@millicast/vue-viewer-plugin
Version:
Vue.js plugin to embed viewer of a Millicast stream. This plugin allows developers to simplify Millicast services integration into their own Vue.js apps.
12 lines (10 loc) • 1.01 MB
JavaScript
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 4055:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
(function(ie,me){ true?me(exports):0})(this,function(ie){"use strict";var ja=Object.defineProperty,qa=Object.defineProperties;var Ga=Object.getOwnPropertyDescriptors;var ur=Object.getOwnPropertySymbols;var Fs=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable;var Bs=(ie,me,ve)=>me in ie?ja(ie,me,{enumerable:!0,configurable:!0,writable:!0,value:ve}):ie[me]=ve,se=(ie,me)=>{for(var ve in me||(me={}))Fs.call(me,ve)&&Bs(ie,ve,me[ve]);if(ur)for(var ve of ur(me))Os.call(me,ve)&&Bs(ie,ve,me[ve]);return ie},je=(ie,me)=>qa(ie,Ga(me));var gt=(ie,me)=>{var ve={};for(var ke in ie)Fs.call(ie,ke)&&me.indexOf(ke)<0&&(ve[ke]=ie[ke]);if(ie!=null&&ur)for(var ke of ur(ie))me.indexOf(ke)<0&&Os.call(ie,ke)&&(ve[ke]=ie[ke]);return ve};var Us;var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof __webpack_require__.g<"u"?__webpack_require__.g:typeof self<"u"?self:{};function ve(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ke={exports:{}};/*!
* js-logger - http://github.com/jonnyreeves/js-logger
* Jonny Reeves, http://jonnyreeves.co.uk/
* js-logger may be freely distributed under the MIT license.
*/var Ns=ke.exports,Wn;function _s(){return Wn||(Wn=1,function(n){(function(e){var t={};t.VERSION="1.6.1";var r,i={},o=function(l,w){return function(){return w.apply(l,arguments)}},c=function(){var l=arguments,w=l[0],g,p;for(p=1;p<l.length;p++)for(g in l[p])!(g in w)&&l[p].hasOwnProperty(g)&&(w[g]=l[p][g]);return w},a=function(l,w){return{value:l,name:w}};t.TRACE=a(1,"TRACE"),t.DEBUG=a(2,"DEBUG"),t.INFO=a(3,"INFO"),t.TIME=a(4,"TIME"),t.WARN=a(5,"WARN"),t.ERROR=a(8,"ERROR"),t.OFF=a(99,"OFF");var f=function(l){this.context=l,this.setLevel(l.filterLevel),this.log=this.info};f.prototype={setLevel:function(l){l&&"value"in l&&(this.context.filterLevel=l)},getLevel:function(){return this.context.filterLevel},enabledFor:function(l){var w=this.context.filterLevel;return l.value>=w.value},trace:function(){this.invoke(t.TRACE,arguments)},debug:function(){this.invoke(t.DEBUG,arguments)},info:function(){this.invoke(t.INFO,arguments)},warn:function(){this.invoke(t.WARN,arguments)},error:function(){this.invoke(t.ERROR,arguments)},time:function(l){typeof l=="string"&&l.length>0&&this.invoke(t.TIME,[l,"start"])},timeEnd:function(l){typeof l=="string"&&l.length>0&&this.invoke(t.TIME,[l,"end"])},invoke:function(l,w){r&&this.enabledFor(l)&&r(w,c({level:l},this.context))}};var d=new f({filterLevel:t.OFF});(function(){var l=t;l.enabledFor=o(d,d.enabledFor),l.trace=o(d,d.trace),l.debug=o(d,d.debug),l.time=o(d,d.time),l.timeEnd=o(d,d.timeEnd),l.info=o(d,d.info),l.warn=o(d,d.warn),l.error=o(d,d.error),l.log=l.info})(),t.setHandler=function(l){r=l},t.setLevel=function(l){d.setLevel(l);for(var w in i)i.hasOwnProperty(w)&&i[w].setLevel(l)},t.getLevel=function(){return d.getLevel()},t.get=function(l){return i[l]||(i[l]=new f(c({name:l},d.context)))},t.createDefaultHandler=function(l){l=l||{},l.formatter=l.formatter||function(m,I){I.name&&m.unshift("["+I.name+"]")};var w={},g=function(p,m){Function.prototype.apply.call(p,console,m)};return typeof console>"u"?function(){}:function(p,m){p=Array.prototype.slice.call(p);var I=console.log,R;m.level===t.TIME?(R=(m.name?"["+m.name+"] ":"")+p[0],p[1]==="start"?console.time?console.time(R):w[R]=new Date().getTime():console.timeEnd?console.timeEnd(R):g(I,[R+": "+(new Date().getTime()-w[R])+"ms"])):(m.level===t.WARN&&console.warn?I=console.warn:m.level===t.ERROR&&console.error?I=console.error:m.level===t.INFO&&console.info?I=console.info:m.level===t.DEBUG&&console.debug?I=console.debug:m.level===t.TRACE&&console.trace&&(I=console.trace),l.formatter(p,m),g(I,p))}},t.useDefaults=function(l){t.setLevel(l&&l.defaultLevel||t.DEBUG),t.setHandler(t.createDefaultHandler(l))},t.setDefaults=t.useDefaults,n.exports?n.exports=t:(t._prevLogger=e.Logger,t.noConflict=function(){return e.Logger=t._prevLogger,t},e.Logger=t)})(Ns)}(ke)),ke.exports}var Vs=_s();const tt=ve(Vs),$n="0.6.1",kt=60,js=((Us=window==null?void 0:window.navigator)==null?void 0:Us.userAgent)||"No user agent available";let At="",Dt="",Mt="",yt="",wt="",zn="",Lt="",Pt=0;const Ut=[];function qs(n){function e(t,r){return{ts:Math.round(r.timestamp)||"",ot:t==="audio"?"a":"v",bl:r.jitterBufferDelay||0,br:Math.round(r.bitrateBitsPerSecond||0),pld:r.packetsLostDeltaPerSecond||0,j:r.jitter||0,mtp:r.packetRate||0,mid:r.mid||"",mimeType:r.mimeType||""}}return n.stats=n.stats.reduce((t,r)=>{const i=r.audio.inbounds.length!==0?r.audio.inbounds.map(c=>e("audio",c)):r.audio.outbounds.map(c=>e("audio",c)),o=r.video.inbounds.length!==0?r.video.inbounds.map(c=>e("video",c)):r.video.outbounds.map(c=>e("video",c));return t.concat([...i,...o])},[]),n}const Ae={initAccountId:n=>{At=At===""?n:At},initStreamName:n=>{Dt=Dt===""?n:Dt},initSubscriberId:n=>{Mt=Mt===""?n:Mt},initStreamViewId:n=>{yt=yt===""?n:yt},initFeedId:n=>{wt=wt===""?n:wt},setConnectionTime:n=>{Pt=Pt===0?n:Pt},setConnectionState:n=>{zn=n},setClusterId:n=>{Lt=Lt===""?n:Lt},addStats:n=>{Ut.length===kt&&Ut.shift(),Ut.push(n)},get:(n=kt,e="JSON")=>{let t;!Number.isInteger(n)||n>kt||n<=0?t=kt:t=n;const r={client:"@millicast/millicast-sdk",version:$n,timestamp:new Date().toISOString(),userAgent:js,clusterId:Lt,accountId:At,streamName:Dt,subscriberId:Mt,connection:zn,stats:Ut.slice(-t),connectionDurationMs:new Date().getTime()-Pt};return wt!==""?r.feedId=wt:yt!==""&&(r.streamViewId=yt),e==="CMCD"?qs(r):r}};tt.useDefaults({defaultLevel:tt.TRACE});const Bt=["TRACE","DEBUG","INFO","WARN","ERROR"],Kn=(n,e)=>{n.unshift("[".concat(e.name||"Global","] ").concat(new Date().toISOString()," - ").concat(e.level.name," -"))},Xn=(n,e)=>e?n.value>=rt[e].value:n.value>=Ft.value,Gs=(n,e)=>{n=Array.prototype.slice.call(n),n=n.map(t=>typeof t=="object"?JSON.stringify(t):t),Kn(n,e),vt!==0?(dt.push(n.join(" ")),dt.length>=vt&&(dt=dt.slice(-vt))):dt=[]},Hs=tt.createDefaultHandler({formatter:Kn});tt.setHandler((n,e)=>{Gs(n,e),Xn(e.level,e.name)&&Hs(n,e);for(const{handler:t,level:r}of Yn)e.level.value>=r.value&&t(n,e)});let vt=1e4,dt=[],Ft=tt.OFF;const rt={},Yn=[],qe=je(se({},tt),{enabledFor:Xn,getHistory:()=>dt,getHistoryMaxSize:()=>vt,setHistoryMaxSize:n=>{vt=n},setLevel:n=>{Ft=n;for(const e in rt)rt[e]=n},getLevel:()=>Ft,get:n=>{rt[n]||(rt[n]=Ft);const e=tt.get(n);return e.setLevel=t=>{rt[n]=t},e.getLevel=()=>rt[n],e},setHandler:(n,e)=>{Yn.push({handler:n,level:e})},diagnose:(n={})=>{let e;const t={statsCount:60,historySize:1e3,minLogLevel:"TRACE",statsFormat:"JSON"};typeof n=="number"?(t.statsCount=n,e=t):e=se(se({},t),n);const{statsCount:r,historySize:i,minLogLevel:o,statsFormat:c}=e,a=Ae.get(r,c),f=qe.getHistory();if(!Number.isInteger(i)||i<=0)throw new Error("Invalid Argument Exception : historySize must be a positive integer.");if(!Bt.includes(o.toUpperCase()))throw new Error('Invalid Argument Exception : the minLogLevel parameter only excepts "trace", "debug", "info", "warn", and "error" as arguments.');if(Bt.includes(o.toUpperCase())){const d=Bt.slice(Bt.indexOf(o.toUpperCase())),l=f.filter(w=>d.some(g=>w.includes(g)));a.history=l.slice(-i)}return a},JSON:"JSON",CMCD:"CMCD",VERSION:$n});var Ot={exports:{}},Jn;function dr(){if(Jn)return Ot.exports;Jn=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(S,E,b){return Function.prototype.apply.call(S,E,b)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:t=function(S){return Object.getOwnPropertyNames(S)};function r(v){console&&console.warn&&console.warn(v)}var i=Number.isNaN||function(S){return S!==S};function o(){o.init.call(this)}Ot.exports=o,Ot.exports.once=M,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function a(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(v){if(typeof v!="number"||v<0||i(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");c=v}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function f(v){return v._maxListeners===void 0?o.defaultMaxListeners:v._maxListeners}o.prototype.getMaxListeners=function(){return f(this)},o.prototype.emit=function(S){for(var E=[],b=1;b<arguments.length;b++)E.push(arguments[b]);var x=S==="error",P=this._events;if(P!==void 0)x=x&&P.error===void 0;else if(!x)return!1;if(x){var k;if(E.length>0&&(k=E[0]),k instanceof Error)throw k;var O=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw O.context=k,O}var J=P[S];if(J===void 0)return!1;if(typeof J=="function")e(J,this,E);else for(var H=J.length,ee=m(J,H),b=0;b<H;++b)e(ee[b],this,E);return!0};function d(v,S,E,b){var x,P,k;if(a(E),P=v._events,P===void 0?(P=v._events=Object.create(null),v._eventsCount=0):(P.newListener!==void 0&&(v.emit("newListener",S,E.listener?E.listener:E),P=v._events),k=P[S]),k===void 0)k=P[S]=E,++v._eventsCount;else if(typeof k=="function"?k=P[S]=b?[E,k]:[k,E]:b?k.unshift(E):k.push(E),x=f(v),x>0&&k.length>x&&!k.warned){k.warned=!0;var O=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");O.name="MaxListenersExceededWarning",O.emitter=v,O.type=S,O.count=k.length,r(O)}return v}o.prototype.addListener=function(S,E){return d(this,S,E,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(S,E){return d(this,S,E,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(v,S,E){var b={fired:!1,wrapFn:void 0,target:v,type:S,listener:E},x=l.bind(b);return x.listener=E,b.wrapFn=x,x}o.prototype.once=function(S,E){return a(E),this.on(S,w(this,S,E)),this},o.prototype.prependOnceListener=function(S,E){return a(E),this.prependListener(S,w(this,S,E)),this},o.prototype.removeListener=function(S,E){var b,x,P,k,O;if(a(E),x=this._events,x===void 0)return this;if(b=x[S],b===void 0)return this;if(b===E||b.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete x[S],x.removeListener&&this.emit("removeListener",S,b.listener||E));else if(typeof b!="function"){for(P=-1,k=b.length-1;k>=0;k--)if(b[k]===E||b[k].listener===E){O=b[k].listener,P=k;break}if(P<0)return this;P===0?b.shift():I(b,P),b.length===1&&(x[S]=b[0]),x.removeListener!==void 0&&this.emit("removeListener",S,O||E)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(S){var E,b,x;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[S]),this;if(arguments.length===0){var P=Object.keys(b),k;for(x=0;x<P.length;++x)k=P[x],k!=="removeListener"&&this.removeAllListeners(k);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=b[S],typeof E=="function")this.removeListener(S,E);else if(E!==void 0)for(x=E.length-1;x>=0;x--)this.removeListener(S,E[x]);return this};function g(v,S,E){var b=v._events;if(b===void 0)return[];var x=b[S];return x===void 0?[]:typeof x=="function"?E?[x.listener||x]:[x]:E?R(x):m(x,x.length)}o.prototype.listeners=function(S){return g(this,S,!0)},o.prototype.rawListeners=function(S){return g(this,S,!1)},o.listenerCount=function(v,S){return typeof v.listenerCount=="function"?v.listenerCount(S):p.call(v,S)},o.prototype.listenerCount=p;function p(v){var S=this._events;if(S!==void 0){var E=S[v];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(v,S){for(var E=new Array(S),b=0;b<S;++b)E[b]=v[b];return E}function I(v,S){for(;S+1<v.length;S++)v[S]=v[S+1];v.pop()}function R(v){for(var S=new Array(v.length),E=0;E<S.length;++E)S[E]=v[E].listener||v[E];return S}function M(v,S){return new Promise(function(E,b){function x(k){v.removeListener(S,P),b(k)}function P(){typeof v.removeListener=="function"&&v.removeListener("error",x),E([].slice.call(arguments))}F(v,S,P,{once:!0}),S!=="error"&&U(v,x,{once:!0})})}function U(v,S,E){typeof v.on=="function"&&F(v,"error",S,E)}function F(v,S,E,b){if(typeof v.on=="function")b.once?v.once(S,E):v.on(S,E);else if(typeof v.addEventListener=="function")v.addEventListener(S,function x(P){b.once&&v.removeEventListener(S,x),E(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}return Ot.exports}var Ws=dr();const Nt=ve(Ws);var _t={exports:{}},Zn;function $s(){if(Zn)return _t.exports;Zn=1,_t.exports=e,_t.exports.filter=t;var n=dr().EventEmitter;function e(r,i,o){Array.isArray(o)||(o=[o]);var c=[];return o.forEach(function(a){var f=function(){var d=[].slice.call(arguments);d.unshift(a),i.emit.apply(i,d)};c.push(f),r.on(a,f)}),function(){o.forEach(function(f,d){r.removeListener(f,c[d])})}}function t(r,i){var o=new n;return e(r,o,i),o}return _t.exports}var zs=$s();const Vt=ve(zs);var lr={exports:{}};/*! For license information please see webrtc-stats.js.LICENSE.txt */var Qn;function Ks(){return Qn||(Qn=1,function(n,e){(function(t,r){n.exports=r()})(self,()=>{return t={7:i=>{var o,c=typeof Reflect=="object"?Reflect:null,a=c&&typeof c.apply=="function"?c.apply:function(v,S,E){return Function.prototype.apply.call(v,S,E)};o=c&&typeof c.ownKeys=="function"?c.ownKeys:Object.getOwnPropertySymbols?function(v){return Object.getOwnPropertyNames(v).concat(Object.getOwnPropertySymbols(v))}:function(v){return Object.getOwnPropertyNames(v)};var f=Number.isNaN||function(v){return v!=v};function d(){d.init.call(this)}i.exports=d,i.exports.once=function(v,S){return new Promise(function(E,b){function x(k){v.removeListener(S,P),b(k)}function P(){typeof v.removeListener=="function"&&v.removeListener("error",x),E([].slice.call(arguments))}F(v,S,P,{once:!0}),S!=="error"&&function(k,O){typeof k.on=="function"&&F(k,"error",O,{once:!0})}(v,x)})},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var l=10;function w(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}function g(v){return v._maxListeners===void 0?d.defaultMaxListeners:v._maxListeners}function p(v,S,E,b){var x,P,k,O;if(w(E),(P=v._events)===void 0?(P=v._events=Object.create(null),v._eventsCount=0):(P.newListener!==void 0&&(v.emit("newListener",S,E.listener?E.listener:E),P=v._events),k=P[S]),k===void 0)k=P[S]=E,++v._eventsCount;else if(typeof k=="function"?k=P[S]=b?[E,k]:[k,E]:b?k.unshift(E):k.push(E),(x=g(v))>0&&k.length>x&&!k.warned){k.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=v,J.type=S,J.count=k.length,O=J,console&&console.warn&&console.warn(O)}return v}function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function I(v,S,E){var b={fired:!1,wrapFn:void 0,target:v,type:S,listener:E},x=m.bind(b);return x.listener=E,b.wrapFn=x,x}function R(v,S,E){var b=v._events;if(b===void 0)return[];var x=b[S];return x===void 0?[]:typeof x=="function"?E?[x.listener||x]:[x]:E?function(P){for(var k=new Array(P.length),O=0;O<k.length;++O)k[O]=P[O].listener||P[O];return k}(x):U(x,x.length)}function M(v){var S=this._events;if(S!==void 0){var E=S[v];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}function U(v,S){for(var E=new Array(S),b=0;b<S;++b)E[b]=v[b];return E}function F(v,S,E,b){if(typeof v.on=="function")b.once?v.once(S,E):v.on(S,E);else{if(typeof v.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v);v.addEventListener(S,function x(P){b.once&&v.removeEventListener(S,x),E(P)})}}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(v){if(typeof v!="number"||v<0||f(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");l=v}}),d.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},d.prototype.setMaxListeners=function(v){if(typeof v!="number"||v<0||f(v))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+v+".");return this._maxListeners=v,this},d.prototype.getMaxListeners=function(){return g(this)},d.prototype.emit=function(v){for(var S=[],E=1;E<arguments.length;E++)S.push(arguments[E]);var b=v==="error",x=this._events;if(x!==void 0)b=b&&x.error===void 0;else if(!b)return!1;if(b){var P;if(S.length>0&&(P=S[0]),P instanceof Error)throw P;var k=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw k.context=P,k}var O=x[v];if(O===void 0)return!1;if(typeof O=="function")a(O,this,S);else{var J=O.length,H=U(O,J);for(E=0;E<J;++E)a(H[E],this,S)}return!0},d.prototype.addListener=function(v,S){return p(this,v,S,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(v,S){return p(this,v,S,!0)},d.prototype.once=function(v,S){return w(S),this.on(v,I(this,v,S)),this},d.prototype.prependOnceListener=function(v,S){return w(S),this.prependListener(v,I(this,v,S)),this},d.prototype.removeListener=function(v,S){var E,b,x,P,k;if(w(S),(b=this._events)===void 0)return this;if((E=b[v])===void 0)return this;if(E===S||E.listener===S)--this._eventsCount==0?this._events=Object.create(null):(delete b[v],b.removeListener&&this.emit("removeListener",v,E.listener||S));else if(typeof E!="function"){for(x=-1,P=E.length-1;P>=0;P--)if(E[P]===S||E[P].listener===S){k=E[P].listener,x=P;break}if(x<0)return this;x===0?E.shift():function(O,J){for(;J+1<O.length;J++)O[J]=O[J+1];O.pop()}(E,x),E.length===1&&(b[v]=E[0]),b.removeListener!==void 0&&this.emit("removeListener",v,k||S)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(v){var S,E,b;if((E=this._events)===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[v]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete E[v]),this;if(arguments.length===0){var x,P=Object.keys(E);for(b=0;b<P.length;++b)(x=P[b])!=="removeListener"&&this.removeAllListeners(x);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(S=E[v])=="function")this.removeListener(v,S);else if(S!==void 0)for(b=S.length-1;b>=0;b--)this.removeListener(v,S[b]);return this},d.prototype.listeners=function(v){return R(this,v,!0)},d.prototype.rawListeners=function(v){return R(this,v,!1)},d.listenerCount=function(v,S){return typeof v.listenerCount=="function"?v.listenerCount(S):M.call(v,S)},d.prototype.listenerCount=M,d.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},156:function(i,o,c){var a=this&&this.__createBinding||(Object.create?function(w,g,p,m){m===void 0&&(m=p);var I=Object.getOwnPropertyDescriptor(g,p);I&&!("get"in I?!g.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return g[p]}}),Object.defineProperty(w,m,I)}:function(w,g,p,m){m===void 0&&(m=p),w[m]=g[p]}),f=this&&this.__exportStar||function(w,g){for(var p in w)p==="default"||Object.prototype.hasOwnProperty.call(g,p)||a(g,w,p)},d=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(o,"__esModule",{value:!0}),o.Logger=void 0;var l=c(586);Object.defineProperty(o,"Logger",{enumerable:!0,get:function(){return d(l).default}}),f(c(284),o),f(c(280),o),f(c(738),o),f(c(767),o)},185:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.calculatePacketsLostRatio=o.calculateRate=o.getMediaKind=void 0,o.getMediaKind=c=>{let a=c.kind||c.mediaType;return["audio","video"].includes(a)||c.type!=="inbound-rtp"||(a=c.id.toLocaleLowerCase().includes("video")?"video":"audio"),a},o.calculateRate=(c,a,f,d)=>f&&d?(a-d)/((c-f)/1e3):0,o.calculatePacketsLostRatio=(c,a,f,d)=>{const l=c-(f!=null?f:0),w=l+(a-(d!=null?d:0));return w===0?0:l/w}},280:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},284:function(i,o,c){var a,f,d,l,w,g,p,m,I,R,M,U,F,v,S,E,b=this&&this.__awaiter||function(j,B,V,X){return new(V||(V=Promise))(function(Y,_){function N(z){try{W(X.next(z))}catch(K){_(K)}}function q(z){try{W(X.throw(z))}catch(K){_(K)}}function W(z){var K;z.done?Y(z.value):(K=z.value,K instanceof V?K:new V(function(ne){ne(K)})).then(N,q)}W((X=X.apply(j,B||[])).next())})},x=this&&this.__classPrivateFieldSet||function(j,B,V,X,Y){if(X==="m")throw new TypeError("Private method is not writable");if(X==="a"&&!Y)throw new TypeError("Private accessor was defined without a setter");if(typeof B=="function"?j!==B||!Y:!B.has(j))throw new TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?Y.call(j,V):Y?Y.value=V:B.set(j,V),V},P=this&&this.__classPrivateFieldGet||function(j,B,V,X){if(V==="a"&&!X)throw new TypeError("Private accessor was defined without a getter");if(typeof B=="function"?j!==B||!X:!B.has(j))throw new TypeError("Cannot read private member from an object whose class did not declare it");return V==="m"?X:V==="a"?X.call(j):X?X.value:B.get(j)},k=this&&this.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(o,"__esModule",{value:!0}),o.WebRTCStats=void 0;const O=c(7),J=k(c(586)),H=c(738),ee=c(185);class G extends O.EventEmitter{constructor(B){super(),a.add(this),f.set(this,void 0),d.set(this,void 0),l.set(this,void 0),w.set(this,null),g.set(this,void 0),p.set(this,null),this.start=()=>{P(this,g,"f").info("WebRTC statistics collection is starting..."),x(this,p,null,"f"),x(this,w,setInterval(P(this,m,"f"),P(this,d,"f")),"f")},this.stop=()=>{P(this,w,"f")&&(clearInterval(P(this,w,"f")),x(this,w,null,"f"),P(this,g,"f").info("WebRTC statistics collection has stopped."))},m.set(this,()=>b(this,void 0,void 0,function*(){let V,X;try{P(this,g,"f").trace("Requesting WebRTC statistics..."),V=yield P(this,f,"f").call(this),X=new Date().toISOString()}catch(N){return P(this,g,"f").error("Problem collecting the WebRTC statistics.",N),void this.emit("error","Problem collecting the WebRTC statistics - ".concat(N))}const Y=Array.from(V.values()),_={timestamp:X,input:{audio:[],video:[]},output:{audio:[],video:[]}};P(this,l,"f")&&(_.rawStats=V);for(let N=0;N<Object.keys(Y).length;N++){const q=Y[N];switch(q.type){case"outbound-rtp":const W=q,z=(0,ee.getMediaKind)(W);z==="audio"?yield P(this,a,"m",M).call(this,V,W,_):z==="video"&&(yield P(this,a,"m",U).call(this,V,W,_));break;case"inbound-rtp":const K=q;let ne=(0,ee.getMediaKind)(K);ne==="audio"?yield P(this,a,"m",v).call(this,V,K,_):ne==="video"&&(yield P(this,a,"m",S).call(this,V,K,_));break;case"candidate-pair":const pe=q;pe.nominated&&P(this,a,"m",E).call(this,pe,_)}}x(this,p,_,"f"),this.emit("stats",_)})),x(this,g,J.default.get("WebRTCStats"),"f"),x(this,f,B.getStats,"f"),x(this,d,B.getStatsInterval||1e3,"f"),x(this,l,!!B.includeRawStats,"f")}}o.WebRTCStats=G,f=new WeakMap,d=new WeakMap,l=new WeakMap,w=new WeakMap,g=new WeakMap,p=new WeakMap,m=new WeakMap,a=new WeakSet,I=function(j,B){if(B){const V=j.get(B);if(V)return{mimeType:V.mimeType}}return{}},R=function(j,B,V){return b(this,void 0,void 0,function*(){var X,Y,_,N;const q=(0,ee.calculateRate)(B.timestamp,B.bytesSent,V==null?void 0:V.timestamp,V==null?void 0:V.totalBytesSent),W=(0,ee.calculateRate)(B.timestamp,B.packetsSent,V==null?void 0:V.timestamp,V==null?void 0:V.totalPacketsSent),z=P(this,a,"m",I).call(this,j,B.codecId);return Object.assign({id:B.id,timestamp:B.timestamp,mid:B.mid,totalBytesSent:B.bytesSent,bytesSentDelta:B.bytesSent-((X=V==null?void 0:V.totalBytesSent)!==null&&X!==void 0?X:0),totalPacketsSent:B.packetsSent,packetsSentDelta:B.packetsSent-((Y=V==null?void 0:V.totalPacketsSent)!==null&&Y!==void 0?Y:0),bitrate:q,packetRate:W,targetBitrate:B.targetBitrate,retransmittedPacketsSent:B.retransmittedPacketsSent,retransmittedPacketsSentDelta:B.retransmittedPacketsSent-((_=V==null?void 0:V.retransmittedPacketsSent)!==null&&_!==void 0?_:0),retransmittedBytesSent:B.retransmittedBytesSent,retransmittedBytesSentDelta:B.retransmittedBytesSent-((N=V==null?void 0:V.retransmittedBytesSent)!==null&&N!==void 0?N:0)},z)})},M=function(j,B,V){return b(this,void 0,void 0,function*(){var X;const Y=(X=P(this,p,"f"))===null||X===void 0?void 0:X.output.audio.find(q=>q.id===B.id);if(Y&&B.timestamp-Y.timestamp<=0)return;const _=yield P(this,a,"m",R).call(this,j,B,Y),N=Object.assign({},_);V.output.audio.push(N)})},U=function(j,B,V){return b(this,void 0,void 0,function*(){var X;const Y=(X=P(this,p,"f"))===null||X===void 0?void 0:X.output.video.find(W=>W.id===B.id);if(Y&&B.timestamp-Y.timestamp<=0)return;const _=yield P(this,a,"m",R).call(this,j,B,Y);let N=H.QualityLimitationReason.none;B.qualityLimitationReason&&(N=B.qualityLimitationReason);const q=Object.assign(Object.assign({},_),{frameWidth:B.frameWidth,frameHeight:B.frameHeight,framesPerSecond:B.framesPerSecond,framesSent:B.framesSent,qualityLimitationReason:N,qualityLimitationDurations:B.qualityLimitationDurations});V.output.video.push(q)})},F=function(j,B,V){return b(this,void 0,void 0,function*(){var X,Y;const _=(0,ee.calculateRate)(B.timestamp,B.bytesReceived,V==null?void 0:V.timestamp,V==null?void 0:V.totalBytesReceived),N=(0,ee.calculateRate)(B.timestamp,B.packetsReceived,V==null?void 0:V.timestamp,V==null?void 0:V.totalPacketsReceived),q=(0,ee.calculatePacketsLostRatio)(B.packetsLost,B.packetsReceived,V==null?void 0:V.totalPacketsLost,V==null?void 0:V.totalPacketsReceived),W=((X=B.packetsLost)!==null&&X!==void 0?X:0)-((Y=V==null?void 0:V.totalPacketsLost)!==null&&Y!==void 0?Y:0),z=P(this,a,"m",I).call(this,j,B.codecId);return Object.assign({id:B.id,timestamp:B.timestamp,mid:B.mid,trackIdentifier:B.trackIdentifier,jitter:B.jitter,jitterBufferDelay:B.jitterBufferDelay,jitterBufferEmittedCount:B.jitterBufferEmittedCount,totalBytesReceived:B.bytesReceived,totalPacketsReceived:B.packetsReceived,totalPacketsLost:B.packetsLost,bitrate:_,packetRate:N,packetLossRatio:q,packetLossDelta:W},z)})},v=function(j,B,V){return b(this,void 0,void 0,function*(){var X;const Y=(X=P(this,p,"f"))===null||X===void 0?void 0:X.input.audio.find(N=>N.id===B.id);if(Y&&B.timestamp-Y.timestamp<=0)return;const _=yield P(this,a,"m",F).call(this,j,B,Y);V.input.audio.push(_)})},S=function(j,B,V){return b(this,void 0,void 0,function*(){var X;const Y=(X=P(this,p,"f"))===null||X===void 0?void 0:X.input.video.find(q=>q.id===B.id);if(Y&&B.timestamp-Y.timestamp<=0)return;const _=yield P(this,a,"m",F).call(this,j,B,Y),N=Object.assign(Object.assign({},_),{keyFramesDecoded:B.keyFramesDecoded,frameHeight:B.frameHeight,frameWidth:B.frameWidth,framesDecoded:B.framesDecoded,framesDropped:B.framesDropped,framesPerSecond:B.framesPerSecond,framesReceived:B.framesReceived});V.input.video.push(N)})},E=function(j,B){B.totalRoundTripTime=j.totalRoundTripTime,B.currentRoundTripTime=j.currentRoundTripTime,B.responsesReceived=j.responsesReceived,B.availableOutgoingBitrate=j.availableOutgoingBitrate,B.availableIncomingBitrate=j.availableIncomingBitrate}},586:function(i,o,c){var a,f;(function(){var d,l={VERSION:"1.6.1"},w={},g=function(U,F){return function(){return F.apply(U,arguments)}},p=function(){var U,F,v=arguments,S=v[0];for(F=1;F<v.length;F++)for(U in v[F])!(U in S)&&v[F].hasOwnProperty(U)&&(S[U]=v[F][U]);return S},m=function(U,F){return{value:U,name:F}};l.TRACE=m(1,"TRACE"),l.DEBUG=m(2,"DEBUG"),l.INFO=m(3,"INFO"),l.TIME=m(4,"TIME"),l.WARN=m(5,"WARN"),l.ERROR=m(8,"ERROR"),l.OFF=m(99,"OFF");var I=function(U){this.context=U,this.setLevel(U.filterLevel),this.log=this.info};I.prototype={setLevel:function(U){U&&"value"in U&&(this.context.filterLevel=U)},getLevel:function(){return this.context.filterLevel},enabledFor:function(U){var F=this.context.filterLevel;return U.value>=F.value},trace:function(){this.invoke(l.TRACE,arguments)},debug:function(){this.invoke(l.DEBUG,arguments)},info:function(){this.invoke(l.INFO,arguments)},warn:function(){this.invoke(l.WARN,arguments)},error:function(){this.invoke(l.ERROR,arguments)},time:function(U){typeof U=="string"&&U.length>0&&this.invoke(l.TIME,[U,"start"])},timeEnd:function(U){typeof U=="string"&&U.length>0&&this.invoke(l.TIME,[U,"end"])},invoke:function(U,F){d&&this.enabledFor(U)&&d(F,p({level:U},this.context))}};var R,M=new I({filterLevel:l.OFF});(R=l).enabledFor=g(M,M.enabledFor),R.trace=g(M,M.trace),R.debug=g(M,M.debug),R.time=g(M,M.time),R.timeEnd=g(M,M.timeEnd),R.info=g(M,M.info),R.warn=g(M,M.warn),R.error=g(M,M.error),R.log=R.info,l.setHandler=function(U){d=U},l.setLevel=function(U){for(var F in M.setLevel(U),w)w.hasOwnProperty(F)&&w[F].setLevel(U)},l.getLevel=function(){return M.getLevel()},l.get=function(U){return w[U]||(w[U]=new I(p({name:U},M.context)))},l.createDefaultHandler=function(U){(U=U||{}).formatter=U.formatter||function(S,E){E.name&&S.unshift("["+E.name+"]")};var F={},v=function(S,E){Function.prototype.apply.call(S,console,E)};return typeof console>"u"?function(){}:function(S,E){S=Array.prototype.slice.call(S);var b,x=console.log;E.level===l.TIME?(b=(E.name?"["+E.name+"] ":"")+S[0],S[1]==="start"?console.time?console.time(b):F[b]=new Date().getTime():console.timeEnd?console.timeEnd(b):v(x,[b+": "+(new Date().getTime()-F[b])+"ms"])):(E.level===l.WARN&&console.warn?x=console.warn:E.level===l.ERROR&&console.error?x=console.error:E.level===l.INFO&&console.info?x=console.info:E.level===l.DEBUG&&console.debug?x=console.debug:E.level===l.TRACE&&console.trace&&(x=console.trace),U.formatter(S,E),v(x,S))}},l.useDefaults=function(U){l.setLevel(U&&U.defaultLevel||l.DEBUG),l.setHandler(l.createDefaultHandler(U))},l.setDefaults=l.useDefaults,(f=typeof(a=l)=="function"?a.call(o,c,o,i):a)===void 0||(i.exports=f)})()},738:(i,o)=>{var c;Object.defineProperty(o,"__esModule",{value:!0}),o.QualityLimitationReason=void 0,function(a){a[a.none=0]="none",a[a.cpu=1]="cpu",a[a.bandwidth=2]="bandwidth",a[a.other=3]="other"}(c||(o.QualityLimitationReason=c={}))},767:(i,o)=>{Object.defineProperty(o,"__esModule",{value:!0})}},r={},function i(o){var c=r[o];if(c!==void 0)return c.exports;var a=r[o]={exports:{}};return t[o].call(a.exports,a,a.exports,i),a.exports}(156);// removed by dead control flow
var t, r; })}(lr)),lr.exports}var Xs=Ks();const bt=qe.get("PeerConnectionStats"),ei={stats:"stats"},Ys=n=>{const c=n,{input:e,output:t,rawStats:r}=c,i=gt(c,["input","output","rawStats"]);return je(se({},i),{audio:{inbounds:n.input.audio.map(w=>{var g=w,{packetLossRatio:a,packetLossDelta:f,bitrate:d}=g,l=gt(g,["packetLossRatio","packetLossDelta","bitrate"]);return se({packetsLostRatioPerSecond:a,packetsLostDeltaPerSecond:f,bitrateBitsPerSecond:d*8,bitrate:d},l)}),outbounds:n.output.audio.map(w=>{var g=w,{packetLossRatio:a,packetLossDelta:f,bitrate:d}=g,l=gt(g,["packetLossRatio","packetLossDelta","bitrate"]);return se({packetsLostRatioPerSecond:a,packetsLostDeltaPerSecond:f,bitrateBitsPerSecond:d*8,bitrate:d},l)})},video:{inbounds:n.input.video.map(w=>{var g=w,{packetLossRatio:a,packetLossDelta:f,bitrate:d}=g,l=gt(g,["packetLossRatio","packetLossDelta","bitrate"]);return se({packetsLostRatioPerSecond:a,packetsLostDeltaPerSecond:f,bitrateBitsPerSecond:d*8,bitrate:d},l)}),outbounds:n.output.video.map(w=>{var g=w,{packetLossRatio:a,packetLossDelta:f,bitrate:d}=g,l=gt(g,["packetLossRatio","packetLossDelta","bitrate"]);return se({packetsLostRatioPerSecond:a,packetsLostDeltaPerSecond:f,bitrateBitsPerSecond:d*8,bitrate:d},l)})},raw:n.rawStats})};class Js extends Nt{constructor(e,t={statsIntervalMs:1e3,autoInitStats:!0}){super(),this.peer=e,this.collection=null,this.initialized=!1,t.autoInitStats&&this.init(t.statsIntervalMs)}init(e){if(this.initialized){bt.warn("PeerConnectionStats.init() has already been called. Automatic initialization occurs when the PeerConnectionStats object is constructed.");return}bt.info("Initializing peer connection stats");const t=this.peer;try{this.collection=new Xs.WebRTCStats({getStatsInterval:e,getStats:()=>t.getStats(),includeRawStats:!0}),this.collection.on("stats",r=>{const i=Ys(r);Ae.addStats(i),this.emit(ei.stats,i)}),this.collection.start(),this.initialized=!0}catch(r){bt.error(r)}}parseStats(e){return bt.warn("The parseStats method is deprecated and will be removed in future releases."),null}stop(){bt.info("Stopping peer connection stats"),this.collection.stop()}}var ge={},Ge={},fr={},hr={exports:{}},ti;function ri(){if(ti)return hr.exports;ti=1;var n=hr.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":"",t}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(n).forEach(function(e){var t=n[e];t.forEach(function(r){r.reg||(r.reg=/(.*)/),r.format||(r.format="%s")})}),hr.exports}var ni;function Zs(){return ni||(ni=1,function(n){var e=function(a){return String(Number(a))===a?Number(a):a},t=function(a,f,d,l){if(l&&!d)f[l]=e(a[1]);else for(var w=0;w<d.length;w+=1)a[w+1]!=null&&(f[d[w]]=e(a[w+1]))},r=function(a,f,d){var l=a.name&&a.names;a.push&&!f[a.push]?f[a.push]=[]:l&&!f[a.name]&&(f[a.name]={});var w=a.push?{}:l?f[a.name]:f;t(d.match(a.reg),w,a.names,a.name),a.push&&f[a.push].push(w)},i=ri(),o=RegExp.prototype.test.bind(/^([a-z])=(.*)/);n.parse=function(a){var f={},d=[],l=f;return a.split(/(\r\n|\r|\n)/).filter(o).forEach(function(w){var g=w[0],p=w.slice(2);g==="m"&&(d.push({rtp:[],fmtp:[]}),l=d[d.length-1]);for(var m=0;m<(i[g]||[]).length;m+=1){var I=i[g][m];if(I.reg.test(p))return r(I,l,p)}}),f.media=d,f};var c=function(a,f){var d=f.split(/=(.+)/,2);return d.length===2?a[d[0]]=e(d[1]):d.length===1&&f.length>1&&(a[d[0]]=void 0),a};n.parseParams=function(a){return a.split(/;\s?/).reduce(c,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(a){return a.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(a){for(var f=[],d=a.split(" ").map(e),l=0;l<d.length;l+=3)f.push({component:d[l],ip:d[l+1],port:d[l+2]});return f},n.parseImageAttributes=function(a){return a.split(" ").map(function(f){return f.substring(1,f.length-1).split(",").reduce(c,{})})},n.parseSimulcastStreamList=function(a){return a.split(";").map(function(f){return f.split(",").map(function(d){var l,w=!1;return d[0]!=="~"?l=e(d):(l=e(d.substring(1,d.length)),w=!0),{scid:l,paused:w}})})}}(fr)),fr}var pr,ii;function Qs(){if(ii)return pr;ii=1;var n=ri(),e=/%[sdv%]/g,t=function(c){var a=1,f=arguments,d=f.length;return c.replace(e,function(l){if(a>=d)return l;var w=f[a];switch(a+=1,l){case"%%":return"%";case"%s":return String(w);case"%d":return Number(w);case"%v":return""}})},r=function(c,a,f){var d=a.format instanceof Function?a.format(a.push?f:f[a.name]):a.format,l=[c+"="+d];if(a.names)for(var w=0;w<a.names.length;w+=1){var g=a.names[w];a.name?l.push(f[a.name][g]):l.push(f[a.names[w]])}else l.push(f[a.name]);return t.apply(null,l)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],o=["i","c","b","a"];return pr=function(c,a){a=a||{},c.version==null&&(c.version=0),c.name==null&&(c.name=" "),c.media.forEach(function(w){w.payloads==null&&(w.payloads="")});var f=a.outerOrder||i,d=a.innerOrder||o,l=[];return f.forEach(function(w){n[w].forEach(function(g){g.name in c&&c[g.name]!=null?l.push(r(w,g,c)):g.push in c&&c[g.push]!=null&&c[g.push].forEach(function(p){l.push(r(w,g,p))})})}),c.media.forEach(function(w){l.push(r("m",n.m[0],w)),d.forEach(function(g){n[g].forEach(function(p){p.name in w&&w[p.name]!=null?l.push(r(g,p,w)):p.push in w&&w[p.push]!=null&&w[p.push].forEach(function(m){l.push(r(g,p,m))})})})}),l.join("\r\n")+"\r\n"},pr}var si;function eo(){if(si)return Ge;si=1;var n=Zs(),e=Qs();return Ge.write=e,Ge.parse=n.parse,Ge.parseParams=n.parseParams,Ge.parseFmtpConfig=n.parseFmtpConfig,Ge.parsePayloads=n.parsePayloads,Ge.parseRemoteCandidates=n.parseRemoteCandidates,Ge.parseImageAttributes=n.parseImageAttributes,Ge.parseSimulcastStreamList=n.parseSimulcastStreamList,Ge}var mr,oi;function to(){return oi||(oi=1,mr=function(n){const e=new Intl.Collator(n,{sensitivity:"base"});return(t,r)=>e.compare(t,r)==0}),mr}var gr,ai;function ci(){if(ai)return gr;ai=1;class n{constructor(t,r,i,o,c,a,f,d,l){this.foundation=t,this.componentId=r,this.transport=i,this.priority=o,this.address=c,this.port=a,this.type=f,this.relAddr=d,this.relPort=l}equals(t){return t.foundation===this.foundation&&t.componentId===this.componentId&&t.transport===this.transport&&t.priority===this.priority&&t.address===this.address&&t.port===this.port&&t.type===this.type&&t.relAddr===this.relAddr&&t.relPort===this.relPort}clone(){return new n(this.foundation,this.componentId,this.transport,this.priority,this.address,this.port,this.type,this.relAddr,this.relPort)}plain(){const t={foundation:this.foundation,componentId:this.componentId,transport:this.transport,priority:this.priority,address:this.address,port:this.port,type:this.type};return this.relAddr&&(t.relAddr=this.relAddr),this.relPort&&(t.relPort=this.relPort),t}getFoundation(){return this.foundation}getComponentId(){return this.componentId}getTransport(){return this.transport}getPriority(){return this.priority}getAddress(){return this.address}getPort(){return this.port}getType(){return this.type}getRelAddr(){return this.relAddr}getRelPort(){return this.relPort}}return n.expand=function(e){return e.constructor.name==="CandidateInfo"?e:(e=e,new n(e.foundation,e.componentId,e.transport,e.priority,e.address,e.port,e.type,e.relAddr,e.relPort))},n.clone=function(e){return e.constructor.name==="CandidateInfo"?e.clone():n.expand(e)},gr=n,gr}var yr,ui;function jt(){if(ui)return yr;ui=1;class n{constructor(t,r){this.id=t,this.params=r||[]}clone(){return new n(this.id,this.params)}plain(){return this.params.length?{id:this.id,params:this.params}:{id:this.id}}getId(){return this.id}getParams(){return this.params}}return n.expand=function(e){return e.constructor.name==="RTCPFeedbackInfo"?e:(e=e,new n(e.id,e.params))},n.clone=function(e){return e.constructor.name==="RTCPFeedbackInfo"?e.clone():n.expand(e)},yr=n,yr}var wr,di;function qt(){if(di)return wr;di=1;const n=jt();class e{constructor(r,i,o){this.codec=r,this.type=i,this.params={},this.rtcpfbs=new Set,o&&this.addParams(o)}clone(){const r=new e(this.codec,this.type,this.params);this.hasRTX()&&r.setRTX(this.getRTX());for(const i of this.rtcpfbs)r.addRTCPFeedback(i.clone());return this.hasChannels()&&r.setChannels(this.getChannels()),r}plain(){const r={codec:this.codec,type:this.type};this.rtx&&(r.rtx=this.rtx),this.channels&&(r.channels=this.channels),Object.keys(this.params).length&&(r.params=this.params);for(const i of this.rtcpfbs)r.rtcpfbs||(r.rtcpfbs=[]),r.rtcpfbs.push(i.plain());return r}setRTX(r){this.rtx=r}getType(){return this.type}setType(r){this.type=r}getCodec(){return this.codec}getParams(){return this.params}addParams(r){for(const i in r)this.params[i]=r[i]}addParam(r,i){this.params[r]=i}hasParam(r){return Object.hasOwnProperty.call(this.params,r)}getParam(r,i=void 0){if(this.hasParam(r))return this.params[r];if(i===void 0)throw new Error("param ".concat(r," not found and no default value provided"));return""+i}hasRTX(){return this.rtx}getRTX(){return this.rtx}hasChannels(){return this.channels}getChannels(){return this.channels}setChannels(r){this.channels=r}addRTCPFeedback(r){this.rtcpfbs.add(r)}getRTCPFeedbacks(){return this.rtcpfbs}}return e.expand=function(t){if(t.constructor.name==="CodecInfo")return t;t=t;const r=new e(t.codec,t.type,t.params);t.rtx&&r.setRTX(t.rtx),t.channels&&r.setChannels(t.channels);for(const i of t.rtcpfbs||[]){const o=n.expand(i);r.addRTCPFeedback(o)}return r},e.clone=function(t){return t.constructor.name==="CodecInfo"?t.clone():e.expand(t)},e.MapFromNames=function(t,r,i){var o;const c=new Map;let a=96;for(const f of t){let d;const l=f.split(";"),w=l.shift().toLowerCase().trim();w==="pcmu"?d=0:w==="pcma"?d=8:d=++a;const g=new e(w,d);w==="opus"?g.setChannels(2):w==="multiopus"&&g.setChannels(6),r&&w!=="ulpfec"&&w!=="flexfec-03"&&w!=="red"&&g.setRTX(++a);for(const p of i||[])g.addRTCPFeedback(new n(p.id,p.params));for(const p of l){let m=p.split("=");g.addParam(m[0].trim(),(o=m[1])===null||o===void 0?void 0:o.trim())}c.set(d,g)}return c},wr=e,wr}var vr,li;function br(){if(li)return vr;li=1;function n(){var e=this;if(!(this instanceof n))return new(Function.prototype.bind.apply(n,[null].concat(Array.prototype.slice.call(arguments))));Array.from(arguments).forEach(function(t){e[t]=Symbol.for("MEDOOZE_SEMANTIC_SDP_"+t)})}return vr=n,vr}var Sr,fi;function Ir(){if(fi)return Sr;fi=1;const e=br()("ACTIVE","PASSIVE","ACTPASS","INACTIVE");return e.byValue=function(t){switch(t){case e.ACTIVE:case e.PASSIVE:case e.ACTPASS:case e.INACTIVE:return t}return e[t.toUpperCase()]},e.toString=function(t){switch(t){case e.ACTIVE:return"active";case e.PASSIVE:return"passive";case e.ACTPASS:return"actpass";case e.INACTIVE:return"inactive"}},e.reverse=function(t,r){switch(t){case e.ACTIVE:return e.PASSIVE;case e.PASSIVE:return e.ACTIVE;case e.ACTPASS:return r?e.ACTIVE:e.PASSIVE;case e.INACTIVE:return e.INACTIVE}},Sr=e,Sr}var Er,hi;function pi(){if(hi)return Er;hi=1;const n=Ir();class e{constructor(r,i,o){this.setup=r,this.hash=i,this.fingerprint=o}clone(){return new e(this.setup,this.hash,this.fingerprint)}plain(){return{setup:n.toString(this.setup),hash:this.hash,fingerprint:this.fingerprint}}getFingerprint(){return this.fingerprint}getHash(){return this.hash}getSetup(){return this.setup}setSetup(r){this.setup=r}}return e.expand=function(t){return t.constructor.name==="DTLSInfo"?t:(t=t,new e(t.setup?n.byValue(t.setup):n.ACTPASS,t.hash,t.fingerprint))},e.clone=function(t){return t.constructor.name==="DTLSInfo"?t.clone():e.expand(t)},Er=e,Er}var Cr,mi;function gi(){if(mi)return Cr;mi=1;class n{constructor(t,r,i,o){this.tag=t,this.suite=r,this.keyParams=i,this.sessionParams=o}clone(){return new n(this.tag,this.suite,this.keyParams,this.sessionParams)}plain(){return{tag:this.tag,suite:this.suite,keyParams:this.keyParams,sessionParams:this.sessionParams}}getSessionParams(){return this.sessionParams}getKeyParams(){r