zego-express-engine-webrtc
Version:
zego webrtc express sdk
1 lines • 1.68 MB
JavaScript
!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={477:function(){},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)},757:function(t,i,e){"undefined"!=typeof self&&self,t.exports=function(t,i,e,n){return r=[function(t,i,e){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.8",(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.O=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.O,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.O?null:this.start.next},a.prototype.getLast=function(){return 0===this.O?null:this.end.prev},a.prototype.size=function(){return this.O},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.O-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.O,t},a.prototype.removeFirst=function(){return 0<this.O&&this.start.next?this.remove(this.start.next):null},a.prototype.removeLast=function(){return 0<this.O&&this.end.prev?this.remove(this.end.prev):null},a.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this.O=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.O?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){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(17));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._=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){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){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){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){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(31)),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){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){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){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){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(18);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){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.L()||(this.J(this.spanId),this.endCallback&&this.endCallback(this.spanInfo))},r.prototype.L=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.J=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){function n(t){this.q=t=void 0===t?"":t,this.count=0,this.isStarting=!1,this.timer=0,this.lastLogTime=0,this.speed=0,this.lastTime=0}Object.defineProperty(i,"u",{value:!0}),i.SpeedUtil=void 0,n.prototype.add=function(t){this.isStarting&&(this.count+=t)},n.prototype.stop=function(){return this.isStarting=!1,this.reset()},n.prototype.start=function(t){var i=this;void 0===t&&(t=0),this.isStarting=!0,this.count=0,clearInterval(this.timer),t&&(this.timer=window.setInterval(function(){i.speed=i.count/t,i.count=0},t))},n.prototype.reset=function(){this.count=0,clearInterval(this.timer),this.timer=0,this.speed=0},i.SpeedUtil=n},function(t,i,e){Object.defineProperty(i,"u",{value:!0}),i.createZegoStore=i.ZegoWechatMiniStore=i.ZEGO_ENV=void 0;var n,s,r=e(13),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){Object.defineProperty(i,"u",{value:!0}),i.DynamicCode=i.ZegoTracer=i.ZegoSpan=void 0;var n=e(15),s=(Object.defineProperty(i,"ZegoTracer",{enumerable:!0,get:function(){return n.ZegoTracer}}),e(46)),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){Object.defineProperty(i,"u",{value:!0}),i.ZegoTracer=void 0;var n=e(16),s=e(22),r=e(10),o=e(23),u=e(3),a=e(1),c=e(8),h=e(24),f=e(39),l=e(12),d=e(44),v=e(45);function m(t){this.C=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,"boolean"==typeof t.keepLive&&(this.stateCenter.keepLive=t.keepLive),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.F(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.F=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.W.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()},m.prototype.getUnloadStatus=function(){return{uploadSpeed:this.reporter.uploadSpeed,increaseSpeed:this.reporter.speed,unreportLength:this.reporter.unreportDataByteLen}},m.prototype.reportSize=function(){return this.reporter.traceType.MEM_I_API},i.ZegoTracer=m},function(t,i,e){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(19),h=e(20);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=((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){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.X=!1,this.M=r.ROOT_CONTEXT}o.prototype.K=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.K(t,i):t},o.prototype.disable=function(){return this.M=r.ROOT_CONTEXT,this.X=!1,this},o.prototype.enable=function(){return this.X||(this.X=!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){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()).slice(-3)].join("")}},function(t,i,e){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){Object.defineProperty(i,"u",{value:!0}),i.mergeConfig=void 0;var n=e(21);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){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){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.G=t}s.prototype.context=function(){return this.G},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){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){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(25),f=e(30),l=e(38),d=e(5),v=e(4),m=e(11);function p(t,i){this.H=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,this.Y=new m.SpeedUtil("tracer increase"),null!=(i=this.Y)&&i.start(3e3)}Object.defineProperty(p.prototype,"speed",{get:function(){return this.Y.speed},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"uploadSpeed",{get:function(){return this.zegoService.speed},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"unreportDataByteLen",{get:function(){return this.traceType.MEM_I_API+this.traceType.MEM_I_LOAD-this.traceType.MEM_O_DONE-this.traceType.MEM_O_DUMP},enumerable:!1,configurable:!0}),p.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.V(),this.zegoService=new h.ZegoService(this.config.env||c.ZEGO_ENV.BROWSER,this.config.bps||v.DEFAULT_CONFIG.bps,this.product,this.pro,this.H),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.Z.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.H.logger.warn("zt.zd.i fail"),this.postDataState="fail",this.dropCount++,this.$(t),[4,this.tt(1)];case 1:return i.sent(),this.it("postFail"),[2]}})})}),this.nt(),this.storeHandler=new f.ZegoStoreHandler(this.product+"_"+this.config.appID+"_datareporter",d.uuid(6),this.config,this.traceType,this.staticConfig,this.H,this.product),this.storeHandler.setDropCallBack(function(t){i.traceType.DB_O_DROP+=d.calculateMemSize(t),i.it("dataDroped",t)}),[4,this.storeHandler.loadPendingData()];case 1:return e.sent(),this.storeHandler.init().then(function(){i.rt()}).catch(function(t){console.warn(t)}),this.et(),this.st(),this.ut(),[2]}})})},p.prototype.uninit=function(){this.isWaitNtpTimeout=!1,this.ntpTimer&&(clearTimeout(this.ntpTimer),this.ntpTimer=null),this.Y.stop(),this.zegoService.destroy()},p.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))},p.prototype.pause=function(){this.isPaused=!0},p.prototype.resume=function(){this.isPaused=!1;var t=this.pendingQueue.getPendingDataInfo();this.ot(t.pendingDataSize,t.size)},p.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.ht()&&this.ct(),(i=t.get("serverUrl"))&&(this.config.serverUrl=i,this.zegoService.setLogServer(this.config.serverUrl)),this.isConfigOK(this.config)&&(t=(e=this.pendingQueue.getPendingDataInfo()).pendingDataSize,this.ot(t,e.size)),0))},p.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.ct()},p.prototype.setProcessData=function(t){this.H.processData=t},p.prototype.on=function(t,i){return this.ft(t,i)},p.prototype.off=function(t,i){return this.lt(t,i)},p.prototype.report=function(t,i){var e;if(15e3<t.length)return!1;try{e=JSON.parse(t)}catch(t){return!1}return this.H.W.debug(t+" "+i),(null!=e&&e.id_name||null!=(t=null==e?void 0:e.tags)&&t.id_name||this.config.userID)&&this.ht()?(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.vt(JSON.stringify(e),i)):this.tempBuffer.push({data:e,level:i}),!0},p.prototype.setUnloadState=function(t){this.unloadLevel=t,this.state="unload"},p.prototype.vt=function(t,i){var e=this,n=d.calculateMemSize(t),s=(this.traceType.MEM_I_API+=n,this.Y.add(8*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.H.W.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)},p.prototype.ht=function(){return this.isWaitNtpTimeout||void 0!==this.clientTimeOffset},p.prototype.ct=function(){var t,i=this.tempBuffer.shift();i&&(t=i.data,i=i.level,t.tags.id_name=this.config.userID,this.vt(JSON.stringify(t),i),this.ct())},p.prototype.isConfigOK=function(t){return""!==t.userID&&""!==t.token&&""!==t.server},p.prototype.testSize=function(t){},p.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,0<(i=(t=this.pendingQueue.getPendingDataInfo()).pendingDataSize)?this.ot(i,t.size):this.rt())},p.prototype.setWaitNtpTimeout=function(t){this.waitNtpTimeout=t},p.prototype.st=function(){var t=this;this.ntpTimer=setTimeout(function(){t.isWaitNtpTimeout=!0,t.config.userID&&t.ct()},this.waitNtpTimeout)},p.prototype.et=function(){var t=this,i=(this.H.W.debug("startReportTimer "+new Date),this.timeInterval=!0,this.pendingQueue.getPendingDataInfo());this.ot(i.pendingDataSize,i.size),this.reportTimer=window.setTimeout(function(){t.et()},3e4)},p.prototype.ut=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.ot(t,i)]:[3,2];case 1:return n.sent(),[3,3];case 2:this.rt(),n.label=3;case 3:return this.checkDataTimer=window.setTimeout(function(){e.ut()},15e3),[2]}})})},p.prototype.V=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()})},p.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)},p.prototype.setNetStateCheck=function(){"fail"===this.postDataState&&this.zegoService.handleNetConnect()},p.prototype.Z=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.H.W.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.ot(o,u)]:[3,2];case 1:return r.sent(),[3,3];case 2:this.rt(),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.it("progressUpdate",u),0<this.storeHandler.storeSize)&&this.rt(function(t){0===t&&(a.state="normal",a.zegoService.setBps(a.config.bps||v.DEFAULT_CONFIG.bps),a.listenerList.forceSuccessCallback)&&a.it("forceResult","SUCCESS")}),[2]}})})},p.prototype.ot=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.H.W.debug("isPaused "+this.isPaused+" "+this.userID+" "+this.config.token+" "+this.config.serverUrl),t>=this.cacheMaxSize||this.staticConfig.totalAvailCache<=0?[4,this.tt(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.tt(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.dt(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]}})})},p.prototype.nt=function(){var t=this;this.pendingQueue=new l.PendingQueue(this.config.levels,this.product,this.staticConfig,this.H),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.ot(n,e)];case 1:return t.sent(),[2]}})})}})},p.prototype.yt=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){})},p.prototype.tt=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.wt(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]}})})},p.prototype.$=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){})})},p.prototype.wt=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]}})})})},p.prototype.rt=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}))},p.prototype.dt=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}},p.prototype.ft=function(t,i){return!!this.listenerList[t]&&"function"==typeof i&&(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0)},p.prototype.lt=function(t,i){var e;return!!this.listenerList[t]&&(e=this.listenerList[t],i?e.splice(e.indexOf(i),1):this.listenerList[t]=[],!0)},p.prototype.it=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=p},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=(Object.defineProperty(i,"u",{value:!0}),i.ZegoService=void 0,e(0)),o=e(26),u=e(29),a=e(4);function c(t,i,e,n,s){var u,a,c,h=this;this.bt=t,this.gt=e,this.Ot=n,this.H=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._t=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.St=(a=u=0,c=function(){a=u=0},{onOpen:function(){u=performance.now()},onClose:function(){0<u&&(performance.now()-u<100?(a++,h.H.logger.info("zt.rzs.wfsc frequently shutdown.")):c())},isOutOfMaxTimes:function(){return 10<=a}}),this.Mt={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.H.logger.warn("zt.rzs.ohbto hb timeout."),h.socketReconnect(!0,!0)},this.setBps(i),this.reportQueue=new r.Queue}Object.defineProperty(c.prototype,"speed",{get:function(){return this.service.speed},enumerable:!1,configurable:!0}),c.prototype.destroy=function(){this.Et(),this.logUploadTimer&&clearTimeout(this.logUploadTimer),this.reportQueue.clear(),window.removeEventListener("offline",this.Mt.offline),window.removeEventListener("online",this.Mt.online),this.isDestroy=!0},c.prototype.bindWindowListener=function(){window.addEventListener("offline",this.Mt.offline),window.addEventListener("online",this.Mt.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.jt(t)):t.startsWith("https:")||t.startsWith("http:")?(this.logType=2,this.Tt(t)):this.logType=0,!0}catch(t){return!1}},c.prototype.setLogUrlParams=function(t){this.logParams=t},c.prototype.jt=function(t){var i,e=this;this.url!=t&&(this.url=t)&&(this.Et(),this.logParams.id_name)&&(this.St.isOutOfMaxTimes()?(this.H.logger.warn("zt.rzs.owsls frequently shutdown too many times. cannot create socket anymore."),this.state=0):(this.state=1,i=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(i),this.H.logger.info("zt.rzs.owsls socket start "+t),this.service.openHandler(function(){e.service.onPush(),e.service.startCheck(),e.H.logger.info("zt.rzs.owsls socket open"),e.openHandler(),e.St.onOpen()}),this.service.closeHandler(function(t){e.H.logger.warn("zt.rzs.owsls socket close "+JSON.stringify(t.code||t)),e.state=0,e.service.closeSocket(),e.St.onClose(),e.service.url&&e.H.keepLive&&e.socketReconnect(!1)}),this.service.errorHandler(function(t){e.H.logger.warn("zt.rzs.owsls socket error "+JSON.stringify(t.code||t)),e.state=0,e.service.closeSocket(),e.service.url&&e.H.keepLive&&e.socketReconnect(!1)})))},c.prototype.Et=function(){this.service.closeSocket(!0),this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)},c.prototype.Tt=function(t){(this.url=t)&&this.At()},c.prototype.At=function(){this.logUploadTimer&&(clearInterval(this.logUploadTimer),this.logUploadTimer=null)},c.prototype.Rt=function(t,i,e,n){this.bt===r.ZEGO_ENV.BROWSER?this.It(t,i,e,n):this.SendHttpsLogWeChatMini(t,i,e,n)},c.prototype.It=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.Tt(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.Tt(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.kt=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.kt()?(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.Rt(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().reportDatas;t.push.apply(t,s(n))}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.Nt&&!t||n&&(t&&this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0),this.Nt||(this.Nt=setTimeout(function(){var t;!e.isDestroy&&(e.Nt&&(clearTimeout(e.Nt),e.Nt=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){Object.defineProperty(i,"u",{value:!0}),i.LogService=void 0;var n=e(27),s=e(4),r=e(0);function o(t,i,e,s){this.bt=t,this.gt=i,this.Ot=e,this.H=s,this.Dt=new n.ZegoSocketService(this.bt,this.gt,this.Ot,this.H),this.xt=0,this.Pt={},this.Bt=void 0,this.checkHbTimer=void 0}Object.defineProperty(o.prototype,"url",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"speed",{get:function(){return this.Dt.speed},enumerable:!1,configurable:!0}),o.prototype.zt=function(t){var i,e,n=this,s=this.Dt.sendCommandMap[t.messageId||(null==(s=null==t?void 0:t.data)?void 0:s.message_id)];null!=s&&(e=s.v,delete this.Dt.sendCommandMap[t.messageId||(null==(i=null==t?void 0:t.data)?void 0:i.message_id)],this.Dt.sendCommandList.remove(s),0===t.code?setTimeout(function(){e&&null!=e.success&&e.success(t,n.xt)},0):setTimeout(function(){e&&null!=e.error&&e.error(t,n.xt)},0))},o.prototype.onPush=function(){var t=this;this.Dt.onMessage=function(i){t.H.keepLive&&(t.Bt=performance.now(),t.startHbTimer()),t.zt(i)}},o.prototype.closeHandler=function(t){this.Dt.closeHandler(function(i){t(i)})},o.prototype.openHandler=function(t){var i=this;this.Dt.openHandler(function(){i.H.keepLive&&(i.Bt=performance.now(),i.startHbTimer()),t&&t()})},o.prototype.errorHandler=function(t){this.Dt.errorHandler(function(i){t(i)})},o.prototype.Lt=function(t){return{Protocol:"req",cmd:t,appid:123,seq:++this.xt,session_id:""}},o.prototype.startCheck=function(){this.Dt.startCheck()},o.prototype.stopCheck=function(){this.Dt.stopCheck()},o.prototype.isDisConnect=function(){return!this.Dt||this.Dt.isDisConnect()},o.prototype.createSocket=function(t){this.Dt.createSocket(t),this.Pt={},this.Ut=t},o.prototype.closeSocket=function(t){void 0===t&&(t=!1),this.Bt=void 0,this.clearHbTimer(),this.Dt.closeSocket(),t&&(this.Ut=void 0)},o.prototype.sendMessage=function(t,i,e,n,o){return this.Dt.isDisConnect()?(n&&n(r.SOCKET_DISCONNECT),0):(o=o||this.Lt(t),this.Dt.sendMessage(o,i,e,n,{timeOut:1e3*s.DEFAULT_CONFIG.netTimeout}))},o.prototype.on=function(t,i){this.Pt[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.Dt.isDisConnect()||(void 0!==this.Bt&&15e3<performance.now()-this.Bt?this.Ut&&this.onHbTimeout():this.checkHbTimer=setTimeout(function(){t.Dt.isDisConnect()||(t.sendMessage("report",[]),t.startHbTimer())},5e3))},o.prototype.onHbTimeout=function(){},i.LogService=o},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=(Object.defineProperty(i,"u",{value:!0}),i.ZegoSocketService=void 0,e(28)),r=e(0),o=e(11);function u(t,i,e,n){this.gt=i,this.Ot=e,this.H=n,this.Jt=null,this.sendCommandList=new r.LinkedList,this.sendCommandMap={},this.qt=100,this.Ct=3e4,this.Ft=2e3,this.Mt={},this.ENV=t,this.Y=new o.SpeedUtil("tracer upload")}Object.defineProperty(u.prototype,"speed",{get:function(){return this.Y.speed},enumerable:!1,configurable:!0}),u.prototype.createSocket=function(t){var i=this;this.Jt=s.createZegoWebSocket(t,this.ENV,this.H.proxyCtrl),this.Jt.onclose=function(t){i.Mt.close&&i.Mt.close(t)},this.Jt.onerror=function(t){i.Mt.error&&i.Mt.error(t)},this.Jt.binaryType="arraybuffer",this.Y.start(3e3)},u.prototype.closeSocket=function(){this.Jt&&(this.Jt.onclose=null,this.Jt.onerror=null,this.Jt.close(),this.Jt=null,this.Y.stop())},u.prototype.isDisConnect=function(){return!this.Jt||1!==this.Jt.readyState},u.prototype.sendMessage=function(t,i,e,s,r){void 0===r&&(r={timeOut:6e3});var o=n(n({},this.H.processData),{time_upload:Date.now()});return o={data:i={message_id:t.seq,product:this.gt,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.Jt&&"pb"!==this.Ot&&(e=JSON.stringify(i),this.H.W.debug("zt.zss.sm upload data: "+e),s=this.H.deflate(e),this.Y.add(8*e.length),this.Jt.send(s)),t.seq},u.prototype.Wt=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()},u.prototype.Xt=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.Ct<n)&&e&&e.v&&e.v.error&&e.v.error(r.errorList.TIMEOUT,e.v.data.message_id,e.v.data.s),++s>=this.qt));)e=t.getFirst()},u.prototype.startCheck=function(){var t=this;this.Xt(this.sendCommandList,this.sendCommandMap),this.Kt=setTimeout(function(){t.startCheck()},this.Ft)},u.prototype.stopCheck=function(){this.Wt(this.sendCommandList),clearTimeout(this.Kt)},u.prototype.openHandler=function(t){var i=this;this.Jt&&(this.Jt.onopen=function(e){i.responseHandler(),t(e)})},u.prototype.responseHandler=function(){var t=this;this.Jt&&(this.Jt.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)})},u.prototype.closeHandler=function(t){this.Mt.close=t},u.prototype.errorHandler=function(t){this.Mt.error=t},u.prototype.onMessage=function(t){},i.ZegoSocketService=u},function(t,i,e){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.Gt&&(this.readyState=0,this.Gt.onOpen(function(i){t.readyState=t.Gt.readyState,"function"==typeof t.onopen&&(t.onopen(i),t.Gt.onClose(function(i){t.readyState=t.Gt.readyState,"function"==typeof t.onclose&&t.onclose(i)}),t.Gt.onMessage(function(i){"function"==typeof t.onmessage&&t.onmessage(i)}))}),this.Gt.onError(function(i){t.readyState=t.Gt.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.Gt&&this.Gt.send({data:t})},r.prototype.close=function(){this.Gt&&this.Gt.close()},r);function r(t,i){this.url=t,this.readyState=3,this.Gt=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){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){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(12)),u=e(5),a=e(4),c=r(e(13));function h(t,i,e,n,s,r,u){this._=t,this.Ht=i,this.Yt=e,this.Vt=n,this.Zt=s,this.H=r,this.gt=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,"Qt",{get:function(){return"z_t_"+this.gt+"_"+this.Yt.appID},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"$t",{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._+this.interSymbol+this.Ht)];case 2:return(t=e.sent())?[3,4]:[4,this.commonStore.setItem(this._+this.interSymbol+this.Ht,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.$t)||"").split(";");this.transStores=i.filter(function(i){return i.includes(t.Yt.appID+"")&&i.includes(t.gt)}),i=i.filter(function(i){return!i.includes(t.Yt.appID+"")||!i.includes(t.gt)}),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.$t,this.storesKeys+(0<this.storesKeys.length?";":"")+this._+this.interSymbol+this.Ht),[4,this.commonStore.setItem(this._+this.interSymbol+this.Ht,{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._+e.interSymbol+e.Ht?[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.Yt.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)+"_"+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.Zt.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.Zt.totalDBSize-=o,[4,this.ti()];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.Zt.totalDBSize+=h,this.storeSize-=h,[4,this.ti()];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.ti()];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;return s(this,function(s){switch(s.label){case 0:i=(i=t.level)+"_"+t.timestamp+"_"+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.Yt.env?JSON.parse(n):n),o=u.calculateMemSize(i)+o,this.storeSize-=o,this.Zt.totalDBSize+=o,this.Vt.DB_O_DONE+=o,[4,this.ti()];case 4:s.sent(),e(),s.label=5;case 5:return[3,7];case 6:return o=s.sent(),r(o),[3,7];case 7:return[2]}})})})},h.prototype.ti=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._+this.interSymbol+this.Ht)];case 1:return t.sent()?[4,this.commonStore.setItem(this._+this.interSymbol+this.Ht,{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.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.H.W.debug("storage set err")}},h.prototype.getStorage=function(t){try{return localStorage.getItem(t)}catch(t){this.H.W.debug("storage get err")}},h.prototype.saveDataToStorage=function(t){try{this.saveStorage(this.Qt+"_"+t.level+"_"+t.timestamp+"_"+t.seq,t.content)}catch(t){this.H.W.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.H.W.debug("transportStorageData "+o),null!=o&&o.startsWith(this.Qt)&&(s=o.replace(this.Qt+"_",""),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){var n=e(32),s=e(33).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=(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){(function(t){var n=e(35),s=e(36),r=e(37);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(o()<=t)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((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:(()=>{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.ii=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.ni)},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.ni=!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(((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((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(34))},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){i.byteLength=function(t){return 3*((t=c(t))[0]+(t=t[1]))/4-t},i.toByteArray=function(t){for(var i,e=c(t),n=e[0],o=new r(3*(n+(e=e[1]))/4-e),u=0,a=0<e?n-4:n,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===e&&(i=s[t.charCodeAt(h)]<<2|s[t.charCodeAt(h+1)]>>4,o[u++]=255&i),1===e&&(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(((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){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.ri=t,this.gt=i,this.Zt=e,this.H=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.Zt.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.Zt.totalAvailCache+=t},u.prototype.reset=function(){this.byteLength=0},i.PendingQueue=u},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=(Object.defineProperty(i,"u",{value:!0}),i.loadJS=void 0,e(40));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){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(41))),r=n(e(42)),o=n(e(43));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){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){function n(t){this.keepLive=!0,this.logger=t,this.W=t}Object.defineProperty(i,"u",{value:!0}),i.StateCenter=void 0,n.prototype.isLogin=function(){return!0},i.StateCenter=n},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=(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=14);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))},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)},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))}})))},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:()=>pi,NetAgentPCRequest:()=>ci,ZegoConnectionAgent:()=>Ei}),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),A=s(788);const P=s(994);(A=A.default||A).util.Long=P.default||P,A.util.Long.fromBits=A.util.Long.fromBits||function(){return 0};for(var M=A.roots,x=A.types?A.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=A.types?A.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]]=A.Reader.prototype[L[B]],U[L[B]]=A.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]]=A.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)?A.util.emptyArray:"bytes"===a?A.util.newBuffer([]):u[2]&&u[2].hasOwnProperty("low")&&u[2].hasOwnProperty("high")?A.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 A.Reader||(t=A.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]===A.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=A.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){A.rpc.Service.call(this,t,i,e)}return(n.prototype=Object.create(A.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],9:["log_config","zego_connection.proto_initconfig.LogConfig",null]}},LogConfig:{$m:{1:["ws_log","int32",0]}},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"),At=new TextEncoder,Pt=function(t){return At.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 qt(t){return(null==t?void 0:t.includes("https"))?1:3}!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 Ut,Bt={code:1100002,msg:"network timeout."},Jt={code:1100004,msg:"net agent timeout"},Vt={code:1100006,msg:"net connect timeout"},Ht={code:1100007,msg:"the user breaks the network connection"},Gt=1100009,Ft=1100011,Yt={code:1100012,msg:"the socket is idle"};!function(t){t[t.BROWSER=0]="BROWSER",t[t.WEIXINMINI=1]="WEIXINMINI"}(Ut||(Ut={}));var Zt=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}(),Qt=function(){function t(t){void 0===t&&(t=""),this.st=t,this.count=0,this.isStarting=!1,this.timer=0,this.lastLogTime=0,this.speed=0,this.lastTime=0}return t.prototype.add=function(t){this.isStarting&&(this.count+=t)},t.prototype.stop=function(){return this.isStarting=!1,this.reset()},t.prototype.start=function(t){var i=this;void 0===t&&(t=0),this.isStarting=!0,this.count=0,clearInterval(this.timer),t&&(this.timer=window.setInterval(function(){i.speed=i.count/t,i.count=0},t))},t.prototype.reset=function(){this.count=0,clearInterval(this.timer),this.timer=0,this.speed=0},t}(),Xt=function(){function t(){this.ot={}}return t.prototype.addEventHandler=function(t,i){if(this.ot[t]||(this.ot[t]=[]),"function"!=typeof i)throw new Error("Params callBack is not a Function");return this.ot[t]&&-1==this.ot[t].indexOf(i)&&this.ot[t].push(i),!0},t.prototype.removeEventHandler=function(t,i){return!!this.ot[t]&&(this.ot[t]=i?this.ot[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.ot[t]&&this.ot[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}(),Wt=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())})},Kt=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 $t=function(){function t(t){this.rt=t,this.readyState=h.CLOSED,this.ct=null,this.ut=[],this.ht=[],this.ft={}}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.ut.find(function(i){return i.streamID===t})||null},t.prototype.startConnect=function(t){var i=this;try{this.ct=new WebTransport(t),this.readyState=h.CONNECTING,this.ct.ready.then(function(t){i.readyState=h.OPEN,i.onopen(t),i.onTransportClosed()}).catch(function(t){i.readyState=h.CLOSED,i._t(H.LinkFailed,t),i.close()})}catch(t){this.readyState=h.CLOSED,this._t(H.NotSupport,t)}},t.prototype.onTransportClosed=function(){return Wt(this,void 0,void 0,function(){var t;return Kt(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.ct.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.ct=null,this.ut=[],this.ht=[],this.ft={},[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._t=function(t,i){this.ct&&this.onBackToWebSocket(t,i)},t.prototype.send=function(t,i,e,n){var s;return Wt(this,void 0,void 0,function(){var r,o=this;return Kt(this,function(u){switch(u.label){case 0:return this.ct&&i?(null==(r=this.getStreamByID(i))?void 0:r.stream)?[3,2]:(null==r?void 0:r.isCreating)?(this.ht.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.ht=o.ht.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.rt.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.rt.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._t(H.WriteDataFailed,t),o.close())})}catch(t){this._t(H.WriteDataFailed,t),this.close()}return[2]}})})},t.prototype.close=function(){return Wt(this,void 0,void 0,function(){var t,i,e=this;return Kt(this,function(n){return this.readyState=h.CLOSED,this.ct&&(t=Object.values(this.ft),i=function(){var t;null===(t=e.ct)||void 0===t||t.close(),e.ct=null,e.ft={}},t.length>0?Promise.all(t).then(function(){i()}).catch(function(t){i()}):i()),this.ut=[],this.ht=[],[2]})})},t.prototype.createStream=function(t,i){return Wt(this,void 0,void 0,function(){var e,n,s;return Kt(this,function(r){switch(r.label){case 0:if(!this.ct)return[2,null];(e=this.getStreamByID(i))||this.ut.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.ct.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._t(H.CreateStreamFailed,s),this.close(),[3,4];case 4:return[2,null]}})})},t.prototype.closeStream=function(t){var i;return Wt(this,void 0,void 0,function(){var e,n;return Kt(this,function(s){switch(s.label){case 0:if(e=this.getStreamByID(t),this.ut=this.ut.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.ft[t]=n,[4,n];case 2:return s.sent(),delete this.ft[t],[3,4];case 3:return s.sent(),[3,4];case 4:return[2]}})})},t.prototype.initReader=function(t,i){var e,n;return Wt(this,void 0,void 0,function(){var s,r,o,u,a;return Kt(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.rt.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.ut=this.ut.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.rt.warn("zn.zwt.rd error ".concat(null==a?void 0:a.message)),this._t(H.ReadDataFailed,a),this.close()),[2]);case 4:return[3,0];case 5:return[2]}})})},t}();var ti,ii=function(){function t(t,i,e){this.lt=t,this.rt=i,this.proxyCtrl=e,this.dt=null,this.server="",this.type=c.WebSocket,this.vt=null,this.retryTimer=null,this.ENV=t.env,this.eventManager=new Xt,this.Et=new Qt("connection send")}return Object.defineProperty(t.prototype,"speed",{get:function(){return this.Et.speed},enumerable:!1,configurable:!0}),t.prototype.createSocket=function(t,i,e){var n=this;this.rt.info("zn.nss.0 ".concat(t," ").concat(e)),this.server=t,this.type=i,this.type===c.WebTransport?(this.dt=new $t(this.rt),this.dt.onBackToWebSocket=function(t,i){n.type===c.WebTransport&&(n.resetConnectTimer(),n.onBackToWebSocket&&n.onBackToWebSocket(t,i))},this.dt.startConnect(t)):(this.type=c.WebSocket,this.dt=function(t,i,e){return i%2===Ut.BROWSER?function(t,i){return i?i.createSocket(t,0):new WebSocket(t)}(t,e):new Zt(t)}(t,this.ENV%2,this.proxyCtrl)),this.bindSocketHandler(),this.startConnectCheck(e)},t.prototype.bindSocketHandler=function(){var t=this;this.dt&&(this.dt.onopen=function(i){var e;t.type===c.WebSocket&&(t.dt.binaryType="arraybuffer"),t.responseHandler(),t.resetConnectTimer(),null===(e=t.Et)||void 0===e||e.start(3e3),t.eventManager.emit("open",i)},this.dt.onclose=function(i){var e;t.resetConnectTimer(),null===(e=t.Et)||void 0===e||e.stop(),t.eventManager.emit("close",i)},this.dt.onerror=function(i){t.resetConnectTimer(),t.eventManager.emit("error",i)})},t.prototype.startConnectCheck=function(t){var i=this;this.resetConnectTimer(),this.vt=setTimeout(function(){i.type===c.WebTransport&&i.lt.networkState===f.online?(i.resetConnectTimer(),i.onBackToWebSocket&&i.onBackToWebSocket(H.LinkTimeout,{message:"connect timeout"})):i.eventManager.emit("timeout")},t)},t.prototype.resetConnectTimer=function(){this.vt&&(clearTimeout(this.vt),this.vt=null)},t.prototype.responseHandler=function(){var t=this;this.dt&&(this.dt.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(){var t;this.dt&&(this.dt.onclose=null,this.dt.onerror=null,this.dt.close(),this.dt=null,null===(t=this.Et)||void 0===t||t.stop()),this.resetConnectTimer()},t.prototype.isNotConnected=function(){return!this.dt||this.dt.readyState!==h.OPEN},t.prototype.sendMessage=function(t,i,e,n){this.isNotConnected()||this.dt&&(this.Et.add(8*t.byteLength),this.dt.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.dt)||void 0===i||i.closeStream(t))},t.prototype.hasStream=function(t){var i,e;return this.type===c.WebTransport&&!!(null===(e=null===(i=this.dt)||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}(),ei=function(){function t(t,i,e){this.lt=t,this.gt=i,this.proxyCtrl=e,this.ipStackRules=[],this.St=null,this.Tt=u.noProbe,this.Ct=2}return Object.defineProperty(t.prototype,"bt",{get:function(){var t=this.lt.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.lt.customConfig.ipStackMode===i.IPv4Prefer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ot",{get:function(){return this.lt.logger},enumerable:!1,configurable:!0}),t.prototype.createSockets=function(t,i){var e=this;this.Ot.info("".concat(bt," call ").concat(JSON.stringify(t)," ").concat(JSON.stringify(i))),this.Tt=u.noProbe;var s=this.lt.isIpStackDetected?1e4:Rt;this.Ot.info("".concat(bt," interval ").concat(s)),(null==t?void 0:t.server)&&(this.Rt=t,this.At||(this.At=new ii(this.lt,this.Ot,this.proxyCtrl)),this.bindServiceHandler(this.At,this.Rt),this.At.createSocket(t.server,t.linkType,s)),(null==i?void 0:i.server)?(this.Pt=i,this.It||(this.It=new ii(this.lt,this.Ot,this.proxyCtrl)),this.Ot.info("".concat(yt," bypass time ").concat(this.bt)),this.St=setTimeout(function(){e.bindServiceHandler(e.It,e.Pt),e.It.createSocket(i.server,i.linkType,Rt)},this.bt)):this.onIPStackDetection({ipStackType:this.Rt.ipStackType===n.IPv4?n.IPv6:n.IPv4,detection:o.unreachable}),this.Tt=u.probing},t.prototype.bindServiceHandler=function(t,i){var s=this;this.Ot.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.Ot.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.lt.retryLevel===R.single&&s.Rt.svrConnectState===a.success)s.Ot.info("".concat(_t," only retry once"));else if(s.gt.Nt==u.probing&&i.tryCount<s.Ct)return s.Ot.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)===Vt.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.Ot.info("".concat(_t," ").concat(i.server," open ").concat(u[s.Tt])),i.svrConnectState=a.success,r(o.reachable),s.Tt===u.probing?(s.Tt=u.probed,s.removeServiceListener(t),s.onSocketOpen&&s.onSocketOpen(t,i)):s.onNextSocketOpen&&s.onNextSocketOpen(t,i),s.lt.customConfig.probeByPassStrategy===e.Default&&s.isIpv4Prefer&&i.ipStackType===n.IPv4&&s.St&&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",Vt)}),t.onBackToWebSocket=function(e,n){if(s.lt.networkState===f.online){var r={message:n.message||""};s.Ot.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.Rt)||void 0===t?void 0:t.svrConnectState)&&[a.fail,a.timeout].includes(this.Rt.svrConnectState)&&(!this.Pt||void 0!==(null===(i=this.Pt)||void 0===i?void 0:i.svrConnectState)&&[a.fail,a.timeout].includes(this.Pt.svrConnectState))&&(this.Ot.info("".concat(yt," sockets fail")),this.onSocketsFail&&this.onSocketsFail())},t.prototype.checkIfBackToWss=function(){var t,i,e,n,s,r,o,u;this.Rt&&this.Rt.backToWss&&(this.onSocketBackToWebSocket&&this.onSocketBackToWebSocket(this.Rt,(null===(i=null===(t=this.Rt)||void 0===t?void 0:t.backToWssInfo)||void 0===i?void 0:i.reason)||H.Unknown,(null===(n=null===(e=this.Rt)||void 0===e?void 0:e.backToWssInfo)||void 0===n?void 0:n.error)||{}),this.Pt&&this.Pt.backToWss&&this.onSocketBackToWebSocket&&this.onSocketBackToWebSocket(this.Pt,(null===(r=null===(s=this.Pt)||void 0===s?void 0:s.backToWssInfo)||void 0===r?void 0:r.reason)||H.Unknown,(null===(u=null===(o=this.Pt)||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.Tt==u.probing&&this.destroySockets()},t.prototype.destroySockets=function(){var t;this.Ot.info("".concat("zn.sm.ds.0"," call")),this.At&&(this.removeServiceListener(this.At),this.At.closeSocket()),this.It&&(this.removeServiceListener(this.It),null===(t=this.It)||void 0===t||t.closeSocket()),this.clearByPassProbe()},t.prototype.clearByPassProbe=function(){this.St&&(clearTimeout(this.St),this.St=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}(),ni=function(){return ni=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},ni.apply(this,arguments)},si=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))},ri=function(){function i(t,i,e){var s,r=this;this.Dt=t,this.lt=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.Nt=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.yt=100,this.wt=15e3,this.zt=1e3,this.Mt=5e3,this.connectInterval=1e4,this.connectRsp={},this.unlogTypes=[12,13],this.tryServers=[],this.connectStartTime=0,this.isTestedWebTransport=((s={})[n.IPv4]=!1,s[n.IPv6]=!1,s),this.msgCache={},this.Ht=0,this.bt=500,this.Ut="",this.Gt=function(){var t,i;r.Ot.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.Ht)),r.socketService&&r.connectServer!==(null===(i=r.socketService)||void 0===i?void 0:i.server)&&(r.connectServer=r.socketService.server,r.tryServers.pop(),r.tryServers.push(r.connectServer)),2!==r.netLinkState&&r.kt()},this.Vt=function(t){r.closeCallback("close",t)},this.Bt=function(t){r.closeCallback("error",t)},this.Yt=function(){var t;r.Ot.info(at+" timeout"),r.Lt(1,r.connectServer,Vt.code),null===(t=r.$t)||void 0===t||t.call(r,!0,{code:Vt.code,msg:""}),r.netLinkState=0,r.connectRsp.fail&&r.connectRsp.fail()},this.onUpdateMsgTimeChanged=void 0,this.updatedMsgTime=Date.now(),this.socketDetectManager=new ei(this.lt,this,this.proxyCtrl),this.socketDetectManager.onSocketOpen=function(t,i){r.Ot.info("".concat(pt," main server ").concat(i.server," open socket")),r.socketService=t,r.setIPStackDetectedInfo(i),r.bindSocketServiceEvent(),r.Gt()},this.socketDetectManager.onIPStackDetection=function(t){r.Ot.info("".concat(pt," ip stack detection ").concat(JSON.stringify(t))),r.xt(t)},this.socketDetectManager.onNextSocketOpen=function(t,i){r.Ot.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.Ot.info("".concat(pt," backToWss reason: ").concat(i,", error: ").concat(s.message)),r.lt.enableHttp3){var o=t.server,u=t.ipStackType,a=r.jt(u),c=jt(a,r.lt.env,r.lt.appID);if(r.Ot.info("".concat(pt," backToWss server: ").concat(o," stack: ").concat(u)),r.lt.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.Ot.info("".concat(pt," backToWss http3 fail")),Lt(a,r.lt.env,r.lt.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.Lt(1,r.connectServer,Ft,i,s),r._t&&r._t(i,s)}},this.socketDetectManager.onSocketsFail=function(){r.Ot.info("".concat(pt," socket fail")),r.Nt=u.noProbe,r.netLinkState=0,r.connectRsp.fail&&r.connectRsp.fail()}}return Object.defineProperty(i.prototype,"linkServerStorageKey",{get:function(){return this.jt(this.lt.currentIpStackType)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"byPassStackType",{get:function(){return this.lt.currentIpStackType===n.IPv4?n.IPv6:n.IPv4},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Ot",{get:function(){return this.lt.logger},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){var t,i;return null!==(i=null===(t=this.socketService)||void 0===t?void 0:t.speed)&&void 0!==i?i:0},enumerable:!1,configurable:!0}),i.prototype.setIPStackDetectedInfo=function(t){this.lt.isIpStackDetected=!0;var i=t.ipStackType;this.lt.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.qt=t},enumerable:!1,configurable:!0}),i.prototype.initEvent=function(t,i,e,n,s,r){this.Ft=t,this.$t=i,this.Jt=e,this.Wt=n,this._t=s,this.Qt=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.Ot.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.Ot.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.Ot.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.Ot.info("".concat(vt," set ipv6")),this.servers=this.serversGroup.wssV6,this.http3Servers=this.serversGroup.http3V6,this.lt.currentIpStackType=n.IPv6):(this.Ot.info("".concat(vt," set ipv4")),this.servers=this.serversGroup.wss,this.http3Servers=this.serversGroup.http3,this.lt.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.Ot.info("zn.wl.ds.0 call "+t),this.closeSocket(),t!==_.NONE&&(i&&this.Lt(1,this.connectServer,null==i?void 0:i.code),this.$t&&this.$t(t===_.BROKEN,i,this.tryServers))},i.prototype.refreshServers=function(t){this.servers=si(si([],t,!0),this.servers,!0)},i.prototype.isEnableHttp3=function(){return!!this.lt.enableHttp3&&!!this.lt.customConfig.enableHttp3&&this.lt.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.Ot.info(at+" call"),!this.servers||!(null===(n=this.servers)||void 0===n?void 0:n.length))return this.Ot.warn(at+" no servers"),!1;this.connectRsp.suc=i;var o=!1;this.connectRsp.fail=function(){e&&(o?r.Ot.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.Lt(0),this.netLinkState=1,this.Ht=Date.now();var a=this.getConnectServers(),c=a.mainSvrInfo,h=a.byPassSvrInfo;return this.Nt===u.noProbe?(this.Ot.info("".concat(at," probe")),this.socketDetectManager.createSockets(c,h),this.Nt=u.probing):(this.Ot.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.Jt&&this.Jt(!0),!0},i.prototype.Lt=function(t,i,e,n,s){},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.Kt(this.servers,this.http3Servers,this.lt.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.Kt(n,e[1],this.byPassStackType,this.byPassUrlIndex,"bypass"))}return{mainSvrInfo:i,byPassSvrInfo:t}},i.prototype.Kt=function(t,i,e,n,s){var r,o="",u=c.WebSocket;return this.Ot.info(at+" "+s+" enableHttp3:"+this.isEnableHttp3()),(r=this.isEnableHttp3()?this.getUseableHttp3Server(i,e):"").length>0&&(u=c.WebTransport,o=r,this.Ot.info("".concat(at," h3 connect ").concat(s," server ").concat(o))),r||(u=c.WebSocket,o=t[n],this.Ot.info("".concat(at," wss connect ").concat(s," server ").concat(o))),{server:o,linkType:u,ipStackType:e,tryCount:0,failTime:0}},i.prototype.xt=function(t){this.Ot.info("".concat(mt," ").concat(JSON.stringify(t)));var i=t.ipStackType,e=t.detection,s=!1;i===n.IPv4?(this.lt.linkIpStackDetection.IPv4!==e&&(s=!0),this.lt.linkIpStackDetection.IPv4=e):i===n.IPv6&&(this.lt.linkIpStackDetection.IPv6!==e&&(s=!0),this.lt.linkIpStackDetection.IPv6=e),s&&(this.Ot.info("".concat(mt," res ").concat(JSON.stringify(this.lt.linkIpStackDetection))),this.Qt(ni({},this.lt.linkIpStackDetection)));var r=this.lt.linkIpStackDetection;this.Nt===u.probing&&r.IPv4!==o.unknown&&r.IPv6!==o.unknown&&(this.Nt=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.Ot.info("".concat(gt," failed:").concat(s," reason:").concat(H.LinkTimeout," time:").concat(Date.now()-n,"ms"));else{var h=new Uint8Array(i),f=e.Dt.decodeResponse(h,r),l=f[2];if(f[1]===d.MSG_TYPE_GET_CONFIG_RESPONSE&&0===l.code){e.Ot.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.lt.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.Qt(ni({},e.lt.linkIpStackDetection)),e.socketDetectManager.removeServiceListener(t),t.off("message"),t.closeSocket()}}catch(t){e.Ot.info("".concat(gt," failed:").concat(s," reason:").concat(H.GetConfigFailed," error:").concat(JSON.stringify(t)," time:").concat(Date.now()-n,"ms"))}});var u=this.Zt(r);null==t||t.sendMessage(u.buf,u.streamID,u.type,b.OTHER)},i.prototype.closeCallback=function(t,i){var e;this.Ot.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.Ot.warn("".concat(n," ").concat(t," ").concat(JSON.stringify(i.code?i.code:i))),this.Xt(i)},i.prototype.Xt=function(t){var i=(null==t?void 0:t.code)||Vt.code;this.Lt(1,this.connectServer,i),this.$t&&this.$t(!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.Gt.bind(this)),this.socketService.on("close",this.Vt.bind(this)),this.socketService.on("error",this.Bt.bind(this)),this.socketService.on("timeout",this.Yt.bind(this)),this.socketService.onBackToWebSocket=function(i,e){var n,s={message:e.message||""};if(t.Ot.info(dt+" call reason:"+i+" error:"+s.message+" h3 "+t.lt.enableHttp3+" service: "+!!t.socketService),t.lt.networkState===f.online)if(s.message.includes("Connection lost"))t.closeCallback("error",s);else{if(!t.lt.enableHttp3)return;if(!t.socketService)return;t.Ot.info(lt+" server ".concat(t.socketService.server," fail")),t.lt.enableHttp3=!1;var r=jt(t.linkServerStorageKey,t.lt.env,t.lt.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.Ot.info(lt+" http3 fail"),Lt(t.linkServerStorageKey,t.lt.env,t.lt.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.Lt(1,t.connectServer,Ft,i,s),t._t&&t._t(i,s)}else t.closeCallback("error",s)}):this.Ot.warn(dt+" no service")},i.prototype.removeSocketServiceEvent=function(){this.Ot.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.Ot.info("zn.wl.rsdt.0 call"),this.socketDetectManager&&this.socketDetectManager.stopTask(),this.closeSocket(),this.netLinkState=0},i.prototype.kt=function(){this.Ot.info("zn.wl.osso.0 call"),this.connectRsp.suc&&this.connectRsp.suc(),this.netLinkState=2,this.Lt(1,this.connectServer,0),this.Ft&&this.Ft(this.tryServers,0),this.tryServers=[],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();return this.Ot.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(),0))},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.Mt),void 0===u.isInSendMap&&(u.isInSendMap=!0),void 0===u.isMsgCache&&(u.isMsgCache=!0),this.txid++;var v={appid:this.lt.appID,biz_type:0,mode_no:this.lt.appInfo.mode,sdk_type:Tt.sdkType,zegoconn_run_env:0===this.lt.env?p.ZEGOCONN_RUN_ENV_BROWSER:p.ZEGOCONN_RUN_ENV_APPLET,zegoconn_version:this.lt.appInfo.connVer};(null===(h=this.lt.appInfo)||void 0===h?void 0:h.deviceID)&&(v.device_id=this.lt.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=ni({id_name:this.lt.userId},n?v:{}),g=ni(ni({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.ti&&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.Ot.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.ii=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.Dt.encodeRequest(t,i,e,this.socketService.type);null===(s=this.socketService)||void 0===s||s.sendMessage(this.ii(o),e,t,n),null===(r=this.qt)||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.Ot.info(ct+" streamID: ".concat(n,", msgType: ").concat(i,"-").concat(N[i])+o)}r&&this.isRspMsg(r)?this.handleSendCommandMsgRsp(i,r,t,{size:e}):this.Wt(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.lt.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.Dt.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.Ot.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.lt.currentIpStackType)&&t.testWebTransport(t.http3Servers,t.lt.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.ni(this.sendCommandList,this.sendCommandMap,this.unSendCommandList,this.unSendCommandMap),this.ti=setTimeout(function(){t.startCheck()},this.zt)},i.prototype.stopCheck=function(){this.ei(this.sendCommandList),this.ti&&(clearTimeout(this.ti),this.ti=null)},i.prototype.ni=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.wt<r);else{var c=u.U.error;u.U.isCheck&&c&&c({},u.U.txid,Bt)}if(++o>=s.yt)return!0}return!1})},i.prototype.ei=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,Bt)},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,Bt)},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._t=function(t,i){},i.prototype.Qt=function(t){},i.prototype.jt=function(t){return t===n.IPv4?"z_net_http3_servers_status":"z_net_http3_v6_servers_status"},i.prototype.Zt=function(t){var i,e;this.txid++;var n={appid:this.lt.appID,biz_type:0,mode_no:this.lt.appInfo.mode,sdk_type:Tt.sdkType,zegoconn_run_env:0===this.lt.env?p.ZEGOCONN_RUN_ENV_BROWSER:p.ZEGOCONN_RUN_ENV_APPLET,zegoconn_version:this.lt.appInfo.connVer};(null===(i=this.lt.appInfo)||void 0===i?void 0:i.deviceID)&&(n.device_id=null===(e=this.lt.appInfo)||void 0===e?void 0:e.deviceID);var s=ni({id_name:this.lt.userId},n),r=this.lt.appInfo.geoFencing,o=ni(ni({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.Dt.encodeRequest(u,o,a,t);return{buf:this.ii(c),streamID:a,type:u}},i.prototype.getUseableHttp3Server=function(t,i){var e="",n=jt(this.jt(i),this.lt.env,this.lt.appID);if(this.Ot.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.Ot.info(ht+" "+e),e},i.prototype.si=function(t,i){if(!t.length)return[];var e=t,n=jt(i,this.lt.env,this.lt.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.lt.env,this.lt.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.jt(i),n=this.si(t,e);this.Ot.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.Ot.info("zn.wl.h3.t.0 start:"+n);var s=new $t(this.Ot),r=Date.now();s.onBackToWebSocket=function(s){var o;e.Ot.info("".concat(ft," failed:").concat(n," reason:").concat(s," time:").concat(Date.now()-r,"ms")),Lt(i,e.lt.env,e.lt.appID,((o={})[n]={status:!1,time:Date.now()},o),!0),e.startTestHttp3Server(t,i)},s.onopen=function(t){var i=e.Zt(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.Ot.info("".concat(ft," failed:").concat(n," reason:").concat(H.LinkTimeout," time:").concat(Date.now()-r,"ms"));else{var h=new Uint8Array(o),f=e.Dt.decodeResponse(h,c.WebTransport);if(f[1]===d.MSG_TYPE_GET_CONFIG_RESPONSE&&0===f[2].code)return e.Ot.info("".concat("zn.wl.h3.t.1"," success:").concat(n," time: ").concat(Date.now()-r,"ms storageKey: ").concat(i)),Lt(i,e.lt.env,e.lt.appID,((u={})[n]={status:!0,time:Date.now()},u),!0),void s.close()}}catch(t){e.Ot.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.lt.env,e.lt.appID,((a={})[n]={status:!1,time:Date.now()},a),!0),e.startTestHttp3Server(t,i)},s.startConnect(n)}},i}(),oi=function(){function t(t,i,e){this.oi=t,this.Dt=i,this.stateCenter=e}return Object.defineProperty(t.prototype,"appInfo",{get:function(){return this.stateCenter.appInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ot",{get:function(){return this.stateCenter.logger},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t,i){this.Ot.info("zn.nab.gc call");var e=this.oi.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.Ot.info(nt+" call");var n=this.oi.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.Ot.info(nt+" suc "),t&&t(i)},function(t,n,s){e.Ot.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.Ot.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.Ot.error(st+" fail "+JSON.stringify(e)),void a(e);if(0===t.code){o.Ot.info(st+" suc");var n=o.decodeConfigMessage(t.data.data);u({code:0,data:n,etag:t.data.etag})}else o.Ot.error(st+" fail "+t.code),a({code:t.code})};o.oi.getFreeStream(b.OTHER).sendMessage(d.MSG_TYPE_GET_APPCONFIG_REQUEST,c,h,h,null,{timeout:n})})},t.prototype.decodeConfigMessage=function(t){return this.Dt.decodeConfigMessage(t)},t.prototype.getSvrAddr=function(){var t=this;return new Promise(function(i,e){t.Ot.info("".concat(et," call"));var n=t.oi.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.Ot.info("".concat(et," suc")),i(e)},function(i,n,s){t.Ot.info("".concat(et," fail")),e(s||i)})})},t}();!function(t){t.Lazy="lazy",t.Periodic="periodic"}(ti||(ti={}));var ui=function(){function t(t,i){this.oi=t,this.lt=i,this.ri=null,this.ci=5,this.ui=10,this.hi=0,this.ai=0,this.fi=0,this.mode=ti.Lazy}return Object.defineProperty(t.prototype,"_i",{get:function(){return this.oi.getHbStream()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ot",{get:function(){return this.lt.logger},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"li",{get:function(){var t=this.lt.lastRecvMsgTime;return!!t&&Date.now()-t>1e3*this.ci},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"di",{get:function(){var t=this.fi;return!!t&&Date.now()-t>1e3*this.ui},enumerable:!1,configurable:!0}),t.prototype.init=function(t){this.Ot.info("zn.nhb.ii call. "),t.data.logic_hb_interval>=1&&t.data.logic_hb_interval<=10&&(this.ci=t.data.logic_hb_interval),t.data.logic_hb_timeout>=3&&t.data.logic_hb_timeout<=30&&(this.ui=t.data.logic_hb_timeout),this.ai=0,this.hi=this.ui/this.ci,this.startHB()},t.prototype.startHB=function(){var t=this;if(this._i){var i=this.li;if(this.Ot.debug("zn.nhb.rs call "+i),!i&&this.fi&&(this.Ot.info(rt+" stop check."),this.fi=0),null!==this.ri){if(i||this.mode===ti.Periodic)return;clearTimeout(this.ri)}var e=this.ri=setTimeout(function(){t.ri===e&&(t.ri=null),t.li&&!t.fi&&(t.Ot.info(rt+" start check."),t.fi=Date.now()),t.di&&(t.Ot.warn(rt+" over max hb timeout. "),t.onHBTimeout&&t.onHBTimeout()),t.Ei()},1e3*this.ci)}},t.prototype.Ei=function(){var t=this;if(this._i){this.Ot.debug(rt+" call "+this.ai++);var i=(new Date).getTime(),e=function(e,n,s){var r=(new Date).getTime()-i;if(t.Ot.debug(rt+" hb callback "+r),s&&0!==(null==s?void 0:s.code))t.Ot.warn(rt+" fail "+JSON.stringify(s));else{if(t.fi&&(t.Ot.info(rt+" hb rsp to stop check."),t.fi=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.lt.appInfo.env&&t.lt.updateNTP(i,u,a)}t.ai=0}},n={ts:Date.now()};this._i.sendMessage(d.MSG_TYPE_HB_REQUEST,n,e,e,null)}},t.prototype.onHBTimeout=function(){},t.prototype.stop=function(){this.ri&&(clearTimeout(this.ri),this.ri=null),this.ai=0},t}(),ai=function(){return ai=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},ai.apply(this,arguments)},ci=function(){function t(t,i,e,n,s,r){this.Ot=t,this.pi=i,this.oi=e,this.gi=n,this.lt=s,this.Si=r,this.connectState=y.DISCONNECT,this.lastConnectState=y.DISCONNECT,this.brokenTimer=null,this.listenerList={connected:[],broken:[]},this.pcEmitState=-1,this.Ti=null,this.eventManager=new Xt,this.Si&&(this.Si.isMsgCache=!1)}return Object.defineProperty(t.prototype,"service",{get:function(){return this.pi},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"netPcStream",{get:function(){return this.Ti||this.createPcStream()},enumerable:!1,configurable:!0}),t.prototype.createPcStream=function(){var t=this.oi.createStream(b.PC);return this.Ti=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.Ti||this.Ot.info(wt+" create pc ".concat(this.pi," ").concat(this.netPcStream.StreamID));var f=t.payload;(null===(s=this.Si)||void 0===s?void 0:s.encode)&&(f=Pt(t.payload));var l={service_no:this.pi,ack:t.ack,payload:f,wss_message_type:null!==(o=null===(r=this.Si)||void 0===r?void 0:r.messageType)&&void 0!==o?o:Tt.wssMessageType,wss_path:null===(u=this.Si)||void 0===u?void 0:u.path,wss_raw_query:null===(a=this.Si)||void 0===a?void 0:a.query,zegoconn_version:Tt.connectVer,addr_type:0===this.lt.customConfig.ipStackMode?0:1};this.netPcStream.isConnect()||(this.Ot.info(wt+" pc is not connect"),this.eventManager.emit("connectStart")),this.netPcStream.sendMessage(d.MSG_TYPE_PC_UPWARD_MESSAGE,l,function(){h.Ot.info(wt+" suc"),e&&e()},function(t){h.Ot.error(wt+" fail"),i&&i(t)},null,{isInSendMap:"boolean"==typeof t.isInSendMap&&t.isInSendMap,extras:n,isMsgCache:null===(c=this.Si)||void 0===c?void 0:c.isMsgCache})},t.prototype.onPushEvent=function(t,i,e){var n;switch(this.Ot.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.Ot.info(St+" ".concat(this.pi," down ").concat((null==i?void 0:i.ts)&&i.ts.toNumber&&i.ts.toNumber()||i.ts));var s=i.payload;(null===(n=this.Si)||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.Ot.info(St+" ".concat(this.pi," 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.Ot.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.Ot.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:Gt})},1e3*this.gi)},t.prototype.resetBrokenTimer=function(){this.brokenTimer&&clearTimeout(this.brokenTimer)},t.prototype.Ci=function(t,i,e){var n;this.Ot.info("zn.napr.cr"+" close pc ".concat(this.pi," ").concat((null===(n=this.Ti)||void 0===n?void 0:n.StreamID)||-1," ").concat(t," ").concat(this.connectState," ").concat(i," ").concat(e||"")),this.connectState===y.DISCONNECT&&"disconnected"!==t||(this.Ti&&(this.Ti.closeStream(0,""),this.Ti.destroyed(),this.Ti=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.Ci("broken",t,i)},t.prototype.closeRequest=function(){this.Ci("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,ai({service_no:this.pi},i))},t.prototype.stateChanged=function(t,i,e,n){this.Ot.info("zn.napr.sc ".concat(t," ").concat(i," ").concat(JSON.stringify(e))),this.pcEmitState===t?this.Ot.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}(),hi=function(){function t(t,i){this.oi=t,this.lt=i,this.pcStreamRequests=[],this.pcEstablishTimeout=Tt.pcEstablishTimeout}return Object.defineProperty(t.prototype,"Ot",{get:function(){return this.lt.logger},enumerable:!1,configurable:!0}),t.prototype.getRequest=function(t,i){var e=new ci(this.Ot,t,this.oi,this.pcEstablishTimeout,this.lt,i);return this.pcStreamRequests.push(e),e},t.prototype.updateConnectState=function(t,i,e){this.Ot.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}(),fi=function(){function t(t,i){this.Ot=t,this.lt=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.bi=1,this.mi=0,this.Oi=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.Ot.info(ut+" call"),this.maxTimer||(this.Ot.info(ut+" start max timer"),this.maxTimer=setTimeout(function(){t.Ot.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,Jt)},1e3*this.RETRY_MAX_TIME))},t.prototype.stopMaxTime=function(){this.Ot.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.Ot.info(ot+" call "+t+" "+i+" "+e+" "+this.bi),this.lt.isDestroyed)return!1;if(this.retryTimer)return this.Ot.info(ot+" has actived, ignore"),!1;var s=this.lt.networkState==f.offline;if(s){if(this.Ot.info(ot+" check if really offline. "+this.mi),this.mi>=this.Oi)return this.Ot.warn(ot+" network is broken, stop retry"),!1}else this.mi=0;if(this.link.isConnecting()&&!e)return this.Ot.info(ot+" link is connecting, ignore"),!1;if(this.isOverTime)return this.Ot.info(ot+" retry over time, stop retry"),!1;if(this.bi>this.retryIPMaxTimes)return this.invalid(),this.onRetryBeyondLimit(),!1;var r=function(){n.Ot.info(ot+" interval "+n.Ri),n.retryTimer=setTimeout(function(){i||n.link.destroySocket(_.BROKEN),n.link.connectSocket(t,function(){n.Ot.info(ot+" suc"),n.lt.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.lt.networkState===f.online&&(n.h3ClosedTimes.push(Date.now()),3===n.h3ClosedTimes.length)){if(n.h3ClosedTimes[2]-n.h3ClosedTimes[0]<=15e3)return n.h3ClosedTimes=[],n.Ot.info(lt+" reason:"+H.ClosedTooOften+" error:Links break too often"),Lt(n.link.linkServerStorageKey,n.lt.env,n.lt.appID,((t={})[n.link.connectServer]={status:!1,time:Date.now()},t),!0),n.lt.enableHttp3=!1,!n.maxTimer&&n.startMaxTime(),void n.active(!1,!0);n.h3ClosedTimes.shift()}n.Ot.info(ot+" fail"),!n.maxTimer&&n.startMaxTime(),n.active(!0,!1,!0)}),n.retryTimer&&clearTimeout(n.retryTimer),n.retryTimer=null,s?n.mi++:n.bi++},i?0:1e3*n.Ri)};if(1==this.bi)xt().then(function(t){n.Ri=Math.floor(t*(1-n.RETRY_START_TIME_INTERVAL)+n.RETRY_START_TIME_INTERVAL),r()}).catch(function(){n.Ri=.5*n.RETRY_START_TIME_INTERVAL,r()});else{var o=Math.pow(2,Math.round(this.bi/this.RETRY_CONTINUE_COUNT+1));this.Ri=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.Ot.info("zn.rlh.ivd end retry"),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.bi=1,this.mi=0},t}(),li=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=$t.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}(),di=function(){function t(){this.level=1}return t.prototype.setLogLevel=function(t){var i;return this.level=null!==(i=vi[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}(),vi={debug:0,info:1,warn:2,error:3,report:99,disable:100},mi=function(){return mi=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},mi.apply(this,arguments)},pi=function(){function t(t,i,e){this.Ot=t,this.oi=i,this.pi=e}return Object.defineProperty(t.prototype,"netHttpStream",{get:function(){return this.oi.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.pi,ack:t.ack,headers:t.headers,body:Pt(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.Ot.info(Et+" gzip");else if(t.body){var n=Mt(t.body);t.body=n}var s=mi(mi({},t),{body:void 0});!o&&r.Ot.info(Et+" suc "+JSON.stringify(s)),i&&i(t)},function(t,i,n){!o&&r.Ot.error(Et+" fail"),e&&e(n||t)},function(t){!o&&r.Ot.error(Et+" ack"),n&&n(t)},s)},t.prototype.sendRequest2=function(t,i,e,n,s){var r=this,o=1===t.format?Pt(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.Ot.info(Ot+" gzip");else if(n.body&&1===t.format)try{a=Mt(n.body),n.body=a}catch(t){r.Ot.info(Ot+" decode "+JSON.stringify(t))}var u=mi(mi({},n),{body:void 0});r.Ot.info(Ot+" suc "+JSON.stringify(u)),i&&i(n,s)}else{try{var a=Mt(n.body);n.body=a}catch(t){r.Ot.info(Ot+" status "+n.status_code+" "+JSON.stringify(t))}e&&e(n)}},function(t,i,n){r.Ot.error(Ot+" fail"),e&&e(n||t)},function(t){r.Ot.error(Ot+" ack"),n&&n(t)},s)},t}(),gi=function(){function t(t,i,e){this.type=t,this.Ai=i,this.gt=e,this.isFree=!1,this.isFirst=!0,this.timestamp=0,this.id=Date.now()}return Object.defineProperty(t.prototype,"StreamID",{get:function(){return this.Ai},enumerable:!1,configurable:!0}),t.prototype.Pi=function(){this.timestamp=Date.now()},t.prototype.refresh=function(t){this.Ai=t,this.isFirst=!0,this.Pi()},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.Pi();var u=this.Ai;this.gt.sendMessage(t,u,i,this.isFirst,function(t,i,n){o.type!==b.PC&&(o.isFree=!0,o.Pi()),o.isFirst&&u===o.StreamID&&(o.isFirst=!1),e&&e(t,n)},function(t,i,e){o.type!==b.PC&&(o.isFree=!0,o.Pi()),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.gt.sendMessage(d.MSG_TYPE_STREAM_CLOSED,this.Ai,{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.gt)||void 0===t?void 0:t.socketService)||void 0===i?void 0:i.type)===c.WebTransport&&this.gt.socketService.closeStream(this.Ai),this.onDestroyed()},t.prototype.isConnect=function(){return this.gt.isConnect()},t.prototype.onDestroyed=function(){},t}(),bi=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))},_i=function(){function t(t,i){var e=this;this.gt=t,this.lt=i,this.streamID=1,this.pcStreams=[],this.streams=[],this.gt.onSocketClose=function(){e.refreshAllStream()}}return Object.defineProperty(t.prototype,"Ot",{get:function(){return this.lt.logger},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.clearStreams()},t.prototype.createStream=function(t){var i=this,e=this.getNextStreamID(),n=new gi(t,e,this.gt);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 gi(b.OTHER,this.getNextStreamID(),this.gt);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.Ot.info("zn.sm.ras call"),bi(bi(bi([],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}(),yi=function(){return yi=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},yi.apply(this,arguments)},wi=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 Si(t,i){return void 0===i&&(i="setAppInfo"),Error("Failed to execute ".concat(t," before ").concat(i,"."))}var Ei=function(){function t(t){var i=this;this.proxyCtrl=t,this.Ii=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=1,this.connectSeq=0,this.Ni=0,this.listenNetworkState=!0,this.defaultConnectServers=[],this.Di=0,this.lastLinkConnectState=0,this._t=function(t,e){i.logger.warn("zn.zca.btws h333 back to ws. ".concat(t)),i.$t(!0,{code:Ft,msg:(null==e?void 0:e.message)||JSON.stringify(e)}),i.yi()},this.Qt=function(t){var e=i.stateCenter.ipList;i.stateCenter.clientIP&&i.wi(i.stateCenter.clientIP),i.stateCenter.byPassClientIP&&i.wi(i.stateCenter.byPassClientIP);var n={linkConnectDetection:t};(e.ipv4.length>0||e.ipv6.length>0)&&(n.ipList=e),i.eventManager.emit("ipDetection",n)},this.Ft=function(t,e){if(i.linkConnectState=2,i.zi(),0===i.appInfo.env){var n=i.reportSeq++;i.eventManager.emit("dispatchEvent",n,"start"),i.Mi().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.Hi().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){})}i.eventManager.emit("connected"),i.Ui(t,e)},this.Jt=function(){i.logger.info(Q+" call"),i.linkConnectState=1},this.$t=function(t,e,n){i.logger.info("zn.zca.ode"+" ".concat(t," ").concat(JSON.stringify(e)));var s=i.linkConnectState;i.linkConnectState=0,t?i.Gi(null==e?void 0:e.code,O.TEMP):(1===s&&n&&i.Ui(n,null==e?void 0:e.code),0!==s&&(i.eventManager.emit("disconnected"),i.netAgentPCRequestMgr.updateConnectState(y.DISCONNECT,O.CLOSE,e),i.ki((null==e?void 0:e.code)||0)))},this.Wt=function(t,e,n,s){switch(e){case d.MSG_TYPE_REDIRECT:case d.MSG_TYPE_REDIRECT2:i.Vi(n);break;case d.MSG_TYPE_CLOSE_CONNECTION:i.Bi(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 di,this.stateCenter=new li,this.stateCenter.logger=this.logger,this.protobuf=new G(this.stateCenter),this.eventManager=new Xt,this.zegoLink=new ri(this.protobuf,this.stateCenter,this.proxyCtrl),this.Yi(),this.streamManager=new _i(this.zegoLink,this.stateCenter),this.businessRequestMgr=new oi(this.streamManager,this.protobuf,this.stateCenter),this.zegoLink.HBHandler=this.netHeartBeatHandler=new ui(this.streamManager,this.stateCenter),this.netAgentPCRequestMgr=new hi(this.streamManager,this.stateCenter),this.zegoLink.initEvent(this.Ft,this.$t,this.Jt,this.Wt,this._t,this.Qt),this.zegoLink.onUpdateMsgTimeChanged=function(t){i.Li()},this.Li(),this.$i()}return t.prototype.Yi=function(){var t=this;this.zegoLink.Lt=function(i,e,n,s,r){if(0==t.Ni&&0==i){var o=t.reportSeq++;t.Ni=o,t.eventManager.emit("onceConnectEvent",o,"start")}else if(0!=t.Ni&&1==i){var u=qt(e);t.eventManager.emit("onceConnectEvent",t.Ni,"end",{server:e,error:n,connect_type:u,h3_reason:s,message:null==r?void 0:r.message}),t.Ni=0}}},Object.defineProperty(t.prototype,"speed",{get:function(){return this.zegoLink.speed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDestroy",{get:function(){return this.stateCenter.isDestroyed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xi",{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.Di},set:function(t){this.lastLinkConnectState=this.Di,this.Di=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=yi(yi({},this.stateCenter.appInfo),t),navigator&&(this.stateCenter.networkState=navigator.onLine?f.online:f.offline,i+=" oline: ".concat(navigator.onLine)),0===t.env?this.ji():1===t.env&&this.qi(),this.logger.info(i)}},t.prototype.checkAndConnect=function(t){if(!this.stateCenter.appID)throw Si(t,"setAppInfo");if(this.connectServers.length<=0)throw Si(t,"setNetAgentDefaultServers or setDispatchConnectServers");if(this.isDestroy)throw Error("instance have destroyed, invalid call");this.retryLinkHandler||this.yi()},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,$t.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=wi([],t,!0)),0===this.wssV6Servers.length&&0!==i.length&&(this.wssV6Servers=wi([],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=wi([],t,!0)),i.length>0&&(this.http3Servers=wi([],i,!0)),e.length>0&&(this.wssV6Servers=wi([],e,!0)),n.length>0&&(this.http3V6Servers=wi([],n,!0)),this.stateCenter.appID>0&&this.yi()},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 pi(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 pi(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 Si("getAppConfigByAgent","setUserInfo");return this.isConnect()||(this.logger.info("zn.gab.0 link is not connect"),this.innerReconnect()),this.Fi(t,this.stateCenter.userId,i,e,n,s)},t.prototype.getPCRequest=function(t,i){var e=this;if(!this.stateCenter.appInfo)throw Si("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.Gi(Gt),e.Ji())}),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.Wi(!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?Ht:void 0),this.Ii&&clearTimeout(this.Ii),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.10"},t.prototype.reconnectUA=function(){this.retryLinkHandler&&(this.retryLinkHandler.startMaxTime(),this.Gi(),this.Wi(!1,R.detail))},t.prototype.$i=function(){var t=this;this.netHeartBeatHandler.onHBTimeout=function(){t.eventManager.emit("heartBeatTimeout")}},t.prototype.ji=function(){var t=this;this.listenNetworkState&&(window.addEventListener("offline",function(){t.Ki()}),window.addEventListener("online",function(){t.Zi()}))},t.prototype.qi=function(){var t=this;wx.onNetworkStatusChange(function(i){i.isConnected?t.Zi():t.Ki()})},t.prototype.Zi=function(){this.logger.info("zn.zca.noh.0 network is online"),this.stateCenter.networkState=f.online,this.xi&&this.Xi()},t.prototype.Ki=function(){this.logger.info("zn.zca.noh.1 network is broken"),this.stateCenter.networkState=f.offline,this.xi&&this.tn()},t.prototype.Li=function(){var t=this;this.stateCenter.useNetAgent&&(this.Ii&&clearTimeout(this.Ii),this.Ii=setTimeout(function(){t.logger.info("zn.zca.clm interval: "+t.linkMsgMaxInterval+" ; start time:"+t.zegoLink.updatedMsgTime),t.Qi(Yt)},1e3*this.linkMsgMaxInterval))},t.prototype.yi=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 fi(this.logger,this.stateCenter)),this.retryLinkHandler.init(),this.retryLinkHandler.initLink(this.zegoLink),this.retryLinkHandler.onactive=function(i,e){e===Jt&&(t.eventManager.emit("disconnected",e),t.ki((null==e?void 0:e.code)||0),t.netAgentPCRequestMgr.updateConnectState(y.DISCONNECT,O.TIMEOUT,e))},this.retryLinkHandler.onRetryBeyondLimit=function(){t.Wi(!0)},this.Wi(!0))},t.prototype.Wi=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.Ji(!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.Nt=u.noProbe,this.zegoLink.removeSocketServiceEvent()},t.prototype.wi=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.zi=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._t(H.GetConfigFailed,"get config error")));0===e.code?(t.logger.info(Z+" suc "+JSON.stringify(e)),t.nn(e,i)):t.logger.info(Z+" fail "+JSON.stringify(e))};this.businessRequestMgr.getConfig(e,e)},t.prototype.nn=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.wi(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.Mi=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.en(r),m=d||h?o:t.en(o),p=d||f?u:t.en(u),g=d||l?a:t.en(a),b=t.sn(v),_=t.sn(m,"https"),y=t.sn(p),w=t.sn(g,"https");i({servers:b,http3Servers:_,wssV6Servers:y,http3V6Servers:w,domains:v,http3Domains:m,wssV6Domains:p,http3V6Domains:g})},function(t){e(t)})})},t.prototype.Hi=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.sn=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.en=function(t){var i=wi([],t,!0);return i.filter(function(t){return!!t.host})},t.prototype.Fi=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(yi(yi({},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(yi(yi({},n),{retryCount:r}))}o.getAppConfigFailCount++,(20008===n.code||1100002===n.code)&&o.getAppConfigFailCount<3?o.Fi(t,i,e,s).then(function(t){return u(t)}).catch(function(t){return a(t)}):(r=o.getAppConfigFailCount,o.getAppConfigFailCount=0,a(yi(yi({},n),{retryCount:r})))}):o.logger.error(X+" userID or token must be string")})},t.prototype.ki=function(t){var i=(new Date).getTime()-this.connectedTime;this.connectid&&this.eventManager.emit("disConnectedEvent",{duration:i,server:this.zegoLink.connectServer,connectid:this.connectid,error:t})},t.prototype.Vi=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.sn(i),o=this.sn(e,"https"),u=this.sn(n),a=this.sn(s,"https");r&&Array.isArray(r)&&r.length>0?(this.Gi(1100010),this.stateCenter.specified&&(this.logger.info(W+" specified"),r=this.specifiedServers),this.zegoLink.setServers(r,o,u,a),this.Ji(!1,!0)):this.logger.warn(W+" wss_groups null")},t.prototype.Bi=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.Mi().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.Gi(t.reason),i.zegoLink.setServers(l,o,a,c),i.Ji(!1,!0)}}).catch(function(t){i.logger.info(K+" dispatch fail")});break;case S.ACTION_IDLE:20020===t.reason&&(this.Gi(t.reason),this.Ji(!1));break;case S.ACTION_RETRY:this.Gi(t.reason),this.Ji(!1);break;case S.ACTION_NEXT_GROUP:this.netAgentPCRequestMgr.closePCs(t.reason),this.eventManager.emit("broken",k.CLOSE),this.Ji()}},t.prototype.Xi=function(){this.retryLinkHandler&&(this.zegoLink.isConnect()?this.retryLinkHandler.stopMaxTime():this.Wi(!1,R.detail))},t.prototype.tn=function(){this.Gi(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.Ji())},t.prototype.Ji=function(t,i){var e;(null===(e=this.retryLinkHandler)||void 0===e?void 0:e.active(t,i))&&this.rn()},t.prototype.rn=function(){if(0===this.connectSeq){var t=this.reportSeq++;this.connectSeq=t,this.eventManager.emit("connectedEvent",t,"start")}},t.prototype.Ui=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;var s=qt(t[0]),r=qt(n.zegoLink.connectServer);n.eventManager.emit("connectedEvent",n.connectSeq,"end",{first_connect_type:s,connect_type:r,count:t.length,connectid:n.connectid,server:n.zegoLink.connectServer,error:i}),n.connectSeq=0})},t.prototype.Gi=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.linkConnectState=0,this.eventManager.emit("broken"),2===this.lastLinkConnectState&&0===this.linkConnectState&&this.ki(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))},3788:function(t){"use strict";t.exports=i},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)},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.A(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.k(t,i,e)):(this.log.info(d.SETTING_FETCH_SETTING+" file not found"),this.k(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.A(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.A(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.A=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="string"==typeof(e=null==(e=f[i].versions)?void 0:e.hash)?new Uint8Array(e.split(",").map(function(t){return parseInt(t)})):new Uint8Array;a.push({file_name:t,hash:e,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.k=function(t,i,e){var n=this;return new Promise(function(o,u){n.log.info(d.SETTING__FETCH_SETTING+" call"),n.A(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){var i,e;t.needPolling&&(e="string"==typeof(null==(i=t.versions)?void 0:i.hash)?new Uint8Array(null==(i=t.versions)?void 0:i.hash.split(",").map(function(t){return parseInt(t)})):new Uint8Array,n.push({file_name:t.fileName,hash:e,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.8",(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}),!h._options.connection||null!=(s=h._options.connection)&&s.isDestroy?u(r(r({},d.FILE_REQUEST_FAIL),{reportData:c,status_code:null==n?void 0:n.status_code})):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()),{}),z="";if(0<(null==k?void 0:k.byteLength)&&0<(null==I?void 0:I.byteLength))try{var D=0===i.response_compress?m._options.inflate(I,{to:"string"}):a.decodeString(I);C=JSON.parse(D),z=k.toString()}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:z,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}),m._options.connection&&(null==(a=m._options.connection)||!a.isDestroy)&&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))},5178:function(t,i,e){var n;t.exports=(n=e(9021),n.enc.Utf8)},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)},5733:function(t){"use strict";t.exports=e},6361:function(t){"use strict";t.exports=n},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)},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,A,P=n.parseRtpParameters(a);b||(D=n.getIceParameters(a,m),(A=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=P,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(A)),!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=P,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)},6994:function(i){"use strict";i.exports=t},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)}})}()))},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),P(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&&(A(t.L,2*t.p,i=t.o-t.p),A(t.ub,t.rc,i),C(t,i))}function A(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 P(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)At(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,A,P,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.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>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)),(P=t.a[e+D]).z>r&&(P.z=r,P.r=e+m+1,P.j=0,P.t=1,P.Ac=1,P.r2=e,P.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),(P=t.a[e+m]).z>r&&(P.z=r,P.r=e,P.j=o+4,P.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)),(P=t.a[e+D]).z>r&&(P.z=r,P.r=e+m+1,P.j=0,P.t=1,P.Ac=1,P.r2=e,P.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+=Pt(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+=Pt(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+=Pt(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+=Pt(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+=Pt(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,At(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,At(t))}function Dt(t){return n(n(a(t.Jb),t.mc),[4,0])}function At(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 Pt(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},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)},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)}},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 Qw}});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=1e5,v="未引入消息模块",m="3.11.0",p="2025-10-24 20:49:13",g=void 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 b,_,y;!function(t){t[t.disable=0]="disable",t[t.websocket=1]="websocket",t[t.https=2]="https"}(b||(b={})),function(t){t[t.SDKProject_ZegoWebRTC=6]="SDKProject_ZegoWebRTC",t[t.SDKProject_ZegoMiniProgram=7]="SDKProject_ZegoMiniProgram"}(_||(_={})),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"}(y||(y={}));var w,S=0,E=1,O=2,T=1e3,k=3600,R=52e6,I={waiting_url:1,tryPublish:2,update_info:3,publishing:4,stop:5,retryPublish:6},N=2001,C=2002,z=2003,D=function(){var t=1;return function(){return t++}}(),A=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"}(w||(w={}));var P,M,x,j,L,q,U,B,J,V,H,G,F,Y=12001,Z=12002,Q=12003,X=0,W=1,K=2,$=0,tt=1,it=2;!function(t){t[t.Default=0]="Default",t[t.Extranet=1]="Extranet",t[t.Intranet=2]="Intranet"}(P||(P={})),function(t){t[t.logout=0]="logout",t[t.trylogin=1]="trylogin",t[t.login=2]="login"}(M||(M={})),function(t){t[t.logout=0]="logout",t[t.trylogin=1]="trylogin",t[t.login=2]="login",t[t.reconnect=3]="reconnect"}(x||(x={})),function(t){t[t.stop=0]="stop",t[t.start=1]="start"}(j||(j={})),function(t){t[t.CDN=0]="CDN",t[t.RTC=1]="RTC",t[t.L3=2]="L3",t[t.DG=3]="DG"}(L||(L={})),function(t){t[t.useAnalyzer=0]="useAnalyzer",t[t.useWorklet=1]="useWorklet"}(q||(q={})),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"}(U||(U={})),function(t){t.WIN32="WIN32",t.MAC="Mac",t.ANDROID="Android",t.LINUX="Linux",t.IOS="iOS",t.Harmony="Harmony",t.UNKNOWN="WTF"}(B||(B={})),function(t){t.CDN="cdn",t.L3="l3",t.RTC="rtc"}(J||(J={})),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"}(V||(V={})),function(t){t[t.offline=0]="offline",t[t.online=1]="online"}(H||(H={})),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"}(G||(G={})),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"}(F||(F={}));var et,nt,st,rt,ot=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}(),ut=function(){function t(){this.start=new ot,this.end=new ot,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 ot(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"}(et||(et={})),function(t){t[t.None=0]="None",t[t.Vocalist=1]="Vocalist",t[t.BackingSinging=2]="BackingSinging"}(nt||(nt={})),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"}(st||(st={})),function(t){t[t.ZegoDefined=0]="ZegoDefined",t[t.UserUnregister=1]="UserUnregister"}(rt||(rt={}));var at,ct,ht;!function(t){t[t.disconnected=0]="disconnected",t[t.connecting=1]="connecting",t[t.connected=2]="connected"}(at||(at={})),function(t){t[t.tryProbe=0]="tryProbe",t[t.probed=2]="probed"}(ct||(ct={})),function(t){t[t.replaceNew=0]="replaceNew",t[t.changeResolution=1]="changeResolution"}(ht||(ht={}));var ft,lt={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"}(ft||(ft={}));var dt,vt;!function(t){t[t.publish_quality=0]="publish_quality",t[t.play_quality=1]="play_quality",t[t.charge=2]="charge"}(dt||(dt={})),function(t){t[t.low=1]="low",t[t.stantard=2]="stantard",t[t.hight=3]="hight",t[t.custome=4]="custome"}(vt||(vt={}));var mt,pt,gt={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"}(mt||(mt={})),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"}(pt||(pt={}));var bt,_t,yt,wt;!function(t){t[t.PortraitSegmentation=0]="PortraitSegmentation"}(bt||(bt={})),function(t){t[t.BASE_LINE=1]="BASE_LINE",t[t.MAIN=2]="MAIN",t[t.HIGH=3]="HIGH"}(_t||(_t={})),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"}(yt||(yt={})),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"}(wt||(wt={}));var St,Et={width:320,height:240,frameRate:15,bitRate:300},Ot={width:640,height:480,frameRate:15,bitRate:800},Tt={width:1280,height:720,frameRate:20,bitRate:1500},kt={frameRate:20,bitRate:800},Rt={frameRate:15,bitRate:1500},It={frameRate:5,bitRate:2e3};!function(t){t[t.IPv4Only=0]="IPv4Only",t[t.IPv4Prefer=1]="IPv4Prefer",t[t.IPv6Prefer=2]="IPv6Prefer"}(St||(St={}));var Nt,Ct,zt,Dt,At,Pt,Mt,xt,jt,Lt,qt={0:"IPv4Only",1:"IPv4Prefer",2:"IPv6Prefer"};!function(t){t[t.IPv4=0]="IPv4",t[t.IPv6=1]="IPv6"}(Nt||(Nt={})),function(t){t[t.kV4Only=0]="kV4Only",t[t.kV4AndV6=1]="kV4AndV6",t[t.kV6AndV4=2]="kV6AndV4"}(Ct||(Ct={})),function(t){t[t.ZV4Only=0]="ZV4Only",t[t.ZV4Priority=1]="ZV4Priority",t[t.ZV6Priority=2]="ZV6Priority",t[t.ZV6AndV4Priority=3]="ZV6AndV4Priority"}(zt||(zt={})),function(t){t[t.unreachable=0]="unreachable",t[t.unknown=1]="unknown",t[t.reachable=2]="reachable"}(Dt||(Dt={})),function(t){t[t.probed=0]="probed",t[t.noProbe=1]="noProbe",t[t.probing=2]="probing"}(At||(At={})),function(t){t[t.LOGOUT=0]="LOGOUT",t[t.TRY_LOGIN=1]="TRY_LOGIN",t[t.LOGIN=2]="LOGIN"}(Pt||(Pt={})),function(t){t[t.RSP=0]="RSP",t[t.PUSH=1]="PUSH"}(Mt||(Mt={})),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"}(xt||(xt={})),function(t){t[t.ZegoRoomTransparentMessageModeOnlyClient=0]="ZegoRoomTransparentMessageModeOnlyClient",t[t.ZegoRoomTransparentMessageModeOnlyServer=1]="ZegoRoomTransparentMessageModeOnlyServer",t[t.ZegoRoomTransparentMessageModeClientAndServer=2]="ZegoRoomTransparentMessageModeClientAndServer"}(jt||(jt={})),function(t){t[t.ZegoRoomTransparentMessageNormal=0]="ZegoRoomTransparentMessageNormal",t[t.ZegoRoomTransparentMessageSequence=1]="ZegoRoomTransparentMessageSequence"}(Lt||(Lt={}));var Ut={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."},USER_HAD_LOGIN_OTHER:{code:1002086,msg:"the user had logined in other device"},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"},TOKEN_USERID_ERROR:{code:1002077,msg:"the token userid error"},NATIVE_TOKEN_EXPIRED:{code:1002078,msg:"token expire error"},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"}},Bt=o(6994),Jt=Bt.default||Bt;function Vt(t){return"number"==typeof t}function Ht(t){return"string"==typeof t}function Gt(t){return"boolean"==typeof t}function Ft(t){return void 0===t}function Yt(t){return null!==t&&t instanceof Object}function Zt(t){return null===t}function Qt(t){return"function"==typeof t}function Xt(t){return t instanceof Array}function Wt(t){return t instanceof Uint8Array}function Kt(t){return t instanceof MediaStream}function $t(t){return t instanceof HTMLElement}function ti(t){return t instanceof HTMLMediaElement}function ii(t){return Vt(t)&&0!==t}var ei=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))},ni=Promise,si=document;function ri(t,i,e){void 0===e&&(e=!0);var n=si.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 oi(t,i){var e=si.createElement("canvas");return e.width=t,e.height=i,e}function ui(t,i,e){void 0===e&&(e=""),t.info("".concat(i," call ").concat(e))}function ai(t,i,e){void 0===e&&(e=""),t.info("".concat(i," end ").concat(e))}function ci(t,i,e){void 0===e&&(e=""),t.info("".concat(i," success ").concat(e))}function hi(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||Ui.code,extendedData:e}}function fi(t,i){return new ni(function(e,n){n(hi(t,i))})}function li(t,i){for(var e in void 0===i&&(i=""),t){if(Jt.isLong(t[e])||Qt(t[e]||Wt(t[e])))return;Array.isArray(t[e])?t[e].forEach(function(t,i){li(t,i+"")}):Yt(t[e])?li(t[e],e):t.hasOwnProperty(e)||(Vt(t[e])&&(t[e]=0),Ht(t[e])&&(t[e]=""))}}function di(t){return/^([0-9a-zA-Z#!$%&()`'+-;<=.>@^_~,\\*])+$/.test(t)&&/^[^:/]*$/g.test(t)}function vi(t){return/^([0-9a-zA-Z-_])+$/.test(t)}function mi(t,i){return 0==i?Vt(t)&&t%1==0&&t>=0:Vt(t)&&t%1==0&&t>0}var pi="room not exist",gi="device is not found",bi="stream is not from zego",_i="input param error",yi="no preview",wi="network is broken";function Si(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 Ei(t,i,e){i&&t.setAttributes(i),t.end(e)}function Oi(t){return JSON.stringify(t)}var Ti=function(){return new Promise(function(t,i){t(Math.random())})};function ki(t,i){return void 0===t&&(t=0),i||(i="_zegom{codecid}"),0===t?"_zego264":i.replace("{codecid}",t+"")}function Ri(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 Ii="the user cancels the stream request.",Ni={code:1000002,message:"not login room"},Ci={code:1000014,message:"stream ID is too long"},zi={code:1000015,message:"streamID is empty"},Di={code:1000016,message:"stream ID contains illegal characters"},Ai={code:1000017,message:wi},Pi={code:1000018,message:"local stream wrong"},Mi={code:1001021,message:"set geoFence fail"},xi={code:1100001,message:_i},ji={code:1100002,message:"network timeout."},Li={code:1100003,msg:"socket close"},qi={code:1101002,message:"get app config fail"},Ui={code:1101003,message:"Module not imported"},Bi=1002099,Ji={code:1102016,message:"token error"},Vi={code:1102017,message:"dispatch error"},Hi={code:1102018,message:"token expired"},Gi={code:1102022,message:"dispatch request timeout"},Fi={code:1102023,message:"connect signal fail"},Yi={code:1102026,msg:pi},Zi={code:1003028,message:"There are duplicate stream ids in the room"},Qi={code:1003050,message:"the extra info of the stream is null"},Xi={code:1003099,message:"publish inner error"},Wi=1003081,Ki={code:1103001,message:_i},$i={code:1103002,message:"browser do not support"},te={code:1103011,message:"enumerate devices fail"},ie={code:1103012,message:"use camera device fail"},ee={code:1103021,message:"session request fail"},ne={code:1103022,message:"create offer error"},se={code:1103027,message:"server session closed"},re={code:1103044,message:bi},oe={code:1103055,message:"publish stream no found"},ue={code:1103058,message:"client ip changed"},ae={code:1103061,message:"get media fail"},ce={code:1103068,message:"update sdp fail"},he={code:1103103,message:"remote sdp no candidate "},fe={code:1103089,message:Ii},le=1103093,de={code:1004099,message:"internal exeception"},ve={code:1104001,message:"input parm error"},me={code:1104020,message:"dispatch request fail"},pe={code:1104021,message:"session request fail"},ge={code:1104022,message:"create offer error"},be={code:1104033,message:"client ip changed"},_e={code:1104038,message:"resource mode is not supported"},ye={code:1104027,message:"server session closed"},we={code:1004002,message:"play stream not found"},Se={code:1004020,message:"play stream interrupted"},Ee={code:1004025,message:"stream is forbided by media server"},Oe={code:1004080,message:"browser does not support the codec"},Te={code:1004081,message:"decode video failed"},ke={code:1104042,message:Ii},Re={code:1104043,message:"mini sdp error"},Ie={code:1104044,message:"stream is not playing"},Ne={code:1104047,message:"remote sdp no candidate "},Ce=1006006,ze=1106007,De="the microphone may be loose, and audio data collection is abnormal.",Ae=1106008,Pe="the camera may be loose, and video data collection is abnormal.",Me=1106009,xe=1106010,je={code:1000067,message:"Logged in room, setting scenario is not supported"},Le={code:1103083,message:"sdp wrong format"},qe={code:1103084,message:"mini sdp buffer size exceeded"},Ue={code:1103085,message:"url size exceeded"},Be=1103086,Je="this publish stream id is not created by CreateZegoStream",Ve=1103087,He="the zego stream does not capture audio",Ge=1103088,Fe="the zego stream does not capture video",Ye={code:1103074,message:"video track is not readable"},Ze=1103047,Qe="track is not found",Xe={code:1103048,message:gi},We=1103029,Ke={code:1103045,message:"video is false"},$e={code:1103046,message:"audio is false"},tn=1103101,en="only stream which have one track and kind no exist can add track",nn=1103069,sn="publisher state wrong",rn=1103070,on="not support handle track",un=1103071,an=1103071,cn=1103079,hn="replace track fail",fn={code:1103076,message:"audio track is not readable"},ln={code:1017130,message:"get mini sdp error"},dn={code:1017131,message:"parse mini sdp error"},vn={code:1017132,message:"worker is invalid"},mn={code:1017133,message:"mini trans timeout"},pn=function(t){return t},gn=function(t){return t},bn=function(t){return t},_n=function(t){return t},yn=function(t){return t},wn="/sdk/init",Sn=wn,En="/sdk/login",On="listener",Tn=wn,kn={event:"/sdk/create_stream",error:{te:$i,ie:Ki,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:ae,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:gn,screen:pn,camera:pn,custom:pn,preview_conf:pn,media_stream_id:gn},Rn="/sdk/create_zego_stream",In="/sdk/start_capture_mic",Nn="/sdk/start_capture_camera",Cn="/sdk/start_capture_camera_mic",zn="/sdk/start_capture_custom_audio",Dn="/sdk/start_capture_custom_video",An="/sdk/start_capture_custom_video_audio",Pn="/sdk/start_capture_screen_video",Mn="/sdk/start_capture_screen_video_audio",xn="/sdk/update_publish_stream",jn={event:"/sdk/start_publish",error:{he:Ki,fe:ji,le:Gi,de:Vi,ve:Ai,me:re,pe:{code:1103099,message:"stream is not capturing"},ge:{code:1103073,message:"video effect is starting, please operate after video effect is started"},be:Ni,_e:{code:1103051,message:"publisher retry timeout"},ye:{code:1003025,message:"stream is forbided by media server"},we:Hi,Se:se,Ee:{code:1103030,message:"negotiation timeout"},Oe:ne,Te:{code:1103023,message:"setLocalDescription error"},ke:{code:1103060,message:"session request timeout"},Re:ee,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"},Ae:{code:1103056,message:"publish is publishing"},Pe:ue,Me:{code:1103059,message:"ttl over time"},xe:{code:1103067,message:"update sdp time out"},je:ce,Le:{code:1103078,message:"publish stream poor and net probe poor"},qe:{code:1103100,message:"background process is start, but not subscribe yet"},Ue:fe,Be:Re,Je:{code:1103019,message:"publish streams auth fail"},Ve:{code:1003080,message:"browser does not support the codec"}},urls:bn,server_url:gn,publish_option:pn,message:gn,stream_id:gn,stream_sid:_n,room_id:gn,video_en_codec_id:_n,cap_w:_n,cap_h:_n,w:_n,h:_n,video_en_fps:_n,video_en_bps:_n,audio_c_channel_count:_n,audio_en_bps:_n,aec_level:_n,ans_level:_n,agc:yn,traffic_control_min_video_bitrate:{bitrate:_n,mode:_n},cap_volume:_n,enable_camera:yn,enable_mic:yn,video_activate:yn,audio_activate:yn,gw_version:_n,is_dual_stream:_n,is_mini:yn,is_peer:yn},Ln={event:"/publish/start",is_peer:yn,reason:gn,url:gn,ip:gn,peer_id:_n,source_type:gn,net_protocol:gn,wait_consume:_n,dispatch_consume:_n,signal_consume:_n,is_dual_stream:_n,is_mini:yn,mini_error:_n,port:_n},qn="/publish/rtc_dispatch",Un={event:"/publish/restart",stream_id:gn,server_url:gn,reason_code:_n,is_dual_stream:_n,is_mini:yn,mini_error:_n},Bn={event:"/sdk/publish",room_id:gn,room_sid_string:gn,retry_btime:_n,max_retry_interval:_n,fail_cnt:_n,continuous_fail_cnt:_n,probe_ip_cnt:_n,valid_probe_ip_cnt:_n,poor_quality_retry_cnt:_n,use_resource_type:bn,probe_not_trigger_retry_info:pn,stop_reason:gn,child_error:_n,try_time:_n,try_cnt:_n,server_url:gn,publish_begin_time:_n,publish_state_time:_n,bitrate:_n,h:_n,w:_n,cap_w:_n,cap_h:_n,fps:_n,use_na:_n,env:_n,webrtc_sid:_n,stream_id:gn,itemtype:gn,total_d:_n,valid_d:_n,tempbroken_cnt:_n},Jn="/sdk/api/publish_video_c_size",Vn=_n,Hn=_n,Gn=_n,Fn="/sdk/play_video_size_changed",Yn=_n,Zn=_n,Qn=_n,Xn={event:"/rtc/publish",tryidx:_n,url:gn,ip:gn,net_protocol:gn,lsttime:_n,denied_info:gn,dispatch_external_ip:gn,total_stat:pn,room_id:gn,room_sid_string:gn,resource_type:gn,protocol:gn,stop_reason:gn,try_time:_n},Wn={event:"/sdk/stop_publish",error:{ie:Ki},stream_id:gn,stream_sid:_n,room_id:gn},Kn="/rtc/publish_stream_state_error",$n={event:"/sdk/start_play",error:{He:zi,Ge:ve,Fe:Ci,Ye:Di,Ze:Ni,Qe:{code:1103049,message:"repeated pull same stream"},Xe:ji,We:Gi,Ke:Vi,un:Ai,an:_e,cn:{code:1104039,message:"play stream not found"},hn:{code:1104031,message:"player retry timeout"},fn:Se,ln:{code:1104035,message:"reset session push"},dn:{code:1104030,message:"negotiation timeout"},Oe:ge,Te:{code:1104023,message:"setLocalDescription error"},Re:pe,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"},vn:{code:1104032,message:"player is playing"},Pe:be,Me:{code:1104034,message:"ttl is over time"},mn:{code:1104037,message:"probe time out"},pn:{code:1104041,message:"stream quality poor and net probe poor"},gn:ke,Be:Re,bn:{code:1104045,message:"play streams is out limit"},_n:{code:1104046,message:"play streams auth fail"},yn:de},room_id:gn,urls:bn,server_url:gn,video_layer:_n,play_option:pn,message:gn,stream_id:gn,stream_sid:_n,resource_mode:_n,src:gn,video_codec_id:gn,room_sid_string:gn,is_multi:yn,audio_activate:yn,video_activate:yn,gw_version:_n,use_na:_n,biz_product:_n,is_peer:yn,is_mini:yn},ts={event:"/play/start",tryidx:_n,is_peer:yn,reason:gn,url:gn,ip:gn,port:_n,peer_id:_n,source_type:gn,net_protocol:gn,wait_consume:_n,dispatch_consume:_n,signal_consume:_n,biz_product:_n,is_mini:yn},is="/play/rtc_dispatch",es="/play/l3_dispatch",ns="/play/restart",ss={event:"/sdk/play",audio_cumulative_break_time:_n,audio_cumulative_decode_time:_n,video_cumulative_break_time:_n,video_cumulative_decode_time:_n,l3_a_break_time:_n,l3_a_decode_time:_n,l3_v_break_time:_n,l3_v_decode_time:_n,rtc_a_break_time:_n,rtc_a_decode_time:_n,rtc_v_break_time:_n,rtc_v_decode_time:_n,fft_audio:_n,fft_video:_n,room_id:gn,room_sid_string:gn,retry_btime:_n,max_retry_interval:_n,use_na:_n,fail_cnt:_n,continuous_fail_cnt:_n,probe_ip_cnt:_n,valid_probe_ip_cnt:_n,poor_quality_retry_cnt:_n,probe_not_trigger_retry_info:pn,use_resource_type:bn,stop_reason:gn,child_error:_n,try_time:_n,try_cnt:_n,webrtc_sid:_n,itemtype:gn,server_url:gn,play_begin_time:_n,play_state_time:_n,play_state_cnt:_n,first_frame_time:_n,protocol:gn,dispatch_external_ip:gn,total_stat:pn,w:_n,h:_n,abrc:_n,vbrc:_n,vinfo:pn,total_d:_n,valid_d:_n,tempbroken_cnt:_n},rs={event:"/rtc/play",tryidx:_n,url:gn,ip:gn,stream_id:gn,room_id:gn,room_sid_string:gn,net_protocol:gn,lsttime:_n,denied_info:gn,stop_reason:gn,dispatch_external_ip:gn,env:_n,resource_type:gn,protocol:gn,total_stat:pn,vinfo:pn,try_time:_n},os={event:"/sdk/stop_play",error:{ie:Ki},room_id:gn,stream_id:gn,webrtc_sid:_n,stream_sid:_n,biz_product:_n},us="/rtc/play_stream_state_error",as="/device/list",cs={te:$i,wn:te},hs={event:"/device/audio_device_changed",error:{te:$i,wn:te},interrupt:_n,device:gn,device_name:gn},fs={event:"/device/video_device_changed",error:{te:$i,wn:te},interrupt:_n,device:gn,device_name:gn},ls="/sdk/check_system",ds=pn,vs="/sdk/remote_camera_update",ms=gn,ps=gn,gs=_n,bs="/sdk/remote_mic_update",_s=gn,ys=gn,ws=_n,Ss={event:"/sdk/destroy_stream",error:{Sn:Pi},stop_reason:gn},Es="/device/api/audio_output",Os=gn,Ts=gn,ks={event:"/liveroom/recv_stream_update_info",stream_update_type:gn,stream_seq:_n,stream_list:pn,error:{En:Yi}},Rs="/liveroom/send_stream_update_info",Is=gn,Ns=gn,Cs=gn,zs={event:"/liveroom/get_current_stream_list",room_id:gn,room_sid_string:gn,stream_seq:_n,stream_size:_n,stream_list:pn,use_ua:_n,error:{ie:Ki,NOT_LOGIN:Ni}},Ds={event:"/sdk/net_first_video_frame",webrtc_sid:_n,fft_consumed:pn,resource_type:gn,reliability:_n,push_consumed:_n,prepare_recv_consumed:_n,connected_consumed:_n,protocol:gn,biz_product:_n,dev_changed:yn},As={event:"/sdk/net_first_audio_frame",webrtc_sid:_n,fft_consumed:pn,resource_type:gn,reliability:_n,push_consumed:_n,prepare_recv_consumed:_n,connected_consumed:_n,protocol:gn,biz_product:_n,dev_changed:yn},Ps="/app/lifecycle",Ms=gn,xs={event:"/sdk/publish_volume_changed",old_cap_volume:_n,cap_volume:_n,change_duration:_n,error:{ie:xi}},js="/sdk/listener",Ls="/sdk/network_change",qs="/sdk/network_first_ntp_sync",Us="/sdk/net_probe",Bs=_n,Js=bn,Vs={event:"/sdk/net_probe_result",is_switch:yn,is_publish:yn,stream_id:gn,result:_n,node:gn,net_quality:_n,probe_net_quality:_n},Hs="/cloud_setting/cache",Gs=pn,Fs="/cdn/play",Ys=gn,Zs=gn,Qs="/l3/play",Xs=_n,Ws=_n,Ks="/sdk/play_src_changed",$s=gn,tr=gn,ir="/publish/create_offer",er=yn,nr=_n,sr="/publish/set_local_sdp",rr=yn,or={event:"/publish/create_session",sdp:gn,is_mini:yn,gw_nodes:bn,gw_nodes_ttl:_n,gw_version:_n,webrtc_sid:_n},ur="/publish/set_remote_sdp",ar=yn,cr=_n,hr="/publish/ice_connected",fr="/publish/rtc_publish_event",lr=_n,dr="/rtc/play_event_message",vr=_n,mr="/rtc/recv_close_session",pr=pn,gr="/rtc/recv_reset_session",br="/rtc/ice_connection_state_changed",_r=gn,yr="/publish/send_media_desc",wr=_n,Sr="/publish/send_ice_candidate",Er=pn,Or="/play/create_offer",Tr=yn,kr="/play/set_local_sdp",Rr=yn,Ir={event:"/play/create_session",sdp:gn,is_mini:yn,gw_nodes:bn,gw_nodes_ttl:_n,gw_version:_n,webrtc_sid:_n},Nr="/play/set_remote_sdp",Cr=yn,zr=_n,Dr="/play/ice_connected",Ar="/play/send_media_desc",Pr=_n,Mr="/play/send_ice_candidate",xr=pn,jr="/zegoconn/connect",Lr="/sdk/net_ip_stack",qr=gn,Ur="/sdk/media_login_req",Br={event:"/zegoconn/proxy_connect",service_no:_n,proxy_link_sources:_n,recv_time:_n,connect_stream:_n},Jr={event:"/zegoconn/proxy_broken",service_no:_n},Vr={event:"/zegoconn/proxy_disconnect",service_no:_n},Hr="/rtc/exception_update",Gr=_n,Fr=gn,Yr={event:"/sdk/set_video_config",error:{ie:xi,Sn:Pi},video_params:pn,video_conf:pn},Zr={event:"/sdk/set_audio_config",error:{ie:xi,Sn:Pi},audio_params:pn,audio_conf:pn},Qr="/sdk/api/publish_video_en_size",Xr=_n,Wr=_n,Kr="/sdk/api/publish_video_en_bps",$r=_n,to="/sdk/api/publish_video_en_fps",io=_n,eo={event:"/sdk/replace_track",error:{ie:xi},track_kind:gn},no={event:"/device/api/video_c",error:{ie:xi,Tn:Xe,Sn:Pi,kn:ie},device:gn,device_name:gn,facing_mode:gn},so={event:"/device/api/audio_c",error:{ie:xi,Tn:Xe,Sn:Pi},device:gn,device_name:gn},ro={event:"/sdk/play_content_changed",webrtc_sid:_n,video_activate:yn,audio_activate:yn,video_layer:_n},oo="/sdk/mute_publish_video",uo=_n,ao=yn,co="/sdk/mute_publish_audio",ho=_n,fo="/device/enable_mic",lo=yn,vo=pn,mo="/device/enable_camera",po=yn,go=pn,bo="/sdk/mute_play_video",_o=_n,yo="/sdk/mute_play_audio",wo=_n,So={event:"/liveroom/send_stream_extra_info",error:{ie:xi,Rn:Qi,In:Ni,Nn:oe,Cn:{code:1103062,message:"update stream info fail"},_zpg_kExtraInfoNull:Qi,_zpg_kExtraInfoTooLong:{code:1003051,message:"the extra info of the stream is too long"}},stream_id:gn,send_seq:_n,stream_extra_info:pn,room_id:gn,room_sid_string:gn,use_na:_n},Eo="/active/sei",Oo=_n,To=_n,ko=["sdp","remote_sdp"],Ro=[-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 Io=o(955),No=o.n(Io),Co=o(5178),zo=o.n(Co),Do="TOKEN_ERROR",Ao="TOKEN_EXPIRED",Po="ROOM_INNER_ERROR";function Mo(t,i,e){i.success&&(e[t+"SuccessCallback"]=i.success),i.error&&(e[t+"ErrorCallback"]=i.error)}function xo(t,i){return i[t+"SuccessCallback"]}function jo(t,i,e,n){Mo(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 Lo(t,i){return{code:t,msg:i||"liveroom error"}}function qo(t,i){delete i[t+"SuccessCallback"],delete i[t+"ErrorCallback"]}function Uo(t,i){var e={code:t,message:"server error"};return e.code=t+52e6,i&&(e.message=i),e}function Bo(t,i){var e={1016:"MULTI_ROOM_UNABLE",1105:"ROOM_MAX_USER_COUNT",1012:"PUBLISHER_ERROR_REPETITIVE_PUBLISH_STREAM",2002:Do,2003:"ROOM_ERROR_LOGIN_TIMEOUT",2010:Do,5022:"MULTI_ROOM_COUNT_EXCEED",5030:"FORBID_BLACK_USER"};return t>2e5&&t<3e5?e[t-2e5]||Po:t<2e5?{50013:"USER_HAD_LOGIN_OTHER",50116:Do,50117:Ao,50118:Do,50119:Do,50120:Do,50121:Do,50122:Do,50123:Ao,50124:Do,50125:Do,50126:Do,50127:Do,50128:Do}[t]||e[t]||Po:e[t]||Po}function Jo(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&&1!==e[l].stream_state){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 Vo(t,i,e){return i=null!=i?i:1,e=null!=e?e:1e4,Vt(t)&&t%1==0&&t>=i&&t<=e}function Ho(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 Go(t,i,e){return t.push(i),t.length>e&&t.shift(),t.reduce(function(t,i){return t+i})/t.length}function Fo(t){return t<600?97-Math.pow(.09*t,1.1):18*Math.exp(.002*(600-t))}function Yo(t,i){if(i){return t<=55?99-Math.pow(.8*t,1.18):G.PoorMinQuality}var e=100*t;return e<=40?96-Math.pow(e,1.22):G.PoorMinQuality}function Zo(t,i,e){if(Ft(e))return Math.min(Fo(t),Yo(i,!0));var n=function(t){return t<=50?98-Math.pow(t,1.15):G.PoorMinQuality}(e);return.15*n+.85*Math.min(Fo(t),Yo(i,!1))}function Qo(t){return t>=G.ExcellentMinQuality?F.Excellent:t>=G.GoodMinQuality?F.Good:t>=G.MiddleMinQuality?F.Middle:t>=G.PoorMinQuality?F.Poor:F.Die}function Xo(){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 Wo(){return"function"==typeof RTCPeerConnection.prototype.setConfiguration}function Ko(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 $o(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 tu(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})}function iu(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}var eu=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&=i}return i>>>0};function nu(t,i,e){var n=(new Date).getTime(),s=A(),r="".concat(t,"_").concat(i,"_").concat(e,"_").concat(n,"_").concat(s);return eu(r)}function su(t,i){return(t&1<<i)>>i}function ru(){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 ou(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return((null==t?void 0:t.effectiveType)||(null==t?void 0:t.type)||"unknown").toUpperCase()}function uu(t,i){return No().encrypt(t,i).toString()}function au(t,i){try{return No().decrypt(t,i).toString(zo())}catch(t){return""}}function cu(t,i){try{localStorage.setItem(t,i)}catch(t){}}function hu(t){try{return localStorage.getItem(t)}catch(t){}}function fu(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?Uo(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 lu(t){return!(!t.startsWith("wss")||-1===t.indexOf("test")||!t.endsWith("ws"))}function du(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=Ro[255&t.charCodeAt(r++)]}while(r<o&&-1==i);if(-1==i)break;do{e=Ro[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=Ro[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=Ro[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=Qt(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 vu(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 mu(){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 pu,gu,bu=o(2799),_u=1,yu={product:"rtc_web",importLevel:a.H,levels:[0,10,100,1e3],bps:32e3},wu="0c9e6e0f8c0a8f4e",Su="z_net_access_servers",Eu="z_net_http3_access_servers",Ou="z_net_v6_access_servers",Tu="z_net_http3_v6_access_servers",ku="z_appconfig",Ru="z_appconfig_etag",Iu="z_geos",Nu="z_rtc_domains",Cu={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:bu.Mode.MODE_ONLINE,sdkType:3,connectVer:4,pcEstablishTimeout:15,scheme:"wss",location:"accesshub",wssMessageType:1},zu="weblogger-wss",Du="detaillog-global",Au=[{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],Mu="zm.0",xu="zm.wl",ju="zm.slf",Lu="zm.lg",qu="zm.lo",Uu="zm.sr",Bu="zm.fac",Ju="zm.fac.tk",Vu="zm.hlu",Hu="zm.cna",Gu="zm.gsac",Fu="zm.zpl.url",Yu="zm.glgf",Zu="zm.scsu",Qu="zm.on",Xu="zm.off",Wu="zm.rntk",Ku="zm.emr",$u="zm.rm.lg",ta="zm.rm.tl",ia="zm.rm.lgr",ea="zm.rm.lo",na="zm.rm.rr",sa="zm.rm.kco",ra="zm.rm.gwl",oa="zm.hhl",ua="zm.hb.st",aa="zm.hb.rsp",ca="zm.rrh.hlf",ha="zm.us.ftu",fa="zm.us.urp",la="zm.us.uph",da="zm.us.mg",va="zm.st.at",ma="ON_LISTENER",pa="zm.st.ofls",ga="zm.lrh.sm",ba="zm.lrh.hp",_a="zm.lrh.hsp",ya="zm.lrh.gs",wa="zm.lrh.lgi",Sa="zm.lrh.ful",Ea="zm.lrh.lgo",Oa="zm.lrh.sru",Ta="zm.lrh.scc",ka="zm.lrh.hd",Ra="zm.lrh.hb",Ia="zm.tc.ii",Na="zm.nt.od",Ca=function(t){return t},za=function(t){return t},Da=function(t){return t},Aa=function(t){return t},Pa=function(t){return t},Ma={event:"/sdk/init",error:{kInvalidParamError:Ut.INPUT_PARAM},system_info:Da,servers:function(t){return t},is_from_cache:Pa,project:Da,liveroom_version:Da,biz_type:Aa,lua_md5:Da,sev_env:Da,use_na:Aa},xa="listener",ja="/sdk/set_debug",La=Da,qa={event:"/sdk/set_log_config",error:{kInvalidParamError:Ut.INPUT_PARAM},log_level:function(t){return t},remote_log_level:Da,log_url:Da},Ua="/log/upload",Ba={event:"/sdk/login",room_id:Da,room_sid_string:Da,user_state_update:Aa,max_member_cnt:Aa,message:Da,token:Da,svr_env:Da,server:Da,try_cnt:Aa,room_mode:Aa,role:Aa,audience_create_room:Aa,liveroom_sid_string:Da,error:{ROOM_ID_NULL:Ut.ROOM_ID_NULL,INPUT_PARAM:Ut.INPUT_PARAM,ROOM_ID_TOO_LONG:Ut.ROOM_ID_TOO_LONG,ROOM_ID_INVALID_CHARACTER:Ut.ROOM_ID_INVALID_CHARACTER,USER_ID_NULL:Ut.USER_ID_NULL,USER_ID_TOO_LONG:Ut.USER_ID_TOO_LONG,USER_ID_INVALID_CHARACTER:Ut.USER_ID_INVALID_CHARACTER,USER_NAME_NULL:Ut.USER_NAME_NULL,USER_NAME_TOO_LONG:Ut.USER_NAME_TOO_LONG,REPEATEDLY_LOGIN:Ut.REPEATEDLY_LOGIN,LOGIN_TIMEOUT:Ut.LOGIN_TIMEOUT,INNER_ERROR:Ut.ROOM_INNER_ERROR,NETWORK_BROKEN:Ut.NETWORK_BROKEN,ROOM_COUNT_EXCEED:Ut.ROOM_COUNT_EXCEED,DIFFERENT_USER_ID:Ut.DIFFERENT_USER_ID,LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID:Ut.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID}},Ja="/sdk/sublogin",Va={event:"/zpush/login",sdk_zpush_sessionid_string:Da},Ha={event:"/liveroom/enter"},Ga={event:"/sdk/renew_token",error:{INPUT_PARAM:Ut.INPUT_PARAM,NOT_LOGIN:Ut.NOT_LOGIN},token:Da},Fa="/zpush/hb_timeout",Ya={event:"/sdk/logout",error:{INPUT_PARAM:Ut.INPUT_PARAM,ROOM_ROOMID_INCORRECT:Ut.ROOM_ROOMID_INCORRECT},room_id:Da,room_sid_string:Da,is_multi:Pa,is_send_cmd_net:Pa,liveroom_sid_string:Da,reason:Da},Za="/switch/logout_user",Qa="/liveroom/quit",Xa=Da,Wa=Da,Ka="/zpush/multi_logout_user",$a="/sdk/relogin",tc={event:"/liveroom/tempbroken"},ic={event:"/sdk/reconnect",room_broken_time:Aa},ec={event:"/sdk/disconnect",valid_d:Aa,total_d:Aa,tempbroken_cnt:Aa},nc="/sdk/kickout",sc=Aa,rc=Aa,oc={event:"/liveroom/hb",room_id:Da,room_sid_string:Da,interval:Aa,stream_seq:Aa,server_user_seq:Aa,error:{NOT_LOGIN:Ut.NOT_LOGIN,HB_TIMEOUT:Ut.TIMEOUT}},uc="/liveroom/recv_user_update_info",ac="/sdk/listener",cc={event:"/sdk/enable_multi_room",is_multi:Pa,error:{kInvalidParamError:Ut.INPUT_PARAM,kAlreadyLoginError:Ut.ALREADY_LOGIN}},hc="/cloud_setting/cache",fc=za,lc="/cloud_setting/refresh",dc=za,vc=za,mc="/cloud_setting/request",pc=za,gc=za,bc={event:"/liveroom/get_current_user_list",user_index:Aa,is_time_ascend:Pa,use_na:Aa},_c="/zegoconn/connect",yc=Da,wc=Aa,Sc="/zegoconn/create_socket",Ec="/zegoconn/disconnect",Oc=Da,Tc=Da,kc=Aa,Rc="/zegoconn/auto_dispatch",Ic=Ca,Nc=Ca,Cc=Ca,zc=Ca,Dc="/zegoconn/request",Ac=za,Pc="/sdk_config/init",Mc=za,xc=Aa,jc={event:"/zegoconn/proxy_connect",service_no:Aa,proxy_link_sources:Aa,recv_time:Aa,connect_stream:Aa},Lc={event:"/zegoconn/proxy_broken",service_no:Aa},qc={event:"/zegoconn/proxy_disconnect",service_no:Aa},Uc=[50116,50118,50119,50120,50121,50122,50124,50125,50126,50127,50128],Bc=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,Vt(t)&&t<3600&&(this.RETRY_MAX_TIME=t),Vt(i)&&(this.RETRY_START_TIME_INTERVAL=i),Vt(e)&&(this.RETRY_CONTINUE_COUNT=e),Vt(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}(),Jc=(pu=function(t,i){return pu=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])},pu(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}pu(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),Vc=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))},Hc=function(t){function i(i,e,n){var s=t.call(this)||this;return s.zn=i,s.Dn=e,s.An=n,s.Pn=0,s.Mn=0,s.xn=3,s.jn="",s.lastError=0,s.loginCompleted=!1,s.loginRoomCallback={},s}return Jc(i,t),Object.defineProperty(i.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),i.prototype.renewLocalToken=function(t,i){this.token=t,this.An.token=this.token;var e=(new Date).getTime(),n=parseInt(t.substring(0,2)),s=void 0;if(i&&Vt(i))s=1e3*i;else if(Ht(t)&&n>=3){var r=1e3*du(t.substring(2));this.zn.info("zm.rm.rlt time "+r+" "+e+" "+this.Dn.local_time_deviation),s=r-(e-this.Dn.local_time_deviation)}s&&this.roomHandler.resetTokenTimer(s),this.zn.setTokenInfo(t),this.Dn.actionListener("_tokenRenewed",t,this.An.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.zn.info($u+" retry call "+(null===(e=this.An)||void 0===e?void 0:e.roomID)+" "+t);var u=(null===(n=this.loginRoomCallback)||void 0===n?void 0:n.success)?Ja:$a;if(this.qn||(this.qn=this.Ln.createSpan(a.H,{key:Ba.event,par:this.roomID},{key:u,par:this.roomID},u,!0),this.jn=u),this.roomHandler.setRunState(r.trylogin),this.An.isMulti&&(null===(s=this.Dn.roomModulesList.find(function(t){return!t.isMulti}))||void 0===s?void 0:s.runState)!==r.login)this.zn.info($u+" service is disconnected, multi room stop retry");else if(this.retryTimer)this.zn.info($u+" has actived, ignore");else{var h=this.Dn.networkState==c.offline;if(h){if(this.zn.info($u+" check if really offline. "+this.Mn),this.Mn>=this.xn)return void this.zn.warn($u+" network is broken, stop retry")}else this.Mn=0;if(this.isOverTime)this.zn.info($u+" retry over time, stop retry");else{var f=function(){o.zn.info($u+" interval "+o.retryActiveInterval),o.retryTimer=setTimeout(function(){o.roomHandler.login(o.roomID,o.token,o.user,o.config,function(t){o.Dn.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.Mn++:o.retryActiveCount++},t?0:1e3*o.retryActiveInterval)};if(1==this.retryActiveCount)Ti().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.zn.info($u+" start max timer"),0===this.Pn&&(this.Pn=(new Date).getTime()),this.maxTimer=setTimeout(function(){var i;t.zn.info($u+" over max time ".concat(t.RETRY_MAX_TIME,"s, stop retry")),t.isOverTime=!0,t.roomHandler.resetRoom(),0!==t.Pn&&(i=(i=(new Date).getTime()-t.Pn)>0?i:void 0),t.Un(!1,Ut.LOGIN_TIMEOUT),t.qn&&(t.Ln.spanEnd({key:t.jn,par:t.roomID},{error:Ut.LOGIN_TIMEOUT.code,message:Ut.LOGIN_TIMEOUT.msg,try_time:i}),t.qn=null),t.loginRoomCallback.fail&&(t.loginRoomCallback.fail(Ut.LOGIN_TIMEOUT),t.roomHandler.disconnectedHandle(Ut.LOGIN_TIMEOUT),t.resetCallBack())},1e3*this.RETRY_MAX_TIME))},i.prototype.stopMaxTime=function(){this.zn.info($u+" stop max timer"),0!==this.Pn&&(this.Pn=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.An.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.An.resetSessionInfo(),!0;var s=Vc(Vc([202002,205030,205035],Uc,!0),[50013],!1);return 10015===e?(this.An.retryConnect(),!0):!(null==s?void 0:s.includes(e))&&(!!n.includes(e)||this.An.lastRunState==r.login&&(this.zn.warn("zm.rrh.he reset"),this.An.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.Un(!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.zn.info(ca+" "+t+" "+JSON.stringify(i)),i){if(this.qn){var s=void 0;0!==this.Pn&&(s=(s=(new Date).getTime()-this.Pn)>0?s:void 0),this.Ln.spanEnd({key:this.jn,par:this.roomID},{error:i.code,message:i.msg,try_time:s}),this.qn=null}if(this.handleError(i,e))this.zn.info(ca+" retry"),[40001].includes(i.code)?(this.Dn.roomModulesList.forEach(function(t){t.userHandler.updateUserDelete(t.roomID)}),this.retryLoginRoom(!1,!1,Ut.NETWORK_RECOVERY)):this.retryLoginRoom();else{this.zn.info(ca+" reset"),this.roomHandler.resetRoom(),this.Un(t,i);var r=this.Bn(i.code);if(this.loginRoomCallback.fail){this.loginRoomCallback.fail(i);var o="";e&&i.code===Bi&&(o=JSON.stringify({server_code:r})),this.roomHandler.disconnectedHandle(i,{extendedData:o}),this.resetCallBack()}}}else{s=void 0;0!==this.Pn&&(s=(s=(new Date).getTime()-this.Pn)>0?s:void 0),this.Un(t,{code:0,msg:""}),this.qn&&(this.Ln.spanEnd({key:this.jn,par:this.roomID},{room_id:this.roomID,room_sid_string:null===(n=this.An)||void 0===n?void 0:n.roomSidString,try_time:s}),this.qn=null),this.loginRoomCallback.success&&(this.loginRoomCallback.success(t),this.resetCallBack())}},i.prototype.invalid=function(){this.zn.info("zm.rh.ivd end retry"),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.retryActiveCount=1,this.Mn=0},i.prototype.Un=function(t,i){this.stopMaxTime(),this.invalid(),this.onactive(t,i)},i.prototype.Bn=function(t){return R+t},i.prototype.resetCallBack=function(){this.loginRoomCallback.success=void 0,this.loginRoomCallback.fail=void 0,this.loginCompleted=!0},i.prototype.resetError=function(){this.lastError=0},i}(Bc);!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"}(gu||(gu={}));var Gc={error:{code:0,msg:"suc"}},Fc={NOT_EMPTY:function(t,i,e,n,s){return void 0===i||""===i||null===i?(n.error("".concat(e," ").concat(t," is empty")),s):Gc},ILLEGAL_CHARACTERS:function(t,i,e,n,s){return di(i)?Gc:(n.error("".concat(e," ").concat(t," contains illegal characters")),s)},TYPE_STRING:function(t,i,e,n,s){return Ht(i)?Gc:(n.error("".concat(e," ").concat(t," must be string")),s)},TYPE_INTEGER:function(t,i,e,n,s){return mi(i,!1)?Gc:(n.error("".concat(e," ").concat(t," must be integer number")),s)},TYPE_OBJECT:function(t,i,e,n,s){return i&&Yt(i)?Gc:(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):Gc},MAX_LENGTH_64:function(t,i,e,n,s){return i.length>64?(n.error("".concat(e," ").concat(t," is too long")),s):Gc},MAX_LENGTH_100:function(t,i,e,n,s){return i.length>100?(n.error("".concat(e," ").concat(t," is too long")),s):Gc},MAX_LENGTH_128:function(t,i,e,n,s){return i.length>128?(n.error("".concat(e," ").concat(t," is too long")),s):Gc},MAX_LENGTH_256:function(t,i,e,n,s){return i.length>256?(n.error("".concat(e," ").concat(t," is too long")),s):Gc},MAX_LENGTH_1024:function(t,i,e,n,s){return i.length>1024?(n.error("".concat(e," ").concat(t," is too long")),s):Gc}};function Yc(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===gu.NOT_EMPTY||void 0!==h)&&Fc[f]){var l=Fc[f](c.key,h,c.action,c.logger,u[a]);if(l!=Gc)return l}}return Gc}var Zc=o(5733),Qc=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())})},Xc=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])}}},Wc=function(){function t(t,i){this.zn=t,this._dataReport=i,this.id="",this._debug=!1,this.appConfigEtag=-1,this.appConfigFetched=!1,this.customSetLogURL=!1,this.requestList={},this.mode=bu.Mode.MODE_ONLINE,this.connectState="connected",this.testNetPackageSize=!1,this.netGeoFencing={},this.agentIpStackDetection={IPv4:Dt.unknown,IPv6:Dt.unknown},this.isFlutter=!1,this.agentConnectIPStackType=Nt.IPv4,this.advanceConfig={},this.svrDomains={},this.userListenerList=["roomUserUpdate","roomOnlineUserCountUpdate","IMRecvCustomCommand","IMRecvBroadcastMessage","roomExtraInfoUpdate","IMRecvBarrageMessage","roomStateUpdate","tokenWillExpire","roomStateChanged","recvRoomTransparentMessage"],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:[],roomTokenWillExpire:[],_tokenRenewed:[],_protobufResponse:[],_cloudSettingNotify:[],_settingCanFetch:[],_beforeSwitchRoom:[],_afterSwitchRoom:[],_experimentalAPICallback:[],recvRoomTransparentMessage:[]},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.Jn=!1,this._sdkVersion="unknown",this.Vn=void 0,this.mode=Cu.modeNo}return Object.defineProperty(t.prototype,"selectIPStackMode",{get:function(){var t;return this.settingConfig.getSettingWithUserParams("ip_stack_mode",null===(t=ll.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,Zc.LoggerStateCenter.getInstance().debug=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"testEnvironment",{get:function(){return this._testEnvironment},set:function(t){this._testEnvironment=t,Zc.LoggerStateCenter.getInstance().testEnvironment=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ENV",{get:function(){return this._env},set:function(t){this._env=t,Zc.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.Hn:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableWSLog",{get:function(){var t,i;return 1===(null===(i=null===(t=this.appConfig)||void 0===t?void 0:t.log_config)||void 0===i?void 0:i.ws_log)||this.Jn},enumerable:!1,configurable:!0}),t.prototype.getRequestId=function(){return this.idName+"-"+D()},t.prototype.actionListener=function(t){for(var i=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var s=["roomStateChanged","roomExtraInfoUpdate","tokenWillExpire"].includes(t);if(s&&this.listenerList[t]){var r=this.reporter.createSpan(a.H,{key:xa},{key:""},ac);r.setAttributes({listener:t,listener_params:JSON.stringify(e)}),r.end()}s&&this.zn.info("zm.al ".concat(t," ").concat(JSON.stringify(e),". pageID: ").concat(ll.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.zn.error(va+" "+t+" "+JSON.stringify(e)),e}},0);else try{n.apply(void 0,e)}catch(e){throw i.zn.error(va+" "+t+" "+JSON.stringify(e)),e}})},t.prototype.onListener=function(t,i){return this.listenerList[t]?Qt(i)?(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0):(this.zn.error(ma+" listener callBack must be funciton"),!1):(this.zn.error(ma+" event "+t+" no found"),!1)},t.prototype.offListener=function(t,i){return this.listenerList[t]?Qt(i)?(-1!==this.listenerList[t].indexOf(i)&&(this.listenerList[t]=this.listenerList[t].filter(function(t){return t!==i})),!0):(this.zn.error(pa+" listener callBack must be funciton"),!1):(this.zn.error(pa+" 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.getLogWhiteList=function(t,i){var e,n;return void 0===t&&(t=!1),void 0===i&&(i=5),Qc(this,void 0,void 0,function(){var s,r,o,u,c,h,f,l,d,v,m,p=this;return Xc(this,function(g){switch(g.label){case 0:s=""+i,r=Si(this.reporter,a.H,"","/log/whitelist",Ma.event),Vt(o=this.Vn)&&(clearTimeout(o),this.Vn=void 0),u=1===(null===(n=null===(e=this.appConfig)||void 0===e?void 0:e.log_config)||void 0===n?void 0:n.ws_log),5===i&&(this.zn.enableWebSocketLog(u||!this.logDomain),s+=" ; ws_log: ".concat(u)),g.label=1;case 1:return g.trys.push([1,3,,4]),i--,[4,this.zn.getWhiteList()];case 2:return c=g.sent(),s+=" ".concat(Oi(c)),h=!1,f=!1,l=void 0,0===c.code&&1&(d=c.data).type&&(1&d.upload_log_type&&(l=d,h=!0,t?this.zn.uploadStorageLog().catch(function(t){p.zn.warn("".concat(ra," all zip log upload error: ")+JSON.stringify(t)+t)}):this.zn.makeZipLogSpaceUpload().catch(function(t){p.zn.warn("".concat(ra," history zip log upload error: ")+JSON.stringify(t)+t)})),this.Jn=f=!!(64&d.upload_log_type),this.zn.enableWebSocketLog(this.enableWSLog||!this.logDomain)),Ei(r,{need_retry:!1,need_report:h,need_ws:f,log_type:null==l?void 0:l.upload_log_type,log_start_time:null==l?void 0:l.start_time,log_end_time:null==l?void 0:l.end_time}),[3,4];case 3:return v=g.sent(),s+=" ".concat(v),m=!1,i>0&&(m=!0,this.Vn=function(t,i){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,ei([t,i],e,!1))}(function(){p.getLogWhiteList(t,i--)},3e3)),r.setAttributes({need_retry:m}),this.reporter.setError(r,{code:-1,message:""+v}),[3,4];case 4:return this.zn.info("".concat(ra," ").concat(s)),[2]}})})},t}(),Kc=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())})},$c=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])}}},th=function(){function t(t,i,e,n,s){this.zn=t,this.Dn=i,this._dataReport=e,this.Gn=n,this.An=s,this.Fn=null,this.Yn=d,this.Zn=null,this.Qn=0,this.Xn=!1,this.Wn=0,this.Kn=0,this.$n=36e5}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.prototype.es=function(){var t=this;this.ns(),this.Zn=setTimeout(function(){t.zn.warn("zm.hb.to call. "+t.Yn),t.hbLogout(Ut.HEARTBEAT_TIMEOUT),t.Ln.createSpan(a.H,{key:Ba.event,par:t.An.roomID},{key:""},Fa).end()},this.Yn)},t.prototype.ns=function(){this.Zn&&clearTimeout(this.Zn)},t.prototype.init=function(t){var i,e,n,s,r=this;this.Xn=!1,this.Kn=0,this.Wn=0,s=ii(null===(i=t.body)||void 0===i?void 0:i.hearbeat_interval)?t.body.hearbeat_interval<l?l:t.body.hearbeat_interval:3e4,this.Yn=ii(null===(e=t.body)||void 0===e?void 0:e.hearbeat_timeout)?null===(n=t.body)||void 0===n?void 0:n.hearbeat_timeout:d;var o=Math.floor(Math.random()*s);this.ns(),this.Fn&&clearTimeout(this.Fn),this.Fn=setTimeout(function(){r.start(s)},o),this.Qn++},t.prototype.start=function(t){return Kc(this,void 0,void 0,function(){var i,e,n,s,r=this;return $c(this,function(o){switch(o.label){case 0:return this.zn.info(ua+" call"),i=this.Ln.createSpan(a.H,{key:Ba.event,par:this.An.roomID},{key:""},oc.event),this.An.isLogin()?(e=function(t,e){var n,s,o,u,a=!0;if(t.header&&t.body){if(0!==(t.body&&t.body.err_code)){var c=Uo(t.body.err_code||t.body.code,t.body.err_message||t.body.message);i.setAttributes({error:c.code,message:c.message+t.body.err_code}),a=!1}}else i.setAttributes({error:t.code>0?t.code:Ut.ROOM_INNER_ERROR.code,message:t.msg?t.msg:Ut.ROOM_INNER_ERROR}),a=!1;r.ss(t,e),0===(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.err_code)&&i.setAttributes({interval:oc.interval(null===(s=null==t?void 0:t.body)||void 0===s?void 0:s.hearbeat_interval),stream_seq:oc.stream_seq(null===(o=null==t?void 0:t.body)||void 0===o?void 0:o.stream_seq),server_user_seq:oc.server_user_seq(null===(u=null==t?void 0:t.body)||void 0===u?void 0:u.server_user_seq)});var h=!1;a?h=!r.Kn||performance.now()-r.Kn>=r.$n:h=!0;h&&(r.Kn=performance.now(),i.end())},this.Gn.heartBeat(e,e,this.An,this.Yn),this.rs=t,n=this.rs,this.Qn>=2?[4,Ti()]:[3,2]):(this.zn.error(ua+" state error"),this.Kn=performance.now(),this.Ln.setError(i,oc.error.NOT_LOGIN),[2]);case 1:return s=o.sent(),n=Math.round(s*(this.rs+1)),this.Qn=1,[3,3];case 2:n=this.rs,o.label=3;case 3:return this.Zn||this.es(),this.Fn=setTimeout(function(){r.start(r.rs)},n),this.zn.info(ua+" call success"),[2]}})})},t.prototype.ss=function(t,i){var e,n;if(t.body&&t.body.err_code&&0!==t.body.err_code){if(this.zn.error(aa+" disconnect, server error="+t.body.err_code),40001==t.body.err_code)return;return t.body.err_code==s?void this.hbLogout(Ut.HEARTBEAT_TIMEOUT):void this.hbLogout(Lo(t.body.err_code))}if(!t.header||!t.body)return this.zn.error(aa+" disconnect, error="+JSON.stringify(t)+", seq = "+i),void this.hbLogout(t);ii(null===(e=t.body)||void 0===e?void 0:e.hearbeat_interval)&&(this.rs=t.body.hearbeat_interval,this.rs<l&&(this.rs=l)),ii(null===(n=t.body)||void 0===n?void 0:n.hearbeat_timeout)&&(this.Yn=t.body.hearbeat_timeout),this.Wn=(new Date).getTime(),this.Xn?this.zn.info(aa+" has reset"):this.es(),this.heartbeatRspNotiFy(t,this.An.roomID),this.zn.info(aa+" call success "+i)},t.prototype.heartbeatRspNotiFy=function(t,i){},t.prototype.hbLogout=function(t){},t.prototype.resetHeartbeat=function(){clearTimeout(this.Fn),this.Fn=null,this.Xn=!0,this.ns(),this.Qn=0,this.Kn=0,this.Wn=0,this.zn.info("zm.hb.rst call success")},t}(),ih={code:1102026,msg:"cancel login"};var eh=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:"")},nh=function(t){return function(t){var i=escape||window.escape;return decodeURIComponent(i(String.fromCharCode.apply(String,Array.from(t))))}(t)};function sh(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 rh="DISCONNECTED",oh="CONNECTED",uh="CONNECTING",ah=function(){function t(t,i,e,n,s){this.zn=t,this.Dn=i,this._dataReport=e,this.An=n,this.Gn=s,this.us=null,this.cs=1e4,this.hs=null,this.fs=0,this.ls=0,this.validTime=0,this.totalTime=0,this.brokenCounts=0,this.ds=0,this.vs=0,this.ps=!1,this.loginCallback={}}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gs",{get:function(){return this.An.roomID},enumerable:!1,configurable:!0}),t.prototype.resetTokenTimer=function(t){var i=this;this.zn.info("zm.rm.rst call: "+(t=(t=(t-=3e4)<0?0:t)>2147483647?2147483647:t)),this.hs&&clearTimeout(this.hs),this.hs=setTimeout(function(){i.Dn.actionListener("tokenWillExpire",i.gs),i.Dn.actionListener("roomTokenWillExpire",i.gs)},t)},t.prototype.bs=function(){this.hs&&clearTimeout(this.hs),this.hs=null},t.prototype.setRunState=function(t){this.An.runState!==t&&(this.An.lastRunState=this.An.runState,this.An.runState=t)},t.prototype._s=function(){this.us&&clearTimeout(this.us),this.us=null},t.prototype.ys=function(t){var i,e,n,s,r,o,u,c,h=this.Ln.createSpan(a.H,{key:Ya.event,par:this.gs},{key:""},this.Dn.isMultiRoom?Qa:Za);t&&"0"===this.Gn.zPushSid&&(this.Gn.zPushSid=null===(e=null===(i=this.Gn)||void 0===i?void 0:i.switchSessionID)||void 0===e?void 0:e.toString()),this.updateTimes();var f=t?null===(n=this.Gn)||void 0===n?void 0:n.zPushSid:null===(r=null===(s=this.Gn)||void 0===s?void 0:s.switchSessionID)||void 0===r?void 0:r.toString();h.setAttributes({room_id:Ya.room_id(null===(o=this.An)||void 0===o?void 0:o.roomID),room_sid_string:Ya.room_sid_string(null===(u=this.An)||void 0===u?void 0:u.roomSidString),liveroom_sid_string:Xa(null===(c=this.An)||void 0===c?void 0:c.userSidString),sdk_zpush_sessionid_string:Wa(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.zn.info(na+" call"),this.Dn.roomModulesList.length>1&&!t&&(this.An.isMulti=!0),this._s(),this.An.sessionExist&&this.An.runState!==r.logout&&!this.An.isDisConnect()){var n=function(t){e.ws(t,!e.An.isMulti)};this.Gn.logout(this.An,n,n)}this.ys(t),this.setRunState(r.logout),this.An.resetRoomSession(),this.An.resetUserSession(),this.An.isMulti||(this.Dn.userid="",this.zn.setSessionInfo(this.Dn.appid,this.gs,this.An.userSidString,this.Dn.idName,this.Dn.nickName,this.Dn.sdKVersion),null===(i=this.Gn)||void 0===i||i.reset()),this.resetRoomCallBack(),this.Dn.roomModulesList=this.Dn.roomModulesList.filter(function(t){return t!==e.An});var s=this.Dn.roomModulesList[0];(s&&(s.isMulti=!1,s.runState!==r.login&&s&&s.retryRoom()),this.Dn.isMultiRoom&&0===this.Dn.roomModulesList.length)&&(this.Ln.createSpan(a.H,{key:Ya.event,par:this.gs},{key:""},Ka).end(),this.Gn.zPushSid="0");this.zn.info(na+" 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.zn.info(sa+" call "+JSON.stringify(t));var f=function(t){var i={code:t,message:"kickout reason = "+t},e={code:63000005,message:"zpush token expired",name:Ao};switch(t){case 1:return{code:63000001,message:"zpush multiple login kickout",name:"MULTIPLE_LOGIN_KICKOUT"};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.Ln.createSpan(a.H,{key:Ba.event,par:this.gs},{key:""},nc);this.updateTimes(),l.setAttributes({error:null===(s=Ut[f.name||"ROOM_INNER_ERROR"])||void 0===s?void 0:s.code,message:f.message,kickout_reason:sc((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:rc(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.An.roomTryHandler;if(d)if(d.onactive=function(t,i){h.zn.info(sa+" onactive"),h.disconnectedHandle(i),h.Dn.actionListener("_kickout",i)},t.body.need_relogin&&1==t.body.need_relogin)this.An.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&&Ut[f.name]){v.custom_kickout_message=Ut[f.name].msg+"; kickout reason: "+(t.body.reason||t.body.kickout_reason)}this.disconnectedHandle(f.name&&Ut[f.name]?Ut[f.name]:Ut.ROOM_INNER_ERROR,{extendedData:JSON.stringify(v),isKickout:!0}),this.Dn.actionListener("_kickout",{code:Ut.MANUAL_KICKOUT.code,msg:Ut.MANUAL_KICKOUT.msg+t.body.reason||t.body.kickout_reason})}else this.zn.info(sa+" try handler no found")},t.prototype.handleHbLogout=function(t){var i,e=this,n=this.An.roomTryHandler;n&&(n.onactive=function(t,i){e.zn.warn(oa+" onactive"),e.transError(i),e.disconnectedHandle(i)},[Ut.HEARTBEAT_TIMEOUT.code].includes(null==t?void 0:t.code)||[105,152,2001].includes(null==t?void 0:t.code)||t.msg.endsWith("1000002001")||t.msg.endsWith("1000000152")||t.msg.endsWith("1000000105")?[Ut.HEARTBEAT_TIMEOUT.code].includes(t.code)?(this.Dn.roomModulesList.forEach(function(t){t.roomTryHandler&&(t.roomTryHandler.lastError=Ut.NETWORK_RECOVERY.code)}),this.An.retryRoom(!1,!1,Ut.NETWORK_RECOVERY)):(null===(i=this.An.roomTryHandler)||void 0===i?void 0:i.lastError)===Ut.NETWORK_RECOVERY.code?this.An.retryRoom(!1,!1,Ut.NETWORK_RECOVERY):this.An.retryRoom():[Ut.TIMEOUT.code,Ut.SOCKET_CLOSE.code].includes(null==t?void 0:t.code)?this.zn.warn(oa+" timeout "+Oi(t)):(this.zn.warn(oa+" unexpected error: ".concat(JSON.stringify(t))),this.logoutByError(t)))},t.prototype.logoutByError=function(t){var i=this.An.roomTryHandler;i&&(i.stopMaxTime(),i.invalid(),this.resetRoom(),this.disconnectedHandle(t))},t.prototype.onConnecting=function(t){this._roomStateHandle(uh,xt.Logining,t)},t.prototype.disconnectedHandle=function(t,i){if(t&&0!==t.code){this.bs();var e=(null==i?void 0:i.isKickout)?xt.Kickout:xt.ReconnectFailed;this.transError(t),this._roomStateHandle(rh,e,t,(null==i?void 0:i.extendedData)||t.msg)}else this._roomStateHandle(oh,xt.Reconnected,t,null==i?void 0:i.extendedData)},t.prototype.updateTimes=function(){this.updateValidTime(),this.updateTotalTime()},t.prototype.updateValidTime=function(){this.ds&&(this.validTime=this.validTime+Date.now()-this.ds,this.ds=0)},t.prototype.updateTotalTime=function(){this.vs&&(this.totalTime=Date.now()-this.vs)},t.prototype._roomStateHandle=function(t,i,e,n,s){var r,o,u,a,c=this,h=this.An.roomID,f=Date.now();if(i&&i==xt.Reconnecting){if(this.ls++,0===this.fs&&(this.fs=(new Date).getTime(),this.roomSpan(tc,h,i,{error:e,extendedData:n||""})),1===this.ls)return clearTimeout(this.Ss),void(this.Ss=setTimeout(function(){1===c.ls&&c._roomStateHandle(t,i,e,n,s)},8e3));clearTimeout(this.Ss)}this.zn.info("zm.rm.scb "+t+" "+JSON.stringify(e)),[oh,rh].includes(t)&&(this.ls=0,clearTimeout(this.Ss),this.ps&&this.brokenCounts++),t!==oh&&this.updateTimes(),i&&[xt.LoginFailed,xt.ReconnectFailed].includes(i)&&(i=(null===(r=this.An.roomTryHandler)||void 0===r?void 0:r.loginCompleted)?xt.ReconnectFailed:xt.LoginFailed),i&&[xt.Logined,xt.Reconnected].includes(i)&&((null===(o=this.An.roomTryHandler)||void 0===o?void 0:o.loginCompleted)?i=xt.Reconnected:(i=xt.Logined,this.vs=this.vs||f),this.ps=!1,this.ds=f),i&&[xt.Logining,xt.Reconnecting].includes(i)&&(i=(null===(u=this.An.roomTryHandler)||void 0===u?void 0:u.loginCompleted)?xt.Reconnecting:xt.Logining,this.vs&&(this.ps=!0));var l=0;switch(i){case xt.Reconnecting:break;case xt.ReconnectFailed:a=ec,0!==this.fs&&(this.fs=0);break;case xt.Reconnected:a=ic,0!==this.fs&&(l=(new Date).getTime()-this.fs,this.fs=0)}if(this.An.lastRoomState=this.An.roomState,this.An.roomState=t,this.An.roomReasonState=i,this.An.roomState!==this.An.lastRoomState){this.Dn.actionListener("_roomStateUpdate",h,t,e?e.code:0,n,i,s);var d=(null==e?void 0:e.code)||0;d==ih.code&&(d=0),this.Dn.actionListener("roomStateUpdate",h,t,d,n),this.Dn.actionListener("roomStateChanged",h,i,d,n),a&&this.roomSpan(a,h,i,{error:e,extendedData:n||"",brokenTime:l})}t===rh&&(this.vs=0,this.totalTime=0,this.validTime=0,this.brokenCounts=0)},t.prototype.roomSpan=function(t,i,e,n){var s,r,o=this.Ln.createSpan(a.H,{key:Ba.event,par:i},{key:""},t.event);o.setAttributes(e===xt.Reconnected?{room_broken_time:ic.room_broken_time((null==n?void 0:n.brokenTime)||0)}:{error:(null===(s=null==n?void 0:n.error)||void 0===s?void 0:s.code)||0,message:(null==n?void 0:n.extendedData)||""}),t===tc&&o.setAttributes({last_hb_success_ts:null===(r=this.An.heartBeatHandler)||void 0===r?void 0:r.Wn}),t==ec&&o.setAttributes({valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),o.end()},t.prototype.transError=function(t){if(this.zn.info("zm.rm.te "+JSON.stringify(t)),0!==t.code&&(t.code<2e9&&t.code>1e9||t.code<1e6)){var i=Bo(t.code);i&&Ut[i]&&(t.code=Ut[i].code,t.msg=Ut[i].msg)}},t.prototype.login=function(t,i,e,n,s,o,u){if(this.zn.info($u+" call:"+t),this.zn.remoteReport($u+" call:"+i),!this.An.isMulti&&this.zn.setSessionInfo(this.Dn.appid,t,"",e.userID,"",this.Dn.sdKVersion),n){var c=n.userUpdate,h=n.maxMemberCount;c&&Gt(c)&&(this.An.userStateUpdate=c),h&&Vt(h)&&(this.An.maxMemberCount=h)}if(!this.Dn.configOK)return this.zn.error($u+" init sdk wrong"),void o(Ut.INIT);this.An.runState!==r.trylogin&&this.setRunState(r.trylogin),this.An.isCancelLogin=!1,this.An.roomID=t,this.An.token=i,this.An.thirdToken=i,this.Dn.idName=e.userID,this.Dn.nickName=e.userName||e.userID,this.loginCallback.success=s,this.loginCallback.fail=o,this.Es=this.An.isMulti?Ha:Va,this.Ln.createSpan(a.H,{key:Ja,bak_key:$a,par:this.gs},{key:this.Es.event,par:this.gs},this.Es.event,!0),this._s(),this.onConnecting(u||{code:0,msg:""}),this.Os(),this.zn.info($u+" call success")},t.prototype.Os=function(){var t,i,e,n,s=this;if(this.An.runState===r.trylogin)if(this.An.isMulti&&this.An.isDisConnect())this.zn.warn(ta+" liveroom is not connected");else{var o=function(t,i){s.Ts(t,i)};(null===(t=this.Gn)||void 0===t?void 0:t.isUaConnect)?(this.Ln.spanSetAttributes({key:this.Es.event,par:null===(i=this.An)||void 0===i?void 0:i.roomID},{sdk_zpush_sessionid_string:null===(n=null===(e=this.Gn)||void 0===e?void 0:e.switchSessionID)||void 0===n?void 0:n.toString()}),this.Gn.login(this.An,o,o)):(this.us=setTimeout(function(){s.zn.info(ta+" over time no response, login timeout"),s.loginCallback.fail&&s.loginCallback.fail(Ba.error.LOGIN_TIMEOUT)},this.cs),this.zn.warn(ta+" ua is not connected")),this.zn.info(ta+" call success")}else this.zn.error("zb.rh.tl state error")},t.prototype.Ts=function(t,i){if(this.zn.info(ia+" seq: "+i+" "+JSON.stringify(t)),this.An.runState===r.trylogin)if(t.header&&t.body){if(t.header.seq!==i&&0==this.An.isMulti)return void this.zn.error(ia+" in wrong seq, local="+i+",recv="+t.header.seq);0!==t.body.err_code?(this.zn.error(ia+" server error="+t.body.err_code),this.ks(t)):(this.zn.info(ia+" call success."),this.Rs(t))}else this.zn.error(ia+" "+JSON.stringify(t)),this.ks(t);else this.An.isCancelLogin?(this.ks(ih),this.An.isCancelLogin=!1):this.zn.error(ia+" state error")},t.prototype.ks=function(t){this._s();var i=Ba.error.INNER_ERROR;t.header&&t.body?i=Lo(t.body.err_code):t.code&&t.msg&&(i=t),this.Ln.spanEnd({key:this.Es.event,par:this.gs},{error:i.code,message:i.msg}),this.loginCallback.fail&&this.loginCallback.fail(i,!0)},t.prototype.Rs=function(t){var i,e,n,s,o;this.An.checkRoomSession(t.body.room_session_id)&&(this.An.loginTime=Date.now());var u=this.An.lastRunState;this.setRunState(r.login),this.Dn.userid=t.body.user_id,this.An.longRoomSid=t.body.room_session_id,this.An.longSid=t.body.session_id;var a=((i={})[this.gs]={room_sid_string:this.An.roomSidString},i);this.Ln.setPublicPros(a);var c=null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.token_remain_time;this.Dn.configRoomAuth=c>0;var h=parseInt(this.An.token.substring(0,2));if(t.body.ret_timestamp&&h>=3){var f=(new Date).getTime(),l=f-t.body.ret_timestamp;this.Dn.local_time_deviation=l<5e3?0:l;var d=c>0?1e3*c:1e3*du(this.An.token.substring(2))-(f-this.Dn.local_time_deviation);this.resetTokenTimer(d)}!this.An.isMulti&&this.zn.setSessionInfo(this.Dn.appid,this.gs,this.An.userSidString,this.Dn.idName,this.Dn.nickName,this.Dn.sdKVersion),this.Ln.spanEnd({key:this.Es.event,par:this.gs},{room_id:null===(n=this.An)||void 0===n?void 0:n.roomID,room_sid_string:null===(s=this.An)||void 0===s?void 0:s.roomSidString,zpush_sessionid_string:Jt.isLong(this.Gn.switchSessionID)?this.Gn.switchSessionID.toString():"0",liveroom_sid_string:null===(o=this.An)||void 0===o?void 0:o.userSidString}),this._s(),this.loginSuccessCallBack(u,t),this._roomStateHandle(oh,xt.Logined,{code:0,msg:""}),this.Dn.getLogWhiteList(),this.loginCallback.success&&this.loginCallback.success(!0)},t.prototype.logout=function(t,i){this.zn.info(ea+" call");var e={code:0,msg:""};this.An.runState!==r.logout?(this.An.runState===r.trylogin&&(this.An.isCancelLogin=!0,e=ih),this.resetRoom(t),this._roomStateHandle(rh,xt.Logout,e,void 0,i),this.bs(),this.zn.info(ea+" call success")):this.zn.warn("zb.rh.lo at logout")},t.prototype.ws=function(t,i){var e;this.zn.info(ea+" result="+(t.body&&t.body.err_code?t.body.err_code:"-1")),i&&(null===(e=this.Gn)||void 0===e||e.closeRequest())},t}(),ch=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))},hh=function(){function t(t,i,e,n,s){this.zn=t,this.Dn=i,this._dataReport=e,this.Gn=n,this.An=s,this.Is=!1,this.Ns=[],this.Cs=0,this.zs=0,this.Ds=[],this.As=null,this.Ps=3e4,this.Ms=5e3,this.xs={anchor_id:"",anchor_id_name:"",anchor_nick_name:""}}return t.prototype.loginRsp=function(t,i){this.xs=t.body.anchor_info||this.xs,this.Ps=t.body.userlist_interval||this.Ps,this.Ms=t.body.userlist_merge_timeout||this.Ms,t.body.anchor_info&&(this.Dn.actionListener("getAnchorInfo",t.body.anchor_info.anchor_id_name,t.body.anchor_info.anchor_nick_name),this.Dn.actionListener("_getAnchorInfo",t.body.anchor_info.anchor_id_name,t.body.anchor_info.anchor_nick_name)),t.body.online_count&&this.Dn.actionListener("roomOnlineUserCountUpdate",this.An.roomID,t.body.online_count),this.zn.info("zm.us.lgr userStateUpdate "+this.An.userStateUpdate),this.An.userStateUpdate&&this.js(i)},t.prototype.patchUserList=function(t){var i=this;t.body.server_user_seq!==this.Cs&&this.An.userStateUpdate&&!this.As&&(this.zn.info("zm.us.pt call update user "+this.Cs+" server "+t.body.server_user_seq),this.As||(this.As={}),this.Ls&&clearTimeout(this.Ls),this.Ls=setTimeout(function(){i.qs()},this.Ms)),this.zs=t.body.server_user_seq,null!=t.body.online_count&&0!=t.body.online_count&&this.Dn.actionListener("roomOnlineUserCountUpdate",this.An.roomID,t.body.online_count)},t.prototype.resetUserHandler=function(){this.Is=!1,this.Us=0,this.Ns=[],this.Cs=0,this.zs=0,this.Ds=void 0,this.As={},this.Ls=void 0,this.Bs=void 0,this.Ps=3e4,this.Ms=5e3,this.xs={anchor_id:"",anchor_id_name:"",anchor_nick_name:""}},t.prototype.js=function(t){this.Is?this.zn.warn(ha+" is already querying"):(this.Is=!0,this.Ns=[],this.Js(0,t||0),this.zn.info(ha+" the first time call"))},t.prototype.Js=function(t,i){var e,n=this,s=function(t){n.Vs(t,i)},r={user_index:t,sort_type:0},o=bc;this.Dn.reporter.createSpan(a.H,{key:Ba.event,par:this.An.roomID},{key:o.event,par:this.An.roomID},o.event,!0).setAttribute("user_index",o.user_index(t)),null===(e=this.Gn)||void 0===e||e.fetchUserList(r,s,s,this.An)},t.prototype.Vs=function(t,i){var e,n,s=this;if(this.Dn.reporter.spanEnd({key:bc.event,par:this.An.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.Is=!1,this.Us=Date.now()+this.Ps,void this.zn.info(fa+" fetch error "+t.body.err_code);if(!t.header||!t.body)return this.Is=!1,this.Us=Date.now()+this.Ps,void this.zn.info(fa+" fetch error "+t);if(this.An.userStateUpdate){this.Ns=ch(ch([],this.Ns,!0),t.body.user_baseinfos,!0);var o=t.body.ret_user_index;if(o!=t.body.server_user_index)return this.zn.info(fa+" fetch another page"),void this.Js(o+1,i);this.Cs=t.body.server_user_seq;for(var u=[],a=[],c=0;c<this.Ns.length;c++){var h={userID:this.Ns[c].id_name,userName:this.Ns[c].nick_name,role:this.Ns[c].role};4!==h.role&&(u.push(h),a.push({idName:this.Ns[c].id_name,nickName:this.Ns[c].nick_name,role:this.Ns[c].role}))}this.Dn.actionListener("_getTotalUserList",this.An.roomID,a),i==r.login?(this.Ds&&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.zn,this.Ds,u,function(t,i){0!==t.length&&s.onUserStateUpdate(s.An.roomID,"ADD",t),0!==i.length&&s.onUserStateUpdate(s.An.roomID,"DELETE",i)}),this.Ds=u):(this.Ds=u,0!==u.length&&this.onUserStateUpdate(this.An.roomID,"ADD",u)),this.Is=!1,this.Us=Date.now()+this.Ps,this.Ns=[],this.zn.info(fa+" call success user_list "+u+", count: "+u.length+", seq: "+this.Cs)}else this.zn.info(fa+" not update")},t.prototype.handlePushUserStateUpdateMsg=function(t){var i=this;if(this.zn.info(la+" call"),this.An.userStateUpdate)if(this.Cs!==t.body.user_list_seq)if(this.Cs+t.body.user_actions.length===t.body.user_list_seq){this.Cs=t.body.user_list_seq;for(var e=[],n=0;n<t.body.user_actions.length;n++){var s={action:t.body.user_actions[n].Action,idName:t.body.user_actions[n].IdName,nickName:t.body.user_actions[n].NickName,role:t.body.user_actions[n].Role,loginTime:t.body.user_actions[n].LoginTime};4===s.role||e.push(s)}this.Dn.actionListener("_userStateUpdate",t.body.room_id,e);var r=[],o=[];e.forEach(function(t){var e;1==t.action?r.push({userID:t.idName,userName:t.nickName,role:t.role}):2==t.action&&((null===(e=i.Ds)||void 0===e?void 0:e.find(function(i){return i.userID===t.idName}))?o.push({userID:t.idName,userName:t.nickName,role:t.role}):i.zn.info(la+" user "+t.idName+" not exist"))}),this.Ds&&(this.Ds=this.Ds.concat(r).filter(function(t){return!o.some(function(i){return i.userID==t.userID})})),0!==r.length&&this.onUserStateUpdate(t.body.room_id,"ADD",r),0!==o.length&&this.onUserStateUpdate(t.body.room_id,"DELETE",o),this.zn.info(la+" call success")}else this.Hs(t.body.user_list_seq,t.body.user_actions);else this.zn.warn(la+" user_list_seq is the same with local seq");else this.zn.info(la+" userStateUpdate is false")},t.prototype.onUserStateUpdate=function(t,i,e){var n=this,s=e.filter(function(t){return t.userID!==n.Dn.idName});0!=s.length&&(s=s.map(function(t){return{userID:t.userID,userName:t.userName}}),this.Dn.actionListener("roomUserUpdate",t,i,s))},t.prototype.Hs=function(t,i){var e=this;this.As||(this.zn.warn(da+" new merge userlist "+this.Cs+" server "+t),this.As={},this.Ls&&clearTimeout(this.Ls),this.Ls=setTimeout(function(){e.qs()},this.Ms)),this.As[t]=i,this.zn.warn(da+" merge userlist "+this.Cs+" server "+t+" userlist "+i.length)},t.prototype.Gs=function(t){var i=this;this.zn.info("zm.us.mg merge userlist "+this.Cs+" userSeqList "+t.join(",")),this.Cs=t[t.length-1],this.Us=Date.now()+this.Ps;var e={};t.forEach(function(t){i.As&&i.As[t].forEach(function(t){e[t.IdName]=t})}),this.As=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.Ds=this.Ds&&this.Ds.concat(s).filter(function(t){return!r.some(function(i){return i.userID==t.userID})}),0!==s.length&&this.onUserStateUpdate(this.An.roomID,"ADD",s),0!==r.length&&this.onUserStateUpdate(this.An.roomID,"DELETE",r),this.Dn.actionListener("_userStateUpdate",this.An.roomID,n)},t.prototype.qs=function(){var t=this,i=Object.keys(this.As).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.zs)this.Gs(i);else{this.As=null;var e=this.Us-Date.now();this.zn.info("zm.us.mto fetch merge userlist "+this.Cs+" userSeqList "+i.join(",")+" wait "+e),e>0?(this.Bs&&clearTimeout(this.Bs),this.Bs=setTimeout(function(){t.js()},e)):this.js()}},t.prototype.updateUserDelete=function(t){this.Ds&&this.Ds.length&&(this.onUserStateUpdate(t,"DELETE",this.Ds),this.Ds=[])},t}(),fh=function(){function t(t,i,e,n,s,o){this.roomID=t,this.Dn=i,this.zn=e,this.dataReport=n,this.rtm=s,this.Gn=o,this.runState=r.logout,this.lastRunState=r.logout,this.lastRoomState="DISCONNECTED",this.roomState="DISCONNECTED",this.roomReasonState=xt.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 ah(this.zn,this.Dn,this.dataReport,this,o),this.heartBeatHandler=new th(this.zn,this.Dn,this.dataReport,this.Gn,this),this.userHandler=new hh(this.zn,this.Dn,this.dataReport,this.Gn,this),this.initMessageHandler(),this.initLiveHandler(),this.init()}return Object.defineProperty(t.prototype,"logger",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateCenter",{get:function(){return this.Dn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"liveRoomHandler",{get:function(){return this.Gn},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){var n;t.zn.info("zm.lrm.brh login suc "+i),t.heartBeatHandler.init(e),t.Gn.startCheck(),t.userHandler.loginRsp(e,i),t.messageHandler&&t.messageHandler.loginRsp(e),null===(n=t.roomTryHandler)||void 0===n||n.resetError(),t.isMulti||t.Fs(),t.Ys(e)},this.roomHandler.resetRoomCallBack=function(){t.heartBeatHandler.resetHeartbeat(),t.liveHandler&&t.liveHandler.resetLiveHandler(),t.messageHandler&&t.messageHandler.resetMessageInfo(),t.Gn&&t.Gn.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.Dn.actionListener("HBResponse",t,i)},t.prototype.Ys=function(t){this.Dn.actionListener("roomLoginResponse",t)},t.prototype.checkRoomSession=function(t){return null!==this.longRoomSid&&this.longRoomSid.eq(t)},t.prototype.Fs=function(){this.Dn.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=Bo(e.code);n&&Ut[n]&&(e=Ut[n]),t.roomHandler._roomStateHandle("DISCONNECTED",xt.ReconnectFailed,e,e.msg)}else t.roomHandler._roomStateHandle("CONNECTED",xt.Reconnected,e)},i.lastError===Ut.NETWORK_RECOVERY.code?i.retryLoginRoom(!0,!1,Ut.NETWORK_RECOVERY):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.Gn.isDisConnect()},t.prototype.retryConnect=function(){this.zn.info("zm.lrm.rc call"),this.resetSessionInfo(),this.Gn.closeRequest()},t.prototype.retryRoom=function(t,i,e){void 0===t&&(t=!1),void 0===i&&(i=!1),this.zn.info("zm.lrm.rr.0 call retryNow:"+t+" resetSession: "+i+" "+Oi(e));var n=this.roomTryHandler;n&&this.rtm.isUaConnect&&n.retryLoginRoom(t,i,e)},t.prototype.resetSessionInfo=function(){var t;this.zn.info("zm.lrm.rsi call"),this.resetRoomSession(),this.resetUserSession(),null===(t=this.Gn)||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}(),lh=o(4883),dh=function(){function t(t){void 0===t&&(t=!1),this.close=!1,this.isLoad=!1,this.callBackList=[],this.close=t,this.close||(this.Zs=new lh.ZegoSetting)}return t.prototype.setLog=function(t){var i;null===(i=this.Zs)||void 0===i||i.setLog(t)},t.prototype.init=function(t){var i;null===(i=this.Zs)||void 0===i||i.init(t)},t.prototype.setEnvVariable=function(t,i){var e;null===(e=this.Zs)||void 0===e||e.setEnvVariable(t,i)},t.prototype.getEnvVariables=function(){var t;return null===(t=this.Zs)||void 0===t?void 0:t.getEnvVariables()},t.prototype.fetchSetting=function(t,i,e){return this.Zs?this.Zs.fetchSetting(t,i,e):Promise.resolve()},t.prototype.fetchMultiSetting=function(t,i,e){return this.Zs?this.Zs.fetchMultiSetting(t,i,e):Promise.resolve()},t.prototype.setOptions=function(t){var i;return this.close||null===(i=this.Zs)||void 0===i?void 0:i.setOptions(t)},t.prototype.getSettingCache=function(t){var i;return this.Zs?null===(i=this.Zs)||void 0===i?void 0:i.getSettingCache(t):Promise.resolve()},t.prototype.setToken=function(t){var i;null===(i=this.Zs)||void 0===i||i.setToken(t)},t.prototype.setUserID=function(t){var i;null===(i=this.Zs)||void 0===i||i.setUserID(t)},t.prototype.activePolling=function(){var t;null===(t=this.Zs)||void 0===t||t.activePolling()},t.prototype.uninit=function(){var t;null===(t=this.Zs)||void 0===t||t.uninit()},t.prototype.getEnvVariable=function(t){var i;null===(i=this.Zs)||void 0===i||i.getEnvVariable(t)},t}(),vh=function(){function t(t){this.Qs=-1,this.Xs=3e4,this.Ws=0,this.Xs=t}return t.prototype.trigger=function(){var t,i=performance.now();(this.Ws++,-1===this.Qs)?(t={toReport:!0,failCount:this.Ws},this.Qs=i,this.Ws=0):i-this.Qs>this.Xs?(t={toReport:!0,failCount:this.Ws},this.Qs=i,this.Ws=0):t={toReport:!1};return t},t}(),mh=o(757);function ph(){return navigator.userAgent||""}function gh(){return null!==navigator.platform.match(/iPhone|iPod|iPad|ios/i)}function bh(){return null!==ph().match(/Android|android/i)}function _h(){return null!==ph().match(/OpenHarmony|HarmonyOS/i)}function yh(){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 wh(){return"safari"==yh().name.toLowerCase()}function Sh(){return"chrome"==yh().name.toLowerCase()}function Eh(){return"firefox"==yh().name.toLowerCase()}function Oh(){return Sh()&&!!navigator.userAgent.toLocaleLowerCase().match(/redmi\snote\s8/)}function Th(){var t=ph();return!!(t.match(/Mobi/i)||t.match(/Android/i)||t.match(/iPhone/i))}function kh(){var t,i;return!!(null===(i=null===(t=ph())||void 0===t?void 0:t.toLowerCase())||void 0===i?void 0:i.match(/MicroMessenger/i))}function Rh(){var t=ph().toLowerCase().match(/cpu iphone os (.*?) like mac os/);return t&&t[1]||""}function Ih(){return gh()?B.IOS:bh()?B.ANDROID:null!==navigator.platform.match(/Mac|Mac68K|MacPPC|MacIntel/i)?B.MAC:null!==navigator.platform.match("Win32")&&null===ph().match(/WOW64|Win64|x86_64|x86-64|x64;|amd64|AMD64|x64_64/i)?B.WIN32:_h()?B.Harmony:B.UNKNOWN}var Nh=function(){return Nh=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},Nh.apply(this,arguments)},Ch=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])}}},Dh=function(){function t(t){this.zn=t,this.Ks=yu.product,this.tr={},this.ir={},this.isUnload=!1;new mh.DynamicCode;this.er=new mh.ZegoTracer(ll.proxyCtrl),this.er.setSampleConfig({level:a.L}),this.nr=Ih()}return Object.defineProperty(t.prototype,"tracer",{get:function(){return this.er},enumerable:!1,configurable:!0}),t.prototype.init=function(t,i,e){var n=this;this.er.init({product:this.Ks,version:"1.0.0",env:i,appID:t,deviceID:e,importantLevel:yu.importLevel,levels:yu.levels,bps:yu.bps,spanStart:function(t){try{Qt(window.scriptSpanStart)&&scriptSpanStart(n.ir,n.er,t)}catch(t){n.zn.warn(Ia+" dy span start "+t)}},spanBeforeEnd:function(t){t.setAttribute("ntype_end",ou())},spanEnd:function(t,i){try{Qt(window.scriptSpanEnd)&&scriptSpanEnd(n.ir,n.er,t)}catch(t){n.zn.warn(Ia+" dy span end "+JSON.stringify(t))}},resources:{product:this.Ks,appid:t,device_id:e,console:0==i?"rtc":"ali"},deflate:this.zn.deflate})},t.prototype.setConfig=function(t){this.er.setConfig(t)},t.prototype.loadScript=function(t,i,e,n){return Ch(this,void 0,void 0,function(){var s;return zh(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.er.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(),Qt(window.scriptInit)&&scriptInit(this.ir,this.er),[3,3];case 2:return s=r.sent(),this.zn.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.er.startReport(e)},t.prototype.flush=function(t){this.er.flush(t)},t.prototype.destroy=function(){this.er.destroy()},t.prototype.setCommonStates=function(t){this.ir=t},t.prototype.setResource=function(t){this.er.setResource(t)},t.prototype.setCommonAttributes=function(t){this.tr=Object.assign({},this.tr,t)},t.prototype.deleteCommonAttributes=function(t){var i=this;t.forEach(function(t){delete i.tr[t]})},t.prototype.createSpan=function(i,e,n){var s=this.er.createSpan(i,e,{parent:n});return t.reportCustomerContext>0&&s.setAttributes({customer_context:t.reportCustomerContext}),s.setAttributes(Nh({ntype:ou(),os_type:this.nr,error:0,message:""},this.tr)),s},t.prototype.spanEnd=function(t,i,e){t&&i&&t.setAttributes(Nh({},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.er.setLogger(t)},t.prototype.setTimeOffset=function(t){this.er.setTimeOffset(t)},t.prototype.setUnloadState=function(t){this.isUnload=!0,this.er.setUnloadState(t)},t.prototype.setNetStateCheck=function(){this.er.setNetStateCheck()},t.prototype.getUploadStatus=function(){return this.er.getUnloadStatus()},t.reportCustomerContext=0,t}(),Ah=function(){return Ah=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},Ah.apply(this,arguments)},Ph=(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"]),Mh=["/sdk/start_play","/play/start","/play/restart"],xh=function(){function t(t){this.zn=t,this.sr={},this.rr={},this.ur={},this.ar=new Map,this.tracerHandler=new Dh(t)}return t.setReportCustomerContext=function(t){Dh.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.ar.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.sr)null==i.sr[e].span&&delete i.sr[e][t]})},t.prototype.setPublicPros=function(t){this.rr=Object.assign({},this.rr,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.sr[i.key])||void 0===r?void 0:r[i.par+c])&&i.bak_key&&(u=null===(o=this.sr[i.bak_key])||void 0===o?void 0:o[i.par+c])}else i&&!(u=this.sr[i.key])&&i.bak_key&&(u=this.sr[i.bak_key]);(u||(u=this.sr[Ma.event]),a=this.tracerHandler.createSpan(t,n,u),"/sdk/login"===i.key&&(a.setAttribute("room_id",i.par),this.rr[i.par]&&a.setAttributes(this.rr[i.par])),(Ph.includes(i.key)||Mh.includes(i.key))&&a.setAttribute("stream_id",i.par),Ph.includes(i.key)&&this.rr["_publish_"+i.par]&&a.setAttributes(this.rr["_publish_"+i.par]),Mh.includes(i.key)&&this.rr["_play_"+i.par]&&a.setAttributes(this.rr["_play_"+i.par]),s)&&(e.par?(!this.sr[e.key]&&(this.sr[e.key]={}),this.sr[e.key][e.par+(c=e.par1?"_"+e.par1:"")]=a):this.sr[e.key]=a);return a},t.prototype.setSpanInMap=function(t,i){i.par?(!this.sr[i.key]&&(this.sr[i.key]={}),this.sr[i.key][i.par+(i.par2?"_"+i.par2:"")]=t):this.sr[i.key]=t},t.prototype.spanEnd=function(t,i,e,n){var s;t.par?(s=this.sr[t.key]&&this.sr[t.key][t.par+(t.par1?"_"+t.par1:"")],this.sr[t.key]&&!e&&delete this.sr[t.key][t.par]):(s=this.sr[t.key],!e&&delete this.sr[t.key]);this.tracerHandler.spanEnd(s,i,n)},t.prototype.spanReport=function(t){var i;t.par?(i=this.sr[t.key]&&this.sr[t.key][t.par+(t.par1?"_"+t.par1:"")],this.sr[t.key]&&delete this.sr[t.key][t.par]):(i=this.sr[t.key],delete this.sr[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.sr[t.key]&&this.sr[t.key][t.par+n])&&t.bak_key&&(e=this.sr[t.bak_key]&&this.sr[t.bak_key][t.par+n])}else!(e=this.sr[t.key])&&t.bak_key&&(e=this.sr[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.sr[t.key]&&this.sr[t.key][t.par+s])&&t.bak_key&&(n=this.sr[t.bak_key]&&this.sr[t.bak_key][t.par+s])}else!(n=this.sr[t.key])&&t.bak_key&&(n=this.sr[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.ur[t]=i},t.prototype.getAPIErrorReport=function(t){return this.ur[t]},t.prototype.takeAPIErrorReport=function(t,i,e,n){if(e){var s=this.ar.get(t);s||(s=new vh(e),this.ar.set(t,s));var r=s.trigger(),o=r.failCount;if(r.toReport){var u=this.createSpan(a.I,{key:Ma.event},{key:""},t);u.setAttributes(Ah({api_fail_count:o},n)),this.setError(u,i)}}},t}(),jh=o(3788);const Lh=o(6994);(jh=jh.default||jh).util.Long=Lh.default||Lh,jh.util.Long.fromBits=jh.util.Long.fromBits||function(){return 0};for(var qh=jh.roots,Uh=jh.types?jh.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},Bh=jh.types?jh.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},Jh=Object.keys(Uh),Vh={$:function(t){return Vh[t]?Vh[t].call(this):qh[t].decode?qh[t].decode(this,this.uint32()):Vh.$.call(this,"int32")}},Hh={$:function(t,i,e){var n=Uh[t];return void 0===n?qh[t].encode?(this.uint32(e<<3|2).fork(),qh[t].encode(i,this).ldelim()):Hh.$.call(this,"int32",i,e):Hh[t].call(this.uint32(e<<3|n),i)}},Gh=0;Gh<Jh.length;Gh++)Vh[Jh[Gh]]=jh.Reader.prototype[Jh[Gh]],Hh[Jh[Gh]]=jh.Writer.prototype[Jh[Gh]];!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]]=jh.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)?jh.util.emptyArray:"bytes"===a?jh.util.newBuffer([]):u[2]&&u[2].hasOwnProperty("low")&&u[2].hasOwnProperty("high")?jh.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 jh.Reader||(t=jh.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]===jh.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!==Bh[c=!Vh[c]&&!qh[c].decode?"int32":c]&&2==(7&o))for(var f=t.uint32()+t.pos;t.pos<f;)r[a].push(Vh.$.call(t,c));else r[a].push(Vh.$.call(t,c))}else r[a]=Vh.$.call(t,c)}else t.skipType(7&o)}return r},s.encode=function(t,e){for(var n in e||(e=jh.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===Uh[o]&&!qh[o].encode?"int32":o,c&&void 0!==Bh[o]){e.uint32(n<<3|2).fork();for(u=0;u<h.length;u++)Hh[o].call(e,h[u]);e.ldelim()}else for(u=0;u<h.length;u++)Hh.$.call(e,o,h[u],n)}}else null!=t[r]&&t.hasOwnProperty(r)&&Hh.$.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){jh.rpc.Service.call(this,t,i,e)}return(n.prototype=Object.create(jh.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,qh[r[0]],qh[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&&(qh[`${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]}}}}},"",qh,!1);var Fh,Yh=qh.rtc,Zh=function(){return Zh=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},Zh.apply(this,arguments)},Qh=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())})},Xh=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])}}},Wh=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"}(Fh||(Fh={}));var Kh=0,$h=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=Kh++,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?Fh.CONNECTING:(null===(t=null==this?void 0:this.socket)||void 0===t?void 0:t.readyState)||Fh.CLOSED},enumerable:!1,configurable:!0}),t.prototype.createSocket=function(){return Qh(this,void 0,void 0,function(){var t,i,e,n,s,r=this;return Xh(this,function(o){switch(o.label){case 0:if(this.socket&&this.socket.readyState!==Fh.CLOSED)return[2];t=null,i=this.activeServer?Wh([this.activeServer],this.servers,!0):this.servers,e=function(e){var s,o,u;return Xh(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=Yh.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=Yh.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=Zh(Zh({},this.params),t)},t.prototype.open=function(){this.isConnecting=!0,this.readyState!==Fh.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}(),tf=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())})},ef=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])}}},nf=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))},sf=Yh.webproxy;function rf(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 of(t,i){return tf(this,void 0,void 0,function(){var e,n,s,r,o,u;return ef(this,function(a){switch(a.label){case 0:e=new Uint8Array,n=[],s=Array.from(t),r=function(t){var r,o;return ef(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=eh(n.join("\r\n"));n=[];var a=new Uint8Array(s);e=rf([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=eh(n.join("\r\n")),n=[],[2,e=rf([e,u])]}})})}function uf(t){return tf(this,void 0,void 0,function(){var i,e,n;return ef(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,of(t,e)];case 1:return[2,{body:s.sent(),contentType:"multipart/form-data; boundary="+e}]}})})}var af,cf=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.cr=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 $h(this.urls,{target:t,appid:this.appID,token:this.token,userID:this.userID},this.activeServer);return n.onActiveServer=function(t){e.cr(t)},n},t.prototype.getTurnInfo=function(){var t;return tf(this,void 0,void 0,function(){var i,e,n;return ef(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=sf.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=sf.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="/"),tf(this,void 0,void 0,function(){var e,n,s,r,o,u,a;return ef(this,function(c){switch(c.label){case 0:e=null,n=null,s=this.activeServer?nf([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.cr(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 tf(this,void 0,void 0,function(){var e,n;return ef(this,function(s){switch(s.label){case 0:return e=sf.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,sf.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:eh("request time out.")}))},null==n?void 0:n.timeout),new Promise(function(i,e){return tf(s,void 0,void 0,function(){var n,s,r,o,u,a,c,h,f,l,d,v,m,p,g;return ef(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,uf(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=eh(t.body)),u=sf.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?nf([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:eh(JSON.stringify(c))}),[2]):[4,null==a?void 0:a.arrayBuffer()];case 10:if(v=b.sent()||[],m=sf.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(nh(p.body))}catch(t){p.body=nh(p.body)}i(p)}else e({status_code:-1,headers:[],body:JSON.parse(nh(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:eh(JSON.stringify(t))}))})},t}(),hf=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())})},ff=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"}(af||(af={}));var lf,df,vf,mf=function(){function t(t){this.hr=t}return t.prototype.init=function(t){},t.prototype.createSocket=function(t,i){try{return new WebSocket(this.lr(t,i))}catch(t){throw console.error(t),t}},t.prototype.lr=function(t,i){var e=this;return t.replace(/^(https?:\/\/|wss?:\/\/)([\w.-]+)(?::(\d+))?/,function(t,n,s,r){var o="";if(e.hr){var u=e.hr,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:eh("request time out.")}))},null==n?void 0:n.timeout),new Promise(function(i,e){return hf(s,void 0,void 0,function(){var n,s,r,o,u,a;return ff(this,function(c){switch(c.label){case 0:n=t.body,s=null,r=null,o=this.lr(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:eh(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:eh("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:eh(JSON.stringify(t))}))})},t.prototype.destroy=function(){},t}(),pf=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))},gf=["relogin_token"],bf=["id_name","nick_name"],_f=pf(pf(["stream_id"],bf,!0),["extra_info","title","stream_attr","stream_title"],!1),yf=["trans_type"],wf=["trans_channel"],Sf=pf([],bf,!0),Ef=["msg_id","msg_client_id"],Of=pf(["trans_type"],wf,!0),Tf=pf([],wf,!0),kf=pf(["trans_type","trans_data"],bf,!0),Rf=pf([],wf,!0),If=pf([],kf,!0),Nf=["stop_stream_id_list"],Cf=pf([],bf,!0),zf=["id_name","custom_reason"],Df=["stream_id_list"],Af=["sender_idname","sender_nickname"],Pf=pf([],_f,!0),Mf=pf(pf([],bf,!0),["msg_content"],!1),xf=pf(pf([],bf,!0),["msg_id","msg_content"],!1),jf=pf(pf([],bf,!0),["trans_type","trans_data","trans_channel"],!1),Lf=pf(pf([],bf,!0),wf,!0),qf=["trans_type","trans_data"],Uf=["sender_idname","sender_nickname","msg_content"],Bf=[[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"],[11007,"PushTransparentMsg"],[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"],[303021,"SignalTransparentMsgReq"],[303022,"SignalTransparentMsgRsp"],[303023,"SendChannelMsgReq"],[303024,"SendChannelMsgRsp"],[304001,"GetUserlistReq"],[304002,"GetUserlistRsp"]],Jf=Bf.reduce(function(t,i){var e=i[0];return t[e]=[12001,12002,12003].includes(e)?"PushStream":i[1],t},{}),Vf=Bf.reduce(function(t,i){return t[i[1]]=i[0],t},{}),Hf=o(3788),Gf=o(6440),Ff=o.n(Gf),Yf=o(4636),Zf=o.n(Yf),Qf=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 Ff().create(e,i)},t}(),Xf=function(){return Xf=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},Xf.apply(this,arguments)},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))};Hf.util.Long=Jt,Hf.configure(),lf=Yh,df=Yh.liveroom_cs_v3,vf=Yh.proto_switch_v3;var Kf,$f=1001,tl=1002,il=1003,el=1004;!function(t){t[t.disconnected=0]="disconnected",t[t.broken=1]="broken",t[t.connected=2]="connected"}(Kf||(Kf={}));var nl=function(){function t(t,i,e,n,s){var r,o,u,c,h,f,l,d,v=this;this.zn=t,this.Dn=i,this._ua=e,this._dataReport=n,this.rtm=s,this.seq=0,this.dr={},this.vr="",this.zPushSid="0",this.mr=[["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.pr=100,this.gr=1e4,this.br=2e3,this._r=lf,this.yr={},this.wr={},this.Sr={},this.Er=[Vf.PushReq,Vf.MergePushReq,Vf.PushKickout],this.Or=[Vf.LoginRoomRsp,Vf.LogoutRoomRsp,Vf.PushKickout,Vf.PushReq,Vf.MergePushReq],this.Tr=[1105],this.kr=Kf.disconnected,this.Rr=[11001,11002,11003,11004],this.Ir="",this.Nr=new Qf,this.Cr=this._ua.getPCRequest(bu.BusinessService.SERVICE_SWITCH4LIVEROOM),this.switchSessionID=Jt.fromInt(0),null===(r=this.Cr)||void 0===r||r.on("connected",function(t){v.zr(t)}),null===(o=this.Cr)||void 0===o||o.on("broken",function(t){v.Dr()}),null===(u=this.Cr)||void 0===u||u.on("disconnected",function(t,i){v.Ar(t,i)}),null===(c=this.Cr)||void 0===c||c.on("downLoadMessage",function(t,i){v.handlePush(t,i)}),null===(h=this.Cr)||void 0===h||h.on("exception",function(t,i){v.zn.info("zm.lrh.o.0 except "+JSON.stringify(t))}),null===(f=this.Cr)||void 0===f||f.on("pcBrokenEvent",function(t){var i=Lc,e=v.Ln.createSpan(a.H,{key:_c},{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.Cr)||void 0===l||l.on("pcDisconnectedEvent",function(t){var i=qc,e=v.Ln.createSpan(a.H,{key:_c},{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.Cr)||void 0===d||d.on("pcConnectedEvent",function(t){var i=jc,e=v.Ln.createSpan(a.H,{key:_c},{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,"Pr",{get:function(){return Object.values(this.dr)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nickName",{get:function(){return eh(this.Dn.nickName)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TermType",{get:function(){return this.Dn.ENV%2==0?e.TT_WEB:e.TT_MINIPROGRAM},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.prototype.isDisConnect=function(){return this.kr!==Kf.connected},t.prototype.getHeader=function(t,i,e){var n={cmd:t,seq:i,timestamp:(new Date).getTime()};this.Mr&&(n.controls=this.Mr),(null==e?void 0:e.contextKey)&&(n.context_key=null==e?void 0:e.contextKey);var s=vf.Header.create(n),r=vf.Header.encode(s).finish();return{seq:n.seq,content:r}},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=this;void 0===r&&(r={timeout:6e3,resend:!1}),void 0===o&&(o=!0),this.zn.info(ga+" call"),++this.seq;var h,f=function(){if(o){var u={seq:c.seq,sendTime:Date.parse(new Date+""),timeout:r.timeout,resend:r.resend,success:e,error:function(t,i,e){var s;c.zn.error(ga+" error "+i+" "+Oi(t)+" "+Oi(e)+" "+!!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!==Vf.LoginRoomRsp){var h=c.Dn.roomModulesList.find(function(t){return t.roomID==a});if([1002,105].indexOf(o)>-1)return u===Vf.EnterRoomRsp&&h?h?void h.retryRoom(!1,!0):void c.zn.error(ga+" room no found ignore "):void c.rtm.retryRoom(!1,void 0,!0);if([141].includes(o)&&h)return void h.roomHandler.logoutByError({code:o,msg:null==r?void 0:r.err_message})}n&&n(t,i)},params:s};r.resend&&(u.cmdN=t,u.sendBody=i),c.dr[u.seq]=u}};if("LoginRoomReq"!==t&&this.kr!==Kf.connected)return this.zn.info(ga+" state "+this.kr+" "+r.resend),r.resend?f():n&&n(Li),-1;if(Vt(t))h=t;else if(Ft(h=Vf[t]))return this.zn.warn(ga+" cmd not found "+t),-1;f();var l,d=0;l=Ft(null==s?void 0:s.roomID)?null===(u=this.Dn.roomModulesList[0])||void 0===u?void 0:u.roomID:null==s?void 0:s.roomID,"LoginRoomReq"!==t&&l&&(d=this.wr[l]);var v=this.getHeader(h,this.seq,{contextKey:d}),m=v.content,p=i,g=this.getHead(m.length,p.length),b=new Uint8Array(Array.from(g).concat(Array.from(m)).concat(Array.from(p)));this.zn.info(ga+" seq: "+v.seq+" cmd: "+t);return null===(a=this.Cr)||void 0===a||a.sendRequest({payload:b,ack:"LoginRoomReq"===t},function(t){c.zn.info(ga+" fail")},function(){c.zn.info(ga+" ack")},{}),v.seq},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=vf.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.zn.warn(_a+" body len ".concat(o," != ").concat(s.length)),!Jf[n.cmd])return this.zn.info(ba+" cmd is not rtc"),void this.onSwitchMessage(n,r);var u=this.decodeResponseBody(n,r);if(this.Er.includes(n.cmd))this.handleSwitchPush(n,u);else{this.zn.info(ba+" down seq: "+n.seq+" "+(Jf[n.cmd]||n.cmd)+" "+JSON.stringify(this.jr(u)));var a={header:this.transHeader(n),body:this.transRsp(u)},c=this.yr[n.context_key];Ft(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.yr[u];if(a||this.Tr.includes(t.cmd)){if(t.cmd===Vf.PushReq){if((l=this.transRsp(i.head)).room_id=a,!this.Dn.roomModulesList.find(function(t){return t.roomID==a}))return void this.zn.warn(_a+" room no found ignore ");var c={header:l,body:this.Rr.includes(i.head.sub_cmd)?{signal_msg:nh(i.msg_body),sub_cmd:i.head.sub_cmd}:i.head.sub_cmd===Vf.PushSignalCustom?{custommsg:nh(i.msg_body)}:Jf[i.head.sub_cmd]?this.transRsp(this.Lr(df[Jf[i.head.sub_cmd]],i.msg_body)):{}};switch(i.head.sub_cmd){case Vf.PushUserInfoUpdated:null===(e=c.body.user_action_list)||void 0===e||e.forEach(function(t){o.qr(t,Cf)});break;case Vf.PushUserKickout:this.qr(c.body,zf);break;case Vf.PushTrans:this.qr(c.body,jf);break;case Vf.PushUserTrans:this.qr(c.body,Lf),null===(n=c.body.trans_seq_list)||void 0===n||n.forEach(function(t){o.qr(t,qf)});break;case Vf.PushIm:null===(s=c.body.msg_list)||void 0===s||s.forEach(function(t){o.qr(t,Mf)});break;case Vf.PushChannelMsg:this.qr(c.body,Uf),this.keysExist(c.body,["channel_type"]);break;case Vf.PushTransparentMsg:this.qr(c.body,Af);break;case Vf.PushStreamAdd:case Vf.PushStreamDelete:case Vf.PushStreamUpdate:null===(r=c.body.stream_info_list)||void 0===r||r.forEach(function(t){o.qr(t,Pf)});break;case Vf.PushUserTokenExpire:this.qr(c.body.stop_stream_info,Df);break;case Vf.PushUserLogReport:this.Dn.getLogWhiteList(!0)}switch(this.zn.info(_a+" push ".concat(t.seq," ").concat(JSON.stringify(this.jr(c)))),i.head.sub_cmd){case Vf.PushUserInfoUpdated:this.handlePushUserStateUpdateMsg(c);break;case Vf.PushUserKickout:this.transKeysName(c.body,this.mr),this.handlePushKickout(c,!1);break;case Vf.PushTrans:this.handlePushTransMsg(c);break;case Vf.PushUserTrans:this.handlePushUserTransMsg(c);break;case Vf.PushIm:this.handlePushRoomMsg(c);break;case Vf.PushSignalCustom:this.handlePushCustomMsg(c);break;case Vf.PushStreamAdd:case Vf.PushStreamDelete:case Vf.PushStreamUpdate:this.handlePushStreamMsg(c);break;case Vf.PushJoinliveRequest:case Vf.PushJoinliveResult:case Vf.PushJoinliveInvite:case Vf.PushJoinliveStop:this.handlePushSignalMsg(c);break;case Vf.PushUserTokenExpire:this.handlePushTokenExpire(c);break;case Vf.PushChannelMsg:this.handlePushChannelMsg(c);break;case Vf.PushTransparentMsg:this.handlePushTransparentMsg(c);break;default:this.zn.info(_a+" white "),this.onSwitchMessage(t,i)}if(1==i.head.qos_flag){var h=vf.PushRsp.create({code:0,message:"",sub_cmd:i.head.sub_cmd,server_send_time:i.head.send_time}),f=vf.PushRsp.encode(h).finish();this.sendMessage("PushRsp",f,void 0,void 0)}}else if(t.cmd===Vf.MergePushReq){var l;if((l=this.transRsp(i.head)).room_id=a,!this.Dn.roomModulesList.find(function(t){return t.roomID==a}))return void this.zn.warn(_a+" 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===Vf.PushBigIm&&(null===(i=(e=df.PushBigIm.decode(t.msg_body)).msg_list)||void 0===i||i.forEach(function(t){o.qr(t,xf)}),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=vf.MergePushRsp.create({messages:d,server_send_time:i.head.send_time}),f=vf.MergePushRsp.encode(h).finish();this.sendMessage("MergePushRsp",f,void 0,void 0)}}else if(t.cmd===Vf.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.zn.warn(_a+" ctx key ".concat(u," not found"));var m={header:t,body:i};this.Sr[u]?this.Sr[u].push(m):this.Sr[u]=[m]}},t.prototype.handlePushChannelMsg=function(t){},t.prototype.handlePushTransparentMsg=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.Dn.actionListener("_stopStream",n,{code:Ut.TOKEN_EXPIRED.code,message:Ut.TOKEN_EXPIRED.msg})},t.prototype.handlePushKickout=function(t,i){var e,n;if(i)Wf([],this.Dn.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.Dn.roomModulesList.find(function(t){return t.roomID==s});if(this.longToStringNumber(t.body,["session_id"],"toString"),!r)return void this.zn.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.Dn.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.Dn.reporter.createSpan(a.H,{key:Ba.event,par:s},{key:""},uc),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.zn.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.Or.includes(t.cmd)?"proto_switch_v3":"liveroom_cs_v3";return this.Lr(this._r[e][Jf[t.cmd]],i)},t.prototype.login=function(t,i,e){var n,s,r=this;this.kr==Kf.disconnected&&(this.zn.info(wa+" 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:mu(),room_id:eh(t.roomID),room_name:eh(t.roomName),nick_name:this.nickName,role:this.Dn.role,third_token:eh(t.token),room_create_flag:this.Dn.roomCreateFlag,user_state_flag:t.userStateUpdate?1:0,user_count_limit:t.maxMemberCount,relate_service:this.Dn.relateService.join()||""};if(t.isMulti){var a=Xf(Xf({},u),{conn_type:2});delete(f=Xf(Xf({},a),{room_id:t.roomID,room_name:t.roomName})).third_token,this.zn.info(wa+" enter "+JSON.stringify(f));var c=df.EnterRoomReq.create(a),h=df.EnterRoomReq.encode(c).finish();this.sendMessage("EnterRoomReq",h,function(e,n){var s;r.Ur(e,t),i&&i(e,n),(null===(s=e.header)||void 0===s?void 0:s.context_key)&&r.processPushMsgCache(e.header.context_key),r.Br(t.roomID)},function(t,i){r.clearAllPushMsgCache(),e&&e(t,i)},{roomID:t.roomID})}else{var f,l=Xf(Xf({},u),{app_id:this.Dn.appid,id_name:eh(this.Dn.idName),device_id:this.Dn.deviceID,term_type:this.TermType,sdk_version:this.Dn.sdkVerNum,client_stamp:eh(o),relogin_token:this.switchSessionID.notEquals(Jt.fromInt(0))?eh(this.Ir):"",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.Dn.bizVersion||"",login_logic:this.Dn.isMultiRoom?3:1,sdk_conn_type:2});t.roomReasonState===xt.Reconnecting&&(l.relogin_type=1),delete(f=Xf(Xf({},l),{id_name:this.Dn.idName,nick_name:this.Dn.nickName,client_stamp:o,k1_sign:void 0,relogin_token:this.Ir,room_id:t.roomID,room_name:t.roomName,user_session_id:t.longSid})).third_token,this.vr=t.token,this.zn.info(wa+" login "+JSON.stringify(f)),this.zn.remoteReport(wa+" token "+t.token);c=vf.LoginRoomReq.create(l),h=vf.LoginRoomReq.encode(c).finish();this.sendMessage("LoginRoomReq",h,function(e,n){var s,o,u;r.zn.info(wa+" 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.Mr=null===(o=null==e?void 0:e.header)||void 0===o?void 0:o.controls),r.Ur(e,t),r.Ir=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),r.Br(t.roomID)},function(t,i){r.clearAllPushMsgCache(),e&&e(t,i)})}},t.prototype.Ur=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.wr[i.roomID]=t.header.context_key,this.yr[t.header.context_key]=i.roomID,t.header.room_id=i.roomID),this.qr(t.body,gf),this.qr(null===(n=t.body)||void 0===n?void 0:n.anchor_info,bf),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.qr(t,wf),null===(e=t.trans_seq_list)||void 0===e||e.forEach(function(t){a.qr(t,yf)})}),null===(u=null===(o=t.body)||void 0===o?void 0:o.stream_info_list)||void 0===u||u.forEach(function(i,e){a.qr(t.body.stream_info_list[e],_f)}),this.longToStringNumber(t.body,["ret_timestamp"],"toString"),this.transKeysName(t.body,this.mr),this.keysExist(t.body,["token_remain_time","stream_seq","hearbeat_interval","hearbeat_timeout"]),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){Ft(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.qr=function(t,i){var e=this;Yt(t)&&i.forEach(function(i){if("[object Uint8Array]"===Object.prototype.toString.call(t[i]))try{t[i]=nh(t[i])}catch(t){e.zn.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 nh(t)}catch(s){return e.zn.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.zn.info(Ea+" quit "+t.roomID),this.clearPushMsgCacheByRoomID(t.roomID);var s=df.QuitRoomReq.create(o={}),r=df.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.Nr.md5Bytes(eh(this.vr)),user_session_id:t.longSid,logout_logic:this.Dn.isMultiRoom?3:1},u=this.jr(o);this.zn.info(Ea+" logout "+JSON.stringify(u));s=vf.LogoutRoomReq.create(o),r=vf.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.Jr=function(){var t=this.Pr;this.zn.info("zm.lrh.csml "+t.length),t.forEach(function(t){t&&t.error&&setTimeout(function(){t&&t.error&&t.error(Ut.TIMEOUT,t.seq)},0)}),this.dr={}},t.prototype.Vr=function(){var t=this,i=Date.now(),e=0,n=0,s=0;this.Pr.find(function(r){if(r.sendTime+r.timeout>i)return!1;if(delete t.dr[r.seq],++n,null==r.error)++s;else{var o=r.error,u=r.seq;setTimeout(function(){o&&o(Ut.TIMEOUT,u)},0)}return++e>=t.pr}),n>0&&this.zn.info("zm.lrh.cmlt timeout: ".concat(n," , ").concat(s))},t.prototype.startCheck=function(){var t=this;this.Vr(),this.Hr=setTimeout(function(){t.startCheck()},this.br)},t.prototype.stopCheck=function(){this.Jr(),clearTimeout(this.Hr)},t.prototype.Br=function(t){var i=this,e=this.Pr;this.zn.info("zm.lrh.huscl "+e.length),e.forEach(function(e){if(e&&e.resend){var n=e.seq,s=e.cmdN,r=e.sendTime,o=e.sendBody,u=e.params,a=e.success,c=e.error;if((null==u?void 0:u.roomID)===t){var h=(new Date).getTime()-r;i.sendMessage(s,o,a,c,u,{timeout:h,resend:!1},!0),delete i.dr[n]}}})},t.prototype.handleSendCommandMsgRsp=function(t){var i=this.dr[t.header.seq];if(null!=i){var e=i,n=null==e?void 0:e.params;delete this.dr[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=df.HbReq.create({}),o=df.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.qr(t,wf),null===(e=t.trans_seq_list)||void 0===e||e.forEach(function(t){s.qr(t,yf)})}),null===(r=i.body.user_trans_channel_list)||void 0===r||r.forEach(function(t,i){var e;s.qr(t,wf),null===(e=t.trans_seq_list)||void 0===e||e.forEach(function(t){s.qr(t,yf)})}),s.transKeysName(i.body,[["hb_interval","hearbeat_interval"],["hb_timeout","hearbeat_timeout"],["big_im_time_window","bigim_time_window"],["trans_channel_list","trans_seqs"]]),s.keysExist(i.body,["hearbeat_interval","hearbeat_timeout"]),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=Xf({},t),o=this.jr(r);this.zn.info(Sa+" "+JSON.stringify(o));var u=df.GetUserlistReq.create(r),a=df.GetUserlistReq.encode(u).finish();return this.sendMessage("GetUserlistReq",a,function(t,e){var n,r;s.zn.info(Sa+" 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.qr(t.body.user_base_info_list[e],Sf)}),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:eh(t.msg_content)},o=this.jr(r);this.zn.info("zm.lrh.srm.1 "+JSON.stringify(o));var u=df.SendImReq.create(r),a=df.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:eh(t.trans_type),trans_data:eh(t.trans_data),trans_local_seq:t.trans_local_seq,trans_channel:eh(t.trans_channel)},o=this.jr(r);this.zn.info("zm.lrh.srm.0 "+JSON.stringify(o));var u=df.SetTransReq.create(r),a=df.SetTransReq.encode(u).finish();return this.sendMessage("SetTransReq",a,function(t,e){s.qr(t.body,Of),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:eh(t.trans_type),trans_local_seq:t.trans_seq}}),o={trans_channel:eh(t.trans_channel),trans_list:r},u=this.jr(o);this.zn.info("zm.lrh.frm "+JSON.stringify(u));var a=df.GetTransReq.create(o),c=df.GetTransReq.encode(a).finish();return this.sendMessage("GetTransReq",c,function(t,e){var n;s.qr(t.body,Tf),null===(n=t.body.trans_list)||void 0===n||n.forEach(function(t){s.qr(t,kf)}),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:eh(t.trans_type),trans_local_seq:t.trans_seq}}),o={trans_channel:eh(t.trans_channel),user_trans_list:r},u=this.jr(o);this.zn.info("zm.lrh.futi "+JSON.stringify(u));var a=df.GetUserTransReq.create(o),c=df.GetUserTransReq.encode(a).finish();return this.sendMessage("GetUserTransReq",c,function(t,e){var n;s.qr(t.body,Rf),null===(n=t.body.user_trans_list)||void 0===n||n.forEach(function(t){s.qr(t,If)}),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:eh(t)}}),o=Xf({to_user_list:r,push_message:eh(t.custom_msg)},t),u=this.jr(o);this.zn.info(Ta+" "+JSON.stringify(u));var a=df.SignalLiveCustomReq.create(o),c=df.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:eh(t.msgContent),to_user_list:r.map(function(t){return eh(t)})},u=this.jr(o);this.zn.info(Ta+" "+JSON.stringify(u));var a=df.SendChannelMsgReq.create(o),c=df.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.sendTransparentMessage=function(t,i,e,n,s){var r=this,o=this.jr(t);this.zn.info("zm.lrh.stm "+Oi(o));var u=df.SignalTransparentMsgReq.create(t),a=df.SignalTransparentMsgReq.encode(u).finish();return this.sendMessage("SignalTransparentMsgReq",a,function(t,i){n&&n(r.transRsp(t),i)},function(t,i){console.error("sendTransparentMessage"),s&&s(t,i)},{roomID:i},{timeout:1e3*e,resend:!0})},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:eh(t.msg_content),msg_client_id:eh(t.bigmsg_client_id)}})},o=this.jr(r);this.zn.info("zm.lrh.sbrm "+JSON.stringify(o));var u=df.SendBigImReq.create(r),a=df.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.qr(t,Ef)}),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 il:s="SignalLiveInviteReq";break;case $f:s="SignalLiveRequestReq";break;case tl:s="SignalLiveResultReq";break;case el:s="SignalLiveStopReq"}var r=t.dest_id_name.map(function(t){return{id_name:eh(t)}}),o={push_message:eh(t.signal_msg),to_user_list:r},u=this.jr(o);this.zn.info("zm.lrh.ssc "+JSON.stringify(u));var a=df[s].create(o),c=df[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.zn.info(Oa+" "+JSON.stringify(Xf(Xf({},t),{third_token:void 0}))),this.zn.remoteReport(Oa+" token "+t.third_token);var a=this.Dn.roomModulesList.find(function(t){return t.roomID==n.roomID});if(!a)return this.zn.error(Oa+" room no found ignore "),-1;switch(t.sub_cmd){case 2001:u="AddStreamReq",o={stream_id:eh(s.stream_id),extra_info:eh(s.extra_info),client_req_seq:this.seq+1,third_token:eh(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:eh(s.stream_id),stream_sid:s.stream_sid,client_req_seq:this.seq+1};break;case 2003:u="UpdateStreamReq",o={stream_id:eh(s.stream_id),stream_sid:s.stream_sid,client_req_seq:this.seq+1,extra_info:eh(s.extra_info)}}var c=this.jr(o);this.zn.info(Oa+" "+JSON.stringify(c));var h=df[u].create(o),f=df[u].encode(h).finish();return this.sendMessage(u,f,function(t,e){r.zn.info(Oa+" suc "+u+" "+JSON.stringify(t)),t.header.room_id=a.roomID,i&&i(t,e)},function(t,i){r.zn.info(Oa+" 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.Dn.roomModulesList.find(function(t){return t.roomID==n.roomID})){var r={},o=this.jr(r);this.zn.info(ya+" "+JSON.stringify(o));var u=df.GetStreamListReq.create(r),a=df.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.qr(t,_f),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.zn.error(ya+" room no found ignore "+n.roomID)},t.prototype.jr=function(t){var i=this,e={};return Object.keys(t).forEach(function(n){["logout_check"].includes(n)?e[n]=t[n]:i.Gr(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=Xf(Xf({},t),i);return delete e.rsp_head,e},t.prototype.Gr=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.Gr(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.Gr(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]=nh(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.Lr=function(t,i){return i&&Xf({},t.decode(i))},t.prototype.Ar=function(t,i){var e=this;this.zn.info(ka+" call"),this.kr=Kf.disconnected,this.Dn.roomModulesList.forEach(function(t){var i=t.roomTryHandler;i&&e.isUaConnect&&(e.zn.info(ka+" ua is connect"),i.retryLoginRoom())})},t.prototype.Dr=function(){this.zn.info(Ra+" call"),this.kr=Kf.broken,this.clearAllPushMsgCache(),this.Fr(Ra)},t.prototype.Fr=function(t){var i=this;this.Dn.roomModulesList.forEach(function(e){var n=e.roomTryHandler,s=e.roomHandler;n&&(n.invalid(),n.onactive=function(e,n){i.zn.info(t+" onactive"),s.transError(n),s.disconnectedHandle(n)},n.startMaxTime(),s._roomStateHandle("CONNECTING",xt.Reconnecting,Ut.NETWORK_BROKEN))})},t.prototype.zr=function(t){this.zn.info("zm.lrh.hc call "+t),this.kr=Kf.connected,t===bu.ConnectedType.AUTO&&this.rtm.retryRoom()},t.prototype.renewToken=function(t,i,e,n){var s=this,r={token:t.token},o=df.RenewTokenReq.create(r),u=df.RenewTokenReq.encode(o).finish(),a=this.jr(r);this.zn.info("zm.lrh.rt "+JSON.stringify(a)),this.sendMessage("RenewTokenReq",u,function(t,e){s.qr(t.body,Nf),s.keysExist(t.body,["token_remain_time"]),i&&i(t,e)},e,{roomID:null==n?void 0:n.roomID})},t.prototype.reset=function(){this.zn.info("zm.lrh.r.0 call "),this.kr=Kf.disconnected,this.switchSessionID=Jt.fromInt(0),this.Hr&&clearTimeout(this.Hr)},t.prototype.closeRequest=function(){var t;null===(t=this.Cr)||void 0===t||t.closeRequest()},t.prototype.resetSessionInfo=function(){this.switchSessionID=Jt.fromInt(0)},t.prototype.processPushMsgCache=function(t){var i=this.Sr[t];if(i){this.zn.info(ba+" 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.Sr[t]}},t.prototype.clearAllPushMsgCache=function(){var t=this;Object.keys(this.Sr).forEach(function(i){var e=parseInt(i);delete t.Sr[e]})},t.prototype.clearPushMsgCacheByRoomID=function(t){var i=this.wr[t];i&&this.Sr[i]&&delete this.Sr[i]},t.prototype.handleLogoutRsp=function(t){var i=this.wr[t];i&&(delete this.yr[i],delete this.wr[t],this.Sr[i]&&delete this.Sr[i])},t}(),sl=function(){function t(){this.defaultSetting={remote_log_level:"info",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:q.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,transcode_on_zero_fps:0,report_attr_level:0,log_strategy:-1,connect_media_in_advance:1},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(Vt(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(Ft(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);Gt(c)&&(r.ANS=c);var h=this.getSetting("AGC",i);Gt(h)&&(r.AGC=h);var f=this.getSetting("AEC",i);Gt(f)&&(r.AEC=f);var l=this.getSetting("camera_audio_bitrate",i);Vt(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}(),rl="init",ol="room",ul="rtc",al=function(){return al=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},al.apply(this,arguments)},cl=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())})},hl=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])}}},fl=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))},ll=function(){function i(t,e,n,s,r,o,u){var h,f,l,d,v,b,_,y=this;this.zn=n,this._dataReport=s,this.Ln=r,this.Yr=u,this.dispatchServers=[],this.dispatchHttp3Servers=[],this.dispatchWssV6Servers=[],this.dispatchHttp3V6Servers=[],this.Zr=null,this.Qr=1e3,this.version=m,this.id="",this.Xr={online:function(){y.Wr()},offline:function(){y.Wr()},unload:function(t){return cl(y,void 0,void 0,function(){return hl(this,function(i){switch(i.label){case 0:return this.zn.info(xu+" "+t.type),this.Ln.setUnloadState(a.I),this._onBeforePageUnload?[4,this._onBeforePageUnload()]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.logoutRoom(void 0,!1,!0),[2]}})})}},this._roomLoginResponseListener=function(){clearTimeout(y.cloudSettingTimer),y.cloudSettingTimer=setTimeout(function(){y.zn.info(Lu+" fetch cloud setting"),y.Kr()},100)};var w=i.logConfigForPreset;(null==w?void 0:w.logLevel)&&this.logger.setLogLevel(w.logLevel),n.onConnected=function(t){var i=t.url,e="".concat(Mu," log connected ").concat(i);if(i&&i.startsWith("wss://")){y.Dn.logDomain=i.split("/")[2];var n="wss://".concat(y.Dn.logDomain,"/zglog/tlog");y.logger.info("".concat(Mu," event url ").concat(n)),y.Ln.setConfig({serverUrl:n})}y.Dn.enableWSLog||(y.zn.enableWebSocketLog(!1),e+=" ; close ws log"),y.zn.info(e)},n.onUploadLog=function(t,i,e){var n=y.Ln.createSpan(a.H,{key:Ma.event},{key:""},Ua);n.setAttributes({file_size:Math.round(t/8),file_name:i}),e?y.Ln.setError(n,e):n.end()},this.Dn=new Wc(this.zn,this._dataReport),this.Dn.ENV=o,this.Dn.product=yu.product,this.Dn.advanceConfig=al(al({},this.Dn.advanceConfig),{customDomain:i.customDomain}),this.$r();var S=i.engineOptions;this.cloudSetting=new dh(null==S?void 0:S.closeCloudSetting),this.getReportSeq=A,this.getSeq=D,this.io(),this.Dn.deviceID=function(t){void 0===t&&(t=0);var i=hu("z_deviceID");if(i)return i;(new Date).getTime();var e=vu(t);return cu("z_deviceID",e),e}(o),i.pageID||(i.pageID=vu(o));var E=this.Dn.id=vu(o);this.logger.info("".concat(Mu," deviceID: ").concat(this.Dn.deviceID,", pageID: ").concat(i.pageID,", instID: ").concat(E)),this.Ln.init(t,o,this.Dn.deviceID),this.Ln.setLogger(this.zn),this.Dn.reporter=this.Ln;var O,T=Ma,k=this.Ln.createSpan(a.H,{key:""},{key:T.event},T.event,!0);e&&this.eo(e);var R,I,N=0===o?"ZegoExpressWebRTC":"ZegoExpressMiniProgram";if((null===(h=this.Yr)||void 0===h?void 0:h.reportData)&&(O=null===(l=null===(f=this.Yr)||void 0===f?void 0:f.reportData)||void 0===l?void 0:l.version,N=(null===(v=null===(d=this.Yr)||void 0===d?void 0:d.reportData)||void 0===v?void 0:v.project)||N),k.setAttributes({biz_type:T.biz_type(0),project:T.project(N),liveroom_version:T.liveroom_version(O),is_from_cache:T.is_from_cache(!1),sev_env:T.sev_env(this.Dn.testEnvironment?"test":"online"),framework:(null===(b=i.engineOptions)||void 0===b?void 0:b.framework)||void 0,logger_rev:Zc.ZegoLogger.logVersion,build_time:p}),I=this.zn,(R=t)&&Vt(R)&&mi(R)||(I.error("ccp.0 appid must be positive integer number and not empty"),0)){this.Dn.appid=t,this.Dn.configOK=!0,this.Dn.sdKVersion=this.version,this.Dn.testEnvironment&&(this.Dn.mode=bu.Mode.MODE_TEST),this.netAgent=new bu.ZegoConnectionAgent(i.proxyCtrl),this.zn.setSessionInfo(this.Dn.appid,"","","","",this.version),this.netAgent.init(),this.netAgent.setLogger(this.zn);var C={appID:this.Dn.appid,env:this.Dn.ENV,mode:this.Dn.mode};S&&S.pri&&(C.model=1),i.geoFenceType&&i.geoFenceAreaList&&(C.geoFencing={type:i.geoFenceType,list:i.geoFenceAreaList}),this.netAgent.setAppInfo(C),this.liveRoomHandler=new nl(this.zn,this.Dn,this.netAgent,this._dataReport,this);var z="";0===o?z="rtc":1===o&&(z="ali"),this.Dn.settingConfig=new sl,this.cloudSetting.setLog(this.zn),this.cloudSetting.init({productNum:_u,appID:t,env:o,pollingNotify:function(t,i){y.zn.info(Mu+" setting file changed "+t+" "+JSON.stringify(i)),y.Dn.actionListener("_cloudSettingNotify",t,i)},reportNotify:this.no.bind(this),online:!this.Dn.testEnvironment,connection:this.netAgent,inflate:this.zn.inflate});var P="".concat(Mu," default setting.");P+=this.so(),this.zn.setZipLogConfig(1),this.zn.enableWebSocketLog(!0),this.zn.info(P),this.setAPIReports(),this.cloudSetting.setEnvVariable("environment",z);var M=this.cloudSetting.getSettingCache(rl),x=this.cloudSetting.getSettingCache(ol),j=!1,L=setTimeout(function(){y.zn.warn("".concat(Mu," time out, get cache settings failed!")),j=!0,y.ro(),y.getStoreAppConfig(),k.setAttributes({use_na:T.use_na(1),connection_rev:y.netAgent.getVersion()}),k.end()},500);Promise.all([M,x]).then(function(t){var i=t[0],e=t[1],n="".concat(Mu," get cloud config ").concat(j);L&&clearTimeout(L),y.oo(null==i?void 0:i.setting),j||(y.ro(),y.getStoreAppConfig());var s=y.so(!0);s&&(n+=s),y.uo(),y.setAPIReports();var r=y.ao("report_script");if(r){var o=r.url,u=r.key,c=r.hash;n+=" ; report script ".concat(o," ").concat(u," ").concat(c),o&&y.Ln.loadScript(!1,o,u,c),c&&k.setAttributes({lua_md5:T.lua_md5(c)})}else y.Ln.loadScript(!1,"","","");y.zn.info(n),y.oo(null==e?void 0:e.setting);var h=y.Ln.createSpan(a.H,{key:T.event},{key:""},hc);h.setAttributes({files:fc([{name:rl,content:JSON.stringify(null==i?void 0:i.setting),versions:JSON.stringify(null==i?void 0:i.versions),code:0,message:""},{name:ol,content:JSON.stringify(null==e?void 0:e.setting),versions:JSON.stringify(null==e?void 0:e.versions),code:0,message:""}])}),h.end(),k.setAttributes({use_na:T.use_na(1),connection_rev:y.netAgent.getVersion()}),k.end()}).catch(function(t){if(L&&clearTimeout(L),k.setAttributes({use_na:T.use_na(1),connection_rev:y.netAgent.getVersion()}),k.end(),y.zn.warn("".concat(Mu," initConfig ").concat(JSON.stringify(t))),(null==t?void 0:t.code)===Ut.GEO_SET_ERROR.code)throw Error("GeoFencing set Error")});var q=this.version;g,this.zn.info("".concat(Mu," ").concat(null!==(_=null===navigator||void 0===navigator?void 0:navigator.userAgent)&&void 0!==_?_:""," ").concat(q," log: ").concat(Zc.ZegoLogger.logVersion)),this._bindWindowListener(),this.Dn.networkState=navigator?navigator.onLine?c.online:c.offline:c.online;var U="Firefox"===ru()?null===navigator||void 0===navigator?void 0:navigator.userAgent:null===navigator||void 0===navigator?void 0:navigator.appVersion;k.setAttribute("sys_info",U||""),this.co(),this.zn.setSessionInfo(this.Dn.appid,"","","","",this.version)}else this.zn.error("".concat(Mu," init sdk error")),this.Ln.setError(k,T.error.kInvalidParamError);w&&this.setLogConfig(w),this.Dn.onListener("roomLoginResponse",this._roomLoginResponseListener)}return Object.defineProperty(i.prototype,"logger",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateCenter",{get:function(){return this.Dn},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.ao=function(t,i){var e;return void 0===i&&(i=!1),null===(e=this.Dn.settingConfig)||void 0===e?void 0:e.getSetting(t,i)},i.prototype.oo=function(t,i){var e;return null===(e=this.Dn.settingConfig)||void 0===e?void 0:e.setSetting(t,i)},Object.defineProperty(i.prototype,"reporter",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),i.prototype.so=function(t,i){var e={},n=this.ao("remote_log_level",t);return n&&(e.remote_log_level=n,this.zn.setRemoteLogLevel(n)),Object.keys(e).length>0?Oi(e):""},i.prototype.setEngineConfig=function(t){var i=t.roomRetryTime,e=t.isFlutter;i&&(this.Dn.roomRetryTime=i),Gt(e)&&(this.Dn.isFlutter=e)},i.prototype.destroyRTM=function(){this.Dn.roomModulesList.some(function(t){return!((null==t?void 0:t.isLogout())||t.roomState===rh)})&&this.logoutRoom(),this.Ln.setUnloadState(a.I),this.Ln.destroy(),this.ho(),this.fo()},i.prototype.io=function(){this.proxyRes=fu,this.getServerError=Lo},i.prototype.$r=function(){var t=this.version.split(".").map(function(t){return parseInt(t)});this.Dn.sdkVerNum=(0===this.Dn.ENV?_.SDKProject_ZegoWebRTC:_.SDKProject_ZegoMiniProgram)<<28|t[0]<<20|t[1]<<8|t[2]},i.prototype.co=function(){this.Ln.createSpan(a.H,{key:Ma.event},{key:xa},xa,!0).end()},i.prototype.uo=function(){var t=[],i=[],e=this.Dn.advanceConfig.customDomain;if((null==e?void 0:e.detaillog)&&""!==(null==e?void 0:e.detaillog))t.push(s=e.detaillog),this.zn.info(Fu+" set detaillog url by advance config "+JSON.stringify(t)),this.zn.setZipLogDomains(t,i);else if(this.Dn.geoFencing){var n=this.Dn.geoFencing;this.zn.info(Fu+" geo log is "+(o=n.detaillog)+" "+(u=n.wssV6Detaillog)),o&&""!==o&&(t.push(o),this.zn.info(Fu+" set detaillog url by geoFencing v4 "+JSON.stringify(t))),u&&""!==u&&(i.push(u),this.zn.info(Fu+" set detaillog url by geoFencing v6 "+JSON.stringify(t))),(t.length>0||i.length>0)&&this.zn.setZipLogDomains(t,i)}else{if(this.ao("detaillog_domain")){var s=this.ao("detaillog_domain");this.zn.info("".concat(Fu," set detaillog domain by cloudsetting ").concat(s)),s&&""!==s&&t.push(s)}else if(this.Dn.svrDomains){var r=this.Dn.svrDomains,o=r.detaillog,u=r.wssV6Detaillog;this.zn.info("".concat(Fu," set detaillog domain by svr ").concat(o," ").concat(u)),o&&""!==o&&t.push(o),u&&""!==u&&i.push(u)}(t.length>0||i.length>0)&&this.zn.setZipLogDomains(t,i)}},i.prototype.getStoreAppConfig=function(){if(this.zn.info(Gu+" call"),localStorage){var t=hu(ku+"_"+this.getAppID()+"_"+(this.Dn.mode||Cu.modeNo));if(t){var i=hu(Ru+"_"+this.getAppID()+"_"+(this.Dn.mode||Cu.modeNo));i||this.zn.info(Gu+" no store config etag");try{var e=au(t,wu);if(e?(this.Dn.appConfig=JSON.parse(e),this.Ln.spanSetAttributes({key:Ma.event},{is_from_cache:Ma.is_from_cache(!0)}),this.Dn.actionListener("_appConfigRsp")):localStorage.removeItem(ku+"_"+this.getAppID()+"_"+(this.Dn.mode||Cu.modeNo)),i){var n=au(i,wu);this.Dn.appConfigEtag=parseInt(n)}}catch(t){this.zn.warn(Gu+" "+JSON.stringify(t))}}else this.zn.info(Gu+" no store config")}else this.zn.warn(Gu+" no localstorage")},i.prototype.ro=function(){var t,e,n,s,r,o,u=this;this.zn.info(Hu+" call"),this.netAgent.on("disconnected",function(t){u.zn.info(Hu+" netAgent disconnect "+u.Dn.roomModulesList.length),u.Dn.roomModulesList.length>0&&u.netAgent.connectUa()}),this.netAgent.on("connected",function(){u.zn.info("".concat(Hu," netAgent connect stack ").concat(Nt[u.netAgent.connectIPStackType])),u.Dn.agentConnectIPStackType=u.netAgent.connectIPStackType,u.Ln.setNetStateCheck(),u.fetchAppConfig(),u.retryRoom(!0)}),this.netAgent.on("broken",function(t){u.zn.info("".concat(Hu," netAgent broken"))}),this.netAgent.on("dispatchEvent",function(t,i,e){if(u.zn.info("".concat(Hu," dispatch")),"start"===i){var n=u.Ln.createSpan(a.H,{key:_c},{key:""},Rc);u.Dn.requestList[t]=n}else if("end"===i){(n=u.Dn.requestList[t])&&(n.setAttributes({domain_list:Ic(e.domains),http3_domain_list:Nc(e.http3Domains),wss_v6_domain_list:Cc(e.wssV6Domains),http3_v6_domain_list:zc(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.zn.info("".concat(Hu," dispatchResult ").concat(JSON.stringify(t)));var h=u.Dn.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=uu(JSON.stringify(i),wu);cu(t+"_"+u.Dn.appid+"_"+(u.Dn.mode||Cu.modeNo),e)};f(Su,i),f(Eu,n),f(Ou,r),f(Tu,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.Dn.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=uu(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}),wu);cu(Nu+"_"+u.Dn.appid+"_"+(u.Dn.mode||Cu.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.uo())}),this.netAgent.on("ipDetection",function(t){var i,e,n=t.linkConnectDetection,s=t.ipList;if(n&&(u.zn.info("".concat(Hu," ip detection v4: ").concat(Dt[n.IPv4],", v6: ").concat(Dt[n.IPv6])),u.Dn.agentIpStackDetection=n),s){var r=u.Ln.createSpan(a.H,{key:Tn},{key:""},Lr);r.setAttributes({ipv4:qr(null===(i=s.ipv4)||void 0===i?void 0:i[0]),ipv6:qr(null===(e=s.ipv6)||void 0===e?void 0:e[0])}),r.end()}}),this.netAgent.on("onceConnectEvent",function(t,i,e){if(u.zn.info("".concat(Hu," once connect")),"start"===i){var n=u.Ln.createSpan(a.H,{key:_c},{key:Sc},Sc,!0);u.Dn.requestList[t]=n}else if("end"===i){(n=u.Dn.requestList[t])&&(n.setAttributes(al({},e)),n.end())}}),this.netAgent.on("connectedEvent",function(t,i,e){if(u.zn.info("".concat(Hu," connect")),"start"===i){var n=u.Ln.createSpan(a.H,{key:Ma.event},{key:_c},_c,!0);u.Dn.requestList[t]=n}else if("end"===i){(n=u.Dn.requestList[t])&&e&&(n.setAttributes({request_count:wc(e.count),connect_id:yc(e.connectid),first_connect_type:e.first_connect_type,connect_type:e.connect_type,error:e.error||0,server:e.server,ip_stack:u.netAgent.connectIPStackType}),n.end())}}),this.netAgent.on("requestEvent",function(t,i,e){if(u.zn.info("".concat(Hu," request")),"start"===i){var n=u.Ln.createSpan(a.H,{key:Ma.event},{key:Dc},Dc,!0);u.Dn.requestList[t]=n}else if("end"===i){(n=u.Dn.requestList[t])&&(n.setAttributes({req_location:Ac(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.zn.info("".concat(Hu," disconnect"));var s=u.Ln.createSpan(a.H,{key:Ma.event},{key:""},Ec);s.setAttributes({url:Tc(e),connect_duration:kc(i),connect_id:Oc(n)}),s.end()}),this.netAgent.on("clientInfo",function(t){var i=t.timeOffset,e=t.geofencingID;Vt(i)&&u.Ln.setTimeOffset(i),u.lo(),Vt(e)&&(u.Dn.netGeoFencing.id=e)}),this.netAgent.on("heartBeatTimeout",function(){u.Dn.actionListener("_uaHeartBeatTimeout")});var c=qt[this.Dn.selectIPStackMode];this.zn.info("".concat(Hu," select ip stack mode ").concat(c)),this.zn.setSettingConfig({ipStackMode:this.Dn.selectIPStackMode}),this.netAgent.setSettingConfig({enableHttp3:void 0!==(null===(t=i.engineOptions)||void 0===t?void 0:t.http3)?!!i.engineOptions.http3:1===this.ao("http3"),ipStackMode:this.Dn.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.do(),m=v.detaillog;h=v.accesshub,l=v.wssV6Accesshub,this.stateCenter.svrDomains.logreport=v.logreport[0],this.stateCenter.svrDomains.detaillog=m[0],this.zn.info("".concat(Hu," hard domains ").concat(JSON.stringify(h)));var p=this.vo();if(this.zn.info("".concat(Hu," 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.Dn.svrDomains.wssV6Accesshub=y),b&&(this.stateCenter.svrDomains.logreport=b),w&&(this.Dn.svrDomains.wssV6Logreport=w),_&&(this.stateCenter.svrDomains.detaillog=_),S&&(this.Dn.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.mo(),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.zn.info("".concat(Hu," advance config domains: ").concat(JSON.stringify(k),", set domains ").concat(JSON.stringify(h),", ")),this.zn.info("".concat(Hu," 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")}),A=d.map(function(t){return"https://".concat(t,"/accesshub")});if(this.netAgent.setNetAgentDefaultServers(C,D),this.dispatchServers=[],this.Dn.geoFencing||T||E)this.dispatchServers=C,this.dispatchHttp3Servers=z,this.dispatchWssV6Servers=D,this.dispatchHttp3V6Servers=A;else{var P=this.po(),M=P.http3Servers,x=P.wssV6Servers,j=P.http3V6Servers;this.dispatchServers=P.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.uo()):this.handleLogUpload(),this.zn.info(Hu+" 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.bo=function(t){var i=t.split(".");return i[i.length-2]+"."+i[i.length-1]},i.prototype.mo=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.Dn.geoFencing){var r=this.bo(null===(i=this.Dn.geoFencing)||void 0===i?void 0:i.accesshub);this.Dn.geoFencing.accesshub=null===(e=this.Dn.geoFencing)||void 0===e?void 0:e.accesshub.replace(r,t),this.Dn.geoFencing.logreport=null===(n=this.Dn.geoFencing)||void 0===n?void 0:n.logreport.replace(r,t),this.Dn.geoFencing.detaillog=null===(s=this.Dn.geoFencing)||void 0===s?void 0:s.detaillog.replace(r,t)}},i.prototype.hashMainDomain=function(){var t=Cu.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 Cu.normalPriDomains[i%t]},i.prototype.do=function(){var t,i={accesshub:[],wssV6Accesshub:[],logreport:[],detaillog:[]},e=(null===(t=this.Yr)||void 0===t?void 0:t.prefixDomain)||Cu.prefixDomain,n=Cu.wssV6preFixDomain,s=zu,r=Du,o=this.hashMainDomain(),u=Cu.normalPriDomains.filter(function(t){return t!==o});return i.accesshub=fl([o],u,!0).map(function(t){return e+"."+t}),i.wssV6Accesshub=fl([o],u,!0).map(function(t){return n+"."+t}),i.logreport=[s+"."+o],i.detaillog=[r+"."+o],i},i.prototype.po=function(){var t=this,i=function(i){var e=hu(i+"_"+t.Dn.appid+"_"+(t.Dn.mode||Cu.modeNo));if(!e)return[];var n=au(e,wu);if(n)try{return JSON.parse(n)}catch(t){return[]}return[]};return{servers:i(Su),http3Servers:i(Eu),wssV6Servers:i(Ou),http3V6Servers:i(Tu)}},i.prototype.vo=function(){var t=hu(Nu+"_"+this.Dn.appid+"_"+(this.Dn.mode||Cu.modeNo));if(!t)return null;var i=au(t,wu);if(i)try{return JSON.parse(i)}catch(t){return null}return null},i.prototype._o=function(t){return Cu.scheme+"://"+t+"/"+Cu.location},i.prototype.getUnloadEventName=function(){var t=navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i),i=ru(),e=navigator.userAgent,n="micromessenger"==e.toLowerCase().match(/MicroMessenger/i),s=e.indexOf("Android")>-1||e.indexOf("Adr")>-1;return t||n&&s?"pagehide":"Firefox"===i?"beforeunload":"unload"},i.prototype._bindWindowListener=function(){var t=this.getUnloadEventName();window.addEventListener(t,this.Xr.unload),window.addEventListener("offline",this.Xr.offline),window.addEventListener("online",this.Xr.online)},i.prototype.fo=function(){var t=this.getUnloadEventName();window.removeEventListener(t,this.Xr.unload),window.removeEventListener("offline",this.Xr.offline),window.removeEventListener("online",this.Xr.online)},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.Dn.roomModulesList.find(function(t){return t.roomID==i});n&&n.retryRoom(t,e)}else this.Dn.roomModulesList.forEach(function(i){null==i||i.retryRoom(t,e)})},i.prototype.yo=function(){this.zn.info(xu+" network is online"),this.Dn.networkState!==c.online&&(this.Dn.networkState=c.online,this.ho())},i.prototype.ho=function(){this.Zr&&(clearInterval(this.Zr),this.Zr=null)},i.prototype.wo=function(){var t=this;this.ho(),this.zn.info(Na+" start network online detection.."),this.Zr=setInterval(function(){t.Dn.networkState!==c.offline&&t.ho(),t.isUaConnect&&(t.zn.info(Na+" detected network online"),t.yo(),t.ho())},this.Qr)},i.prototype.Wr=function(){this.zn.info(xu+" network is broken"),this.Dn.networkState!==c.offline&&(this.Dn.networkState=c.offline,this.wo())},i.prototype.setLogConfig=function(t){var i,e;this.zn.info(ju+" call "+Oi(t));var n=this.Ln.createSpan(a.H,{key:Ma.event},{key:qa.event},qa.event);if(t.logLevel&&["debug","info","warn","error","report","disable"].includes(t.logLevel)&&(this.zn.setLogLevel(t.logLevel),n.setAttributes({log_level:qa.log_level(t.logLevel)})),t.remoteLogLevel&&["debug","info","warn","error","report","disable"].includes(t.remoteLogLevel)&&n.setAttributes({remote_log_level:qa.remote_log_level(t.remoteLogLevel)}),Ht(t.logURL)&&(t.logURL.startsWith("wss://")||t.logURL.startsWith("https://")))(null===(i=this.Dn.geoFencing)||void 0===i?void 0:i.logreport)?this.zn.info(ju+" geo exist"):(this.zn.setLogServer([t.logURL],[]),this.Dn.customSetLogURL=!0,0===this.Dn.ENV&&(this.Dn.logDomain=null===(e=this.zn.url)||void 0===e?void 0:e.split("/")[2],this.Ln.setConfig({serverUrl:"wss://"+this.Dn.logDomain+"/zglog/tlog"}))),n.setAttributes({log_url:qa.log_url(t.logURL)}),n.end();else if(t.logURL)return this.zn.error(ju+"log url must be a wss or https url"),this.Ln.setError(n,qa.error.kInvalidParamError),!1;Vt(t.logSize)||Vt(t.logCount);var s={};return Vt(t.logSize)&&(s.size=t.logSize,n.setAttributes({log_size:t.logSize})),Vt(t.logCount)&&(s.count=t.logCount,n.setAttributes({log_count:t.logCount})),Object.keys(s).length>0&&this.zn.setStorageConfig(s),this.zn.info(ju+" call success"),n.end(),!0},i.prototype.setDebugVerbose=function(t){var i=this.Ln.createSpan(a.H,{key:Ma.event},{key:ja},ja);Gt(t)&&(this.Dn.debug=t,this.Dn.debugCustom=!0,i.setAttributes({debug:La(t?"true":"false")})),i.end(),this.zn.info("zm.sdv call success")},i.prototype.eo=function(t){Ht(t)&&t.indexOf("wss")>-1?this.Dn.debug=lu(t):Array.isArray(t)&&t.length>0&&t.every(function(t){return Ht(t)&&t.indexOf("wss")>-1})?this.Dn.debug=lu(t[0]):this.zn.info(Mu+" server wrong"),this.Dn.testEnvironment=this.Dn.debug},i.prototype.renewToken=function(t,i){var e,n,s=this,r=this.Ln.createSpan(a.H,{key:Ba.event,par:i},{key:""},Ga.event);if(!(Ft(i)||Ht(i)&&""!=i))return this.zn.error(Wu+" roomID must be string and no empty"),!1;var o=this.getRoomModules(i)||this.Dn.roomModulesList[0];if(!o)return this.zn.error(Wu+" calling must after loginRoom"),this.Ln.setError(r,Ga.error.NOT_LOGIN),!1;if(Ht(t)&&o.roomTryHandler){if(t===o.roomTryHandler.token)this.zn.info(Wu+" token has not changed"),r.setAttributes({error:Ga.error.INPUT_PARAM.code,message:"token has not changed"}),r.end();else if(r.setAttributes({token:Ga.token(t)}),this.Dn.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.Dn.actionListener("_stopStream",h,{code:Ut.NO_PUBLISH_AUTH.code,message:Ut.NO_PUBLISH_AUTH.msg}),s.Ln.setReporterInfo(s.Dn.idName||"",t),s.Dn.configCheckToken=!0,r.end(),s.zn.info(Wu+" "+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.Ln.setError(r,i),!u||1000002014!==u&&2014!==u?s.zn.error(Wu+" "+JSON.stringify(i)):(s.Dn.configCheckToken=!1,null===(n=o.roomTryHandler)||void 0===n||n.renewLocalToken(t),s.cloudSetting.setToken(t),s.zn.warn(Wu+" "+JSON.stringify(i)))},o)}else null===(n=o.roomTryHandler)||void 0===n||n.renewLocalToken(t),this.cloudSetting.setToken(t),this.Ln.setReporterInfo(this.Dn.idName||"",t),r.end();return!0}return Ht(t)&&!o.roomTryHandler?(this.zn.error(Wu+" calling must after loginRoom"),this.Ln.setError(r,Ga.error.NOT_LOGIN),!1):(this.zn.error(Wu+" token must be string and not empty"),this.Ln.setError(r,Ga.error.INPUT_PARAM),!1)},i.prototype.setCloudSettingURLs=function(t){var i=this;this.zn.info(Zu+" call "),Array.isArray(t)&&t.length>0&&t.every(function(t){return Ht(t)&&t.indexOf("http")>-1})&&this.cloudSetting.init({productNum:_u,appID:this.Dn.appid,env:this.Dn.ENV,pollingNotify:function(t,e){i.zn.info(Zu+" setting file changed "+t+" "+JSON.stringify(e)),i.Dn.actionListener("_cloudSettingNotify",t,e)},reportNotify:this.no.bind(this),online:!this.Dn.testEnvironment,connection:this.netAgent})},i.prototype.loginRoom=function(t,i,e,n){var s=this;return this.zn.info(Lu+" call by user "+(null==e?void 0:e.userID)+" "+t+" "+this.version+" build: "+p),new Promise(function(o,u){return cl(s,void 0,void 0,function(){var s,a,h,f,l,d,v,m,p,g,b,_,y,w,S=this;return hl(this,function(E){switch(E.label){case 0:return 1!==this.Dn.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.Ln.getAPIErrorReport(Ba.event);S.Ln.takeAPIErrorReport(Ba.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.Dn).roomModulesList,l=Ba.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.Dn.actionListener("roomStateChanged",t,xt.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 fh(t,this.Dn,this.zn,this._dataReport,this,this.liveRoomHandler),(b=g.roomTryHandler)||(b=new Hc(this.zn,this.Dn,g),g.roomTryHandler=b),b.init(this.Dn.roomRetryTime),b.initRoom(g.roomHandler,t,i,e,n),b.loginCompleted=!1,g.roomHandler._roomStateHandle(uh,xt.Logining,{code:0,msg:""}),(_=Yc({roomID:{order:0,value:t,rules:[{name:gu.NOT_EMPTY,error:l.ROOM_ID_NULL},{name:gu.TYPE_STRING,error:l.INPUT_PARAM,extMsg:"roomID must be string"},{name:gu.MAX_LENGTH_128,error:l.ROOM_ID_TOO_LONG},{name:gu.ILLEGAL_CHARACTERS,error:l.ROOM_ID_INVALID_CHARACTER}]},token:{order:1,value:i,rules:[{name:gu.NOT_EMPTY,error:l.INPUT_PARAM},{name:gu.TYPE_STRING,error:l.INPUT_PARAM}]},user:{order:2,value:e,rules:[{name:gu.NOT_EMPTY,error:l.INPUT_PARAM,extMsg:" param user error."},{name:gu.TYPE_OBJECT,error:l.INPUT_PARAM,extMsg:" param user error."}]},"user.userID":{order:3,value:e.userID,rules:[{name:gu.NOT_EMPTY,error:l.USER_ID_NULL,extMsg:" param user error."},{name:gu.TYPE_STRING,error:l.INPUT_PARAM,extMsg:" param userID error."},{name:gu.MAX_LENGTH_64,error:l.USER_ID_TOO_LONG},{name:gu.ILLEGAL_CHARACTERS,error:l.USER_ID_INVALID_CHARACTER}]},"user.userName":{order:4,value:e.userName,rules:[{name:gu.TYPE_STRING,error:l.INPUT_PARAM,extMsg:" userName must be string."},{name:gu.MAX_LENGTH_256,error:l.USER_NAME_TOO_LONG}]},config:{order:5,value:n,rules:[]},"config.maxMemberCount":{order:6,value:n.maxMemberCount,rules:[{name:gu.TYPE_INTEGER,error:l.INPUT_PARAM,extMsg:" maxMemberCount must be integer number."}]}},{action:Lu,logger:this.zn}))!==Gc)return g.roomHandler._roomStateHandle(rh,xt.LoginFailed,_.error,_.extMsg),s(_.error,_.extMsg),[2];if(y=this.So(o,u,t,i,n),w=y.loginSpan,b.setLoginRoomCallback(y.interResolve,y.interReject),this.zn.setSessionInfo(this.Dn.appid,"","",e.userID,"",this.version),this.Dn.roomModulesList.length>0&&1==this.Dn.isMultiRoom?g.isMulti=!0:fl([],this.Dn.roomModulesList,!0).forEach(function(t){return t.roomHandler.logout()}),n&&(g.config=n),this.Dn.roomModulesList.push(g),this.netAgent&&(this.Dn.idName=e.userID,this.netAgent.setUserInfo(e.userID),this.Dn.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.Ln.setCommonAttributes({id_name:e.userID}),this.Ln.setReporterInfo(e.userID,i),this.zn.setTokenInfo(i,e.userID),this.Ln.setSpanInMap(w,{key:Ba.event,par:t}),this.Dn.setMultiRoom=!0,!this.isUaConnect){this.zn.info(Lu+" 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.zn.warn(Lu+" connect ua fail "+JSON.stringify(null==t?void 0:t.message))}return[2]}return this.Dn.networkState=c.online,b.retryLoginRoom(!0),[2]}})})})},i.prototype.switchRoom=function(t,i,e){return void 0===t&&(t=""),void 0===i&&(i=""),cl(this,void 0,void 0,function(){var n,s,r,o=this;return hl(this,function(u){return this.zn.info("".concat(Uu," call by user fromRoomID:").concat(t," toRoomID:").concat(i)),(s=Yc({fromRoomID:{order:0,value:t,rules:[{name:gu.NOT_EMPTY,error:(n=Ba.error).ROOM_ID_NULL},{name:gu.TYPE_STRING,error:n.INPUT_PARAM,extMsg:"roomID must be string"},{name:gu.MAX_LENGTH_128,error:n.ROOM_ID_TOO_LONG},{name:gu.ILLEGAL_CHARACTERS,error:n.ROOM_ID_INVALID_CHARACTER}]},toRoomID:{order:1,value:i,rules:[{name:gu.NOT_EMPTY,error:n.ROOM_ID_NULL},{name:gu.TYPE_STRING,error:n.INPUT_PARAM,extMsg:"roomID must be string"},{name:gu.MAX_LENGTH_128,error:n.ROOM_ID_TOO_LONG},{name:gu.ILLEGAL_CHARACTERS,error:n.ROOM_ID_INVALID_CHARACTER}]},config:{order:2,value:e,rules:[{name:gu.NOT_EMPTY,error:n.INPUT_PARAM,extMsg:"param config error."},{name:gu.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:gu.NOT_EMPTY,error:n.INPUT_PARAM},{name:gu.TYPE_STRING,error:n.INPUT_PARAM}]},"config.maxMemberCount":{order:4,value:null==e?void 0:e.maxMemberCount,rules:[{name:gu.TYPE_INTEGER,error:n.INPUT_PARAM,extMsg:"maxMemberCount must be integer number."}]}},{action:Uu,logger:this.zn}))!==Gc?(this.zn.error(Uu+" 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.zn.error("".concat(Uu," params error: ").concat(Ut.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID.code)),[2,Promise.reject(Ut.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.zn.error("".concat(Uu," params error: ").concat(Ut.ROOM_ROOMID_INCORRECT.code)),[2,Promise.reject(Ut.ROOM_ROOMID_INCORRECT)])})})},i.prototype.handleLogUpload=function(){var t,i;if(this.zn.info(Vu+" call"),this.Dn.customSetLogURL)this.zn.info(Vu+" set custom log");else if(this.zn.url&&this.zn.logConnected)this.zn.info(Vu+" log is connected");else{var e=[],n=[],s=this.Dn.advanceConfig.customDomain;if(s&&s.logreport)e.push(u=s.logreport),this.Dn.logDomain=u;else if(this.Dn.geoFencing){var r=this.Dn.geoFencing,o=r.wssV6Logreport;(u=r.logreport)&&e.push(u),o&&n.push(o)}else if(this.Dn.testEnvironment)this.Dn.logDomain="weblogger-hk-test.zegocloud.com",e.push(this.Dn.logDomain);else if(0===this.stateCenter.ENV){if(this.Dn.svrDomains){var u,a=this.Dn.svrDomains;o=a.wssV6Logreport;(u=a.logreport)&&e.push(u),o&&n.push(o)}}else if(1===this.stateCenter.ENV){this.Dn.logDomain=Cu.logreportDomain,e.push(this.Dn.logDomain);var c=null===(i=null===(t=this.Dn.appConfig)||void 0===t?void 0:t.app_config)||void 0===i?void 0:i.domain;if(c){var h="weblogger".concat(this.Dn.appid,"-api.").concat(c);e.push(h)}}if(0===this.Dn.ENV){var f=e.map(function(t){return"wss://".concat(t,"/").concat(Cu.rtcLogPath)}),l=n.map(function(t){return"wss://".concat(t,"/").concat(Cu.rtcLogPath)});(f.length>0||l.length>0)&&this.zn.setLogServer(f,l)}else{f=e.map(function(t){return"https://".concat(t,"/httplog")});this.zn.setLogServer(f,[])}}},i.prototype.fetchAppConfigByTargetToken=function(t,i){return cl(this,void 0,void 0,function(){var e,n,s,r,o,u,a=this;return hl(this,function(c){switch(c.label){case 0:if(this.zn.info(Ju+" call"),!i)return this.zn.warn(Ju+" user not exist"),[2];if(e=this.getUserID(),n="",s=null,t)n=t;else{if(!(this.Dn.roomModulesList.length>0))return this.zn.warn(Ju+" token not exist"),[2];n=this.getToken()}!this.zn.roomid&&this.zn.setSessionInfo(this.Dn.appid,"player-no-room","",i,"",this.Dn.sdKVersion),c.label=1;case 1:return c.trys.push([1,5,6,7]),this.netAgent.isConnect()?[3,3]:[4,new ni(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.zn.error(Ju+" ua not connected"),[2];this.zn.info(Ju+" ua connected"),c.label=3;case 3:return this.netAgent.setUserInfo(i),[4,this.netAgent.getAppConfigByAgent("init",n,5e3,this.Dn.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.zn.error(Ju+" token not validated"+u),[3,7];case 6:return e&&this.netAgent.setUserInfo(e),this.zn.info(Ju+" call success"),[2,s];case 7:return[2]}})})},i.prototype.fetchAppConfig=function(t){return cl(this,void 0,void 0,function(){var i,e,n,s,r,o,u,c,h,f,l,d,v,m,p,g,b;return hl(this,function(_){switch(_.label){case 0:if(this.Dn.appConfigFetched)return this.zn.warn(Bu+" config fetched"),[2];if(!this.getUserID())return this.zn.info(Bu+" user not exist"),[2];if(i="",t)i=t;else{if(!(this.Dn.roomModulesList.length>0))return this.zn.warn(Bu+" token not exist"),[2];i=this.getToken()}e=this.Ln.createSpan(a.H,{key:Ma.event},{key:""},Pc),this.zn.info(Lu+" initConfig etag: "+this.Dn.appConfigEtag),-1!==this.Dn.appConfigEtag&&(!(n=this.Dn.appConfig.SDKVersion)||this.Dn.sdkVerNum>n)&&(this.Dn.appConfigEtag=-1,this.zn.warn(Lu+" reset etag. "+n)),s=!!this.Dn.appConfig,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this.netAgent.getAppConfigByAgent("init",i,5e3,this.Dn.appConfigEtag,{isSpecial:!1})];case 2:if(r=_.sent(),o=r.code,u=r.data,c=r.etag,h=r.retryCount,e.setAttributes({trigger_reason:Mc(this.Dn.appConfig?"refresh":"normal"),try_count:xc(h||0),request_etag:this.Dn.appConfigEtag,response_etag:c,init_conf:Oi(u)}),e.end(),this.Dn.appConfigFetched=!0,this.zn.info(Lu+" initConfig code:"+o+" data: "+JSON.stringify(u)+" etag: "+c),this.Dn.appConfigEtag!==c){if(0==Object.keys(u).length)return this.zn.info(Lu+" initConfig data null"),[2];d=u.log_config,this.Dn.appConfig={app_config:u.app_config,media_config:{publish_config:(f=u.media_config).publish_config,play_config:f.play_config},speedlog_config:al(al({},l=u.speedlog_config),{charge_info_report_no_playing:l.charge_info_report_no_playing||0}),log_config:d,SDKVersion:this.Dn.sdkVerNum},this.Dn.appConfigEtag=c,v=JSON.stringify(this.Dn.appConfig),m=uu(v,wu),cu(ku+"_"+this.getAppID()+"_"+(this.Dn.mode||Cu.modeNo),m),p=uu(this.Dn.appConfigEtag+"",wu),cu(Ru+"_"+this.getAppID()+"_"+(this.Dn.mode||Cu.modeNo),p)}return!s&&this.Dn.appConfig&&this.Dn.actionListener("_appConfigRsp"),!this.Dn.netAppConfig&&this.Dn.appConfig&&(this.Dn.netAppConfig=Object.assign(this.Dn.appConfig),this.Dn.actionListener("_netAppConfigRsp",this.Dn.netAppConfig)),[3,4];case 3:return g=_.sent(),this.zn.error(Lu+" fail "+JSON.stringify(g)),e.setAttributes({error:null==g?void 0:g.code}),e.end(),[20012,20008,20019].includes(null==g?void 0:g.code)&&(b=20019===(null==g?void 0:g.code)?JSON.parse(JSON.stringify(Ut.SDK_NOT_SPECIAL)):JSON.parse(JSON.stringify(Ut.APPID_INVALID)),this.Dn.roomModulesList.forEach(function(t){t.roomTryHandler&&t.roomTryHandler.loginFail(b)})),[3,4];case 4:return[2]}})})},i.prototype.Kr=function(){var t,i=this;null===(t=this.cloudSetting)||void 0===t||t.fetchMultiSetting([rl,ol,ul]).then(function(t){var e;if(i.zn.info(Lu+" settingConfig "+JSON.stringify(t)),t){var n=Lu+" fetche setting.";i.oo(null===(e=null==t?void 0:t[rl])||void 0===e?void 0:e.setting),i.Dn.actionListener("_settingCanFetch",null==t?void 0:t[ul]);var s=i.so(!0,!0);i.zn.info(n+=s),i.uo(),i.setAPIReports();var r=i.ao("report_script");if(r){var o=r.url,u=r.key,a=r.hash;i.zn.info("".concat(Lu," report script ").concat(o," ").concat(u," ").concat(a)),o&&i.Ln.loadScript(!0,o,u,a)}}}).catch(function(t){i.zn.warn(Lu+" settingConfig "+JSON.stringify(t))}),this.Dn.onListener("_cloudSettingNotify",function(t,e){var n=i.cloudSetting.getEnvVariables()||{},s=i.Ln.createSpan(a.H,{key:Ma.event},{key:""},lc);if(s.setAttributes({request_kv:dc(n),files:vc([{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===rl){i.oo(null==e?void 0:e.setting);var r=i.so(!0,!0);r&&i.zn.info(Lu+" setting changed "+r)}})},i.prototype.no=function(t,i,e){0!==(null==e?void 0:e.code)||!1===(null==e?void 0:e.polling)?"request_start"===i?this.Ln.createSpan(a.H,{key:Ma.event},{key:mc,par:t+""},mc,!0):"request_end"===i&&this.Ln.spanEnd({key:mc,par:t+""},{request_detail:pc(null==e?void 0:e.reportData),files:gc(null==e?void 0:e.files),code:null==e?void 0:e.code,request_kv:null==e?void 0:e.requestKV}):this.zn.info("zm.crn not report")},i.prototype.So=function(t,i,e,n,s){var r=this,o=Ba,u=this.Ln.createSpan(a.I,{key:Ma.event},{key:""},o.event);u.setAttributes({svr_env:o.svr_env(this.Dn.testEnvironment?"test":"online"),token:o.token(n)}),s&&(Gt(s.userUpdate)&&u.setAttribute("user_state_update",o.user_state_update(s.userUpdate?1:0)),Vt(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.Dn.isMultiRoom?1:0),role:o.role(r.Dn.role),audience_create_room:o.audience_create_room(r.Dn.roomCreateFlag?1:0),max_member_cnt:o.max_member_cnt((null==a?void 0:a.maxMemberCount)||0),user_name:r.Dn.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=Uo(t.code,t.msg),c=Bo(t.code)):a={code:t.code,message:t.msg},a&&r.Ln.setError(u,{code:a.code,msg:a.message+n}),c&&Ut[c]&&(t.code=Ut[c].code,(null===(s=t.msg)||void 0===s?void 0:s.includes("unknown"))&&(t.msg=Ut[c].msg)),i(t.code&&t.msg&&""!==n?{code:t.code,msg:t.msg+n}:t)},loginSpan:u}},i.prototype.logoutRoom=function(t,i,e){var n=this;this.zn.info(qu+" call by user "+t);var s=[];if(this.Dn.roomModulesList.length){var r="normal logout";if(i?r="switch room":e&&(r="page unload"),void 0===t)fl([],this.Dn.roomModulesList,!0).forEach(function(t){n.Eo(t,void 0,void 0,r),s.push(t.roomID),t.roomHandler.logout(!0)}),this.cloudSetting.uninit();else{if(!Ht(t)||""==t)throw this.zn.error(qu+" roomID must be string and not empty"),this.Eo(void 0,o=Ya.error.ROOM_ROOMID_INCORRECT,void 0,r),this.Dn.isFlutter&&this.Dn.actionListener("roomStateChanged",t,xt.LogoutFailed,o.code,o.msg),o;var o,u=this.getRoomModules(t);if(!u)throw this.zn.error(qu+" room not exist "+t),this.Eo(void 0,o=Ya.error.ROOM_ROOMID_INCORRECT,t,r),this.Dn.isFlutter&&this.Dn.actionListener("roomStateChanged",t,xt.LogoutFailed,o.code,o.msg),o;this.Eo(u,void 0,void 0,r),s.push(t),u.roomHandler.logout(!1,i),0===this.Dn.roomModulesList.length&&this.cloudSetting.uninit()}this.Ln.deleteCommonAttributes(["id_name"]),this.Ln.clearRoomSpans(s)}else{this.zn.warn(qu+" no room");var a={code:0,msg:"no room login"};this.Dn.actionListener("roomStateChanged",t,xt.Logout,a.code,a.msg)}},i.prototype.uploadLog=function(t){var i=this;return void 0===t&&(t=!1),new Promise(function(e,n){i.zn.info("zm.zip.udlg call "+t),i.zn.uploadStorageLog(t).then(function(){i.zn.info("zm.zip.udlg call success"),e({errorCode:0,extendedData:"upload logs success!"})}).catch(function(t){i.zn.error("zm.zip.udlg upload zip log failed, result: "+((null==t?void 0:t.message)||"unknown")),e({errorCode:Ut.UPLOAD_LOG_ERROR.code,extendedData:Ut.UPLOAD_LOG_ERROR.msg+", result: "+((null==t?void 0:t.message)||"unknown")})})})},i.prototype.sendCustomCommand=function(t,i,e){return new Promise(function(t,i){console.error(v),i()})},i.prototype._sendCustomCommand=function(t,i,e){return new Promise(function(t,i){console.error(v),i()})},i.prototype.sendRoomChannelMessage=function(t,i,e,n,s){return new Promise(function(t,i){console.error(v),i()})},i.prototype.sendTransparentMessage=function(t,i){return new Promise(function(t,i){console.error(v),i()})},i.prototype.sendBroadcastMessage=function(t,i){return new Promise(function(t,i){console.error(v),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(v),i()})},i.prototype.setRoomExtraInfo=function(t,i,e){return new Promise(function(t,i){console.error(v),i()})},i.prototype._setRoomExtraInfo=function(t,i,e){return new Promise(function(t,i){console.error(v),i()})},i.prototype.sendBarrageMessage=function(t,i){return new Promise(function(t,i){console.error(v),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(v),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(v),!1},i.prototype.inviteJoinLive=function(t,i,e,n,s){return console.error(v),!1},i.prototype.endJoinLive=function(t,i,e,n){return console.error(v),!1},i.prototype.respondJoinLive=function(t,i,e,n,s){return console.error(v),!1},i.prototype.getVersion=function(){return this.version},i.prototype.setSdkBizVersion=function(t){Ht(t)&&""!==t&&(this.Dn.bizVersion=t)},i.prototype.on=function(t,i){return this.Dn.listenerList[t]?Qt(i)?(-1==this.Dn.listenerList[t].indexOf(i)&&this.Dn.listenerList[t].push(i),!0):(this.zn.error(Qu+" listener callBack must be funciton"),!1):(this.zn.error(Qu+" event "+t+" no found"),!1)},i.prototype.off=function(t,i){if(!this.Dn.listenerList[t])return this.zn.error(Xu+" listener no found"),!1;var e=this.Dn.listenerList[t];if(i){var n=e.indexOf(i);n>=0&&e.splice(n,1)}else this.Dn.listenerList[t]=[];return!0},i.prototype._on=function(t,i){return this.Dn.listenerList[t]?Qt(i)?(-1==this.Dn.listenerList[t].indexOf(i)&&this.Dn.listenerList[t].push(i),!0):(this.zn.error(Qu+" listener callBack must be funciton"),!1):(this.zn.error(Qu+" event "+t+" no found"),!1)},i.prototype._off=function(t,i){if(!this.Dn.listenerList[t])return this.zn.error(Xu+" listener no found"),!1;var e=this.Dn.listenerList[t];return i?e.splice(e.indexOf(i),1):this.Dn.listenerList[t]=[],!0},i.prototype.isTestEnvironment=function(){return this.Dn.testEnvironment},i.prototype.isLogin=function(t){var i=this.getRoomModules(t)||this.Dn.roomModulesList[0];return!!i&&i.isLogin()},i.prototype.getMultiRoom=function(){return this.Dn.isMultiRoom},i.prototype.getAppID=function(){return this.Dn.appid},i.prototype.getUserID=function(){return this.Dn.idName},i.prototype.getUserName=function(){return this.Dn.nickName},i.prototype.getToken=function(t){return(this.getRoomModules(t)||this.Dn.roomModulesList[0]).token},i.prototype.setRoomCreateFlag=function(t){this.Dn.roomCreateFlag=t},i.prototype.setRole=function(t){this.Dn.role=t},i.prototype.getSessionId=function(t){var i=this.getRoomModules(t)||this.Dn.roomModulesList[0];return i?i.userSidString:"0"},i.prototype.getRoomSessionID=function(t){var i=this.getRoomModules(t)||this.Dn.roomModulesList[0];return i?i.roomSidString:"0"},i.prototype.getAppConfig=function(){return this.Dn.appConfig},i.prototype.setTestPackageSize=function(t){this.stateCenter.configOK&&(this.Dn.testNetPackageSize=t)},i.prototype.setAccess=function(t){},i.prototype.enableMultiRoom=function(t){var i=this.Ln.createSpan(a.H,{key:Ma.event},{key:""},cc.event);return Gt(t)?(i.setAttribute("is_multi",cc.is_multi(t)),this.Dn.roomModulesList.length>0||this.Dn.setMultiRoom?(this.zn.error(Ku+" multi room can only be set once before first login"),this.Ln.setError(i,cc.error.kAlreadyLoginError),!1):(i.end(),this.Dn.isMultiRoom=t,this.Dn.setMultiRoom=!0,!0)):(this.zn.error(Ku+" param must be boolean"),this.Ln.setError(i,cc.error.kInvalidParamError),!1)},i.prototype.getRoomModules=function(t){return this.Dn.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,fh,nl)}},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 Au.find(function(i){return i.id===t})}))throw new Error("GeoFencing set Error");i.geoFenceAreaList=t.geoFenceAreaList}if(t.dataReportCustomerContext&&mi(t.dataReportCustomerContext,!0)&&xh.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=al(al({},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),Ht(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=al({},i),!0},i.prototype.resetRoomTokenTimer=function(t,i){var e=this.getRoomModules(t)||this.Dn.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.Dn.protoFormat=t},i.prototype.setSdkLoginRelateService=function(t){Array.isArray(t)&&t.every(function(t){return Ht(t)})&&(this.Dn.relateService=t)},i.prototype.getRoomID=function(){return this.Dn.roomid},i.prototype.getServerTimeOffset=function(){return this.Dn.serverTimeOffset},i.prototype.getReqHead=function(t){var i;return i=Ht(t)&&""!==t&&this.getRoomModules(t)||this.Dn.roomModulesList[0],this.liveRoomHandler.getReqHead(i)},i.prototype.sendSwitchMessage=function(t,i){throw this.zn.error("".concat("zm.ssm"," ").concat(Ut.WHITE_BOARD_VERSION_ERROR.msg)),Ut.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 Vt(t)&&i?this.liveRoomHandler.sendMessage(t,i,void 0,void 0,e,void 0,!1):-1},i.prototype.Eo=function(t,i,e,n){var s=this,r=Ya.event,o=this.Ln.getAPIErrorReport(r);if(i)o&&this.Ln.takeAPIErrorReport(r,i,o);else{var u=this.Ln.createSpan(a.I,{key:Ma.event},{key:r,par:null==t?void 0:t.roomID},r,!0);if(u.setAttributes({is_multi:Ya.is_multi(this.Dn.isMultiRoom),is_send_cmd_net:Ya.is_send_cmd_net(!0),reason:Ya.reason(n)}),t){var c=t.roomHandler;c.updateTimes(),u.setAttributes({room_id:Ya.room_id(null==t?void 0:t.roomID),room_sid_string:Ya.room_sid_string(null==t?void 0:t.roomSidString),liveroom_sid_string:Ya.liveroom_sid_string(null==t?void 0:t.userSidString),valid_d:c.validTime,total_d:c.totalTime,tempbroken_cnt:c.brokenCounts})}else Ht(e)&&u.setAttributes({room_id:Ya.room_id(e),valid_d:0,total_d:0,tempbroken_cnt:0});i?this.Ln.setError(u,i):u.end(),setTimeout(function(){s.Ln.flush()},200)}},i.prototype.getMsgSpan=function(t,i,e){return void 0===e&&(e=!1),this.Ln.createSpan(a.H,{key:Ba.event,par:i},{key:t,par:i},t,e)},i.prototype.lo=function(){var t=this;Vt(this.netAgent.timeOffset)&&this.Ln.setTimeOffset(this.netAgent.timeOffset),this.Oo=setTimeout(function(){t.lo()},9e5)},i.prototype.setNetAgentHBMode=function(t){this.netAgent.setHeartBeatMode(t)},i.prototype.setLocalGeoFencing=function(){var t=this.Dn.netGeoFencing;if((null==t?void 0:t.id)&&(null==t?void 0:t.accesshub)){var i=uu(JSON.stringify(this.Dn.netGeoFencing),wu);cu(Iu+"_"+this.Dn.appid+"_"+(this.Dn.mode||Cu.modeNo),i),this.Dn.netGeoFencing={}}},i.prototype.getLocalGeoFencing=function(){var t=hu(Iu+"_"+this.Dn.appid+"_"+(this.Dn.mode||Cu.modeNo));if(!t)return this.zn.info(Yu+" no local geo"),null;var i=au(t,wu);if(i)try{return JSON.parse(i)}catch(t){return this.zn.warn(Yu+" local geo descrypt fail"),null}return null},i.prototype.getGeoDomains=function(){var t,e,n,s;if(i.geoFenceType&&i.geoFenceAreaList){this.zn.info("".concat(Hu," 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.zn.warn("".concat(Hu," geofencing not exist")),Ut.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.Dn.geoFencing=r,this.zn.info("".concat(Hu," use geo ").concat(JSON.stringify(this.Dn.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(Au));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 cf(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 mf(t)):(null===(e=this.proxyCtrl)||void 0===e||e.destroy(),this.proxyCtrl=null)},i.prototype.setAPIReports=function(){var t=this.Dn.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.Ln.setAPIErrorReport("/sdk/login",r(i,t[1])),this.Ln.setAPIErrorReport("/sdk/logout",r(i,e)),this.Ln.setAPIErrorReport("/sdk/start_publish",r(i,n)),this.Ln.setAPIErrorReport("/sdk/start_play",r(i,s))},i.customDomain={},i.proxyCtrl=null,i.pageID="",i}(),dl=function(){function t(t,i,e,n){var s;void 0===e&&(e=0),null===(s=ll.proxyCtrl)||void 0===s||s.init({appID:t}),this.logger=new Zc.ZegoLogger(e,ll.proxyCtrl||void 0),this.dataReport=new Zc.ZegoDataReport(this.logger),this.reporter=new xh(this.logger),this.zegoWebRTM=new ll(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.sendTransparentMessage=function(t,i){return this.zegoWebRTM.sendTransparentMessage(t,i)},t.prototype.setLogConfig=function(t){return this.zegoWebRTM.setLogConfig(t)},t.presetLogConfig=function(t){return ll.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){ll.use(t)},t.setGeoFence=function(t,i){ll.setGeoFence(t,i)},t.setEngineOptions=function(t){ll.setEngineOptions(t)},t.setCloudProxyConfig=function(t,i,e){ll.setCloudProxyConfig(t,i,e)},t.setLocalProxyConfig=function(t,i){ll.setLocalProxyConfig(t,i)},t}(),vl=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))},ml=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=vl(vl(vl([],r.obj.H265,!0),r.obj.H264,!0),r.obj.VP8,!0):"VP8"===e?u=vl(vl(vl([],r.obj.H265,!0),r.obj.H264,!0),r.obj.VP9,!0):"H264"===e?u=vl(vl(vl([],r.obj.H265,!0),r.obj.VP8,!0),r.obj.VP9,!0):"H265"===e&&(u=vl(vl(vl([],r.obj.VP8,!0),r.obj.H264,!0),r.obj.VP9,!0)),"H264"==e&&Gt(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 _t.BASE_LINE:return!i.includes("profile-level-id=42");case _t.MAIN:return!i.includes("profile-level-id=4d");case _t.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=Ft(s)||s!==et.HARD_SOFT_ENCODEC_FIRST?Ft(s)||s!==et.HIGH_PROFILE_FIRST?[h([c(_t.BASE_LINE),a(n)]),h([c(_t.BASE_LINE),a(!n)]),h([a(n)]),h([a(!n)])]:[h([c(_t.HIGH),a(n)]),h([c(_t.HIGH),a(!n)]),h([a(n)]),h([a(!n)])]:[h([a(n),c(_t.BASE_LINE)]),h([a(n)]),h([a(!n),c(_t.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}(),pl=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())})},gl=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])}}},bl=function(){function t(){var t=this,i=si.createElement("canvas"),e=i.getContext("2d");e.fillStyle="rgba(255, 255, 255, 0)";try{this.To=i.captureStream()}catch(t){console.error("canvas captureStream error",t)}this.ko=setInterval(function(){e.fillText("test",Math.floor(640*Math.random()),Math.floor(480*Math.random()))},33),this.Ro=setTimeout(function(){t.Io&&t.Io("Detection timeout"),t.hangup()},5e3)}return t.prototype.checkSupportByType=function(t,i){return pl(this,void 0,void 0,function(){var i,e,n=this;return gl(this,function(s){switch(s.label){case 0:return this.checkType=t,i={},this.No=new RTCPeerConnection(i),this.Co=new RTCPeerConnection(i),e=new ni(function(t){return n.Io=t}),this.No.addEventListener("icecandidate",function(t){return n.onIceCandidate(n.No,t)}),this.Co.addEventListener("icecandidate",function(t){return n.onIceCandidate(n.Co,t)}),this.No.addEventListener("iceconnectionstatechange",function(i){"connected"===n.No.iceConnectionState&&(n.zo=setTimeout(function(){return pl(n,void 0,void 0,function(){var i=this;return gl(this,function(e){switch(e.label){case 0:return[4,this.No.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.Do=!0,i.Ao=n,i.Po&&i.detectIsSupported(t)}}),[2]}})})},1e3))}),this.Co.addEventListener("iceconnectionstatechange",function(i){"connected"===n.Co.iceConnectionState&&(n.Mo=setTimeout(function(){return pl(n,void 0,void 0,function(){var i=this;return gl(this,function(e){switch(e.label){case 0:return[4,this.Co.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.Po=!0,i.xo=n,i.Do&&i.detectIsSupported(t)}}),[2]}})})},1e3))}),this.To.getTracks().forEach(function(t){return n.No.addTrack(t,n.To)}),[4,this.check(t)];case 1:return s.sent(),[4,e];case 2:return[2,s.sent()]}})})},t.prototype.check=function(t,i){return pl(this,void 0,void 0,function(){var e,n;return gl(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),i&&Qt(this.No.addTransceiver)&&(this.No.addTransceiver("video",{direction:"sendonly"}),this.No.addTransceiver("audio",{direction:"sendonly"})),[4,this.No.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})];case 1:return(e=s.sent()).sdp=ml.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 pl(this,void 0,void 0,function(){var i,e,n,s;return gl(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.No.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.Co.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.Co.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 pl(this,void 0,void 0,function(){var i,e;return gl(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.Co.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.No.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 pl(this,void 0,void 0,function(){var e;return gl(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.Io(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.No?this.Co:this.No},t.prototype.getPcName=function(t){return t===this.No?"_zgp_localPc":"_zgp_remotePc"},t.prototype.onCreateSessionDescriptionError=function(t){console.error("Failed to create session description: ".concat(t.toString())),this.hangup(),this.Io(t)},t.prototype.onSetSessionDescriptionError=function(t){console.error("Failed to set session description: ".concat(t.toString())),this.hangup(),this.Io(t)},t.prototype.detectIsSupported=function(t){this.Io(!(!this.Ao||!this.xo)||"The browser does not support ".concat(t," format")),this.hangup()},t.prototype.hangup=function(){this.No.close(),this.Co.close(),this.To.getTracks().forEach(function(t){return t.stop()}),this.Ro&&(clearTimeout(this.Ro),this.Ro=null),this.zo&&(clearTimeout(this.zo),this.zo=null),this.Mo&&(clearTimeout(this.Mo),this.Mo=null),this.Do=!1,this.Po=!1,this.ko&&(clearInterval(this.ko),this.ko=null)},t}();const _l="[a-fA-F\\d:]",yl=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${_l})|(?<=${_l})(?=\\s|$))`:"",wl="(?: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}",Sl="[a-fA-F\\d]{1,4}",El=`\n(?:\n(?:${Sl}:){7}(?:${Sl}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${Sl}:){6}(?:${wl}|:${Sl}|:)| // 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(?:${Sl}:){5}(?::${wl}|(?::${Sl}){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(?:${Sl}:){4}(?:(?::${Sl}){0,1}:${wl}|(?::${Sl}){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(?:${Sl}:){3}(?:(?::${Sl}){0,2}:${wl}|(?::${Sl}){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(?:${Sl}:){2}(?:(?::${Sl}){0,3}:${wl}|(?::${Sl}){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(?:${Sl}:){1}(?:(?::${Sl}){0,4}:${wl}|(?::${Sl}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::${Sl}){0,5}:${wl}|(?::${Sl}){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(),Ol=new RegExp(`(?:^${wl}$)|(?:^${El}$)`),Tl=new RegExp(`^${wl}$`),kl=new RegExp(`^${El}$`),Rl=t=>t&&t.exact?Ol:new RegExp(`(?:${yl(t)}${wl}${yl(t)})|(?:${yl(t)}${El}${yl(t)})`,"g");Rl.v4=t=>t&&t.exact?Tl:new RegExp(`${yl(t)}${wl}${yl(t)}`,"g"),Rl.v6=t=>t&&t.exact?kl:new RegExp(`${yl(t)}${El}${yl(t)}`,"g");var Il=Rl;const{toString:Nl}=Object.prototype;const Cl={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function zl(t,i={}){if("[object RegExp]"!==Nl.call(t))throw new TypeError("Expected a RegExp instance");const e=Object.keys(Cl).map(e=>("boolean"==typeof i[e]?i[e]:t[e])?Cl[e]:"").join(""),n=new RegExp(i.source||t.source,e);return n.lastIndex="number"==typeof i.lastIndex?i.lastIndex:t.lastIndex,n}function Dl(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}(()=>zl(t).test(i))()}catch(t){throw t}}const Al={timeout:400};function Pl(t){return!(t.length>45)&&Dl(Il.v6({exact:!0}),t,Al)}function Ml(t){return!(t.length>15)&&Dl(Il.v4({exact:!0}),t,Al)}function xl(t){return[t>>24&255,t>>16&255,t>>8&255,255&t].join(".")}function jl(t){var i=t.split(".");return(parseInt(i[0])<<24)+(parseInt(i[1])<<16)+(parseInt(i[2])<<8)+parseInt(i[3])}function Ll(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 ql(t){return Pl(t)}function Ul(t){return function(t){return Ml(t)}(t)?Nt.IPv4:ql(t)?Nt.IPv6:-1}function Bl(t){var i=t.match(/^[^:]*:(.*?):[^:]*$/);return i?i[1]:""}var Jl=function(){return Jl=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},Jl.apply(this,arguments)},Vl=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())})},Hl=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])}}},Gl=kn.error.ie;function Fl(t,i){return Vl(this,void 0,void 0,function(){return Hl(this,function(e){return i&&Qt(t.addTransceiver)&&(t.addTransceiver("video",{direction:"sendonly"}),t.addTransceiver("audio",{direction:"sendonly"})),[2,t.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})]})})}function Yl(t,i,e,n,s){var r;return Vl(this,void 0,void 0,function(){var o,u,a,c,h,f,l;return Hl(this,function(d){switch(d.label){case 0:if(o={webRTC:!1,customCapture:!1,camera:!1,microphone:!1,videoCodec:{H264:!1,H265:!1,VP8:!1,VP9:!1},screenSharing:t,errInfo:{}},n&&"screenSharing"===n)return i({result:t,errInfo:o.errInfo}),[2];if((!n||"customCapture"===n)&&(((u=si.createElement("video")).captureStream||u.mozCaptureStream)&&(o.customCapture=!0),"customCapture"===n))return i({result:o.customCapture,errInfo:o.errInfo}),[2];if(a=!!(null===(r=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===r?void 0:r.getUserMedia),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&&(console.error("webrtc requires https or localhost"),!a))throw new Error("webrtc requires https or localhost");return!t}(),n&&"camera"!==n&&"microphone"!==n)return[3,10];if(!a)return[3,9];if(n&&"camera"!==n)return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,od({video:!0,audio:!1})];case 2:return(c=d.sent())&&(o.camera=!0)&&c.getTracks().forEach(function(t){t.stop()}),[3,4];case 3:return h=d.sent(),o.errInfo.camera={name:h.name,message:h.message},console.error("camera devices detect error: ",h.name,h.message),[3,4];case 4:if(n&&"microphone"!==n)return[3,8];d.label=5;case 5:return d.trys.push([5,7,,8]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 6:return(f=d.sent())&&(o.microphone=!0)&&f.getTracks().forEach(function(t){return t.stop()}),[3,8];case 7:return l=d.sent(),o.errInfo.microphone={name:l.name,message:l.message},console.error("microphone devices detect error: ",l.name,l.message),[3,8];case 8:return[3,10];case 9:o.camera=!1,o.microphone=!1,d.label=10;case 10:return"camera"===n||"microphone"===n?(i({result:o[n],errInfo:o.errInfo}),[2]):(function(t,i,e,n){Vl(this,void 0,void 0,function(){var s,r,o,u,a,c,h,f,l,d;return Hl(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&&"H265"!==e?[3,2]:[4,(d=new bl).checkSupportByType(e,n)]:[3,2];case 1:return Gt(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,Fl(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","H265"];h<f.length;h++)l=f[h],d=new bl,c.push(d.checkSupportByType(l));return Promise.all(c).then(function(i){i.forEach(function(t,i){Gt(t)?s[a[i]]=!0:(s[a[i]]=!1,u=t)}),u?t(s,u):t(s)}),[2]}try{Fl(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||(o.videoCodec.H264=t.H264,o.videoCodec.H265=t.H265,o.videoCodec.VP8=t.VP8,o.videoCodec.VP9=t.VP9,o.webRTC=t.webRTC),e&&(Ht(e)?o.errInfo.extendedDate=e:o.errInfo.webRTC={name:e.name,message:e.message},console.error("videoCodec detect error: "+e)),i&&i(n?{result:t[n],errInfo:o.errInfo}:o)},e,n,s),[2])}})})}var Zl=function(t){return Yt(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 Ql(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:Ql(n)}else void 0!==n&&(i[e]=n)}return i}function Xl(t){return Uint8Array.from(Array.from(window.unescape(encodeURIComponent(t))).map(function(t){return t.charCodeAt(0)}))}var Wl=function(t){return t.split("\nm=").map(function(t,i){return(i>0?"m="+t:t).trim()+"\r\n"})};function Kl(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=Wl(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),Jl(Jl({},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 $l(t){var i=Kl(t)[0];if(i.length>0){var e=i[0].ip,n=Ul(e)===Nt.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 td(t){var i=t.match(/a=ice-ufrag:(\S+)/);return i?i[1]:""}function id(t){var i=t.match(/a=ice-pwd:(\S+)/);return i?i[1]:""}function ed(t){var i=t.split(":");return t.replace(":"+i[i.length-1],"")}function nd(t){var i=J.RTC;switch(t){case 1:case 3:i=J.CDN;break;case 2:i=J.L3;break;default:i=J.RTC}return i}function sd(t){return Ht(t)&&Number(t.split(".")[0])||0}function rd(t,i,e,n){var s=t.version,r=t.name.toLowerCase(),o=sd(s);return r===i&&(0===n&&o<e||(1===n&&o===e||2===n&&o>e))}function od(t){var i=this;return new ni(function(e,n){return Vl(i,void 0,void 0,function(){var i,s,r,o,u,a;return Hl(this,function(c){switch(c.label){case 0:i=[Jl({},t),Jl(Jl({},t),{video:{width:360}}),Jl(Jl({},t),{video:{width:640}}),Jl(Jl({},t),{video:{width:720}}),Jl(Jl({},t),{video:{width:854}}),Jl(Jl({},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 ud(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 ad(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 cd(t){return t.ip+":"+t.port}function hd(t,i){return t.findIndex(function(t){return i.includes(t.ip)&&i.includes(t.port+"")})}function fd(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 ld(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 dd(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(cs.wn)}):i&&i(cs.te)}function vd(t,i){if(Ft(t))return i(Gl," bitrate is required when videoQuality is 4"),!1;if(Vt(t)){if(!Vo(t,0,10240))return i(Gl," bitrate must be integer number"),!1;if(!function(t,i){return!(t>10240&&(i(Gl," bitrate cannot greater than 10 Mbps"),1))}(t,i))return!1}else i(Gl," bitrate must be number");return!0}function md(t,i,e,n){if(!Yt(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(Vt(u)&&!mi(u,!1))return{result:!1,message:" ".concat(o," of ").concat(i," must be integer number")};if(Vt(e)&&Vt(u)&&u<e)return{result:!1,message:" ".concat(o," of ").concat(i," must greater than ").concat(e)};if(Vt(n)&&Vt(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 pd(t,i,e,n,s){var r=md(t,i,n,s);return r.result||e&&e(Gl,r.message),r.result}function gd(t,i,e){for(var n=0,s=t;n<s.length;n++){var r=s[n],o=i[r];if(Ft(o))return e&&e(Gl," ".concat(r," is required when videoQuality is 4")),!1;if(Vt(o)&&!mi(o,!1))return e&&e(Gl," ".concat(r," must be integer number")),!1;if(Vt(o)&&("width"===r||"height"===r)&&o<0)return e&&e(Gl," ".concat(r," must greater than 0.")),!1;if(Vt(o)&&"width"===r&&o>7680)e&&e(Gl," ".concat(r," cannot greater than 7680."));else if(Vt(o)&&"height"===r&&o>4320)e&&e(Gl," ".concat(r," cannot greater than 4320."));else if(Yt(o)){if("width"===r&&!pd(o,r,e,0,7680))return!1;if("height"===r&&!pd(o,r,e,0,4320))return!1;if("frameRate"===r&&!pd(o,r,e))return!1}else if(!Vt(o)&&Yt(o))return e&&e(Gl," ".concat(r," must be number or object")),!1}return!0}function bd(t){return t&&"live"===t.readyState?!0===t.enabled?0:3:2}function _d(t){return(Vt(t)?t:t.exact?t.exact:t.ideal?t.ideal:t.min||t.max)||0}function yd(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 wd=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}}))},Sd="zc.0",Ed="zc.1",Od="zc.cs",Td="zc.ds",kd="zc.sps.0",Rd="zc.sps.1",Id="zc.sps.0.0",Nd="zc.sps.1.0",Cd="zc.smsi.0",zd="zc.psh.0",Dd="zc.psh.1",Ad="zc.tsh.rngn.0",Pd="zc.tsh.rngn.1",Md="zc.tsh.dgnb",xd="zc.s.cmt",jd="zc.s.sss",Ld="zsc.ssgn",qd="zsc.ccns",Ud="zsc.ucgl",Bd="zc.p.0.sp.0",Jd="zc.p.ps",Vd="zc.p.0.ocpss",Hd="zc.p.0.ocos",Gd="zc.p.0.oslds",Fd="zc.p.0.ogrd",Yd="zc.p.0.oic",Zd="zc.p.0.ocsc",Qd="zc.p.0.oicsc",Xd="zc.p.0.spqt",Wd="zc.p.0.upq",Kd="zc.p.0.orrs",$d="zc.p.0.orcs",tv="zc.p.0.sci",iv="zc.p.0.psr",ev="zc.p.0.od",nv="zc.p.0.ssl.0",sv="zc.p.0.heb",rv="zc.p.0.ss",ov="zc.p.0.sgn",uv="zc.p.0.hdgn",av="zc.p.0.scd",cv="zc.p.0.scg",hv="zc.p.0.tc",fv="zc.p.1.sp.0",lv="zc.p.ocpss.1",dv="zc.p.hcsws.1",vv="zc.p.ocos.1",mv="zc.p.oslds.1",pv="zc.p.ormd.1",gv="zc.p.oic.1",bv="zc.p.oicsc.1",_v="zc.p.rp.1",yv="zc.p.spqt.1",wv="zc.p.upq.1",Sv="zc.p.gs.1",Ev="zc.p.orrs.1",Ov="zc.p.orcs.1",Tv="zc.p.orss.1",kv="zc.p.ogrs.1",Rv="zc.p.sci.1",Iv="zc.p.psr.1",Nv="zc.p.ssl.1",Cv="zc.p.1.sgn",zv="zc.p.1.hdgn",Dv="zc.p.1.scd",Av="zc.p.1.scg",Pv="zc.p.1.smsbpm",Mv="zc.p.1.sms",xv="zc.p.1.mst",jv="zc.p.1.spsf",Lv="zc.uslq",qv="zc.sr.uud",Uv="zc.hpqd.pl",Bv="zc.hpqd.pu",Jv="zc.hcid.pu",Vv="zc.sr.sd",Hv="zc.sr.chdtr",Gv="zc.sr.sprd",Fv="zc.sr.srptc.0",Yv="zc.sr.cic.0",Zv="zc.sr.cnia.0",Qv="zc.p.scv",Xv="zc.sh.msbss",Wv="zc.sh.ms",Kv="zc.sh.psl",$v="zc.srs",tm="zc.irs",im="zc.ssh",em="zc.ups.0",nm="zc.vam.rv",sm="zc.vam.iwg",rm="zc.vam.vam",om="zc.svc",um="zc.sac",am="zc.rp",cm="zc.emo",hm="zc.asi",fm="zc.mpsv.0",lm="zc.mpsa.0",dm="zc.mm",vm="zc.mpsv.1",mm="zc.mpsa.1",pm="zc.mapa.1",gm="zc.mapv.1",bm="zc.ht",_m=function(){function t(t,i){this.zn=t,this.jo=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=P.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:[],playerRecvSEI:[],beautyEffectError:[],_engineConfigUpdate:[],backgroundEffectError:[],exceptionUpdate:[],networkQuality:[],mixerSoundLevelUpdate:[],autoMixerSoundLevelUpdate:[],mixerRelayCDNStateUpdate:[],_engineDestroy:[],recvExperimentalAPI:[],playerVideoTrackUpdate:[],playerAudioTrackUpdate:[],publisherVideoEncoderChanged:[]},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=U.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},switchRoomNotStopPlay:!1,enableReferenceBitrate:!0,speechEnhanceLogLevel:1},this.Lo=!0,this.qo=!1,this.player265Validated=!1,this.player265ReceiverList=[],this.miniSdpError=0,this.debugVerboseUpdateList={streamProbeState:[],chargeInfosUpdate:[],startConnectWebRTCServer:[]},this.logReportCallback=jo,this.unregisterCallback=qo,this.decodeServerError=Uo,this.getLiveRoomError=Bo,this.getServerError=Lo,this.mergeStreamList=Jo,this.actionSuccessCallback=xo,this.checkValidNumber=Vo,this.uint8arrayToBase64=Ko,this.getSeq=D,this.getReportSeq=A,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)&&!Ft(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",xy.ipStackMode)||St.IPv4Prefer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMiniSdp",{get:function(){if(!this.Lo&&!this.qo)return!1;if(!window.WebAssembly||!window.Worker)return!1;if(rd(this.browserInfo,"chrome",78,0))return!1;var t=this.settingConfig.getSetting("open_mini_sdp");return!!Gt(t)&&(this.zn.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.Uo},set:function(t){this.Uo=t},enumerable:!1,configurable:!0}),t.prototype.getRequestId=function(){return this.idName+"-"+D()},t.prototype.addListener=function(t,i){return this.listenerList[t]?Qt(i)?(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0):(this.zn.error("zc.o.0 listener callBack must be funciton"),!1):(this.zn.error("zc.o.0 event "+t+" no found"),!1)},t.prototype.actionListener=function(t){for(var i=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var s=["roomStreamUpdate","playerStateUpdate","publisherStateUpdate","screenSharingEnded","beautyEffectError","backgroundEffectError","playerVideoTrackUpdate","playerAudioTrackUpdate","publisherVideoEncoderChanged","deviceError"].includes(t);if(s&&this.listenerList[t]){var r=this.reporter.createSpan(a.H,{key:On},{key:""},js);r.setAttributes({listener:t,listener_params:JSON.stringify(e)}),r.end()}(s||["streamExtraInfoUpdate"].includes(t))&&this.zn.info("zc.al ".concat(t," ").concat(JSON.stringify(e))),this.listenerList[t]&&this.listenerList[t].forEach(function(n){try{setTimeout(function(){n.apply(void 0,e)},0)}catch(e){i.zn.error("zc.sc.al "+t+" "+e)}})},t.prototype.deleteListener=function(t,i){if(!this.listenerList[t])return this.zn.error("zc.o.1 listener no found"),!1;this.zn.info("zc.o.1 "+"".concat(t," cb:")+typeof i);var e=this.listenerList[t];if(i){var n=e.indexOf(i);n>=0&&e.splice(n,1)}else this.listenerList[t]=[];return!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.Kr=function(t,i){return this.settingConfig.getSetting(t,i)},t.prototype.destroy=function(){this.Uo=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.prototype.Bo=function(t,i){!function(t,i,e){for(var n in e)ko.includes(n)&&t>=1&&i.setAttribute(n,e[n])}(this.settingConfig.getSetting("report_attr_level"),t,i)},t}(),ym=function(){return ym=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},ym.apply(this,arguments)},wm=zs,Sm="zb.sh.usi",Em=function(){function t(t,i,e,n,s){this.zn=t,this.Dn=i,this.rtm=e,this.Uo=n,this.gs=s,this.Jo=0,this.Vo=0,this.Ho=0,this.Go=!1,this.Fo=null,this.Yo=2e3,this.Zo=5e3,this.mixStreamTaskList={},this.mixRequestIdList=[],this.mixStreamHbList={},this.roomID=s,this.logger=t,this.stateCenter=i}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reporter",{get:function(){return this.Ln},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=Xt(e)?e[0]||"":Ht(e)?e:"",t.urlHls=Xt(n)?n[0]||"":Ht(n)?n:"",t.urlFlvPlus=Xt(s)?s[0]||"":Ht(s)?s:"",t.urlHlsPlus=Xt(r)?r[0]||"":Ht(r)?r:"",t.urlHttpsFlv=Xt(o)?o[0]||"":Ht(o)?o:"",t.urlHttpsHls=Xt(u)?u[0]||"":Ht(u)?u:"",t.urlRtmp=Xt(a)?a[0]||"":Ht(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";ui(this.zn,e,"stream update"),this.room=i,t.body?(this.Yo=t.body.stream_list_hb_merge_timeout||2e3,this.Zo=t.body.stream_list_push_merge_timeout||5e3,this.Go=!1,this.handleFullUpdateStream(t.body.stream_seq,t.body.stream_info||[],!0),this._handleReconnectStream(t.body.stream_info),ai(this.zn,e)):this.zn.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=""),ui(this.zn,Sm);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.zn.info(Sm+" 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.Uo.publisherList[t]){var d=this.Uo.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=ym({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,h=c.room,f=c.rtm.stateCenter.roomModulesList.find(function(t){return t.roomID===(null==h?void 0:h.roomID)}),l=function(){return(null==f?void 0:f.isTryLogin())||"CONNECTING"===(null==f?void 0:f.roomState)},d=function(){c.zn.warn(Sm+" resend stream update "+i),c._updateStreamInfo(t,i,e,n,s,r)};if(h&&((null==f?void 0:f.isLogin())||l())&&o.code&&o.code==ji.code&&h.streamInfoList[t].seq==u){setTimeout(function(){if(2001==i&&c.Dn.publishStreamList[t]&&c.Dn.publishStreamList[t].state==I.update_info||2002==i)if(l()){var e=function(t,i){var n=function(){c.rtm.stateCenter.offListener("_roomStateUpdate",e)};t===(null==h?void 0:h.roomID)&&"CONNECTED"===i?(d(),n()):t===(null==h?void 0:h.roomID)&&"DISCONNECTED"===i&&n()};c.rtm.stateCenter.onListener("_roomStateUpdate",e)}else d();else s&&s(ji)},0)}else if(o.body&&o.body.err_code){var v=o.body.err_code,m=Xi;[1011,1000002002].includes(v)?m=Hi:[5030].includes(v)?(a=Oi(Ut.FORBID_BLACK_USER),m=JSON.parse(a)):[2002,2003,2010,2015].includes(v)&&(m=Ji),s&&s(m,u);var p="";m.code===Xi.code&&(p=JSON.stringify({server_code:R+v})),i===N&&c.onPublishStateUpdate(W,t,m,p)}},{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}),ci(this.zn,Sm,"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.Ln.createSpan(a.H,{key:En,par:this.gs},{key:""},Rs)).setAttributes({stream_update_type:Is(2001===i?"stream added":2002===i?"stream deleted":""),stream_extra_info:Ns(e),stream_id:Cs(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.Ln.setError(u,t)),s&&s(t,e)},r)}else this.zn.warn(Sm+" "+pi)},t.prototype.handleStreamUpdateRsp=function(t,i,e){var n,s,r,o;if(this.rtm.isDisConnect())this.zn.warn("zb.sh.hsur not login");else if(0==t.body.err_code){this.zn.info("zb.sh.hsur stream seq "+this.Vo+" 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.Dn.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.zn.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.zn.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.zn.info("hsur.0 room no found")}else this.zn.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.Dn.idName,nick_name:this.Dn.nickName},e),t.body.stream_seq>this.Vo+1)return this.zn.info("zb.sh.hss.1 seq diff server: "+t.body.stream_seq+" client "+this.Vo),void this.fetchStreamList();this.Vo=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.Dn.publishStreamList[i],r=t.streamList.find(function(t){return t.stream_id==i});if(this.zn.info("hsur.0 cmd "+n+" "+!!r),r&&2002===n){var o=t.streamList.findIndex(function(t){return t.stream_id==i});this.zn.info("hsur.0 stream index "+o),o>-1&&t.streamList.splice(o,1)}s?(s.state==I.update_info&&(s.state=I.publishing,2001!==n||r||t.streamList.push(e),this.onPublishStateUpdate(X,i,{code:0,message:""})),r&&r.stream_sid!==e.stream_sid&&(this.zn.info("hsur.0 update sid. "+i+" origin:"+r.stream_sid+", new:"+e.stream_sid),r.stream_sid=e.stream_sid)):this.zn.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(ui(this.zn,a,i),this.Go=!1,this.Ln.spanEnd({key:wm.event,par:this.gs},{stream_seq:wm.stream_seq(null===(e=t.body)||void 0===e?void 0:e.stream_seq),stream_size:wm.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:wm.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.Vo!==t.body.stream_seq){if(this.Vo>t.body.stream_seq)return this.zn.error(a+" less seq"),void this.fetchStreamList(i);if(this.Ho>t.body.stream_seq)this.zn.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),ci(this.zn,a)}}else this.zn.info(a+" same seq");else this.zn.info(a+" server error="+t.body.err_code)},t.prototype.syncPublishStreamList=function(){var t,i="zb.sh.spsl";ui(this.zn,i);var e=function(i){var e=n.Dn.publishStreamList[i];if(e.state===I.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.Uo.publisherList[i])||void 0===t?void 0:t.publisher)&&(r=n.Uo.publisherList[i].publisher.getStreamAddOptions()),e.state=I.update_info,n.updateStreamInfo(i,N,e.extra_info,function(t){},void 0,r)}}},n=this;for(var s in this.Dn.publishStreamList)e(s);ci(this.zn,i)},t.prototype.handleFullUpdateStream=function(t,i,e){var n=this;void 0===e&&(e=!1);var s="zb.sh.hfus";ui(this.zn,s),this.Vo=t,this.Ho<t&&(this.Ho=t),this.zn.debug(s+" server seq "+this.Vo),i=i.filter(function(t){return 1!==t.stream_type}),this.Dn.mergeStreamList(this.Dn.idName,this.room.streamList,i,function(t,i,e,r){0!==t.length&&(n.zn.debug(s+" callback addstream"),n.onStreamUpdated(n.gs,1,n.makeCallbackStreamList(t))),0!==i.length&&(n.zn.debug(s+" callback delstream"),n.onStreamUpdated(n.gs,0,n.makeCallbackStreamList(i))),0!==e.length&&(n.zn.debug(s+" callback updatestream"),n.onStreamExtraInfoUpdated(n.gs,n.makeCallbackStreamList(e))),0!==r.length&&(n.zn.warn(s+" callback updateAttrstream"),n.onStreamAttrUpdated(n.gs,n.makeCallbackStreamList(r)))}),e||this.syncPublishStreamList(),ci(this.zn,s)},t.prototype.handlePushStreamUpdateMsg=function(t){var i="zb.sh.hpsum";ui(this.zn,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.Vo+1!==t.body.stream_seq)return ui(this.zn,i,"updatestream 1"),void this.fetchStreamList();if(t.body.stream_seq<this.Ho)return ui(this.zn,i,"updatestream 2"),void this.fetchStreamList();switch(this.Vo=t.body.stream_seq,t.body.stream_cmd){case Y:this.Qo(e);break;case Z:this.Xo(e);break;case Q:this._handleUpdatedStreamList(e)}ci(this.zn,i)}else this.zn.info(i+", emtpy list")},t.prototype.Qo=function(t){var i="zb.sh.hasl";ui(this.zn,i);for(var e,n=[],s=0;s<t.length;s++)if(t[s].anchor_id_name!=this.Dn.idName&&t[s].id_name!=this.Dn.idName&&t[s].user_id!==this.Dn.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.zn.debug("hdsl.0 have self stream added");if(0!==n.length){this.zn.debug(i+" callback addstream");for(var o=0;o<n.length;o++){this.room.streamList.push(n[o]);var u=this.Uo.playerList[n[o].stream_id];null==u||u.setStreamAdd()}this.onStreamUpdated(this.gs,1,this.makeCallbackStreamList(n))}ci(this.zn,i)},t.prototype.Xo=function(t){var i="zb.sh.hdsl";ui(this.zn,i);for(var e=[],n=0;n<t.length;n++)if(t[n].anchor_id_name!=this.Dn.idName&&t[n].id_name!=this.Dn.idName&&t[n].user_id!==this.Dn.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.zn.debug(i+" have self stream deleted");0!==e.length&&(this.zn.debug(i+" callback delstream"),this.onStreamUpdated(this.gs,0,this.makeCallbackStreamList(e))),ai(this.zn,i)},t.prototype._handleUpdatedStreamList=function(t){var i="zb.sh.husl";ui(this.zn,i);for(var e=[],n=[],s=0;s<t.length;s++)if(t[s].anchor_id_name!=this.Dn.idName&&t[s].id_name!=this.Dn.idName&&t[s].user_id!==this.Dn.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.zn.debug("hsul.0 have self stream updated");0!==e.length&&(this.zn.debug(i+" callback updatestream"),this.onStreamExtraInfoUpdated(this.gs,this.makeCallbackStreamList(e))),0!==n.length&&(this.zn.warn(i+" callback updateAttrStream"),this.onStreamAttrUpdated(this.gs,this.makeCallbackStreamList(n))),ci(this.zn,i)},t.prototype.fetchStreamList=function(t){var i,e,n,s=this,r="zb.sh.fsl";ui(this.zn,r);var o=this.Ln.createSpan(a.H,{key:En,par:this.gs},{key:wm.event,par:this.gs},wm.event,!0);return this.rtm.isDisConnect()?(this.zn.info(r+" state error"),void this.Ln.setError(o,wm.error.NOT_LOGIN)):this.Go?(this.zn.info(r+" already doing"),void this.Ln.setError(o,wm.error.ie," already doing")):(this.Go=!0,this.zn.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 ci(this.zn,r))},t.prototype._handleReconnectStream=function(t){var i,e,n,s,r,o,u,a="zb.sh.hrs";ui(this.zn,a);var c=this.Uo.publisherList;this.zn.info(a+" publish "+Object.keys(this.Uo.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.gs)return"continue";var h=t.find(function(t){return t.stream_id==a}),l=h&&!(h.anchor_id_name===f.Dn.idName||h.id_name===f.Dn.idName||h.user_id===f.Dn.idName);if(f.zn.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=C);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=N,m=void 0;c[a].publisher&&(m=c[a].publisher.getStreamAddOptions()),f.updateStreamInfo(a,v,f.Dn.publishStreamList[a].extra_info,void 0,void 0,m)}},f=this;for(var l in c)h(l);ai(this.zn,a)},t.prototype.makeCallbackStreamList=function(t){var i,e=[];this.Dn.appConfig&&(i=this.Dn.appConfig.media_config.play_config.resource_info.filter(function(t){return[L.CDN,L.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==L.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 y.FLV:u.push(d);break;case y.HLS:a.push(d);break;case y.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.Dn.idName,method:2,token:(null===(o=this.room)||void 0===o?void 0:o.token)||"",mode:this.Dn.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 Ft(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===ji.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.Dn.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.Dn.idName},{name:"Token-Biztype",val:"2"},{name:"Net-Mode",val:this.Dn.netMode+""}],body:{},idName:this.Dn.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){ui(this.zn,"zb.sh.usei");var s=z;this.Dn.publishStreamList[t]&&this.Dn.publishStreamList[t].state>=I.update_info?(this.Dn.publishStreamList[t].extra_info=i,this.updateStreamInfo(t,s,i,e,n)):this.Dn.publishStreamList[t]&&this.Dn.publishStreamList[t].state===I.tryPublish?(this.Dn.publishStreamList[t].extra_info=i,e({errorCode:0})):n(So.error.Cn)},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(Vt(t.body.stream_refresh)&&0!==t.body.stream_refresh)return this.zn.info(Kv+" stream refresh "),void this.fetchStreamList();this.zn.info(Kv+" stream seq "+this.Vo+" "+JSON.stringify(this.Fo)),t.body.stream_seq>this.Vo&&!this.Fo&&(this.Fo={},ui(this.zn,Kv,"update stream "+this.Vo+" server "+t.body.stream_seq),this.Wo&&clearTimeout(this.Wo),this.Wo=setTimeout(function(){i.handleMergeTimeout()},this.Yo)),this.Jo=t.body.stream_seq},t.prototype.getStreamSeq=function(){return this.Vo},t.prototype.mergeStreamByStreamSeq=function(t,i,e){var n=this;this.Fo||(this.zn.warn(Xv+" new merge stream list "+this.Vo+" server "+i),this.Fo={},this.Wo&&clearTimeout(this.Wo),this.Wo=setTimeout(function(){n.handleMergeTimeout()},this.Zo)),this.zn.info(Xv+" ".concat(this.Fo," ").concat(t," ").concat(i," ").concat(e)),this.Fo[i]={cmd:t,streamList:e}},t.prototype.handleMergeTimeout=function(){if(this.Fo){var t=Object.keys(this.Fo).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.Jo?this.mergeStream(t):(this.Fo=null,this.fetchStreamList())}},t.prototype.mergeStream=function(t){var i=this;this.zn.info(Wv+" merge streamList "+this.Vo+" streamSeqList "+t.join(","));var e=t[t.length-1],n=[];t.forEach(function(t){if(i.Fo&&i.Fo[t])switch(i.Fo[t].cmd){case Y:i.Fo[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 Z:i.Fo[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 Q:i.Fo[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.Fo=null,this.zn.info(Wv+" "+n),this.handleFullUpdateStream(e,n)},t.prototype.reset=function(){this.Jo=0,this.Fo=null,this.mixStreamTaskList={},this.mixRequestIdList=[],this.mixStreamHbList={},this.Wo&&(clearTimeout(this.Wo),this.Wo=void 0),this.Yo=2e3,this.Zo=5e3},t}(),Om=function(){function t(){this.handlerListMap={}}return t.prototype.addEventHandler=function(t,i){if(this.handlerListMap[t]||(this.handlerListMap[t]=[]),!Qt(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}(),Tm=Om,km="zg_autoplay_wrapper";function Rm(){return navigator.language.includes("zh")}var Im=function(){function t(){this.content='Media play failed. Click the "Resume"to resume.',this.Ko=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(km,"{padding:14px;background:#fff;border-radius:3px;box-shadow:1px 1px 10px#988e8d;border:1px solid#d1cfcf;max-width:500px}.").concat(km,"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(km,"{width:80vw}}");t.appendChild(document.createTextNode(i)),si.head.appendChild(t),Rm()&&(this.content="浏览器阻止音视频播放,请点击“恢复播放”。"),this.$o=new Tm}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.createDialog=function(){var t=si.createElement("template"),i=si.createElement("div");i.className="zg_autoplay_mask";var e=si.createElement("div");e.className=km;var n=si.createElement("div");n.className="zg_autoplay_header",n.textContent=location.host;var s=si.createElement("div");s.className="zg_autoplay_content",s.textContent=this.content;var r=si.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=si.createElement("button");o.className="zg_autoplay_action_confirm",o.innerText=Rm()?"恢复播放":"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.$o.emit("allowPlay"),this.deleteDiaLog()},t.prototype.deleteDiaLog=function(){this.Ko&&(si.body.removeChild(this.Ko),this.Ko=null)},t.prototype.addDiaLog=function(){this.Ko=this.Ko||this.createDialog(),si.body.appendChild(this.Ko),this.Ko.onclick=this.onConfirm.bind(this)},t.prototype.on=function(t,i){return this.$o.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.$o.removeEventHandler(t,i)},t.instance=null,t}(),Nm=function(){function t(t,i){this.zn=t,this.tu=i}return t.prototype.info=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.zn.info(t.join(""),{streamid:this.tu})},t.prototype.warn=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.zn.warn(t.join(""),{streamid:this.tu})},t.prototype.error=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.zn.error(t.join(""),{streamid:this.tu})},t.prototype.debug=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.zn.debug(t.join(""),{streamid:this.tu})},t}();function Cm(t,i){return new Nm(t,i)}var zm,Dm=function(){return Dm=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},Dm.apply(this,arguments)},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())})},Pm=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])}}},Mm=ph(),xm=/^(?=.*MicroMessenger)(?=.*HONOR).*$/.test(Mm||""),jm=Im.getInstance(),Lm=function(){function t(t,i,e){var n=this;this.previewer=i,this.iu=null,this.eu=null,this.inited=!1,this.container=null,this.nu=null,this.Yr={enableVideoAutoplayDialog:!0,enableAudioAutoplayDialog:!0,clearLastFrame:!0,useAudioElement:!0},this.su=Ri(function(t,i,e){n.ru.emit("autoplayFailed",i,e),(t?n.Yr.enableVideoAutoplayDialog:n.Yr.enableAudioAutoplayDialog)?jm.addDiaLog():si.body.addEventListener("mousedown",n.Xr.resumePlayByClickBody),n.ou.warn("zc.zsv id:".concat(n.id," autoplay failed"))},600),this.uu=!1,this.au=!1,this.cu=Ri(function(){var t,i=Array.from(si.getElementsByTagName("video")),e=Array.from(si.getElementsByTagName("audio")),n=i.some(function(t){return!t.id||!t.id.startsWith("zg-rtc-video_")}),s=e.some(function(t){return!t.id||!t.id.startsWith("zg-rtc-audio_")});(n||s)&&((t=document.createElement("audio")).src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=",t.play(),setTimeout(function(){t.pause(),t.remove()},1e3))},300),this.hu=Ri(this.fu,20),this.Xr={visibilitychange:function(){var t;si.hidden||n.au||!Th()||(n.ou.info("zc.zsv id: ".concat(n.id," page show, recover audio")),n.Yr.useAudioElement&&n.eu?n.eu.srcObject=n.eu.srcObject:(n.ou.info("zc.ac.rs id: ".concat(n.id," page show")),n.ac.resume()),n.hu(n.eu,!0)),si.hidden||n.uu||!Th()||(null===(t=n.iu)||void 0===t?void 0:t.paused)&&(n.ou.info("zc.zsv id: ".concat(n.id," page show, recover video")),n.fu(n.iu,!0))},focus:function(t){n.au||(gh()&&Rh().startsWith("16")||_h())&&(n.ou.info("zc.zsv id: ".concat(n.id," page focus, recover audio")),n.hu(n.eu,!0))},canPlayAudio:function(t){n.ru.emit("canPlayAudio",t)},canPlayVideo:function(t){n.ru.emit("canPlayVideo",t)},resumePlayByClickBody:function(){return Am(n,void 0,void 0,function(){return Pm(this,function(t){switch(t.label){case 0:return this.ou.info("zc.zsv id:".concat(this.id," resume by click dom_body")),[4,this.resume()];case 1:return t.sent(),si.body.removeEventListener("mousedown",this.Xr.resumePlayByClickBody),[2]}})})}},this.inited=!0,this.Yr=Dm(Dm({},this.Yr),e);var s=this.id="".concat(t.id);this.ou=Cm(this.zn,(null==i?void 0:i.streamId)||""||void 0),this.ou.info("zc.sv.c id:".concat(s," isLocal: ").concat(this.isLocal));var r=si.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=ri(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.Xr.canPlayVideo),o&&a.srcObject.addTrack(o);var c=si.createElement("audio");c.id="zg-rtc-audio_".concat(s),c.setAttribute("autoplay",""),c.setAttribute("playsinline",""),c.muted=!0,c.srcObject=this.lu=new MediaStream,c.addEventListener("canplay",this.Xr.canPlayAudio),u&&c.srcObject.addTrack(u),"object"==typeof WeixinJSBridge&&"function"==typeof WeixinJSBridge.invoke&&WeixinJSBridge.invoke("getNetworkType",{},function(){n.ou.info("zc.zsv id:".concat(n.id," weixin load media")),c.load(),a.load()}),this.du=r,this.iu=a,this.eu=c,this.ru=new Tm,this.vu=function(){n.resume()},jm.on("allowPlay",this.vu),window.addEventListener("focus",this.Xr.focus),si.addEventListener("visibilitychange",this.Xr.visibilitychange)}return Object.defineProperty(t.prototype,"video",{get:function(){return this.iu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this.eu},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.Dn.browser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zn",{get:function(){return this.previewer.logger},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLocal",{get:function(){return this.previewer instanceof tg},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isMounted",{get:function(){return!!this.du.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_hasAudio",{get:function(){var t,i;return"live"===(null===(i=null===(t=this.lu)||void 0===t?void 0:t.getTracks()[0])||void 0===i?void 0:i.readyState)&&!this.au},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_hasVideo",{get:function(){var t,i,e;return!!(null===(t=this.iu)||void 0===t?void 0:t.parentNode)&&"live"===(null===(e=null===(i=this.iu.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"]),Am(this,void 0,void 0,function(){var e=this;return Pm(this,function(n){return this.ou.info("zc.zsv resume call: ".concat(t,", kindList: ").concat(i,", id:").concat(this.id,", isLocal: ").concat(this.isLocal)),i.forEach(function(i){return Am(e,void 0,void 0,function(){var e,n,s=this;return Pm(this,function(r){switch(r.label){case 0:return n="audio"===i?this.eu:this.iu,((e="audio"===i)?this._hasAudio:this._hasVideo)?!e||this.Yr.useAudioElement?[3,1]:(this.ou.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 ni(function(t){var i=setTimeout(function(){s.ou.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.ou.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 Am(this,void 0,void 0,function(){return Pm(this,function(t){switch(t.label){case 0:return this.Yr.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.ou.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=Dm({},i)).enableAutoplayDialog;Gt(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.ou.info("zc.zsv.pv id:".concat(this.id," play: ").concat(typeof t,", ").concat(JSON.stringify(i)," isLocal:").concat(this.isLocal));var e=null;if(Ht(t)?e=si.getElementById(t):$t(t)&&(e=t),!e)throw this.ou.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.Yr=Dm(Dm({},this.Yr),i);var n=this.Yr,s=n.objectFit,r=n.mirror;this.iu&&(void 0!==s&&(this.iu.style.objectFit=s),Gt(r)&&(this.iu.style.transform=r?"rotateY(180deg)":"")),!e.contains(this.du)&&e.appendChild(this.du),this.container=e,this.uu=!1,this.fu(this.iu,!0)},t.prototype.playAudio=function(t,i){void 0===i&&(i=!0),this.ou.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.Yr=Dm(Dm({},this.Yr),t);var e=!0;if("safari"===this.browser){var n=Mm.match(/Version\/([\d\.]+)/);if(n)"13.1.2"!==n[1]||this.Yr.useAudioElement||(e=!1)}e||(this.ou.warn("zc.zsv.pa id:".concat(this.id," safari 13.1.2 cannot use audio ctx render.")),this.Yr.useAudioElement=!0);var s=i,r=this.Yr.muted;this.eu&&Gt(r)&&(s=!r),this.au=!s,this.fu(this.eu,s)},t.prototype.stop=function(){this.ou.info("zc.zsv stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.stopAudio(),this.stopVideo()},t.prototype.stopAudio=function(){this.ou.info("zc.zsv.sa stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.au=!0,this.fu(this.eu,!1)},t.prototype.stopVideo=function(){var t;this.ou.info("zc.zsv.sv stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.fu(this.iu,!1);var i=null===(t=this.du)||void 0===t?void 0:t.parentNode;i&&i.removeChild(this.du)},t.prototype.setVideo=function(t,i){return void 0===i&&(i=!1),Am(this,void 0,void 0,function(){return Pm(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),Am(this,void 0,void 0,function(){return Pm(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),Am(this,void 0,void 0,function(){var n,s,r;return Pm(this,function(o){switch(o.label){case 0:return this.ou.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.iu:this.eu)?(s=n.srcObject)?i?[3,1]:((r=s.getTracks()).forEach(function(t){null==s||s.removeTrack(t),n.srcObject=n.srcObject}),this.ru.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.Yr.useAudioElement||this.mu(!0),this.ru.emit("_trackChange",i.kind,i),this.fu(n,!(t?this.uu:this.au)),!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.Yr.mirror=!!t;this.iu&&(this.iu.style.transform=i?"rotateY(180deg)":"")},t.prototype.setVideoMuted=function(t){return this.ou.info("zc.zsv id:".concat(this.id," mute video: ").concat(t," isLocal:").concat(this.isLocal)),this.uu=t,this.fu(this.iu,!t)},t.prototype.setAudioMuted=function(t){return this.ou.info("zc.zsv id:".concat(this.id," mute audio: ").concat(t," isLocal:").concat(this.isLocal)),this.au=t,this.fu(this.eu,!t)},t.prototype.setVolume=function(t){if(this.ou.info("zc.zsv id:".concat(this.id," volume: ").concat(t," isLocal:").concat(this.isLocal)),this.eu){var i=t>100?1:t/100;return this.eu.volume=i,this.pu&&(this.pu.gain.value=i),this.eu.volume==i}return!1},t.prototype.takeStreamSnapshot=function(t){var i=this.iu;if(!i)return"";if(!i.srcObject)return"";var e=oi(this.iu.videoWidth,this.iu.videoHeight),n=e.getContext("2d");n&&n.drawImage(this.iu,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=si.createElement("a");n.style.display="none",n.href=e;var s=(null==t?void 0:t.fileName)||"snapshot"+Date.now();n.download=s+"."+r,si.body.appendChild(n),n.click(),setTimeout(function(){si.body.removeChild(n),window.URL.revokeObjectURL(e)},100)}),s},t.prototype.getVideoHeight=function(){return this.iu?this.iu.videoHeight:0},t.prototype.getVideoWidth=function(){return this.iu?this.iu.videoWidth:0},t.prototype.mu=function(t){if(void 0===t&&(t=!1),this.nu?t&&(this.nu.disconnect(),this.nu=this.ac.createMediaStreamSource(this.lu)):this.nu=this.ac.createMediaStreamSource(this.lu),!this.pu){var i=this.pu=this.ac.createGain();this.eu&&(i.gain.value=this.eu.volume)}return this.nu.connect(this.pu),{gainNode:this.pu,srcNode:this.nu}},t.prototype.fu=function(t,i,e){var n,s,r=this;if(void 0===e&&(e=0),!t||!this.du)return!1;var o=!this.Yr.useAudioElement,u="VIDEO"===t.tagName;if(this.ou.info("zc.zsv id:".concat(this.id," mount play ").concat(t.tagName)),i){if(!u&&o){t.muted=!0,t.pause(),t.remove(),this.mu().gainNode.connect(this.ac.destination);var a="running";this.ou.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.su(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(){xm&&!u&&(r.ou.info("zc.ac.rs id:".concat(r.id," honor suspend ac")),r.ac.resume()),r.ou.info("zc.zsv id:".concat(r.id," render ").concat(t.tagName," use element success")),_h()&&r.cu()}).catch(function(i){r.ou.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.su(u,t,i)})};t.muted=!0,u||(this.pu&&this.pu.disconnect(),t.muted=!1,t.srcObject=t.srcObject),xm&&!u&&(this.ou.info("zc.ac.rs id:".concat(this.id," honor resume ac")),this.ac.suspend()),t.play().catch(function(i){r.ou.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.uu:r.au);r.ou.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.ou.info("zc.zsv decode failed. retry again"),r.fu(t,a,e++)):(r.ou.info("zc.zsv not retry on error. ".concat(e," ").concat(null===(o=t.error)||void 0===o?void 0:o.code)),r.su(u,t,t.error)))},!t.parentNode&&u&&this.du.appendChild(t)}}else if(t.muted=!0,t.remove(),t.pause(),!u){o&&this.pu&&this.pu.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.ru.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.ru.removeEventHandler(t,i)},t.prototype.useAudioOut=function(t){var i;return Am(this,void 0,void 0,function(){var e;return Pm(this,function(n){switch(n.label){case 0:return e=null===(i=this.eu)||void 0===i?void 0:i.setSinkId,e?[4,e.call(this.eu,t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},t.prototype.destroy=function(){this.stop();var t=this.iu,i=this.eu;_h()&&(t&&(t.muted=!1,t.pause()),i&&(i.muted=!1,i.pause())),t&&(t.removeEventListener("canplay",this.Xr.canPlayVideo),t.srcObject=null,this.iu=null),i&&(i.removeEventListener("canplay",this.Xr.canPlayAudio),i.srcObject=null,this.eu=null),window.removeEventListener("focus",this.Xr.focus),si.removeEventListener("visibilitychange",this.Xr.visibilitychange),si.body.removeEventListener("mousedown",this.Xr.resumePlayByClickBody),jm.off("allowPlay",this.vu),this.inited=!1,this.vu=null},t.prototype.getAudioNodeAndStopRender=function(){var t=this.eu,i=this.Yr;t&&(t.muted=!0,t.remove(),t.pause());var e=this.mu(!0).gainNode;return i.useAudioContext&&e.disconnect(),e},t}(),qm=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}(),Um=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())})},Bm=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])}}},Jm=function(){function t(){this.isFirstNode=!0,this.isLastNode=!0,this.hasAnother=!1}return t.prototype.connect=function(t){return Um(this,void 0,void 0,function(){return Bm(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 Um(this,void 0,void 0,function(){return Bm(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}(),Vm=function(){function t(){}return t.createError=function(t,i){return{code:t.code,message:t.message+(i?" "+i:"")}},t}(),Hm=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)}}(),Gm=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())})},Fm=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=Vm.createError,Zm=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 Hm(i,t),Object.defineProperty(i.prototype,"output",{get:function(){return{track:this.track}},enumerable:!1,configurable:!0}),i.prototype.setInput=function(t){return Gm(this,void 0,void 0,function(){return Fm(this,function(t){throw Ym({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}(Jm),Qm=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())})},Xm=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])}}},Wm=function(){function t(t,i,e,n,s){this.gu=t,this.bu=i,this.Uo=e,this.browser=n,this.preview=s,this._u=[],this._vcMgr=void 0,this.gu.connect(this.bu)}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._u[this._u.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"secondToLastNode",{get:function(){return this._u.length<2?null:this._u[this._u.length-2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this.isEmpty()?null:this._u[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"secondNode",{get:function(){return this._u.length<2?null:this._u[1]},enumerable:!1,configurable:!0}),t.prototype.pushBack=function(t){return Qm(this,void 0,void 0,function(){return Xm(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.bu)];case 2:return i.sent(),[3,6];case 3:return[4,this.gu.connect(t)];case 4:return i.sent(),t.setNodePos(!0),[4,t.connect(this.bu)];case 5:i.sent(),i.label=6;case 6:return this._u.push(t),[2]}})})},t.prototype.popBack=function(){return Qm(this,void 0,void 0,function(){return Xm(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.bu)];case 3:return t.sent(),[3,7];case 4:return[4,this.gu.disconnect()];case 5:return t.sent(),[4,this.gu.connect(this.bu)];case 6:t.sent(),t.label=7;case 7:return this._u.pop(),[2]}})})},t.prototype.pushFront=function(t){return Qm(this,void 0,void 0,function(){return Xm(this,function(i){switch(i.label){case 0:return[4,this.gu.disconnect()];case 1:return i.sent(),this.firstNode&&t.setNodePos(void 0,void 0,!1),[4,this.gu.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.bu)];case 5:i.sent(),i.label=6;case 6:return this._u.unshift(t),[2]}})})},t.prototype.popFront=function(){return Qm(this,void 0,void 0,function(){return Xm(this,function(t){switch(t.label){case 0:return[4,this.gu.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.gu.connect(this.secondNode)]):[3,4];case 3:return t.sent(),[3,6];case 4:return[4,this.gu.connect(this.bu)];case 5:t.sent(),t.label=6;case 6:return this._u.shift(),[2]}})})},t.prototype.remove=function(t){return Qm(this,void 0,void 0,function(){var i,e,n;return Xm(this,function(s){switch(s.label){case 0:return-1===(i=this._u.indexOf(t))?[3,13]:[4,t.disconnect()];case 1:return s.sent(),e=this._u[i+1],i-1>=0?[4,(n=this._u[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.bu)];case 5:s.sent(),s.label=6;case 6:return[3,12];case 7:return[4,this.gu.disconnect()];case 8:return s.sent(),this.lastNode==t?[3,10]:(e.setNodePos(!0),[4,this.gu.connect(e)]);case 9:return s.sent(),[3,12];case 10:return[4,this.gu.connect(this.bu)];case 11:s.sent(),s.label=12;case 12:this._u.splice(i,1),s.label=13;case 13:return[2]}})})},t.prototype.isConnected=function(t){return-1!==this._u.indexOf(t)},t.prototype.isEmpty=function(){return 0===this._u.length},t.prototype.getSourceTrack=function(){var t;return null===(t=this.gu.output)||void 0===t?void 0:t.track},t.prototype.getDestinationTrack=function(){var t;return null===(t=this.bu.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),Qm(this,void 0,void 0,function(){var u;return Xm(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)===ht.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 Zm(t,this.Uo),i)];case 2:return a.sent(),[2]}})})},t.prototype.replaceSource=function(t,i){return void 0===i&&(i=!0),Qm(this,void 0,void 0,function(){return Xm(this,function(e){switch(e.label){case 0:return this.bu.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.bu)];case 3:e.sent(),e.label=4;case 4:return this.gu=t,this.bu.setReplaceRemote(),[2]}})})},t.prototype.replaceDestination=function(t){return Qm(this,void 0,void 0,function(){return Xm(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.gu.disconnect()];case 4:return i.sent(),[4,this.gu.connect(t)];case 5:i.sent(),i.label=6;case 6:return this.bu=t,[2]}})})},t.prototype.destroy=function(){for(var t,i=0;i<this._u.length;i++){this._u[i].disconnect()}this._u=[],this.bu.destroy(),this.gu.destory(),null===(t=this.vcMgr)||void 0===t||t.destroy()},t}(),Km=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)}}(),$m=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())})},tp=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])}}},ip=Vm.createError,ep=function(t){function i(i,e){var n=t.call(this)||this;return n.yu=i,n.browser=e,n.isFirstNode=!1,n.isLastNode=!1,n.track=null,n.wu=!0,n}return Km(i,t),i.prototype.setReplaceRemote=function(t){void 0===t&&(t=!0),this.wu=t},i.prototype.setInput=function(t){return $m(this,void 0,void 0,function(){var i,e,n,s,r=this;return tp(this,function(o){switch(o.label){case 0:if(null==(null==t?void 0:t.track))return[2];if(!this.yu.localStream)throw ip({code:-1,message:"preview haven't been inited."});return this.track=i=null==t?void 0:t.track,this.yu.localStream.getVideoTracks()[0]===i?[3,4]:(e=this.yu.localStream,(null==(n=this.yu.zegoCaptureStream)?void 0:n.stream)&&(e=n.stream),s=this.yu.Uo.getPublishList(e),this.wu&&0!==s.length?[4,ni.all(s.map(function(t){return $m(r,void 0,void 0,function(){var e;return tp(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.yu.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 $m(this,void 0,void 0,function(){return tp(this,function(t){throw ip({code:-1,message:"video destination node cann't connect any video node."})})})},i.prototype.disconnect=function(){return $m(this,void 0,void 0,function(){return tp(this,function(t){throw ip({code:-1,message:"video destination node cann't disconnect any video node."})})})},i.prototype.destroy=function(){this.track=null},i}(Jm),np=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())})},sp=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])}}},rp=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"}(zm||(zm={}));var op=function(){function t(t,i,e){var n=this;this.zn=t,this.Su=i,this.customVC=e,this.canvasTrack=null,this.gl=null,this.Eu=0,this.Ou=0,this.Tu=zm.noInit,this.hasBeautyTask=!1,this.hasBackgroundTask=!1,this.backgroundLoop=null,this.eventHandler={visibilitychange:function(){if(si.hidden){var t=function(){return np(n,void 0,void 0,function(){return sp(this,function(i){switch(i.label){case 0:return this.backgroundLoop=window.setTimeout(t,Math.floor(1e3/this.fps)),!si.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.ku=new Tm}return Object.defineProperty(t.prototype,"initState",{set:function(t){this.Tu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inited",{get:function(){return this.Tu===zm.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.Ru},enumerable:!1,configurable:!0}),t.prototype.init=function(t,i){var e;return np(this,void 0,void 0,function(){var n;return sp(this,function(s){switch(s.label){case 0:if(this.Tu!=zm.noInit)return[3,4];this.Tu=zm.initing,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.renderVideo(t,i)];case 2:return s.sent(),this.Tu=zm.inited,this.onInited(),[3,4];case 3:return n=s.sent(),this.Tu=zm.noInit,this.onRenderFail(n),n.code===Ye.code&&"ended"===(null===(e=this.Ru)||void 0===e?void 0:e.readyState)&&this.resetVideo(),[3,4];case 4:return[2]}})})},t.prototype.checkInit=function(t,i){return np(this,void 0,void 0,function(){return sp(this,function(e){switch(e.label){case 0:return!t||"live"!==t.readyState||this.Ru===t&&(null==i?void 0:i.handleTrackType)!==ht.changeResolution?[3,2]:(this.Tu=zm.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 np(this,void 0,void 0,function(){var n,s,r;return sp(this,function(o){switch(o.label){case 0:return this.zn.info("".concat(nm," call")),null===t?(this.Ru=t,[2]):this.Ru==t&&(null==i?void 0:i.handleTrackType)!==ht.changeResolution?[2]:(this.Ru=t,this.videoEl||(this.videoEl=ri(),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.zn.info(nm+" set target fps: "+this.fps)),this.zn.info(nm+" video canvas render: width "+n.width+" height "+n.height),!s||!r)throw this.zn.error(nm+" resolution of track is wrong"),Ye;return this.originWidth=s,this.originHeight=r,this.videoEl.setAttribute("width",s.toString()),this.videoEl.setAttribute("height",r.toString()),"safari"!==this.Su||(null==i?void 0:i.handleTrackType)!==ht.replaceNew&&(null==i?void 0:i.handleTrackType)!==ht.changeResolution||this.resetCanvas(),this.initWegGl(),[2]}})})},t.prototype.getPlayingVideo=function(t,i,e){return np(this,void 0,void 0,function(){var e,n,s=this;return sp(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.Su)&&"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(Ye):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.zn.warn(nm+" video track error"),t&&t.removeEventListener("playing",o),e(Ye)},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=ri(),null===(t=this.videoEl)||void 0===t||t.setAttribute("style","display:none")},t.prototype.initWegGl=function(){var t;if(this.zn.info("".concat(sm," call")),this.canvasEl||(this.zn.info("".concat(sm," no canvas")),this.customVC?(this.canvasEl=document.getElementById("render_canvas"),this.canvasEl.width=this.originWidth,this.canvasEl.height=this.originHeight):this.canvasEl=oi(this.originWidth,this.originHeight)),this.gl||(this.gl=null===(t=this.canvasEl)||void 0===t?void 0:t.getContext("webgl")),!this.gl)return this.zn.warn("".concat(sm," no gl")),void this.handleInitError({code:1001});this.zn.info("".concat(sm," end"))},t.prototype.resetCanvas=function(){this.canvasEl=null,this.gl=null,this.canvasTrack=null},t.prototype.getCanvasTrack=function(t){return this.zn.info("".concat(rm," 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.zn.info("".concat(rm," start task"));var i=function(){return np(t,void 0,void 0,function(){return sp(this,function(t){switch(t.label){case 0:return this.Ou=requestAnimationFrame(i),[4,this.renderAFrame()];case 1:return t.sent(),[2]}})})};this.Ou=requestAnimationFrame(i),si.removeEventListener("visibilitychange",this.eventHandler.visibilitychange),si.addEventListener("visibilitychange",this.eventHandler.visibilitychange,!1)},t.prototype.stopRenderTask=function(){this.zn.info("".concat(rm," stop task")),this.Ou&&(cancelAnimationFrame(this.Ou),this.Ou=0),si.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},t.prototype.renderAFrame=function(){return np(this,void 0,void 0,function(){var t,i,e;return sp(this,function(n){return t=Date.now(),i=1e3/this.fps,(e=this.Eu?t-this.Eu:i)>=i&&(this.Eu=t-(e-i),this.videoEl&&this.videoEl.paused&&this.videoEl.play(),this.videoEl&&this.videoEl.videoWidth>6&&this.videoEl.videoHeight>6&&this.ku.emit("renderFrame")),[2]})})},t.prototype.on=function(t,i){return!!i&&this.ku.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.ku.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.ku).emit.apply(i,rp([t],e,!1))},t.prototype.setRenderTask=function(t,i){this.zn.info("".concat(rm," 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.zn.info("".concat(rm," dt")),this.destroyVideo(),this.canvasEl&&(this.canvasEl.remove(),this.canvasEl=null),this.canvasTrack=null,this.Ru=null,this.gl=null,this.stopRenderTask(),this.hasBeautyTask=!1,this.hasBackgroundTask=!1,this.backgroundLoop&&clearTimeout(this.backgroundLoop),this.backgroundLoop=null},t}();function up(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 ap=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())})},cp=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])}}},hp="zc.smw",fp=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"}),lp=function(){function t(){}return t.addModuleToContext=function(t,i){return ap(this,void 0,void 0,function(){var e;return cp(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),i.info(hp+" worklet addModule call"),[4,t.audioWorklet.addModule(URL.createObjectURL(fp))];case 1:return n.sent(),i.info(hp+" worklet addModule success"),this.isSuccess=!0,[2];case 2:return e=n.sent(),i.warn(hp+" worklet addModule catch error. ".concat(null==e?void 0:e.message)),[3,3];case 3:return[2]}})})},t.isSuccess=!1,t}(),dp=function(){function t(t,i,e,n){void 0===e&&(e=1e3),void 0===n&&(n=200),this.zn=t,this.Dn=i,this.Iu=e,this.Nu=n,this.Cu=null,this.zu=null,this.Du=null,this.volume=0,this.onSoundLevelUpdate=function(t){}}return t.prototype.preload=function(t){return ap(this,void 0,void 0,function(){return cp(this,function(i){switch(i.label){case 0:return!lp.isSuccess?[4,lp.addModuleToContext(t,this.zn)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},t.prototype.initAudioWorklet=function(t,i){return ap(this,void 0,void 0,function(){var e,n,s=this;return cp(this,function(r){switch(r.label){case 0:if(this.Cu)return[3,5];r.label=1;case 1:if(r.trys.push([1,3,,4]),function(t){return!!Qt(t.createAnalyser)}(t)&&this.Dn.settingConfig.getSetting("sound_level_api_type")!==q.useWorklet)throw"use analyzer";return this.zn.info(hp+" use AudioWorklet. "),[4,this.preload(t)];case 2:return r.sent(),(e=this.Cu=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.Iu),[3,4];case 3:return n=r.sent(),this.zn.info(hp+" not use AudioWorklet. "+n),this.Du=up(t,i,this.Iu,this.Nu,function(t){s.onSoundLevelUpdate&&s.onSoundLevelUpdate(t||0)}),[3,4];case 4:return[3,6];case 5:i.connect(this.Cu).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.Du)||void 0===n?void 0:n.analyzer)&&s.connect(this.Du.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.Cu;this.Iu=t,i&&i.port.postMessage({name:"setIntervalTime",intervalTime:t}),this.Du&&this.Du.setInterval(t)},t.prototype.destroy=function(){this.zu&&(this.zu.onaudioprocess=null,this.zu.disconnect()),this.Du&&(this.Du.destroy(),this.Du=null),this.Cu&&(this.Cu.port.postMessage({name:"stop"}),this.Cu.port.onmessage=null,this.Cu.port.close(),this.Cu.disconnect(),this.zn.info(hp+" close worklet")),this.Cu=null,this.zu=null},t.sourceList={},t}(),vp=null,mp=null;function pp(t){return isNaN(t)?0:Math.max(-32768,Math.min(32767,Math.round(32767*t)))}var gp=null,bp=null;function _p(t,i,e,n,s){void 0===n&&(n=1),void 0===s&&(s=!1);var r=1;if(!i||!e||i===e){if(s){for(var o=new Int16Array(t.length),u=0;u<t.length;u++)o[u]=pp(t[u]);return o}return t}if((r=i/e)<=0)throw new Error("Invalid sample rate ratio");if(n<=0)throw new Error("Invalid channel count");var a,c=t.length/n,h=Math.round(c/r),f=h*n;s?((!bp||f>bp.length)&&(bp=new Int16Array(f)),a=bp):((!gp||f>gp.length)&&(gp=new Float32Array(f)),a=gp);for(var l=function(t,i,e,n,s){var r=s*s,o=n-e-t+i;return o*s*r+(t-i-o)*r+(e-t)*s+i},d=0;d<n;d++)for(u=0;u<h;u++){var v=u*r,m=Math.floor(v),p=v-m,g=Math.max(0,m-1)*n+d,b=m*n+d,_=Math.min(c-1,m+1)*n+d,y=Math.min(c-1,m+2)*n+d,w=t[g],S=t[b],E=t[_],O=t[y],T=l(w,S,E,O,p),k=Math.min(w,S,E,O),R=Math.max(w,S,E,O);T=Math.max(k,Math.min(R,T)),a[u*n+d]=s?pp(T):T}return a.slice(0,f)}function yp(t,i,e,n,s){void 0===s&&(s=!1),e&&n&&e!==n&&(t=t.map(function(t){return _p(t,e,n)}));var r=t.length,o=t[0];if(!o)return s?new Int16Array:new Float32Array;var u=o.length*i;s?(!function(t){return t instanceof Int16Array}(mp)||u>mp.length)&&(mp=new Int16Array(u)):(!(vp instanceof Float32Array)||u>vp.length)&&(vp=new Float32Array(u));var a=s?mp:vp;if(1===r&&1===i){if(!s)return o;for(var c=0;c<o.length;c++)a[c]=pp(o[c])}else for(c=0;c<o.length;c++)2===i?s?(a[c*i]=pp(o[c]),a[c*i+1]=pp(2===r?t[1][c]:o[c])):(a[c*i]=o[c],a[c*i+1]=2===r?t[1][c]:o[c]):a[c]=s?pp((o[c]+t[1][c])/2):(o[c]+t[1][c])/2;var h=a.slice(0,o.length*i);return s?null==mp||mp.fill(0):null==vp||vp.fill(0),h}function wp(t,i,e,n,s){void 0===s&&(s=!1);var r=t;if((e&&n&&e!==n||s)&&(r=t.map(function(t){return _p(t,e,n,1,s)})),1===i&&2===t.length){var o=void 0;o=s?new Int16Array(r[0]):new Float32Array(r[0]);var u=r[1];r=[o];for(var a=0;a<o.length;a++)o[a]=(o[a]+u[a])/2}else if(2===i&&1===t.length){u=void 0;u=s?new Int16Array(r[0]):new Float32Array(r[0]),r=[r[0],u]}return r}var Sp,Ep,Op,Tp,kp,Rp,Ip,Np,Cp,zp,Dp,Ap,Pp,Mp,xp,jp,Lp,qp,Up,Bp,Jp,Vp,Hp,Gp,Fp,Yp=function(){function t(t,i){this.ac=t,this.zn=i,this.useScript=!1,this.Au=null,this.Pu=null,this.Mu=4096}return t.prototype.setAudioFrameCallback=function(t,i,e,n){var s,r,o,u=this;this.zn.info("zc.apdp.safc.0 ".concat(t.id," ").concat(i," ").concat(JSON.stringify(n)));var a=(null==n?void 0:n.frameSize)||this.Mu;if(i)if(this.nu||(this.nu=this.ac.createMediaStreamSource(t)),this.useScript)this.Au||(this.Au=this.ac.createScriptProcessor(a),this.Au.onaudioprocess=function(t){for(var i=0;i<t.outputBuffer.numberOfChannels;i+=1)for(var s=t.outputBuffer.getChannelData(i),r=0;r<s.length;r+=1)s[r]=0;var o=t.inputBuffer.numberOfChannels,a=[];try{if(o>0)for(var c=0;c<o;c++){var h=t.inputBuffer.getChannelData(c);a.push(h)}var f=n||{},l=f.sampleRate,d=f.bitDepth,v=f.channelCount,m=t.inputBuffer.sampleRate,p=v||o,g=l||m,b=16===d;if(f.mergeChannelsIntoPcm){var _=yp(a,p,m,g,b);e({channels:[],channelCount:p,sampleRate:g,pcm:_})}else if([l,v,d].some(function(t){return!Ft(t)})){var y=wp(a,p,m,g,b);e({channels:y,channelCount:p,sampleRate:g})}else e({channels:a,channelCount:o,sampleRate:m})}catch(t){u.zn.info("zc.apdp.safc.0 script fail ".concat(t.toString()))}},this.zn.info("zc.apdp.safc.0 create _zgp_scriptNode")),this.nu.connect(this.Au),this.Au.connect(this.ac.destination);else{if(!this.Pu){try{this.Pu=new AudioWorkletNode(this.ac,"audio-pcm-data-processor",{processorOptions:{bufferSize:a}})}catch(t){this.zn.error("zc.apdp.safc.0 create worklet fail ".concat(t.toString()))}if(this.Pu){this.Pu.port.onmessage=function(t){if("process"===t.data.type)try{var i=t.data,s=i.channels,r=i.channelCount,o=n||{},u=o.sampleRate,a=o.bitDepth,c=o.channelCount,h=i.sampleRate,f=c||r,l=u||h,d=16===a;if(o.mergeChannelsIntoPcm){var v=yp(s,f,h,l,d);e({channels:[],channelCount:f,sampleRate:l,pcm:v})}else if([u,c,a].some(function(t){return!Ft(t)})){var m=wp(s,f,h,l,d);e({channels:m,channelCount:f,sampleRate:l})}else e({channels:s,channelCount:r,sampleRate:h})}catch(t){throw t}},this.zn.info("zc.apdp.safc.0 init worklet")}}this.Pu&&this.nu.connect(this.Pu),null===(s=this.Pu)||void 0===s||s.connect(this.ac.destination)}else{try{this.Pu&&(null===(r=this.nu)||void 0===r||r.disconnect(this.Pu)),this.Au&&(null===(o=this.nu)||void 0===o||o.disconnect(this.Au))}catch(t){this.zn.info("zc.apdp.safc.0 ".concat(JSON.stringify(t)))}this.nu=null}},t.prototype.replaceSource=function(t){var i,e;if(this.zn.info("zc.apdp.rs.0 ".concat(t.id)),this.nu){var n=this.ac.createMediaStreamSource(t);this.Pu&&(null===(i=this.nu)||void 0===i||i.disconnect(this.Pu),n.connect(this.Pu)),this.Au&&(null===(e=this.nu)||void 0===e||e.disconnect(this.Au),n.connect(this.Au)),this.nu=null,this.nu=n}},t.prototype.destroy=function(){var t,i;this.zn.info("zc.apdp.ds.0 call"),this.Pu&&(this.Pu.port.close(),null===(t=this.nu)||void 0===t||t.disconnect(this.Pu),this.Pu.disconnect(),this.zn.info("zc.apdp.ds.0 destroy worklet")),this.Au&&(this.Au.onaudioprocess=null,null===(i=this.nu)||void 0===i||i.disconnect(this.Au),this.Au.disconnect(),this.zn.info("zc.apdp.ds.0 close script processor")),this.Pu=null,this.Au=null,this.nu=null,this.zn.info("zc.apdp.ds.0 end")},t}(),Zp=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}(),Qp=function(){return Qp=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},Qp.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())})},Wp=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])}}},Kp=["videoInput","videoQuality","facingMode","width","height","frameRate","videoOptimizationMode"],$p=["audioInput","channelCount","ANS","AGC","AEC"],tg=function(){function t(t,i,e,n,s){this.zn=t,this.Dn=i,this.Uo=e,this.previewType=n,this.onlyPreview=s,this.xu={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.ju=null,this.voiceProccessor=null,this.lastTrackEndTime={audio:0,video:0},this.script=null,this.mic=null,this.eventListenerManager=new Zp,this.Lu=null,this._videoTrack=null,this.cloneVideoTrack=null,this.originVideoTrack=null,this.originAudioTrack=null,this.activateSEIConfig=null,this.qu=!0,this.hasStopCaptureVideo=!1,this.Uu=!0,this.gainNode=null,this.cameraMaxResolution={},this.enableDualStream=!1,this.lowStreamConfig={width:160,height:120,frameRate:15,bitRate:50},this.Bu=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.To},set:function(t){this.To=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoInfo",{get:function(){return this.xu},set:function(t){this.xu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mediaStreamConfig",{get:function(){return this.Ju},set:function(t){this.Ju=t},enumerable:!1,configurable:!0}),t.prototype.getEmptyAudioTrack=function(){if(!this.ju){var t=this.Uo.ac.createMediaStreamDestination(),i=t?t.stream:null,e=this.ju=i?i.getAudioTracks()[0]:null;this.zn.info("zp.geat "+"empty audio id: ".concat(null==e?void 0:e.id))}return this.ju},t.prototype.checkAudioExceptionEnded=function(t){var i;t&&(this.Uo.trackUtils.isTrackStopBySDK(t)||this.To&&"camera"===this.audioPreviewType&&this.Uo.getPublishList(this.To).length>0&&t.id===(null===(i=this.Lu)||void 0===i?void 0:i.id)&&(this.Dn.actionListener("_deviceError",Me,t.label,"micro"),this.Dn.actionListener("deviceError",Me,t.label),this.Uo.checkDeviceChange&&this.Uo.checkDeviceChange()))},t.prototype.checkVideoExceptionEnded=function(t){var i;t&&(this.Uo.trackUtils.isTrackStopBySDK(t)||this.To&&"camera"===this.videoPreviewType&&this.Uo.getPublishList(this.To).length>0&&t.id===(null===(i=this.videoTrack)||void 0===i?void 0:i.id)&&(this.Dn.actionListener("_deviceError",xe,t.label,"camera"),this.Dn.actionListener("deviceError",xe,t.label),this.Uo.checkDeviceChange&&this.Uo.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.Lu||(null===(t=this.To)||void 0===t?void 0:t.getAudioTracks()[0])||null},set:function(t){this.Lu!==t&&(this.Lu&&this.removeAudioTrackEvent(this.Lu),this.Lu=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.To)||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.qu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVideoEnabled",{get:function(){return this.Uu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"muteImage",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoNodeQueue",{get:function(){if(!this.Vu){if(!this._videoTrack)throw new Error("cannot use video node queue, because videoTrack of previewer haven't been inited.");var t=new Zm(this._videoTrack,this.Uo),i=new ep(this,this.Dn.browser);this.Vu=new Wm(t,i,this.Uo,this.Dn.browser,this),this.vcMgr&&(this.Vu.vcMgr=this.vcMgr)}return this.Vu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVideoNodeQueueEnabled",{get:function(){return this.Vu&&!this.Vu.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.getDestinationTrack=function(){return!this.Vu||this.Vu.isEmpty()?null:this.videoNodeQueue.getDestinationTrack()},Object.defineProperty(t.prototype,"ac",{get:function(){return this.Uo.ac},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"acMgr",{get:function(){return this.Uo.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 op(this.logger,this.Dn.browser,this.Uo.isCustomVC),this.Vu&&(this.Vu.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.Uo.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=Rh();if(n&&n.includes("11_4")||(t=Ng(this.Dn,this.zn,t),t=Zl(t)),e.audio=!0,e.video={width:this.Dn.settingConfig.getSetting("camera_width")||640,height:this.Dn.settingConfig.getSetting("camera_height")||480,frameRate:this.Dn.settingConfig.getSetting("camera_framerate")||15,bitRate:this.Dn.settingConfig.getSetting("camera_video_bitrate")},t.audio){var s=this.Dn.settingConfig.getCloudSettingScenario(this.Dn.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,Gt(t.ANS)&&(e.audio.noiseSuppression=t.ANS),Gt(t.AGC)&&(e.audio.autoGainControl=t.AGC),Gt(t.AEC)&&(e.audio.echoCancellation=t.AEC),e.audio.channelCount=Vt(t.channelCount)?t.channelCount:1}else!1===t.audio&&(e.audio=!1);if(t.video){var a=640,c=480,h=15,f=this.Dn.settingConfig.getSetting("camera_video_bitrate");if(1===t.videoQuality?(a=Et.width,c=Et.height,h=Et.frameRate,f=Et.bitRate):2===t.videoQuality?(a=Ot.width,c=Ot.height,h=Ot.frameRate,f=Ot.bitRate):3===t.videoQuality?(a=Tt.width,c=Tt.height,h=Tt.frameRate,f=Tt.bitRate):(a=t.width||640,c=t.height||480,h=t.frameRate||15,f=t.bitRate||this.Dn.settingConfig.getSetting("camera_video_bitrate"),this.zn.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:2*Math.floor(Number(a)/2),height:2*Math.floor(Number(c)/2),frameRate:h,bitRate:f},null!=t.facingMode?e.video.facingMode=t.facingMode:t.videoInput&&"undefined"!=t.videoInput&&(e.video.deviceId={exact:t.videoInput}),this.zn.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 Xp(this,void 0,void 0,function(){var s,r,o;return Wp(this,function(u){switch(u.label){case 0:if(this.zn.info("zp.sv.2 called "+JSON.stringify(t)),this.Ju=Qp({},t),!1===t.video&&this.deleteConstraints(this.Ju,Kp),!1===t.audio&&this.deleteConstraints(this.Ju,$p),this.zn.info("zp.sv.2 store "+JSON.stringify(this.Ju)),s=function(t){i(t)},Kt(t.source)||ti(t.source)){try{r=this.Hu(t),s&&s(r)}catch(t){e(t)}return[2]}return void 0!==navigator.mediaDevices&&null!=navigator.mediaDevices.getUserMedia?[3,1]:(e&&e(kn.error.te),[2]);case 1:return u.trys.push([1,3,,4]),[4,this.Gu(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.Ju,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.Gu=function(t,i){var e,n;return Xp(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 Wp(this,function(D){switch(D.label){case 0:s=this.getMediaStreamConstraints(t),o=s.mediaStreamConfig,u={},(r=s.mediaStreamConstraints).video?u=Qp({},r.video):Ft(o.bitRate)||(u.bitRate=o.bitRate),this.xu=Qp(Qp({},this.xu),u),this.xu.audioBitrate=1e3*o.audioBitrate||48e3,this.xu.startBitrate=o.startBitrate||this.Dn.settingConfig.getSetting("bitrate_mode"),this.xu.minBitrate=o.minBitrate,this.xu.keyFrameInterval=o.keyFrameInterval||this.xu.keyFrameInterval,Ht(t.videoOptimizationMode)&&(this.xu.contentHint=t.videoOptimizationMode),this.logger.info("zp.sv.2 update video info ".concat(JSON.stringify(this.xu),", onlyPreview: ").concat(this.onlyPreview)),r.audio&&(a=this.Dn.settingConfig.getCloudSettingScenario(this.Dn.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.xu.audioBitrate=1e3*c),h&&(r.audio.channelCount=h,this.xu.channelCount=h),Gt(f)&&(this.logger.info("zp.sv.2 setting AEC "+f),this.Ju.AEC=r.audio.echoCancellation=f),Gt(l)&&(this.logger.info("zp.sv.2 setting AGC "+l),this.Ju.AGC=r.audio.autoGainControl=l),Gt(d)&&(this.logger.info("zp.sv.2 setting ANS "+d),this.Ju.ANS=r.audio.noiseSuppression=d)),r.video instanceof Object&&(r.video.width=this.Dn.settingConfig.getSetting("camera_width",!0)||r.video.width,r.video.height=this.Dn.settingConfig.getSetting("camera_height",!0)||r.video.height,r.video.frameRate=this.Dn.settingConfig.getSetting("camera_framerate",!0)||r.video.frameRate),this.Ju.video=!!r.video,this.Ju.audio=!!r.audio,o.unlimitedCaptureResolution&&r.video.width&&(r.video.width={ideal:4096},r.video.height={ideal:2160},this.zn.info("zp.sv.2 capture max resolution of camera")),this.logger.info("zp.sv.2 constraints "+JSON.stringify(r)),i.setAttribute("preview_conf",kn.preview_conf(r)),v=function(t){var i=kn.error.oe;return i.message=i.message+" "+t.name+" "+t.message,"NotAllowedError"===t.name||"SecurityError"===t.name?(i=Qp({},kn.error.ue)).message=t.name+": "+i.message:"NotReadableError"===t.name?(i=Qp({},kn.error.ae)).message=t.name+": "+i.message:"OverconstrainedError"===t.name&&((i=Qp({},kn.error.ce)).message=t.name+": "+i.message+(t.constraint?". such as "+t.constraint:"")),i},m=function(t,i){return new ni(function(e){z.zn.info("zp.sv.2 recapture call"),dd(function(n){var s=n.cameras,r=n.microphones;if(z.zn.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.zn.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.zn.info("zp.sv.2 recapture audio "+u),t.audio.deviceId={exact:u}}navigator.mediaDevices.getUserMedia(t).then(function(t){z.zn.info("zp.sv.2 recapture success"),e(t)}).catch(function(t){e(void 0)})},function(t){z.zn.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(tu(t,z.zn,"zp.sv.2"),"video"===t.kind){var i=t.getSettings(),e=i.height,n=i.frameRate;z.zn.info("zp.sv.2 track settings ".concat(i.width," ").concat(e," ").concat(n))}}),this.zn.info("zp.sv.2 success"),[3,6];case 3:return g=D.sent(),this.zn.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=Ft(null===(e=r.video)||void 0===e?void 0:e.videoInput)),_&&(w=Ft(null===(n=r.audio)||void 0===n?void 0:n.audioInput)),this.zn.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.To=p,this.previewSuc=!0,this.initMediaTrack(p),this.xu&&((T=p.getVideoTracks()[0])&&(k=T.getSettings(),R=k.width,I=k.height,N=k.frameRate,Yt(this.xu.width)&&R&&(this.xu.width=R),Yt(this.xu.height)&&I&&(this.xu.height=I),Yt(this.xu.frameRate)&&N&&(this.xu.frameRate=N)),C=Yt(r.audio)&&r.audio.channelCount,this.xu.channelCount=C||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1)),[2,p]}})})},t.prototype.Hu=function(t){if(Kt(t.source)){var i=t.source.getVideoTracks(),e=i.length>0?i[0].getSettings():{width:0,height:0,frameRate:0};return this.zn.debug("zp.sv.2 use external media stream"),this.previewSuc=!0,this.To=new MediaStream(t.source),this.initMediaTrack(this.To),this.xu={width:e.width||0,height:e.height||0,frameRate:e.frameRate||0,bitRate:t.bitRate||this.Dn.settingConfig.getSetting("custom_video_bitrate"),startBitrate:t.startBitrate||this.Dn.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:""},Ht(t.videoOptimizationMode)&&(this.xu.contentHint=t.videoOptimizationMode),this.To}if(ti(t.source)){var n=this.captureStream(t.source,t);if(n)return this.xu.bitRate=t.bitRate||this.Dn.settingConfig.getSetting("custom_video_bitrate"),this.previewSuc=!0,this.initMediaTrack(n),n;throw kn.error.te}return new MediaStream},t.prototype.captureStream=function(t,i){var e,n,s,r;if(!t)return this.zn.info("zp.cs.2 no local video"),null;var o=this.streamCenter.captureStreamElementMap.get(t);if(o)this.zn.info("zp.cs.2 stream has capture"),r=o.clone();else{var u=void 0;if(t.captureStream)u=t.captureStream(),this.zn.debug("zp.cs.2 captureStream");else{if(!t.mozCaptureStream)return this.zn.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.zn.debug("zp.cs.2 mozCaptureStream")}this.streamCenter.captureStreamElementMap.set(t,u),r=u.clone()}if(0==r.getTracks().length)return this.zn.error("zp.cs.2 external capture tracks no found"),null;this.zn.info("zp.cs.2 tracks: "+r.getTracks().length),this.To=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.xu={width:t.videoWidth,height:t.videoHeight,frameRate:(null==c?void 0:c.frameRate)||0,bitRate:i.bitRate||this.Dn.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.Dn.settingConfig.getSetting("bitrate_mode"),minBitrate:i.minBitrate,keyFrameInterval:i.keyFrameInterval,contentHint:""},Ht(i.videoOptimizationMode)&&(this.xu.contentHint=i.videoOptimizationMode),this.zn.debug("zp.cs.2 called success"),this.To},t.prototype.stopPreview=function(){var t,i,e,n=this;if(this.zn.info("zp.sv.2.1 called"),this.To){var s=this.rtcViewer;s&&s.destroy(),this.videoEffect&&(this.videoEffect.setBeautyEffectOptions(!1),this.videoEffect.destroy()),this.Fu&&this.Fu.destroy(),this.voiceProccessor&&this.voiceProccessor.destroy(),null===(t=this.Dn.backgroundBlurManager)||void 0===t||t.releaseMap(this.To),this.backgroundProcessor&&(this.backgroundProcessor.release(),this.backgroundProcessor=null),this.streamCompositor&&(this.streamCompositor=null),this.Vu&&this.videoNodeQueue.destroy(),this.Uo.trackUtils.stopTrack(this.cloneVideoTrack),this.cloneVideoTrack=null,this.muteImageAnID&&cancelAnimationFrame(this.muteImageAnID),this.blkImgAnId&&cancelAnimationFrame(this.blkImgAnId),this.stopSoundLevel(),this.Uo.trackUtils.stopTrack(this.originVideoTrack),this.originVideoTrack=null,this.Uo.trackUtils.stopTrack(this.originAudioTrack),this.originAudioTrack=null,this.Uo.trackUtils.stopTrack(this.videoTrack),this.videoTrack=null,this.Uo.trackUtils.stopTrack(this.audioTrack),this.audioTrack=null,dp.sourceDisConnect(this.To),null===(i=this.audioMixManager)||void 0===i||i.stopAudioManager(),this.Yu(),!this.zegoCaptureStream&&this.To.getTracks().forEach(function(t){n.Uo.trackUtils.stopTrack(t)}),this.To=null,!this.zegoCaptureStream&&(null===(e=this.lowStream)||void 0===e||e.getTracks().forEach(function(t){return n.Uo.trackUtils.stopTrack(t)})),this.lowStream=void 0,this.xu={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.zn.error("zp.em.2 no localStream"),!1;var e=this.localStream.getAudioTracks()[0];e.enabled=t;var n=this.Uo,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 Xp(i,void 0,void 0,function(){var i,s;return Wp(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.Zu(s,3),this.qu=t,this.zn.debug("zp.em.2 call success. "+t),!0},t.prototype.updatePublisherStreamMicStatus=function(t,i){this.Zu(this.qu&&t,i)},t.prototype.Zu=function(t,i){if(this.To){var e=this.Uo.getPublishList(this.To).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.To){var e=this.Uo.getPublishList(this.To).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.To?this.micTrack?(this.micTrack.enabled=this.qu&&t,this.updatePublisherStreamMicStatus(t,3),this.zn.debug("zp.emo.2 call success"),!0):(this.zn.info("zp.emo.2 no micTrack"),!0):(this.zn.error("zp.em.2 no localStream"),!1)},t.prototype.enableCamera=function(t,i,e){var n;return Xp(this,void 0,void 0,function(){var s,r,o,u,a,c,h,f,l,d=this;return Wp(this,function(v){switch(v.label){case 0:return this.localStream&&this.videoTrack?(s=this.videoTrack,u=this.lowStream,this.Bu&&(t?t&&(this.isVideoNodeQueueEnabled?setTimeout(function(){var t=d.videoNodeQueue.getDestinationTrack();t&&d.replacePreviewTrack(t,!0)},800):this.videoTrack&&this.replacePreviewTrack(this.videoTrack,!1)):(r=this.Qu(this.Bu),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.zn.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.zn.error("zp.ec.2 video track no found"),[2,!1]);case 1:v.sent(),v.label=2;case 2:return t&&s?[4,this.videoNodeQueue.replaceNewSourceByTrack(s,!1)]:[3,4];case 3:v.sent(),v.label=4;case 4:v.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&&(l=null,f.forEach(function(i){var e="H265"===i.publishOption.videoCodec,n=!i.sideMediaConfig.isSEIStart,a=i.getVideoSenders();a&&a.forEach(function(c,f){return Xp(d,void 0,void 0,function(){var d,v,m,p,g=this;return Wp(this,function(b){switch(b.label){case 0:return t?[3,10]:this.Bu?(i.setSendMuteImage(!0),i.isTcVideoPasued()?[3,4]:a.length>1&&0===f&&o?[4,null==c?void 0:c.replaceTrack(o)]:[3,2]):[3,5];case 1:return b.sent(),[3,4];case 2:return r?[4,null==c?void 0:c.replaceTrack(r)]:[3,4];case 3:b.sent(),b.label=4;case 4:return[3,9];case 5:return e||!n?[3,8]:i.isTcVideoPasued()?[3,7]:[4,c.replaceTrack(null)];case 6:b.sent(),b.label=7;case 7:return[3,9];case 8:e&&(l||(d=null==s?void 0:s.getSettings(),l=this.Wu(null==d?void 0:d.width,null==d?void 0:d.height,n)),l&&c.replaceTrack(l)),b.label=9;case 9:return[3,22];case 10:return t?(i.setSendMuteImage(!1),v=0,!this.Bu&&e&&(null===(p=c.track)||void 0===p||p.stop()),this.isVideoNodeQueueEnabled?(v=800,m=this.videoNodeQueue.getDestinationTrack(),i.isTcVideoPasued()||!m||c.track===m?[3,12]:[4,null==c?void 0:c.replaceTrack(m)]):[3,13]):[3,22];case 11:b.sent(),b.label=12;case 12:return[3,21];case 13:return i.isTcVideoPasued()||c.track===this.videoTrack?[3,21]:(null==h?void 0:h.streamFromCanvas)?[3,19]:a.length>1&&0===f?u?[4,null==c?void 0:c.replaceTrack(u.getVideoTracks()[0])]:[3,15]:[3,16];case 14:b.sent(),b.label=15;case 15:return[3,18];case 16:return[4,null==c?void 0:c.replaceTrack(this.videoTrack)];case 17:b.sent(),b.label=18;case 18:return[3,21];case 19:return[4,null==c?void 0:c.replaceTrack(h.streamFromCanvasTrack)];case 20:b.sent(),b.label=21;case 21:v?setTimeout(function(){g.muteImageAnID&&clearInterval(g.muteImageAnID),g.blkImgAnId&&clearInterval(g.blkImgAnId)},v):(this.muteImageAnID&&clearInterval(this.muteImageAnID),this.blkImgAnId&&clearInterval(this.blkImgAnId)),b.label=22;case 22:return[2]}})})});var c=d.Bu&&!t?0:bd(d.videoTrack);i.sendStreamStatus(c,i.mic_status)})),this.Uu=t,this.zn.info("zp.ec.2 call success"),[2,!0]}})})},t.prototype.Xu=function(t,i){var e=this;if(rd(this.Dn.browserInfo,"chrome",86,2)&&rd(this.Dn.browserInfo,"chrome",92,0)&&t&&!Ft(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 Xp(this,void 0,void 0,function(){var t,i,e,n,s=this;return Wp(this,function(r){switch(r.label){case 0:return t=this.lowStream,this.videoTrack?(i=this.videoTrack.enabled,e="safari"===this.Dn.browser,this.hasStopCaptureVideo=!0,n=function(){return Xp(s,void 0,void 0,function(){return Wp(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.Dn.engineConfig.previewClearLastFrame?e?[3,2]:(this.videoTrack.enabled=!1,t&&(t.getVideoTracks()[0].enabled=!1),[4,new ni(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.Uo.trackUtils.stopTrack(this.videoTrack),this.Uo.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.Uo.trackUtils.stopTrack(this.videoTrack),this.Uo.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.To&&0!=this.To.getAudioTracks().length){null===(t=this.soundMeterWorklet)||void 0===t||t.destroy();var i=this.Uo.getCloudSoundInterval();try{var e=this,n=this.Uo.createSoundLevel(this.ac,this.To,this.Uo.soundLevelInterval,i,function(t){e.soundLevel=100*t}),s=n.mic;this.soundMeterWorklet=n.soundMeter,this.mic=s}catch(t){this.zn.error(nv+" 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.Uo.soundLevelDelegate?(this.stopSoundLevel(),this.startSoundLevel()):this.stopSoundLevel()},t.prototype.setBeautyEffect=function(t,i){return Xp(this,void 0,void 0,function(){return Wp(this,function(t){return[2]})})},t.prototype.setMuteImage=function(t){this.Bu=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={}),Xp(this,void 0,void 0,function(){var s,r,o,u,a,c,h;return Wp(this,function(f){return this.zn.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.zn.info("zsc.rpt.0 videoNodeQueue replaceNewSource"),null===(n=this.Vu)||void 0===n||n.replaceNewSourceByTrack(t,void 0,Qp({},e))):r&&this.audioNodeQueue&&!e.isTrackProcessedFromOriginalStream?((a=new MediaStream).addTrack(t),c=this.ac.createMediaStreamSource(a),this.audioNodeQueue.replaceSource(c),this.voiceProccessor&&wh()&&t!==this.ju&&this.voiceProccessor.resetWorklet()):r&&!this.audioNodeQueue&&this.destNode&&!e.isTrackProcessedFromOriginalStream?(this.createSrcNode(t,!0).connect(this.destNode),this.zn.info("zsc.rpt.0 replace audio track with audio mix.")):(this.zn.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.Dn.browser&&this.rtcViewer.resume(!0)),!s&&o&&this.enableDualStream&&this.createLowStream()),i||s||e.isTrackProcessedFromOriginalStream||(this.zn.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.Uo.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.zn.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.Uo.checkPreview(e);this.zn.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.To)||void 0===t?void 0:t.getVideoTracks()[0];if(r){var o=r.getSettings().height,u=r.getSettings().width,a=ph(),c=kh(),h=a.indexOf("Android")>-1||a.indexOf("Adr")>-1;this.zn.info("zp.cls w: "+u+" h: "+o+" "+h+" "+c);var f=Vt(null===(i=this.xu)||void 0===i?void 0:i.width)&&Vt(null===(e=this.xu)||void 0===e?void 0:e.height)&&o==this.xu.width&&u==this.xu.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.zn.info("zp.cls lw: "+p+" lh: "+v),"firefox"===this.Dn.browser)this.lowStream=this.getStreamThroughCanvas(this.To,{w:p,h:v,fps:g});else{this.lowStream=null===(n=this.To)||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.zn.error("zp.cls "+t)}}},t.prototype.initAudioNodeQueue=function(t){if(!this.audioTrack||!this.To)return!1;var i=this.createSrcNode(this.audioTrack),e=this.createDestNode(this.To);return this.audioNodeQueue=new qm(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.zn.info("zp.pv.csn use empty track"),s=this.getEmptyAudioTrack()),this.srcNode&&!e){if(!i)return this.srcNode;this.srcNode.disconnect(),this.zn.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.zn.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.ju===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.zn.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.Uo.publisherList){var r=this.Uo.publisherList[s];if(r.localStream==t){var o=r.publisher.audioSender;o&&(o.replaceTrack(e),this.zn.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.qu)),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.To||this.rtcViewer&&this.rtcViewer.inited||(this.rtcViewer=new Lm(this.To,this,{clearLastFrame:this.Dn.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=ri(),c=si.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 ni(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.zn.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.Ku&&(clearInterval(n.Ku),n.Ku=null),n.Ku=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.zn.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.zn.info("zc.gstc stop canvas track:"+l.id),n.Ku&&(clearInterval(n.Ku),n.Ku=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)},Kt(t)&&t.getAudioTracks().length){var d=t.getAudioTracks()[0];f.addTrack(d)}return f},t.prototype.stopCanvasStreamTrack=function(){this.streamFromCanvas&&this.streamFromCanvasTrack&&(this.Uo.trackUtils.stopTrack(this.streamFromCanvasTrack),this.streamFromCanvasTrack=null),this.Ku&&(clearInterval(this.Ku),this.Ku=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.zn.info("zc.pv.uvi input video info: ".concat(JSON.stringify(i))),this.xu=Qp(Qp(Qp({},this.xu),i),{bitRate:this.xu.bitRate||i.bitRate,minBitrate:this.xu.bitRate||i.bitRate}),Qp({},this.xu)},t.prototype.updateAudioInfo=function(t){var i={};return this.zn.info("zc.pv.uai input audio info: ".concat(JSON.stringify(i))),this.xu=Qp(Qp({},this.xu),i),Qp({},this.xu)},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.xu.width=i),void 0!==e&&(this.xu.height=e),void 0!==n&&(this.xu.frameRate=n),void 0!==s&&(this.xu.bitRate=s),void 0!==r&&(this.xu.startBitrate=r),void 0!==o&&(this.xu.minBitrate=o),void 0!==u&&(this.xu.keyFrameInterval=u),void 0!==a&&(this.xu.channelCount=a),void 0!==c&&(this.xu.audioBitrate=c),void 0!==h&&(this.xu.contentHint=h)}},t.prototype.updateMediaStreamConstraints=function(t,i){var e=this;this.zn.info("zc.pv.umsc ".concat(JSON.stringify(t))),"video"===i?Kp.forEach(function(i){return e.Ju[i]=t[i]}):$p.forEach(function(i){return e.Ju[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.Dn.engineConfig.choirRole;if(this.To){this.zn.info("zc.pv.svf ".concat(null===(i=this.To)||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.zn.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.zn.info("zc.pv.svf factor: ".concat(n)),this.setVolume(void 0,n)}},t.prototype.setVolume=function(t,i){var e,n,s;this.zn.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(Vt(o)){var u=!1;r.gain.value!=o&&(u=!0,r.gain.value=o),this.zn.info("zc.pv.scv ".concat(this.audioPreviewType," ").concat(null===(s=this.To)||void 0===s?void 0:s.id," volume: ").concat(o,". hasChanged: ").concat(u))}else this.zn.error("zc.pv.scv ".concat(this.audioPreviewType," ").concat(null===(n=this.To)||void 0===n?void 0:n.id," volume error: ").concat(o))},t.prototype.Qu=function(t){var i=oi(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.Wu=function(t,i,e){(t<160||i<160)&&(t=160,i=160);var n=oi(t,i),s=n.getContext("2d");return e?s&&(s.fillStyle="black",s.fillRect(0,0,t,i)):this.blkImgAnId=setInterval(function(){s&&(s.fillStyle="black",s.fillRect(0,0,t,i))},100),n.captureStream().getVideoTracks()[0]},t.prototype.setAudioFrameCallback=function(t,i){if(this.zn.info("zc.pv.safc call"),this.To){this.Fu||(this.Fu=new Yp(this.ac,this.zn));var e=null!==t;this.audioNodeQueue||this.initAudioNodeQueue(),this.audioNodeQueue&&this.Fu.setAudioFrameCallback(this.audioNodeQueue.destinationNode.stream,e,function(i){t&&t(i)},i)}else this.zn.info("zc.pv.safc no localStream")},t.prototype.Yu=function(){this.Fu&&(this.Fu.destroy(),this.Fu=null)},t}();function ig(t,i){if(t&&!Kt(t)&&t.zegoStream){if(i.info("cu.gs type:zego"),Kt(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"}(Sp||(Sp={})),function(t){t[t.World=0]="World",t[t.Team=1]="Team",t[t.SecretTeam=2]="SecretTeam"}(Ep||(Ep={})),function(t){t[t.All=0]="All",t[t.World=1]="World",t[t.Team=2]="Team"}(Op||(Op={})),function(t){t[t.All=0]="All",t[t.World=1]="World",t[t.Team=2]="Team"}(Tp||(Tp={})),function(t){t[t.Song=0]="Song",t[t.Accompaniment=1]="Accompaniment",t[t.AccompanimentClip=2]="AccompanimentClip",t[t.AccompanimentSegment=3]="AccompanimentSegment"}(kp||(kp={})),function(t){t[t.Count=0]="Count",t[t.User=1]="User",t[t.Room=2]="Room",t[t.Master=3]="Master"}(Rp||(Rp={})),function(t){t[t.VendorDefault=0]="VendorDefault",t[t.Vendor1=1]="Vendor1",t[t.Vendor2=2]="Vendor2",t[t.Vendor3=4]="Vendor3"}(Ip||(Ip={})),function(t){t[t.PortraitSegmentation=0]="PortraitSegmentation"}(Np||(Np={})),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"}(Cp||(Cp={})),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"}(zp||(zp={})),function(t){t[t.None=0]="None",t[t.Local=1]="Local",t[t.Publish=2]="Publish",t[t.All=3]="All"}(Dp||(Dp={})),function(t){t[t.AI=0]="AI",t[t.AIBalanced=1]="AIBalanced",t[t.AIAggressive=2]="AIAggressive"}(Ap||(Ap={})),function(t){t[t.AspectFill=0]="AspectFill",t[t.AspectFit=1]="AspectFit"}(Pp||(Pp={})),function(t){t[t.ZegoFontTypeSourceHanSans=0]="ZegoFontTypeSourceHanSans",t[t.ZegoFontTypeAlibabaSans=1]="ZegoFontTypeAlibabaSans",t[t.ZegoFontTypePangMenZhengDaoTitle=2]="ZegoFontTypePangMenZhengDaoTitle",t[t.ZegoFontTypeHappyZcool=3]="ZegoFontTypeHappyZcool"}(Mp||(Mp={})),function(t){t[t.ZegoAudioMixModeRaw=0]="ZegoAudioMixModeRaw",t[t.ZegoAudioMixModeFocused=1]="ZegoAudioMixModeFocused"}(xp||(xp={})),function(t){t[t.ZegoAudioCodecIDNormal=1]="ZegoAudioCodecIDNormal",t[t.ZegoAudioCodecIDNormal2=2]="ZegoAudioCodecIDNormal2",t[t.ZegoAudioCodecIDLow3=6]="ZegoAudioCodecIDLow3"}(jp||(jp={})),function(t){t[t.ZegoEncodeProfileDefault=0]="ZegoEncodeProfileDefault",t[t.ZegoEncodeProfileBaseline=1]="ZegoEncodeProfileBaseline",t[t.ZegoEncodeProfileMain=2]="ZegoEncodeProfileMain",t[t.ZegoEncodeProfileHigh=3]="ZegoEncodeProfileHigh"}(Lp||(Lp={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On"}(qp||(qp={})),function(t){t[t.PortraitSegmentation=0]="PortraitSegmentation"}(Up||(Up={})),function(t){t[t.ZegoGeoFenceTypeNone=0]="ZegoGeoFenceTypeNone",t[t.ZegoGeoFenceTypeInclude=1]="ZegoGeoFenceTypeInclude",t[t.ZegoGeoFenceTypeExclude=2]="ZegoGeoFenceTypeExclude"}(Bp||(Bp={})),function(t){t[t.ZegoDefined=0]="ZegoDefined",t[t.UserUnregister=1]="UserUnregister"}(Jp||(Jp={})),function(t){t[t.TrafficControlFocusOnLocalOnly=0]="TrafficControlFocusOnLocalOnly",t[t.TrafficControlFocusOnRemote=1]="TrafficControlFocusOnRemote"}(Vp||(Vp={})),function(t){t[t.NoVideo=0]="NoVideo"}(Hp||(Hp={})),function(t){t[t.Allow=0]="Allow",t[t.NotAllow=1]="NotAllow"}(Gp||(Gp={})),function(t){t[t.video=0]="video",t[t.audio=1]="audio",t[t.videoAndAudio=2]="videoAndAudio"}(Fp||(Fp={}));var eg=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}(),ng=eg,sg=function(){return sg=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},sg.apply(this,arguments)},rg=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())})},og=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])}}},ug=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))},ag=function(){function t(t,i,e,n,s){var r=this;this.Yr=t,this.zn=i,this.Uo=e,this.Dn=n,this.$u=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.ta=[],this.ia=[],this.Xr={autoplayFailed:function(t,i){r.ru.emit("autoplayFailed",t,i)},autoplayCaptureFailed:function(t,i){r.ru.emit("autoplayCaptureFailed",t,i)},canPlayAudio:function(t){r.ru.emit("canPlayAudio",t)},canPlayVideo:function(t){r.ru.emit("canPlayVideo",t)},canPlayCaptureVideo:function(t){r.ru.emit("canPlayCaptureVideo",t)},canPlayCaptureAudio:function(t){r.ru.emit("canPlayCaptureAudio",t)},videoTrackChanged:function(t){r.ru.emit("videoTrackChanged",t)},audioTrackChanged:function(t){r.ru.emit("audioTrackChanged",t)},captureVideoTrackChanged:function(t){r.ru.emit("captureVideoTrackChanged",t)},captureAudioTrackChanged:function(t){r.ru.emit("captureAudioTrackChanged",t)}},this.ea=!1,this.na=!1,this.sa=null,this.ra=[],this.oa=null,this.ua=null,this.aa="",this.ca="",this.ha=null,this.fa=null,this.ru=new Tm,this.autoPlay&&!t.view&&this.zn.error("zcs.c if you want to play the stream automatically, the view parameter is required."),this.Ln=this.Dn.reporter}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.Yr.view||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoPlay",{get:function(){return!!Gt(this.Yr.autoPlay)&&this.Yr.autoPlay},enumerable:!1,configurable:!0}),t.prototype.getAudioTracks=function(){var t;return this.zn.info("zcs.gats call"),(null===(t=this.originAudioStream)||void 0===t?void 0:t.getAudioTracks())||[]},t.prototype.getVideoTracks=function(){var t;return this.zn.info("zcs.gvts call"),(null===(t=this.originVideoStream)||void 0===t?void 0:t.getVideoTracks())||[]},t.prototype.getTracks=function(){return ug(ug([],this.getAudioTracks(),!0),this.getVideoTracks(),!0)},Object.defineProperty(t.prototype,"aCaptureViewer",{get:function(){return this.sa},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewer",{get:function(){return this.oa},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,"la",{get:function(){return this.$u.publishStreamHandler},enumerable:!1,configurable:!0}),t.prototype.on=function(t,i){return!!i&&this.ru.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.ru.removeEventHandler(t,i)},t.prototype.startPublish=function(){},t.prototype.resetPublish=function(){this.da()},t.prototype._getDeviceIdByTrack=function(t){return t&&t.getSettings().deviceId||""},t.prototype.va=function(t,i){var e=Yt(t)?t:{};return i.call(this,e)},t.prototype.ma=function(t,i){var e=this;if(this.zn.info("zcs.uos call type:"+i),0==i){if(this.originVideoStream=t,this.autoPlay||this.na){var n=this.ra.map(function(t){return{container:t.container,option:t.Yr}});this.stopPlayCaptureVideo(),(null==n?void 0:n.length)||(n=[{container:this.Yr.captureView||null,option:{}}]),n.forEach(function(t){return t.container&&e.playCaptureVideo(t.container,t.option)})}this.Xr.captureVideoTrackChanged(this.originVideoStream.getVideoTracks()[0])}else this.originAudioStream=t,this.audioCaptureMuted||(this.stopPlayCaptureAudio(),this.playCaptureAudio()),this.Xr.captureAudioTrackChanged(this.originAudioStream.getAudioTracks()[0])},Object.defineProperty(t.prototype,"isPublish",{get:function(){for(var t in this.Uo.publisherList){if(this.Uo.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),rg(this,void 0,void 0,function(){var n,s,r,o,u,a,c=this;return og(this,function(h){switch(h.label){case 0:if(this.zn.info("zcs.uat call"),!this.originAudioStream||this.isPublish&&0==e||!this.stream)return[2];if(!(n=this.checkPreview(this.originAudioStream))||!n.audioTrack)return this.zn.info("zcs.uat not preview"),[2];s=this.fa,r=n.audioTrack,o=function(i){if(n&&i){var e=n.mediaStreamConfig;i.audio={input:e.audioInput,ANS:e.ANS,AEC:e.AEC,AGC:e.AGC,bps:n.videoInfo.audioBitrate,channelCount:e.channelCount}}c.fa=n.audioTrack,c.Xr.audioTrackChanged(n.audioTrack),t(i)},h.label=1;case 1:return h.trys.push([1,3,,4]),this.stream&&this.pa(this.stream,this.stream,this.originAudioStream,!0),[4,this._updateStreamTrack(s,r,o,i)];case 2:return u=h.sent(),this.zn.info("zcs.uat success"),[2,u];case 3:return a=h.sent(),this.zn.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),rg(this,void 0,void 0,function(){var n,s,r,o,u,a=this;return og(this,function(c){switch(c.label){case 0:if(this.zn.info("zcs.uvt call"),!this.originVideoStream||this.isPublish&&0==e||!this.stream)return this.zn.info("zcs.uvt not capture"),[2];if(n=this.ha,!(s=this.checkPreview(this.originVideoStream))||!s.videoTrack)return this.zn.info("zcs.uvt not preview"),[2];r=s.videoTrack,o=function(i){if(s&&i){var e=s.mediaStreamConfig,n=s.videoInfo,r=n.contentHint;i.video={input:e.videoInput,w:n.width,h:n.height,fps:n.frameRate,bps:1e3*n.bitRate,keyFrameInterval:n.keyFrameInterval,optimizationMode:r||void 0,facingMode:e.facingMode}}a.ha=s.videoTrack,a.Xr.videoTrackChanged(s.videoTrack),t(i)},c.label=1;case 1:return c.trys.push([1,3,,4]),this.stream&&this.pa(this.stream,this.originVideoStream,this.stream,!0),[4,this._updateStreamTrack(n,r,o,i)];case 2:return c.sent(),this.ca=this.aa,this.zn.info("zcs.uvt success"),[3,4];case 3:return u=c.sent(),this.zn.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),rg(this,void 0,void 0,function(){var n,s,r,o,u,a;return og(this,function(c){switch(c.label){case 0:this.zn.info("zcs.uva call"),n=!this.originVideoStream,s=!this.originAudioStream,r={},o=function(i){n=!0,i&&(r.video=null==i?void 0:i.video),s&&t(sg(sg({},i),r))},u=function(i){s=!0,i&&(r.audio=null==i?void 0:i.audio),n&&t(sg(sg({},i),r))},c.label=1;case 1:return c.trys.push([1,4,,5]),[4,this.updateStreamVideoTrack(o,i,e)];case 2:return c.sent(),[4,this.updateStreamAudioTrack(u,i,e)];case 3:return c.sent(),[3,5];case 4:return a=c.sent(),i(a),this.zn.info("zcs.uva error:".concat(JSON.stringify(a))),[3,5];case 5:return[2]}})})},t.prototype._updateStreamTrack=function(t,i,e,n){return rg(this,void 0,void 0,function(){var s,r,o,u,a,c;return og(this,function(h){switch(h.label){case 0:return h.trys.push([0,6,,7]),this.zn.info("zcs.ut call"),s=this.stream&&this.checkPreview(this.stream),this.stream&&s?(r={errorCode:0,extendedData:""},t?[3,2]:(this.zn.info("zcs.ut add"),[4,this.la.handleTrack("ADD",this.stream,i,e,n)])):(this.zn.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.zn.info("zcs.ut replace"),o=!1,this.aa&&this.ca&&this.aa!==this.ca&&(o=!0),[4,this.$u.replaceTrack(this.stream,i,void 0,{isReplaceNew:o,isCaptureStream:!0})]);case 3:return r=h.sent(),this.Uo.trackUtils.stopTrack(t),u=this.Uo.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.ga=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.fa=s.audioTrack)}if(this.originVideoStream){var r=this.checkPreview(this.originVideoStream);r&&r.videoTrack&&(n.push(r.videoTrack),this.ha=r.videoTrack)}this.stream=new MediaStream(n)}var o=this.checkPreview(this.stream);if(!o){var u={},a=Ng(this.Dn,this.zn);if(Ft(t.bitrate)||(u.bitRate=t.bitrate),Ft(t.minBitrate)||(u.minBitrate=t.minBitrate),Ft(t.startBitrate)||(u.startBitrate=t.startBitrate),u.audioBitrate=Vt(t.audioBitrate)?1e3*t.audioBitrate:1e3*(a.audioBitrate||48),"camera"===i){var c=this.Dn.settingConfig.getSetting("camera_audio_bitrate",!0),h=this.Dn.settingConfig.getSetting("camera_video_bitrate",!0);Vt(u.audioBitrate)&&Vt(c)&&(u.audioBitrate=1e3*c),Vt(u.bitRate)&&Vt(h)&&(u.bitRate=h)}u.channelCount=Ft(t.channelCount)?a.channelCount||1:t.channelCount,o=this.createZegoStreamPreview(this.stream,!1,void 0,u),this.stream=this.$u.getStreamByCanvas(this.stream)}this.stream&&this.pa(this.stream,this.originVideoStream,this.originAudioStream,!0),o&&0===(null===(e=this.stream)||void 0===e?void 0:e.getAudioTracks().length)&&this.$u.setEmptyAudioTrack(this.stream,o),this.$u.initCopyMusic(this.stream),o.zegoCaptureStream=this,this.ca=this.aa,this.ua=o},t.prototype.createZegoStreamPreview=function(t,i,e,n){var s=new tg(this.zn,this.Dn,this.Uo,e,i);return this.Uo.previewStreamList.push(s),s.localStream=t,s.mediaStreamConfig={},n&&(s.videoInfo=sg(sg({},s.videoInfo),n),s.mediaStreamConfig.bitRate=n.bitRate),s.initMediaTrack(t),"screen"==e&&this.$u.addShareScreenEnd(t),s},t.prototype.checkPreview=function(t){return this.Uo.checkPreview(t)},t.prototype.pa=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=sg({videoQuality:s.mediaStreamConfig.videoQuality,bitRate:s.mediaStreamConfig.bitRate},f),c=f.video;var l=sg({},h);if(ug(ug([],$p,!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.zn.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.Dn.settingConfig.getSetting("camera_video_bitrate",!0);Vt(m)&&Vt(p)&&(this.zn.info("zcs.up ".concat(s.previewType," cloud videoBitrate ").concat(p)),m=p),this.zn.info("zcs.up ".concat(s.previewType," videoBitrate changed ").concat(d," to ").concat(m)),l.bitRate=m}this.isPublish&&delete l.keyFrameInterval}a=sg({},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.zn.info("zcs.up ".concat(n," audioBitrate changed ").concat(O," to ").concat(h.audioBitrate)),a.audioBitrate=h.audioBitrate),u=sg(sg({},u),{audio:g,AEC:b,AGC:_,ANS:y,audioBitrate:w,channelCount:S,audioInput:E})}u.video=c,s.mediaStreamConfig=u,s.videoInfo=sg(n?sg({},s.videoInfo):{},a)}}},t.prototype._getVideoBitrate=function(t){return Vt(this.Yr.videoBitrate)?sg(sg({},t),{bitrate:this.Yr.videoBitrate}):sg(sg({},t),this.Yr.videoBitrate)},t.prototype._getAudioBitrate=function(t){return t.audioBitrate=this.Yr.audioBitrate,t},t.prototype._createStream=function(t,i,e,n,s){return rg(this,void 0,void 0,function(){var r,o,u,a,c,h,f,l,d,v,m;return og(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),r=e==Fp.video||e==Fp.videoAndAudio,o=e==Fp.audio||e==Fp.videoAndAudio,t=this._getVideoBitrate(t),t=this._getAudioBitrate(t),this.zn.info("zcs.cs config:"+JSON.stringify(((v={})[i]=t,v))),[4,this.$u.createStream((m={},m[i]=t,m))];case 1:return u=p.sent(),this.aa=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.pa(f,u,null),this.pa(l,null,u),this.ia.push(f),this.ta.push(l),this.ma(f,0),this.ma(l,1),!this.stream&&a?(this.stream=u,this.fa=h,this.ha=c,a.zegoCaptureStream=this,this.ua=a):this.updateStreamVideoAndAudio(n,s,0)):r?(this.ma(u,0),this.ia.push(u),this.stream?this.updateStreamVideoTrack(n,s,0):this.ga(t,i)):o&&(l=new MediaStream([h]),this.createZegoStreamPreview(l,!0,i),this.pa(l,null,u),this.ma(l,1),this.ta.push(l),this.ta.push(u),this.stream?this.updateStreamAudioTrack(n,s,0):this.ga(t,i)),this.isPublish||(this.autoPlay||this.ea)&&this.autoPlay&&this.playVideo(),this.da(),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 ni(function(e){return rg(i,void 0,void 0,function(){var i,n,s,r,o,u,a,c,h,f,l=this;return og(this,function(d){switch(d.label){case 0:this.zn.info("".concat(i="zcs.scm"," call ").concat(JSON.stringify(t))),n=this.ba(In),s=function(i){var s,r,o;if(l.ua&&!l.isPublish){var u=null===(s=l.ua)||void 0===s?void 0:s.mediaStreamConfig,a=u.channelCount;o={audio:{input:u.audioInput,ANS:u.ANS,AEC:u.AEC,AGC:u.AGC,bps:(null===(r=l.ua)||void 0===r?void 0:r.videoInfo).audioBitrate,channelCount:a}}}Ei(n,{preview_conf:o,stream_options:{audio:t},error:i.errorCode||0,message:i.extendedData||i.message}),e(i)},d.label=1;case 1:return d.trys.push([1,3,,4]),r={},(null===(c=this.Yr.camera)||void 0===c?void 0:c.audio)&&Yt(null===(h=this.Yr.camera)||void 0===h?void 0:h.audio)&&(r=sg({},Ql(null===(f=this.Yr.camera)||void 0===f?void 0:f.audio))),o=this._a("microphone",i),r=sg(sg(sg({},r),o),Ql(t)),u=sg({audio:!0,video:!1,audioInput:r.input},r),[4,this._createStream(u,"camera",1,s,s)];case 2:return d.sent(),this.zn.info("zcs.scm success"),[3,4];case 3:return a=d.sent(),s(a),this.zn.info("zcs.scm fail"),[3,4];case 4:return[2]}})})})},t.prototype.startCaptureCamera=function(t){var i=this;return void 0===t&&(t={}),new ni(function(e){return rg(i,void 0,void 0,function(){var i,n,s,r,o,u,a,c,h,f,l=this;return og(this,function(d){switch(d.label){case 0:this.zn.info("".concat(i="zcs.scc"," call ").concat(JSON.stringify(t))),n=this.ba(Nn),s=function(i){var s,r,o;if(l.ua&&!l.isPublish){var u=null===(s=l.ua)||void 0===s?void 0:s.mediaStreamConfig,a=null===(r=l.ua)||void 0===r?void 0:r.videoInfo,c=a.contentHint;o={video:{input:u.videoInput,w:a.width,h:a.height,fps:a.frameRate,bps:1e3*a.bitRate,keyFrameInterval:a.keyFrameInterval,optimizationMode:c||void 0,facingMode:u.facingMode}}}Ei(n,{preview_conf:o,stream_options:{video:t},error:i.errorCode||0,message:i.extendedData||i.message}),e(i)},d.label=1;case 1:return d.trys.push([1,3,,4]),r={},(null===(c=this.Yr.camera)||void 0===c?void 0:c.video)&&Yt(null===(h=this.Yr.camera)||void 0===h?void 0:h.video)&&(r=sg({},Ql(null===(f=this.Yr.camera)||void 0===f?void 0:f.video))),o=this._a("camera",i),r=sg(sg(sg({},r),o),Ql(t)),u=sg({audio:!1,video:!0,videoInput:r.input,videoQuality:r.quality,videoOptimizationMode:r.optimizationMode},r),[4,this._createStream(u,"camera",0,s,s)];case 2:return d.sent(),this.zn.info("zcs.scc success"),[3,4];case 3:return a=d.sent(),s(a),this.zn.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 ni(function(n){return rg(e,void 0,void 0,function(){var e,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b=this;return og(this,function(_){switch(_.label){case 0:this.zn.info("".concat(e="zcs.sccm"," call c:").concat(JSON.stringify(t),", m:").concat(JSON.stringify(i))),s=this.ba(Cn),r=function(e){var r,o,u;if(b.ua&&!b.isPublish){var a=null===(r=b.ua)||void 0===r?void 0:r.mediaStreamConfig,c=null===(o=b.ua)||void 0===o?void 0:o.videoInfo,h=c.contentHint;u={video:{input:a.videoInput,w:c.width,h:c.height,fps:c.frameRate,bps:1e3*c.bitRate,keyFrameInterval:c.keyFrameInterval,optimizationMode:h||void 0,facingMode:a.facingMode},audio:{input:a.audioInput,ANS:a.ANS,AEC:a.AEC,AGC:a.AGC,bps:c.audioBitrate,channelCount:a.channelCount}}}Ei(s,{preview_conf:u,stream_options:{video:t,audio:i},error:e.errorCode||0,message:e.extendedData||e.message}),n(e)},_.label=1;case 1:return _.trys.push([1,3,,4]),o={},(null===(l=this.Yr.camera)||void 0===l?void 0:l.video)&&Yt(null===(d=this.Yr.camera)||void 0===d?void 0:d.video)&&(o=sg({},Ql(null===(v=this.Yr.camera)||void 0===v?void 0:v.video))),u=this._a("camera",e),o=sg(sg(sg({},o),u),Ql(t)),a={},(null===(m=this.Yr.camera)||void 0===m?void 0:m.audio)&&Yt(null===(p=this.Yr.camera)||void 0===p?void 0:p.audio)&&(a=sg({},Ql(null===(g=this.Yr.camera)||void 0===g?void 0:g.audio))),c=this._a("microphone",e),a=sg(sg(sg({},a),c),Ql(i)),h=sg(sg(sg({audio:!0,video:!0,videoInput:null==o?void 0:o.input,videoQuality:null==o?void 0:o.quality,videoOptimizationMode:null==o?void 0:o.optimizationMode},o),{audioInput:null==a?void 0:a.input}),a),[4,this._createStream(h,"camera",2,r,r)];case 2:return _.sent(),this.zn.info("zcs.sccm success"),[3,4];case 3:return f=_.sent(),r(f),this.zn.info("zcs.sccm fail"),[3,4];case 4:return[2]}})})})},t.prototype.autoCapture=function(){var t=this;return new ni(function(i,e){return rg(t,void 0,void 0,function(){var t,n,s,r,o,u,a,c,h,f,l,d;return og(this,function(v){switch(v.label){case 0:this.zn.info("zcs.ac call"),v.label=1;case 1:return v.trys.push([1,23,,24]),r=(n=this.Yr).custom,o=n.screen,(s=n.camera)?(this.zn.info("zcs.ac camera:".concat(JSON.stringify(s))),l=s.video,(f=s.audio)&&l?(u=Yt(l)?l:void 0,a=Yt(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.va(f,this.startCaptureMicrophone)]:[3,5];case 4:return t=v.sent(),[3,7];case 5:return l?[4,this.va(l,this.startCaptureCamera)]:[3,7];case 6:t=v.sent(),v.label=7;case 7:return[3,22];case 8:return o?(this.zn.info("zcs.ac screen:".concat(JSON.stringify(o))),l=o.video,(f=o.audio)?(c=l,h=f,Gt(l)&&(c={}),Gt(f)&&(h={}),[4,this.startCaptureScreenWithAudio(c,h)]):[3,10]):[3,13];case 9:return t=v.sent(),[3,12];case 10:return[4,this.va(l,this.startCaptureScreen)];case 11:t=v.sent(),v.label=12;case 12:return[3,22];case 13:return r?(this.zn.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.va(f,this.startCaptureCustomAudio)]:[3,17];case 16:t=v.sent(),v.label=17;case 17:return l?[4,this.va(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:ae.code,extendedData:ae.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 ni(function(e){return rg(i,void 0,void 0,function(){var i,n,s,r,o,u,a,c=this;return og(this,function(h){switch(h.label){case 0:if(this.zn.info("".concat(i="zcs.scca"," call ").concat(JSON.stringify(t))),n=this.ba(zn),s=function(i){var s,r,o;c.ua&&!c.isPublish&&(o={audio:{bps:(null===(s=c.ua)||void 0===s?void 0:s.videoInfo).audioBitrate,channelCount:null===(r=c.ua)||void 0===r?void 0:r.mediaStreamConfig.channelCount}});Ei(n,{preview_conf:o,stream_options:{audio:c.ya(t)},error:i.errorCode||0,message:i.extendedData||i.message}),e(i)},(r=this.wa(t)).errorCode)return s(r),[2];h.label=1;case 1:return h.trys.push([1,3,,4]),o=this._a("customAudio",i),[4,this._createStream(sg(sg(sg(sg({},Ql(null===(a=this.Yr.custom)||void 0===a?void 0:a.audio)),o),Ql(t)),{audio:!0}),"custom",1,s,s)];case 2:return h.sent(),this.zn.info("".concat(i," success")),[3,4];case 3:return u=h.sent(),s(u),this.zn.info("".concat(i," fail")),[3,4];case 4:return[2]}})})})},t.prototype.startCaptureCustomVideo=function(t){var i=this;return new ni(function(e){return rg(i,void 0,void 0,function(){var i,n,s,r,o,u,a,c,h=this;return og(this,function(f){switch(f.label){case 0:if(this.zn.info("".concat(i="zcs.sccv"," call ").concat(JSON.stringify(t))),n=this.ba(Dn),s=function(i){var s,r;if(h.ua&&!h.isPublish){var o=null===(s=h.ua)||void 0===s?void 0:s.videoInfo,u=o.contentHint;r={video:{bps:1e3*o.bitRate,keyFrameInterval:o.keyFrameInterval,optimizationMode:u||void 0}}}Ei(n,{preview_conf:r,stream_options:{video:h.ya(t)},error:i.errorCode||0,message:i.extendedData||i.message}),e(i)},(r=this.wa(t)).errorCode)return s(r),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),o=this._a("customVideo",i),u=Object.assign({},Ql(null===(c=this.Yr.custom)||void 0===c?void 0:c.video),o,Ql(t)),[4,this._createStream(sg({videoOptimizationMode:u.optimizationMode},u),"custom",0,s,s)];case 2:return f.sent(),this.zn.info("".concat(i," success")),[3,4];case 3:return a=f.sent(),s(a),this.zn.info("".concat(i," fail")),[3,4];case 4:return[2]}})})})},t.prototype.startCaptureCustomVideoAndAudio=function(t,i){var e=this;return new ni(function(n){return rg(e,void 0,void 0,function(){var e,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y=this;return og(this,function(w){switch(w.label){case 0:if(this.zn.info("".concat(e="zcs.sccva"," call v:").concat(JSON.stringify(t)," a:").concat(JSON.stringify(i))),s=this.ba(An),r=function(e){var r,o,u;if(y.ua&&!y.isPublish){var a=(null===(r=y.ua)||void 0===r?void 0:r.mediaStreamConfig).channelCount,c=null===(o=y.ua)||void 0===o?void 0:o.videoInfo,h=c.contentHint;u={video:{bps:1e3*c.bitRate,keyFrameInterval:c.keyFrameInterval,optimizationMode:h||void 0},audio:{bps:c.audioBitrate,channelCount:a}}}Ei(s,{preview_conf:u,stream_options:{video:y.ya(t),audio:y.ya(i)},error:e.errorCode||0,message:e.extendedData||e.message}),n(e)},(o=this.wa(t)).errorCode)return r(o),[2];if((u=this.wa(i)).errorCode)return r(u),[2];w.label=1;case 1:return w.trys.push([1,7,,8]),a=this._a("customAudio",e),c=this._a("customVideo",e),t.source!=i.source?[3,3]:[4,this._createStream(sg(sg(sg(sg(sg(sg(sg({videoOptimizationMode:t.optimizationMode||c.optimizationMode||(null===(d=null===(l=this.Yr.custom)||void 0===l?void 0:l.video)||void 0===d?void 0:d.optimizationMode)},Ql(null===(v=this.Yr.custom)||void 0===v?void 0:v.video)),Ql(null===(m=this.Yr.custom)||void 0===m?void 0:m.audio)),c),a),Ql(t)),Ql(i)),{audio:!0}),"custom",2,r,r)];case 2:return w.sent(),[3,6];case 3:return h={video:!1,audio:!1},[4,this._createStream(sg(sg(sg(sg({videoOptimizationMode:t.optimizationMode||c.optimizationMode||(null===(g=null===(p=this.Yr.custom)||void 0===p?void 0:p.video)||void 0===g?void 0:g.optimizationMode)},null===(b=this.Yr.custom)||void 0===b?void 0:b.video),c),t),{video:!0}),"custom",0,function(t){h.video=!0,h.audio&&r(t)},r)];case 4:return w.sent(),[4,this._createStream(sg(sg(sg(sg({},null===(_=this.Yr.custom)||void 0===_?void 0:_.audio),a),i),{audio:!0}),"custom",1,function(t){h.audio=!0,h.video&&r(t)},r)];case 5:w.sent(),w.label=6;case 6:return this.zn.info("zcs.sccva success"),[3,8];case 7:return f=w.sent(),r(f),this.zn.info("zcs.sccva fail"),[3,8];case 8:return[2]}})})})},t.prototype.startCaptureScreen=function(t){var i=this;return void 0===t&&(t={}),new ni(function(e,n){return rg(i,void 0,void 0,function(){var i,n,s,r,o,u,a,c,h,f,l=this;return og(this,function(d){switch(d.label){case 0:this.zn.info("".concat(i="zcs.scs"," call ").concat(JSON.stringify(t))),n=this.ba(Pn),s=function(i){var s,r;if(l.ua&&!l.isPublish){var o=null===(s=l.ua)||void 0===s?void 0:s.videoInfo,u=o.contentHint;r={video:{w:o.width,h:o.height,fps:o.frameRate,bps:1e3*o.bitRate,keyFrameInterval:o.keyFrameInterval,optimizationMode:u||void 0}}}Ei(n,{preview_conf:r,stream_options:{video:iu(t||{},["captureElement"])},error:i.errorCode||0,message:i.extendedData||i.message}),e(i)},d.label=1;case 1:return d.trys.push([1,3,,4]),r={},(null===(c=this.Yr.screen)||void 0===c?void 0:c.video)&&Yt(null===(h=this.Yr.screen)||void 0===h?void 0:h.video)&&(r=sg({},Ql(null===(f=this.Yr.screen)||void 0===f?void 0:f.video))),o=this._a("screenVideo",i),r=sg(sg(sg({},r),o),Ql(t)),u=sg(sg({videoOptimizationMode:r.optimizationMode,videoQuality:r.quality},r),{audio:!1}),[4,this._createStream(u,"screen",0,s,s)];case 2:return d.sent(),this.zn.info("".concat(i," success")),[3,4];case 3:return a=d.sent(),s(a),this.zn.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 ni(function(n,s){return rg(e,void 0,void 0,function(){var e,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b=this;return og(this,function(_){switch(_.label){case 0:this.zn.info("".concat(e="zcs.scs"," call v:").concat(JSON.stringify(t)," a:").concat(JSON.stringify(i))),s=this.ba(Mn),r=function(e){var r,o,u;if(b.ua&&!b.isPublish){var a=null===(r=b.ua)||void 0===r?void 0:r.mediaStreamConfig,c=null===(o=b.ua)||void 0===o?void 0:o.videoInfo,h=c.contentHint;u={video:{w:c.width,h:c.height,fps:c.frameRate,bps:1e3*c.bitRate,keyFrameInterval:c.keyFrameInterval,optimizationMode:h||void 0},audio:{ANS:a.ANS,AEC:a.AEC,AGC:a.AGC,bps:c.audioBitrate,channelCount:a.channelCount}}}Ei(s,{preview_conf:u,stream_options:{video:iu(t||{},["captureElement"]),audio:i},error:e.errorCode||0,message:e.extendedData||e.message}),n(e)},_.label=1;case 1:return _.trys.push([1,3,,4]),o={},(null===(l=this.Yr.screen)||void 0===l?void 0:l.video)&&Yt(null===(d=this.Yr.screen)||void 0===d?void 0:d.video)&&(o=sg({},Ql(null===(v=this.Yr.screen)||void 0===v?void 0:v.video))),u=this._a("screenVideo",e),o=sg(sg(sg({},o),u),Ql(t)),a={},(null===(m=this.Yr.screen)||void 0===m?void 0:m.audio)&&Yt(null===(p=this.Yr.screen)||void 0===p?void 0:p.audio)&&(a=sg({},Ql(null===(g=this.Yr.screen)||void 0===g?void 0:g.audio))),c=this._a("screenAudio",e),a=sg(sg(sg({},a),c),Ql(i)),h=sg(sg(sg({videoOptimizationMode:o.optimizationMode,videoQuality:o.quality},o),a),{audio:!0}),[4,this._createStream(h,"screen",2,r,r)];case 2:return _.sent(),this.zn.info("zcs.scs success"),[3,4];case 3:return f=_.sent(),r(f),this.zn.info("zcs.scs fail"),[3,4];case 4:return[2]}})})})},t.prototype.stopCaptureAudio=function(){var t=this;return new ni(function(i){var e,n,s=!0;if(t.originAudioStream){t.zn.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.zn.info("zcs.sca stop audio"),s="camera"===(null===(n=t.ua)||void 0===n?void 0:n.audioPreviewType)?t.ua.enableMicrophoneOnly(!1):t.la.enableMicrophone(t.stream,!0),t.ua&&(t.ua.syncAudioEnabled=!1)),t.zn.info("zcs.sca stop result:"+s),s&&(r.stop(),t.originAudioStream=null,t.stopPlayCaptureAudio(),t.da())}i(s)})},t.prototype.stopCaptureVideo=function(){var t;return rg(this,void 0,void 0,function(){var i,e,n,s,r=this;return og(this,function(o){switch(o.label){case 0:if(i=!0,this.zn.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.ua?(this.zn.info("zcs.scv stop stream video"),"camera"!=this.ua.videoPreviewType?[3,3]:[4,this.la.enableCameraCapturing(this.ua,!1)]):[3,5]:[3,5];case 2:return i=o.sent(),[3,5];case 3:return[4,this.ua.stopCaptureVideo()];case 4:o.sent(),i=!0,o.label=5;case 5:return this.zn.info("zcs.scv stop result:"+i),i&&(this.Uo.trackUtils.stopTrack(e),this.originVideoStream=null,this.stopPlayCaptureVideo(),this.ia.forEach(function(t){return r.$u.destroyStream(t)}),this.ia=[],this.da()),[3,7];case 6:return s=o.sent(),this.zn.error("zcs.scv "+JSON.stringify(s)),i=!1,[3,7];case 7:return[2,i]}})})},t.prototype.Sa=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 Lm(t,e,{clearLastFrame:this.Dn.engineConfig.previewClearLastFrame}):(null==e?void 0:e.getViewer())||null},t.prototype.Ea=function(){var t,i,e;this.oa=this.Sa(this.stream),null===(t=this.oa)||void 0===t||t.on("canPlayAudio",this.Xr.canPlayAudio),null===(i=this.oa)||void 0===i||i.on("canPlayVideo",this.Xr.canPlayVideo),null===(e=this.oa)||void 0===e||e.on("autoplayFailed",this.Xr.autoplayFailed)},t.prototype.playAudio=function(t){var i;if(this.zn.info("zcs.pa call"),!this.stream)return this.zn.warn("zcs.pa You need to capture the audio stream first");this.oa||this.Ea(),null===(i=this.oa)||void 0===i||i.playAudio(t,!0),this.audioMuted=!1},t.prototype.playCaptureAudio=function(t){var i,e,n;if(this.zn.info("zcs.pca call"),!this.originAudioStream)return this.zn.warn("zcs.pca You need to capture the audio stream first");this.sa||(this.sa=this.Sa(this.originAudioStream),null===(i=this.sa)||void 0===i||i.on("canPlayAudio",this.Xr.canPlayCaptureAudio),null===(e=this.sa)||void 0===e||e.on("autoplayFailed",this.Xr.autoplayCaptureFailed)),this.audioCaptureMuted=!1,null===(n=this.sa)||void 0===n||n.playAudio(t,!0)},t.prototype.playVideo=function(t,i){var e;if(this.zn.info("zcs.pv call"),this.stream){if(this.oa&&this.oa.inited||(this.Ea(),null===(e=this.oa)||void 0===e||e.setAudioMuted(this.audioMuted)),this.oa){var n=t||this.view;n&&$t(n)?(this.oa.playVideo(n,i),this.ea=!0):this.zn.error("zcs.pv Execute `playVideo` failed, container not exist")}}else this.zn.warn("zcs.pv You need to capture the video stream first")},t.prototype.playCaptureVideo=function(t,i){this.zn.info("zcs.pcv call");var e=this.ra[0]||null;if(this.originVideoStream){if(!e||this.Yr.multiplacePreview){if(!(e=this.Sa(this.originVideoStream,e&&this.Yr.multiplacePreview)))return;e.on("canPlayVideo",this.Xr.canPlayCaptureVideo),e.on("autoplayFailed",this.Xr.autoplayCaptureFailed),this.ra.push(e)}var n=t||this.Yr.captureView;n&&$t(n)?(e.playVideo(n,i),this.na=!0):this.zn.error("zcs.pcv Execute `playVideo` failed, container not exist")}else this.zn.warn("zcs.pv You need to capture the video stream first")},t.prototype.updatePlayVideo=function(){this.oa&&this.stream?this.oa.setVideo(this.stream.getVideoTracks()[0]):this.autoPlay&&this.playVideo()},t.prototype.updatePlayAudio=function(){this.oa&&this.stream&&this.oa.setAudio(this.stream.getAudioTracks()[0])},t.prototype.takeStreamSnapshot=function(t){var i;return(null===(i=this.oa)||void 0===i?void 0:i.takeStreamSnapshot(t))||""},t.prototype.resumeVideo=function(){var t;return null===(t=this.oa)||void 0===t?void 0:t.resume(!0,["video"])},t.prototype.resumeAudio=function(){var t;return null===(t=this.oa)||void 0===t?void 0:t.resume(!0,["audio"])},t.prototype.stopVideo=function(){var t;null===(t=this.oa)||void 0===t||t.stopVideo(),this.ea=!1},t.prototype.stopAudio=function(){this.oa&&(this.oa.stopAudio(),this.audioMuted=!0)},t.prototype.stopPlayCaptureVideo=function(){this.ra.forEach(function(t){t.stopVideo(),t.destroy()}),this.ra=[],this.na=!1},t.prototype.stopPlayCaptureAudio=function(){this.sa&&(this.sa.destroy(),this.sa=null,this.audioCaptureMuted=!0)},t.prototype.setVolume=function(t){return!!this.oa&&this.oa.setVolume(t)},t.prototype.setAudioOutputDevice=function(t){if(this.oa)return this.oa.useAudioOut(t)},t.prototype._destroyCacheStream=function(t){var i=this;return t.filter(function(t){return!!t.active||(i.$u.destroyStream(t),!1)})},t.prototype.da=function(){this.ta=this._destroyCacheStream(this.ta),this.ia=this._destroyCacheStream(this.ia)},t.prototype._a=function(t,i){var e=this.stream&&this.checkPreview(this.stream);if(!this.stream||!e)return this.zn.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&&Ql(n)}return n},t.prototype.wa=function(t){return(null==t?void 0:t.source)&&(ti(null==t?void 0:t.source)||Kt(null==t?void 0:t.source))?{errorCode:0,extendedData:""}:{errorCode:Ki.code,extendedData:Ki.message+" source not exist or error"}},t.prototype.ba=function(t){var i=Si(this.Ln,a.H,"",t,Rn);return i.setAttributes({local_stream_id:this.id}),i},t.prototype.ya=function(t){return sg(sg({},t),{source:void 0,source_type:(null==t?void 0:t.source)?ti(null==t?void 0:t.source)?"Element":"MediaStream":void 0})},t.prototype.destroy=function(){var t,i=this;this.originAudioStream&&(this.originAudioStream=null),this.originVideoStream&&(this.originVideoStream=null),this.stream&&(this.$u.destroyStream(this.stream),this.stream=null),this.ta.forEach(function(t){return i.$u.destroyStream(t)}),this.ia.forEach(function(t){return i.$u.destroyStream(t)}),this.ta=[],this.ia=[],this.stopPlayCaptureVideo(),this.stopPlayCaptureAudio(),this.stopVideo(),this.stopAudio(),null===(t=this.oa)||void 0===t||t.destroy(),this.oa=null,this.ru=new Tm},t}(),cg="zsc.rd.qd",hg=function(){function t(t,i,e){this.zn=t,this.Dn=i,this.Uo=e,this.Oa=2e3,this.lastRecordDeviceTime=0}return t.prototype.getDetectionStreams=function(){var t=[];return this.Uo.previewStreamList.forEach(function(i){i.localStream&&t.push(i.localStream)}),t},t.prototype.Ta=function(t){this.zn.warn(cg+" DeviceError: ".concat(ze," ").concat(De)),this.Dn.actionListener("_deviceError",ze,t,"micro"),this.Dn.actionListener("deviceError",ze,t)},t.prototype.ka=function(t){if(this.zn.info(cg+" get name of device id: ".concat(JSON.stringify(t))),!t.deviceID&&!this.Ra&&""==t.trackLabel)return"unknown";if(!t.deviceID||"default"===t.deviceID)return t.trackLabel;for(var i in this.Ra){var e=this.Ra[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.Ia=function(t){this.zn.warn(cg+" DeviceError: ".concat(Ae," ").concat(Pe)),this.Dn.actionListener("_deviceError",Ae,t,"camera"),this.Dn.actionListener("deviceError",Ae,t)},t.prototype.Na=function(t){this.Ra=t},t.prototype.Ca=function(t){return{trackID:t.id,trackLabel:t.label,readyState:t.readyState,deviceID:t.getSettings().deviceId}},t.prototype.za=function(t,i){return-1!==t.findIndex(function(t){return t.deviceName==i.deviceName&&t.preview==t.preview})},t.prototype.Da=function(t,i){if(t.audioTrack){var e=this.Ca(t.audioTrack),n=performance.now()-t.lastTrackEndTime.audio;if("ended"==e.readyState&&n<this.Oa){this.zn.warn(cg+" mic device may loose.");var s={deviceName:this.ka(e),preview:t};this.za(i,s)||i.push(s)}}},t.prototype.Aa=function(t,i){if(t.videoTrack){var e=this.Ca(t.videoTrack),n=performance.now()-t.lastTrackEndTime.video;if("ended"==e.readyState&&n<this.Oa){this.zn.warn(cg+" camera device may loose.");var s={deviceName:this.ka(e),preview:t};this.za(i,s)||i.push(s)}}},t.prototype.Pa=function(t,i,e){var n=this.Uo.getPreviewer(t);n&&(this.Da(n,i),this.Aa(n,e))},t.prototype.isRecordQuickly=function(){return performance.now()-this.lastRecordDeviceTime<this.Oa},t.prototype.onDeviceNoChangeQuickly=function(t){var i=this;if(this.isRecordQuickly())this.zn.info(cg+" device no change because record device quickly");else{this.zn.info(cg+" device no change quickly"),this.Na(t);var e=[],n=[];this.getDetectionStreams().forEach(function(t){i.Pa(t,e,n)}),e.forEach(function(t){i.Ta(t.deviceName),t.preview.updatePublisherStreamMicStatus(!1,2)}),n.forEach(function(t){i.Ia(t.deviceName),t.preview.updatePublisherStreamCameraStatus(!1,2)})}},t}(),fg=function(){return fg=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},fg.apply(this,arguments)},lg=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())})},dg=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])}}},vg=function(){function t(t,i,e){this.zn=t,this.Uo=i,this.Dn=e}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.prototype.Ma=function(t,i,e,n,s){return lg(this,void 0,void 0,function(){var r,o,u,a,c,h,f,l,d,v,m,p,g=this;return dg(this,function(b){switch(b.label){case 0:return r=this.Uo.checkPreview(i),o="audio"===t,r?!!r.zegoCaptureStream&&"video"===t&&"camera"!==r.previewType?(this.zn.error("zsc.sd.0 stream type cannot set device"),n&&n({errorCode:ie.code,extendedData:ie.message}),[2]):"video"===t&&0==r.mediaStreamConfig.video?(this.zn.error("zsc.sd.0 camera can not be changed when video is false"),n&&n({errorCode:Ke.code,extendedData:Ke.message}),[2]):o&&0==r.mediaStreamConfig.audio?(this.zn.error("zsc.sd.0 microphone can not be changed when audio is false"),n&&n({errorCode:$e.code,extendedData:$e.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=bh(),h=_h()&&ph().indexOf("HuaweiBrowser")>-1,this.Dn.engineConfig.stopTrackWhenSwitchDevice||(null==s?void 0:s.stopTrack)||Eh()||kh()&&c&&ph().indexOf("Oriole 64-bit")>-1||h||_h()&&null!==ph().match(/ArkWeb/i)?(this.zn.info("zsc.sd.0 stop "),this.Uo.trackUtils.stopTrack(a),c&&Eh()?[4,new Promise(function(t){setTimeout(function(){t(void 0)},100)})]:[3,2]):[3,2]):(this.zn.error("zsc.sd.0 preview no found"),n&&n({errorCode:re.code,extendedData:re.message}),[2]);case 1:b.sent(),b.label=2;case 2:return f=fg(fg({},r.mediaStreamConfig),u),o&&"default"===e&&(this.zn.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.Uo.trackUtils.stopTrack(t)});var u=g.Uo.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.Uo.trackUtils.stopTrack(o),r.updateZegoStreamCaptureTrack(e)}}),r.restartSoundLevel()},o?l.video=!1:l.audio=!1,this.zn.info("zsc.sd.0 mediaStreamConstraints "+JSON.stringify(l)),v=Ke,"audio"===t&&(v=$e),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.Uo.trackUtils.stopTrack("video"==t?r.videoTrack:r.audioTrack),g.zn.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.zn.info("zsc.sd.0 swtich "+t+" device success"),n&&n({errorCode:0,extendedData:""})},function(i){g.zn.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.zn.info("zsc.sd.0 recover last "+t+" device success"),n&&n({errorCode:v.code,extendedData:v.message+" "+JSON.stringify(i)})},function(i){g.zn.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.zn.error("zsc.sd.0 switch"+t+" device fail, has track ended."),Object.assign(r.mediaStreamConfig,u),d(0,i),g.zn.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 lg(this,void 0,void 0,function(){var g,b,_,y,w,S,E,O,T,k,R,I,N,C,z,D,A,P,M,x,j,L,q,U,B=this;return dg(this,function(J){switch(J.label){case 0:if(this.zn.info((g="zsc.spsc.0 video")+" constraints "+JSON.stringify(i)),!(b=this.Uo.checkPreview(t)))return this.zn.error(g+" preview no found"),n&&n({errorCode:re.code,extendedData:re.message}),[2];if(!(_=b.videoTrack))return this.zn.error(g+" video track not found"),n&&n({errorCode:Ze,extendedData:Qe}),[2];if(y=b.videoPreviewType||b.previewType,i.video=b.mediaStreamConfig.video,i.videoQuality||(i.videoQuality=4,i.quality=4),i=Ql(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.Uo.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.Uo.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.zn.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.zn.info(g+" resolution diff with track settings"),I=!0)),this.zn.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:Yr.video_conf(C)}),z=this.Uo.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),A=I||D,!(y&&["camera","screen"].includes(y)&&A))return[3,5];J.label=1;case 1:return J.trys.push([1,3,,4]),this.zn.info(g+" track change "),[4,_.applyConstraints(fg(fg({},R.video),{deviceId:void 0}))];case 2:return J.sent(),[3,4];case 3:return P=J.sent(),n&&n({errorCode:We,extendedData:"".concat(P.name," ").concat(P.constraint?"constraint:"+P.constraint:"")}),[2];case 4:(M=this.Uo.getPreviewer(t))&&R.video instanceof Object&&M.setVideoInfo({width:(x=R.video).width,height:x.height,frameRate:x.frameRate}),I&&"safari"===this.Dn.browser&&(null===(f=b.videoNodeQueue)||void 0===f||f.replaceNewSourceByTrack(_,void 0,{handleTrackType:ht.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,Qr,{w:Xr(null==n?void 0:n.width),h:Wr(null==n?void 0:n.height)}),(null==w?void 0:w.frameRate)!==(null==n?void 0:n.frameRate)&&B.enVideoSpan(t.streamID,to,{fps:io(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,!(Vt(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,Kr,{bitrate:$r(1e3*j)}),J.label=8;case 8:return q++,[3,6];case 9:return this.zn.info(g+" set constraints success "),n&&n({errorCode:0,extendedData:""}),[2]}})})},t.prototype.setPublishStreamAudioConstraints=function(t,i,e,n){return lg(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 dg(this,function(E){switch(E.label){case 0:if(this.zn.info((s="zsc.spsc.0 audio")+" constraints "+JSON.stringify(i)),!(r=this.Uo.checkPreview(t)))return this.zn.error(s+" preview no found"),n&&n({errorCode:re.code,extendedData:re.message}),[2];if(!(o=r.audioTrack)||r.hasEmptyAudioTrack)return this.zn.error(s+" audio track not found"),n&&n({errorCode:Ze,extendedData:Qe}),[2];i.audio=r.mediaStreamConfig.audio,i=Ql(i),u=r.audioPreviewType||r.previewType,a=JSON.parse(JSON.stringify(r.mediaStreamConfig)),c=Object.assign(r.mediaStreamConfig,i),"screen"==u?h=this.Uo.getScreenConstrains(c):(f=r.getMediaStreamConstraints(c,!0).mediaStreamConstraints,h=f),this.zn.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.Uo.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.Uo.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.zn.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.zn.info(s+" oldMediaStreamConstraints "+JSON.stringify(b)),[4,navigator.mediaDevices.getUserMedia({video:!1,audio:b.audio}).catch(function(t){S.zn.error(s+".1 setbackup fail "+t.name)})];case 4:return(_=E.sent())&&(_.getTracks().forEach(function(t){tu(t,S.zn,s+".1")}),y=t.getVideoTracks()[0],this.Uo.trackUtils.stopTrack(y),w=_.getAudioTracks()[0],r.replacePreviewTrack(w),r.updateZegoStreamCaptureTrack(w),r.destNode||r.onAudioTrackChange(w)),this.zn.info(s+".1 setbackup suc "),n&&n({errorCode:We,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 lg(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,A=this;return dg(this,function(P){switch(P.label){case 0:if(ui(this.zn,bm,". 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:""},!Kt(i))return this.zn.error(bm+" stream wrong"),s({errorCode:xi.code,extendedData:xi.message}),[2];if(!(e instanceof MediaStreamTrack))return this.zn.error(bm+" parameter 2 type error"),s({errorCode:xi.code,extendedData:xi.message}),[2];if(!(f=this.Uo.checkPreview(i)))return this.zn.error(bm+" stream no found"),s&&s({errorCode:re.code,extendedData:re.message}),[2];if("video"===e.kind){if(null===(r=f.videoEffect)||void 0===r?void 0:r.enabled)return this.zn.error(bm+" need to disable video beauty effect first"),s&&s({errorCode:un,extendedData:"need to disable video beauty effect before add or remove track"}),[2];if(f.enableDualStream)return this.zn.error(bm+" "+(l=" can not add/remove track while dual stream enabled.")),s&&s({errorCode:un,extendedData:l}),[2];if(f.isBackgroundBlur)return this.zn.error(bm+" need to disable background process first"),s&&s({errorCode:an,extendedData:"need to disable video background process before add or remove track"}),[2]}return f.streamFromCanvas&&"video"===e.kind?(this.zn.error(bm+" browser not support"),s&&s({errorCode:rn,extendedData:on}),[2]):(d="audio"===e.kind&&this.Dn.engineConfig.keepAudioTrack&&f.hasEmptyAudioTrack,v=i.getTracks().length>=2||i.getTracks().find(function(t){return t.kind==e.kind}),c&&v&&!d?(this.zn.error(bm+" only stream which have one track and kind no exist can add track"),s&&s({errorCode:tn,extendedData:en}),[2]):"REMOVE"==t&&(i.getTracks().length<=1||"video"===e.kind&&f.hasEmptyAudioTrack||!i.getTracks().find(function(t){return t.kind===e.kind}))?(this.zn.error(bm+" can not remove track"),s({errorCode:rn,extendedData:on}),[2]):!(m=this.Uo.checkPublish(i))||m.publisher.supportTransceiver||5===m.publisher.stateNego&&1!=m.publisher.isUpdateSDP?(p=function(t){var i=A.Uo.previewStreamList.find(function(i){return i.originVideoTrack===t||i.originAudioTrack===t});if(i=i||A.Uo.previewStreamList.find(function(i){return i.localStream.getTracks().find(function(i){return i==t})}),i)return A.zn.info(bm+" video info: ".concat(JSON.stringify(i.videoInfo))),i;A.zn.warn(bm+" ".concat(t.kind," track is not created by sdk"))},this.Dn.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.zn.info(bm+" 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.zn.info(bm+" support transceiver"):S.isUpdateSDP=!0,S.sideMediaConfig.isSEIStart&&"video"===e.kind?(this.zn.info(bm+" replace sei blank track."),O=void 0,c?[4,S.replacePublishedTrack(e,!1,{handleTrack:t})]:[3,2]):[3,5]):(this.zn.error(bm+" pc has not created."),[2])):[3,15])):(this.zn.error(bm+" publish state wrong. "+"".concat(m.publisher.stateNego)),s&&s({errorCode:nn,extendedData:sn}),[2]));case 1:return O=P.sent(),S.handleSEIVideoTrack("add"),[3,4];case 2:return S.handleSEIVideoTrack("remove"),[4,S.replacePublishedTrack(S.sideMediaConfig.track,!1,{handleTrack:t})];case 3:O=P.sent(),P.label=4;case 4:return 0===(null==O?void 0:O.errorCode)||this.zn.warn(bm+" 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.zn.info(bm+" add audio track. ")):(i.removeTrack(e),_[y]=null,b&&b.setTrack(!1,null),(k=S.audioSender)&&k.replaceTrack(null),this.zn.info(bm+" remove audio track. ")),this.zn.info(bm+" 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 P.sent(),this.zn.info(bm+" sender replace track "+R.kind),[3,9];case 8:E.addTrack(R,i),this.zn.info(bm+" pc add track "+R.kind),P.label=9;case 9:return[3,11];case 10:if(!k)return this.zn.error(bm+" sender no found"),s&&s({errorCode:Ze,extendedData:Qe}),[2];try{k.replaceTrack(null),this.zn.info(bm+" sender replace null.")}catch(t){this.zn.error(bm+" "+t),s&&s({errorCode:cn,extendedData:hn+" "+t})}P.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"===A.Dn.browser),"video"==e.kind&&1==e.enabled?S.sendStreamStatus(0,S.mic_status,!0):1==e.enabled&&S.sendStreamStatus(S.camera_status,0,!0),A.zn.info(bm+" 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),A.zn.info(bm+" remove track completely")),f.mediaStreamConfig.video="ADD"==t},z=function(){return lg(A,void 0,void 0,function(){var t,i,e,r=this;return dg(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,fg(fg({},N),{bitRate:c?N.bitRate:50}),function(t){return lg(r,void 0,void 0,function(){return dg(this,function(i){return 0!==t?s&&s({errorCode:ce.code,extendedData:ce.message}):(C(),n(h),this.zn.info(bm+" end")),[2]})})}),[3,4];case 3:return e=o.sent(),this.zn.error(bm+" "+e),s&&s({errorCode:ne.code,extendedData:ne.message+" "+e}),[3,4];case 4:return[2]}})})},S.isUpdateSDP?(this.zn.info(bm+" need to update sdp"),[4,z()]):[3,13];case 12:return P.sent(),[3,14];case 13:this.zn.info(bm+" only update track"),C(),c&&"video"===e.kind&&N.bitRate&&S.setBitrate(N.bitRate),n(h),P.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.zn.info(bm+" end"),n(h),P.label=16;case 16:return[2]}})})},t.prototype.enVideoSpan=function(t,i,e){var n=this.Ln.createSpan(a.H,{key:jn.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.Uo.checkPreview(t),u=this.Uo.getPublishList(t,!1);if(!o)return this.zn.error("zc.rt.0 preview no found"),{errorCode:re.code,extendedData:re.message};if(o.streamFromCanvas&&"video"===i.kind&&!r)return this.zn.error("zc.rt.0 browser not support"),{errorCode:rn,extendedData:on};var a=t.getTracks().find(function(t){return t.kind===i.kind}),c="audio"===i.kind,h={errorCode:Ze,extendedData:Qe};if(!n&&!a)return this.zn.error("zc.rt.0 track no found"),h;if(!n&&c&&o.hasEmptyAudioTrack&&(this.zn.warn("zc.rt.0 replace empty audio track"),!this.Dn.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.zn.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.Uo.soundLevelDelegate&&c,y=s?{handleTrackType:ht.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,fg({isTrackProcessedFromOriginalStream:e},y))}),_&&o.startSoundLevel(),w}return _&&o.stopSoundLevel(),o.replacePreviewTrack(i,!1,fg({isTrackProcessedFromOriginalStream:e},y)),_&&o.startSoundLevel(),{errorCode:0,extendedData:""}},t.prototype.enableCamera=function(t,i,e){var n=this.Uo.checkPreview(t);return n?(n.enableCamera(i,this.Uo,e),!0):(this.zn.error("zsc.ec.0 "+yi),!1)},t.prototype.enableMicrophone=function(t,i){var e=this.Uo.checkPreview(t);return e?e.enableMicrophone(i):(this.zn.error("zsc.em.0 "+yi),!1)},t.prototype.enableMicrophoneOnly=function(t){ui(this.zn,cm);for(var i=0;i<this.Uo.previewStreamList.length;i++){if(!this.Uo.previewStreamList[i].enableMicrophoneOnly(t))return this.zn.error("".concat(cm,".0 previewer ").concat(i," change mic mute state failed")),!1;0}return this.Uo.isMicEnabled=t,!0},t.prototype.getBlackTrack=function(t,i){(t<120||i<90)&&(t=128,i=90);var e=oi(t,i),n=e.getContext("2d");return n&&(n.fillStyle="black"),null==n||n.fillRect(0,0,t,i),e.captureStream().getVideoTracks()[0]},t.prototype.enableCameraCapturing=function(t,i){var e;return lg(this,void 0,void 0,function(){var n,s,r,o,u,a,c,h,f,l,d=this;return dg(this,function(v){switch(v.label){case 0:return t.localStream?(n=this.Uo.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.zn.warn("zp.ecc camera is already capturing"),[3,12]):[3,13]):[2,!1];case 1:s=t.getMediaStreamConstraints(fg(fg({},t.mediaStreamConfig),{audio:!1})).mediaStreamConstraints,v.label=2;case 2:return v.trys.push([2,11,,12]),[4,navigator.mediaDevices.getUserMedia(s)];case 3:return(r=v.sent()).getTracks().forEach(function(t){return tu(t,d.zn,"zsc.ecc")}),(o=r.getVideoTracks()[0]).enabled=t.isVideoEnabled,!1===o.enabled&&this.zn.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,v.label=5;case 5:return u<n.length?("H265"===(a=n[u]).publishOption.videoCodec&&a.getVideoSenders().forEach(function(t){var i;null===(i=t.track)||void 0===i||i.stop()}),[4,a.replacePublishedTrack(o)]):[3,8];case 6:if(0!==(null==(c=v.sent())?void 0:c.errorCode))throw c;v.label=7;case 7:return u++,[3,5];case 8:return[3,10];case 9:t.replacePreviewTrack(o),v.label=10;case 10:return t.hasStopCaptureVideo=!1,t.updateZegoStreamCaptureTrack(o),[3,12];case 11:return h=v.sent(),this.zn.error("zsc.ecc resume camera capturing failed. "+JSON.stringify(h)),[2,!1];case 12:return[3,15];case 13:return n.length&&(f=null,n.forEach(function(i){var e;if("H265"===i.publishOption.videoCodec){if(!f){var n=null===(e=t.videoTrack)||void 0===e?void 0:e.getSettings();f=d.getBlackTrack(null==n?void 0:n.width,null==n?void 0:n.height)}f&&i.getVideoSenders().forEach(function(t){t.replaceTrack(f)})}})),[4,t.stopCaptureVideo()];case 14:v.sent(),n.length&&(l=t.muteImage&&!t.isVideoEnabled?0:bd(t.videoTrack),n.forEach(function(t){t.sendStreamStatus(l,t.mic_status)})),v.label=15;case 15:return[2,!0]}})})},t.prototype.activateSEIInsert=function(t,i,e){void 0===e&&(e=0);var n=this.Uo.checkPreview(t);return n?0!==i&&1!==i?(this.zn.error(hm+" value of “action” should be 0 or 1"),!1):(n.activateSEIConfig={action:i,infoType:e},this.Uo.getPublishList(t).map(function(t){return t.publisher}).forEach(function(t){t.activateSEIInsert(i,e)}),!0):(this.zn.error(hm+" stream is not created"),!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)},pg=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())})},gg=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])}}},bg=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))},_g=jn,yg=jn.event,wg=jn.error,Sg=Ln,Eg=Xn,Og=kn.error,Tg=Og.ie,kg=Og.ne,Rg=Og.ee,Ig=Ho();if(navigator.mediaDevices&&"setCaptureHandleConfig"in navigator.mediaDevices)try{navigator.mediaDevices.setCaptureHandleConfig({handle:Ig,exposeOrigin:!0,permittedOrigins:["*"]})}catch(t){}function Ng(t,i,e){var n={width:640,height:360},s={width:640,height:480},r={width:960,height:540},o=mg(mg({video:!0,videoQuality:4,frameRate:15,bitRate:500},n),{audioBitrate:48,channelCount:1});switch(t.scenario){case U.UNKNOWN:o={};break;case U.StandardVideoCall:break;case U.HighVideoCall:o.frameRate=25,o.bitRate=1500,o=mg(mg({},o),r);break;case U.StandardChatroom:o.video=!1,o.audioBitrate=24;break;case U.HighQualityChatroom:o.video=!1;break;case U.Karaoke:o.video=!1,o.audioBitrate=128,o.channelCount=2;break;case U.Broadcast:o.frameRate=20,o.bitRate=1200,(o=mg(mg({},o),r)).audioBitrate=64,o.channelCount=2;break;default:t.isFlutter?(o.bitRate=600,o=mg(mg({},o),n)):(o.bitRate=800,o=mg(mg({},o),s))}i.info("".concat(Od," scenario ").concat(t.scenario," ").concat(JSON.stringify(o)));var u=t.settingConfig.getCloudSettingScenario(t.scenario,!1,!0);return Object.assign(o,u||{},e||{})}var Cg,zg,Dg,Ag=function(){function t(t,i,e,n,s,r){var o=this;this.zn=t,this.dataReport=i,this.Dn=e,this.Uo=n,this.rtm=s,this.zegoWebRtc=r,this.xa=new hg(this.zn,this.Dn,this.Uo),this.ja=[],this.eventHandler={visibilitychange:function(){var t=!si.hidden;o.Dn.engineConfig.autoRecaptureOnShow&&t&&(o.zn.info("".concat("zc.hvc.0"," call ").concat(t)),o.ja.forEach(function(t){var i,e=ig(t,o.zn);null===(i=o.zegoWebRtc.rtcModules.publishModule.la)||void 0===i||i.Ma("video",e,"recapture",function(){})}))}},this.La=0,this.qa=0,this.Ua=0,this.Ba=Ri(function(t){var i=o.Ln.createSpan(a.H,{key:Sn},{key:""},xs.event);i.setAttributes({old_cap_volume:o.qa,cap_volume:t,change_duration:o.Ua}),i.end(),o.La=0},3e3),this.Ja=void 0,this.la=new vg(t,n,e),this.recordDevices(),this.Uo.checkDeviceChange=function(){o.Va(500)},this.handleVisibilityChange()}return Object.defineProperty(t.prototype,"publishStreamHandler",{get:function(){return this.la},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.prototype.handleVisibilityChange=function(){var t=ph();t.indexOf("OpenHarmony")>-1&&t.indexOf("HuaweiBrowser")>-1&&si.addEventListener("visibilitychange",this.eventHandler.visibilitychange)},t.prototype.createStream=function(t,i){var e=this;void 0===i&&(i=!1),this.zn.info(Od+" 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=mg({},o)),u&&(s=Gt(u)?u:mg({},u)),c&&(r=mg({},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++,Yt(s)&&s.bitrate&&(s.bitRate=s.bitrate),s=Zl(s)),r&&(h++,r.bitrate&&(r.bitRate=r.bitrate)),r=r&&Ql(r),n=n&&Ql(n),s=s&&Ql(s),h>1){var f="cannot set more than one type of source";throw this.zn.error(Od+" ".concat(f,". ").concat(JSON.stringify(t))),{code:xi.code,msg:f}}return new ni(function(o,u){var c,h=e.Ln.createSpan(a.H,{key:Sn},{key:""},kn.event),f={is_zego_stream:i?0:1};(null==t?void 0:t.camera)&&(f.scenario=e.Dn.scenario),h.setAttributes(f);var l=function(t){var i=e.Uo.checkPreview(t),s=e.getStreamByCanvas(t);i&&e.setEmptyAudioTrack(s,i),e.initCopyMusic(t),h.setAttributes({media_stream_id:kn.media_stream_id(null==t?void 0:t.id)}),h.end(),!e.Dn.deviceInfos&&e.recordDevices(),(n||null==n)&&e.ja.push(s),o(s),e.Uo.activeSoundLevel()},d=function(t,i){void 0===i&&(i=""),e.Ln.setError(h,t,i),u({code:t.code,msg:t.message+i})};if(!!!(null===(c=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===c?void 0:c.getUserMedia)&&"https:"!==window.location.protocol&&"file:"!==window.location.protocol&&-1==window.location.hostname.indexOf("127.0.0.1")&&-1==window.location.hostname.indexOf("localhost")){var v=" https or localhost required ";return e.zn.error(Od+v),void d({code:Og.te.code,message:Og.te.message+v})}var m=function(t){Xt(t)?d(t[0],t[1]):d(t)};r?e.Hu(r,h).then(l).catch(m):s?e.Ha(s,h,i).then(l).catch(m):(n||null==n)&&e.Gu(n||{},h,i).then(l).catch(m)})},t.prototype.Gu=function(t,i,e){return pg(this,void 0,void 0,function(){var n,s,r=this;return gg(this,function(o){if(!Ft(t.videoQuality)&&!mi(t.videoQuality))throw this.zn.error(Od+(n=" videoQuality must be integer number")),[Tg,n];if(!Ft(t.keyFrameInterval)&&!mi(t.keyFrameInterval))throw this.zn.error(Od+(n=" keyFrameInterval must be integer number")),[Tg,n];if(!Ft(t.videoOptimizationMode)&&!["default","motion","detail"].includes(t.videoOptimizationMode))throw this.zn.error(Od+(n=" video optimizationMode must be 'default', 'motion', 'detail'")),[Tg,n];if(!Ft(t.videoInput)&&!Zt(t.videoInput)&&!Ht(t.videoInput))throw this.zn.error(Od+(n=" video input must be string'")),[Tg,n];if(!Ft(t.audioInput)&&!Zt(t.audioInput)&&!Ht(t.audioInput))throw this.zn.error(Od+(n=" audio input must be string'")),[Tg,n];if(!Ft(t.facingMode)&&!Ht(t.facingMode))throw this.zn.error(Od+(n=" facingMode must be string'")),[Tg,n];if(t.audioBitrate){if(!mi(t.audioBitrate))throw this.zn.error(Od+(n=" audioBitrate must be integer number")),[Tg,n];if(t.audioBitrate<6||t.audioBitrate>510)throw n=" audio bitrate cannot exceed the range [6,510]. current value: ".concat(t.audioBitrate,"."),this.zn.error(Od+n),[Tg,n];this.Dn.audioBitRate=1e3*t.audioBitrate}if(t.bitRate){if(!Vt(t.bitRate))throw this.zn.error(Od+(n=" bitrate must be integer number")),[Tg,n];if(t.bitRate>10240)throw this.zn.error(Od+(n=" bitrate cannot more than 10 Mbps")),[Tg,n]}if(!Ft(t.minBitrate)&&!Vt(t.minBitrate))throw this.zn.error(Od+(n=" minBitrate must be integer number")),[Tg,n];if(!Ft(t.startBitrate)&&!["default","target"].includes(t.startBitrate))throw this.zn.error(Od+(n=" startBitrate must be integer 'default' or 'target'")),[Tg,n];if(void 0!==t.channelCount&&!mi(t.channelCount))throw this.zn.error(Od+(n=" channelCount must be integer number")),[Tg,n];if(!Ft(t.AEC)&&!Gt(t.AEC))throw this.zn.error(Od+(n=" AEC must be boolean'")),[Tg,n];if(!Ft(t.ANS)&&!Gt(t.ANS))throw this.zn.error(Od+(n=" ANS must be boolean'")),[Tg,n];if(!Ft(t.AGC)&&!Gt(t.AGC))throw this.zn.error(Od+(n=" AGC must be boolean'")),[Tg,n];var u,a;return e&&4===t.videoQuality&&(!gd(["frameRate","width","height"],u=t,a=function(t,i){throw[t,i]})||vd(u.bitRate,a)),s={},this.zn.info(Od+" camera "+JSON.stringify(t)),s=t,i.setAttributes({stream_type:kn.stream_type("camera"),camera:kn.camera(t)}),Gt(s.video)||(s.video=!0),Gt(s.audio)||(s.audio=!0),[2,new ni(function(t,e){r.Ga(s,"camera",t,e,i)})]})})},t.prototype.Ha=function(t,i,e){return pg(this,void 0,void 0,function(){var n,s,r,o=this;return gg(this,function(u){return function(t,i,e){var n=Yt(t),s=kn.error.ie;if(n&&!Ft(t.videoQuality)&&!mi(t.videoQuality))return e(s," videoQuality must be integer number"),!1;if(n&&!Ft(t.sourceID)&&!Ht(t.sourceID))return e(s," sourceID must be string"),!1;if(n&&!Ft(t.videoOptimizationMode)&&!["default","motion","detail"].includes(t.videoOptimizationMode))return e(s," video optimizationMode must be 'default', 'motion', 'detail'"),!1;if(n&&!Ft(t.keyFrameInterval)&&!mi(t.keyFrameInterval))return e(s," keyFrameInterval must be integer number"),!1;if(n&&i&&4===t.videoQuality){if(!vd(t.bitRate,e))return!1;if(!gd(["frameRate"],t,e))return!1}}(t,e,function(t,i){throw[t,i]}),n=this.Dn.browser,s=this.Uo.getScreenConstrains(t),i.setAttributes({stream_type:kn.stream_type("screen"),screen:kn.screen(s)}),r=t&&t.captureElement,[2,new ni(function(i,e){var u=function(t){e([t])},a=function(e){o.Uo.createScreenPreviewer(e,s,t)&&i(e),o.addShareScreenEnd(e)};Eh()||Yt(t)&&"firefox"==t.type?o.startScreenShotFirFox("screen",s,function(t,i,e){t?i&&a(i):e&&u(e)}):!r&&Sh()&&xy.screenShotReady||Yt(t)&&"shot"==t.type?o.startScreenShotChrome(function(i,e,n){i?(o.zn.info(Od+" using extension"),e&&a(e)):(n&&o.zn.error(Od+" extension "+n),"SS_DIALOG_CANCEL"===n||Yt(t)&&"shot"==t.type?n&&u(Og.ee):o.startScreenSharing(s,function(t,i,e){t?i&&a(i):(o.zn.error(Od+" "+e),e&&u(e))}))}):"Electron"==n||Yt(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.Hu=function(t,i){return pg(this,void 0,void 0,function(){var e,n,s=this;return gg(this,function(r){if(!t.source||!ti(t.source)&&!Kt(t.source))throw this.zn.error(Od+" source must be HTMLMediaElement or MediaStream"),[Tg," source must be HTMLMediaElement or MediaStream"];if(t.bitRate){if(!mi(t.bitRate))throw this.zn.error(Od+" bitrate must be integer number"),[Tg," bitrate must be integer number"];if(t.bitRate>10240)throw this.zn.error(Od+" bitrate cannot greater than 10 Mbps"),[Tg," bitrate cannot greater than 10 Mbps"]}if(t.audioBitrate){if(!mi(t.audioBitrate))throw this.zn.error("ze.cs.0 audioBitrate must be integer number"),[Tg," audioBitrate must be integer number"];if(t.audioBitrate<6)throw this.zn.error("ze.cs.0 audioBitrate cannot less 6 kbps"),[Tg," audioBitrate cannot less 6 kbps"];if(t.audioBitrate>510)throw this.zn.error("ze.cs.0 audioBitrate cannot greater than 510 kbps"),[Tg," audioBitrate cannot greater than 510 kbps"]}if(!Ft(t.keyFrameInterval)&&!mi(t.keyFrameInterval))throw this.zn.error(Od+(e=" keyFrameInterval must be integer number")),[Tg,e];if(!Ft(t.videoOptimizationMode)&&!["default","motion","detail"].includes(t.videoOptimizationMode))throw this.zn.error(Od+(e=" video optimizationMode must be 'default', 'motion', 'detail'")),[Tg,e];if(void 0!==t.channelCount&&1!==t.channelCount&&2!==t.channelCount)throw this.zn.error("ze.cs.0 channelCount must number 1 or 2"),[Tg," channelCount must number 1 or 2"];return n=Kt(t.source)?"MediaStream":"HTMLElement",i.setAttributes({stream_type:kn.stream_type("custom"),custom:kn.custom(mg(mg({},t),{source_type:n}))}),[2,new ni(function(e,n){s.Ga(t,"custom",e,n,i)})]})})},t.prototype.getStreamByCanvas=function(t){var i=this.Uo.checkPreview(t);if(i){var e=Rh();if(e&&e.includes("15_1")&&!this.Dn.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 ni(function(e,n){return pg(i,void 0,void 0,function(){var i,s,r,o,u,c,h,f,l,d,v=this;return gg(this,function(m){switch(m.label){case 0:if(this.zn.info("ze.czs.0 call"),i=this.Ln.createSpan(a.H,{key:Sn},{key:""},Rn),s=function(n){Ei(i,{local_stream_id:n.id,stream_options:iu(t||{},["captureView","view"])}),e(n)},r=function(t){v.Ln.setError(i,t),n(t)},o=!1,t&&!Yt(t))return[2,r(xi)];if((c=[u=t.camera,t.screen,t.custom].reduce(function(t,i){return t+(i?1:0)},0))>1)return this.zn.error(Od+" ".concat(h="cannot set more than one type of source",". ").concat(JSON.stringify(t))),[2,r({code:xi.code,message:h})];if(o=!!u||0===c,f=new ag(t,this.zn,this.Uo,this.Dn,this),l=new ng(f),!t.autoCapture&&null!=t.autoCapture)return[3,4];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,l.zegoStream.autoCapture()];case 2:return m.sent(),[3,4];case 3:return d=m.sent(),[2,r(d)];case 4:return this.zn.info("ze.czs.0 success"),o&&this.ja.push(l),s(l),[2]}})})})},t.prototype.destroyStream=function(t){this.zn.info(Td+" call");var i=this.Ln.createSpan(a.H,{key:Sn},{key:""},Ss.event);if(!(Kt(t)||Yt(t)&&t.getTracks))return this.zn.error(Td+" localStream is not mediaStream or tracks is null"),void this.Ln.setError(i,Ss.error.Sn);Kt(t)?(Kt(t)&&0==t.getTracks().length&&this.zn.info(Td+" tracks is null"),this.ja=this.ja.filter(function(i){return i!==t}),this.stopPreview(t)):t.zegoStream&&t.zegoStream.destroy(),Ei(i,{stop_reason:Ss.stop_reason("destroyStream"),local_stream_id:t.id})},t.prototype.startPublishingStream=function(t,i,e,n){var s,r,o,u=this,c=ig(i,this.zn),h=Cm(this.zn,t);h.info(kd+" call publishOption: "+JSON.stringify(e)+" isDataChannel: "+JSON.stringify(!!n)+" ms_id: "+(null==c?void 0:c.id));var f,l=!0,d="",v=wg,m=v.he;l&&void 0===t&&(h.error(kd+(d="stream id required")),l=!1,f=zi),!l||t&&Ht(t)||(h.error(kd+" "+(d="stream id type wrong")),l=!1,f=zi),l&&0===t.length&&(this.zn.error(kd+" "+(d=zi.message)),l=!1,f=zi),l&&t.length>256&&(h.error(kd+" "+(d="stream id length limit")),l=!1,f=Ci),l&&!vi(t)&&(this.zn.warn(kd+" #invald streamID:".concat(t)),this.Dn.isFlutter&&(l=!1,f=Di)),l&&!di(t)&&(h.error(kd+" "+(d="stream ID contains illegal characters")),l=!1,f=Di),l&&(!c||Kt(c)&&0==c.getTracks().length)?(h.error(kd+" "+(d="localStream wrong")),l=!1,f=m):c&&c.getTracks().forEach(function(t){tu(t,u.zn,kd)});var p=this.Uo.checkPreview(c);l&&!p&&(h.error(kd+" "+(d=bi)),l=!1,f=v.me);var g=null==p?void 0:p.zegoCaptureStream;if(g&&(g.originAudioStream||g.originVideoStream||(h.error(kd+" "+(d="stream is not capturing")),l=!1,f=v.pe)),(null==p?void 0:p.isVideoEffectStarting)&&(h.error(kd+" "+(d=(f=v.ge).message)),l=!1),l&&e&&!Yt(e)&&(l=!1,f=m,d="publishOption must be object"),l&&e&&!Ft(e.streamParams)&&!Ht(e.streamParams)&&(h.error(kd+" publishOption streamParams must be string"),l=!1,f=m,d=" publishOption streamParams must be string"),l&&e&&!Ft(e.extraInfo)&&!Ht(e.extraInfo)&&(h.error(kd+" publishOption extraInfo must be string"),l=!1,f=m,d=" publishOption extraInfo must be string"),l&&e&&!Ft(e.videoCodec)&&!Ht(e.videoCodec)&&(h.error(kd+" publishOption videoCodec must be string"),l=!1,f=m,d=" publishOption videoCodec must be string"),l&&e&&!Ft(e.inspectFlag)&&(Vt(e.inspectFlag)?[0,1].includes(e.inspectFlag)||(h.error(kd+" publishOption inspectFlag is not in range"),l=!1,f=m,d=" publishOption inspectFlag is not in range"):(h.error(kd+" publishOption inspectFlag must be number"),l=!1,f=m,d=" publishOption inspectFlag must be number")),!l||!this.Dn.isMultiRoom||e&&Ht(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&&!Ft(e.trafficControlFocusOnMode)&&(Vt(e.trafficControlFocusOnMode)&&[0,1].includes(e.trafficControlFocusOnMode)||(this.zn.error(kd+" publishOption trafficControlFocusOnMode: ".concat(e.trafficControlFocusOnMode," is invalid")),delete e.trafficControlFocusOnMode)),l&&e&&!Ft(e.trafficControlMinVideoBitrate)&&(Vt(e.trafficControlMinVideoBitrate)||(this.zn.error(kd+" publishOption trafficControlMinVideoBitrate: ".concat(e.trafficControlMinVideoBitrate," is invalid")),e.trafficControlMinVideoBitrate=0)),l&&e&&!Ft(e.enableTrafficControl)&&(Gt(e.enableTrafficControl)||(this.zn.error(kd+" publishOption enableTrafficControl: ".concat(e.enableTrafficControl," is invalid")),e.enableTrafficControl=!0)),this.Dn.useNetAgent&&this.Dn.roomList.length>0?h.info(kd+" publish accelerate"):this.rtm.isDisConnect()&&(h.error(kd+" not login"),l=!1,f=v.be),!l){h.error(kd+" "+d);var b=this.Ln.getAPIErrorReport(yg);throw b&&f&&this.Ln.takeAPIErrorReport(yg,f,b),{errorCode:null==f?void 0:f.code,extendedData:d}}var _=this.Ln.createSpan(a.I,{key:Sn},{key:yg,par:t},yg,!0);e||(e={});var y=(null==p?void 0:p.videoPreviewType)||(null==p?void 0:p.previewType);!e.videoCodec&&Oh()&&"custom"==y&&(null===(r=null==p?void 0:p.mediaStreamConfig)||void 0===r?void 0:r.source)&&ti(null===(o=p.mediaStreamConfig)||void 0===o?void 0:o.source)&&(h.info(kd+" Redmi note 8 uesed custom stream. change to VP8"),e.videoCodec="VP8");var w=nu(this.Dn.appid,this.Dn.idName,t),S=((s={})["_publish_"+t]={stream_sid:w},s);this.Ln.setPublicPros(S),_.setAttributes({stream_id:_g.stream_id(t),stream_sid:_g.stream_sid(w),publish_option:_g.publish_option(e),enable_camera:_g.enable_camera(!!(null==p?void 0:p.videoTrack)),enable_mic:_g.enable_mic(!!(null==p?void 0:p.audioTrack))}),e.audioBitRate=this.Dn.audioBitRate;var E=e.roomID?e.roomID:this.Dn.roomList[0]?this.Dn.roomList[0].roomID:"",O=this.Dn.getRoomByRoomID(E);return O?(_.setAttributes({room_id:_g.room_id(E)}),this.Uo.setPublishStateStart(O,t,c,e,w,n)?(this.Dn.publishStreamList[t]={state:I.tryPublish,extra_info:e.extraInfo,roomID:O.roomID},h.info("zc.p.sps.1 start publish"),O.streamHandler.onPublishStateUpdate(K,t,{code:0,message:""}),this.Ln.createSpan(a.H,{key:jn.event,par:t},{key:Sg.event,par:t},Sg.event,!0).setAttributes({reason:Sg.reason("StartPublish")}),this.Ln.createSpan(a.I,{key:jn.event,par:t},{key:Xn.event,par:t},Xn.event,!0).setAttributes({room_id:Eg.room_id(null==O?void 0:O.roomID),room_sid_string:Eg.room_sid_string(null==O?void 0:O.roomSessionID)}),this.Dn.appConfig?(null==p?void 0:p.containBackgroundProcess)&&!1===this.Dn.supportBg?(h.info("zc.p.sps.1 check not support background porcess"),O.streamHandler.onPublishStateUpdate(W,t,v.qe),!1):(this.Uo.startPublishingStream(t),!0):(this.Uo.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 ni(function(n){var s=e.Ln.createSpan(a.H,{key:Sn},{key:""},xn),r=function(e){var r=e.errorCode,o=e.extendedData,u=e.video,a=e.audio,c={};u&&(c.video=u),a&&(c.audio=a),Ei(s,{local_stream_id:t.id,update_type:i,preview_conf:c}),n({errorCode:r,extendedData:o})},o=function(r,o){var u=Vt(r)?{errorCode:r,extendedData:JSON.stringify({fail_reason:o})}:r;e.zn.error(em+" "+u.extendedData),Ei(s,{local_stream_id:t.id,update_type:i,error:u.errorCode,message:u.extendedData}),n(u)};e.zn.info(em+" call");var u=e.Uo.checkPreview(t);if(u)if(u.zegoCaptureStream){var c=u.zegoCaptureStream;i!=Fp.audio&&i!=Fp.videoAndAudio||c.getAudioTracks().length?i!=Fp.video&&i!=Fp.videoAndAudio||c.getVideoTracks().length?i==Fp.audio?c.updateStreamAudioTrack(r,o,1):i==Fp.video?c.updateStreamVideoTrack(r,o,1):c.updateStreamVideoAndAudio(r,o,1):o(Ge,Fe):o(Ve,He)}else o(xi.code,xi.message+", stream type wrong");else o(Be,Je)})},t.prototype.activateSEIInsert=function(t){var i=t.stream,e=t.action,n=t.infoType,s=this._getSpan(t.stream,Eo);s.setAttributes({action:Oo(t.action),info_type:To(t.infoType)});var r=this.la.activateSEIInsert(i,e,n);return s.end(),r},t.prototype.sendSEI=function(t,i){if(!Xo())return this.zn.warn(Cd+" browser not support "),!1;if(!Wt(i))return this.zn.error(Cd+" inData required Uint8Array"),!1;if(i.byteLength>4096)return this.zn.error(Cd+" inData length limit"),!1;var e=this.Uo.publisherList[t];return e&&e.publisher?e.publisher.sendSEI(i):(this.zn.warn(Cd+" publish not exist"),!1)},t.prototype.stopPublishingStream=function(t,i,e){var n,s,r,o;this.zn.info(Id+" call "+(i?i.toString():""),{streamid:t});var u=i||{code:0,message:""},c=this.Ln.createSpan(a.I,{key:Sn},{key:""},Wn.event);if(!Ht(t)||""==t)return this.zn.error(Id+" streamID must be string and not empty"),this.Ln.setError(c,Wn.error.ie,"stream id type error"),!1;var h=this.Uo.publisherList[t];e&&!(null===(n=null==h?void 0:h.publisher)||void 0===n?void 0:n.Fa)&&(u=wg.Ue),c.setAttributes({stream_id:Wn.stream_id(t),stream_sid:Wn.stream_sid(null==h?void 0:h.streamSid),room_id:Wn.room_id(null===(r=null===(s=this.Uo.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.Uo.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.Uo.stopPublishingStream(t,u),this.Dn.publishStreamList[t]){if(this.Dn.publishStreamList[t].state>=I.update_info&&f){if(!i||1102018!==i.code)f.streamHandler.updateStreamInfo(t,C);for(var d=0;d<f.streamList.length;d++)if(f.streamList[d].stream_id==t){f.streamList.splice(d--,1);break}}delete this.Dn.publishStreamList[t]}return c.end(),f&&l&&f.streamHandler.onPublishStateUpdate(W,t,u),!0},t.prototype.stopPublishingStreamInRoom=function(t){for(var i in this.zn.info("zc.spsr.0.0 call "+t),this.Dn.publishStreamList)this.Dn.publishStreamList[i].roomID===t&&this.stopPublishingStream(i)},t.prototype.setCaptureVolume=function(t,i){var e=this;return new ni(function(n){e.zn.info(Qv+" call");var s=ig(t,e.zn),r=xs.error.ie,o=function(t){e.zn.error(Qv+" "+t),n({errorCode:r.code,extendedData:JSON.stringify({fail_reason:r.message+" "+t})})},u=e.Uo.checkPreview(s);Kt(s)&&u?0!=s.getAudioTracks().length?!Vt(i)||i<0||i>200?o(" volume must be number between 0 to 200"):(e.La?e.Ua=Math.round(performance.now()-e.La):(e.La=performance.now(),e.qa=u.volume),e.Ba(i),u.setVolume(i),n({errorCode:0,extendedData:""}),e.zn.info(Qv+" call success")):o(" stream audioTrack no found"):o(" stream must be created by zego")})},t.prototype.getElectronScreenSources=function(){var t=this;return new ni(function(i,e){var n=window.require("electron");n||(t.zn.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.zn.error("zc.gess.0 "+i),e(i)})})},t.prototype.startScreenShotChrome=function(t){if(xy.screenShotReady)window.postMessage({type:"SS_UI_REQUEST",text:"start"},"*"),Mo("screenShare",{success:t},this.Dn.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.zn.error(i),t(!1,null,{code:kg.code,message:kg.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(wh()&&Yt(r)){var u=r.width,a=r.height;Yt(u)?r.width={max:u.max||u.ideal}:u&&(r.width={max:u}),Yt(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.zn.info("zc.b.sss config: "+JSON.stringify(c)),n.getDisplayMedia(c).then(function(n){return pg(e,void 0,void 0,function(){var e,s,r,u,a;return gg(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===Ig?[4,CropTarget.fromElement(e)]:(this.zn.info("".concat(o," no current tap")),n.getVideoTracks().forEach(function(t){return t.stop()}),i(!1,null,{code:kg.code,message:kg.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.zn.error("".concat(o," crop error:").concat(a)),n.getVideoTracks().forEach(function(t){return t.stop()}),i(!1,null,{code:kg.code,message:kg.message+" "+a}),[3,5];case 5:return this.zn.info("zc.b.sss capture suc"),i(!0,n),[2]}})})}).catch(function(t){e.zn.error(o+" "+t),t.message&&"permission denied"==t.message.toLowerCase()?i(!1,null,Rg):i(!1,null,{code:kg.code,message:kg.message+" "+t})})}else this.zn.error("zc.b.sss brower does not support getDisplayMedia"),i(!1,null,Og.te)},t.prototype.startScreenShotFirFox=function(t,i,e){var n=this,s={video:mg(mg({},i.video),{mediaSource:t}),audio:i.audio};navigator.mediaDevices.getUserMedia(s).then(function(t){t.getTracks().forEach(function(t){return tu(t,n.zn,"ze.ssf.1")}),e(!0,t)}).catch(function(t){n.zn.error("ze.ssf.1 "+t),e(!1,null,{code:kg.code,message:kg.message+" "+t})})},t.prototype.startScreenShotElectron=function(t,i){var e=this;if(!window.require("electron"))return this.zn.error("ze.sse.1 Electron is not exist"),void i(!1,null,{code:kg.code,message:kg.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 tu(t,e.zn,"ze.sse.1")}),i(!0,t)}).catch(function(t){e.zn.error("ze.sse.1 "+t),i(!1,null,{code:kg.code,message:kg.message+" "+t})})},t.prototype.Ga=function(t,i,e,n,s){var r=this,o=null;return o=new tg(this.zn,this.Dn,this.Uo,i),this.Uo.previewStreamList.push(o),o.startPreview(t,function(n){r.Uo.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.Uo.isMicEnabled)),(null==t?void 0:t.videoOptimizationMode)&&r.Uo.setVideoTrackContentHint(n,null==t?void 0:t.videoOptimizationMode),r.zn.debug("zsc.sp.0 call success"),!r.Dn.deviceInfos&&r.recordDevices(),e&&e(n)},function(t){r.Uo.previewStreamList=r.Uo.previewStreamList.filter(function(t){return t!==o}),n&&n(t)},s),!0},t.prototype.stopPreview=function(t){if(!t)return this.zn.warn("zsc.sp.0 localStream null"),!1;for(var i in this.Uo.publisherList)this.Uo.publisherList[i].localStream===t&&(this.Uo.publisherList[i].localStream=null);var e=this.Uo.checkPreview(t);return e?(e.previewSuc&&(e.stopPreview(),this.Uo.removePreview(e)),!0):(this.zn.info("zsc.sp.0 "+yi),!1)},t.prototype.recordDevices=function(t,i){var e,n=this,s=this.Ja;this.zn.info("zsc.rd.0 call "+!!s),s||(s=this.Va(0),this.Ja=s),s.then(function(i){n.xa.lastRecordDeviceTime=performance.now(),t&&t(i)}).catch(function(t){n.zn.warn("zsc.rd.0 getDevices err:"+t),i&&i(t)}).finally(function(){n.Ja=void 0}),void 0!==(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.ondevicechange)&&(navigator.mediaDevices.ondevicechange=null,navigator.mediaDevices.ondevicechange=function(t){return pg(n,void 0,void 0,function(){return gg(this,function(t){return this.zn.info("zsc.rd.0 devicechange"),this.Va(500),[2]})})})},t.prototype.Va=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=""),pg(this,void 0,void 0,function(){var i,e,n,s=this;return gg(this,function(r){switch(r.label){case 0:return this.zn.info("zsc.rd.0 get and compare devices: "+t),i=!0,(e=this.Dn.deviceChangeTimer)?(clearTimeout(e),this.Dn.deviceChangeTimer=null):0===t&&(i=!1),n=function(){return pg(s,void 0,void 0,function(){var t=this;return gg(this,function(e){return this.zn.info("zsc.rd.0 start get and compare devices"),[2,new Promise(function(e,n){dd(function(n){var s,r,o,u,c,h;t.zn.info("zsc.rd.0 get devices success. ".concat(JSON.stringify(n),"; need compare: ").concat(i));var f=n.microphones,l=n.speakers,d=n.cameras,v=t.Dn.deviceInfos;if(!v){var m=function(t,i){return t.map(function(t){return{device:t.deviceID,device_name:t.deviceName,type:i}})};Ei(Si(t.Ln,a.H,"",as,Sn),{dev_list:bg(bg(bg([],m(d,0),!0),m(f,1),!0),m(l,2),!0),dev_kind:"init"})}if(!v||!i)return t.Dn.deviceInfos={microphones:f,speakers:l,cameras:d},void e(JSON.parse(JSON.stringify(t.Dn.deviceInfos)));var p=!0,g=[],b=[];if(wh()&&1===(null===(r=null===(s=t.Dn.deviceInfos)||void 0===s?void 0:s.cameras)||void 0===r?void 0:r.length)&&""===(null===(o=t.Dn.deviceInfos)||void 0===o?void 0:o.cameras[0].deviceID))t.zn.info("zsc.rd.0 cameras not accurate");else{for(var _=function(i){var e=t.Dn.deviceInfos.cameras[i];n.cameras.find(function(t){return t.deviceID===e.deviceID})||g.push(e)},y=0;y<t.Dn.deviceInfos.cameras.length;y++)_(y);t.Dn.deviceStateOut=!1;var w=!1;g.length>0&&(w=!0),g.forEach(function(i){for(var e in t.Uo.publisherList){var n=t.Uo.publisherList[e],s=n.publisher;if(n.localStream&&""!==n.cameraLabel&&n.cameraLabel===i.deviceName)w=!1,!s.isVideoTrackAlive()&&s.sendStreamStatus(-6,s.mic_status),p=!1,t.Dn.actionListener("_deviceError",Ce,i.deviceName,"camera"),t.Dn.actionListener("deviceError",Ce,i.deviceName);n.localStream&&0===n.localStream.getAudioTracks().length&&(w=!1)}w&&(t.Dn.deviceStateOut=!0),t.deviceInterruptReport(0,i,"camera"),p=!1,t.Dn.actionListener("videoDeviceStateChanged","DELETE",i)}),n.cameras.filter(function(i){return!t.Dn.deviceInfos.cameras.find(function(t){return t.deviceID===i.deviceID})}).forEach(function(i){t.deviceInterruptReport(1,i,"camera"),p=!1,t.Dn.actionListener("videoDeviceStateChanged","ADD",i)})}wh()&&1===(null===(c=null===(u=t.Dn.deviceInfos)||void 0===u?void 0:u.microphones)||void 0===c?void 0:c.length)&&""===(null===(h=t.Dn.deviceInfos)||void 0===h?void 0:h.microphones[0].deviceID)?t.zn.info("zsc.rd.0 microphones not accurate"):((b=t.Dn.deviceInfos.microphones.filter(function(t){return!n.microphones.find(function(i){return i.deviceID===t.deviceID})})).forEach(function(i){for(var e in t.Uo.publisherList){var n=t.Uo.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),p=!1,t.Dn.actionListener("_deviceError",Ce,t.Uo.publisherList[e].microLabel,"micro"),t.Dn.actionListener("deviceError",Ce,t.Uo.publisherList[e].microLabel)}t.deviceInterruptReport(0,i,"micro"),p=!1,t.Dn.actionListener("audioDeviceStateChanged","DELETE","Input",i)}),n.microphones.filter(function(i){return!t.Dn.deviceInfos.microphones.find(function(t){return t.deviceID===i.deviceID})}).forEach(function(i){t.deviceInterruptReport(1,i,"micro"),p=!1,t.Dn.actionListener("audioDeviceStateChanged","ADD","Input",i)}));var S=t.Dn.deviceInfos.speakers.filter(function(t){return!n.speakers.find(function(i){return i.deviceID===t.deviceID})}),E=n.speakers.filter(function(i){return!t.Dn.deviceInfos.speakers.find(function(t){return t.deviceID===i.deviceID})});S.forEach(function(i){var e=t.Ln.createSpan(a.H,{key:Sn},{key:""},Es);e.setAttributes({reason_type:Ts("delete"),device:Os(i.deviceID),device_name:Os(i.deviceName)}),e.end(),p=!1,t.Dn.actionListener("audioDeviceStateChanged","DELETE","Output",i)}),E.forEach(function(i){var e=t.Ln.createSpan(a.H,{key:Sn},{key:""},Es);e.setAttributes({reason_type:Ts("add"),device:Os(i.deviceID),device_name:Os(i.deviceName)}),e.end(),p=!1,t.Dn.actionListener("audioDeviceStateChanged","ADD","Output",i)}),p&&t.xa.onDeviceNoChangeQuickly(n);var O=mg({},t.Dn.deviceInfos);if(t.Dn.deviceInfos={microphones:n.microphones,speakers:n.speakers,cameras:n.cameras},t.Dn.autoSwitchDeviceSetting.microphone){var T=t.Dn.deviceInfos.microphones;if(b&&0!==b.length&&0!=T.length)t.Uo.previewStreamList.forEach(function(i){return pg(t,void 0,void 0,function(){var t,e,n,s,r,o,u;return gg(this,function(a){switch(a.label){case 0:return t=i.localStream,e=T[0].deviceID,s=null==(n=i.audioTrack)?void 0:n.getSettings().deviceId,r=!1,s&&"default"===s?(o=O.microphones.find(function(t){return"default"===t.deviceID}).deviceName,u=T.find(function(t){return"default"===t.deviceID}).deviceName,r=u!==o):""!==s&&(r=b.some(function(t){return t.deviceID===s})),t&&r&&""!==e?(this.zn.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.Dn.autoSwitchDeviceSetting.camera){var k=t.Dn.deviceInfos.cameras;if(g&&0!==g.length&&0!=k.length)t.Uo.previewStreamList.forEach(function(i){return pg(t,void 0,void 0,function(){var t,e,n,s,r,o,u;return gg(this,function(a){switch(a.label){case 0:return t=i.localStream,e=k[0].deviceID,s=null==(n=i.videoTrack)?void 0:n.getSettings().deviceId,r=!1,s&&"default"===s?(o=O.cameras.find(function(t){return"default"===t.deviceID}).deviceName,u=k.find(function(t){return"default"===t.deviceID}).deviceName,r=u!==o):""!==s&&(r=g.some(function(t){return t.deviceID===s})),t&&r&&""!==e?(this.zn.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.Dn.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.Dn.deviceChangeTimer=setTimeout(function(){return pg(s,void 0,void 0,function(){var t,s;return gg(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 ui(this.zn,om),new ni(function(n,s){var r=ig(t,e.zn),o=Yr.error,u=o.Sn,a=o.ie,c=e._getSpan(r,Yr.event),h=mg({},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.Ln.setError(c,u,t)};if(!Kt(r))return e.zn.error(om+" localStream not found"),l("localStream not found"),void s({errorCode:a.code,extendedData:a.message+" localStream no found"});if(!i||!Yt(i)||0==Object.keys(i).length)return e.zn.error(om+" 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&&Vt(m)&&!e.Dn.checkValidNumber(m,0,7680))return e.zn.error(om+" 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&&Yt(m)){if(!(v=md(m,"width",0,7680)).result)return e.zn.error(om+" constraints width: "+v.message),l("constraints width: "+v.message),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"})}else if(m&&!Vt(m)&&!Yt(m))return e.zn.error(om+" 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&&Vt(p)&&!e.Dn.checkValidNumber(p,0,4320))return e.zn.error(om+" 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&&Yt(p)){if(!(v=md(i.height,"height",0,4320)).result)return e.zn.error(om+" constraints height: "+v.message),l("constraints height: "+v.message),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"})}else if(p&&!Vt(p)&&!Yt(p))return e.zn.error(om+" 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&&!Vt(g))return e.zn.error(om+(d=" constraints maxBitrate is not a number")),l(d),void s({errorCode:a.code,extendedData:a.message+d});if(!Ft(b)&&!Vt(b)&&!Yt(b))return e.zn.error(om+(d=" constraints frameRate is not a number or an object")),l(d),void s({errorCode:a.code,extendedData:a.message+d});if(Vt(b)&&!(b>0&&b%1==0))return e.zn.error(om+" 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&&Yt(b)&&!(v=md(b,"frameRate")).result)return e.zn.error(om+" constraints frameRate: "+v.message),l("constraints frameRate: "+v.message),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});e.la.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 ui(this.zn,um),new ni(function(n){var s=ig(t,e.zn),r=e._getSpan(s,Zr.event);if(r.setAttributes({audio_params:Zr.audio_params(i)}),!Kt(s))return e.zn.error(um+" localStream not found"),e.Ln.setError(r,Zr.error.Sn),void n({errorCode:Zr.error.ie.code,extendedData:Zr.error.ie.message+" localStream no found"});if(!i||!Yt(i)||0==Object.keys(i).length||!Ft(i.AEC)&&!Gt(i.AEC)||!Ft(i.AGC)&&!Gt(i.AGC)||!Ft(i.ANS)&&!Gt(i.ANS))return e.zn.error(um+" constraints wrong"),e.Ln.setError(r,Zr.error.ie," constraints wrong"),void n({errorCode:Zr.error.ie.code,extendedData:Zr.error.ie.message+" constraints wrong"});e.la.setPublishStreamAudioConstraints(s,i,r,function(t){r.end(),n(t)})})},t.prototype.mutePublishStreamVideo=function(t,i,e){var n=ig(t,this.zn);ui(this.zn,fm,". "+(null==n?void 0:n.id)+" mute: ".concat(i,", retain: ").concat(e));var s=this._getSpan(n,oo),r=this.Uo.checkPreview(n);if(!r)return this.zn.error(fm+" localStream error"),!1;if(!Gt(i)||!Ft(e)&&!Gt(e))return this.zn.error(fm+" option error"),!1;var o=this.la.enableCamera(n,!i,e);return r.syncVideoEnabled=o&&i,s.setAttributes({mute_type:uo(i?1:0),retain:ao(e||!1)}),s.end(),ai(this.zn,fm),o},t.prototype.mutePublishStreamAudio=function(t,i){var e=ig(t,this.zn);ui(this.zn,lm,(null==e?void 0:e.id)+" mute: ".concat(i));var n=this.Uo.checkPreview(e);if(!n)return this.zn.error(lm+" localStream error"),!1;var s=this._getSpan(e,co);if(!Gt(i))return this.zn.error(lm+" option error"),!1;var r=this.la.enableMicrophone(e,!i);return n.syncAudioEnabled=r&&i,s.setAttributes({mute_type:ho(i?1:0)}),s.end(),ai(this.zn,lm),r},t.prototype.muteMicrophone=function(t){this.zn.info(dm+" call");var i=Si(this.Ln,a.H,"",fo,Tn);if(!Gt(t))return this.zn.error(dm+" option error"),this.Ln.setError(i,xi),!1;var e=this.la.enableMicrophoneOnly(!t),n=Object.keys(this.Uo.publisherList).map(function(t){return{stream_id:t}});return Ei(i,{enable:lo(!t),stream_list:vo(n)}),this.zn.info(dm+" end"),e},t.prototype.handleTrack=function(t,i,e,n,s){this.la.handleTrack(t,i,e,n,s)},t.prototype._getSpan=function(t,i){var e=this.Uo.checkPublish(t);return this.Ln.createSpan(a.H,e?{key:jn.event,par:e.streamID}:{key:Sn},{key:""},i)},t.prototype.enVideoSpan=function(t,i,e){this.la.enVideoSpan(t,i,e)},t.prototype.replaceTrack=function(t,i,e,n){return pg(this,void 0,void 0,function(){var s,r,o,u,a,c;return gg(this,function(h){return s=this._getSpan(t,eo.event),r=eo.error.ie,Kt(t)?i&&i instanceof MediaStreamTrack?(o={id:i.id,muted:i.muted,enabled:i.enabled,kind:i.kind,readyState:i.readyState,label:i.label},ui(this.zn,am,". ".concat(t.id," track: ")+JSON.stringify(o)),u=!0,"safari"===this.Dn.browser&&void 0!==(null==n?void 0:n.isReplaceNew)&&(u=n.isReplaceNew),a=Ft(null==n?void 0:n.isCaptureStream)||null==n?void 0:n.isCaptureStream,c=this.la._replaceTrack(t,i,e,void 0,u,a),s.setAttributes({track_kind:eo.track_kind(i.kind)}),s.end(),[2,c]):(this.zn.error(am+" mediastream track no found"),this.Ln.setError(s,r,"mediastream track no found"),[2,{errorCode:r.code,extendedData:r.message+" mediastream track no found"}]):(this.zn.error(am+" localStream not found"),this.Ln.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 ui(this.zn,n),new ni(function(s){var r=ig(t,e.zn),o=e._getSpan(r,no.event);if(o.setAttributes({device:no.device(i)}),!Kt(r))return e.zn.error(n+" localStream not found"),e.Ln.setError(o,no.error.Sn),void s({errorCode:no.error.ie.code,extendedData:no.error.ie.message});if(!Ht(i))return e.zn.error(n+" deviceID must be string"),e.Ln.setError(o,no.error.ie," deviceID must be string"),void s({errorCode:no.error.ie.code,extendedData:no.error.ie.message});var u=function(t){Ei(o,{error:t.errorCode,message:t.extendedData}),e.Uo.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)};dd(function(t){var s=t.cameras.find(function(t){return t.deviceID==i});if(!s)return e.zn.error(n+" "+gi),void u({errorCode:no.error.Tn.code,extendedData:no.error.Tn.message});o.setAttributes({device_name:no.device_name(null==s?void 0:s.deviceName)}),e.la.Ma("video",r,i,u)},function(t){e.zn.warn(n+" getDevices err:"+t),e.la.Ma("video",r,i,u)})})},t.prototype.useFrontCamera=function(t,i){var e=this,n="zc.ufc.0";return ui(this.zn,n,""+i),new ni(function(s,r){var o=ig(t,e.zn),u=e._getSpan(o,no.event);if(!Kt(o))return e.zn.error(n+" localStream not found"),e.Ln.setError(u,no.error.Sn),void r({errorCode:no.error.ie.code,extendedData:no.error.ie.message});if(!Gt(i))return e.zn.error(n+" enable must be boolean"),e.Ln.setError(u,no.error.ie," enable must be boolean"),void r({errorCode:no.error.ie.code,extendedData:no.error.ie.message});var a=bh(),c=gh(),h=_h();if(!(a||c||h))return e.zn.error(n+" must use in mobile"),e.Ln.setError(u,no.error.kn," must use in mobile"),void r({errorCode:no.error.kn.code,extendedData:no.error.kn.message});var f=i?"user":"environment";u.setAttributes({facing_mode:no.facing_mode(f)}),e.la.Ma("video",o,"",function(t){u.setAttributes({error:t.errorCode,message:t.extendedData}),u.end(),e.Uo.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 ui(this.zn,n),new ni(function(s){var r=ig(t,e.zn),o=e._getSpan(r,so.event);o.setAttributes({device:so.device(i)});var u=function(t,i){e.zn.error(n+" "+i);var r=t;r.message=r.message+(i?" "+i:""),e.Ln.setError(o,t,i),s({errorCode:r.code,extendedData:r.message})},a=function(t){Ei(o,{error:t.errorCode,message:t.extendedData}),e.Uo.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.Uo.checkPreview(r);0===t.errorCode&&i&&(i.hasMicTrack=!0),s(t)};Kt(r)?Ht(i)?dd(function(t){var s=t.microphones.find(function(t){return t.deviceID==i});if(!s)return e.zn.error(n+" "+gi),void a({errorCode:so.error.Tn.code,extendedData:so.error.Tn.message});o.setAttributes({device_name:so.device_name(null==s?void 0:s.deviceName)}),e.la.Ma("audio",r,i,a)},function(t){e.zn.warn(n+" getDevices err:"+t),e.la.Ma("audio",r,i,a)}):u(so.error.ie,"deviceID must be string"):u(so.error.Sn,"localStream not found")})},t.prototype.enableDualStream=function(t){var i="zsc.eds";ui(this.zn,i);var e=ig(t,this.zn),n=this.Uo.checkPreview(e);if(n)if(null==n?void 0:n.lowStream)this.zn.error(i+" low stream already exists");else{var s=n.videoPreviewType||n.previewType;if(Eh()&&"custom"==s)this.zn.error(i+" can not support firefox");else this.Uo.checkPublish(e)?this.zn.error(i+" is publishing"):(n.enableDualStream=!0,n.createLowStream())}else this.zn.error(i+" preview no found")},t.prototype.setLowStreamParameter=function(t,i){var e=ig(t,this.zn),n=this.Uo.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&&_d(s.width)&&i.width>_d(s.width)?this.zn.error("zsc.slsp.0 low stream width can not larger than high stream"):i.height&&s.height&&_d(s.height)&&i.height>_d(s.height)?this.zn.error("zsc.slsp.0 low stream height can not larger than high stream"):i.frameRate&&s.frameRate&&_d(s.frameRate)&&i.frameRate>_d(s.frameRate)||i.height&&s.bitRate&&i.bitRate>s.bitRate||(n.lowStreamConfig=Object.assign(n.lowStreamConfig,i))}else this.zn.error("zsc.slsp.0 preview no found")},t.prototype.setDummyCaptureImagePath=function(t,i){var e=this;return new ni(function(n,s){var r=ig(i,e.zn),o=e.Uo.checkPreview(r);if(!o)return e.zn.error("zc.sdcp.0 preview no found"),void n(!1);if(!Ht(t))return e.zn.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.zn.info("zc.sdcp.0 load file path success"),o.setMuteImage(u),n(!0)},o.loadImgTimer=setTimeout(function(){e.zn.error("zc.sdcp.0 load img timeout"),n(!1)},5e3)})},t.prototype.enableAutoSwitchDevice=function(t){this.zn.info("zc.easw call. "+JSON.stringify(t)),this.Dn.autoSwitchDeviceSetting=mg({},t)},t.prototype.enableCameraCapturing=function(t,i){return void 0===i&&(i=!0),pg(this,void 0,void 0,function(){var e,n,s,r,o,u;return gg(this,function(c){return this.zn.info("zsc.ecc call by user "+i),e=Si(this.Ln,a.H,"",mo,Tn),n=ig(t,this.zn),(s=this.Uo.checkPreview(n))?(r=s.videoPreviewType||s.previewType,s.localStream&&s.videoTrack&&"camera"===r?(o=this.Uo.getPublishList(n),u=o.map(function(t){return{stream_id:t.streamID}}),Ei(e,{enable:po(i),stream_list:go(u)}),[2,this.la.enableCameraCapturing(s,i)]):(this.zn.error("zsc.ecc not camera stream"),[2,!1])):(this.zn.error("zsc.ecc "+yi),this.Ln.setError(e,re),[2,!1])})})},t.prototype.getStreamStats=function(t){var i,e,n;return this.zn.info("zc.p.0.gqs call"),Kt(t)&&t.getTracks().length>0?n=null===(i=this.Uo.checkPublish(t))||void 0===i?void 0:i.publisher:Ht(t)&&(n=null===(e=this.Uo.publisherList[t])||void 0===e?void 0:e.publisher),n?(null==n?void 0:n.qualityHandler.Ya)||null:(this.zn.error("zsc.sp.0 stream is not publishing"),null)},t.prototype.startWaitPublish=function(){var t=this;this.Uo.waitPublishList.forEach(function(i){t.Uo.startPublishingStream(i)}),this.Uo.waitPublishList=[]},t.prototype.deviceInterruptReport=function(t,i,e){var n,s="camera"===e?fs:hs;"micro"===e?n=1:"speaker"===e&&(n=0);var r=Si(this.Ln,a.H,"",s.event,Sn),o={changed_type:s.interrupt(t),device:s.device(i.deviceID),device_name:s.device_name(i.deviceName)};Vt(n)&&(o.device_type=n),Ei(r,o)},t.prototype.initCopyMusic=function(t){if(this.Uo.useCopyMusic&&!isNaN(this.Dn.engineConfig.choirRole)){var i=this.Uo.checkPreview(t),e=this.Dn.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.Uo.userid)?0:1);i&&!i.onlyPreview&&i.setVolumeFactorByUserCount(s)}}},t.prototype.setEmptyAudioTrack=function(t,i){if(this.Dn.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.Ln.createSpan(a.H,{key:Sn},{key:""},Ss.event);e.setAttributes({stop_reason:Ss.stop_reason("screenSharingEnded")}),t&&i.stopPreview(t),e.end(),i.Dn.actionListener("screenSharingEnded",t)})},t.prototype.destroy=function(){si.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},t}(),Pg=function(){return Pg=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},Pg.apply(this,arguments)},Mg=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())})},xg=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])}}},jg=$n.event,Lg=$n,qg=function(){function t(t,i,e,n,s){this.zn=t,this.dataReport=i,this.Dn=e,this.Uo=n,this.rtm=s}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.prototype.startPlayingStream=function(t,i,e){var n=this;return this.zn.info(Rd+" playOption: "+JSON.stringify(iu(i||{},["CDNVideo","CDNPlayer"]))+" isDataChannel: "+JSON.stringify(!!e),{streamid:t}),new ni(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=Lg,a=function(t,i){o.zn.error(Rd+" "+(i||t.message));var e=o.Ln.getAPIErrorReport(jg);e&&o.Ln.takeAPIErrorReport(jg,t,e),n&&n(Pg(Pg({},t),{errorCode:t.code,extendedData:t.message+(i?" "+i:"")}))};if(!t)return a(u.error.He),!1;if(!Ht(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(!vi(t)&&(this.zn.warn(Rd+" #invald streamID:".concat(t)),this.Dn.isFlutter))return a(u.error.Ye),!1;if(!di(t))return a(u.error.Ye),!1;if(!Ft(i)&&!Yt(i))return a(u.error.Ge,"playOption must be object"),!1;if(!Ft(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(Gt(null==i?void 0:i.adaptiveSwitch)&&(null==i?void 0:i.adaptiveSwitch)){if((null==i?void 0:i.resourceMode)!==V.L3)return a(u.error.Ge,"adaptiveSwitch only support resourceMode as L3"),!1;if(!Xt(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.Uo.maxChannels;if(Vt(c)&&Object.keys(this.Uo.playerList).length>=c){var h=Object.values(this.Uo.playerList).filter(function(t){return!1===(null==t?void 0:t.isProbe)}).length;if(h>=c)return this.zn.error("zsc.pss.1 play streams is out limit "+h+" "+c),a(u.error.bn),!1}var f=nu(this.Dn.appid,this.Dn.idName,t),l=((r={})["_play_"+t]={stream_sid:f},r);if(this.Ln.setPublicPros(l),this.Dn.playAccelerate&&this.Dn.roomList.length>0)this.zn.info(Rd+" play accelerate");else if(this.rtm.isDisConnect())return a(u.error.Ze),!1;this.Dn.pullLimited||(t=NaN+t),i&&i.videoCodec&&(i.videoCodec=i.videoCodec.toUpperCase());var d=this.Dn.settingConfig.getSetting("resource_mode",!0);void 0!==d&&(this.zn.info(Rd+" setting resource_mode "+d),!i&&(i={}),i.resourceMode=d);var v=this.Uo.setPlayStateStart(t,i,f,s);return!0!==v?(a(JSON.parse(JSON.stringify(v)),"cannot start play"),!1):(this.Uo.onPlayStateUpdate(it,t,{code:0,message:""}),this.Uo.playSuccessCallBackList[t]=function(t){e&&e(t)},n&&(this.Uo.playErrorCallBackList[t]=n),this.Dn.appConfig?(this.Uo.startPlayingStream(t),!0):(this.Uo.waitPlayList.push(t),!0))},t.prototype.setPlayStreamVideoType=function(t,i){var e=this;return new Promise(function(n,s){return Mg(e,void 0,void 0,function(){var e,r;return xg(this,function(o){switch(o.label){case 0:if(e=Cm(this.zn,t),!Ht(t)||""===t)return e.error(Nd+" streamid must be string and not empty"),s(!1),[2];if(!(r=this.Uo.playerList[t]))return e.error(Nd+" player not exist"),s(!1),[2];if(![0,1,2].includes(i))return e.error(Nd+" 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=Cm(this.zn,t);r.info(Nd+" call");var o=this.Ln.createSpan(a.I,{key:Sn},{key:""},os.event);if(!Ht(t)||""===t)return r.error(Nd+" streamid must be string and not empty"),this.Ln.setError(o,os.error.ie,"stream id type error"),void delete this.Dn.reportSeqList.stopPlay[t];var u=this.Uo.playerList[t];o.setAttributes({stream_id:os.stream_id(t),room_id:os.room_id(null===(n=this.Uo.playerList[t])||void 0===n?void 0:n.room.roomID),webrtc_sid:os.webrtc_sid(null==u?void 0:u.sessionId),stream_sid:os.stream_sid(null==u?void 0:u.streamSid),biz_product:u&&(null===(s=u.playOption)||void 0===s?void 0:s.resourceMode)==V.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=Lg.error.gn);var h=[1,3].includes(null==u?void 0:u.resourceMode)&&(null==u?void 0:u.playMode)===J.CDN;for(var f in this.Uo.stopPlayingStream(t,i),this.Dn.streamUrlMap)if(this.Dn.streamUrlMap[f]===t){delete this.Dn.streamUrlMap[f];break}i?this.Ln.setError(o,i):o.end(),c&&this.Uo.onPlayStateUpdate(tt,t,i||{code:0,message:""},{isCDN:h}),r.debug(Nd+" call success")},t.prototype.stopPlayingStreamInRoom=function(t){for(var i in this.zn.info("zc.spsr.1.0 call "+t),this.Uo.playerList)this.Uo.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.zn.debug("zsc.ssao.0 device "+i),t?"undefined"!==t.sinkId?(t.setSinkId(i).then(function(){e.zn.info("zsc.ssao.0 success device: "+i)}).catch(function(t){e.zn.info("zsc.ssao.0 "+t.name)}),!0):(this.zn.error("zsc.ssao.0 browser does not suppport"),!1):(this.zn.error("zsc.ssao.0 no localVideo"),!1))},t.prototype.startWaitPlay=function(){var t=this;this.Uo.waitPlayList.forEach(function(i){t.Uo.startPlayingStream(i)}),this.Uo.waitPlayList=[]},t.prototype.setPlayerListForbid=function(t){var i=this;t.forEach(function(t){var e=t.stream_attr_opts,n=i.Uo.playerList[t.streamID];e&&(null==n||n.setMuteStreamByPlayMode(e))})},t.prototype.getStreamStats=function(t){var i,e;return this.zn.info("zc.p.1.gqs call"),Ht(t)&&(e=this.Uo.playerList[t]),e&&(null===(i=null==e?void 0:e.qualityHandler)||void 0===i?void 0:i.Ya)?e.qualityHandler.Ya||null:(this.zn.error("zsc.sp.0 stream is not playing"),null)},t.prototype.mutePlayStreamVideo=function(t,i){ui(this.zn,vm,t+" "+i);var e=this.Ln.createSpan(a.H,{key:$n.event,par:t},{key:""},bo);e.setAttributes({mute_type:_o(i?1:0)});var n=this.mutePlayStream(t,"video",i);return e.end(),this.zn.info(vm+" end"),n},t.prototype.mutePlayStreamAudio=function(t,i){ui(this.zn,mm,t+" "+i);var e=this.Ln.createSpan(a.H,{key:$n.event,par:t},{key:""},yo);e.setAttributes({mute_type:wo(i?1:0)});var n=this.mutePlayStream(t,"audio",i);return e.end(),this.zn.info(mm+" end"),n},t.prototype.muteAllPlayAudioStreams=function(t){var i=this;return ui(this.zn,pm," "+t),new Promise(function(e,n){if("boolean"!=typeof t)return i.zn.error(pm+" mute should be a boolean type"),void n(!1);var s=Object.keys(i.Uo.playerList),r=[];if(!i.Uo.playModule)return i.zn.info(pm+" cannot find play module."),void n(!1);i.Uo.defaultAudioMuted=t,i.zn.info(pm+" "+"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.zn.info(pm+" "+"mute ".concat(t," all audio success")),e(!0)}).catch(function(e){i.zn.error(pm+" mute: "+t+" error catch: "+e),n(!1)})})},t.prototype.muteAllPlayVideoStreams=function(t){var i=this;return ui(this.zn,gm," "+t),new Promise(function(e,n){if("boolean"!=typeof t)return i.zn.error(gm+" mute should be a boolean type"),void n(!1);var s=Object.keys(i.Uo.playerList),r=[];if(!i.Uo.playModule)return i.zn.info(gm+" cannot find play module."),void n(!1);i.Uo.defaultVideoMuted=t,i.zn.info(gm+" "+"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.zn.info(gm+" "+"mute ".concat(t," all audio success")),e(!0)}).catch(function(e){i.zn.error(gm+" 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.zn.info("zsc.mps.0 call "+i+" "+e),new ni(function(r,o){if(!Ht(t)||""==t)return s.zn.error("zsc.mps.0 streamID must be string and not empty"),void o(!1);if(!Gt(e))return s.zn.error("zsc.mps.0 mute must be boolean"),void o(!1);var u=s.Uo.playerList[t];if(!u)return s.zn.error("zsc.mps.0 player not found"),void o(!1);if("video"===i){if(u.playOption&&!1===u.playOption.video)return s.zn.error("zsc.mps.0 stream no contain video"),void o(!1);if(n&&(null==u?void 0:u.isServerMuteVideo))return s.zn.error("zsc.mps.0 stream ".concat(t," has forbid video")),void o(!1);if(u.playMode===J.CDN)return s.zn.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.zn.info("zsc.mps.0 suc"),u.playMediaStatus.video=!e;var o=ro,c=s.Ln.createSpan(a.H,{key:$n.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.zn.error("zsc.mps.0 fail"),o(!1)})}else if("audio"===i){if(u.playOption&&!1===u.playOption.audio)return s.zn.error("zsc.mps.0 stream no contain audio"),void o(!1);if(n&&(null==u?void 0:u.isServerMuteAudio))return s.zn.error("zsc.mps.0 stream ".concat(t," has forbid audio")),void o(!1);if(u.playMode===J.CDN)return s.zn.info("zsc.mps.0 stream ".concat(t," cdn mute audio ").concat(e)),void(u.playMediaStatus.audio=!e);u.ActivatePlayAudioStream(e,function(){s.zn.info("zsc.mps.0 suc"),u.playMediaStatus.audio=!e;var i=ro,n=s.Ln.createSpan(a.H,{key:$n.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.zn.error("zsc.mps.0 fail"),o(!1)})}else o(!1)})},t}(),Ug=function(){function t(t,i,e,n){this.Uo=t,this.Dn=i,this.zn=e,this.rtm=n}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.prototype.setStreamExtraInfo=function(t,i){var e=this;return new ni(function(n,s){var r=e.Uo.getRoomByStreamID(t),o=So,u=e.Ln.createSpan(a.H,r?{key:En,par:null==r?void 0:r.roomID}:{key:Tn},{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.zn.error("zb.ssei "+i),e.Ln.setError(u,t,i),s({errorCode:t.code,extendedData:t.message+" "+i})};Ht(t)&&""!=t?Ht(i)?0!==i.length?i.length>1024?c(o.error._zpg_kExtraInfoTooLong):e.rtm.isDisConnect()?c(o.error.In):e.Dn.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.Ln.setError(u,f),s(f)}},c):c(o.error.In):c(o.error.Nn):c(o.error._zpg_kExtraInfoNull):c(o.error.ie," extraInfo must be string"):c(o.error.ie," streamID must be string and not empty")})},t}(),Bg=function(){return Bg=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},Bg.apply(this,arguments)},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())})},Vg=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])}}},Hg=ts,Gg=$n.event,Fg=$n.error,Yg=jn.error,Zg=function(){function t(t,i,e,n,s,r,o){var u=this;this.zn=t,this.dataReport=i,this.Dn=e,this.Uo=n,this.rtm=s,this.ac=r,this.zegoWebRtc=o,this.beforeunloadListener=function(){u.logger.stopStorageLog();for(var t=0;t<u.Uo.previewStreamList.length;t++)u.Uo.previewStreamList[t].stopPreview();u.Uo.previewStreamList=[]},this.pagehideListener=function(){for(var t in window.event&&(window.event.cancelBubble=!0),u.Uo.publisherList)u.publishModule.stopPublishingStream(t);for(var t in u.Uo.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,xo("screenShare",u.Dn.callbackList)),"SS_DIALOG_CANCEL"===e&&xo("screenShare",u.Dn.callbackList)(!1,null,e)},this.offlineListener=function(){for(var t in u.zn.info("zc.off.0 "+wi),u.Dn.networkState=H.offline,u.Uo.publisherList){u.Uo.stopNetProbe(u.Uo.publisherList[t].publisher)}for(var t in u.Uo.playerList){var i=u.Uo.playerList[t];i.playMode==J.CDN&&i.zegoCdnPlayer&&(i.zegoCdnPlayer.canRetry=!1),u.Uo.stopNetProbe(i)}},this.onlineListener=function(t){for(var i in u.zn.info("zc.on.0 network is online"),u.Dn.networkState=H.online,u.Uo.publisherList){var e=u.Uo.publisherList[i].publisher,n=u.Uo.publisherList[i].retryStreamHandler;7==e.state||e.stateNego==gt.stop||e.iceStateDisConnect?!n.isOverTime&&n.publishStateHandle(W,i,Yg.ve):6==e.state&&n.stopMaxTime()}for(var i in u.Uo.playerList){var s=u.Uo.playerList[i],r=s.playMode,o=(n=s.retryStreamHandler,s.zegoCdnPlayer);r==J.CDN&&o&&(o.canRetry=!1),7==s.state||r!==J.CDN&&(0==s.stateNego||s.iceStateDisConnect)?!n.isOverTime&&n.playStateHandle(tt,i,Fg.un):6==s.state&&n.stopMaxTime()}},this.visibilitychangeListener=function(t){var i="";i="visible"===si.visibilityState?"foreground":"background";var e=u.Ln.createSpan(a.H,{key:Sn},{key:""},Ps);e.setAttribute("state",Ms(i)),e.end()},this.safariPagehideListener=function(t){var i=u.Ln.createSpan(a.H,{key:Sn},{key:""},Ps);i.setAttribute("state",Ms("background")),i.end()},this.safariPageshowListener=function(t){var i=u.Ln.createSpan(a.H,{key:Sn},{key:""},Ps);i.setAttribute("state",Ms("foreground")),i.end()},this.publishModule=new Ag(this.zn,this.dataReport,this.Dn,this.Uo,this.rtm,this.zegoWebRtc),this.playModule=new qg(this.zn,this.dataReport,this.Dn,this.Uo,this.rtm),this.Uo.playModule=this.playModule,this.initAdvance(),this.streamCommon=new Ug(n,e,t,s),this.initStreamCDN(),this.initAudioMix(),this.Dn.appConfig=this.rtm.getAppConfig(),this.init()}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logger",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateCenter",{get:function(){return this.Dn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamCenter",{get:function(){return this.Uo},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=ph(),i=t.match(/iPad/i)||t.match(/iPhone/i)?"pagehide":"firefox"===this.Dn.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),si.addEventListener("visibilitychange",this.visibilitychangeListener),wh()&&(window.addEventListener("pagehide",this.safariPagehideListener),window.addEventListener("pageshow",this.safariPageshowListener))},t.prototype.offWindowListner=function(){var t=ph(),i=t.match(/iPad/i)||t.match(/iPhone/i)?"pagehide":"firefox"===this.Dn.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),si.removeEventListener("visibilitychange",this.visibilitychangeListener),wh()&&(window.removeEventListener("pagehide",this.safariPagehideListener),window.removeEventListener("pageshow",this.safariPageshowListener))},t.prototype.bindEngineDestroyListener=function(){var t=this;this.Dn.listenerList._engineDestroy.push(function(){t.offWindowListner()})},t.prototype.bindRTMListener=function(){var t=this;this.rtm._on("_settingCanFetch",function(i){return Jg(t,void 0,void 0,function(){var t,e,n;return Vg(this,function(s){return this.zn.info("zc.scf stream config "+JSON.stringify(i).length),i&&(this.Dn.settingConfig.setSetting(i.setting),(null===(e=i.setting)||void 0===e?void 0:e.open_mini_sdp)&&(t=this.Dn.settingConfig.getSetting("open_mini_sdp"),null===(n=this.Uo)||void 0===n||n.initMiniSdpWorker(t))),[2]})})}),this.rtm._on("_appConfigRsp",function(){t.zn.info("zc.acr call ");var i=!t.Dn.appConfig;t.Dn.appConfig=t.rtm.getAppConfig(),t.zn.info("zc.acr appConfig ".concat(JSON.stringify(t.Dn.appConfig))),i&&(t.Uo.reConnectSignals(),t.publishModule.startWaitPublish(),t.playModule.startWaitPlay())}),this.rtm._on("_netAppConfigRsp",function(i){t.Dn.netAppConfig=i,t.Dn.supportBg=t.checkBackgroundCapacity()}),this.rtm._on("_roomLogin",function(i,e){var n;t.Dn.appid=t.rtm.getAppID(),t.Dn.idName=t.rtm.getUserID(),t.Dn.nickName=t.rtm.getUserName(),t.Dn.testEnvironment=t.rtm.isTestEnvironment(),t.Dn.isMultiRoom=t.rtm.getMultiRoom(),t.Uo.setSessionInfo(t.Dn.appid,t.Dn.idName,t.Dn.testEnvironment);var s=t.Dn.getRoomByRoomID(i);if(!s){var r=new Em(t.zn,t.Dn,t.rtm,t.Uo,i);t.bindStreamHandler(r),t.Dn.roomList.push(s={roomID:i,streamHandler:r,sessionID:"",roomSessionID:"",token:e,isResetRoom:!1,streamList:[],streamInfoList:[],dataChannelManager:null});var o=t.Dn.Kr("connect_media_in_advance",!0),u=t.Dn.Kr("connect_media_in_advance");(null!==(n=null!=o?o:t.Dn.engineConfig.connectMediaServerInAdvance)&&void 0!==n?n:u)&&t.Uo.connectWebRTCCenterServer(!0,!0,i,e)}}),this.rtm._on("roomLoginResponse",function(i){return Jg(t,void 0,void 0,function(){var t,e,n,s,r,o;return Vg(this,function(u){return this.zn.info("zc.rlr call "+JSON.stringify(i)),t=i.header.room_id||i.body.room_id,this.Dn.appConfig=this.rtm.getAppConfig(),e=this.rtm.getToken(t),n=this.rtm.getSessionId(t),s=this.rtm.getRoomSessionID(t),(r=this.Dn.getRoomByRoomID(t))||(o=new Em(this.zn,this.Dn,this.rtm,this.Uo,t),this.bindStreamHandler(o),this.Dn.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.zn.info("zc.rlr stream fetch "+t),r.streamHandler.room=r,r.streamHandler.fetchStreamList(),[2]):(r.streamHandler.handleStreamStart(i,r),this.Uo.checkStreamReport(),this.zn.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.Dn.getRoomByRoomID(s||e);null==r||r.streamHandler.patchStreamList(i)}),this.rtm._on("_roomStateUpdate",function(i,e,n,s,r,o){if("CONNECTED"===e&&t.Uo.billingTimer.startChargeInfosUpload(),"DISCONNECTED"==e){t.zn.info("zc.rsu "+i+" disconnected "+(n?n+" ":"")+(s||"")),t.Uo.billingTimer.stopChargeInfosUpload();var u=t.Dn.getRoomByRoomID(i);if(u){var a=t.Dn.roomList.findIndex(function(t){return t.roomID==i});u.isResetRoom=!0,u.streamHandler.reset(),u.dataChannelManager&&t.zegoWebRtc.destroyRealTimeSequentialDataManager(u.dataChannelManager),o||t.Uo.reset(i,n),t.Dn.roomList.splice(a,1)}if(o&&Object.keys(t.streamCenter.playerList).length>0)return;t.Uo.disconnectAllSignal()}else t.zn.info("zc.rsu "+i+" state: "+e)}),this.rtm._on("_tokenRenewed",function(i,e){t.zn.info("zc.tr roomID:"+e),t.zn.remoteReport("zc.tr token:"+i);var n=t.Dn.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.Dn.getRoomByRoomID(i);s?"pushstatus"===e||"mixpushstatus"===e&&s.streamHandler.getMixStreamStatus(n):t.zn.error("zc.opur room no found")}),this.rtm._on("_uaHeartBeatTimeout",function(){var i;t.zn.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.Dn.getRoomByRoomID(e),s=this.rtm.getMsgSpan(ks.event,e);if(!n)return this.Ln.setError(s,ks.error.En),void this.zn.error("zc.opsu room no found");var r="";switch(t.body.stream_cmd){case Y:r="add";break;case Z:r="delete";break;case Q: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:ks.stream_update_type(r),stream_seq:t.body.stream_seq,stream_list:ks.stream_list(o)}),s.end(),n.streamHandler.handlePushStreamUpdateMsg(t)},t.prototype.bindStreamCenterHandler=function(){var t=this;this.Uo.onPlayStateUpdate=function(i,e,n){var s,r=Cm(t.zn,e);r.info("zc.opsu.1 ".concat(i));var o=t.Uo.playerList[e];o&&(0!=i&&1!=i||(o.retryStreamHandler.streamRetryStartTime=0,o.uploadPlayEvent(n)),[0,Fg.gn.code].includes(null==n?void 0:n.code)||(o.latestPlayErrCode=n.code),!o.isProbe&&o.Za&&(1==i&&n&&o.Za.setAttributes({error:n.code,message:n.message}),(0===i||2===i&&0!==n.code)&&o.reportMiniSdpInfos(),0!==i&&(Ei(o.Za,{url:Hg.url(null===(s=o.signal)||void 0===s?void 0:s.server),ip:Hg.ip(o.ip),peer_id:Hg.peer_id(o.peerID),source_type:Hg.source_type(o.playMode),net_protocol:Hg.net_protocol(o.netProtocol),signal_consume:Hg.signal_consume(o.signalTime),tryidx:Hg.tryidx(o.tryidx)}),o.Za=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.Uo.playErrorCallBackList[e]){r.info("zc.opsu.1 connect changed");var a=n&&(n.code==Fg.gn.code?0:n.code);t.Uo.playErrorCallBackList[e]({errorCode:a||0,extendedData:a?n.message:""}),delete t.Uo.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===Fg.gn.code&&(n={code:0,message:""}),h&&t.Dn.actionListener("playerStateUpdate",{state:c,streamID:e,errorCode:n&&n.code,extendedData:n&&n.message})}},this.Uo.onPublishStateUpdate=function(i,e,n){t.onPublishStateUpdateHandle(i,e,n)},this.Uo.onPublishQualityUpdate=function(i,e){t.Dn.actionListener("publishQualityUpdate",i,e)},this.Uo.onPlayQualityUpdate=function(i,e){t.Dn.actionListener("playQualityUpdate",i,e)},this.Uo.onRemoteCameraStatusUpdate=function(i,e,n){var s=t.Ln.createSpan(a.H,{key:Gg,par:i},{key:""},vs);s.setAttributes({stream_id:ms(i),camera_status:ps(e),status_code:gs(n)}),s.end(),t.Dn.actionListener("remoteCameraStatusUpdate",i,e),t.Dn.actionListener("_remoteCameraStatusUpdate",i,n)},this.Uo.onRemoteMicStatusUpdate=function(i,e,n){var s=t.Ln.createSpan(a.H,{key:Gg,par:i},{key:""},bs);s.setAttributes({stream_id:_s(i),mic_status:ys(e),status_code:ws(n)}),s.end(),t.Dn.actionListener("remoteMicStatusUpdate",i,e),t.Dn.actionListener("_remoteMicStatusUpdate",i,n)},this.Uo.onSoundLevelUpdate=function(i){t.Dn.actionListener("soundLevelUpdate",i)},this.Uo.onMicSoundLevelUpdate=function(i){t.Dn.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:lt[t.closeType]&<[t.closeType].code||0,description:lt[t.closeType]&<[t.closeType].description||"unknown"}});r.stream_delete_reason=o}if(0===e?s=s.filter(function(t){var e,n=!i.Dn.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.Dn.actionListener("roomStreamUpdate",t,function(t){return 0==t?"DELETE":"ADD"}(e),s,Object.keys(r).length>0?JSON.stringify(r):""),n.length>0&&i.Dn.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.Dn.actionListener("streamExtraInfoUpdate",t,u)}},t.onPublishStateUpdate=function(t,e,n,s){var r,o,u,a,c,h,f,l,d;i.zn.info("zb.opsu ".concat(t," ").concat(JSON.stringify(n)," ").concat(JSON.stringify(s),"}"),{streamid:e});var v=i.Uo.publisherList[e],m=v&&v.publisher;if(m){var p=v.publisher.isRePublish?Un:Ln,g=Ln;0!=t&&1!=t||(v.retryStreamHandler.streamRetryStartTime=0,m.uploadPublishEvent(n)),[0,Yg.Ue.code].includes(null==n?void 0:n.code)||(m.latestPublishErrCode=n.code),2===t&&0!==n.code&&m.reportMiniSdpInfos(),0!==t&&i.Ln.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=Xn,_=Date.now();if(m){var y=m.publishedTimeStamp;0!=t&&y&&(n&&n.code&&n.code!==Yg.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.Uo.stopPublishingStream(e,n),n=Bg(Bg({},n),{code:Zi.code})):2002===n.code&&(i.Uo.stopPublishingStream(e,n),n.code=Ji.code),m.uploadRTCPublishStats(),i.Ln.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.Dn.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===Yg.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.Dn.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.Dn.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.Uo.useCopyMusic&&!isNaN(this.Dn.engineConfig.choirRole)){this.zn.info("zc.rtc.upvf "+t);var e=[];if(t){var n=this.Dn.getRoomByRoomID(t);n&&e.push(n)}else e.push.apply(e,this.Dn.roomList);e.forEach(function(t){var e=Array.from(new Set(t.streamList.map(function(t){return t.id_name})));i.Uo.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 tu(t,n.zn,"zc.st.ssf")}),e(!0,t)}).catch(function(t){e(!1,null,t)})},t.prototype.onPublishStateUpdateHandle=function(t,i,e){var n=this,s=Cm(this.zn,i);s.info("zc.opsuh.0 call");var r=this.Uo.publisherList[i],o=r.room;if(o)if(0==t){var u=this.Dn.publishStreamList[i];if(u){var a=!o.streamList.find(function(t){return t.stream_id==i&&(t.anchor_id_name==n.Dn.idName||t.id_name==n.Dn.idName||t.user_id===n.Dn.idName)});if(s.info("zc.opsuh.0 room stream "+a),[I.tryPublish,I.retryPublish].includes(u.state)&&a)u.state=I.update_info,o.streamHandler.updateStreamInfo(i,N,u.extra_info,function(t){},void 0,r.publisher.getStreamAddOptions());else s.info("zc.opsuh.0 stream update"),u.state=I.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 "+pi)},t.prototype.WebrtcOnPublishStateUpdateHandle=function(t,i,e){if(this.Dn.publishStreamList[i].state==I.publishing){var n=this.Uo.getRoomByStreamID(i);n&&n.streamHandler.onPublishStateUpdate(t,i,e)}},t.prototype.bindListener=function(t,i){return this.Dn.addListener(t,i)},t.prototype.deleteListener=function(t,i){return this.Dn.deleteListener(t,i)},t.prototype.checkBackgroundCapacity=function(){if(this.Dn.netAppConfig){var t=this.Dn.netAppConfig.media_config.publish_config.object_segmentation_platform;return!!t&&!!su(t,0)}return!0},t}(),Qg=function(){function t(t,i){void 0===i&&(i=!1),this.view=t,this.isH265=i,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)if(this.isH265){if(39!==(126&this.view.getUint8(this.nalu_start+this.start_code_size))>>1)return!0}else if(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 Xg(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 Cg.PEER_CLOSE_REASON_NORMAL:return"Client voluntarily exits.";case Cg.PEER_CLOSE_REASON_STATE_ERROR:return"Status error; Reason: Repeatedly received offer/answer, etc.";case Cg.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 Cg.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 Cg.PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH:return"No matching audio codec; Reason: Client (Web) does not support OPUS, etc.";case Cg.PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH:return"No matching video codec; Reason: Client (Web) does not support h264, h265 and vp8 etc.";case Cg.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 zg.DENIED_ACTION_STOP:return"cancel pushing stream.";case zg.DENIED_ACTION_RETRY_NEXT_IP:return"Try the next ip, if there is no next ip, re-request the route.";case zg.DENIED_ACTION_REDIRECT:return"Redirect to the ip address specified by data.";case zg.DENIED_ACTION_REDISPATCH:return"re-request route.";case zg.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 Dg.DENIED_ERROR_DISPATCH_FAILED:return"media scheduling failed.";case Dg.DENIED_ERROR_EMPTY_PUBLISH_IPS:return"empty publish ips error.";case Dg.DENIED_ERROR_EMPTY_PLAY_IPS:return"empty play ips error.";case Dg.DENIED_ERROR_STREAM_NOT_EXSIT:return"stream does not exist.";case Dg.DENIED_ERROR_APP_NOT_ONLINE:return"APP has been removed.";case Dg.DENIED_ERROR_INVALID_PARAMETERS:return"invalid parameter.";case Dg.DENIED_ERROR_NO_CLIENTIP_SET:return"client ip is not set.";case Dg.DENIED_ERROR_PERMISSION_DENIED:return"No permission, access denied.";case Dg.DENIED_ERROR_SET_STREAM_INFO_FAILED:return"Failed to set stream information.";case Dg.DENIED_ERROR_INTERNAL_ERROR:return"internal error / server busy.";case Dg.DENIED_ERROR_PUBLISH_FORBIDDEN:return"Streaming is banned.";case Dg.DENIED_ERROR_NEW_PUBLISH:return"new publish error.";case Dg.DENIED_ERROR_INNER_ERROR:return"inner error.";case Dg.DENIED_ERROR_MANAGER_STOP:return"manager stop error.";case Dg.DENIED_ERROR_PUBLISH_AUTH_FAILED:return"Stream push authentication failed.";case Dg.DENIED_ERROR_PLAY_AUTH_FAILED:return"Stream pull authentication failed.";case Dg.DENIED_ERROR_SERVER_STOP:return"server stoped error.";case Dg.DENIED_ERROR_SESSION_ID:return"session id error.";case Dg.DENIED_ERROR_MANAGER_TIMEOUT:return"manager timeout.";case Dg.DENIED_ERROR_NEW_PUBLISH_SRC:return"new publish src.";case Dg.DENIED_ERROR_PLAY_SESSION_LIMIT:return"Pull session limit.";case Dg.DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE:return"disable ip port flexible.";case Dg.DENIED_ERROR_PACKET_ILLEGAL_TS:return"packet illegal ts.";case Dg.DENIED_ERROR_PACKET_ILLEGAL_ADDR:return"packet illegal address.";case Dg.DENIED_ERROR_PACKET_ILLEGAL_FORMAT:return"packet illegal format.";case Dg.DENIED_ERROR_CHECK_ADDR_TIMEOUT:return"Check address timed out.";case Dg.DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE:return"Check Address Illegal Signature.";case Dg.DENIED_ERROR_CHECK_ADDR_INCONSTANT:return"Check for address changes.";case Dg.DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT:return"SDP negotiation timed out, check whether the SDP is sent successfully.";case Dg.DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT:return"Address negotiation timed out, check whether the Candidate is sent successfully.";case Dg.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 Dg.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 Dg.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 Dg.DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED:return"Streaming encryption failed";case Dg.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 Dg.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 Dg.DENIED_ERROR_WEBRTC_NEW_SRC:return"After the stream pushing end pushes the stream again, the stream pulling end will receive this message.";case Dg.DENIED_ERROR_WEBRTC_CODEC_NOT_MATCH:return"The client does not support the codec used by the stream source";case Dg.DENIED_ERROR_WEBRTC_CODEC_SWITCH:return"The streaming source switched the encoding format while clients were still pulling the stream";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"}(Cg||(Cg={})),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"}(zg||(zg={})),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",t[t.DENIED_ERROR_WEBRTC_CODEC_NOT_MATCH=3009]="DENIED_ERROR_WEBRTC_CODEC_NOT_MATCH",t[t.DENIED_ERROR_WEBRTC_CODEC_SWITCH=3010]="DENIED_ERROR_WEBRTC_CODEC_SWITCH"}(Dg||(Dg={}));var Wg,Kg={FPS:{code:pt.captureFpsToLow,message:"The video capture frame rate is too low."},VOLUME:{code:pt.captureVolumeToLow,message:"The capture volume is too low."}},$g={V_BITRATE:{code:pt.sendVideoBitrateToLow,message:"The video bit rate sent is too low."},FPS:{code:pt.sendFpsToLow,message:"The video frame rate sent is too low."},A_BITRATE:{code:pt.sendAudioBitrateToLow,message:"The audio bit rate sent is too low."}},tb={A_VOLUME:{code:pt.receiveVolumeToLow,message:"The volume of audio received is too low."},A_DECODE:{code:pt.receiveAudioDecodedFail,message:"The received audio failed to be decoded."},V_DECODE:{code:pt.receiveVideoDecodedFail,message:"The received video failed to be decoded."},V_DECODED_FPS:{code:pt.receiveVideoFpsDecodedToLow,message:"Received video decode frame rate is too low."},RENDER_VIDEO_FPS:{code:pt.renderVideoFpsToLow,message:"The rendered video frame rate is too low."}},ib={FPS:{code:pt.captureFpsNormal,message:"The video capture frame rate is normal."},VOLUME:{code:pt.captureVolumeNormal,message:"The capture volume is normal."}},eb={V_BITRATE:{code:pt.sendVideoBitrateNormal,message:"The video bit rate sent is normal."},FPS:{code:pt.sendFpsNormal,message:"The video frame rate sent is normal."},A_BITRATE:{code:pt.sendAudioBitrateNormal,message:"The audio bit rate sent is normal."}},nb={A_VOLUME:{code:pt.receiveVolumeNormal,message:"The volume of audio received is normal."},A_DECODE:{code:pt.receiveAudioDecodedNormal,message:"The received audio successed to be decoded."},V_DECODE:{code:pt.receiveVideoDecodedNormal,message:"The received video successed to be decoded."},V_DECODED_FPS:{code:pt.receiveVideoFpsDecodedNormal,message:"Received video decode frame rate is normal."},RENDER_VIDEO_FPS:{code:pt.renderVideoFpsNormal,message:"The rendered video frame rate is normal."}},sb=function(){function t(t,i,e,n){this.Dn=t,this.parentEvent=n,this.results={},this.preTime=Date.now(),this.preTotalFps=0,this.preIsNormal={},this.zn=i,this.streamId=e,this.initPreIsNormal(Kg),this.initPreIsNormal($g),this.initPreIsNormal(tb)}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.Dn.actionListener("exceptionUpdate",this.streamId,t)),!this.preIsNormal[n]&&r&&(this.uploadEventData(i),this.Dn.actionListener("exceptionUpdate",this.streamId,i)),this.preIsNormal[n]=r,s=[]}this.results[n]=s},t.prototype.uploadEventData=function(t){var i=this.Dn.reporter.createSpan(a.I,{key:this.parentEvent,par:this.streamId},{key:""},Hr);i.setAttributes({code:Gr(t.code),message:Fr(t.message)}),i.end()},t.prototype.checkRemoteStats=function(t,i){this.recordData(tb.A_VOLUME,nb.A_VOLUME,this.recvAudioVolume(t)),this.recordData(tb.A_DECODE,nb.A_DECODE,this.recvAudioDecode(t)),this.recordData(tb.V_DECODE,nb.V_DECODE,this.recvVideoDecode(t)),this.recordData(tb.V_DECODED_FPS,nb.V_DECODED_FPS,this.recvVideoDecodedFrameRate(t)),this.recordData(tb.RENDER_VIDEO_FPS,nb.RENDER_VIDEO_FPS,this.renderVideoFrameRate(t,i))},t.prototype.checkLocalStats=function(t){this.recordData(Kg.FPS,ib.FPS,this.captureVideoFrameRate(t)),this.recordData($g.FPS,eb.FPS,this.sendVideoFrameRate(t)),this.recordData(Kg.VOLUME,ib.VOLUME,this.sendAudioVolume(t)),this.recordData($g.V_BITRATE,eb.V_BITRATE,this.sendVideoBitrate(t)),this.recordData($g.A_BITRATE,eb.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}(),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)},ob=function(){function t(t,i,e,n,s,r,o){this.Qa=t,this.Xa=i,this.Wa=e,this.jo=s,this.Dn=r,this.Uo=o,this.Ka=null,this.$a=1e3,this._c=null,this.Sc=null,this.Tc=0,this.Qs=0,this.Uc={},this.Vc=0,this.Yc=0,this.probeState=ct.probed,this.publishStat={},this.Ya={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.Zc=0,this.Xc="udp",this.Wc={},this.$c="",this.th="",this.ih=0,this.eh=0,this.nh=void 0,this.connectIPStack=-1,this.sh=new sb(this.Dn,n,this.streamId,jn.event)}return Object.defineProperty(t.prototype,"streamId",{get:function(){return this.Wa.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.Wa.sessionId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerID",{get:function(){return this.Wa.peerID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"To",{get:function(){return this.Wa.localStream},enumerable:!1,configurable:!0}),t.prototype.setPublishQualityTimer=function(){var t=this;null==this.Ka&&(this.Wa.info(Xd+" called ".concat(this.$a," ").concat(this.Qa," ").concat(this.Xa)),(this.Ka||this._c||this.Sc)&&this.clearPublishQualityTimer(),this.Ka=setInterval(function(){t.rh()},this.$a),this.Tc=this.Qs=Date.now(),1e3!==this.$a&&(this.Qa!=this.$a&&(this._c=setInterval(function(){t.notifyPublishQuality()},this.Qa)),this.Xa!=this.$a&&(this.Sc=setInterval(function(){t.reportPublishQuality()},this.Xa))),this.Uc={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.Wa.info("zc.p.0.spqt.1 called ".concat(!!this.Ka," ").concat(!!this._c," ").concat(!!this.Sc)),null!=this.Ka&&(clearInterval(this.Ka),this.Ka=null),null!=this._c&&(clearInterval(this._c),this._c=null),null!=this.Sc&&(clearInterval(this.Sc),this.Sc=null),this.Uc={},this.Yc=0,this.Zc=0},t.prototype.oh=function(){var t=this,i=[],e=!1;if(!this.Wa.peerConnection)return{result:i,hasVideo:e};var n=[],s=this.Wa,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.Wa.peerConnection&&i.push(t.Wa.peerConnection.getStats(n.track)))}),{result:i,hasVideo:e}},t.prototype.rh=function(){var t=this;if(this.Wa.peerConnection){var i=this.oh(),e=i.hasVideo;Promise.all(i.result).then(function(i){0!==i.length&&t.Ka&&t.uh(i.filter(function(t){return t instanceof RTCStatsReport}),i[i.length-1]instanceof RTCStatsReport?null:i[i.length-1],e)}).catch(function(i){t.Wa.info(Xd+" getStats error "+i.toString())})}},t.prototype.uh=function(t,i,e){var n,s,r,o=this;if(t){var u,a,c=this.Uo.checkPreview(this.To),h=c&&c.rtcViewer;h&&(u=h.iu,a=h.eu),u&&u.currentTime||(u=ld(this.To,"video")||u),a&&a.currentTime||(a=ld(this.To,"audio")||a||u);var f=[],l="",d={scenario:this.Dn.scenario,sampleTimeWindow:this.Xa,audioCodec:"",audioTargetBitrate:this.Wa.videoInfo.audioBitrate/1e3||0,audioBitrate:0,audioRtxBitrate:0,videoTargetBitrate:this.Wa.videoInfo.bitRate||0,videoTargetFPS:this.Wa.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.To.getAudioTracks().length>0&&this.To.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.Wa.ip&&(ql(this.Wa.ip)?d.ipv6=this.Wa.ip:d.ipv4=Ll(this.Wa.ip));var v=this.Uc.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.th!==s&&(o.th=s),d.audioCodec=o.th,0!=v&&(d.audioBitrate=8*(e.bytesSent-o.Uc.audioBytesSent)/(e.timestamp-v),e.retransmittedPacketsSent=e.retransmittedPacketsSent||0,e.packetsSent=e.packetsSent||0,d.audioFPS=(e.packetsSent-(e.retransmittedPacketsSent-o.Uc.audioRetransmittedPacketsSent)-o.Uc.audioPacketsSent)/(e.timestamp-v)*1e3||0,g=(e.retransmittedPacketsSent-o.Uc.audioRetransmittedPacketsSent)/(e.packetsSent-o.Uc.audioPacketsSent)),d.audioBitrate<0&&(d.audioBitrate=0),void 0!==e.retransmittedBytesSent){if(0!=v)d.audioRtxBitrate=8*(e.retransmittedBytesSent-o.Uc.audioRetransmittedBytesSent)/(a=e.timestamp-v);o.Uc.audioRetransmittedBytesSent=e.retransmittedBytesSent}o.Uc.audioBytesSent=e.bytesSent,o.Uc.time=e.timestamp,o.Uc.audioPacketsSentTimeStamp=e.packetsSent-o.Uc.audioPacketsSent,o.Uc.audioPacketsSent=e.packetsSent,o.Uc.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.$c!==u&&(o.$c=u),d.videoCodecName=o.$c;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.Uc.videoBytesSent)/(a=e.timestamp-v),d.videoFPS=1e3*(e.framesEncoded-o.Uc.framesEncoded)/a,b=(e.retransmittedPacketsSent-o.Uc.videoRetransmittedPacketsSent)/(e.packetsSent-o.Uc.videoPacketsSent),void 0!==e.retransmittedBytesSent&&(d.retransmitBitrate=8*(e.retransmittedBytesSent-o.Uc.videoRetransmittedBytesSent)/a,d.actualEncBitrate=8*(c-o.Uc.videoActualBytesSent)/a),void 0!==e.qpSum&&(d.frameQp=(e.qpSum-o.Uc.qpSum)/(e.framesEncoded-o.Uc.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.Uc.videoBytesSent=e.bytesSent,o.Uc.framesEncoded=e.framesEncoded,o.Uc.time=e.timestamp,o.Uc.videoPacketsSentTimeStamp=e.packetsSent-o.Uc.videoPacketsSent,o.Uc.videoPacketsSent=e.packetsSent,o.Uc.videoRetransmittedPacketsSent=e.retransmittedPacketsSent,o.Uc.videoRetransmittedBytesSent=e.retransmittedBytesSent,o.Uc.videoActualBytesSent=c,o.Uc.qpSum=e.qpSum,i||o.ah(v,d,e)}else if("remote-inbound-rtp"==e.type&&"video"==n){e.packetsLost>0&&(d.videoPacketsLost=e.packetsLost);var h=e.packetsLost-o.Uc.videoPacketsLost;d.videoPacketsLostRate=h>0?h/o.Uc.videoPacketsSentTimeStamp:0,e.packetsLost>0&&(o.Uc.videoPacketsLost=e.packetsLost),o.Uc.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.Uc.audioPacketsLost;d.audioPacketsLostRate=w>0?w/o.Uc.audioPacketsSentTimeStamp:0,e.packetsLost>0&&(o.Uc.audioPacketsLost=e.packetsLost),o.Uc.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.ah(v,d,e);else if("candidate-pair"!=e.type||!e.nominated||Eh()&&!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.Uo.lastChangeIpTime;if(S&&o.eh<S&&Date.now()-S<=15e3){var E=e.bytesReceived,O=o.Uc.condidateBytesReceived;O&&(E>O?o.ih=0:o.ih++),o.ih>=5&&(o.ih=0,o.eh=S,o.onPublishingError(ue)),o.Uc.condidateBytesReceived=E}else o.ih>0&&(o.ih=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=fd(E,this.Dn.browser))}void 0!==S&&this.Xc!==S&&(this.Wa.info(Xd+" protocol "+S),this.Xc=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=Ul(C);z>=0&&z!==this.connectIPStack&&(this.Wa.info(Wd+" "+this.streamId+" ipStack "+Nt[z]),this.connectIPStack=z,this.onConnectIPUpdate(C))}O=this.hh([{key:"candidateType",value:T},{key:"networkType",value:k}]),"relay"===T&&(O=this.hh([{key:"relayProtocol",value:R},{key:"relatedAddress",value:I},{key:"url",value:N}])),O&&this.Wa.info(Wd+" upload candidate change "+JSON.stringify(this.Wc))}}if("chrome"===this.Dn.browser){var D=null===(s=ph())||void 0===s?void 0:s.match(/Chrome\/(\d+)/);parseInt(D&&D[1]||"100")<=91&&d.isHardwareEncode&&this.Wa.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 A=Zo(p,b,y),P=Zo(m,g,_);if(d.videoQuality=v>0?Qo(A):0,d.audioQuality=v>0?Qo(P):0,this.Dn.networkState!==H.offline&&"disconnected"!==(null===(r=this.Wa.peerConnection)||void 0===r?void 0:r.connectionState)||(d.videoQuality=F.Die,d.audioQuality=F.Die),e&&(!d.frameHeight||!d.frameWidth)){var M=this.To.getVideoTracks()[0];M&&(d.frameHeight=M.getSettings().height||0,d.frameWidth=M.getSettings().width||0)}var x=Math.min(A,P);this.Vc=x,this.fh(d),this.publishStat=d,this.Wa.onStatsUpdated(this.publishStat);var j=Date.now();this.$a===this.Qa?this.notifyPublishQuality():this._c||j-this.Tc+50>=this.Qa&&this.notifyPublishQuality(),this.Xa===this.$a?this.reportPublishQuality():this.Sc||j-this.Qs+50>=this.Xa&&this.reportPublishQuality()}},t.prototype.onConnectIPUpdate=function(t){},t.prototype.notifyPublishQuality=function(){this.Tc=Date.now(),this.Wa.onPublishQualityUpdate(this.streamId,this.Ya)},t.prototype.reportPublishQuality=function(){var t=Date.now();this.Qs=t,this.checkProbe(),this.dh(this.publishStat),this.sh.checkLocalStats(this.publishStat),this.Uo.changeTxQuality(Qo(this.Vc)),this.Wa.sendNetQualityGrade(this.Uo.rxQuality,this.Uo.txQuality)},t.prototype.checkProbe=function(){var t=this.Vc,i=this.Uc.time;this.Wa.debug(Xd+" netQuality "+t+" "+i),t<=this.Uo.targetQuality?this.Yc++:this.Yc=0,i>0&&this.Yc>=this.Uo.probeStartedNum&&Date.now()>this.Wa.probeTime+this.Uo.probeInterval&&(this.Wa.info(Xd+" netQuality "+t+" start net probe"),this.probeState=ct.tryProbe,this.Wa.poorQualityRetryCnt++,this.Uo.startNetProbe(!0,this.Wa))},t.prototype.ah=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.Uc.frameHeight===n&&this.Uc.frameWidth===s)0===t&&(this.Uc.frameHeight=n,this.Uc.frameWidth=s);else{var u=this.Dn.reporter.createSpan(a.H,{key:jn.event,par:this.streamId},{key:""},Jn);u.setAttributes({webrtc_sid:Vn(this.sessionId),w:Hn(s),h:Gn(n)}),u.end(),this.Uc.frameHeight=n,this.Uc.frameWidth=s}0!=t&&(i.videoTransferFPS=1e3*(r-this.Uc.framesSent)/(o-t)),i.videoTransferFPS<0&&(i.videoTransferFPS=0),this.Uc.framesSent=r},t.prototype.fh=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:rb(rb({},this.Ya.video),{videoBitrate:i,videoFPS:e,videoTransferFPS:n,frameHeight:s,frameWidth:r,muteState:o,videoQuality:u,isHardwareEncode:a}),audio:rb(rb({},this.Ya.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.Ya=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.dh=function(t){var i=Date.now();if(0==this.Zc||i-this.Zc>=2e3){t.stream_type="publish",t.stream_id=this.streamId,t.timeStamp=i;var e=this.simplifyPublishDataKey(t);void 0!==this.nh&&(e.gw_vRecvKbps=this.nh.videoRecvBitrate,e.gw_TCStat=this.nh.trafficControlStat,e.gw_vPlr=this.nh.videoLostRate,e.gw_aRecvKbps=this.nh.audioRecvBitrate,e.gw_aPlr=this.nh.audioLostRate),this.Wa.info(Wd+" upload"+JSON.stringify(e)),this.To&&this.Wa.info(Wd+" "+$o(this.To)),this.Uo.updateQuality(dt.publish_quality,t),this.Zc=i}},t.prototype.hh=function(t){for(var i=!1,e=0;e<t.length;e++){var n=t[e],s=n.key,r=n.value;this.Wc[s]!==r&&(this.Wc[s]=r,i=!0)}return i},t.prototype.onPublishingError=function(t){},t.prototype.updateGwPublishNetState=function(t){this.nh=t},t}(),ub=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())})},ab=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=Yh.webrtc_cmd,hb=67109120,fb=function(){function t(t,i,e){this.mh=0,this.ph=0,this.gh=0,this.bh=null,this._h=!1,this.yh=0,this.wh=0,this.Sh=0,this.Eh=0,this.Oh=0,this.Th=0,this.kh=null,this.Rh=0,this.Ih=0,this.Nh=0,this.Ch={},this.zh=new ut,this.Dh=3e3,this.br=1e3,this.Hr=null,this.Ah={},this.Ph=["p2p_net_stats_get"],this.Mh=["getP2PNetStats"],this.xh={first:!0,seq:0},this.jh={first:!0,seq:0},this.Lh={first:!0,seq:0},this.useCmd=!0,this.LOG_TAG=i?"zc.p.prs.0":"zc.p.prs",this.zn=Cm(t,e),this.tu=e,this.zn.info("".concat(this.LOG_TAG,".c 1"))}return Object.defineProperty(t.prototype,"dataChannel",{set:function(t){this.bh=t,t&&this.gh>=hb&&(this._h=!0,this.zn.info("".concat(this.LOG_TAG," enable dc")))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCenterServerConnected",{get:function(){var t;return(null===(t=this.kh)||void 0===t?void 0:t.mediaState)===Pt.LOGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webrtcCenterServerSignal",{set:function(t){this.kh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamId",{get:function(){return this.tu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerId",{get:function(){return this.mh},set:function(t){this.mh!==t&&this.zn.info("".concat(this.LOG_TAG," setPeerId: ").concat(this.mh," ").concat(t,", sid: ").concat(this.sessionId)),this.mh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.ph},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwVersion",{get:function(){return this.gh},set:function(t){this.gh=t,t>=hb&&this.bh&&(this._h=!0,this.zn.info("".concat(this.LOG_TAG," enable dc, sid: ").concat(this.sessionId)))},enumerable:!1,configurable:!0}),t.prototype.reset=function(){var t,i=this,e=this.bh?1:0;this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId," reset, rtt:(").concat(this.Th,",").concat(this.Oh,",").concat(this.Eh,"), dc: ").concat(e,", rtt(").concat(this.Sh,",").concat(this.wh,",").concat(this.yh,"), (tx: ").concat(this.Rh," ").concat(this.Ih,", rx:").concat(this.Nh,"), sid: ").concat(this.sessionId)),this.Hr&&clearTimeout(this.Hr),this.zh.each(function(t){t._data&&delete i.Ch[t._data.seq]}),this.zh.removeAll(),null===(t=this.kh)||void 0===t||t.unregisterPeerCallback(this.ph),this.gh=0,this.ph=0,this.mh=0,this.bh=null,this._h=!1,this.Sh=0,this.wh=0,this.yh=0,this.Th=0,this.Oh=0,this.Eh=0,this.Rh=0,this.Ih=0,this.Nh=0,this.xh.first=!0,this.jh.first=!0,this.Lh.first=!0},t.prototype.isDCReady=function(){return!(!this.bh||"open"!=this.bh.readyState)},Object.defineProperty(t.prototype,"DCState",{get:function(){return this.bh?this.bh.readyState:"invalid"},enumerable:!1,configurable:!0}),t.prototype.isUseDC=function(){return!!this._h&&(!(this.gh<hb)&&"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.zh.push(r);this.Ch[r.seq]=o,this.checkTimer()},t.prototype.removeReqTask=function(t){t._data&&delete this.Ch[t._data.seq],this.zh.remove(t)},t.prototype.checkTimer=function(){var t=this;this.zh.size()>0?this.Hr||(this.Hr=setTimeout(function(){t.Hr=null,t.onTimeout()},this.br)):this.Hr&&(clearTimeout(this.Hr),this.Hr=null)},t.prototype.onTimeout=function(){for(var t,i=this.zh.getFirst(),e=(new Date).getTime();null!=i&&i._data&&!(i._data.sendTime+this.Dh>e);)i._data.isOverDC&&(this._h&&(this.zn.error("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", rollback DC, sid: ").concat(this.sessionId)),this._h=!1),this.Ih++),this.removeReqTask(i),this.Ph.includes(i._data.cmd)||this.zn.warn("".concat(this.LOG_TAG," 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.zh.getFirst();this.checkTimer()},t.prototype.onDataChannelMessage=function(t){var i=new Uint8Array(t),e=i[0];if(11!=e||i.length<4)this.zn.error("".concat(this.LOG_TAG,".dc 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.zn.error("".concat(this.LOG_TAG,".dc 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.zn.error("".concat(this.LOG_TAG,".dc pid: ").concat(this.peerId,", unknown cmd type: ").concat(n,", sid: ").concat(this.sessionId))}},t.prototype.emitCallback=function(t,i){var e=this.Ah[t];e&&e.callback(i.seq,this.ph,i)},t.prototype.updateRtt=function(t){if(this.Th=t,0===this.Eh)return this.Eh=t,void(this.Oh=t);t>this.Eh&&(this.Eh=t),t<this.Oh&&(this.Oh=t)},t.prototype.updateDcRtt=function(t){if(this.Sh=t,0===this.yh)return this.yh=t,void(this.wh=t);t>this.yh&&(this.yh=t),t<this.wh&&(this.wh=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.Nh++;var n=cb.WebrtcCmdReqMsg.decode(t);if(n){var s,r=Object.keys(n)[0];this.zn.debug("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", handleCmdPush fromDC: ").concat(i,", cmd: ").concat(r)),li(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.jh.first||o.seq>this.jh.seq)&&(this.jh.first=!1,this.jh.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.xh.first||o.seq>this.xh.seq)&&(this.xh.first=!1,this.xh.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.mh=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.Lh.first||o.seq>this.Lh.seq)&&(this.Lh.first=!1,this.Lh.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.zn.error("".concat(this.LOG_TAG," 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.zn.error("".concat(this.LOG_TAG," 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.Ch[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.zn.warn("".concat(this.LOG_TAG," 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=cb.WebrtcCmdRspMsg.decode(t);if(n){var s,r=Object.keys(n)[0];switch(li(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.zn.error("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", handleCmdRsp, unknown cmd: ").concat(r,", sid: ").concat(this.sessionId))}s&&this.internalCheckCmdRsp(s,i,e,r),this.checkTimer()}else this.zn.error("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", handleCmdRsp, decode failed"))},t.prototype.sendCmdAck=function(t,i,e,n,s,r){var o,u=cb.WebrtcCmdRspMsg.encode((o={},o[t]={result:e,seq:n},o)).finish();s&&this.isDCReady()?this.sendAckByDC(u):this.kh&&this.kh.sendGWCmdAck(this.ph,{peer_id:this.mh,cmd_id:i},u,r)},t.prototype.sendReqByDC=function(t){this.sendByDC(t,0),this.Rh++},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.bh)||void 0===e||e.send(n)},t.prototype.registerPeerCallback=function(){var t=this;this.kh&&this.kh.registerPeerCallback(this.ph,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===Mt.RSP){if("CmdRsp"===u)return void this.handleCmdRsp(null===(e=t.body)||void 0===e?void 0:e.body,o,!1);var c=this.Ch[o];if(!c)return void this.zn.warn("".concat(this.LOG_TAG," 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.Ah[u];f&&f.callback(null===(s=null==t?void 0:t.header)||void 0===s?void 0:s.seq,this.ph,null==t?void 0:t.body)}}},t.prototype.registerPushCallback=function(t,i){this.Ah[t]={callback:i},this.kh&&["SessionResetPush"].includes(t)&&this.kh.registerPushCallback(t,this.ph,i)},t.prototype.unregisterPushCallback=function(t){delete this.Ah[t],this.kh&&this.kh.unregisterPushCallback(t,this.ph)},t.prototype.dispatchGwNodes=function(t,i,e){if(this.kh){var n=D();this.kh.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.kh){var r=i.serverHost,o=performance.now();this.kh.createSession(t,i,function(t,i,n){return ub(s,void 0,void 0,function(){var s,u;return ab(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.zn.info("".concat(this.LOG_TAG," CreateSessionRsp, node: ").concat(u,", gw ver: ").concat(this.getGwVersString(n.gw_version),", rtt: ").concat(s,", sid: ").concat(i)),this.ph=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.kh){var s=performance.now();this.kh.createSessionWithSdp(t,function(e,r,o){return ub(n,void 0,void 0,function(){var n,u;return ab(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.zn.info("".concat(this.LOG_TAG," CreateSessionWithSdpRsp, node: ").concat(u,", gw ver: ").concat(this.getGwVersString(o.gw_version),", rtt: ").concat(n,", sid: ").concat(r)),this.ph=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.ph,i)},function(t){r&&r(t)}),this.kh&&this.kh.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.ph,i)},function(t){s&&s(t)}),this.kh&&this.kh.sendMediaDescUpdateReq(t,i,e)},t.prototype.sendCandidateInfo=function(t,i,e){var n=this,s=D();this.addReqTask(s,"CandidateInfo",!1,function(t,e){i&&i(t,n.ph,e)},function(t){e&&e(t)}),this.kh&&this.kh.sendCandidateInfo(s,this.ph,t)},t.prototype.sendCloseSession=function(t,i,e){var n=this;if(this.ph>0){var s=D();this.addReqTask(s,"CloseSession",!1,function(t,e){i&&i(t,n.ph,e)},function(t){e&&e(t)}),this.kh&&this.kh.sendCloseSession(s,this.ph,t)}},t.prototype.sendStreamStatus=function(t,i,e,n){var s,r=D(),o=this.isUseDC();if(this.addReqTask(r,"StreamStatus",o,function(t,i){e(t,i)},function(t){n&&n()}),this.useCmd&&this.gh>=hb&&this.peerId>0){this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(r,", sendStreamStatus(").concat(t,", ").concat(i,"), dc:").concat(o));var u=cb.WebrtcCmdReqMsg.encode({stream_status:{mic_status:i,camera_status:t,seq:r}}).finish();o&&this.isDCReady()?this.sendReqByDC(u):this.isCenterServerConnected&&(null===(s=this.kh)||void 0===s||s.sendGWCmdReq(this.ph,r,{peer_id:this.peerId,cmd_id:16,body:u}))}else this.kh&&this.isCenterServerConnected&&this.kh.sendStreamStatus(r,this.ph,t,i,this.streamId);return r},t.prototype.sendStreamAlignmentProperty=function(t){var i=this;return new ni(function(e){var n=D(),s=cb.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.zn.error("".concat(i.LOG_TAG," pid: ").concat(i.peerId,", seq: ").concat(n,", sendStreamPropertyUpdate error: ").concat(t)),e(!1)}),i.zn.info("".concat(i.LOG_TAG," pid: ").concat(i.peerId,", seq: ").concat(n,", sendStreamAlignmentProperty(").concat(t,"), dc: ").concat(r)),r?i.sendReqByDC(s):i.kh?i.kh.sendGWCmdReq(i.ph,n,{peer_id:i.peerId,cmd_id:9,body:s}):e(!1)})},t.prototype.sendSEIUUID=function(t){return ub(this,void 0,void 0,function(){var i=this;return ab(this,function(e){return[2,new ni(function(e,n){var s=D(),r=cb.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.zn.info("".concat(i.LOG_TAG," pid: ").concat(i.peerId,", seq: ").concat(s,", sendSEIUUID:").concat(t,", dc: ").concat(o)),o?i.sendReqByDC(r):i.kh?i.kh.sendGWCmdReq(i.ph,s,{peer_id:i.mh,cmd_id:5,body:r}):n(3)})]})})},t.prototype.subscribeVideoStream=function(t){return ub(this,void 0,void 0,function(){var i=this;return ab(this,function(e){return[2,new ni(function(e,n){var s=D(),r=cb.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.zn.info("".concat(i.LOG_TAG,".dc pid: ").concat(i.peerId,", seq: ").concat(s,", subscribeVideoStream:").concat(t,", dc: ").concat(o)),o?i.sendReqByDC(r):i.kh?i.kh.sendGWCmdReq(i.ph,s,{peer_id:i.mh,cmd_id:2,body:r}):n(3)})]})})},t.prototype.sendRestartIce=function(t,i){return ub(this,void 0,void 0,function(){var e=this;return ab(this,function(n){return[2,new ni(function(n,s){var r=D(),o=cb.WebrtcCmdReqMsg.encode({restart_ice:{ice_ufrag:t,ice_pwd:i,seq:r}}).finish(),u=e.isUseDC();e.addReqTask(r,"restart_ice",u,function(t){li(t[Object.keys(t)[0]]),n(t)},function(t){s(t)}),e.zn.info("".concat(e.LOG_TAG,".dc pid: ").concat(e.peerId,", seq: ").concat(r,", iceUfrag:").concat(t,", icePwd:").concat(i,", dc: ").concat(u)),u?e.sendReqByDC(o):e.kh?e.kh.sendGWCmdReq(e.ph,r,{peer_id:e.mh,cmd_id:28,body:o}):s(3)})]})})},t.prototype.sendNetQualityGrade=function(t,i){var e=D(),n=cb.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.kh&&this.kh.sendGWCmdReq(this.ph,e,{peer_id:this.peerId,cmd_id:6,body:n})},t.prototype.sendBroadcasterStatus=function(t){var i,e=this,n=D(),s=this.isUseDC();if(this.addReqTask(n,"broadcaster_status",s,function(t,i){e.zn.debug("".concat(e.LOG_TAG," pid: ").concat(e.peerId,", seq: ").concat(t,", BroadcasterStatusRsp: ").concat(JSON.stringify(i)))},function(t){e.zn.error("".concat(e.LOG_TAG," pid: ").concat(e.peerId,", seq: ").concat(n,", sendBroadcasterStatus error: ").concat(t))}),this.useCmd&&this.gh>=hb&&this.peerId>0){this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(n,", sendBroadcasterStatus(").concat(t,"), dc:").concat(s));var r=cb.WebrtcCmdReqMsg.encode({broadcaster_status:{status:t,seq:n}}).finish();s?this.sendReqByDC(r):null===(i=this.kh)||void 0===i||i.sendGWCmdReq(this.ph,n,{peer_id:this.peerId,cmd_id:17,body:r})}else this.kh&&this.kh.sendBroadcasterStatus(n,this.ph,t)},t.prototype.sendNetProbeReq=function(t,i){var e,n=this,s=D(),r=this.isUseDC();if(this.addReqTask(s,"net_quality_probe",r,function(i,e){n.zn.debug("".concat(n.LOG_TAG," pid: ").concat(n.peerId,", seq: ").concat(i,", NetProbeRsp: ").concat(JSON.stringify(e))),t&&t(i,e)},function(t){n.zn.error("".concat(n.LOG_TAG," pid: ").concat(n.peerId,", seq: ").concat(s,", sendNetProbeReq error: ").concat(t)),i&&i(t)}),this.useCmd&&this.gh>=hb&&this.peerId>0){this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(s,", sendNetProbeReq, dc: ").concat(r));var o=cb.WebrtcCmdReqMsg.encode({net_quality_probe:{seq:s,action:1}}).finish();r?this.sendReqByDC(o):null===(e=this.kh)||void 0===e||e.sendGWCmdReq(this.ph,s,{peer_id:this.peerId,cmd_id:23,body:o})}else this.kh&&this.kh.sendNetProbe(s,this.ph,this.peerId)},t.prototype.getP2PNetStats=function(t,i){var e,n=this;if(this.peerId){var s=D(),r=this.isUseDC();if(this.addReqTask(s,"p2p_net_stats_get",r,function(i,e){n.zn.debug("".concat(n.LOG_TAG," pid: ").concat(n.peerId,", seq: ").concat(i,", getP2PNetStatsRsp: ").concat(JSON.stringify(e))),t&&t(i,e)},function(t){n.zn.error("".concat(n.LOG_TAG," pid: ").concat(n.peerId,", seq: ").concat(s,", getP2PNetStats error: ").concat(t)),i&&i(t)}),this.useCmd&&this.gh>=hb&&this.peerId>0){var o=cb.WebrtcCmdReqMsg.encode({p2p_net_stats_get:{seq:s}}).finish();r?this.sendReqByDC(o):null===(e=this.kh)||void 0===e||e.sendGWCmdReq(this.ph,s,{peer_id:this.peerId,cmd_id:26,body:o})}else this.kh&&this.kh.getP2PNetStats(s,this.ph,this.peerId)}else this.zn.warn("".concat(this.LOG_TAG," pid: ").concat(this.peerId," invalid, getP2PNetStats)"))},t.prototype.ActivatePlayAudioStream=function(t,i,e){var n,s=this,r=D(),o=this.isUseDC();if(this.addReqTask(r,"active_audio_play",o,function(t,e){s.zn.info("".concat(s.LOG_TAG," pid: ").concat(s.peerId,", seq: ").concat(t,", ActivatePlayAudioStreamRsp: ").concat(JSON.stringify(e))),i&&i(t,e)},function(t){s.zn.error("".concat(s.LOG_TAG,".dc pid: ").concat(s.peerId,", seq: ").concat(r,", ActivatePlayAudioStream error: ").concat(t)),e&&e(t)}),this.useCmd&&this.gh>=hb&&this.peerId>0){this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(r,", ActivatePlayAudioStream(").concat(t,"), dc: ").concat(o));var u=cb.WebrtcCmdReqMsg.encode({active_audio_play:{active:t?0:1,seq:r}}).finish();o?this.sendReqByDC(u):null===(n=this.kh)||void 0===n||n.sendGWCmdReq(this.ph,r,{peer_id:this.peerId,cmd_id:20,body:u})}else this.kh&&this.kh.ActivatePlayAudioStream(r,this.ph,t)},t.prototype.ActivatePlayVideoStream=function(t,i,e){var n,s=this,r=D(),o=this.isUseDC();if(this.addReqTask(r,"active_video_play",o,function(t,e){s.zn.debug("".concat(s.LOG_TAG," pid: ").concat(s.peerId,", seq: ").concat(t,", ActivatePlayVideoStreamRsp: ").concat(JSON.stringify(e))),i&&i(t,e)},function(t){s.zn.error("".concat(s.LOG_TAG," pid: ").concat(s.peerId,", seq: ").concat(r,", ActivatePlayVideoStream error: ").concat(t)),e&&e(t)}),this.useCmd&&this.gh>=hb&&this.peerId>0){this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(r,", ActivatePlayVideoStream(").concat(t,"), dc: ").concat(o));var u=cb.WebrtcCmdReqMsg.encode({active_video_play:{active:t?0:1,layer:0,seq:r}}).finish();o?this.sendReqByDC(u):null===(n=this.kh)||void 0===n||n.sendGWCmdReq(this.ph,r,{peer_id:this.peerId,cmd_id:21,body:u})}else this.kh&&this.kh.ActivatePlayVideoStream(r,this.ph,t)},t.prototype.activateSEIInsert=function(t,i,e,n){var s,r=this,o=D(),u=this.isUseDC();if(this.addReqTask(o,"active_sei_insert",u,function(t,i){r.zn.debug("".concat(r.LOG_TAG," pid: ").concat(r.peerId,", seq: ").concat(t,", activateSEIInsertRsp: ").concat(JSON.stringify(i))),e&&e(t,i)},function(t){r.zn.error("".concat(r.LOG_TAG," pid: ").concat(r.peerId,", seq: ").concat(o,", activateSEIInsert error: ").concat(t)),n&&n(t)}),this.useCmd&&this.gh>=hb&&this.peerId>0){this.zn.info("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(o,", activateSEIInsert(").concat(t,", ").concat(i,"), dc: ").concat(u));var a=cb.WebrtcCmdReqMsg.encode({active_sei_insert:{seq:o,action:t,info_type:i}}).finish();u?this.sendReqByDC(a):null===(s=this.kh)||void 0===s||s.sendGWCmdReq(this.ph,o,{peer_id:this.peerId,cmd_id:25,body:a})}else this.kh&&this.kh.activateSEIInsert(o,this.ph,this.peerId,t,i)},t.prototype.sendPlayStats=function(t){var i,e=D(),n=this.isUseDC();if(this.gh>=83886081&&this.peerId>0){this.zn.debug("".concat(this.LOG_TAG," pid: ").concat(this.peerId,", seq: ").concat(e,", sendPlayStats(").concat(t,"}), dc: ").concat(n));var s=cb.WebrtcCmdReqMsg.encode({play_stats:{seq:e,audio_jitter_ms:t}}).finish();return n?this.sendReqByDC(s):null===(i=this.kh)||void 0===i||i.sendGWCmdReq(this.ph,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"}(Wg||(Wg={}));var lb,db,vb,mb=function(){function t(){this.qh=0,this.Uh=0,this.Bh=0}return t.prototype.reset=function(){this.qh=0,this.Uh=0,this.Bh=0},t.prototype.setGenDataInKbps=function(t){t>5e3&&(t=5e3),this.qh=Math.floor(t/8)},Object.defineProperty(t.prototype,"sendBytesOnems",{get:function(){return this.qh},enumerable:!1,configurable:!0}),t.prototype.generatePadding=function(){if(this.qh<1)return 0;var t=Math.floor(performance.now());if(0===this.Bh)return this.Bh=t,this.Uh=0,0;var i=t-this.Bh;if(i<3)return 0;if(this.Bh=t,i>500)return this.Uh=0,0;var e=i*this.qh+this.Uh;return e<600?(this.Uh=e,0):(this.Uh=0,e)},t}();!function(t){t[t.Normal=0]="Normal",t[t.Control=1]="Control"}(lb||(lb={})),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"}(db||(db={})),function(t){t[t.Default=-1]="Default",t[t.NoVideo=0]="NoVideo"}(vb||(vb={}));var pb=function(){function t(t,i){this.zn=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=lb.Normal,this.continueUpCount=0,this.lastUpdateTargetVideoBitrateTime=0,this.updateTargetVideoBitrateCount=0,this.enable_debug_log=!1,this.Jh=!0,this.Vh=vb.Default,this.Hh=new mb,this.bh=null,this.Gh=0,this.Fh=0,this.Yh={first:!0,seq:0,status:db.UNDERUSE,bandwide:0,targetBitrate:0,rtt:0},this.Zh=0,this.Qh=0,this.Xh=0,this.Wh=0,this.Kh=0,this.$h=!1,this.tf=!1,this.if=null,this.test_padding=0,this.Dn=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=lb.Normal,this.continueUpCount=0,this.lastUpdateTargetVideoBitrateTime=0,this.updateTargetVideoBitrateCount=0,this.Jh=!0,this.Vh=vb.Default,this.Hh.reset(),this.bh=null,this.Gh=0,this.Fh=0,this.Yh.first=!0,this.Yh.seq=0,this.Yh.status=db.UNDERUSE,this.Yh.bandwide=0,this.Yh.targetBitrate=0,this.Zh=0,this.Qh=0,this.Xh=0,this.Wh=0,this.Kh=0,this.$h=!1,this.tf=!1,this.clearProeTimer()},t.prototype.enableVideo=function(t){this.Jh=t},t.prototype.setDatachannel=function(t){this.bh=t},t.prototype.setMinVideoBitrateMode=function(t){0===t&&(this.Vh=t)},t.prototype.getMinVideoBitrateMode=function(){return this.Vh},t.prototype.getBandwide=function(){return this.Yh.bandwide},t.prototype.getFeedback=function(){return this.Yh},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.zn.info("".concat(hv," 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.Vh,", a[").concat(this.maxAudioBitrate,"]")),this.isStart=!0)},t.prototype.stop=function(){this.isStart&&this.zn.info("".concat(hv," 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.zn.info("".concat(hv," 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.Gh=Math.floor(1e3*t.audioBitrate),this.Fh=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=lb.Control,this.continueUpCount=0);var o=this.targetVideoBitrate;if(this.tcState==lb.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.zn.info("".concat(hv," 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.Yh.first||this.compare16BitsSeq(n,this.Yh.seq)>0?(this.Yh.first=!1,this.Yh.seq=n,this.Yh.status=s,this.Yh.bandwide=1e3*r,this.Yh.targetBitrate=1e3*o,this.Yh.rtt=u,this.processBandwide()):this.zn.debug("".concat(hv," handleFeedback, seq reorder: ").concat(this.Yh.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.bh&&"open"==this.bh.readyState){var t=this.getRandomInt(500,1e3);if(t>this.Qh&&(t=this.Qh),this.bh.bufferedAmount>32e3)return this.Qh-=t,void(this.Qh<0&&(this.Qh=0));var i=Math.floor(performance.now());if(t>0&&t<1144){var e=new Uint8Array(t+7);e[0]=Wg.TcPadding,e[1]=this.Zh>>8&255,e[2]=255&this.Zh,e[3]=i>>24&255,e[4]=i>>16&255,e[5]=i>>8&255,e[6]=255&i,this.Zh++,this.Zh>=65536&&(this.Zh=0),this.bh.send(e),this.Qh-=e.byteLength,this.Qh<0&&(this.Qh=0)}}},t.prototype.processBandwide=function(){if(!(!this.enable||!this.Jh||!this.bh||this.Yh.bandwide<=0||this.Yh.targetBitrate<=0||this.Gh<=0||this.Vh!=vb.NoVideo)){var t,i=this.Gh,e=this.minVideoBitrate<=0?5e4:this.minVideoBitrate,n=this.Yh.status,s=this.Yh.targetBitrate,r=this.Yh.bandwide;t=this.Yh.rtt>=300?this.Yh.bandwide:s;var o=e+i+4e4;if(n>0?((r<=e+4e4||r<=1e5)&&(this.Wh++,!1===this.$h&&(this.pauseVideo(),this.$h=!0)),this.Kh=0):n<=0&&(t>o||s>1.5*o)&&(this.Wh=0,this.Kh++,(t>1.2*o&&t>15e4||this.Kh>25||s>1.8*o&&s>25e4)&&this.$h&&(this.tf=!1,this.$h=!1,this.stopBandWideProbe(),this.resumeVideo())),this.$h){var u=s-i;u>0&&n<=0?(this.Xh=u,this.Hh.setGenDataInKbps(u/1e3),this.tf||(this.tf=!0),this.if||this.startBandWideProbe()):this.stopBandWideProbe()}}},t.prototype.startBandWideProbe=function(){var t=this;this.clearProeTimer(),this.tf&&(this.if=setTimeout(function(){var i=t.Hh.generatePadding();t.Qh+=i;if(t.Xh>0)for(var e=t.Xh/16e4+1,n=0;n<e;n++)t.Qh>0&&t.sendPaddingData();t.startBandWideProbe()},40))},t.prototype.stopBandWideProbe=function(){this.Xh=0,this.Qh=0,this.Hh.reset(),this.clearProeTimer()},t.prototype.clearProeTimer=function(){this.if&&(clearTimeout(this.if),this.if=null)},t}(),gb=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())})},bb=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])}}},_b=function(){function t(t,i,e){this.Uo=t,this.ef=100,this.zn=Cm(i,e)}return t.prototype.getMiniSdp=function(t){var i=this,e="zc.s.gmsdp";return this.zn.info("".concat(e," lSDP:").concat(t.length," isMini")),new ni(function(n,s){return gb(i,void 0,void 0,function(){var i,r,o,u,a=this;return bb(this,function(c){return i=this.Uo.miniSdpWorker,r=function(t){a.zn.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.zn.info("".concat(e," parse sdp success buffer:").concat(null==t?void 0:t.byteLength)),u(),!t||!t.byteLength)return r(ln);n(t)}).catch(function(t){return u(),r(t)}),o=setTimeout(function(){a.zn.info("".concat(e," get minisdp timeout")),r(mn)},this.ef),[2]):[2,r(vn)]:[2,r({code:ln.code,message:"sdp error"})]})})})},t.prototype.parseMiniSdp=function(t){var i=this,e="zc.s.prsdp";return this.zn.info("".concat(e," rSDP:").concat(t.length," isMini")),new ni(function(n,s){var r,o=t,u=i.Uo.miniSdpWorker,a=function(t){i.zn.error("".concat(e," error:").concat(JSON.stringify(t))),s(t)},c=function(){r&&(clearTimeout(r),r=null)};if(!o||!o.byteLength)return a({code:dn.code,message:"buffer error"});u?(u.loadMiniSdpToOriginSdp(o).then(function(t){i.zn.info("".concat(e," parse minisdp success sdp:").concat(t.length)),c(),t?n(t):a(dn)}).catch(function(t){c(),a(t)}),r=setTimeout(function(){i.zn.info("".concat(e," parse minisdp timeout")),a(mn)},i.ef)):a(vn)})},t}(),yb=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 wb(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 Sb(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 Eb=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)}}(),Ob=function(){return Ob=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},Ob.apply(this,arguments)},Tb=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())})},kb=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 Rb,Ib=new Uint8Array([0,0,0,1,101,184,0,4,0,0,9,255,254,222,35,192,166,30,73,128]),Nb=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]),Cb=new Uint8Array([0,0,0,1,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,30,186,2,64,0,0,0,1,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,30,160,136,69,150,233,111,11,128,64,0,0,3,0,64,0,0,3,3,194,0,0,0,1,68,1,192,115,192,137]),zb=new Uint8Array([0,0,0,1,40,1,172,26,224,244,133,49,47,246,227,105,128]),Db=jn,Ab=Bn,Pb=Ln,Mb=Db.error,xb=Xn,jb=function(t){function i(i,e,n,s,r,o,u,a){var c,h=t.call(this,e,i)||this;return h.ipV6Prefer=0,h.ipStackNode=Nt.IPv4,h.nf=!1,h.sf=[],h.rf=[],h.uf=[],h.af="",h.cf="",h.hf=500,h.startTime=0,h.ff=!0,h.port=0,h.lf=null,h.df=null,h.vf=3e3,h.mf=3e3,h.pf=16,h.gf=16,h.bf={state:"NO_PUBLISH",code:0},h._f=!1,h.supportTransceiver=!0,h.Lo=!1,h.yf=0,h.wf=0,h.Sf=0,h.Ef=0,h.Of=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.ph=0,h.Tf=[],h.kf=null,h.Rf=null,h.If=null,h.Nf=null,h.parentSpanKey="",h.Cf=0,h.zf=null,h.Df=!1,h.Af=[],h.Pf=[],h.Mf="H264",h.xf=gt.stop,h.isExternal=!1,h.jf=25e3,h.Lf=!1,h.qf="",h.Uf=[],h.ipNode=null,h.ipV4NodeList=[],h.ipV6NodeList=[],h.Bf=0,h.retryFailGwNodes=[],h.retryFailIpV4Nodes=[],h.retryFailIpV6Nodes=[],h.Jf=!1,h.Vf=0,h.Hf=!1,h.Gf=0,h.Ff=0,h.Yf=[],h.Zf=[],h.Qf=[],h.Xf=!1,h.Wf="",h.Kf=!1,h.$f="",h.tl="",h.il=!0,h.el=0,h.probeQuality=0,h.probeTime=0,h.probeNodeList=[],h.probedList=[],h.probeTimer=null,h.nl=0,h.sl=0,h.poorQualityRetryCnt=0,h.rl=[],h.continuousFailCnt=0,h.isUpdateSDP=!1,h.toBeReplacedTracks={},h.send_seq=0,h.dataChannelState=0,h.ol=0,h.ul=0,h.al="",h.cl=[],h.hl=[],h.fl={forceSynchronousNetworkTime:0,alignment:0},h.ll={isSEIStart:!1,SEIType:rt.ZegoDefined,unregisterSeiFilter:"",uuidSend:!1,track:null},h.dl=0,h.reportPublishStateTime=0,h.isRePublish=!1,h.rtcPublishCount=0,h.stopReason="",h.signalTime=0,h.vl=((c={}).PublishEventPush={seq:-1,time:0},c.ClientInfoPush={seq:-1,time:0},c),h.ml=!0,h.pl=!1,h.ip="",h.bl={lanIP:"",wanIP:"",intranet:!1},h.encodeLowVideoFrame=function(t,i){h.encodeFrame(t,i,!0)},h.encodeVideoFrame=function(t,i){h.ll.track?h.encodeFrameAudioOnly(t,i,!1):h.encodeFrame(t,i,!1)},h.recvLastKeyFrameTime=0,h.camera_status=2,h.mic_status=2,h._l=!1,h.yl=0,h.wl=void 0,h.Xr={onUaSocketConnected:function(){var t;h.info("zc.p.0.eh.0 ".concat(null===(t=h.wl)||void 0===t?void 0:t.length," gwNode: ").concat(h.qf)),h.wl&&(h.qf="",h.getDispatchIPNodeMode(),h.Sl.apply(h,h.wl),h.wl=void 0)}},h.id=eu("".concat(o.appid,"_").concat(u.idName,"_").concat(i,"_").concat(Date.now(),"_").concat(D())),h.tu=i,h.dataReport=n,h.qualityTimeInterval=s,h.Uo=o,h.Dn=u,h.Mf=h.Kr("publish_video_codec"),h.ua=a,h.To=a.localStream,h.El=a.zegoCaptureStream,h.Lo=h.Dn.isMiniSdp,h.Lo&&(h.Ol=new _b(o,e,i)),h.Tl=new fb(e,!0,i),h.kl=new pb(h,u),h.El&&h.El.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 ob(h.qualityTimeInterval,r,h,e,h.dataReport,h.Dn,h.Uo),h.qualityHandler.onPublishingError=function(t){h.publishStateUpdateError(t)},h}return Eb(i,t),Object.defineProperty(i.prototype,"Rl",{get:function(){return this.Uo.agentIpStackDetection.IPv4===Dt.reachable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"signal",{get:function(){return this.Il},enumerable:!1,configurable:!0}),i.prototype.updateCBState=function(t){var i=this,e=Object.keys(t).some(function(e){return t[e]!==i.bf[e]});return e&&(this.bf=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.Uo.createSEIWorker()},Object.defineProperty(i.prototype,"seiWorker",{get:function(){return this.Uo.seiWorker},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sessionId",{get:function(){return this.ph},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"videoInfo",{get:function(){return this.xu},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"xu",{get:function(){return this.previewer.videoInfo},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"targetVBitrate",{get:function(){return 0===this.camera_status?this.xu.bitRate:0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lowStreamVBitrate",{get:function(){return this.ua.lowStreamConfig.bitRate},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Ju",{get:function(){return this.previewer.mediaStreamConfig},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamId",{get:function(){return this.tu},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"localStream",{get:function(){return this.To},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerConnection",{get:function(){return this.zf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateNego",{get:function(){return this.xf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"publishOption",{get:function(){return this.Nl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNode",{get:function(){return this.qf},set:function(t){this.qf=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodeList",{get:function(){return this.Uf},set:function(t){this.Uf=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===zt.ZV4Only?0===this.Uf.length:this.ipNodeType===zt.ZV4Priority?0===this.ipV4NodeList.length:(this.ipNodeType===zt.ZV6Priority||0===this.ipV4NodeList.length)&&0===this.ipV6NodeList.length},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPeer",{get:function(){return this.il},set:function(t){this.il=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerID",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dataChannel",{get:function(){return this.bh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sideMediaConfig",{get:function(){return this.ll},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.ua},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.Vc},set:function(t){this.qualityHandler.Vc=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"qualityGrade",{get:function(){var t=this.qualityHandler.Ya;return Math.max(t.video.videoQuality,t.audio.audioQuality)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isLowVideoQuality",{get:function(){var t,i,e,n,s,r;if(0!==this.camera_status)return!1;var o=this.videoInfo.width||(null===(i=null===(t=this.videoSender)||void 0===t?void 0:t.track)||void 0===i?void 0:i.getSettings().width),u=this.videoInfo.height||(null===(n=null===(e=this.videoSender)||void 0===e?void 0:e.track)||void 0===n?void 0:n.getSettings().height),a=this.qualityHandler.Ya.video;if(o&&u&&o>a.frameWidth&&o>a.frameHeight)return!0;var c=this.videoInfo.frameRate||(null===(r=null===(s=this.videoSender)||void 0===s?void 0:s.track)||void 0===r?void 0:r.getSettings().frameRate);return!!(c&&c-a.videoFPS>5)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lastPublishStats",{get:function(){return this.qualityHandler.Uc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"webrtcProtocol",{get:function(){return this.qualityHandler.Xc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lowStream",{get:function(){var t;return null===(t=this.ua)||void 0===t?void 0:t.lowStream},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStateRetry",{get:function(){return[gt.stop,gt.iceClosed,gt.iceFailed].includes(this.xf)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"iceStateDisConnect",{get:function(){return[gt.iceClosed,gt.iceDisconnected,gt.iceFailed].includes(this.xf)},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.pl?"tcp":this.ml?this.webrtcProtocol:"udp"},enumerable:!1,configurable:!0}),i.prototype.Kr=function(t,i){return void 0===i&&(i=!1),this.Dn.settingConfig.getSetting(t,i)},Object.defineProperty(i.prototype,"Fa",{get:function(){return 6===this.state},enumerable:!1,configurable:!0}),i.prototype.isTcVideoPasued=function(){return this.Xf},i.prototype.setSendMuteImage=function(t){this.Kf=t},i.prototype.setSignal=function(t){this.Il!==t&&(this.Il=t,this.Tl.webrtcCenterServerSignal=t)},i.prototype.initStreamReport=function(){this.Cl=this.Ln.createSpan(a.I,{key:jn.event,par:this.tu},{key:Ab.event,par:this.tu},Ab.event,!0),this.dl=(new Date).getTime()},i.prototype.checkAutoTcp=function(){var t=Wo();this.info("zc.p.0.cat ".concat(t," ").concat(this.il)),this.ml=!(!t||!this.il)},i.prototype.publishStateUpdateError=function(t,i,e,n){this.error(iv+" call "+JSON.stringify(t));var s=this.Ln.createSpan(a.H,{key:jn.event,par:this.tu},{key:""},Kn);s.setAttributes({error:null==t?void 0:t.code,message:null==t?void 0:t.message}),s.end(),this.tu&&this.onPublishStateUpdate(W,this.tu,t,i,e,n),this.info(iv+" ended")},i.prototype.netProbeToReDispatch=function(t,i){var e;void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),this._f=!0;var n=null===(e=this.Uo.publisherList[this.tu])||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.kl.getLastVideoBitrate();if(i){var e=this.kl.getBandwide();this.info("".concat(hv," update ref bitrate: ").concat(i,", bw: ").concat(e)),this.Uo.updateReferenceBitrate(i)}this.closeSession(t),this.state=7,this.Lf=!1,null==this.zf&&null==this.zf||(this.zf.close(),this.zf=null,this.videoSender=void 0,this.lowVideoSender=void 0,this.audioSender=void 0),this.zl&&(this.zl=null),this.Dl&&(this.Dl=null),this.resetIceInfos(),this.resetNat64Infos(),this.al="",this.ip="",this.df&&(this.df=null),null!==this.Al&&(clearTimeout(this.Al),this.Al=null),null!==this.Pl&&(clearTimeout(this.Pl),this.Pl=null),null!=this.Ml&&(clearTimeout(this.Ml),this.Ml=null),null!=this.xl&&(clearTimeout(this.xl),this.xl=null),this.jl&&(clearTimeout(this.jl),this.jl=null),this.Ll&&(clearTimeout(this.Ll),this.Ll=null),this.qualityHandler.clearPublishQualityTimer(),this._clearCanvasTimer(),this.unregisterMsgCallback(),this.Tl.reset(),this.ql=0,this.Cf=0,this.Tf=[],this.wl=void 0,this.resetEncBitrate(),this.isUpdateSDP=!1,this.Xf=!1,this.Wf="",this.Kf=!1,this.$f="",this.tl="",this.pf=16,this.gf=16},i.prototype._clearCanvasTimer=function(){var t;null!=this.kf&&(clearInterval(this.kf),null===(t=this.ll.track)||void 0===t||t.stop(),this.ll.track=null,this.kf=null,this.Rf=null,this.If=null,this.Nf=null)},i.prototype.resetPushCmdSeqMap=function(){var t;this.vl=((t={}).PublishEventPush={seq:-1,time:0},t.ClientInfoPush={seq:-1,time:0},t)},i.prototype.Ul=function(){var t=this;this.Tl.registerPushCallback("CloseSessionPush",function(i,e,n){32===n.reason&&(t.Lo=!1,t.Dn.Lo=!1,t.Ef=performance.now()-t.Of),t.Bl(i,e,n)}),this.Tl.registerPushCallback("SessionResetPush",function(i,e,n){t.Jl(i,e,n)}),this.Tl.registerPushCallback("PublishEventPush",function(i,e,n){t.Vl(i,e,n)}),this.Tl.registerPushCallback("ClientInfoPush",function(i,e,n){t.Hl(i,n.peer_id,n.clientip||n.client_ip)}),this.Tl.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.Tl.unregisterPushCallback("CloseSessionPush"),this.Tl.unregisterPushCallback("SessionResetPush"),this.Tl.unregisterPushCallback("PublishEventPush"),this.Tl.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(Bd+" called"),t){if(this.checkAutoTcp(),this.Lo&&!this.Of&&(this.Of=performance.now()),this.state=0,this.Df=!1,this.To=i,this.Nl=e||{},this.kl.stop(),this.Xf=!1,this.Wf="",Gt(this.Nl.enableDTX)){var T=this.Kr("dtx",!0);this.Nl.enableDTX=void 0!==T?!!T:this.Nl.enableDTX}else this.Nl.enableDTX=!!this.Kr("dtx");var k;(null===(s=this.Nl)||void 0===s?void 0:s.SEIType)&&(this.ll.SEIType=this.Nl.SEIType),this.qualityHandler.Ya.video.muteState=(null===(o=null===(r=this.ua)||void 0===r?void 0:r.videoTrack)||void 0===o?void 0:o.enabled)?"0":"1",this.qualityHandler.Ya.audio.muteState=this.To.getAudioTracks().length>0&&this.To.getAudioTracks()[0].enabled?"0":"1",(null===(u=this.Nl)||void 0===u?void 0:u.videoCodec)&&(this.Mf=this.Nl.videoCodec);var R=null===(a=this.ua)||void 0===a?void 0:a.videoPreviewType;switch(R){case"camera":k=this.Kr("camera_video_bitrate",!0);break;case"screen":k=this.Kr("screen_video_bitrate",!0);break;case"custom":k=this.Kr("custom_video_bitrate",!0)}void 0!==k&&(this.info(Bd+" setting "+R+" "+k),this.xu.bitRate=k);var I=this.Kr("bitrate_mode",!0);I&&(this.info(Bd+" setting bitrate_mode "+I),this.xu.startBitrate=I);var N=this.Kr("publish_video_codec",!0);if(N&&(this.info(Bd+" setting publish_video_codec "+N),this.Mf=N),Gt(null===(c=this.Nl)||void 0===c?void 0:c.isSEIStart)&&(this.ll.isSEIStart=this.Nl.isSEIStart),this.ll.isSEIStart){var C=Xo();("H264"!==this.Mf&&"H265"!==this.Mf||!C)&&(this.warn(Bd+" not use sei; support: ".concat(C,", codec: ").concat(this.Mf," ")),this.ll.isSEIStart=!1)}(null===(h=this.Dn.seiConfig)||void 0===h?void 0:h.unregisterSEIFilter)&&(this.ll.unregisterSeiFilter=null===(f=this.Dn.seiConfig)||void 0===f?void 0:f.unregisterSEIFilter),9===this.Dn.scenario&&(this.fl.forceSynchronousNetworkTime=1),[0,1].includes(null===(l=this.Nl)||void 0===l?void 0:l.forceSynchronousNetworkTime)&&(this.fl.forceSynchronousNetworkTime=null===(d=this.Nl)||void 0===d?void 0:d.forceSynchronousNetworkTime);var z=0,D=0;(null===(v=this.Nl)||void 0===v?void 0:v.trafficControlMinVideoBitrate)&&(z=this.Nl.trafficControlMinVideoBitrate),Ft(this.Nl.trafficControlFocusOnMode)||(D=this.Nl.trafficControlFocusOnMode);Gt(this.Nl.enableTrafficControl)&&this.kl.setEnable(this.Nl.enableTrafficControl);var A=0,P=0;if(this.xu.bitRate&&"target"===this.xu.startBitrate&&(A=this.xu.bitRate),z>0)P=z;else if(this.xu.minBitrate)P=this.xu.minBitrate;else if("screen"===this.ua.previewType){var M=function(t){var i=0,e=t.frameRate,n=t.width*t.height*(e<=30?e:30);return Vt(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.xu);P=M.minBitrate,this.info(Bd+" resolution: ".concat(M.resolution,", min bitrate: ").concat(P))}if(this.kl.setVideoBitrate(this.xu.bitRate),this.kl.setMinVideoBitrate(P),this.kl.setStartVideoBitrate(A),isNaN(this.xu.audioBitrate)||this.kl.setAudioBitrate(this.xu.audioBitrate),this.kl.enableVideo(!!(null===(m=this.ua)||void 0===m?void 0:m.videoTrack)),Vt(this.Nl.trafficControlMinVideoMode)&&this.kl.setMinVideoBitrateMode(this.Nl.trafficControlMinVideoMode),this.canSetBandWidthBySender()&&null!=n&&n>0){var x=this.Kr("ref_bitrate_on");(null!=x?x:this.Dn.engineConfig.enableReferenceBitrate)&&!this.ua.enableDualStream&&this.kl.setReferenceVideoBitrate(n)}this.kl.updateVideoTargetBitrate=function(t){O.applyVideoBitrate(t)},this.kl.pauseVideo=function(){O.onTcPauseVideo()},this.kl.resumeVideo=function(){O.onTcResumeVideo()},this.kl.start(),this.Ln.spanSetAttributes({key:Db.event,par:this.tu},{video_en_codec_id:Db.video_en_codec_id(this.getCodecId(this.Mf)),audio_c_channel_count:Db.audio_c_channel_count(2==this.xu.channelCount?2:1),audio_en_bps:Db.audio_en_bps(this.xu.audioBitrate),aec_level:Db.aec_level(1==this.Ju.AEC?2:0==this.Ju.AEC?0:2),ans_level:Db.ans_level(1==this.Ju.ANS?2:0==this.Ju.ANS?0:2),agc:Db.agc(1==this.Ju.AGC||0!=this.Ju.AGC),video_activate:Db.video_activate(!!(null===(g=null===(p=this.ua)||void 0===p?void 0:p.videoTrack)||void 0===g?void 0:g.enabled)),audio_activate:Db.audio_activate(!!(null===(_=null===(b=this.ua)||void 0===b?void 0:b.audioTrack)||void 0===_?void 0:_.enabled)),scenario:this.Dn.scenario,traffic_control_min_video_bitrate:{bitrate:Db.traffic_control_min_video_bitrate.bitrate(z),mode:Db.traffic_control_min_video_bitrate.mode(D)},cap_volume:this.previewer.volume,is_peer:Db.is_peer(this.il)}),this.Cl.setAttributes({room_id:Ab.room_id(null===(w=null===(y=this.Uo.publisherList[this.tu])||void 0===y?void 0:y.room)||void 0===w?void 0:w.roomID),room_sid_string:Ab.room_sid_string(null===(E=null===(S=this.Uo.publisherList[this.tu])||void 0===S?void 0:S.room)||void 0===E?void 0:E.roomSessionID),max_retry_interval:Ab.max_retry_interval(this.Dn.streamRetryTime),scenario:this.Dn.scenario,use_resource_type:Ab.use_resource_type(["rtc"])}),this.il?this.Gl({encodedInsertableStreams:this.ll.isSEIStart}):this.Sl(),null!=this.Ml&&(clearTimeout(this.Ml),this.Ml=null),this.Ml=setTimeout(function(){O.error(Bd+" waiting timeout"),O.publishStateUpdateError(Mb.Ee)},this.jf)}else this.error(Bd+" "+t+" streamId is null")},i.prototype.Sl=function(t){var i,e,n,s,r,o=this;if(!(null===(i=this.Il)||void 0===i?void 0:i.isUaConnected))return this.info(Bd+" wait to create session"),this.wl=[t],void this.Il.on("uaConnected",this.Xr.onUaSocketConnected);this.ql=D();var u=this.tu;1==this.Uo.testEnvironment&&(u="zegotest-"+this.Uo.appid+"-"+this.tu),this.Uo.gwNode&&(this.qf=this.Uo.gwNode);var a=this.Kr("gw_nodes");a&&Xt(a)&&a.length>0&&(this.info(Bd+" setting "+JSON.stringify(a)),this.Uf=a,this.qf=this.Uf[0]||this.qf),this.setTurnTcp();var c=this.Kr("udp_or_tcp",!0);c&&(this.info(Bd+" setting udp_or_tcp "+c),this.pl="tcp"===c),this.pl&&(this.il=!1,this.ml=!1);var h=(null===(n=null===(e=this.Uo.publisherList[this.tu])||void 0===e?void 0:e.room)||void 0===n?void 0:n.roomID)||(null===(s=this.Dn.roomList[0])||void 0===s?void 0:s.roomID);this.getIPStackNode(),this.info("".concat(Bd," session req, seq: ").concat(this.ql," gwNode: ").concat(this.qf,", ipNodeType: ").concat(this.ipNodeType,", ").concat(this.il?"peer":"turn",", ipv6_prefer: ").concat(this.ipV6Prefer));var f=this.Fl(h),l=f.params,d=f.paramsExt;this.Yl=d;var v=or,m=function(){o.state=1,o.info(Bd+" called success"),o.xf=gt.start};if(this.il){this.getLocalMiniSdp(t.sdp,function(i){var e=(new Date).getTime(),n=o.getSpan(or.event,o.parentSpanKey),s={};i?(o.info(Bd+" isMini"),s.miniSdp=i):s.sdp=t.sdp,n.setAttributes({server_host:o.qf,ip_mode:o.ipV6Prefer,req_params_ext:d}),o.Tl.createSessionWithSdp(Ob(Ob({seq:o.ql,type:0,mode:0,streamId:u,videoInfo:o.xu,strAuthParam:o.Nl&&o.Nl.streamParams||""},s),{serverHost:o.qf,params:l,paramsExt:d,roomID:h,geo:{type:o.Uo.geo.type,areaList:o.Uo.geo.areaList},ipV6Prefer:o.ipV6Prefer}),function(t,i,s){return Tb(o,void 0,void 0,function(){var r;return kb(this,function(o){return r=(new Date).getTime(),this.info(Bd+" create session time "+(r-e)),wd(s),this.Dn.Bo(n,{sdp:s.sdp}),n.setAttributes({webrtc_sid:i,is_mini:v.is_mini(this.Lo),gw_nodes:v.gw_nodes(s.gw_nodes),ip_infos:s.ips,ip_v6_infos:s.ipv6s,gw_nodes_ttl:v.gw_nodes(s.gw_nodes_ttl),gw_version:v.gw_version(s.gw_version),rsp_params_ext:s.params_ext}),n.end(),this.Ln.spanSetAttributes({key:Db.event,par:this.tu},{gw_version:Db.gw_version(s.gw_version)}),this.xf!==gt.iceConnected&&this.getSpan(hr,this.parentSpanKey,"",!0),this.Zl(t,i,s,this.ipV6Prefer),[2]})})},function(t,i){if(o.ql==i){var e=1==t?Mb.ke:Mb.Re;o.info(Bd+" create session fail. signal: ".concat(o.Il.state,"; ws: ").concat(o.Il.mediaState)),o.Ln.setError(n,e),o.publishStateUpdateError(e)}else o.warn(Bd+" seq is not match.")}),m()})}else{var p=this.getSpan(or.event,this.parentSpanKey);p.setAttributes({server_host:this.qf,ip_mode:this.ipV6Prefer});var g={type:0,mode:0,streamID:u,strAuthParam:(null===(r=this.Nl)||void 0===r?void 0:r.streamParams)||"",serverHost:this.qf,params:l,roomID:h,geo:{type:this.Uo.geo.type,areaList:this.Uo.geo.areaList},ipV6Prefer:this.ipV6Prefer};this.Tl.createSession(this.ql,g,function(t,i,e){return Tb(o,void 0,void 0,function(){return kb(this,function(n){return wd(e),p.setAttributes({webrtc_sid:v.webrtc_sid(i),gw_nodes:v.gw_nodes(e.gw_nodes),ip_infos:e.ips,ip_v6_infos:e.ipv6s,gw_nodes_ttl:v.gw_nodes(e.gw_nodes_ttl),gw_version:v.gw_version(e.gw_version)}),p.end(),this.Ln.spanSetAttributes({key:Db.event,par:this.tu},{gw_version:Db.gw_version(e.gw_version)}),this.Ql(t,i,e,this.ipV6Prefer),[2]})})},function(t,i){if(o.ql==i){var e=1==t?Mb.ke:Mb.Re;o.Ln.setError(p,e),o.publishStateUpdateError(e)}else o.warn(Bd+" seq is not match.")}),m()}},i.prototype.Ql=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.Xl,h="webrtc://".concat(a,"/").concat(c,"/").concat(this.tu);if(this.Ln.spanSetAttributes({key:this.parentSpanKey,par:this.tu},{webrtc_sid:e.session_id,url:h}),this.info(Bd+" sessionId:"+e.session_id),this.ql==t){this.resetPushCmdSeqMap();var f=e.client_ip||e.clientip;f&&(this.Dn.clientIP=f),this.el=e.peer_id;var l=0,d=(new Date).getTime();if(this.dl&&(this.info(Bd+" create signal time "+(l=d-this.dl)),this.signalTime=l),this.ul=d,0!==e.result){if(this.error(Bd+" create session failed "+e.result),1021===(null==e?void 0:e.result))return void this.publishStateUpdateError(Mi,!0);if(2012===(null==e?void 0:e.result))return void this.publishStateUpdateError(Mb.Je,!0);2016===(null==e?void 0:e.result)&&n===Ct.kV6AndV4&&(this.ff=!1),this.publishStateUpdateError(Mb.Re)}else this.ph=e.session_id,this.Df=!0,this.info(Bd+" create session success "+this.ph),this.setGwNodes(e,!1,n,t),n===Ct.kV6AndV4&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.ff=!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(Bd+" isRestartIce "+this.nf),this.Wl(e)}else this.error(Bd+" seq is not match.")},i.prototype.Zl=function(t,i,e,n){var s,r,o,u=this;if(this.info(Bd+" sessionId:"+i),this.ql==t){this.resetPushCmdSeqMap();var a=e.client_ip||e.clientip;a&&(this.Dn.clientIP=a),this.el=e.peer_id;var c=0,h=(new Date).getTime();if(this.dl&&(this.info(Bd+" create signal time "+(c=h-this.dl)),this.signalTime=c),this.ul=h,0!==e.result){if(108===e.result){if("H265"===this.Mf){if(!this.publishOption.enableAutoSwitchVideoCodec)return void this.publishStateUpdateError(Mb.Ve,!0,"not support H265 codec");this.Nl.videoCodec="H264",this.info("".concat(Bd," switch video codec to ").concat(this.Nl.videoCodec))}}else 110===e.result&&(this.Lo=!1,this.Dn.Lo=!1,this.Ef=performance.now()-this.Of,this.yf=2);if(this.error(Bd+" create session failed "+e.result),1021===(null==e?void 0:e.result))return void this.publishStateUpdateError(Mi,!0);if(2012===(null==e?void 0:e.result))return void this.publishStateUpdateError(Mb.Je,!0);2016===(null==e?void 0:e.result)&&n===Ct.kV6AndV4&&(this.ff=!1),this.publishStateUpdateError({code:Mb.Re.code,message:Mb.Re.message+" result:"+e.result})}else this.ph=i,this.Df=!0,this.setGwNodes(e,!1,n,t),this.info(Bd+" get remote session success "),n===Ct.kV6AndV4&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.ff=!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(Bd+" isRestartIce "+this.nf),this.Ul(),this.parseRemoteSdp(e,function(t){if(u.ml){if(u.info(Bd+" fully auto tcp"),!u.setConfiguration(t,e.params_ext))return void u.publishStateUpdateError(he,!1);u.setLocalSdp(u.Dl)}u.Kl(t,void 0,e.params_ext,null==e?void 0:e.mini_sdp)},function(t){u.publishStateUpdateError(t)})}else this.error(Bd+" seq is not match.")},i.prototype.$l=function(t){var i,e=this;if(this.info(av+" 1"),t){var n=t.candidate,s=t.sdpMid,r=t.sdpMLineIndex;if(n)this.info(av+" addIceCandidate"),null===(i=this.zf)||void 0===i||i.addIceCandidate(new RTCIceCandidate({sdpMid:s,sdpMLineIndex:r,candidate:n})).then(function(){e.info(av+" add can suc")}).catch(function(t){e.info(av+" add can fail, ".concat(t.message))})}},i.prototype.Fl=function(t){var i="",e=[],n={},s=this.Dn.seiConfig.SEIPass;Gt(s)&&(n.sei_filter_pass=s?1:0),n.auto_switch_turn_type="firefox"===this.Dn.browser?2:1,this.Dn.idName&&e.push("zguid="+this.Dn.idName),t&&e.push("zgrid="+t),this.Uo.isProxy&&(n.zg_proxy=1),1===this.fl.forceSynchronousNetworkTime&&(n.sync_ntp=1);var r=this.Nl,o=r.setDeviceDelayByUser,u=r.trafficControlFocusOnMode,a=r.enableTrafficControl;isNaN(o)||(n.ktv_device_delay=o),Gt(a)&&(n.tc_type=a?0:2),isNaN(u)||(n.tc_focuson_mode=0==u?1:0);var c=Rh(),h=this.Kr("vid_clock_rate_est");(c&&(c.includes("18_4")||c.includes("18_5"))||h)&&(n.enable_vid_clock_rate_est=1);var f=this.kl.getMinVideoBitrate();f>0&&(n.tc_min_video_kbps=f<.7*this.xu.bitRate?f:.7*this.xu.bitRate);return n.proto_flags=2,this.Kr("peer_signal_over_dc")&&(n.proto_flags|=256),e.length>0&&(i=e.join("&")),{params:i,paramsExt:n}},i.prototype.getDispatchIPNodeMode=function(){if(!this.qf){this.info("zc.p.0.gdinm call");var t=this.Uo.getStreamIPNodesMode(),i=t.ipNodeType;this.ipV6Prefer=t.ipV6Prefer,this.ipNodeType=i,this.ipV6Prefer===Ct.kV6AndV4&&!this.ff&&this.Rl&&(this.ipV6Prefer=Ct.kV4AndV6,this.ipNodeType=zt.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===Ct.kV4Only)this.ipNodeType=zt.ZV4Only;else{var t=this.Uo.getRetryIPPreferNodeType().ipNodeType;this.ipNodeType=t}this.info("zc.p.0.grinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))},i.prototype.getRetryIPv6Prefer=function(){this.ipV6Prefer=this.Uo.getIPv6PreferByGwNode(this.gwNode)},i.prototype.checkIfToRestart=function(t){this.nf=t!==Ct.kV4Only&&(this.ipNodeType===zt.ZV6AndV4Priority||this.Dn.selectIPStackMode===St.IPv4Prefer&&this.Uo.agentIpStackDetection.IPv4===Dt.reachable&&this.ipNodeType===zt.ZV6Priority)},i.prototype.getIPStackNode=function(){if(this.gwNode){var t=ed(this.gwNode);this.ipStackNode=Ul(t)}else this.ipStackNode=[zt.ZV4Only,zt.ZV4Priority].includes(this.ipNodeType)?Nt.IPv4:Nt.IPv6},i.prototype.setGwNodes=function(t,i,e,n){var s,r,o;if(this.info("".concat(ov," 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(ov," 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=ud(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=ad(t.ips,this.retryFailIpV4Nodes,i),this.retryFailIpV4Nodes=[]),(null===(o=null==t?void 0:t.ipv6s)||void 0===o?void 0:o.length)>0&&(c=ad(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.qf="",this.Uf=[],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(uv+" "+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.Uf=t.length>0?t:this.Uf,this.ipV4NodeList=n.length>0?n:this.ipV4NodeList,this.ipV6NodeList=s.length>0?s:this.ipV6NodeList,e===Ct.kV4Only?(this.qf=t.length>0?this.Uf[0]:this.qf,t.length>0&&u()):e==Ct.kV4AndV6&&n.length>0?(this.qf=cd(n[0]),this.ipNode=n[0],u()):e===Ct.kV6AndV4&&s.length>0?(this.qf=cd(s[0]),this.ipNode=s[0],u()):(this.Uf.length>0&&(this.qf=this.Uf[0]),this.info("".concat(uv," no gwNode ").concat(e," ").concat(n.length," ").concat(s.length)),this.ipNodeType=zt.ZV4Only,this.ipStackNode=Nt.IPv4),this.Uo.updateCachedGwNodesList(this.streamId,!0,t||[],o,n,s)}},i.prototype.dispatchGwNodes=function(t,i,e){var n=this,s=this.tu;1==this.Uo.testEnvironment&&(s="zegotest-"+this.Uo.appid+"-"+this.tu);var r=t;r===St.IPv6Prefer&&!this.ff&&this.Rl&&(r=St.IPv4Prefer);var o=this.getSpan(qn,this.parentSpanKey);o.setAttributes({ip_mode:t}),this.Tl.dispatchGwNodes({type:0,streamID:s,geo:{type:this.Uo.geo.type,areaList:this.Uo.geo.areaList},ipV6Prefer:r},function(t,e,n){wd(n),Ei(o,{gw_nodes:n.gw_nodes,ip_infos:n.ips,ip_v6_infos:n.ipv6s}),i&&i(n)},function(t,i){n.Ln.setError(o,t),e&&e(t)})},i.prototype.Wl=function(t){var i;return Tb(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 kb(this,function(D){switch(D.label){case 0:return this.info((e=Vd)+" called"),n=[],this.Uo.autoSwitchProtocol=this.Kr("auto_to_tcp")||!1,s=this.Kr("udp_max_fail_num"),!isNaN(s)&&(this.Uo.maxUdpFailNum=s),u=(r=this.Uo).maxUdpFailNum,a=r.udpFailNum,this.info(e+" autoToTcp: ".concat(o=r.autoSwitchProtocol,", udpFailNum: ").concat(a,", maxUdpFailNum: ").concat(u,".")),o&&!this.pl&&a>=u&&(this.info(e+" switch to tcp. "),this.pl=!0,this.ml=!1),(c=this.Kr("udp_or_tcp",!0))&&(this.info(e+" setting udp_or_tcp "+c),this.pl="tcp"===c),h=void 0,f=this.bl.wanIP=(t.gw_nodes[0]||this.qf).split(":")[0],!this.Uo.isProxy||this.Uo.isLocalProxy?[3,2]:(l=null==ll?void 0:ll.proxyCtrl,[4,Promise.all([l.getTurnInfo(),l.intranetCheck(jl(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.Yl.coturn_internal=w),S=xl(b),E="turn:".concat(S,":").concat(_,"?transport=").concat(this.pl?"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(xl(w))),h=[{credential:g,urls:[E],username:y}]),m.code?this.warn(e+" use intranetCheck failed."+JSON.stringify(m)):this.bl.intranet=m.data.intranet||!1,[3,3];case 2:this.Uo.isLocalProxy&&this.Uo.turnServers?(h=(T=this.Uo.turnServers).map(function(t){return{credential:t.credential,urls:[t.url],username:t.username}}),this.info(e+" use local proxy: "+JSON.stringify(T)),this.bl.intranet=!1):t.turn_server&&(O=[],t.turn_server.split(";").forEach(function(t){var i=Bl(t).replace("[","").replace("]",""),e=Ul(i);if(z.ipStackNode===e?O.push(t):z.sf.push(t),e==Nt.IPv4){var n=yd(i),s=t.replace(i,"[".concat(n,"]"));z.Uo.isCandidateHasIPv6&&O.push(s)}}),(C=this.sf).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.pl?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.ll.isSEIStart},this.af=t.turn_username,this.cf=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.Gl(I),this.Ul(),this.info(e+" call success"),[2]}})})},i.prototype.td=function(t,i){var e=this.vl[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.vl[t]))),!1):(this.vl[t]={seq:i,time:r},!0)},i.prototype.onReceivedDataChannel=function(t){var i=new Uint8Array(t.data,0,1);i[0]==Wg.Signal?this.Tl.onDataChannelMessage(t.data):i[0]==Wg.TcFeedback&&this.kl.handleFeedback(t.data)},i.prototype.Gl=function(t){var i,e,n,s,r,o,u,a=this,c=Vd;this.zf=new RTCPeerConnection(t),this.zf.onicecandidate=function(t){a.onIceCandidate(t)},this.zf.onsignalingstatechange=function(t){a.onSignalStateChange(t)},this.zf.connectionState?this.zf.onconnectionstatechange=function(t){a.ed(t)}:this.info("".concat(c," not support connectionState")),this.zf.oniceconnectionstatechange=function(t){a.onIceConnectionStateChange(t)};var h=this.Kr("peer_signal_over_dc"),f=!(!this.kl.isEnable()||0!=this.kl.getMinVideoBitrateMode());if(this.Uo.isDataChannelEnabled||h||f){var l={ordered:!1};this.info("zc.p.dc.0.n option:"+JSON.stringify(l)+" enable:"+h+" "+f),this.ol=0,this.bh=this.zf.createDataChannel(this.tu,l),this.bh.binaryType="arraybuffer",h&&(this.Tl.dataChannel=this.bh),f&&this.kl.setDatachannel(this.bh),this.bh.onopen=function(t){a.info("zc.p.dc.0.o data channel open"),a.dataChannelState=1},this.bh.onclose=function(t){a.error("zc.p.dc.0.c onclose"),a.dataChannelState=0},this.bh.onmessage=function(t){if(a.ol++<3&&a.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,a.onReceivedDataChannel(e)}}else a.onReceivedDataChannel(t)}}var d=[],v=[],m=Xo(),p=this.isRePublish?Un:Ln,g=0;if(this.lowStream&&(g=1,this.lowStream.getVideoTracks().forEach(function(t){var i;if("video"===t.kind){a.info(Bd+" lt-id: "+t.id);var e=null===(i=a.zf)||void 0===i?void 0:i.addTrack(t,a.lowStream);a.lowVideoSender=e,a.ll.isSEIStart&&e&&m&&a.nd(e,!0)}}),this.Ln.spanSetAttributes({key:Db.event,par:this.tu},{low_stream_params:null===(i=this.ua)||void 0===i?void 0:i.lowStreamConfig})),this.Ln.spanSetAttributes({key:p.event,par:this.tu},{is_dual_stream:Ln.is_dual_stream(g),is_mini:Ln.is_mini(this.Lo)}),this.Ln.spanSetAttributes({key:Db.event,par:this.tu},{is_dual_stream:Db.is_dual_stream(g)}),this.To){if(this.To.getTracks().forEach(function(t){var i,e,n=a.ll.isSEIStart&&m;a.info("".concat(c," pc addTrack enable ").concat(t.kind," ").concat(t.enabled," ").concat(a.ua.isVideoEnabled)),("audio"===t.kind&&a.previewer.isAudioEnabled||"video"===t.kind&&(t.enabled||n))&&(e=null===(i=a.zf)||void 0===i?void 0:i.addTrack(t,a.To))&&"video"===t.kind&&a.kl.getStartVideoBitrate()>0&&(a.ua.videoInfo.contentHint&&"detail"===a.ua.videoInfo.contentHint||e.track&&"contentHint"in e.track&&(a.info("".concat(hv," setContentHint: ").concat(e.track.contentHint," => detail, tid :").concat(e.track.id)),e.track.contentHint="detail",a.Wf="motion")),n&&e&&(a.info(Bd+" sei transform: "+t.kind),"video"===t.kind?a.nd(e):"audio"===t.kind&&a.sd(e)),tu(t,a.zn,c,{streamID:a.tu})}),!(null===(e=this.ua)||void 0===e?void 0:e.videoTrack)&&this.ll.isSEIStart){this.xu.bitRate||(this.xu.bitRate=50);var b=this.ll.track=this._addCanvasStreamVideoTrack(),_=this.zf.addTrack(b,this.To);_&&"video"==b.kind&&m&&this.nd(_)}(null===(n=this.ua)||void 0===n?void 0:n.videoTrack)&&!this.ua.hasStopCaptureVideo&&this.ua.isVideoEnabled&&(d=[null===(s=this.ua)||void 0===s?void 0:s.videoTrack]),this.ua.isAudioEnabled&&(v=this.To.getAudioTracks());var y,w=!1,S=!1;if(d.length>0)this.info(c+" video device: "+(y=d[0]).label+" ; set: "+JSON.stringify(y.getSettings())),w=!0;if(v.length>0)this.info(c+" audio device: "+(y=v[0]).label+" ; set: "+JSON.stringify(y.getSettings())),S=!0;var E=null===(r=this.zf)||void 0===r?void 0:r.getSenders().find(function(t){var i;return"video"===(null===(i=t.track)||void 0===i?void 0:i.kind)&&t!==a.lowVideoSender}),O=null===(o=this.zf)||void 0===o?void 0:o.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(c+" ts sender ".concat(!!E," ").concat(!!O)),!w&&E&&this.warn(c+" vt diff ".concat(!!this.previewer.videoTrack," ").concat(this.localStream===(null===(u=this.previewer)||void 0===u?void 0:u.localStream))),w||this.ll.isSEIStart||E||(this.info(c+" add vt"),E=this.zf.addTransceiver("video",{direction:"sendrecv"}).sender),S||O||(this.info(c+" add at"),O=this.zf.addTransceiver("audio",{direction:"sendrecv"}).sender)):this.supportTransceiver=!1,this.videoSender=E,this.audioSender=O}var T={offerToReceiveAudio:v.length>0?1:0,offerToReceiveVideo:d.length>0?1:0};!0===this.Nl.enableDTX&&(T.voiceActivityDetection=!0),this.df=T,this.info(c+" createOffer: "+JSON.stringify(T));var k=this.getSpan(ir,this.parentSpanKey);k.setAttributes({is_dual_stream:nr(this.lowStream?1:0)}),this.zf.createOffer(T).then(function(t){a.Dn.Bo(k,{sdp:t.sdp}),Ei(k,{is_mini:er(a.Lo)}),a.onCreateOfferSuccess(t)},function(t){a.error(c+" create offer error "+t.toString()),a.Ln.setError(k,{code:Mb.Oe.code,message:t.toString()}),a.publishStateUpdateError(Mb.Oe,!0)})},i.prototype.restartIce=function(){var t,i=this,e="zc.p.0.rsi";this.info("".concat(e," call")),null===(t=this.zf)||void 0===t||t.createOffer(Ob(Ob({},this.df),{iceRestart:!0})).then(function(t){var n,s,r;if(i.info("".concat(e," createOffer suc")),t.sdp){i.rd(t);var o=td(t.sdp),u=id(t.sdp);i.info("".concat(e," ice ").concat(o," ").concat(u));var a={iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:i.sf,username:i.af,credential:i.cf}],encodedInsertableStreams:i.ll.isSEIStart};i.info("".concat(e," set config ").concat(JSON.stringify(a))),null===(n=i.zf)||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.zf)||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.zf)||void 0===r||r.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:i.zl})).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.rf.forEach(function(t){var n;null===(n=i.zf)||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.sf=[],this.af="",this.cf="",this.rf=[]},i.prototype.resetNat64Infos=function(){this.info("zc.p.0.rni.0 call"),this.uf=[]},i.prototype.switchVideoCodec=function(t,i){var e=this,n="zc.p.0.sc.0";return new Promise(function(s,r){var o;e.df?null===(o=e.zf)||void 0===o||o.createOffer(e.df).then(function(o){if(!o.sdp)return e.warn("".concat(n," create offer sdp none")),void r(!1);var u=ml.getSDPVideoCodec(o.sdp);if(u&&0===u[i].length)return e.warn("".concat(n," code not support")),void r(!1);e.Mf=i,e.onCreateOfferSuccess(o,!0,void 0,function(i){return Tb(e,void 0,void 0,function(){return kb(this,function(e){return 0!==i?(this.Mf=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(t){var i;void 0===t&&(t=!1);var e=null===(i=this.previewer.videoTrack)||void 0===i?void 0:i.getSettings(),n=0===this.lastPublishStats.framesEncoded&&0!==(this.publishStat.inputWidth||(null==e?void 0:e.width))&&0!==(this.publishStat.inputHeight||(null==e?void 0:e.height))&&0!==(this.publishStat.inputFPS||(null==e?void 0:e.frameRate));return!(t&&n||0===this.camera_status&&"0"===this.publishStat.videoMuteState&&0===this.lastPublishStats.videoBytesSent&&n)},i.prototype.getCodecId=function(t){switch(t){case"H264":default:return 0;case"VP8":return 2;case"H265":return 4}},i.prototype.sendSEI=function(t){var i=this;if("H264"!==this.Mf&&"H265"!==this.Mf)return this.error(rv+" code not support"),!1;if(!this.ll.isSEIStart)return console.error("Send SEI Failed. The publishing stream has not enabled sei."),!1;if(this.ll.SEIType==rt.UserUnregister&&t.byteLength<=16)return this.error(rv+" inData size should greater than 16"),!1;if(this.cl.length>=10)return this.error(rv+" side info count limit"),!1;this.cl.push(t.buffer);var e=this.seiWorker;return e&&(this.cl.forEach(function(t){e.postMessage({cmd:"pushSideInfo",buffer:t,hasLowStream:!!i.lowStream,streamID:i.tu,maxLength:10},[t])}),this.cl=[]),!0},i.prototype.sd=function(t){var i={cmd:"encode",streamID:this.tu,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(Ob({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.od});s.pipeThrough(u).pipeTo(r),this.Uo.handleSeiRollBack()}}},i.prototype.nd=function(t,i){void 0===i&&(i=!1);var e=this.createSEIWorker(),n={cmd:"encode",streamID:this.tu,type:this.ll.SEIType,isLowStream:i,emulationPreventionByte:this.Dn.seiConfig.emulationPreventionByte,onlyAudio:!!this.ll.track,vCodec:this.Mf};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(Ob({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.Uo.handleSeiRollBack()}}},i.prototype.od=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.ll.SEIType===rt.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.Dn.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,s,r,o=e?this.hl:this.cl;if(o.length>0){var u=!1,a=null===(s=null===(n=t.getMetadata)||void 0===n?void 0:n.call(t))||void 0===s?void 0:s.mimeType;u=a?null!==(r=null==a?void 0:a.includes("H265"))&&void 0!==r&&r:"H265"===this.Mf;for(var c=new DataView(t.data),h=[],f=0,l=0;l<o.length;l++){var d=this.encodeSEINalu(o[l]);f+=5+(N=d.ebspLength),h.push(d)}e?this.hl=[]:this.cl=[];for(var v=new ArrayBuffer(f+t.data.byteLength),m=new DataView(v),p=0,g=new Qg(c,u),b=0,_=!1,y=!1,w=!1,S=0;g.NextNalu();)if(S++,u){if(32==(E=(126&c.getUint8(g.nalu_start+g.start_code_size))>>1))_=!0,b+=g.nalu_size;else if(33==E)y=!0,b+=g.nalu_size;else if(34==E)w=!0,b+=g.nalu_size;else if(35==E)continue;if(_&&y&&w)break}else{var E;if(7==(E=31&c.getUint8(g.nalu_start+g.start_code_size)))y=!0,b+=g.nalu_size;else if(8==E)w=!0,b+=g.nalu_size;else if(9==E)continue;if(y&&w)break}for(var O=0;O<b;O++)m.setInt8(p++,c.getInt8(O));var T=10-S,k=h.length>=(T=T>0?T:0)?T:h.length;for(l=0;l<k;l++){var R=h[l],I=R.rbspView,N=R.ebspLength;m.setUint8(p++,0),m.setUint8(p++,0),m.setUint8(p++,0),m.setUint8(p++,1),u?(m.setUint8(p++,78),m.setUint8(p++,1)):m.setUint8(p++,6);for(var C=0;C<N;C++)m.setInt8(p++,I[C-0])}for(O=b;O<t.data.byteLength;O++)m.setInt8(p++,c.getInt8(O));new Uint8Array(v);t.data=v}i.enqueue(t)},i.prototype.encodeFrameAudioOnly=function(t,i,e){var n,s,r,o=e?this.hl:this.cl,u=0,a="key"===t.type,c=!1,h=null===(s=null===(n=t.getMetadata)||void 0===n?void 0:n.call(t))||void 0===s?void 0:s.mimeType;c=h?null!==(r=null==h?void 0:h.includes("H265"))&&void 0!==r&&r:"H265"===this.Mf;var f=performance.now(),l=0,d=[];if(o.length>0){for(var v=o.length>=9?9:o.length,m=0;m<v;m++){var p=this.encodeSEINalu(o[m]);l+=4+(c?2:1)+(T=p.ebspLength),d.push(p)}e?this.hl=[]:this.cl=[],f-this.recvLastKeyFrameTime>2e3&&(a=!0)}a&&(u=c?Cb.length+zb.length:Nb.length+Ib.length);var g=new ArrayBuffer(l+u),b=new DataView(g),_=0;if(a)if(c){var y=new DataView(Cb.buffer);for(S=0;S<Cb.length;S++)b.setInt8(_++,y.getInt8(S))}else for(var w=new DataView(Nb.buffer),S=0;S<Nb.length;S++)b.setInt8(_++,w.getInt8(S));for(m=0;m<d.length;m++){var E=d[m],O=E.rbspView,T=E.ebspLength;b.setUint8(_++,0),b.setUint8(_++,0),b.setUint8(_++,0),b.setUint8(_++,1),c?(b.setUint8(_++,78),b.setUint8(_++,1)):b.setUint8(_++,6);for(var k=0;k<T;k++)b.setInt8(_++,O[k-0])}if(a)if(c){var R=new DataView(zb.buffer);for(S=0;S<zb.length;S++)b.setInt8(_++,R.getInt8(S))}else for(var I=new DataView(Ib.buffer),S=0;S<Ib.length;S++)b.setInt8(_++,I.getInt8(S));t.data=g,a&&(this.recvLastKeyFrameTime=f),i.enqueue(t)},i.prototype.onCreateOfferSuccess=function(t,i,e,n){var s=this;if(i&&(this.isUpdateSDP=!0,n&&(this.ud=n)),this.To&&this.To.getTracks().forEach(function(t){tu(t,s.zn,Hd)}),this.info(Hd+" local sdp revert "+this.Af.join("")),this.rd(t),this.info(Hd+" localSdp1 "+t.sdp.substr(0,t.sdp.length/2)),this.info(Hd+" localSdp2 "+t.sdp.substr(t.sdp.length/2)),this.ml&&!i)return this.Dl=t,void this.Sl(t);this.setLocalSdp(t,e)},i.prototype.rd=function(t){var i;this.xu.bitRate>0&&(t.sdp=this.ad(t.sdp,this.xu.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.xu.audioBitrate)||s.push("maxaveragebitrate="+this.xu.audioBitrate);var r=/stereo=\d+/,o=t.sdp.match(r),u="stereo="+(2===this.xu.channelCount?1:0);if(o&&o[0]?t.sdp=t.sdp.replace(r,u):s.push(u),!0===this.Nl.enableDTX){var a=/usedtx=\d+/,c=t.sdp.match(a),h="usedtx="+(this.Nl.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.Af=t.sdp.match(/m=(.\w*)\s/g)||[],this.info(Hd+" local sdp revert "+this.Af.join(""));var d=ml.getSDPVideoCodec(t.sdp);if((null==t?void 0:t.sdp.includes("m=video"))&&0===d[this.Mf].length){if(!this.publishOption.enableAutoSwitchVideoCodec)return void this.publishStateUpdateError(Mb.Ve,!0,"not support ".concat(this.Mf," codec"));var v=this.Mf;if(this.Mf="H264"===this.Mf?"VP8":"H264",0===d[this.Mf].length&&"H265"===v&&(this.Mf="VP8"),this.info("".concat(Hd," switch video codec to ").concat(this.Mf)),this.Dn.actionListener("publisherVideoEncoderChanged",this.getCodecId(v),this.getCodecId(this.Mf),this.streamId),0===d[this.Mf].length)return void this.publishStateUpdateError(Mb.Ve,!0,"not support H264 and VP8 codec")}t.sdp=ml.getSDPByVideDecodeType(t.sdp,this.Mf),this.setSdpHardCode(t),"firefox"===this.Dn.browser&&rd(this.Dn.browserInfo,"firefox",139,2)&&(t.sdp=Sb(t.sdp))},i.prototype.setLocalSdp=function(t,i){var e,n=this;this.info(Hd+" set local sdp");var s=this.getSpan(sr,this.parentSpanKey);this.Dn.Bo(s,{sdp:t.sdp}),s.setAttributes({is_mini:rr(this.Lo),is_dual_stream:nr(this.lowStream?1:0)}),null===(e=this.zf)||void 0===e||e.setLocalDescription(t).then(function(){return Tb(n,void 0,void 0,function(){return kb(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(Hd+" error "+t.toString()),n.Ln.setError(s,{code:Mb.Te.code,message:t.toString()}),n.publishStateUpdateError(Mb.Te,!0)})},i.prototype.ad=function(t,i){var e="AS";return"firefox"===this.Dn.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.ua)||void 0===i?void 0:i.previewType,r=this.Dn.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(Gd+" ".concat(null===(e=this.ua)||void 0===e?void 0:e.previewType," software encode: ").concat(o,", "));var u=ml.getSDPByVideDecodeType(t.sdp,this.Mf,o,this.Dn.engineConfig.encodecSelectionMode);t.sdp=u},i.prototype.onSetLocalDescriptionSuccess=function(t,i){return Tb(this,void 0,void 0,function(){var e,n=this;return kb(this,function(s){return this.info(Gd+" success"),this.To&&this.To.getTracks().forEach(function(t){tu(t,n.zn,Gd)}),!this.isUpdateSDP&&(this.state=2),i&&(this.previewer.videoInfo=Ob(Ob({},this.xu),i)),this.setSdpHardCode(t),this.il&&!this.isUpdateSDP?this.ml?(this.info(Gd+" fully auto tcp"),[2]):(this.Sl(t),[2]):(e=function(i){var e,s={};i?s.miniSdp=i:s.sdp=t.sdp;var r=Ob(Ob({},s),{keyframe_intv:Math.floor((null===(e=n.xu)||void 0===e?void 0:e.keyFrameInterval)||2),paramsExt:n.Yl});if(n.Cf=D(),n.isUpdateSDP){n.info(Gd+" update sdp");var o=Ob(Ob({},r),{type:0});n.Tl.sendMediaDescUpdateReq(n.Cf,n.ph,o,function(t,i,e){0==(null==e?void 0:e.result)&&n.parseRemoteSdp(e,function(t){n.hd(t)||n.Kl(t)},function(t){n.publishStateUpdateError(t)})},function(t,i){n.error(Gd+" update sdp failed"),n.ud&&n.ud(-1),n.publishStateUpdateError(1==t?Mb.xe:Mb.je)})}else{var u=n.getSpan(yr,n.parentSpanKey);u.setAttributes({req_params_ext:n.Yl}),n.Tl.sendMediaDesc(n.Cf,n.ph,0,r,function(t,i,e){n.Dn.Bo(u,{sdp:r.sdp}),u.setAttributes({webrtc_sid:wr(i),mediaDescription:{keyframe_intv:r.keyframe_intv}}),n.Cf==t&&n.ph==i?(n.info(Gd+" send success stateNego:waiterAnswer"),n.xf=gt.waiterAnswer,n.state=3,n.parseRemoteSdp(e,function(t){n.Dn.Bo(u,{remote_sdp:t}),u.end(),n.hd(t)||n.Kl(t,!0,void 0,null==e?void 0:e.mini_sdp)},function(t){n.publishStateUpdateError(t)})):n.error(Gd+" seq or sessionId is not equal")},function(t,i){n.error(Gd+" mediaDesc error "+JSON.stringify(t)),n.Ln.setError(u,{code:Mb.ze.code,message:Mb.ze.message}),n.publishStateUpdateError(Mb.ze)}),n.info(Gd+" 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.Dn.browserInfo.name.toLowerCase(),i=sd(this.Dn.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 Tb(this,void 0,void 0,function(){var i=this;return kb(this,function(e){return[2,new ni(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.hd=function(t){return 0===$l(t).length&&(this.publishStateUpdateError(he,!1),!0)},i.prototype.setBandWidthBySdp=function(t,i){this.info("zc.p.sbwbs bandwidth: ".concat(i));var e="AS";return"firefox"===this.Dn.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.Kl=function(t,i,e,n){var s,r;return void 0===i&&(i=!1),Tb(this,void 0,void 0,function(){var 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,A,P,M,x,j,L,q=this;return kb(this,function(U){switch(U.label){case 0:if(this.info(Fd+" call"),this.xu.audioBitrate&&48e3!==this.xu.audioBitrate&&(t=t.replace(/maxaveragebitrate=(\d+)/,"maxaveragebitrate="+this.xu.audioBitrate)),this.Pf=t.match(/m=(.\w*)\s/g)||[],this.info(Fd+" sdp revert "+this.Pf.join("")),this.setTurnTcp(),this.Uo.autoSwitchProtocol=this.Kr("auto_to_tcp")||!1,o=this.Kr("udp_max_fail_num"),!isNaN(o)&&(this.Uo.maxUdpFailNum=o),c=(u=this.Uo).maxUdpFailNum,h=u.udpFailNum,this.info("zp.oro.0 autoToTcp: ".concat(a=u.autoSwitchProtocol,", udpFailNum: ").concat(h,", maxUdpFailNum: ").concat(c,".")),a&&!this.pl&&h>=c&&(this.info("zp.oro.0 switch to tcp."),this.pl=!0,this.ml=!1),(f=this.Kr("udp_or_tcp",!0))&&(this.info("zp.oro.0 setting udp_or_tcp "+f),this.pl="tcp"===f),this.pl&&!this.Uo.isProxy&&"firefox"!==this.Dn.browser&&(null===(s=t.match(/candidate.*/g))||void 0===s||s.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.Uo.isProxy)if(l=Kl(t),d=l[0],v=l[1],m=t.match(/a=mid:[^(\n|\r)]+/g),v&&m)if(this.bl.intranet)setTimeout(function(){v.forEach(function(t,i){var e,n={sdpMLineIndex:i,candidate:t.replace(d[i].ip,q.bl.wanIP).replace("a=",""),sdpMid:m[i].replace("a=mid:","")};q.info("zp.oro.0 add wan candidate:"+JSON.stringify(n)),null===(e=q.zf)||void 0===e||e.addIceCandidate(new RTCIceCandidate(n))})},1e3);else for(this.info("zp.oro.0 change candidate ip from lan to wan: "+(p=this.bl.wanIP)),g=0;g<v.length;g++)_=(b=v[g]).replace(d[g].ip,p),t=t.replace(b,_);else this.warn("zp.oro.0 candidate not found");else t=this.extractCandidate(t);if(this.info("zp.oro.0 sdp revert "+this.Af.join("")+" "+this.Pf.join("")),this.Af.join()!==this.Pf.join()&&this.Af.length==this.Pf.length&&(y=new RegExp("[\\s\\S]*"+this.Pf[0]).exec(t)[0].replace(this.Pf[0],""),w=[],S="",this.Af.forEach(function(i){var e=q.Pf.findIndex(function(t){return t==i}),n=new RegExp(i+"[\\s\\S]*"+(q.Pf[e+1]||"")).exec(t)[0].replace(q.Pf[e+1],""),s=/a=mid:(\w)/.exec(n)[1];w.push(s),S+=n||""}),t=y.replace(/a=group:BUNDLE.*/,"a=group:BUNDLE "+w.join(" "))+S,this.Af=[],this.Pf=[]),(E=Wl(t).filter(function(t){return t.startsWith("m=video")})).length>0&&(T=(O=this.lowStream?E[1]:E[0]).match(/m=video(.|\r|\n)*a=rtpmap(.|\r|\n)*(a=fmtp:(\d+).*)/),Sh()&&(k=this.kl.getStartVideoBitrate(),R=this.kl.getMinVideoBitrate(),I=[],R&&I.push("x-google-min-bitrate=".concat(R)),k&&I.push("x-google-start-bitrate=".concat(k)),null!==T&&I.length&&(N=T[3],C="".concat(N,";").concat(I.join(";")),z=O.replace(N,C),t=t.replace(O,z)))),!(this.xu.bitRate>0))return[3,5];if(D=this.xu.bitRate,A=this.xu.bitRate,P=!1,!this.canSetBandWidthBySender())return[3,4];U.label=1;case 1:return U.trys.push([1,3,,4]),A=this.kl.getTargetVideoBitrate(),[4,this.applyVideoBitrate(A)];case 2:return P=U.sent(),[3,4];case 3:return M=U.sent(),this.error(Fd+JSON.stringify(M)),[3,4];case 4:P||(t=this.setBandWidthBySdp(t,D)),null==(x=this.getVideoSenders())||x.forEach(function(t){if(t&&t.getParameters&&t.setParameters){var i=t===q.lowVideoSender,e=t.getParameters();if(e.encodings&&0!=e.encodings.length||(e.encodings=[{}]),i){var n=q.lowStreamVBitrate;n&&(e.encodings[0].maxBitrate=1e3*n)}else{var s=q.getScaleResolutionDownBy();1!=s&&(e.encodings[0].scaleResolutionDownBy=s)}q.videoInfo.frameRate>0&&(e.encodings[0].maxFramerate=q.videoInfo.frameRate),t.setParameters(e)}}),U.label=5;case 5:return this.info(Fd+" remoteSdp:"+t),j={type:"answer",sdp:t},L=this.getSpan(ur,this.parentSpanKey),this.Dn.Bo(L,{sdp:j.sdp}),L.setAttributes({is_mini:ar(this.Lo),is_dual_stream:nr(this.lowStream?1:0),webrtc_sid:cr(this.ph)}),this.zl=j.sdp,null===(r=this.zf)||void 0===r||r.setRemoteDescription(new RTCSessionDescription(j)).then(function(){q.info(Fd+" set success"),q.To&&q.To.getTracks().forEach(function(t){tu(t,q.zn,Fd)}),L.end(),q.xf==gt.iceConnected&&q.ud&&(q.info(Fd+" update sdp success"),q.ud(0),q.ud=void 0,q.isUpdateSDP=!1)},function(t){q.error(Fd+" failed: "+t.toString()),q.Lo&&Wt(n)&&q.warn(Fd+" remote mini "+n.toString()),L.setAttributes({error:Mb.Ie.code,message:t.toString()}),L.end();var i=!0;q.Lo&&(i=!1,q.Lo=!1,q.Ef=performance.now()-q.Of,q.yf=4),q.publishStateUpdateError(Mb.Ie,i)}),this.state=4,i&&(this.fd(this.Tf),this.Tf=[],this.state=5),this.ml&&this.$l(e),this.startTime=Date.now(),this.checkRetryOtherIPCandidate(),this.info(Fd+" call success"),[2]}})})},i.prototype.checkRetryOtherIPCandidate=function(){var t=this;this.jl=setTimeout(function(){t.info("".concat("zc.p.0.croic"," check ").concat(t.state," ").concat(t.ipNodeType," ").concat(t.rf.length)),6!==t.state&&t.nf&&t.rf.length>0&&(t.ipStackNode=t.ipStackNode===Nt.IPv4?Nt.IPv6:Nt.IPv4,t.restartIce())},this.hf)},i.prototype.extractCandidate=function(t){var i=this,e=Kl(t),n=e[0];return e[1].forEach(function(e,s){var r=n[s].ip,o=Ul(r);if(i.ipStackNode!==o){var u={sdpMLineIndex:parseInt(n[s].mid),candidate:e.replace("a=",""),sdpMid:n[s].mid};i.rf.push(u),t=t.replace(e+"\n","")}if(o===Nt.IPv4){var a=yd(r),c=e.replace(new RegExp(r,"g"),a).replace("a=",""),h={sdpMLineIndex:parseInt(n[s].mid),candidate:c,sdpMid:n[s].mid};i.uf.find(function(t){return t.candidate===h.candidate&&t.sdpMLineIndex===h.sdpMLineIndex&&t.sdpMid===h.sdpMid})||i.uf.push(h)}}),t},i.prototype.getScaleResolutionDownBy=function(){var t,i,e,n=this.lastPublishStats.frameWidth,s=(null===(i=null===(t=this.ua)||void 0===t?void 0:t.cameraMaxResolution)||void 0===i?void 0:i.maxWidth)||0,r=null===(e=this.ua.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){var i;return Tb(this,void 0,void 0,function(){var e,n,s=this;return kb(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),[4,this.applyVideoBitrate(t)];case 1:if(r.sent(),!gh()||!kh())return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,null===(i=this.peerConnection)||void 0===i?void 0:i.createOffer({})];case 3:return e=r.sent(),this.onCreateOfferSuccess(e,!0,Ob(Ob({},this.videoInfo),{bitRate:t}),function(t){return Tb(s,void 0,void 0,function(){return kb(this,function(t){return this.info("zc.p.sbw set bitrate by update sdp"),[2]})})}),[3,5];case 4:return r.sent(),[3,5];case 5:return this.kl.setVideoBitrate(t),this.xu.bitRate=t,[3,7];case 6:return n=r.sent(),this.error("zc.p.0.sb.0"+JSON.stringify(n)),[3,7];case 7:return[2]}})})},i.prototype.setVideoBitrateForTC=function(t){this.kl.setVideoBitrate(t)},i.prototype.setConfiguration=function(t,i){var e,n,s=this;if(this.info(cv+" 1"),i){var r=i.turn_username,o=i.turn_auth_key,u=i.turn_urls;this.af=r,this.cf=o;var a=void 0;if(u){var c=u.split(";"),h=[];c.forEach(function(t){var i=Bl(t).replace("[","").replace("]",""),e=Ul(i);if(s.ipStackNode===e?h.push(t):s.sf.push(t),e==Nt.IPv4){var n=yd(i),r=t.replace(i,"[".concat(n,"]"));s.Uo.isCandidateHasIPv6&&h.push(r)}}),(e=this.sf).push.apply(e,h),0===(a=h).length&&a.push.apply(a,this.sf)}else{var f=$l(t);if(0===f.length)return this.info(cv+" no candidate"),!1;a=f}null===(n=this.zf)||void 0===n||n.setConfiguration({iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:a,username:r,credential:o}],encodedInsertableStreams:this.ll.isSEIStart})}return!0},i.prototype.onIceConnectionStateChange=function(t){var i,e=this;if(7!=this.state&&null!=this.zf){this.info(Qd+" ice state: "+this.zf.iceConnectionState);var n=this.getSpan(br,this.parentSpanKey,Xn.event);if(n.setAttributes({ice_state:_r(this.zf.iceConnectionState)}),"connected"===this.zf.iceConnectionState){if(this.info(Qd+" connected state "+this.state+" ?"+(null===(i=this.zf)||void 0===i?void 0:i.connectionState)),this.dl){var s=(new Date).getTime()-this.dl;this.Cl.setAttributes({publish_begin_time:Ab.publish_begin_time(s)}),this.dl=0}if(this.Ln.spanEnd({key:hr,par:this.tu},{webrtc_sid:this.ph}),this.xf=gt.iceConnected,this.ul){var r=(new Date).getTime()-this.ul;this.info(Qd+" ice time "+r)}this._f=!1,this.info(Qd+" stateNego:iceConnected"),this.Ml&&(clearTimeout(this.Ml),this.Ml=null),null!=this.xl&&(clearTimeout(this.xl),this.xl=null),this.zf.connectionState||(this.Lf?this.publishSuccess():(this.ld&&clearTimeout(this.ld),this.ld=null,this.ld=setTimeout(function(){var t;e.info(Qd+" get first stats state "+e.state),6!==e.state&&(null===(t=e.zf)||void 0===t||t.getStats().then(function(t){e.info(Qd+" get first stats suc"),t.size>0&&e.publishSuccess()}))},1e3)))}else if("closed"===this.zf.iceConnectionState)n.end(),this.xf=gt.iceClosed,this.dd(this.zf.iceConnectionState);else if("failed"===this.zf.iceConnectionState)n.end(),this.xf=gt.iceFailed,this.dd(this.zf.iceConnectionState);else if("disconnected"===this.zf.iceConnectionState){n.end(),this.warn(Qd+" ice disconnected "),this.xf=gt.iceDisconnected;var o=this.Uo.lastChangeIpTime;o&&Date.now()-o<15e3?this.publishStateUpdateError(Mb.Ne):this.xl||(this.xl=setTimeout(function(){e.dd("disconnected")},15e3))}}},i.prototype.onIceCandidate=function(t){var i,e,n=this;if(this.info(Yd+" candidate "+JSON.stringify(t.candidate)),t.candidate){if(t.candidate.candidate)Ul(null===(i=t.candidate.candidate.split(" "))||void 0===i?void 0:i[4])===Nt.IPv6&&(this.ml&&(this.info("".concat(Yd," can len ").concat(this.uf.length)),this.uf.forEach(function(t){var i;null===(i=n.zf)||void 0===i||i.addIceCandidate(new RTCIceCandidate(t)).then(function(){n.info("".concat(Yd," add can suc"))}).catch(function(t){n.info("".concat(Yd," add can fail, ").concat(t.message))})})),this.Uo.isCandidateHasIPv6=!0);if(-1!=(null===(e=t.candidate.candidate)||void 0===e?void 0:e.indexOf("relay"))){this.info(Yd+" candidate "+t.candidate.candidate+" state "+this.state+" autotcp "+this.ml);var s=function(t){n.fd([{candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex}])};this.ml?s(t):this.state<5||7==this.state?this.Tf.push({candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex}):s(t)}else this.info(Yd+" candidate not relay")}},i.prototype.fd=function(t){var i=this;if(this.info(tv+" called"),!(t=t.filter(function(t){return t.candidate.indexOf("relay")>0}))||t.length<1)this.info(tv+" cancelled");else{var e=this.getSpan(Sr,this.parentSpanKey);e.setAttributes({candidate_info:Er(t)}),this.xf!==gt.iceConnected&&(this.xf=gt.sendCandidate),this.info(tv+" stateNego:sendCandidate"),this.Tl.sendCandidateInfo(t,function(t,n,s){i.info(tv+" send success"),e.end()},function(t,n){i.error(tv+" failed to send: "+t.toString()),i.Ln.setError(e,{code:Mb.De.code,message:t.toString()}),i.publishStateUpdateError(Mb.De)})}},i.prototype.ed=function(t){var i,e,n=null===(i=this.zf)||void 0===i?void 0:i.connectionState;this.info(Zd+" conn state: "+n);Date.now();if("connected"===n){if("motion"===this.Wf){var s=this.videoSender;s&&"video"===(null===(e=s.track)||void 0===e?void 0:e.kind)&&"contentHint"in s.track&&(this.info("".concat(hv," recover contentHint: ").concat(s.track.contentHint," => ").concat(this.Wf,", tid :").concat(s.track.id)),s.track.contentHint=this.Wf),this.Wf=""}6!==this.state&&this.publishSuccess()}},i.prototype.onSignalStateChange=function(t){this.info(Zd+" signal state: "+t.target.signalingState),7!=this.state&&null!=this.zf&&"closed"===t.target.signalingState&&(this.xf=gt.iceClosed,this.dd(this.zf.iceConnectionState))},i.prototype.Bl=function(t,i,e){this.info($d+" "+JSON.stringify(e));var n=this.getSpan(mr,Xn.event);n.setAttributes({err_info:pr(e.err_info||""),reason_info:null==e?void 0:e.reason}),n.end(),this.Ln.spanSetAttributes({key:Xn.event,par:this.tu},{denied_info:Xn.denied_info(e.err_info),stop_reason:Xn.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(Mb.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(Xg(o,r,null==s?void 0:s.err)),1011===s.err&&(u=Mb.ye),1014===s.err&&(u=Mb.we),1012===s.err&&(u=Zi),this.Ml&&clearTimeout(this.Ml);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.pl){if([8,10].includes(o)||[18,15].includes(o)&&2===r&&[3001,3002].includes(s.err)){this.Uo.udpFailNum++;var h=this.Uo;h.autoSwitchProtocol&&h.udpFailNum>=h.maxUdpFailNum&&(this.il=!1,this.Uo.setIsPeer(!1),c=!0)}else this.Uo.udpFailNum=0;var f=this.Uo.isNodeLast(this).lastTryNext,l=[3001,3002,3003,3004,3005,3006,3007,3008].includes(s.err);f&&l&&(this.info($d+" switch tcp by all fail"),this.Dn.turnToTcp=!0,this.ml=!1,this.il=!1,this.Uo.setIsPeer(!1))}this.publishStateUpdateError(u,a,s,c)},i.prototype.Jl=function(t,i,e){if(this.info(Kd+" received "),this.getSpan(gr,Xn.event).end(),i==this.ph){var n={code:Mb.Se.code,message:"server session reset "+e.reason};this.Ml&&clearTimeout(this.Ml),this.publishStateUpdateError(n)}else this.error(Kd+" cannot find session")},i.prototype.Vl=function(t,i,e){var n;if(this.info("".concat("zc.p.0.orpe"," received, ").concat(t)),this.td("PublishEventPush",t)){var s=this.getSpan(fr,this.parentSpanKey,Xn.event);s.setAttributes({event_state:lr(e.event),webrtc_sid:i}),s.end(),this.ld&&(clearTimeout(this.ld),this.ld=null);var r=null===(n=this.zf)||void 0===n?void 0:n.connectionState;this.Lf=!0,(r?"connected"===r:this.xf===gt.iceConnected)&&6!=this.state?0==e.event&&this.publishSuccess():this.resendStreamStatus(0)}},i.prototype.Hl=function(t,i,e){if(this.td("ClientInfoPush",t)){this.Dn.clientIP!==e&&this.info("zc.p.0.orci.1 client ip changed "+this.Dn.clientIP+" "+e),this.Dn.clientIP=e,this.el=i,this.Tl.peerId=this.el,this.al=e,this.Dn.isMultiOuter=this.isMultiOuter(),6===this.state&&this.getConnectIP(),this.ll.isSEIStart&&this.ll.SEIType==rt.UserUnregister&&this.ll.unregisterSeiFilter&&this.sendSEIUUID();var n=this.ua;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.ll.unregisterSeiFilter),this.Tl.sendSEIUUID(this.ll.unregisterSeiFilter).then(function(i){t.info("zc.ssuid success"),0==(null==i?void 0:i.result)&&(t.ll.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.Tl.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.dd=function(t){this.info(Qd+" state "+this.state+" connectionState "+t),this.publishStateUpdateError(Mb.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.Uo.publishersLength){var r=this.Uo.playerList;for(var o in r){var u=r[o];6==u.state&&u.broadcasterStatus==j.start&&(u.sendBroadcasterStatus(0),u.broadcasterStatus=j.stop)}}this.closeSession(0),this.resetPushCmdSeqMap();var a=Date.now();this.Cl.setAttributes({publish_state_time:Ab.publish_state_time(a-this.reportPublishStateTime)}),this.uploadRTCPublishStats();var c=this.Fa?0:this.lastFailTimeLen;(this.Ln.spanEnd({key:Xn.event,par:this.tu},{tryidx:xb.tryidx(this.rtcPublishCount),url:xb.url(null===(i=this.Il)||void 0===i?void 0:i.server),ip:xb.ip(this.ip),dispatch_external_ip:xb.dispatch_external_ip(this.Dn.clientIP),resource_type:xb.resource_type("rtc"),protocol:xb.protocol("webrtc"),net_protocol:Pb.net_protocol(this.netProtocol),stop_reason:Xn.stop_reason(s),try_time:xb.try_time(c),error:(null==t?void 0:t.code)||0,message:(null==t?void 0:t.message)||""}),this.Fa)||this.Ln.spanEnd({key:(this.isRePublish?Un:Ln).event,par:this.tu},{error:(null==t?void 0:t.code)||0,message:(null==t?void 0:t.message)||"",url:Pb.url(null===(e=this.Il)||void 0===e?void 0:e.server),ip:Pb.ip(this.ip),peer_id:Pb.peer_id(this.el),source_type:Pb.source_type("rtc"),net_protocol:Pb.net_protocol(this.netProtocol)});var h=0;t&&0!==t.code&&(h=t.code===fe.code?this.latestPublishErrCode:t.code);var f=this.publishedTimeStamp;this.Cl.setAttributes({stream_id:Ab.stream_id(this.tu),webrtc_sid:Ab.webrtc_sid(this.ph),probe_ip_cnt:Ab.probe_ip_cnt(this.nl),valid_probe_ip_cnt:Ab.valid_probe_ip_cnt(this.sl),poor_quality_retry_cnt:Ab.poor_quality_retry_cnt(this.poorQualityRetryCnt),probe_not_trigger_retry_info:Ab.probe_not_trigger_retry_info(this.rl.length>0?this.rl:void 0),bitrate:Ab.bitrate(1e3*this.xu.bitRate),h:Ab.h(this.xu.height),w:Ab.w(this.xu.width),cap_w:Ab.w(this.xu.width),cap_h:Ab.h(this.xu.height),fps:Ab.h(this.xu.frameRate),env:Ab.env(this.Dn.testEnvironment?3:1),fail_cnt:Ab.fail_cnt(Math.max(this.rtcPublishCount-1,0)),continuous_fail_cnt:Ab.continuous_fail_cnt(Math.max(this.continuousFailCnt-1,0)),stop_reason:Ab.stop_reason(s),error:(null==t?void 0:t.code)||0,message:(null==t?void 0:t.message)||"",last_error:h,try_time:xb.try_time(c),valid_d:this.validPublishedTime+(f?a-f:0),total_d:a-this.firstPublishedTimeStamp,tempbroken_cnt:this.errorTimes,is_mini:this.Lo}),(null==t?void 0:t.code)===Mb.Ue.code&&this.uploadPublishEvent(t),this.Cl.end(),this.Uo.stopToReport(0),this.Uo.stopNetProbe(this),this.retryFailGwNodes=[],this.resetPublish(0),this.hasSucceed=!1,this.isRePublish=!1,this.rtcPublishCount=0,this._f=!1,this.nl=0,this.sl=0,this.poorQualityRetryCnt=0,this.rl=[],this.continuousFailCnt=0,null===(n=this.El)||void 0===n||n.resetPublish(),this.kl.stop(),this.Xf=!1,this.seiWorker&&this.seiWorker.postMessage({cmd:"clear",type:"push",streamID:this.tu})},i.prototype.uploadRTCPublishStats=function(){var t,i,e,n,s,r,o,u,a,c,h,f,l,d;this.lastPublishStats.time&&this.Ln.spanSetAttributes({key:Xn.event,par:this.tu},{lsttime:Xn.lsttime(parseInt(this.lastPublishStats.time)),total_stat:Xn.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.availableOutgoingBitrate)?null===(d=this.publishStat)||void 0===d?void 0:d.availableOutgoingBitrate: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(ev+" call"),this.info(ev+" websocket disconnect"),this.publishStateUpdateError(t||$n.error.Ce,!!t)},i.prototype.publishSuccess=function(){var t,i,e,n,s,r=this;if(this.info(Jd+" call"),this.pl||(this.Uo.udpFailNum=0),this.isUpdateSDP&&this.ud)return this.info(Jd+" update sdp success"),this.ud(0),this.ud=void 0,void(this.isUpdateSDP=!1);var o=this.isRePublish?Un:Ln,u=null===(t=this.Uo.publisherList[this.tu])||void 0===t?void 0:t.retryStreamHandler;for(var a in null==u||u.getTryTime(this,!0),this.reportMiniSdpInfos(),this.Ln.spanEnd({key:o.event,par:this.tu},{url:Pb.url(null===(i=this.Il)||void 0===i?void 0:i.server),source_type:Pb.source_type("rtc"),signal_consume:Pb.signal_consume(this.signalTime),is_peer:Pb.is_peer(this.il)},!0,!1),6!=this.state&&this.onPublishStateUpdate(X,this.tu,{code:0,message:""},!0),this.state=6,this.hasSucceed=!0,this.continuousFailCnt=0,this.resetIceInfos(),this.resetNat64Infos(),this.getConnectIP(),this.Ll=setTimeout(function(){r.reportPublishStartEvent()},1e3),this.reportPublishStateTime=Date.now(),this.Uo.playerList){var c=this.Uo.playerList[a];6==c.state&&c.broadcasterStatus==j.stop&&(c.sendBroadcasterStatus(1),c.broadcasterStatus=j.start)}var h=this.Kr("probe_started_num");!isNaN(h)&&(this.Uo.probeStartedNum=h),this.qualityHandler.setPublishQualityTimer();var f=this.Kr("auto_switch_publish_video_codec",!0);this.publishOption.enableAutoSwitchVideoCodec&&f&&(null===(e=this.df)||void 0===e?void 0:e.offerToReceiveVideo)&&!this.sideMediaConfig.isSEIStart&&(this.Al=setTimeout(function(){return Tb(r,void 0,void 0,function(){var t,i;return kb(this,function(e){switch(e.label){case 0:if(this.checkCodecSupport(!1))return[3,4];t=this.Mf,i="H264"===this.Mf?"VP8":"H264",this.info("".concat(Jd," 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.Dn.actionListener("publisherVideoEncoderChanged",this.getCodecId(t),this.getCodecId(this.Mf),this.streamId),[3,4];case 3:return e.sent(),this.warn("".concat(Jd," switch video codec fail")),[3,4];case 4:return[2]}})})},this.vf)),this.ll.track&&this.ll.isSEIStart&&"H265"===this.Mf&&(this.Pl=setTimeout(function(){return Tb(r,void 0,void 0,function(){var t,i=this;return kb(this,function(e){switch(e.label){case 0:if(this.checkCodecSupport(!0))return[3,4];this._clearCanvasTimer(),this.pf=320,this.gf=240,this.info("".concat(Jd," fb sei trk res to ").concat(this.pf," * ").concat(this.gf)),e.label=1;case 1:return e.trys.push([1,3,,4]),t=this.ll,[4,this._addCanvasStreamVideoTrack()];case 2:return t.track=e.sent(),this.getVideoSenders().forEach(function(t){t&&t.replaceTrack(i.ll.track)}),[3,4];case 3:return e.sent(),this.warn("".concat(Jd," fb sei trk fail")),[3,4];case 4:return[2]}})})},this.mf));var l=2,d=2,v=null===(n=this.ua)||void 0===n?void 0:n.videoTrack,m=0!==this.To.getAudioTracks().length&&this.To.getAudioTracks()[0];this.To&&this.To.getTracks().forEach(function(t){tu(t,r.zn,Jd)}),v&&"live"===v.readyState&&v.enabled||(null===(s=this.ua)||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.Uo.soundLevelDelegate&&this.ua&&this.ua.startSoundLevel(),9===this.Dn.scenario&&this.setStreamAlignmentProperty(1).then(function(t){r.zn.info("zc.ssap ktv. "+t)}),this.info(Jd+" call success")},i.prototype.startSoundLevel=function(){var t;if(this.info(nv+" call"),this.To&&0!=this.To.getAudioTracks().length)try{null===(t=this.ua)||void 0===t||t.startSoundLevel()}catch(t){this.error(nv+" get sound level failed "+t)}else this.info(nv+" local stream no found")},i.prototype.stopSoundLevel=function(){var t;this.info("zc.p.0.ssl.1 call"),null===(t=this.ua)||void 0===t||t.stopSoundLevel()},i.prototype.handleEncBitrate=function(t,i,e){var n=this,s=1e3*this.xu.bitRate,r=0;if(i>0){this.Jf||this.Hf||(this.Vf++,i>=.75*t?(this.Vf>=10&&this.Gf>=.6*this.Vf&&(this.Hf=!0,this.Ff=s),this.Gf++):this.Vf>=10&&this.Gf/this.Vf<.3&&(this.Jf=!0));var o=Go(this.Yf,i,10);if(this.Jf)if(o>=1.05*s){if(this.Ff>s){this.Ff-=o>t?o-t:o-s,this.Ff=Math.max(this.Ff,s),this.Ff=Math.min(this.Ff,2*s),r=this.Ff}}else o<.8*s&&(0===this.Ff&&(this.Ff=t),this.Ff=this.Ff>=s?this.Ff+.08*s:1.05*this.Ff,this.Ff=Math.min(this.Ff,2*s),r=this.Ff)}if(e>0&&e<s){var u=Go(this.Qf,e,5);if(this.Jf){if(u+i>1.05*s)this.Ff-=u+i-s,this.Ff=Math.max(this.Ff,s-u),r=this.Ff}else r=this.Ff-u}else this.Ff<s&&(this.Ff=s,r=this.Ff);if(r>0){r=Go(this.Zf,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(sv+" success "+r)}).catch(function(t){n.error(sv+" "+t)})}},i.prototype.resetEncBitrate=function(){this.Jf=!1,this.Vf=0,this.Hf=!1,this.Gf=0,this.Ff=0,this.Yf=[],this.Zf=[],this.Qf=[]},i.prototype.replacePublishedTrack=function(t,i,e){var n,s;return void 0===i&&(i=!1),void 0===e&&(e={}),Tb(this,void 0,void 0,function(){var r,o,u,a,c,h,f,l,d,v,m,p,g;return kb(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=bd(i?a:t),h=this.mic_status):"audio"===o&&(h=bd(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:Ze,extendedData:Qe}]}})})},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.Il&&(this.camera_status=t,this.mic_status=i,this._l=!1,this.Lf||this.lf?(this.lf&&(clearTimeout(this.lf),this.lf=null),n++,this.info(jd+" start send ".concat(n," camera:").concat(t," mic:").concat(i,".")),this.yl=this.Tl.sendStreamStatus(t,i,function(t){s.yl===t&&(s._l=!0)},function(){s.camera_status===t&&s.mic_status===i&&(s.warn(jd+" time out. ".concat(n)),n<=1&&s.sendStreamStatus(t,i,!0,n))})):this.lf=setTimeout(function(){s.resendStreamStatus(1)},3e3))},i.prototype.resendStreamStatus=function(t){var i,e,n;if(void 0===t&&(t=0),!this._l)if(this.info(jd+" resend ".concat(t)),0==t){var s=2,r=2,o=null===(i=this.ua)||void 0===i?void 0:i.videoTrack,u=0!==this.To.getAudioTracks().length&&this.To.getAudioTracks()[0];o&&("live"===o.readyState||(null===(e=this.ua)||void 0===e?void 0:e.muteImage))&&(s=(null===(n=this.ua)||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.ll.track?this._clearCanvasTimer():"remove"!=t||this.ll.track||(this.ll.track=this._addCanvasStreamVideoTrack()),this.seiWorker&&this.seiWorker.postMessage({cmd:"publishStreamType",streamID:this.tu,onlyAudio:!!this.ll.track})},i.prototype._addCanvasStreamVideoTrack=function(){var t=this;16===this.pf&&16===this.gf&&"H265"===this.Mf&&(this.pf=160,this.gf=160),this.Rf=oi(this.pf,this.gf),this.If=this.Rf.getContext("2d"),this.Nf=new Image,this.Nf.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFFJREFUOE9jZGBgaGBgYLBnYGBwYCANHGBgYDjIyMDAcIWBgUGbNL1w1VdBBvwnUzNY26gBo2EwjNLBfjJyIiz7HADlBVB2DiEjR15lYGBYAwAypRSY53SYoAAAAABJRU5ErkJggg==";var i=this.Dn.engineConfig.blankVideoTrackFrameInterval||100;return this.info("zc.acsvt frame interval: "+i),this.kf=setInterval(function(){var i;null===(i=t.If)||void 0===i||i.drawImage(t.Nf,0,0,t.pf,t.gf)},i),this.Rf.captureStream().getVideoTracks()[0]},i.prototype.getSpan=function(t,i,e,n){void 0===n&&(n=!1);var s=Si(this.Ln,a.H,this.tu,t,i,e,n);return s.setAttribute("is_mini",this.Lo),s},i.prototype.isMultiOuter=function(){return!(!this.Dn.accessClientIp||!this.al||this.Dn.accessClientIp===this.al)},i.prototype.isCustomCdn=function(){var t,i;return void 0!==(null===(t=this.Nl)||void 0===t?void 0:t.cdnUrl)&&""!==(null===(i=this.Nl)||void 0===i?void 0:i.cdnUrl)},i.prototype.setTurnTcp=function(){this.pl=this.Dn.turnToTcp,void 0!==this.Dn.turnOverTcpOnly&&(this.pl=this.Dn.turnOverTcpOnly)},i.prototype.setStreamAlignmentProperty=function(t){return this.fl.alignment=t,this.Tl.sendStreamAlignmentProperty(t)},i.prototype.uploadPublishEvent=function(t){var i=this.tu,e=t.code,n={};this.Ef&&(n.mini_retry_consume=+this.Ef.toFixed(0),this.Ef=0,this.Of=0),this.Ln.spanEnd({key:jn.event,par:i},Ob(Ob(Ob({},n),{error:e}),t),!0)},i.prototype.getConnectIP=function(){if(this.al&&!this.ip){var t=Ul(this.al),i=this.getIPByGwNode(t),e=i.ip,n=i.port;this.ip=e,this.port=n,this.info("zc.p.0.gci.0 ip: ".concat(e," ").concat(n)),this.reportPublishStartEvent()}},i.prototype.reportPublishStartEvent=function(){var t=this.isRePublish?Un:Ln;this.Ln.spanSetAttributes({key:t.event,par:this.tu},{ip:Pb.ip(this.ip),port:Pb.port(this.port)}),this.Ln.spanReport({key:t.event,par:this.tu})},i.prototype.getIPByGwNode=function(t){var i;if(this.ipNode){var e=this.ipNode.vid.split("|"),n="";return e.forEach(function(i){var e=Ul(i);t===e&&(n=i)}),{ip:n,port:this.ipNode.port}}if(this.gwNode){var s=null===(i=this.gwNode)||void 0===i?void 0:i.split(":"),r=s[s.length-1];return{ip:this.gwNode.replace(":"+r,""),port:parseInt(r)}}return{ip:"",port:0}},i.prototype.sendNetQualityGrade=function(t,i){this.Tl.sendNetQualityGrade(t,i)},i.prototype.closeSession=function(t){var i,e;null===(i=this.Il)||void 0===i||i.off("uaConnected",this.Xr.onUaSocketConnected),this.Df&&(this.Tl.sendCloseSession(t,function(){}),null===(e=this.Il)||void 0===e||e.removeSession(this.ph),this.Df=!1)},i.prototype.activateSEIInsert=function(t,i){var e=this;return new ni(function(n,s){return e.Tl?(e.Tl.activateSEIInsert(t,i,function(t,i){var s=!1;0===i.result?(e.info(hm+" called success"),s=!0):1===i.result?(e.error(hm+" "+i.peer_id+" invalid param."),s=!1):2===i.result&&(e.error(hm+" peer not exist"),s=!1),n(s)},function(t){1===t&&e.error(hm+" request timeout")}),!1):n(!1)})},i.prototype.getStreamAddOptions=function(){return{stream_resource:1,stream_codec:"VP8"===this.Mf?2:this.lowStream?4:0}},i.prototype.onStatsUpdated=function(t){this.kl.onStatsUpdated(t)},i.prototype.getLocalMiniSdp=function(t,i){var e,n=this;if(this.Lo){var s=performance.now();null===(e=this.Ol)||void 0===e||e.getMiniSdp(t).then(function(t){n.wf=performance.now()-s,i(t)}).catch(function(t){n.Lo=!1,n.Dn.Lo=!1,n.wf=performance.now()-s,n.Ef=performance.now()-n.Of,n.yf=1,i()})}else i()},i.prototype.parseRemoteSdp=function(t,i,e){var n,s=this;if(this.Lo&&Wt(t.mini_sdp)&&t.mini_sdp.byteLength>0){var r=performance.now();null===(n=this.Ol)||void 0===n||n.parseMiniSdp(t.mini_sdp).then(function(t){s.Sf=performance.now()-r,i(t)}).catch(function(t){s.Lo=!1,s.Dn.Lo=!1,s.Sf=performance.now()-r,s.Ef=performance.now()-s.Of,s.yf=3,e(t)})}else i(t.sdp)},i.prototype.reportMiniSdpInfos=function(){var t=this.isRePublish?Un:Ln,i={};(this.Lo||this.yf)&&(i.mini_error=this.yf,i.code_sdp_consume=+this.wf.toFixed(0),i.decode_sdp_consume=+this.Sf.toFixed(0),this.yf=0,this.wf=0,this.Sf=0),this.Ln.spanSetAttributes({key:t.event,par:this.tu},Ob({},i))},i.prototype.onTcPauseVideo=function(){var t=this;if(this.Xf=!0,this.peerConnection&&0===this.camera_status){var i="",e=this.getVideoSenders();null==e||e.forEach(function(e){return Tb(t,void 0,void 0,function(){var t,n,s;return kb(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.tl=n.id)):(i+=" big:",i+=e.track.id,(n=this.localStream.getVideoTracks()[0].clone()).stop(),e.replaceTrack(n),this.$f=n.id)),[2]})})});var n=this.kl.getFeedback();this.info("".concat(hv," pause video, tid: ").concat(i,", tc:{").concat(n.status,"|").concat(n.bandwide,"|").concat(n.targetBitrate,"|").concat(n.rtt,"}"))}else this.warn("".concat(hv," pause video, camera: ").concat(this.camera_status,", bw: ").concat(this.kl.getBandwide()))},i.prototype.onTcResumeVideo=function(){var t=this;if(this.Xf=!1,this.peerConnection&&0===this.camera_status){var i="",e=this.getVideoSenders();null==e||e.forEach(function(e){return Tb(t,void 0,void 0,function(){var t,n,s,r;return kb(this,function(o){return t=e===this.lowVideoSender,n=this.ua.isVideoEnabled&&!this.ua.hasStopCaptureVideo,e.track&&n&&(t?t&&(s=void 0,(s=this.Kf?this.To.getVideoTracks()[0].clone():this.ua.streamFromCanvasTrack?this.ua.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.Kf?s=this.To.getVideoTracks()[0]:(s=this.ua.getDestinationTrack())||(s=this.ua.streamFromCanvasTrack?this.ua.streamFromCanvasTrack:this.To.getVideoTracks()[0]),s&&(e.replaceTrack(s),i+=" big:",i+=s.id))),[2]})})}),this.tl="",this.$f="";var n=this.kl.getFeedback();this.info("".concat(hv," resume video, tid: ").concat(i,", tc:{").concat(n.status,"|").concat(n.bandwide,"|").concat(n.targetBitrate,"|").concat(n.rtt,"}"))}else this.warn("".concat(hv," resume video, bw: ").concat(this.kl.getBandwide()))},i.prototype.isVideoTrackAlive=function(){var t=this.ua._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.To.getAudioTracks().length&&this.To.getAudioTracks()[0],i=!(!t||"live"!==t.readyState||!t.enabled);return this.info("zc.p.0.iata ".concat(i)),i},i.prototype.getAvailableBitrate=function(){var t,i,e;return(null===(t=this.publishStat)||void 0===t?void 0:t.availableOutgoingBitrate)&&(e=(null===(i=this.publishStat)||void 0===i?void 0:i.availableOutgoingBitrate)/1e3),e},i}(Nm),Lb=function(){this.publisherList={},this.playerList={}},qb=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}},Ub=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&&qb(t,n,o,s,c),r.breakDuration+=h;else if(u>=s)if(u<500)if(u+a<h)qb(t-(h-a),n,o,s,c),n.breakStartTime=t-u,r.breakDuration+=a+u,r.decodeTime+=h-(a+u);else qb(t-h+a,n,o,s,c),n.breakStartTime=t-h+a,r.breakDuration+=h;else u>=500&&(qb(t-u,n,o,s,c),n.breakStartTime=t-u,r.breakDuration+=h);else a<=s?(qb(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)},Bb=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}},Jb=function(){return Jb=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},Jb.apply(this,arguments)},Vb=function(){function t(t,i,e,n,s,r){this.Qa=t,this.Xa=i,this.vd=e,this.zn=n,this.dataReport=s,this.Dn=r,this.playQualityList=[],this.Ka=null,this._c=null,this.Sc=null,this.md={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.Ya={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.Vc=0,this.probeState=ct.probed,this.if=null,this.pd=1e4,this.Zc=0,this.playStat={},this.gd=200,this.bd=500,this._d={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.yd={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.wd=0,this.Sd={breakDuration:0,breakCancelDuration:0,decodeTime:0},this.Ed={breakDuration:0,breakCancelDuration:0,decodeTime:0},this.Od={decodeDuration:0,breakDuration:0,blankDuration:0},this.Td={decodeDuration:0,breakDuration:0,blankDuration:0},this.kd={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0,audioBytesReceived:0},this.Rd=void 0,this.Id="",this.Yc=0,this.Nd=0,this.$a=1e3,this.Xc="udp",this.Wc={},this.$c="",this.th="",this.Cd=!1,this.zd=!1,this.Dd=!1,this.ih=0,this.eh=0,this.connectIPStack=-1,this.Ad=0,this.Tc=0,this.Qs=0,this.Pd=!0,this.onFindDecodeException=function(t){},this.Md=void 0,this.xd=!1,this.onRecvMediaData=function(){},this.p2pNetStats={p2pLostRate:0,p2pRTT:0},this.Ya.video.muteState=this.vd.videoMuteState,this.Ya.audio.muteState=this.vd.audioMuteState,this.sh=new sb(this.Dn,this.zn,this.tu,$n.event)}return Object.defineProperty(t.prototype,"_playStream",{get:function(){return this.vd.playStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Uo",{get:function(){return this.Dn.streamCenter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tu",{get:function(){return this.vd.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.vd.sessionId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerID",{get:function(){return this.vd.peerID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioMuted",{get:function(){if(!this.vd.remoteStream||this.vd.remoteStream.getAudioTracks().length<=0)return!0;var t=this.vd.remoteStream.getAudioTracks()[0];return!(!t||!t.muted&&"ended"!==t.readyState&&t.enabled)||("1"==this.vd.audioMuteState||!this.vd.playMediaStatus.audio)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoMuted",{get:function(){if(!this.vd.remoteStream||this.vd.remoteStream.getVideoTracks().length<=0)return!0;var t=this.vd.remoteStream.getVideoTracks()[0];return!(!t||!t.muted&&"ended"!==t.readyState&&t.enabled)||("1"==this.vd.videoMuteState||!this.vd.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.vd.rtcViewer;u&&(s=u.iu,r=u.eu),s&&s.currentTime||(s=ld(this._playStream,"video")||s),r&&r.currentTime||(r=ld(this._playStream,"audio")||r||s);var a={sampleTimeWindow:this.Xa,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.vd.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.vd.ip&&(ql(this.vd.ip)?a.ipv6=this.vd.ip:a.ipv4=Ll(this.vd.ip));var c=this.md.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.wd||(this.wd=o-1e3);var y=this.vd.playMode===J.L3;if(g){var w=g.totalInterFrameDelay,S=g.framesDecoded,E=g.totalSquaredInterFrameDelay,O=_(S,this.kd.framesDecode);this.kd.framesDecode=S;var T=_(w,this.kd.totalInterFrameDelay);this.kd.totalInterFrameDelay=w;var k=_(E,this.kd.totalSquaredInterFrameDelay);this.kd.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.vd.cameraStatus&&!this._d.decodeStartTime&&(this._d.decodeStartTime=o-1e3),this._d.decodeStartTime&&!this.zd)Ub(o,O,0===this.vd.cameraStatus&&this.vd.playMediaStatus.video&&!this.Cd&&!this.Dd,this._d,this.bd,this.Sd,this.Od,C,z,y)}if(b){var D=b.totalSamplesReceived,A=b.concealedSamples,P=b.bytesReceived,M=_(D,this.kd.totalSamplesReceived);this.kd.totalSamplesReceived=D;var x=_(A,this.kd.concealedSamples);this.kd.concealedSamples=A;var j=_(P,this.kd.audioBytesReceived);this.kd.audioBytesReceived=P;var L=parseInt((1e3*(x/(M||1))).toString());if(j>0&&0===this.vd.micStatus&&!this.yd.decodeStartTime&&(this.yd.decodeStartTime=o-1e3),this.yd.decodeStartTime)Ub(o,j,0===this.vd.micStatus&&this.vd.playMediaStatus.audio&&!this.Cd&&!this.Dd,this.yd,this.gd,this.Ed,this.Td,L,L,y)}var q=[],U="",B=!1;if(t.forEach(function(t){"track"==t.type&&(B=!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.th!==r&&(n.th=r),a.audioCodec=n.th,0!=c)a.audioBitrate=8*(i.bytesReceived-n.md.audioBytesReceived)/(i.timestamp-c),(b=i.packetsLost-n.md.audioPacketsLost)>0&&(f=b/(b+i.packetsReceived-n.md.audioPacketsReceived));if(a.audioBitrate<0&&(a.audioBitrate=0),i.jitterBufferDelay){var o=i.jitterBufferDelay,u=i.jitterBufferEmittedCount;m=Math.floor((o-n.md.audioJitterBufferDelay)/(u-n.md.audioJitterBufferEmittedCount)*1e3),(m=isNaN(m)||m<0?0:m)>1e4&&n.vd.info("".concat(Sv," audio jitterDelay ").concat(o," ").concat(n.md.audioJitterBufferDelay," ").concat(u," ").concat(n.md.audioJitterBufferEmittedCount)),n.md.audioJitterBufferDelay=o,n.md.audioJitterBufferEmittedCount=u,a.audioJitterBufferDelayMs=m}a.audioJitter=i.jitter,i.packetsLost>0&&(a.audioPacketsLost=i.packetsLost);var g=i.packetsLost-n.md.audioPacketsLost;a.audioFPS=(i.packetsReceived-n.md.audioPacketsReceived)/(i.timestamp-c)*1e3,a.audioPacketsLostRate=g>0?g/(i.packetsReceived-n.md.audioPacketsReceived+g):0,n.md.audioBytesReceived=i.bytesReceived,i.packetsLost>0&&(n.md.audioPacketsLost=i.packetsLost),n.md.audioPacketsReceived=i.packetsReceived,n.md.audioTime=i.timestamp,n.md.time=i.timestamp,n.md.audioBitrate=a.audioBitrate,d=i.jitter,B||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.md.videoBytesReceived)/(i.timestamp-c),a.videoFPS=1e3*(i.framesDecoded-n.md.framesDecoded)/(i.timestamp-c),(b=i.packetsLost-n.md.videoPacketsLost)>0&&(l=b/(b+i.packetsReceived-n.md.videoPacketsReceived));else Vt(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.$c!==y){var w=n.Uo.seiWorker;w&&w.postMessage({cmd:"updatePlayer",codec:y,streamID:n.tu}),n.$c=y}if(a.videoCodecName=n.$c,i.jitterBufferDelay){o=i.jitterBufferDelay,u=i.jitterBufferEmittedCount;p=Math.floor((o-n.md.videoJitterBufferDelay)/(u-n.md.videoJitterBufferEmittedCount)*1e3),(p=isNaN(p)||p<0?0:p)>1e4&&n.vd.info("".concat(Sv," video jitterDelay ").concat(o," ").concat(n.md.videoJitterBufferDelay," ").concat(u," ").concat(n.md.videoJitterBufferEmittedCount)),n.md.videoJitterBufferDelay=o,n.md.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.md.videoPacketsLost)>0?g/(i.packetsReceived-n.md.videoPacketsReceived+g):0,n.md.videoBytesReceived=i.bytesReceived,n.md.framesDecoded=i.framesDecoded,i.packetsLost>0&&(n.md.videoPacketsLost=i.packetsLost),n.md.videoPacketsReceived=i.packetsReceived,n.md.videoTime=i.timestamp,n.md.time=i.timestamp,v=i.jitter,B||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||Eh()&&!i.selected)"local-candidate"===i.type&&q.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&&(U=i.localCandidateId);var S=n.Uo.lastChangeIpTime;if(S&&n.eh<S&&Date.now()-S<=15e3){var E=i.bytesReceived,O=n.md.condidateBytesReceived;O&&(E>O?n.ih=0:n.ih++),n.ih>=5&&(n.ih=0,n.eh=S,n.onPlayingError(be)),n.md.condidateBytesReceived=E}else n.ih>0&&(n.ih=0)}}),U){var V=q.find(function(t){return t.id==U});if(V){var G=void 0;if(void 0!==V.relayProtocol)G=V.relayProtocol;else if(V.protocol)G=V.protocol;else if(V.priority){var Y=V.priority>>24;void 0!==Y&&(G=fd(Y,this.Dn.browser))}void 0!==G&&this.Xc!==G&&(this.vd.info(yv+" protocol "+G),this.Xc=G);var Z=!1,Q=V.candidateType,X=V.networkType,W=V.relayProtocol,K=V.relatedAddress,$=V.url,tt=V.ip;if(tt){var it=Ul(tt);it>=0&&it!==this.connectIPStack&&(this.zn.info(wv+" "+this.tu+" ipStack "+Nt[it]),this.connectIPStack=it)}Z=this.hh([{key:"candidateType",value:Q},{key:"networkType",value:X}]),"relay"===Q&&(Z=this.hh([{key:"relayProtocol",value:W},{key:"relatedAddress",value:K},{key:"url",value:$}])),Z&&this.vd.info(wv+" upload candidate change "+JSON.stringify(this.Wc))}}var et=0;et=m>0&&p>0?Math.max(m,p):m>0?m:p>0?p:0,a.jitterBufferDelayMs=this.md.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?Qo(st):0,a.videoQuality=c>0?Qo(nt):0,this.Dn.networkState!==H.offline&&"disconnected"!==(null===(e=this.vd.peerConnection)||void 0===e?void 0:e.connectionState)||(a.videoQuality=F.Die,a.audioQuality=F.Die);var rt=Math.min(nt,st);if(this.Vc=rt,a.peerToPeerDelay=isNaN(this.p2pNetStats.p2pRTT)?0:parseInt((this.p2pNetStats.p2pRTT/2+this.md.jitterBufferDelayMs).toString()),a.peerToPeerPacketLostRate=this.p2pNetStats.p2pLostRate,this.playStat=a,this.updateCurrentQualityStats(a),!this.xd&&(a.videoBitrate>0||a.audioBitrate>0)&&(this.xd=!0,this.onRecvMediaData&&this.onRecvMediaData()),this.Pd){var ot=a.videoFramesDropped,ut=a.videoTransferFPS;a.videoBitrate>0&&0===a.videoFPS&&ot>0&&ut>0&&Math.abs(ot-ut)<=3?this.Md?performance.now()-this.Md>3e3&&(this.Md=void 0,this.Pd=!1,this.onFindDecodeException&&this.onFindDecodeException(!0)):this.Md=performance.now():a.videoFPS>0&&(this.Md=void 0,this.Pd=!1)}this.$a==this.Qa?this.notifyPlayQuality():this._c||o-this.Tc+50>=this.Qa&&this.notifyPlayQuality(),this.$a==this.Xa?this.reportPlayQuality():this.Sc||o-this.Qs+50>=this.Xa&&this.reportPlayQuality(),this.vd.onStatsUpdated(this.playStat)}},t.prototype.notifyPlayQuality=function(){this.Tc=Date.now(),this.vd.onPlayQualityUpdate(this.tu,this.Ya)},t.prototype.reportPlayQuality=function(){var t=Date.now();this.Qs=t,this.checkProbe(t),this.uploadPlayQuality(this.playStat,t),this.sh.checkRemoteStats(this.playStat,this._playStream),this.Uo.changeRxQuality(Qo(this.Vc))},t.prototype.getVideoRenderFps=function(t){var i=-1;if(!t||!(t&&(!!t.getVideoPlaybackQuality||!!t.requestVideoFrameCallback||void 0!==t.mozPaintedFrames)))return-1;var e=this.md.videoElem,n=t.currentTime,s=t.getVideoPlaybackQuality();t.requestVideoFrameCallback&&!s.totalVideoFrames?e&&e==t||(this.md.videoElem=t,this.md.lastTimestamp=n,!e&&t.requestVideoFrameCallback(this.videoFramesRender.bind(this))):this.md.videoElem=null,e=this.md.videoElem;var r,o=Date.now(),u=this.md,a=u.renderTime;return r="firefox"!=this.Dn.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.md.renderTime=o,this.md.totalRenderFrames=r,i},t.prototype.videoFramesRender=function(t,i){var e=this.md,n=e.videoElem;if(n&&n.requestVideoFrameCallback){var s=n.currentTime;e.lastTimestamp!=s&&(this.md.paintedFrames++,this.md.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.md.videoElem||ld(this.vd.playStream);u&&(t.frameHeight=u.videoHeight||0,t.frameWidth=u.videoWidth||0)}0!==this.vd.cameraStatus&&0===t.videoBitrate&&0===t.videoFPS&&(t.frameHeight=0,t.frameWidth=0);var c=t.frameWidth,h=t.frameHeight;if(0===e||this.md.frameHeight===h&&this.md.frameWidth===c)0===e&&(this.md.frameHeight=h,this.md.frameWidth=c,this.vd.isProbe||(this.Ln.spanAppendAttribute({key:this.vd.playingEvent,par:this.tu},"vinfo",{h:h,fft:Date.now(),w:c}),this.Ln.spanAppendAttribute({key:ss.event,par:this.tu},"vinfo",{h:h,fft:Date.now(),w:c})));else{if(!this.vd.isProbe){var f=this.Ln.createSpan(a.H,{key:$n.event,par:this.tu},{key:""},Fn);f.setAttributes({webrtc_sid:Yn(this.sessionId),w:Zn(c),h:Qn(h)}),f.end(),this.Ln.spanAppendAttribute({key:this.vd.playingEvent,par:this.tu},"vinfo",{h:h,fft:Date.now(),w:c}),this.Ln.spanAppendAttribute({key:ss.event,par:this.tu},"vinfo",{h:h,fft:Date.now(),w:c})}this.md.frameHeight=h,this.md.frameWidth=c}0!=e&&(isNaN(s)||isNaN(r)||(t.videoTransferFPS=1e3*(s-this.md.framesReceived)/(o-e),t.videoFramesDropped=r-this.md.framesDropped)),t.videoTransferFPS<0&&(t.videoTransferFPS=0),t.videoFramesDropped<0&&(t.videoFramesDropped=0),s&&(this.md.framesReceived=s),r&&(this.md.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:Jb(Jb({},this.Ya.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.Od.decodeDuration,videoCumulativeBreakTime:this.Od.breakDuration,videoCumulativeBreakRate:this.Od.breakDuration/(this.Od.decodeDuration+this.Od.breakDuration||1),videoRenderFPS:C}),audio:Jb(Jb({},this.Ya.audio),{audioBitrate:l,audioCodec:d,audioQuality:m,audioFPS:p,audioJitter:g,audioLevel:b,audioPacketsLost:_,audioPacketsLostRate:y,audioSamplingRate:w,audioSendLevel:S,muteState:v,audioCumulativeDecodeTime:this.Td.decodeDuration,audioCumulativeBreakTime:this.Td.breakDuration,audioCumulativeBreakRate:this.Td.breakDuration/(this.Td.decodeDuration+this.Td.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.Ya=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?$o(this._playStream):void 0;return void 0!==e&&this.Id!==e&&(this.Id=e,i.stmTracks=e),i},t.prototype.uploadPlayQuality=function(t,i){var e=i;if(0==this.Zc||e-this.Zc>=2e3){t.stream_type="play",t.stream_id=this.tu,t.timeStamp=e,t.video_break_duration=this.Sd.breakDuration,t.video_break_cancel_duration=this.Sd.breakCancelDuration,t.video_decode_time=this.Sd.decodeTime,this.Sd.breakCancelDuration=0,this.Sd.breakDuration=0,this.Sd.decodeTime=0,t.audio_break_duration=this.Ed.breakDuration,t.audio_break_cancel_duration=this.Ed.breakCancelDuration,t.audio_decode_time=this.Ed.decodeTime,this.Ed.breakCancelDuration=0,this.Ed.breakDuration=0,this.Ed.decodeTime=0,t.real_sampling_interval=e-this.wd;var n=this.simplifyPlayDataKey(t);void 0!==this.Rd&&(n.gw_aTxKbps=this.Rd.audioTXBitrate,n.gw_vTxkbps=this.Rd.videoTXBitrate,n.gw_vRedRate=this.Rd.videoRedRate,n.gw_TCStat=this.Rd.trafficControlStat,n.gw_TCBW=this.Rd.trafficControlStat),this.wd=e,this.vd.info(wv+" upload"+JSON.stringify(n)),this.Uo.updateQuality(dt.play_quality,t),this.Zc=e}},t.prototype.getP2PNetStats=function(){var t=this;this.Ad=Date.now(),this.vd.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.Ka&&(this.vd.info(yv+" called ".concat(this.$a," ").concat(this.Qa," ").concat(this.Xa)),(this.Ka||this._c||this.Sc)&&this.clearPlayQualityTimer(),this.getP2PNetStats(),this.Ka=setInterval(function(){t.Nd++;var i=t.vd.peerConnection;if(i){var e=[i.getStats(null)];Promise.all(e).then(function(i){if(t.Ka)t.getPlayStats(i[0],i[1])}).catch(function(i){t.vd.error(yv+" getStats error "+i.toString())})}},this.$a),this.Tc=this.Qs=Date.now(),1e3!==this.$a&&(this.$a!=this.Qa&&(this._c=setInterval(function(){t.notifyPlayQuality()},this.Qa)),this.$a!=this.Xa&&(this.Sc=setInterval(function(){t.reportPlayQuality()},this.Xa))),this.md={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.md.paintedFrames,lastTimestamp:0,videoElem:this.md.videoElem,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0})},t.prototype.clearPlayQualityTimer=function(){if(this.vd.info("zc.p.spqt.1.1 called ".concat(!!this.Ka," ").concat(!!this._c," ").concat(!!this.Sc)),null!=this._c&&(clearInterval(this._c),this._c=null),null!=this.Sc&&(clearInterval(this.Sc),this.Sc=null),null!=this.Ka){clearInterval(this.Ka),this.Ka=null;var t=(new Date).getTime();this.wd=0,this.Nd=0,this.kd={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0,audioBytesReceived:0};var i=this.vd.playMode===J.L3;Bb(this._d,this.Sd,this.Od,this.bd,!this.Dd&&0===this.vd.cameraStatus&&this.vd.playMediaStatus.video,t,i),Bb(this.yd,this.Ed,this.Td,this.gd,!this.Dd&&0===this.vd.micStatus&&this.vd.playMediaStatus.audio,t,i)}this.Yc=0,this.md={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.zd=!1,this.Dd=!1},t.prototype.checkProbe=function(t){var i=this.Vc,e=this.md.time;this.vd.debug(yv+" netQuality "+i+" "+e),i<=this.Uo.targetQuality?this.Yc++:this.Yc=0,e>0&&this.Yc>=this.Uo.probeStartedNum&&t>this.vd.probeTime+this.Uo.probeInterval&&(this.zn.info(yv+" netQuality "+i+" start net probe"),this.probeState=ct.tryProbe,this.vd.poorQualityRetryCnt++,this.Uo.startNetProbe(!1,this.vd))},t.prototype.startProbeTimeout=function(){var t=this;this.if=setTimeout(function(){t.vd.error(fv+" probe timeout"),t.vd.playStateUpdateError($n.error.mn)},this.pd)},t.prototype.stopProbeTimeout=function(){this.if&&(clearTimeout(this.if),this.if=null)},t.prototype.setStreamUpdate=function(t){0===t?this.Cd=!0:1===t&&(this.Cd=!1)},t.prototype.setPlayStreamEnd=function(t){this.Dd=t},t.prototype.setHasBFrames=function(t){this.zd=t},t.prototype.updateGwPlayNetState=function(t){this.Rd=t},t.prototype.resetCallbackState=function(){this.xd=!1,this.Pd=!0,this.Vc=0},t.prototype.hh=function(t){for(var i=!1,e=0;e<t.length;e++){var n=t[e],s=n.key,r=n.value;this.Wc[s]!==r&&(this.Wc[s]=r,i=!0)}return i},t.prototype.onPlayingError=function(t){},t}(),Hb=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)}}(),Gb=$n.event,Fb=Bn,Yb=ss,Zb=$n.error,Qb=jn.error,Xb=Xn,Wb=rs;!function(t){t[t.disconnected=0]="disconnected",t[t.connecting=1]="connecting",t[t.connected=2]="connected"}(Rb||(Rb={}));var Kb=function(t){function i(i,e,n,s,r){var o=t.call(this)||this;return o.streamID=i,o.zn=e,o.Dn=n,o.Uo=s,o.isPublish=r,o.streamRetryStartTime=0,o.ou=Cm(o.zn,o.streamID),o}return Hb(i,t),Object.defineProperty(i.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),i.prototype.startMaxTime=function(){var t=this;this.ou.info("zc.tsh.smt call"),this.maxTimer?this.ou.warn("zc.tsh.smt max timer"):(0===this.streamRetryStartTime&&(this.streamRetryStartTime=(new Date).getTime()),this.maxTimer=setTimeout(function(){if(t.ou.warn("zc.tsh.smt over max time ".concat(t.RETRY_MAX_TIME,"s, stop retry")),t.isOverTime=!0,t.invalid(),t.isPublish){if(!t.Uo.publisherList[t.streamID])return void t.ou.info("zc.tsh.smt publish no found");t.publishStateHandle(W,t.streamID,Qb._e,!0)}else{var i=t.Uo.playerList[t.streamID];if(!i)return void t.ou.info("zc.tsh.smt play no found");var e=Zb.hn;t.Dn.isFlutter&&i.isStreamNotFound&&(e=i.hasSucceed?we:de),t.playStateHandle(tt,t.streamID,e,!0)}},1e3*this.RETRY_MAX_TIME),this.ou.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.ou.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.Dn.networkState==H.offline?(this.ou.info("zc.tsh.rns offline"),Rb.disconnected):this.isPublish?(this.ou.info("zc.tsh.rns publish ws state "+(null==(t=this.Uo.publisherList[this.streamID].publisher.signal)?void 0:t.state)+" "+t.mediaState),(null==t?void 0:t.state)==O&&(null==t?void 0:t.mediaState)===Pt.LOGIN?Rb.connected:(null==t?void 0:t.state)===S&&(null==t?void 0:t.mediaState)===Pt.LOGOUT?Rb.disconnected:Rb.connecting):(this.ou.info("zc.tsh.rns play ws state "+(null==(t=this.Uo.playerList[this.streamID].signal)?void 0:t.state)+" "+(null==t?void 0:t.mediaState)),(null==t?void 0:t.state)==O&&(null==t?void 0:t.mediaState)===Pt.LOGIN?Rb.connected:(null==t?void 0:t.state)===S&&(null==t?void 0:t.mediaState)===Pt.LOGOUT?Rb.disconnected:Rb.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.ou.info(zd+" call "+(e?e.code+"":"")+" "+n+" "+JSON.stringify(s)+" "+r+" "+c);var h=this.Uo.publisherList[i],f=h.publisher;if(c)return this.stopMaxTime(),this.invalid(),1===t&&f.resetPublish(1),(null==e?void 0:e.code)&&this.Ln.spanSetAttributes({key:f.parentSpanKey,par:i},e),void this.Uo.onPublishStateUpdate(t,i,e);if(e&&0!==e.code){this.maxTimer||c||this.startMaxTime(),this.Dn.publishStreamList[i].state=I.retryPublish;var l=f.localStream,d=f.publishOption;f.resetPublish(1);var v=this.retryNextSignal();if(this.ou.info(zd+" server connect state "+Rb[v]),v===Rb.connected){this.ou.info(zd+" retry current signal "),this.rtcPublishSpan(i,e,f),(null===(o=h.publisher.signal)||void 0===o?void 0:o.state)===O&&(this.ou.info(zd+" 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=[Qb.ve.code,Qb.Ne.code,he.code].includes(e.code)?0:1e3;return this.ou.info(zd+" delay "+m),this.startRetryTimer=setTimeout(function(){a.ou.info(zd+" retry publish "+f.state),7==f.state&&f.startPublish(i,l,d)},m),e&&0!==e.code&&this.Uo.onPublishStateUpdate(2,i,e),void this.publishStartSpan(i,e,h,s)}if(v===Rb.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.Uo.onPublishStateUpdate(2,i,e),this.publishStartSpan(i,e,h,s)}else this.ou.info(zd+" server connecting")}this.ou.info(zd+" end")},i.prototype.needReDispatchError=function(t){return[Qb.Le.code,Zb.pn.code].includes(t.code)},i.prototype.isSwitchIPStackError=function(t){return[he.code,Ne].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.ou.info(Dd+" call "+(e?e.code+"":"")+" "+n+" "+JSON.stringify(s)+" "+r+" "+v);var m=this.Uo.playerList[i];if(v)return this.stopMaxTime(),this.invalid(),(null==e?void 0:e.code)&&(null===(o=m.Za)||void 0===o||o.setAttributes({error:null==e?void 0:e.code})),void this.Uo.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.ou.info(Dd+" server connect state "+Rb[g]),g===Rb.connected){this.ou.info(Dd+" retry current signal "),m.isCenterNode&&(null===(u=m.signal)||void 0===u?void 0:u.state)===O&&(this.ou.info(Dd+" 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=$n.error,_=[b.un.code,b.Ne.code,Ne.code].includes(e.code)?0:1e3;return this.ou.info(Dd+" delay "+_),this.startRetryTimer=setTimeout(function(){d.ou.info(Dd+" retry state "+m.state),7===m.state&&m.startPlay(i,m.getRemoteStreamSuc)},_),e&&0!==e.code&&this.Uo.onPlayStateUpdate(2,i,e),p||m.jd||(m.jd=Si(this.Ln,a.I,i,m.playingEvent,$n.event),this.endRtcPlaySpan(i,e,m)),void this.playStartSpan(i,m,void 0,e,s)}if(g===Rb.disconnected){var y=null===(l=m.room)||void 0===l?void 0:l.roomID;this.retryServer(m.playMode===J.RTC,y,null==m?void 0:m.room.token),m&&(m.isExternal=!1),this.Uo.onPlayStateUpdate(2,i,e),p||m.jd||(m.jd=Si(this.Ln,a.I,i,m.playingEvent,$n.event),this.endRtcPlaySpan(i,e,m)),this.endRtcPlaySpan(i,e,m),this.playStartSpan(i,m,void 0,e,s)}else this.ou.info(Dd+" server connecting")}this.ou.info(Dd+" end")},i.prototype.retryServer=function(t,i,e){var n=t?hy:fy;this.Uo.signalList[n]?this.Uo.openConnectServerTask(n):this.Uo.connectWebRTCCenterServer(!1,t,i,e)},i.prototype.setRetryFailNodes=function(t){if(t)if(t.ipNodeType===zt.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=hd(e,o),a=hd(n,o);if(u>-1)(c=hd(s,o))>=0&&s.splice(c,1),s.push(e[u]);else if(a>-1){var c;(c=hd(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,h=Ad;if(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(i&&i.code&&[Oe.code].includes(i.code))h+=" try curr node ; ";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.ou.info(Ad+" redirect");var f=null==e?void 0:e.ins;if(f&&f.length>0){var l=((null===(s=f[0])||void 0===s?void 0:s.IP)||(null===(r=f[0])||void 0===r?void 0:r.ip))+":"+((null===(o=f[0])||void 0===o?void 0:o.Port)||(null===(u=f[0])||void 0===u?void 0:u.port)),d=(null===(a=f[0])||void 0===a?void 0:a.ipv6)+":"+(null===(c=f[0])||void 0===c?void 0:c.port);t.gwNode=l&&d?[zt.ZV4Only,zt.ZV4Priority].includes(t.ipNodeType)?l:d:l||d}break;case 4:t.resetGwNodes(),this.Uo.clearCachedGwNodesList(t,this.isPublish)}else this.retryNextGwNode(t,!1,n);this.ou.info(h+=" new node "+t.gwNode)},i.prototype.retryNextGwNode=function(t,i,e){if(this.ou.info(Pd+" call "+t.gwNode),t.gwNode||!t.isNodesEmpty){var n=(new Date).getTime(),s=t.gwNodesTTL<n,r=t.iceStateDisConnect&&this.Dn.isMultiOuter,o=this.Uo.isNodeLast(this.isPublish?t:t.zegoPeer),u=o.lastTryNext,a=o.currentIdx,c=t.hasSucceed;this.ou.info(Pd+" ttl: "+s+" ice: "+r+" last: "+u+" hasSucc: "+c),i||c&&s||t.isLastConnected&&r||u?(t.gwNode=this.Uo.getGwNode(t,t.ipNodeType,a),this.dispatchGwNodesBypass(t)):t.gwNode=this.Uo.getGwNode(t,t.ipNodeType,e?-1:a)}else this.ou.info(Pd+" 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.Uo.getStreamIPNodesMode().ipV6Prefer;t.dispatchGwNodes(s,function(e){n.ou.info(Md+" suc "+JSON.stringify(e)),t.setGwNodes(e,!0,s),i()},function(t){n.ou.info(Md+" 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.Ln.spanEnd({key:Xn.event,par:t},{tryidx:Xb.tryidx(null==e?void 0:e.rtcPublishCount),url:Xb.url(null===(n=null==e?void 0:e.signal)||void 0===n?void 0:n.server),ip:Xb.ip(null==e?void 0:e.ip),dispatch_external_ip:Xb.dispatch_external_ip(this.Dn.clientIP),resource_type:Xb.resource_type("rtc"),protocol:Xb.protocol("webrtc"),try_time:Xb.try_time(s),error:null==i?void 0:i.code,message:null==i?void 0:i.message})},i.prototype.publishStartSpan=function(t,i,e,n){var s,r,o,u=null==e?void 0:e.publisher,c=(null==u?void 0:u.hasSucceed)?Un:Ln,h=this.Ln.createSpan(a.H,{key:jn.event,par:t},{key:c.event,par:t},c.event,!0);(null==i?void 0:i.code)===se.code?o={reason:"DenyInfoError",deny_code:n.err,deny_action:null==n?void 0:n.action}:(null==i?void 0:i.code)===Ai.code&&(o={reason:"NetworkBroken"}),o&&h.setAttributes(o),!1===(null==u?void 0:u.isRePublish)&&this.Ln.spanSetAttributes({key:Fb.event,par:t},{retry_btime:Fb.retry_btime((new Date).getTime())}),(null==u?void 0:u.hasSucceed)&&(u.isRePublish=!0,u.parentSpanKey=Un.event),this.Ln.createSpan(a.I,{key:jn.event,par:t},{key:Xn.event,par:t},Xn.event,!0).setAttributes({room_id:Xb.room_id(null===(s=null==e?void 0:e.room)||void 0===s?void 0:s.roomID),room_sid_string:Xb.room_sid_string(null===(r=null==e?void 0:e.room)||void 0===r?void 0:r.roomSessionID)}),u&&(u.rtcPublishCount++,u.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:Wb.try_time(n),error:null==i?void 0:i.code,message:null==i?void 0:i.message}))},i.prototype.playStartSpan=function(t,i,e,n,s){if(void 0===e&&(e=!1),!i.Za&&!i.isProbe){i.Za=Si(this.Ln,a.H,t,i.playStartEvent,Gb,void 0,!0);var r=void 0;e?r={reason:"StartPlay"}:(null==n?void 0:n.code)===Ai.code?r={reason:"NetworkBroken"}:s&&(r={reason:"DenyInfoError",deny_code:null==s?void 0:s.err,deny_action:null==s?void 0:s.action}),r&&i.Za.setAttributes(r)}!0===i.hasSucceed&&this.Ln.spanSetAttributes({key:Yb.event,par:t},{retry_btime:Yb.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}(Bc),$b=function(){return $b=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},$b.apply(this,arguments)},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())})},i_=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_=$n.event,n_=$n.error,s_=ss;function r_(t){var i=0,e=0;return i=t[e++]<<24,i|=t[e++]<<16,i|=t[e++]<<8,i|=t[e++]}function o_(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 u_,a_=function(){function t(t,i,e,n,s,r,o,u,a,c){var h,f=this;this.vd=t,this.Ld=i,this.Cl=r,this.Uo=o,this.Dn=u,this.room=a,this.qd=c,this.ml=!0,this._state=7,this.lastState=7,this.xf=0,this.Tf=[],this.dl=0,this.ph=0,this.remoteStream=null,this.zf=void 0,this.closeSessionSignal=!1,this.Ud=!1,this.Bd=!1,this.mic=null,this.firstFrameTime=0,this.ipV6Prefer=0,this.ipNodeType=zt.ZV4Priority,this.ipStackNode=Nt.IPv4,this.ff=!0,this.nf=!1,this.sf=[],this.rf=[],this.uf=[],this.af="",this.cf="",this.hf=500,this.startTime=0,this.qf="",this.Uf=[],this.Bf=0,this.ipNode=null,this.ipV4NodeList=[],this.ipV6NodeList=[],this.probeType="audio",this.el=0,this.Jd=0,this.Vd=!1,this.Hd="",this.Gd=0,this.ul=0,this.al="",this.retryFailGwNodes=[],this.retryFailIpV4Nodes=[],this.retryFailIpV6Nodes=[],this.signalTime=0,this.stopReason="",this.Fd=0,this.Yd=0,this.vl=((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.ol=0,this.Zd={Qd:!0,Xd:[],Wd:[]},this.onDataChannelList=[],this.ll={isSEIStart:!1,unregisterSeiFilter:"",filterSize:0},this.Lo=!1,this.yf=0,this.wf=0,this.Sf=0,this.Ef=0,this.Of=0,this.bl={lanIP:"",wanIP:"",intranet:!1},this.Df=!1,this.Kd={first:!0,seq:0},this.pl=!1,this.decodeVideoFrame=function(t,i){var e,n,s="VP8"!==f.Hd,r="H265"===f.Hd;if(s){var o=f.$d;if(o){if(o.buffer)if(t.timestamp-o.time<20){var u=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),o.buffer);u&&(s=!1)}else o.buffer=void 0}else f.$d={buffer:new Uint8Array(t.data).slice(0),time:t.timestamp}}if(s){for(var a=new DataView(t.data),c=0,h=new Qg(a,r),l=0,d=!1;h.NextNalu(d);){if(r){if(32==(l=(126&a.getUint8(h.nalu_start+h.start_code_size))>>1)||33==l||34==l||35==l)continue;if(39!=l)break}else{if(7==(l=31&a.getUint8(h.nalu_start+h.start_code_size))||8==l||9==l)continue;if(6!=l)break}var v=new Uint8Array(t.data).slice(h.nalu_start+h.start_code_size,h.nalu_start+h.start_code_size+h.nalu_size);if(f.Dn.seiConfig.emulationPreventionByte)v=o_(v).output;c=r?2:1,d=!0;for(var m=0;255===v[c];)m+=255,c++;if(243===(m+=v[c++])||5===m||100===m){for(var p=0;255===v[c];)p+=255,c++;if(p+=v[c++],t.data.byteLength-c<p)break;var g=new Uint8Array(4+p);switch(g[0]=0,g[1]=0,m){case 100:g[2]=3,g[3]=235;break;case 5:g[2]=3,g[3]=236;break;case 243:g[2]=3,g[3]=237}for(var b=0;b<p;b++)g[4+b-0]=v[c++];var _=!1;if(243===m)_=!0;else if(5===m){var y=f.ll.unregisterSeiFilter;if(y){var w=g.slice(4,4+f.ll.filterSize),S=void 0,E=!0;if(0===(S="string"==typeof y?Xl(y):y).length)E=!1;else for(var O=0;O<S.length;O++)if(S[O]!==w[O]){E=!1;break}_=E}else _=!0}_&&f.Dn.actionListener("playerRecvSEI",f.tu,g)}else if(244===m){for(p=0;255===v[c];)p+=255,c++;if(p+=v[c++],t.data.byteLength-c<p)break;var T=parseInt(p/5+""),k=v.slice(c,c+=p),R=[],I=function(t){var i=5*t,s=k.slice(i,i+4),r=k.slice(i+4,i+5),o=r_(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)||"";R.push({soundLevelID:o,value:u,streamID:a})};for(O=0;O<T;O++)I(O);var N=new Map(R.map(function(t){return[t.soundLevelID,t.value]})),C=R.filter(function(t){return t.streamID}).map(function(t){return[t.streamID,t.value]}),z=new Map(C);f.Dn.actionListener("mixerSoundLevelUpdate",N,f.tu),z.size&&f.Dn.actionListener("autoMixerSoundLevelUpdate",z,f.tu)}}i.enqueue(t)}else i.enqueue(t)},this.decodeAudioFrame=function(t,i){i.enqueue(t)},this.Xr={seiMessage:function(t){var i=t.data,e=i.streamID;if(e===f.tu)switch(i.cmd){case"recvSEI":f.Dn.actionListener("playerRecvSEI",e,new Uint8Array(i.buffer));break;case"mixSoundLevel":f.onRecvMixSoundLevels&&f.onRecvMixSoundLevels(i.soundLevelList)}},onUaSocketConnected:function(){var t;f.zn.info("zc.ply.ousc call. "+(null===(t=f.wl)||void 0===t?void 0:t.length)+" gwNode: "+f.qf),f.wl&&(f.qf="",f.getDispatchIPNodeMode(),f.Sl.apply(f,f.wl))}},this.onCanStopNegaTimer=function(){},this.onPlayStateUpdateError=function(){},this.onPlayBFrameEvent=function(t){},this.onPlayStreamEnd=function(t){},this.onGwPlayNetState=function(t){},this.wl=void 0,this.zn=Cm(n,this.tu),this.Tl=new fb(n,!1,t.streamId),e&&this.setSignal(e),this.dataReport=s,this.Lo=this.Dn.isMiniSdp,this.Lo&&(this.Ol=new _b(o,n,this.tu)),this.checkAutoTcp(),this.tv(),this.dl=t.playStartTime}return Object.defineProperty(t.prototype,"signal",{get:function(){return this.Il},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoTcp",{get:function(){return this.ml},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.xf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ev",{get:function(){return this.vd.playStartEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProbeByDG",{get:function(){return this.vd.isProbeByDG},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamId",{get:function(){return this.tu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.ph},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playStream",{get:function(){return this.vd.playStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerConnection",{get:function(){return this.zf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resourceMode",{get:function(){return this.nv},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Rl",{get:function(){return this.Uo.agentIpStackDetection.IPv4===Dt.reachable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwNode",{get:function(){return this.qf},set:function(t){this.qf=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwNodeList",{get:function(){return this.Uf},set:function(t){this.Uf=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===zt.ZV4Only?0===this.Uf.length:this.ipNodeType===zt.ZV4Priority?0===this.ipV4NodeList.length:(this.ipNodeType===zt.ZV6Priority||0===this.ipV4NodeList.length)&&0===this.ipV6NodeList.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"il",{get:function(){return this.vd.isPeer},set:function(t){this.vd.isPeer=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProbe",{get:function(){return this.vd.isProbe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerID",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needTranscode",{set:function(t){this.Jd=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamConnectIP",{get:function(){return this.al},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingEvent",{get:function(){return this.vd.playingEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamNotFoundTime",{get:function(){return this.Fd},set:function(t){this.Fd=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataChannel",{get:function(){return this.bh},enumerable:!1,configurable:!0}),t.prototype.createSEIWorker=function(){return this.Uo.createSEIWorker()},Object.defineProperty(t.prototype,"seiWorker",{get:function(){return this.Uo.seiWorker},enumerable:!1,configurable:!0}),t.prototype.Kr=function(t,i){return void 0===i&&(i=!1),this.Dn.settingConfig.getSetting(t,i)},Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tu",{get:function(){return this.vd.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sv",{get:function(){var t;return null===(t=this.qd)||void 0===t?void 0:t.streamParams},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playMode",{get:function(){return this.Ld},enumerable:!1,configurable:!0}),t.prototype.tv=function(){var t,i,e,n,s=null===(t=this.qd)||void 0===t?void 0:t.isSEIStart;if(Gt(s)&&(this.ll.isSEIStart=s),s){var r=Xo(),o=null===(i=this.qd)||void 0===i?void 0:i.videoCodec;(o&&"H264"!==o&&"H265"!==o||!r)&&(this.zn.warn(fv+" not use sei; support: ".concat(r,", codec: ").concat(o," ")),this.ll.isSEIStart=!1)}if(null===(e=this.Dn.seiConfig)||void 0===e?void 0:e.unregisterSEIFilter){var u=this.ll.unregisterSeiFilter=null===(n=this.Dn.seiConfig)||void 0===n?void 0:n.unregisterSEIFilter;this.ll.filterSize=Xl(u).byteLength}},t.prototype.setSignal=function(t){this.Il!==t?(this.Il=t,this.Tl.webrtcCenterServerSignal=t,this.wl&&(this.zn.info("zc.prc.ss signal register"),this.Il.on("uaConnected",this.Xr.onUaSocketConnected))):this.zn.info("zc.prc.ss signal no changed")},t.prototype.connectGW=function(){return t_(this,void 0,void 0,function(){var t,i=this;return i_(this,function(e){return this.state=0,this.Ud=!1,this.setTurnTcp(),this.Lo&&!this.Of&&(this.Of=performance.now()),(t=this.Kr("udp_or_tcp",!0))&&(this.zn.info(pv+" setting udp_or_tcp "+t),this.pl="tcp"===t),this.pl&&(this.il=!1,this.ml=!1),[2,new ni(function(t,e){(i.il?i.rv():i.ov()).catch(function(t){e(t)}),i.getRemoteStreamSuc=t})]})})},t.prototype.rv=function(){return t_(this,void 0,void 0,function(){var t,i,e,n,s,r;return i_(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.Gl({encodedInsertableStreams:this.ll.isSEIStart})];case 1:return(t=o.sent())?(t=this.rd(t),[4,this.uv(t)]):[2];case 2:return(i=o.sent())?(this.Zl(i.seq,i.sessionID,e=i.msg,i.ipv6Prefer),[4,this.parseRemoteMiniSdp(e)]):[2];case 3:if(n=o.sent(),this.ml&&!this.av(n,e.params_ext))throw this.cv(Ne,!1);return[4,ni.all([this.hv(t),this.fv(n,void 0,null==e?void 0:e.mini_sdp)])];case 4:return o.sent(),this.ml&&this.$l(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.ov=function(){return t_(this,void 0,void 0,function(){var t,i,e,n,s,r,o,u,a;return i_(this,function(c){switch(c.label){case 0:return c.trys.push([0,7,,8]),[4,this.uv(void 0)];case 1:return(t=c.sent())?(this.Ql(t.seq,t.sessionID,i=t.msg,t.ipv6Prefer),[4,this.lv(i)]):[2];case 2:return e=c.sent(),[4,this.Gl(e)];case 3:return(n=c.sent())?(n=this.rd(n),[4,this.hv(n)]):[2];case 4:return c.sent(),[4,this.dv(n)];case 5:return s=c.sent(),o=s.miniSdp,(r=s.remoteSdp)?[4,this.fv(r,!0,o)]:[2];case 6:return c.sent(),[3,8];case 7:if(!(u=c.sent()).playError)throw u;return this.onPlayStateUpdateError((a=u).error,a.stopRetry,a.detail,a.startFromFirst),[3,8];case 8:return[2]}})})},t.prototype.lv=function(t){var i;return t_(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 i_(this,function(D){switch(D.label){case 0:return this.zn.info((e=lv)+" success"),this.setTurnTcp(),this.Uo.autoSwitchProtocol=this.Kr("auto_to_tcp")||!1,n=this.Kr("udp_max_fail_num"),!isNaN(n)&&(this.Uo.maxUdpFailNum=n),o=(s=this.Uo).maxUdpFailNum,u=s.udpFailNum,this.zn.info(e+" autoToTcp: ".concat(r=s.autoSwitchProtocol,", udpFailNum: ").concat(u,", maxUdpFailNum: ").concat(o,".")),r&&!this.pl&&u>=o&&(this.zn.info(e+" switch to tcp."),this.pl=!0,this.ml=!1),(a=this.Kr("udp_or_tcp",!0))&&(this.zn.info(e+" setting udp_or_tcp "+a),this.pl="tcp"===a),c=[],h=void 0,f=this.bl.wanIP=(t.gw_nodes[0]||this.qf).split(":")[0],!this.Uo.isProxy||this.Uo.isLocalProxy?[3,2]:(l=null==ll?void 0:ll.proxyCtrl,[4,Promise.all([l.getTurnInfo(),l.intranetCheck(jl(f),void 0)])]);case 1:return d=D.sent(),m=d[1],(v=d[0]).code?this.zn.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.Yl.coturn_internal=w),S=xl(b),E="turn:".concat(S,":").concat(_,"?transport=").concat(this.pl?"tcp":"udp"),this.zn.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(xl(w))),h=[{credential:g,urls:[E],username:y}]),m.code?this.zn.warn(e+" use intranetCheck failed."+JSON.stringify(m)):this.bl.intranet=m.data.intranet||!1,[3,3];case 2:this.Uo.isLocalProxy&&this.Uo.turnServers?(h=(T=this.Uo.turnServers).map(function(t){return{credential:t.credential,urls:[t.url],username:t.username}}),this.zn.info(e+" use local proxy: "+JSON.stringify(T)),this.bl.intranet=!1):t.turn_server&&(O=[],t.turn_server.split(";").forEach(function(t){var i=Bl(t).replace("[","").replace("]",""),e=Ul(i);if(z.ipStackNode===e?O.push(t):z.sf.push(t),e==Nt.IPv4){var n=yd(i),s=t.replace(i,"[".concat(n,"]"));z.Uo.isCandidateHasIPv6&&O.push(s)}}),(C=this.sf).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.pl?R.length>0?R:k.map(function(t){return t.replace("udp","tcp")}):k,this.zn.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.ll.isSEIStart},this.af=t.turn_username,this.cf=t.turn_auth_key,h&&(I.iceServers=h,I.iceTransportPolicy="relay",I.rtcpMuxPolicy="require"),this.zn.info(e+" username: "+(N=I.iceServers[0]).username+", credential: "+N.credential),this.Ul(),this.zn.info(e+" call success"),[2,I]}})})},t.prototype.td=function(t,i){var e=this.vl[t],n=e.seq,s=e.time,r=performance.now();return-1!==n&&n>=i&&r-s<6e3?(this.zn.warn("zc.p.cps.1"+" push ".concat(t,", seq ").concat(i," local ").concat(JSON.stringify(this.vl[t]))),!1):(this.vl[t]={seq:i,time:r},!0)},t.prototype.Gl=function(t){return t_(this,void 0,void 0,function(){var i,e,n,s,r,o,u,a,c=this;return i_(this,function(h){switch(h.label){case 0:i=lv,this.zf=new RTCPeerConnection(t),this.zf.onicecandidate=function(t){c.vv(t)},this.zf.onsignalingstatechange=function(t){c.mv(t)},this.zf.oniceconnectionstatechange=function(t){c.pv(t)},this.zf.onconnectionstatechange=function(t){c.gv(t)},this.zf.ontrack=function(t){c.bv(t.streams[0],t.receiver)},e=this.Kr("peer_signal_over_dc"),(this.Uo.isDataChannelEnabled||e)&&(n={ordered:!1},this.zn.info("zc.p.dc.n option:"+JSON.stringify(n)+" enable: "+e),this.ol=0,this.bh=this.zf.createDataChannel(this.tu,n),this.bh.binaryType="arraybuffer",e&&(this.Tl.dataChannel=this.bh),this.bh.onopen=function(t){c.zn.info("zc.p.dc.o onopen")},this.bh.onclose=function(t){c.zn.warn("zc.p.dc.c onclose")},this.bh.onmessage=function(t){if(c.ol++<3&&c.zn.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.Dn.customUa&&(s=Qt(this.zf.addTransceiver),this.zn.info(i+" custom ua ios "+s),s&&(this.zf.addTransceiver("video",{direction:"recvonly"}),this.zf.addTransceiver("audio",{direction:"recvonly"}))),this.df=r={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.isProbe?"audio"===this.probeType&&(r.offerToReceiveVideo=!1):(this.qd&&!1===this.qd.video&&(r.offerToReceiveVideo=!1),this.qd&&!1===this.qd.audio&&(r.offerToReceiveAudio=!1)),this.zn.info(i+" createOffer: "+JSON.stringify(r)),o=this.getSpan(Or,this.ev),h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this.zf.createOffer(r)];case 2:return u=h.sent(),o&&(this.Dn.Bo(o,{sdp:u.sdp}),o.setAttributes({is_mini:Tr(this.Lo)}),o.end()),this._v(u.sdp||"")?[2,u]:(this.onNeedReplay&&this.onNeedReplay(),[2,void 0]);case 3:throw a=h.sent(),this.zn.error(i+" create offer error "+a.toString()),o&&this.Ln.setError(o,{code:n_.Oe.code,message:a.toString()}),this.cv(n_.Oe,!0);case 4:return[2]}})})},t.prototype.hd=function(t){return 0===$l(t).length},t.prototype.restartIce=function(){var t,i=this,e="zc.p.1.rsi";this.zn.info("".concat(e," call")),null===(t=this.zf)||void 0===t||t.createOffer($b($b({},this.df),{iceRestart:!0})).then(function(t){var n,s,r;if(i.zn.info("".concat(e," createOffer suc")),t.sdp){i.rd(t);var o=td(t.sdp),u=id(t.sdp);i.zn.info("".concat(e," ice ").concat(o," ").concat(u));var a={iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:i.sf,username:i.af,credential:i.cf}],encodedInsertableStreams:i.ll.isSEIStart};i.zn.info("".concat(e," set config ").concat(JSON.stringify(a))),null===(n=i.zf)||void 0===n||n.setConfiguration(a),i.sendRestartIce(o,u),i.zn.info("".concat(e," localSdp1 ").concat(t.sdp.substr(0,t.sdp.length/2))),i.zn.info("".concat(e," localSdp2 ").concat(t.sdp.substr(t.sdp.length/2))),null===(s=i.zf)||void 0===s||s.setLocalDescription(t).then(function(t){i.zn.info("".concat(e," set local sdp suc"))}).catch(function(t){i.zn.info("".concat(e," set local sdp fail ").concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))}),null===(r=i.zf)||void 0===r||r.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:i.zl})).then(function(t){i.zn.info("".concat(e," set remote sdp suc"))}).catch(function(t){i.zn.info("".concat(e," set remote sdp fail ").concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))}),i.rf.forEach(function(t){var n;null===(n=i.zf)||void 0===n||n.addIceCandidate(new RTCIceCandidate(t)).then(function(){i.zn.info("".concat(e," ").concat(i.tu,", add can suc"))}).catch(function(t){i.zn.info("".concat(e," ").concat(i.tu,", add can fail, ").concat(t.message))})})}}).catch(function(t){i.zn.warn("zc.p.0.rsi err ".concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))})},t.prototype.resetIceInfos=function(){this.zn.info("zc.p.1.rii.0 call"),this.sf=[],this.af="",this.cf="",this.rf=[]},t.prototype.resetNat64Infos=function(){this.zn.info("zc.p.0.rni.0 call"),this.uf=[]},t.prototype._v=function(t){return this.zn.info(lv+" is probe "+this.isProbe),!this.isProbe||(!("audio"===this.probeType&&!t.includes("m=audio"))||(this.zn.warn(lv+" no audio"),this.probeType="all",!1))},t.prototype.uv=function(t){var i=this;return new ni(function(e,n){try{i.Sl(t,e,n)}catch(t){n(t)}})},t.prototype.Sl=function(t,i,e){var n,s,r,o,u=this,a=!!t;if(!this.Il.isUaConnected)return this.zn.info(fv+" wait to create session"),this.wl=[t,i,e],void this.Il.on("uaConnected",this.Xr.onUaSocketConnected);this.wl&&(this.wl=void 0),this.ql=D();var c=this.tu;1==this.Uo.testEnvironment&&(c="zegotest-"+this.Uo.appid+"-"+this.tu);var h="".concat(fv," session req : "),f=this.getTransCodec(c),l=f.transCodecID,d=f.transCodecSuffix,v=f.transCodecStreamID;d&&(h+=" transcode: ".concat(l," , ").concat(c," , ").concat(d," ; "),this.Dn.onExperimentalAPICallback({method:"playerStartTranscoding",content:{streamID:this.tu,codecTemplateID:l,reason:this.Jd}}));c=v,this.Uo.gwNode&&(this.qf=this.Uo.gwNode);var m=this.Kr("gw_nodes");m&&Xt(m)&&m.length>0&&(this.zn.info(fv+" setting "+JSON.stringify(m)),this.Uf=m,this.qf=this.Uf[0]||this.qf);var p=(null===(s=null===(n=this.Uo.publisherList[this.tu])||void 0===n?void 0:n.room)||void 0===s?void 0:s.roomID)||(null===(r=this.Dn.roomList[0])||void 0===r?void 0:r.roomID);this.getIPStackNode(),this.zn.info(h+" gwNode: ".concat(this.qf,", ipNodeType: ").concat(this.ipNodeType,", ").concat(this.il?"peer":"turn",", ipv6_prefer: ").concat(this.ipV6Prefer));var g=this.Fl(p),b=g.params,_=g.paramsExt;this.Yl=_;var y=Ir;if(a){var w=function(n){var s=u.getSpan(Ir.event,u.ev);null==s||s.setAttributes({server_host:u.qf,ip_mode:u.ipV6Prefer,req_params_ext:_});var r=u.Kr("l3_play_buffer_ms"),o=(new Date).getTime();u.Df=!1;var a={};n?a.miniSdp=n:a.sdp=t.sdp,u.Tl.createSessionWithSdp($b($b({seq:u.ql,type:u.isProbe?2:1,mode:0,streamId:c,strAuthParam:u.sv||""},a),{serverHost:u.qf,playBufLevel:u.Ld===J.L3?r:void 0,params:b,paramsExt:_,roomID:p,geo:{type:u.Uo.geo.type,areaList:u.Uo.geo.areaList},transCodecID:l,transCodecSuffix:d,ipV6Prefer:u.ipV6Prefer}),function(t,e,n){return t_(u,void 0,void 0,function(){var r;return i_(this,function(u){return r=(new Date).getTime(),this.zn.info(fv+" create session time "+(r-o)),wd(n),s&&(this.Dn.Bo(s,{sdp:n.sdp}),s.setAttributes({webrtc_sid:e,gw_nodes:y.gw_nodes(n.gw_nodes),ip_infos:n.ips,ip_v6_infos:n.ipv6s,gw_nodes_ttl:y.gw_nodes(n.gw_nodes_ttl),gw_version:y.gw_version(n.gw_version),ip_mode:this.ipV6Prefer,rsp_params_ext:n.params_ext}),s.end()),5!==this.xf&&this.getSpan(Dr,this.ev,"",!0),this.ql!=t?(this.zn.error(dv+" seq is not match."),i(void 0)):i({seq:t,sessionID:e,msg:n,ipv6Prefer:this.ipV6Prefer}),[2]})})},function(t,i){if(u.ql==i){t===Re&&(u.Lo=!1);var n=1==t?n_.ke:n_.Re;s&&u.Ln.setError(s,n),u.zn.warn(dv+" create session fail. ".concat(t.code)),e(u.cv(n))}else u.zn.warn(dv+" seq is not match.")})};if(this.Lo){var S=performance.now();null===(o=this.Ol)||void 0===o||o.getMiniSdp(t.sdp).then(function(t){u.wf=performance.now()-S,w(t)}).catch(function(t){u.Lo=!1,u.Dn.Lo=!1,u.wf=performance.now()-S,u.Ef=performance.now()-u.Of,u.yf=1,w()})}else w()}else{var E=this.getSpan(Ir.event,this.ev);null==E||E.setAttributes({server_host:this.qf,ip_mode:this.ipV6Prefer}),this.Df=!1,this.Tl.createSession(this.ql,{type:1,mode:0,streamID:c,strAuthParam:this.sv||"",serverHost:this.qf,params:b,roomID:p,geo:{type:this.Uo.geo.type,areaList:this.Uo.geo.areaList},transCodecID:l,transCodecSuffix:d,ipV6Prefer:this.ipV6Prefer},function(t,e,n){return t_(u,void 0,void 0,function(){return i_(this,function(s){return wd(n),E&&(E.setAttributes({webrtc_sid:Ir.webrtc_sid(e),is_mini:y.is_mini(this.Lo),gw_nodes:y.gw_nodes(n.gw_nodes),ip_infos:n.ips,ip_v6_infos:n.ipv6s,gw_nodes_ttl:y.gw_nodes(n.gw_nodes_ttl),gw_version:y.gw_version(n.gw_version),ip_mode:this.ipV6Prefer}),E.end()),this.ql!=t?(this.zn.error(fv+" seq is not match."),i(void 0)):i({seq:t,sessionID:e,msg:n,ipv6Prefer:this.ipV6Prefer}),[2]})})},function(t,i){if(u.ql==i){var n=1==t?n_.ke:n_.Re;E&&u.Ln.setError(E,n),e&&e(u.cv(n))}else u.zn.warn(fv+" seq is not match.")})}this.state=1,this.zn.info(fv+" called success"),this.xf=1},t.prototype.Fl=function(t){var i="",e=[],n={},s=this.Dn.seiConfig.SEIPass;Gt(s)&&(n.sei_filter_pass=s?1:0),n.auto_switch_turn_type="firefox"===this.Dn.browser?2:1,this.Ld===J.L3&&(n.client_class_type=1,!0===this.qd.adaptiveSwitch&&this.qd.adaptiveTemplateIDList&&(n.adaptive_switch=1,n.adaptive_template_id_list=this.qd.adaptiveTemplateIDList.join(","))),Vt(this.qd.streamType)&&(n.video_stream_type=this.qd.streamType),Vt(this.qd.posterType)&&(n.req_poster_type=this.qd.posterType);var r=0,o=this.qd.jitterBufferTarget,u=this.qd.playoutDelayHint;return Vt(o)&&o>0&&o<=4e3?r=o:Vt(u)&&u>0&&u<=4&&(r=1e3*u),Gt(this.qd.enableLowLatency)&&this.qd.enableLowLatency&&(r=2147483647),r>0&&(n.play_jitter_level=r),this.Dn.idName&&e.push("zguid="+this.Dn.idName),t&&e.push("zgrid="+t),this.Uo.isProxy&&(n.zg_proxy=1),n.proto_flags=2,this.Kr("peer_signal_over_dc")&&(n.proto_flags|=256),e.length>0&&(i=e.join("&")),{params:i,paramsExt:n}},t.prototype.getDispatchIPNodeMode=function(){if(!this.qf){this.zn.info("zc.p.1.gdinm call");var t=this.Uo.getStreamIPNodesMode(),i=t.ipNodeType;this.ipV6Prefer=t.ipV6Prefer,this.ipNodeType=i,this.ipV6Prefer===Ct.kV6AndV4&&!this.ff&&this.Rl&&(this.ipV6Prefer=Ct.kV4AndV6,this.ipNodeType=zt.ZV4Priority),this.zn.info("zc.p.1.gdinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))}},t.prototype.getRetryIPNodeMode=function(){if(this.zn.info("zc.p.1.grinm call"),this.ipV6Prefer===Ct.kV4Only)this.ipNodeType=zt.ZV4Only;else{var t=this.Uo.getRetryIPPreferNodeType(),i=t.ipV6Prefer;this.ipNodeType=t.ipNodeType,this.ipV6Prefer=i}this.zn.info("zc.p.1.grinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))},t.prototype.getRetryIPv6Prefer=function(){this.ipV6Prefer=this.Uo.getIPv6PreferByGwNode(this.gwNode)},t.prototype.checkIfToRestart=function(t){this.nf=!this.isProbe&&(t!==Ct.kV4Only&&(this.ipNodeType===zt.ZV6AndV4Priority||this.Dn.selectIPStackMode===St.IPv4Prefer&&this.Uo.agentIpStackDetection.IPv4===Dt.reachable&&this.ipNodeType===zt.ZV6Priority))},t.prototype.getIPStackNode=function(){if(this.gwNode){var t=ed(this.gwNode);this.ipStackNode=Ul(t)}else this.ipStackNode=[zt.ZV4Only,zt.ZV4Priority].includes(this.ipNodeType)?Nt.IPv4:Nt.IPv6},t.prototype.setGwNodes=function(t,i,e,n){var s,r,o;if(this.zn.info("".concat(Cv," 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.zn.info("".concat(Cv," 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=ud(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=ad(t.ips,this.retryFailIpV4Nodes,i),this.retryFailIpV4Nodes=[]),(null===(o=null==t?void 0:t.ipv6s)||void 0===o?void 0:o.length)>0&&(c=ad(t.ipv6s,this.retryFailIpV6Nodes,i),this.retryFailIpV6Nodes=[]),this.handleDispatchedGwNodes(t.gw_nodes||[],t.gw_nodes_ttl,e,a,c)}},t.prototype.resetGwNodes=function(){this.zn.info("zc.p.1.rgn call"),this.qf="",this.Uf=[],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.zn.info(zv+" "+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.Uf=t.length>0?t:this.Uf,this.ipV4NodeList=n.length>0?n:this.ipV4NodeList,this.ipV6NodeList=s.length>0?s:this.ipV6NodeList,e===Ct.kV4Only?(this.qf=t.length>0?this.Uf[0]:this.qf,t.length>0&&u()):e==Ct.kV4AndV6&&n.length>0?(this.qf=cd(n[0]),this.ipNode=n[0],u()):e===Ct.kV6AndV4&&s.length>0?(this.qf=cd(s[0]),this.ipNode=s[0],u()):(this.Uf.length>0&&(this.qf=this.Uf[0]),this.zn.info("".concat(zv," ").concat(this.tu," no gwNode ").concat(e," ").concat(n.length," ").concat(s.length)),this.ipNodeType=zt.ZV4Only,this.ipStackNode=Nt.IPv4),this.Uo.updateCachedGwNodesList(this.streamId,!1,t||[],o,n,s)}},t.prototype.Ql=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.Xl,h="webrtc://".concat(a,"/").concat(c,"/").concat(this.tu);this.Ln.spanSetAttributes({key:this.ev,par:this.tu},{webrtc_sid:e.session_id,url:h}),this.zn.info(fv+" sessionId:"+e.session_id),this.resetPushCmdSeqMap();var f=e.client_ip||e.clientip;f&&(this.Dn.clientIP=f),this.el=e.peer_id;var l=0,d=(new Date).getTime();if(this.dl&&(this.zn.info(dv+" create signal time "+(l=d-this.dl)),this.signalTime=l),this.ul=d,0!==e.result){this.zn.error(fv+" create error "+e.result);var v=this.cv(n_.Re);throw 1021===(null==e?void 0:e.result)&&(v=this.cv(Mi,!0)),2013===(null==e?void 0:e.result)&&(v=this.cv(n_._n,!0)),2016===(null==e?void 0:e.result)&&n===Ct.kV6AndV4&&(this.ff=!1),1006===(null==e?void 0:e.result)&&(v=this.cv(n_.yn,!0)),v}this.ph=e.session_id,this.Df=!0,this.setGwNodes(e,!1,n,t),n===Ct.kV6AndV4&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.ff=!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.zn.info(fv+" "+this.tu+" isRestartIce "+this.nf)},t.prototype.Zl=function(t,i,e,n){var s,r,o;this.zn.info(dv+" sessionId:"+i),this.resetPushCmdSeqMap();var u=e.client_ip||e.clientip;u&&(this.Dn.clientIP=u),this.el=e.peer_id;var a=0,c=(new Date).getTime();if(this.dl&&(this.zn.info(dv+" create signal time "+(a=c-this.dl)),this.signalTime=a),this.ul=c,0!==e.result){if(110===e.result&&(this.Lo=!1,this.Dn.Lo=!1,this.Ef=performance.now()-this.Of,this.yf=2),this.zn.error(dv+" create session failed "+e.result),1021===(null==e?void 0:e.result))throw this.cv(Mi,!0);var h=n_.Re;if(1004===(null==e?void 0:e.result))if(h=$b($b({},this.Dn.isFlutter?de:n_.cn),{message:"Stream not found."}),this.yv())throw this.cv(h,!0);if(2013===(null==e?void 0:e.result))throw this.cv(h=n_._n,!0);if(2016===(null==e?void 0:e.result)&&n===Ct.kV6AndV4&&(this.ff=!1),1006===(null==e?void 0:e.result))throw this.cv(n_.yn,!0);throw this.cv(h)}this.ph=i,this.Df=!0,this.zn.info(dv+" create session success "),this.setGwNodes(e,!1,n,t),n===Ct.kV6AndV4&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.ff=!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.zn.info(dv+" "+this.tu+" isRestartIce "+this.nf),this.Ul()},t.prototype.$l=function(t){var i,e=this;if(this.zn.info(Dv+" set candidate ".concat(!!t)),t){var n=t.candidate,s=t.sdpMid,r=t.sdpMLineIndex;if(n)this.zn.info(Dv+" addIceCandidate"),null===(i=this.zf)||void 0===i||i.addIceCandidate(new RTCIceCandidate({sdpMid:s,sdpMLineIndex:r,candidate:n})).then(function(){e.zn.info(Dv+" add can suc")}).catch(function(t){e.zn.info(Dv+" add can fail, ".concat(t.message))})}},t.prototype.rd=function(t){if(!(null==t?void 0:t.sdp))throw this.zn.warn(vv+" no content"),this.cv(ge,!0);var i=t.sdp;this.zn.info(vv+" localSdp1 "+i.substr(0,i.length/2)),this.zn.info(vv+" 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=yb([],n[s],!0);i.splice(r[0]+s,0,r[1])}return i.join("\r\n")}(i=wb(i)),this.qd.videoCodec&&(i=ml.getSDPByVideDecodeType(i,this.qd.videoCodec)),"firefox"===this.Dn.browser&&rd(this.Dn.browserInfo,"firefox",139,2)&&(i=Sb(i)),t.sdp=i,t},t.prototype.hv=function(t){var i;return t_(this,void 0,void 0,function(){var e,n;return i_(this,function(s){switch(s.label){case 0:this.zn.info(vv+" set local sdp"),(e=this.getSpan(kr,this.ev))&&(this.Dn.Bo(e,{sdp:t.sdp}),e.setAttributes({is_mini:Rr(this.Lo)})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,null===(i=this.zf)||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.zn.error(vv+" set error "+n.toString()),e&&this.Ln.setError(e,{code:n_.Te.code,message:n.toString()}),this.cv(n_.Te,!0);case 4:return[2]}})})},t.prototype.dv=function(t){return t_(this,void 0,void 0,function(){var i,e,n,s,r,o,u,a,c,h=this;return i_(this,function(f){switch(f.label){case 0:if(this.zn.info(mv+" success"),i={paramsExt:this.Yl},!this.Lo)return[3,5];e=performance.now(),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this.Ol.getMiniSdp(t.sdp)];case 2:return n=f.sent(),this.wf=performance.now()-e,i.miniSdp=n,[3,4];case 3:return f.sent(),this.Lo=!1,this.Dn.Lo=!1,this.wf=performance.now()-e,this.Ef=performance.now()-this.Of,this.yf=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.Ld===J.L3&&(i.min_play_buf_level_ms=500),this.wv=D(),null==(s=this.getSpan(Ar,this.ev))||s.setAttributes({req_params_ext:this.Yl}),this.state=2,[4,new ni(function(t,e){h.Tl.sendMediaDesc(h.wv,h.ph,0,i,function(i,e,n){t({seq:i,sessionId:e,data:n})},function(t,i){h.zn.error(mv+" failed to send "+t),s&&h.Ln.setError(s,{code:n_.ze.code,message:t.toString()}),h.wv==i&&e(h.cv(n_.ze))})})];case 7:return r=f.sent(),o=r.seq,u=r.sessionId,a=r.data,this.zn.info(mv+" sendMediaDesc resp"),s&&(this.Dn.Bo(s,{sdp:i.sdp}),s.setAttributes({webrtc_sid:Pr(u)})),this.wv!=o?(this.zn.error(mv+" seq or sessionId is not equal "+this.wv+" "+o),[2,{remoteSdp:""}]):(this.zn.info(mv+" send success stateNego:waiterAnswer"),this.xf=2,this.state=3,[4,this.parseRemoteMiniSdp(a)]);case 8:if(c=f.sent(),s&&this.Dn.Bo(s,{remote_sdp:c}),null==s||s.end(),c)return[2,{remoteSdp:c,miniSdp:null==a?void 0:a.mini_sdp}];throw this.cv(n_.ze)}})})},Object.defineProperty(t.prototype,"turnToTcp",{get:function(){return this.pl},enumerable:!1,configurable:!0}),t.prototype.checkAutoTcp=function(){var t=Wo();this.zn.info("zc.p.1.cat ".concat(t," ").concat(this.il)),this.ml=!(!t||!this.il)},t.prototype.fv=function(t,i,e){var n,s;return void 0===i&&(i=!1),t_(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=this;return i_(this,function(k){switch(k.label){case 0:if(r={type:"answer",sdp:t,toJSON:function(){}},o=this.getSpan(Nr,this.ev),this.setTurnTcp(),this.Uo.autoSwitchProtocol=this.Kr("auto_to_tcp")||!1,u=this.Kr("udp_max_fail_num"),!isNaN(u)&&(this.Uo.maxUdpFailNum=u),h=(a=this.Uo).maxUdpFailNum,f=a.udpFailNum,this.zn.info(pv+" autoToTcp: ".concat(c=a.autoSwitchProtocol,", udpFailNum: ").concat(f,", maxUdpFailNum: ").concat(h,".")),c&&!this.pl&&f>=h&&(this.zn.info(pv+" switch to tcp."),this.pl=!0,this.ml=!1),(l=this.Kr("udp_or_tcp",!0))&&(this.zn.info(pv+" setting udp_or_tcp "+l),this.pl="tcp"===l),this.pl&&!this.Uo.isProxy&&"firefox"!==this.Dn.browser&&(null===(n=r.sdp.match(/candidate.*/g))||void 0===n||n.forEach(function(t){var i=t.replace(/udp/,"tcp");i.includes(" tcptype ")||(i=i.replace(" typ host "," typ host tcptype passive ")),r.sdp=r.sdp.replace(t,i)})),this.Uo.isProxy)if(d=pv,m=Kl(v=r.sdp),p=m[0],g=m[1],b=v.match(/a=mid:[^(\n|\r)]+/g),g&&b)if(this.bl.intranet)setTimeout(function(){g.forEach(function(t,i){var e,n={sdpMLineIndex:i,candidate:t.replace(p[i].ip,T.bl.wanIP).replace("a=",""),sdpMid:b[i].replace("a=mid:","")};T.zn.info(d+" add wan candidate:"+JSON.stringify(n)),null===(e=T.zf)||void 0===e||e.addIceCandidate(new RTCIceCandidate(n))})},1e3);else for(this.zn.info(d+" change candidate ip from lan to wan: "+(_=this.bl.wanIP)),y=0;y<g.length;y++)S=(w=g[y]).replace(p[y].ip,_),r.sdp=v.replace(w,S);else this.zn.warn(d+" candidate not found");else r.sdp=this.extractCandidate(r.sdp);this.zn.info(pv+" remoteSdp "+r.sdp),o&&(this.Dn.Bo(o,{sdp:r.sdp}),o.setAttributes({webrtc_sid:zr(this.ph),is_mini:Cr(this.Lo)})),this.state=4,i&&(this.fd(this.Tf),this.Tf=[],this.state=5),this.startTime=Date.now(),this.checkRetryOtherIPCandidate(),this.zn.info(pv+" call success"),this.zl=r.sdp,k.label=1;case 1:return k.trys.push([1,3,,4]),[4,null===(s=this.zf)||void 0===s?void 0:s.setRemoteDescription(new RTCSessionDescription(r))];case 2:return k.sent(),o&&o.end(),this.zn.info(pv+" set success"),[3,4];case 3:throw E=k.sent(),this.zn.error(pv+" set remote error "+E.toString()),this.Lo&&Wt(e)&&this.zn.warn(pv+" mini "+e.toString()),o&&(o.setAttributes({error:n_.Ie.code,message:E.toString()}),o.end()),O=!0,this.Lo&&(O=!1,this.Lo=!1,this.Ef=performance.now()-this.Of,this.yf=4),this.cv(n_.Ie,O);case 4:return[2]}})})},t.prototype.checkRetryOtherIPCandidate=function(){var t=this;this.jl=setTimeout(function(){t.zn.info("".concat("zc.p.1.croic"," ").concat(t.tu," check ").concat(t.state," ").concat(t.ipNodeType," ").concat(t.rf.length)),6!==t.state&&t.nf&&t.rf.length>0&&(t.ipStackNode=t.ipStackNode===Nt.IPv4?Nt.IPv6:Nt.IPv4,t.restartIce())},this.hf)},t.prototype.extractCandidate=function(t){var i=this,e=Kl(t),n=e[0];return e[1].forEach(function(e,s){var r=n[s].ip,o=Ul(r);if(i.ipStackNode!==o){var u={sdpMLineIndex:parseInt(n[s].mid),candidate:e.replace("a=",""),sdpMid:n[s].mid};i.rf.push(u),t=t.replace(e+"\n","")}if(o===Nt.IPv4){var a=yd(r),c=e.replace(new RegExp(r,"g"),a).replace("a=",""),h={sdpMLineIndex:parseInt(n[s].mid),candidate:c,sdpMid:n[s].mid};i.uf.find(function(t){return t.candidate===h.candidate&&t.sdpMLineIndex===h.sdpMLineIndex&&t.sdpMid===h.sdpMid})||i.uf.push(h)}}),t},t.prototype.av=function(t,i){var e,n,s=this;if(this.zn.info(Av+" preset turn "+"".concat(JSON.stringify(i))),i){var r=i.turn_username,o=i.turn_auth_key,u=i.turn_urls;this.af=r,this.cf=o;var a=void 0;if(u){var c=u.split(";"),h=[];c.forEach(function(t){var i=Bl(t).replace("[","").replace("]",""),e=Ul(i);if(s.ipStackNode===e?h.push(t):s.sf.push(t),e==Nt.IPv4){var n=yd(i),r=t.replace(i,"[".concat(n,"]"));s.Uo.isCandidateHasIPv6&&h.push(r)}}),(e=this.sf).push.apply(e,h),0===(a=h).length&&a.push.apply(a,this.sf)}else{var f=$l(t);if(0===f.length)return this.zn.info(Av+" "+this.tu+" no candidate"),!1;a=f}var l={iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:a,username:r,credential:o}],encodedInsertableStreams:this.ll.isSEIStart};try{null===(n=this.zf)||void 0===n||n.setConfiguration(l)}catch(t){this.zn.info(Av+" preset turn "+t)}}return!0},t.prototype.sendRestartIce=function(t,i){var e=this;this.zn.info("zc.p.1.srsi call: "+t+" "+i),this.Tl.sendRestartIce(t,i).then(function(t){e.zn.info("zc.p.1.srsi result "+JSON.stringify(t))}).catch(function(t){e.zn.warn("zc.p.1.srsi fail: "+JSON.stringify(t))})},t.prototype.Sv=function(t,i,e){if(this.zn.info("zc.p.orpe.1 received "+e.event),!this.isProbe){var n=this.Ln.createSpan(a.H,{key:e_,par:this.tu},{key:""},dr);n.setAttributes({event_state:vr(e.event),webrtc_sid:i}),n.end()}(this.Kd.first||t>this.Kd.seq)&&this.onPlayBFrameEvent(!1),0===e.event?this.onPlayStreamEnd(!1):1===e.event&&this.onPlayStreamEnd(!0)},t.prototype.Hl=function(t,i,e){var n=e.clientip||e.client_ip;this.Dn.clientIP!==n&&this.zn.info("zc.p.orci.1.1 client ip changed "+this.Dn.clientIP+" "+n),this.Dn.clientIP=n,this.el=e.peer_id,this.Tl.peerId=e.peer_id,this.al=n,this.Dn.isMultiOuter=this.isMultiOuter(),this.onGetIP(),this.isProbe&&5==this.xf&&this.Tl.sendNetProbeReq(function(){},function(){}),this.Vd=!0},t.prototype.onGetIP=function(){},t.prototype.Ev=function(t,i,e){var n=0,s=e.lossrate,r=e.rtt;(this.el!==e.peer_id&&!this.isProbeByDG||Ft(s)||Ft(r))&&(this.zn.info("zc.p.1.nqi local peerID:"+this.el+" remote peerID:"+e.peer_id+" lossrate:"+s+" rtt:"+r),n=1),this.onRecvNetQuality&&this.onRecvNetQuality(n,s,r)},t.prototype.Ov=function(t,i,e){this.zn.info("zc.s.nqga call: "+i),this.onRecvNetQualityGrade&&this.onRecvNetQualityGrade(e)},t.prototype.vv=function(t){var i,e=this;if(this.zn.info(gv+" called"),null!=t.candidate){if(this.zn.info(gv+" candidate "+t.candidate.candidate+" state "+this.state+" autotcp "+this.ml),t.candidate.candidate)Ul(null===(i=t.candidate.candidate.split(" "))||void 0===i?void 0:i[4])===Nt.IPv6&&(this.ml&&(this.zn.info("".concat(gv," can len ").concat(this.uf.length)),this.uf.forEach(function(t){var i;null===(i=e.zf)||void 0===i||i.addIceCandidate(new RTCIceCandidate(t)).then(function(){e.zn.info("".concat(gv," add can suc"))}).catch(function(t){e.zn.info("".concat(gv," add can fail, ").concat(t.message))})})),this.Uo.isCandidateHasIPv6=!0);var n=function(t){e.fd([{candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex}])};this.ml?n(t):this.state<5||7==this.state?(this.zn.info(gv+" cached"),this.Tf.push({candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex})):(this.zn.info(gv+" send"),n(t))}},t.prototype.mv=function(t){this.zn.info("zc.p.ocsc.1 called "+t.target.signalingState),7!=this.state&&null!=this.zf&&"closed"===t.target.signalingState&&(this.xf=7,this.Tv(this.zf.iceConnectionState))},t.prototype.pv=function(t){var i=this;if(7!=this.state&&null!=this.zf){this.zn.info(bv+" stateChanged "+this.zf.iceConnectionState);var e=this.getSpan(br,this.ev,this.playingEvent);if(e&&e.setAttributes({ice_state:_r(this.zf.iceConnectionState)}),"connected"===this.zf.iceConnectionState){if(this.xf=5,this.isProbe&&this.il&&(this.Vd||this.isProbeByDG))return this.Tl.sendNetProbeReq(function(){},function(){}),void this.onCanStopNegaTimer();if(this.onCanStopNegaTimer(),null!=this.xl&&(clearTimeout(this.xl),this.xl=null),!this.isProbe&&this.dl){var n=(new Date).getTime()-this.dl;this.Cl.setAttributes({play_begin_time:s_.play_begin_time(n)}),this.dl=0}if(this.Ln.spanEnd({key:Dr,par:this.tu},{webrtc_sid:this.ph}),this.ul){var s=(new Date).getTime()-this.ul;this.zn.info(bv+" ice time "+s)}this.isProbe||6==this.state||(this.onPlayStateUpdate&&this.onPlayStateUpdate($,this.tu,{code:0,message:""},!0),this.getRemoteStreamSuc&&(this.getRemoteStreamSuc(this.qd.resourceMode==V.DG?null:this.playStream),this.getRemoteStreamSuc=null)),this.state=6,this.resetIceInfos(),this.resetNat64Infos();var r=(new Date).getTime()-this.ul;this.onIceConnected&&this.onIceConnected(this.sessionId,r),this.zn.info(bv+" stateNego:iceConnected"),this.pl||(this.Uo.udpFailNum=0)}else if("closed"===this.zf.iceConnectionState)null==e||e.end(),this.xf=7,this.Tv(this.zf.iceConnectionState);else if("failed"===this.zf.iceConnectionState)null==e||e.end(),this.xf=8,this.Tv(this.zf.iceConnectionState);else if("disconnected"===this.zf.iceConnectionState){null==e||e.end(),this.xf=6,this.zn.warn(bv+" ice disconnected");var o=this.Uo.lastChangeIpTime;o&&Date.now()-o<15e3?this.onPlayStateUpdateError(n_.Ne):this.xl||(this.xl=setTimeout(function(){i.Tv("disconnected")},15e3))}}},t.prototype.gv=function(t){var i,e;this.zn.info("zc.p.opcsc.1 connectionChanged "+(null===(i=this.zf)||void 0===i?void 0:i.connectionState)),"connected"===(null===(e=this.zf)||void 0===e?void 0:e.connectionState)&&this.onPeerConnected&&this.onPeerConnected(this.sessionId,(new Date).getTime()-this.ul)},t.prototype.Tv=function(t){this.zn.info(bv+" state "+this.state+" connectionState "+t),this.onPlayStateUpdateError(n_.Ne)},t.prototype.close=function(t){this.zn.info(_v+" close peer, reason: "+t),this.state=7,this.Ud=!1,this.Vd=!1,this.closeSession(t),null!=this.zf&&(this.zf.close(),this.zf=null),this.zl&&(this.zl=null),this.Dl&&(this.Dl=null),this.resetIceInfos(),this.resetNat64Infos(),this.al="",this.wl=void 0;var i=this.seiWorker;i&&i.removeEventListener("message",this.Xr.seiMessage),this.onCanStopNegaTimer(),null!=this.xl&&(clearTimeout(this.xl),this.xl=null),this.jl&&(clearTimeout(this.jl),this.jl=null),this.stopVideocTimer(),this.kv(),this.Tl.reset(),this.ql=0,this.wv=0,this.Kd.first=!0},t.prototype.stopPlay=function(){this.retryFailGwNodes=[],this.retryFailIpV4Nodes=[],this.retryFailIpV6Nodes=[]},t.prototype.Jl=function(t,i,e){this.zn.info(Ev+" received ");var n=this.getSpan(gr,this.playingEvent);if(n&&n.end(),i==this.ph){var s={code:n_.fn.code,message:"server session reset "+e.reason};this.onCanStopNegaTimer(),this.onPlayStateUpdateError(s)}else this.zn.info(Ev+" cannot find session")},t.prototype.Bl=function(t,i,e){this.zn.info(Ov+" "+JSON.stringify(e)),this.Ln.spanSetAttributes({key:this.playingEvent,par:this.tu},{denied_info:rs.denied_info(e.err_info),stop_reason:rs.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.yv()&&(o=!0));var u=$b({},o&&1004===(null==n?void 0:n.err)?this.Dn.isFlutter?we:n_.cn:o?ye:n_.fn);1011===(null==n?void 0:n.err)&&(u=$b({},Ee)),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(Xg(r,s,null==n?void 0:n.err)),this.onCanStopNegaTimer();var a=!1;if(!this.pl){if([8,10].includes(r)||[18,15].includes(r)&&2===s&&[3001,3002].includes(n.err)){this.Uo.udpFailNum++;var c=this.Uo;c.autoSwitchProtocol&&c.udpFailNum>=c.maxUdpFailNum&&(this.il=!1,this.Uo.setIsPeer(!1),a=!0)}else this.Uo.udpFailNum=0;var h=this.Uo.isNodeLast(this).lastTryNext,f=[3001,3002,3003,3004,3005,3006,3007,3008].includes(n.err);h&&f&&(this.zn.info(Ov+" switch tcp by all fail"),this.Dn.turnToTcp=!0,this.ml=!1,this.il=!1,this.Uo.setIsPeer(!1))}this.onPlayStateUpdateError(u,o,n,a)},t.prototype.yv=function(){var t=Date.now(),i=this.Dn.streamRetryTime,e=this.Fd;if(e){if(t-e>1e3*i)return this.Fd=0,this.zn.info("zc.p.ctest.1 "+" stream not found. retry over time: ".concat(i,"s")),!0}else this.Fd=t;return!1},t.prototype.Rv=function(t,i,e){void 0===e&&(e=!1),this.onRecvStreamStatus&&this.onRecvStreamStatus(i.camera_status,i.mic_status,e),this.zn.info(Tv+" call success")},t.prototype.bv=function(t,i){var e,n,s=this;if(this.zn.info(kv+" called "+t),t){this.Iv(i),this.ll.isSEIStart&&Xo()&&("video"===i.track.kind?this.Nv(i):"audio"===i.track.kind&&this.Cv(i)),this.onRecvRemoteStream&&this.onRecvRemoteStream(t),this.remoteStream=t;var r=null===(e=this.room.streamList)||void 0===e?void 0:e.find(function(t){return t.stream_id===s.tu}),o=3===(null===(n=null==r?void 0:r.stream_attr_opts)||void 0===n?void 0:n.stream_codec);this.getVideoCodec(o),this.Bd&&this.Rv(this.zv,this.Dv,!0)}else this.zn.warn(kv+" remote stream is empty")},t.prototype.Iv=function(t){var i,e=0,n=0,s=this.qd.jitterBufferTarget,r=this.qd.playoutDelayHint;if(Vt(s)&&s>0&&s<=4e3?(n=s,e=s/1e3):Vt(r)&&r>0&&r<=4&&(n=1e3*e,e=r),Gt(this.qd.enableLowLatency)&&this.qd.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.zn.info(kv+" ".concat(o," playoutDelayHint: ").concat(n,", origin delay: ").concat(t.playoutDelayHint," | ").concat(t.jitterBufferTarget)),t.playoutDelayHint=e,t.jitterBufferTarget=n,this.zn.info(kv+" ".concat(o," playoutDelayHint result: ").concat(t.playoutDelayHint," | ").concat(t.jitterBufferTarget))}catch(t){this.zn.warn(kv+" set playoutDelayHint failed. ".concat(t))}},t.prototype.Nv=function(t){var i=this.createSEIWorker();i&&i.addEventListener("message",this.Xr.seiMessage);var e=this.ll,n={cmd:"decode",streamID:this.tu,emulationPreventionByte:this.Dn.seiConfig.emulationPreventionByte,codec:this.Hd,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($b({readable:r,writable:o},n),[r,o])}catch(t){u=!0}if(u){this.zn.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.Uo.handleSeiRollBack()}}},t.prototype.Cv=function(t){var i={cmd:"decode",streamID:this.tu,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($b({readable:s,writable:r},i),[s,r])}catch(t){o=!0}if(o){this.zn.warn("zc.cart The current browser version is too low.");var u=new TransformStream({transform:this.decodeAudioFrame});s.pipeThrough(u).pipeTo(r),this.Uo.handleSeiRollBack()}}},t.prototype.fd=function(t){var i=this;if(this.zn.info(Rv+" called"),!(t=t.filter(function(t){return!!(t&&t.candidate.indexOf("relay")>0)}))||t.length<1)this.zn.info(Rv+" cancelled");else{var e=this.getSpan(Mr,this.ev);e&&e.setAttributes({candidate_info:xr(t)}),5!==this.xf&&(this.xf=4),this.zn.info(Rv+" stateNego:sendCandidate"),this.Tl.sendCandidateInfo(t,function(t,n,s){i.zn.debug(Rv+" send success"),e&&e.end()},function(t,n){i.zn.error(Rv+" failed to send: "+t.toString()),e&&i.Ln.setError(e,{code:n_.De.code,message:t.toString()}),i.onPlayStateUpdateError(n_.De)})}},t.prototype.resetPushCmdSeqMap=function(){var t;this.vl=((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.cv=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 Wg.Signal:this.Tl.onDataChannelMessage(t.data);break;case Wg.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.Zd.Qd&&(this.Zd.Xd[0]=a==c?a:c,this.Zd.Qd=!1),this.Zd.Wd.push({sn:a,sn0:c,recv_ts:h,flags:u,payload_len:r,payloadArray:o}),this.Zd.Wd.sort(this.compareShort),a==this.Zd.Xd[0]){var f=this.Zd.Wd.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.tu)}),this.Zd.Wd=[],this.Zd.Qd=!0}this.Zd.Xd[0]++}else for(var m=function(){var t=p.Zd.Wd.filter(function(t){return t.sn0==n.Zd.Wd[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.Zd.Xd[0]=t[0].sn0+t.length,null===(e=p.onDataChannelList)||void 0===e||e.forEach(function(t){t(s,i,n.tu)}),p.Zd.Wd=[],p.Zd.Qd=!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.Zd.Xd[0]=o,"break"}for(r=0;r<t.length;r++)p.Zd.Wd.shift()},p=this;this.Zd.Wd.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.updVidCodec=function(){var t=this.seiWorker;t&&t.postMessage({cmd:"updatePlayer",codec:this.Hd,streamID:this.tu})},t.prototype.getVideoCodec=function(t){var i=this;if(void 0===t&&(t=!1),this.zf&&(this.zf.getStats().then(function(t){t.forEach(function(e){if("inbound-rtp"===e.type&&"video"===e.kind&&e.codecId){var n=t.get(e.codecId).mimeType.toLowerCase();n.indexOf("h264")>-1?i.Hd="H264":n.indexOf("vp8")>-1?(i.Hd="VP8",i.ll.isSEIStart&&i.zn.error("zc.p.gvc video code VP8 is not support SEI"),i.updVidCodec()):n.indexOf("h265")>-1&&(i.Hd="H265",i.updVidCodec())}})}),this.Gd++,this.Hd||this.Gd>=20))return t&&""===this.Hd&&(this.Hd="H265",this.updVidCodec()),void this.stopVideocTimer();this.stopVideocTimer(),this.Av=setTimeout(function(){i.getVideoCodec(t)},100)},t.prototype.stopVideocTimer=function(){this.Av&&(clearTimeout(this.Av),this.Av=null)},t.prototype.isMultiOuter=function(){return!(!this.Dn.accessClientIp||!this.al||this.Dn.accessClientIp===this.al)},t.prototype.getSpan=function(t,i,e,n){if(void 0===n&&(n=!1),this.isProbe)return null;var s=Si(this.Ln,a.H,this.tu,t,i,e,n);return s.setAttribute("is_mini",this.Lo),s},t.prototype.setTurnTcp=function(){this.pl=this.Dn.turnToTcp,void 0!==this.Dn.turnOverTcpOnly&&(this.pl=this.Dn.turnOverTcpOnly)},t.prototype.Ul=function(){var t=this,i=performance.now();this.Tl.registerPushCallback("CloseSessionPush",function(e,n,s){if(i){var r=(performance.now()-i).toFixed(0);i=void 0,t.zn.info(Ov+" ".concat(t.tu,", cmd: CloseSessionPush, cost_time: ").concat(r))}32===s.reason&&(t.Lo=!1,t.Dn.Lo=!1,t.Ef=performance.now()-t.Of),t.Bl(e,n,s)}),this.Tl.registerPushCallback("SessionResetPush",function(i,e,n){t.Jl(i,e,n)}),this.Tl.registerPushCallback("StreamStatusNotifyPush",function(i,e,n){t.Rv(i,n)}),this.Tl.registerPushCallback("PlayEventPush",function(i,e,n){t.Sv(i,e,n)}),this.Tl.registerPushCallback("ClientInfoPush",function(i,e,n){t.Hl(i,e,n)}),this.Tl.registerPushCallback("NetQualityInfoPush",function(i,e,n){t.Ev(i,e,n)}),this.Tl.registerPushCallback("net_quality_grade_push",function(i,e,n){t.Ov(i,e,n)}),this.Tl.registerPushCallback("codec_error_notify",function(i,e,n){t.Pv(i,n.media_type,n.error_type)}),this.Tl.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.kv=function(){this.Tl.unregisterPushCallback("CloseSessionPush"),this.Tl.unregisterPushCallback("SessionResetPush"),this.Tl.unregisterPushCallback("PlayEventPush"),this.Tl.unregisterPushCallback("ClientInfoPush"),this.Tl.unregisterPushCallback("NetQualityInfoPush"),this.Tl.unregisterPushCallback("StreamStatusNotifyPush")},t.prototype.Pv=function(t,i,e){if(0!==e){var n=i?"video":"audio",s="zc.p.1.oce"+" ".concat(n," codec error: ").concat(e,", codec: ").concat(this.Hd," ; ");if(1===e){if(s+="remove ".concat(n," track."),!this.isProbe&&6===this.state){var r=$;this.qd.transcodeOnDecodeFail&&1===i&&!this.Jd?(r=tt,this.Jd=Oe.code,this.onPlayStateUpdateError(Oe,!1,void 0,!0)):this.onPlayStateUpdate&&this.onPlayStateUpdate(r,this.tu,{code:Oe.code,message:"browser dose not support current ".concat(n," codec")},!0)}}else 3===e&&((this.Kd.first||t>this.Kd.seq)&&(this.Kd.first=!1,this.Kd.seq=t),this.onPlayBFrameEvent&&this.onPlayBFrameEvent(!0),this.onPlayStateUpdate&&this.onPlayStateUpdate($,this.tu,{code:Wi,message:"B-frame is detected in the bitstream"},!0));this.zn.warn(s)}},t.prototype.sendBroadcasterStatus=function(t){this.Tl.sendBroadcasterStatus(t)},t.prototype.ActivatePlayAudioStream=function(t,i,e){this.Tl.ActivatePlayAudioStream(t,i,e)},t.prototype.ActivatePlayVideoStream=function(t,i,e){this.Tl.ActivatePlayVideoStream(t,i,e)},t.prototype.sendPlayStats=function(t){return this.Tl.sendPlayStats(t)},Object.defineProperty(t.prototype,"gwVersion",{get:function(){return this.Tl.gwVersion},enumerable:!1,configurable:!0}),t.prototype.getP2PNetStats=function(t,i){this.Tl.getP2PNetStats(t,i)},t.prototype.closeSession=function(t){var i,e;null===(i=this.Il)||void 0===i||i.off("uaConnected",this.Xr.onUaSocketConnected),this.resetPushCmdSeqMap(),this.Df&&(this.Tl.sendCloseSession(t),null===(e=this.Il)||void 0===e||e.removeSession(this.ph),this.Df=!1)},t.prototype.dispatchGwNodes=function(t,i,e){var n=this,s=this.tu;1==this.Uo.testEnvironment&&(s="zegotest-"+this.Uo.appid+"-"+this.tu);var r=t;r===St.IPv6Prefer&&!this.ff&&this.Rl&&(r=St.IPv4Prefer);var o=this.getTransCodec(s),u=o.transCodecID,a=o.transCodecSuffix;s=o.transCodecStreamID;var c=this.Ld===J.RTC?is:es,h=this.getSpan(c,c);null==h||h.setAttributes({ip_mode:t}),this.Tl.dispatchGwNodes({type:1,streamID:s,transCodecID:u,transCodecSuffix:a,geo:{type:this.Uo.geo.type,areaList:this.Uo.geo.areaList},ipV6Prefer:r},function(t,e,n){wd(n),h&&Ei(h,{gw_nodes:n.gw_nodes,ip_infos:n.ips,ip_v6_infos:n.ipv6s}),i&&i(n)},function(t,i){h&&n.Ln.setError(h,t),e&&e(t)})},t.prototype.getTransCodec=function(t){var i,e,n,s,r,o=(this.Dn.appConfig||{}).media_config,u=t,a=!1,c=void 0!==(null===(i=this.qd)||void 0===i?void 0:i.codecTemplateID)&&1===(null===(e=null==o?void 0:o.play_config)||void 0===e?void 0:e.enable_codec_template);return this.qd.transcodeOnDecodeFail?(a=!!this.Jd)&&(s=c?this.qd.codecTemplateID:0):(a=c)&&(s=this.qd.codecTemplateID),a&&(u=t+(r=ki(s,null===(n=o.play_config)||void 0===n?void 0:n.codec_template_postfix_pattern))),{transCodecStreamID:u,enableTransCodec:a,transCodecID:s,transCodecSuffix:r}},t.prototype.parseRemoteMiniSdp=function(t){return t_(this,void 0,void 0,function(){var i,e,n;return i_(this,function(s){switch(s.label){case 0:if(!(this.Lo&&Wt(t.mini_sdp)&&t.mini_sdp.byteLength>0))return[3,5];e=performance.now(),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.Ol.parseMiniSdp(t.mini_sdp)];case 2:return i=s.sent(),this.Sf=performance.now()-e,[3,4];case 3:throw n=s.sent(),this.Lo=!1,this.Dn.Lo=!1,this.Sf=performance.now()-e,this.Ef=performance.now()-this.Of,this.yf=3,this.cv(n);case 4:return[3,6];case 5:Ht(null==t?void 0:t.sdp)&&(null==t?void 0:t.sdp)&&(i=t.sdp),s.label=6;case 6:return[2,i]}})})},t.prototype.reportMiniSdpInfos=function(t){var i={};(this.Lo||this.yf)&&(i.mini_error=this.yf,i.code_sdp_consume=+this.wf.toFixed(0),i.decode_sdp_consume=+this.Sf.toFixed(0),this.yf=0,this.wf=0,this.Sf=0),this.Ln.spanSetAttributes({key:t,par:this.tu},$b({},i))},t.prototype.resetMiniReportInfos=function(){this.Ef=0,this.Of=0},t.prototype.setPlayStreamVideoType=function(t){return t_(this,void 0,void 0,function(){return i_(this,function(i){return[2,this.Tl.subscribeVideoStream(t)]})})},t}(),c_=ts,h_=$n.event,f_=function(){function t(t,i,e,n,s){var r=this;this.vd=t,this.Ln=e,this.Uo=n,this.Dn=s,this.Mv=0,this.cdnPlayTime=0,this.state=7,this.sendTransCodecCmd=function(t,i){if(void 0===t&&(t=0),i=i||r.xv){var e=i.streamID,n=i.playAddr,s=i.codecTemplateID,o=i.codecSuffix;r.xv=i;var u=r.vd.room.streamHandler.notifySdkNeedStream(e,{playAddr:n,transCodecID:s,transCodecSuffix:o,retry:t},function(t,i){r.zn.info("zsc.pc.1 notify trans codec success"),r.jv=Date.now()},function(n,s){if(r.zn.error("zsc.pc.1 notify trans codec err:"+n.code+" "+n.message),2===(null==s?void 0:s.action))return r.Lv||(r.Lv=setTimeout(function(){r.Lv=void 0,r.sendTransCodecCmd(t+1,i)},s.action_delay)),void r.Uo.onPlayStateUpdate(it,e,{code:n.code,message:n.message},{isCDN:!0});r.Uo.onPlayStateUpdate(tt,e,de,{isCDN:!0})});r.qv=u}},this.zn=Cm(i,this.streamID)}return Object.defineProperty(t.prototype,"zegoExpressPlayer",{get:function(){return this.Uv(this.cdnPlayer)?this.cdnPlayer:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zegoCdnPlayer",{get:function(){return this.Uv(this.cdnPlayer)?void 0:this.cdnPlayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamID",{get:function(){return this.vd.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Bv",{get:function(){return this.vd.playMode==J.CDN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jd",{get:function(){return this.vd.jd},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.vd,l=f.playOption;f.Za&&(null===(e=f.Za)||void 0===e||e.end()),f.Za=Si(this.Ln,a.H,h,f.playStartEvent,h_,void 0,!0);var d=function(t,e){var n;f.Za&&(Ei(f.Za,{url:c_.url(c.cdnUrl),ip:c_.ip(f.ip),source_type:c_.source_type(f.playMode),net_protocol:c_.net_protocol("tcp"),tryidx:c_.tryidx(f.tryidx)}),f.Za=void 0),null===(n=c.jd)||void 0===n||n.setAttributes({stop_reason:Zs(t)}),i&&i(e)},v=this.cdnPlayer,m=this.Uv(v);if(!m&&!l.CDNVideo)return this.zn.error("zsc.pc.1 cdn video no found"),d("cdn video no found",ve),!1;var p=null===(n=this.Uo.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.jd)||void 0===s||s.setAttributes({tryidx:Xs(f.tryidx),biz_product:Ws(g==V.DG?1:0)});var b=(this.Dn.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)&&!l.transcodeOnDecodeFail,y=h,w="";_&&(y+=w=ki(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.Dn.appConfig)return this.zn.error("zsc.pss.1 stream info no found"),d("stream info no found",me),!1;var T=this.Jv(h),k=T.flv,R=T.hls;E=k?[k]:[],O=R?[R]:[]}if(!f||!v)return d("no cdn player",ve),!1;f.useResourceTypes.push(J.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.zn.error("zsc.pc.1 can not find cdn urls"),d("cdn protocol not support.",me),!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.Bv&&(f.Za&&(Ei(f.Za,{url:c_.url(this.cdnUrl),ip:c_.ip(f.ip),source_type:c_.source_type(f.playMode),net_protocol:c_.net_protocol("tcp"),tryidx:c_.tryidx(f.tryidx)}),f.Za=void 0),this.Uo.onPlayStateUpdate($,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.jv&&Date.now()-this.jv>9e4&&(this.jv=void 0,this.sendTransCodecCmd(0))},t.prototype._clearTransCodecRetry=function(){var t,i;null===(t=this.qv)||void 0===t||t.invalid(),null===(i=this.qv)||void 0===i||i.stopMaxTime()},t.prototype.stopCDNPlayer=function(){this.Lv&&(clearTimeout(this.Lv),this.Lv=void 0),this._clearTransCodecRetry(),this.jv=void 0,this.cdnPlayer&&(this.zn.info("zc.cph.stcp stop"),this.cdnPlayer.stop(),this.updateCDNValidTime(),this.setCdnState(7))},t.prototype.Uv=function(t){return!(!t||!t._extApi)},t.prototype.bindZegoExpressPlayerEvents=function(t,i,e){var n=this,s=this.vd,r=!1;t._extApi.off("canplay"),t._extApi.on("canplay",function(){r||(n.zn.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.zn.error("zsc.pc.1 error occur ".concat(a," ").concat(c)),[100003,100004,100005].includes(a)?(o&&(clearTimeout(o),o=null),u>3?(n.zn.error("zsc.pc.1 retryCount ".concat(u," greater than ").concat(3,". end play cdn source")),n.updateCDNValidTime(),null===(e=n.jd)||void 0===e||e.setAttributes({stop_reason:Zs(c)})):o=setTimeout(function(){u++,t.resume(),s.CDNBrokenCnt++},3e3)):100006!==a&&(null===(r=n.jd)||void 0===r||r.setAttributes({stop_reason:Zs(c)}),n.zn.error("zsc.pc.1 stop play cdn source."))}),t._extApi.off("loaded"),t._extApi.on("loaded",function(){n.Bv&&6==s.state?s.CDNBrokenCnt++:(n.zn.info("zsc.pc.1 ended play cdn"),n.updateCDNValidTime())}),t._extApi.off("netQualityScoreUpdate")},t.prototype.Jv=function(t){var i,e,n,s=((i={})[V.RTC]=1,i[V.CDN]=0,i[V.L3]=2,i),r=this.Dn.appConfig.media_config.play_config.resource_info;if(r.length){var o=r.find(function(t){return t.resource_type==s[V.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 y.FLV:e=h;break;case y.HLS:n=h}}}return{flv:e,hls:n}},t.prototype.onCDNPlayerCanplay=function(t,i){var e=this.vd;if(6!=e.state&&(this.setCdnState(6),0==e.firstFrameTime)){e.firstFrameTime=Date.now()-e.beginTime;var n=this.Ln.createSpan(a.H,{key:$n.event,par:t},{key:""},Ds.event);n.setAttributes({fft_consumed:Ds.fft_consumed(e.firstFrameTime),biz_product:Ds.biz_product(i.resourceMode==V.DG?1:0)}),n.end()}0==this.cdnPlayTime&&this.Bv&&(this.cdnPlayTime=Date.now())},t.prototype.bindZegoCDNPlayerEvents=function(t,i,e){var n=this,s=this.vd;t.onComplete=function(){if(n.Bv&&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.Dn.networkState==c.offline&&(t.canRetry=!1),null===(e=n.jd)||void 0===e||e.setAttributes({stop_reason:Zs(i)}),n.updateCDNValidTime()},t.onCanplay=function(){n.onCDNPlayerCanplay(i,e)}},t.prototype.selectCDNSource=function(t,i,e){var n=this.Uv(t),s="",r=this.jd;if(n)s=i[0],null==r||r.setAttributes({protocol:Ys("flv")});else if(t.isSupportFLV()&&(null==i?void 0:i.length)>0)s=i[0],null==r||r.setAttributes({protocol:Ys("flv")});else if(t.isSupportHLS()&&(null==e?void 0:e.length)>0)s=e[0],null==r||r.setAttributes({protocol:Ys("hls")});else if(!this.cdnUrl)return null;return s?s=s.replace("http://","https://"):null},t.prototype.updateCDNValidTime=function(){this.cdnPlayTime&&(this.Mv+=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.vd;this.zn.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.Dn.browser&&!a&&u&&n._CDNPlayerClone){var c=u.parentElement;if(c){var h=si.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}"),si.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.zn.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}(),l_=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)}}(),d_=function(){return d_=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},d_.apply(this,arguments)},v_=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])}}},p_=$n,g_=$n.event,b_=$n.error,__=ss,y_=ts,w_=rs.event,S_=Qs,E_=Fs;!function(t){t.beforePublish="beforePublish",t.publishing="publishing",t.afterPublish="afterPublish"}(u_||(u_={}));var O_=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).zn=e,p.Uo=u,p.ac=c,p.Dn=h,p.room=f,p.streamSid=d,p.isDataChannel=v,p.Vv=void 0,p.Hv=void 0,p.Gv=void 0,p.bf={state:"NO_PLAY",code:0},p.probedList=[],p.probeTime=0,p.probeTimer=null,p.probeNodeList=[],p.hasSucceed=!1,p.Fv=0,p.Yv=0,p.pulledTimeStamp=0,p.firstPulledTimeStamp=0,p.Zv=0,p.Qv=0,p.CDNBrokenCnt=0,p.serverUrl=hy,p.isCenterNode=!0,p._state=7,p.lastState=7,p.broadcasterStatus=j.stop,p.isExternal=!1,p.reportPlayStateTime=0,p.streamInRoom=!0,p.playStartTime=0,p.Xv=0,p.nl=0,p.sl=0,p.poorQualityRetryCnt=0,p.rl=[],p.continuousFailCnt=0,p.Wv=0,p.remoteStream=null,p.playStream=null,p.rtcViewer=null,p.qd={},p.Kv={video:!0,audio:!0,expireTime:0},p.isServerMuteVideo=!1,p.isServerMuteAudio=!1,p.$v=null,p.Ml=null,p.jf=25e3,p.cameraStatus=0,p.micStatus=0,p.soundLevel=0,p.mic=null,p.beginTime=0,p.firstFrameTime=0,p.playMode=J.RTC,p.il=!0,p.isProbe=!1,p.el=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._f=!1,p.probeQuality=0,p.ip="",p.port=0,p.audioMuteState="0",p.videoMuteState="0",p.tm=null,p.im=0,p.nm="",p.sm=0,p.rm=0,p.om=u_.beforePublish,p.soundMeterWorklet=null,p.um=!1,p.am={},p.isProbe||(p.hm=Si(p.Ln,a.I,i,g_,Ma.event,void 0,!0)),p.id=eu("".concat(u.appid,"_").concat(h.idName,"_").concat(i,"_").concat(Date.now(),"_").concat(D())),p.beginTime=Date.now(),p.tu=i,n&&p.setSignal(n),p.dataReport=s,p.qualityHandler=new Vb(r,o,p,p.zn,p.dataReport,p.Dn),p.qualityHandler.onRecvMediaData=function(){var t;p.isProbe||(null===(t=p.fm)||void 0===t?void 0:t.streamNotFoundTime)&&(p.fm.streamNotFoundTime=0,p.info("zc.p.ormd.1 reset streamNotFoundTime"))},p.qualityHandler.onFindDecodeException=function(t){var i,e;if(!p.isProbe){var n=null===(i=p.room.streamList)||void 0===i?void 0:i.find(function(t){return t.stream_id===p.tu}),s="zc.p.ofde.1 may fail to decode. v: ".concat(t," , ").concat(null===(e=null==n?void 0:n.stream_attr_opts)||void 0===e?void 0:e.stream_codec);if(p.playOption.transcodeOnDecodeFail&&p.fm)1!==p.Kr("transcode_on_zero_fps",!0)||p.fm.needTranscode||(s+=" ; need transcode",p.fm.needTranscode=Te.code,p.playStateUpdateError(Te,!1,void 0,!0));p.warn(s)}},p.qualityHandler.onPlayingError=function(t){p.playStateUpdateError(t)},p.playMediaStatus={video:!p.Uo.defaultVideoMuted,audio:!p.Uo.defaultAudioMuted},p.info("zc.p.1 set playMediaStatus ".concat(JSON.stringify(p.playMediaStatus))),p.nv=p.Kr("resource_mode"),p.retryStreamHandler=new Kb(p.streamId,p.zn,p.Dn,p.Uo,!1),l){if(p.qd=l,l.CDNPlayer)p.getCDNHandler().cdnPlayer=l.CDNPlayer;p.initResourceMode(l.resourceMode)}p.initStreamReport();var g=d_(d_({},l),{CDNVideo:void 0,CDNPlayer:void 0});return null===(m=p.hm)||void 0===m||m.setAttributes({stream_id:p_.stream_id(i),stream_sid:p_.stream_sid(d),play_option:p_.play_option(g),video_codec_id:p_.video_codec_id(null==l?void 0:l.videoCodec),use_na:p_.use_na(1),biz_product:(null==l?void 0:l.resourceMode)==V.DG?1:0,resource_mode:p_.resource_mode(p.resourceMode),src:p_.src(p.playMode),room_id:p_.room_id(null==f?void 0:f.roomID),room_sid_string:p_.room_sid_string(null==f?void 0:f.roomSessionID),is_multi:p_.is_multi(p.Dn.isMultiRoom)}),p}return l_(i,t),Object.defineProperty(i.prototype,"zegoPeer",{get:function(){return this.fm},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fm",{get:function(){var t=void 0;switch(this.playMode){case J.RTC:t=this.Vv;break;case J.L3:t=this.Hv}return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerConnection",{get:function(){var t;return null===(t=this.fm)||void 0===t?void 0:t.peerConnection},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"signal",{get:function(){var t;return null===(t=this.fm)||void 0===t?void 0:t.signal},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"curCBState",{get:function(){return this.bf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Mv",{get:function(){var t;return(null===(t=this.Gv)||void 0===t?void 0:t.Mv)||0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamConnectIP",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.streamConnectIP)||""},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"zegoExpressPlayer",{get:function(){var t;return null===(t=this.Gv)||void 0===t?void 0:t.zegoExpressPlayer},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"zegoCdnPlayer",{get:function(){var t;return null===(t=this.Gv)||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.bf[e]});return e&&(this.bf=t),e},Object.defineProperty(i.prototype,"state",{get:function(){var t;return this.playMode==J.CDN?this.Gv?this.Gv.state:7:void 0===(null===(t=this.fm)||void 0===t?void 0:t._state)?7:this.fm._state},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamId",{get:function(){return this.tu},set:function(t){this.tu=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sessionId",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.sessionId)||0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playOption",{get:function(){return this.qd},set:function(t){this.qd=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateNego",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.stateNego)||0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"resourceMode",{get:function(){return this.nv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNode",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.gwNode)||""},set:function(t){this.fm&&(this.fm.gwNode=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodeList",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.gwNodeList)||[]},set:function(t){this.fm&&(this.fm.gwNodeList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodesTTL",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.gwNodesTTL)||0},set:function(t){this.fm&&(this.fm.gwNodesTTL=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isNodesEmpty",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.isNodesEmpty)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipNodeType",{get:function(){var t;return this.fm?null===(t=this.fm)||void 0===t?void 0:t.ipNodeType:zt.ZV4Priority},set:function(t){this.fm&&(this.fm.ipNodeType=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipV6Prefer",{get:function(){var t;return this.fm?null===(t=this.fm)||void 0===t?void 0:t.ipV6Prefer:1},set:function(t){this.fm&&(this.fm.ipV6Prefer=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPeer",{get:function(){return this.il},set:function(t){this.il=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerID",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"retryFailGwNodes",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.retryFailGwNodes)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"retryFailIpV4Nodes",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.retryFailIpV4Nodes)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"retryFailIpV6Nodes",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.retryFailIpV6Nodes)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipV4NodeList",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.ipV4NodeList)||[]},set:function(t){this.fm&&(this.fm.ipV4NodeList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipV6NodeList",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.ipV6NodeList)||[]},set:function(t){this.fm&&(this.fm.ipV6NodeList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipNode",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.ipNode)||null},set:function(t){this.fm&&t&&(this.fm.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,"qualityGrade",{get:function(){var t=this.qualityHandler.Ya;return Math.max(t.video.videoQuality,t.audio.audioQuality)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"netQuality",{get:function(){return this.qualityHandler.Vc},set:function(t){this.qualityHandler.Vc=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lastPlayStats",{get:function(){return this.qualityHandler.md},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.fm)||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.Xc},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),Ei(Si(this.Ln,a.H,this.streamId,Ks,$n.event),{src:tr(t),last_src:$s(r)});var o=!1;t!==J.CDN&&r!==J.CDN||(o=!0),this.resetPlay(o,0),this.Uo.removeStreamFromSignal(!1,this.streamId,15e3);var u=this.retryStreamHandler;u.endRtcPlaySpan(this.streamId,void 0,this),this.playMode=t;var c=!0;this.playMode===J.L3?(this.serverUrl=fy,c=!1):(this.serverUrl=hy,c=!0),this.useResourceTypes.push(this.playMode),this.useResourceTypes=Array.from(new Set(this.useResourceTypes)),this.playMode===J.CDN?this.playCDN():(u.startMaxTime(),u.playStartSpan(this.streamId,this,!0),this.Uo.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.Uo.rePlayStream(n.streamId,t)}))}else this.info(s+" no change.")},Object.defineProperty(i.prototype,"ipStack",{get:function(){return ql(this.ip)?Nt.IPv6:Nt.IPv4},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dataChannel",{get:function(){var t;return null===(t=this.fm)||void 0===t?void 0:t.dataChannel},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataChannelList",{get:function(){var t;return(null===(t=this.fm)||void 0===t?void 0:t.onDataChannelList)||[]},set:function(t){this.fm&&(this.fm.onDataChannelList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"netProtocol",{get:function(){var t,i;return(null===(t=this.fm)||void 0===t?void 0:t.turnToTcp)?"tcp":(null===(i=this.fm)||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.fm)||void 0===t?void 0:t.Lo)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"seiWorker",{get:function(){return this.Uo.seiWorker},enumerable:!1,configurable:!0}),i.prototype.Kr=function(t,i){return void 0===i&&(i=!1),this.Dn.settingConfig.getSetting(t,i)},Object.defineProperty(i.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"logger",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completePlaySpan",{get:function(){return this.hm},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playingEvent",{get:function(){var t=w_;switch(this.playMode){case J.L3:t=S_;break;case J.RTC:t=w_;break;case J.CDN:t=E_}return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playStartEvent",{get:function(){return this.hasSucceed?ns:y_.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStreamNotFound",{get:function(){var t;return!!(null===(t=this.fm)||void 0===t?void 0:t.streamNotFoundTime)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"allowAutoSwitchResource",{get:function(){return[V.DG,V.CUSTOM].includes(this.nv)},enumerable:!1,configurable:!0}),i.prototype.initResourceMode=function(t){if(Vt(t)&&[0,1,2,3,5].includes(t)){var i=nd(t);if(this.nv=t,t===V.DG)i=J.L3;else if(t===V.CUSTOM){var e=this.playOption.customResourceConfig||{},n=e.beforePublish,s=void 0;this.Uo.publishersLength>0?(s=e.publishing,this.om=u_.publishing):(s=n,this.om=u_.beforePublish),i=s===V.L3?J.L3:s===V.CDN?J.CDN:J.RTC}this.useResourceTypes.push(i),this.playMode=i,i===J.L3&&(this.serverUrl=fy),this.info("zc.ply.cpm init mode "+i)}return this.playMode},i.prototype.changePublishOccasion=function(t){var i=this.om,e=this.qd.resourceMode===V.CUSTOM,n=this.qd.customResourceConfig||{},s=n.afterPublish,r=n.publishing;if(t&&i!==u_.publishing){if(this.om=u_.publishing,e&&Vt(r))return this.changePlayMode(nd(r))}else if(!t&&i!==u_.afterPublish&&i===u_.publishing&&(this.om=u_.afterPublish,e&&Vt(s)))return this.changePlayMode(nd(s))},i.prototype.setSignal=function(t){var i=this.fm;i?i.setSignal(t):i=this.lm(this.playMode,t),this.info(fv+" 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._f=!0;var e=null==this?void 0:this.retryStreamHandler;e&&e.dispatchGwNodesBypass(this,t,i)},i.prototype.initStreamReport=function(){this.Cl=this.Ln.createSpan(a.I,{key:g_,par:this.tu},{key:__.event,par:this.tu},__.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(fv+" called ");var h=this.qd||{};if(t){var f=this.fm;if(f){this.getRemoteStreamSuc=i,this.playMediaStatus={video:this.playMediaStatus.video&&(void 0===this.qd.video||!!this.qd.video),audio:this.playMediaStatus.audio&&(void 0===this.qd.audio||!!this.qd.audio)},h&&h.videoCodec&&(this.qd.videoCodec=h.videoCodec),null===(e=this.hm)||void 0===e||e.setAttributes({video_layer:p_.video_layer(2===this.qd.streamType?-1:this.qd.streamType||1)});var l=this.Kr("play_video_codec",!0);l&&(this.info(fv+" setting play_video_codec "+l),this.qd.videoCodec=l);var d=(null===(n=this.qd)||void 0===n?void 0:n.resourceMode)==V.DG?1:0;null===(s=this.Za)||void 0===s||s.setAttributes({is_peer:y_.is_peer(this.il),is_mini:y_.is_mini(this.isMiniSdp)});var v={};(null===(r=this.fm)||void 0===r?void 0:r.Of)||(v.is_mini=this.isMiniSdp),null===(o=this.hm)||void 0===o||o.setAttributes(d_({audio_activate:p_.audio_activate(1==this.qd.audio||0!=this.qd.audio),video_activate:p_.video_activate(1==this.qd.video||0!=this.qd.video),biz_product:p_.biz_product(d),is_peer:p_.is_peer(this.il)},v)),this.Cl.setAttributes({room_id:__.room_id(null===(u=null==this?void 0:this.room)||void 0===u?void 0:u.roomID),room_sid_string:__.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.Ml&&(clearTimeout(this.Ml),this.Ml=null),this.Ml=setTimeout(function(){c.error(fv+" waiting timeout"),c.playStateUpdateError(b_.dn)},this.jf),this.isProbe&&this.qualityHandler.startProbeTimeout()}else this.error(fv+" no peer")}else this.warn(fv+" streamId is null")},i.prototype.lm=function(t,i){var e=this;if([J.L3,J.RTC].includes(t)){var n=t===J.L3,s=this.fm;return s||(this.info(fv+" create peer "+t),s=new a_(this,t,i,this.zn,this.dataReport,this.Cl,this.Uo,this.Dn,this.room,this.qd)),s.onCanStopNegaTimer=function(){null!=e.Ml&&(clearTimeout(e.Ml),e.Ml=null)},s.onNeedReplay=function(){e.resetPlay(!0,0),e.startPlay(e.tu,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.Wv++,e.continuousFailCnt=0,e.reportPlayStateTime=Date.now(),e._f=!1,e.Za&&Ei(e.Za,{signal_consume:y_.signal_consume(e.signalTime),is_peer:y_.is_peer(e.il),peer_id:y_.peer_id(e.peerID),source_type:y_.source_type(e.playMode),net_protocol:y_.net_protocol(null==e?void 0:e.netProtocol),tryidx:y_.tryidx(e.tryidx)},!1),e.isProbe||e.jd||(e.jd=Si(e.Ln,a.I,e.streamId,e.playingEvent,$n.event,void 0,!0)),e.getConnectIP(),e.Uo.publisherList){if(6==e.Uo.publisherList[u].publisher.state&&e.broadcasterStatus==j.stop){null==s||s.sendBroadcasterStatus(1),e.broadcasterStatus=j.start;break}}if(!e.isProbe){e.qualityHandler.setPlayQualityTimer();var c=e.Kr("probe_started_num");!isNaN(c)&&(e.Uo.probeStartedNum=c)}var h,f,l;("firefox"===(l=e.Dn.browser)||"chrome"===l&&(h=0,(f=(ph().toLowerCase().match(/chrome\/([\d.]+)/)||[])[1])&&(h=parseInt(f.split(",")[0])),h<72))&&e.dm(t,i);var d=e.am,v=d.v,m=d.a;Vt(v)&&e.onRemoteCameraStatusUpdate(v),Vt(m)&&e.onRemoteMicStatusUpdate(m),e.allowAutoSwitchResource&&(e.playMode===J.RTC?null===(n=e.Hv)||void 0===n||n.close(0):e.playMode===J.L3&&(null===(r=e.Vv)||void 0===r||r.close(0)))},s.onGetIP=function(){6===e.state&&e.getConnectIP()},s.onPeerConnected=this.dm.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(kv+" add track "+n),e.playStream.addTrack(t),i&&i.setTrack(n,t,"safari"===e.Dn.browser),e.Dn.actionListener(n?"playerVideoTrackUpdate":"playerAudioTrackUpdate",e.tu,t)));n||e.vm()})}else e.playStream=t.clone(),e.info(kv+" clone");e.Gv&&e.Gv.renderMediaStreamByCdnPlayer(e.playStream),e.Uo.soundLevelDelegate&&!e.isProbe&&e.startSoundLevel(),e.audioMuteState=t.getAudioTracks().length>0?"0":"1",e.videoMuteState=t.getVideoTracks().length>0?"0":"1"},s.onRecvStreamStatus=this.pm.bind(this),s.onRecvMixSoundLevels=function(t){e.gm(t)},s.onRecvNetQuality=function(t,i,n){e.playMode===(null==s?void 0:s.playMode)&&(e.qualityHandler.stopProbeTimeout(),0==t&&Vt(i)&&Vt(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.nm=e.nm||(null===(n=null===(i=e.Uo.playerList[e.tu])||void 0===i?void 0:i.room.streamList.find(function(t){return t.stream_id==e.tu}))||void 0===n?void 0:n.id_name),e.nm&&(e.Dn.actionListener("networkQuality",e.nm,null==r?void 0:r.tx_quality,null==r?void 0:r.rx_quality),!e.tm&&e.startPollNetworkQuality(),e.im=0)}},n?this.Hv=s:this.Vv=s,s}},i.prototype.resetGwNodes=function(){var t;null===(t=this.fm)||void 0===t||t.resetGwNodes()},i.prototype.setGwNodes=function(t,i,e,n){var s;null===(s=this.fm)||void 0===s||s.setGwNodes(t,i,e,n)},i.prototype.dispatchGwNodes=function(t,i,e){var n;null===(n=this.fm)||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(_v+" call"),t&&(null===(e=this.Vv)||void 0===e||e.close(i),null===(n=this.Hv)||void 0===n||n.close(i),null===(s=this.Gv)||void 0===s||s.stopCDNPlayer()),this.ip="",null!=this.Ml&&(clearTimeout(this.Ml),this.Ml=null),this.qualityHandler.stopProbeTimeout(),this.qualityHandler.clearPlayQualityTimer(),this.stopSoundLevel(),this.sm=0,this.rm=0},i.prototype.playStateUpdateError=function(t,i,e,n){if(this.error(Iv+" call "+JSON.stringify(t)),!this.isProbe){var s=this.Ln.createSpan(a.H,{key:g_,par:this.tu},{key:""},us);s.setAttributes({error:null==t?void 0:t.code,message:null==t?void 0:t.message}),s.end()}this.isProbe?this.onCalNetQualityResult(1):this.tu&&this.onPlayStateUpdate(tt,this.tu,t,i,e,n),this.info(Iv+" ended")},i.prototype.getCameraMicStatus=function(t){return 0==t?"OPEN":"MUTE"},i.prototype.onPlayStateUpdate=function(t,i,e,n,s,r){((i&&this.Uo.playerList[i])===this?this.retryStreamHandler.playStateHandle(t,this.streamId,e,n,s,r):this.error("zsc.pss.1 cannot find play"),t===$&&0===(null==e?void 0:e.code))&&(this.Uo.playModule&&this.bm(),this.Uo.supplementPlayingChargeTime(),this.qualityHandler.resetCallbackState())},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.gm=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 d_(d_({},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.Dn.actionListener("mixerSoundLevelUpdate",n,this.tu),r.size&&this.Dn.actionListener("autoMixerSoundLevelUpdate",r,this.tu)},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.Uo.publisherList){if(6==this.Uo.publisherList[a].publisher.state&&this.broadcasterStatus==j.start){this.sendBroadcasterStatus(0),this.broadcasterStatus=j.stop;break}}var c=null===(e=this.fm)||void 0===e?void 0:e.Lo,h=this.isStreaming?0:this.lastFailTimeLen;if(!this.isProbe){var f=Date.now()-this.reportPlayStateTime;[0,2].includes(this.nv)&&this.Cl.setAttributes({play_state_time:__.play_state_time(f||0)}),this.jd&&this.endPlayingSpan({stop_reason:rs.stop_reason(u),try_time:rs.try_time(h)}),(null==t?void 0:t.code)==b_.gn.code&&this.uploadPlayEvent(t),this.seiWorker&&this.seiWorker.postMessage({cmd:"clear",type:"pull",streamID:this.tu})}if(this.stopPollNetworkQuality(),this.resetPlay(!0,0),this.Yu(),!this.isProbe){var l=this.qualityHandler,d=l._d,v=l.yd,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===ke.code?this.latestPlayErrCode:t.code),this.Cl.setAttributes(d_(d_({biz_product:(null===(n=this.qd)||void 0===n?void 0:n.resourceMode)==V.DG?1:0,webrtc_sid:__.webrtc_sid(this.sessionId),max_retry_interval:__.max_retry_interval(this.Dn.streamRetryTime),probe_ip_cnt:__.probe_ip_cnt(this.nl),valid_probe_ip_cnt:__.valid_probe_ip_cnt(this.sl),poor_quality_retry_cnt:__.poor_quality_retry_cnt(this.poorQualityRetryCnt),probe_not_trigger_retry_info:__.probe_not_trigger_retry_info(this.rl.length>0?this.rl:void 0),fail_cnt:__.fail_cnt(Math.max(this.tryidx-1,0)),continuous_fail_cnt:__.continuous_fail_cnt(Math.max(this.continuousFailCnt-1,0)),try_time:__.try_time(h),use_resource_type:__.use_resource_type(this.useResourceTypes),use_na:ss.use_na(1),play_state_cnt:__.first_frame_time(this.Wv),protocol:__.protocol("webrtc"),dispatch_external_ip:__.dispatch_external_ip(this.Dn.clientIP),w:__.w(null===(s=this.playStat)||void 0===s?void 0:s.frameWidth),h:__.h(null===(r=this.playStat)||void 0===r?void 0:r.frameHeight),stop_reason:__.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.Fv+this.Yv+this.Mv,tempbroken_cnt:this.Zv+this.Qv+this.CDNBrokenCnt,is_mini:c})),this.Cl.end()}this.Uo.stopToReport(1),this.Uo.stopNetProbe(this),null===(o=this.fm)||void 0===o||o.stopPlay(),this._m(),this.ym(),this.hasSucceed=!1,this.tryidx=0,this._f=!1,this.nl=0,this.sl=0,this.poorQualityRetryCnt=0,this.continuousFailCnt=0;var _=this.rtcViewer;_&&_.destroy()},i.prototype.uploadPlayEvent=function(t){var i,e;if(this.hm){var n={};this.fm&&(null===(i=this.fm)||void 0===i?void 0:i.Ef)&&(n.mini_retry_consume=+(null===(e=this.fm)||void 0===e?void 0:e.Ef.toFixed(0)),this.fm.resetMiniReportInfos()),Ei(this.hm,d_(d_({},n),{error:t.code,message:t.message}))}this.hm=void 0},i.prototype.onDisconnect=function(t){this.info("zc.p.od.1 call"),this.playStateUpdateError(t||b_.Ce,!!t)},i.prototype.startSoundLevel=function(){var t,i=this;if(this.info(Nv+" 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.Uo.getCloudSoundInterval();try{var n=this,s=this.Uo.createSoundLevel(this.ac,this.remoteStream,this.Uo.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(Nv+" get sound level failed "+t)}}else this.info(Nv+" 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.jd)||void 0===t||t.setAttributes({lsttime:rs.lsttime(parseInt(this.lastPlayStats.time)),total_stat:Xn.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 Lm(this.playStream,this,{clearLastFrame:this.Dn.engineConfig.playClearLastFrame})),this.rtcViewer},i.prototype.dm=function(t,i){var e;this.isProbe||0!=this.firstFrameTime||(this.firstFrameTime=(new Date).getTime()-this.beginTime,this.Cl.setAttributes({first_frame_time:__.first_frame_time(this.firstFrameTime),fft_video:__.fft_video(this.firstFrameTime),fft_audio:__.fft_audio(this.firstFrameTime),biz_product:Ds.biz_product((null===(e=this.qd)||void 0===e?void 0:e.resourceMode)==V.DG?1:0)}),this.wm=this.firstFrameSpan("video",t,i),this.Sm=this.firstFrameSpan("audio",t,i)),this.um&&this.Em(this.cameraStatus,this.micStatus)},i.prototype.Em=function(t,i){0===t&&this.wm&&(this.wm.setAttributes({dev_changed:Ds.dev_changed(0!==this.cameraStatus)}),this.wm.spanReport(),this.wm=null),0===i&&this.Sm&&(this.Sm.setAttributes({dev_changed:As.dev_changed(0!==this.micStatus)}),this.Sm.spanReport(),this.Sm=null)},i.prototype.firstFrameSpan=function(t,i,e){var n,s="video"===t?Ds:As,r=Si(this.Ln,a.H,this.tu,s.event,g_),o=this.streamInRoom?2:0===this.Xv?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.Xv),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.qd)||void 0===n?void 0:n.resourceMode)==V.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.Xv||5===this.state||(this.Xv=(new Date).getTime()-this.playStartTime),6===this.state&&this.Gv&&this.Gv.retrySendTransCodecCmd()},i.prototype.setStreamUpdate=function(t){this.qualityHandler.setStreamUpdate(t)},i.prototype.startPollNetworkQuality=function(){var t=this;clearTimeout(this.tm),this.tm=setTimeout(function(){t.im++;var i=F.Unknown,e=F.Unknown;t.nm&&t.im>1&&(t.im>3&&(i=F.Die,e=F.Die),t.Dn.actionListener("networkQuality",t.nm,i,e)),t.startPollNetworkQuality()},3e3)},i.prototype.stopPollNetworkQuality=function(){clearTimeout(this.tm),this.im=0},i.prototype.setAudioFrameCallback=function(t,i){(this.info("zc.p.safc.0 call"),this.playStream)?(this.Fu||(this.Fu=new Yp(this.ac,this.zn)),this.Fu.setAudioFrameCallback(this.playStream,null!==t,function(i){t&&t(i)},i)):this.warn("zc.p.safc.0 no play stream")},i.prototype.Yu=function(){this.Fu&&(this.Fu.destroy(),this.Fu=null)},i.prototype.vm=function(){var t;null===(t=this.Fu)||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!==ke.code&&(i=1);var e=Date.now(),n=this.playMode,s=e-this.pulledTimeStamp;n==J.RTC?(this.Fv=s,this.Zv+=i):n===J.L3&&(this.Yv=s,this.Qv+=i),this.pulledTimeStamp=0}},i.prototype.updateCDNValidTime=function(){var t;null===(t=this.Gv)||void 0===t||t.updateCDNValidTime()},i.prototype.setMuteStreamByPlayMode=function(t){this.info(Pv+" 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=!su(n,0),u=!su(n,1);(this.info(Pv+" mode: ".concat(u,",\n ").concat(o,",\n ").concat(r,",\n ").concat(JSON.stringify(this.Kv))),u!==this.Kv.video||o!==this.Kv.audio||r!==this.Kv.expireTime)?(Gt(u)&&(this.Kv.lastVideo=this.Kv.video,this.Kv.video=u),Gt(o)&&(this.Kv.lastAudio=this.Kv.audio,this.Kv.audio=o),r&&(this.Kv.expireTime=r),this.Uo.playModule&&this.isStreaming&&this.bm()):this.info(Pv+" mode not change")},i.prototype.bm=function(){var t=[void 0,!0].includes(this.qd.video),i=[void 0,!0].includes(this.qd.audio),e=this.Kv,n=e.video,s=e.audio,r=e.lastVideo,o=e.lastAudio,u=e.expireTime;this.info("".concat(Mv," ").concat(JSON.stringify(this.Kv)));var a=this.playMediaStatus,c=a.video,h=a.audio,f=u-((new Date).getTime()+this.Dn.clientTimeOffset);this.info("".concat(Mv," remainTime ").concat(f));var l=!1,d=!1,v=!1,m=!1;this.Om();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.Tm("video",d,p),i&&v&&this.Tm("audio",m,p),this.ym(),(!1===n||!1===s)&&f>0&&this.km(f)},i.prototype.Tm=function(t,i,e,n){var s=this;this.info("".concat(xv," ").concat(this.tu," ").concat(t," ").concat(i));var r=this.Uo.playModule;r&&r.mutePlayStream(this.tu,t,i,!1).then(function(i){s.info("".concat(xv," ").concat(s.tu," mute ").concat(t,": ").concat(i));var r=function(t,i){s.Dn.onExperimentalAPICallback({method:t,content:{roomID:s.room.roomID,streamID:s.tu,mute:i}})},o=!s.playMediaStatus.video,u=!s.playMediaStatus.audio;"video"===t&&e&&s.Rm!==o&&(r("onRecvRoomMuteVideoStream",o),s.Rm=o),"audio"===t&&e&&s.Im!==u&&(r("onRecvRoomMuteAudioStream",u),s.Im=u),n&&n()})},i.prototype.km=function(t){var i=this;this.info("".concat(jv," ").concat(this.tu," ").concat(t)),this.$v=setTimeout(function(){var t=i.Uo.playModule;if(i.info("".concat(jv," ").concat(i.tu," ").concat(!!t)),t){var e=i.Kv,n=e.audio;!1===e.video&&i.Tm("video",!1,!0,function(){i.Om()}),!1===n&&i.Tm("audio",!1,!0,function(){i.Om()}),i._m()}},t)},i.prototype.Om=function(){var t=this.Kv,i=t.video,e=t.audio,n=t.expireTime-((new Date).getTime()+this.Dn.clientTimeOffset);this.isServerMuteVideo=n>0&&!1===i,this.isServerMuteAudio=n>0&&!1===e},i.prototype.ym=function(){this.$v&&(clearTimeout(this.$v),this.$v=null)},i.prototype._m=function(){this.Kv={video:!0,audio:!0,expireTime:0,lastVideo:!0,lastAudio:!0}},i.prototype.pm=function(t,i,e){this.info("".concat(Tv," status camera_status: ").concat(t," mic_status: ").concat(i));var n=this.cameraStatus!==t;if((!this.um||n)&&this.onRemoteCameraStatusUpdate(t),(!this.um||this.micStatus!==i)&&this.onRemoteMicStatusUpdate(i),this.um=!0,this.cameraStatus=t,this.micStatus=i,this.videoMuteState=0===t?"0":"1",this.audioMuteState=0===i?"0":"1",Gt(this.qd.video))this.info(Tv+" has set video option, ignore stream status");else if(this.handleVideoTrackForPlaying(n),"safari"===this.Dn.browser&&e)for(var s=si.querySelectorAll("video, audio"),r=0;r<s.length;r++){var o=s[r];o.srcObject===this.playStream&&(this.info(Tv+" track changed. rerender stream"),o.srcObject=this.playStream)}this.Em(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(Tv+" viewer clear last frame"),n.checkIfClearLastFrame()):e.getVideoTracks().forEach(function(t){t.enabled=!1,i.Uo.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.Dn.browser),this.Dn.actionListener("playerVideoTrackUpdate",this.tu,r)}}},i.prototype.onRemoteCameraStatusUpdate=function(t){6===this.state?(this.am.v=void 0,this.Uo.onRemoteCameraStatusUpdate(this.streamId,this.getCameraMicStatus(t),t)):(this.am.v=t,this.info(Tv+" v not playing. "))},i.prototype.onRemoteMicStatusUpdate=function(t){6===this.state?(this.am.a=void 0,this.Uo.onRemoteMicStatusUpdate(this.streamId,this.getCameraMicStatus(t),t)):(this.am.a=t,this.info(Tv+" 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.jd=Si(e.Ln,a.H,e.streamId,e.playingEvent,$n.event,void 0,!0),i&&i.apply(void 0,t)},function(i){e.info(n+" fail. "+i),e.onPlayStateUpdate(tt,e.tu,i,!0),t&&t(i)})},i.prototype.getCDNHandler=function(){return this.Gv||(this.Gv=new f_(this,this.zn,this.Ln,this.Uo,this.Dn)),this.Gv},i.prototype.endPlayingSpan=function(t){var i,e,n;if(void 0===t&&(t={}),this.jd){var s=this.room,r=this.playMode===J.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(),Ei(this.jd,d_(d_({stream_id:rs.stream_id(this.streamId),room_id:rs.room_id(null==s?void 0:s.roomID),room_sid_string:rs.room_sid_string(null==s?void 0:s.roomSessionID),tryidx:rs.tryidx(this.tryidx),ip:rs.ip(null==this?void 0:this.ip),resource_type:rs.resource_type(this.playMode),dispatch_external_ip:rs.dispatch_external_ip(this.Dn.clientIP)},r?{url:rs.url(null===(e=this.Gv)||void 0===e?void 0:e.cdnUrl),net_protocol:rs.net_protocol("tcp")}:{protocol:rs.protocol("webrtc"),url:rs.url(null===(n=this.signal)||void 0===n?void 0:n.server),try_time:rs.try_time(o),net_protocol:rs.net_protocol(this.netProtocol)}),t)),this.jd=void 0,!0}return!1},i.prototype.sendBroadcasterStatus=function(t){var i=this.fm;i&&i.sendBroadcasterStatus(t)},i.prototype.ActivatePlayAudioStream=function(t,i,e){var n=this.fm;n&&n.ActivatePlayAudioStream(t,i,e)},i.prototype.ActivatePlayVideoStream=function(t,i,e){var n=this.fm;n&&n.ActivatePlayVideoStream(t,i,e)},i.prototype.getP2PNetStats=function(t,i){var e=this.fm;e&&e.getP2PNetStats(t,i)},i.prototype.getConnectIP=function(){var t,i;if(this.streamConnectIP&&!this.ip){var e=Ul(this.streamConnectIP),n=this.getIPByGwNode(e),s=n.ip,r=n.port;this.ip=s,this.port=r,this.info("zc.p.1.gci.0 ip: ".concat(s," ").concat(r)),null===(t=this.Za)||void 0===t||t.setAttributes({ip:y_.ip(this.ip),port:y_.port(this.port)}),null===(i=this.Za)||void 0===i||i.spanReport(),this.Za=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=Ul(i);t===e&&(n=i)}),{ip:n,port:this.ipNode.port}}if(this.gwNode){var s=null===(i=this.gwNode)||void 0===i?void 0:i.split(":"),r=s[s.length-1];return{ip:this.gwNode.replace(":"+r,""),port:parseInt(r)}}return{ip:"",port:0}},i.prototype.reportMiniSdpInfos=function(){var t;null===(t=this.fm)||void 0===t||t.reportMiniSdpInfos(this.playStartEvent)},i.prototype.setPlayStreamVideoType=function(t){return v_(this,void 0,void 0,function(){var i;return m_(this,function(e){return(i=this.fm)?[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.fm;if(i&&!(i.gwVersion<83886080)){var e=Date.now();if(0===this.sm||e-(this.sm+50)>=2e3){var n=this.dataChannel;if(n&&"open"===n.readyState){var s=new Uint8Array(5);s[0]=14,s[1]=this.rm>>8&255,s[2]=255&this.rm,s[3]=t>>8&255,s[4]=255&t,this.rm++,this.rm>=65536&&(this.rm=0),n.send(s)}else i.sendPlayStats(t);this.sm=e}}},i}(Nm),T_=o(6361),k_=o.n(T_),R_=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())})},I_=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.zn=i,this.Nm=e;var n=this.Cm();this.zm=t+":"+Ho(6),this.Dm=k_().createInstance({name:this.zm}),this.zn.info(im+" constructor ".concat(t," ").concat(this.zm," ").concat(n)),this.recordStoresInStorage(t,this.zm,n)}return Object.defineProperty(t.prototype,"deletedKeys",{get:function(){return this.name+"_d"},enumerable:!1,configurable:!0}),t.prototype.Cm=function(){return Math.ceil(this.Nm._now()/1e3)},t.prototype.recordStoresInStorage=function(t,i,e){try{var n=localStorage.getItem(t);this.zn.info(im+" 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.zn.info(im+" resetStorageStores"),this.refreshStores("0",this.zm)},t.prototype.removeStoreFromStorage=function(t){return R_(this,void 0,void 0,function(){return I_(this,function(i){switch(i.label){case 0:return t===this.zm?[3,2]:(this.zn.info(im+" removeStore ".concat(t)),[4,this.dropInstance(t)]);case 1:return i.sent(),this.refreshStores("2",t),[3,3];case 2:this.zn.info(im+" not remove self"),i.label=3;case 3:return[2]}})})},t.prototype.refreshStores=function(t,i){var e,n;if(this.zn.info(im+" 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.zn.info(im+" 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.Cm()-parseInt((null===(n=f.split("/"))||void 0===n?void 0:n[1])||"0")>86400&&u.push(d);var v=d+"/"+this.Cm();a.push(v+"-"+t)}-1===d.indexOf(this.zm)&&"0"==l&&o.push(d)}localStorage.setItem(this.name,a.join(","))}return[o,u]},t.prototype.dropInstance=function(t){return R_(this,void 0,void 0,function(){var i;return I_(this,function(e){switch(e.label){case 0:this.zn.info(im+" dropInstance ".concat(t)),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,k_().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.zn.info(im+" 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 R_(this,void 0,void 0,function(){var e,n,s,r,o,u,a,c=this;return I_(this,function(h){switch(h.label){case 0:return h.trys.push([0,12,,13]),e=this.getDeleteKey(),[4,(n=k_().createInstance({name:t})).keys()];case 1:return s=h.sent(),this.zn.info(im+" ".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.zn.info(im+" ".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.zn.info(im+" ".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.zn.info(im+" ".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.zn.info(im+" ".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.zn.warn(im+" get cache failed ".concat(t," ").concat(a)),[3,13];case 13:return[2]}})})},t.prototype.readStoreDatas=function(t,i,e){return R_(this,void 0,void 0,function(){var n,s,r,o;return I_(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 I_(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.zn.info(im+" 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 R_(this,void 0,void 0,function(){var e;return I_(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.Dm.setItem(t,i)];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),this.zn.warn(im+" save "+JSON.stringify(e)),[3,3];case 3:return[2]}})})},t.prototype.getItem=function(t){return R_(this,void 0,void 0,function(){var i;return I_(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.Dm.getItem(t)];case 1:return[2,e.sent()];case 2:return i=e.sent(),this.zn.warn(im+" get "+JSON.stringify(i)),[3,3];case 3:return[2]}})})},t.prototype.removeItem=function(t){return R_(this,void 0,void 0,function(){var i;return I_(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.Dm.removeItem(t)];case 1:return e.sent(),this.zn.info(im+" removeItem ".concat(JSON.stringify(t))),[3,3];case 2:return i=e.sent(),this.zn.warn(im+" remove "+JSON.stringify(i)),[3,3];case 3:return[2]}})})},t.prototype.clearItems=function(t){return R_(this,void 0,void 0,function(){var i,e,n,s;return I_(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),this.zn.info(im+" call clearItems ".concat(t)),[4,this.Dm.keys()];case 1:i=r.sent(),this.zn.info(im+" clearItems store ".concat(JSON.stringify(i))),e=i.filter(function(i){return i.indexOf(t)>-1}),this.zn.info(im+" 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.zn.warn(im+" clear "+s.toString()),[3,7];case 7:return[2]}})})},t.prototype.checkItemsIsClear=function(t){return R_(this,void 0,void 0,function(){var i,e,n;return I_(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.zn.info(im+" checkIsClear call ".concat(t)),[4,this.Dm.keys()];case 1:return i=s.sent(),e=i.filter(function(i){return i.indexOf(t)>-1}),this.zn.info(im+" checkIsClear filters ".concat(JSON.stringify(e))),[2,e.length>0];case 2:return n=s.sent(),this.zn.warn(im+" checkIsClear err ".concat(JSON.stringify(n))),[2,!0];case 3:return[2]}})})},t.prototype.getUnReportCachedDatas=function(t){return R_(this,void 0,void 0,function(){var i,e,n;return I_(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.Dm)]):[3,3];case 2:e=s.sent(),s.label=3;case 3:return[2,e]}})})},t.prototype.filterItems=function(t){return R_(this,void 0,void 0,function(){var i,e;return I_(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.Dm.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.zn.warn(im+" 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.zn.info(im+" refresh old ".concat(t," ").concat(i," ").concat(e)),!localStorage)return[];var n=localStorage.getItem(t);if(!(null==n?void 0:n.length))return this.zn.info(im+" 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.zn.info(im+" 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 R_(this,void 0,void 0,function(){return I_(this,function(e){switch(e.label){case 0:return i===this.zm?[3,2]:(this.zn.info(im+" remove old store ".concat(i)),[4,this.dropInstance(i)]);case 1:return e.sent(),this.refreshOldStores(t,"2",i),[3,3];case 2:this.zn.info(im+" not remove old self"),e.label=3;case 3:return[2]}})})},t.prototype.setDeleteKey=function(t,i){this.zn.info(im+" 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.zn.info(im+" 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.zn.info(im+" get del keys ".concat(JSON.stringify(i))),i},t}(),C_=function(){function t(t){void 0===t&&(t=""),this.Am=t,this.count=0,this.isStarting=!1,this.timer=0,this.lastLogTime=0,this.speed=0,this.lastTime=0}return t.prototype.add=function(t){this.isStarting&&(this.count+=t)},t.prototype.stop=function(){return this.isStarting=!1,this.reset()},t.prototype.start=function(t){var i=this;void 0===t&&(t=0),this.isStarting=!0,this.count=0,clearInterval(this.timer),t&&(this.timer=window.setInterval(function(){i.speed=i.count/t,i.count=0},t))},t.prototype.reset=function(){this.count=0,clearInterval(this.timer),this.timer=0,this.speed=0},t}(),z_=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())})},D_=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 A_=Yh.logreport,P_=function(){function t(t,i,e){var n=this;this.zn=t,this.Dn=i,this.Uo=e,this.Pm=[],this.Mm=[],this.xm=0,this.jm=0,this.Lm=0,this.qm=[],this.Um=6e4,this.Bm=!1,this.Jm={},this.Vm=6e4,this.Hm=20,this.Gm=!1,this.beforeunloadListener=function(){n.zn.info("".concat(Vv," beforeunload")),n.Fm.resetStorageStores()},this.Fm=new N_(this.CacheKey,t,this),this.bindListener(),this.bindDestroyListener(),this.Ym=new C_("speed log")}return Object.defineProperty(t.prototype,"uploadCreateTime",{get:function(){return Math.round(this.jm/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this.Ym.speed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CacheKey",{get:function(){return"z_s_c2_"+this.Dn.appid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oldCacheKey",{get:function(){return"z_s_c_"+this.Dn.appid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"billingTimer",{get:function(){return this.Dn.streamCenter.billingTimer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPublishingStream",{get:function(){var t,i=this.Uo.publisherList,e=!1;for(var n in i)if(null===(t=i[n].publisher)||void 0===t?void 0:t.Fa){e=!0;break}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Zm",{get:function(){var t=this.Uo.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)&&[J.L3,J.RTC].includes(n.playMode)){i=!0;break}}return i},enumerable:!1,configurable:!0}),t.prototype.checkIfSupportNTP=function(){var t,i=null===(t=this.Dn.rtm)||void 0===t?void 0:t.getNetworkInfo().timestamp;i&&(this.zn.info("zc.sr.cisn use ntp. gap: "+(i-Date.now())),this.Gm=!0)},t.prototype.Qm=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.Qm();window.addEventListener(t,this.beforeunloadListener)},t.prototype.offListener=function(){var t=this.Qm();window.removeEventListener(t,this.beforeunloadListener)},t.prototype.bindDestroyListener=function(){var t=this;this.Dn.listenerList._engineDestroy.push(function(){t.zn.info("".concat(Vv," _engineDestroy")),t.Jm={},t.Fm.resetStorageStores(),t.offListener()})},t.prototype.updateQualityOrChargeInfo=function(t,i,e){var n;this.zn.info(Lv+" update info ".concat(t," ").concat(!!i));var s=this._now();!i||0!==this.Pm.length||0!==this.Mm.length||this.Xm&&0!==(null===(n=this.Xm)||void 0===n?void 0:n.infos.length)||(this.jm=s,this._saveSpeedLogHead(),0===this.xm&&(this.xm=s)),i&&(t==dt.publish_quality?this.handlePublishQualityData(i):t==dt.play_quality?this.handlePlayQualityData(i):t==dt.charge&&this.handleChargeInfoData(i));var r=this.Wm(),o=r>0,u=e&&o,a=r>8e3,c=0!==this.xm&&s-this.xm>this.Vm;(o&&c||a||u)&&(this.zn.info(Lv+" start upload fire ".concat(a,",").concat(c,",").concat(u)),this.streamQualityUpload(this.jm,u),this.Pm=[],this.Mm=[],this.resetCharges(),this.jm=0,this.xm=s,this.checkHasDataToReport())},t.prototype.Wm=function(){var t,i,e;if(this.Pm.length>0||this.Mm.length>0||(null===(i=null===(t=this.Xm)||void 0===t?void 0:t.infos)||void 0===i?void 0:i.length)>0){var n=this._getSpeedLogHead(),s={publish_quality_infos:this.Pm,play_quality_infos:this.Mm,network_type:mu(),client_type:2};return this.Xm&&(null===(e=this.Xm)||void 0===e?void 0:e.infos.length)>0&&(s.charge_infos=JSON.parse(JSON.stringify(this.Xm))),this._createStreamQualityPacket(n,s).byteLength}return 0},t.prototype.checkHasDataToReport=function(){this.zn.info(Hv+" call"),this.Uo.publishersLength||0!==Object.keys(this.Uo.playerList).length||!1!==this.billingTimer.isReporting||(this.zn.info(Hv+" no stream or charge to report"),this.xm=0),this.hasPublishingStream||this.Zm||this.billingTimer.shouldSampleCharge()||(this.zn.info(Hv+" no data to report"),this.xm=0)},t.prototype.streamQualityUpload=function(t,i){var e,n,s,r=(null===(n=null===(e=this.Xm)||void 0===e?void 0:e.infos)||void 0===n?void 0:n.length)>0;if(this.Uo.publishersLength>0||Object.keys(this.Uo.playerList).length>0||r||i){var o=this._getSpeedLogHead(),u={publish_quality_infos:this.Pm,play_quality_infos:this.Mm,network_type:mu(),client_type:2};if(this.Xm&&(null===(s=this.Xm)||void 0===s?void 0:s.infos.length)>0)this.Xm.timestamp_offset_begin===this.Xm.timestamp_offset_end&&0===this.Xm.timestamp_diff?this.zn.info(Lv+" no charge time"):(u.charge_infos=JSON.parse(JSON.stringify(this.Xm)),this.zn.info(Lv+" 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 ni(function(e,n){var s,r,o,u,a=!1,c=function(){var t;i.zn.info(Lv+" speed log socket open"),a=!0,i.Ym.start(3e3),i.Km&&e(i.Km),null===(t=i.Km)||void 0===t||t.removeEventListener("open",c)},h=function(){var t;i.zn.info(Lv+" speed log socket close"),a||n("not open, socket closed"),i.Ym.stop(),null===(t=i.Km)||void 0===t||t.removeEventListener("close",h)},f=function(){var t;i.zn.info(Lv+" speed log socket error"),a||n("not open, socket error"),null===(t=i.Km)||void 0===t||t.removeEventListener("error",f)},l=function(){!function(){var t;null===(t=i.Km)||void 0===t||t.addEventListener("open",c)}(),function(){var t,e;null===(t=i.Km)||void 0===t||t.addEventListener("close",h),null===(e=i.Km)||void 0===e||e.addEventListener("error",f)}()};if(i.Km&&2!=i.Km.readyState&&3!=i.Km.readyState)1==i.Km.readyState?(a=!0,e(i.Km)):l();else{var d=i.Dn.appid,v=i.Dn.idName,m=null===(s=i.Dn.roomList[0])||void 0===s?void 0:s.token;if(!d||!v||!m)return i.zn.error(Lv+" 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.zn.info(Lv+" stream url "+p.split("?")[0]),i.Km=(r=p,void 0===(u=1)&&(u=1),(o=ll.proxyCtrl)?o.createSocket(r,u):new WebSocket(r)),l()}setTimeout(function(){a||i.Dn.engineDestroy||n("not open, timeout, socket closed")},1e4)})},t.prototype._createStreamQualityPacket=function(t,i){var e=A_.SpeedLogHead.create(t),n=A_.QualityEvent.create(i),s=A_.SpeedLogHead.encode(e).finish(),r=A_.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.tp=function(t,i,e,n,s,r){var o=!1,u=!1;1!==t.readyState&&!u&&n&&n(),t.onmessage=function(i){(i.data+"").includes("success")?(!u&&e&&e(),o=!0):(!u&&n&&n(),o=!0),t.onmessage=null},this.Ym.add(8*i.length),t.send(i),setTimeout(function(){o||(s&&s(),u=!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.zn.url)||void 0===s?void 0:s.split("/")[2];if(o){if(this.checkNetworkIsAbnormal())return this.zn.warn(Gv+" ".concat(t," network is abnormal")),void this.saveReportPacketsToCache(t,i,e,n);r._getStreamReportSocket(o).then(function(s){if(r.Bm)return r.zn.warn(Gv+" ".concat(t," is sending")),void r.saveReportPacketsToCache(t,i,e,n);var o=Date.now()%1e4;r.Bm=!0;var u=r._createStreamQualityPacket(i,e);r.zn.info(Gv+" ".concat(t," send ").concat(o," ").concat(n," ").concat(null==u?void 0:u.byteLength)),r.tp(s,u,function(){return z_(r,void 0,void 0,function(){return D_(this,function(i){switch(i.label){case 0:return this.zn.info(Gv+" ".concat(t," send suc ").concat(o)),this.Bm=!1,this.delStreamData(t),n?[4,this.Fm.removeStoreFromStorage(n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.checkCachePacketsToReport(!0),[2]}})})},function(){r.zn.info(Gv+" ".concat(t," send error ").concat(o)),r.Bm=!1,r.retryReportPackets(t,i,e,n)},function(){r.zn.info(Gv+" ".concat(t," send timeout ").concat(o)),r.Bm=!1,r.retryReportPackets(t,i,e,n)},o)}).catch(function(s){"appid userid token not exist"!==s?(r.zn.info(Gv+" open socket error, retry upload quality event"),r.retryReportPackets(t,i,e,n)):r.zn.info(Gv+" stop retry upload quality event.")})}},t.prototype.retryReportPackets=function(t,i,e,n){this.zn.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.ep&&clearTimeout(this.ep),this.Um=t?5e3:6e4,this.ep=setTimeout(function(){var t=i.qm.shift();if(t){var e=t.timeStampKey,n=t._SpeedLogHead,s=t._QualityEvent,r=t.storeName;i.zn.info("zc.sr.ccptr"+" ".concat(e," ").concat(r)),i.sendPacketReportData(e,n,s,r)}else i.checkStorageDataToReport()},this.Um)},t.prototype.saveReportPacketsToCache=function(t,i,e,n){(this.zn.info(Fv+" call ".concat(t)),this.qm.length>=this.Hm)?this.zn.info(Fv+" ".concat(this.qm.length)):this.qm.find(function(i){return i.timeStampKey===t})||this.qm.push({timeStampKey:t,_SpeedLogHead:i,_QualityEvent:e,storeName:n})},t.prototype.checkStorageDataToReport=function(){return z_(this,void 0,void 0,function(){var t;return D_(this,function(i){switch(i.label){case 0:return[4,this.Fm.getUnReportCachedDatas(0===this.jm?"":this.jm+"")];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.Uo.getRoomByStreamID(t.stream_id),n=null===(i=this.Uo.publisherList[t.stream_id])||void 0===i?void 0:i.publisher;if(e&&n){var s=n.id,r=this.Pm.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.zn.info("".concat(Bv," stream_id: ").concat(t.stream_id,", ip: ").concat(r.ipv4," "))),t.ipv6&&(r.ipv6=t.ipv6,this.zn.info("".concat(Bv," stream_id: ").concat(t.stream_id," ip: ").concat(r.ipv6," "))),this.Pm.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.jm)/10)}),this.saveStreamInfo("publish",r)}else this.zn.info("".concat(Bv," room not exist. ").concat(!!e," "))},t.prototype.handlePlayQualityData=function(t){var i=this.Uo.getRoomByStreamID(t.stream_id),e=this.Uo.playerList[t.stream_id];if(e&&i){var n={l3:3,rtc:2,cdn:2}[e.playMode],s=e.id,r=this.Mm.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.zn.info("".concat(Uv," ").concat(t.stream_id," ip ").concat(r.ipv4," "))),t.ipv6&&(r.ipv6=t.ipv6,this.zn.info("".concat(Uv," ").concat(t.stream_id," ip ").concat(r.ipv6," "))),this.Mm.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.jm)/10),peer_to_peer_plr:t.peerToPeerPacketLostRate,peer_to_peer_delay:t.peerToPeerDelay}),this.saveStreamInfo("play",r)}else this.zn.info("".concat(Uv," player or room not exist. ").concat(!!e," ").concat(!!i," "))},t.prototype.handleChargeInfoData=function(t){var i,e;this.Xm||(this.Xm={room_id:"",timestamp_offset_begin:0,timestamp_offset_end:0,timestamp_diff_flag:0,timestamp_diff:0,infos:[]}),(null===(i=this.Dn.roomList[0])||void 0===i?void 0:i.roomID)&&(this.Xm.room_id=null===(e=this.Dn.roomList[0])||void 0===e?void 0:e.roomID);var n=this._now(),s=this.jm;this.zn.info("".concat(Jv," charge ").concat(n," ").concat(s," ").concat(JSON.stringify(t))),0===this.Xm.infos.length&&(this.Xm.timestamp_offset_begin=Math.round((n-s)/1e3),0!==this.Lm&&(this.Xm.timestamp_diff=Math.round((n-this.Lm)/1e3),this.Xm.timestamp_diff_flag=1,this.zn.info("".concat(Jv," charge time diff ").concat(this.Lm," ").concat(this.Xm.timestamp_diff)))),this.Lm=n,this.Xm.timestamp_offset_end=Math.round((n-s)/1e3),this.Xm.infos.push(t),this.saveChargeInfos(this.Xm)},t.prototype.supplementChargeTime=function(){0===this.Lm&&(this.Lm=this._now(),this.zn.info("".concat("zc.sr.sct.0"," charge time ").concat(this.Lm," ")))},t.prototype.resetCharges=function(){this.Xm&&(this.Xm={room_id:"",timestamp_offset_begin:0,timestamp_offset_end:0,timestamp_diff_flag:0,timestamp_diff:0,infos:[]})},t.prototype.resetChargeTime=function(){this.Lm=0},t.prototype.stopSampleCharge=function(){this.resetChargeTime(),this.checkHasDataToReport()},t.prototype._saveSpeedLogHead=function(){if(0!==this.jm){var t=this._getSpeedLogHead();this.Fm.saveItem(this.jm+"_head",t)}},t.prototype.saveStreamInfo=function(t,i){0!==this.jm&&this.Fm.saveItem("".concat(this.jm,"_").concat(t).concat(i.stream_id),i)},t.prototype.saveChargeInfos=function(t){0!==this.jm&&this.Fm.saveItem("qec_".concat(this.jm),t)},t.prototype.delStreamData=function(t){var i=this.qm.findIndex(function(i){return i.timeStampKey===t});i>-1&&(this.zn.info("".concat(Vv," del cache ").concat(i," ").concat(t)),this.qm.splice(i,1)),this.clearStoreItems(t+"")},t.prototype.clearStoreItems=function(t){var i=this;this.zn.info("".concat("zc.sr.csi.0"," clearStoreItems ").concat(t)),this.Fm.setDeleteKey("add",t),this.Fm.clearItems(t),setTimeout(function(){return z_(i,void 0,void 0,function(){return D_(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 z_(this,void 0,void 0,function(){var i,e=this;return D_(this,function(n){switch(n.label){case 0:return this.zn.info("".concat(Yv," call ").concat(t)),[4,this.Fm.checkItemsIsClear(t)];case 1:return i=n.sent(),this.Jm[t]?this.Jm[t]++:this.Jm[t]=1,i?(this.zn.info("".concat(Yv," count ").concat(t," ").concat(this.Jm[t])),this.Jm[t]&&this.Jm[t]<=5&&(this.Fm.clearItems(t),setTimeout(function(){return z_(e,void 0,void 0,function(){return D_(this,function(i){switch(i.label){case 0:return[4,this.checkClear(t)];case 1:return i.sent(),[2]}})})},1e3))):delete this.Jm[t],[2]}})})},t.prototype._getSpeedLogHead=function(i){return{version:20,timestamp:i||Math.round(this.jm/1e3),event:0,app_id:this.Dn.appid,user_id:this.Dn.idName,biz_type:1,time_offset:Jt.MAX_VALUE,os_type:Ih(),scenario:100===this.Dn.scenario?void 0:this.Dn.scenario,sdk_version:m,report_version:this.Dn.sdkVerNum,customer_context:t.reportCustomerContext}},t.prototype.checkStreamReport=function(){var t=this;this.zn.info("".concat(Vv," check un report call"));var i=this.Fm.getStoresFromStorage(),e=i[0],n=i[1];this.zn.info("".concat(Vv," 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.Fm.getCacheStoreData(n).then(function(i){t.zn.info("".concat(Vv," check un report ").concat(n," ").concat(null==i?void 0:i.length)),t.uploadUnReportDatas(i,n)}).catch(function(i){t.zn.info("".concat(Vv," 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.zn.info("".concat(Vv," old ").concat(e," check un report")),a.Fm.getCacheStoreData(e).then(function(i){t.zn.info("".concat(Vv," old check un report ").concat(e," ").concat(null==i?void 0:i.length)),t.uploadUnReportDatas(i,e)}).catch(function(i){t.zn.info("".concat(Vv," 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 z_(this,void 0,void 0,function(){var n=this;return D_(this,function(s){switch(s.label){case 0:return this.Dn.roomList.length<=0?(this.zn.warn(qv+" 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.zn.info("".concat(qv," cacheData publish ").concat(r," ").concat(JSON.stringify(u))),n.zn.info("".concat(qv," cacheData play ").concat(r," ").concat(JSON.stringify(a))),n.zn.info("".concat(qv," cacheData charge ").concat(r," ").concat(JSON.stringify(c))),n.zn.info("".concat(qv," cacheData ").concat(r," ").concat(n.Jm[r])),n.Jm[r])n.zn.info("".concat(qv," the data ").concat(r," report"));else{var h={publish_quality_infos:u,play_quality_infos:a,network_type:mu(),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.zn.info("".concat(qv," save ").concat(r," ").concat(i)),n.Fm.saveItem(r+"_head",o),u.forEach(function(t){n.Fm.saveItem("".concat(r,"_publish").concat(t.stream_id),t)}),a.forEach(function(t){n.Fm.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.Fm.saveItem("qec_".concat(r),c)),n.zn.info(Lv+" start upload cache quality. ".concat(r)),n.saveReportPacketsToCache(r,o,h)}}),i?(this.zn.info(Lv+" remove storage store ".concat(e," ").concat(i)),e?[4,this.Fm.removeOldStoreFromStorage(e,i)]:[3,2]):[3,4]):[3,5];case 1:return s.sent(),[3,4];case 2:return[4,this.Fm.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.Fm.getOldStores(this.oldCacheKey),e="zc.sqrw.rlcd.0";this.zn.info("".concat(e," old: ").concat(null==i?void 0:i.length));for(var n=function(n){var r=i[n];s.zn.info("".concat(e," old ").concat(r," check un report")),s.Fm.getCacheStoreData(r,s.oldCacheKey).then(function(i){t.zn.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.zn.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.Gm?this.Dn.rtm.getNetworkInfo().timestamp:Date.now(),1===t&&(i=Math.round(i/1e3)),i},t.prototype.checkNetworkIsAbnormal=function(){var t;return(null===(t=this.Dn.rtm)||void 0===t?void 0:t.isDisConnect())&&this.Dn.networkState==H.offline?(this.zn.warn(Zv+" offline. "),!0):!this.Uo.isNetAgentConnect()&&(this.zn.warn(Zv+" netAgent disconnect. "),!0)},t.prototype.resetReport=function(){var t=this;this.Pm=[],this.Mm=[],this.jm=0,this.xm=0,this.ep&&(clearTimeout(this.ep),this.ep=null),setTimeout(function(){t.Km&&(t.Km.close(),t.Km=void 0,t.Bm=!1,t.Ym.stop())},2e4)},t.reportCustomerContext=0,t}();function M_(){var t={},i=this,e=-10;function n(t){return/[^\x20-\x7E]+/.test(t)}var s={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(s,r){var o,u,a,c,h=t._loadMiniSdpToSdp,f=t.UTF8ToString,l=t._malloc,d=t.HEAPU8,v=t._free;i.postMessage({code:e,msg:"lmto call"});var m=l(s.length);i.postMessage({code:e,msg:"lmto malloc"}),d.set(s,m);var p=h(m,s.byteLength);i.postMessage({code:e,msg:"lmto s"});var g=f(p)||"";i.postMessage({code:e,msg:"lmto o "+g.length});for(var b=g.split("\r\n")||[],_=["ice-ufrag","ice-pwd","ice-options","fingerprint","setup","mid","extmap","sendrecv","sendonly","recvonly","inactive","rtpmap","rtcp-fb","fmtp","ssrc","candidate","msid"];b.length;){var y=b.length,w=null===(u=null===(o=b[y-1])||void 0===o?void 0:o.split("=")[1])||void 0===u?void 0:u.split(":")[0],S=b[y-1];if(-1!=(null===(a=b[y-1])||void 0===a?void 0:a.indexOf("="))&&_.includes(w)&&0!=(null===(c=b[y-1])||void 0===c?void 0:c.indexOf("="))&&!n(S))break;b.pop()}g=b.join("\r\n"),i.postMessage({code:0,data:g+="\r\n",eventId:r});try{v(m)}catch(t){i.postMessage({code:e,msg:"lmto free "+(null==t?void 0:t.message)})}}};onmessage=function(t){var n;s[t.data.command]?s[t.data.command](t.data.val,t.data.eventId):i.postMessage({code:e,msg:"om cmd invalid "+(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.command)})}}var x_,j_=o(8754).G,L_=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())})},q_=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])}}},U_=function(){function t(t){var i=this;this.zn=t,this.initOK=!1,this.np={},this.seq=1;var e=M_.toString().trim().match(/\{([\s\S]*)\}/)[1],n=URL.createObjectURL(new window.Blob([e],{type:"text/javascript"}));this.sp=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/xJ7m09mMqWeD8Q7x8TFlvs1jXDS63dnXSi6j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nQMXfZ9STyTGel0s7gMUF1hd4+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=j_.decompress(Array.from(s)),o=URL.createObjectURL(new window.Blob([r],{type:"text/javascript"}));this.sp.onmessage=function(t){var e=t.data;e.eventId&&Qt(i.np[e.eventId])?(i.np[e.eventId]({code:e.code,data:e.data}),delete i.np[e.eventId]):-10===(null==e?void 0:e.code)&&i.zn.info("zc.ms.0.w "+e.msg)},this.sp.onmessageerror=function(t){console.error("Error receiving message from worker: ".concat(t))},this.sp.onerror=function(t){i.initOK=!1,i.zn.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 ni(function(e){t.eventId="".concat(t.command,"_").concat(i.seq++),i.sp.postMessage(t),i.np[t.eventId]=function(t){e(t)}})},t.prototype.initWasm=function(t){return L_(this,void 0,void 0,function(){var i=this;return q_(this,function(e){return[2,new Promise(function(e,n){return L_(i,void 0,void 0,function(){var i;return q_(this,function(s){switch(s.label){case 0:return this.zn.info("zc.ms.0.c init"),[4,this.messageHandler({command:"init",val:t})];case 1:return 0===(i=s.sent()).code?e(!0):(this.zn.warn("zc.ms.0.c fail "+i.errMsg),n(!1)),[2]}})})})]})})},t.prototype.parseToMiniSdp=function(t){return L_(this,void 0,void 0,function(){var i=this;return q_(this,function(e){return[2,new ni(function(e,n){return L_(i,void 0,void 0,function(){var i,s;return q_(this,function(r){switch(r.label){case 0:return Ht(t)&&t?this.initOK?[4,this.messageHandler({command:"parseToMiniSdp",val:t})]:(n(ln),[2]):(n(xi),[2]);case 1:if(0===(i=r.sent()).code)e(i.data);else{switch(s=void 0,i.code){case-1:s=Le;break;case-2:s=qe;break;case-3:s=Ue}n(s)}return[2]}})})})]})})},t.prototype.loadMiniSdpToOriginSdp=function(t){return L_(this,void 0,void 0,function(){var i=this;return q_(this,function(e){return[2,new ni(function(e,n){return L_(i,void 0,void 0,function(){var i;return q_(this,function(s){switch(s.label){case 0:return Wt(t)?this.initOK?[4,this.messageHandler({command:"loadMiniSdpToOriginSdp",val:t})]:(n(ln),[2]):(n(xi),[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.sp.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"}(x_||(x_={}));var B_,J_=function(){function t(t,i){this.zn=t,this.Dn=i,this.rp=5e3,this.op=!1}return Object.defineProperty(t.prototype,"Uo",{get:function(){return this.Dn.streamCenter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"up",{get:function(){var t;return null===(t=this.Uo)||void 0===t?void 0:t.up},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ap",{get:function(){return Object.values(this.Uo.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.Uo.publisherList,e=!1;for(var n in i)if(null===(t=i[n].publisher)||void 0===t?void 0:t.Fa){e=!0;break}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPlayingRTCAndL3Stream",{get:function(){var t,i,e=this.Uo.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)&&[J.RTC,J.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.Uo||!!this.op&&(this.shouldReportRoomTime?0===(null===(t=this.Dn.rtm)||void 0===t?void 0:t.stateCenter.roomModulesList.filter(function(t){return!t.isLogout()||!t.isDisConnect()}).length):0===(null===(i=this.Dn.appConfig.speedlog_config)||void 0===i?void 0:i.charge_info_report_mode)?0===this.Uo.publishersLength:0===this.ap)},enumerable:!1,configurable:!0}),t.prototype.report=function(t){var i,e,n;if(void 0===t&&(t=!1),this.zn.info("zc.bill.tm.r.0 call"),this.Uo){if(t)return this.zn.info("zc.bill.tm.r.0 stop"),void(null===(i=this.up)||void 0===i||i.updateQualityOrChargeInfo(dt.charge,void 0,!0));if(!this.shouldSampleCharge())return this.zn.info("zc.bill.tm.r.0 not sample charge"),null===(e=this.up)||void 0===e||e.updateQualityOrChargeInfo(dt.charge,void 0),void this.up.resetChargeTime();var s=this.samplingChargeInfos();null===(n=this.up)||void 0===n||n.updateQualityOrChargeInfo(dt.charge,s)}else this.zn.info("zc.bill.tm.r.0 no stream center")},t.prototype.shouldStartReportCharge=function(){if(!this.Dn.appConfig)return this.zn.info("zc.bill.ssrc.0 no app config"),!1;var t=this.Dn.appConfig.speedlog_config.charge_info_report_cycle;return this.zn.info("zc.bill.ssrc.0 speedlog config ".concat(JSON.stringify(this.Dn.appConfig.speedlog_config))),!(!Vt(t)||0===t)&&(this.rp=1e3*t,!0)},t.prototype.shouldSampleCharge=function(){var t,i=this;if(!this.Dn.appConfig)return this.zn.info("zc.bill.ssc.0 no app config"),!1;var e=this.Dn.appConfig.speedlog_config,n=e.charge_info_report_mode,s=e.charge_info_report_no_playing,r=!1,o=null===(t=this.Dn.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.ap)&&(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.Dn.rtm)||void 0===t?void 0:t.stateCenter.appConfig)||!(null===(i=this.Dn.rtm)||void 0===i?void 0:i.stateCenter.appConfig.speedlog_config)||0===(null===(e=this.Dn.rtm)||void 0===e?void 0:e.stateCenter.appConfig.speedlog_config.charge_info_report_cycle)||1!==(null===(n=this.Dn.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.op},enumerable:!1,configurable:!0}),t.prototype.startChargeInfoTimer=function(){var t=this;if(this.cp&&(clearTimeout(Number(this.cp)),this.cp=null,this.shouldEndSampleCharge))return this.zn.info(x_.START_CHARGE_INFO_TIMER+" chargeinfos timer report ended"),void(this.op=!1);this.cp=setTimeout(function(){t.report(),t.startChargeInfoTimer()},this.rp)},t.prototype.supplementPlayingChargeTime=function(){this.op&&this.up.supplementChargeTime()},t.prototype.startChargeInfosUpload=function(){this.shouldStartReportCharge()&&(this.op||(this.op=!0,this.shouldReportRoomTime&&this.report(),this.startChargeInfoTimer(),this.zn.info("zsc.sciu.0 call")))},t.prototype.stopChargeInfosUpload=function(){this.zn.info("zsc.sciu.1 call"),this.cp&&this.shouldEndSampleCharge&&(this.zn.info("zsc.sciu.1 stop"),clearTimeout(Number(this.cp)),this.cp=null,this.shouldReportRoomTime&&this.report(!0),this.op=!1,this.up.stopSampleCharge(),this.zn.info("zsc.sciu.1 chargeinfos timer report ended"))},t.prototype.destroy=function(){this.zn.info("zsc.ds.0 call"),this.cp&&(clearTimeout(Number(this.cp)),this.cp=null),this.op=!1},t.prototype.samplingChargeInfos=function(){var t,i;this.zn.info("zsc.cci.0 call");var e={is_publishing:0,no_playing:0},n=this.Uo,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||![J.RTC,J.L3].includes(i.playMode))return"continue";i.playMode===J.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===J.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.md.frameWidth,height:i.qualityHandler.md.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===J.L3,o=t===J.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.md.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}(),V_=function(){function t(){this.hp={},this.fp=500}return t.prototype.isTrackStopBySDK=function(t){return void 0!==this.hp[t.id]&&performance.now()-this.hp[t.id]<=this.fp},t.prototype.recordStopTrack=function(t){t&&(this.hp[t.id]=performance.now())},t}(),H_=function(){function t(t){this.zn=t,this.lp=new V_}return t.prototype.isTrackStopBySDK=function(t){return this.lp.isTrackStopBySDK(t)},t.prototype.stopTrack=function(t){t&&(this.zn.info("zc.tk.ut track "+t.id+" stop"),this.lp.recordStopTrack(t),t.stop())},t}();function G_(){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=new Uint8Array([0,0,0,1,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,30,186,2,64,0,0,0,1,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,30,160,136,69,150,233,111,11,128,64,0,0,3,0,64,0,0,3,3,194,0,0,0,1,68,1,192,115,192,137]),r=new Uint8Array([0,0,0,1,40,1,172,26,224,244,133,49,47,246,227,105,128]),o={},u={},a={},c={},h=function(){function t(t,i){void 0===i&&(i=!1),this.view=t,this.isH265=i,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)if(this.isH265){if(39!==(126&this.view.getUint8(this.nalu_start+this.start_code_size))>>1)return!0}else if(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 f(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 l(t){return Uint8Array.from(Array.from(unescape(encodeURIComponent(t))).map(function(t){return t.charCodeAt(0)}))}function d(t){var i=0,e=0;return i=t[e++]<<24,i|=t[e++]<<16,i|=t[e++]<<8,i|=t[e++]}function v(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 m(a,c,m,p,g){var b=void 0,_=g[p],y=_.isLowStream,w=_.kind,S=_.vCodec;if(w=w||"video",y=y||!1,"encode"===a?b=function(t,i){"audio"===w?i.enqueue(t):_.onlyAudio?function(t,i,u,a,c){var h,f,l,d=o[u];if(d){var m=a?d.lowStreamSideInfos:d.sideInfos,p=0,g="key"===t.type,b=performance.now(),_=!1,y=null===(f=null===(h=t.getMetadata)||void 0===h?void 0:h.call(t))||void 0===f?void 0:f.mimeType;_=y?null!==(l=null==y?void 0:y.includes("H265"))&&void 0!==l&&l:"H265"===c;var w=0,S=[];if(m.length>0){for(var E=m.length>=9?9:m.length,O=0;O<E;O++){var T=v(m[O],d.type,d.emulationPreventionByte);w+=4+(_?2:1)+(P=T.ebspLength),S.push(T)}a?d.lowStreamSideInfos=[]:d.sideInfos=[],b-d.recvLastKeyFrameTime>2e3&&(g=!0)}_&&!g&&b-d.recvLastKeyFrameTime>2e3&&(g=!0),g&&(p=_?s.length+r.length:n.length+e.length);var k=new ArrayBuffer(w+p),R=new DataView(k),I=0;if(g)if(_){var N=new DataView(s.buffer);for(z=0;z<s.length;z++)R.setInt8(I++,N.getInt8(z))}else for(var C=new DataView(n.buffer),z=0;z<n.length;z++)R.setInt8(I++,C.getInt8(z));for(O=0;O<S.length;O++){var D=S[O],A=D.rbspView,P=D.ebspLength;R.setUint8(I++,0),R.setUint8(I++,0),R.setUint8(I++,0),R.setUint8(I++,1),_?(R.setUint8(I++,78),R.setUint8(I++,1)):R.setUint8(I++,6);for(var M=0;M<P;M++)R.setInt8(I++,A[M-0])}if(g)if(_){var x=new DataView(r.buffer);for(z=0;z<r.length;z++)R.setInt8(I++,x.getInt8(z))}else{var j=new DataView(e.buffer);for(z=0;z<e.length;z++)R.setInt8(I++,j.getInt8(z))}t.data=k,g&&(d.recvLastKeyFrameTime=b),i.enqueue(t)}else i.enqueue(t)}(t,i,p,y,S):function(t,i,e,n,s){var r,u,a,c=o[e];if(c){var f=n?c.lowStreamSideInfos:c.sideInfos;if(f.length>0){var l=!1,d=null===(u=null===(r=t.getMetadata)||void 0===r?void 0:r.call(t))||void 0===u?void 0:u.mimeType;l=d?null!==(a=null==d?void 0:d.includes("H265"))&&void 0!==a&&a:"H265"===s;for(var m=new DataView(t.data),p=[],g=0,b=0;b<f.length;b++){var _=v(f[b],c.type,c.emulationPreventionByte);g+=4+(l?2:1)+(M=_.ebspLength),p.push(_)}n?c.lowStreamSideInfos=[]:c.sideInfos=[];for(var y=new ArrayBuffer(g+t.data.byteLength),w=new DataView(y),S=0,E=new h(m,l),O=0,T=!1,k=!1,R=!1,I=0;E.NextNalu();)if(I++,l){if(32==(N=(126&m.getUint8(E.nalu_start+E.start_code_size))>>1))T=!0,O+=E.nalu_size;else if(33==N)k=!0,O+=E.nalu_size;else if(34==N)R=!0,O+=E.nalu_size;else if(35==N)continue;if(T&&k&&R)break}else{var N;if(7==(N=31&m.getUint8(E.nalu_start+E.start_code_size)))k=!0,O+=E.nalu_size;else if(8==N)R=!0,O+=E.nalu_size;else if(9==N)continue;if(k&&R)break}for(var C=0;C<O;C++)w.setInt8(S++,m.getInt8(C));var z=10-I,D=p.length>=(z=z>0?z:0)?z:p.length;for(b=0;b<D;b++){var A=p[b],P=A.rbspView,M=A.ebspLength;w.setUint8(S++,0),w.setUint8(S++,0),w.setUint8(S++,0),w.setUint8(S++,1),l?(w.setUint8(S++,78),w.setUint8(S++,1)):w.setUint8(S++,6);for(var x=0;x<M;x++)w.setInt8(S++,P[x-0])}for(C=O;C<t.data.byteLength;C++)w.setInt8(S++,m.getInt8(C));new Uint8Array(y),t.data=y}i.enqueue(t)}else i.enqueue(t)}(t,i,p,y,S)}:"decode"===a&&(b=function(e,n){"audio"===w?n.enqueue(e):function(e,n,s){var r,o,a,c=u[s],v=c&&"VP8"!==c.codec,m=!1,p=null===(o=null===(r=e.getMetadata)||void 0===r?void 0:r.call(e))||void 0===o?void 0:o.mimeType;if(m=p?null!==(a=null==p?void 0:p.includes("H265"))&&void 0!==a&&a:"H265"===c.codec,v){var g=c.firstFrame;if(g){if(g.buffer)if(e.timestamp-g.time<20){var b=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),g.buffer);b&&(v=!1)}else g.buffer=void 0}else c.firstFrame={buffer:new Uint8Array(e.data).slice(0),time:e.timestamp}}if(v){for(var _=new DataView(e.data),y=0,w=new h(_,m),S=0,E=!1;w.NextNalu(E);){if(m){if(32==(S=(126&_.getUint8(w.nalu_start+w.start_code_size))>>1)||33==S||34==S||35==S)continue;if(39!=S)break}else{if(7==(S=31&_.getUint8(w.nalu_start+w.start_code_size))||8==S||9==S)continue;if(6!=S)break}var O=new Uint8Array(e.data).slice(w.nalu_start+w.start_code_size,w.nalu_start+w.start_code_size+w.nalu_size);c.emulationPreventionByte&&(O=f(O).output),y=m?2:1,E=!0;for(var T=0;255===O[y];)T+=255,y++;if((T+=O[y++])===i||5===T||100===T){for(var k=0;255===O[y];)k+=255,y++;if(k+=O[y++],e.data.byteLength-y<k)break;var R=new Uint8Array(4+k);switch(R[0]=0,R[1]=0,T){case 100:R[2]=3,R[3]=235;break;case 5:R[2]=3,R[3]=236;break;case i:R[2]=3,R[3]=237}for(var I=0;I<k;I++)R[4+I-0]=O[y++];var N=!1;if(T===i)N=!0;else if(5===T){var C=c.unregisterSeiFilter;if(C){var z=R.slice(4,4+c.filterSize),D=void 0,A=!0;if(0===(D="string"==typeof C?l(C):C).length)A=!1;else for(var P=0;P<D.length;P++)if(D[P]!==z[P]){A=!1;break}N=A}else N=!0}N&&t.postMessage({cmd:"recvSEI",streamID:s,buffer:Array.from(R)})}else if(244===T){for(k=0;255===O[y];)k+=255,y++;if(k+=O[y++],e.data.byteLength-y<k)break;var M=parseInt(k/5+""),x=O.slice(y,y+=k),j=[];for(P=0;P<M;P++){var L=5*P,q=x.slice(L,L+4),U=x.slice(L+4,L+5),B=d(q);j.push({soundLevelID:B,value:U[0]})}t.postMessage({cmd:"mixSoundLevel",soundLevelList:j,streamID:c.streamID})}}n.enqueue(e)}else n.enqueue(e)}(e,n,p)}),b){var E=new TransformStream({transform:b});c.pipeThrough(E).pipeTo(m)}}function p(t){var i=o[t];return i||(o[t]={streamID:t,sideInfos:[],lowStreamSideInfos:[],type:243,emulationPreventionByte:!1,recvLastKeyFrameTime:0},o[t])}function g(t){var i=u[t];return i||(u[t]={streamID:t,emulationPreventionByte:!1,codec:"",unregisterSeiFilter:"",filterSize:0},u[t])}function b(t){var i=t.cmd;if("encode"===i){var e=t.readable,n=t.writable,s=t.streamID,r=t.type,o=t.isLowStream,u=t.emulationPreventionByte,h=t.onlyAudio,f=t.vCodec;if("audio"!==(d=t.kind)){var l=p(s);l.type=r,l.emulationPreventionByte=u}a[s]={isLowStream:o,kind:d,onlyAudio:h,vCodec:f},m(i,e,n,s,a)}else if("decode"===i){e=t.readable,n=t.writable,s=t.streamID,u=t.emulationPreventionByte;var d,v=t.codec,b=t.unregisterSeiFilter,_=t.filterSize;if("audio"!==(d=t.kind)){var y=g(s);y.emulationPreventionByte=u,y.codec=v,y.unregisterSeiFilter=b,y.filterSize=_}c[s]={isLowStream:!1,kind:d},m(i,e,n,s,c)}}onmessage=function(i){var e=i.data,n=e.cmd;try{switch(n){case"encode":case"decode":b(e);break;case"updatePlayer":var s=e.codec;g(v=e.streamID).codec=s;break;case"pushSideInfo":var r=e.buffer,h=e.hasLowStream,f=e.maxLength,l=p(v=e.streamID);l.sideInfos.length>f?console.error("Send SEI Failed. The number of inserted sei exceeds the limit."):(l.sideInfos.push(r),h&&l.lowStreamSideInfos.push(r));break;case"publishStreamType":var d=a[v=e.streamID];d&&(d.onlyAudio=e.onlyAudio);break;case"clear":var v=e.streamID;"push"==e.type?(delete o[v],delete a[v]):(delete c[v],delete u[v])}}catch(i){t.postMessage({cmd:"error",error:i})}},t.RTCTransformEvent&&(t.onrtctransform=function(t){var i=t.transformer;b(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"}(B_||(B_={}));var F_={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)},Z_=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())})},Q_=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])}}},X_=["LoginReq","CreateSessionWithSdpReq","CreateSessionReq"],W_=["Peer2PeerNetStatsGetReq","Peer2PeerNetStatsGetRsp","CmdRsp"];var K_,$_=Yh.webrtc_proto_v2,ty=Yh.webrtc_cmd,iy=Yh.generalpclib,ey=function(){function t(t,i,e,n){this.dp=t,this.zn=i,this.Dn=e,this.vp=n,this.mp=new Tm,this.Ch={},this.zh=new ut,this.pr=100,this.Ah={},this.pp={},this.Dh=5e3,this.gr=1e4,this.Hr=null,this.br=2e3,this.gp=null,this.bp=6e3,this._p=!0,this.yp={},this.wp=["ActivateVideoPlayStreamReq","ActivateAudioPlayStreamReq","CreateSessionReq","CreateSessionWithSdpReq","ActivateSEIInsertReq","StreamStatusNotify"],this.kr=S,this.Sp=Pt.LOGOUT,this.Ep=0,this.Op=void 0,this.unCheckCmds=["LoginReq","CreateSessionReq","CreateSessionWithSdpReq"];var s=t===hy;this.Tp=s?"zc.wcss.0":"zc.wcss.1";this.kp=n.getPCRequest(s?bu.BusinessService.SERVICE_WEBRTC_SIGNAL:bu.BusinessService.SERVICE_L3_WEBRTC_SIGNAL,{path:"wsv2",query:"",encode:!1,messageType:2,isMsgCache:!1}),this.Rp()}return Object.defineProperty(t.prototype,"isUaConnected",{get:function(){return this.vp.isConnect()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.kr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mediaState",{get:function(){return this.Sp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"token",{get:function(){return this.Ip},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenType",{get:function(){return this.Ep},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"server",{get:function(){return this.dp},enumerable:!1,configurable:!0}),t.prototype.Rp=function(){var t,i=this;this.vp.on("connected",function(){i.zn.info("".concat(i.Tp," netAgent connected ").concat(i.kr)),i.kr===E&&i.loginCenterSvr(),i.mp.emit("uaConnected")}),this.vp.on("disconnected",function(){i.zn.info("".concat(i.Tp," netAgent disconnected"))}),this.vp.on("broken",function(t){i.zn.info("".concat(i.Tp," netAgent broken ").concat(t))}),this.kp.on("connected",function(t){i.zn.info("".concat(i.Tp," pc connected ").concat(bu.ConnectedType[t])),i.kr=O,t===bu.ConnectedType.AUTO&&i.loginCenterSvr()}),this.kp.on("disconnected",function(t,e){i.zn.info("".concat(i.Tp," pc disconnected ").concat(bu.DisconnectedType[t],", ua connect: ").concat(i.isUaConnected,", signal ").concat(i._p?"closed":"connect")),i.kr=S,i.Sp=Pt.LOGOUT,i._p||(i.isUaConnected?i.loginCenterSvr():i.kr=E)}),this.kp.on("broken",function(){i.zn.info("".concat(i.Tp," pc broken")),i.kr=E,i.Sp=Pt.LOGOUT}),this.kp.on("downLoadMessage",function(t,e){i.handleWsMessage({data:t,extras:e})}),null===(t=this.kp)||void 0===t||t.on("exception",function(t,e){i.zn.info("".concat(i.Tp," pc exception ").concat(JSON.stringify(t)))}),this.kp.off("pcBrokenEvent"),this.kp.on("pcBrokenEvent",function(t){var e=Jr,n=i.Ln.createSpan(a.H,{key:jr},{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.kp.off("pcDisconnectedEvent"),this.kp.on("pcDisconnectedEvent",function(t){var e=Vr,n=i.Ln.createSpan(a.H,{key:jr},{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.kp.off("pcConnectedEvent"),this.kp.on("pcConnectedEvent",function(t){var e=Br,n=i.Ln.createSpan(a.H,{key:jr},{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.zn.info("".concat(this.Tp," set session info")),this.Np=t+"",this.Cp=i},t.prototype.onReconnected=function(t){},t.prototype.onNeedRetry=function(t,i){},Object.defineProperty(t.prototype,"Xl",{get:function(){var t,i,e;if(this.Dn.appConfig){var n=this.Dn.appConfig.media_config.publish_config.resource_info.find(function(t){return t.resource_type===L.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===y.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.gs=t||(null===(n=this.Dn.roomList[0])||void 0===n?void 0:n.roomID),this.Ip=i||(null===(s=this.Dn.roomList[0])||void 0===s?void 0:s.token),this.zn.info("".concat(this.Tp," start connect server, roomID: ").concat(this.gs)),this.zn.remoteReport("".concat(this.Tp," token: ").concat(this.Ip)),this.Ep=0,this._p=!1,this.Op=e,this.Sp===Pt.LOGOUT){if(!this.Dn.appConfig)return void this.zn.info("".concat(this.Tp," no app config"));if(!this.Xl)return void(e&&e(this.dp,qi.code));this.app=this.Xl,this.isUaConnected?this.loginCenterSvr():(this.kr=E,this.zn.info("".concat(this.Tp," ua is not connected")))}else this.zn.info("".concat(this.Tp,this.Sp===Pt.TRY_LOGIN?" server is connecting":" server is connected"))},t.prototype.disconnectServer=function(){this.zn.info("".concat(this.Tp," disconnect server")),this.disconnectPcRequest(),this.resetCheckMessage(),this.resetLoginTimer(),this.kr=S,this.Sp=Pt.LOGOUT,this.Op=void 0,this.Ip="",this.pp={},this.Ep=0},t.prototype.disconnectPcRequest=function(){this.zn.info("".concat(this.Tp," disconnect pc link ").concat(this._p)),this._p||(this._p=!0,this.kp.closeRequest())},t.prototype.resetLoginTimer=function(){this.zn.info("".concat(this.Tp," reset login timer")),clearTimeout(this.gp),this.gp=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=F_[e.header.cmd],li(e.body),n={header:Y_(Y_({},e.header),{appid:this.Np,user_id:this.Cp}),body:e.body};return n}this.zn.error("".concat(this.Tp," 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.Np&&e.header.user_id===this.Cp?(W_.includes(e.header.cmd)||this.zn.info("".concat(this.Tp," signmsg=").concat(e.header.cmd," ").concat(null===(i=e.header)||void 0===i?void 0:i.seq)),this.handleServerPush(e)):this.zn.error("".concat(this.Tp," check header failed"))},t.prototype.resetCheckMessage=function(){var t;this.zn.info("".concat(this.Tp," reset check msg")),clearTimeout(this.Hr),this.Hr=null;for(var i=this.zh.getFirst();null!=i;)this.zh.remove(i),(null===(t=i._data)||void 0===t?void 0:t.error)&&i._data.error(2,i._data.seq),i=this.zh.getFirst();this.Ch={}},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,Mt.PUSH),this.removeSession(t.header.session_id);break;case"StreamStatusNotifyPush":this.sendStreamStatusNotifyAck(t.header.seq,t.header.session_id,0),this.handleMsgWithSession(t,Mt.PUSH);break;case"PublishEventPush":case"PlayEventPush":case"CmdPush":this.handleMsgWithSession(t,Mt.PUSH);break;case"ClientInfoPush":this.sendClientInfoAck(t.header.seq,t.header.session_id,0),this.handleMsgWithSession(t,Mt.PUSH);break;case"NetQualityInfoPush":this.sendNetQualityInfoPushAck(t.header.seq,t.header.session_id,t.body.peer_id,0),this.handleMsgWithSession(t,Mt.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,Mt.RSP)}},t.prototype.registerPeerCallback=function(t,i){this.yp[t]=i},t.prototype.unregisterPeerCallback=function(t){delete this.yp[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.yp[null===(n=null==t?void 0:t.header)||void 0===n?void 0:n.session_id];s&&s(t,i)}else this.zn.error("".concat(this.Tp," rsp no session ").concat(t.header.cmd))},t.prototype.loginCenterSvr=function(){var t=this;if(this.app){var i=[];if(0!=Object.keys(this.pp).length)for(var e in this.pp){var n=parseInt(e);i.push({session_id:n,session_token:this.pp[n].token})}var s=this.Ip,r=Si(this.Ln,a.H,this.Cp,Ur,wn),o={appid:this.Dn.appid,user_id:this.Dn.idName,token:s,tokenType:this.Ep,sessions:i,roomid:this.gs,sdk_version:this.Dn.sdkVerNum,app:this.app,net_mode:this.Dn.netMode};this.zn.info("".concat(this.Tp," LoginReq ").concat(JSON.stringify(Y_(Y_({},o),{token:void 0})))),this.zn.remoteReport("".concat(this.Tp," LoginReq token ").concat(this.Ip));var u="LoginReq",c=this.encodePBBody(u,o);this.Sp=Pt.TRY_LOGIN,this.sendMessageWithCallback(u,this.Dn.getSeq(),0,c,function(i,e,n){t.resetLoginTimer(),Ei(r,{result:n.result,seq:i}),0==n.result?(t.Sp=Pt.LOGIN,t.Ip=n.token,t.Ep=n.tokenType,t.zn.info("".concat(t.Tp," LoginReq suc, callback ").concat(!!t.Op)),t.zn.remoteReport("".concat(t.Tp," LoginRsp token ").concat(n.token)),null!=t.Op?(t.Op(t.dp,0),t.Op=void 0):t.onReconnected(t.dp),t.checkMessageTimeout()):(t.zn.warn("".concat(t.Tp," LoginReq fail, result: ").concat(n.result," callback ").concat(!!t.Op)),t.disconnectPcRequest(),t.Sp=Pt.LOGOUT,null!=t.Op?(t.Op(t.dp,n.result),t.resetCallback(n.result)):t.onNeedRetry(t.dp,n.result))},function(i,e){t.resetLoginTimer(),t.Sp=Pt.LOGOUT;var n="LoginReq fail, callback ".concat(!!t.Op,", is signal closed ").concat(t._p,". code: ").concat(i);t.zn.info("".concat(t.Tp," ").concat(n)),r.setAttribute("seq",e),t.Ln.setError(r,{code:i,msg:n},n),null==t.Op||t._p||(t.Op(t.dp,i=null!=i?i:-1),t.resetCallback(i))}),this.resetLoginTimer(),this.gp=setTimeout(function(){t.zn.info("".concat(t.Tp," login timer triggered, callback ").concat(!!t.Op)),t.Sp=Pt.LOGOUT,null!=t.Op?(t.Op(t.dp,-1),t.resetCallback(-1)):t.onNeedRetry(t.dp,-1)},this.bp)}else this.zn.info("".concat(this.Tp," no config for login"))},t.prototype.resetCallback=function(t){this.zp(t)&&(this.Op=void 0)},t.prototype.zp=function(t){return!![qi.code,20010,1008].includes(t)},t.prototype.sendMessageWithCallback=function(t,i,e,n,s,r){var o=this;void 0===s&&(s=null),void 0===r&&(r=null),W_.includes(t)||this.zn.info("".concat(this.Tp," send callback ").concat(t,", seq: ").concat(i," ").concat(this.kr));var u=performance.now();if(!this.unCheckCmds.includes(t)&&this.kr!==O)return this.zn.error("".concat(this.Tp," 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(X_.includes(t)){var r=(performance.now()-u).toFixed(0);o.zn.info("".concat(o.Tp," 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.zh.push(a);this.Ch[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.kp.sendRequest({payload:f,ack:l,isInSendMap:d},function(t){o.zn.info("".concat(o.Tp," send callback fail ").concat(JSON.stringify(t))),t.code&&r&&r(t.code,i)},function(t){o.zn.info("".concat(o.Tp," send callback ack"))})},t.prototype.sendMessage=function(t,i,e,n,s){if(void 0===s&&(s=!0),this.Sp===Pt.LOGIN){var r=this.getHeader(t,i,e),o=this.encodePBMsg(r,n);this.kp.sendRequest({payload:o})}else this.zn.error("".concat(this.Tp," send ").concat(t," connect not establish ").concat(Pt[this.Sp]))},t.prototype.getHeader=function(t,i,e){return this.headerData({version:"1.0.1",cmd:t,appid:this.Np+"",seq:i,user_id:this.Cp,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.zn.info("".concat(this.Tp," params ").concat(JSON.stringify(t))),ty.WebrtcCmdReqMsg.encode({peer_extend_param:t}).finish()},t.prototype.decodeParamsExt=function(t){return ty.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:Ht(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.Dn.isMultiRoom&&(l.roomid=a),this.zn.info("".concat(this.Tp," 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=Cm(this.zn,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:Ht(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.Dn.isMultiRoom&&(O.roomid=m),y.info("".concat(this.Tp," 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 Z_(s,void 0,void 0,function(){return Q_(this,function(s){return n.params_ext&&(n.params_ext=this.decodeParamsExt(n.params_ext),li(n.params_ext)),y.info("".concat(this.Tp," rsp ").concat(JSON.stringify(Y_(Y_({},n),{sdp:void 0,session_token:void 0})))),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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," media desc ").concat(JSON.stringify(r)));var o=this.encodePBBody("MediaDescReq",r);this.sendMessage("MediaDescReq",t,i,o)},t.prototype.removeSession=function(t){this.zn.info("".concat(this.Tp," remove session ").concat(t)),this.pp[t]&&delete this.pp[t]},t.prototype.sendCloseSession=function(t,i,e){var n="CloseSessionReq",s={reason:e},r=this.encodePBBody(n,s);this.zn.info("".concat(this.Tp," 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.zn.debug("".concat(this.Tp," rsp data"));var n=this.Ch[e];if(null!=n){delete this.Ch[e],this.zh.remove(n);var s=n._data;(null==s?void 0:s.cmd)!==t?this.zn.error("".concat(this.Tp," command is not match")):s.success&&s.success(e,i.header.session_id,i.body)}else{if("CloseSessionRsp"==i.header.cmd||W_.includes(t))return;this.zn.error("".concat(this.Tp," cannot find data ").concat(t," ").concat(e))}},t.prototype.addSession=function(t,i){this.zn.info("".concat(this.Tp," add session ").concat(t)),this.pp[t]={token:i}},t.prototype.handlePushData=function(t){this.zn.info("".concat(this.Tp," push data, cmd: ").concat(t.header.cmd,", session: ").concat(t.header.session_id));var i=this.Ah[t.header.cmd+t.header.session_id];i?i.callback&&i.callback(t.header.seq,t.header.session_id,t.body):this.zn.warn("".concat(this.Tp," no callbackData, cmd: ").concat(t.header.cmd,", session: ").concat(t.header.session_id))},t.prototype.handlePushResetSessionData=function(t){this.zn.info("".concat(this.Tp," push reset session"));var i=[];if(0==t.body.cResetType)i=Object.keys(this.pp);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.Ah[t.header.cmd+i[n]];null==s?this.zn.info("".concat(this.Tp," no callbackData ").concat(i[n])):s.callback&&s.callback(t.header.seq,i[n],t.body)}else this.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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&&Qt(e)&&(this.zn.info("".concat(this.Tp," set callback, session: ").concat(i,", ").concat(t)),this.Ah[t+i]={callback:e})},t.prototype.unregisterPushCallback=function(t,i){delete this.Ah[t+i]},t.prototype.checkMessageTimeout=function(){for(var t,i,e=this,n=this.zh.getFirst(),s=(new Date).getTime(),r=0,o=0,u=0;null!=n&&n._data&&!(n._data.sendTime+this.Dh>s);)if(delete this.Ch[n._data.seq],this.zh.remove(n),++o,n._data.cmd&&-1==this.wp.indexOf(n._data.cmd))n=this.zh.getFirst();else{if(null==n._data.error||this.gr>0&&n._data.sendTime+this.gr<s?++u:(this.zn.warn(xd+" 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)),Qt(n._data.error)&&n._data.error(1,n._data.seq)),++r>=this.pr)break;n=this.zh.getFirst()}this.Hr=setTimeout(function(){e.checkMessageTimeout()},this.br),0==o&&0==u||this.zn.info(xd+" 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};Cm(this.zn,s).info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.zn.info("".concat(this.Tp," 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.Dn.getSeq(),t,r,!1)},t.prototype.on=function(t,i){this.mp.addEventHandler(t,i)},t.prototype.off=function(t,i){this.mp.removeEventHandler(t,i)},t.prototype.headerData=function(t){var i=B_[t.cmd];if(void 0!==i){var e=$_.Head.create({cmd:i,seq:t.seq,session_id:t.session_id});return $_.Head.encode(e).finish()}this.zn.error("".concat(this.Tp," 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=iy.Header.create({cmd:e?100:101}),r=iy.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=$_[t].create(i);return $_[t].encode(e).finish()},t.prototype.decodePBBody=function(t,i){var e=F_[t.cmd];if(e)return $_[e].decode(i);this.zn.error("".concat(this.Tp," 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=iy.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=$_.Head.decode(r.slice(7,7+u)),c=r.slice(7+u);return{header:a,body:this.decodePBBody(a,c)}}this.zn.error("".concat(this.Tp," webrtc tag error ").concat(o))}else this.zn.error("".concat(this.Tp," cmd error ").concat(s.cmd))}else this.zn.error("".concat(this.Tp," type error ").concat(e))},t}(),ny=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)}}(),sy=function(t){function i(i,e){var n=t.call(this)||this;return n.Dp=i,n.zn=e,n.retryActiveCount=1,n.RETRY_MAX_TIME=90,n.Ap=.3,n.Pp=4.8,n.aborted=!1,n.Tp="zc.rssh "+i.server,n}return ny(i,t),i.prototype.startRetryTask=function(t,i,e,n,s){this.zn.info("".concat(this.Tp," start retry task"));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.zn.info("".concat(this.Tp," active ").concat(t)),this.retryTimer)return this.zn.info("".concat(this.Tp," has actived, ignore")),!1;if(this.isOverTime)return this.zn.info("".concat(this.Tp," retry over time, stop retry")),!1;this.retryActiveInterval=this.getRetryDelayByCount(this.retryActiveCount);var n=Vt(t)?t:this.retryActiveInterval,s=function(){e.zn.info("".concat(e.Tp," connect timer triggered ")+e.Dp.mediaState),e.retryTimer&&clearTimeout(e.retryTimer),e.retryTimer=null,e.retryActiveCount++,e.Dp&&(e.Dp.mediaState===Pt.LOGOUT||0===t?(e.Dp.connectServer(null==i?void 0:i.roomID,null==i?void 0:i.token,function(t,i){e.handleConnectRsp(t,i)}),0===t&&(e.onCompleteActive&&e.onCompleteActive(e.Dp.server),e.onCompleteActive=void 0)):e.Dp.mediaState===Pt.LOGIN&&e.Un())},r="";return 0===n?(s(),r+="connect immediately"):(this.retryTimer=setTimeout(s,n),r+="connect timer start, delay ".concat(n)),this.zn.info("".concat(this.Tp," ").concat(r)),!0},i.prototype.handleConnectRsp=function(t,i){this.zn.info(this.Tp+" connect res "+i+" aborted "+this.aborted),this.aborted||(0!=i?this.Dp.zp(i)?(this.Un(),this.onFailActive&&this.onFailActive(this.Dp.server,i),this.resetCallback()):this.active():(this.zn.info("".concat(this.Tp," connect suc ")),this.Un(),this.onSucActive&&this.onSucActive(t),this.resetCallback()))},i.prototype.getRetryDelayByCount=function(t){var i=Math.min(this.Pp,this.Ap*Math.pow(2,t<2?0:t)),e=Math.random(),n=Math.floor(e*(1e3*i+1));return this.zn.info("".concat(this.Tp," attempt ").concat(t," ").concat(i," ").concat(n)),n},i.prototype.startMaxTime=function(){var t=this;this.maxTimer||(this.maxTimer=setTimeout(function(){t.zn.warn("".concat(t.Tp," 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.Dp.server,101),t.resetCallback())},1e3*this.RETRY_MAX_TIME))},i.prototype.stopMaxTime=function(){this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},i.prototype.Un=function(){this.zn.info("".concat(this.Tp," stop retry")),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.zn.info("".concat(this.Tp," 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.zn.info(this.Tp+" reset"),this.stopMaxTime(),this.invalid(),this.resetCallback()},i}(Bc),ry="zc.bwa",oy=function(){function t(t,i,e){this.zn=t,this.Uo=i,this.Dn=e,this.timer=0,this.Mp=F.Excellent,this.xp=5}return Object.defineProperty(t.prototype,"jp",{get:function(){return+this.Uo.streamReportSpeed.toFixed(1)},enumerable:!1,configurable:!0}),t.prototype.Lp=function(){var t,i=null!==(t=this.Dn.reporter.tracerHandler.getUploadStatus())&&void 0!==t?t:{uploadSpeed:0,increaseSpeed:0};return+Math.max(i.uploadSpeed,i.increaseSpeed).toFixed(1)},t.prototype.setUploadStrategy=function(t,i){return this.zn.setUploadStrategy(t),t!=this.xp&&(this.xp=t,i&&this.zn.info("".concat(ry," ").concat(i)),!0)},t.prototype.start=function(){var t,i,e=this,n=null!==(i=null!==(t=this.Uo.Kr("log_strategy",!0))&&void 0!==t?t:this.Uo.Kr("log_strategy"))&&void 0!==i?i:-1;[0,1,2,3,4,5].includes(n)?this.stop():this.timer||(this.qp(),this.timer=setInterval(function(){e.qp()},3e3))},t.prototype.qp=function(){var t,i,e=Object.values(this.Uo.publisherList),n=Object.values(this.Uo.playerList);if(e.length>0){this.endStreamTime=void 0;var s=e.reduce(function(t,i,n){var s,r=i.publisher,o=r.targetVBitrate;r.lowStream&&(o+=null!==(s=r.lowStreamVBitrate)&&void 0!==s?s:0),t.needBitrate+=o,0===r.mic_status&&(t.needBitrate+=100),t.hasPublishing||6!==r.state||(t.hasPublishing=!0);var u=r.getAvailableBitrate();Ft(u)||t.bitrateList.push(u);var a=r.qualityGrade;a>t.netGrade&&(t.netGrade=a),0===r.camera_status&&(t.hasVideo=!0,r.isLowVideoQuality&&(t.isReduceVideoQuality=!0));var c=t.bitrateList.length;return n===e.length-1&&c>0&&(t.bitrate=t.bitrateList.reduce(function(t,i){return t+i},0)/c),t},{needBitrate:0,bitrateList:[],bitrate:void 0,netGrade:F.Excellent,isReduceVideoQuality:!1,hasVideo:!1,hasPublishing:!1}),r=s.bitrate,o=s.needBitrate,u=s.netGrade,a=s.isReduceVideoQuality,c=s.hasVideo,h=s.hasPublishing;if(window.noZegoLogStrategy)this.zn.setUploadStrategy(5),this.xp=5;else if(h)if(r){var f=r-o-8*n.length;if(!window.noZegoLogStrategy){var l=void 0;f<=0&&c&&!a?this.zn.setUploadStrategy(l=1):l=this.zn.setUpBitrate(f),Ft(l)||l==this.xp||(this.zn.info("".concat(ry," publish strategy: ").concat(l," bitrate: ").concat(f," grade: ").concat(u," reduce: ").concat(!c||a)),this.xp=l),Ft(u)||(this.Mp=u)}}else{l=this.Up(u);this.setUploadStrategy(l,"publish strategy: ".concat(l," grade: ").concat(u," reduce: ").concat(a))}else this.zn.setUploadStrategy(l=1),this.setUploadStrategy(l,"publish requesting strategy: ".concat(l))}else if(n.length>0){this.endStreamTime=void 0;var d=n.reduce(function(t,i){return t.hasPlaying||6!==i.state||(t.hasPlaying=!0),i.qualityGrade>t.grade&&(t.grade=i.qualityGrade),t},{grade:F.Excellent,hasPlaying:!1}),v=d.hasPlaying;l=this.Up(u=d.grade);v&&0!==l||(l=1),window.noZegoLogStrategy?(this.zn.setUploadStrategy(5),this.xp=5):this.setUploadStrategy(l,"play strategy: ".concat(l," grade: ").concat(u," playing: ").concat(v))}else{var m=this.Lp(),p=+(null!==(i=(null===(t=this.Dn.rtm)||void 0===t?void 0:t.netAgent).speed)&&void 0!==i?i:0).toFixed(1),g="".concat(ry," will end. curr strategy: ").concat(this.xp," grade: ").concat(this.Mp," tracer: ").concat(m," speedLog: ").concat(this.jp," netAgent: ").concat(p);if(this.endStreamTime||(this.endStreamTime=Date.now()),Date.now()-this.endStreamTime>3e4||m+this.jp+p<10){l=this.Up(F.Excellent);this.setUploadStrategy(l)&&(g+=" target strategy ".concat(l))}this.zn.info(g),5===this.xp&&this.stop()}},t.prototype.lazyStopCheck=function(){[F.Excellent,F.Good].includes(this.Mp)},t.prototype.stop=function(){var t,i,e="".concat(ry," end check net. ").concat(this.Mp);this.timer&&(clearInterval(this.timer),this.timer=0);var n=null!==(i=null!==(t=this.Uo.Kr("log_strategy",!0))&&void 0!==t?t:this.Uo.Kr("log_strategy"))&&void 0!==i?i:-1;(!n||n<0)&&(n=5),this.zn.setUploadStrategy(n),Ft(n)||n==this.xp||(e+=" new strategy ".concat(n),this.xp=n),this.zn.info(e)},t.prototype.Up=function(t){var i,e=this.Mp;switch(t<e&&(t=e-1),this.Mp=t,t){case F.Excellent:i=5;break;case F.Good:i=3;break;case F.Middle:i=2;break;case F.Poor:i=1;break;case F.Die:i=0;break;default:i=4}return i},t.defaultAvailableBitrate=5e4,t}(),uy=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)}}(),ay=function(){return ay=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},ay.apply(this,arguments)},cy=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"}(K_||(K_={}));var hy="rtc",fy="l3",ly=jn,dy=ly.event,vy=ly.error,my=$n,py=my.error,gy=tt,by=Rt.frameRate,_y=Rt.bitRate,yy=function(){function t(t){this.zn=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.zn.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}(),wy=function(t){function i(i,e,n,s,r,o){var u,c,h,f=this;return(f=t.call(this)||this).zn=i,f.Dn=e,f.dataReport=n,f.Bp=s,f.acMgr=r,f.geo=o,f.testEnvironment=!1,f.playModule=null,f.trackUtils=new H_(f.zn),f.Jp=3e3,f.Vp=3e3,f.previewStreamList=[],f.Hp={},f.captureStreamElementMap=new Map,f.soundLevelDelegate=!1,f.soundLevelInterval=1e3,f.enableInBackground=!1,f.il=!0,f.Gp={},f.Fp={},f.streamIPStackMode=St.IPv4Prefer,f.isMicEnabled=!0,f.isDataChannelEnabled=!1,f.targetQuality=G.MiddleMinQuality,f.probeInterval=6e4,f.Yp=3e5,f.gwNode="",f.playerList={},f.publisherList={},f.playSuccessCallBackList={},f.playErrorCallBackList={},f.waitPublishList=[],f.waitPlayList=[],f.autoSwitchProtocol=!0,f.udpFailNum=0,f.maxUdpFailNum=2,f.probeStartedNum=3,f.cachedGwNodesList={},f.cachedGwNodesMode=K_.TheSameReUse,f.Zp=-1,f.Qp=-1,f.tm=null,f.Xp=3,f.useCopyMusic=!1,f.playEventKeys={},f.isCustomVC=!1,f.defaultVideoMuted=!1,f.defaultAudioMuted=!1,f.agentConnectIPStackType=-1,f._agentIpStackDetection={IPv4:Dt.unknown,IPv6:Dt.unknown},f.miniSdpWorker=null,f.ipV6Prefer=0,f.ipNodeType=zt.ZV4Priority,f.isCandidateHasIPv6=!1,f.referenceVideoBitrate=-1,f.referenceBitrateUpdateTs=0,f.Wp=function(t){f.zn.info("zsc.orh.0 call ".concat(t)),f.retryStreamList(t)},f.Kp=function(t,i){f.zn.info("zsc.odh.0 call ".concat(t," connect fail ").concat(i)),f.openConnectServerTask(t)},f.eventHandler={visibilitychange:function(){!f.enableInBackground&&f.soundLevelDelegate&&(!si.hidden?(f.enableSoundLevelProcessor(!0),f.activeSoundLevel(),"suspended"===f.ac.state&&f.ac.resume()):(f.soundLevelTimer&&clearTimeout(f.soundLevelTimer),f.soundLevelTimer=null,f.enableSoundLevelProcessor(!1)))}},f.isNotSupportSeiWorker=!1,f.turnServers=void 0,f.checkDeviceChange=void 0,f.$p=new yy(i),f.Bp._on("_roomStateUpdate",function(t,i,e,n,s,r){var o;for(var u in"CONNECTING"==i?o=1:"CONNECTED"===i&&(o=5),f.tg.timer||Ft(o)||f.tg.setUploadStrategy(o,"login state ".concat(i," , strategy ").concat(o)),f.playerList){var a=f.playerList[u];if(a.room.roomID==t&&6===a.state&&a.playMode==J.CDN)if("CONNECTED"==i){a.CDNBrokenCnt++;var c=a.zegoCdnPlayer,h=a.zegoExpressPlayer;h?h.resume():c&&(c.canRetry=!0,c.retry())}else"DISCONNECTED"===i&&!r&&f.stopPlayingStream(u)}}),si.addEventListener("visibilitychange",f.eventHandler.visibilitychange),f.up=new P_(i,e,f),null===(u=f.Bp.netAgent)||void 0===u||u.on("clientInfo",function(t){var i;if(f.Dn.accessClientIp&&(null==t?void 0:t.clientIP)&&f.Dn.accessClientIp!==t.clientIP){f.zn.info("zsc.cs.0 client ip changed "+f.Dn.accessClientIp+" "+t.clientIP);var e=f.Ln.createSpan(a.H,{key:Sn},{key:""},Ls);e.setAttributes({last_client_ip:f.Dn.accessClientIp,current_client_ip:t.clientIP}),e.end(),f.lastChangeIpTime=Date.now(),f.ig(f.publisherList,!0),f.ig(f.playerList,!1),f.Gp={}}if(f.Dn.accessClientIp=t.clientIP,!f.Dn.clientTimeOffset&&(null==t?void 0:t.timeOffset)){var n=f.Ln.createSpan(a.H,{key:Sn},{key:""},qs);n.setAttributes({ntp_source:2,ntp_offset:null==t?void 0:t.timeOffset}),n.end()}Vt(null==t?void 0:t.timeOffset)&&(f.Dn.clientTimeOffset=null==t?void 0:t.timeOffset),f.updateTimeOffsetInterval(),null===(i=f.up)||void 0===i||i.checkIfSupportNTP()}),null===(c=f.Bp.netAgent)||void 0===c||c.on("connected",function(){var t=f.Bp.netAgent.connectIPStackType;f.zn.info("zsc.cs.0 netAgent connect stack ".concat(Nt[t])),f.agentConnectIPStackType=t}),null===(h=f.Bp.netAgent)||void 0===h||h.on("ipDetection",function(t){f.zn.info("zsc.cs.0 ip detection ".concat(JSON.stringify(t)));var i=t.linkConnectDetection;if(i&&(f._agentIpStackDetection.IPv4!==i.IPv4||f._agentIpStackDetection.IPv6!==(null==i?void 0:i.IPv6))){f._agentIpStackDetection=i;var e=f.getStreamIPNodesMode().ipNodeType;f.ipNodeType=e}}),f.tg=new oy(i,f,f.Dn),f}return uy(i,t),Object.defineProperty(i.prototype,"signalList",{get:function(){return this.Hp},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"probeList",{get:function(){return this.Gp},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamReportSpeed",{get:function(){return this.up.speed},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!!(ll.proxyCtrl&&!0!==this.Dn.engineConfig.notProxyRTC||this.isLocalProxy)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isLocalProxy",{get:function(){var t=ll.proxyCtrl;return t&&!(null==t?void 0:t.getTurnInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Ln",{get:function(){return this.Dn.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.Qp},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"txQuality",{get:function(){return this.Zp},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxChannels",{get:function(){var t;return this.Kr("max_channels",!0)?t=this.Kr("max_channels",!0):Vt(this.Dn.engineConfig.maxChannels)?t=this.Dn.engineConfig.maxChannels:this.Kr("max_channels")&&(t=this.Kr("max_channels")),t},enumerable:!1,configurable:!0}),i.setCloseNetProbe=function(t){i.closeNetProbe=t},i.setReportCustomerContext=function(t){P_.reportCustomerContext=t},i.prototype.ig=function(t,i){var e=this,n="zc.rgnds";ui(this.zn,n);var s=null;for(var r in t)s=i?t[r].publisher:t[r];s&&(this.clearCachedGwNodesList(s,i),Object.keys(this.Fp).forEach(function(t){return e.Fp[t].ipChange=!0}),this.stopNetProbe(s),ci(this.zn,n))},Object.defineProperty(i.prototype,"billingTimer",{get:function(){return this._billingTimer||(this._billingTimer=new J_(this.zn,this.Dn)),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===J.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===J.L3}).length},enumerable:!1,configurable:!0}),i.prototype.initMiniSdpWorker=function(t){var i,e=rd(this.Dn.browserInfo,"chrome",78,0);t&&U_.isSupported&&!e?this.miniSdpWorker=this.miniSdpWorker||new U_(this.zn):(this.Dn.Lo=!1,null===(i=this.miniSdpWorker)||void 0===i||i.destroy(),this.miniSdpWorker=null)},i.prototype.setSessionInfo=function(t,i,e){this.zn.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=Cm(this.zn,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.Ln.spanSetAttributes({key:dy,par:i},{error:vy.Ae.code,message:vy.Ae.message}),!1;var l=new jb(i,this.zn,this.dataReport,this.Dn.engineConfig.publishQualityInterval||this.Jp,this.Vp,this,this.Dn,f);this.isProxy&&this.il&&this.setIsPeer(!1),l.isPeer=this.il,l.isExternal=!0,l.parentSpanKey=Ln.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.zn,this.Dn,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.eg(!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.Dn.deviceStateOut&&0===i.audio.audioBitrate?(e.deviceStateCount++,e.deviceStateCount>=2&&(e.deviceStateCount=0,a.Dn.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=Cm(this.zn,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=Cm(this.zn,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.Dn.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()}),this.tg.start()}else n.error("zsc.sps.0 publisher don't exist")},i.prototype.publishStream=function(t){var i=this,e=Cm(this.zn,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){tu(t,i.zn,"zsc.ps.0")}),this.Ln.spanSetAttributes({key:dy,par:t},{cap_w:ly.cap_w(o.videoInfo.width),cap_h:ly.cap_h(o.videoInfo.height),w:ly.w(o.videoInfo.width),h:ly.h(o.videoInfo.height),video_en_fps:ly.video_en_fps(o.videoInfo.frameRate),video_en_bps:ly.video_en_bps(1e3*o.videoInfo.bitRate),is_mini:ly.is_mini(n.Lo)}),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=Cm(this.zn,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.eg(!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 ey(t,this.zn,this.Dn,this.Bp.netAgent);return this.Dn.clientIP=this.Bp.netAgent.clientIP||"",i.setSessionInfo(this.appid,this.userid),i.onReconnected=this.Wp,i.onNeedRetry=this.Kp,i},i.prototype.connectWebRTCCenterServer=function(t,i,e,n,s){var r,o=this,u=this.zn,a="zsc.cwrcs.0";u.info("".concat(a," call, isLogin: ").concat(t,", server: ").concat(i?"rtc":"l3"));var c=null,h=i?hy:fy;this.$p.clearLazyEndTimer(h),this.Hp[h]?(r=this.Hp[h].signal,this.Hp[h].retryServerSignalHandler=null):(r=this.createStreamSignal(h),this.Hp[h]={signal:r}),r&&(r.mediaState===Pt.LOGOUT?(u.info("".concat(a," has not connect")),c||(c=new sy(r,this.zn),this.Hp[h].retryServerSignalHandler=c),c.startRetryTask(this.Dn.serverRetryTime,{roomID:e,token:n,firstInterval:0},function(t){var i=o.Hp[t].signal;i&&s&&s(i)},function(i){o.retryStreamList(i);var e=o.Hp[i].signal;t&&e&&(i===hy&&o.hasRTCStream||i===fy&&o.hasL3Stream||o.disconnectSignalURL(e,!0,15e3))},function(t,i){o.handleServerConnectFail(t,i)})):r.mediaState===Pt.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===hy&&this.hasRTCStream||t===fy&&this.hasL3Stream)&&this.openConnectServerTask(t):i&&this.handleConnectFailStream(t,i)},i.prototype.handleConnectFailStream=function(t,i){var e="zsc.rcsr.0";if(this.zn.info("".concat(e," reconnect ").concat(t," ").concat(i)),this.Dn.engineConfig.keepRtcWhenSignalDisconnected){var n=function(t,e){var n,s=!1;return i===qi.code?(n=ay({},qi),s=!0):((n=ay({},Fi)).message=n.message+" "+i,1008===i&&(n=Hi,s=!0),20010===i&&(s=!0,n=t?JSON.parse(JSON.stringify(ee)):e?JSON.parse(JSON.stringify(pe)):JSON.parse(JSON.stringify(_e)))),{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(W,t.streamID,e.error,e.stopRetry)}),Object.values(this.playerList).forEach(function(t){var i,e=n(!1,t.playMode===J.RTC);null===(i=t.retryStreamHandler)||void 0===i||i.playStateHandle(gy,t.streamId,e.error,e.stopRetry)})}else this.zn.info("".concat(e," keep rtc when signal disconnect"))},i.prototype.disconnectAllSignal=function(){var t=this;this.zn.info("zsc.dcas.0 call"),Object.values(this.Hp).forEach(function(i){var e=i.signal;e&&t.disconnectStreamSignal(e)})},i.prototype.disconnectStreamSignal=function(t){!this.Bp.stateCenter.roomModulesList.some(function(t){return"DISCONNECTED"!==t.roomState})&&this.disconnectSignalURL(t,!1)},i.prototype.disconnectSignalURL=function(t,i,e){var n=this;this.zn.info("zsc.dcsu.0 "+t.server+" "+i+" call");var s=t.server;i?(this.zn.info("zsc.dcsu.0 lazy end"),this.$p.startLazyEndTimer(s,function(){var i=n.ng(s);n.zn.info("zsc.dcsu.0 lazy end start "+i),i&&t.disconnectServer(),n.zn.info("zsc.dcsu.0 lazy end signal")},e)):this.$p.hasEndTask(s)?(this.zn.info("zsc.dcsu.0 has task to end"),this.$p.end(s)):(this.zn.info("zsc.dcsu.0 direct disconnect"),t.disconnectServer()),this.zn.info("zsc.dcsu.0 call success")},i.prototype.reConnectSignals=function(){this.zn.info("".concat("zsc.rcs.0"," call")),Object.values(this.Hp).forEach(function(t){var i=t.retryServerSignalHandler,e=t.signal;i&&(null==i||i.active(0,{roomID:null==e?void 0:e.gs,token:null==e?void 0:e.token}))})},i.prototype.isNetAgentConnect=function(){var t,i;return null===(i=null===(t=this.Bp)||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=Cm(this.zn,t);if(r.info("zsc.pss.1 call"),this.playerList[t])return r.error("zsc.pss.1 player already exist"),py.Qe;var o=this.getPlayRoom(t)||this.Dn.roomList[0];if(!o)return r.error("zsc.pss.1 not login room"),py.Ze;var u=new O_(t,this.zn,null,this.dataReport,this.Dn.engineConfig.playQualityInterval||this.Jp,this.Vp,this,this.ac,this.Dn,o,i,e,n);!this.getStream(o,t)&&(u.streamInRoom=!1),this.isProxy&&this.il&&this.setIsPeer(!1),u.isExternal=!0,u.isPeer=this.il,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=Cm(this.zn,t),o=this.playerList[t],u=o.playMode===J.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.Dn.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:my.urls([o.serverUrl])}),c.startMaxTime(),c.playStartSpan(t,o,!0),this.connectWebRTCCenterServer(!1,(null==o?void 0:o.playMode)===J.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()}),this.tg.start(),!0)},i.prototype.playStream=function(t,i){var e,n=Cm(this.zn,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=Cm(this.zn,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.$p.startLazyEndTimer(t.server,function(){var i=r.ng(t.server);o.info("zsc.rsfs.0 "+t.server+"lazy end start, empty "+i),i&&t.disconnectServer()},e)},a=null===(n=this.Hp[hy])||void 0===n?void 0:n.signal;a&&!this.hasRTCStream&&u(a);var c=null===(s=this.Hp[fy])||void 0===s?void 0:s.signal;c&&!this.hasL3Stream&&u(c)},i.prototype.ng=function(t){var i;if(null===(i=this.Hp[t])||void 0===i?void 0:i.signal){if(t===hy&&!this.hasRTCStream)return!0;if(t===fy&&!this.hasL3Stream)return!0}return!1},i.prototype.stopPlayingStream=function(t,i){var e=Cm(this.zn,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&&dp.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.zn.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?vy._e:{code:i||0,message:""};a&&!u.Fa&&(c=vy.Ue),null===(s=null===(n=o.room)||void 0===n?void 0:n.streamHandler)||void 0===s||s.onPublishStateUpdate(W,r,c),this.stopPublishingStream(r,c),delete this.Dn.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.Dn.roomList.length;c=1002031==i?py.hn:{code:i||0,message:""};if(a&&void 0!==d&&6!==d&&(c=py.gn),m&&(this.getStream(v,h)||1==p))this.onPlayStateUpdate(gy,h,c),this.stopPlayingStream(h,c);else if(m&&p>1){var g=this.Dn.roomList.find(function(i){return i.roomID!==t});g?this.playerList[h].room=g:(this.stopPlayingStream(h,c),this.onPlayStateUpdate(gy,h,c))}}0==this.publishersLength&&0==Object.keys(this.playerList).length&&(this.Gp={}),this.waitPublishList=[],this.waitPlayList=[],this.up.resetReport(),this.zn.info("zsc.rs call success")},i.prototype.openConnectServerTask=function(t){var i=this,e=this.Hp[t],n=e.signal,s=e.retryServerSignalHandler;if(null==s||s.reset(),n){var r=new sy(n,this.zn);r.startRetryTask(this.Dn.serverRetryTime,{firstInterval:0},function(t){},function(t){i.retryStreamList(t)},function(t,e){i.handleServerConnectFail(t,e)}),this.Hp[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.zn.info("zsc.orh.0 reconnect "+e+" "+n.state+" "+n.stateNego),7==n.state||n.isStateRetry?!s.isOverTime&&s.publishStateHandle(W,e,vy.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.zn.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!==J.CDN&&o.isStateRetry?!s.isOverTime&&s.playStateHandle(gy,e,py.un):6==o.state&&s.stopMaxTime())}},i.prototype.getPublisher=function(t){var i=null;if(Ht(t)&&this.publisherList[t]&&this.publisherList[t].publisher)i=this.publisherList[t].publisher;else if(Kt(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 Ht(t)&&this.publisherList[t]&&this.publisherList[t].publisher?e=null===(i=this.publisherList[t].publisher)||void 0===i?void 0:i.previewer:Kt(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&&!Kt(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(Gt(t)&&t)i={audio:!1,video:{frameRate:by},bitRate:this.Kr("screen_video_bitrate")||_y};else if(Yt(t)){switch(t.videoQuality){case 1:i={video:{frameRate:kt.frameRate},bitRate:kt.bitRate};break;case 3:i={video:{frameRate:It.frameRate},bitRate:It.bitRate};break;case 4:i={video:{frameRate:t.frameRate,width:t.width,height:t.height},bitRate:t.bitRate};break;case 2:i={video:{frameRate:by},bitRate:_y};break;default:i={video:{frameRate:by},bitRate:this.Kr("screen_video_bitrate")||_y}}if(i.audio=!!Gt(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=ay(ay({},t),i)}return i},i.prototype.createScreenPreviewer=function(t,i,e){var n=new tg(this.zn,this.Dn,this,"screen"),s=t.getVideoTracks()[0].getSettings();return this.previewStreamList.push(n),Yt(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.Kr("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&&Ht(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 tg(this.zn,this.Dn,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=ay(ay({},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.zn.info("zsc.ssd.0 call"),this.soundLevelDelegate=t,this.enableInBackground=e,i&&this.setSoundLevelInterval(i),this.enableSoundLevelProcessor(t),t?(this.zn.info("zsc.ssd.0 start getting sound"),this.activeSoundLevel()):(this.zn.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(){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.zn.info("zsc.ssl.0 stop"),clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null)},i.prototype.sg=function(){return this.Ln.createSpan(a.H,{key:Sn},{key:""},Us)},i.prototype.startNetProbe=function(t,i,e){var n;(i&&(i.probeTime=Date.now()),i&&!i.isPeer||!this.il)?this.Ln.setError(this.sg(),{code:-1,message:"not support peer"}):(n=e||this.getProbeNodeList(i),this.zn.info("zc.stnp.1 nodes ".concat(JSON.stringify(n))),n.length>0&&this.rg(t,i,n))},i.prototype.stopNetProbe=function(t){var i=this;this.Fp&&t&&t.probeState!=ct.probed&&(this.zn.info("zc.stnp.0 call ".concat(t.streamId)),Object.keys(this.Fp).forEach(function(t){var e;(null===(e=i.Fp[t])||void 0===e?void 0:e.isProbed)||(i.stopPlayingStream(i.Fp[t].streamID),delete i.Fp[t])}),t.probeState=ct.probed,this.og(t))},i.prototype.getProbeNodeList=function(t){var i;switch(null==t?void 0:t.ipNodeType){case zt.ZV4Only:i=t.gwNodeList;break;case zt.ZV4Priority:i=this.sortIPNodesByPriority(t.ipV4NodeList).map(function(t){return cd(t)});break;case zt.ZV6Priority:i=this.sortIPNodesByPriority(t.ipV6NodeList).map(function(t){return cd(t)});break;case zt.ZV6AndV4Priority:i=this.getSortedIPV6AndV4Nodes(t,"v6").map(function(t){return cd(t)});break;default:i=[]}return i},i.prototype.og=function(t){t.probeTimer&&clearTimeout(t.probeTimer),t.probeTimer=null},i.prototype.ug=function(){var t="zegoprobe-"+(new Date).getTime();return this.setPlayStateStart(t),{prober:this.playerList[t]?this.playerList[t]:null,streamID:t}},i.prototype.ag=function(){var t=this,i="zc.sp.cdn";ui(this.zn,i);var e=this.ug(),n=e.prober,s=e.streamID;n&&(n.isProbe=!0,this.playerList[s].serverUrl=fy,this.startPlayingStream(s,function(){}),this.playerList[s].isProbeByDG=!0,n.onCalNetQualityResult=function(e,n){t.zn.info("zc.ocnqr.0 l3 detect "+e+" "+n),t.stopPlayingStream(s),ci(t.zn,i)})},i.prototype.cg=function(t,i,e,n){void 0===n&&(n=-1);var s={result:e,probeQuality:n,timeStamp:(new Date).getTime()};this.Fp[i]&&(this.Fp[i].isProbed=!0),this.Gp[i]=s,t.probedList.push(ay(ay({},s),{gwNode:i}))},i.prototype.rg=function(t,i,e){var n=this,s="zc.psp.0";if(ui(this.zn,s),i&&e){var r=i.streamId,o=this.sg();i.probeNodeList=e;var u=(new Date).getTime(),a=e.filter(function(t){return!(n.Gp[t]&&n.Gp[t].timeStamp+n.Yp>u||i.probeState==ct.probed||n.Fp[t]&&!n.Fp[t].isProbed)&&(delete n.Gp[t],!0)}),c={};this.zn.info("".concat(s," ").concat(r," probe nodes:").concat(JSON.stringify(a)));for(var h=a.length>this.Xp?this.Xp:a.length,f=function(r){var u=a[r];if(0==h)return"break";h--,l.Gp[u]={};var f=l.ug(),d=f.prober,v=f.streamID;if(l.Fp[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.zn.info(a+" "+d.gwNode+" "+t+" "+s),delete c[u];var h=0==Object.keys(c).length;if(null===(r=n.Fp[u])||void 0===r?void 0:r.ipChange)return n.zn.info("".concat(a," ipChange:").concat(u)),n.stopPlayingStream(n.Fp[u].streamID),void delete n.Fp[u];var f=ct.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:Bs(parseInt(i.netQuality+"")),node_list:Js(e)}),o.end()},i.probeTimer||(i.probeTimer=setTimeout(function(){n.zn.info("zc.snp.0 call probeTimer"),n.handleProbedList(t,i,!1,e)},6e3)),ci(l.zn,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}}ai(this.zn,s)},i.prototype.handleProbeQuality=function(t,i,e,n,s,r){var o;ui(this.zn,"zc.hpq.0","".concat(i.streamId," ").concat(s," ").concat(e," ").concat(r," ")),this.cg(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.og(i);var r,o=i.probedList,u=i.probeState==ct.probed,a="zc.hpl.0";(ui(this.zn,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.zn.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.zn.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.Fp[t.gwNode])||void 0===i?void 0:i.streamID;e&&(s.stopPlayingStream(e),delete s.Fp[t.gwNode])}),this.handleCalNetQualityResult(t,r,i,e,n),i.probedList=[]):this.zn.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=Cm(this.zn,e.streamId);null==s||s.forEach(function(t){var i;(null===(i=r.Gp[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.Ln.createSpan(a.H,{key:Sn},{key:""},Vs.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=ct.probed):f=!1),!f)if(l){if(d.info(h+" last "),!e._f)for(var m in e.netProbeToReDispatch(function(){e._f=!1,d.info("".concat(h," gw redispatch success")),r.startNetProbe(t,e)},function(){d.info("".concat(h," gw redispatch fail")),e._f=!1}),this.Gp)-1===this.Gp[m].netQuality&&(this.Gp[m]={})}else n&&this.startNetProbe(t,e,s);var p=Vs;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(it,s,{code:Se.code,message:Se.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(Ht(i)){var e=i.toLowerCase();if(["default","motion","detail","text"].includes(e)){var n=t.getVideoTracks()[0];n?"contentHint"in n?(this.zn.info("zc.svtch "+e),n.contentHint="default"==e?"":e):this.zn.warn("zc.svtch mediaStreamTrack contentHint attribute not supported"):this.zn.warn("zc.svtch video track no found")}else this.zn.warn("zc.svtch videoOptimizationMode wrong")}else this.zn.warn("zc.svtch videoOptimizationMode type wrong")},i.prototype.getPlayRoom=function(t){var i=this;return this.Dn.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.up.updateQualityOrChargeInfo(t,i)},i.prototype.checkStreamReport=function(){this.up.checkStreamReport(),this.up.reportOldCacheData()},i.prototype.stopToReport=function(t){this.up.updateQualityOrChargeInfo(t,void 0,!0)},i.prototype.setIsPeer=function(t){this.il=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=Cm(this.zn,t.streamId);e.info(Ld+" call"),this.checkCachedNodesUse(t,i),t.gwNodesTTL&&t.gwNodesTTL<(new Date).getTime()&&(e.info(Ld+" ttl timeout, reset gw"),t.resetGwNodes()),this.gwNode&&(t.gwNode=this.gwNode),e.info(Ld+" end "+t.gwNode)},i.prototype.getNodeIndex=function(t,i){var e="",n=i?"publish":"play",s="";switch(i||(t.playMode==J.RTC?s="_rtc":t.playMode===J.L3&&(s="_l3")),this.cachedGwNodesMode){case K_.NotReUse:break;case K_.TheSameReUse:e=n+"_"+t.streamId+s;break;case K_.DiffReUse:e=n;break;case K_.AllReUse:e="stream"}return e},i.prototype.checkCachedNodesUse=function(t,i){var e,n,s,r=Cm(this.zn,t.streamId);if(r.info(qd+" call "+this.cachedGwNodesMode),t.isExternal)if(i&&t.isCustomCdn())r.info(qd+" custom cdn");else if(t.hasSucceed&&this.Dn.isMultiOuter)r.info(qd+" multi outer");else{var o=this.getNodeIndex(t,i);if(r.info(qd+" "+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(qd+" 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===zt.ZV4Only?(t.gwNode=t.gwNodeList[0],t.ipV6Prefer=Ct.kV4Only):(t.gwNode=this.getGwNode(t,this.ipNodeType,-1),t.ipV6Prefer=this.ipV6Prefer))}r.info(qd+" end "+t.gwNode)}else r.info(qd+" retry internal")},i.prototype.updateCachedGwNodesList=function(t,i,e,n,s,r){void 0===s&&(s=[]),void 0===r&&(r=[]);var o=Cm(this.zn,t);if(o.info(Ud+" call"),0===n)this.setCachedGwNodesMode(K_.NotReUse);else if(n>0){var u=i?this.getPublisher(t):this.playerList[t];if(u){var a=this.getNodeIndex(u,i);o.info(Ud+" 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.zn.info(Ud+" player no found"+t)}},i.prototype.clearCachedGwNodesList=function(t,i){var e=this.getNodeIndex(t,i);this.zn.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;Vt(null===(t=this.Bp)||void 0===t?void 0:t.netAgent.timeOffset)&&(this.Dn.clientTimeOffset=null===(i=this.Bp)||void 0===i?void 0:i.netAgent.timeOffset),this.Oo=setTimeout(function(){e.updateTimeOffsetInterval()},9e5)},i.prototype.changeRxQuality=function(t){this.Qp=t,this.startPublishNetWorkQuality()},i.prototype.changeTxQuality=function(t){this.Zp=t,this.startPublishNetWorkQuality()},i.prototype.startPublishNetWorkQuality=function(){var t=this;null===this.tm&&(this.tm=setInterval(function(){t.Dn.actionListener("networkQuality","",t.Zp,t.Qp)},3e3))},i.prototype.resetNetworkData=function(){Object.keys(this.playerList).length<1&&(this.Qp=-1),this.publishersLength<1&&(this.Zp=-1),Object.keys(this.playerList).length<1&&this.publishersLength<1&&(clearInterval(this.tm),this.tm=null)},i.prototype.getCloudSoundInterval=function(){var t=this.Kr("sound_sample_interval");return t&&(t<100&&(t=100),t>3e3&&(t=3e3),this.zn.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 dp(this.zn,this.Dn,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=G_.toString().trim().match(/\{([\s\S]*)\}/)[1],e=URL.createObjectURL(new window.Blob([i],{type:"text/javascript"}));return t=this.seiWorker=new Worker(e),this.zn.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.Oo&&clearTimeout(this.Oo),this.tm&&clearInterval(this.tm),null===(t=this._billingTimer)||void 0===t||t.destroy(),this.hg(),this.checkDeviceChange=void 0,this.isCandidateHasIPv6=!1,this.captureStreamElementMap.clear(),this.tg.stop(),this.destroySEIWorker(),si.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},i.prototype.hg=function(){var t=this;Object.keys(this.Hp).forEach(function(i){var e,n;t.Hp[i].signal=null,null===(n=null===(e=t.Hp[i])||void 0===e?void 0:e.retryServerSignalHandler)||void 0===n||n.invalid(),t.Hp[i].retryServerSignalHandler=null,delete t.Hp[i]})},i.prototype.supplementPlayingChargeTime=function(){this.billingTimer.supplementPlayingChargeTime()},i.prototype.getDataChannelOption=function(){var t={ordered:!0},i=this.Dn.engineConfig.datachannelOption;return Gt(i.ordered)&&!i.ordered&&(t.ordered=!1,Vt(i.maxPacketLifeTime)&&i.maxPacketLifeTime>0&&i.maxPacketLifeTime<5e3?t.maxPacketLifeTime=i.maxPacketLifeTime:Vt(i.maxRetransmits)&&i.maxRetransmits>0&&i.maxRetransmits<50&&(t.maxRetransmits=i.maxRetransmits)),t},i.prototype.getIPv6PreferByGwNode=function(t){return Ul(ed(t))===Nt.IPv4?Ct.kV4AndV6:Ct.kV6AndV4},i.prototype.getGwNode=function(t,i,e){var n="",s=t.gwNodeList,r=t.ipV4NodeList,o=t.ipV6NodeList;if(i===zt.ZV4Only)(null==s?void 0:s.length)>0&&(n=s[++e%s.length]);else if(i===zt.ZV4Priority)(null==r?void 0:r.length)>0&&(t.ipNode=r[++e%r.length],n=cd(t.ipNode));else if(i===zt.ZV6Priority)(null==o?void 0:o.length)>0&&(t.ipNode=o[++e%o.length],n=cd(t.ipNode));else if(i===zt.ZV6AndV4Priority){var u=this.getSortedIPV6AndV4Nodes(t,"v6");if(u.length>0)if(-1===e)n=cd(u[0]);else{var a=hd(u,t.gwNode);n=cd(u[++a%u.length])}}return this.zn.info("zsc.gw get node ".concat(zt[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=cy([],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:ql(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===zt.ZV4Only)e=(i=n.findIndex(function(t){return t==o}))===n.length-1;else{var u=hd(s,o),a=hd(r,o);if(t.ipNodeType===zt.ZV4Priority)e=(i=u)===s.length-1;else if(t.ipNodeType===zt.ZV6Priority)e=(i=a)===r.length-1;else{var c=this.getSortedIPV6AndV4Nodes(t,"v6");e=(i=hd(c,o))===c.length-1}}return{lastTryNext:e,currentIdx:i}},i.prototype.getStreamIPNodesMode=function(){var t,i;if(this.zn.info("zsc.gsinm call, proxy: ".concat(this.isProxy,", mode: ").concat(St[this.Dn.selectIPStackMode]," ")),this.isProxy||this.Dn.selectIPStackMode===St.IPv4Only)t=Ct.kV4Only,i=zt.ZV4Only;else if(this.Dn.selectIPStackMode===St.IPv4Prefer){var e=this.getIPV4PreferNodeType();i=e.ipNodeType,t=e.ipV6Prefer}else{var n=this.getIPV6PreferNodeType();i=n.ipNodeType,t=n.ipV6Prefer}return this.zn.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.zn.info("zsc.gi4nt connected: ".concat(Nt[t],", detection: ").concat(JSON.stringify(this.agentIpStackDetection)));var i,e,n=this.agentIpStackDetection,s=n.IPv4,r=n.IPv6;return t===Nt.IPv4||s===Dt.reachable?(i=zt.ZV4Only,e=Ct.kV4Only):[Dt.unknown,Dt.unreachable].includes(s)&&r===Dt.reachable?(i=zt.ZV6Priority,e=Ct.kV6AndV4):(i=zt.ZV4Priority,e=Ct.kV4AndV6),{ipNodeType:i,ipV6Prefer:e}},i.prototype.getIPV6PreferNodeType=function(){this.zn.info("zsc.gi6nt detection: ".concat(JSON.stringify(this.agentIpStackDetection)));var t,i,e=this.agentIpStackDetection,n=e.IPv4-e.IPv6;return 0===n?(t=zt.ZV6AndV4Priority,i=Ct.kV6AndV4):n>0?(t=zt.ZV4Priority,i=Ct.kV4AndV6):(t=zt.ZV6Priority,i=Ct.kV6AndV4),{ipNodeType:t,ipV6Prefer:i}},i.prototype.getRetryIPPreferNodeType=function(){var t,i;this.zn.info("zsc.gripnt mode:".concat(St[this.Dn.selectIPStackMode]," detection: ").concat(this.agentIpStackDetection));var e=this.agentIpStackDetection;if(this.Dn.selectIPStackMode===St.IPv4Prefer)e.IPv4===Dt.reachable?(t=zt.ZV4Priority,i=Ct.kV4AndV6):e.IPv6===Dt.reachable?(t=zt.ZV6Priority,i=Ct.kV6AndV4):(t=zt.ZV4Priority,i=Ct.kV4AndV6);else{var n=this.getIPV6PreferNodeType();t=n.ipNodeType,i=n.ipV6Prefer}return{ipNodeType:t,ipV6Prefer:i}},i.prototype.eg=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.prototype.Kr=function(t,i){return this.Dn.settingConfig.getSetting(t,i)},i.closeNetProbe=!1,i}(Lb),Sy=o(6794),Ey=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}(),Oy=function(){return Oy=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},Oy.apply(this,arguments)},Ty=function(){function t(t,i,e){this.fg=t,this.lg=i,this.Uo=e,this._initTime=Date.now()}return Object.defineProperty(t.prototype,"appid",{get:function(){return this.lg.appid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"device_id",{get:function(){return this.fg.deviceID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"product",{get:function(){return this.fg.roomServer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sdk_version",{get:function(){return m},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.lg.sdkVerNum},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"browser",{get:function(){return this.lg.browser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id_name",{get:function(){return this.fg.idName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nick_name",{get:function(){return this.fg.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.fg.userid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"network_state",{get:function(){return this.lg.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.fg.roomServer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"device_infos",{get:function(){return this.lg.deviceInfos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"room_list",{get:function(){var t=this,i={};return this.lg.roomList.forEach(function(e){var n,s,r,o=t.fg.roomModulesList.find(function(t){return t.roomID===e.roomID}),u={roomSessionID:e.roomSessionID,sessionID:e.sessionID,streamList:e.streamList,token:e.token,role:t.fg.role,roomCreateFlag:t.fg.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 Oy({roomID:t},e.room_list[t])})},Object.defineProperty(t.prototype,"room_id_list",{get:function(){return this.lg.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.fg.roomModulesList[0],e=i.runState,n=i.lastRunState;return e===M.logout?t=x.logout:e===M.login?t=x.login:n===M.logout?t=x.trylogin:n===M.login&&(t=x.reconnect),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publishStreamList",{get:function(){return Object.keys(this.Uo.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.Uo.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 Oy({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.Uo.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.Uo.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 Oy({streamID:t},e.playList[t])})},Object.defineProperty(t.prototype,"playListSize",{get:function(){return this.playStreamList.length},enumerable:!1,configurable:!0}),t}(),ky="zc.ac.mer",Ry=function(){function t(t,i,e){var n=this;this.zn=t,this.ac=i,this.eu=e,this.error=!1,this.effectMode=1,this.eventHandler={volumechange:function(t){var i=t.target;i&&n.dg&&(i.muted||i.paused?(n.zn.info(ky+" local audio muted disconnect"),n.dg.disconnect()):(n.zn.info(ky+" local audio is connected"),n.dg.connect(n.ac.destination)))}},this.zn.info(ky+" 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.dg&&(this.dg.gain.value=t)},t.prototype.init=function(){var t=this.ac;try{var i=ph().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.eu.crossOrigin&&this.zn.info(ky+" Media element does not support cross-origin. Maybe no sound can be played"),this.srcNode=t.createMediaElementSource(this.eu);var e=this.dg=t.createGain();e.connect(t.destination),this.srcNode.connect(e),"suspended"===this.ac.state&&this.ac.resume()}catch(t){return this.zn.warn(ky+" 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[Dp.Local,Dp.All].includes(this.effectMode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"effectOnMix",{get:function(){return[Dp.Publish,Dp.All].includes(this.effectMode)},enumerable:!1,configurable:!0}),t.prototype.setVoiceChangeNode=function(t,i,e){if(void 0===e&&(e=!1),this.dg&&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.zn.info(ky+" 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.dg):this.srcNode.connect(this.dg),s&&(o?i.connect(s):this.srcNode.connect(s)),this.voiceChangerNode=i;else{var u=this.srcNode;u.connect(this.dg),this.mixOutputNode&&u.connect(this.mixOutputNode),this.voiceChangerNode=void 0}}},t.prototype.destroy=function(){var t;null===(t=this.dg)||void 0===t||t.connect(this.ac.destination),this.eu.removeEventListener("volumechange",this.eventHandler.volumechange),this.eu.removeEventListener("pause",this.eventHandler.volumechange),this.eu.removeEventListener("play",this.eventHandler.volumechange)},t}(),Iy=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())})},Ny=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])}}},Cy=function(){function t(t){var i=this;this.zn=t,this.isResuming=!1,this.vg=new Map,this.mg=new Map,this.eventHandler={resumeAudioContext:function(t){var e=i.ac.state;if("running"!==e){var n=null==t?void 0:t.type;i.zn.info("zc.ac.rs call "+e+", "+n),i.ac.resume().then(function(){i.zn.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.zn.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.zn.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.zn=i:t.mgr=new t(i),t.mgr},t.prototype.getMediaElementRenderer=function(t){var i=this.vg.get(t);return i||((i=new Ry(this.zn,this.ac,t)).error?null:(this.vg.set(t,i),i))},t.prototype.checkAudioContext=function(){if(this.zn.info("zc.ac.cac call"),this.ac&&"suspended"===this.ac.state){var t=this.eventHandler.resumeAudioContext;wh()&&t(),window.addEventListener("mousedown",t)}},t.prototype.offCheckAudioContextListener=function(){this.zn.info("zc.ac.ocac call"),window.removeEventListener("mousedown",this.eventHandler.resumeAudioContext)},t.prototype.registerModule=function(t,i){return Iy(this,void 0,void 0,function(){var e,n,s;return Ny(this,function(r){switch(r.label){case 0:if(this.mg.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.mg.set(t,!0),[3,4];case 3:return s=r.sent(),this.mg.set(t,!1),this.zn.error("zc.ac.rm.0 ".concat(t," fail ").concat(s.toString())),[3,4];case 4:return[2]}})})},t.prototype.destroy=function(){this.offCheckAudioContextListener()},t}(),zy=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),Ft(i)||i(null)}catch(t){console.error(t),Ft(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}(),Dy=function(){return Dy=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},Dy.apply(this,arguments)},Ay=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())})},Py=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])}}},My=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 xy=function(){function t(i,e,n,s,r,o){void 0===r&&(r=0),void 0===o&&(o=U.Default);var u,c,h=this;if(this.logger=i,this.reporter=n,this.recordedBlobs=[],this.mediaRecorder=null,t.isInstantiated=!0,this.zn=i,this.dataReport=e,this.acMgr=Cy.create(this.zn),this.stateCenter=new _m(this.zn,this.dataReport),this.Dn=this.stateCenter,this.Dn.clientType="webrtc",this.Dn.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!==P.Extranet&&f!==P.Intranet||(this.Dn.netMode=t.engineOptions.netMode)}this.RTM=s,this.Dn.appid=s.getAppID(),this.streamCenter=new wy(this.zn,this.Dn,this.dataReport,this.RTM,this.acMgr,{type:t.geoFenceType,areaList:t.geoFenceAreaList}),this.Uo=this.streamCenter,this.Dn.browser=Sy.browserDetails.browser,this.Dn.browserInfo=yh(),this.Dn.sdkVerNum=this.RTM.stateCenter.sdkVerNum,this.RTM.cloudSetting.setEnvVariable("sdk_version",m),this.initTracer(n),this.rtcModules=new Zg(this.zn,this.dataReport,this.Dn,this.Uo,this.RTM,this.ac,this),null===(c=this.RTM.cloudSetting)||void 0===c||c.getSettingCache(ul).then(function(t){var i;h.zn.info(Sd+" streamConfig "+JSON.stringify(t));var e=h.Ln.createSpan(a.H,{key:Tn},{key:""},Hs);e.setAttributes({files:Gs([{name:ul,content:JSON.stringify(null==t?void 0:t.setting),versions:JSON.stringify(null==t?void 0:t.versions),code:0,message:""}])}),e.end(),h.Dn.settingConfig.setSetting(null==t?void 0:t.setting);var n=h.Dn.settingConfig.getSetting("open_mini_sdp");null===(i=h.Uo)||void 0===i||i.initMiniSdpWorker(n)}).catch(function(t){h.zn.warn(Sd+" streamConfig "+JSON.stringify(t))}),this.Dn.rtm=this.RTM,this.Dn.streamCenter=this.Uo,[3,4,5,6,7,8,9].includes(o)?(this.Dn.scenario=o,this.zn.info(tm+" "+o+" success")):100===o?(this.stateCenter.scenario=o,this.zn.info(tm+" "+o+" liveroom set")):(this.Dn.scenario=U.Default,this.zn.error(tm+" "+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,"Ln",{get:function(){return this.Dn.reporter},enumerable:!1,configurable:!0}),t.setGeoFence=function(i,e){if(t.isInstantiated)throw Mi;t.geoFenceType=i,t.geoFenceAreaList=e},t.setEngineOptions=function(i){t.engineOptions=Dy(Dy({},t.engineOptions||{}),i),i.geoFenceType&&(t.geoFenceType=i.geoFenceType),i.geoFenceAreaList&&(t.geoFenceAreaList=i.geoFenceAreaList),"boolean"==typeof i.closeNetProbe&&wy.setCloseNetProbe(i.closeNetProbe),mi(i.dataReportCustomerContext,!0)&&wy.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.zn.info(Ed+" 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.Uo.previewStreamList;i<e.length;i++){var n=e[i];n.localStream&&t.destroyStream(n.localStream)}t.Dn.actionListener("_engineDestroy"),t.acMgr.destroy(),t.rtcModules.publishModule.destroy(),t.Uo.destroy(),t.Dn.destroy(),t.RTM.netAgent.destroy(),t.zn.info(Ed+" call success"),t.zn.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.Uo.isMicEnabled},t.prototype.setAudioOutput=function(t,i){return this.zn.info("zc.sao call"),Ht(i)?this.rtcModules.playModule.setStreamAudioOutput(t,i):(this.zn.error("audiooutput is not string"),!1)},t.prototype.setGWNode=function(t){Ht(t)&&t.length>0&&(this.Uo.gwNode=t)},t.prototype.setQualityMonitorCycle=function(t){return this.zn.warn("setQualityMonitorCycle method deprecated!!!"),!1},t.prototype.startPlayingStream=function(t,i,e){return this.zn.info(Rd+" 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.zn.info(Nd+" call by user",{streamid:t+""}),this.rtcModules.playModule.stopPlayingStream(t,void 0,!0)},t.prototype.setPlayAccelerate=function(t){this.Dn.playAccelerate=t},t.prototype.setTurnOverTcpOnly=function(t){this.zn.info("zc.stoto call "+t),Gt(t)?this.Dn.turnOverTcpOnly=t:this.zn.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.zn.info($v+" "+t+" called"),this.Dn.roomList.length?(this.zn.error($v+" "+JSON.stringify(je)),!1):(this.Dn.scenario=t,this.zn.info($v+" "+t+" called success"),!0)):(this.zn.error($v+" "+t+" please use valid scenario"),!1)},t.prototype.destroyStream=function(t){this.zn.info(Td+" call by user"),this.rtcModules.publishModule.destroyStream(t)},t.prototype.startPublishingStream=function(t,i,e,n){return this.zn.info(kd+" call by user",{streamid:t+""}),this.rtcModules.publishModule.startPublishingStream(t,i,e?Dy({},e):e,n)},t.prototype.updatePublishingStream=function(t,i){return this.zn.info(em+" 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.zn.info("zc.ssc "+JSON.stringify(t)),this.Dn.seiConfig=Dy(Dy({},this.Dn.seiConfig),t),this.Dn.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.zn.info(Id+" 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 hi(["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 hi(["audio mix"])},t.prototype.getEffectCurrentProgress=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.getEffectProgress(t,i);throw hi(["audio mix"])},t.prototype.seekAudioEffect=function(t,i,e){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.seekAudioEffect(t,i,e);throw hi(["audio mix"])},t.prototype.playEffect=function(t,i,e){if(void 0===this.rtcModules.audioMixModule)throw hi(["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 hi(["audio mix"])},t.prototype.resumeEffect=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.resumeEffect(t,i);throw hi(["audio mix"])},t.prototype.stopEffect=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopEffect(t,i);throw hi(["audio mix"])},t.prototype.unloadEffect=function(t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.unloadEffect(t);throw hi(["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 hi(["audio mix"])},t.prototype.startMixingAudio=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.startMixingAudio(t,i);throw hi(["audio mix"])},t.prototype.stopMixingAudio=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopMixingAudio(t,i);throw hi(["audio mix"])},t.prototype.mixingBuffer=function(t,i,e,n){if(void 0===this.rtcModules.audioMixModule)throw hi(["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 hi(["audio mix"])},t.prototype.setMixingAudioVolume=function(t,i,e){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.setMixingAudioVolume(t,i,e);throw hi(["audio mix"])},t.prototype.checkSystemRequirements=function(i,e){var n=this,s=navigator&&navigator.mediaDevices&&(t.screenShotReady||"getDisplayMedia"in navigator.mediaDevices);return this.zn.info("zc.csr call"+ph()),new ni(function(t){var r=Si(n.Ln,a.H,"",ls,Tn),o=e||"all",u=function(i){Ei(r,{capability:ds(i)});var e=n.Dn.checkList.indexOf(o);n.Dn.checkList.splice(e,1),t(i)};return["webRTC","customCapture","camera","microphone","screenSharing","H264","VP8","H265","all"].includes(o)&&[0,1].includes(i)?n.Dn.checkList.includes(o)||n.Dn.checkList.includes("all")?u({result:!1,errInfo:{extendedDate:"The last test of the same type has not returned a result "}}):(n.Dn.checkList.push(o),void Yl(s,u,i,e,n.Dn.customUa)):u({result:!1,errInfo:{extendedDate:"param error"}})})},t.prototype.enumDevices=function(t,i){return Ay(this,void 0,void 0,function(){var e,n,s,r,o,u,a,c,h,f,l,d,v,m=this;return Py(this,function(p){switch(p.label){case 0:return this.zn.info("zc.ed.0 call"),e=function(){return new ni(function(t,i){m.rtcModules.publishModule.recordDevices(function(i){var e=!0,n=!0;i.cameras.find(function(t){if(""===t.deviceID)return e=!1,!0}),i.microphones.find(function(t){if(""===t.deviceID)return n=!1,!0}),t({devices:i,enableCamera:e,enableMic:n})},function(t){i(t)})})},[4,e()];case 1:return n=p.sent(),s=n.enableCamera,r=n.enableMic,o=n.devices,t?(this.zn.info("zc.ed.0 check permission"),u={video:!0,audio:!0},"videoinput"===i?u.audio=!1:"audioinput"!==i&&"audiooutput"!==i||(u.video=!1),c=u.audio&&!r,(a=u.video&&!s)||c?(this.zn.info("zc.ed.0 need to get device permission. needCamera: ".concat(a,", needMic: ").concat(c)),[4,od(u).catch(function(){})]):[3,4]):[3,4];case 2:return(h=p.sent())&&h.getTracks().forEach(function(t){t.stop()}),[4,e()];case 3:f=p.sent(),l=f.devices,d=f.enableCamera,v=f.enableMic,u.video&&!d&&this.zn.warn("zc.ed.0 get video device permission failed."),u.audio&&!v&&this.zn.warn("zc.ed.0 get audio device permission failed."),o=l,p.label=4;case 4:return[2,o]}})})},t.prototype.getCameras=function(){return Ay(this,void 0,void 0,function(){return Py(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 Ay(this,void 0,void 0,function(){return Py(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 Ay(this,void 0,void 0,function(){return Py(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.zn.error("localStream is empty!"),!1;var n=Dy({},e);return new zy(this.ac,n).connectToSource(t,function(t){i(t)})},t.prototype.getSoundLevel=function(t,i,e){if(!this.rtcModules.audioMixModule)throw hi(["audio mix"]);this.rtcModules.audioMixModule.getSoundLevel(t,i,e)},t.prototype.stopSoundLevel=function(t){if(!this.rtcModules.audioMixModule)throw hi(["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 Ay(n,void 0,void 0,function(){var n,o,u,a,c;return Py(this,function(h){switch(h.label){case 0:if(n=function(t){r({errorCode:t.errorCode||t.code,extendedData:t.extendedData||t.message})},!(Ht(t)||Kt(t)||(f=t,f instanceof ng)))return this.zn.error("zc.safc.0 streamID must be string or ZegoLocalStream or MediaStream"),n(xi),[2];if((null==e?void 0:e.frameSize)&&![256,512,1024,2048,4096,8192,16384].includes(null==e?void 0:e.frameSize))return this.zn.error("zc.safc.0 option frameSize invalid"),n(xi),[2];if(Ht(t)){if(!(u=this.Uo.playerList[t]))return this.zn.error("zc.safc.0 player not found"),n(Ie),[2];if(0===(null===(c=u.playStream)||void 0===c?void 0:c.getAudioTracks().length))return this.zn.error("zc.safc.0 no stream or no audio"),n(Ie),[2];o=u}else{if(!(a=this.Uo.checkPreview(t)))return this.zn.error("zsc.sd.0 preview no found"),n(re),[2];if(0===t.getAudioTracks().length||a.isOriginEmptyTrack())return this.zn.error("zsc.sd.0 preview no audio track"),n(fn),[2];o=a}return[4,this.Uo.acMgr.registerModule("audioPCMExporter",'class AudioPcmDataProcessor extends AudioWorkletProcessor {\r\n // 0. Determine the buffer size (this is the same as the 1st argument of ScriptProcessor)\r\n\r\n constructor(options) {\r\n super();\r\n // console.error("AudioPcmDataProcessor");\r\n this.bufferSize = 1024;\r\n // 1. Track the current buffer fill level\r\n this._bytesWritten = 0;\r\n\r\n // 2. Create a buffer of fixed size\r\n this.channelCount = 2;\r\n\r\n this.inputChannels = [];\r\n this.bufferSize = options.processorOptions.bufferSize || this.bufferSize;\r\n this.initBuffer();\r\n this.port.postMessage({\r\n type: "msg",\r\n msg: "init"\r\n });\r\n }\r\n\r\n initBuffer() {\r\n this._bytesWritten = 0;\r\n }\r\n\r\n process(inputList) {\r\n // console.warn("process", inputList[0]);\r\n this.port.postMessage({\r\n type: "proces",\r\n len: inputList[0].length\r\n });\r\n if (this.isBufferFull()) {\r\n this.flush();\r\n }\r\n\r\n const _inputChannels = inputList[0];\r\n this.channelCount = _inputChannels.length;\r\n if (_inputChannels && _inputChannels.length) {\r\n // 创建缓存输入\r\n if (!this.inputChannels[0]) {\r\n for (let i = 0; i < this.channelCount; i++) {\r\n this.inputChannels[i] = new Float32Array(this.bufferSize);\r\n }\r\n }\r\n\r\n const bufferLen = _inputChannels[0].length;\r\n for (let j = 0; j < bufferLen; j++) {\r\n for (let i = 0; i < _inputChannels.length; i++) {\r\n this.inputChannels[i][this._bytesWritten] = _inputChannels[i][j];\r\n }\r\n this._bytesWritten++;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n isBufferEmpty() {\r\n return this._bytesWritten === 0;\r\n }\r\n\r\n isBufferFull() {\r\n // console.warn(this._bytesWritten, this.bufferSize, this.channelCount);\r\n return this._bytesWritten === this.bufferSize;\r\n }\r\n\r\n flush() {\r\n this.port.postMessage({\r\n type: "process",\r\n channels: this.inputChannels,\r\n channelCount: this.inputChannels.length,\r\n sampleRate: sampleRate\r\n });\r\n this.initBuffer();\r\n }\r\n}\r\n\r\ntry {\r\n registerProcessor("audio-pcm-data-processor", AudioPcmDataProcessor);\r\n} catch (error) {\r\n // console.warn("registerProcessor", error);\r\n}\r\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.Uo.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.zn.error("zc.mdrcd Exception while creating ZegoMediaRecorder:",t)}this.mediaRecorder.onstop=function(t){i.zn.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.zn.warn("zc.mdrcd please invoke startRecord first")},t.prototype.resumeRecord=function(){this.mediaRecorder?this.mediaRecorder.resume():this.zn.warn("zc.mdrcd please invoke startRecord first")},t.prototype.pauseRecord=function(){this.mediaRecorder?this.mediaRecorder.pause():this.zn.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=si.createElement("a");n.style.display="none",n.href=e,n.download=t+".webm",si.body.appendChild(n),n.click(),setTimeout(function(){si.body.removeChild(n),window.URL.revokeObjectURL(e)},100)}else this.zn.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.zn.info("zc.ssd.0 call"),Gt(t)?i&&(!mi(i)||i<100||i>3e3)?this.zn.error("zc.ssd.0 soundLevel interval must be integer number which is between 100 and 3000"):this.Uo.setSoundLevelDelegate(t,i,e):this.zn.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 m},t.prototype.setStreamExtraInfo=function(t,i){return this.rtcModules.streamCommon.setStreamExtraInfo(t,i)},t.prototype.addPublishCdnUrl=function(t,i){return this.zn.info("zg.cm.apu call "+i,{streamid:t}),this.rtcModules.streamCDNModule?this.rtcModules.streamCDNModule.publishTarget({type:"addpush",streamID:t,pushUrl:i}):fi(["stream CDN"])},t.prototype.removePublishCdnUrl=function(t,i){return this.zn.info("zg.cm.rpu call "+i,{streamid:t}),this.rtcModules.streamCDNModule?this.rtcModules.streamCDNModule.publishTarget({type:"delpush",streamID:t,pushUrl:i}):fi(["stream CDN"])},t.prototype.startMixerTask=function(t){return fi(["mix stream"])},t.prototype.startAutoMixerTask=function(t){return fi(["mix stream"])},t.prototype.setMixerTaskConfig=function(t){return fi(["mix stream"])},t.prototype.stopMixerTask=function(t){return fi(["mix stream"])},t.prototype.stopAutoMixerTask=function(t){return fi(["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(Zg,jb);break;case"MixStream":i.install(t,Em,Zg);break;case"StreamCDN":i.install(t,Zg,Em);break;case"Advance":i.install(t,Zg,Em,tg,qg,Ag,jb,ey);break;case"BeautyEffect":case"VoiceChanger":i.install(t,tg);break;case"RangeAudio":case"DataChannel":case"AiDenoise":case"BackgroundProcess":case"CopyrightedMusic":case"StreamCompositor":i.install(t)}},t.prototype.createRangeAudioInstance=function(){throw hi(["range audio"])},t.prototype.createCopyrightedMusic=function(){throw hi(["copyrighted music"])},t.prototype.destroyCopyrightedMusic=function(){},t.prototype.createRealTimeSequentialDataManager=function(t){throw hi(["data channel"])},t.prototype.destroyRealTimeSequentialDataManager=function(t){throw hi(["data channel"])},t.prototype.enableDataChannel=function(t){Gt(t)&&(this.Uo.isDataChannelEnabled=t)},t.prototype.addTrack=function(t,i){var e=this;return new ni(function(n,s){var r={id:i.id,muted:i.muted,enabled:i.enabled,kind:i.kind,readyState:i.readyState,label:i.label};e.zn.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 ni(function(n,s){e.zn.info("zc.rt call"),e.rtcModules.publishModule.handleTrack("REMOVE",t,i,n,s)})},t.prototype.setBeautyEffect=function(t,i,e){return fi(["beauty effect"])},t.prototype.setLowlightEnhance=function(t,i){return fi(["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.zn.info("zc.caia.0 call"),new ni(function(e,n){if(t=ig(t,i.zn),!i.checkTrackParam(t,1))return i.zn.info("zc.caia.0 param active: false"),e(!1);var s=0;try{var r=0,o=i.Uo.createSoundLevel(i.ac,t,50,50,function(t){t*=100;var n=!1;r>=4?(u.destroy(),(t>0||s>0)&&(n=!0),i.zn.info("zc.caia.0 active: "+n),e(n)):s=Math.max(t,s),r++}),u=o.soundMeter;u&&o.mic||(i.zn.error("zc.cvia.1 checkVideoTrackIsActive not supported"),e(!1))}catch(t){i.zn.error("zc.cvia.1 "+t),e(!1)}})},t.prototype.checkVideoTrackIsActive=function(t){var i=this;this.zn.info("zc.cvia.0 call");var e=this;return new ni(function(n,s){if(t=ig(t,i.zn),!i.checkTrackParam(t,0))return i.zn.info("zc.cvia.1 param active: false"),n(!1);var r=ri(1,1),o=oi(160,120).getContext("2d");o&&(null==o?void 0:o.drawImage)&&(null==o?void 0:o.getImageData)||(e.zn.error("zc.cvia.1 checkVideoTrackIsActive not supported"),n(!1)),r.style.position="fixed",r.style.left="-1000px",r.style.opacity="0.01",si.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.zn.info("zc.cvia.0 active: true"),n(!0),void a();a(),e.zn.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.zn.info("zc.ctp.0 call type:"+i),!Kt(t))return this.zn.error("zc.ctp.1 param 1 must be MediaStream"),!1;var s=this.Uo.checkPreview(t),r=Object.keys(this.Uo.playerList).find(function(i){var e;return(null===(e=n.Uo.playerList[i])||void 0===e?void 0:e.playStream)===t});if(!s&&!r)return this.zn.error("zc.ctp.1 "+bi),!1;var o=t[0==i?"getVideoTracks":"getAudioTracks"]()[0];return o?"live"!==o.readyState||!o.enabled||o.muted?(this.zn.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.Uo.playerList[r])||void 0===e?void 0:e.micStatus):(this.zn.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 Ay(this,void 0,void 0,function(){var e,n=this;return Py(this,function(s){return e=null==t?void 0:t.setSinkId,this.zn.info("zc.saopd call:"+i),[2,new ni(function(s,r){return Ay(n,void 0,void 0,function(){var n,o,u,a=this;return Py(this,function(c){switch(c.label){case 0:if(n=function(t){a.zn.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||!Ht(i))return[2,n({code:ve.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(fn)]:[2,n({code:le,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),Ay(this,void 0,void 0,function(){return Py(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(Gt(t)){var i=this.Dn.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.Uo.checkPreview(t),e=null==i?void 0:i.getViewer();if(!e)throw Error("create viewer failed.");return new Ey(e)},t.prototype.createRemoteViewer=function(t){var i=this.Uo.checkPlayer(t),e=null==i?void 0:i.getViewer();if(!e)throw Error("create viewer failed.");return new Ey(e)},t.prototype.createStreamCompositor=function(){throw hi(["stream compositor"])},t.prototype._enableAiDenoise=function(t,i,e){return e==Ap.AIBalanced||e==Ap.AI||e==Ap.AIAggressive?this.setVoiceChangerPreset(t,{ANS:{enable:i,mode:e}}):this.enableAiDenoise(t,i)},t.prototype.enableAiDenoise=function(t,i){return fi(["ai denoise"])},t.prototype.setAiDenoiseMode=function(t,i){return fi(["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 fi(["voice changer","advanced"])},t.prototype.enableLiveAudioEffect=function(t,i,e){return fi(["voice changer","advanced"])},t.prototype.loadBackgroundBlurModule=function(){return fi(["blur background","advanced"],-1)},t.prototype.initBackgroundModule=function(t,i){return fi(["blur background","advanced"],-1)},t.prototype.setBackgroundBlurOptions=function(t,i){throw hi(["blur background","advanced"])},t.prototype.setVirtualBackgroundOptions=function(t,i){throw hi(["blur background","advanced"])},t.prototype.setTransparentBackgroundOptions=function(t){throw hi(["blur background","advanced"])},t.prototype.enableBackgroundProcess=function(t,i,e){return fi(["advanced"])},t.prototype.enableAutoSwitchDevice=function(t){this.rtcModules.publishModule.enableAutoSwitchDevice(t)},t.prototype.initTracer=function(t){this.Dn.reporter=t;var i=new Ty(this.RTM.stateCenter,this.Dn,this.Uo);this.Ln.setCommonStates(i),this.Ln.setResource({sdk_version:m,report_version:this.Dn.sdkVerNum})},t.prototype.setEngineConfig=function(t){if(t&&this.zn.info("zc.sec.0 "+JSON.stringify(t)),this.checkMaxChannels(t),this.checkRetryTime(t),this.Dn.engineConfig=Dy(Dy({},this.Dn.engineConfig),t),this.checkQualityInterval(),this.Dn.actionListener("_engineConfigUpdate",this.Dn.engineConfig),t.adaptCustomUA){var i=ph();this.Dn.customUa=i.includes("iOS"),this.zn.info("zc.sec.0 custom ua ".concat(i))}Yt(t.setUserInfo)&&this.pg(t.setUserInfo),Gt(t.enableMiniSDP)&&this.stateCenter.setIsMiniSdp(t.enableMiniSDP),this.RTM.setEngineConfig(t)},t.prototype.pg=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.Dn.reporter.setReporterInfo(e,i)},t.prototype.checkQualityInterval=function(){var t=this.Dn.engineConfig,i=t.publishQualityInterval,e=t.playQualityInterval;Vt(i)&&0!==i&&i<T&&(this.Dn.engineConfig.publishQualityInterval=T),Vt(e)&&0!==e&&e<T&&(this.Dn.engineConfig.playQualityInterval=T)},t.prototype.checkMaxChannels=function(t){var i=t.maxChannels;Vt(i)&&(i<1&&(t.maxChannels=1),i>50&&(t.maxChannels=50))},t.prototype.checkRetryTime=function(t){var i=t.roomRetryTime,e=t.streamRetryTime;Vt(i)&&(i<1&&(t.roomRetryTime=1),i>k&&(t.roomRetryTime=k)),Vt(e)&&(e<1&&(t.streamRetryTime=1),e>k&&(t.streamRetryTime=k),this.Dn.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.Dn.appid,logger:this.zn,validateToken:function(t,i){return Ay(e,void 0,void 0,function(){return Py(this,function(e){switch(e.label){case 0:return this.Dn.player265Validated?[2,!0]:[4,this.RTM.fetchAppConfigByTargetToken(t,i)];case 1:return e.sent()&&(this.Dn.player265Validated=!0),[2,!!this.Dn.player265Validated]}})})},isLogin:function(){return e.Dn.rtm&&e.Dn.rtm.stateCenter.roomModulesList.some(function(t){return t.isLogin()})},seiConfig:function(){return e.Dn.seiConfig},addReceiver:function(t){e.Dn.player265ReceiverList.push(t)},removeReceiver:function(t){e.Dn.player265ReceiverList=e.Dn.player265ReceiverList.filter(function(i){return i!=t})}})},t.prototype.setStreamAlignmentProperty=function(t,i){return Ay(this,void 0,void 0,function(){var e,n,s,r;return Py(this,function(o){switch(o.label){case 0:return e="zc.ssap",n=Ht(t),this.zn.info(e+" call. "+(n?t:null==t?void 0:t.id)+" alignment: ".concat(i)),s=null,(s=n?this.Uo.publisherList[t]:this.Uo.checkPublish(t))&&6===s.publisher.state?[4,s.publisher.setStreamAlignmentProperty(i)]:(this.zn.error(e+" failed. setStreamAlignmentProperty failed, stream not published."),[2,!1]);case 1:return r=o.sent(),this.zn.info(e+" end. "+r),[2,r]}})})},t.prototype.setTurnServer=function(t){if(!Xt(t))throw"'setTurnServer' failed. param error.";this.streamCenter.turnServers=My([],t,!0)},t.prototype.destroyEngine=function(){if(this.Dn.engineDestroy)throw new Error("ZegoExpressEngine has been destroyed.");this.destroyEngineHandler(),this.Dn.engineDestroy=!0},t.prototype.uploadLog=function(t){return void 0===t&&(t=!1),this.RTM.uploadLog(t)},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.gg(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.getReportSize=function(){var t;return null===(t=this.RTM.reporter.tracerHandler)||void 0===t?void 0:t.tracer.reportSize()},t.prototype.getFlutterVideoConfig=function(){var t=Ng(this.Dn,this.zn,{});return{encodeWidth:t.width,encodeHeight:t.height,fps:t.frameRate,bitrate:t.bitRate,keyFrameInterval:t.keyFrameInterval}},t.prototype.getFlutterAudioConfig=function(){var t=Ng(this.Dn,this.zn,{});return{bitrate:t.audioBitrate,channel:t.channelCount}},t.prototype.gg=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&&(xy.screenShotReady=!0)});var jy,Ly=function(){return Ly=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},Ly.apply(this,arguments)},qy=function(){function t(t,i){this.bg=t,this._g=i}return t.prototype.start=function(t,i,e,n){this.bg.playEffect(Ly({stream:this._g,effectID:t},i||{}),e,n)},t.prototype.stop=function(t){return this.bg.stopEffect(this._g,t)},t.prototype.pause=function(t){return this.bg.pauseEffect(this._g,t)},t.prototype.resume=function(t){return this.bg.resumeEffect(this._g,t)},t.prototype.setVolume=function(t,i,e){return this.bg.setEffectVolume(this._g,i,t,e)},t.prototype.getTotalDuration=function(t){return this.bg.getEffectDuration(t)},t.prototype.getCurrentProgress=function(t){return this.bg.getEffectCurrentProgress(this._g,t)},t.prototype.seekTo=function(t,i){return this.bg.seekAudioEffect(this._g,t,i)},t}(),Uy=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)}}(),By=function(t){function i(i,e,n){var s=t.call(this,i,e,0,arguments[2])||this;return s.zegoWebRTC=new xy(s.logger,s.dataReport,s.reporter,s.zegoWebRTM,0,null==n?void 0:n.scenario),s}return Uy(i,t),i.prototype.setEngineConfig=function(t){this.zegoWebRTC.setEngineConfig(t)},i.setEngineOptions=function(t){dl.setEngineOptions(t),xy.setEngineOptions(t)},i.setGeoFence=function(t,i){xy.setGeoFence(t,i),dl.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){dl.use(t),xy.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 qy(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(!0)},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.11.0",i}(dl),Jy="zm.scc",Vy="zm.sbcm",Hy="zm.srlm",Gy="zm.sbrm",Fy="zm.schm",Yy="zm.msg.sdr",Zy="zm.msg.rlr",Qy="zm.msg.rps",Xy="zm.msg.srm",Wy="zm.msg.scm",Ky="zm.msg.schm",$y="zm.msg.sbm",tw="zm.msg.bps",iw="zm.sv.ps",ew={code:1100001,msg:"input param error."},nw={code:1100002,msg:"network timeout."},sw={code:1100003,msg:"socket close"},rw={code:1000002,msg:"not login"},ow={code:1009001,msg:"message content is empty"},uw={code:1009002,msg:"content is too long"},aw={code:1009005,msg:"inconsistent room id"},cw={code:1009010,msg:"failed to send message"},hw={code:1009013,msg:"message is too long"},fw={code:1002017,msg:"room extra info key exceed the limit"},lw={code:1002098,msg:"room channel type error"},dw={code:1002099,msg:"room inner error"},vw={code:1102022,msg:"trans send frequently"},mw={code:1009015,msg:"frequency limited."},pw=function(t){return t},gw=function(t){return t},bw=function(t){return t},_w="/sdk/login",yw={event:"/liveroom/send_big_room_message",room_sid_string:pw,error:{INPUT_PARAM:ew,IM_MESSAGE_NULL:ow,IM_CONTENT_TOO_LONG:uw,IM_MESSAGE_TOO_LONG:hw,INCONSISTENT_ROOM_ID:aw,ROOM_NOT_EXIST:rw}},ww={event:"/liveroom/send_custom_command",room_sid_string:pw,request_id:gw,error:{INPUT_PARAM:ew,IM_CONTENT_NULL:ow,IM_CONTENT_TOO_LONG:uw,INCONSISTENT_ROOM_ID:aw,ROOM_NOT_EXIST:rw}},Sw={event:"/liveroom/send_room_message",room_id:gw,room_sid_string:gw,msg_content_size:bw,send_seq:bw,msg_id:bw,error:{INPUT_PARAM:ew,IM_MESSAGE_NULL:ow,IM_MESSAGE_TOO_LONG:hw,ROOM_NOT_EXIST:rw,INCONSISTENT_ROOM_ID:aw}},Ew={event:"/liveroom/set_room_extrainfo",room_id:gw,room_sid_string:pw,key:gw,value:gw,error:{INPUT_PARAM:ew,TRANS_FREQUENTLY:vw,ROOM_ROOMID_INCORRECT:Ut.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"}}},Ow="/liveroom/get_room_extrainfo",Tw=pw,kw=pw,Rw=1000001109,Iw=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"}(jy||(jy={}));var Cw=function(){return Cw=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},Cw.apply(this,arguments)},zw=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())})},Dw=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 Aw=function(){function t(t,i,e,n,s,r){var o=this;this.zn=t,this.Dn=i,this._dataReport=e,this.Gn=n,this._rtm=s,this.An=r,this.yg=0,this.wg=500,this.Sg={},this.Eg=0,this.Og=[],this.Tg=null,this.kg=null,this.Hn=0,this.Rg=0,this.Ig=!1,this.Ng={},this.Cg={},this.zg={},this.roomExtraInfo={},this.Dg=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.zn.warn(Qy+" id name same"):(e.length>0&&o.Dn.actionListener("roomExtraInfoUpdate",o.An.roomID,Object.values(o.roomExtraInfo)),t.forEach(function(t){o.Dn.actionListener("recvReliableMessage",t.trans_type,t.trans_seq,t.trans_data)}))}}return Object.defineProperty(t.prototype,"Ln",{get:function(){return this.Dn.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&&Ht(r)){var a=parseFloat(r);this.Hn=0==a?0:+r-(new Date).getTime()}if(o&&ii(o)&&(this.Rg=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.Cg[i]||n.Cg[i].seq<t.trans_seq})).map(function(t){return{trans_type:t.trans_type,trans_local_seq:t.trans_seq}})).length>0&&this.Ag(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.zn.info("zb.mh.futm.0 call");var n=function(t){e.Pg(t)};this.Gn.fetchUserTransInfo({trans_channel:t,fetch_array:i},n,n,this.An),this.zn.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.zg[s]||(i.zg[s]={}),!i.zg[s][e]||i.zg[s][e].seq<n}),r.length>0&&n.fetchUserTransMessage(s,r)},n=this,s=0;s<t.length;s++)e(s)},t.prototype.Pg=function(t){if(t.body&&0!=t.body.err_code)this.zn.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.zg[e]||(this.zg[e]={}),!this.zg[e][o]||this.zg[e][o].seq<u?(this.zg[e][o]={seq:u},n.push(r)):this.zn.warn("zb.mh.hfutr fetch trans seq wrong"),this.zn.info("zb.mh.hfutr trans "+o+" seq "+u)}n.length>0&&this.Dn.actionListener("_userTransUpdate",this.An.roomID,e,n),this.zn.info("zb.mh.hfutr call success")}}else this.zn.error("zb.mh.hfutr user trans send error "+JSON.stringify(t))},t.prototype.sendReliableMessage=function(t,i,e,n){var s=this;if(this.zn.info(Yy+" call"),!this.An.isLogin())return this.zn.error(Yy+" state error"),void(n&&n(rw));if(this.Ig)return this.zn.error(Yy+" send too often"),void n(Ew.error.TRANS_FREQUENTLY);this.Cg[t]||(this.Cg[t]={seq:0});var r={trans_type:t,trans_data:i,trans_local_seq:this.Cg[t].seq,trans_channel:"clt"};this.Ig=!0;this.Gn.sendReliableMessage(r,function(n){s.Cg[t].seq=n.body.trans_seq,s.zn.info(Yy+" trans "+t+" seq "+n.body.trans_seq),s.Ig=!1,s.roomExtraInfo[t]={key:t,value:i,updateUser:{userID:s.An.userID,userName:s.An.userName},updateTime:Date.now()},e({seq:n.header.seq,errorCode:0})},function(t){var i=dw;s.zn.error(Yy+" fail "+JSON.stringify(t)),t.body&&t.body.err_code?(i=s._rtm.getServerError(t.body.err_code,t.body.err_message),s.zn.error(Yy+" "+i.msg)):i=t,s.Ig=!1,n(i)},this.An)},t.prototype.Ag=function(t,i){var e=this,n={trans_channel:t,fetch_array:i},s=this.Ln.createSpan(jy.H,{key:_w,par:this.An.roomID},{key:""},Ow);s.setAttributes({fetch_array:Tw(i)});var r=function(t){e.Mg(t,s)};this.Gn.fetchReliableMessage(n,r,r,this.An),this.zn.info("zm.msg.frm call success")},t.prototype.Mg=function(t,i){if(t.body&&0!=t.body.err_code)return this.zn.error(Zy+" trans send error "+t.body.err_code),void this.Dn.reporter.setError(i,{code:t.body.err_code});if(!t.header||!t.body)return this.zn.error(Zy+" trans send error "+t),void this.Dn.reporter.setError(i,nw);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!==Rw){var u=o.trans_type,a=o.trans_seq;s.push({trans_type:u,trans_seq:a}),o.err_code!==Iw?!this.Cg[u]||this.Cg[u].seq<a?(this.Cg[u]={seq:a},n.push(o)):this.zn.warn(Zy+" fetch trans seq wrong"):(this.zn.warn(Zy+" fetch trans seq is wrong "+o.err_code),this.Cg[u]={seq:a})}else this.zn.warn(Zy+" fetch trans unknown type "+o.err_code)}this.roomExtraInfo={},n.length>0&&this.Dg(n)}i.setAttributes({result_array:kw(s)}),i.end()},t.prototype.handlePushTransMsg=function(t){var i,e,n=t.body.trans_type,s=t.body.trans_seq;!this.Cg[n]||this.Cg[n].seq<s?(this.Cg[n]={seq:s},this.Dg([t.body],(null===(i=null==t?void 0:t.body)||void 0===i?void 0:i.trans_idname)===this.Dn.idName||(null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.id_name)===this.Dn.idName)):this.zn.warn(Qy+" trans seq wrong"),this.zn.info(Qy+" trans "+n+" seq "+s)},t.prototype.handlePushUserTransMsg=function(t){this.zn.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.zg[e]||(this.zg[e]={}),(!this.zg[e][r]||this.zg[e][r].seq<o)&&(this.zg[e][r]={seq:o},n.push(i[s]))}n.length>0?this.Dn.actionListener("_userTransUpdate",this.An.roomID,e,n):this.zn.warn("zb.mh.hputr.0 no fetch user trans")}else this.zn.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.An.isLogin())return this.zn.error(Xy+" state error"),r(rw),!1;var a=Date.parse(new Date+"");if(this.yg>0&&this.yg+this.wg>a)return this.zn.info(Xy+" freq error"),r&&r(mw,0,t,n),!1;this.yg=a;var c=this.Gn.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,s=dw;if(!t.header||!t.body)return t.code&&t.msg&&(s=t),void r({seq:0,errorCode:s.code,messageID:0});n=(i=[u._rtm.getServerError(t.body.err_code,null===(e=t.body)||void 0===e?void 0:e.err_message),t.body.msg_id])[1],u.zn.error(Xy+" "+(s=i[0]).msg),s==nw&&(s=cw),r({seq:t.header.seq,errorCode:s.code,messageID:n,message:s.msg})},this.An);return this.Ln.spanSetAttributes({key:Sw.event,par:null===(o=this.An)||void 0===o?void 0:o.roomID},{send_seq:Sw.send_seq(c)}),this.zn.info(Xy+" 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.Dn.actionListener("IMRecvBroadcastMessage",this.An.roomID,i),this.Dn.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.An.isLogin())return this.zn.error(Wy+" state error"),n(rw),!1;var o={from_userid:this.Dn.idName,from_username:this.Dn.nickName,request_id:this.Dn.getRequestId(),custom_content:i||"",room_id:this.An.roomID};this.Ln.spanSetAttributes({key:ww.event,par:null===(s=this.An)||void 0===s?void 0:s.roomID},{request_id:ww.request_id(o.request_id)});var u={dest_id_name:t,custom_msg:JSON.stringify(o)};return this.Gn.sendCustomCommand(u,function(t){e({seq:t.header.seq,errorCode:0})},function(t){var i,e,s,o,u,a=dw;a=t.body&&t.body.err_code?r._rtm.getServerError(t.body.err_code,null===(i=t.body)||void 0===i?void 0:i.err_message):t,r.zn.error(Wy+" "+a.msg),u=2===(null===(e=t.body)||void 0===e?void 0:e.err_code)||1000000002===(null===(s=t.body)||void 0===s?void 0:s.err_code)?ew:a==nw?cw:a,n({seq:(null===(o=t.header)||void 0===o?void 0:o.seq)||-1,errorCode:u.code,code:u.code,message:u.msg})},this.An),this.zn.info(Wy+" call success"),!0},t.prototype.handlePushChannelMsg=function(t){var i=t.body;if(0===i.channel_type){this.Dn.actionListener("_experimentalAPICallback",{method:"onRecvRoomChannelMessage",content:{roomID:this.An.roomID,sendIDName:i.sender_idname,sendNickName:i.sender_nickname,msgType:i.msg_type,msgContent:i.msg_content}})}},t.prototype.handlePushTransparentMsg=function(t){var i=t.body,e=i.sender_idname,n=i.sender_nickname,s=i.client_seq,r=i.msg_data,o=this.Ng[e],u=!1;o&&s?Jt.isLong(s)&&Jt.isLong(o)&&s.gt(o)&&(u=!0):u=!0,this.Ng[e]=s,u&&this.Dn.actionListener("recvRoomTransparentMessage",this.An.roomID,{sendUser:{userID:e,userName:n},content:r})},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.Dn.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.An.isLogin())return this.zn.error(Ky+" state error"),r(rw),!1;return this.Gn.sendRoomChannelMessage({channelType:t,msgType:i,msgContent:e,toUserIDList:n},this.An.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.zn.error(Ky+" err:"+JSON.stringify(i)),[2].includes(i.code)?i.code=ew.code:[3].includes(i.code)?i.code=uw.code:i=i.code==nw.code?Cw({},cw):i.code==sw.code?Cw({},sw):{code:dw.code,msg:"liveroom error ".concat(i.code," ").concat(i.msg)},r(i)}),this.zn.info(Ky+" call success"),!0},t.prototype.sendTransparentMessage=function(t,i,e,n,s,r,o){var u,a,c=this,h="zm.msg.stpm";if(!this.An.isLogin())return this.zn.error(h+" state error"),void o(rw);0===i?a=0:a=(null===(u=this.Dn.rtm)||void 0===u?void 0:u.getNetworkInfo().timestamp)||Date.now();var f={msg_type:t,msg_data:e,to_user_list:n.map(function(t){return eh(t.userID)}),client_seq:Jt.fromInt(a)};this.Gn.sendTransparentMessage(f,this.An.roomID,s||10,function(t){r({seq:t.header.seq,errorCode:0})},function(t){var i=c.xg(t,h);o(i)}),this.zn.info(h+" call success")},t.prototype.sendBigRoomMessage=function(t,i,e,n,s,r){var o=this;if(!this.An.isLogin())return this.zn.error($y+" state error"),void(r&&r(rw));var u=this.Rg,a=this.Hn,c=(new Date).getTime()+a,h=this._rtm.getSeq().toString();if(this.Sg[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.Eg<f&&0==this.Og.length)this.Eg=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.Og.push({msg_category:t,msg_type:1,msg_content:n,bigmsg_client_id:h}),1==this.Og.length&&this.setBigImTimer(a,u)}},t.prototype.sendBigRoomMessageInternal=function(t,i,e){this.Gn.sendBigRoomMessage({msgs:t},function(t){i(t)},function(t){var i,n,s;t.header&&t.body?s=t.body?{code:null===(i=t.body)||void 0===i?void 0:i.err_code,msg:null===(n=t.body)||void 0===n?void 0:n.err_message}:dw:(t.code&&t.msg&&(s=t),e(s)),e(s)},this.An),this.zn.info($y+" sendBigRoomMessage called")},t.prototype.handleBigImMsgRsp=function(t){this.Rg=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.Sg[n]){var s=this.Sg[n].success;null!=s&&s({seq:t.header.seq,errorCode:0,messageID:i[e].msg_id||i[e].bigmsg_id}),delete this.Sg[n]}}},t.prototype.setBigImTimer=function(t,i){var e=this,n=(new Date).getTime()+t,s=i-n%i,r=function(t){e.Tg=setTimeout(function(){e.onBigImTimer()},t)};(function(t){return zw(this,void 0,void 0,function(){var i;return Dw(this,function(e){switch(e.label){case 0:return[4,Ti()];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.Hn;this.Eg=Math.floor(i/this.Rg);for(var e=[],n=[],s=0;s<this.Og.length&&!(s>=20);s++){var r=this.Og[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.Og.length>20?this.Og.splice(0,20):this.Og=[],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.Sg[r];o&&(null!=o.error&&o.error(i,e),delete t.Sg[r])}}),this.Tg&&clearTimeout(this.Tg),this.Tg=null,this.Og.length>0&&this.setBigImTimer(this.Hn,this.Rg)},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(Ht(t))try{i=JSON.parse(t)}catch(t){return void this.zn.warn(tw+"parse json error")}else i=t;if(i){for(var e=i.room_id||this.An.roomID,n=[],s=i.msg_list||i.msg_data,r=0;r<s.length;r++){var o=s[r];o.id_name!=this.Dn.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.zn.info(tw+" self message")}0==n.length?this.zn.info(tw+" no other pushData except self"):this.onRecvBigRoomMessage(n,e),this.zn.info(tw+"call success")}else this.zn.warn(tw+" 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.Dn.actionListener("IMRecvBarrageMessage",i,e),this.Dn.actionListener("_recvBigRoomMessage",t,i)},t.prototype.resetMessageInfo=function(){this.Cg={},this.kg&&(clearTimeout(this.kg),this.kg=null),this.Eg=0,this.Og=[],this.Sg={},this.Tg&&(clearTimeout(this.Tg),this.Tg=null),this.Hn=0,this.Rg=0},t.prototype.xg=function(t,i){var e=dw;return e=t.body&&t.body.err_code?Lo(t.body.err_code,t.body.err_message):t,this.zn.error(i+" err:"+Oi(e)),[2].includes(e.code)?e.code=ew.code:[3].includes(e.code)?e.code=uw.code:e=e.code==nw.code?Cw({},cw):e.code==sw.code?Cw({},sw):{code:dw.code,msg:"liveroom error ".concat(e.code," ").concat(e.msg)},e},t.prototype.deleteTransparentUser=function(t){delete this.Ng[t]},t}();function Pw(t,i,e,n){return{interResolve:function(e){i(e),t.end()},interReject:function(i,s){void 0===s&&(s="");var r=i.errorCode||i.code,o=i.message||i.msg||""+s,u=r;if(r<1e6){t.setAttributes({server_code:r});var a=void 0;n&&n[r]?r=(a=n[r]).code:(a=Uo(r,i.msg||""),r=dw.code),u=a.code}t.setAttributes({error:u,message:o}),t.end(),e({errorCode:r})}}}function Mw(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(Sw.event,t,!0),a=Pw(u,function(t){u.setAttributes({msg_id:Sw.msg_id(t.messageID)}),r(t)},o,{3:hw}),c=a.interResolve,h=a.interReject;if(!Ht(t))return s.logger.error(Vy+" roomid must be string"),void h(Sw.error.INPUT_PARAM," param roomID error");if(!Ht(i))return s.logger.error(Vy+" message must be string"),void h(Sw.error.INPUT_PARAM," param message error");if(0===i.length)return s.logger.error(Vy+" message is empty"),void h(Sw.error.IM_MESSAGE_NULL);if(sh(i)>Nw)return s.logger.error(Vy+" message is too long"),void h(Sw.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()?Sw.error.ROOM_NOT_EXIST:Sw.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 xw(t,i,e){var n=this;return new Promise(function(s,r){var o=n.getMsgSpan(ww.event,t,!0),u=Pw(o,s,r,{3:uw}),a=u.interResolve,c=u.interReject;if(!Ht(t))return n.logger.error(Jy+" roomID must be string"),void c(ww.error.INCONSISTENT_ROOM_ID," roomID must be string");if(!Xt(e)||e.find(function(t){return!Ht(t)}))return n.logger.error(Jy+" toUserIDList must be string array"),void c(ww.error.INPUT_PARAM," param toUserList error");if(!Ht(i)&&!Yt(i))return n.logger.error(Jy+" command must be a string or object"),void c(ww.error.IM_CONTENT_NULL," command type error");var h=n.getRoomModules(t),f=Ht(i)?i:JSON.stringify(i);return sh(f)>Nw?(n.logger.error(Jy+" command too long"),void c(ww.error.IM_CONTENT_TOO_LONG)):0===f.length?(n.logger.error(Jy+" command empty"),void c(ww.error.IM_CONTENT_NULL)):(o.setAttributes({msg_content:f}),h?void h.messageHandler.sendCustomCommand(e,i,a,c):(n.logger.error(Jy+" room not exist, roomID: "+t),void c(n.isDisConnect()?ww.error.ROOM_NOT_EXIST:ww.error.INCONSISTENT_ROOM_ID)))})}function jw(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(yw.event,t),a=Pw(u,r,o,{3:uw}),c=a.interResolve,h=a.interReject;if(!Ht(t))return s.logger.error(Gy+" roomid must be string"),void h(yw.error.ROOM_NOT_EXIST," param roomID error");if(!Ht(i))return s.logger.error(Gy+" message must be string"),void h(yw.error.IM_MESSAGE_NULL);if(0===i.length)s.logger.error(Gy+" message is empty"),h(yw.error.IM_MESSAGE_NULL);else if(sh(i)>Nw)return s.logger.error(Gy+" message is too long"),void h(s.stateCenter.isFlutter?yw.error.IM_CONTENT_TOO_LONG:yw.error.IM_MESSAGE_TOO_LONG);u.setAttributes({msg_content:i});var f=s.getRoomModules(t);if(!f)return s.logger.error(Gy+" room not exist, roomID: "+t),void h(s.isDisConnect()?yw.error.ROOM_NOT_EXIST:yw.error.INCONSISTENT_ROOM_ID);f.messageHandler.sendBigRoomMessage(e,n,t,i,c,h)})}function Lw(t,i,e){var n=this;return new Promise(function(s,r){var o=n.getMsgSpan(Ew.event,t),u=Pw(o,s,r,{1015:fw}),a=u.interResolve,c=u.interReject;if(!Ht(t))return n.logger.error(Vy+" roomid must be string"),void c(Ew.error.ROOM_ROOMID_INCORRECT," roomID must be string");if(0===t.length)return n.logger.error(Vy+" roomid is empty"),void c(Ew.error.ROOM_ROOMID_INCORRECT," roomid is empty");if(!Ht(i))return n.logger.error(Hy+" key must be string"),void c(Ew.error.KEY_EMPTY," key must be string");if(0===i.length)return n.logger.error(Hy+" key is empty"),void c(Ew.error.KEY_EMPTY);if(i.length>128)return n.logger.error(Hy+" key is too long"),void c(Ew.error.KEY_TOO_LONG);if(!Ht(e))return n.logger.error(Hy+" value must be string"),void c(Ew.error.INPUT_PARAM," value must be string");if(e.length>4096)return n.logger.error(Hy+" value is too long"),void c(Ew.error.VALUE_TOOL_LONG);o.setAttributes({key:Ew.key(i),value:Ew.value(e)});var h=n.getRoomModules(t);if(!h)return n.logger.error(Hy+" room not exist, roomID: "+t),void c(Ew.error.ROOM_ROOMID_INCORRECT);h.messageHandler.sendReliableMessage(i,e,a,c)})}var qw={_sendBroadcastMessage:Mw,sendBroadcastMessage:function(t,i){var e=this;return new Promise(function(n,s){Mw.call(e,t,i).then(function(t){n({errorCode:t.errorCode,messageID:t.messageID,extendedData:t.extendedData})}).catch(function(t){s(t)})})},_sendCustomCommand:xw,sendCustomCommand:function(t,i,e){var n=this;return new Promise(function(s,r){xw.call(n,t,i,e).then(function(t){s({errorCode:t.errorCode,extendedData:t.extendedData})}).catch(function(t){r(t)})})},_sendBarrageMessage:jw,sendBarrageMessage:function(t,i){var e=this;return new Promise(function(n,s){jw.call(e,t,i).then(function(t){n({errorCode:t.errorCode,messageID:t.messageID,extendedData:t.extendedData})}).catch(function(t){s(t)})})},_setRoomExtraInfo:Lw,setRoomExtraInfo:function(t,i,e){return Lw.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(Fy+i),u({errorCode:t.code,extendedData:t.msg+i})};if(0===i)if(Ht(t))if(mi(e))if(Xt(s)&&!s.find(function(t){return!Ht(t)}))if(Ht(n))if(sh(n)>Nw)a(uw," msgContent too long");else if(0!==n.length){var c=r.getRoomModules(t);if(!c)return r.logger.error(Fy+" room not exist, roomID: "+t),void a(r.isDisConnect()?ww.error.ROOM_NOT_EXIST:ww.error.INCONSISTENT_ROOM_ID);c.messageHandler.sendRoomChannelMessage(i,e,n,s,function(){o({errorCode:0,extendedData:""})},a)}else a(ew," msgContent empty");else a(ew," msgContent must be a string");else a(ew," toUserIDList must be string array");else a(ew," msgType must be integer number");else a(ew," roomID must be string");else a(lw)})},sendTransparentMessage:function(t,i){var e=this;return new Promise(function(n,s){var r="zm.stpm",o=function(t,i){void 0===i&&(i=""),i&&e.logger.error(r+" "+i),s({errorCode:t.code,extendedData:t.msg+i})};if(!Ht(t)||t.length>127||!di(t))o(aw);else if(Yt(i)){var u=i.sendMode,a=i.sendType,c=i.content,h=i.recvUserList,f=i.timeOut;if([0,1,2].includes(u))if([0,1].includes(a))if(c)if(Wt(c))if(c.byteLength)if(c.byteLength>4096)o(uw);else if(Xt(h)&&!h.find(function(t){return!Ht(t.userID)}))if(Ft(f)||mi(f)){var l=e.getRoomModules(t);if(!l)return e.logger.error(r+" room not exist, roomID: "+t),void o(e.isDisConnect()?rw:aw);l.messageHandler.sendTransparentMessage(u,a,c,h,f,function(){n({errorCode:0,extendedData:""})},o)}else o(ew,"message content type error");else o(ew,"recvUserList must be ZegoUser Array");else o(ow);else o(ew,"message content type error");else o(ow);else o(ew,"message sendType error");else o(ew,"message sendMode error")}else o(ew,"message must be object")})}};var Uw={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(iw+" room no found ignore "+JSON.stringify(t))},handlePushTransMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushTransMsg(i[1])},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(iw+" 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(iw+" room no found ignore "+JSON.stringify(t))},handlePushChannelMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushChannelMsg(i[1])},handlePushTransparentMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushTransparentMsg(i[1])}};var Bw={initMessageHandler:function(){this.messageHandler=new Aw(this.logger,this.stateCenter,this.dataReport,this.liveRoomHandler,this.rtm,this)}},Jw={type:"Message",install:function(t,i,e){for(var n in qw)Object.defineProperty(t.prototype,n,{value:qw[n],writable:!1});for(var n in Uw)Object.defineProperty(e.prototype,n,{value:Uw[n],writable:!1});for(var n in Bw)Object.defineProperty(i.prototype,n,{value:Bw[n],writable:!1})}},Vw=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())})},Hw=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])}}},Gw=function(){function t(t,i){this.zegoWebRTC=t,this.roomID=i,this.pubDataChannelList=[],this.subDataChannelList=[],this.listenerList={receiveRealTimeSequentialData:[]},this.zn=t.logger}return t.prototype.startBroadcasting=function(t,i){return Vw(this,void 0,void 0,function(){var i,e,n,s,r,o;return Hw(this,function(u){switch(u.label){case 0:if(ui(this.zn,i="dc.sb.0"),this.pubDataChannelList.includes(t))return this.zn.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.zn.error(i+" publish datachannel no exist, try other stream ID"),[2,!1];if(this.broadcastStream)return[3,2];n=si.createElement("canvas"),s=void 0;try{s=n.captureStream()}catch(t){return this.zn.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),ai(this.zn,i),[2,o]}})})},t.prototype.stopBroadcasting=function(t){var i="dc.sb.1";ui(this.zn,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),ai(this.zn,i),!0):(this.zn.error(i+" datachannel no found"),!1)},t.prototype.sendRealTimeSequentialData=function(t,i){if(!(i instanceof ArrayBuffer))return this.zn.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.zn.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 Vw(this,void 0,void 0,function(){var i,s,r;return Hw(this,function(o){switch(o.label){case 0:return ui(this.zn,i="dc.ss.0"),this.subDataChannelList.includes(t)?(this.zn.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),ai(this.zn,i),[2,!0]):(this.zn.error(i+" datachannel no exist, try other stream ID"),[2,!1])}})})},t.prototype.stopSubscribing=function(t){var i="dc.ss.1";ui(this.zn,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),ai(this.zn,i),!0):(this.zn.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]?Qt(i)?(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0):(this.zn.error("zc.o.0 listener callBack must be funciton"),!1):(this.zn.error("dc.o.0 event "+t+" no found"),!1)},t.prototype.deleteListener=function(t,i){if(!this.listenerList[t])return this.zn.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.zn.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 ui(this.zn,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,ai(this.zn,i)},t}(),Fw=function(){function t(t,i){this._roomID=i,this.jg=new Gw(t,i)}return t.prototype.reset=function(){this.jg.reset()},Object.defineProperty(t.prototype,"roomID",{get:function(){return this._roomID},enumerable:!1,configurable:!0}),t.prototype.startBroadcasting=function(t){return this.jg.startBroadcasting(t)},t.prototype.stopBroadcasting=function(t){return this.jg.stopBroadcasting(t)},t.prototype.sendRealTimeSequentialData=function(t,i){return this.jg.sendRealTimeSequentialData(t,i)},t.prototype.startSubscribing=function(t){return this.jg.startSubscribing(t)},t.prototype.stopSubscribing=function(t){return this.jg.stopSubscribing(t)},t.prototype.on=function(t,i){this.jg.on(t,i)},t.prototype.off=function(t,i){this.jg.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 Fw(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})}},Zw=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)}}();By.use(Jw),By.use(Yw);var Qw=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Zw(i,t),i}(By)}(),u}()});