diff --git a/Release/ArRTC@latest.js b/Release/ArRTC@latest.js index ec79cf4..ef56539 100644 --- a/Release/ArRTC@latest.js +++ b/Release/ArRTC@latest.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ArRTC=t():e.ArRTC=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=134)}([function(e,t,n){var r=n(1),i=n(7),o=n(15),a=n(11),s=n(18),c=function(e,t,n){var u,d,f,l,p=e&c.F,h=e&c.G,v=e&c.S,m=e&c.P,_=e&c.B,y=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,g=h?i:i[t]||(i[t]={}),S=g.prototype||(g.prototype={});for(u in h&&(n=t),n)f=((d=!p&&y&&void 0!==y[u])?y:n)[u],l=_&&d?s(f,r):m&&"function"==typeof f?s(Function.call,f):f,y&&a(y,u,f,e&c.U),g[u]!=f&&o(g,u,l),m&&S[u]!=f&&(S[u]=f)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(4);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(51)("wks"),i=n(30),o=n(1).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){var r=n(20),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=!n(2)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(3),i=n(91),o=n(27),a=Object.defineProperty;t.f=n(8)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(25);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(1),i=n(15),o=n(14),a=n(30)("src"),s=n(139),c=(""+s).split("toString");n(7).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,n){var r=n(0),i=n(2),o=n(25),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){"use strict";var r=n(124),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n0?r:n)(e)}},function(e,t,n){var r=n(47),i=n(29),o=n(16),a=n(27),s=n(14),c=n(91),u=Object.getOwnPropertyDescriptor;t.f=n(8)?u:function(e,t){if(e=o(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(0),i=n(7),o=n(2);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},function(e,t,n){var r=n(18),i=n(46),o=n(10),a=n(6),s=n(107);e.exports=function(e,t){var n=1==e,c=2==e,u=3==e,d=4==e,f=6==e,l=5==e||f,p=t||s;return function(t,s,h){for(var v,m,_=o(t),y=i(_),g=r(s,h,3),S=a(y.length),E=0,T=n?p(t,S):c?p(t,0):void 0;S>E;E++)if((l||E in y)&&(m=g(v=y[E],E,_),e))if(n)T[E]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return E;case 2:T.push(v)}else if(d)return!1;return f?-1:u||d?d:T}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";if(n(8)){var r=n(31),i=n(1),o=n(2),a=n(0),s=n(62),c=n(87),u=n(18),d=n(43),f=n(29),l=n(15),p=n(44),h=n(20),v=n(6),m=n(118),_=n(33),y=n(27),g=n(14),S=n(48),E=n(4),T=n(10),C=n(79),b=n(34),R=n(36),w=n(35).f,I=n(81),O=n(30),A=n(5),N=n(23),D=n(52),P=n(49),k=n(83),x=n(41),L=n(55),M=n(42),U=n(82),F=n(109),V=n(9),j=n(21),B=V.f,G=j.f,W=i.RangeError,H=i.TypeError,K=i.Uint8Array,J=Array.prototype,z=c.ArrayBuffer,Y=c.DataView,X=N(0),q=N(2),Q=N(3),$=N(4),Z=N(5),ee=N(6),te=D(!0),ne=D(!1),re=k.values,ie=k.keys,oe=k.entries,ae=J.lastIndexOf,se=J.reduce,ce=J.reduceRight,ue=J.join,de=J.sort,fe=J.slice,le=J.toString,pe=J.toLocaleString,he=A("iterator"),ve=A("toStringTag"),me=O("typed_constructor"),_e=O("def_constructor"),ye=s.CONSTR,ge=s.TYPED,Se=s.VIEW,Ee=N(1,(function(e,t){return we(P(e,e[_e]),t)})),Te=o((function(){return 1===new K(new Uint16Array([1]).buffer)[0]})),Ce=!!K&&!!K.prototype.set&&o((function(){new K(1).set({})})),be=function(e,t){var n=h(e);if(n<0||n%t)throw W("Wrong offset!");return n},Re=function(e){if(E(e)&&ge in e)return e;throw H(e+" is not a typed array!")},we=function(e,t){if(!E(e)||!(me in e))throw H("It is not a typed array constructor!");return new e(t)},Ie=function(e,t){return Oe(P(e,e[_e]),t)},Oe=function(e,t){for(var n=0,r=t.length,i=we(e,r);r>n;)i[n]=t[n++];return i},Ae=function(e,t,n){B(e,t,{get:function(){return this._d[n]}})},Ne=function(e){var t,n,r,i,o,a,s=T(e),c=arguments.length,d=c>1?arguments[1]:void 0,f=void 0!==d,l=I(s);if(null!=l&&!C(l)){for(a=l.call(s),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);s=r}for(f&&c>2&&(d=u(d,arguments[2],2)),t=0,n=v(s.length),i=we(this,n);n>t;t++)i[t]=f?d(s[t],t):s[t];return i},De=function(){for(var e=0,t=arguments.length,n=we(this,t);t>e;)n[e]=arguments[e++];return n},Pe=!!K&&o((function(){pe.call(new K(1))})),ke=function(){return pe.apply(Pe?fe.call(Re(this)):Re(this),arguments)},xe={copyWithin:function(e,t){return F.call(Re(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return $(Re(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return U.apply(Re(this),arguments)},filter:function(e){return Ie(this,q(Re(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Z(Re(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Re(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Re(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Re(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Re(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ue.apply(Re(this),arguments)},lastIndexOf:function(e){return ae.apply(Re(this),arguments)},map:function(e){return Ee(Re(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Re(this),arguments)},reduceRight:function(e){return ce.apply(Re(this),arguments)},reverse:function(){for(var e,t=Re(this).length,n=Math.floor(t/2),r=0;r1?arguments[1]:void 0)},sort:function(e){return de.call(Re(this),e)},subarray:function(e,t){var n=Re(this),r=n.length,i=_(e,r);return new(P(n,n[_e]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===t?r:_(t,r))-i))}},Le=function(e,t){return Ie(this,fe.call(Re(this),e,t))},Me=function(e){Re(this);var t=be(arguments[1],1),n=this.length,r=T(e),i=v(r.length),o=0;if(i+t>n)throw W("Wrong length!");for(;o255?255:255&r),i.v[p](n*t+i.o,r,Te)}(this,n,e)},enumerable:!0})};g?(h=n((function(e,n,r,i){d(e,h,u,"_d");var o,a,s,c,f=0,p=0;if(E(n)){if(!(n instanceof z||"ArrayBuffer"==(c=S(n))||"SharedArrayBuffer"==c))return ge in n?Oe(h,n):Ne.call(h,n);o=n,p=be(r,t);var _=n.byteLength;if(void 0===i){if(_%t)throw W("Wrong length!");if((a=_-p)<0)throw W("Wrong length!")}else if((a=v(i)*t)+p>_)throw W("Wrong length!");s=a/t}else s=m(n),o=new z(a=s*t);for(l(e,"_d",{b:o,o:p,l:a,e:s,v:new Y(o)});fdocument.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(93),i=n(66).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(10),o=n(65)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(5)("unscopables"),i=Array.prototype;null==i[r]&&n(15)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(9).f,i=n(14),o=n(5)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(0),i=n(25),o=n(2),a=n(69),s="["+a+"]",c=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),d=function(e,t,n){var i={},s=o((function(){return!!a[e]()||"​…"!="​…"[e]()})),c=i[e]=s?t(f):a[e];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},f=d.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(u,"")),e};e.exports=d},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(1),i=n(9),o=n(8),a=n(5)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(11);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&c&&n.push({ssrc:c});var d=r.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var a=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;id;)if((s=c[d++])!=s)return!0}else for(;u>d;d++)if((e||d in c)&&c[d]===n)return e||d||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(24);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(5)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(3);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(48),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},function(e,t,n){"use strict";n(111);var r=n(11),i=n(15),o=n(2),a=n(25),s=n(5),c=n(84),u=s("species"),d=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var l=s(e),p=!o((function(){var t={};return t[l]=function(){return 7},7!=""[e](t)})),h=p?!o((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[u]=function(){return n}),n[l](""),!t})):void 0;if(!p||!h||"replace"===e&&!d||"split"===e&&!f){var v=/./[l],m=n(a,l,""[e],(function(e,t,n,r,i){return t.exec===c?p&&!i?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),_=m[0],y=m[1];r(String.prototype,e,_),i(RegExp.prototype,l,2==t?function(e,t){return y.call(e,this,t)}:function(e){return y.call(e,this)})}}},function(e,t,n){var r=n(18),i=n(106),o=n(79),a=n(3),s=n(6),c=n(81),u={},d={};(t=e.exports=function(e,t,n,f,l){var p,h,v,m,_=l?function(){return e}:c(e),y=r(n,f,t?2:1),g=0;if("function"!=typeof _)throw TypeError(e+" is not iterable!");if(o(_)){for(p=s(e.length);p>g;g++)if((m=t?y(a(h=e[g])[0],h[1]):y(e[g]))===u||m===d)return m}else for(v=_.call(e);!(h=v.next()).done;)if((m=i(v,y,h.value,t))===u||m===d)return m}).BREAK=u,t.RETURN=d},function(e,t,n){var r=n(1).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(1),i=n(0),o=n(11),a=n(44),s=n(28),c=n(59),u=n(43),d=n(4),f=n(2),l=n(55),p=n(39),h=n(70);e.exports=function(e,t,n,v,m,_){var y=r[e],g=y,S=m?"set":"add",E=g&&g.prototype,T={},C=function(e){var t=E[e];o(E,e,"delete"==e||"has"==e?function(e){return!(_&&!d(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return _&&!d(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof g&&(_||E.forEach&&!f((function(){(new g).entries().next()})))){var b=new g,R=b[S](_?{}:-0,1)!=b,w=f((function(){b.has(1)})),I=l((function(e){new g(e)})),O=!_&&f((function(){for(var e=new g,t=5;t--;)e[S](t,t);return!e.has(-0)}));I||((g=t((function(t,n){u(t,g,e);var r=h(new y,t,g);return null!=n&&c(n,m,r[S],r),r}))).prototype=E,E.constructor=g),(w||O)&&(C("delete"),C("has"),m&&C("get")),(O||R)&&C(S),_&&E.clear&&delete E.clear}else g=v.getConstructor(t,e,m,S),a(g.prototype,n),s.NEED=!0;return p(g,e),T[e]=g,i(i.G+i.W+i.F*(g!=y),T),_||v.setStrong(g,e,m),g}},function(e,t,n){for(var r,i=n(1),o=n(15),a=n(30),s=a("typed_array"),c=a("view"),u=!(!i.ArrayBuffer||!i.DataView),d=u,f=0,l="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=i[l[f++]])?(o(r.prototype,s,!0),o(r.prototype,c,!0)):d=!1;e.exports={ABV:u,CONSTR:d,TYPED:s,VIEW:c}},function(e,t,n){var r=n(4),i=n(1).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){t.f=n(5)},function(e,t,n){var r=n(51)("keys"),i=n(30);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(1).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(4),i=n(3),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(18)(Function.call,n(21).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(4),i=n(68).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){"use strict";var r=n(20),i=n(25);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){var r=n(20),i=n(25);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(31),i=n(0),o=n(11),a=n(15),s=n(41),c=n(105),u=n(39),d=n(36),f=n(5)("iterator"),l=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,v,m,_){c(n,t,h);var y,g,S,E=function(e){if(!l&&e in R)return R[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},T=t+" Iterator",C="values"==v,b=!1,R=e.prototype,w=R[f]||R["@@iterator"]||v&&R[v],I=w||E(v),O=v?C?E("entries"):I:void 0,A="Array"==t&&R.entries||w;if(A&&(S=d(A.call(new e)))!==Object.prototype&&S.next&&(u(S,T,!0),r||"function"==typeof S[f]||a(S,f,p)),C&&w&&"values"!==w.name&&(b=!0,I=function(){return w.call(this)}),r&&!_||!l&&!b&&R[f]||a(R,f,I),s[t]=I,s[T]=p,v)if(y={values:C?I:E("values"),keys:m?I:E("keys"),entries:O},_)for(g in y)g in R||o(R,g,y[g]);else i(i.P+i.F*(l||b),t,y);return y}},function(e,t,n){var r=n(77),i=n(25);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){var r=n(4),i=n(24),o=n(5)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(5)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(41),i=n(5)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){"use strict";var r=n(9),i=n(29);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(48),i=n(5)("iterator"),o=n(41);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(10),i=n(33),o=n(6);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),c=a>2?arguments[2]:void 0,u=void 0===c?n:i(c,n);u>s;)t[s++]=e;return t}},function(e,t,n){"use strict";var r=n(37),i=n(110),o=n(41),a=n(16);e.exports=n(75)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,i,o=n(56),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,u=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),d=void 0!==/()??/.exec("")[1];(u||d)&&(c=function(e){var t,n,r,i,c=this;return d&&(n=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),u&&(t=c.lastIndex),r=a.call(c,e),u&&r&&(c.lastIndex=c.global?r.index+r[0].length:t),d&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;in;)t.push(arguments[n++]);return _[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},p=function(e){delete _[e]},"process"==n(24)(f)?r=function(e){f.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:h?(o=(i=new h).port2,i.port1.onmessage=g,r=a(o.postMessage,o,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts?(r=function(e){d.postMessage(e+"","*")},d.addEventListener("message",g,!1)):r="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:l,clear:p}},function(e,t,n){"use strict";var r=n(1),i=n(8),o=n(31),a=n(62),s=n(15),c=n(44),u=n(2),d=n(43),f=n(20),l=n(6),p=n(118),h=n(35).f,v=n(9).f,m=n(82),_=n(39),y=r.ArrayBuffer,g=r.DataView,S=r.Math,E=r.RangeError,T=r.Infinity,C=y,b=S.abs,R=S.pow,w=S.floor,I=S.log,O=S.LN2,A=i?"_b":"buffer",N=i?"_l":"byteLength",D=i?"_o":"byteOffset";function P(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,c=(1<>1,d=23===t?R(2,-24)-R(2,-77):0,f=0,l=e<0||0===e&&1/e<0?1:0;for((e=b(e))!=e||e===T?(i=e!=e?1:0,r=c):(r=w(I(e)/O),e*(o=R(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?d/o:d*R(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*R(2,t),r+=u):(i=e*R(2,u-1)*R(2,t),r=0));t>=8;a[f++]=255&i,i/=256,t-=8);for(r=r<0;a[f++]=255&r,r/=256,s-=8);return a[--f]|=128*l,a}function k(e,t,n){var r,i=8*n-t-1,o=(1<>1,s=i-7,c=n-1,u=e[c--],d=127&u;for(u>>=7;s>0;d=256*d+e[c],c--,s-=8);for(r=d&(1<<-s)-1,d>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===d)d=1-a;else{if(d===o)return r?NaN:u?-T:T;r+=R(2,t),d-=a}return(u?-1:1)*r*R(2,d-t)}function x(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function L(e){return[255&e]}function M(e){return[255&e,e>>8&255]}function U(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function F(e){return P(e,52,8)}function V(e){return P(e,23,4)}function j(e,t,n){v(e.prototype,t,{get:function(){return this[n]}})}function B(e,t,n,r){var i=p(+n);if(i+t>e[N])throw E("Wrong index!");var o=e[A]._b,a=i+e[D],s=o.slice(a,a+t);return r?s:s.reverse()}function G(e,t,n,r,i,o){var a=p(+n);if(a+t>e[N])throw E("Wrong index!");for(var s=e[A]._b,c=a+e[D],u=r(+i),d=0;dJ;)(W=K[J++])in y||s(y,W,C[W]);o||(H.constructor=y)}var z=new g(new y(2)),Y=g.prototype.setInt8;z.setInt8(0,2147483648),z.setInt8(1,2147483649),!z.getInt8(0)&&z.getInt8(1)||c(g.prototype,{setInt8:function(e,t){Y.call(this,e,t<<24>>24)},setUint8:function(e,t){Y.call(this,e,t<<24>>24)}},!0)}else y=function(e){d(this,y,"ArrayBuffer");var t=p(e);this._b=m.call(new Array(t),0),this[N]=t},g=function(e,t,n){d(this,g,"DataView"),d(e,y,"DataView");var r=e[N],i=f(t);if(i<0||i>r)throw E("Wrong offset!");if(i+(n=void 0===n?r-i:l(n))>r)throw E("Wrong length!");this[A]=e,this[D]=i,this[N]=n},i&&(j(y,"byteLength","_l"),j(g,"buffer","_b"),j(g,"byteLength","_l"),j(g,"byteOffset","_o")),c(g.prototype,{getInt8:function(e){return B(this,1,e)[0]<<24>>24},getUint8:function(e){return B(this,1,e)[0]},getInt16:function(e){var t=B(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=B(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return x(B(this,4,e,arguments[1]))},getUint32:function(e){return x(B(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return k(B(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return k(B(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){G(this,1,e,L,t)},setUint8:function(e,t){G(this,1,e,L,t)},setInt16:function(e,t){G(this,2,e,M,t,arguments[2])},setUint16:function(e,t){G(this,2,e,M,t,arguments[2])},setInt32:function(e,t){G(this,4,e,U,t,arguments[2])},setUint32:function(e,t){G(this,4,e,U,t,arguments[2])},setFloat32:function(e,t){G(this,4,e,V,t,arguments[2])},setFloat64:function(e,t){G(this,8,e,F,t,arguments[2])}});_(y,"ArrayBuffer"),_(g,"DataView"),s(g.prototype,a.VIEW,!0),t.ArrayBuffer=y,t.DataView=g},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(123)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){e.exports=!n(8)&&!n(2)((function(){return 7!=Object.defineProperty(n(63)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(1),i=n(7),o=n(31),a=n(64),s=n(9).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(14),i=n(16),o=n(52)(!1),a=n(65)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){var r=n(9),i=n(3),o=n(32);e.exports=n(8)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,c=0;s>c;)r.f(e,n=a[c++],t[n]);return e}},function(e,t,n){var r=n(16),i=n(35).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},function(e,t,n){"use strict";var r=n(8),i=n(32),o=n(53),a=n(47),s=n(10),c=n(46),u=Object.assign;e.exports=!u||n(2)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=s(e),u=arguments.length,d=1,f=o.f,l=a.f;u>d;)for(var p,h=c(arguments[d++]),v=f?i(h).concat(f(h)):i(h),m=v.length,_=0;m>_;)p=v[_++],r&&!l.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(19),i=n(4),o=n(99),a=[].slice,s={},c=function(e,t,n){if(!(t in s)){for(var r=[],i=0;i>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(1).parseFloat,i=n(40).trim;e.exports=1/r(n(69)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(24);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(4),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){"use strict";var r=n(34),i=n(29),o=n(39),a={};n(15)(a,n(5)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(3);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(229);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(19),i=n(10),o=n(46),a=n(6);e.exports=function(e,t,n,s,c){r(t);var u=i(e),d=o(u),f=a(u.length),l=c?f-1:0,p=c?-1:1;if(n<2)for(;;){if(l in d){s=d[l],l+=p;break}if(l+=p,c?l<0:f<=l)throw TypeError("Reduce of empty array with no initial value")}for(;c?l>=0:f>l;l+=p)l in d&&(s=t(s,d[l],l,u));return s}},function(e,t,n){"use strict";var r=n(10),i=n(33),o=n(6);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),s=i(e,a),c=i(t,a),u=arguments.length>2?arguments[2]:void 0,d=Math.min((void 0===u?a:i(u,a))-c,a-s),f=1;for(c0;)c in n?n[s]=n[c]:delete n[s],s+=f,c+=f;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(84);n(0)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){n(8)&&"g"!=/./g.flags&&n(9).f(RegExp.prototype,"flags",{configurable:!0,get:n(56)})},function(e,t,n){"use strict";var r,i,o,a,s=n(31),c=n(1),u=n(18),d=n(48),f=n(0),l=n(4),p=n(19),h=n(43),v=n(59),m=n(49),_=n(86).set,y=n(249)(),g=n(114),S=n(250),E=n(60),T=n(115),C=c.TypeError,b=c.process,R=b&&b.versions,w=R&&R.v8||"",I=c.Promise,O="process"==d(b),A=function(){},N=i=g.f,D=!!function(){try{var e=I.resolve(1),t=(e.constructor={})[n(5)("species")]=function(e){e(A,A)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(A)instanceof t&&0!==w.indexOf("6.6")&&-1===E.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!l(e)||"function"!=typeof(t=e.then))&&t},k=function(e,t){if(!e._n){e._n=!0;var n=e._c;y((function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a,s=i?t.ok:t.fail,c=t.resolve,u=t.reject,d=t.domain;try{s?(i||(2==e._h&&M(e),e._h=1),!0===s?n=r:(d&&d.enter(),n=s(r),d&&(d.exit(),a=!0)),n===t.promise?u(C("Promise-chain cycle")):(o=P(n))?o.call(n,c,u):c(n)):u(r)}catch(e){d&&!a&&d.exit(),u(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&x(e)}))}},x=function(e){_.call(c,(function(){var t,n,r,i=e._v,o=L(e);if(o&&(t=S((function(){O?b.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=O||L(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){_.call(c,(function(){var t;O?b.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),k(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw C("Promise can't be resolved itself");(t=P(e))?y((function(){var r={_w:n,_d:!1};try{t.call(e,u(F,r,1),u(U,r,1))}catch(e){U.call(r,e)}})):(n._v=e,n._s=1,k(n,!1))}catch(e){U.call({_w:n,_d:!1},e)}}};D||(I=function(e){h(this,I,"Promise","_h"),p(e),r.call(this);try{e(u(F,this,1),u(U,this,1))}catch(e){U.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(44)(I.prototype,{then:function(e,t){var n=N(m(this,I));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?b.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&k(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=u(F,e,1),this.reject=u(U,e,1)},g.f=N=function(e){return e===I||e===a?new o(e):i(e)}),f(f.G+f.W+f.F*!D,{Promise:I}),n(39)(I,"Promise"),n(42)("Promise"),a=n(7).Promise,f(f.S+f.F*!D,"Promise",{reject:function(e){var t=N(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!D),"Promise",{resolve:function(e){return T(s&&this===a?I:this,e)}}),f(f.S+f.F*!(D&&n(55)((function(e){I.all(e).catch(A)}))),"Promise",{all:function(e){var t=this,n=N(t),r=n.resolve,i=n.reject,o=S((function(){var n=[],o=0,a=1;v(e,!1,(function(e){var s=o++,c=!1;n.push(void 0),a++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=N(t),r=n.reject,i=S((function(){v(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(e,t,n){"use strict";var r=n(19);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},function(e,t,n){var r=n(3),i=n(4),o=n(114);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(9).f,i=n(34),o=n(44),a=n(18),s=n(43),c=n(59),u=n(75),d=n(110),f=n(42),l=n(8),p=n(28).fastKey,h=n(38),v=l?"_s":"size",m=function(e,t){var n,r=p(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var d=e((function(e,r){s(e,d,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,null!=r&&c(r,n,e[u],e)}));return o(d.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=h(this,t),r=m(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(h(this,t),e)}}),l&&r(d.prototype,"size",{get:function(){return h(this,t)[v]}}),d},def:function(e,t,n){var r,i,o=m(e,t);return o?o.v=n:(e._l=o={i:i=p(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[v]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){u(e,t,(function(e,n){this._t=h(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?d(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,d(1))}),n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){"use strict";var r=n(44),i=n(28).getWeak,o=n(3),a=n(4),s=n(43),c=n(59),u=n(23),d=n(14),f=n(38),l=u(5),p=u(6),h=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},_=function(e,t){return l(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=_(this,e);if(t)return t[1]},has:function(e){return!!_(this,e)},set:function(e,t){var n=_(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=p(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var u=e((function(e,r){s(e,u,t,"_i"),e._t=t,e._i=h++,e._l=void 0,null!=r&&c(r,n,e[o],e)}));return r(u.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(f(this,t)).delete(e):n&&d(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(f(this,t)).has(e):n&&d(n,this._i)}}),u},def:function(e,t,n){var r=i(o(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){var r=n(20),i=n(6);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(35),i=n(53),o=n(3),a=n(1).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(6),i=n(71),o=n(25);e.exports=function(e,t,n,a){var s=String(o(e)),c=s.length,u=void 0===n?" ":String(n),d=r(t);if(d<=c||""==u)return s;var f=d-c,l=i.call(u,Math.ceil(f/u.length));return l.length>f&&(l=l.slice(0,f)),a?l+s:s+l}},function(e,t,n){var r=n(8),i=n(32),o=n(16),a=n(47).f;e.exports=function(e){return function(t){for(var n,s=o(t),c=i(s),u=c.length,d=0,f=[];u>d;)n=c[d++],r&&!a.call(s,n)||f.push(e?[n,s[n]]:s[n]);return f}}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(o)})),e.exports=c}).call(this,n(326))},function(e,t,n){"use strict";var r=n(13),i=n(328),o=n(125),a=n(330),s=n(333),c=n(334),u=n(129);e.exports=function(e){return new Promise((function(t,d){var f=e.data,l=e.headers;r.isFormData(f)&&delete l["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",v=e.auth.password||"";l.Authorization="Basic "+btoa(h+":"+v)}var m=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),o(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};i(t,d,r),p=null}},p.onabort=function(){p&&(d(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){d(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),d(u(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var _=n(335),y=(e.withCredentials||c(m))&&e.xsrfCookieName?_.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),d(e),p=null)})),void 0===f&&(f=null),p.send(f)}))}},function(e,t,n){"use strict";var r=n(329);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t,n){"use strict";var r=n(13);e.exports=function(e,t){t=t||{};var n={},i=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(i,(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(o,(function(i){r.isObject(t[i])?n[i]=r.deepMerge(e[i],t[i]):void 0!==t[i]?n[i]=t[i]:r.isObject(e[i])?n[i]=r.deepMerge(e[i]):void 0!==e[i]&&(n[i]=e[i])})),r.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var s=i.concat(o).concat(a),c=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return r.forEach(c,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e){e.exports=JSON.parse('{"name":"ar-rtc-sdk","version":"4.0.9","description":"For publishing npm package anyrtc SDK (Web). Get more information from https://www.anyrtc.io.","main":"./release/ArRTC@latest.js","scripts":{"build":"webpack --mode=production","dev":"webpack --mode=development","doc":"tsc & api-extractor run"},"typings":"./release/ar-rtc-sdk.d.ts","author":"https://www.anyrtc.io","keywords":["web","webrtc","ArRTC"],"license":"./LICENSES.txt","devDependencies":{"awesome-typescript-loader":"^5.2.1","typescript":"^3.7.2","webpack":"^4.41.2","webpack-cli":"^3.3.10","webpack-sources":"^1.4.3","@babel/polyfill":"^7.8.7","@types/node":"^13.9.0","axios":"^0.19.2","electron":"^9.1.0"},"dependencies":{"webrtc-adapter":"^7.5.1"}}')},function(e,t,n){"use strict";var r=n(45);function i(e,t,n,i,o){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(i?i.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=i?r[0]:r,!!r.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.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(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},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(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},d.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var i=0;i=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){n.addTrack(e,r)}))}},d.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},d.prototype._gather=function(t,n){var i=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),s.component=1,s.ufrag=o.getLocalParameters().usernameFragment;var u=r.writeCandidate(s);a.candidate=Object.assign(a.candidate,r.parseCandidate(u)),a.candidate.candidate=u,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var d=r.getMediaSections(i._localDescription.sdp);d[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",i._localDescription.sdp=r.getDescription(i._localDescription.sdp)+d.join("");var f=i.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),c||i._dispatchEvent("icecandidate",a),f&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},d.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},d.prototype._transceive=function(e,n,i){var a=o(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),i&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},d.prototype.setLocalDescription=function(e){var t,n,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=r.parseRtpParameters(e);i.transceivers[t].localCapabilities=n})),i.transceivers.forEach((function(e,t){i._gather(e.mid,t)}));else if("answer"===e.type){t=r.splitSections(i._remoteDescription.sdp),n=t.shift();var s=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=i.transceivers[t],c=a.iceGatherer,u=a.iceTransport,d=a.dtlsTransport,f=a.localCapabilities,l=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);s&&(h.role="server"),i.usingBundle&&0!==t||(i._gather(a.mid,t),"new"===u.state&&u.start(c,p,s?"controlling":"controlled"),"new"===d.state&&d.start(h));var v=o(f,l);i._transceive(a,v.codecs.length>0,!1)}}))}return i._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(i){var d=this;if(-1===["offer","answer"].indexOf(i.type))return Promise.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!a("setRemoteDescription",i.type,d.signalingState)||d._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+d.signalingState));var f={};d.remoteStreams.forEach((function(e){f[e.id]=e}));var l=[],p=r.splitSections(i.sdp),h=p.shift(),v=r.matchPrefix(h,"a=ice-lite").length>0,m=r.matchPrefix(h,"a=group:BUNDLE ").length>0;d.usingBundle=m;var _=r.matchPrefix(h,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!_&&_.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(a,c){var u=r.splitLines(a),p=r.getKind(a),_=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,y=u[0].substr(2).split(" ")[2],g=r.getDirection(a,h),S=r.parseMsid(a),E=r.getMid(a)||r.generateIdentifier();if(_||"application"===p&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))d.transceivers[c]={mid:E,kind:p,protocol:y,rejected:!0};else{var T,C,b,R,w,I,O,A,N;!_&&d.transceivers[c]&&d.transceivers[c].rejected&&(d.transceivers[c]=d._createTransceiver(p,!0));var D,P,k=r.parseRtpParameters(a);_||(D=r.getIceParameters(a,h),(P=r.getDtlsParameters(a,h)).role="client"),O=r.parseRtpEncodingParameters(a);var x=r.parseRtcpParameters(a),L=r.matchPrefix(a,"a=end-of-candidates",h).length>0,M=r.matchPrefix(a,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===i.type||"answer"===i.type)&&!_&&m&&c>0&&d.transceivers[c]&&(d._disposeIceAndDtlsTransports(c),d.transceivers[c].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[c].iceTransport=d.transceivers[0].iceTransport,d.transceivers[c].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[c].rtpSender&&d.transceivers[c].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[c].rtpReceiver&&d.transceivers[c].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==i.type||_){if("answer"===i.type&&!_){C=(T=d.transceivers[c]).iceGatherer,b=T.iceTransport,R=T.dtlsTransport,w=T.rtpReceiver,I=T.sendEncodingParameters,A=T.localCapabilities,d.transceivers[c].recvEncodingParameters=O,d.transceivers[c].remoteCapabilities=k,d.transceivers[c].rtcpParameters=x,M.length&&"new"===b.state&&(!v&&!L||m&&0!==c?M.forEach((function(e){s(T.iceTransport,e)})):b.setRemoteCandidates(M)),m&&0!==c||("new"===b.state&&b.start(C,D,"controlling"),"new"===R.state&&R.start(P)),!o(T.localCapabilities,T.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&T.sendEncodingParameters[0].rtx&&delete T.sendEncodingParameters[0].rtx,d._transceive(T,"sendrecv"===g||"recvonly"===g,"sendrecv"===g||"sendonly"===g),!w||"sendrecv"!==g&&"sendonly"!==g?delete T.rtpReceiver:(N=w.track,S?(f[S.stream]||(f[S.stream]=new e.MediaStream),n(N,f[S.stream]),l.push([N,w,f[S.stream]])):(f.default||(f.default=new e.MediaStream),n(N,f.default),l.push([N,w,f.default])))}}else{(T=d.transceivers[c]||d._createTransceiver(p)).mid=E,T.iceGatherer||(T.iceGatherer=d._createIceGatherer(c,m)),M.length&&"new"===T.iceTransport.state&&(!L||m&&0!==c?M.forEach((function(e){s(T.iceTransport,e)})):T.iceTransport.setRemoteCandidates(M)),A=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(A.codecs=A.codecs.filter((function(e){return"rtx"!==e.name}))),I=T.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var U,F=!1;if("sendrecv"===g||"sendonly"===g){if(F=!T.rtpReceiver,w=T.rtpReceiver||new e.RTCRtpReceiver(T.dtlsTransport,p),F)N=w.track,S&&"-"===S.stream||(S?(f[S.stream]||(f[S.stream]=new e.MediaStream,Object.defineProperty(f[S.stream],"id",{get:function(){return S.stream}})),Object.defineProperty(N,"id",{get:function(){return S.track}}),U=f[S.stream]):(f.default||(f.default=new e.MediaStream),U=f.default)),U&&(n(N,U),T.associatedRemoteMediaStreams.push(U)),l.push([N,w,U])}else T.rtpReceiver&&T.rtpReceiver.track&&(T.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===T.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),T.associatedRemoteMediaStreams=[]);T.localCapabilities=A,T.remoteCapabilities=k,T.rtpReceiver=w,T.rtcpParameters=x,T.sendEncodingParameters=I,T.recvEncodingParameters=O,d._transceive(d.transceivers[c],!1,F)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===i.type?"active":"passive"),d._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?d._updateSignalingState("have-remote-offer"):d._updateSignalingState("stable"),Object.keys(f).forEach((function(t){var n=f[t];if(n.getTracks().length){if(-1===d.remoteStreams.indexOf(n)){d.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){d._dispatchEvent("addstream",r)}))}l.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(d,t,r,[n])}))}})),l.forEach((function(e){e[2]||u(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},d.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},d.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},d.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));o>0||a>0;)o>0&&(n._createTransceiver("audio"),o--),a>0&&(n._createTransceiver("video"),a--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(i,o){var a=i.track,s=i.kind,c=i.mid||r.generateIdentifier();i.mid=c,i.iceGatherer||(i.iceGatherer=n._createIceGatherer(o,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(s);t<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=i.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];a&&t>=15019&&"video"===s&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,s)),i.localCapabilities=u,i.sendEncodingParameters=d})),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){u+=i(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))}));var d=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(d)},d.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=r.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,r){if(!(r+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;if(e.stream)"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=o(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=i(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var u=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(u)},d.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(i,o){if(!n._remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u0?r.parseCandidate(e.candidate):{};if("tcp"===f.protocol&&(0===f.port||9===f.port))return i();if(f.component&&1!==f.component)return i();if((0===a||a>0&&d.iceTransport!==n.transceivers[0].iceTransport)&&!s(d.iceTransport,f))return o(c("OperationError","Can not add ICE candidate"));var l=e.candidate.trim();0===l.indexOf("a=")&&(l=l.substr(2)),(t=r.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(f.type?l:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var p=0;pi;)X(e,n=r[i++],t[n]);return e},Q=function(e){var t=F.call(this,e=T(e,!0));return!(this===G&&i(j,e)&&!i(B,e))&&(!(t||!i(this,e)||!i(j,e)||i(this,M)&&this[M][e])||t)},$=function(e,t){if(e=E(e),t=T(t,!0),e!==G||!i(j,t)||i(B,t)){var n=N(e,t);return!n||!i(j,t)||i(e,M)&&e[M][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=P(E(e)),r=[],o=0;n.length>o;)i(j,t=n[o++])||t==M||t==c||r.push(t);return r},ee=function(e){for(var t,n=e===G,r=P(n?B:E(e)),o=[],a=0;r.length>a;)!i(j,t=r[a++])||n&&!i(G,t)||o.push(j[t]);return o};W||(s((k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var e=l(arguments.length>0?arguments[0]:void 0),t=function(n){this===G&&t.call(B,n),i(this,M)&&i(this[M],e)&&(this[M][e]=!1),J(this,e,C(1,n))};return o&&K&&J(G,e,{configurable:!0,set:t}),z(e)}).prototype,"toString",(function(){return this._k})),w.f=$,O.f=X,n(35).f=R.f=Z,n(47).f=Q,I.f=ee,o&&!n(31)&&s(G,"propertyIsEnumerable",Q,!0),h.f=function(e){return z(p(e))}),a(a.G+a.W+a.F*!W,{Symbol:k});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)p(te[ne++]);for(var re=A(p.store),ie=0;re.length>ie;)v(re[ie++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(V,e+="")?V[e]:V[e]=k(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in V)if(V[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),a(a.S+a.F*!W,"Object",{create:function(e,t){return void 0===t?b(e):q(b(e),t)},defineProperty:X,defineProperties:q,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:ee});var oe=u((function(){I.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return I.f(S(e))}}),x&&a(a.S+a.F*(!W||u((function(){var e=k();return"[null]"!=L([e])||"{}"!=L({a:e})||"{}"!=L(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(g(t)||void 0!==e)&&!Y(e))return _(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,L.apply(x,r)}}),k.prototype[U]||n(15)(k.prototype,U,k.prototype.valueOf),f(k,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(e,t,n){e.exports=n(51)("native-function-to-string",Function.toString)},function(e,t,n){var r=n(32),i=n(53),o=n(47);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),c=o.f,u=0;s.length>u;)c.call(e,a=s[u++])&&t.push(a);return t}},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(34)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperty:n(9).f})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperties:n(94)})},function(e,t,n){var r=n(16),i=n(21).f;n(22)("getOwnPropertyDescriptor",(function(){return function(e,t){return i(r(e),t)}}))},function(e,t,n){var r=n(10),i=n(36);n(22)("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},function(e,t,n){var r=n(10),i=n(32);n(22)("keys",(function(){return function(e){return i(r(e))}}))},function(e,t,n){n(22)("getOwnPropertyNames",(function(){return n(95).f}))},function(e,t,n){var r=n(4),i=n(28).onFreeze;n(22)("freeze",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4),i=n(28).onFreeze;n(22)("seal",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4),i=n(28).onFreeze;n(22)("preventExtensions",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4);n(22)("isFrozen",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},function(e,t,n){var r=n(4);n(22)("isSealed",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},function(e,t,n){var r=n(4);n(22)("isExtensible",(function(e){return function(t){return!!r(t)&&(!e||e(t))}}))},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(96)})},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(97)})},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(68).set})},function(e,t,n){"use strict";var r=n(48),i={};i[n(5)("toStringTag")]="z",i+""!="[object z]"&&n(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(98)})},function(e,t,n){var r=n(9).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(8)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(4),i=n(36),o=n(5)("hasInstance"),a=Function.prototype;o in a||n(9).f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(0),i=n(100);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(e,t,n){var r=n(0),i=n(101);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(e,t,n){"use strict";var r=n(1),i=n(14),o=n(24),a=n(70),s=n(27),c=n(2),u=n(35).f,d=n(21).f,f=n(9).f,l=n(40).trim,p=r.Number,h=p,v=p.prototype,m="Number"==o(n(34)(v)),_="trim"in String.prototype,y=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=_?t.trim():l(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,c=t.slice(2),u=0,d=c.length;ui)return NaN;return parseInt(c,r)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(m?c((function(){v.valueOf.call(n)})):"Number"!=o(n))?a(new h(y(t)),n,p):y(t)};for(var g,S=n(8)?u(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),E=0;S.length>E;E++)i(h,g=S[E])&&!i(p,g)&&f(p,g,d(h,g));p.prototype=v,v.constructor=p,n(11)(r,"Number",p)}},function(e,t,n){"use strict";var r=n(0),i=n(20),o=n(102),a=n(71),s=1..toFixed,c=Math.floor,u=[0,0,0,0,0,0],d="Number.toFixed: incorrect invocation!",f=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*u[n],u[n]=r%1e7,r=c(r/1e7)},l=function(e){for(var t=6,n=0;--t>=0;)n+=u[t],u[t]=c(n/e),n=n%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==u[e]){var n=String(u[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},h=function(e,t,n){return 0===t?n:t%2==1?h(e,t-1,n*e):h(e*e,t/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(2)((function(){s.call({})}))),"Number",{toFixed:function(e){var t,n,r,s,c=o(this,d),u=i(e),v="",m="0";if(u<0||u>20)throw RangeError(d);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(v="-",c=-c),c>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(c*h(2,69,1))-69)<0?c*h(2,-t,1):c/h(2,t,1),n*=4503599627370496,(t=52-t)>0){for(f(0,n),r=u;r>=7;)f(1e7,0),r-=7;for(f(h(10,r,1),0),r=t-1;r>=23;)l(1<<23),r-=23;l(1<0?v+((s=m.length)<=u?"0."+a.call("0",u-s)+m:m.slice(0,s-u)+"."+m.slice(s-u)):v+m}})},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(102),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),i=n(1).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(103)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),i=n(103),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),i=n(101);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(0),i=n(100);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){var r=n(0),i=n(104),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},function(e,t,n){var r=n(0),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,n){var r=n(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),i=n(72);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(0),i=n(73);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(183)})},function(e,t,n){var r=n(72),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),c=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),u=r(e);return is||n!=n?u*(1/0):u*n}},function(e,t,n){var r=n(0),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,o=0,a=0,s=arguments.length,c=0;a0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(o)}})},function(e,t,n){var r=n(0),i=Math.imul;r(r.S+r.F*n(2)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(104)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(72)})},function(e,t,n){var r=n(0),i=n(73),o=Math.exp;r(r.S+r.F*n(2)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),i=n(73),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(0),i=n(33),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(0),i=n(16),o=n(6);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t,n){"use strict";var r=n(0),i=n(74)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(76),a="".endsWith;r(r.P+r.F*n(78)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),s=void 0===n?r:Math.min(i(n),r),c=String(e);return a?a.call(t,c,s):t.slice(s-c.length,s)===c}})},function(e,t,n){"use strict";var r=n(0),i=n(76);r(r.P+r.F*n(78)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(71)})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(76),a="".startsWith;r(r.P+r.F*n(78)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(12)("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},function(e,t,n){"use strict";n(12)("big",(function(e){return function(){return e(this,"big","","")}}))},function(e,t,n){"use strict";n(12)("blink",(function(e){return function(){return e(this,"blink","","")}}))},function(e,t,n){"use strict";n(12)("bold",(function(e){return function(){return e(this,"b","","")}}))},function(e,t,n){"use strict";n(12)("fixed",(function(e){return function(){return e(this,"tt","","")}}))},function(e,t,n){"use strict";n(12)("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},function(e,t,n){"use strict";n(12)("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},function(e,t,n){"use strict";n(12)("italics",(function(e){return function(){return e(this,"i","","")}}))},function(e,t,n){"use strict";n(12)("link",(function(e){return function(t){return e(this,"a","href",t)}}))},function(e,t,n){"use strict";n(12)("small",(function(e){return function(){return e(this,"small","","")}}))},function(e,t,n){"use strict";n(12)("strike",(function(e){return function(){return e(this,"strike","","")}}))},function(e,t,n){"use strict";n(12)("sub",(function(e){return function(){return e(this,"sub","","")}}))},function(e,t,n){"use strict";n(12)("sup",(function(e){return function(){return e(this,"sup","","")}}))},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";var r=n(0),i=n(10),o=n(27);r(r.P+r.F*n(2)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),n=o(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(0),i=n(218);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,n){"use strict";var r=n(2),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},function(e,t,n){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(11)(r,"toString",(function(){var e=o.call(this);return e==e?i.call(this):"Invalid Date"}))},function(e,t,n){var r=n(5)("toPrimitive"),i=Date.prototype;r in i||n(15)(i,r,n(221))},function(e,t,n){"use strict";var r=n(3),i=n(27);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),"number"!=e)}},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(54)})},function(e,t,n){"use strict";var r=n(18),i=n(0),o=n(10),a=n(106),s=n(79),c=n(6),u=n(80),d=n(81);i(i.S+i.F*!n(55)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,f,l=o(e),p="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,_=0,y=d(l);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),null==y||p==Array&&s(y))for(n=new p(t=c(l.length));t>_;_++)u(n,_,m?v(l[_],_):l[_]);else for(f=y.call(l),n=new p;!(i=f.next()).done;_++)u(n,_,m?a(f,v,[i.value,_],!0):i.value);return n.length=_,n}})},function(e,t,n){"use strict";var r=n(0),i=n(80);r(r.S+r.F*n(2)((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(0),i=n(16),o=[].join;r(r.P+r.F*(n(46)!=Object||!n(17)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),i=n(67),o=n(24),a=n(33),s=n(6),c=[].slice;r(r.P+r.F*n(2)((function(){i&&c.call(i)})),"Array",{slice:function(e,t){var n=s(this.length),r=o(this);if(t=void 0===t?n:t,"Array"==r)return c.call(this,e,t);for(var i=a(e,n),u=a(t,n),d=s(u-i),f=new Array(d),l=0;l1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(109)}),n(37)("copyWithin")},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(82)}),n(37)("fill")},function(e,t,n){"use strict";var r=n(0),i=n(23)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(37)("find")},function(e,t,n){"use strict";var r=n(0),i=n(23)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(37)(o)},function(e,t,n){n(42)("Array")},function(e,t,n){var r=n(1),i=n(70),o=n(9).f,a=n(35).f,s=n(77),c=n(56),u=r.RegExp,d=u,f=u.prototype,l=/a/g,p=/a/g,h=new u(l)!==l;if(n(8)&&(!h||n(2)((function(){return p[n(5)("match")]=!1,u(l)!=l||u(p)==p||"/a/i"!=u(l,"i")})))){u=function(e,t){var n=this instanceof u,r=s(e),o=void 0===t;return!n&&r&&e.constructor===u&&o?e:i(h?new d(r&&!o?e.source:e,t):d((r=e instanceof u)?e.source:e,r&&o?c.call(e):t),n?this:f,u)};for(var v=function(e){e in u||o(u,e,{configurable:!0,get:function(){return d[e]},set:function(t){d[e]=t}})},m=a(d),_=0;m.length>_;)v(m[_++]);f.constructor=u,u.prototype=f,n(11)(r,"RegExp",u)}n(42)("RegExp")},function(e,t,n){"use strict";n(112);var r=n(3),i=n(56),o=n(8),a=/./.toString,s=function(e){n(11)(RegExp.prototype,"toString",e,!0)};n(2)((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?s((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):"toString"!=a.name&&s((function(){return a.call(this)}))},function(e,t,n){"use strict";var r=n(3),i=n(6),o=n(85),a=n(57);n(58)("match",1,(function(e,t,n,s){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var c=r(e),u=String(this);if(!c.global)return a(c,u);var d=c.unicode;c.lastIndex=0;for(var f,l=[],p=0;null!==(f=a(c,u));){var h=String(f[0]);l[p]=h,""===h&&(c.lastIndex=o(u,i(c.lastIndex),d)),p++}return 0===p?null:l}]}))},function(e,t,n){"use strict";var r=n(3),i=n(10),o=n(6),a=n(20),s=n(85),c=n(57),u=Math.max,d=Math.min,f=Math.floor,l=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;n(58)("replace",2,(function(e,t,n,h){return[function(r,i){var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(e,t){var i=h(n,e,this,t);if(i.done)return i.value;var f=r(e),l=String(this),p="function"==typeof t;p||(t=String(t));var m=f.global;if(m){var _=f.unicode;f.lastIndex=0}for(var y=[];;){var g=c(f,l);if(null===g)break;if(y.push(g),!m)break;""===String(g[0])&&(f.lastIndex=s(l,o(f.lastIndex),_))}for(var S,E="",T=0,C=0;C=T&&(E+=l.slice(T,R)+N,T=R+b.length)}return E+l.slice(T)}];function v(e,t,r,o,a,s){var c=r+e.length,u=o.length,d=p;return void 0!==a&&(a=i(a),d=l),n.call(s,d,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(c);case"<":s=a[i.slice(1,-1)];break;default:var d=+i;if(0===d)return n;if(d>u){var l=f(d/10);return 0===l?n:l<=u?void 0===o[l-1]?i.charAt(1):o[l-1]+i.charAt(1):n}s=o[d-1]}return void 0===s?"":s}))}}))},function(e,t,n){"use strict";var r=n(3),i=n(97),o=n(57);n(58)("search",1,(function(e,t,n,a){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var s=r(e),c=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var d=o(s,c);return i(s.lastIndex,u)||(s.lastIndex=u),null===d?-1:d.index}]}))},function(e,t,n){"use strict";var r=n(77),i=n(3),o=n(49),a=n(85),s=n(6),c=n(57),u=n(84),d=n(2),f=Math.min,l=[].push,p="length",h=!d((function(){RegExp(4294967295,"y")}));n(58)("split",2,(function(e,t,n,d){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[p]||2!="ab".split(/(?:ab)*/)[p]||4!=".".split(/(.?)(.?)/)[p]||".".split(/()()/)[p]>1||"".split(/.?/)[p]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var o,a,s,c=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,h=void 0===t?4294967295:t>>>0,v=new RegExp(e.source,d+"g");(o=u.call(v,i))&&!((a=v.lastIndex)>f&&(c.push(i.slice(f,o.index)),o[p]>1&&o.index=h));)v.lastIndex===o.index&&v.lastIndex++;return f===i[p]?!s&&v.test("")||c.push(""):c.push(i.slice(f)),c[p]>h?c.slice(0,h):c}:"0".split(void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,i,r):v.call(String(i),n,r)},function(e,t){var r=d(v,e,this,t,v!==n);if(r.done)return r.value;var u=i(e),l=String(this),p=o(u,RegExp),m=u.unicode,_=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(h?"y":"g"),y=new p(h?u:"^(?:"+u.source+")",_),g=void 0===t?4294967295:t>>>0;if(0===g)return[];if(0===l.length)return null===c(y,l)?[l]:[];for(var S=0,E=0,T=[];E0?arguments[0]:void 0)}}),{get:function(e){var t=r.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(i(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(116),i=n(38);e.exports=n(61)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(1),o=n(23)(0),a=n(11),s=n(28),c=n(96),u=n(117),d=n(4),f=n(38),l=n(38),p=!i.ActiveXObject&&"ActiveXObject"in i,h=s.getWeak,v=Object.isExtensible,m=u.ufstore,_=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(d(e)){var t=h(e);return!0===t?m(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(f(this,"WeakMap"),e,t)}},g=e.exports=n(61)("WeakMap",_,y,u,!0,!0);l&&p&&(c((r=u.getConstructor(_,"WeakMap")).prototype,y),s.NEED=!0,o(["delete","has","get","set"],(function(e){var t=g.prototype,n=t[e];a(t,e,(function(t,i){if(d(t)&&!v(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)}))})))},function(e,t,n){"use strict";var r=n(117),i=n(38);n(61)("WeakSet",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(0),i=n(62),o=n(87),a=n(3),s=n(33),c=n(6),u=n(4),d=n(1).ArrayBuffer,f=n(49),l=o.ArrayBuffer,p=o.DataView,h=i.ABV&&d.isView,v=l.prototype.slice,m=i.VIEW;r(r.G+r.W+r.F*(d!==l),{ArrayBuffer:l}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return h&&h(e)||u(e)&&m in e}}),r(r.P+r.U+r.F*n(2)((function(){return!new l(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(a(this),e);for(var n=a(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),o=new(f(this,l))(c(i-r)),u=new p(this),d=new p(o),h=0;r=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}})),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},function(e,t,n){var r=n(21),i=n(36),o=n(14),a=n(0),s=n(4),c=n(3);a(a.S,"Reflect",{get:function e(t,n){var a,u,d=arguments.length<3?t:arguments[2];return c(t)===d?t[n]:(a=r.f(t,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(d):void 0:s(u=i(t))?e(u,n,d):void 0}})},function(e,t,n){var r=n(21),i=n(0),o=n(3);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},function(e,t,n){var r=n(0),i=n(36),o=n(3);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),i=n(3),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(119)})},function(e,t,n){var r=n(0),i=n(3),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(9),i=n(21),o=n(36),a=n(14),s=n(0),c=n(29),u=n(3),d=n(4);s(s.S,"Reflect",{set:function e(t,n,s){var f,l,p=arguments.length<4?t:arguments[3],h=i.f(u(t),n);if(!h){if(d(l=o(t)))return e(l,n,s,p);h=c(0)}if(a(h,"value")){if(!1===h.writable||!d(p))return!1;if(f=i.f(p,n)){if(f.get||f.set||!1===f.writable)return!1;f.value=s,r.f(p,n,f)}else r.f(p,n,c(0,s));return!0}return void 0!==h.set&&(h.set.call(p,s),!0)}})},function(e,t,n){var r=n(0),i=n(68);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){n(281),e.exports=n(7).Array.includes},function(e,t,n){"use strict";var r=n(0),i=n(52)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(37)("includes")},function(e,t,n){n(283),e.exports=n(7).Array.flatMap},function(e,t,n){"use strict";var r=n(0),i=n(284),o=n(10),a=n(6),s=n(19),c=n(107);r(r.P,"Array",{flatMap:function(e){var t,n,r=o(this);return s(e),t=a(r.length),n=c(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(37)("flatMap")},function(e,t,n){"use strict";var r=n(54),i=n(4),o=n(6),a=n(18),s=n(5)("isConcatSpreadable");e.exports=function e(t,n,c,u,d,f,l,p){for(var h,v,m=d,_=0,y=!!l&&a(l,p,3);_0)m=e(t,n,h,o(h.length),m,f-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=h}m++}_++}return m}},function(e,t,n){n(286),e.exports=n(7).String.padStart},function(e,t,n){"use strict";var r=n(0),i=n(120),o=n(60),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){n(288),e.exports=n(7).String.padEnd},function(e,t,n){"use strict";var r=n(0),i=n(120),o=n(60),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){n(290),e.exports=n(7).String.trimLeft},function(e,t,n){"use strict";n(40)("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},function(e,t,n){n(292),e.exports=n(7).String.trimRight},function(e,t,n){"use strict";n(40)("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},function(e,t,n){n(294),e.exports=n(64).f("asyncIterator")},function(e,t,n){n(92)("asyncIterator")},function(e,t,n){n(296),e.exports=n(7).Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(0),i=n(119),o=n(16),a=n(21),s=n(80);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),c=a.f,u=i(r),d={},f=0;u.length>f;)void 0!==(n=c(r,t=u[f++]))&&s(d,t,n);return d}})},function(e,t,n){n(298),e.exports=n(7).Object.values},function(e,t,n){var r=n(0),i=n(121)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){n(300),e.exports=n(7).Object.entries},function(e,t,n){var r=n(0),i=n(121)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){"use strict";n(113),n(302),e.exports=n(7).Promise.finally},function(e,t,n){"use strict";var r=n(0),i=n(7),o=n(1),a=n(49),s=n(115);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},function(e,t,n){n(304),n(305),n(306),e.exports=n(7)},function(e,t,n){var r=n(1),i=n(0),o=n(60),a=[].slice,s=/MSIE .\./.test(o),c=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(e,t,n){var r=n(0),i=n(86);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){for(var r=n(83),i=n(32),o=n(11),a=n(1),s=n(15),c=n(41),u=n(5),d=u("iterator"),f=u("toStringTag"),l=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(p),v=0;v=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){n(309),e.exports=n(122).global},function(e,t,n){var r=n(310);r(r.G,{global:n(88)})},function(e,t,n){var r=n(88),i=n(122),o=n(311),a=n(313),s=n(320),c=function(e,t,n){var u,d,f,l=e&c.F,p=e&c.G,h=e&c.S,v=e&c.P,m=e&c.B,_=e&c.W,y=p?i:i[t]||(i[t]={}),g=y.prototype,S=p?r:h?r[t]:(r[t]||{}).prototype;for(u in p&&(n=t),n)(d=!l&&S&&void 0!==S[u])&&s(y,u)||(f=d?S[u]:n[u],y[u]=p&&"function"!=typeof S[u]?n[u]:m&&d?o(f,r):_&&S[u]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[u]=f,e&c.R&&g&&!g[u]&&a(g,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(312);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(314),i=n(319);e.exports=n(90)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(315),i=n(316),o=n(318),a=Object.defineProperty;t.f=n(90)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(89);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(90)&&!n(123)((function(){return 7!=Object.defineProperty(n(317)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(89),i=n(88).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(89);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var r=n(13),i=n(124),o=n(322),a=n(130);function s(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var c=s(n(127));c.Axios=o,c.create=function(e){return s(a(c.defaults,e))},c.Cancel=n(131),c.CancelToken=n(336),c.isCancel=n(126),c.all=function(e){return Promise.all(e)},c.spread=n(337),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";var r=n(13),i=n(125),o=n(323),a=n(324),s=n(130);function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},c.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,i){return this.request(r.merge(i||{},{method:e,url:t,data:n}))}})),e.exports=c},function(e,t,n){"use strict";var r=n(13);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,n){"use strict";var r=n(13),i=n(325),o=n(126),a=n(127);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return s(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(s(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(13);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,u=[],d=!1,f=-1;function l(){d&&c&&(d=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!d){var e=s(l);d=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var n=1;n=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},function(e,t,n){"use strict";var r=n(13);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(13);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(131);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return se})),n.d(r,"shimGetDisplayMedia",(function(){return ce})),n.d(r,"shimMediaStream",(function(){return ue})),n.d(r,"shimOnTrack",(function(){return de})),n.d(r,"shimGetSendersWithDtmf",(function(){return fe})),n.d(r,"shimGetStats",(function(){return le})),n.d(r,"shimSenderReceiverGetStats",(function(){return pe})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return he})),n.d(r,"shimAddTrackRemoveTrack",(function(){return ve})),n.d(r,"shimPeerConnection",(function(){return me})),n.d(r,"fixNegotiationNeeded",(function(){return _e}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return Se})),n.d(i,"shimGetDisplayMedia",(function(){return Ee})),n.d(i,"shimPeerConnection",(function(){return Te})),n.d(i,"shimReplaceTrack",(function(){return Ce}));var o={};n.r(o),n.d(o,"shimGetUserMedia",(function(){return be})),n.d(o,"shimGetDisplayMedia",(function(){return Re})),n.d(o,"shimOnTrack",(function(){return we})),n.d(o,"shimPeerConnection",(function(){return Ie})),n.d(o,"shimSenderGetStats",(function(){return Oe})),n.d(o,"shimReceiverGetStats",(function(){return Ae})),n.d(o,"shimRemoveStream",(function(){return Ne})),n.d(o,"shimRTCDataChannel",(function(){return De})),n.d(o,"shimAddTransceiver",(function(){return Pe})),n.d(o,"shimCreateOffer",(function(){return ke})),n.d(o,"shimCreateAnswer",(function(){return xe}));var a={};n.r(a),n.d(a,"shimLocalStreamsAPI",(function(){return Le})),n.d(a,"shimRemoteStreamsAPI",(function(){return Me})),n.d(a,"shimCallbacksAPI",(function(){return Ue})),n.d(a,"shimGetUserMedia",(function(){return Fe})),n.d(a,"shimConstraints",(function(){return Ve})),n.d(a,"shimRTCIceServerUrls",(function(){return je})),n.d(a,"shimTrackEventTransceiver",(function(){return Be})),n.d(a,"shimCreateOfferLegacy",(function(){return Ge}));var s={};n.r(s),n.d(s,"shimRTCIceCandidate",(function(){return Ke})),n.d(s,"shimMaxMessageSize",(function(){return Je})),n.d(s,"shimSendThrowTypeError",(function(){return ze})),n.d(s,"shimConnectionState",(function(){return Ye})),n.d(s,"removeAllowExtmapMixed",(function(){return Xe}));var c,u,d,f,l,p,h,v,m={SDK_VERSION:n(132).version,PROCESS_ID:"",GATEWAY_ADDRESS:"https://gateway.agrtc.cn",GATEWAY_CONNECT_TIMEOUT:2e3,GATEWAY_ERTRY_TIMEOUT:12e5,ACCOUNT_REGISTER_RETRY_TIMEOUT:1,ACCOUNT_REGISTER_RETRY_RATIO:2,ACCOUNT_REGISTER_RETRY_TIMEOUT_MAX:6e4,ACCOUNT_REGISTER_RETRY_COUNT_MAX:1e5,AUDIO_CONTEXT:null,EVENT_REPORT_DOMAIN:"event.agrtc.cn",EVENT_REPORT_BACKUP_DOMAIN:"event.agrtc.cn",WEBCS_BACKUP_CONNECT_TIMEOUT:6e3,HTTP_CONNECT_TIMEOUT:5e3,PLAYER_STATE_DEFER:2e3,SIGNAL_REQUEST_TIMEOUT:1e4,SIGNAL_REQUEST_WATCH_INTERVAL:1e3,REPORT_STATS:!0,UPLOAD_LOG:!1,NOT_REPORT_EVENT:[],FILEPATH_LENMAX:255,SUBSCRIBE_TCC:!1,PING_PONG_TIME_OUT:10,DUALSTREAM_OPERATION_CHECK:!0,WEBSOCKET_TIMEOUT_MIN:1e4,EVENT_REPORT_SEND_INTERVAL:1e3,MEDIA_ELEMENT_EXISTS_DEPTH:3,CANDIDATE_TIMEOUT:2e3,SHIM_CANDIDATE:!1,LEAVE_MSG_TIMEOUT:2e3,SHOW_REPORT_INVOKER_LOG:!1,STATS_FILTER:{transportId:!0,googTrackId:!0},JOIN_EXTEND:"",PUB_EXTEND:"",SUB_EXTEND:"",FORCE_TURN:!1,TURN_ENABLE_TCP:!0,TURN_ENABLE_UDP:!0,MAX_UPLOAD_CACHE:50,UPLOAD_CACHE_INTERVAL:200,AUDIO_SOURCE_VOLUME_UPDATE_INTERVAL:200,AUDIO_SOURCE_AVG_VOLUME_DURATION:3e3,AUDIO_VOLUME_INDICATION_INTERVAL:2e3};!function(e){e.DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED",e.RELAY_OK="RELAY_OK",e.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",e.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED"}(c||(c={})),function(e){e.NETWORK_CONNECTED="NETWORK_CONNECTED",e.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",e.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",e.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",e.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",e.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",e.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",e.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",e.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",e.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED"}(u||(u={})),function(e){e.RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",e.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE",e.RELAY_STATE_IDLE="RELAY_STATE_IDLE",e.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING"}(d||(d={})),function(e){e.CHANNEL_BANNED="CHANNEL_BANNED",e.IP_BANNED="IP_BANNED",e.LEAVE="LEAVE",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.UID_BANNED="UID_BANNED",e.DEVELOPER_INVALID="DEVELOPER_INVALID",e.TOKEN_INVALID="TOKEN_INVALID"}(f||(f={})),function(e){e[e.AUDIO_ONLY=2]="AUDIO_ONLY",e[e.DISABLE=0]="DISABLE",e[e.LOW_STREAM=1]="LOW_STREAM"}(l||(l={})),function(e){e[e.HIGH_STREAM=0]="HIGH_STREAM",e[e.LOW_STREAM=1]="LOW_STREAM"}(p||(p={})),function(e){e.WIN_10="Windows 10",e.WIN_81="Windows 8.1",e.WIN_8="Windows 8",e.WIN_7="Windows 7",e.WIN_VISTA="Windows Vista",e.WIN_SERVER_2003="Windows Server 2003",e.WIN_XP="Windows XP",e.WIN_2000="Windows 2000",e.ANDROID="Android",e.OPEN_BSD="Open BSD",e.SUN_OS="Sun OS",e.LINUX="Linux",e.IOS="iOS",e.MAC_OS_X="Mac OS X",e.MAC_OS="Mac OS",e.QNX="QNX",e.UNIX="UNIX",e.BEOS="BeOS",e.OS_2="OS/2",e.SEARCH_BOT="Search Bot"}(h||(h={})),function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.TIMEOUT="TIMEOUT",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_SUPPORT="NOT_SUPPORT",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORT="OPERATION_ABORT",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",e.NETWORK_ERROR="NETWORK_ERROR",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",e.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOTE_FOUND",e.ELECTRON_IS_NULL="ELECTRON_IS_NULL",e.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",e.STREAM_ALREADY_INITIALIZED="STREAM_ALREADY_INITIALIZED",e.STREAM_IS_CLOSED="STREAM_IS_CLOSED",e.ABORT_OTHER_INIT="ABORT_OTHER_INIT",e.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",e.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",e.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",e.PERMISSION_DENIED="PERMISSION_DENIED",e.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",e.CAN_NOT_AUTOPLAY="CAN_NOT_AUTOPLAY",e.HIGH_STREAM_NO_VIDEO_TRACK="HIGH_STREAM_NO_VIDEO_TRACK",e.SCREEN_SHARE_CAN_NOT_CREATE_LOW_STREAM="SCREEN_SHARE_CAN_NOT_CREATE_LOW_STREAM",e.TOKEN_GENERATOR_FUNCTION_ERROR="TOKEN_GENERATOR_FUNCTION_ERROR",e.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",e.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",e.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",e.UID_CONFLICT="UID_CONFLICT",e.TRACK_ALREADY_PUBLISHED="TRACK_ALREADY_PUBLISHED",e.TRACK_IS_NOT_PUBLISHED="TRACK_IS_NOT_PUBLISHED",e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.SENDER_NOT_FOUND="SENDER_NOT_FOUND",e.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",e.SET_ANSWER_FAILED="SET_ANSWER_FAILED",e.ICE_FAILED="ICE_FAILED",e.PC_CLOSED="PC_CLOSED",e.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.TRACK_IS_NOT_SUBSCRIBED="TRACK_IS_NOT_SUBSCRIBED",e.SUBSCRIPTION_IS_IN_PROGRESS="SUBSCRIPTION_IS_IN_PROGRESS",e.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",e.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",e.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",e.EFFECT_ID_CONFLICTED="EFFECT_ID_CONFLICTED",e.EFFECT_SOUND_ID_NOT_FOUND="EFFECT_SOUND_ID_NOT_FOUND",e.WS_ABORT="WS_ABORT",e.WS_DISCONNECT="WS_DISCONNECT",e.WS_ERR="WS_ERR",e.CAN_NOT_CONNECT_TO_LIVE_STREAMING_WORKER="CAN_NOT_CONNECT_TO_LIVE_STREAMING_WORKER",e.REQUEST_TO_LIVE_STREAMING_WORKER_FAILED="REQUEST_TO_LIVE_STREAMING_WORKER_FAILED",e.PUSH_RTMP_URL_CONFLICT="PUSH_RTMP_URL_CONFLICT",e.PULL_URL_CONFLICT="PULL_URL_CONFLICT",e.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",e.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE"}(v||(v={}));var _,y=function(e){var t=e;void 0===t&&(t=7);var n=Math.random().toString(16).substr(2,t).toLowerCase();return n.length===t?n:n+y(t-n.length)},g=function(e,t){var n="YYYY-MM-DD hh:mm:ss";if("number"!=typeof e)throw new Error("[timesToDate]: timestamp must be number");t&&"string"==typeof t&&(n=t);var r=e||Date.now(),i=new Date(r)||new Date(r),o=i.getFullYear(),a=i.getMonth()+1,s=i.getDate(),c=i.getHours(),u=i.getMinutes(),d=i.getSeconds();return n.indexOf("YYYY")>-1&&(n=n.replace("YYYY",(function(e){return""+o}))),n.indexOf("MM")>-1?n=n.replace("MM",(function(e){return a<10?"0"+a:""+a})):n.indexOf("M")>-1&&(n=n.replace("M",(function(e){return""+a}))),n.indexOf("DD")>-1?n=n.replace("DD",(function(e){return s<10?"0"+s:""+s})):n.indexOf("D")>-1&&(n=n.replace("D",(function(e){return""+s}))),n.indexOf("hh")>-1?n=n.replace("hh",(function(e){return c<10?"0"+c:""+c})):n.indexOf("h")>-1&&(n=n.replace("h",(function(e){return""+c}))),n.indexOf("mm")>-1?n=n.replace("mm",(function(e){return u<10?"0"+u:""+u})):n.indexOf("m")>-1&&(n=n.replace("m",(function(e){return""+u}))),n.indexOf("ss")>-1?n=n.replace("ss",(function(e){return d<10?"0"+d:""+d})):n.indexOf("s")>-1&&(n=n.replace("s",(function(e){return""+d}))),n};!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE"}(_||(_={}));var S=new(function(){function e(){this.logPrefix="SupLogger",this.logLevel=_.NONE,this.uploadServeTranslators=[],this.DEBUG=_.DEBUG,this.INFO=_.INFO,this.WARNING=_.WARNING,this.ERROR=_.ERROR,this.NONE=_.NONE}return e.prototype.use=function(e){"function"==typeof e&&this.uploadServeTranslators.push((function(t,n){e(t,n)}))},e.prototype.setLogLevel=function(e,t){t&&(this.logPrefix=t),"number"==typeof e&&e>-1&&e<5&&(this.logLevel=e)},e.prototype.error=function(){for(var e=[],t=0;t_.ERROR&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [ERROR]: ","color: #dc3545;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"error",params:n,timestamp:r},(function(){console.error.apply(console,n)}))})):console.error.apply(console,n)}},e.prototype.warning=function(){for(var e=[],t=0;t_.WARNING&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [WARNING]: ","color: #ffc107;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"warning",params:n,timestamp:r},(function(){console.warn.apply(console,n)}))})):console.warn.apply(console,n)}},e.prototype.info=function(){for(var e=[],t=0;t_.INFO&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [INFO]: ","color: #6facff;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"info",params:n,timestamp:r},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e.prototype.debug=function(){for(var e=[],t=0;t_.DEBUG&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [DEBUG]: ","color: #007bff;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"debug",params:n,timestamp:r},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e}());S.setLogLevel(S.DEBUG,"anyrtc-SDK");var E,T=S,C=Array.prototype,b=function(){function e(){this._events={},this.addListener=this.on}return e.prototype.getListeners=function(e){return this._events[e]?C.map.call(this._events[e],(function(e){return e.listener})):[]},e.prototype.on=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!1})},e.prototype.once=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!0})},e.prototype.off=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e],r=this._indexOfListener(n,t);-1!==r&&C.splice.call(n,r,1)},e.prototype.removeAllListeners=function(e){e?delete this._events[e]:this._events={}},e.prototype.emit=function(e){for(var t=[],n=1;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] ",i),r(i)},t._sendMessage(i)}))]}))}))},t.prototype.doOffline=function(e){var t={Cmd:"Offline"};t.Content=JSON.stringify({UserId:this._userId,UserSId:e}),this._sendMessage(t)},t.prototype.doPublish=function(e,t){var n=this;return new Promise((function(r,i){var o=function(e){var t=e.data,i=JSON.parse(t),a=i.Cmd,s=(i.Encrypt,i.Content),c=JSON.parse(s);a===A.ON_PUBLISH&&(n.signal.removeEventListener("message",o),r(c))};n.signal.addEventListener("message",o);var a={Cmd:"DoPublish"},s={StreamId:n._userId,ClientType:"sdk",AudCodecType:"Opus",VidCodecType:"H264"};if("[object Object]"===Object.prototype.toString.call(e)&&(s.AVSetting=JSON.stringify(Object.assign({HasAudio:!0,HasVideo:!0},e))),t){var c=t.Uri,u=t.Account,d=t.Pwd;a.Content={Uri:c||"",Account:u||"",Pwd:d||""}}a.Content=JSON.stringify(s),n._sendMessage(a)}))},t.prototype.doRePublish=function(e){var t=this;return new Promise((function(n,r){var i=function(e){var r=e.data,o=JSON.parse(r),a=o.Cmd,s=(o.Encrypt,o.Content),c=JSON.parse(s);a===A.ON_RE_PUBLISH&&(t.signal.removeEventListener("message",i),n(c))};t.signal.addEventListener("message",i);var o={Cmd:"DoRePublish"},a={StreamId:t._userId,ClientType:"sdk"};"[object Object]"===Object.prototype.toString.call(e)&&(a.AVSetting=JSON.stringify(Object.assign({HasAudio:!0,HasVideo:!0},e))),o.Content=JSON.stringify(a),t._sendMessage(o)}))},t.prototype.doPublishS=function(e){var t={Cmd:"DoPublishS"},n={StreamId:this._userId};if(e){var r=e.Uri,i=e.Account,o=e.Pwd;t.Content={Uri:r||"",Account:i||"",Pwd:o||""}}t.Content=JSON.stringify(n),this._sendMessage(t)},t.prototype.doUnPublish=function(){var e={Cmd:"DoUnPublish"};e.Content=JSON.stringify({StreamId:this._userId}),this._sendMessage(e)},t.prototype.doUnPublishS=function(){var e={Cmd:"DoUnPublishS"};e.Content=JSON.stringify({StreamId:this._userId}),this._sendMessage(e)},t.prototype.doSubscribe=function(e){var t={Cmd:"DoSubscribe"};t.Content=JSON.stringify(Object.assign({SubSessId:y(32)},e)),this._sendMessage(t)},t.prototype.doUnSubscribe=function(e){var t={Cmd:"DoUnSubscribe"};t.Content=JSON.stringify(Object.assign({StreamId:e})),this._sendMessage(t)},t.prototype.doReNewToken=function(e){var t={Cmd:"RenewAcsToken"};t.Content=JSON.stringify({AcsToken:e}),this._sendMessage(t)},t.prototype.sendAnswer=function(e,t,n){var r={Cmd:"Answer"},i={StreamId:e,Sdp:t};void 0!==n&&(i.SubStream=n),r.Content=JSON.stringify(i),this._sendMessage(r)},t.prototype.sendIceCandidate=function(e,t,n){var r={Cmd:"Ice"},i={StreamId:e,Sdp:t};void 0!==n&&(i.SubStream=n),r.Content=JSON.stringify(i),this._sendMessage(r)},t.prototype.setClientRole=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"SetRole",UserId:this._userId,Role:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.enableDualStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"DualStream",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.setAVStatus=function(e,t,n){var r={Cmd:"ChanMsg"};r.Content=JSON.stringify({Cmd:"SetAVStatus",StreamId:e,RecvAudio:t,RecvVideo:n,ToSvr:"GNode"}),this._sendMessage(r)},t.prototype.setRemoteVStrmType=function(e,t){var n={Cmd:"ChanMsg"};n.Content=JSON.stringify({Cmd:"SetRemoteVStrmType",UserId:this._userId,StreamId:e,StrmType:t,ToSvr:"GNode"}),this._sendMessage(n)},t.prototype.reportAVStat=function(e){var t=e.TimeUsed,n=e.AudNum,r=e.VidSize,i={Cmd:"ReportAVStat"};i.TimeUsed=t,i.AudNum=n,i.VidSize=r,i.AudBitrate=0,i.VidBitrate=0,i.Content="",this._sendMessage(i)},t.prototype.reportArStats=function(e){var t={Cmd:"ReportArStats"};t.Content=JSON.stringify(e),this._sendMessage(t)},t.prototype.enableLocalVideo=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"EnableLocalVideo",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.enableLocalAudio=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"EnableLocalAudio",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.muteLocalVideoStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"MuteLocalVideoStream",UserId:this._userId,Mute:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.muteLocalAudioStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"MuteLocalAudioStream",UserId:this._userId,Mute:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.disconnectCTS=function(e){this.signal&&this.signal.close(1e3,e),this.signal=null},t.prototype.clearEventEmitter=function(){this.removeAllListeners()},t.prototype._setConnectTimeout=function(){var e=this;e._clearConnectTimeout(),e._connectTimeout=window.setTimeout((function(){e._emitConnectionState("DISCONNECTING",f.NETWORK_ERROR)}),1e4)},t.prototype._startKeepAlive=function(){var e=this;e._stopKeepAlive(),e.doKeepAlive(),e._keepAiveInterval=window.setInterval((function(){e.doKeepAlive()}),e._keepAliveIntervalTime)},t.prototype._stopKeepAlive=function(){this._keepAiveInterval&&clearInterval(this._keepAiveInterval)},t.prototype._clearConnectTimeout=function(){this._connectTimeout&&clearTimeout(this._connectTimeout)},t.prototype._handleKeepAlive=function(){var e=this;e._removeHandleKeepAlive(),e._keepAliveTimeout=window.setTimeout((function(){e.disconnectCTS("NETWORK_ERROR")}),3*e._keepAliveIntervalTime)},t.prototype._removeHandleKeepAlive=function(){this._keepAliveTimeout&&clearTimeout(this._keepAliveTimeout)},t.prototype._sendMessage=function(e){return"object"!=typeof e?(T.error("[_sendMessage] msg must be object."),!1):(this.signal&&this.signal.send(JSON.stringify(e)),!0)},t.prototype._emitGateWayEvent=function(e,t){this.emit("@gateway_events",{type:e,data:t})},t.prototype._emitConnectionState=function(e,t){this._revState=this._curState,this._curState=e,this.handleMediaServerEvents&&this.handleMediaServerEvents("connection-state-change",{curState:this._curState,revState:this._revState,reason:t}),T.debug("["+this._userId+"] connection state change: "+this._revState+" -> "+this._curState)},t}(b),x=function(e){for(var t=[],n=1;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=n&&parseInt(r[n],10)}function Q(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};const o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);const r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function $(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Y=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Z(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(X=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function ee(){if("object"==typeof window){if(Y)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function te(e,t){X&&console.warn(e+" is deprecated, please use "+t+" instead.")}function ne(e){const{navigator:t}=e,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=q(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)n.browser="chrome",n.version=q(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=q(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=q(t.userAgent,/AppleWebKit\/(\d+)\./,1),n.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return n}function re(e){return"[object Object]"===Object.prototype.toString.call(e)}function ie(e){return re(e)?Object.keys(e).reduce((function(t,n){const r=re(e[n]),i=r?ie(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[n]:i})}),{}):e}function oe(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?e(t,t.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{e(t,t.get(n),r)})}))}(e,n,i)})}),i}const ae=ee;function se(e){const t=e&&e.navigator;if(!t.mediaDevices)return;const n=ne(e),r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[i("min",n)]=r.ideal,t.optional.push(e),e={},e[i("max",n)]=r.ideal,t.optional.push(e)):(e[i("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(n.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const a=n.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||a)){let n;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?n=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(n=["front"]),n)return t.mediaDevices.enumerateDevices().then(t=>{let a=(t=t.filter(e=>"videoinput"===e.kind)).find(e=>n.some(t=>e.label.toLowerCase().includes(t)));return!a&&t.length&&n.includes("back")&&(a=t[t.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=r(e.video),ae("chrome: "+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return ae("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,r){i(e,e=>{t.webkitGetUserMedia(e,n,e=>{r&&r(o(e))})})}.bind(t),t.mediaDevices.getUserMedia){const e=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException("","NotFoundError");return e},e=>Promise.reject(o(e))))}}}function ce(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(t=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function ue(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function de(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Q(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function fe(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{const t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function le(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach(e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(t=>{n[t]=e.stat(t)}),t[n.id]=n}),t},o=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};if(arguments.length>=2){const r=function(e){n(o(i(e)))};return t.apply(this,[r,e])}return new Promise((e,n)=>{t.apply(this,[function(t){e(o(i(t)))},n])}).then(n,r)}}function pe(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>oe(t,e.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),Q(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>oe(t,e.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function he(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")});const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function ve(e){if(!e.RTCPeerConnection)return;const t=ne(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return he(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(e=>e===t))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find(e=>e.track===t);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>o(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function me(e){const t=ne(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),!e.RTCPeerConnection)return;const n=0===e.RTCPeerConnection.prototype.addIceCandidate.length;t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return n||arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}function _e(e){Q(e,"negotiationneeded",e=>{if("stable"===e.target.signalingState)return e})}var ye=n(133),ge=n.n(ye);function Se(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(e=>Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e)))}}function Ee(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function Te(e){const t=ne(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const n=new Event("enabled");n.enabled=e,this.dispatchEvent(n)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const n=ge()(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(e=>{if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&te("RTCIceServer.url","RTCIceServer.urls");const r="string"==typeof t;return r&&(t=[t]),t=t.filter(e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n}),delete e.url,e.urls=r?t[0]:t,!!t.length}})}(e.iceServers,t.version),ee("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function Ce(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}function be(e){const t=ne(e),n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){te("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function Re(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function we(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ie(e){const t=ne(e);if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})),t.version<68){const t=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,o)}}function Oe(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Ae(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),Q(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Ne(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){te("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function De(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Pe(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach(e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();"encodings"in n||(n.encodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).catch(()=>{})))}return r})}function ke(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function xe(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function Le(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function Me(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function Ue(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function Fe(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Ve(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function Ve(e){return e&&void 0!==e.video?Object.assign({},e,{video:ie(e.video)}):e}function je(e){const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;nt.generateCertificate})}function Be(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ge(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find(e=>"audio"===e.receiver.track.kind);!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find(e=>"video"===e.receiver.track.kind);!1===e.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!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}var We=n(45),He=n.n(We);function Ke(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),r=He.a.parseCandidate(e.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Q(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function Je(e){if(!e.RTCPeerConnection)return;const t=ne(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=He.a.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=He.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},r=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},i=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},o=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=He.a.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=r(arguments[0]),t=i(e),n=o(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>a}),this._sctp=s}return a.apply(this,arguments)}}function ze(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Q(e,"datachannel",e=>(t(e.channel,e.target),e))}function Ye(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function Xe(e){if(!e.RTCPeerConnection)return;const t=ne(e);if("chrome"===t.browser&&t.version>=71)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter(e=>"a=extmap-allow-mixed"!==e.trim()).join("\n")),n.apply(this,arguments)}}var qe,Qe=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=ee,c=ne(e),u={browserDetails:c,commonShim:s,extractVersion:q,disableLog:$,disableWarnings:Z};switch(c.browser){case"chrome":if(!r||!me||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;n("adapter.js shimming chrome."),u.browserShim=r,se(e),ue(e),me(e),de(e),ve(e),fe(e),le(e),pe(e),_e(e),Ke(e),Ye(e),Je(e),ze(e),Xe(e);break;case"firefox":if(!o||!Ie||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=o,be(e),Ie(e),we(e),Ne(e),Oe(e),Ae(e),De(e),Pe(e),ke(e),xe(e),Ke(e),Ye(e),Je(e),ze(e);break;case"edge":if(!i||!Te||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),u;n("adapter.js shimming edge."),u.browserShim=i,Se(e),Ee(e),Te(e),Ce(e),Je(e),ze(e);break;case"safari":if(!a||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=a,je(e),Ge(e),Ue(e),Le(e),Me(e),Be(e),Fe(e),Ke(e),Je(e),ze(e),Xe(e);break;default:n("Unsupported browser!")}return u}({window:window}),$e=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Ze=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]o.framesDecodeCount?(n.lts=Date.now(),t.framesDecodeInterval=a,500<=t.framesDecodeInterval&&(t.framesDecodeFreezeTime+=t.framesDecodeInterval)):t.framesDecodeCount0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.videoEncoderConfig.bitrateMax&&"pub"===this.type&&"chrome"===Qe.browserDetails.browser&&((r=n.sdp.split("\r\n")).forEach((function(e,t){/^a=fmtp:\d*/.test(e)&&(r[t]=e+";x-google-min-bitrate="+o.videoEncoderConfig.bitrateMax/2+";")})),n.sdp=r.join("\r\n")),[4,this.pc.setRemoteDescription(new RTCSessionDescription(n))]):[3,3];case 1:return a.sent(),[4,this.pc.createAnswer(t?{iceRestart:t}:{})];case 2:i=a.sent(),this.pc.setLocalDescription(i),this.emit(A.CREATE_ANSWER,JSON.stringify(i)),a.label=3;case 3:return[2]}}))}))},t.prototype.setIceCandidate=function(e){if(this.pc){var t=JSON.parse(e),n=t.sdpMLineIndex,r=t.candidate,i=new RTCIceCandidate({sdpMLineIndex:n,candidate:r});this.pc.addIceCandidate(i)}},t.prototype.updateBandWidth=function(e){return at(this,void 0,void 0,(function(){var t,n;return st(this,(function(r){switch(r.label){case 0:return"pub"!==this.type&&"pubEx"!==this.type?[3,2]:"chrome"===Qe.browserDetails.browser||"safari"===Qe.browserDetails.browser||"firefox"===Qe.browserDetails.browser&&Qe.browserDetails.version>=64&&"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype?(t=this.pc.getSenders()[0],(n=t.getParameters()).encodings||(n.encodings=[{}]),0===e?delete n.encodings[0].maxBitrate:n.encodings[0].maxBitrate=1e3*e,[4,t.setParameters(n).catch((function(e){return console.error(e)}))]):[3,2];case 1:return r.sent(),[2];case 2:return[2]}}))}))},t.prototype._mungeSdpForSimulcasting=function(e){for(var t=e.split("\r\n"),n=!1,r=[-1],i=[-1],o=null,a=null,s=null,c=null,u=-1,d=0;d-1){u=d;break}}else if(n){var f=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(f)r[0]=f[1],i[0]=f[2],t.splice(d,1),d--;else{if(r[0]){if((h=t[d].match("a=ssrc:"+r[0]+" cname:(.+)"))&&(o=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" msid:(.+)"))&&(a=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" mslabel:(.+)"))&&(s=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" label:(.+)"))&&(c=h[1]),0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+r[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(r[0]<0){u=-1,n=!1;for(d=0;d-1){u=d;break}}else if(n){if(r[0]<0){var p=t[d].match(/a=ssrc:(\d+)/);if(p){r[0]=p[1],t.splice(d,1),d--;continue}}else{var h;if((h=t[d].match("a=ssrc:"+r[0]+" cname:(.+)"))&&(o=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" msid:(.+)"))&&(a=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" mslabel:(.+)"))&&(s=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" label:(.+)"))&&(c=h[1]),0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+r[0])){t.splice(d,1),d--;continue}}0!==t[d].length||(t.splice(d,1),d--)}}}if(r[0]<0)return e;u<0&&(u=t.length),r[1]=Math.floor(4294967295*Math.random()),r[2]=Math.floor(4294967295*Math.random()),i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random());for(d=0;d0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gt=function(){for(var e=[],t=0;tthis.audioLevelBase&&(this.audioLevelBase=Math.abs(e[t]),10&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1](e.bitrate||0)&&(e.bitrate=t._encoderConfig.bitrate),(t._encoderConfig.sampleRate||0)>(e.sampleRate||0)&&(e.sampleRate=t._encoderConfig.sampleRate),(t._encoderConfig.sampleSize||0)>(e.sampleSize||0)&&(e.sampleSize=t._encoderConfig.sampleSize),t._encoderConfig.stereo&&(e.stereo=!0))})),this._encoderConfig=e},t.prototype._handleAllAudioTrackMute=function(){for(var e=!0,t=0;t "+n+" * "+r);break;case"stalled":t.videoElementStatus=St.STALLED;break;case"suspend":t.videoElementStatus=St.SUSPEND;break;case"pause":t.videoElementStatus=St.PAUSED;break;case"waiting":t.videoElementStatus=St.WAITING}},this.startGetVideoDimensions=function(){!function e(){t.videoElement&&(40&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Ht=null,Kt=function(){if(Ht)return Ht;try{return Ht=window.require("electron")}catch(e){return null}};function Jt(e,t){return Bt(this,void 0,void 0,(function(){var n;return Gt(this,(function(r){switch(r.label){case 0:return n={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxHeight:t.height,maxWidth:t.width}}},t.frameRate&&"number"!=typeof t.frameRate?(n.video.mandatory.maxFrameRate=t.frameRate.max,n.video.mandatory.minFrameRate=t.frameRate.min):"number"==typeof t.frameRate&&(n.video.mandatory.maxFrameRate=t.frameRate),[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,r.sent()]}}))}))}function zt(e){return Bt(this,void 0,void 0,(function(){var t,n,r;return Gt(this,(function(i){switch(i.label){case 0:t=["window","screen"],"application"!==e&&"window"!==e||(t=["window"]),"screen"===e&&(t=["screen"]),n=Kt(),r=null;try{r=n.desktopCapturer.getSources({types:t})}catch(e){r=null}return r instanceof Promise||(r=new Promise((function(e,r){n.desktopCapturer.getSources({types:t},(function(t,n){t?r(t):e(n)}))}))),[4,r];case 1:return[2,i.sent()]}}))}))}function Yt(e,t){return void 0===t&&(t=!1),Bt(this,void 0,void 0,(function(){var n,r,i,o,a,s;return Gt(this,(function(c){switch(c.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new x(v.NOT_SUPPORT+"can not find getUserMedia");return t&&(e.video&&(delete e.video.width,delete e.video.height),e.screen&&(delete e.screen.width,delete e.screen.height)),n=jt,e.audio||e.video||e.screen||e.audioSource||e.videoSource?e.audio||e.video?(r={video:e.video,audio:e.audio},[4,navigator.mediaDevices.getUserMedia(r)]):[3,2]:[3,11];case 1:return[2,c.sent()];case 2:return e.screen?(i=Object.assign({},{width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate}),o=e.screen.electronScreenSourceId||"screen",Kt()?[4,zt(o)]:[3,7]):[3,10];case 3:return(a=c.sent())?[4,(u=a,new Promise((function(e,t){var n=document.createElement("div");n.innerText="share screen",n.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom: solid 1px #B9B8B9;");var r=document.createElement("div");r.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");var i=document.createElement("div");i.innerText="Agora Web Screensharing wants to share the contents of your screen with webdemo.agorabeckon.com. Choose what you'd like to share.",i.setAttribute("style","height: 12%;");var o=document.createElement("div");o.setAttribute("style","width: 100%; height: 80%; background: #FFF; border: solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");var a=document.createElement("div");a.setAttribute("style","text-align: right; padding: 16px 0;");var s=document.createElement("button");s.innerHTML="cancel",s.setAttribute("style","width: 85px;"),s.onclick=function(){document.body.removeChild(c);var e=new Error("NotAllowedError");e.name="NotAllowedError",t(e)},a.appendChild(s),r.appendChild(i),r.appendChild(o),r.appendChild(a);var c=document.createElement("div");c.setAttribute("style","position: absolute; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),c.appendChild(n),c.appendChild(r),document.body.appendChild(c),u.map((function(t){if(t.id){var n=document.createElement("div");n.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;"),n.innerHTML='
'+t.name+"",n.onclick=function(){document.body.removeChild(c),e(t.id)},o.appendChild(n)}}))})))]:[3,6];case 4:return[4,Jt(c.sent(),i)];case 5:return[2,c.sent()];case 6:return[3,9];case 7:return n.getDisplayMedia?(e.screen.mediaSource&&~["screen","window","application"].indexOf(e.screen.mediaSource)&&Object.assign(i,{displaySurface:"screen"===e.screen.mediaSource?"monitor":e.screen.mediaSource}),[4,navigator.mediaDevices.getDisplayMedia({video:i,audio:!!e.screenAudio})]):[3,9];case 8:return[2,c.sent()];case 9:return[3,11];case 10:if(e.audioSource||e.videoSource)return s=new MediaStream,e.audioSource&&s.addTrack(e.audioSource),e.videoSource&&s.addTrack(e.videoSource),[2,s];c.label=11;case 11:return[2]}var u}))}))}function Xt(e,t,n){var r,i,o,a,s=0,c=0,u=0,d=0;if(n&&(n.bitrateMin&&(c=n.bitrateMin),n.bitrateMax&&(s=n.bitrateMax),u=c||0,d=s||0,c>(s=s)&&(c=s),c=c),t){var f=t.frameRate,l=t.height,p=t.width*l,h=[];p<14400||p>=14400&&p<19200?h=[50,100]:p>=19200&&p<32400?h=[64,130]:p>=32400&&p<43200?h=[100,200]:p>=43200&&p<57600?h=[120,240]:p>=57600&&p<76800?h=[140,280]:p>=76800&&p<101760?h=[200,400]:p>=101760&&p<129600?h=[220,440]:p>=129600&&p<172800?h=[260,520]:p>=172800&&p<230400?h=[320,640]:p>=230400&&p<307200?h=[400,800]:p>=307200&&p<407040?h=[500,1e3]:p>=407040&&p<691200?h=[610,1220]:p>=691200&&p<921600?h=[910,1820]:p>=921600&&p<2073600?h=[1130,2260]:p>=2073600&&p<3686400?h=[2080,4160]:p>=3686400&&p<8294400?h=[4850,6500]:p>8294400&&(h=[6500,8910]),c=(r=Wt(function(e,t,n,r){var i,o,a;"rtc"===e||"game"===e?(i=Wt(r,1),a=i[0],(n<=0||n>a)&&(n=a)):(o=Wt(r,2),a=o[1],(n<=0||n>a)&&(n=a));return[30,n]}(e,0,s,h),2))[0],s=r[1],f<10?(c=(i=Wt([c/2,s/2],2))[0],s=i[1]):f>24||f<=30?p<=2073600&&(c=(o=Wt([1.5*c,1.5*s],2))[0],(s=o[1])>6500&&(s=6500)):f>30&&(c=(a=Wt([1.5*c,1.5*s],2))[0],s=a[1])}0!==u&&u0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1;n--)if(r=t._pubTracks[n],~e.indexOf(r)){if("video"===r.trackMediaType){if(this.videoTrack!==r)throw new x(v.INVALID_OPERATION,"You haven't published this track ",r);this.videoTrack.off(A.UPDATE_MUTE_STATE,t._handleVideoTrackEvent),this.videoTrack.off(A.RTC_NEED_RENEGOTIATE,t._handleRTCNeedRenegotiate),this.removeTrack(this.videoTrack),this.peer.removeTrack(this._videoMediaStreamTrack)}else"audio"===r.trackMediaType&&this.audioTrack&&((i=this.audioTrack).removeAudioTrack(r),0===i.trackList.length&&(this.audioTrack.off(A.UPDATE_MUTE_STATE,t._handleAudioTrackEvent),this.removeTrack(i),this.peer.removeTrack(this._audioMediaStreamTrack)));t._pubTracks.splice(n,1)}}else this.audioTrack&&(this.audioTrack.off(A.UPDATE_MUTE_STATE,t._handleAudioTrackEvent),this.audioTrack.removeAllAudioTracks(),this.peer.removeTrack(this._audioMediaStreamTrack)),this.videoTrack&&(this.videoTrack.off(A.UPDATE_MUTE_STATE,t._handleVideoTrackEvent),this.videoTrack.off(A.RTC_NEED_RENEGOTIATE,this._handleRTCNeedRenegotiate),this.peer.removeTrack(this._videoMediaStreamTrack)),this._pubTracks=[],this.removeTrack();return[2,t._pubTracks]}))}))},t.prototype.destory=function(e){void 0===e&&(e=!0),this.removeTracks(),this.removeAllTracks(e),this.clearOriginTracks(),this._closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.type="",this.ID=""},t.prototype._handleRTCNeedRenegotiate=function(){var e=this.videoTrack._encoderConfig.bitrateMax;this.peer.updateBandWidth(e)},t.prototype._handleVideoTrackMuteUpdate=function(e){this.emit(A.UPDATE_MUTE_STATE,this.ID,this.type,this.videoTrack.trackMediaType,e)},t.prototype._handleAudioTrackMuteUpdate=function(e){this.emit(A.UPDATE_MUTE_STATE,this.ID,this.type,this.audioTrack.trackMediaType,e)},t}(_t),ln=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="pubEx",i._createPC(r),i.statsCollector=n,i.statsCollector.addLocalConnection(i),i}return ln(t,e),t.prototype.addTracks=function(e){var t=this;"video"!==e.trackMediaType||this.videoTrack||(this.videoTrack=e,e.getStats=function(){return t.statsCollector.getLocalVideoTrackStats(t.ID)},this._videoMediaStreamTrack=e.getMediaStreamTrack(),this.peer.addTrack(this._videoMediaStreamTrack,e._encoderConfig))},t.prototype.removeTracks=function(e){"video"===e.trackMediaType&&e===this.videoTrack&&(this.videoTrack=void 0,this.peer.removeTrack(this._videoMediaStreamTrack))},t.prototype.destory=function(e){void 0===e&&(e=!0),this.removeTracks(this.videoTrack),this.removeAllTracks(e),this.clearOriginTracks(),this._closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.type="",this.ID=""},t}(_t),hn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._player=void 0,r.trackMediaType="video",r}return hn(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return!!this._player},enumerable:!0,configurable:!0}),t.prototype.play=function(e,t){var n=void 0!==t&&"[object Object]"===Object.prototype.toString.call(t)?t:{};if("string"==typeof e){var r=void 0,i=document.getElementById(e);i?e=i:(r="[track-".concat(this.getTrackId(),'] can not find "#'),T.warning(r.concat(e,'" element, use document.body')),e=document.body)}T.debug("[track-".concat(this.getTrackId(),"] play"));var o=Object.assign({},{},n,{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(o):(this._player=new At(o),this._player.updateVideoTrack(this._mediaStreamTrack)),"playing"!==this._player._playervideoElementStatus&&this._player.play()},t.prototype.stop=function(){this._player&&(this._player.destroy(),this._player=void 0)},t.prototype.getStats=function(){},t}(z),mn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_n=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.trackMediaType="audio",document.createElement("audio").srcObject=new MediaStream([t]),r._context=Et.getAudioContextInstance();var i=r._context.createMediaStreamSource(new MediaStream([t]));return Et.addSourceNode(n,i),r}return mn(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){throw new Error("Method not implemented.")},enumerable:!0,configurable:!0}),t.prototype.play=function(){Et.getSourceNode(this.getTrackId()).startPlay()},t.prototype.stop=function(){Et.getSourceNode(this.getTrackId()).stopPlay()},t.prototype.setVolume=function(e){Et.getGainNode(this.getTrackId()).gain.setValueAtTime(e/1e3,this._context.currentTime)},t.prototype.getVolumeLevel=function(){return Et.getGainNode(this.getTrackId()).gain.value},t.prototype.getStats=function(){},t}(z),yn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="sub",i._createPC(r),i.statsCollector=n,i.statsCollector.addRemoteConnection(i),i}return yn(t,e),t.prototype.addTracks=function(e){if("video"===e){var t=this._videoMediaStreamTrack,n=new vn(t,y(5));return this.addTrack(n),this.videoTrack}var r=this._audioMediaStreamTrack,i=new _n(r,y(5));this.addTrack(i);var o=document.createElement("audio");return o.autoplay=!0,o.muted=!0,o.setAttribute("muted","muted"),o.setAttribute("autoplay","autoplay"),o.srcObject=new MediaStream([r]),this.audioTrack},t.prototype.removeTracks=function(e){"video"===e?this.removeTrack(this.videoTrack):this.removeTrack(this.audioTrack)},t.prototype.destory=function(e){void 0===e&&(e=!0),this.removeAllTracks(e),this.clearOriginTracks(),this._closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.type="",this.ID=""},t}(_t),Sn={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0},En={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0},Tn={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0},Cn={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0},bn=function(){function e(e){this.clientId="",this.localConnectionsMap=new Map,this.remoteConnectionsMap=new Map,this.clientId=e,this.updateStatsInterval=window.setInterval(this.updateStats.bind(this),1e3)}return e.prototype.updateStats=function(){this.remoteConnectionsMap.forEach((function(e){var t=e.audioStats,n=e.videoStats,r=e.pcStats,i=Object.assign({},Sn),o=Object.assign({},En),a=e.connection.peer.getStats();if(a){var s=a.audioRecv[0],c=a.videoRecv[0];r&&r.videoRecv[0];s&&("opus"!==s.codec&&"aac"!==s.codec||(i.codecType=s.codec),s.outputLevel?i.receiveLevel=Math.round(32767*s.outputLevel):e.connection.audioTrack&&(i.receiveLevel=Math.round(32767*e.connection.audioTrack.getVolumeLevel())),i.receiveBytes=s.bytes,i.receivePackets=s.packets,i.receivePacketsLost=s.packetsLost,i.packetLossRate=i.receivePacketsLost/i.receivePackets,i.receiveBitrate=t?8*Math.max(0,i.receiveBytes-t.receiveBytes):0,i.totalDuration=t?t.totalDuration+1:1,i.totalFreezeTime=t?t.totalFreezeTime:0,i.freezeRate=i.totalFreezeTime/i.totalDuration,i.receiveDelay=s.jitterBufferMs),c&&("H264"!==c.codec&&"VP8"!==c.codec||(o.codecType=c.codec),o.receiveBytes=c.bytes,o.receiveBitrate=n?8*Math.max(0,o.receiveBytes-n.receiveBytes):0,o.decodeFrameRate=c.decodeFrameRate,o.renderFrameRate=c.decodeFrameRate,c.outputFrame&&(o.renderFrameRate=c.outputFrame.frameRate),c.receivedFrame?(o.receiveFrameRate=c.receivedFrame.frameRate,o.receiveResolutionHeight=c.receivedFrame.height,o.receiveResolutionWidth=c.receivedFrame.width):e.connection.videoTrack&&(o.receiveResolutionHeight=e.connection.videoTrack._videoHeight||0,o.receiveResolutionHeight=e.connection.videoTrack._videoWidth||0),void 0!==c.framesRateFirefox&&(o.receiveFrameRate=Math.round(c.framesRateFirefox)),o.receivePackets=c.packets,o.receivePacketsLost=c.packetsLost,o.packetLossRate=o.receivePacketsLost/o.receivePackets,o.totalDuration=n?n.totalDuration+1:1,o.totalFreezeTime=n?n.totalFreezeTime:0,o.receiveDelay=c.jitterBufferMs||0,o.freezeRate=o.totalFreezeTime/o.totalDuration),e.audioStats=i,e.videoStats=o,e.pcStats=a}})),this.localConnectionsMap.forEach((function(e){var t=e.audioStats,n=e.videoStats,r=Object.assign({},Tn),i=Object.assign({},Cn),o=e.connection.peer.getStats();if(o){var a=o.audioSend[0],s=o.videoSend[0];a&&("opus"!==a.codec&&"aac"!==a.codec||(r.codecType=a.codec),a.inputLevel?r.sendVolumeLevel=Math.round(32767*a.inputLevel):e.connection.audioTrack&&(r.sendVolumeLevel=Math.round(32767*e.connection.audioTrack.getVolumeLevel())),r.sendBytes=a.bytes,r.sendPackets=a.packets,r.sendPacketsLost=a.packetsLost,r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0),s&&("H264"!==s.codec&&"VP8"!==s.codec||(i.codecType=s.codec),i.sendBytes=s.bytes,i.sendBitrate=n?8*Math.max(0,i.sendBytes-n.sendBytes):0,s.inputFrame?(i.captureFrameRate=s.inputFrame.frameRate,i.captureResolutionHeight=s.inputFrame.height,i.captureResolutionWidth=s.inputFrame.width):e.connection.videoTrack&&(i.captureResolutionWidth=e.connection.videoTrack._videoWidth||0,i.captureResolutionHeight=e.connection.videoTrack._videoHeight||0),s.sentFrame?(i.sendFrameRate=s.sentFrame.frameRate,i.sendResolutionHeight=s.sentFrame.height,i.sendResolutionWidth=s.sentFrame.width):e.connection.videoTrack&&(i.sendResolutionWidth=e.connection.videoTrack._videoWidth||0,i.sendResolutionHeight=e.connection.videoTrack._videoHeight||0),s.avgEncodeMs&&(i.encodeDelay=s.avgEncodeMs),e.connection.videoTrack&&e.connection.videoTrack._encoderConfig&&e.connection.videoTrack._encoderConfig.bitrateMax&&(i.targetSendBitrate=1e3*e.connection.videoTrack._encoderConfig.bitrateMax),i.sendPackets=s.packets,i.sendPacketsLost=s.packetsLost,i.totalDuration=n?n.totalDuration+1:1,i.totalFreezeTime=n?n.totalFreezeTime:0),e.audioStats=r,e.videoStats=i}}))},e.prototype.getLocalAudioTrackStats=function(e){var t=this.localConnectionsMap.get(e);return t&&t.audioStats?t.audioStats:Object.assign({},Tn)},e.prototype.getLocalVideoTrackStats=function(e){var t=this.localConnectionsMap.get(e);return t&&t.videoStats?t.videoStats:Object.assign({},Cn)},e.prototype.getRemoteAudioTrackStats=function(e){var t=this.remoteConnectionsMap.get(e);return t&&t.audioStats?t.audioStats:Object.assign({},Sn)},e.prototype.getRemoteVideoTrackStats=function(e){var t=this.remoteConnectionsMap.get(e);return t&&t.videoStats?t.videoStats:Object.assign({},En)},e.prototype.getRTCStats=function(){var e=0,t=0,n=0,r=0;this.localConnectionsMap.forEach((function(n){n.audioStats&&(e+=n.audioStats.sendBytes,t+=n.audioStats.sendBitrate),n.videoStats&&(e+=n.videoStats.sendBytes,t+=n.videoStats.sendBitrate)})),this.remoteConnectionsMap.forEach((function(e){e.audioStats&&(r+=e.audioStats.receiveBytes,n+=e.audioStats.receiveBitrate),e.videoStats&&(r+=e.videoStats.receiveBytes,n+=e.videoStats.receiveBitrate)}));return{Duration:0,UserCount:1,SendBitrate:t,SendBytes:e,RecvBytes:r,RecvBitrate:n,OutgoingAvailableBandwidth:0,RTT:0}},e.prototype.removeConnection=function(e){this.localConnectionsMap.delete(e),this.remoteConnectionsMap.delete(e)},e.prototype.addLocalConnection=function(e){var t=e.ID;this.localConnectionsMap.has(t)||this.localConnectionsMap.set(t,{connection:e})},e.prototype.addRemoteConnection=function(e){var t=e.ID;this.remoteConnectionsMap.has(t)||this.remoteConnectionsMap.set(t,{connection:e})},e.prototype.updateTrafficStats=function(e){},e.prototype.updateUplinkStats=function(e){},e.prototype.isLocalVideoFreeze=function(e,t){var n=!!t&&e.framesDecodeFreezeTime>t.framesDecodeFreezeTime,r=!t||e.framesDecodeCount>t.framesDecodeCount;return n||!r},e.prototype.isRemoteAudioFreeze=function(e){},e.prototype.clear=function(){clearInterval(this.updateStatsInterval),this.clientId="",this.localConnectionsMap=new Map,this.remoteConnectionsMap=new Map},e}(),Rn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},In=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){e.UN_PUBLISH="UN_PUBLISH",e.PUBLISH="PUBLISH",e.RE_PUBLISH="RE_PUBLISH"}(nn||(nn={}));var An,Nn,Dn=function(e){function t(t){var n=e.call(this)||this;if(n.channelName=void 0,n.connectionState="DISCONNECTED",n.remoteUsers=[],n.uid="",n.localTracks=[],n._isStringUID=!0,n._turnServer=void 0,n._isDualStreamEnabled=!1,n._clientId="",n._sessionId="",n._useWss=!0,n._config={forceWaitGatewayResponse:!0,mode:"rtc",codec:"h264",role:"host"},n._joinInfo={},n._appId="",n._highStream=void 0,n._lowStream=void 0,n._latestRepInfo={},n._AVStatsControlls=void 0,n._reportStatsInterval=0,n._latestEventLts={},n._subPeerAVStats={},t){t.codec;var r=t.mode,i=t.role;"live"!==r||i||(t.role="audience"),n._config=Object.assign(n._config,t),"rtc"===r&&(n._config.role="host"),n._config.codec="h264",T.info("["+n._clientId+"] Initializing ArRTC client, mode: "+n._config.mode+", codec: "+n._config.codec)}return n._clientId=y(5),n._statsCollector=new bn(n._clientId),n._setAVStatsRepTimer(),n}return Rn(t,e),t.prototype.join=function(e,t,n,r){var i=this,o=this;o._latestEventLts.joinStartTime=Date.now();return new Promise((function(a,s){return wn(i,void 0,void 0,(function(){var i,s,c;return In(this,(function(u){switch(u.label){case 0:if("DISCONNECTED"!==o.connectionState)throw new x(v.INVALID_OPERATION,"join failure Cause of current server state is "+o.connectionState);if("string"!=typeof e)throw new TypeError("appid must be string.");if(""===e)throw new TypeError("appid can not be empty.");if(o._appId=e,o._joinInfo.appId,i=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof t)throw new TypeError("channel must be string.");if(!i.test(t))throw new x(v.INVALID_PARAMS,"The length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,");if(o.channelName=t,s=/^[a-zA-Z0-9]{1,48}$/,""!==r&&null!=r&&!s.test(r))throw new x(v.INVALID_PARAMS,"The length must be within 48 bytes. The supported characters: a-z,A-Z,0-9");return o._createMediaServerIntance(),o._joinInfo.sid=y(32),n&&(o._joinInfo.token=n),[4,o._authGateWay(r,n).catch((function(e){switch(e){case"CHANNEL_BANNED":case"IP_BANNED":case"SERVER_ERROR":case"UID_BANNED":case"DEVELOPER_INVALID":case"APP_INVALID":case"TOKEN_INVALID":o.emit("connection-state-change","DISCONNECTING","CONNECTING",f[e]);break;case"TOKEN_EXPIRED":o.emit("token-privilege-did-expire"),T.debug("token privilege has expire")}T.error(e)}))];case 1:return(c=u.sent())&&a(c),[2]}}))}))}))},t.prototype.leave=function(){var e=this;return new Promise((function(t,n){var r,i,o;return wn(this,void 0,void 0,(function(){var a;return In(this,(function(s){switch(s.label){case 0:return Object.keys(e._joinInfo).length>0?("CONNECTED"===e.connectionState&&(null===(r=e._gateway)||void 0===r||r.doOffline(e._joinInfo.sid),null===(i=e._gateway)||void 0===i||i.disconnectCTS(),e.connectionState="DISCONNECTED",null===(o=e._gateway)||void 0===o||o.removeAllListeners(),e._gateway=void 0),e.remoteUsers.map((function(t,n){t._mediaStream&&t._mediaStream.destory(),e._unsubscribe(t)})),e._subPeerAVStats={},e._sessionId="",e.remoteUsers=[],e._msSub=[],e.uid="",e._joinInfo={},e._statsCollector&&e._statsCollector.clear(),e._highStream?[4,e.unpublish()]:[3,2]):[3,3];case 1:s.sent(),s.label=2;case 2:return a=Date.now(),it.leave(e._joinInfo.sid,{startTime:a,extend:null}),t(),[2];case 3:return n(),[2]}}))}))}))},t.prototype.publish=function(e){var t=this,n=this;return new Promise((function(r,i){return wn(t,void 0,void 0,(function(){var t,o,a,s,c,u,d,f,l,p,h,m,_,y,g,S,E,C,b,R,w,I,O,A,N,D,P,k,L,M,U,F,V;return In(this,(function(j){switch(j.label){case 0:if(n._latestEventLts.publishStartLts=Date.now(),"CONNECTED"!==n.connectionState)throw new x(v.INVALID_OPERATION,"Can't publish stream when connection state is not connected");if(t=[],e instanceof Array)t=e;else{if(!(e instanceof K))throw new x(v.INVALID_PARAMS,"track must be LocalTrack");t=[e]}if(0===(t=t.filter((function(e){return e instanceof K}))).length)throw new x(v.INVALID_PARAMS,"track list is empty");if("live"===n._config.mode&&"audience"===n._config.role)throw new x(v.INVALID_OPERATION,"audience can not publish stream");return o=n._highStream||{},a=o.videoTrack,s=o.audioTrack,[4,n._publishHighStream(t)];case 1:return c=j.sent(),u=n._highStream,d=u.videoTrack,f=u.audioTrack,l=!!d,p=!!f,0!==n.localTracks.length?[3,3]:(d&&(h=d.getMediaStreamTrack(),m=d.getEncoderConfig(),(_=function(e){return e instanceof MediaStreamTrack?e.getSettings():null}(h))&&Xt(n._config.mode,_,m)),[4,null===(O=n._gateway)||void 0===O?void 0:O.doPublish({LocalAudioEnable:p,LocalVideoEnable:l,LocalAudioMute:!!p&&!f._enabled,LocalVideoMute:!!l&&!d._enabled,DualStream:n._isDualStreamEnabled},n._turnServer)]);case 2:return y=j.sent(),0===(R=y.Code)?(g={startTime:n._latestEventLts.publishStartLts,success:!0,cameraDeviceId:n._highStream.videoTrack?n._highStream.videoTrack.getMediaStreamTrack().label:"",microphoneDeviceId:n._highStream.audioTrack?n._highStream.audioTrack.getMediaStreamTrack().label:""},0===R?(y.StreamId,w=y.Offer,I=n._highStream.peer,g.success=!0,I.createAnswer(w),n._isDualStreamEnabled&&(n._publishLowStream(),null===(A=n._gateway)||void 0===A||A.doPublishS(n._turnServer),null===(N=n._gateway)||void 0===N||N.enableDualStream(!0)),n.localTracks=c):g.success=!1,it.publish(n._joinInfo.sid,g),r()):T.error("publish failure, need republish"),[3,6];case 3:return n._highStream&&(null===(D=n._highStream.peer)||void 0===D?void 0:D.pc)&&(S=null===(k=null===(P=n._highStream.peer)||void 0===P?void 0:P.pc)||void 0===k?void 0:k.getTransceivers())?(E=S.filter((function(e){return"video"===e.mid})),C=S.filter((function(e){return"audio"===e.mid})),E.length>0&&"inactive"===(null===(L=E[0])||void 0===L?void 0:L.currentDirection)||C.length>0&&"inactive"===(null===(M=C[0])||void 0===M?void 0:M.currentDirection)?[4,null===(U=n._gateway)||void 0===U?void 0:U.doRePublish({LocalAudioEnable:p,LocalVideoEnable:l,LocalAudioMute:!!p&&!f._enabled,LocalVideoMute:!!l&&!d._enabled,DualStream:n._isDualStreamEnabled})]:[3,5]):[3,6];case 4:return(b=j.sent())&&(R=b.Code,b.StreamId,w=b.Offer,0===R?((I=n._highStream.peer).createAnswer(w,!0),r()):i()),[3,6];case 5:p!==!!s&&(null===(F=n._gateway)||void 0===F||F.enableLocalAudio(p)),l!==!!a&&(null===(V=n._gateway)||void 0===V||V.enableLocalVideo(l)),j.label=6;case 6:return[2]}}))}))}))},t.prototype.unpublish=function(e){var t;return wn(this,void 0,void 0,(function(){var n,r,i,o=this;return In(this,(function(a){switch(a.label){case 0:if(!(n=this)._highStream)throw new x(v.INVALID_OPERATION,"You haven't published track yet");return r=[],e&&e instanceof K?r=[e]:e instanceof Array&&(r=e),r=r.filter((function(e){return e instanceof K})),void 0!==e&&JSON.stringify(r)!==JSON.stringify(n.localTracks)?[3,2]:(r=n.localTracks,i=n,[4,n._highStream.removeTracks(r)]);case 1:return i.localTracks=a.sent(),null===(t=n._gateway)||void 0===t||t.doUnPublish(),n._isDualStreamEnabled&&(n.disableDualStream(),n._lowStream&&n._lowStream.destory()),n._highStream.destory(),n._highStream=void 0,[3,3];case 2:r.map((function(e){return wn(o,void 0,void 0,(function(){var t,r,i,o;return In(this,(function(a){switch(a.label){case 0:return~n.localTracks.indexOf(e)?e instanceof Rt?(t=n,[4,n._highStream.removeTracks(e)]):[3,2]:[3,4];case 1:t.localTracks=a.sent(),0===n.localTracks.filter((function(e){return e instanceof Rt})).length&&(null===(i=n._gateway)||void 0===i||i.enableLocalAudio(!1)),a.label=2;case 2:return e instanceof sn?(r=n,[4,n._highStream.removeTracks(e)]):[3,4];case 3:r.localTracks=a.sent(),0===n.localTracks.filter((function(e){return e instanceof sn})).length&&(null===(o=n._gateway)||void 0===o||o.enableLocalVideo(!1)),n._isDualStreamEnabled&&(n.disableDualStream(),n._lowStream&&n._lowStream.destory()),a.label=4;case 4:return[2]}}))}))})),a.label=3;case 3:return[2]}}))}))},t.prototype.subscribe=function(e,t){var n=this,r=this;return new Promise((function(i,o){return wn(n,void 0,void 0,(function(){var n,o,a,s,c,u,d,f,l;return In(this,(function(p){if(!r._gateway)throw new x(v.INVALID_OPERATION,"call this api before join");if(!(n=r.remoteUsers.find((function(t){return t.uid===e.uid}))))throw new x("user "+e.uid+" is not find");if("video"!==t&&"audio"!==t)throw new x(v.INVALID_PARAMS,"mediaType must be 'video' or 'audio'");return o=n.hasVideo,a=n.hasAudio,s=o&&"video"===t,c=a&&"audio"===t,r._subPeerAVStats[e.uid]?(null===(d=r._gateway)||void 0===d||d.setAVStatus(e.uid,a,o),"video"===t?r._subPeerAVStats[e.uid].subscribeVideo=!0:"audio"===t&&(r._subPeerAVStats[e.uid].subscribeAudio=!0)):(r._subPeerAVStats[e.uid]={subscribeVideo:s,subscribeAudio:c,_originAudioTrack:null,_originVideoTrack:null},r._latestEventLts.subscribeStartLts=Date.now(),null===(u=r._gateway)||void 0===u||u.doSubscribe({StreamId:e.uid,SvrIp:r._msSub[0].ip,SvrPort:r._msSub[0].port,RecvAudio:c,RecvVideo:s,StrmType:n._subStreamType,PubSessId:n._pubSid,VideoCache:n._videoCache})),c&&((null===(f=n._mediaStream)||void 0===f?void 0:f._audioMediaStreamTrack)?(n.audioTrack||(n.audioTrack=n._mediaStream.addTracks("audio")),i()):Object.defineProperty(n,"_audioMediaStreamTrack",{enumerable:!0,configurable:!0,set:function(e){this.audioTrack=n._mediaStream.addTracks("audio"),i()}})),s&&((null===(l=n._mediaStream)||void 0===l?void 0:l._videoMediaStreamTrack)?(n.videoTrack||(n.videoTrack=n._mediaStream.addTracks("video")),i()):Object.defineProperty(n,"_videoMediaStreamTrack",{enumerable:!0,configurable:!0,set:function(e){this.videoTrack=n._mediaStream.addTracks("video"),i()}})),[2]}))}))}))},t.prototype.unsubscribe=function(e,t){var n=this;return new Promise((function(r,i){var o,a,s=n._unsubscribe(e,t);s.hasAudio||s.hasVideo?(null===(a=n._gateway)||void 0===a||a.setAVStatus(s.uid,s.hasAudio,s.hasVideo),"video"===t?n._subPeerAVStats[e.uid].subscribeVideo=!1:"audio"===t&&(n._subPeerAVStats[e.uid].subscribeAudio=!1)):(null===(o=n._gateway)||void 0===o||o.doUnSubscribe(s.uid),s._mediaStream.destory(),s._mediaStream=null,delete n._subPeerAVStats[e.uid]);r()}))},t.prototype.setLowStreamParameter=function(e){if(!e)throw new x(v.INVALID_PARAMS,"streamParameter must be object");if(this._isDualStreamEnabled&&this._lowStream){var t={};e.framerate&&(t.frameRate=e.framerate>15?15:e.framerate),e.height&&(t.height=e.height),e.width&&(t.width=e.width),this._lowStream._videoMediaStreamTrack.applyConstraints(t)}},t.prototype.enableDualStream=function(){return wn(this,void 0,void 0,(function(){var e,t=this;return In(this,(function(n){return e=this,[2,new Promise((function(n,r){return wn(t,void 0,void 0,(function(){var t,n;return In(this,(function(r){if(!0===e._isDualStreamEnabled)return T.warning(v.INVALID_OPERATION,"Already enabled."),[2];if(e._isDualStreamEnabled=!0,"{}"!==JSON.stringify(e._joinInfo)&&"CONNECTED"===e.connectionState){if(!e._highStream||!e._highStream.videoTrack)throw new x(v.INVALID_OPERATION,"Can't publish low stream cause of you did not publish high stream");e._publishLowStream(),null===(t=e._gateway)||void 0===t||t.doPublishS(e._turnServer),null===(n=e._gateway)||void 0===n||n.enableDualStream(!0)}return[2]}))}))}))]}))}))},t.prototype.disableDualStream=function(){var e=this;return new Promise((function(t,n){var r,i;!1!==e._isDualStreamEnabled?(e._isDualStreamEnabled=!1,null===(r=e._gateway)||void 0===r||r.doUnPublishS(),null===(i=e._gateway)||void 0===i||i.enableDualStream(!1)):T.warning(v.INVALID_OPERATION,"Already disabled.")}))},t.prototype.setParameters=function(e){return wn(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return In(this,(function(c){return t=this,n=e.ConfPriCloudAddr,r=e.SetTurnSvr,i=e.ConfPriEventAddr,n&&(a=n.ServerAdd,s=n.Port,o=n.Wss,t._useWss="boolean"!=typeof o||o,a&&(m.GATEWAY_ADDRESS=t._useWss?"https://"+a:"http://"+a+(s?":"+s:""))),~m.GATEWAY_ADDRESS.indexOf(m.EVENT_REPORT_DOMAIN)||it.setBasicUrl("",""),r&&(t._turnServer=r),i&&(a=i.ServerAdd,s=i.Port,a&&it.setBasicUrl(a,a)),[2]}))}))},t.prototype.setClientRole=function(e){var t;return wn(this,void 0,void 0,(function(){var n;return In(this,(function(r){if("rtc"===(n=this)._config.mode)throw T.warning("rtc mode can not use setClientRole"),new x(v.INVALID_OPERATION,"rtc mode can not use setClientRole");if("audience"===e&&n._highStream)throw new x(v.INVALID_OPERATION,"can not set client role to audience when publishing stream");return e!==n._config.role&&(n._config.role=e,null===(t=n._gateway)||void 0===t||t.setClientRole(e)),[2]}))}))},t.prototype.setProxyServer=function(){},t.prototype.startProxyServer=function(){},t.prototype.stopProxyServer=function(){},t.prototype.setRemoteVideoStreamType=function(e,t){var n=this;return new Promise((function(r,i){var o,a=n.remoteUsers.find((function(t){return t.uid===e}));if(!a)throw T.warning("can not find remote user "+e),new x(v.INVALID_PARAMS,"can not find remote user "+e);if("number"!=typeof t)throw new x(v.INVALID_PARAMS,"streamType must be number");if(!a._dualStream)throw new x(v.INVALID_OPERATION,"The remote user "+e+" did not enable the dual stream");(null==a?void 0:a.hasVideo)?(null===(o=n._gateway)||void 0===o||o.setRemoteVStrmType(e,t),n.emit("stream-type-changed",e,t)):a._subStreamType=t}))},t.prototype.setStreamFallbackOption=function(e,t){return new Promise((function(e,t){}))},t.prototype.setEncryptionConfig=function(e,t){},t.prototype.renewToken=function(e){var t=this;return new Promise((function(n,r){var i;if("CONNECTED"!==t.connectionState)throw new x(v.INVALID_OPERATION,"renewToken should not be called before user join");null===(i=t._gateway)||void 0===i||i.doReNewToken(e)}))},t.prototype.enableAudioVolumeIndicator=function(){},t.prototype.getRTCStats=function(){return this._statsCollector.getRTCStats()},t.prototype.setLiveTranscoding=function(e){return new Promise((function(e,t){}))},t.prototype.startLiveStreaming=function(e,t){return new Promise((function(e,t){}))},t.prototype.stopLiveStreaming=function(e){return new Promise((function(e,t){}))},t.prototype.addInjectStreamUrl=function(e,t){return new Promise((function(e,t){}))},t.prototype.removeInjectStreamUrl=function(){return new Promise((function(e,t){}))},t.prototype.startChannelMediaRelay=function(e){return new Promise((function(e,t){}))},t.prototype.updateChannelMediaRelay=function(e){return new Promise((function(e,t){}))},t.prototype.stopChannelMediaRelay=function(){return new Promise((function(e,t){}))},t.prototype._authGateWay=function(e,t){var n;return wn(this,void 0,void 0,(function(){var r,i,o,a,s,c,u,d;return In(this,(function(f){switch(f.label){case 0:return r=this,[4,w.joinGateway({sid:r._joinInfo.sid,appId:r._appId,cname:r.channelName,uid:e||"",token:t||"",extend:"",proxyServer:"",wss:r._useWss})];case 1:if(!(i=f.sent()))return[3,4];if(o=i.code,a=i.session_id,s=i.addresses,a&&(r._sessionId=a,it.sessionInit(r._joinInfo.sid,{cname:r.channelName,appid:r._appId,mode:"rtc"===r._config.mode?0:"live"===r._config.mode?1:"game"===r._config.mode&&2,role:r._config.role,code:o})),!s||s instanceof Array&&0===s.length)throw new x("Can not find service list");return r._msSub=s.filter((function(e){return 1===e.type})),[4,r._connectMediaServer(i)];case 2:return f.sent(),c={ChanId:r.channelName,ChanSId:r._sessionId,UserId:e,UserSId:r._joinInfo.sid,SdkVer:m.SDK_VERSION,VCodec:r._config.codec,ACodec:"opus",Role:r._config.role,AcsToken:t||""},u=Date.now(),[4,null===(n=r._gateway)||void 0===n?void 0:n.doOnline(c)];case 3:return d=f.sent(),it.joinGateway(r._joinInfo.sid,{joinStartTime:r._latestEventLts.joinStartTime,startTime:u,uid:d,cid:r._joinInfo.cid,extend:null,success:!0}),r.uid=d,Object.assign(r._joinInfo,{apResponse:i,clientId:r._clientId,appId:r._appId,cname:r.channelName,uid:r.uid,turnServer:{},proxyServer:void 0,token:t||r._appId,useProxyServer:!1,startTime:Date.now()}),[2,r.uid];case 4:return[2]}}))}))},t.prototype._connectMediaServer=function(e){return wn(this,void 0,void 0,(function(){var t,n,r,i;return In(this,(function(o){return t=this,n=e.addresses,e.detail[8],r=Date.now(),i=n.filter((function(e){return 0===e.type})),[2,new Promise((function(o,a){var s,c,u,d,l;return wn(this,void 0,void 0,(function(){var p,h,_,y,g,S,E,C;return In(this,(function(b){switch(b.label){case 0:if(p=!1,!(i.length>0))return[3,9];b.label=1;case 1:b.trys.push([1,6,7,8]),h=On(i),_=h.next(),b.label=2;case 2:return _.done?[3,5]:(y=_.value,T.debug("begin connect media server ",y),null===(s=t._gateway)||void 0===s||s.setAppInfo({appId:t._appId}),null===(c=t._gateway)||void 0===c||c.configServer(t._useWss,y.ip,y.port),[4,null===(u=t._gateway)||void 0===u?void 0:u.connectCTS()]);case 3:return b.sent(),o(),p=!0,g=Date.now(),it.chooseServer(t._joinInfo.sid,{startTime:r,success:!0,uid:t._joinInfo.uid,cid:"",elapse:g-t._latestEventLts.joinStartTime,extend:null,eventElapse:g-r,chooseServer:{},serverList:n,errorCode:"NETWORK_ERROR"}),[3,5];case 4:return _=h.next(),[3,2];case 5:return[3,8];case 6:return S=b.sent(),E={error:S},[3,8];case 7:try{_&&!_.done&&(C=h.return)&&C.call(h)}finally{if(E)throw E.error}return[7];case 8:return p||(Date.now()-(null===(d=t._gateway)||void 0===d?void 0:d._connectBeginTime)0)r.map((function(r){var i=e._subPeerAVStats[r],o=0;if(i.subscribeAudio&&t++,i.subscribeVideo){var a=e._statsCollector.getRemoteVideoTrackStats(r);o=a.receiveResolutionWidth*a.receiveResolutionHeight}n+=o}));else if(e.localTracks.length>0)e.localTracks.find((function(e){return e instanceof Rt}))&&(t+=1);e._repRes(t,n)}},t.prototype._repRes=function(e,t){var n=this._latestRepInfo.lts,r={audioNumber:e,videoSize:t,lts:Date.now()};this._gateway&&this._gateway.reportAVStat({TimeUsed:r.lts-n||0,AudNum:r.audioNumber,VidSize:r.videoSize}),this._latestRepInfo=r},t.prototype._setAVStatsRepTimer=function(){var e=this;e._clearAVStatsRepTimer(),e._AVStatsControlls=setInterval((function(){e._calculate()}),1e4),e._calculate()},t.prototype._clearAVStatsRepTimer=function(){this._AVStatsControlls&&clearInterval(this._AVStatsControlls)},t.prototype._createMediaServerIntance=function(){var e=this;e._gateway||(e._gateway=new k),e._gateway.handleMediaServerEvents=function(t,n){var r,i,o,a,s,c,u,d=n.Code;switch(t){case"connection-state-change":var f=n.curState,l=n.revState,p=n.reason;if(T.warning("connection-state-change",e.connectionState,f,l,p),e.connectionState===f)return;e.connectionState=f,e.emit("connection-state-change",f,l,p);var h=0;switch(e.connectionState){case"CONNECTING":h=0;break;case"RECONNECTING":h=2;break;case"CONNECTED":h=1;break;case"DISCONNECTING":case"DISCONNECTED":h=4}var v=Date.now();it.serverConnectionState(e._joinInfo.sid,{startTime:v,extend:{currentState:h}}),"DISCONNECTED"===f||"RECONNECTING"===f&&(e.remoteUsers.map((function(t){t._mediaStream&&t._mediaStream.destory(),e._unsubscribe(t);var n=e._subPeerAVStats[t.uid];n&&(n.subscribeAudio&&e.emit("user-unpublished",t,"audio"),n.subscribeVideo&&e.emit("user-unpublished",t,"video"))})),e.remoteUsers=[],e._latestEventLts={},e._msSub=[],null===(r=e._gateway)||void 0===r||r.removeAllListeners(),e._gateway=void 0,e._joinInfo.sid=y(32),e._createMediaServerIntance(),e._authGateWay(e._joinInfo.uid,e._joinInfo.token).then((function(t){e._republish(),e.remoteUsers=[],e._subPeerAVStats={}})));break;case"token-privilege-did-expire":e.emit("token-privilege-did-expire");break;case"token-privilege-will-expire":e.emit("token-privilege-will-expire");break;case A.ON_PUBLISH_EX:if(0===d){n.StreamId;var m=n.Offer;e._lowStream.peer.createAnswer(m)}break;case A.ON_SUBSCRIBE:if(0===d){var _,g=n.StreamId;m=n.Offer;if(g===e.uid)_=e._highStream.peer;else{var S=e.remoteUsers.find((function(e){return e.uid===g}));if(S||T.warning("can not find remote user "+g),S.uid===g)(ee=new gn(g,e._statsCollector,e._joinInfo)).on(A.CONNECTION_STATE_CHANGE,e._handlePeerConnectionEvent.bind(e,A.CONNECTION_STATE_CHANGE)),ee.on(A.ICE_CONNECTION_STATE_CHANGE,e._handlePeerConnectionEvent.bind(e,A.ICE_CONNECTION_STATE_CHANGE)),ee.on(A.ICE_CANDIDATE,e._handlePeerConnectionEvent.bind(e,A.ICE_CANDIDATE)),ee.on(A.CREATE_ANSWER,e._handlePeerConnectionEvent.bind(e,A.CREATE_ANSWER)),ee.on(A.TRACK_ADDED,(function(e,t,n){"audio"===t?S._audioMediaStreamTrack=n:"video"===t&&(S._videoMediaStreamTrack=n)})),S._mediaStream=ee,_=ee.peer}_&&_.createAnswer(m)}else{var E=n.StreamId;window.setTimeout((function(){e._resubscribe(E)}),3e3)}break;case A.ON_FORCE_OFFLINE:null===(i=e._gateway)||void 0===i||i.disconnectCTS("UID_BANNED"),null===(o=e._gateway)||void 0===o||o.removeAllListeners(),e._gateway=void 0;break;case A.ON_ICE:var C=n.StreamId,b=n.Sdp,R=n.SubStream,w=void 0;if(C===e.uid)w=e._highStream.peer,R&&(w=e._lowStream.peer);else{var I=e.remoteUsers.find((function(e){return e.uid===C}));I||T.warning("can not find remote user "+C),w=(ee=I._mediaStream).peer}w.setIceCandidate(b);break;case A.ON_SESSION_INIT:var O=n.CId,N=n.Interval;e._joinInfo.cid=O,e._startReportStats(O,N);break;case A.ON_CHANNEL_MESSAGE:var D=n.Cmd;if(D===A.ON_CHANNEL_USER_ONLINE){var P={_video_added_:!1,_video_enabled_:!1,_video_muted_:!1,_audio_added_:!1,_audio_enabled_:!1,_audio_muted_:!1,hasAudio:!1,hasVideo:!1,uid:n.UserId};e.remoteUsers.push(P),e.emit("user-joined",P)}else if(D===A.ON_CHANNEL_USER_OFFLINE){var k=n.UserId,L=n.Reason,M=e.remoteUsers.find((function(t,n){if(t.uid===k){var r=e._subPeerAVStats[k];r&&(r.subscribeAudio&&(e._unsubscribe(t,"audio"),e.emit("user-unpublished",re,"audio")),r.subscribeVideo&&(e._unsubscribe(t,"video"),e.emit("user-unpublished",re,"video"))),t._mediaStream&&(t._mediaStream.destory(),t._mediaStream=null),e.remoteUsers.splice(n,1)}return t.uid===k}));if(M){var U="";switch(L){case"Dropped":U="ServerTimeOut";case"Offline":U="Quit";break;case"BecomeAudience":U="BecomeAudience"}e.emit("user-left",M,U)}e._setAVStatsRepTimer()}else if(D===A.ON_CHANNEL_SET_USER_ROLE)n.AppId,n.UserId,n.Code,n.Role,n.ChanId;else if(D===A.ON_CHANNEL_DUALSTREAM_ENABLE){var F=n.UserId,V=n.Enable,j=e.remoteUsers.find((function(e){return e.uid===F}));j&&(j._dualStream=V)}else if(D===A.ON_CHANNEL_USER_STREAM_OPEN){var B=n.UserId,G=(n.StreamId,n.PubSessionId),W=n.DualStream,H=n.HasAudio,K=n.LocalAudioEnable,J=n.LocalAudioMute,z=n.HasVideo,Y=n.LocalVideoEnable,X=n.LocalVideoMute,q=(n.VidCodecType,n.AudCodecType,e.remoteUsers.find((function(e){return e.uid===B})));if(void 0!==q){var Q=H&&K&&!J,$=z&&Y&&!X,Z=!0;$&&Y&&!X||(Z=!1),Object.assign(q,{_video_added_:H,_video_enabled_:Y,_video_muted_:X,_audio_added_:z,_audio_enabled_:K,_audio_muted_:J,hasAudio:Q,hasVideo:$,_videoCache:Z,_pubSid:G,_dualStream:W,_subStreamType:0}),$&&e.emit("user-published",q,"video"),Q&&e.emit("user-published",q,"audio")}}else if(D===A.ON_CHANNEL_USER_STREAM_CLOSE){var ee,te=n.UserId,ne=(n.StreamId,n.PubSessionId),re=e.remoteUsers.find((function(e){return e.uid===te&&e._pubSid===ne}));if(null!=re)(de=e._subPeerAVStats[re.uid])&&(de.subscribeAudio&&(e._unsubscribe(re,"audio"),e.emit("user-unpublished",re,"audio"),re._audio_added_=!1,re._audio_enabled_=!1,re._audio_muted_=!1,re.hasAudio=re._audio_added_&&re._audio_enabled_&&!re._audio_muted_),de.subscribeVideo&&(e._unsubscribe(re,"video"),e.emit("user-unpublished",re,"video"),re._video_added_=!1,re._video_enabled_=!1,re._video_muted_=!1,re.hasVideo=re._video_added_&&re._video_enabled_&&!re._video_muted_)),e._subPeerAVStats[te]&&delete e._subPeerAVStats[te],(ee=re._mediaStream)&&(ee&&ee.destory(),delete re._mediaStream),e._statsCollector.removeConnection(re.uid)}else if(D===A.ON_CHANNEL_USER_ENABLE_LOCAL_VIDEO||D===A.ON_CHANNEL_USER_ENABLE_VIDEO||D===A.ON_CHANNEL_USER_DISABLE_VIDEO){var ie=n.UserId,oe=(V=n.Enable,e.remoteUsers.find((function(e){return e.uid===ie})));if(!oe)throw new x("user "+ie+" is not find");var ae=oe.hasVideo;if(D===A.ON_CHANNEL_USER_ENABLE_LOCAL_VIDEO?oe._video_enabled_=V:D===A.ON_CHANNEL_USER_ENABLE_VIDEO?oe._video_added_=!0:D===A.ON_CHANNEL_USER_DISABLE_VIDEO&&(oe._video_added_=!1),oe.hasVideo=oe._video_added_&&oe._video_enabled_&&!oe._video_muted_,V||D===A.ON_CHANNEL_USER_ENABLE_VIDEO)ae||(null===(a=e._gateway)||void 0===a||a.setAVStatus(ie,oe.hasAudio,oe.hasVideo),oe._mediaStream&&(oe.videoTrack=oe._mediaStream.addTracks("video")),e.emit("user-published",oe,"video"));else if(!V||D===A.ON_CHANNEL_USER_DISABLE_VIDEO){(de=e._subPeerAVStats[oe.uid])&&de.subscribeVideo&&(e._unsubscribe(oe,"video"),oe.videoTrack&&(oe.videoTrack.stop(),oe.videoTrack=void 0),null===(s=e._gateway)||void 0===s||s.setAVStatus(ie,oe.hasAudio,oe.hasVideo),e.emit("user-unpublished",oe,"video"),T.info("stream removed with uid "+ie))}e._setAVStatsRepTimer()}else if(D===A.ON_CHANNEL_USER_ENABLE_LOCAL_AUDIO||D===A.ON_CHANNEL_USER_ENABLE_AUDIO||D===A.ON_CHANNEL_USER_DISABLE_AUDIO){var se=n.UserId,ce=(V=n.Enable,e.remoteUsers.find((function(e){return e.uid===se})));if(!ce)throw new x("user "+se+" is not find");var ue=ce.hasAudio;if(D===A.ON_CHANNEL_USER_ENABLE_LOCAL_AUDIO?ce._audio_enabled_=V:D===A.ON_CHANNEL_USER_ENABLE_AUDIO?ce._audio_added_=!0:D===A.ON_CHANNEL_USER_DISABLE_AUDIO&&(ce._audio_added_=!1),ce.hasAudio=ce._audio_added_&&ce._audio_enabled_&&!ce._audio_muted_,V||D===A.ON_CHANNEL_USER_ENABLE_AUDIO)ue||(null===(c=e._gateway)||void 0===c||c.setAVStatus(se,ce.hasAudio,ce.hasVideo),ce._mediaStream&&(ce.audioTrack=ce._mediaStream.addTracks("audio")),e.emit("user-published",ce,"audio"));else if(!V||D===A.ON_CHANNEL_USER_DISABLE_AUDIO){var de;(de=e._subPeerAVStats[ce.uid])&&de.subscribeAudio&&(e._unsubscribe(ce,"audio"),ce.audioTrack=void 0,null===(u=e._gateway)||void 0===u||u.setAVStatus(se,ce.hasAudio,ce.hasVideo),e.emit("user-unpublished",ce,"audio"))}e._setAVStatsRepTimer()}else if(D===A.ON_CHANNEL_USER_MUTE_VIDEO){var fe=n.UserId,le=n.Mute,pe=e.remoteUsers.find((function(e){return e.uid===fe}));pe._video_muted_=le,pe.hasVideo=pe._video_enabled_&&!pe._video_muted_,e._subPeerAVStats[fe]&&(e._subPeerAVStats[fe].subscribeVideo=!le),le?(pe.videoTrack&&(pe.videoTrack.stop(),pe.videoTrack=void 0),e.emit("user-unpublished",pe,"video")):e.emit("user-published",pe,"video"),e._setAVStatsRepTimer()}else if(D===A.ON_CHANNEL_USER_MUTE_AUDIO){var he=n.UserId,ve=(le=n.Mute,e.remoteUsers.find((function(e){return e.uid===he})));ve._audio_muted_=le,ve.hasAudio=ve._audio_enabled_&&!ve._audio_muted_,e._subPeerAVStats[he]&&(e._subPeerAVStats[he].subscribeAudio=!le),le?e.emit("user-unpublished",ve,"audio"):e.emit("user-published",ve,"audio"),e._setAVStatsRepTimer()}}}},t.prototype._handlePeerConnectionEvent=function(e,t,n,r){var i,o;if(e===A.ICE_CONNECTION_STATE_CHANGE);else if(e===A.CONNECTION_STATE_CHANGE)switch(r){case"connected":if("sub"===n)return;var a=void 0;if("pub"===n?a=this._highStream.peer:"pubEx"===n&&(a=this._lowStream.peer),"{}"!==JSON.stringify(a.videoEncoderConfig)){var s=a.videoEncoderConfig;s.bitrateMax&&a.updateBandWidth(s.bitrateMax)}break;case"disconnected":break;case"failed":T.warning(this.connectionState,this._gateway),"pub"===n||"pubEx"===n?(T.warning("republish => "),this._republish()):"sub"===n&&(T.warning("resubscribe => "),this._resubscribe(t))}else e===A.ICE_CANDIDATE?null===(i=this._gateway)||void 0===i||i.sendIceCandidate(t,r,"pubEx"===n):e===A.CREATE_ANSWER&&(null===(o=this._gateway)||void 0===o||o.sendAnswer(t,r,"pubEx"===n))},t.prototype._startReportStats=function(e,t){var n=this;n._reportStatsInterval&&clearInterval(n._reportStatsInterval),n._reportStatsInterval=window.setInterval((function(){var t;if(n._highStream){var r={cid:e,lts:Date.now(),type:"local"};if(n._highStream.videoTrack){var i=n._highStream.videoTrack.getStats();i&&(r.lvid={sbr:i.sendBitrate,sfps:i.sendFrameRate,eofps:i.captureFrameRate,rofps:i.captureFrameRate,stbr:i.captureFrameRate,stfps:i.captureFrameRate,ebr:i.sendBytes,e_w:i.captureResolutionWidth,e_h:i.captureResolutionHeight,efps:i.captureFrameRate,ploss:i.sendPacketsLost})}else r.lvid={};if(n._highStream.audioTrack){var o=n._highStream.audioTrack.getStats();o&&(r.laud={nc:1,shz:0,sbr:o.sendBitrate,vol:o.sendVolumeLevel,ploss:o.sendPacketsLost})}else r.laud={};null===(t=n._gateway)||void 0===t||t.reportArStats(r)}n._lowStream,n.remoteUsers.length>0&&n.remoteUsers.forEach((function(t){var r,i={cid:e,peer:t.uid,lts:Date.now(),type:"peer"};if(t.videoTrack){var o=t.videoTrack.getStats();o&&(i.vif={w:o.receiveResolutionWidth,h:o.receiveResolutionHeight,rbr:o.receiveBitrate,dofps:o.receiveFrameRate,rofps:o.renderFrameRate,ploss:o.receivePacketsLost,rst:o._subStreamType,tft:o.totalFreezeTime,ffps:o.freezeRate})}else i.vif={};if(t.audioTrack){var a=t.audioTrack.getStats();a&&(i.aif={ntd:a.end2EndDelay,jbd:a.receiveDelay,aloss:a.packetLossRate,nc:1,rhz:0,rb:a.receiveBitrate,tft:a.totalFreezeTime,ffps:a.freezeRate,vol:a.receiveLevel,ploss:a.receivePacketsLost})}else i.aif={};null===(r=n._gateway)||void 0===r||r.reportArStats(i)}))}),t)},t}(b),Pn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kn=function(e){function t(t,n){var r=e.call(this)||this;return r.startPlayTime=0,r.startPlayOffset=0,r.pausePlayTime=0,r.currentLoopCount=0,r.options={},r.sourceNode=void 0,r._currentState="stopped",r.id=n,r.context=Et.getAudioContextInstance(),r.mediaStreamDestination=r.context.createMediaStreamDestination(),r.audioBuffer=t,r.startPlayOffset=r.options.startPlayTime||0,r}return Pn(t,e),t.prototype.getAudioTrack=function(){return this.mediaStreamDestination.stream.getAudioTracks()[0]},t.prototype.updateOptions=function(e){"stopped"===this.currentState?(this.options=e,this.startPlayOffset=this.options.startPlayTime||0):T.warning("can not set audio source options")},t.prototype.startProcessAudioBuffer=function(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"},t.prototype.pauseProcessAudioBuffer=function(){this.sourceNode&&"playing"===this.currentState&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")},t.prototype.seekAudioBuffer=function(e){this.sourceNode&&(this.sourceNode.onended=null,"playing"===this.currentState&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),"playing"===this.currentState?(this.startPlayOffset=e,this.startSourceNode()):"paused"===this.currentState&&(this.pausePlayTime=e))},t.prototype.resumeProcessAudioBuffer=function(){"paused"===this.currentState&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")},t.prototype.stopProcessAudioBuffer=function(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch(e){}this.reset()}},t.prototype.startSourceNode=function(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))},t.prototype.createSourceNode=function(){var e=this.context.createBufferSource();return e.buffer=this.audioBuffer,e.loop=!!this.options.loop,e.connect(this.mediaStreamDestination),e},t.prototype.handleSourceNodeEnded=function(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()},t.prototype.reset=function(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0},Object.defineProperty(t.prototype,"currentState",{get:function(){return this._currentState},set:function(e){e!==this._currentState&&(this._currentState=e,this.emit(A.AUDIO_SOURCE_STATE_CHANGE,this._currentState))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this.audioBuffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return"stopped"===this.currentState?0:"paused"===this.currentState?this.pausePlayTime:(this.context.currentTime-this.startPlayTime+this.startPlayOffset)%this.audioBuffer.duration},enumerable:!0,configurable:!0}),t}(b),xn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ln=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Mn=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?i(r(e),9007199254740991):0}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=!n(2)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(3),i=n(91),o=n(27),a=Object.defineProperty;t.f=n(8)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(25);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(1),i=n(15),o=n(14),a=n(30)("src"),s=n(139),c=(""+s).split("toString");n(7).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,n){var r=n(0),i=n(2),o=n(25),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){"use strict";var r=n(124),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n0?r:n)(e)}},function(e,t,n){var r=n(47),i=n(29),o=n(16),a=n(27),s=n(14),c=n(91),u=Object.getOwnPropertyDescriptor;t.f=n(8)?u:function(e,t){if(e=o(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(0),i=n(7),o=n(2);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},function(e,t,n){var r=n(18),i=n(46),o=n(10),a=n(6),s=n(107);e.exports=function(e,t){var n=1==e,c=2==e,u=3==e,d=4==e,f=6==e,l=5==e||f,p=t||s;return function(t,s,h){for(var v,m,_=o(t),y=i(_),g=r(s,h,3),S=a(y.length),E=0,T=n?p(t,S):c?p(t,0):void 0;S>E;E++)if((l||E in y)&&(m=g(v=y[E],E,_),e))if(n)T[E]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return E;case 2:T.push(v)}else if(d)return!1;return f?-1:u||d?d:T}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";if(n(8)){var r=n(31),i=n(1),o=n(2),a=n(0),s=n(62),c=n(87),u=n(18),d=n(43),f=n(29),l=n(15),p=n(44),h=n(20),v=n(6),m=n(118),_=n(33),y=n(27),g=n(14),S=n(48),E=n(4),T=n(10),C=n(79),b=n(34),R=n(36),w=n(35).f,I=n(81),O=n(30),A=n(5),N=n(23),D=n(52),P=n(49),k=n(83),x=n(41),L=n(55),M=n(42),U=n(82),F=n(109),j=n(9),V=n(21),B=j.f,G=V.f,W=i.RangeError,H=i.TypeError,K=i.Uint8Array,J=Array.prototype,z=c.ArrayBuffer,Y=c.DataView,X=N(0),q=N(2),Q=N(3),$=N(4),Z=N(5),ee=N(6),te=D(!0),ne=D(!1),re=k.values,ie=k.keys,oe=k.entries,ae=J.lastIndexOf,se=J.reduce,ce=J.reduceRight,ue=J.join,de=J.sort,fe=J.slice,le=J.toString,pe=J.toLocaleString,he=A("iterator"),ve=A("toStringTag"),me=O("typed_constructor"),_e=O("def_constructor"),ye=s.CONSTR,ge=s.TYPED,Se=s.VIEW,Ee=N(1,(function(e,t){return we(P(e,e[_e]),t)})),Te=o((function(){return 1===new K(new Uint16Array([1]).buffer)[0]})),Ce=!!K&&!!K.prototype.set&&o((function(){new K(1).set({})})),be=function(e,t){var n=h(e);if(n<0||n%t)throw W("Wrong offset!");return n},Re=function(e){if(E(e)&&ge in e)return e;throw H(e+" is not a typed array!")},we=function(e,t){if(!E(e)||!(me in e))throw H("It is not a typed array constructor!");return new e(t)},Ie=function(e,t){return Oe(P(e,e[_e]),t)},Oe=function(e,t){for(var n=0,r=t.length,i=we(e,r);r>n;)i[n]=t[n++];return i},Ae=function(e,t,n){B(e,t,{get:function(){return this._d[n]}})},Ne=function(e){var t,n,r,i,o,a,s=T(e),c=arguments.length,d=c>1?arguments[1]:void 0,f=void 0!==d,l=I(s);if(null!=l&&!C(l)){for(a=l.call(s),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);s=r}for(f&&c>2&&(d=u(d,arguments[2],2)),t=0,n=v(s.length),i=we(this,n);n>t;t++)i[t]=f?d(s[t],t):s[t];return i},De=function(){for(var e=0,t=arguments.length,n=we(this,t);t>e;)n[e]=arguments[e++];return n},Pe=!!K&&o((function(){pe.call(new K(1))})),ke=function(){return pe.apply(Pe?fe.call(Re(this)):Re(this),arguments)},xe={copyWithin:function(e,t){return F.call(Re(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return $(Re(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return U.apply(Re(this),arguments)},filter:function(e){return Ie(this,q(Re(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Z(Re(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Re(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Re(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Re(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Re(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ue.apply(Re(this),arguments)},lastIndexOf:function(e){return ae.apply(Re(this),arguments)},map:function(e){return Ee(Re(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Re(this),arguments)},reduceRight:function(e){return ce.apply(Re(this),arguments)},reverse:function(){for(var e,t=Re(this).length,n=Math.floor(t/2),r=0;r1?arguments[1]:void 0)},sort:function(e){return de.call(Re(this),e)},subarray:function(e,t){var n=Re(this),r=n.length,i=_(e,r);return new(P(n,n[_e]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===t?r:_(t,r))-i))}},Le=function(e,t){return Ie(this,fe.call(Re(this),e,t))},Me=function(e){Re(this);var t=be(arguments[1],1),n=this.length,r=T(e),i=v(r.length),o=0;if(i+t>n)throw W("Wrong length!");for(;o255?255:255&r),i.v[p](n*t+i.o,r,Te)}(this,n,e)},enumerable:!0})};g?(h=n((function(e,n,r,i){d(e,h,u,"_d");var o,a,s,c,f=0,p=0;if(E(n)){if(!(n instanceof z||"ArrayBuffer"==(c=S(n))||"SharedArrayBuffer"==c))return ge in n?Oe(h,n):Ne.call(h,n);o=n,p=be(r,t);var _=n.byteLength;if(void 0===i){if(_%t)throw W("Wrong length!");if((a=_-p)<0)throw W("Wrong length!")}else if((a=v(i)*t)+p>_)throw W("Wrong length!");s=a/t}else s=m(n),o=new z(a=s*t);for(l(e,"_d",{b:o,o:p,l:a,e:s,v:new Y(o)});fdocument.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(93),i=n(66).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(10),o=n(65)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(5)("unscopables"),i=Array.prototype;null==i[r]&&n(15)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(9).f,i=n(14),o=n(5)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(0),i=n(25),o=n(2),a=n(69),s="["+a+"]",c=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),d=function(e,t,n){var i={},s=o((function(){return!!a[e]()||"​…"!="​…"[e]()})),c=i[e]=s?t(f):a[e];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},f=d.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(u,"")),e};e.exports=d},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(1),i=n(9),o=n(8),a=n(5)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(11);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&c&&n.push({ssrc:c});var d=r.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var a=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;id;)if((s=c[d++])!=s)return!0}else for(;u>d;d++)if((e||d in c)&&c[d]===n)return e||d||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(24);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(5)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(3);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(48),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},function(e,t,n){"use strict";n(111);var r=n(11),i=n(15),o=n(2),a=n(25),s=n(5),c=n(84),u=s("species"),d=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$
")})),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var l=s(e),p=!o((function(){var t={};return t[l]=function(){return 7},7!=""[e](t)})),h=p?!o((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[u]=function(){return n}),n[l](""),!t})):void 0;if(!p||!h||"replace"===e&&!d||"split"===e&&!f){var v=/./[l],m=n(a,l,""[e],(function(e,t,n,r,i){return t.exec===c?p&&!i?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),_=m[0],y=m[1];r(String.prototype,e,_),i(RegExp.prototype,l,2==t?function(e,t){return y.call(e,this,t)}:function(e){return y.call(e,this)})}}},function(e,t,n){var r=n(18),i=n(106),o=n(79),a=n(3),s=n(6),c=n(81),u={},d={};(t=e.exports=function(e,t,n,f,l){var p,h,v,m,_=l?function(){return e}:c(e),y=r(n,f,t?2:1),g=0;if("function"!=typeof _)throw TypeError(e+" is not iterable!");if(o(_)){for(p=s(e.length);p>g;g++)if((m=t?y(a(h=e[g])[0],h[1]):y(e[g]))===u||m===d)return m}else for(v=_.call(e);!(h=v.next()).done;)if((m=i(v,y,h.value,t))===u||m===d)return m}).BREAK=u,t.RETURN=d},function(e,t,n){var r=n(1).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(1),i=n(0),o=n(11),a=n(44),s=n(28),c=n(59),u=n(43),d=n(4),f=n(2),l=n(55),p=n(39),h=n(70);e.exports=function(e,t,n,v,m,_){var y=r[e],g=y,S=m?"set":"add",E=g&&g.prototype,T={},C=function(e){var t=E[e];o(E,e,"delete"==e||"has"==e?function(e){return!(_&&!d(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return _&&!d(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof g&&(_||E.forEach&&!f((function(){(new g).entries().next()})))){var b=new g,R=b[S](_?{}:-0,1)!=b,w=f((function(){b.has(1)})),I=l((function(e){new g(e)})),O=!_&&f((function(){for(var e=new g,t=5;t--;)e[S](t,t);return!e.has(-0)}));I||((g=t((function(t,n){u(t,g,e);var r=h(new y,t,g);return null!=n&&c(n,m,r[S],r),r}))).prototype=E,E.constructor=g),(w||O)&&(C("delete"),C("has"),m&&C("get")),(O||R)&&C(S),_&&E.clear&&delete E.clear}else g=v.getConstructor(t,e,m,S),a(g.prototype,n),s.NEED=!0;return p(g,e),T[e]=g,i(i.G+i.W+i.F*(g!=y),T),_||v.setStrong(g,e,m),g}},function(e,t,n){for(var r,i=n(1),o=n(15),a=n(30),s=a("typed_array"),c=a("view"),u=!(!i.ArrayBuffer||!i.DataView),d=u,f=0,l="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=i[l[f++]])?(o(r.prototype,s,!0),o(r.prototype,c,!0)):d=!1;e.exports={ABV:u,CONSTR:d,TYPED:s,VIEW:c}},function(e,t,n){var r=n(4),i=n(1).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){t.f=n(5)},function(e,t,n){var r=n(51)("keys"),i=n(30);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(1).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(4),i=n(3),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(18)(Function.call,n(21).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(4),i=n(68).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){"use strict";var r=n(20),i=n(25);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){var r=n(20),i=n(25);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(31),i=n(0),o=n(11),a=n(15),s=n(41),c=n(105),u=n(39),d=n(36),f=n(5)("iterator"),l=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,v,m,_){c(n,t,h);var y,g,S,E=function(e){if(!l&&e in R)return R[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},T=t+" Iterator",C="values"==v,b=!1,R=e.prototype,w=R[f]||R["@@iterator"]||v&&R[v],I=w||E(v),O=v?C?E("entries"):I:void 0,A="Array"==t&&R.entries||w;if(A&&(S=d(A.call(new e)))!==Object.prototype&&S.next&&(u(S,T,!0),r||"function"==typeof S[f]||a(S,f,p)),C&&w&&"values"!==w.name&&(b=!0,I=function(){return w.call(this)}),r&&!_||!l&&!b&&R[f]||a(R,f,I),s[t]=I,s[T]=p,v)if(y={values:C?I:E("values"),keys:m?I:E("keys"),entries:O},_)for(g in y)g in R||o(R,g,y[g]);else i(i.P+i.F*(l||b),t,y);return y}},function(e,t,n){var r=n(77),i=n(25);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){var r=n(4),i=n(24),o=n(5)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(5)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(41),i=n(5)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){"use strict";var r=n(9),i=n(29);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(48),i=n(5)("iterator"),o=n(41);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(10),i=n(33),o=n(6);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),c=a>2?arguments[2]:void 0,u=void 0===c?n:i(c,n);u>s;)t[s++]=e;return t}},function(e,t,n){"use strict";var r=n(37),i=n(110),o=n(41),a=n(16);e.exports=n(75)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,i,o=n(56),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,u=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),d=void 0!==/()??/.exec("")[1];(u||d)&&(c=function(e){var t,n,r,i,c=this;return d&&(n=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),u&&(t=c.lastIndex),r=a.call(c,e),u&&r&&(c.lastIndex=c.global?r.index+r[0].length:t),d&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;in;)t.push(arguments[n++]);return _[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},p=function(e){delete _[e]},"process"==n(24)(f)?r=function(e){f.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:h?(o=(i=new h).port2,i.port1.onmessage=g,r=a(o.postMessage,o,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts?(r=function(e){d.postMessage(e+"","*")},d.addEventListener("message",g,!1)):r="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:l,clear:p}},function(e,t,n){"use strict";var r=n(1),i=n(8),o=n(31),a=n(62),s=n(15),c=n(44),u=n(2),d=n(43),f=n(20),l=n(6),p=n(118),h=n(35).f,v=n(9).f,m=n(82),_=n(39),y=r.ArrayBuffer,g=r.DataView,S=r.Math,E=r.RangeError,T=r.Infinity,C=y,b=S.abs,R=S.pow,w=S.floor,I=S.log,O=S.LN2,A=i?"_b":"buffer",N=i?"_l":"byteLength",D=i?"_o":"byteOffset";function P(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,c=(1<>1,d=23===t?R(2,-24)-R(2,-77):0,f=0,l=e<0||0===e&&1/e<0?1:0;for((e=b(e))!=e||e===T?(i=e!=e?1:0,r=c):(r=w(I(e)/O),e*(o=R(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?d/o:d*R(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*R(2,t),r+=u):(i=e*R(2,u-1)*R(2,t),r=0));t>=8;a[f++]=255&i,i/=256,t-=8);for(r=r<0;a[f++]=255&r,r/=256,s-=8);return a[--f]|=128*l,a}function k(e,t,n){var r,i=8*n-t-1,o=(1<>1,s=i-7,c=n-1,u=e[c--],d=127&u;for(u>>=7;s>0;d=256*d+e[c],c--,s-=8);for(r=d&(1<<-s)-1,d>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===d)d=1-a;else{if(d===o)return r?NaN:u?-T:T;r+=R(2,t),d-=a}return(u?-1:1)*r*R(2,d-t)}function x(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function L(e){return[255&e]}function M(e){return[255&e,e>>8&255]}function U(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function F(e){return P(e,52,8)}function j(e){return P(e,23,4)}function V(e,t,n){v(e.prototype,t,{get:function(){return this[n]}})}function B(e,t,n,r){var i=p(+n);if(i+t>e[N])throw E("Wrong index!");var o=e[A]._b,a=i+e[D],s=o.slice(a,a+t);return r?s:s.reverse()}function G(e,t,n,r,i,o){var a=p(+n);if(a+t>e[N])throw E("Wrong index!");for(var s=e[A]._b,c=a+e[D],u=r(+i),d=0;dJ;)(W=K[J++])in y||s(y,W,C[W]);o||(H.constructor=y)}var z=new g(new y(2)),Y=g.prototype.setInt8;z.setInt8(0,2147483648),z.setInt8(1,2147483649),!z.getInt8(0)&&z.getInt8(1)||c(g.prototype,{setInt8:function(e,t){Y.call(this,e,t<<24>>24)},setUint8:function(e,t){Y.call(this,e,t<<24>>24)}},!0)}else y=function(e){d(this,y,"ArrayBuffer");var t=p(e);this._b=m.call(new Array(t),0),this[N]=t},g=function(e,t,n){d(this,g,"DataView"),d(e,y,"DataView");var r=e[N],i=f(t);if(i<0||i>r)throw E("Wrong offset!");if(i+(n=void 0===n?r-i:l(n))>r)throw E("Wrong length!");this[A]=e,this[D]=i,this[N]=n},i&&(V(y,"byteLength","_l"),V(g,"buffer","_b"),V(g,"byteLength","_l"),V(g,"byteOffset","_o")),c(g.prototype,{getInt8:function(e){return B(this,1,e)[0]<<24>>24},getUint8:function(e){return B(this,1,e)[0]},getInt16:function(e){var t=B(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=B(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return x(B(this,4,e,arguments[1]))},getUint32:function(e){return x(B(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return k(B(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return k(B(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){G(this,1,e,L,t)},setUint8:function(e,t){G(this,1,e,L,t)},setInt16:function(e,t){G(this,2,e,M,t,arguments[2])},setUint16:function(e,t){G(this,2,e,M,t,arguments[2])},setInt32:function(e,t){G(this,4,e,U,t,arguments[2])},setUint32:function(e,t){G(this,4,e,U,t,arguments[2])},setFloat32:function(e,t){G(this,4,e,j,t,arguments[2])},setFloat64:function(e,t){G(this,8,e,F,t,arguments[2])}});_(y,"ArrayBuffer"),_(g,"DataView"),s(g.prototype,a.VIEW,!0),t.ArrayBuffer=y,t.DataView=g},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(123)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){e.exports=!n(8)&&!n(2)((function(){return 7!=Object.defineProperty(n(63)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(1),i=n(7),o=n(31),a=n(64),s=n(9).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(14),i=n(16),o=n(52)(!1),a=n(65)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){var r=n(9),i=n(3),o=n(32);e.exports=n(8)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,c=0;s>c;)r.f(e,n=a[c++],t[n]);return e}},function(e,t,n){var r=n(16),i=n(35).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},function(e,t,n){"use strict";var r=n(8),i=n(32),o=n(53),a=n(47),s=n(10),c=n(46),u=Object.assign;e.exports=!u||n(2)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=s(e),u=arguments.length,d=1,f=o.f,l=a.f;u>d;)for(var p,h=c(arguments[d++]),v=f?i(h).concat(f(h)):i(h),m=v.length,_=0;m>_;)p=v[_++],r&&!l.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(19),i=n(4),o=n(99),a=[].slice,s={},c=function(e,t,n){if(!(t in s)){for(var r=[],i=0;i>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(1).parseFloat,i=n(40).trim;e.exports=1/r(n(69)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(24);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(4),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){"use strict";var r=n(34),i=n(29),o=n(39),a={};n(15)(a,n(5)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(3);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(229);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(19),i=n(10),o=n(46),a=n(6);e.exports=function(e,t,n,s,c){r(t);var u=i(e),d=o(u),f=a(u.length),l=c?f-1:0,p=c?-1:1;if(n<2)for(;;){if(l in d){s=d[l],l+=p;break}if(l+=p,c?l<0:f<=l)throw TypeError("Reduce of empty array with no initial value")}for(;c?l>=0:f>l;l+=p)l in d&&(s=t(s,d[l],l,u));return s}},function(e,t,n){"use strict";var r=n(10),i=n(33),o=n(6);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),s=i(e,a),c=i(t,a),u=arguments.length>2?arguments[2]:void 0,d=Math.min((void 0===u?a:i(u,a))-c,a-s),f=1;for(c0;)c in n?n[s]=n[c]:delete n[s],s+=f,c+=f;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(84);n(0)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){n(8)&&"g"!=/./g.flags&&n(9).f(RegExp.prototype,"flags",{configurable:!0,get:n(56)})},function(e,t,n){"use strict";var r,i,o,a,s=n(31),c=n(1),u=n(18),d=n(48),f=n(0),l=n(4),p=n(19),h=n(43),v=n(59),m=n(49),_=n(86).set,y=n(249)(),g=n(114),S=n(250),E=n(60),T=n(115),C=c.TypeError,b=c.process,R=b&&b.versions,w=R&&R.v8||"",I=c.Promise,O="process"==d(b),A=function(){},N=i=g.f,D=!!function(){try{var e=I.resolve(1),t=(e.constructor={})[n(5)("species")]=function(e){e(A,A)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(A)instanceof t&&0!==w.indexOf("6.6")&&-1===E.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!l(e)||"function"!=typeof(t=e.then))&&t},k=function(e,t){if(!e._n){e._n=!0;var n=e._c;y((function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a,s=i?t.ok:t.fail,c=t.resolve,u=t.reject,d=t.domain;try{s?(i||(2==e._h&&M(e),e._h=1),!0===s?n=r:(d&&d.enter(),n=s(r),d&&(d.exit(),a=!0)),n===t.promise?u(C("Promise-chain cycle")):(o=P(n))?o.call(n,c,u):c(n)):u(r)}catch(e){d&&!a&&d.exit(),u(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&x(e)}))}},x=function(e){_.call(c,(function(){var t,n,r,i=e._v,o=L(e);if(o&&(t=S((function(){O?b.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=O||L(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){_.call(c,(function(){var t;O?b.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),k(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw C("Promise can't be resolved itself");(t=P(e))?y((function(){var r={_w:n,_d:!1};try{t.call(e,u(F,r,1),u(U,r,1))}catch(e){U.call(r,e)}})):(n._v=e,n._s=1,k(n,!1))}catch(e){U.call({_w:n,_d:!1},e)}}};D||(I=function(e){h(this,I,"Promise","_h"),p(e),r.call(this);try{e(u(F,this,1),u(U,this,1))}catch(e){U.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(44)(I.prototype,{then:function(e,t){var n=N(m(this,I));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?b.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&k(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=u(F,e,1),this.reject=u(U,e,1)},g.f=N=function(e){return e===I||e===a?new o(e):i(e)}),f(f.G+f.W+f.F*!D,{Promise:I}),n(39)(I,"Promise"),n(42)("Promise"),a=n(7).Promise,f(f.S+f.F*!D,"Promise",{reject:function(e){var t=N(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!D),"Promise",{resolve:function(e){return T(s&&this===a?I:this,e)}}),f(f.S+f.F*!(D&&n(55)((function(e){I.all(e).catch(A)}))),"Promise",{all:function(e){var t=this,n=N(t),r=n.resolve,i=n.reject,o=S((function(){var n=[],o=0,a=1;v(e,!1,(function(e){var s=o++,c=!1;n.push(void 0),a++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=N(t),r=n.reject,i=S((function(){v(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(e,t,n){"use strict";var r=n(19);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},function(e,t,n){var r=n(3),i=n(4),o=n(114);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(9).f,i=n(34),o=n(44),a=n(18),s=n(43),c=n(59),u=n(75),d=n(110),f=n(42),l=n(8),p=n(28).fastKey,h=n(38),v=l?"_s":"size",m=function(e,t){var n,r=p(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var d=e((function(e,r){s(e,d,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,null!=r&&c(r,n,e[u],e)}));return o(d.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=h(this,t),r=m(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(h(this,t),e)}}),l&&r(d.prototype,"size",{get:function(){return h(this,t)[v]}}),d},def:function(e,t,n){var r,i,o=m(e,t);return o?o.v=n:(e._l=o={i:i=p(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[v]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){u(e,t,(function(e,n){this._t=h(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?d(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,d(1))}),n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){"use strict";var r=n(44),i=n(28).getWeak,o=n(3),a=n(4),s=n(43),c=n(59),u=n(23),d=n(14),f=n(38),l=u(5),p=u(6),h=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},_=function(e,t){return l(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=_(this,e);if(t)return t[1]},has:function(e){return!!_(this,e)},set:function(e,t){var n=_(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=p(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var u=e((function(e,r){s(e,u,t,"_i"),e._t=t,e._i=h++,e._l=void 0,null!=r&&c(r,n,e[o],e)}));return r(u.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(f(this,t)).delete(e):n&&d(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(f(this,t)).has(e):n&&d(n,this._i)}}),u},def:function(e,t,n){var r=i(o(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){var r=n(20),i=n(6);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(35),i=n(53),o=n(3),a=n(1).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(6),i=n(71),o=n(25);e.exports=function(e,t,n,a){var s=String(o(e)),c=s.length,u=void 0===n?" ":String(n),d=r(t);if(d<=c||""==u)return s;var f=d-c,l=i.call(u,Math.ceil(f/u.length));return l.length>f&&(l=l.slice(0,f)),a?l+s:s+l}},function(e,t,n){var r=n(8),i=n(32),o=n(16),a=n(47).f;e.exports=function(e){return function(t){for(var n,s=o(t),c=i(s),u=c.length,d=0,f=[];u>d;)n=c[d++],r&&!a.call(s,n)||f.push(e?[n,s[n]]:s[n]);return f}}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(o)})),e.exports=c}).call(this,n(326))},function(e,t,n){"use strict";var r=n(13),i=n(328),o=n(125),a=n(330),s=n(333),c=n(334),u=n(129);e.exports=function(e){return new Promise((function(t,d){var f=e.data,l=e.headers;r.isFormData(f)&&delete l["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",v=e.auth.password||"";l.Authorization="Basic "+btoa(h+":"+v)}var m=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),o(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};i(t,d,r),p=null}},p.onabort=function(){p&&(d(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){d(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),d(u(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var _=n(335),y=(e.withCredentials||c(m))&&e.xsrfCookieName?_.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),d(e),p=null)})),void 0===f&&(f=null),p.send(f)}))}},function(e,t,n){"use strict";var r=n(329);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t,n){"use strict";var r=n(13);e.exports=function(e,t){t=t||{};var n={},i=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(i,(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(o,(function(i){r.isObject(t[i])?n[i]=r.deepMerge(e[i],t[i]):void 0!==t[i]?n[i]=t[i]:r.isObject(e[i])?n[i]=r.deepMerge(e[i]):void 0!==e[i]&&(n[i]=e[i])})),r.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var s=i.concat(o).concat(a),c=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return r.forEach(c,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e){e.exports=JSON.parse('{"name":"ar-rtc-sdk","version":"4.0.10","description":"For publishing npm package anyrtc SDK (Web). Get more information from https://www.anyrtc.io.","main":"./release/ArRTC@latest.js","scripts":{"build":"webpack --mode=production","dev":"webpack --mode=development","doc":"tsc & api-extractor run"},"typings":"./release/ar-rtc-sdk.d.ts","author":"https://www.anyrtc.io","keywords":["web","webrtc","ArRTC"],"license":"./LICENSES.txt","devDependencies":{"awesome-typescript-loader":"^5.2.1","typescript":"^3.7.2","webpack":"^4.41.2","webpack-cli":"^3.3.10","webpack-sources":"^1.4.3","@babel/polyfill":"^7.8.7","@types/node":"^13.9.0","axios":"^0.19.2","electron":"^9.1.0"},"dependencies":{"webrtc-adapter":"^7.5.1"}}')},function(e,t,n){"use strict";var r=n(45);function i(e,t,n,i,o){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(i?i.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=i?r[0]:r,!!r.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.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(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},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(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},d.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var i=0;i=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){n.addTrack(e,r)}))}},d.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},d.prototype._gather=function(t,n){var i=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),s.component=1,s.ufrag=o.getLocalParameters().usernameFragment;var u=r.writeCandidate(s);a.candidate=Object.assign(a.candidate,r.parseCandidate(u)),a.candidate.candidate=u,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var d=r.getMediaSections(i._localDescription.sdp);d[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",i._localDescription.sdp=r.getDescription(i._localDescription.sdp)+d.join("");var f=i.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),c||i._dispatchEvent("icecandidate",a),f&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},d.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},d.prototype._transceive=function(e,n,i){var a=o(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),i&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},d.prototype.setLocalDescription=function(e){var t,n,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=r.parseRtpParameters(e);i.transceivers[t].localCapabilities=n})),i.transceivers.forEach((function(e,t){i._gather(e.mid,t)}));else if("answer"===e.type){t=r.splitSections(i._remoteDescription.sdp),n=t.shift();var s=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=i.transceivers[t],c=a.iceGatherer,u=a.iceTransport,d=a.dtlsTransport,f=a.localCapabilities,l=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);s&&(h.role="server"),i.usingBundle&&0!==t||(i._gather(a.mid,t),"new"===u.state&&u.start(c,p,s?"controlling":"controlled"),"new"===d.state&&d.start(h));var v=o(f,l);i._transceive(a,v.codecs.length>0,!1)}}))}return i._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(i){var d=this;if(-1===["offer","answer"].indexOf(i.type))return Promise.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!a("setRemoteDescription",i.type,d.signalingState)||d._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+d.signalingState));var f={};d.remoteStreams.forEach((function(e){f[e.id]=e}));var l=[],p=r.splitSections(i.sdp),h=p.shift(),v=r.matchPrefix(h,"a=ice-lite").length>0,m=r.matchPrefix(h,"a=group:BUNDLE ").length>0;d.usingBundle=m;var _=r.matchPrefix(h,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!_&&_.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(a,c){var u=r.splitLines(a),p=r.getKind(a),_=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,y=u[0].substr(2).split(" ")[2],g=r.getDirection(a,h),S=r.parseMsid(a),E=r.getMid(a)||r.generateIdentifier();if(_||"application"===p&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))d.transceivers[c]={mid:E,kind:p,protocol:y,rejected:!0};else{var T,C,b,R,w,I,O,A,N;!_&&d.transceivers[c]&&d.transceivers[c].rejected&&(d.transceivers[c]=d._createTransceiver(p,!0));var D,P,k=r.parseRtpParameters(a);_||(D=r.getIceParameters(a,h),(P=r.getDtlsParameters(a,h)).role="client"),O=r.parseRtpEncodingParameters(a);var x=r.parseRtcpParameters(a),L=r.matchPrefix(a,"a=end-of-candidates",h).length>0,M=r.matchPrefix(a,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===i.type||"answer"===i.type)&&!_&&m&&c>0&&d.transceivers[c]&&(d._disposeIceAndDtlsTransports(c),d.transceivers[c].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[c].iceTransport=d.transceivers[0].iceTransport,d.transceivers[c].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[c].rtpSender&&d.transceivers[c].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[c].rtpReceiver&&d.transceivers[c].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==i.type||_){if("answer"===i.type&&!_){C=(T=d.transceivers[c]).iceGatherer,b=T.iceTransport,R=T.dtlsTransport,w=T.rtpReceiver,I=T.sendEncodingParameters,A=T.localCapabilities,d.transceivers[c].recvEncodingParameters=O,d.transceivers[c].remoteCapabilities=k,d.transceivers[c].rtcpParameters=x,M.length&&"new"===b.state&&(!v&&!L||m&&0!==c?M.forEach((function(e){s(T.iceTransport,e)})):b.setRemoteCandidates(M)),m&&0!==c||("new"===b.state&&b.start(C,D,"controlling"),"new"===R.state&&R.start(P)),!o(T.localCapabilities,T.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&T.sendEncodingParameters[0].rtx&&delete T.sendEncodingParameters[0].rtx,d._transceive(T,"sendrecv"===g||"recvonly"===g,"sendrecv"===g||"sendonly"===g),!w||"sendrecv"!==g&&"sendonly"!==g?delete T.rtpReceiver:(N=w.track,S?(f[S.stream]||(f[S.stream]=new e.MediaStream),n(N,f[S.stream]),l.push([N,w,f[S.stream]])):(f.default||(f.default=new e.MediaStream),n(N,f.default),l.push([N,w,f.default])))}}else{(T=d.transceivers[c]||d._createTransceiver(p)).mid=E,T.iceGatherer||(T.iceGatherer=d._createIceGatherer(c,m)),M.length&&"new"===T.iceTransport.state&&(!L||m&&0!==c?M.forEach((function(e){s(T.iceTransport,e)})):T.iceTransport.setRemoteCandidates(M)),A=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(A.codecs=A.codecs.filter((function(e){return"rtx"!==e.name}))),I=T.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var U,F=!1;if("sendrecv"===g||"sendonly"===g){if(F=!T.rtpReceiver,w=T.rtpReceiver||new e.RTCRtpReceiver(T.dtlsTransport,p),F)N=w.track,S&&"-"===S.stream||(S?(f[S.stream]||(f[S.stream]=new e.MediaStream,Object.defineProperty(f[S.stream],"id",{get:function(){return S.stream}})),Object.defineProperty(N,"id",{get:function(){return S.track}}),U=f[S.stream]):(f.default||(f.default=new e.MediaStream),U=f.default)),U&&(n(N,U),T.associatedRemoteMediaStreams.push(U)),l.push([N,w,U])}else T.rtpReceiver&&T.rtpReceiver.track&&(T.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===T.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),T.associatedRemoteMediaStreams=[]);T.localCapabilities=A,T.remoteCapabilities=k,T.rtpReceiver=w,T.rtcpParameters=x,T.sendEncodingParameters=I,T.recvEncodingParameters=O,d._transceive(d.transceivers[c],!1,F)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===i.type?"active":"passive"),d._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?d._updateSignalingState("have-remote-offer"):d._updateSignalingState("stable"),Object.keys(f).forEach((function(t){var n=f[t];if(n.getTracks().length){if(-1===d.remoteStreams.indexOf(n)){d.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){d._dispatchEvent("addstream",r)}))}l.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(d,t,r,[n])}))}})),l.forEach((function(e){e[2]||u(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},d.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},d.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},d.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));o>0||a>0;)o>0&&(n._createTransceiver("audio"),o--),a>0&&(n._createTransceiver("video"),a--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(i,o){var a=i.track,s=i.kind,c=i.mid||r.generateIdentifier();i.mid=c,i.iceGatherer||(i.iceGatherer=n._createIceGatherer(o,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(s);t<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=i.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];a&&t>=15019&&"video"===s&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,s)),i.localCapabilities=u,i.sendEncodingParameters=d})),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){u+=i(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))}));var d=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(d)},d.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=r.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,r){if(!(r+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;if(e.stream)"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=o(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=i(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var u=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(u)},d.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(i,o){if(!n._remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u0?r.parseCandidate(e.candidate):{};if("tcp"===f.protocol&&(0===f.port||9===f.port))return i();if(f.component&&1!==f.component)return i();if((0===a||a>0&&d.iceTransport!==n.transceivers[0].iceTransport)&&!s(d.iceTransport,f))return o(c("OperationError","Can not add ICE candidate"));var l=e.candidate.trim();0===l.indexOf("a=")&&(l=l.substr(2)),(t=r.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(f.type?l:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var p=0;pi;)X(e,n=r[i++],t[n]);return e},Q=function(e){var t=F.call(this,e=T(e,!0));return!(this===G&&i(V,e)&&!i(B,e))&&(!(t||!i(this,e)||!i(V,e)||i(this,M)&&this[M][e])||t)},$=function(e,t){if(e=E(e),t=T(t,!0),e!==G||!i(V,t)||i(B,t)){var n=N(e,t);return!n||!i(V,t)||i(e,M)&&e[M][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=P(E(e)),r=[],o=0;n.length>o;)i(V,t=n[o++])||t==M||t==c||r.push(t);return r},ee=function(e){for(var t,n=e===G,r=P(n?B:E(e)),o=[],a=0;r.length>a;)!i(V,t=r[a++])||n&&!i(G,t)||o.push(V[t]);return o};W||(s((k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var e=l(arguments.length>0?arguments[0]:void 0),t=function(n){this===G&&t.call(B,n),i(this,M)&&i(this[M],e)&&(this[M][e]=!1),J(this,e,C(1,n))};return o&&K&&J(G,e,{configurable:!0,set:t}),z(e)}).prototype,"toString",(function(){return this._k})),w.f=$,O.f=X,n(35).f=R.f=Z,n(47).f=Q,I.f=ee,o&&!n(31)&&s(G,"propertyIsEnumerable",Q,!0),h.f=function(e){return z(p(e))}),a(a.G+a.W+a.F*!W,{Symbol:k});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)p(te[ne++]);for(var re=A(p.store),ie=0;re.length>ie;)v(re[ie++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(j,e+="")?j[e]:j[e]=k(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in j)if(j[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),a(a.S+a.F*!W,"Object",{create:function(e,t){return void 0===t?b(e):q(b(e),t)},defineProperty:X,defineProperties:q,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:ee});var oe=u((function(){I.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return I.f(S(e))}}),x&&a(a.S+a.F*(!W||u((function(){var e=k();return"[null]"!=L([e])||"{}"!=L({a:e})||"{}"!=L(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(g(t)||void 0!==e)&&!Y(e))return _(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,L.apply(x,r)}}),k.prototype[U]||n(15)(k.prototype,U,k.prototype.valueOf),f(k,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(e,t,n){e.exports=n(51)("native-function-to-string",Function.toString)},function(e,t,n){var r=n(32),i=n(53),o=n(47);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),c=o.f,u=0;s.length>u;)c.call(e,a=s[u++])&&t.push(a);return t}},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(34)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperty:n(9).f})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperties:n(94)})},function(e,t,n){var r=n(16),i=n(21).f;n(22)("getOwnPropertyDescriptor",(function(){return function(e,t){return i(r(e),t)}}))},function(e,t,n){var r=n(10),i=n(36);n(22)("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},function(e,t,n){var r=n(10),i=n(32);n(22)("keys",(function(){return function(e){return i(r(e))}}))},function(e,t,n){n(22)("getOwnPropertyNames",(function(){return n(95).f}))},function(e,t,n){var r=n(4),i=n(28).onFreeze;n(22)("freeze",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4),i=n(28).onFreeze;n(22)("seal",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4),i=n(28).onFreeze;n(22)("preventExtensions",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4);n(22)("isFrozen",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},function(e,t,n){var r=n(4);n(22)("isSealed",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},function(e,t,n){var r=n(4);n(22)("isExtensible",(function(e){return function(t){return!!r(t)&&(!e||e(t))}}))},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(96)})},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(97)})},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(68).set})},function(e,t,n){"use strict";var r=n(48),i={};i[n(5)("toStringTag")]="z",i+""!="[object z]"&&n(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(98)})},function(e,t,n){var r=n(9).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(8)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(4),i=n(36),o=n(5)("hasInstance"),a=Function.prototype;o in a||n(9).f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(0),i=n(100);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(e,t,n){var r=n(0),i=n(101);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(e,t,n){"use strict";var r=n(1),i=n(14),o=n(24),a=n(70),s=n(27),c=n(2),u=n(35).f,d=n(21).f,f=n(9).f,l=n(40).trim,p=r.Number,h=p,v=p.prototype,m="Number"==o(n(34)(v)),_="trim"in String.prototype,y=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=_?t.trim():l(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,c=t.slice(2),u=0,d=c.length;ui)return NaN;return parseInt(c,r)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(m?c((function(){v.valueOf.call(n)})):"Number"!=o(n))?a(new h(y(t)),n,p):y(t)};for(var g,S=n(8)?u(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),E=0;S.length>E;E++)i(h,g=S[E])&&!i(p,g)&&f(p,g,d(h,g));p.prototype=v,v.constructor=p,n(11)(r,"Number",p)}},function(e,t,n){"use strict";var r=n(0),i=n(20),o=n(102),a=n(71),s=1..toFixed,c=Math.floor,u=[0,0,0,0,0,0],d="Number.toFixed: incorrect invocation!",f=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*u[n],u[n]=r%1e7,r=c(r/1e7)},l=function(e){for(var t=6,n=0;--t>=0;)n+=u[t],u[t]=c(n/e),n=n%e*1e7},p=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==u[e]){var n=String(u[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},h=function(e,t,n){return 0===t?n:t%2==1?h(e,t-1,n*e):h(e*e,t/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(2)((function(){s.call({})}))),"Number",{toFixed:function(e){var t,n,r,s,c=o(this,d),u=i(e),v="",m="0";if(u<0||u>20)throw RangeError(d);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(v="-",c=-c),c>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(c*h(2,69,1))-69)<0?c*h(2,-t,1):c/h(2,t,1),n*=4503599627370496,(t=52-t)>0){for(f(0,n),r=u;r>=7;)f(1e7,0),r-=7;for(f(h(10,r,1),0),r=t-1;r>=23;)l(1<<23),r-=23;l(1<0?v+((s=m.length)<=u?"0."+a.call("0",u-s)+m:m.slice(0,s-u)+"."+m.slice(s-u)):v+m}})},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(102),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),i=n(1).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(103)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),i=n(103),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),i=n(101);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(0),i=n(100);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){var r=n(0),i=n(104),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},function(e,t,n){var r=n(0),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,n){var r=n(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),i=n(72);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(0),i=n(73);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(183)})},function(e,t,n){var r=n(72),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),c=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),u=r(e);return is||n!=n?u*(1/0):u*n}},function(e,t,n){var r=n(0),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,o=0,a=0,s=arguments.length,c=0;a0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(o)}})},function(e,t,n){var r=n(0),i=Math.imul;r(r.S+r.F*n(2)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(104)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(72)})},function(e,t,n){var r=n(0),i=n(73),o=Math.exp;r(r.S+r.F*n(2)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),i=n(73),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(0),i=n(33),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(0),i=n(16),o=n(6);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t,n){"use strict";var r=n(0),i=n(74)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(76),a="".endsWith;r(r.P+r.F*n(78)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),s=void 0===n?r:Math.min(i(n),r),c=String(e);return a?a.call(t,c,s):t.slice(s-c.length,s)===c}})},function(e,t,n){"use strict";var r=n(0),i=n(76);r(r.P+r.F*n(78)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(71)})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(76),a="".startsWith;r(r.P+r.F*n(78)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(12)("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},function(e,t,n){"use strict";n(12)("big",(function(e){return function(){return e(this,"big","","")}}))},function(e,t,n){"use strict";n(12)("blink",(function(e){return function(){return e(this,"blink","","")}}))},function(e,t,n){"use strict";n(12)("bold",(function(e){return function(){return e(this,"b","","")}}))},function(e,t,n){"use strict";n(12)("fixed",(function(e){return function(){return e(this,"tt","","")}}))},function(e,t,n){"use strict";n(12)("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},function(e,t,n){"use strict";n(12)("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},function(e,t,n){"use strict";n(12)("italics",(function(e){return function(){return e(this,"i","","")}}))},function(e,t,n){"use strict";n(12)("link",(function(e){return function(t){return e(this,"a","href",t)}}))},function(e,t,n){"use strict";n(12)("small",(function(e){return function(){return e(this,"small","","")}}))},function(e,t,n){"use strict";n(12)("strike",(function(e){return function(){return e(this,"strike","","")}}))},function(e,t,n){"use strict";n(12)("sub",(function(e){return function(){return e(this,"sub","","")}}))},function(e,t,n){"use strict";n(12)("sup",(function(e){return function(){return e(this,"sup","","")}}))},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";var r=n(0),i=n(10),o=n(27);r(r.P+r.F*n(2)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),n=o(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(0),i=n(218);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,n){"use strict";var r=n(2),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},function(e,t,n){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(11)(r,"toString",(function(){var e=o.call(this);return e==e?i.call(this):"Invalid Date"}))},function(e,t,n){var r=n(5)("toPrimitive"),i=Date.prototype;r in i||n(15)(i,r,n(221))},function(e,t,n){"use strict";var r=n(3),i=n(27);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),"number"!=e)}},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(54)})},function(e,t,n){"use strict";var r=n(18),i=n(0),o=n(10),a=n(106),s=n(79),c=n(6),u=n(80),d=n(81);i(i.S+i.F*!n(55)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,f,l=o(e),p="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,_=0,y=d(l);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),null==y||p==Array&&s(y))for(n=new p(t=c(l.length));t>_;_++)u(n,_,m?v(l[_],_):l[_]);else for(f=y.call(l),n=new p;!(i=f.next()).done;_++)u(n,_,m?a(f,v,[i.value,_],!0):i.value);return n.length=_,n}})},function(e,t,n){"use strict";var r=n(0),i=n(80);r(r.S+r.F*n(2)((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(0),i=n(16),o=[].join;r(r.P+r.F*(n(46)!=Object||!n(17)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),i=n(67),o=n(24),a=n(33),s=n(6),c=[].slice;r(r.P+r.F*n(2)((function(){i&&c.call(i)})),"Array",{slice:function(e,t){var n=s(this.length),r=o(this);if(t=void 0===t?n:t,"Array"==r)return c.call(this,e,t);for(var i=a(e,n),u=a(t,n),d=s(u-i),f=new Array(d),l=0;l1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(109)}),n(37)("copyWithin")},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(82)}),n(37)("fill")},function(e,t,n){"use strict";var r=n(0),i=n(23)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(37)("find")},function(e,t,n){"use strict";var r=n(0),i=n(23)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(37)(o)},function(e,t,n){n(42)("Array")},function(e,t,n){var r=n(1),i=n(70),o=n(9).f,a=n(35).f,s=n(77),c=n(56),u=r.RegExp,d=u,f=u.prototype,l=/a/g,p=/a/g,h=new u(l)!==l;if(n(8)&&(!h||n(2)((function(){return p[n(5)("match")]=!1,u(l)!=l||u(p)==p||"/a/i"!=u(l,"i")})))){u=function(e,t){var n=this instanceof u,r=s(e),o=void 0===t;return!n&&r&&e.constructor===u&&o?e:i(h?new d(r&&!o?e.source:e,t):d((r=e instanceof u)?e.source:e,r&&o?c.call(e):t),n?this:f,u)};for(var v=function(e){e in u||o(u,e,{configurable:!0,get:function(){return d[e]},set:function(t){d[e]=t}})},m=a(d),_=0;m.length>_;)v(m[_++]);f.constructor=u,u.prototype=f,n(11)(r,"RegExp",u)}n(42)("RegExp")},function(e,t,n){"use strict";n(112);var r=n(3),i=n(56),o=n(8),a=/./.toString,s=function(e){n(11)(RegExp.prototype,"toString",e,!0)};n(2)((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?s((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):"toString"!=a.name&&s((function(){return a.call(this)}))},function(e,t,n){"use strict";var r=n(3),i=n(6),o=n(85),a=n(57);n(58)("match",1,(function(e,t,n,s){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var c=r(e),u=String(this);if(!c.global)return a(c,u);var d=c.unicode;c.lastIndex=0;for(var f,l=[],p=0;null!==(f=a(c,u));){var h=String(f[0]);l[p]=h,""===h&&(c.lastIndex=o(u,i(c.lastIndex),d)),p++}return 0===p?null:l}]}))},function(e,t,n){"use strict";var r=n(3),i=n(10),o=n(6),a=n(20),s=n(85),c=n(57),u=Math.max,d=Math.min,f=Math.floor,l=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;n(58)("replace",2,(function(e,t,n,h){return[function(r,i){var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(e,t){var i=h(n,e,this,t);if(i.done)return i.value;var f=r(e),l=String(this),p="function"==typeof t;p||(t=String(t));var m=f.global;if(m){var _=f.unicode;f.lastIndex=0}for(var y=[];;){var g=c(f,l);if(null===g)break;if(y.push(g),!m)break;""===String(g[0])&&(f.lastIndex=s(l,o(f.lastIndex),_))}for(var S,E="",T=0,C=0;C=T&&(E+=l.slice(T,R)+N,T=R+b.length)}return E+l.slice(T)}];function v(e,t,r,o,a,s){var c=r+e.length,u=o.length,d=p;return void 0!==a&&(a=i(a),d=l),n.call(s,d,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(c);case"<":s=a[i.slice(1,-1)];break;default:var d=+i;if(0===d)return n;if(d>u){var l=f(d/10);return 0===l?n:l<=u?void 0===o[l-1]?i.charAt(1):o[l-1]+i.charAt(1):n}s=o[d-1]}return void 0===s?"":s}))}}))},function(e,t,n){"use strict";var r=n(3),i=n(97),o=n(57);n(58)("search",1,(function(e,t,n,a){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var s=r(e),c=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var d=o(s,c);return i(s.lastIndex,u)||(s.lastIndex=u),null===d?-1:d.index}]}))},function(e,t,n){"use strict";var r=n(77),i=n(3),o=n(49),a=n(85),s=n(6),c=n(57),u=n(84),d=n(2),f=Math.min,l=[].push,p="length",h=!d((function(){RegExp(4294967295,"y")}));n(58)("split",2,(function(e,t,n,d){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[p]||2!="ab".split(/(?:ab)*/)[p]||4!=".".split(/(.?)(.?)/)[p]||".".split(/()()/)[p]>1||"".split(/.?/)[p]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var o,a,s,c=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,h=void 0===t?4294967295:t>>>0,v=new RegExp(e.source,d+"g");(o=u.call(v,i))&&!((a=v.lastIndex)>f&&(c.push(i.slice(f,o.index)),o[p]>1&&o.index=h));)v.lastIndex===o.index&&v.lastIndex++;return f===i[p]?!s&&v.test("")||c.push(""):c.push(i.slice(f)),c[p]>h?c.slice(0,h):c}:"0".split(void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,i,r):v.call(String(i),n,r)},function(e,t){var r=d(v,e,this,t,v!==n);if(r.done)return r.value;var u=i(e),l=String(this),p=o(u,RegExp),m=u.unicode,_=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(h?"y":"g"),y=new p(h?u:"^(?:"+u.source+")",_),g=void 0===t?4294967295:t>>>0;if(0===g)return[];if(0===l.length)return null===c(y,l)?[l]:[];for(var S=0,E=0,T=[];E0?arguments[0]:void 0)}}),{get:function(e){var t=r.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(i(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(116),i=n(38);e.exports=n(61)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(1),o=n(23)(0),a=n(11),s=n(28),c=n(96),u=n(117),d=n(4),f=n(38),l=n(38),p=!i.ActiveXObject&&"ActiveXObject"in i,h=s.getWeak,v=Object.isExtensible,m=u.ufstore,_=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(d(e)){var t=h(e);return!0===t?m(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(f(this,"WeakMap"),e,t)}},g=e.exports=n(61)("WeakMap",_,y,u,!0,!0);l&&p&&(c((r=u.getConstructor(_,"WeakMap")).prototype,y),s.NEED=!0,o(["delete","has","get","set"],(function(e){var t=g.prototype,n=t[e];a(t,e,(function(t,i){if(d(t)&&!v(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)}))})))},function(e,t,n){"use strict";var r=n(117),i=n(38);n(61)("WeakSet",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(0),i=n(62),o=n(87),a=n(3),s=n(33),c=n(6),u=n(4),d=n(1).ArrayBuffer,f=n(49),l=o.ArrayBuffer,p=o.DataView,h=i.ABV&&d.isView,v=l.prototype.slice,m=i.VIEW;r(r.G+r.W+r.F*(d!==l),{ArrayBuffer:l}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return h&&h(e)||u(e)&&m in e}}),r(r.P+r.U+r.F*n(2)((function(){return!new l(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(a(this),e);for(var n=a(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),o=new(f(this,l))(c(i-r)),u=new p(this),d=new p(o),h=0;r=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}})),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},function(e,t,n){var r=n(21),i=n(36),o=n(14),a=n(0),s=n(4),c=n(3);a(a.S,"Reflect",{get:function e(t,n){var a,u,d=arguments.length<3?t:arguments[2];return c(t)===d?t[n]:(a=r.f(t,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(d):void 0:s(u=i(t))?e(u,n,d):void 0}})},function(e,t,n){var r=n(21),i=n(0),o=n(3);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},function(e,t,n){var r=n(0),i=n(36),o=n(3);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),i=n(3),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(119)})},function(e,t,n){var r=n(0),i=n(3),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(9),i=n(21),o=n(36),a=n(14),s=n(0),c=n(29),u=n(3),d=n(4);s(s.S,"Reflect",{set:function e(t,n,s){var f,l,p=arguments.length<4?t:arguments[3],h=i.f(u(t),n);if(!h){if(d(l=o(t)))return e(l,n,s,p);h=c(0)}if(a(h,"value")){if(!1===h.writable||!d(p))return!1;if(f=i.f(p,n)){if(f.get||f.set||!1===f.writable)return!1;f.value=s,r.f(p,n,f)}else r.f(p,n,c(0,s));return!0}return void 0!==h.set&&(h.set.call(p,s),!0)}})},function(e,t,n){var r=n(0),i=n(68);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){n(281),e.exports=n(7).Array.includes},function(e,t,n){"use strict";var r=n(0),i=n(52)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(37)("includes")},function(e,t,n){n(283),e.exports=n(7).Array.flatMap},function(e,t,n){"use strict";var r=n(0),i=n(284),o=n(10),a=n(6),s=n(19),c=n(107);r(r.P,"Array",{flatMap:function(e){var t,n,r=o(this);return s(e),t=a(r.length),n=c(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(37)("flatMap")},function(e,t,n){"use strict";var r=n(54),i=n(4),o=n(6),a=n(18),s=n(5)("isConcatSpreadable");e.exports=function e(t,n,c,u,d,f,l,p){for(var h,v,m=d,_=0,y=!!l&&a(l,p,3);_0)m=e(t,n,h,o(h.length),m,f-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=h}m++}_++}return m}},function(e,t,n){n(286),e.exports=n(7).String.padStart},function(e,t,n){"use strict";var r=n(0),i=n(120),o=n(60),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){n(288),e.exports=n(7).String.padEnd},function(e,t,n){"use strict";var r=n(0),i=n(120),o=n(60),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){n(290),e.exports=n(7).String.trimLeft},function(e,t,n){"use strict";n(40)("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},function(e,t,n){n(292),e.exports=n(7).String.trimRight},function(e,t,n){"use strict";n(40)("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},function(e,t,n){n(294),e.exports=n(64).f("asyncIterator")},function(e,t,n){n(92)("asyncIterator")},function(e,t,n){n(296),e.exports=n(7).Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(0),i=n(119),o=n(16),a=n(21),s=n(80);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),c=a.f,u=i(r),d={},f=0;u.length>f;)void 0!==(n=c(r,t=u[f++]))&&s(d,t,n);return d}})},function(e,t,n){n(298),e.exports=n(7).Object.values},function(e,t,n){var r=n(0),i=n(121)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){n(300),e.exports=n(7).Object.entries},function(e,t,n){var r=n(0),i=n(121)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){"use strict";n(113),n(302),e.exports=n(7).Promise.finally},function(e,t,n){"use strict";var r=n(0),i=n(7),o=n(1),a=n(49),s=n(115);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},function(e,t,n){n(304),n(305),n(306),e.exports=n(7)},function(e,t,n){var r=n(1),i=n(0),o=n(60),a=[].slice,s=/MSIE .\./.test(o),c=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(e,t,n){var r=n(0),i=n(86);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){for(var r=n(83),i=n(32),o=n(11),a=n(1),s=n(15),c=n(41),u=n(5),d=u("iterator"),f=u("toStringTag"),l=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(p),v=0;v=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){n(309),e.exports=n(122).global},function(e,t,n){var r=n(310);r(r.G,{global:n(88)})},function(e,t,n){var r=n(88),i=n(122),o=n(311),a=n(313),s=n(320),c=function(e,t,n){var u,d,f,l=e&c.F,p=e&c.G,h=e&c.S,v=e&c.P,m=e&c.B,_=e&c.W,y=p?i:i[t]||(i[t]={}),g=y.prototype,S=p?r:h?r[t]:(r[t]||{}).prototype;for(u in p&&(n=t),n)(d=!l&&S&&void 0!==S[u])&&s(y,u)||(f=d?S[u]:n[u],y[u]=p&&"function"!=typeof S[u]?n[u]:m&&d?o(f,r):_&&S[u]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[u]=f,e&c.R&&g&&!g[u]&&a(g,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(312);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(314),i=n(319);e.exports=n(90)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(315),i=n(316),o=n(318),a=Object.defineProperty;t.f=n(90)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(89);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(90)&&!n(123)((function(){return 7!=Object.defineProperty(n(317)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(89),i=n(88).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(89);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var r=n(13),i=n(124),o=n(322),a=n(130);function s(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var c=s(n(127));c.Axios=o,c.create=function(e){return s(a(c.defaults,e))},c.Cancel=n(131),c.CancelToken=n(336),c.isCancel=n(126),c.all=function(e){return Promise.all(e)},c.spread=n(337),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";var r=n(13),i=n(125),o=n(323),a=n(324),s=n(130);function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},c.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,i){return this.request(r.merge(i||{},{method:e,url:t,data:n}))}})),e.exports=c},function(e,t,n){"use strict";var r=n(13);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,n){"use strict";var r=n(13),i=n(325),o=n(126),a=n(127);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return s(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(s(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(13);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,u=[],d=!1,f=-1;function l(){d&&c&&(d=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!d){var e=s(l);d=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var n=1;n=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},function(e,t,n){"use strict";var r=n(13);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(13);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(131);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"shimGetUserMedia",(function(){return se})),n.d(r,"shimGetDisplayMedia",(function(){return ce})),n.d(r,"shimMediaStream",(function(){return ue})),n.d(r,"shimOnTrack",(function(){return de})),n.d(r,"shimGetSendersWithDtmf",(function(){return fe})),n.d(r,"shimGetStats",(function(){return le})),n.d(r,"shimSenderReceiverGetStats",(function(){return pe})),n.d(r,"shimAddTrackRemoveTrackWithNative",(function(){return he})),n.d(r,"shimAddTrackRemoveTrack",(function(){return ve})),n.d(r,"shimPeerConnection",(function(){return me})),n.d(r,"fixNegotiationNeeded",(function(){return _e}));var i={};n.r(i),n.d(i,"shimGetUserMedia",(function(){return Se})),n.d(i,"shimGetDisplayMedia",(function(){return Ee})),n.d(i,"shimPeerConnection",(function(){return Te})),n.d(i,"shimReplaceTrack",(function(){return Ce}));var o={};n.r(o),n.d(o,"shimGetUserMedia",(function(){return be})),n.d(o,"shimGetDisplayMedia",(function(){return Re})),n.d(o,"shimOnTrack",(function(){return we})),n.d(o,"shimPeerConnection",(function(){return Ie})),n.d(o,"shimSenderGetStats",(function(){return Oe})),n.d(o,"shimReceiverGetStats",(function(){return Ae})),n.d(o,"shimRemoveStream",(function(){return Ne})),n.d(o,"shimRTCDataChannel",(function(){return De})),n.d(o,"shimAddTransceiver",(function(){return Pe})),n.d(o,"shimCreateOffer",(function(){return ke})),n.d(o,"shimCreateAnswer",(function(){return xe}));var a={};n.r(a),n.d(a,"shimLocalStreamsAPI",(function(){return Le})),n.d(a,"shimRemoteStreamsAPI",(function(){return Me})),n.d(a,"shimCallbacksAPI",(function(){return Ue})),n.d(a,"shimGetUserMedia",(function(){return Fe})),n.d(a,"shimConstraints",(function(){return je})),n.d(a,"shimRTCIceServerUrls",(function(){return Ve})),n.d(a,"shimTrackEventTransceiver",(function(){return Be})),n.d(a,"shimCreateOfferLegacy",(function(){return Ge}));var s={};n.r(s),n.d(s,"shimRTCIceCandidate",(function(){return Ke})),n.d(s,"shimMaxMessageSize",(function(){return Je})),n.d(s,"shimSendThrowTypeError",(function(){return ze})),n.d(s,"shimConnectionState",(function(){return Ye})),n.d(s,"removeAllowExtmapMixed",(function(){return Xe}));var c,u,d,f,l,p,h,v,m={SDK_VERSION:n(132).version,PROCESS_ID:"",GATEWAY_ADDRESS:"https://gateway.agrtc.cn",GATEWAY_CONNECT_TIMEOUT:2e3,GATEWAY_ERTRY_TIMEOUT:12e5,ACCOUNT_REGISTER_RETRY_TIMEOUT:1,ACCOUNT_REGISTER_RETRY_RATIO:2,ACCOUNT_REGISTER_RETRY_TIMEOUT_MAX:6e4,ACCOUNT_REGISTER_RETRY_COUNT_MAX:1e5,AUDIO_CONTEXT:null,EVENT_REPORT_DOMAIN:"event.agrtc.cn",EVENT_REPORT_BACKUP_DOMAIN:"event.agrtc.cn",WEBCS_BACKUP_CONNECT_TIMEOUT:6e3,HTTP_CONNECT_TIMEOUT:5e3,PLAYER_STATE_DEFER:2e3,SIGNAL_REQUEST_TIMEOUT:1e4,SIGNAL_REQUEST_WATCH_INTERVAL:1e3,REPORT_STATS:!0,UPLOAD_LOG:!1,NOT_REPORT_EVENT:[],FILEPATH_LENMAX:255,SUBSCRIBE_TCC:!1,PING_PONG_TIME_OUT:10,DUALSTREAM_OPERATION_CHECK:!0,WEBSOCKET_TIMEOUT_MIN:1e4,EVENT_REPORT_SEND_INTERVAL:1e3,MEDIA_ELEMENT_EXISTS_DEPTH:3,CANDIDATE_TIMEOUT:2e3,SHIM_CANDIDATE:!1,LEAVE_MSG_TIMEOUT:2e3,SHOW_REPORT_INVOKER_LOG:!1,STATS_FILTER:{transportId:!0,googTrackId:!0},JOIN_EXTEND:"",PUB_EXTEND:"",SUB_EXTEND:"",FORCE_TURN:!1,TURN_ENABLE_TCP:!0,TURN_ENABLE_UDP:!0,MAX_UPLOAD_CACHE:50,UPLOAD_CACHE_INTERVAL:200,AUDIO_SOURCE_VOLUME_UPDATE_INTERVAL:200,AUDIO_SOURCE_AVG_VOLUME_DURATION:3e3,AUDIO_VOLUME_INDICATION_INTERVAL:2e3};!function(e){e.DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED",e.RELAY_OK="RELAY_OK",e.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",e.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED"}(c||(c={})),function(e){e.NETWORK_CONNECTED="NETWORK_CONNECTED",e.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",e.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",e.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",e.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",e.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",e.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",e.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",e.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",e.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED"}(u||(u={})),function(e){e.RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",e.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE",e.RELAY_STATE_IDLE="RELAY_STATE_IDLE",e.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING"}(d||(d={})),function(e){e.CHANNEL_BANNED="CHANNEL_BANNED",e.IP_BANNED="IP_BANNED",e.LEAVE="LEAVE",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.UID_BANNED="UID_BANNED",e.DEVELOPER_INVALID="DEVELOPER_INVALID",e.TOKEN_INVALID="TOKEN_INVALID"}(f||(f={})),function(e){e[e.AUDIO_ONLY=2]="AUDIO_ONLY",e[e.DISABLE=0]="DISABLE",e[e.LOW_STREAM=1]="LOW_STREAM"}(l||(l={})),function(e){e[e.HIGH_STREAM=0]="HIGH_STREAM",e[e.LOW_STREAM=1]="LOW_STREAM"}(p||(p={})),function(e){e.WIN_10="Windows 10",e.WIN_81="Windows 8.1",e.WIN_8="Windows 8",e.WIN_7="Windows 7",e.WIN_VISTA="Windows Vista",e.WIN_SERVER_2003="Windows Server 2003",e.WIN_XP="Windows XP",e.WIN_2000="Windows 2000",e.ANDROID="Android",e.OPEN_BSD="Open BSD",e.SUN_OS="Sun OS",e.LINUX="Linux",e.IOS="iOS",e.MAC_OS_X="Mac OS X",e.MAC_OS="Mac OS",e.QNX="QNX",e.UNIX="UNIX",e.BEOS="BeOS",e.OS_2="OS/2",e.SEARCH_BOT="Search Bot"}(h||(h={})),function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.TIMEOUT="TIMEOUT",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_SUPPORT="NOT_SUPPORT",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORT="OPERATION_ABORT",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",e.NETWORK_ERROR="NETWORK_ERROR",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",e.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOTE_FOUND",e.ELECTRON_IS_NULL="ELECTRON_IS_NULL",e.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",e.STREAM_ALREADY_INITIALIZED="STREAM_ALREADY_INITIALIZED",e.STREAM_IS_CLOSED="STREAM_IS_CLOSED",e.ABORT_OTHER_INIT="ABORT_OTHER_INIT",e.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",e.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",e.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",e.PERMISSION_DENIED="PERMISSION_DENIED",e.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",e.CAN_NOT_AUTOPLAY="CAN_NOT_AUTOPLAY",e.HIGH_STREAM_NO_VIDEO_TRACK="HIGH_STREAM_NO_VIDEO_TRACK",e.SCREEN_SHARE_CAN_NOT_CREATE_LOW_STREAM="SCREEN_SHARE_CAN_NOT_CREATE_LOW_STREAM",e.TOKEN_GENERATOR_FUNCTION_ERROR="TOKEN_GENERATOR_FUNCTION_ERROR",e.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",e.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",e.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",e.UID_CONFLICT="UID_CONFLICT",e.TRACK_ALREADY_PUBLISHED="TRACK_ALREADY_PUBLISHED",e.TRACK_IS_NOT_PUBLISHED="TRACK_IS_NOT_PUBLISHED",e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.SENDER_NOT_FOUND="SENDER_NOT_FOUND",e.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",e.SET_ANSWER_FAILED="SET_ANSWER_FAILED",e.ICE_FAILED="ICE_FAILED",e.PC_CLOSED="PC_CLOSED",e.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.TRACK_IS_NOT_SUBSCRIBED="TRACK_IS_NOT_SUBSCRIBED",e.SUBSCRIPTION_IS_IN_PROGRESS="SUBSCRIPTION_IS_IN_PROGRESS",e.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",e.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",e.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",e.EFFECT_ID_CONFLICTED="EFFECT_ID_CONFLICTED",e.EFFECT_SOUND_ID_NOT_FOUND="EFFECT_SOUND_ID_NOT_FOUND",e.WS_ABORT="WS_ABORT",e.WS_DISCONNECT="WS_DISCONNECT",e.WS_ERR="WS_ERR",e.CAN_NOT_CONNECT_TO_LIVE_STREAMING_WORKER="CAN_NOT_CONNECT_TO_LIVE_STREAMING_WORKER",e.REQUEST_TO_LIVE_STREAMING_WORKER_FAILED="REQUEST_TO_LIVE_STREAMING_WORKER_FAILED",e.PUSH_RTMP_URL_CONFLICT="PUSH_RTMP_URL_CONFLICT",e.PULL_URL_CONFLICT="PULL_URL_CONFLICT",e.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",e.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE"}(v||(v={}));var _,y=function(e){var t=e;void 0===t&&(t=7);var n=Math.random().toString(16).substr(2,t).toLowerCase();return n.length===t?n:n+y(t-n.length)},g=function(e,t){var n="YYYY-MM-DD hh:mm:ss";if("number"!=typeof e)throw new Error("[timesToDate]: timestamp must be number");t&&"string"==typeof t&&(n=t);var r=e||Date.now(),i=new Date(r)||new Date(r),o=i.getFullYear(),a=i.getMonth()+1,s=i.getDate(),c=i.getHours(),u=i.getMinutes(),d=i.getSeconds();return n.indexOf("YYYY")>-1&&(n=n.replace("YYYY",(function(e){return""+o}))),n.indexOf("MM")>-1?n=n.replace("MM",(function(e){return a<10?"0"+a:""+a})):n.indexOf("M")>-1&&(n=n.replace("M",(function(e){return""+a}))),n.indexOf("DD")>-1?n=n.replace("DD",(function(e){return s<10?"0"+s:""+s})):n.indexOf("D")>-1&&(n=n.replace("D",(function(e){return""+s}))),n.indexOf("hh")>-1?n=n.replace("hh",(function(e){return c<10?"0"+c:""+c})):n.indexOf("h")>-1&&(n=n.replace("h",(function(e){return""+c}))),n.indexOf("mm")>-1?n=n.replace("mm",(function(e){return u<10?"0"+u:""+u})):n.indexOf("m")>-1&&(n=n.replace("m",(function(e){return""+u}))),n.indexOf("ss")>-1?n=n.replace("ss",(function(e){return d<10?"0"+d:""+d})):n.indexOf("s")>-1&&(n=n.replace("s",(function(e){return""+d}))),n};!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE"}(_||(_={}));var S=new(function(){function e(){this.logPrefix="SupLogger",this.logLevel=_.NONE,this.uploadServeTranslators=[],this.DEBUG=_.DEBUG,this.INFO=_.INFO,this.WARNING=_.WARNING,this.ERROR=_.ERROR,this.NONE=_.NONE}return e.prototype.use=function(e){"function"==typeof e&&this.uploadServeTranslators.push((function(t,n){e(t,n)}))},e.prototype.setLogLevel=function(e,t){t&&(this.logPrefix=t),"number"==typeof e&&e>-1&&e<5&&(this.logLevel=e)},e.prototype.error=function(){for(var e=[],t=0;t_.ERROR&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [ERROR]: ","color: #dc3545;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"error",params:n,timestamp:r},(function(){console.error.apply(console,n)}))})):console.error.apply(console,n)}},e.prototype.warning=function(){for(var e=[],t=0;t_.WARNING&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [WARNING]: ","color: #ffc107;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"warning",params:n,timestamp:r},(function(){console.warn.apply(console,n)}))})):console.warn.apply(console,n)}},e.prototype.info=function(){for(var e=[],t=0;t_.INFO&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [INFO]: ","color: #6facff;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"info",params:n,timestamp:r},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e.prototype.debug=function(){for(var e=[],t=0;t_.DEBUG&&this.logLevel!==_.NONE||this.logLevel===_.NONE)){var n=e,r=Date.now();n.unshift("["+g(r,"YYYY-MM-DD hh:mm:ss")+"] %c"+this.logPrefix+" [DEBUG]: ","color: #007bff;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"debug",params:n,timestamp:r},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e}());S.setLogLevel(S.DEBUG,"anyrtc-SDK");var E,T=S,C=Array.prototype,b=function(){function e(){this._events={},this.addListener=this.on}return e.prototype.getListeners=function(e){return this._events[e]?C.map.call(this._events[e],(function(e){return e.listener})):[]},e.prototype.on=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!1})},e.prototype.once=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!0})},e.prototype.off=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e],r=this._indexOfListener(n,t);-1!==r&&C.splice.call(n,r,1)},e.prototype.removeAllListeners=function(e){e?delete this._events[e]:this._events={}},e.prototype.emit=function(e){for(var t=[],n=1;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] ",i),r(i)},t._sendMessage(i)}))]}))}))},t.prototype.doOffline=function(e){var t={Cmd:"Offline"};t.Content=JSON.stringify({UserId:this._userId,UserSId:e}),this._sendMessage(t)},t.prototype.doPublish=function(e,t){var n=this;return new Promise((function(r,i){var o=function(e){var t=e.data,i=JSON.parse(t),a=i.Cmd,s=(i.Encrypt,i.Content),c=JSON.parse(s);a===A.ON_PUBLISH&&(n.signal.removeEventListener("message",o),r(c))};n.signal.addEventListener("message",o);var a={Cmd:"DoPublish"},s={StreamId:n._userId,ClientType:"sdk",AudCodecType:"Opus",VidCodecType:"H264"};if("[object Object]"===Object.prototype.toString.call(e)&&(s.AVSetting=JSON.stringify(Object.assign({HasAudio:!0,HasVideo:!0},e))),t){var c=t.Uri,u=t.Account,d=t.Pwd;a.Content={Uri:c||"",Account:u||"",Pwd:d||""}}a.Content=JSON.stringify(s),n._sendMessage(a)}))},t.prototype.doRePublish=function(e){var t=this;return new Promise((function(n,r){var i=function(e){var r=e.data,o=JSON.parse(r),a=o.Cmd,s=(o.Encrypt,o.Content),c=JSON.parse(s);a===A.ON_RE_PUBLISH&&(t.signal.removeEventListener("message",i),n(c))};t.signal.addEventListener("message",i);var o={Cmd:"DoRePublish"},a={StreamId:t._userId,ClientType:"sdk"};"[object Object]"===Object.prototype.toString.call(e)&&(a.AVSetting=JSON.stringify(Object.assign({HasAudio:!0,HasVideo:!0},e))),o.Content=JSON.stringify(a),t._sendMessage(o)}))},t.prototype.doPublishS=function(e){var t={Cmd:"DoPublishS"},n={StreamId:this._userId};if(e){var r=e.Uri,i=e.Account,o=e.Pwd;t.Content={Uri:r||"",Account:i||"",Pwd:o||""}}t.Content=JSON.stringify(n),this._sendMessage(t)},t.prototype.doUnPublish=function(){var e={Cmd:"DoUnPublish"};e.Content=JSON.stringify({StreamId:this._userId}),this._sendMessage(e)},t.prototype.doUnPublishS=function(){var e={Cmd:"DoUnPublishS"};e.Content=JSON.stringify({StreamId:this._userId}),this._sendMessage(e)},t.prototype.doSubscribe=function(e){var t={Cmd:"DoSubscribe"};t.Content=JSON.stringify(Object.assign({SubSessId:y(32)},e)),this._sendMessage(t)},t.prototype.doUnSubscribe=function(e){var t={Cmd:"DoUnSubscribe"};t.Content=JSON.stringify(Object.assign({StreamId:e})),this._sendMessage(t)},t.prototype.doReNewToken=function(e){var t={Cmd:"RenewAcsToken"};t.Content=JSON.stringify({AcsToken:e}),this._sendMessage(t)},t.prototype.sendAnswer=function(e,t,n){var r={Cmd:"Answer"},i={StreamId:e,Sdp:t};void 0!==n&&(i.SubStream=n),r.Content=JSON.stringify(i),this._sendMessage(r)},t.prototype.sendIceCandidate=function(e,t,n){var r={Cmd:"Ice"},i={StreamId:e,Sdp:t};void 0!==n&&(i.SubStream=n),r.Content=JSON.stringify(i),this._sendMessage(r)},t.prototype.setClientRole=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"SetRole",UserId:this._userId,Role:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.enableDualStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"DualStream",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.setAVStatus=function(e,t,n){var r={Cmd:"ChanMsg"};r.Content=JSON.stringify({Cmd:"SetAVStatus",StreamId:e,RecvAudio:t,RecvVideo:n,ToSvr:"GNode"}),this._sendMessage(r)},t.prototype.setRemoteVStrmType=function(e,t){var n={Cmd:"ChanMsg"};n.Content=JSON.stringify({Cmd:"SetRemoteVStrmType",UserId:this._userId,StreamId:e,StrmType:t,ToSvr:"GNode"}),this._sendMessage(n)},t.prototype.reportAVStat=function(e){var t=e.TimeUsed,n=e.AudNum,r=e.VidSize,i={Cmd:"ReportAVStat"};i.TimeUsed=t,i.AudNum=n,i.VidSize=r,i.AudBitrate=0,i.VidBitrate=0,i.Content="",this._sendMessage(i)},t.prototype.reportArStats=function(e){var t={Cmd:"ReportArStats"};t.Content=JSON.stringify(e),this._sendMessage(t)},t.prototype.enableLocalVideo=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"EnableLocalVideo",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.enableLocalAudio=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"EnableLocalAudio",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.muteLocalVideoStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"MuteLocalVideoStream",UserId:this._userId,Mute:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.muteLocalAudioStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"MuteLocalAudioStream",UserId:this._userId,Mute:e,ToSvr:"MNode"}),this._sendMessage(t)},t.prototype.disconnectCTS=function(e){this.signal&&this.signal.close(1e3,e),this.signal=null},t.prototype.clearEventEmitter=function(){this.removeAllListeners()},t.prototype._setConnectTimeout=function(){var e=this;e._clearConnectTimeout(),e._connectTimeout=window.setTimeout((function(){e._emitConnectionState("DISCONNECTING",f.NETWORK_ERROR)}),1e4)},t.prototype._startKeepAlive=function(){var e=this;e._stopKeepAlive(),e.doKeepAlive(),e._keepAiveInterval=window.setInterval((function(){e.doKeepAlive()}),e._keepAliveIntervalTime)},t.prototype._stopKeepAlive=function(){this._keepAiveInterval&&clearInterval(this._keepAiveInterval)},t.prototype._clearConnectTimeout=function(){this._connectTimeout&&clearTimeout(this._connectTimeout)},t.prototype._handleKeepAlive=function(){var e=this;e._removeHandleKeepAlive(),e._keepAliveTimeout=window.setTimeout((function(){e.disconnectCTS("NETWORK_ERROR")}),3*e._keepAliveIntervalTime)},t.prototype._removeHandleKeepAlive=function(){this._keepAliveTimeout&&clearTimeout(this._keepAliveTimeout)},t.prototype._sendMessage=function(e){return"object"!=typeof e?(T.error("[_sendMessage] msg must be object."),!1):(this.signal&&this.signal.send(JSON.stringify(e)),!0)},t.prototype._emitGateWayEvent=function(e,t){this.emit("@gateway_events",{type:e,data:t})},t.prototype._emitConnectionState=function(e,t){this._revState=this._curState,this._curState=e,this.handleMediaServerEvents&&this.handleMediaServerEvents("connection-state-change",{curState:this._curState,revState:this._revState,reason:t}),T.debug("["+this._userId+"] connection state change: "+this._revState+" -> "+this._curState)},t}(b),x=function(e){for(var t=[],n=1;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=n&&parseInt(r[n],10)}function Q(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};const o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);const r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function $(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Y=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Z(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(X=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function ee(){if("object"==typeof window){if(Y)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function te(e,t){X&&console.warn(e+" is deprecated, please use "+t+" instead.")}function ne(e){const{navigator:t}=e,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=q(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)n.browser="chrome",n.version=q(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=q(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=q(t.userAgent,/AppleWebKit\/(\d+)\./,1),n.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return n}function re(e){return"[object Object]"===Object.prototype.toString.call(e)}function ie(e){return re(e)?Object.keys(e).reduce((function(t,n){const r=re(e[n]),i=r?ie(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[n]:i})}),{}):e}function oe(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?e(t,t.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{e(t,t.get(n),r)})}))}(e,n,i)})}),i}const ae=ee;function se(e){const t=e&&e.navigator;if(!t.mediaDevices)return;const n=ne(e),r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[i("min",n)]=r.ideal,t.optional.push(e),e={},e[i("max",n)]=r.ideal,t.optional.push(e)):(e[i("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(n.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const a=n.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||a)){let n;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?n=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(n=["front"]),n)return t.mediaDevices.enumerateDevices().then(t=>{let a=(t=t.filter(e=>"videoinput"===e.kind)).find(e=>n.some(t=>e.label.toLowerCase().includes(t)));return!a&&t.length&&n.includes("back")&&(a=t[t.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=r(e.video),ae("chrome: "+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return ae("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,r){i(e,e=>{t.webkitGetUserMedia(e,n,e=>{r&&r(o(e))})})}.bind(t),t.mediaDevices.getUserMedia){const e=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException("","NotFoundError");return e},e=>Promise.reject(o(e))))}}}function ce(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(t=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function ue(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function de(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Q(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function fe(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{const t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function le(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach(e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(t=>{n[t]=e.stat(t)}),t[n.id]=n}),t},o=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};if(arguments.length>=2){const r=function(e){n(o(i(e)))};return t.apply(this,[r,e])}return new Promise((e,n)=>{t.apply(this,[function(t){e(o(i(t)))},n])}).then(n,r)}}function pe(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>oe(t,e.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),Q(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>oe(t,e.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function he(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")});const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function ve(e){if(!e.RTCPeerConnection)return;const t=ne(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return he(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(e=>e===t))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find(e=>e.track===t);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>o(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function me(e){const t=ne(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),!e.RTCPeerConnection)return;const n=0===e.RTCPeerConnection.prototype.addIceCandidate.length;t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return n||arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}function _e(e){Q(e,"negotiationneeded",e=>{if("stable"===e.target.signalingState)return e})}var ye=n(133),ge=n.n(ye);function Se(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(e=>Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e)))}}function Ee(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function Te(e){const t=ne(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const n=new Event("enabled");n.enabled=e,this.dispatchEvent(n)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const n=ge()(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(e=>{if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&te("RTCIceServer.url","RTCIceServer.urls");const r="string"==typeof t;return r&&(t=[t]),t=t.filter(e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n}),delete e.url,e.urls=r?t[0]:t,!!t.length}})}(e.iceServers,t.version),ee("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function Ce(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}function be(e){const t=ne(e),n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){te("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function Re(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function we(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ie(e){const t=ne(e);if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})),t.version<68){const t=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,o)}}function Oe(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Ae(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),Q(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Ne(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){te("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function De(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Pe(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach(e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();"encodings"in n||(n.encodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).catch(()=>{})))}return r})}function ke(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function xe(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function Le(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function Me(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function Ue(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function Fe(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(je(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function je(e){return e&&void 0!==e.video?Object.assign({},e,{video:ie(e.video)}):e}function Ve(e){const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;nt.generateCertificate})}function Be(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ge(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find(e=>"audio"===e.receiver.track.kind);!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find(e=>"video"===e.receiver.track.kind);!1===e.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!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}var We=n(45),He=n.n(We);function Ke(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),r=He.a.parseCandidate(e.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Q(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function Je(e){if(!e.RTCPeerConnection)return;const t=ne(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=He.a.splitSections(e.sdp);return t.shift(),t.some(e=>{const t=He.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},r=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},i=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},o=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=He.a.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=r(arguments[0]),t=i(e),n=o(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>a}),this._sctp=s}return a.apply(this,arguments)}}function ze(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Q(e,"datachannel",e=>(t(e.channel,e.target),e))}function Ye(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function Xe(e){if(!e.RTCPeerConnection)return;const t=ne(e);if("chrome"===t.browser&&t.version>=71)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter(e=>"a=extmap-allow-mixed"!==e.trim()).join("\n")),n.apply(this,arguments)}}var qe,Qe=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=ee,c=ne(e),u={browserDetails:c,commonShim:s,extractVersion:q,disableLog:$,disableWarnings:Z};switch(c.browser){case"chrome":if(!r||!me||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;n("adapter.js shimming chrome."),u.browserShim=r,se(e),ue(e),me(e),de(e),ve(e),fe(e),le(e),pe(e),_e(e),Ke(e),Ye(e),Je(e),ze(e),Xe(e);break;case"firefox":if(!o||!Ie||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=o,be(e),Ie(e),we(e),Ne(e),Oe(e),Ae(e),De(e),Pe(e),ke(e),xe(e),Ke(e),Ye(e),Je(e),ze(e);break;case"edge":if(!i||!Te||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),u;n("adapter.js shimming edge."),u.browserShim=i,Se(e),Ee(e),Te(e),Ce(e),Je(e),ze(e);break;case"safari":if(!a||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=a,Ve(e),Ge(e),Ue(e),Le(e),Me(e),Be(e),Fe(e),Ke(e),Je(e),ze(e),Xe(e);break;default:n("Unsupported browser!")}return u}({window:window}),$e=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Ze=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]o.framesDecodeCount?(n.lts=Date.now(),t.framesDecodeInterval=a,500<=t.framesDecodeInterval&&(t.framesDecodeFreezeTime+=t.framesDecodeInterval)):t.framesDecodeCount0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.videoEncoderConfig.bitrateMax&&"pub"===this.type&&"chrome"===Qe.browserDetails.browser&&((r=n.sdp.split("\r\n")).forEach((function(e,t){/^a=fmtp:\d*/.test(e)&&(r[t]=e+";x-google-min-bitrate="+o.videoEncoderConfig.bitrateMax/2+";")})),n.sdp=r.join("\r\n")),[4,this.pc.setRemoteDescription(new RTCSessionDescription(n))]):[3,3];case 1:return a.sent(),[4,this.pc.createAnswer(t?{iceRestart:t}:{})];case 2:i=a.sent(),this.pc.setLocalDescription(i),this.emit(A.CREATE_ANSWER,JSON.stringify(i)),a.label=3;case 3:return[2]}}))}))},t.prototype.setIceCandidate=function(e){if(this.pc){var t=JSON.parse(e),n=t.sdpMLineIndex,r=t.candidate,i=new RTCIceCandidate({sdpMLineIndex:n,candidate:r});this.pc.addIceCandidate(i)}},t.prototype.updateBandWidth=function(e){return at(this,void 0,void 0,(function(){var t,n;return st(this,(function(r){switch(r.label){case 0:return"pub"!==this.type&&"pubEx"!==this.type?[3,2]:"chrome"===Qe.browserDetails.browser||"safari"===Qe.browserDetails.browser||"firefox"===Qe.browserDetails.browser&&Qe.browserDetails.version>=64&&"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype?(t=this.pc.getSenders()[0],(n=t.getParameters()).encodings||(n.encodings=[{}]),0===e?delete n.encodings[0].maxBitrate:n.encodings[0].maxBitrate=1e3*e,[4,t.setParameters(n).catch((function(e){return console.error(e)}))]):[3,2];case 1:return r.sent(),[2];case 2:return[2]}}))}))},t.prototype._mungeSdpForSimulcasting=function(e){for(var t=e.split("\r\n"),n=!1,r=[-1],i=[-1],o=null,a=null,s=null,c=null,u=-1,d=0;d-1){u=d;break}}else if(n){var f=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(f)r[0]=f[1],i[0]=f[2],t.splice(d,1),d--;else{if(r[0]){if((h=t[d].match("a=ssrc:"+r[0]+" cname:(.+)"))&&(o=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" msid:(.+)"))&&(a=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" mslabel:(.+)"))&&(s=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" label:(.+)"))&&(c=h[1]),0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+r[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(r[0]<0){u=-1,n=!1;for(d=0;d-1){u=d;break}}else if(n){if(r[0]<0){var p=t[d].match(/a=ssrc:(\d+)/);if(p){r[0]=p[1],t.splice(d,1),d--;continue}}else{var h;if((h=t[d].match("a=ssrc:"+r[0]+" cname:(.+)"))&&(o=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" msid:(.+)"))&&(a=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" mslabel:(.+)"))&&(s=h[1]),(h=t[d].match("a=ssrc:"+r[0]+" label:(.+)"))&&(c=h[1]),0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+r[0])){t.splice(d,1),d--;continue}}0!==t[d].length||(t.splice(d,1),d--)}}}if(r[0]<0)return e;u<0&&(u=t.length),r[1]=Math.floor(4294967295*Math.random()),r[2]=Math.floor(4294967295*Math.random()),i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random());for(d=0;d0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gt=function(){for(var e=[],t=0;tthis.audioLevelBase&&(this.audioLevelBase=Math.abs(e[t]),10&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1](e.bitrate||0)&&(e.bitrate=t._encoderConfig.bitrate),(t._encoderConfig.sampleRate||0)>(e.sampleRate||0)&&(e.sampleRate=t._encoderConfig.sampleRate),(t._encoderConfig.sampleSize||0)>(e.sampleSize||0)&&(e.sampleSize=t._encoderConfig.sampleSize),t._encoderConfig.stereo&&(e.stereo=!0))})),this._encoderConfig=e},t.prototype._handleAllAudioTrackMute=function(){for(var e=!0,t=0;t "+n+" * "+r);break;case"stalled":t.videoElementStatus=St.STALLED;break;case"suspend":t.videoElementStatus=St.SUSPEND;break;case"pause":t.videoElementStatus=St.PAUSED;break;case"waiting":t.videoElementStatus=St.WAITING}},this.startGetVideoDimensions=function(){!function e(){t.videoElement&&(40&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Ht=null,Kt=function(){if(Ht)return Ht;try{return Ht=window.require("electron")}catch(e){return null}};function Jt(e,t){return Bt(this,void 0,void 0,(function(){var n;return Gt(this,(function(r){switch(r.label){case 0:return n={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxHeight:t.height,maxWidth:t.width}}},t.frameRate&&"number"!=typeof t.frameRate?(n.video.mandatory.maxFrameRate=t.frameRate.max,n.video.mandatory.minFrameRate=t.frameRate.min):"number"==typeof t.frameRate&&(n.video.mandatory.maxFrameRate=t.frameRate),[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,r.sent()]}}))}))}function zt(e){return Bt(this,void 0,void 0,(function(){var t,n,r;return Gt(this,(function(i){switch(i.label){case 0:t=["window","screen"],"application"!==e&&"window"!==e||(t=["window"]),"screen"===e&&(t=["screen"]),n=Kt(),r=null;try{r=n.desktopCapturer.getSources({types:t})}catch(e){r=null}return r instanceof Promise||(r=new Promise((function(e,r){n.desktopCapturer.getSources({types:t},(function(t,n){t?r(t):e(n)}))}))),[4,r];case 1:return[2,i.sent()]}}))}))}function Yt(e,t){return void 0===t&&(t=!1),Bt(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,u;return Gt(this,(function(d){switch(d.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new x(v.NOT_SUPPORT+"can not find getUserMedia");return t&&(e.video&&(delete e.video.width,delete e.video.height),e.screen&&(delete e.screen.width,delete e.screen.height)),n=Vt,e.audio||e.video||e.screen||e.audioSource||e.videoSource?e.audio||e.video?(r={video:e.video,audio:e.audio},[4,navigator.mediaDevices.getUserMedia(r)]):[3,2]:[3,11];case 1:return i=d.sent(),e.audio&&((o=document.createElement("audio")).autoplay=!0,o.muted=!0,o.setAttribute("muted","muted"),o.setAttribute("autoplay","autoplay"),o.srcObject=new MediaStream([i.getAudioTracks()[0]])),[2,i];case 2:return e.screen?(a=Object.assign({},{width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate}),s=e.screen.electronScreenSourceId||"screen",Kt()?[4,zt(s)]:[3,7]):[3,10];case 3:return(c=d.sent())?[4,(f=c,new Promise((function(e,t){var n=document.createElement("div");n.innerText="share screen",n.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom: solid 1px #B9B8B9;");var r=document.createElement("div");r.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");var i=document.createElement("div");i.innerText="Agora Web Screensharing wants to share the contents of your screen with webdemo.agorabeckon.com. Choose what you'd like to share.",i.setAttribute("style","height: 12%;");var o=document.createElement("div");o.setAttribute("style","width: 100%; height: 80%; background: #FFF; border: solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");var a=document.createElement("div");a.setAttribute("style","text-align: right; padding: 16px 0;");var s=document.createElement("button");s.innerHTML="cancel",s.setAttribute("style","width: 85px;"),s.onclick=function(){document.body.removeChild(c);var e=new Error("NotAllowedError");e.name="NotAllowedError",t(e)},a.appendChild(s),r.appendChild(i),r.appendChild(o),r.appendChild(a);var c=document.createElement("div");c.setAttribute("style","position: absolute; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),c.appendChild(n),c.appendChild(r),document.body.appendChild(c),f.map((function(t){if(t.id){var n=document.createElement("div");n.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;"),n.innerHTML='
'+t.name+"",n.onclick=function(){document.body.removeChild(c),e(t.id)},o.appendChild(n)}}))})))]:[3,6];case 4:return[4,Jt(d.sent(),a)];case 5:return[2,d.sent()];case 6:return[3,9];case 7:return n.getDisplayMedia?(e.screen.mediaSource&&~["screen","window","application"].indexOf(e.screen.mediaSource)&&Object.assign(a,{displaySurface:"screen"===e.screen.mediaSource?"monitor":e.screen.mediaSource}),[4,navigator.mediaDevices.getDisplayMedia({video:a,audio:!!e.screenAudio})]):[3,9];case 8:return[2,d.sent()];case 9:return[3,11];case 10:if(e.audioSource||e.videoSource)return u=new MediaStream,e.audioSource&&u.addTrack(e.audioSource),e.videoSource&&u.addTrack(e.videoSource),[2,u];d.label=11;case 11:return[2]}var f}))}))}function Xt(e,t,n){var r,i,o,a,s=0,c=0,u=0,d=0;if(n&&(n.bitrateMin&&(c=n.bitrateMin),n.bitrateMax&&(s=n.bitrateMax),u=c||0,d=s||0,c>(s=s)&&(c=s),c=c),t){var f=t.frameRate,l=t.height,p=t.width*l,h=[];p<14400||p>=14400&&p<19200?h=[50,100]:p>=19200&&p<32400?h=[64,130]:p>=32400&&p<43200?h=[100,200]:p>=43200&&p<57600?h=[120,240]:p>=57600&&p<76800?h=[140,280]:p>=76800&&p<101760?h=[200,400]:p>=101760&&p<129600?h=[220,440]:p>=129600&&p<172800?h=[260,520]:p>=172800&&p<230400?h=[320,640]:p>=230400&&p<307200?h=[400,800]:p>=307200&&p<407040?h=[500,1e3]:p>=407040&&p<691200?h=[610,1220]:p>=691200&&p<921600?h=[910,1820]:p>=921600&&p<2073600?h=[1130,2260]:p>=2073600&&p<3686400?h=[2080,4160]:p>=3686400&&p<8294400?h=[4850,6500]:p>8294400&&(h=[6500,8910]),c=(r=Wt(function(e,t,n,r){var i,o,a;"rtc"===e||"game"===e?(i=Wt(r,1),a=i[0],(n<=0||n>a)&&(n=a)):(o=Wt(r,2),a=o[1],(n<=0||n>a)&&(n=a));return[30,n]}(e,0,s,h),2))[0],s=r[1],f<10?(c=(i=Wt([c/2,s/2],2))[0],s=i[1]):f>24||f<=30?p<=2073600&&(c=(o=Wt([1.5*c,1.5*s],2))[0],(s=o[1])>6500&&(s=6500)):f>30&&(c=(a=Wt([1.5*c,1.5*s],2))[0],s=a[1])}0!==u&&u0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1;n--)if(r=t._pubTracks[n],~e.indexOf(r)){if("video"===r.trackMediaType){if(this.videoTrack!==r)throw new x(v.INVALID_OPERATION,"You haven't published this track ",r);this.videoTrack.off(A.UPDATE_MUTE_STATE,t._handleVideoTrackEvent),this.videoTrack.off(A.RTC_NEED_RENEGOTIATE,t._handleRTCNeedRenegotiate),this.removeTrack(this.videoTrack),this.peer.removeTrack(this._videoMediaStreamTrack)}else"audio"===r.trackMediaType&&this.audioTrack&&((i=this.audioTrack).removeAudioTrack(r),0===i.trackList.length&&(this.audioTrack.off(A.UPDATE_MUTE_STATE,t._handleAudioTrackEvent),this.removeTrack(i),this.peer.removeTrack(this._audioMediaStreamTrack)));t._pubTracks.splice(n,1)}}else this.audioTrack&&(this.audioTrack.off(A.UPDATE_MUTE_STATE,t._handleAudioTrackEvent),this.audioTrack.removeAllAudioTracks(),this.peer.removeTrack(this._audioMediaStreamTrack)),this.videoTrack&&(this.videoTrack.off(A.UPDATE_MUTE_STATE,t._handleVideoTrackEvent),this.videoTrack.off(A.RTC_NEED_RENEGOTIATE,this._handleRTCNeedRenegotiate),this.peer.removeTrack(this._videoMediaStreamTrack)),this._pubTracks=[],this.removeTrack();return[2,t._pubTracks]}))}))},t.prototype.destory=function(e){void 0===e&&(e=!0),this.removeTracks(),this.removeAllTracks(e),this._closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.type="",this.ID=""},t.prototype._handleRTCNeedRenegotiate=function(){var e=this.videoTrack._encoderConfig.bitrateMax;this.peer.updateBandWidth(e)},t.prototype._handleVideoTrackMuteUpdate=function(e){this.emit(A.UPDATE_MUTE_STATE,this.ID,this.type,this.videoTrack.trackMediaType,e)},t.prototype._handleAudioTrackMuteUpdate=function(e){this.emit(A.UPDATE_MUTE_STATE,this.ID,this.type,this.audioTrack.trackMediaType,e)},t}(_t),ln=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="pubEx",i._createPC(r),i.statsCollector=n,i.statsCollector.addLocalConnection(i),i}return ln(t,e),t.prototype.addTracks=function(e){var t=this;"video"!==e.trackMediaType||this.videoTrack||(this.videoTrack=e,e.getStats=function(){return t.statsCollector.getLocalVideoTrackStats(t.ID)},this._videoMediaStreamTrack=e.getMediaStreamTrack(),this.peer.addTrack(this._videoMediaStreamTrack,e._encoderConfig))},t.prototype.removeTracks=function(e){"video"===e.trackMediaType&&e===this.videoTrack&&(this.videoTrack=void 0,this.peer.removeTrack(this._videoMediaStreamTrack))},t.prototype.destory=function(e){void 0===e&&(e=!0),this.removeTracks(this.videoTrack),this.removeAllTracks(e),this.clearOriginTracks(),this._closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.type="",this.ID=""},t}(_t),hn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._player=void 0,r.trackMediaType="video",r}return hn(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return!!this._player},enumerable:!0,configurable:!0}),t.prototype.play=function(e,t){var n=void 0!==t&&"[object Object]"===Object.prototype.toString.call(t)?t:{};if("string"==typeof e){var r=void 0,i=document.getElementById(e);i?e=i:(r="[track-".concat(this.getTrackId(),'] can not find "#'),T.warning(r.concat(e,'" element, use document.body')),e=document.body)}T.debug("[track-".concat(this.getTrackId(),"] play"));var o=Object.assign({},{},n,{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(o):(this._player=new At(o),this._player.updateVideoTrack(this._mediaStreamTrack)),"playing"!==this._player._playervideoElementStatus&&this._player.play()},t.prototype.stop=function(){this._player&&(this._player.destroy(),this._player=void 0)},t.prototype.getStats=function(){},t}(z),mn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_n=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.trackMediaType="audio",document.createElement("audio").srcObject=new MediaStream([t]),r._context=Et.getAudioContextInstance();var i=r._context.createMediaStreamSource(new MediaStream([t]));return Et.addSourceNode(n,i),r}return mn(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){throw new Error("Method not implemented.")},enumerable:!0,configurable:!0}),t.prototype.play=function(){Et.getSourceNode(this.getTrackId()).startPlay()},t.prototype.stop=function(){Et.getSourceNode(this.getTrackId()).stopPlay()},t.prototype.setVolume=function(e){Et.getGainNode(this.getTrackId()).gain.setValueAtTime(e/1e3,this._context.currentTime)},t.prototype.getVolumeLevel=function(){return Et.getGainNode(this.getTrackId()).gain.value},t.prototype.getStats=function(){},t}(z),yn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gn=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="sub",i._createPC(r),i.statsCollector=n,i.statsCollector.addRemoteConnection(i),i}return yn(t,e),t.prototype.addTracks=function(e){if("video"===e){var t=this._videoMediaStreamTrack,n=new vn(t,y(5));return this.addTrack(n),this.videoTrack}var r=this._audioMediaStreamTrack,i=new _n(r,y(5));this.addTrack(i);var o=document.createElement("audio");return o.autoplay=!0,o.muted=!0,o.setAttribute("muted","muted"),o.setAttribute("autoplay","autoplay"),o.srcObject=new MediaStream([r]),this.audioTrack},t.prototype.removeTracks=function(e){"video"===e?this.removeTrack(this.videoTrack):this.removeTrack(this.audioTrack)},t.prototype.destory=function(e){void 0===e&&(e=!0),this.removeAllTracks(e),this.clearOriginTracks(),this._closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.type="",this.ID=""},t}(_t),Sn={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0},En={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0},Tn={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0},Cn={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0},bn=function(){function e(e){this.clientId="",this.localConnectionsMap=new Map,this.remoteConnectionsMap=new Map,this.clientId=e,this.updateStatsInterval=window.setInterval(this.updateStats.bind(this),1e3)}return e.prototype.updateStats=function(){this.remoteConnectionsMap.forEach((function(e){var t=e.audioStats,n=e.videoStats,r=e.pcStats,i=Object.assign({},Sn),o=Object.assign({},En),a=e.connection.peer.getStats();if(a){var s=a.audioRecv[0],c=a.videoRecv[0];r&&r.videoRecv[0];s&&("opus"!==s.codec&&"aac"!==s.codec||(i.codecType=s.codec),s.outputLevel?i.receiveLevel=Math.round(32767*s.outputLevel):e.connection.audioTrack&&(i.receiveLevel=Math.round(32767*e.connection.audioTrack.getVolumeLevel())),i.receiveBytes=s.bytes,i.receivePackets=s.packets,i.receivePacketsLost=s.packetsLost,i.packetLossRate=i.receivePacketsLost/i.receivePackets,i.receiveBitrate=t?8*Math.max(0,i.receiveBytes-t.receiveBytes):0,i.totalDuration=t?t.totalDuration+1:1,i.totalFreezeTime=t?t.totalFreezeTime:0,i.freezeRate=i.totalFreezeTime/i.totalDuration,i.receiveDelay=s.jitterBufferMs),c&&("H264"!==c.codec&&"VP8"!==c.codec||(o.codecType=c.codec),o.receiveBytes=c.bytes,o.receiveBitrate=n?8*Math.max(0,o.receiveBytes-n.receiveBytes):0,o.decodeFrameRate=c.decodeFrameRate,o.renderFrameRate=c.decodeFrameRate,c.outputFrame&&(o.renderFrameRate=c.outputFrame.frameRate),c.receivedFrame?(o.receiveFrameRate=c.receivedFrame.frameRate,o.receiveResolutionHeight=c.receivedFrame.height,o.receiveResolutionWidth=c.receivedFrame.width):e.connection.videoTrack&&(o.receiveResolutionHeight=e.connection.videoTrack._videoHeight||0,o.receiveResolutionHeight=e.connection.videoTrack._videoWidth||0),void 0!==c.framesRateFirefox&&(o.receiveFrameRate=Math.round(c.framesRateFirefox)),o.receivePackets=c.packets,o.receivePacketsLost=c.packetsLost,o.packetLossRate=o.receivePacketsLost/o.receivePackets,o.totalDuration=n?n.totalDuration+1:1,o.totalFreezeTime=n?n.totalFreezeTime:0,o.receiveDelay=c.jitterBufferMs||0,o.freezeRate=o.totalFreezeTime/o.totalDuration),e.audioStats=i,e.videoStats=o,e.pcStats=a}})),this.localConnectionsMap.forEach((function(e){var t=e.audioStats,n=e.videoStats,r=Object.assign({},Tn),i=Object.assign({},Cn),o=e.connection.peer.getStats();if(o){var a=o.audioSend[0],s=o.videoSend[0];a&&("opus"!==a.codec&&"aac"!==a.codec||(r.codecType=a.codec),a.inputLevel?r.sendVolumeLevel=Math.round(32767*a.inputLevel):e.connection.audioTrack&&(r.sendVolumeLevel=Math.round(32767*e.connection.audioTrack.getVolumeLevel())),r.sendBytes=a.bytes,r.sendPackets=a.packets,r.sendPacketsLost=a.packetsLost,r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0),s&&("H264"!==s.codec&&"VP8"!==s.codec||(i.codecType=s.codec),i.sendBytes=s.bytes,i.sendBitrate=n?8*Math.max(0,i.sendBytes-n.sendBytes):0,s.inputFrame?(i.captureFrameRate=s.inputFrame.frameRate,i.captureResolutionHeight=s.inputFrame.height,i.captureResolutionWidth=s.inputFrame.width):e.connection.videoTrack&&(i.captureResolutionWidth=e.connection.videoTrack._videoWidth||0,i.captureResolutionHeight=e.connection.videoTrack._videoHeight||0),s.sentFrame?(i.sendFrameRate=s.sentFrame.frameRate,i.sendResolutionHeight=s.sentFrame.height,i.sendResolutionWidth=s.sentFrame.width):e.connection.videoTrack&&(i.sendResolutionWidth=e.connection.videoTrack._videoWidth||0,i.sendResolutionHeight=e.connection.videoTrack._videoHeight||0),s.avgEncodeMs&&(i.encodeDelay=s.avgEncodeMs),e.connection.videoTrack&&e.connection.videoTrack._encoderConfig&&e.connection.videoTrack._encoderConfig.bitrateMax&&(i.targetSendBitrate=1e3*e.connection.videoTrack._encoderConfig.bitrateMax),i.sendPackets=s.packets,i.sendPacketsLost=s.packetsLost,i.totalDuration=n?n.totalDuration+1:1,i.totalFreezeTime=n?n.totalFreezeTime:0),e.audioStats=r,e.videoStats=i}}))},e.prototype.getLocalAudioTrackStats=function(e){var t=this.localConnectionsMap.get(e);return t&&t.audioStats?t.audioStats:Object.assign({},Tn)},e.prototype.getLocalVideoTrackStats=function(e){var t=this.localConnectionsMap.get(e);return t&&t.videoStats?t.videoStats:Object.assign({},Cn)},e.prototype.getRemoteAudioTrackStats=function(e){var t=this.remoteConnectionsMap.get(e);return t&&t.audioStats?t.audioStats:Object.assign({},Sn)},e.prototype.getRemoteVideoTrackStats=function(e){var t=this.remoteConnectionsMap.get(e);return t&&t.videoStats?t.videoStats:Object.assign({},En)},e.prototype.getRTCStats=function(){var e=0,t=0,n=0,r=0;this.localConnectionsMap.forEach((function(n){n.audioStats&&(e+=n.audioStats.sendBytes,t+=n.audioStats.sendBitrate),n.videoStats&&(e+=n.videoStats.sendBytes,t+=n.videoStats.sendBitrate)})),this.remoteConnectionsMap.forEach((function(e){e.audioStats&&(r+=e.audioStats.receiveBytes,n+=e.audioStats.receiveBitrate),e.videoStats&&(r+=e.videoStats.receiveBytes,n+=e.videoStats.receiveBitrate)}));return{Duration:0,UserCount:1,SendBitrate:t,SendBytes:e,RecvBytes:r,RecvBitrate:n,OutgoingAvailableBandwidth:0,RTT:0}},e.prototype.removeConnection=function(e){this.localConnectionsMap.delete(e),this.remoteConnectionsMap.delete(e)},e.prototype.addLocalConnection=function(e){var t=e.ID;this.localConnectionsMap.has(t)||this.localConnectionsMap.set(t,{connection:e})},e.prototype.addRemoteConnection=function(e){var t=e.ID;this.remoteConnectionsMap.has(t)||this.remoteConnectionsMap.set(t,{connection:e})},e.prototype.updateTrafficStats=function(e){},e.prototype.updateUplinkStats=function(e){},e.prototype.isLocalVideoFreeze=function(e,t){var n=!!t&&e.framesDecodeFreezeTime>t.framesDecodeFreezeTime,r=!t||e.framesDecodeCount>t.framesDecodeCount;return n||!r},e.prototype.isRemoteAudioFreeze=function(e){},e.prototype.clear=function(){clearInterval(this.updateStatsInterval),this.clientId="",this.localConnectionsMap=new Map,this.remoteConnectionsMap=new Map},e}(),Rn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},In=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){e.UN_PUBLISH="UN_PUBLISH",e.PUBLISH="PUBLISH",e.RE_PUBLISH="RE_PUBLISH"}(nn||(nn={}));var An,Nn,Dn=function(e){function t(t){var n=e.call(this)||this;if(n.channelName=void 0,n.connectionState="DISCONNECTED",n.remoteUsers=[],n.uid="",n.localTracks=[],n._isStringUID=!0,n._turnServer=void 0,n._isDualStreamEnabled=!1,n._clientId="",n._sessionId="",n._useWss=!0,n._config={forceWaitGatewayResponse:!0,mode:"rtc",codec:"h264",role:"host"},n._joinInfo={},n._appId="",n._highStream=void 0,n._lowStream=void 0,n._latestRepInfo={},n._AVStatsControlls=void 0,n._reportStatsInterval=0,n._statsCollector=void 0,n._latestEventLts={},n._subPeerAVStats={},t){t.codec;var r=t.mode,i=t.role;"live"!==r||i||(t.role="audience"),n._config=Object.assign(n._config,t),"rtc"===r&&(n._config.role="host"),n._config.codec="h264",T.info("["+n._clientId+"] Initializing ArRTC client, mode: "+n._config.mode+", codec: "+n._config.codec)}return n._clientId=y(5),n._setAVStatsRepTimer(),n}return Rn(t,e),t.prototype.join=function(e,t,n,r){var i=this,o=this;o._latestEventLts.joinStartTime=Date.now();return new Promise((function(a,s){return wn(i,void 0,void 0,(function(){var i,s,c;return In(this,(function(u){switch(u.label){case 0:if("DISCONNECTED"!==o.connectionState)throw new x(v.INVALID_OPERATION,"join failure Cause of current server state is "+o.connectionState);if("string"!=typeof e)throw new TypeError("appid must be string.");if(""===e)throw new TypeError("appid can not be empty.");if(o._appId=e,o._joinInfo.appId,i=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof t)throw new TypeError("channel must be string.");if(!i.test(t))throw new x(v.INVALID_PARAMS,"The length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,");if(o.channelName=t,s=/^[a-zA-Z0-9]{1,48}$/,""!==r&&null!=r&&!s.test(r))throw new x(v.INVALID_PARAMS,"The length must be within 48 bytes. The supported characters: a-z,A-Z,0-9");return o._createMediaServerIntance(),o._joinInfo.sid=y(32),n&&(o._joinInfo.token=n),[4,o._authGateWay(r,n).catch((function(e){switch(e){case"CHANNEL_BANNED":case"IP_BANNED":case"SERVER_ERROR":case"UID_BANNED":case"DEVELOPER_INVALID":case"APP_INVALID":case"TOKEN_INVALID":o.emit("connection-state-change","DISCONNECTING","CONNECTING",f[e]);break;case"TOKEN_EXPIRED":o.emit("token-privilege-did-expire"),T.debug("token privilege has expire")}T.error(e)}))];case 1:return(c=u.sent())&&(this._statsCollector=new bn(this._clientId),a(c)),[2]}}))}))}))},t.prototype.leave=function(){var e=this;return new Promise((function(t,n){var r,i,o;return wn(this,void 0,void 0,(function(){var a;return In(this,(function(s){switch(s.label){case 0:return Object.keys(e._joinInfo).length>0?("CONNECTED"===e.connectionState&&(null===(r=e._gateway)||void 0===r||r.doOffline(e._joinInfo.sid),null===(i=e._gateway)||void 0===i||i.disconnectCTS(),e.connectionState="DISCONNECTED",null===(o=e._gateway)||void 0===o||o.removeAllListeners(),e._gateway=void 0),e.remoteUsers.map((function(t,n){t._mediaStream&&t._mediaStream.destory(),e._unsubscribe(t)})),e._subPeerAVStats={},e._sessionId="",e.remoteUsers=[],e._msSub=[],e.uid="",e._joinInfo={},e._statsCollector&&e._statsCollector.clear(),e._highStream?[4,e.unpublish()]:[3,2]):[3,3];case 1:s.sent(),s.label=2;case 2:return a=Date.now(),it.leave(e._joinInfo.sid,{startTime:a,extend:null}),t(),[2];case 3:return n(),[2]}}))}))}))},t.prototype.publish=function(e){var t=this,n=this;return new Promise((function(r,i){return wn(t,void 0,void 0,(function(){var t,o,a,s,c,u,d,f,l,p,h,m,_,y,g,S,E,C,b,R,w,I,O,A,N,D,P,k,L,M,U,F,j;return In(this,(function(V){switch(V.label){case 0:if(n._latestEventLts.publishStartLts=Date.now(),"CONNECTED"!==n.connectionState)throw new x(v.INVALID_OPERATION,"Can't publish stream when connection state is not connected");if(t=[],e instanceof Array)t=e;else{if(!(e instanceof K))throw new x(v.INVALID_PARAMS,"track must be LocalTrack");t=[e]}if(0===(t=t.filter((function(e){return e instanceof K}))).length)throw new x(v.INVALID_PARAMS,"track list is empty");if("live"===n._config.mode&&"audience"===n._config.role)throw new x(v.INVALID_OPERATION,"audience can not publish stream");return o=n._highStream||{},a=o.videoTrack,s=o.audioTrack,[4,n._publishHighStream(t)];case 1:return c=V.sent(),u=n._highStream,d=u.videoTrack,f=u.audioTrack,l=!!d,p=!!f,0!==n.localTracks.length?[3,3]:(d&&(h=d.getMediaStreamTrack(),m=d.getEncoderConfig(),(_=function(e){return e instanceof MediaStreamTrack?e.getSettings():null}(h))&&Xt(n._config.mode,_,m)),[4,null===(O=n._gateway)||void 0===O?void 0:O.doPublish({LocalAudioEnable:p,LocalVideoEnable:l,LocalAudioMute:!!p&&!f._enabled,LocalVideoMute:!!l&&!d._enabled,DualStream:n._isDualStreamEnabled},n._turnServer)]);case 2:return y=V.sent(),0===(R=y.Code)?(g={startTime:n._latestEventLts.publishStartLts,success:!0,cameraDeviceId:n._highStream.videoTrack?n._highStream.videoTrack.getMediaStreamTrack().label:"",microphoneDeviceId:n._highStream.audioTrack?n._highStream.audioTrack.getMediaStreamTrack().label:""},0===R?(y.StreamId,w=y.Offer,I=n._highStream.peer,g.success=!0,I.createAnswer(w),n._isDualStreamEnabled&&(n._publishLowStream(),null===(A=n._gateway)||void 0===A||A.doPublishS(n._turnServer),null===(N=n._gateway)||void 0===N||N.enableDualStream(!0)),n.localTracks=c):g.success=!1,it.publish(n._joinInfo.sid,g),r()):T.error("publish failure, need republish"),[3,6];case 3:return n._highStream&&(null===(D=n._highStream.peer)||void 0===D?void 0:D.pc)&&(S=null===(k=null===(P=n._highStream.peer)||void 0===P?void 0:P.pc)||void 0===k?void 0:k.getTransceivers())?(E=S.filter((function(e){return"video"===e.mid})),C=S.filter((function(e){return"audio"===e.mid})),E.length>0&&"inactive"===(null===(L=E[0])||void 0===L?void 0:L.currentDirection)||C.length>0&&"inactive"===(null===(M=C[0])||void 0===M?void 0:M.currentDirection)?[4,null===(U=n._gateway)||void 0===U?void 0:U.doRePublish({LocalAudioEnable:p,LocalVideoEnable:l,LocalAudioMute:!!p&&!f._enabled,LocalVideoMute:!!l&&!d._enabled,DualStream:n._isDualStreamEnabled})]:[3,5]):[3,6];case 4:return(b=V.sent())&&(R=b.Code,b.StreamId,w=b.Offer,0===R?((I=n._highStream.peer).createAnswer(w,!0),r()):i()),[3,6];case 5:p!==!!s&&(null===(F=n._gateway)||void 0===F||F.enableLocalAudio(p)),l!==!!a&&(null===(j=n._gateway)||void 0===j||j.enableLocalVideo(l)),V.label=6;case 6:return[2]}}))}))}))},t.prototype.unpublish=function(e){var t;return wn(this,void 0,void 0,(function(){var n,r,i,o=this;return In(this,(function(a){switch(a.label){case 0:if(!(n=this)._highStream)throw new x(v.INVALID_OPERATION,"You haven't published track yet");return r=[],e&&e instanceof K?r=[e]:e instanceof Array&&(r=e),r=r.filter((function(e){return e instanceof K})),void 0!==e&&JSON.stringify(r)!==JSON.stringify(n.localTracks)?[3,2]:(r=n.localTracks,i=n,[4,n._highStream.removeTracks(r)]);case 1:return i.localTracks=a.sent(),null===(t=n._gateway)||void 0===t||t.doUnPublish(),n._isDualStreamEnabled&&(n.disableDualStream(),n._lowStream&&n._lowStream.destory()),n._highStream.destory(),n._highStream.clearOriginTracks(),n._highStream=void 0,[3,3];case 2:r.map((function(e){return wn(o,void 0,void 0,(function(){var t,r,i,o;return In(this,(function(a){switch(a.label){case 0:return~n.localTracks.indexOf(e)?e instanceof Rt?(t=n,[4,n._highStream.removeTracks(e)]):[3,2]:[3,4];case 1:t.localTracks=a.sent(),0===n.localTracks.filter((function(e){return e instanceof Rt})).length&&(null===(i=n._gateway)||void 0===i||i.enableLocalAudio(!1)),a.label=2;case 2:return e instanceof sn?(r=n,[4,n._highStream.removeTracks(e)]):[3,4];case 3:r.localTracks=a.sent(),0===n.localTracks.filter((function(e){return e instanceof sn})).length&&(null===(o=n._gateway)||void 0===o||o.enableLocalVideo(!1)),n._isDualStreamEnabled&&(n.disableDualStream(),n._lowStream&&n._lowStream.destory()),a.label=4;case 4:return[2]}}))}))})),a.label=3;case 3:return[2]}}))}))},t.prototype.subscribe=function(e,t){var n=this,r=this;return new Promise((function(i,o){return wn(n,void 0,void 0,(function(){var n,o,a,s,c,u,d,f,l;return In(this,(function(p){if(!r._gateway)throw new x(v.INVALID_OPERATION,"call this api before join");if(!(n=r.remoteUsers.find((function(t){return t.uid===e.uid}))))throw new x("user "+e.uid+" is not find");if("video"!==t&&"audio"!==t)throw new x(v.INVALID_PARAMS,"mediaType must be 'video' or 'audio'");return o=n.hasVideo,a=n.hasAudio,s=o&&"video"===t,c=a&&"audio"===t,r._subPeerAVStats[e.uid]?(null===(d=r._gateway)||void 0===d||d.setAVStatus(e.uid,a,o),"video"===t?r._subPeerAVStats[e.uid].subscribeVideo=!0:"audio"===t&&(r._subPeerAVStats[e.uid].subscribeAudio=!0)):(r._subPeerAVStats[e.uid]={subscribeVideo:s,subscribeAudio:c,_originAudioTrack:null,_originVideoTrack:null},r._latestEventLts.subscribeStartLts=Date.now(),null===(u=r._gateway)||void 0===u||u.doSubscribe({StreamId:e.uid,SvrIp:r._msSub[0].ip,SvrPort:r._msSub[0].port,RecvAudio:c,RecvVideo:s,StrmType:n._subStreamType,PubSessId:n._pubSid,VideoCache:n._videoCache})),c&&((null===(f=n._mediaStream)||void 0===f?void 0:f._audioMediaStreamTrack)?(n.audioTrack||(n.audioTrack=n._mediaStream.addTracks("audio")),i()):Object.defineProperty(n,"_audioMediaStreamTrack",{enumerable:!0,configurable:!0,set:function(e){this.audioTrack=n._mediaStream.addTracks("audio"),i()}})),s&&((null===(l=n._mediaStream)||void 0===l?void 0:l._videoMediaStreamTrack)?(n.videoTrack||(n.videoTrack=n._mediaStream.addTracks("video")),i()):Object.defineProperty(n,"_videoMediaStreamTrack",{enumerable:!0,configurable:!0,set:function(e){this.videoTrack=n._mediaStream.addTracks("video"),i()}})),[2]}))}))}))},t.prototype.unsubscribe=function(e,t){var n=this;return new Promise((function(r,i){var o,a,s=n._unsubscribe(e,t);s.hasAudio||s.hasVideo?(null===(a=n._gateway)||void 0===a||a.setAVStatus(s.uid,s.hasAudio,s.hasVideo),"video"===t?n._subPeerAVStats[e.uid].subscribeVideo=!1:"audio"===t&&(n._subPeerAVStats[e.uid].subscribeAudio=!1)):(null===(o=n._gateway)||void 0===o||o.doUnSubscribe(s.uid),s._mediaStream.destory(),s._mediaStream=null,delete n._subPeerAVStats[e.uid]);r()}))},t.prototype.setLowStreamParameter=function(e){if(!e)throw new x(v.INVALID_PARAMS,"streamParameter must be object");if(this._isDualStreamEnabled&&this._lowStream){var t={};e.framerate&&(t.frameRate=e.framerate>15?15:e.framerate),e.height&&(t.height=e.height),e.width&&(t.width=e.width),this._lowStream._videoMediaStreamTrack.applyConstraints(t)}},t.prototype.enableDualStream=function(){return wn(this,void 0,void 0,(function(){var e,t=this;return In(this,(function(n){return e=this,[2,new Promise((function(n,r){return wn(t,void 0,void 0,(function(){var t,n;return In(this,(function(r){if(!0===e._isDualStreamEnabled)return T.warning(v.INVALID_OPERATION,"Already enabled."),[2];if(e._isDualStreamEnabled=!0,"{}"!==JSON.stringify(e._joinInfo)&&"CONNECTED"===e.connectionState){if(!e._highStream||!e._highStream.videoTrack)throw new x(v.INVALID_OPERATION,"Can't publish low stream cause of you did not publish high stream");e._publishLowStream(),null===(t=e._gateway)||void 0===t||t.doPublishS(e._turnServer),null===(n=e._gateway)||void 0===n||n.enableDualStream(!0)}return[2]}))}))}))]}))}))},t.prototype.disableDualStream=function(){var e=this;return new Promise((function(t,n){var r,i;!1!==e._isDualStreamEnabled?(e._isDualStreamEnabled=!1,null===(r=e._gateway)||void 0===r||r.doUnPublishS(),null===(i=e._gateway)||void 0===i||i.enableDualStream(!1)):T.warning(v.INVALID_OPERATION,"Already disabled.")}))},t.prototype.setParameters=function(e){return wn(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return In(this,(function(c){return t=this,n=e.ConfPriCloudAddr,r=e.SetTurnSvr,i=e.ConfPriEventAddr,n&&(a=n.ServerAdd,s=n.Port,o=n.Wss,t._useWss="boolean"!=typeof o||o,a&&(m.GATEWAY_ADDRESS=t._useWss?"https://"+a:"http://"+a+(s?":"+s:""))),~m.GATEWAY_ADDRESS.indexOf(m.EVENT_REPORT_DOMAIN)||it.setBasicUrl("",""),r&&(t._turnServer=r),i&&(a=i.ServerAdd,s=i.Port,a&&it.setBasicUrl(a,a)),[2]}))}))},t.prototype.setClientRole=function(e){var t;return wn(this,void 0,void 0,(function(){var n;return In(this,(function(r){if("rtc"===(n=this)._config.mode)throw T.warning("rtc mode can not use setClientRole"),new x(v.INVALID_OPERATION,"rtc mode can not use setClientRole");if("audience"===e&&n._highStream)throw new x(v.INVALID_OPERATION,"can not set client role to audience when publishing stream");return e!==n._config.role&&(n._config.role=e,null===(t=n._gateway)||void 0===t||t.setClientRole(e)),[2]}))}))},t.prototype.setProxyServer=function(){},t.prototype.startProxyServer=function(){},t.prototype.stopProxyServer=function(){},t.prototype.setRemoteVideoStreamType=function(e,t){var n=this;return new Promise((function(r,i){var o,a=n.remoteUsers.find((function(t){return t.uid===e}));if(!a)throw T.warning("can not find remote user "+e),new x(v.INVALID_PARAMS,"can not find remote user "+e);if("number"!=typeof t)throw new x(v.INVALID_PARAMS,"streamType must be number");if(!a._dualStream)throw new x(v.INVALID_OPERATION,"The remote user "+e+" did not enable the dual stream");(null==a?void 0:a.hasVideo)?(null===(o=n._gateway)||void 0===o||o.setRemoteVStrmType(e,t),n.emit("stream-type-changed",e,t)):a._subStreamType=t}))},t.prototype.setStreamFallbackOption=function(e,t){return new Promise((function(e,t){}))},t.prototype.setEncryptionConfig=function(e,t){},t.prototype.renewToken=function(e){var t=this;return new Promise((function(n,r){var i;if("CONNECTED"!==t.connectionState)throw new x(v.INVALID_OPERATION,"renewToken should not be called before user join");null===(i=t._gateway)||void 0===i||i.doReNewToken(e)}))},t.prototype.enableAudioVolumeIndicator=function(){},t.prototype.getRTCStats=function(){var e;return null===(e=this._statsCollector)||void 0===e?void 0:e.getRTCStats()},t.prototype.setLiveTranscoding=function(e){return new Promise((function(e,t){}))},t.prototype.startLiveStreaming=function(e,t){return new Promise((function(e,t){}))},t.prototype.stopLiveStreaming=function(e){return new Promise((function(e,t){}))},t.prototype.addInjectStreamUrl=function(e,t){return new Promise((function(e,t){}))},t.prototype.removeInjectStreamUrl=function(){return new Promise((function(e,t){}))},t.prototype.startChannelMediaRelay=function(e){return new Promise((function(e,t){}))},t.prototype.updateChannelMediaRelay=function(e){return new Promise((function(e,t){}))},t.prototype.stopChannelMediaRelay=function(){return new Promise((function(e,t){}))},t.prototype._authGateWay=function(e,t){var n;return wn(this,void 0,void 0,(function(){var r,i,o,a,s,c,u,d;return In(this,(function(f){switch(f.label){case 0:return r=this,[4,w.joinGateway({sid:r._joinInfo.sid,appId:r._appId,cname:r.channelName,uid:e||"",token:t||"",extend:"",proxyServer:"",wss:r._useWss})];case 1:if(!(i=f.sent()))return[3,4];if(o=i.code,a=i.session_id,s=i.addresses,a&&(r._sessionId=a,it.sessionInit(r._joinInfo.sid,{cname:r.channelName,appid:r._appId,mode:"rtc"===r._config.mode?0:"live"===r._config.mode?1:"game"===r._config.mode&&2,role:r._config.role,code:o})),!s||s instanceof Array&&0===s.length)throw new x("Can not find service list");return r._msSub=s.filter((function(e){return 1===e.type})),[4,r._connectMediaServer(i)];case 2:return f.sent(),c={ChanId:r.channelName,ChanSId:r._sessionId,UserId:e,UserSId:r._joinInfo.sid,SdkVer:m.SDK_VERSION,VCodec:r._config.codec,ACodec:"opus",Role:r._config.role,AcsToken:t||""},u=Date.now(),[4,null===(n=r._gateway)||void 0===n?void 0:n.doOnline(c)];case 3:return d=f.sent(),it.joinGateway(r._joinInfo.sid,{joinStartTime:r._latestEventLts.joinStartTime,startTime:u,uid:d,cid:r._joinInfo.cid,extend:null,success:!0}),r.uid=d,Object.assign(r._joinInfo,{apResponse:i,clientId:r._clientId,appId:r._appId,cname:r.channelName,uid:r.uid,turnServer:{},proxyServer:void 0,token:t||r._appId,useProxyServer:!1,startTime:Date.now()}),[2,r.uid];case 4:return[2]}}))}))},t.prototype._connectMediaServer=function(e){return wn(this,void 0,void 0,(function(){var t,n,r,i;return In(this,(function(o){return t=this,n=e.addresses,e.detail[8],r=Date.now(),i=n.filter((function(e){return 0===e.type})),[2,new Promise((function(o,a){var s,c,u,d,l;return wn(this,void 0,void 0,(function(){var p,h,_,y,g,S,E,C;return In(this,(function(b){switch(b.label){case 0:if(p=!1,!(i.length>0))return[3,9];b.label=1;case 1:b.trys.push([1,6,7,8]),h=On(i),_=h.next(),b.label=2;case 2:return _.done?[3,5]:(y=_.value,T.debug("begin connect media server ",y),null===(s=t._gateway)||void 0===s||s.setAppInfo({appId:t._appId}),null===(c=t._gateway)||void 0===c||c.configServer(t._useWss,y.ip,y.port),[4,null===(u=t._gateway)||void 0===u?void 0:u.connectCTS()]);case 3:return b.sent(),o(),p=!0,g=Date.now(),it.chooseServer(t._joinInfo.sid,{startTime:r,success:!0,uid:t._joinInfo.uid,cid:"",elapse:g-t._latestEventLts.joinStartTime,extend:null,eventElapse:g-r,chooseServer:{},serverList:n,errorCode:"NETWORK_ERROR"}),[3,5];case 4:return _=h.next(),[3,2];case 5:return[3,8];case 6:return S=b.sent(),E={error:S},[3,8];case 7:try{_&&!_.done&&(C=h.return)&&C.call(h)}finally{if(E)throw E.error}return[7];case 8:return p||(Date.now()-(null===(d=t._gateway)||void 0===d?void 0:d._connectBeginTime)0){var e=[];e=e.concat(this.localTracks),this._highStream.destory(!1),this._highStream=void 0,this.localTracks=[],this.publish(e),this._lowStream&&(this._lowStream.destory(),this._lowStream=void 0,this._isDualStreamEnabled?this.enableDualStream():this.disableDualStream())}},t.prototype._resubscribe=function(e){return wn(this,void 0,void 0,(function(){var t,n,r,i;return In(this,(function(o){switch(o.label){case 0:return n=(t=this).remoteUsers.find((function(t){return t.uid===e})),r=!!n.hasVideo,i=!!n.hasAudio,n?(r&&t.emit("user-unpublished",n,"video"),i&&t.emit("user-unpublished",n,"audio"),n.videoTrack||n.audioTrack?[4,t.unsubscribe(n)]:[3,2]):[3,3];case 1:o.sent(),o.label=2;case 2:n.hasAudio=i,n.hasVideo=r,n.hasVideo&&t.emit("user-published",n,"video"),n.hasAudio&&t.emit("user-published",n,"audio"),o.label=3;case 3:return[2]}}))}))},t.prototype._publishHighStream=function(e){return wn(this,void 0,void 0,(function(){var t;return In(this,(function(n){switch(n.label){case 0:return(t=this)._joinInfo&&"CONNECTED"===t.connectionState?(t._highStream||(t._highStream=new fn(t.uid,t._statsCollector,t._joinInfo),t._highStream.on(A.CONNECTION_STATE_CHANGE,t._handlePeerConnectionEvent.bind(t,A.CONNECTION_STATE_CHANGE)),t._highStream.on(A.ICE_CONNECTION_STATE_CHANGE,t._handlePeerConnectionEvent.bind(t,A.ICE_CONNECTION_STATE_CHANGE)),t._highStream.on(A.ICE_CANDIDATE,t._handlePeerConnectionEvent.bind(t,A.ICE_CANDIDATE)),t._highStream.on(A.CREATE_ANSWER,t._handlePeerConnectionEvent.bind(t,A.CREATE_ANSWER)),t._highStream.on(A.UPDATE_MUTE_STATE,(function(e,n,r,i){var o,a;"pub"===n&&("audio"===r?null===(o=t._gateway)||void 0===o||o.muteLocalAudioStream(!i):"video"===r&&(null===(a=t._gateway)||void 0===a||a.muteLocalVideoStream(!i)))})),t._highStream.on(A.FIRST_FRAME_DECODED,(function(){t._setAVStatsRepTimer()})),t._highStream.on(A.VIDEO_SIZE_CHANGE,(function(){t._setAVStatsRepTimer()}))),[4,t._highStream.addTracks(e)]):[3,2];case 1:return[2,n.sent()];case 2:throw new x(v.INVALID_OPERATION,"Can't publish stream when connection state is not connected")}}))}))},t.prototype._publishLowStream=function(){this._lowStream=new pn(this.uid,this._statsCollector,this._joinInfo),this._lowStream.on(A.CONNECTION_STATE_CHANGE,this._handlePeerConnectionEvent.bind(this,A.CONNECTION_STATE_CHANGE)),this._lowStream.on(A.ICE_CONNECTION_STATE_CHANGE,this._handlePeerConnectionEvent.bind(this,A.ICE_CONNECTION_STATE_CHANGE)),this._lowStream.on(A.ICE_CANDIDATE,this._handlePeerConnectionEvent.bind(this,A.ICE_CANDIDATE)),this._lowStream.on(A.CREATE_ANSWER,this._handlePeerConnectionEvent.bind(this,A.CREATE_ANSWER));var e=this._highStream.videoTrack.getMediaStreamTrack(),t=new sn(e,this._highStream.videoTrack.encoderConfig?this._highStream.videoTrack.encoderConfig:{},y(5));return this._lowStream.addTracks(t),this.setLowStreamParameter({width:320,height:240,framerate:15}),this._lowStream},t.prototype._createLiveStreamingClient=function(){},t.prototype._createChannelMediaRelayClient=function(){},t.prototype._handleDeviceEvents=function(){},t.prototype._handleRVChange=function(){},t.prototype._calculate=function(){var e=this;if("CONNECTED"===e.connectionState){var t=0,n=0,r=Object.keys(e._subPeerAVStats);if(r.length>0)r.map((function(r){var i,o=e._subPeerAVStats[r],a=0;if(o.subscribeAudio&&t++,o.subscribeVideo){var s=null===(i=e._statsCollector)||void 0===i?void 0:i.getRemoteVideoTrackStats(r);a=s.receiveResolutionWidth*s.receiveResolutionHeight}n+=a}));else if(e.localTracks.length>0)e.localTracks.find((function(e){return e instanceof Rt}))&&(t+=1);e._repRes(t,n)}},t.prototype._repRes=function(e,t){var n=this._latestRepInfo.lts,r={audioNumber:e,videoSize:t,lts:Date.now()};this._gateway&&this._gateway.reportAVStat({TimeUsed:r.lts-n||0,AudNum:r.audioNumber,VidSize:r.videoSize}),this._latestRepInfo=r},t.prototype._setAVStatsRepTimer=function(){var e=this;e._clearAVStatsRepTimer(),e._AVStatsControlls=setInterval((function(){e._calculate()}),1e4),e._calculate()},t.prototype._clearAVStatsRepTimer=function(){this._AVStatsControlls&&clearInterval(this._AVStatsControlls)},t.prototype._createMediaServerIntance=function(){var e=this;e._gateway||(e._gateway=new k),e._gateway.handleMediaServerEvents=function(t,n){var r,i,o,a,s,c,u,d,f=n.Code;switch(t){case"connection-state-change":var l=n.curState,p=n.revState,h=n.reason;if(T.warning("connection-state-change",e.connectionState,l,p,h),e.connectionState===l)return;e.connectionState=l,e.emit("connection-state-change",l,p,h);var v=0;switch(e.connectionState){case"CONNECTING":v=0;break;case"RECONNECTING":v=2;break;case"CONNECTED":v=1;break;case"DISCONNECTING":case"DISCONNECTED":v=4}var m=Date.now();it.serverConnectionState(e._joinInfo.sid,{startTime:m,extend:{currentState:v}}),"DISCONNECTED"===l||"RECONNECTING"===l&&(e.remoteUsers.map((function(t){t._mediaStream&&t._mediaStream.destory(),e._unsubscribe(t);var n=e._subPeerAVStats[t.uid];n&&(n.subscribeAudio&&e.emit("user-unpublished",t,"audio"),n.subscribeVideo&&e.emit("user-unpublished",t,"video"))})),e.remoteUsers=[],e._latestEventLts={},e._msSub=[],null===(r=e._gateway)||void 0===r||r.removeAllListeners(),e._gateway=void 0,e._joinInfo.sid=y(32),e._createMediaServerIntance(),e._authGateWay(e._joinInfo.uid,e._joinInfo.token).then((function(t){e._republish(),e.remoteUsers=[],e._subPeerAVStats={}})));break;case"token-privilege-did-expire":e.emit("token-privilege-did-expire");break;case"token-privilege-will-expire":e.emit("token-privilege-will-expire");break;case A.ON_PUBLISH_EX:if(0===f){n.StreamId;var _=n.Offer;e._lowStream.peer.createAnswer(_)}break;case A.ON_SUBSCRIBE:if(0===f){var g,S=n.StreamId;_=n.Offer;if(S===e.uid)g=e._highStream.peer;else{var E=e.remoteUsers.find((function(e){return e.uid===S}));if(E||T.warning("can not find remote user "+S),E.uid===S)(te=new gn(S,e._statsCollector,e._joinInfo)).on(A.CONNECTION_STATE_CHANGE,e._handlePeerConnectionEvent.bind(e,A.CONNECTION_STATE_CHANGE)),te.on(A.ICE_CONNECTION_STATE_CHANGE,e._handlePeerConnectionEvent.bind(e,A.ICE_CONNECTION_STATE_CHANGE)),te.on(A.ICE_CANDIDATE,e._handlePeerConnectionEvent.bind(e,A.ICE_CANDIDATE)),te.on(A.CREATE_ANSWER,e._handlePeerConnectionEvent.bind(e,A.CREATE_ANSWER)),te.on(A.TRACK_ADDED,(function(e,t,n){"audio"===t?E._audioMediaStreamTrack=n:"video"===t&&(E._videoMediaStreamTrack=n)})),E._mediaStream=te,g=te.peer}g&&g.createAnswer(_)}else{var C=n.StreamId;window.setTimeout((function(){e._resubscribe(C)}),3e3)}break;case A.ON_FORCE_OFFLINE:null===(i=e._gateway)||void 0===i||i.disconnectCTS("UID_BANNED"),null===(o=e._gateway)||void 0===o||o.removeAllListeners(),e._gateway=void 0;break;case A.ON_ICE:var b=n.StreamId,R=n.Sdp,w=n.SubStream,I=void 0;if(b===e.uid)I=e._highStream.peer,w&&(I=e._lowStream.peer);else{var O=e.remoteUsers.find((function(e){return e.uid===b}));O||T.warning("can not find remote user "+b),I=(te=O._mediaStream).peer}I.setIceCandidate(R);break;case A.ON_SESSION_INIT:var N=n.CId,D=n.Interval;e._joinInfo.cid=N,e._startReportStats(N,D);break;case A.ON_CHANNEL_MESSAGE:var P=n.Cmd;if(P===A.ON_CHANNEL_USER_ONLINE){var k={_video_added_:!1,_video_enabled_:!1,_video_muted_:!1,_audio_added_:!1,_audio_enabled_:!1,_audio_muted_:!1,hasAudio:!1,hasVideo:!1,uid:n.UserId};e.remoteUsers.push(k),e.emit("user-joined",k)}else if(P===A.ON_CHANNEL_USER_OFFLINE){var L=n.UserId,M=n.Reason,U=e.remoteUsers.find((function(t,n){if(t.uid===L){var r=e._subPeerAVStats[L];r&&(r.subscribeAudio&&(e._unsubscribe(t,"audio"),e.emit("user-unpublished",ie,"audio")),r.subscribeVideo&&(e._unsubscribe(t,"video"),e.emit("user-unpublished",ie,"video"))),t._mediaStream&&(t._mediaStream.destory(),t._mediaStream=null),e.remoteUsers.splice(n,1)}return t.uid===L}));if(U){var F="";switch(M){case"Dropped":F="ServerTimeOut";case"Offline":F="Quit";break;case"BecomeAudience":F="BecomeAudience"}e.emit("user-left",U,F)}e._setAVStatsRepTimer()}else if(P===A.ON_CHANNEL_SET_USER_ROLE)n.AppId,n.UserId,n.Code,n.Role,n.ChanId;else if(P===A.ON_CHANNEL_DUALSTREAM_ENABLE){var j=n.UserId,V=n.Enable,B=e.remoteUsers.find((function(e){return e.uid===j}));B&&(B._dualStream=V)}else if(P===A.ON_CHANNEL_USER_STREAM_OPEN){var G=n.UserId,W=(n.StreamId,n.PubSessionId),H=n.DualStream,K=n.HasAudio,J=n.LocalAudioEnable,z=n.LocalAudioMute,Y=n.HasVideo,X=n.LocalVideoEnable,q=n.LocalVideoMute,Q=(n.VidCodecType,n.AudCodecType,e.remoteUsers.find((function(e){return e.uid===G})));if(void 0!==Q){var $=K&&J&&!z,Z=Y&&X&&!q,ee=!0;Z&&X&&!q||(ee=!1),Object.assign(Q,{_video_added_:K,_video_enabled_:X,_video_muted_:q,_audio_added_:Y,_audio_enabled_:J,_audio_muted_:z,hasAudio:$,hasVideo:Z,_videoCache:ee,_pubSid:W,_dualStream:H,_subStreamType:0}),Z&&e.emit("user-published",Q,"video"),$&&e.emit("user-published",Q,"audio")}}else if(P===A.ON_CHANNEL_USER_STREAM_CLOSE){var te,ne=n.UserId,re=(n.StreamId,n.PubSessionId),ie=e.remoteUsers.find((function(e){return e.uid===ne&&e._pubSid===re}));if(null!=ie)(fe=e._subPeerAVStats[ie.uid])&&(fe.subscribeAudio&&(e._unsubscribe(ie,"audio"),e.emit("user-unpublished",ie,"audio"),ie._audio_added_=!1,ie._audio_enabled_=!1,ie._audio_muted_=!1,ie.hasAudio=ie._audio_added_&&ie._audio_enabled_&&!ie._audio_muted_),fe.subscribeVideo&&(e._unsubscribe(ie,"video"),e.emit("user-unpublished",ie,"video"),ie._video_added_=!1,ie._video_enabled_=!1,ie._video_muted_=!1,ie.hasVideo=ie._video_added_&&ie._video_enabled_&&!ie._video_muted_)),e._subPeerAVStats[ne]&&delete e._subPeerAVStats[ne],(te=ie._mediaStream)&&(te&&te.destory(),delete ie._mediaStream),null===(a=e._statsCollector)||void 0===a||a.removeConnection(ie.uid)}else if(P===A.ON_CHANNEL_USER_ENABLE_LOCAL_VIDEO||P===A.ON_CHANNEL_USER_ENABLE_VIDEO||P===A.ON_CHANNEL_USER_DISABLE_VIDEO){var oe=n.UserId,ae=(V=n.Enable,e.remoteUsers.find((function(e){return e.uid===oe})));if(!ae)throw new x("user "+oe+" is not find");var se=ae.hasVideo;if(P===A.ON_CHANNEL_USER_ENABLE_LOCAL_VIDEO?ae._video_enabled_=V:P===A.ON_CHANNEL_USER_ENABLE_VIDEO?ae._video_added_=!0:P===A.ON_CHANNEL_USER_DISABLE_VIDEO&&(ae._video_added_=!1),ae.hasVideo=ae._video_added_&&ae._video_enabled_&&!ae._video_muted_,V||P===A.ON_CHANNEL_USER_ENABLE_VIDEO)se||(null===(s=e._gateway)||void 0===s||s.setAVStatus(oe,ae.hasAudio,ae.hasVideo),ae._mediaStream&&(ae.videoTrack=ae._mediaStream.addTracks("video")),e.emit("user-published",ae,"video"));else if(!V||P===A.ON_CHANNEL_USER_DISABLE_VIDEO){(fe=e._subPeerAVStats[ae.uid])&&fe.subscribeVideo&&(e._unsubscribe(ae,"video"),ae.videoTrack&&(ae.videoTrack.stop(),ae.videoTrack=void 0),null===(c=e._gateway)||void 0===c||c.setAVStatus(oe,ae.hasAudio,ae.hasVideo),e.emit("user-unpublished",ae,"video"),T.info("stream removed with uid "+oe))}e._setAVStatsRepTimer()}else if(P===A.ON_CHANNEL_USER_ENABLE_LOCAL_AUDIO||P===A.ON_CHANNEL_USER_ENABLE_AUDIO||P===A.ON_CHANNEL_USER_DISABLE_AUDIO){var ce=n.UserId,ue=(V=n.Enable,e.remoteUsers.find((function(e){return e.uid===ce})));if(!ue)throw new x("user "+ce+" is not find");var de=ue.hasAudio;if(P===A.ON_CHANNEL_USER_ENABLE_LOCAL_AUDIO?ue._audio_enabled_=V:P===A.ON_CHANNEL_USER_ENABLE_AUDIO?ue._audio_added_=!0:P===A.ON_CHANNEL_USER_DISABLE_AUDIO&&(ue._audio_added_=!1),ue.hasAudio=ue._audio_added_&&ue._audio_enabled_&&!ue._audio_muted_,V||P===A.ON_CHANNEL_USER_ENABLE_AUDIO)de||(null===(u=e._gateway)||void 0===u||u.setAVStatus(ce,ue.hasAudio,ue.hasVideo),ue._mediaStream&&(ue.audioTrack=ue._mediaStream.addTracks("audio")),e.emit("user-published",ue,"audio"));else if(!V||P===A.ON_CHANNEL_USER_DISABLE_AUDIO){var fe;(fe=e._subPeerAVStats[ue.uid])&&fe.subscribeAudio&&(e._unsubscribe(ue,"audio"),ue.audioTrack=void 0,null===(d=e._gateway)||void 0===d||d.setAVStatus(ce,ue.hasAudio,ue.hasVideo),e.emit("user-unpublished",ue,"audio"))}e._setAVStatsRepTimer()}else if(P===A.ON_CHANNEL_USER_MUTE_VIDEO){var le=n.UserId,pe=n.Mute,he=e.remoteUsers.find((function(e){return e.uid===le}));he._video_muted_=pe,he.hasVideo=he._video_enabled_&&!he._video_muted_,e._subPeerAVStats[le]&&(e._subPeerAVStats[le].subscribeVideo=!pe),pe?(he.videoTrack&&(he.videoTrack.stop(),he.videoTrack=void 0),e.emit("user-unpublished",he,"video")):e.emit("user-published",he,"video"),e._setAVStatsRepTimer()}else if(P===A.ON_CHANNEL_USER_MUTE_AUDIO){var ve=n.UserId,me=(pe=n.Mute,e.remoteUsers.find((function(e){return e.uid===ve})));me._audio_muted_=pe,me.hasAudio=me._audio_enabled_&&!me._audio_muted_,e._subPeerAVStats[ve]&&(e._subPeerAVStats[ve].subscribeAudio=!pe),pe?e.emit("user-unpublished",me,"audio"):e.emit("user-published",me,"audio"),e._setAVStatsRepTimer()}}}},t.prototype._handlePeerConnectionEvent=function(e,t,n,r){var i,o;if(e===A.ICE_CONNECTION_STATE_CHANGE);else if(e===A.CONNECTION_STATE_CHANGE)switch(r){case"connected":if("sub"===n)return;var a=void 0;if("pub"===n?a=this._highStream.peer:"pubEx"===n&&(a=this._lowStream.peer),"{}"!==JSON.stringify(a.videoEncoderConfig)){var s=a.videoEncoderConfig;s.bitrateMax&&a.updateBandWidth(s.bitrateMax)}break;case"disconnected":break;case"failed":T.warning(this.connectionState,this._gateway),"pub"===n||"pubEx"===n?(T.warning("republish => "),this._republish()):"sub"===n&&(T.warning("resubscribe => "),this._resubscribe(t))}else e===A.ICE_CANDIDATE?null===(i=this._gateway)||void 0===i||i.sendIceCandidate(t,r,"pubEx"===n):e===A.CREATE_ANSWER&&(null===(o=this._gateway)||void 0===o||o.sendAnswer(t,r,"pubEx"===n))},t.prototype._startReportStats=function(e,t){var n=this;n._reportStatsInterval&&clearInterval(n._reportStatsInterval),n._reportStatsInterval=window.setInterval((function(){var t;if(n._highStream){var r={cid:e,lts:Date.now(),type:"local"};if(n._highStream.videoTrack){var i=n._highStream.videoTrack.getStats();i&&(r.lvid={sbr:i.sendBitrate,sfps:i.sendFrameRate,eofps:i.captureFrameRate,rofps:i.captureFrameRate,stbr:i.captureFrameRate,stfps:i.captureFrameRate,ebr:i.sendBytes,e_w:i.captureResolutionWidth,e_h:i.captureResolutionHeight,efps:i.captureFrameRate,ploss:i.sendPacketsLost})}else r.lvid={};if(n._highStream.audioTrack){var o=n._highStream.audioTrack.getStats();o&&(r.laud={nc:1,shz:0,sbr:o.sendBitrate,vol:o.sendVolumeLevel,ploss:o.sendPacketsLost})}else r.laud={};null===(t=n._gateway)||void 0===t||t.reportArStats(r)}n._lowStream,n.remoteUsers.length>0&&n.remoteUsers.forEach((function(t){var r,i={cid:e,peer:t.uid,lts:Date.now(),type:"peer"};if(t.videoTrack){var o=t.videoTrack.getStats();o&&(i.vif={w:o.receiveResolutionWidth,h:o.receiveResolutionHeight,rbr:o.receiveBitrate,dofps:o.receiveFrameRate,rofps:o.renderFrameRate,ploss:o.receivePacketsLost,rst:o._subStreamType,tft:o.totalFreezeTime,ffps:o.freezeRate})}else i.vif={};if(t.audioTrack){var a=t.audioTrack.getStats();a&&(i.aif={ntd:a.end2EndDelay,jbd:a.receiveDelay,aloss:a.packetLossRate,nc:1,rhz:0,rb:a.receiveBitrate,tft:a.totalFreezeTime,ffps:a.freezeRate,vol:a.receiveLevel,ploss:a.receivePacketsLost})}else i.aif={};null===(r=n._gateway)||void 0===r||r.reportArStats(i)}))}),t)},t}(b),Pn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kn=function(e){function t(t,n){var r=e.call(this)||this;return r.startPlayTime=0,r.startPlayOffset=0,r.pausePlayTime=0,r.currentLoopCount=0,r.options={},r.sourceNode=void 0,r._currentState="stopped",r.id=n,r.context=Et.getAudioContextInstance(),r.mediaStreamDestination=r.context.createMediaStreamDestination(),r.audioBuffer=t,r.startPlayOffset=r.options.startPlayTime||0,r}return Pn(t,e),t.prototype.getAudioTrack=function(){return this.mediaStreamDestination.stream.getAudioTracks()[0]},t.prototype.updateOptions=function(e){"stopped"===this.currentState?(this.options=e,this.startPlayOffset=this.options.startPlayTime||0):T.warning("can not set audio source options")},t.prototype.startProcessAudioBuffer=function(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"},t.prototype.pauseProcessAudioBuffer=function(){this.sourceNode&&"playing"===this.currentState&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")},t.prototype.seekAudioBuffer=function(e){this.sourceNode&&(this.sourceNode.onended=null,"playing"===this.currentState&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),"playing"===this.currentState?(this.startPlayOffset=e,this.startSourceNode()):"paused"===this.currentState&&(this.pausePlayTime=e))},t.prototype.resumeProcessAudioBuffer=function(){"paused"===this.currentState&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")},t.prototype.stopProcessAudioBuffer=function(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch(e){}this.reset()}},t.prototype.startSourceNode=function(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))},t.prototype.createSourceNode=function(){var e=this.context.createBufferSource();return e.buffer=this.audioBuffer,e.loop=!!this.options.loop,e.connect(this.mediaStreamDestination),e},t.prototype.handleSourceNodeEnded=function(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()},t.prototype.reset=function(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0},Object.defineProperty(t.prototype,"currentState",{get:function(){return this._currentState},set:function(e){e!==this._currentState&&(this._currentState=e,this.emit(A.AUDIO_SOURCE_STATE_CHANGE,this._currentState))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this.audioBuffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return"stopped"===this.currentState?0:"paused"===this.currentState?this.pausePlayTime:(this.context.currentTime-this.startPlayTime+this.startPlayOffset)%this.audioBuffer.duration},enumerable:!0,configurable:!0}),t}(b),xn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ln=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Mn=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]