diff --git a/404.html b/404.html
index c419948..72d436e 100644
--- a/404.html
+++ b/404.html
@@ -30,7 +30,7 @@
})();
-
+
diff --git a/assets/index-cda1b36e.js b/assets/index-3de0e7e6.js
similarity index 66%
rename from assets/index-cda1b36e.js
rename to assets/index-3de0e7e6.js
index 740caf8..6991c88 100644
--- a/assets/index-cda1b36e.js
+++ b/assets/index-3de0e7e6.js
@@ -22,7 +22,7 @@ function _mergeNamespaces(a,o){for(var _e=0;_e>>1,cn=Ft[yn];if(0>>1;ynct(fn,vn))Tnct(_n,fn)?(Ft[yn]=_n,Ft[Tn]=vn,yn=Tn):(Ft[yn]=fn,Ft[bn]=vn,yn=bn);else if(Tnct(_n,vn))Ft[yn]=_n,Ft[Tn]=vn,yn=Tn;else break e}}return un}function ct(Ft,un){var vn=Ft.sortIndex-un.sortIndex;return vn!==0?vn:Ft.id-un.id}if(typeof performance=="object"&&typeof performance.now=="function"){var gt=performance;a.unstable_now=function(){return gt.now()}}else{var rt=Date,it=rt.now();a.unstable_now=function(){return rt.now()-it}}var s=[],et=[],nt=1,at=null,ht=3,dt=!1,ut=!1,lt=!1,mt=typeof setTimeout=="function"?setTimeout:null,ot=typeof clearTimeout=="function"?clearTimeout:null,pt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ft(Ft){for(var un=_e(et);un!==null;){if(un.callback===null)tt(et);else if(un.startTime<=Ft)tt(et),un.sortIndex=un.expirationTime,o(s,un);else break;un=_e(et)}}function yt(Ft){if(lt=!1,ft(Ft),!ut)if(_e(s)!==null)ut=!0,nn(vt);else{var un=_e(et);un!==null&&zt(yt,un.startTime-Ft)}}function vt(Ft,un){ut=!1,lt&&(lt=!1,ot(Nt),Nt=-1),dt=!0;var vn=ht;try{for(ft(un),at=_e(s);at!==null&&(!(at.expirationTime>un)||Ft&&!Mt());){var yn=at.callback;if(typeof yn=="function"){at.callback=null,ht=at.priorityLevel;var cn=yn(at.expirationTime<=un);un=a.unstable_now(),typeof cn=="function"?at.callback=cn:at===_e(s)&&tt(s),ft(un)}else tt(s);at=_e(s)}if(at!==null)var gn=!0;else{var bn=_e(et);bn!==null&&zt(yt,bn.startTime-un),gn=!1}return gn}finally{at=null,ht=vn,dt=!1}}var bt=!1,At=null,Nt=-1,St=5,wt=-1;function Mt(){return!(a.unstable_now()-wtFt||125yn?(Ft.sortIndex=vn,o(et,Ft),_e(s)===null&&Ft===_e(et)&&(lt?(ot(Nt),Nt=-1):lt=!0,zt(yt,vn-yn))):(Ft.sortIndex=cn,o(s,Ft),ut||dt||(ut=!0,nn(vt))),Ft},a.unstable_shouldYield=Mt,a.unstable_wrapCallback=function(Ft){var un=ht;return function(){var vn=ht;ht=un;try{return Ft.apply(this,arguments)}finally{ht=vn}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/**
+ */(function(a){function o(Ft,un){var vn=Ft.length;Ft.push(un);e:for(;0>>1,cn=Ft[yn];if(0>>1;ynct(fn,vn))Tnct(On,fn)?(Ft[yn]=On,Ft[Tn]=vn,yn=Tn):(Ft[yn]=fn,Ft[Cn]=vn,yn=Cn);else if(Tnct(On,vn))Ft[yn]=On,Ft[Tn]=vn,yn=Tn;else break e}}return un}function ct(Ft,un){var vn=Ft.sortIndex-un.sortIndex;return vn!==0?vn:Ft.id-un.id}if(typeof performance=="object"&&typeof performance.now=="function"){var gt=performance;a.unstable_now=function(){return gt.now()}}else{var rt=Date,it=rt.now();a.unstable_now=function(){return rt.now()-it}}var s=[],et=[],nt=1,at=null,ht=3,dt=!1,pt=!1,lt=!1,mt=typeof setTimeout=="function"?setTimeout:null,ot=typeof clearTimeout=="function"?clearTimeout:null,ut=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ft(Ft){for(var un=_e(et);un!==null;){if(un.callback===null)tt(et);else if(un.startTime<=Ft)tt(et),un.sortIndex=un.expirationTime,o(s,un);else break;un=_e(et)}}function bt(Ft){if(lt=!1,ft(Ft),!pt)if(_e(s)!==null)pt=!0,nn(vt);else{var un=_e(et);un!==null&&zt(bt,un.startTime-Ft)}}function vt(Ft,un){pt=!1,lt&&(lt=!1,ot(Nt),Nt=-1),dt=!0;var vn=ht;try{for(ft(un),at=_e(s);at!==null&&(!(at.expirationTime>un)||Ft&&!Mt());){var yn=at.callback;if(typeof yn=="function"){at.callback=null,ht=at.priorityLevel;var cn=yn(at.expirationTime<=un);un=a.unstable_now(),typeof cn=="function"?at.callback=cn:at===_e(s)&&tt(s),ft(un)}else tt(s);at=_e(s)}if(at!==null)var gn=!0;else{var Cn=_e(et);Cn!==null&&zt(bt,Cn.startTime-un),gn=!1}return gn}finally{at=null,ht=vn,dt=!1}}var yt=!1,At=null,Nt=-1,St=5,wt=-1;function Mt(){return!(a.unstable_now()-wtFt||125yn?(Ft.sortIndex=vn,o(et,Ft),_e(s)===null&&Ft===_e(et)&&(lt?(ot(Nt),Nt=-1):lt=!0,zt(bt,vn-yn))):(Ft.sortIndex=cn,o(s,Ft),pt||dt||(pt=!0,nn(vt))),Ft},a.unstable_shouldYield=Mt,a.unstable_wrapCallback=function(Ft){var un=ht;return function(){var vn=ht;ht=un;try{return Ft.apply(this,arguments)}finally{ht=vn}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/**
* @license React
* react-dom.production.min.js
*
@@ -34,10 +34,10 @@ function _mergeNamespaces(a,o){for(var _e=0;_eit||ct[rt]!==gt[it]){var s=`
-`+ct[rt].replace(" at new "," at ");return a.displayName&&s.includes("")&&(s=s.replace("",a.displayName)),s}while(1<=rt&&0<=it);break}}}finally{Na=!1,Error.prepareStackTrace=_e}return(a=a?a.displayName||a.name:"")?Ma(a):""}function Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}}function Qa(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case Ga:return o=a.displayName||null,o!==null?o:Qa(a.type)||"Memo";case Ha:o=a._payload,a=a._init;try{return Qa(a(o))}catch{}}return null}function Ra(a){var o=a.type;switch(a.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=o.render,a=a.displayName||a.name||"",o.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(o);case 8:return o===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Sa(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Ta(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ua(a){var o=Ta(a)?"checked":"value",_e=Object.getOwnPropertyDescriptor(a.constructor.prototype,o),tt=""+a[o];if(!a.hasOwnProperty(o)&&typeof _e<"u"&&typeof _e.get=="function"&&typeof _e.set=="function"){var ct=_e.get,gt=_e.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return ct.call(this)},set:function(rt){tt=""+rt,gt.call(this,rt)}}),Object.defineProperty(a,o,{enumerable:_e.enumerable}),{getValue:function(){return tt},setValue:function(rt){tt=""+rt},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var _e=o.getValue(),tt="";return a&&(tt=Ta(a)?a.checked?"true":"false":a.value),a=tt,a!==_e?(o.setValue(a),!0):!1}function Xa(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ya(a,o){var _e=o.checked;return A$3({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:_e??a._wrapperState.initialChecked})}function Za(a,o){var _e=o.defaultValue==null?"":o.defaultValue,tt=o.checked!=null?o.checked:o.defaultChecked;_e=Sa(o.value!=null?o.value:_e),a._wrapperState={initialChecked:tt,initialValue:_e,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ab(a,o){o=o.checked,o!=null&&ta(a,"checked",o,!1)}function bb(a,o){ab(a,o);var _e=Sa(o.value),tt=o.type;if(_e!=null)tt==="number"?(_e===0&&a.value===""||a.value!=_e)&&(a.value=""+_e):a.value!==""+_e&&(a.value=""+_e);else if(tt==="submit"||tt==="reset"){a.removeAttribute("value");return}o.hasOwnProperty("value")?cb(a,o.type,_e):o.hasOwnProperty("defaultValue")&&cb(a,o.type,Sa(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(a.defaultChecked=!!o.defaultChecked)}function db(a,o,_e){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var tt=o.type;if(!(tt!=="submit"&&tt!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+a._wrapperState.initialValue,_e||o===a.value||(a.value=o),a.defaultValue=o}_e=a.name,_e!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,_e!==""&&(a.name=_e)}function cb(a,o,_e){(o!=="number"||Xa(a.ownerDocument)!==a)&&(_e==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+_e&&(a.defaultValue=""+_e))}var eb=Array.isArray;function fb(a,o,_e,tt){if(a=a.options,o){o={};for(var ct=0;ct<_e.length;ct++)o["$"+_e[ct]]=!0;for(_e=0;_e"+o.valueOf().toString()+"",o=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;o.firstChild;)a.appendChild(o.firstChild)}});function ob(a,o){if(o){var _e=a.firstChild;if(_e&&_e===a.lastChild&&_e.nodeType===3){_e.nodeValue=o;return}}a.textContent=o}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(o){o=o+a.charAt(0).toUpperCase()+a.substring(1),pb[o]=pb[a]})});function rb(a,o,_e){return o==null||typeof o=="boolean"||o===""?"":_e||typeof o!="number"||o===0||pb.hasOwnProperty(a)&&pb[a]?(""+o).trim():o+"px"}function sb(a,o){a=a.style;for(var _e in o)if(o.hasOwnProperty(_e)){var tt=_e.indexOf("--")===0,ct=rb(_e,o[_e],tt);_e==="float"&&(_e="cssFloat"),tt?a.setProperty(_e,ct):a[_e]=ct}}var tb=A$3({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(a,o){if(o){if(tb[a]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(p$2(137,a));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(p$2(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(p$2(61))}if(o.style!=null&&typeof o.style!="object")throw Error(p$2(62))}}function vb(a,o){if(a.indexOf("-")===-1)return typeof o.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var yb=null,zb=null,Ab=null;function Bb(a){if(a=Cb(a)){if(typeof yb!="function")throw Error(p$2(280));var o=a.stateNode;o&&(o=Db(o),yb(a.stateNode,a.type,o))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,o=Ab;if(Ab=zb=null,Bb(a),o)for(a=0;a>>=0,a===0?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function uc(a,o){var _e=a.pendingLanes;if(_e===0)return 0;var tt=0,ct=a.suspendedLanes,gt=a.pingedLanes,rt=_e&268435455;if(rt!==0){var it=rt&~ct;it!==0?tt=tc(it):(gt&=rt,gt!==0&&(tt=tc(gt)))}else rt=_e&~ct,rt!==0?tt=tc(rt):gt!==0&&(tt=tc(gt));if(tt===0)return 0;if(o!==0&&o!==tt&&!(o&ct)&&(ct=tt&-tt,gt=o&-o,ct>=gt||ct===16&&(gt&4194240)!==0))return o;if(tt&4&&(tt|=_e&16),o=a.entangledLanes,o!==0)for(a=a.entanglements,o&=tt;0_e;_e++)o.push(a);return o}function Ac(a,o,_e){a.pendingLanes|=o,o!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,o=31-oc(o),a[o]=_e}function Bc(a,o){var _e=a.pendingLanes&~o;a.pendingLanes=o,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=o,a.mutableReadLanes&=o,a.entangledLanes&=o,o=a.entanglements;var tt=a.eventTimes;for(a=a.expirationTimes;0<_e;){var ct=31-oc(_e),gt=1<=be),ee$1=String.fromCharCode(32),fe=!1;function ge(a,o){switch(a){case"keyup":return $d.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ie=!1;function je(a,o){switch(a){case"compositionend":return he(o);case"keypress":return o.which!==32?null:(fe=!0,ee$1);case"textInput":return a=o.data,a===ee$1&&fe?null:a;default:return null}}function ke(a,o){if(ie)return a==="compositionend"||!ae&&ge(a,o)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:_e,offset:o-a};a=tt}e:{for(;_e;){if(_e.nextSibling){_e=_e.nextSibling;break e}_e=_e.parentNode}_e=void 0}_e=Je(_e)}}function Le(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?Le(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Me(){for(var a=window,o=Xa();o instanceof a.HTMLIFrameElement;){try{var _e=typeof o.contentWindow.location.href=="string"}catch{_e=!1}if(_e)a=o.contentWindow;else break;o=Xa(a.document)}return o}function Ne(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}function Oe(a){var o=Me(),_e=a.focusedElem,tt=a.selectionRange;if(o!==_e&&_e&&_e.ownerDocument&&Le(_e.ownerDocument.documentElement,_e)){if(tt!==null&&Ne(_e)){if(o=tt.start,a=tt.end,a===void 0&&(a=o),"selectionStart"in _e)_e.selectionStart=o,_e.selectionEnd=Math.min(a,_e.value.length);else if(a=(o=_e.ownerDocument||document)&&o.defaultView||window,a.getSelection){a=a.getSelection();var ct=_e.textContent.length,gt=Math.min(tt.start,ct);tt=tt.end===void 0?gt:Math.min(tt.end,ct),!a.extend&>>tt&&(ct=tt,tt=gt,gt=ct),ct=Ke(_e,gt);var rt=Ke(_e,tt);ct&&rt&&(a.rangeCount!==1||a.anchorNode!==ct.node||a.anchorOffset!==ct.offset||a.focusNode!==rt.node||a.focusOffset!==rt.offset)&&(o=o.createRange(),o.setStart(ct.node,ct.offset),a.removeAllRanges(),gt>tt?(a.addRange(o),a.extend(rt.node,rt.offset)):(o.setEnd(rt.node,rt.offset),a.addRange(o)))}}for(o=[],a=_e;a=a.parentNode;)a.nodeType===1&&o.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof _e.focus=="function"&&_e.focus(),_e=0;_e=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(a,o,_e){var tt=_e.window===_e?_e.document:_e.nodeType===9?_e:_e.ownerDocument;Te||Qe==null||Qe!==Xa(tt)||(tt=Qe,"selectionStart"in tt&&Ne(tt)?tt={start:tt.selectionStart,end:tt.selectionEnd}:(tt=(tt.ownerDocument&&tt.ownerDocument.defaultView||window).getSelection(),tt={anchorNode:tt.anchorNode,anchorOffset:tt.anchorOffset,focusNode:tt.focusNode,focusOffset:tt.focusOffset}),Se&&Ie(Se,tt)||(Se=tt,tt=oe(Re,"onSelect"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$1(a,o){Tf++,Sf[Tf]=a.current,a.current=o}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,o){var _e=a.type.contextTypes;if(!_e)return Vf;var tt=a.stateNode;if(tt&&tt.__reactInternalMemoizedUnmaskedChildContext===o)return tt.__reactInternalMemoizedMaskedChildContext;var ct={},gt;for(gt in _e)ct[gt]=o[gt];return tt&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=o,a.__reactInternalMemoizedMaskedChildContext=ct),ct}function Zf(a){return a=a.childContextTypes,a!=null}function $f(){E$1(Wf),E$1(H)}function ag(a,o,_e){if(H.current!==Vf)throw Error(p$2(168));G$1(H,o),G$1(Wf,_e)}function bg(a,o,_e){var tt=a.stateNode;if(o=o.childContextTypes,typeof tt.getChildContext!="function")return _e;tt=tt.getChildContext();for(var ct in tt)if(!(ct in o))throw Error(p$2(108,Ra(a)||"Unknown",ct));return A$3({},_e,tt)}function cg(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G$1(H,a),G$1(Wf,Wf.current),!0}function dg(a,o,_e){var tt=a.stateNode;if(!tt)throw Error(p$2(169));_e?(a=bg(a,o,Xf),tt.__reactInternalMemoizedMergedChildContext=a,E$1(Wf),E$1(H),G$1(H,a)):E$1(Wf),G$1(Wf,_e)}var eg=null,fg=!1,gg=!1;function hg(a){eg===null?eg=[a]:eg.push(a)}function ig(a){fg=!0,hg(a)}function jg(){if(!gg&&eg!==null){gg=!0;var a=0,o=C$1;try{var _e=eg;for(C$1=1;a<_e.length;a++){var tt=_e[a];do tt=tt(!0);while(tt!==null)}eg=null,fg=!1}catch(ct){throw eg!==null&&(eg=eg.slice(a+1)),ac(fc,jg),ct}finally{C$1=o,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(a,o){kg[lg++]=ng,kg[lg++]=mg,mg=a,ng=o}function ug(a,o,_e){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=a;var tt=rg;a=sg;var ct=32-oc(tt)-1;tt&=~(1<>=rt,ct-=rt,rg=1<<32-oc(o)+ct|_e<Nt?(St=At,At=null):St=At.sibling;var wt=ht(ot,At,ft[Nt],yt);if(wt===null){At===null&&(At=St);break}a&&At&&wt.alternate===null&&o(ot,At),pt=gt(wt,pt,Nt),bt===null?vt=wt:bt.sibling=wt,bt=wt,At=St}if(Nt===ft.length)return _e(ot,At),I&&tg(ot,Nt),vt;if(At===null){for(;NtNt?(St=At,At=null):St=At.sibling;var Mt=ht(ot,At,wt.value,yt);if(Mt===null){At===null&&(At=St);break}a&&At&&Mt.alternate===null&&o(ot,At),pt=gt(Mt,pt,Nt),bt===null?vt=Mt:bt.sibling=Mt,bt=Mt,At=St}if(wt.done)return _e(ot,At),I&&tg(ot,Nt),vt;if(At===null){for(;!wt.done;Nt++,wt=ft.next())wt=at(ot,wt.value,yt),wt!==null&&(pt=gt(wt,pt,Nt),bt===null?vt=wt:bt.sibling=wt,bt=wt);return I&&tg(ot,Nt),vt}for(At=tt(ot,At);!wt.done;Nt++,wt=ft.next())wt=dt(At,ot,Nt,wt.value,yt),wt!==null&&(a&&wt.alternate!==null&&At.delete(wt.key===null?Nt:wt.key),pt=gt(wt,pt,Nt),bt===null?vt=wt:bt.sibling=wt,bt=wt);return a&&At.forEach(function(Ht){return o(ot,Ht)}),I&&tg(ot,Nt),vt}function mt(ot,pt,ft,yt){if(typeof ft=="object"&&ft!==null&&ft.type===ya&&ft.key===null&&(ft=ft.props.children),typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case va:e:{for(var vt=ft.key,bt=pt;bt!==null;){if(bt.key===vt){if(vt=ft.type,vt===ya){if(bt.tag===7){_e(ot,bt.sibling),pt=ct(bt,ft.props.children),pt.return=ot,ot=pt;break e}}else if(bt.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===Ha&&uh(vt)===bt.type){_e(ot,bt.sibling),pt=ct(bt,ft.props),pt.ref=sh(ot,bt,ft),pt.return=ot,ot=pt;break e}_e(ot,bt);break}else o(ot,bt);bt=bt.sibling}ft.type===ya?(pt=Ah(ft.props.children,ot.mode,yt,ft.key),pt.return=ot,ot=pt):(yt=yh(ft.type,ft.key,ft.props,null,ot.mode,yt),yt.ref=sh(ot,pt,ft),yt.return=ot,ot=yt)}return rt(ot);case wa:e:{for(bt=ft.key;pt!==null;){if(pt.key===bt)if(pt.tag===4&&pt.stateNode.containerInfo===ft.containerInfo&&pt.stateNode.implementation===ft.implementation){_e(ot,pt.sibling),pt=ct(pt,ft.children||[]),pt.return=ot,ot=pt;break e}else{_e(ot,pt);break}else o(ot,pt);pt=pt.sibling}pt=zh(ft,ot.mode,yt),pt.return=ot,ot=pt}return rt(ot);case Ha:return bt=ft._init,mt(ot,pt,bt(ft._payload),yt)}if(eb(ft))return ut(ot,pt,ft,yt);if(Ka(ft))return lt(ot,pt,ft,yt);th(ot,ft)}return typeof ft=="string"&&ft!==""||typeof ft=="number"?(ft=""+ft,pt!==null&&pt.tag===6?(_e(ot,pt.sibling),pt=ct(pt,ft),pt.return=ot,ot=pt):(_e(ot,pt),pt=xh(ft,ot.mode,yt),pt.return=ot,ot=pt),rt(ot)):_e(ot,pt)}return mt}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p$2(174));return a}function Ih(a,o){switch(G$1(Gh,o),G$1(Fh,a),G$1(Eh,Dh),a=o.nodeType,a){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:lb(null,"");break;default:a=a===8?o.parentNode:o,o=a.namespaceURI||null,a=a.tagName,o=lb(o,a)}E$1(Eh),G$1(Eh,o)}function Jh(){E$1(Eh),E$1(Fh),E$1(Gh)}function Kh(a){Hh(Gh.current);var o=Hh(Eh.current),_e=lb(o,a.type);o!==_e&&(G$1(Fh,a),G$1(Eh,_e))}function Lh(a){Fh.current===a&&(E$1(Eh),E$1(Fh))}var M$1=Uf(0);function Mh(a){for(var o=a;o!==null;){if(o.tag===13){var _e=o.memoizedState;if(_e!==null&&(_e=_e.dehydrated,_e===null||_e.data==="$?"||_e.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Nh=[];function Oh(){for(var a=0;a_e?_e:4,a(!0);var tt=Qh.transition;Qh.transition={};try{a(!1),o()}finally{C$1=_e,Qh.transition=tt}}function Fi(){return di().memoizedState}function Gi(a,o,_e){var tt=lh(a);if(_e={lane:tt,action:_e,hasEagerState:!1,eagerState:null,next:null},Hi(a))Ii(o,_e);else if(_e=Yg(a,o,_e,tt),_e!==null){var ct=L();mh(_e,a,tt,ct),Ji(_e,o,tt)}}function ri(a,o,_e){var tt=lh(a),ct={lane:tt,action:_e,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(o,ct);else{var gt=a.alternate;if(a.lanes===0&&(gt===null||gt.lanes===0)&&(gt=o.lastRenderedReducer,gt!==null))try{var rt=o.lastRenderedState,it=gt(rt,_e);if(ct.hasEagerState=!0,ct.eagerState=it,He(it,rt)){var s=o.interleaved;s===null?(ct.next=ct,Xg(o)):(ct.next=s.next,s.next=ct),o.interleaved=ct;return}}catch{}finally{}_e=Yg(a,o,ct,tt),_e!==null&&(ct=L(),mh(_e,a,tt,ct),Ji(_e,o,tt))}}function Hi(a){var o=a.alternate;return a===N$1||o!==null&&o===N$1}function Ii(a,o){Th=Sh=!0;var _e=a.pending;_e===null?o.next=o:(o.next=_e.next,_e.next=o),a.pending=o}function Ji(a,o,_e){if(_e&4194240){var tt=o.lanes;tt&=a.pendingLanes,_e|=tt,o.lanes=_e,Cc(a,_e)}}var ai={readContext:Vg,useCallback:Q$1,useContext:Q$1,useEffect:Q$1,useImperativeHandle:Q$1,useInsertionEffect:Q$1,useLayoutEffect:Q$1,useMemo:Q$1,useReducer:Q$1,useRef:Q$1,useState:Q$1,useDebugValue:Q$1,useDeferredValue:Q$1,useTransition:Q$1,useMutableSource:Q$1,useSyncExternalStore:Q$1,useId:Q$1,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,o){return ci().memoizedState=[a,o===void 0?null:o],a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,o,_e){return _e=_e!=null?_e.concat([a]):null,ti(4194308,4,yi.bind(null,o,a),_e)},useLayoutEffect:function(a,o){return ti(4194308,4,a,o)},useInsertionEffect:function(a,o){return ti(4,2,a,o)},useMemo:function(a,o){var _e=ci();return o=o===void 0?null:o,a=a(),_e.memoizedState=[a,o],a},useReducer:function(a,o,_e){var tt=ci();return o=_e!==void 0?_e(o):o,tt.memoizedState=tt.baseState=o,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:o},tt.queue=a,a=a.dispatch=Gi.bind(null,N$1,a),[tt.memoizedState,a]},useRef:function(a){var o=ci();return a={current:a},o.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),o=a[0];return a=Ei.bind(null,a[1]),ci().memoizedState=a,[o,a]},useMutableSource:function(){},useSyncExternalStore:function(a,o,_e){var tt=N$1,ct=ci();if(I){if(_e===void 0)throw Error(p$2(407));_e=_e()}else{if(_e=o(),R$1===null)throw Error(p$2(349));Rh&30||ni(tt,o,_e)}ct.memoizedState=_e;var gt={value:_e,getSnapshot:o};return ct.queue=gt,vi(ki.bind(null,tt,gt,a),[a]),tt.flags|=2048,li(9,mi.bind(null,tt,gt,_e,o),void 0,null),_e},useId:function(){var a=ci(),o=R$1.identifierPrefix;if(I){var _e=sg,tt=rg;_e=(tt&~(1<<32-oc(tt)-1)).toString(32)+_e,o=":"+o+"R"+_e,_e=Uh++,0<_e&&(o+="H"+_e.toString(32)),o+=":"}else _e=Vh++,o=":"+o+"r"+_e.toString(32)+":";return a.memoizedState=o},unstable_isNewReconciler:!1},Zh={readContext:Vg,useCallback:Bi,useContext:Vg,useEffect:ji,useImperativeHandle:zi,useInsertionEffect:wi,useLayoutEffect:xi,useMemo:Ci,useReducer:fi,useRef:si,useState:function(){return fi(ei)},useDebugValue:Ai,useDeferredValue:function(a){var o=di();return Di(o,O$1.memoizedState,a)},useTransition:function(){var a=fi(ei)[0],o=di().memoizedState;return[a,o]},useMutableSource:hi,useSyncExternalStore:ii,useId:Fi,unstable_isNewReconciler:!1},$h={readContext:Vg,useCallback:Bi,useContext:Vg,useEffect:ji,useImperativeHandle:zi,useInsertionEffect:wi,useLayoutEffect:xi,useMemo:Ci,useReducer:gi,useRef:si,useState:function(){return gi(ei)},useDebugValue:Ai,useDeferredValue:function(a){var o=di();return O$1===null?o.memoizedState=a:Di(o,O$1.memoizedState,a)},useTransition:function(){var a=gi(ei)[0],o=di().memoizedState;return[a,o]},useMutableSource:hi,useSyncExternalStore:ii,useId:Fi,unstable_isNewReconciler:!1};function Ki(a,o){try{var _e="",tt=o;do _e+=Pa(tt),tt=tt.return;while(tt);var ct=_e}catch(gt){ct=`
+`+ct[rt].replace(" at new "," at ");return a.displayName&&s.includes("")&&(s=s.replace("",a.displayName)),s}while(1<=rt&&0<=it);break}}}finally{Na=!1,Error.prepareStackTrace=_e}return(a=a?a.displayName||a.name:"")?Ma(a):""}function Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}}function Qa(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case Ga:return o=a.displayName||null,o!==null?o:Qa(a.type)||"Memo";case Ha:o=a._payload,a=a._init;try{return Qa(a(o))}catch{}}return null}function Ra(a){var o=a.type;switch(a.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=o.render,a=a.displayName||a.name||"",o.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(o);case 8:return o===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Sa(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Ta(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ua(a){var o=Ta(a)?"checked":"value",_e=Object.getOwnPropertyDescriptor(a.constructor.prototype,o),tt=""+a[o];if(!a.hasOwnProperty(o)&&typeof _e<"u"&&typeof _e.get=="function"&&typeof _e.set=="function"){var ct=_e.get,gt=_e.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return ct.call(this)},set:function(rt){tt=""+rt,gt.call(this,rt)}}),Object.defineProperty(a,o,{enumerable:_e.enumerable}),{getValue:function(){return tt},setValue:function(rt){tt=""+rt},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var _e=o.getValue(),tt="";return a&&(tt=Ta(a)?a.checked?"true":"false":a.value),a=tt,a!==_e?(o.setValue(a),!0):!1}function Xa(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ya(a,o){var _e=o.checked;return A$3({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:_e??a._wrapperState.initialChecked})}function Za(a,o){var _e=o.defaultValue==null?"":o.defaultValue,tt=o.checked!=null?o.checked:o.defaultChecked;_e=Sa(o.value!=null?o.value:_e),a._wrapperState={initialChecked:tt,initialValue:_e,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ab(a,o){o=o.checked,o!=null&&ta(a,"checked",o,!1)}function bb(a,o){ab(a,o);var _e=Sa(o.value),tt=o.type;if(_e!=null)tt==="number"?(_e===0&&a.value===""||a.value!=_e)&&(a.value=""+_e):a.value!==""+_e&&(a.value=""+_e);else if(tt==="submit"||tt==="reset"){a.removeAttribute("value");return}o.hasOwnProperty("value")?cb(a,o.type,_e):o.hasOwnProperty("defaultValue")&&cb(a,o.type,Sa(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(a.defaultChecked=!!o.defaultChecked)}function db(a,o,_e){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var tt=o.type;if(!(tt!=="submit"&&tt!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+a._wrapperState.initialValue,_e||o===a.value||(a.value=o),a.defaultValue=o}_e=a.name,_e!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,_e!==""&&(a.name=_e)}function cb(a,o,_e){(o!=="number"||Xa(a.ownerDocument)!==a)&&(_e==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+_e&&(a.defaultValue=""+_e))}var eb=Array.isArray;function fb(a,o,_e,tt){if(a=a.options,o){o={};for(var ct=0;ct<_e.length;ct++)o["$"+_e[ct]]=!0;for(_e=0;_e"+o.valueOf().toString()+"",o=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;o.firstChild;)a.appendChild(o.firstChild)}});function ob(a,o){if(o){var _e=a.firstChild;if(_e&&_e===a.lastChild&&_e.nodeType===3){_e.nodeValue=o;return}}a.textContent=o}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(o){o=o+a.charAt(0).toUpperCase()+a.substring(1),pb[o]=pb[a]})});function rb(a,o,_e){return o==null||typeof o=="boolean"||o===""?"":_e||typeof o!="number"||o===0||pb.hasOwnProperty(a)&&pb[a]?(""+o).trim():o+"px"}function sb(a,o){a=a.style;for(var _e in o)if(o.hasOwnProperty(_e)){var tt=_e.indexOf("--")===0,ct=rb(_e,o[_e],tt);_e==="float"&&(_e="cssFloat"),tt?a.setProperty(_e,ct):a[_e]=ct}}var tb=A$3({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(a,o){if(o){if(tb[a]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(p$2(137,a));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(p$2(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(p$2(61))}if(o.style!=null&&typeof o.style!="object")throw Error(p$2(62))}}function vb(a,o){if(a.indexOf("-")===-1)return typeof o.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var yb=null,zb=null,Ab=null;function Bb(a){if(a=Cb(a)){if(typeof yb!="function")throw Error(p$2(280));var o=a.stateNode;o&&(o=Db(o),yb(a.stateNode,a.type,o))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,o=Ab;if(Ab=zb=null,Bb(a),o)for(a=0;a>>=0,a===0?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function uc(a,o){var _e=a.pendingLanes;if(_e===0)return 0;var tt=0,ct=a.suspendedLanes,gt=a.pingedLanes,rt=_e&268435455;if(rt!==0){var it=rt&~ct;it!==0?tt=tc(it):(gt&=rt,gt!==0&&(tt=tc(gt)))}else rt=_e&~ct,rt!==0?tt=tc(rt):gt!==0&&(tt=tc(gt));if(tt===0)return 0;if(o!==0&&o!==tt&&!(o&ct)&&(ct=tt&-tt,gt=o&-o,ct>=gt||ct===16&&(gt&4194240)!==0))return o;if(tt&4&&(tt|=_e&16),o=a.entangledLanes,o!==0)for(a=a.entanglements,o&=tt;0_e;_e++)o.push(a);return o}function Ac(a,o,_e){a.pendingLanes|=o,o!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,o=31-oc(o),a[o]=_e}function Bc(a,o){var _e=a.pendingLanes&~o;a.pendingLanes=o,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=o,a.mutableReadLanes&=o,a.entangledLanes&=o,o=a.entanglements;var tt=a.eventTimes;for(a=a.expirationTimes;0<_e;){var ct=31-oc(_e),gt=1<=be),ee$1=String.fromCharCode(32),fe=!1;function ge(a,o){switch(a){case"keyup":return $d.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ie=!1;function je(a,o){switch(a){case"compositionend":return he(o);case"keypress":return o.which!==32?null:(fe=!0,ee$1);case"textInput":return a=o.data,a===ee$1&&fe?null:a;default:return null}}function ke(a,o){if(ie)return a==="compositionend"||!ae&&ge(a,o)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:_e,offset:o-a};a=tt}e:{for(;_e;){if(_e.nextSibling){_e=_e.nextSibling;break e}_e=_e.parentNode}_e=void 0}_e=Je(_e)}}function Le(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?Le(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Me(){for(var a=window,o=Xa();o instanceof a.HTMLIFrameElement;){try{var _e=typeof o.contentWindow.location.href=="string"}catch{_e=!1}if(_e)a=o.contentWindow;else break;o=Xa(a.document)}return o}function Ne(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}function Oe(a){var o=Me(),_e=a.focusedElem,tt=a.selectionRange;if(o!==_e&&_e&&_e.ownerDocument&&Le(_e.ownerDocument.documentElement,_e)){if(tt!==null&&Ne(_e)){if(o=tt.start,a=tt.end,a===void 0&&(a=o),"selectionStart"in _e)_e.selectionStart=o,_e.selectionEnd=Math.min(a,_e.value.length);else if(a=(o=_e.ownerDocument||document)&&o.defaultView||window,a.getSelection){a=a.getSelection();var ct=_e.textContent.length,gt=Math.min(tt.start,ct);tt=tt.end===void 0?gt:Math.min(tt.end,ct),!a.extend&>>tt&&(ct=tt,tt=gt,gt=ct),ct=Ke(_e,gt);var rt=Ke(_e,tt);ct&&rt&&(a.rangeCount!==1||a.anchorNode!==ct.node||a.anchorOffset!==ct.offset||a.focusNode!==rt.node||a.focusOffset!==rt.offset)&&(o=o.createRange(),o.setStart(ct.node,ct.offset),a.removeAllRanges(),gt>tt?(a.addRange(o),a.extend(rt.node,rt.offset)):(o.setEnd(rt.node,rt.offset),a.addRange(o)))}}for(o=[],a=_e;a=a.parentNode;)a.nodeType===1&&o.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof _e.focus=="function"&&_e.focus(),_e=0;_e=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(a,o,_e){var tt=_e.window===_e?_e.document:_e.nodeType===9?_e:_e.ownerDocument;Te||Qe==null||Qe!==Xa(tt)||(tt=Qe,"selectionStart"in tt&&Ne(tt)?tt={start:tt.selectionStart,end:tt.selectionEnd}:(tt=(tt.ownerDocument&&tt.ownerDocument.defaultView||window).getSelection(),tt={anchorNode:tt.anchorNode,anchorOffset:tt.anchorOffset,focusNode:tt.focusNode,focusOffset:tt.focusOffset}),Se&&Ie(Se,tt)||(Se=tt,tt=oe(Re,"onSelect"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$1(a,o){Tf++,Sf[Tf]=a.current,a.current=o}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,o){var _e=a.type.contextTypes;if(!_e)return Vf;var tt=a.stateNode;if(tt&&tt.__reactInternalMemoizedUnmaskedChildContext===o)return tt.__reactInternalMemoizedMaskedChildContext;var ct={},gt;for(gt in _e)ct[gt]=o[gt];return tt&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=o,a.__reactInternalMemoizedMaskedChildContext=ct),ct}function Zf(a){return a=a.childContextTypes,a!=null}function $f(){E$1(Wf),E$1(H)}function ag(a,o,_e){if(H.current!==Vf)throw Error(p$2(168));G$1(H,o),G$1(Wf,_e)}function bg(a,o,_e){var tt=a.stateNode;if(o=o.childContextTypes,typeof tt.getChildContext!="function")return _e;tt=tt.getChildContext();for(var ct in tt)if(!(ct in o))throw Error(p$2(108,Ra(a)||"Unknown",ct));return A$3({},_e,tt)}function cg(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G$1(H,a),G$1(Wf,Wf.current),!0}function dg(a,o,_e){var tt=a.stateNode;if(!tt)throw Error(p$2(169));_e?(a=bg(a,o,Xf),tt.__reactInternalMemoizedMergedChildContext=a,E$1(Wf),E$1(H),G$1(H,a)):E$1(Wf),G$1(Wf,_e)}var eg=null,fg=!1,gg=!1;function hg(a){eg===null?eg=[a]:eg.push(a)}function ig(a){fg=!0,hg(a)}function jg(){if(!gg&&eg!==null){gg=!0;var a=0,o=C$1;try{var _e=eg;for(C$1=1;a<_e.length;a++){var tt=_e[a];do tt=tt(!0);while(tt!==null)}eg=null,fg=!1}catch(ct){throw eg!==null&&(eg=eg.slice(a+1)),ac(fc,jg),ct}finally{C$1=o,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(a,o){kg[lg++]=ng,kg[lg++]=mg,mg=a,ng=o}function ug(a,o,_e){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=a;var tt=rg;a=sg;var ct=32-oc(tt)-1;tt&=~(1<>=rt,ct-=rt,rg=1<<32-oc(o)+ct|_e<Nt?(St=At,At=null):St=At.sibling;var wt=ht(ot,At,ft[Nt],bt);if(wt===null){At===null&&(At=St);break}a&&At&&wt.alternate===null&&o(ot,At),ut=gt(wt,ut,Nt),yt===null?vt=wt:yt.sibling=wt,yt=wt,At=St}if(Nt===ft.length)return _e(ot,At),I&&tg(ot,Nt),vt;if(At===null){for(;NtNt?(St=At,At=null):St=At.sibling;var Mt=ht(ot,At,wt.value,bt);if(Mt===null){At===null&&(At=St);break}a&&At&&Mt.alternate===null&&o(ot,At),ut=gt(Mt,ut,Nt),yt===null?vt=Mt:yt.sibling=Mt,yt=Mt,At=St}if(wt.done)return _e(ot,At),I&&tg(ot,Nt),vt;if(At===null){for(;!wt.done;Nt++,wt=ft.next())wt=at(ot,wt.value,bt),wt!==null&&(ut=gt(wt,ut,Nt),yt===null?vt=wt:yt.sibling=wt,yt=wt);return I&&tg(ot,Nt),vt}for(At=tt(ot,At);!wt.done;Nt++,wt=ft.next())wt=dt(At,ot,Nt,wt.value,bt),wt!==null&&(a&&wt.alternate!==null&&At.delete(wt.key===null?Nt:wt.key),ut=gt(wt,ut,Nt),yt===null?vt=wt:yt.sibling=wt,yt=wt);return a&&At.forEach(function(Ht){return o(ot,Ht)}),I&&tg(ot,Nt),vt}function mt(ot,ut,ft,bt){if(typeof ft=="object"&&ft!==null&&ft.type===ya&&ft.key===null&&(ft=ft.props.children),typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case va:e:{for(var vt=ft.key,yt=ut;yt!==null;){if(yt.key===vt){if(vt=ft.type,vt===ya){if(yt.tag===7){_e(ot,yt.sibling),ut=ct(yt,ft.props.children),ut.return=ot,ot=ut;break e}}else if(yt.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===Ha&&uh(vt)===yt.type){_e(ot,yt.sibling),ut=ct(yt,ft.props),ut.ref=sh(ot,yt,ft),ut.return=ot,ot=ut;break e}_e(ot,yt);break}else o(ot,yt);yt=yt.sibling}ft.type===ya?(ut=Ah(ft.props.children,ot.mode,bt,ft.key),ut.return=ot,ot=ut):(bt=yh(ft.type,ft.key,ft.props,null,ot.mode,bt),bt.ref=sh(ot,ut,ft),bt.return=ot,ot=bt)}return rt(ot);case wa:e:{for(yt=ft.key;ut!==null;){if(ut.key===yt)if(ut.tag===4&&ut.stateNode.containerInfo===ft.containerInfo&&ut.stateNode.implementation===ft.implementation){_e(ot,ut.sibling),ut=ct(ut,ft.children||[]),ut.return=ot,ot=ut;break e}else{_e(ot,ut);break}else o(ot,ut);ut=ut.sibling}ut=zh(ft,ot.mode,bt),ut.return=ot,ot=ut}return rt(ot);case Ha:return yt=ft._init,mt(ot,ut,yt(ft._payload),bt)}if(eb(ft))return pt(ot,ut,ft,bt);if(Ka(ft))return lt(ot,ut,ft,bt);th(ot,ft)}return typeof ft=="string"&&ft!==""||typeof ft=="number"?(ft=""+ft,ut!==null&&ut.tag===6?(_e(ot,ut.sibling),ut=ct(ut,ft),ut.return=ot,ot=ut):(_e(ot,ut),ut=xh(ft,ot.mode,bt),ut.return=ot,ot=ut),rt(ot)):_e(ot,ut)}return mt}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p$2(174));return a}function Ih(a,o){switch(G$1(Gh,o),G$1(Fh,a),G$1(Eh,Dh),a=o.nodeType,a){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:lb(null,"");break;default:a=a===8?o.parentNode:o,o=a.namespaceURI||null,a=a.tagName,o=lb(o,a)}E$1(Eh),G$1(Eh,o)}function Jh(){E$1(Eh),E$1(Fh),E$1(Gh)}function Kh(a){Hh(Gh.current);var o=Hh(Eh.current),_e=lb(o,a.type);o!==_e&&(G$1(Fh,a),G$1(Eh,_e))}function Lh(a){Fh.current===a&&(E$1(Eh),E$1(Fh))}var M$1=Uf(0);function Mh(a){for(var o=a;o!==null;){if(o.tag===13){var _e=o.memoizedState;if(_e!==null&&(_e=_e.dehydrated,_e===null||_e.data==="$?"||_e.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Nh=[];function Oh(){for(var a=0;a_e?_e:4,a(!0);var tt=Qh.transition;Qh.transition={};try{a(!1),o()}finally{C$1=_e,Qh.transition=tt}}function Fi(){return di().memoizedState}function Gi(a,o,_e){var tt=lh(a);if(_e={lane:tt,action:_e,hasEagerState:!1,eagerState:null,next:null},Hi(a))Ii(o,_e);else if(_e=Yg(a,o,_e,tt),_e!==null){var ct=L();mh(_e,a,tt,ct),Ji(_e,o,tt)}}function ri(a,o,_e){var tt=lh(a),ct={lane:tt,action:_e,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(o,ct);else{var gt=a.alternate;if(a.lanes===0&&(gt===null||gt.lanes===0)&&(gt=o.lastRenderedReducer,gt!==null))try{var rt=o.lastRenderedState,it=gt(rt,_e);if(ct.hasEagerState=!0,ct.eagerState=it,He(it,rt)){var s=o.interleaved;s===null?(ct.next=ct,Xg(o)):(ct.next=s.next,s.next=ct),o.interleaved=ct;return}}catch{}finally{}_e=Yg(a,o,ct,tt),_e!==null&&(ct=L(),mh(_e,a,tt,ct),Ji(_e,o,tt))}}function Hi(a){var o=a.alternate;return a===N$1||o!==null&&o===N$1}function Ii(a,o){Th=Sh=!0;var _e=a.pending;_e===null?o.next=o:(o.next=_e.next,_e.next=o),a.pending=o}function Ji(a,o,_e){if(_e&4194240){var tt=o.lanes;tt&=a.pendingLanes,_e|=tt,o.lanes=_e,Cc(a,_e)}}var ai={readContext:Vg,useCallback:Q$1,useContext:Q$1,useEffect:Q$1,useImperativeHandle:Q$1,useInsertionEffect:Q$1,useLayoutEffect:Q$1,useMemo:Q$1,useReducer:Q$1,useRef:Q$1,useState:Q$1,useDebugValue:Q$1,useDeferredValue:Q$1,useTransition:Q$1,useMutableSource:Q$1,useSyncExternalStore:Q$1,useId:Q$1,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,o){return ci().memoizedState=[a,o===void 0?null:o],a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,o,_e){return _e=_e!=null?_e.concat([a]):null,ti(4194308,4,yi.bind(null,o,a),_e)},useLayoutEffect:function(a,o){return ti(4194308,4,a,o)},useInsertionEffect:function(a,o){return ti(4,2,a,o)},useMemo:function(a,o){var _e=ci();return o=o===void 0?null:o,a=a(),_e.memoizedState=[a,o],a},useReducer:function(a,o,_e){var tt=ci();return o=_e!==void 0?_e(o):o,tt.memoizedState=tt.baseState=o,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:o},tt.queue=a,a=a.dispatch=Gi.bind(null,N$1,a),[tt.memoizedState,a]},useRef:function(a){var o=ci();return a={current:a},o.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),o=a[0];return a=Ei.bind(null,a[1]),ci().memoizedState=a,[o,a]},useMutableSource:function(){},useSyncExternalStore:function(a,o,_e){var tt=N$1,ct=ci();if(I){if(_e===void 0)throw Error(p$2(407));_e=_e()}else{if(_e=o(),R$1===null)throw Error(p$2(349));Rh&30||ni(tt,o,_e)}ct.memoizedState=_e;var gt={value:_e,getSnapshot:o};return ct.queue=gt,vi(ki.bind(null,tt,gt,a),[a]),tt.flags|=2048,li(9,mi.bind(null,tt,gt,_e,o),void 0,null),_e},useId:function(){var a=ci(),o=R$1.identifierPrefix;if(I){var _e=sg,tt=rg;_e=(tt&~(1<<32-oc(tt)-1)).toString(32)+_e,o=":"+o+"R"+_e,_e=Uh++,0<_e&&(o+="H"+_e.toString(32)),o+=":"}else _e=Vh++,o=":"+o+"r"+_e.toString(32)+":";return a.memoizedState=o},unstable_isNewReconciler:!1},Zh={readContext:Vg,useCallback:Bi,useContext:Vg,useEffect:ji,useImperativeHandle:zi,useInsertionEffect:wi,useLayoutEffect:xi,useMemo:Ci,useReducer:fi,useRef:si,useState:function(){return fi(ei)},useDebugValue:Ai,useDeferredValue:function(a){var o=di();return Di(o,O$1.memoizedState,a)},useTransition:function(){var a=fi(ei)[0],o=di().memoizedState;return[a,o]},useMutableSource:hi,useSyncExternalStore:ii,useId:Fi,unstable_isNewReconciler:!1},$h={readContext:Vg,useCallback:Bi,useContext:Vg,useEffect:ji,useImperativeHandle:zi,useInsertionEffect:wi,useLayoutEffect:xi,useMemo:Ci,useReducer:gi,useRef:si,useState:function(){return gi(ei)},useDebugValue:Ai,useDeferredValue:function(a){var o=di();return O$1===null?o.memoizedState=a:Di(o,O$1.memoizedState,a)},useTransition:function(){var a=gi(ei)[0],o=di().memoizedState;return[a,o]},useMutableSource:hi,useSyncExternalStore:ii,useId:Fi,unstable_isNewReconciler:!1};function Ki(a,o){try{var _e="",tt=o;do _e+=Pa(tt),tt=tt.return;while(tt);var ct=_e}catch(gt){ct=`
Error generating stack: `+gt.message+`
-`+gt.stack}return{value:a,source:o,stack:ct,digest:null}}function Li(a,o,_e){return{value:a,source:null,stack:_e??null,digest:o??null}}function Mi(a,o){try{console.error(o.value)}catch(_e){setTimeout(function(){throw _e})}}var Ni=typeof WeakMap=="function"?WeakMap:Map;function Oi(a,o,_e){_e=ch(-1,_e),_e.tag=3,_e.payload={element:null};var tt=o.value;return _e.callback=function(){Pi||(Pi=!0,Qi=tt),Mi(a,o)},_e}function Ri(a,o,_e){_e=ch(-1,_e),_e.tag=3;var tt=a.type.getDerivedStateFromError;if(typeof tt=="function"){var ct=o.value;_e.payload=function(){return tt(ct)},_e.callback=function(){Mi(a,o)}}var gt=a.stateNode;return gt!==null&&typeof gt.componentDidCatch=="function"&&(_e.callback=function(){Mi(a,o),typeof tt!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var rt=o.stack;this.componentDidCatch(o.value,{componentStack:rt!==null?rt:""})}),_e}function Ti(a,o,_e){var tt=a.pingCache;if(tt===null){tt=a.pingCache=new Ni;var ct=new Set;tt.set(o,ct)}else ct=tt.get(o),ct===void 0&&(ct=new Set,tt.set(o,ct));ct.has(_e)||(ct.add(_e),a=Ui.bind(null,a,o,_e),o.then(a,a))}function Vi(a){do{var o;if((o=a.tag===13)&&(o=a.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return a;a=a.return}while(a!==null);return null}function Wi(a,o,_e,tt,ct){return a.mode&1?(a.flags|=65536,a.lanes=ct,a):(a===o?a.flags|=65536:(a.flags|=128,_e.flags|=131072,_e.flags&=-52805,_e.tag===1&&(_e.alternate===null?_e.tag=17:(o=ch(-1,1),o.tag=2,dh(_e,o,1))),_e.lanes|=1),a)}var Xi=ua$1.ReactCurrentOwner,Ug=!1;function Yi(a,o,_e,tt){o.child=a===null?Ch(o,null,_e,tt):Bh(o,a.child,_e,tt)}function Zi(a,o,_e,tt,ct){_e=_e.render;var gt=o.ref;return Tg(o,ct),tt=Xh(a,o,_e,tt,gt,ct),_e=bi(),a!==null&&!Ug?(o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~ct,$i(a,o,ct)):(I&&_e&&vg(o),o.flags|=1,Yi(a,o,tt,ct),o.child)}function aj(a,o,_e,tt,ct){if(a===null){var gt=_e.type;return typeof gt=="function"&&!bj(gt)&>.defaultProps===void 0&&_e.compare===null&&_e.defaultProps===void 0?(o.tag=15,o.type=gt,cj(a,o,gt,tt,ct)):(a=yh(_e.type,null,tt,o,o.mode,ct),a.ref=o.ref,a.return=o,o.child=a)}if(gt=a.child,!(a.lanes&ct)){var rt=gt.memoizedProps;if(_e=_e.compare,_e=_e!==null?_e:Ie,_e(rt,tt)&&a.ref===o.ref)return $i(a,o,ct)}return o.flags|=1,a=wh(gt,tt),a.ref=o.ref,a.return=o,o.child=a}function cj(a,o,_e,tt,ct){if(a!==null){var gt=a.memoizedProps;if(Ie(gt,tt)&&a.ref===o.ref)if(Ug=!1,o.pendingProps=tt=gt,(a.lanes&ct)!==0)a.flags&131072&&(Ug=!0);else return o.lanes=a.lanes,$i(a,o,ct)}return dj(a,o,_e,tt,ct)}function ej(a,o,_e){var tt=o.pendingProps,ct=tt.children,gt=a!==null?a.memoizedState:null;if(tt.mode==="hidden")if(!(o.mode&1))o.memoizedState={baseLanes:0,cachePool:null,transitions:null},G$1(fj,gj),gj|=_e;else{if(!(_e&1073741824))return a=gt!==null?gt.baseLanes|_e:_e,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:a,cachePool:null,transitions:null},o.updateQueue=null,G$1(fj,gj),gj|=a,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt=gt!==null?gt.baseLanes:_e,G$1(fj,gj),gj|=tt}else gt!==null?(tt=gt.baseLanes|_e,o.memoizedState=null):tt=_e,G$1(fj,gj),gj|=tt;return Yi(a,o,ct,_e),o.child}function hj(a,o){var _e=o.ref;(a===null&&_e!==null||a!==null&&a.ref!==_e)&&(o.flags|=512,o.flags|=2097152)}function dj(a,o,_e,tt,ct){var gt=Zf(_e)?Xf:H.current;return gt=Yf(o,gt),Tg(o,ct),_e=Xh(a,o,_e,tt,gt,ct),tt=bi(),a!==null&&!Ug?(o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~ct,$i(a,o,ct)):(I&&tt&&vg(o),o.flags|=1,Yi(a,o,_e,ct),o.child)}function ij(a,o,_e,tt,ct){if(Zf(_e)){var gt=!0;cg(o)}else gt=!1;if(Tg(o,ct),o.stateNode===null)jj(a,o),ph(o,_e,tt),rh(o,_e,tt,ct),tt=!0;else if(a===null){var rt=o.stateNode,it=o.memoizedProps;rt.props=it;var s=rt.context,et=_e.contextType;typeof et=="object"&&et!==null?et=Vg(et):(et=Zf(_e)?Xf:H.current,et=Yf(o,et));var nt=_e.getDerivedStateFromProps,at=typeof nt=="function"||typeof rt.getSnapshotBeforeUpdate=="function";at||typeof rt.UNSAFE_componentWillReceiveProps!="function"&&typeof rt.componentWillReceiveProps!="function"||(it!==tt||s!==et)&&qh(o,rt,tt,et),$g=!1;var ht=o.memoizedState;rt.state=ht,gh(o,tt,rt,ct),s=o.memoizedState,it!==tt||ht!==s||Wf.current||$g?(typeof nt=="function"&&(kh(o,_e,nt,tt),s=o.memoizedState),(it=$g||oh(o,_e,it,tt,ht,s,et))?(at||typeof rt.UNSAFE_componentWillMount!="function"&&typeof rt.componentWillMount!="function"||(typeof rt.componentWillMount=="function"&&rt.componentWillMount(),typeof rt.UNSAFE_componentWillMount=="function"&&rt.UNSAFE_componentWillMount()),typeof rt.componentDidMount=="function"&&(o.flags|=4194308)):(typeof rt.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=tt,o.memoizedState=s),rt.props=tt,rt.state=s,rt.context=et,tt=it):(typeof rt.componentDidMount=="function"&&(o.flags|=4194308),tt=!1)}else{rt=o.stateNode,bh(a,o),it=o.memoizedProps,et=o.type===o.elementType?it:Lg(o.type,it),rt.props=et,at=o.pendingProps,ht=rt.context,s=_e.contextType,typeof s=="object"&&s!==null?s=Vg(s):(s=Zf(_e)?Xf:H.current,s=Yf(o,s));var dt=_e.getDerivedStateFromProps;(nt=typeof dt=="function"||typeof rt.getSnapshotBeforeUpdate=="function")||typeof rt.UNSAFE_componentWillReceiveProps!="function"&&typeof rt.componentWillReceiveProps!="function"||(it!==at||ht!==s)&&qh(o,rt,tt,s),$g=!1,ht=o.memoizedState,rt.state=ht,gh(o,tt,rt,ct);var ut=o.memoizedState;it!==at||ht!==ut||Wf.current||$g?(typeof dt=="function"&&(kh(o,_e,dt,tt),ut=o.memoizedState),(et=$g||oh(o,_e,et,tt,ht,ut,s)||!1)?(nt||typeof rt.UNSAFE_componentWillUpdate!="function"&&typeof rt.componentWillUpdate!="function"||(typeof rt.componentWillUpdate=="function"&&rt.componentWillUpdate(tt,ut,s),typeof rt.UNSAFE_componentWillUpdate=="function"&&rt.UNSAFE_componentWillUpdate(tt,ut,s)),typeof rt.componentDidUpdate=="function"&&(o.flags|=4),typeof rt.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof rt.componentDidUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=4),typeof rt.getSnapshotBeforeUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=1024),o.memoizedProps=tt,o.memoizedState=ut),rt.props=tt,rt.state=ut,rt.context=s,tt=et):(typeof rt.componentDidUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=4),typeof rt.getSnapshotBeforeUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=1024),tt=!1)}return kj(a,o,_e,tt,gt,ct)}function kj(a,o,_e,tt,ct,gt){hj(a,o);var rt=(o.flags&128)!==0;if(!tt&&!rt)return ct&&dg(o,_e,!1),$i(a,o,gt);tt=o.stateNode,Xi.current=o;var it=rt&&typeof _e.getDerivedStateFromError!="function"?null:tt.render();return o.flags|=1,a!==null&&rt?(o.child=Bh(o,a.child,null,gt),o.child=Bh(o,null,it,gt)):Yi(a,o,it,gt),o.memoizedState=tt.state,ct&&dg(o,_e,!0),o.child}function lj(a){var o=a.stateNode;o.pendingContext?ag(a,o.pendingContext,o.pendingContext!==o.context):o.context&&ag(a,o.context,!1),Ih(a,o.containerInfo)}function mj(a,o,_e,tt,ct){return Ig(),Jg(ct),o.flags|=256,Yi(a,o,_e,tt),o.child}var nj={dehydrated:null,treeContext:null,retryLane:0};function oj(a){return{baseLanes:a,cachePool:null,transitions:null}}function pj(a,o,_e){var tt=o.pendingProps,ct=M$1.current,gt=!1,rt=(o.flags&128)!==0,it;if((it=rt)||(it=a!==null&&a.memoizedState===null?!1:(ct&2)!==0),it?(gt=!0,o.flags&=-129):(a===null||a.memoizedState!==null)&&(ct|=1),G$1(M$1,ct&1),a===null)return Eg(o),a=o.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(o.mode&1?a.data==="$!"?o.lanes=8:o.lanes=1073741824:o.lanes=1,null):(rt=tt.children,a=tt.fallback,gt?(tt=o.mode,gt=o.child,rt={mode:"hidden",children:rt},!(tt&1)&>!==null?(gt.childLanes=0,gt.pendingProps=rt):gt=qj(rt,tt,0,null),a=Ah(a,tt,_e,null),gt.return=o,a.return=o,gt.sibling=a,o.child=gt,o.child.memoizedState=oj(_e),o.memoizedState=nj,a):rj(o,rt));if(ct=a.memoizedState,ct!==null&&(it=ct.dehydrated,it!==null))return sj(a,o,rt,tt,it,ct,_e);if(gt){gt=tt.fallback,rt=o.mode,ct=a.child,it=ct.sibling;var s={mode:"hidden",children:tt.children};return!(rt&1)&&o.child!==ct?(tt=o.child,tt.childLanes=0,tt.pendingProps=s,o.deletions=null):(tt=wh(ct,s),tt.subtreeFlags=ct.subtreeFlags&14680064),it!==null?gt=wh(it,gt):(gt=Ah(gt,rt,_e,null),gt.flags|=2),gt.return=o,tt.return=o,tt.sibling=gt,o.child=tt,tt=gt,gt=o.child,rt=a.child.memoizedState,rt=rt===null?oj(_e):{baseLanes:rt.baseLanes|_e,cachePool:null,transitions:rt.transitions},gt.memoizedState=rt,gt.childLanes=a.childLanes&~_e,o.memoizedState=nj,tt}return gt=a.child,a=gt.sibling,tt=wh(gt,{mode:"visible",children:tt.children}),!(o.mode&1)&&(tt.lanes=_e),tt.return=o,tt.sibling=null,a!==null&&(_e=o.deletions,_e===null?(o.deletions=[a],o.flags|=16):_e.push(a)),o.child=tt,o.memoizedState=null,tt}function rj(a,o){return o=qj({mode:"visible",children:o},a.mode,0,null),o.return=a,a.child=o}function tj(a,o,_e,tt){return tt!==null&&Jg(tt),Bh(o,a.child,null,_e),a=rj(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function sj(a,o,_e,tt,ct,gt,rt){if(_e)return o.flags&256?(o.flags&=-257,tt=Li(Error(p$2(422))),tj(a,o,rt,tt)):o.memoizedState!==null?(o.child=a.child,o.flags|=128,null):(gt=tt.fallback,ct=o.mode,tt=qj({mode:"visible",children:tt.children},ct,0,null),gt=Ah(gt,ct,rt,null),gt.flags|=2,tt.return=o,gt.return=o,tt.sibling=gt,o.child=tt,o.mode&1&&Bh(o,a.child,null,rt),o.child.memoizedState=oj(rt),o.memoizedState=nj,gt);if(!(o.mode&1))return tj(a,o,rt,null);if(ct.data==="$!"){if(tt=ct.nextSibling&&ct.nextSibling.dataset,tt)var it=tt.dgst;return tt=it,gt=Error(p$2(419)),tt=Li(gt,tt,void 0),tj(a,o,rt,tt)}if(it=(rt&a.childLanes)!==0,Ug||it){if(tt=R$1,tt!==null){switch(rt&-rt){case 4:ct=2;break;case 16:ct=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:ct=32;break;case 536870912:ct=268435456;break;default:ct=0}ct=ct&(tt.suspendedLanes|rt)?0:ct,ct!==0&&ct!==gt.retryLane&&(gt.retryLane=ct,Zg(a,ct),mh(tt,a,ct,-1))}return uj(),tt=Li(Error(p$2(421))),tj(a,o,rt,tt)}return ct.data==="$?"?(o.flags|=128,o.child=a.child,o=vj.bind(null,a),ct._reactRetry=o,null):(a=gt.treeContext,yg=Lf(ct.nextSibling),xg=o,I=!0,zg=null,a!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=a.id,sg=a.overflow,qg=o),o=rj(o,tt.children),o.flags|=4096,o)}function wj(a,o,_e){a.lanes|=o;var tt=a.alternate;tt!==null&&(tt.lanes|=o),Sg(a.return,o,_e)}function xj(a,o,_e,tt,ct){var gt=a.memoizedState;gt===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:tt,tail:_e,tailMode:ct}:(gt.isBackwards=o,gt.rendering=null,gt.renderingStartTime=0,gt.last=tt,gt.tail=_e,gt.tailMode=ct)}function yj(a,o,_e){var tt=o.pendingProps,ct=tt.revealOrder,gt=tt.tail;if(Yi(a,o,tt.children,_e),tt=M$1.current,tt&2)tt=tt&1|2,o.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&wj(a,_e,o);else if(a.tag===19)wj(a,_e,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}tt&=1}if(G$1(M$1,tt),!(o.mode&1))o.memoizedState=null;else switch(ct){case"forwards":for(_e=o.child,ct=null;_e!==null;)a=_e.alternate,a!==null&&Mh(a)===null&&(ct=_e),_e=_e.sibling;_e=ct,_e===null?(ct=o.child,o.child=null):(ct=_e.sibling,_e.sibling=null),xj(o,!1,ct,_e,gt);break;case"backwards":for(_e=null,ct=o.child,o.child=null;ct!==null;){if(a=ct.alternate,a!==null&&Mh(a)===null){o.child=ct;break}a=ct.sibling,ct.sibling=_e,_e=ct,ct=a}xj(o,!0,_e,null,gt);break;case"together":xj(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function jj(a,o){!(o.mode&1)&&a!==null&&(a.alternate=null,o.alternate=null,o.flags|=2)}function $i(a,o,_e){if(a!==null&&(o.dependencies=a.dependencies),hh|=o.lanes,!(_e&o.childLanes))return null;if(a!==null&&o.child!==a.child)throw Error(p$2(153));if(o.child!==null){for(a=o.child,_e=wh(a,a.pendingProps),o.child=_e,_e.return=o;a.sibling!==null;)a=a.sibling,_e=_e.sibling=wh(a,a.pendingProps),_e.return=o;_e.sibling=null}return o.child}function zj(a,o,_e){switch(o.tag){case 3:lj(o),Ig();break;case 5:Kh(o);break;case 1:Zf(o.type)&&cg(o);break;case 4:Ih(o,o.stateNode.containerInfo);break;case 10:var tt=o.type._context,ct=o.memoizedProps.value;G$1(Mg,tt._currentValue),tt._currentValue=ct;break;case 13:if(tt=o.memoizedState,tt!==null)return tt.dehydrated!==null?(G$1(M$1,M$1.current&1),o.flags|=128,null):_e&o.child.childLanes?pj(a,o,_e):(G$1(M$1,M$1.current&1),a=$i(a,o,_e),a!==null?a.sibling:null);G$1(M$1,M$1.current&1);break;case 19:if(tt=(_e&o.childLanes)!==0,a.flags&128){if(tt)return yj(a,o,_e);o.flags|=128}if(ct=o.memoizedState,ct!==null&&(ct.rendering=null,ct.tail=null,ct.lastEffect=null),G$1(M$1,M$1.current),tt)break;return null;case 22:case 23:return o.lanes=0,ej(a,o,_e)}return $i(a,o,_e)}var Aj,Bj,Cj,Dj;Aj=function(a,o){for(var _e=o.child;_e!==null;){if(_e.tag===5||_e.tag===6)a.appendChild(_e.stateNode);else if(_e.tag!==4&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===o)break;for(;_e.sibling===null;){if(_e.return===null||_e.return===o)return;_e=_e.return}_e.sibling.return=_e.return,_e=_e.sibling}};Bj=function(){};Cj=function(a,o,_e,tt){var ct=a.memoizedProps;if(ct!==tt){a=o.stateNode,Hh(Eh.current);var gt=null;switch(_e){case"input":ct=Ya(a,ct),tt=Ya(a,tt),gt=[];break;case"select":ct=A$3({},ct,{value:void 0}),tt=A$3({},tt,{value:void 0}),gt=[];break;case"textarea":ct=gb(a,ct),tt=gb(a,tt),gt=[];break;default:typeof ct.onClick!="function"&&typeof tt.onClick=="function"&&(a.onclick=Bf)}ub(_e,tt);var rt;_e=null;for(et in ct)if(!tt.hasOwnProperty(et)&&ct.hasOwnProperty(et)&&ct[et]!=null)if(et==="style"){var it=ct[et];for(rt in it)it.hasOwnProperty(rt)&&(_e||(_e={}),_e[rt]="")}else et!=="dangerouslySetInnerHTML"&&et!=="children"&&et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&et!=="autoFocus"&&(ea.hasOwnProperty(et)?gt||(gt=[]):(gt=gt||[]).push(et,null));for(et in tt){var s=tt[et];if(it=ct!=null?ct[et]:void 0,tt.hasOwnProperty(et)&&s!==it&&(s!=null||it!=null))if(et==="style")if(it){for(rt in it)!it.hasOwnProperty(rt)||s&&s.hasOwnProperty(rt)||(_e||(_e={}),_e[rt]="");for(rt in s)s.hasOwnProperty(rt)&&it[rt]!==s[rt]&&(_e||(_e={}),_e[rt]=s[rt])}else _e||(gt||(gt=[]),gt.push(et,_e)),_e=s;else et==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,it=it?it.__html:void 0,s!=null&&it!==s&&(gt=gt||[]).push(et,s)):et==="children"?typeof s!="string"&&typeof s!="number"||(gt=gt||[]).push(et,""+s):et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&(ea.hasOwnProperty(et)?(s!=null&&et==="onScroll"&&D$1("scroll",a),gt||it===s||(gt=[])):(gt=gt||[]).push(et,s))}_e&&(gt=gt||[]).push("style",_e);var et=gt;(o.updateQueue=et)&&(o.flags|=4)}};Dj=function(a,o,_e,tt){_e!==tt&&(o.flags|=4)};function Ej(a,o){if(!I)switch(a.tailMode){case"hidden":o=a.tail;for(var _e=null;o!==null;)o.alternate!==null&&(_e=o),o=o.sibling;_e===null?a.tail=null:_e.sibling=null;break;case"collapsed":_e=a.tail;for(var tt=null;_e!==null;)_e.alternate!==null&&(tt=_e),_e=_e.sibling;tt===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:tt.sibling=null}}function S$2(a){var o=a.alternate!==null&&a.alternate.child===a.child,_e=0,tt=0;if(o)for(var ct=a.child;ct!==null;)_e|=ct.lanes|ct.childLanes,tt|=ct.subtreeFlags&14680064,tt|=ct.flags&14680064,ct.return=a,ct=ct.sibling;else for(ct=a.child;ct!==null;)_e|=ct.lanes|ct.childLanes,tt|=ct.subtreeFlags,tt|=ct.flags,ct.return=a,ct=ct.sibling;return a.subtreeFlags|=tt,a.childLanes=_e,o}function Fj(a,o,_e){var tt=o.pendingProps;switch(wg(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S$2(o),null;case 1:return Zf(o.type)&&$f(),S$2(o),null;case 3:return tt=o.stateNode,Jh(),E$1(Wf),E$1(H),Oh(),tt.pendingContext&&(tt.context=tt.pendingContext,tt.pendingContext=null),(a===null||a.child===null)&&(Gg(o)?o.flags|=4:a===null||a.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,zg!==null&&(Gj(zg),zg=null))),Bj(a,o),S$2(o),null;case 5:Lh(o);var ct=Hh(Gh.current);if(_e=o.type,a!==null&&o.stateNode!=null)Cj(a,o,_e,tt,ct),a.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!tt){if(o.stateNode===null)throw Error(p$2(166));return S$2(o),null}if(a=Hh(Eh.current),Gg(o)){tt=o.stateNode,_e=o.type;var gt=o.memoizedProps;switch(tt[Of]=o,tt[Pf]=gt,a=(o.mode&1)!==0,_e){case"dialog":D$1("cancel",tt),D$1("close",tt);break;case"iframe":case"object":case"embed":D$1("load",tt);break;case"video":case"audio":for(ct=0;ct<\/script>",a=a.removeChild(a.firstChild)):typeof tt.is=="string"?a=rt.createElement(_e,{is:tt.is}):(a=rt.createElement(_e),_e==="select"&&(rt=a,tt.multiple?rt.multiple=!0:tt.size&&(rt.size=tt.size))):a=rt.createElementNS(a,_e),a[Of]=o,a[Pf]=tt,Aj(a,o,!1,!1),o.stateNode=a;e:{switch(rt=vb(_e,tt),_e){case"dialog":D$1("cancel",a),D$1("close",a),ct=tt;break;case"iframe":case"object":case"embed":D$1("load",a),ct=tt;break;case"video":case"audio":for(ct=0;ctHj&&(o.flags|=128,tt=!0,Ej(gt,!1),o.lanes=4194304)}else{if(!tt)if(a=Mh(rt),a!==null){if(o.flags|=128,tt=!0,_e=a.updateQueue,_e!==null&&(o.updateQueue=_e,o.flags|=4),Ej(gt,!0),gt.tail===null&>.tailMode==="hidden"&&!rt.alternate&&!I)return S$2(o),null}else 2*B$1()-gt.renderingStartTime>Hj&&_e!==1073741824&&(o.flags|=128,tt=!0,Ej(gt,!1),o.lanes=4194304);gt.isBackwards?(rt.sibling=o.child,o.child=rt):(_e=gt.last,_e!==null?_e.sibling=rt:o.child=rt,gt.last=rt)}return gt.tail!==null?(o=gt.tail,gt.rendering=o,gt.tail=o.sibling,gt.renderingStartTime=B$1(),o.sibling=null,_e=M$1.current,G$1(M$1,tt?_e&1|2:_e&1),o):(S$2(o),null);case 22:case 23:return Ij(),tt=o.memoizedState!==null,a!==null&&a.memoizedState!==null!==tt&&(o.flags|=8192),tt&&o.mode&1?gj&1073741824&&(S$2(o),o.subtreeFlags&6&&(o.flags|=8192)):S$2(o),null;case 24:return null;case 25:return null}throw Error(p$2(156,o.tag))}function Jj(a,o){switch(wg(o),o.tag){case 1:return Zf(o.type)&&$f(),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Jh(),E$1(Wf),E$1(H),Oh(),a=o.flags,a&65536&&!(a&128)?(o.flags=a&-65537|128,o):null;case 5:return Lh(o),null;case 13:if(E$1(M$1),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(p$2(340));Ig()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return E$1(M$1),null;case 4:return Jh(),null;case 10:return Rg(o.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Mj(a,o){var _e=a.ref;if(_e!==null)if(typeof _e=="function")try{_e(null)}catch(tt){W$2(a,o,tt)}else _e.current=null}function Nj(a,o,_e){try{_e()}catch(tt){W$2(a,o,tt)}}var Oj=!1;function Pj(a,o){if(Cf=dd,a=Me(),Ne(a)){if("selectionStart"in a)var _e={start:a.selectionStart,end:a.selectionEnd};else e:{_e=(_e=a.ownerDocument)&&_e.defaultView||window;var tt=_e.getSelection&&_e.getSelection();if(tt&&tt.rangeCount!==0){_e=tt.anchorNode;var ct=tt.anchorOffset,gt=tt.focusNode;tt=tt.focusOffset;try{_e.nodeType,gt.nodeType}catch{_e=null;break e}var rt=0,it=-1,s=-1,et=0,nt=0,at=a,ht=null;t:for(;;){for(var dt;at!==_e||ct!==0&&at.nodeType!==3||(it=rt+ct),at!==gt||tt!==0&&at.nodeType!==3||(s=rt+tt),at.nodeType===3&&(rt+=at.nodeValue.length),(dt=at.firstChild)!==null;)ht=at,at=dt;for(;;){if(at===a)break t;if(ht===_e&&++et===ct&&(it=rt),ht===gt&&++nt===tt&&(s=rt),(dt=at.nextSibling)!==null)break;at=ht,ht=at.parentNode}at=dt}_e=it===-1||s===-1?null:{start:it,end:s}}else _e=null}_e=_e||{start:0,end:0}}else _e=null;for(Df={focusedElem:a,selectionRange:_e},dd=!1,V=o;V!==null;)if(o=V,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,V=a;else for(;V!==null;){o=V;try{var ut=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ut!==null){var lt=ut.memoizedProps,mt=ut.memoizedState,ot=o.stateNode,pt=ot.getSnapshotBeforeUpdate(o.elementType===o.type?lt:Lg(o.type,lt),mt);ot.__reactInternalSnapshotBeforeUpdate=pt}break;case 3:var ft=o.stateNode.containerInfo;ft.nodeType===1?ft.textContent="":ft.nodeType===9&&ft.documentElement&&ft.removeChild(ft.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$2(163))}}catch(yt){W$2(o,o.return,yt)}if(a=o.sibling,a!==null){a.return=o.return,V=a;break}V=o.return}return ut=Oj,Oj=!1,ut}function Qj(a,o,_e){var tt=o.updateQueue;if(tt=tt!==null?tt.lastEffect:null,tt!==null){var ct=tt=tt.next;do{if((ct.tag&a)===a){var gt=ct.destroy;ct.destroy=void 0,gt!==void 0&&Nj(o,_e,gt)}ct=ct.next}while(ct!==tt)}}function Rj(a,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var _e=o=o.next;do{if((_e.tag&a)===a){var tt=_e.create;_e.destroy=tt()}_e=_e.next}while(_e!==o)}}function Sj(a){var o=a.ref;if(o!==null){var _e=a.stateNode;switch(a.tag){case 5:a=_e;break;default:a=_e}typeof o=="function"?o(a):o.current=a}}function Tj(a){var o=a.alternate;o!==null&&(a.alternate=null,Tj(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&(delete o[Of],delete o[Pf],delete o[of],delete o[Qf],delete o[Rf])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Uj(a){return a.tag===5||a.tag===3||a.tag===4}function Vj(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Uj(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Wj(a,o,_e){var tt=a.tag;if(tt===5||tt===6)a=a.stateNode,o?_e.nodeType===8?_e.parentNode.insertBefore(a,o):_e.insertBefore(a,o):(_e.nodeType===8?(o=_e.parentNode,o.insertBefore(a,_e)):(o=_e,o.appendChild(a)),_e=_e._reactRootContainer,_e!=null||o.onclick!==null||(o.onclick=Bf));else if(tt!==4&&(a=a.child,a!==null))for(Wj(a,o,_e),a=a.sibling;a!==null;)Wj(a,o,_e),a=a.sibling}function Xj(a,o,_e){var tt=a.tag;if(tt===5||tt===6)a=a.stateNode,o?_e.insertBefore(a,o):_e.appendChild(a);else if(tt!==4&&(a=a.child,a!==null))for(Xj(a,o,_e),a=a.sibling;a!==null;)Xj(a,o,_e),a=a.sibling}var X$1=null,Yj=!1;function Zj(a,o,_e){for(_e=_e.child;_e!==null;)ak(a,o,_e),_e=_e.sibling}function ak(a,o,_e){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,_e)}catch{}switch(_e.tag){case 5:U||Mj(_e,o);case 6:var tt=X$1,ct=Yj;X$1=null,Zj(a,o,_e),X$1=tt,Yj=ct,X$1!==null&&(Yj?(a=X$1,_e=_e.stateNode,a.nodeType===8?a.parentNode.removeChild(_e):a.removeChild(_e)):X$1.removeChild(_e.stateNode));break;case 18:X$1!==null&&(Yj?(a=X$1,_e=_e.stateNode,a.nodeType===8?Kf(a.parentNode,_e):a.nodeType===1&&Kf(a,_e),bd(a)):Kf(X$1,_e.stateNode));break;case 4:tt=X$1,ct=Yj,X$1=_e.stateNode.containerInfo,Yj=!0,Zj(a,o,_e),X$1=tt,Yj=ct;break;case 0:case 11:case 14:case 15:if(!U&&(tt=_e.updateQueue,tt!==null&&(tt=tt.lastEffect,tt!==null))){ct=tt=tt.next;do{var gt=ct,rt=gt.destroy;gt=gt.tag,rt!==void 0&&(gt&2||gt&4)&&Nj(_e,o,rt),ct=ct.next}while(ct!==tt)}Zj(a,o,_e);break;case 1:if(!U&&(Mj(_e,o),tt=_e.stateNode,typeof tt.componentWillUnmount=="function"))try{tt.props=_e.memoizedProps,tt.state=_e.memoizedState,tt.componentWillUnmount()}catch(it){W$2(_e,o,it)}Zj(a,o,_e);break;case 21:Zj(a,o,_e);break;case 22:_e.mode&1?(U=(tt=U)||_e.memoizedState!==null,Zj(a,o,_e),U=tt):Zj(a,o,_e);break;default:Zj(a,o,_e)}}function bk(a){var o=a.updateQueue;if(o!==null){a.updateQueue=null;var _e=a.stateNode;_e===null&&(_e=a.stateNode=new Lj),o.forEach(function(tt){var ct=ck.bind(null,a,tt);_e.has(tt)||(_e.add(tt),tt.then(ct,ct))})}}function dk(a,o){var _e=o.deletions;if(_e!==null)for(var tt=0;tt<_e.length;tt++){var ct=_e[tt];try{var gt=a,rt=o,it=rt;e:for(;it!==null;){switch(it.tag){case 5:X$1=it.stateNode,Yj=!1;break e;case 3:X$1=it.stateNode.containerInfo,Yj=!0;break e;case 4:X$1=it.stateNode.containerInfo,Yj=!0;break e}it=it.return}if(X$1===null)throw Error(p$2(160));ak(gt,rt,ct),X$1=null,Yj=!1;var s=ct.alternate;s!==null&&(s.return=null),ct.return=null}catch(et){W$2(ct,o,et)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)ek(o,a),o=o.sibling}function ek(a,o){var _e=a.alternate,tt=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(dk(o,a),fk(a),tt&4){try{Qj(3,a,a.return),Rj(3,a)}catch(lt){W$2(a,a.return,lt)}try{Qj(5,a,a.return)}catch(lt){W$2(a,a.return,lt)}}break;case 1:dk(o,a),fk(a),tt&512&&_e!==null&&Mj(_e,_e.return);break;case 5:if(dk(o,a),fk(a),tt&512&&_e!==null&&Mj(_e,_e.return),a.flags&32){var ct=a.stateNode;try{ob(ct,"")}catch(lt){W$2(a,a.return,lt)}}if(tt&4&&(ct=a.stateNode,ct!=null)){var gt=a.memoizedProps,rt=_e!==null?_e.memoizedProps:gt,it=a.type,s=a.updateQueue;if(a.updateQueue=null,s!==null)try{it==="input"&>.type==="radio"&>.name!=null&&ab(ct,gt),vb(it,rt);var et=vb(it,gt);for(rt=0;rtct&&(ct=rt),tt&=~gt}if(tt=ct,tt=B$1()-tt,tt=(120>tt?120:480>tt?480:1080>tt?1080:1920>tt?1920:3e3>tt?3e3:4320>tt?4320:1960*mk(tt/1960))-tt,10a?16:a,xk===null)var tt=!1;else{if(a=xk,xk=null,yk=0,K$1&6)throw Error(p$2(331));var ct=K$1;for(K$1|=4,V=a.current;V!==null;){var gt=V,rt=gt.child;if(V.flags&16){var it=gt.deletions;if(it!==null){for(var s=0;sB$1()-gk?Lk(a,0):sk|=_e),Ek(a,o)}function Zk(a,o){o===0&&(a.mode&1?(o=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):o=1);var _e=L();a=Zg(a,o),a!==null&&(Ac(a,o,_e),Ek(a,_e))}function vj(a){var o=a.memoizedState,_e=0;o!==null&&(_e=o.retryLane),Zk(a,_e)}function ck(a,o){var _e=0;switch(a.tag){case 13:var tt=a.stateNode,ct=a.memoizedState;ct!==null&&(_e=ct.retryLane);break;case 19:tt=a.stateNode;break;default:throw Error(p$2(314))}tt!==null&&tt.delete(o),Zk(a,_e)}var Wk;Wk=function(a,o,_e){if(a!==null)if(a.memoizedProps!==o.pendingProps||Wf.current)Ug=!0;else{if(!(a.lanes&_e)&&!(o.flags&128))return Ug=!1,zj(a,o,_e);Ug=!!(a.flags&131072)}else Ug=!1,I&&o.flags&1048576&&ug(o,ng,o.index);switch(o.lanes=0,o.tag){case 2:var tt=o.type;jj(a,o),a=o.pendingProps;var ct=Yf(o,H.current);Tg(o,_e),ct=Xh(null,o,tt,a,ct,_e);var gt=bi();return o.flags|=1,typeof ct=="object"&&ct!==null&&typeof ct.render=="function"&&ct.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Zf(tt)?(gt=!0,cg(o)):gt=!1,o.memoizedState=ct.state!==null&&ct.state!==void 0?ct.state:null,ah(o),ct.updater=nh,o.stateNode=ct,ct._reactInternals=o,rh(o,tt,a,_e),o=kj(null,o,tt,!0,gt,_e)):(o.tag=0,I&>&&vg(o),Yi(null,o,ct,_e),o=o.child),o;case 16:tt=o.elementType;e:{switch(jj(a,o),a=o.pendingProps,ct=tt._init,tt=ct(tt._payload),o.type=tt,ct=o.tag=$k(tt),a=Lg(tt,a),ct){case 0:o=dj(null,o,tt,a,_e);break e;case 1:o=ij(null,o,tt,a,_e);break e;case 11:o=Zi(null,o,tt,a,_e);break e;case 14:o=aj(null,o,tt,Lg(tt.type,a),_e);break e}throw Error(p$2(306,tt,""))}return o;case 0:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),dj(a,o,tt,ct,_e);case 1:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),ij(a,o,tt,ct,_e);case 3:e:{if(lj(o),a===null)throw Error(p$2(387));tt=o.pendingProps,gt=o.memoizedState,ct=gt.element,bh(a,o),gh(o,tt,null,_e);var rt=o.memoizedState;if(tt=rt.element,gt.isDehydrated)if(gt={element:tt,isDehydrated:!1,cache:rt.cache,pendingSuspenseBoundaries:rt.pendingSuspenseBoundaries,transitions:rt.transitions},o.updateQueue.baseState=gt,o.memoizedState=gt,o.flags&256){ct=Ki(Error(p$2(423)),o),o=mj(a,o,tt,_e,ct);break e}else if(tt!==ct){ct=Ki(Error(p$2(424)),o),o=mj(a,o,tt,_e,ct);break e}else for(yg=Lf(o.stateNode.containerInfo.firstChild),xg=o,I=!0,zg=null,_e=Ch(o,null,tt,_e),o.child=_e;_e;)_e.flags=_e.flags&-3|4096,_e=_e.sibling;else{if(Ig(),tt===ct){o=$i(a,o,_e);break e}Yi(a,o,tt,_e)}o=o.child}return o;case 5:return Kh(o),a===null&&Eg(o),tt=o.type,ct=o.pendingProps,gt=a!==null?a.memoizedProps:null,rt=ct.children,Ef(tt,ct)?rt=null:gt!==null&&Ef(tt,gt)&&(o.flags|=32),hj(a,o),Yi(a,o,rt,_e),o.child;case 6:return a===null&&Eg(o),null;case 13:return pj(a,o,_e);case 4:return Ih(o,o.stateNode.containerInfo),tt=o.pendingProps,a===null?o.child=Bh(o,null,tt,_e):Yi(a,o,tt,_e),o.child;case 11:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),Zi(a,o,tt,ct,_e);case 7:return Yi(a,o,o.pendingProps,_e),o.child;case 8:return Yi(a,o,o.pendingProps.children,_e),o.child;case 12:return Yi(a,o,o.pendingProps.children,_e),o.child;case 10:e:{if(tt=o.type._context,ct=o.pendingProps,gt=o.memoizedProps,rt=ct.value,G$1(Mg,tt._currentValue),tt._currentValue=rt,gt!==null)if(He(gt.value,rt)){if(gt.children===ct.children&&!Wf.current){o=$i(a,o,_e);break e}}else for(gt=o.child,gt!==null&&(gt.return=o);gt!==null;){var it=gt.dependencies;if(it!==null){rt=gt.child;for(var s=it.firstContext;s!==null;){if(s.context===tt){if(gt.tag===1){s=ch(-1,_e&-_e),s.tag=2;var et=gt.updateQueue;if(et!==null){et=et.shared;var nt=et.pending;nt===null?s.next=s:(s.next=nt.next,nt.next=s),et.pending=s}}gt.lanes|=_e,s=gt.alternate,s!==null&&(s.lanes|=_e),Sg(gt.return,_e,o),it.lanes|=_e;break}s=s.next}}else if(gt.tag===10)rt=gt.type===o.type?null:gt.child;else if(gt.tag===18){if(rt=gt.return,rt===null)throw Error(p$2(341));rt.lanes|=_e,it=rt.alternate,it!==null&&(it.lanes|=_e),Sg(rt,_e,o),rt=gt.sibling}else rt=gt.child;if(rt!==null)rt.return=gt;else for(rt=gt;rt!==null;){if(rt===o){rt=null;break}if(gt=rt.sibling,gt!==null){gt.return=rt.return,rt=gt;break}rt=rt.return}gt=rt}Yi(a,o,ct.children,_e),o=o.child}return o;case 9:return ct=o.type,tt=o.pendingProps.children,Tg(o,_e),ct=Vg(ct),tt=tt(ct),o.flags|=1,Yi(a,o,tt,_e),o.child;case 14:return tt=o.type,ct=Lg(tt,o.pendingProps),ct=Lg(tt.type,ct),aj(a,o,tt,ct,_e);case 15:return cj(a,o,o.type,o.pendingProps,_e);case 17:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),jj(a,o),o.tag=1,Zf(tt)?(a=!0,cg(o)):a=!1,Tg(o,_e),ph(o,tt,ct),rh(o,tt,ct,_e),kj(null,o,tt,!0,a,_e);case 19:return yj(a,o,_e);case 22:return ej(a,o,_e)}throw Error(p$2(156,o.tag))};function Gk(a,o){return ac(a,o)}function al(a,o,_e,tt){this.tag=a,this.key=_e,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=tt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(a,o,_e,tt){return new al(a,o,_e,tt)}function bj(a){return a=a.prototype,!(!a||!a.isReactComponent)}function $k(a){if(typeof a=="function")return bj(a)?1:0;if(a!=null){if(a=a.$$typeof,a===Da)return 11;if(a===Ga)return 14}return 2}function wh(a,o){var _e=a.alternate;return _e===null?(_e=Bg(a.tag,o,a.key,a.mode),_e.elementType=a.elementType,_e.type=a.type,_e.stateNode=a.stateNode,_e.alternate=a,a.alternate=_e):(_e.pendingProps=o,_e.type=a.type,_e.flags=0,_e.subtreeFlags=0,_e.deletions=null),_e.flags=a.flags&14680064,_e.childLanes=a.childLanes,_e.lanes=a.lanes,_e.child=a.child,_e.memoizedProps=a.memoizedProps,_e.memoizedState=a.memoizedState,_e.updateQueue=a.updateQueue,o=a.dependencies,_e.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},_e.sibling=a.sibling,_e.index=a.index,_e.ref=a.ref,_e}function yh(a,o,_e,tt,ct,gt){var rt=2;if(tt=a,typeof a=="function")bj(a)&&(rt=1);else if(typeof a=="string")rt=5;else e:switch(a){case ya:return Ah(_e.children,ct,gt,o);case za:rt=8,ct|=8;break;case Aa:return a=Bg(12,_e,o,ct|2),a.elementType=Aa,a.lanes=gt,a;case Ea:return a=Bg(13,_e,o,ct),a.elementType=Ea,a.lanes=gt,a;case Fa:return a=Bg(19,_e,o,ct),a.elementType=Fa,a.lanes=gt,a;case Ia:return qj(_e,ct,gt,o);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Ba:rt=10;break e;case Ca:rt=9;break e;case Da:rt=11;break e;case Ga:rt=14;break e;case Ha:rt=16,tt=null;break e}throw Error(p$2(130,a==null?a:typeof a,""))}return o=Bg(rt,_e,o,ct),o.elementType=a,o.type=tt,o.lanes=gt,o}function Ah(a,o,_e,tt){return a=Bg(7,a,tt,o),a.lanes=_e,a}function qj(a,o,_e,tt){return a=Bg(22,a,tt,o),a.elementType=Ia,a.lanes=_e,a.stateNode={isHidden:!1},a}function xh(a,o,_e){return a=Bg(6,a,null,o),a.lanes=_e,a}function zh(a,o,_e){return o=Bg(4,a.children!==null?a.children:[],a.key,o),o.lanes=_e,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}function bl(a,o,_e,tt,ct){this.tag=o,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=tt,this.onRecoverableError=ct,this.mutableSourceEagerHydrationData=null}function cl(a,o,_e,tt,ct,gt,rt,it,s){return a=new bl(a,o,_e,it,s),o===1?(o=1,gt===!0&&(o|=8)):o=0,gt=Bg(3,null,null,o),a.current=gt,gt.stateNode=a,gt.memoizedState={element:tt,isDehydrated:_e,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(gt),a}function dl(a,o,_e){var tt=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(a){console.error(a)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot,m$2=reactDomExports;createRoot=m$2.createRoot,m$2.hydrateRoot;/**
+`+gt.stack}return{value:a,source:o,stack:ct,digest:null}}function Li(a,o,_e){return{value:a,source:null,stack:_e??null,digest:o??null}}function Mi(a,o){try{console.error(o.value)}catch(_e){setTimeout(function(){throw _e})}}var Ni=typeof WeakMap=="function"?WeakMap:Map;function Oi(a,o,_e){_e=ch(-1,_e),_e.tag=3,_e.payload={element:null};var tt=o.value;return _e.callback=function(){Pi||(Pi=!0,Qi=tt),Mi(a,o)},_e}function Ri(a,o,_e){_e=ch(-1,_e),_e.tag=3;var tt=a.type.getDerivedStateFromError;if(typeof tt=="function"){var ct=o.value;_e.payload=function(){return tt(ct)},_e.callback=function(){Mi(a,o)}}var gt=a.stateNode;return gt!==null&&typeof gt.componentDidCatch=="function"&&(_e.callback=function(){Mi(a,o),typeof tt!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var rt=o.stack;this.componentDidCatch(o.value,{componentStack:rt!==null?rt:""})}),_e}function Ti(a,o,_e){var tt=a.pingCache;if(tt===null){tt=a.pingCache=new Ni;var ct=new Set;tt.set(o,ct)}else ct=tt.get(o),ct===void 0&&(ct=new Set,tt.set(o,ct));ct.has(_e)||(ct.add(_e),a=Ui.bind(null,a,o,_e),o.then(a,a))}function Vi(a){do{var o;if((o=a.tag===13)&&(o=a.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return a;a=a.return}while(a!==null);return null}function Wi(a,o,_e,tt,ct){return a.mode&1?(a.flags|=65536,a.lanes=ct,a):(a===o?a.flags|=65536:(a.flags|=128,_e.flags|=131072,_e.flags&=-52805,_e.tag===1&&(_e.alternate===null?_e.tag=17:(o=ch(-1,1),o.tag=2,dh(_e,o,1))),_e.lanes|=1),a)}var Xi=ua$1.ReactCurrentOwner,Ug=!1;function Yi(a,o,_e,tt){o.child=a===null?Ch(o,null,_e,tt):Bh(o,a.child,_e,tt)}function Zi(a,o,_e,tt,ct){_e=_e.render;var gt=o.ref;return Tg(o,ct),tt=Xh(a,o,_e,tt,gt,ct),_e=bi(),a!==null&&!Ug?(o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~ct,$i(a,o,ct)):(I&&_e&&vg(o),o.flags|=1,Yi(a,o,tt,ct),o.child)}function aj(a,o,_e,tt,ct){if(a===null){var gt=_e.type;return typeof gt=="function"&&!bj(gt)&>.defaultProps===void 0&&_e.compare===null&&_e.defaultProps===void 0?(o.tag=15,o.type=gt,cj(a,o,gt,tt,ct)):(a=yh(_e.type,null,tt,o,o.mode,ct),a.ref=o.ref,a.return=o,o.child=a)}if(gt=a.child,!(a.lanes&ct)){var rt=gt.memoizedProps;if(_e=_e.compare,_e=_e!==null?_e:Ie,_e(rt,tt)&&a.ref===o.ref)return $i(a,o,ct)}return o.flags|=1,a=wh(gt,tt),a.ref=o.ref,a.return=o,o.child=a}function cj(a,o,_e,tt,ct){if(a!==null){var gt=a.memoizedProps;if(Ie(gt,tt)&&a.ref===o.ref)if(Ug=!1,o.pendingProps=tt=gt,(a.lanes&ct)!==0)a.flags&131072&&(Ug=!0);else return o.lanes=a.lanes,$i(a,o,ct)}return dj(a,o,_e,tt,ct)}function ej(a,o,_e){var tt=o.pendingProps,ct=tt.children,gt=a!==null?a.memoizedState:null;if(tt.mode==="hidden")if(!(o.mode&1))o.memoizedState={baseLanes:0,cachePool:null,transitions:null},G$1(fj,gj),gj|=_e;else{if(!(_e&1073741824))return a=gt!==null?gt.baseLanes|_e:_e,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:a,cachePool:null,transitions:null},o.updateQueue=null,G$1(fj,gj),gj|=a,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt=gt!==null?gt.baseLanes:_e,G$1(fj,gj),gj|=tt}else gt!==null?(tt=gt.baseLanes|_e,o.memoizedState=null):tt=_e,G$1(fj,gj),gj|=tt;return Yi(a,o,ct,_e),o.child}function hj(a,o){var _e=o.ref;(a===null&&_e!==null||a!==null&&a.ref!==_e)&&(o.flags|=512,o.flags|=2097152)}function dj(a,o,_e,tt,ct){var gt=Zf(_e)?Xf:H.current;return gt=Yf(o,gt),Tg(o,ct),_e=Xh(a,o,_e,tt,gt,ct),tt=bi(),a!==null&&!Ug?(o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~ct,$i(a,o,ct)):(I&&tt&&vg(o),o.flags|=1,Yi(a,o,_e,ct),o.child)}function ij(a,o,_e,tt,ct){if(Zf(_e)){var gt=!0;cg(o)}else gt=!1;if(Tg(o,ct),o.stateNode===null)jj(a,o),ph(o,_e,tt),rh(o,_e,tt,ct),tt=!0;else if(a===null){var rt=o.stateNode,it=o.memoizedProps;rt.props=it;var s=rt.context,et=_e.contextType;typeof et=="object"&&et!==null?et=Vg(et):(et=Zf(_e)?Xf:H.current,et=Yf(o,et));var nt=_e.getDerivedStateFromProps,at=typeof nt=="function"||typeof rt.getSnapshotBeforeUpdate=="function";at||typeof rt.UNSAFE_componentWillReceiveProps!="function"&&typeof rt.componentWillReceiveProps!="function"||(it!==tt||s!==et)&&qh(o,rt,tt,et),$g=!1;var ht=o.memoizedState;rt.state=ht,gh(o,tt,rt,ct),s=o.memoizedState,it!==tt||ht!==s||Wf.current||$g?(typeof nt=="function"&&(kh(o,_e,nt,tt),s=o.memoizedState),(it=$g||oh(o,_e,it,tt,ht,s,et))?(at||typeof rt.UNSAFE_componentWillMount!="function"&&typeof rt.componentWillMount!="function"||(typeof rt.componentWillMount=="function"&&rt.componentWillMount(),typeof rt.UNSAFE_componentWillMount=="function"&&rt.UNSAFE_componentWillMount()),typeof rt.componentDidMount=="function"&&(o.flags|=4194308)):(typeof rt.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=tt,o.memoizedState=s),rt.props=tt,rt.state=s,rt.context=et,tt=it):(typeof rt.componentDidMount=="function"&&(o.flags|=4194308),tt=!1)}else{rt=o.stateNode,bh(a,o),it=o.memoizedProps,et=o.type===o.elementType?it:Lg(o.type,it),rt.props=et,at=o.pendingProps,ht=rt.context,s=_e.contextType,typeof s=="object"&&s!==null?s=Vg(s):(s=Zf(_e)?Xf:H.current,s=Yf(o,s));var dt=_e.getDerivedStateFromProps;(nt=typeof dt=="function"||typeof rt.getSnapshotBeforeUpdate=="function")||typeof rt.UNSAFE_componentWillReceiveProps!="function"&&typeof rt.componentWillReceiveProps!="function"||(it!==at||ht!==s)&&qh(o,rt,tt,s),$g=!1,ht=o.memoizedState,rt.state=ht,gh(o,tt,rt,ct);var pt=o.memoizedState;it!==at||ht!==pt||Wf.current||$g?(typeof dt=="function"&&(kh(o,_e,dt,tt),pt=o.memoizedState),(et=$g||oh(o,_e,et,tt,ht,pt,s)||!1)?(nt||typeof rt.UNSAFE_componentWillUpdate!="function"&&typeof rt.componentWillUpdate!="function"||(typeof rt.componentWillUpdate=="function"&&rt.componentWillUpdate(tt,pt,s),typeof rt.UNSAFE_componentWillUpdate=="function"&&rt.UNSAFE_componentWillUpdate(tt,pt,s)),typeof rt.componentDidUpdate=="function"&&(o.flags|=4),typeof rt.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof rt.componentDidUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=4),typeof rt.getSnapshotBeforeUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=1024),o.memoizedProps=tt,o.memoizedState=pt),rt.props=tt,rt.state=pt,rt.context=s,tt=et):(typeof rt.componentDidUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=4),typeof rt.getSnapshotBeforeUpdate!="function"||it===a.memoizedProps&&ht===a.memoizedState||(o.flags|=1024),tt=!1)}return kj(a,o,_e,tt,gt,ct)}function kj(a,o,_e,tt,ct,gt){hj(a,o);var rt=(o.flags&128)!==0;if(!tt&&!rt)return ct&&dg(o,_e,!1),$i(a,o,gt);tt=o.stateNode,Xi.current=o;var it=rt&&typeof _e.getDerivedStateFromError!="function"?null:tt.render();return o.flags|=1,a!==null&&rt?(o.child=Bh(o,a.child,null,gt),o.child=Bh(o,null,it,gt)):Yi(a,o,it,gt),o.memoizedState=tt.state,ct&&dg(o,_e,!0),o.child}function lj(a){var o=a.stateNode;o.pendingContext?ag(a,o.pendingContext,o.pendingContext!==o.context):o.context&&ag(a,o.context,!1),Ih(a,o.containerInfo)}function mj(a,o,_e,tt,ct){return Ig(),Jg(ct),o.flags|=256,Yi(a,o,_e,tt),o.child}var nj={dehydrated:null,treeContext:null,retryLane:0};function oj(a){return{baseLanes:a,cachePool:null,transitions:null}}function pj(a,o,_e){var tt=o.pendingProps,ct=M$1.current,gt=!1,rt=(o.flags&128)!==0,it;if((it=rt)||(it=a!==null&&a.memoizedState===null?!1:(ct&2)!==0),it?(gt=!0,o.flags&=-129):(a===null||a.memoizedState!==null)&&(ct|=1),G$1(M$1,ct&1),a===null)return Eg(o),a=o.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(o.mode&1?a.data==="$!"?o.lanes=8:o.lanes=1073741824:o.lanes=1,null):(rt=tt.children,a=tt.fallback,gt?(tt=o.mode,gt=o.child,rt={mode:"hidden",children:rt},!(tt&1)&>!==null?(gt.childLanes=0,gt.pendingProps=rt):gt=qj(rt,tt,0,null),a=Ah(a,tt,_e,null),gt.return=o,a.return=o,gt.sibling=a,o.child=gt,o.child.memoizedState=oj(_e),o.memoizedState=nj,a):rj(o,rt));if(ct=a.memoizedState,ct!==null&&(it=ct.dehydrated,it!==null))return sj(a,o,rt,tt,it,ct,_e);if(gt){gt=tt.fallback,rt=o.mode,ct=a.child,it=ct.sibling;var s={mode:"hidden",children:tt.children};return!(rt&1)&&o.child!==ct?(tt=o.child,tt.childLanes=0,tt.pendingProps=s,o.deletions=null):(tt=wh(ct,s),tt.subtreeFlags=ct.subtreeFlags&14680064),it!==null?gt=wh(it,gt):(gt=Ah(gt,rt,_e,null),gt.flags|=2),gt.return=o,tt.return=o,tt.sibling=gt,o.child=tt,tt=gt,gt=o.child,rt=a.child.memoizedState,rt=rt===null?oj(_e):{baseLanes:rt.baseLanes|_e,cachePool:null,transitions:rt.transitions},gt.memoizedState=rt,gt.childLanes=a.childLanes&~_e,o.memoizedState=nj,tt}return gt=a.child,a=gt.sibling,tt=wh(gt,{mode:"visible",children:tt.children}),!(o.mode&1)&&(tt.lanes=_e),tt.return=o,tt.sibling=null,a!==null&&(_e=o.deletions,_e===null?(o.deletions=[a],o.flags|=16):_e.push(a)),o.child=tt,o.memoizedState=null,tt}function rj(a,o){return o=qj({mode:"visible",children:o},a.mode,0,null),o.return=a,a.child=o}function tj(a,o,_e,tt){return tt!==null&&Jg(tt),Bh(o,a.child,null,_e),a=rj(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function sj(a,o,_e,tt,ct,gt,rt){if(_e)return o.flags&256?(o.flags&=-257,tt=Li(Error(p$2(422))),tj(a,o,rt,tt)):o.memoizedState!==null?(o.child=a.child,o.flags|=128,null):(gt=tt.fallback,ct=o.mode,tt=qj({mode:"visible",children:tt.children},ct,0,null),gt=Ah(gt,ct,rt,null),gt.flags|=2,tt.return=o,gt.return=o,tt.sibling=gt,o.child=tt,o.mode&1&&Bh(o,a.child,null,rt),o.child.memoizedState=oj(rt),o.memoizedState=nj,gt);if(!(o.mode&1))return tj(a,o,rt,null);if(ct.data==="$!"){if(tt=ct.nextSibling&&ct.nextSibling.dataset,tt)var it=tt.dgst;return tt=it,gt=Error(p$2(419)),tt=Li(gt,tt,void 0),tj(a,o,rt,tt)}if(it=(rt&a.childLanes)!==0,Ug||it){if(tt=R$1,tt!==null){switch(rt&-rt){case 4:ct=2;break;case 16:ct=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:ct=32;break;case 536870912:ct=268435456;break;default:ct=0}ct=ct&(tt.suspendedLanes|rt)?0:ct,ct!==0&&ct!==gt.retryLane&&(gt.retryLane=ct,Zg(a,ct),mh(tt,a,ct,-1))}return uj(),tt=Li(Error(p$2(421))),tj(a,o,rt,tt)}return ct.data==="$?"?(o.flags|=128,o.child=a.child,o=vj.bind(null,a),ct._reactRetry=o,null):(a=gt.treeContext,yg=Lf(ct.nextSibling),xg=o,I=!0,zg=null,a!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=a.id,sg=a.overflow,qg=o),o=rj(o,tt.children),o.flags|=4096,o)}function wj(a,o,_e){a.lanes|=o;var tt=a.alternate;tt!==null&&(tt.lanes|=o),Sg(a.return,o,_e)}function xj(a,o,_e,tt,ct){var gt=a.memoizedState;gt===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:tt,tail:_e,tailMode:ct}:(gt.isBackwards=o,gt.rendering=null,gt.renderingStartTime=0,gt.last=tt,gt.tail=_e,gt.tailMode=ct)}function yj(a,o,_e){var tt=o.pendingProps,ct=tt.revealOrder,gt=tt.tail;if(Yi(a,o,tt.children,_e),tt=M$1.current,tt&2)tt=tt&1|2,o.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&wj(a,_e,o);else if(a.tag===19)wj(a,_e,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}tt&=1}if(G$1(M$1,tt),!(o.mode&1))o.memoizedState=null;else switch(ct){case"forwards":for(_e=o.child,ct=null;_e!==null;)a=_e.alternate,a!==null&&Mh(a)===null&&(ct=_e),_e=_e.sibling;_e=ct,_e===null?(ct=o.child,o.child=null):(ct=_e.sibling,_e.sibling=null),xj(o,!1,ct,_e,gt);break;case"backwards":for(_e=null,ct=o.child,o.child=null;ct!==null;){if(a=ct.alternate,a!==null&&Mh(a)===null){o.child=ct;break}a=ct.sibling,ct.sibling=_e,_e=ct,ct=a}xj(o,!0,_e,null,gt);break;case"together":xj(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function jj(a,o){!(o.mode&1)&&a!==null&&(a.alternate=null,o.alternate=null,o.flags|=2)}function $i(a,o,_e){if(a!==null&&(o.dependencies=a.dependencies),hh|=o.lanes,!(_e&o.childLanes))return null;if(a!==null&&o.child!==a.child)throw Error(p$2(153));if(o.child!==null){for(a=o.child,_e=wh(a,a.pendingProps),o.child=_e,_e.return=o;a.sibling!==null;)a=a.sibling,_e=_e.sibling=wh(a,a.pendingProps),_e.return=o;_e.sibling=null}return o.child}function zj(a,o,_e){switch(o.tag){case 3:lj(o),Ig();break;case 5:Kh(o);break;case 1:Zf(o.type)&&cg(o);break;case 4:Ih(o,o.stateNode.containerInfo);break;case 10:var tt=o.type._context,ct=o.memoizedProps.value;G$1(Mg,tt._currentValue),tt._currentValue=ct;break;case 13:if(tt=o.memoizedState,tt!==null)return tt.dehydrated!==null?(G$1(M$1,M$1.current&1),o.flags|=128,null):_e&o.child.childLanes?pj(a,o,_e):(G$1(M$1,M$1.current&1),a=$i(a,o,_e),a!==null?a.sibling:null);G$1(M$1,M$1.current&1);break;case 19:if(tt=(_e&o.childLanes)!==0,a.flags&128){if(tt)return yj(a,o,_e);o.flags|=128}if(ct=o.memoizedState,ct!==null&&(ct.rendering=null,ct.tail=null,ct.lastEffect=null),G$1(M$1,M$1.current),tt)break;return null;case 22:case 23:return o.lanes=0,ej(a,o,_e)}return $i(a,o,_e)}var Aj,Bj,Cj,Dj;Aj=function(a,o){for(var _e=o.child;_e!==null;){if(_e.tag===5||_e.tag===6)a.appendChild(_e.stateNode);else if(_e.tag!==4&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===o)break;for(;_e.sibling===null;){if(_e.return===null||_e.return===o)return;_e=_e.return}_e.sibling.return=_e.return,_e=_e.sibling}};Bj=function(){};Cj=function(a,o,_e,tt){var ct=a.memoizedProps;if(ct!==tt){a=o.stateNode,Hh(Eh.current);var gt=null;switch(_e){case"input":ct=Ya(a,ct),tt=Ya(a,tt),gt=[];break;case"select":ct=A$3({},ct,{value:void 0}),tt=A$3({},tt,{value:void 0}),gt=[];break;case"textarea":ct=gb(a,ct),tt=gb(a,tt),gt=[];break;default:typeof ct.onClick!="function"&&typeof tt.onClick=="function"&&(a.onclick=Bf)}ub(_e,tt);var rt;_e=null;for(et in ct)if(!tt.hasOwnProperty(et)&&ct.hasOwnProperty(et)&&ct[et]!=null)if(et==="style"){var it=ct[et];for(rt in it)it.hasOwnProperty(rt)&&(_e||(_e={}),_e[rt]="")}else et!=="dangerouslySetInnerHTML"&&et!=="children"&&et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&et!=="autoFocus"&&(ea.hasOwnProperty(et)?gt||(gt=[]):(gt=gt||[]).push(et,null));for(et in tt){var s=tt[et];if(it=ct!=null?ct[et]:void 0,tt.hasOwnProperty(et)&&s!==it&&(s!=null||it!=null))if(et==="style")if(it){for(rt in it)!it.hasOwnProperty(rt)||s&&s.hasOwnProperty(rt)||(_e||(_e={}),_e[rt]="");for(rt in s)s.hasOwnProperty(rt)&&it[rt]!==s[rt]&&(_e||(_e={}),_e[rt]=s[rt])}else _e||(gt||(gt=[]),gt.push(et,_e)),_e=s;else et==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,it=it?it.__html:void 0,s!=null&&it!==s&&(gt=gt||[]).push(et,s)):et==="children"?typeof s!="string"&&typeof s!="number"||(gt=gt||[]).push(et,""+s):et!=="suppressContentEditableWarning"&&et!=="suppressHydrationWarning"&&(ea.hasOwnProperty(et)?(s!=null&&et==="onScroll"&&D$1("scroll",a),gt||it===s||(gt=[])):(gt=gt||[]).push(et,s))}_e&&(gt=gt||[]).push("style",_e);var et=gt;(o.updateQueue=et)&&(o.flags|=4)}};Dj=function(a,o,_e,tt){_e!==tt&&(o.flags|=4)};function Ej(a,o){if(!I)switch(a.tailMode){case"hidden":o=a.tail;for(var _e=null;o!==null;)o.alternate!==null&&(_e=o),o=o.sibling;_e===null?a.tail=null:_e.sibling=null;break;case"collapsed":_e=a.tail;for(var tt=null;_e!==null;)_e.alternate!==null&&(tt=_e),_e=_e.sibling;tt===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:tt.sibling=null}}function S$2(a){var o=a.alternate!==null&&a.alternate.child===a.child,_e=0,tt=0;if(o)for(var ct=a.child;ct!==null;)_e|=ct.lanes|ct.childLanes,tt|=ct.subtreeFlags&14680064,tt|=ct.flags&14680064,ct.return=a,ct=ct.sibling;else for(ct=a.child;ct!==null;)_e|=ct.lanes|ct.childLanes,tt|=ct.subtreeFlags,tt|=ct.flags,ct.return=a,ct=ct.sibling;return a.subtreeFlags|=tt,a.childLanes=_e,o}function Fj(a,o,_e){var tt=o.pendingProps;switch(wg(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S$2(o),null;case 1:return Zf(o.type)&&$f(),S$2(o),null;case 3:return tt=o.stateNode,Jh(),E$1(Wf),E$1(H),Oh(),tt.pendingContext&&(tt.context=tt.pendingContext,tt.pendingContext=null),(a===null||a.child===null)&&(Gg(o)?o.flags|=4:a===null||a.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,zg!==null&&(Gj(zg),zg=null))),Bj(a,o),S$2(o),null;case 5:Lh(o);var ct=Hh(Gh.current);if(_e=o.type,a!==null&&o.stateNode!=null)Cj(a,o,_e,tt,ct),a.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!tt){if(o.stateNode===null)throw Error(p$2(166));return S$2(o),null}if(a=Hh(Eh.current),Gg(o)){tt=o.stateNode,_e=o.type;var gt=o.memoizedProps;switch(tt[Of]=o,tt[Pf]=gt,a=(o.mode&1)!==0,_e){case"dialog":D$1("cancel",tt),D$1("close",tt);break;case"iframe":case"object":case"embed":D$1("load",tt);break;case"video":case"audio":for(ct=0;ct<\/script>",a=a.removeChild(a.firstChild)):typeof tt.is=="string"?a=rt.createElement(_e,{is:tt.is}):(a=rt.createElement(_e),_e==="select"&&(rt=a,tt.multiple?rt.multiple=!0:tt.size&&(rt.size=tt.size))):a=rt.createElementNS(a,_e),a[Of]=o,a[Pf]=tt,Aj(a,o,!1,!1),o.stateNode=a;e:{switch(rt=vb(_e,tt),_e){case"dialog":D$1("cancel",a),D$1("close",a),ct=tt;break;case"iframe":case"object":case"embed":D$1("load",a),ct=tt;break;case"video":case"audio":for(ct=0;ctHj&&(o.flags|=128,tt=!0,Ej(gt,!1),o.lanes=4194304)}else{if(!tt)if(a=Mh(rt),a!==null){if(o.flags|=128,tt=!0,_e=a.updateQueue,_e!==null&&(o.updateQueue=_e,o.flags|=4),Ej(gt,!0),gt.tail===null&>.tailMode==="hidden"&&!rt.alternate&&!I)return S$2(o),null}else 2*B$1()-gt.renderingStartTime>Hj&&_e!==1073741824&&(o.flags|=128,tt=!0,Ej(gt,!1),o.lanes=4194304);gt.isBackwards?(rt.sibling=o.child,o.child=rt):(_e=gt.last,_e!==null?_e.sibling=rt:o.child=rt,gt.last=rt)}return gt.tail!==null?(o=gt.tail,gt.rendering=o,gt.tail=o.sibling,gt.renderingStartTime=B$1(),o.sibling=null,_e=M$1.current,G$1(M$1,tt?_e&1|2:_e&1),o):(S$2(o),null);case 22:case 23:return Ij(),tt=o.memoizedState!==null,a!==null&&a.memoizedState!==null!==tt&&(o.flags|=8192),tt&&o.mode&1?gj&1073741824&&(S$2(o),o.subtreeFlags&6&&(o.flags|=8192)):S$2(o),null;case 24:return null;case 25:return null}throw Error(p$2(156,o.tag))}function Jj(a,o){switch(wg(o),o.tag){case 1:return Zf(o.type)&&$f(),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Jh(),E$1(Wf),E$1(H),Oh(),a=o.flags,a&65536&&!(a&128)?(o.flags=a&-65537|128,o):null;case 5:return Lh(o),null;case 13:if(E$1(M$1),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(p$2(340));Ig()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return E$1(M$1),null;case 4:return Jh(),null;case 10:return Rg(o.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Mj(a,o){var _e=a.ref;if(_e!==null)if(typeof _e=="function")try{_e(null)}catch(tt){W$2(a,o,tt)}else _e.current=null}function Nj(a,o,_e){try{_e()}catch(tt){W$2(a,o,tt)}}var Oj=!1;function Pj(a,o){if(Cf=dd,a=Me(),Ne(a)){if("selectionStart"in a)var _e={start:a.selectionStart,end:a.selectionEnd};else e:{_e=(_e=a.ownerDocument)&&_e.defaultView||window;var tt=_e.getSelection&&_e.getSelection();if(tt&&tt.rangeCount!==0){_e=tt.anchorNode;var ct=tt.anchorOffset,gt=tt.focusNode;tt=tt.focusOffset;try{_e.nodeType,gt.nodeType}catch{_e=null;break e}var rt=0,it=-1,s=-1,et=0,nt=0,at=a,ht=null;t:for(;;){for(var dt;at!==_e||ct!==0&&at.nodeType!==3||(it=rt+ct),at!==gt||tt!==0&&at.nodeType!==3||(s=rt+tt),at.nodeType===3&&(rt+=at.nodeValue.length),(dt=at.firstChild)!==null;)ht=at,at=dt;for(;;){if(at===a)break t;if(ht===_e&&++et===ct&&(it=rt),ht===gt&&++nt===tt&&(s=rt),(dt=at.nextSibling)!==null)break;at=ht,ht=at.parentNode}at=dt}_e=it===-1||s===-1?null:{start:it,end:s}}else _e=null}_e=_e||{start:0,end:0}}else _e=null;for(Df={focusedElem:a,selectionRange:_e},dd=!1,V=o;V!==null;)if(o=V,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,V=a;else for(;V!==null;){o=V;try{var pt=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(pt!==null){var lt=pt.memoizedProps,mt=pt.memoizedState,ot=o.stateNode,ut=ot.getSnapshotBeforeUpdate(o.elementType===o.type?lt:Lg(o.type,lt),mt);ot.__reactInternalSnapshotBeforeUpdate=ut}break;case 3:var ft=o.stateNode.containerInfo;ft.nodeType===1?ft.textContent="":ft.nodeType===9&&ft.documentElement&&ft.removeChild(ft.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$2(163))}}catch(bt){W$2(o,o.return,bt)}if(a=o.sibling,a!==null){a.return=o.return,V=a;break}V=o.return}return pt=Oj,Oj=!1,pt}function Qj(a,o,_e){var tt=o.updateQueue;if(tt=tt!==null?tt.lastEffect:null,tt!==null){var ct=tt=tt.next;do{if((ct.tag&a)===a){var gt=ct.destroy;ct.destroy=void 0,gt!==void 0&&Nj(o,_e,gt)}ct=ct.next}while(ct!==tt)}}function Rj(a,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var _e=o=o.next;do{if((_e.tag&a)===a){var tt=_e.create;_e.destroy=tt()}_e=_e.next}while(_e!==o)}}function Sj(a){var o=a.ref;if(o!==null){var _e=a.stateNode;switch(a.tag){case 5:a=_e;break;default:a=_e}typeof o=="function"?o(a):o.current=a}}function Tj(a){var o=a.alternate;o!==null&&(a.alternate=null,Tj(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&(delete o[Of],delete o[Pf],delete o[of],delete o[Qf],delete o[Rf])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Uj(a){return a.tag===5||a.tag===3||a.tag===4}function Vj(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Uj(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Wj(a,o,_e){var tt=a.tag;if(tt===5||tt===6)a=a.stateNode,o?_e.nodeType===8?_e.parentNode.insertBefore(a,o):_e.insertBefore(a,o):(_e.nodeType===8?(o=_e.parentNode,o.insertBefore(a,_e)):(o=_e,o.appendChild(a)),_e=_e._reactRootContainer,_e!=null||o.onclick!==null||(o.onclick=Bf));else if(tt!==4&&(a=a.child,a!==null))for(Wj(a,o,_e),a=a.sibling;a!==null;)Wj(a,o,_e),a=a.sibling}function Xj(a,o,_e){var tt=a.tag;if(tt===5||tt===6)a=a.stateNode,o?_e.insertBefore(a,o):_e.appendChild(a);else if(tt!==4&&(a=a.child,a!==null))for(Xj(a,o,_e),a=a.sibling;a!==null;)Xj(a,o,_e),a=a.sibling}var X$1=null,Yj=!1;function Zj(a,o,_e){for(_e=_e.child;_e!==null;)ak(a,o,_e),_e=_e.sibling}function ak(a,o,_e){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,_e)}catch{}switch(_e.tag){case 5:U||Mj(_e,o);case 6:var tt=X$1,ct=Yj;X$1=null,Zj(a,o,_e),X$1=tt,Yj=ct,X$1!==null&&(Yj?(a=X$1,_e=_e.stateNode,a.nodeType===8?a.parentNode.removeChild(_e):a.removeChild(_e)):X$1.removeChild(_e.stateNode));break;case 18:X$1!==null&&(Yj?(a=X$1,_e=_e.stateNode,a.nodeType===8?Kf(a.parentNode,_e):a.nodeType===1&&Kf(a,_e),bd(a)):Kf(X$1,_e.stateNode));break;case 4:tt=X$1,ct=Yj,X$1=_e.stateNode.containerInfo,Yj=!0,Zj(a,o,_e),X$1=tt,Yj=ct;break;case 0:case 11:case 14:case 15:if(!U&&(tt=_e.updateQueue,tt!==null&&(tt=tt.lastEffect,tt!==null))){ct=tt=tt.next;do{var gt=ct,rt=gt.destroy;gt=gt.tag,rt!==void 0&&(gt&2||gt&4)&&Nj(_e,o,rt),ct=ct.next}while(ct!==tt)}Zj(a,o,_e);break;case 1:if(!U&&(Mj(_e,o),tt=_e.stateNode,typeof tt.componentWillUnmount=="function"))try{tt.props=_e.memoizedProps,tt.state=_e.memoizedState,tt.componentWillUnmount()}catch(it){W$2(_e,o,it)}Zj(a,o,_e);break;case 21:Zj(a,o,_e);break;case 22:_e.mode&1?(U=(tt=U)||_e.memoizedState!==null,Zj(a,o,_e),U=tt):Zj(a,o,_e);break;default:Zj(a,o,_e)}}function bk(a){var o=a.updateQueue;if(o!==null){a.updateQueue=null;var _e=a.stateNode;_e===null&&(_e=a.stateNode=new Lj),o.forEach(function(tt){var ct=ck.bind(null,a,tt);_e.has(tt)||(_e.add(tt),tt.then(ct,ct))})}}function dk(a,o){var _e=o.deletions;if(_e!==null)for(var tt=0;tt<_e.length;tt++){var ct=_e[tt];try{var gt=a,rt=o,it=rt;e:for(;it!==null;){switch(it.tag){case 5:X$1=it.stateNode,Yj=!1;break e;case 3:X$1=it.stateNode.containerInfo,Yj=!0;break e;case 4:X$1=it.stateNode.containerInfo,Yj=!0;break e}it=it.return}if(X$1===null)throw Error(p$2(160));ak(gt,rt,ct),X$1=null,Yj=!1;var s=ct.alternate;s!==null&&(s.return=null),ct.return=null}catch(et){W$2(ct,o,et)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)ek(o,a),o=o.sibling}function ek(a,o){var _e=a.alternate,tt=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(dk(o,a),fk(a),tt&4){try{Qj(3,a,a.return),Rj(3,a)}catch(lt){W$2(a,a.return,lt)}try{Qj(5,a,a.return)}catch(lt){W$2(a,a.return,lt)}}break;case 1:dk(o,a),fk(a),tt&512&&_e!==null&&Mj(_e,_e.return);break;case 5:if(dk(o,a),fk(a),tt&512&&_e!==null&&Mj(_e,_e.return),a.flags&32){var ct=a.stateNode;try{ob(ct,"")}catch(lt){W$2(a,a.return,lt)}}if(tt&4&&(ct=a.stateNode,ct!=null)){var gt=a.memoizedProps,rt=_e!==null?_e.memoizedProps:gt,it=a.type,s=a.updateQueue;if(a.updateQueue=null,s!==null)try{it==="input"&>.type==="radio"&>.name!=null&&ab(ct,gt),vb(it,rt);var et=vb(it,gt);for(rt=0;rtct&&(ct=rt),tt&=~gt}if(tt=ct,tt=B$1()-tt,tt=(120>tt?120:480>tt?480:1080>tt?1080:1920>tt?1920:3e3>tt?3e3:4320>tt?4320:1960*mk(tt/1960))-tt,10a?16:a,xk===null)var tt=!1;else{if(a=xk,xk=null,yk=0,K$1&6)throw Error(p$2(331));var ct=K$1;for(K$1|=4,V=a.current;V!==null;){var gt=V,rt=gt.child;if(V.flags&16){var it=gt.deletions;if(it!==null){for(var s=0;sB$1()-gk?Lk(a,0):sk|=_e),Ek(a,o)}function Zk(a,o){o===0&&(a.mode&1?(o=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):o=1);var _e=L();a=Zg(a,o),a!==null&&(Ac(a,o,_e),Ek(a,_e))}function vj(a){var o=a.memoizedState,_e=0;o!==null&&(_e=o.retryLane),Zk(a,_e)}function ck(a,o){var _e=0;switch(a.tag){case 13:var tt=a.stateNode,ct=a.memoizedState;ct!==null&&(_e=ct.retryLane);break;case 19:tt=a.stateNode;break;default:throw Error(p$2(314))}tt!==null&&tt.delete(o),Zk(a,_e)}var Wk;Wk=function(a,o,_e){if(a!==null)if(a.memoizedProps!==o.pendingProps||Wf.current)Ug=!0;else{if(!(a.lanes&_e)&&!(o.flags&128))return Ug=!1,zj(a,o,_e);Ug=!!(a.flags&131072)}else Ug=!1,I&&o.flags&1048576&&ug(o,ng,o.index);switch(o.lanes=0,o.tag){case 2:var tt=o.type;jj(a,o),a=o.pendingProps;var ct=Yf(o,H.current);Tg(o,_e),ct=Xh(null,o,tt,a,ct,_e);var gt=bi();return o.flags|=1,typeof ct=="object"&&ct!==null&&typeof ct.render=="function"&&ct.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Zf(tt)?(gt=!0,cg(o)):gt=!1,o.memoizedState=ct.state!==null&&ct.state!==void 0?ct.state:null,ah(o),ct.updater=nh,o.stateNode=ct,ct._reactInternals=o,rh(o,tt,a,_e),o=kj(null,o,tt,!0,gt,_e)):(o.tag=0,I&>&&vg(o),Yi(null,o,ct,_e),o=o.child),o;case 16:tt=o.elementType;e:{switch(jj(a,o),a=o.pendingProps,ct=tt._init,tt=ct(tt._payload),o.type=tt,ct=o.tag=$k(tt),a=Lg(tt,a),ct){case 0:o=dj(null,o,tt,a,_e);break e;case 1:o=ij(null,o,tt,a,_e);break e;case 11:o=Zi(null,o,tt,a,_e);break e;case 14:o=aj(null,o,tt,Lg(tt.type,a),_e);break e}throw Error(p$2(306,tt,""))}return o;case 0:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),dj(a,o,tt,ct,_e);case 1:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),ij(a,o,tt,ct,_e);case 3:e:{if(lj(o),a===null)throw Error(p$2(387));tt=o.pendingProps,gt=o.memoizedState,ct=gt.element,bh(a,o),gh(o,tt,null,_e);var rt=o.memoizedState;if(tt=rt.element,gt.isDehydrated)if(gt={element:tt,isDehydrated:!1,cache:rt.cache,pendingSuspenseBoundaries:rt.pendingSuspenseBoundaries,transitions:rt.transitions},o.updateQueue.baseState=gt,o.memoizedState=gt,o.flags&256){ct=Ki(Error(p$2(423)),o),o=mj(a,o,tt,_e,ct);break e}else if(tt!==ct){ct=Ki(Error(p$2(424)),o),o=mj(a,o,tt,_e,ct);break e}else for(yg=Lf(o.stateNode.containerInfo.firstChild),xg=o,I=!0,zg=null,_e=Ch(o,null,tt,_e),o.child=_e;_e;)_e.flags=_e.flags&-3|4096,_e=_e.sibling;else{if(Ig(),tt===ct){o=$i(a,o,_e);break e}Yi(a,o,tt,_e)}o=o.child}return o;case 5:return Kh(o),a===null&&Eg(o),tt=o.type,ct=o.pendingProps,gt=a!==null?a.memoizedProps:null,rt=ct.children,Ef(tt,ct)?rt=null:gt!==null&&Ef(tt,gt)&&(o.flags|=32),hj(a,o),Yi(a,o,rt,_e),o.child;case 6:return a===null&&Eg(o),null;case 13:return pj(a,o,_e);case 4:return Ih(o,o.stateNode.containerInfo),tt=o.pendingProps,a===null?o.child=Bh(o,null,tt,_e):Yi(a,o,tt,_e),o.child;case 11:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),Zi(a,o,tt,ct,_e);case 7:return Yi(a,o,o.pendingProps,_e),o.child;case 8:return Yi(a,o,o.pendingProps.children,_e),o.child;case 12:return Yi(a,o,o.pendingProps.children,_e),o.child;case 10:e:{if(tt=o.type._context,ct=o.pendingProps,gt=o.memoizedProps,rt=ct.value,G$1(Mg,tt._currentValue),tt._currentValue=rt,gt!==null)if(He(gt.value,rt)){if(gt.children===ct.children&&!Wf.current){o=$i(a,o,_e);break e}}else for(gt=o.child,gt!==null&&(gt.return=o);gt!==null;){var it=gt.dependencies;if(it!==null){rt=gt.child;for(var s=it.firstContext;s!==null;){if(s.context===tt){if(gt.tag===1){s=ch(-1,_e&-_e),s.tag=2;var et=gt.updateQueue;if(et!==null){et=et.shared;var nt=et.pending;nt===null?s.next=s:(s.next=nt.next,nt.next=s),et.pending=s}}gt.lanes|=_e,s=gt.alternate,s!==null&&(s.lanes|=_e),Sg(gt.return,_e,o),it.lanes|=_e;break}s=s.next}}else if(gt.tag===10)rt=gt.type===o.type?null:gt.child;else if(gt.tag===18){if(rt=gt.return,rt===null)throw Error(p$2(341));rt.lanes|=_e,it=rt.alternate,it!==null&&(it.lanes|=_e),Sg(rt,_e,o),rt=gt.sibling}else rt=gt.child;if(rt!==null)rt.return=gt;else for(rt=gt;rt!==null;){if(rt===o){rt=null;break}if(gt=rt.sibling,gt!==null){gt.return=rt.return,rt=gt;break}rt=rt.return}gt=rt}Yi(a,o,ct.children,_e),o=o.child}return o;case 9:return ct=o.type,tt=o.pendingProps.children,Tg(o,_e),ct=Vg(ct),tt=tt(ct),o.flags|=1,Yi(a,o,tt,_e),o.child;case 14:return tt=o.type,ct=Lg(tt,o.pendingProps),ct=Lg(tt.type,ct),aj(a,o,tt,ct,_e);case 15:return cj(a,o,o.type,o.pendingProps,_e);case 17:return tt=o.type,ct=o.pendingProps,ct=o.elementType===tt?ct:Lg(tt,ct),jj(a,o),o.tag=1,Zf(tt)?(a=!0,cg(o)):a=!1,Tg(o,_e),ph(o,tt,ct),rh(o,tt,ct,_e),kj(null,o,tt,!0,a,_e);case 19:return yj(a,o,_e);case 22:return ej(a,o,_e)}throw Error(p$2(156,o.tag))};function Gk(a,o){return ac(a,o)}function al(a,o,_e,tt){this.tag=a,this.key=_e,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=tt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(a,o,_e,tt){return new al(a,o,_e,tt)}function bj(a){return a=a.prototype,!(!a||!a.isReactComponent)}function $k(a){if(typeof a=="function")return bj(a)?1:0;if(a!=null){if(a=a.$$typeof,a===Da)return 11;if(a===Ga)return 14}return 2}function wh(a,o){var _e=a.alternate;return _e===null?(_e=Bg(a.tag,o,a.key,a.mode),_e.elementType=a.elementType,_e.type=a.type,_e.stateNode=a.stateNode,_e.alternate=a,a.alternate=_e):(_e.pendingProps=o,_e.type=a.type,_e.flags=0,_e.subtreeFlags=0,_e.deletions=null),_e.flags=a.flags&14680064,_e.childLanes=a.childLanes,_e.lanes=a.lanes,_e.child=a.child,_e.memoizedProps=a.memoizedProps,_e.memoizedState=a.memoizedState,_e.updateQueue=a.updateQueue,o=a.dependencies,_e.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},_e.sibling=a.sibling,_e.index=a.index,_e.ref=a.ref,_e}function yh(a,o,_e,tt,ct,gt){var rt=2;if(tt=a,typeof a=="function")bj(a)&&(rt=1);else if(typeof a=="string")rt=5;else e:switch(a){case ya:return Ah(_e.children,ct,gt,o);case za:rt=8,ct|=8;break;case Aa:return a=Bg(12,_e,o,ct|2),a.elementType=Aa,a.lanes=gt,a;case Ea:return a=Bg(13,_e,o,ct),a.elementType=Ea,a.lanes=gt,a;case Fa:return a=Bg(19,_e,o,ct),a.elementType=Fa,a.lanes=gt,a;case Ia:return qj(_e,ct,gt,o);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Ba:rt=10;break e;case Ca:rt=9;break e;case Da:rt=11;break e;case Ga:rt=14;break e;case Ha:rt=16,tt=null;break e}throw Error(p$2(130,a==null?a:typeof a,""))}return o=Bg(rt,_e,o,ct),o.elementType=a,o.type=tt,o.lanes=gt,o}function Ah(a,o,_e,tt){return a=Bg(7,a,tt,o),a.lanes=_e,a}function qj(a,o,_e,tt){return a=Bg(22,a,tt,o),a.elementType=Ia,a.lanes=_e,a.stateNode={isHidden:!1},a}function xh(a,o,_e){return a=Bg(6,a,null,o),a.lanes=_e,a}function zh(a,o,_e){return o=Bg(4,a.children!==null?a.children:[],a.key,o),o.lanes=_e,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}function bl(a,o,_e,tt,ct){this.tag=o,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=tt,this.onRecoverableError=ct,this.mutableSourceEagerHydrationData=null}function cl(a,o,_e,tt,ct,gt,rt,it,s){return a=new bl(a,o,_e,it,s),o===1?(o=1,gt===!0&&(o|=8)):o=0,gt=Bg(3,null,null,o),a.current=gt,gt.stateNode=a,gt.memoizedState={element:tt,isDehydrated:_e,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(gt),a}function dl(a,o,_e){var tt=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(a){console.error(a)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot,m$2=reactDomExports;createRoot=m$2.createRoot,m$2.hydrateRoot;/**
* @remix-run/router v1.10.0
*
* Copyright (c) Remix Software Inc.
@@ -46,7 +46,7 @@ Error generating stack: `+gt.message+`
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
- */function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(a){for(var o=1;o"u")throw new Error(o)}function warning(a,o){if(!a){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(a,o){return{usr:a.state,key:a.key,idx:o}}function createLocation(a,o,_e,tt){return _e===void 0&&(_e=null),_extends$3({pathname:typeof a=="string"?a:a.pathname,search:"",hash:""},typeof o=="string"?parsePath(o):o,{state:_e,key:o&&o.key||tt||createKey()})}function createPath(a){let{pathname:o="/",search:_e="",hash:tt=""}=a;return _e&&_e!=="?"&&(o+=_e.charAt(0)==="?"?_e:"?"+_e),tt&&tt!=="#"&&(o+=tt.charAt(0)==="#"?tt:"#"+tt),o}function parsePath(a){let o={};if(a){let _e=a.indexOf("#");_e>=0&&(o.hash=a.substr(_e),a=a.substr(0,_e));let tt=a.indexOf("?");tt>=0&&(o.search=a.substr(tt),a=a.substr(0,tt)),a&&(o.pathname=a)}return o}function getUrlBasedHistory(a,o,_e,tt){tt===void 0&&(tt={});let{window:ct=document.defaultView,v5Compat:gt=!1}=tt,rt=ct.history,it=Action.Pop,s=null,et=nt();et==null&&(et=0,rt.replaceState(_extends$3({},rt.state,{idx:et}),""));function nt(){return(rt.state||{idx:null}).idx}function at(){it=Action.Pop;let mt=nt(),ot=mt==null?null:mt-et;et=mt,s&&s({action:it,location:lt.location,delta:ot})}function ht(mt,ot){it=Action.Push;let pt=createLocation(lt.location,mt,ot);_e&&_e(pt,mt),et=nt()+1;let ft=getHistoryState(pt,et),yt=lt.createHref(pt);try{rt.pushState(ft,"",yt)}catch(vt){if(vt instanceof DOMException&&vt.name==="DataCloneError")throw vt;ct.location.assign(yt)}gt&&s&&s({action:it,location:lt.location,delta:1})}function dt(mt,ot){it=Action.Replace;let pt=createLocation(lt.location,mt,ot);_e&&_e(pt,mt),et=nt();let ft=getHistoryState(pt,et),yt=lt.createHref(pt);rt.replaceState(ft,"",yt),gt&&s&&s({action:it,location:lt.location,delta:0})}function ut(mt){let ot=ct.location.origin!=="null"?ct.location.origin:ct.location.href,pt=typeof mt=="string"?mt:createPath(mt);return invariant(ot,"No window.location.(origin|href) available to create URL for href: "+pt),new URL(pt,ot)}let lt={get action(){return it},get location(){return a(ct,rt)},listen(mt){if(s)throw new Error("A history only accepts one active listener");return ct.addEventListener(PopStateEventType,at),s=mt,()=>{ct.removeEventListener(PopStateEventType,at),s=null}},createHref(mt){return o(ct,mt)},createURL:ut,encodeLocation(mt){let ot=ut(mt);return{pathname:ot.pathname,search:ot.search,hash:ot.hash}},push:ht,replace:dt,go(mt){return rt.go(mt)}};return lt}var ResultType;(function(a){a.data="data",a.deferred="deferred",a.redirect="redirect",a.error="error"})(ResultType||(ResultType={}));function matchRoutes(a,o,_e){_e===void 0&&(_e="/");let tt=typeof o=="string"?parsePath(o):o,ct=stripBasename(tt.pathname||"/",_e);if(ct==null)return null;let gt=flattenRoutes(a);rankRouteBranches(gt);let rt=null;for(let it=0;rt==null&&it{let s={relativePath:it===void 0?gt.path||"":it,caseSensitive:gt.caseSensitive===!0,childrenIndex:rt,route:gt};s.relativePath.startsWith("/")&&(invariant(s.relativePath.startsWith(tt),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+tt+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(tt.length));let et=joinPaths([tt,s.relativePath]),nt=_e.concat(s);gt.children&>.children.length>0&&(invariant(gt.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+et+'".')),flattenRoutes(gt.children,o,nt,et)),!(gt.path==null&&!gt.index)&&o.push({path:et,score:computeScore(et,gt.index),routesMeta:nt})};return a.forEach((gt,rt)=>{var it;if(gt.path===""||!((it=gt.path)!=null&&it.includes("?")))ct(gt,rt);else for(let s of explodeOptionalSegments(gt.path))ct(gt,rt,s)}),o}function explodeOptionalSegments(a){let o=a.split("/");if(o.length===0)return[];let[_e,...tt]=o,ct=_e.endsWith("?"),gt=_e.replace(/\?$/,"");if(tt.length===0)return ct?[gt,""]:[gt];let rt=explodeOptionalSegments(tt.join("/")),it=[];return it.push(...rt.map(s=>s===""?gt:[gt,s].join("/"))),ct&&it.push(...rt),it.map(s=>a.startsWith("/")&&s===""?"/":s)}function rankRouteBranches(a){a.sort((o,_e)=>o.score!==_e.score?_e.score-o.score:compareIndexes(o.routesMeta.map(tt=>tt.childrenIndex),_e.routesMeta.map(tt=>tt.childrenIndex)))}const paramRe=/^:\w+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=a=>a==="*";function computeScore(a,o){let _e=a.split("/"),tt=_e.length;return _e.some(isSplat)&&(tt+=splatPenalty),o&&(tt+=indexRouteValue),_e.filter(ct=>!isSplat(ct)).reduce((ct,gt)=>ct+(paramRe.test(gt)?dynamicSegmentValue:gt===""?emptySegmentValue:staticSegmentValue),tt)}function compareIndexes(a,o){return a.length===o.length&&a.slice(0,-1).every((tt,ct)=>tt===o[ct])?a[a.length-1]-o[o.length-1]:0}function matchRouteBranch(a,o){let{routesMeta:_e}=a,tt={},ct="/",gt=[];for(let rt=0;rt<_e.length;++rt){let it=_e[rt],s=rt===_e.length-1,et=ct==="/"?o:o.slice(ct.length)||"/",nt=matchPath({path:it.relativePath,caseSensitive:it.caseSensitive,end:s},et);if(!nt)return null;Object.assign(tt,nt.params);let at=it.route;gt.push({params:tt,pathname:joinPaths([ct,nt.pathname]),pathnameBase:normalizePathname(joinPaths([ct,nt.pathnameBase])),route:at}),nt.pathnameBase!=="/"&&(ct=joinPaths([ct,nt.pathnameBase]))}return gt}function matchPath(a,o){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[_e,tt]=compilePath(a.path,a.caseSensitive,a.end),ct=o.match(_e);if(!ct)return null;let gt=ct[0],rt=gt.replace(/(.)\/+$/,"$1"),it=ct.slice(1);return{params:tt.reduce((et,nt,at)=>{if(nt==="*"){let ht=it[at]||"";rt=gt.slice(0,gt.length-ht.length).replace(/(.)\/+$/,"$1")}return et[nt]=safelyDecodeURIComponent(it[at]||"",nt),et},{}),pathname:gt,pathnameBase:rt,pattern:a}}function compilePath(a,o,_e){o===void 0&&(o=!1),_e===void 0&&(_e=!0),warning(a==="*"||!a.endsWith("*")||a.endsWith("/*"),'Route path "'+a+'" will be treated as if it were '+('"'+a.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+a.replace(/\*$/,"/*")+'".'));let tt=[],ct="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(rt,it)=>(tt.push(it),"/([^\\/]+)"));return a.endsWith("*")?(tt.push("*"),ct+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):_e?ct+="\\/*$":a!==""&&a!=="/"&&(ct+="(?:(?=\\/|$))"),[new RegExp(ct,o?void 0:"i"),tt]}function safelyDecodeURI(a){try{return decodeURI(a)}catch(o){return warning(!1,'The URL path "'+a+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),a}}function safelyDecodeURIComponent(a,o){try{return decodeURIComponent(a)}catch(_e){return warning(!1,'The value for the URL param "'+o+'" will not be decoded because'+(' the string "'+a+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+_e+").")),a}}function stripBasename(a,o){if(o==="/")return a;if(!a.toLowerCase().startsWith(o.toLowerCase()))return null;let _e=o.endsWith("/")?o.length-1:o.length,tt=a.charAt(_e);return tt&&tt!=="/"?null:a.slice(_e)||"/"}function resolvePath(a,o){o===void 0&&(o="/");let{pathname:_e,search:tt="",hash:ct=""}=typeof a=="string"?parsePath(a):a;return{pathname:_e?_e.startsWith("/")?_e:resolvePathname(_e,o):o,search:normalizeSearch(tt),hash:normalizeHash(ct)}}function resolvePathname(a,o){let _e=o.replace(/\/+$/,"").split("/");return a.split("/").forEach(ct=>{ct===".."?_e.length>1&&_e.pop():ct!=="."&&_e.push(ct)}),_e.length>1?_e.join("/"):"/"}function getInvalidPathError(a,o,_e,tt){return"Cannot include a '"+a+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(tt)+"]. Please separate it out to the ")+("`to."+_e+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(a){return a.filter((o,_e)=>_e===0||o.route.path&&o.route.path.length>0)}function resolveTo(a,o,_e,tt){tt===void 0&&(tt=!1);let ct;typeof a=="string"?ct=parsePath(a):(ct=_extends$3({},a),invariant(!ct.pathname||!ct.pathname.includes("?"),getInvalidPathError("?","pathname","search",ct)),invariant(!ct.pathname||!ct.pathname.includes("#"),getInvalidPathError("#","pathname","hash",ct)),invariant(!ct.search||!ct.search.includes("#"),getInvalidPathError("#","search","hash",ct)));let gt=a===""||ct.pathname==="",rt=gt?"/":ct.pathname,it;if(tt||rt==null)it=_e;else{let at=o.length-1;if(rt.startsWith("..")){let ht=rt.split("/");for(;ht[0]==="..";)ht.shift(),at-=1;ct.pathname=ht.join("/")}it=at>=0?o[at]:"/"}let s=resolvePath(ct,it),et=rt&&rt!=="/"&&rt.endsWith("/"),nt=(gt||rt===".")&&_e.endsWith("/");return!s.pathname.endsWith("/")&&(et||nt)&&(s.pathname+="/"),s}const joinPaths=a=>a.join("/").replace(/\/\/+/g,"/"),normalizePathname=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,normalizeHash=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function isRouteErrorResponse(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/**
+ */function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(a){for(var o=1;o"u")throw new Error(o)}function warning(a,o){if(!a){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(a,o){return{usr:a.state,key:a.key,idx:o}}function createLocation(a,o,_e,tt){return _e===void 0&&(_e=null),_extends$3({pathname:typeof a=="string"?a:a.pathname,search:"",hash:""},typeof o=="string"?parsePath(o):o,{state:_e,key:o&&o.key||tt||createKey()})}function createPath(a){let{pathname:o="/",search:_e="",hash:tt=""}=a;return _e&&_e!=="?"&&(o+=_e.charAt(0)==="?"?_e:"?"+_e),tt&&tt!=="#"&&(o+=tt.charAt(0)==="#"?tt:"#"+tt),o}function parsePath(a){let o={};if(a){let _e=a.indexOf("#");_e>=0&&(o.hash=a.substr(_e),a=a.substr(0,_e));let tt=a.indexOf("?");tt>=0&&(o.search=a.substr(tt),a=a.substr(0,tt)),a&&(o.pathname=a)}return o}function getUrlBasedHistory(a,o,_e,tt){tt===void 0&&(tt={});let{window:ct=document.defaultView,v5Compat:gt=!1}=tt,rt=ct.history,it=Action.Pop,s=null,et=nt();et==null&&(et=0,rt.replaceState(_extends$3({},rt.state,{idx:et}),""));function nt(){return(rt.state||{idx:null}).idx}function at(){it=Action.Pop;let mt=nt(),ot=mt==null?null:mt-et;et=mt,s&&s({action:it,location:lt.location,delta:ot})}function ht(mt,ot){it=Action.Push;let ut=createLocation(lt.location,mt,ot);_e&&_e(ut,mt),et=nt()+1;let ft=getHistoryState(ut,et),bt=lt.createHref(ut);try{rt.pushState(ft,"",bt)}catch(vt){if(vt instanceof DOMException&&vt.name==="DataCloneError")throw vt;ct.location.assign(bt)}gt&&s&&s({action:it,location:lt.location,delta:1})}function dt(mt,ot){it=Action.Replace;let ut=createLocation(lt.location,mt,ot);_e&&_e(ut,mt),et=nt();let ft=getHistoryState(ut,et),bt=lt.createHref(ut);rt.replaceState(ft,"",bt),gt&&s&&s({action:it,location:lt.location,delta:0})}function pt(mt){let ot=ct.location.origin!=="null"?ct.location.origin:ct.location.href,ut=typeof mt=="string"?mt:createPath(mt);return invariant(ot,"No window.location.(origin|href) available to create URL for href: "+ut),new URL(ut,ot)}let lt={get action(){return it},get location(){return a(ct,rt)},listen(mt){if(s)throw new Error("A history only accepts one active listener");return ct.addEventListener(PopStateEventType,at),s=mt,()=>{ct.removeEventListener(PopStateEventType,at),s=null}},createHref(mt){return o(ct,mt)},createURL:pt,encodeLocation(mt){let ot=pt(mt);return{pathname:ot.pathname,search:ot.search,hash:ot.hash}},push:ht,replace:dt,go(mt){return rt.go(mt)}};return lt}var ResultType;(function(a){a.data="data",a.deferred="deferred",a.redirect="redirect",a.error="error"})(ResultType||(ResultType={}));function matchRoutes(a,o,_e){_e===void 0&&(_e="/");let tt=typeof o=="string"?parsePath(o):o,ct=stripBasename(tt.pathname||"/",_e);if(ct==null)return null;let gt=flattenRoutes(a);rankRouteBranches(gt);let rt=null;for(let it=0;rt==null&&it{let s={relativePath:it===void 0?gt.path||"":it,caseSensitive:gt.caseSensitive===!0,childrenIndex:rt,route:gt};s.relativePath.startsWith("/")&&(invariant(s.relativePath.startsWith(tt),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+tt+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(tt.length));let et=joinPaths([tt,s.relativePath]),nt=_e.concat(s);gt.children&>.children.length>0&&(invariant(gt.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+et+'".')),flattenRoutes(gt.children,o,nt,et)),!(gt.path==null&&!gt.index)&&o.push({path:et,score:computeScore(et,gt.index),routesMeta:nt})};return a.forEach((gt,rt)=>{var it;if(gt.path===""||!((it=gt.path)!=null&&it.includes("?")))ct(gt,rt);else for(let s of explodeOptionalSegments(gt.path))ct(gt,rt,s)}),o}function explodeOptionalSegments(a){let o=a.split("/");if(o.length===0)return[];let[_e,...tt]=o,ct=_e.endsWith("?"),gt=_e.replace(/\?$/,"");if(tt.length===0)return ct?[gt,""]:[gt];let rt=explodeOptionalSegments(tt.join("/")),it=[];return it.push(...rt.map(s=>s===""?gt:[gt,s].join("/"))),ct&&it.push(...rt),it.map(s=>a.startsWith("/")&&s===""?"/":s)}function rankRouteBranches(a){a.sort((o,_e)=>o.score!==_e.score?_e.score-o.score:compareIndexes(o.routesMeta.map(tt=>tt.childrenIndex),_e.routesMeta.map(tt=>tt.childrenIndex)))}const paramRe=/^:\w+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=a=>a==="*";function computeScore(a,o){let _e=a.split("/"),tt=_e.length;return _e.some(isSplat)&&(tt+=splatPenalty),o&&(tt+=indexRouteValue),_e.filter(ct=>!isSplat(ct)).reduce((ct,gt)=>ct+(paramRe.test(gt)?dynamicSegmentValue:gt===""?emptySegmentValue:staticSegmentValue),tt)}function compareIndexes(a,o){return a.length===o.length&&a.slice(0,-1).every((tt,ct)=>tt===o[ct])?a[a.length-1]-o[o.length-1]:0}function matchRouteBranch(a,o){let{routesMeta:_e}=a,tt={},ct="/",gt=[];for(let rt=0;rt<_e.length;++rt){let it=_e[rt],s=rt===_e.length-1,et=ct==="/"?o:o.slice(ct.length)||"/",nt=matchPath({path:it.relativePath,caseSensitive:it.caseSensitive,end:s},et);if(!nt)return null;Object.assign(tt,nt.params);let at=it.route;gt.push({params:tt,pathname:joinPaths([ct,nt.pathname]),pathnameBase:normalizePathname(joinPaths([ct,nt.pathnameBase])),route:at}),nt.pathnameBase!=="/"&&(ct=joinPaths([ct,nt.pathnameBase]))}return gt}function matchPath(a,o){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[_e,tt]=compilePath(a.path,a.caseSensitive,a.end),ct=o.match(_e);if(!ct)return null;let gt=ct[0],rt=gt.replace(/(.)\/+$/,"$1"),it=ct.slice(1);return{params:tt.reduce((et,nt,at)=>{if(nt==="*"){let ht=it[at]||"";rt=gt.slice(0,gt.length-ht.length).replace(/(.)\/+$/,"$1")}return et[nt]=safelyDecodeURIComponent(it[at]||"",nt),et},{}),pathname:gt,pathnameBase:rt,pattern:a}}function compilePath(a,o,_e){o===void 0&&(o=!1),_e===void 0&&(_e=!0),warning(a==="*"||!a.endsWith("*")||a.endsWith("/*"),'Route path "'+a+'" will be treated as if it were '+('"'+a.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+a.replace(/\*$/,"/*")+'".'));let tt=[],ct="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(rt,it)=>(tt.push(it),"/([^\\/]+)"));return a.endsWith("*")?(tt.push("*"),ct+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):_e?ct+="\\/*$":a!==""&&a!=="/"&&(ct+="(?:(?=\\/|$))"),[new RegExp(ct,o?void 0:"i"),tt]}function safelyDecodeURI(a){try{return decodeURI(a)}catch(o){return warning(!1,'The URL path "'+a+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),a}}function safelyDecodeURIComponent(a,o){try{return decodeURIComponent(a)}catch(_e){return warning(!1,'The value for the URL param "'+o+'" will not be decoded because'+(' the string "'+a+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+_e+").")),a}}function stripBasename(a,o){if(o==="/")return a;if(!a.toLowerCase().startsWith(o.toLowerCase()))return null;let _e=o.endsWith("/")?o.length-1:o.length,tt=a.charAt(_e);return tt&&tt!=="/"?null:a.slice(_e)||"/"}function resolvePath(a,o){o===void 0&&(o="/");let{pathname:_e,search:tt="",hash:ct=""}=typeof a=="string"?parsePath(a):a;return{pathname:_e?_e.startsWith("/")?_e:resolvePathname(_e,o):o,search:normalizeSearch(tt),hash:normalizeHash(ct)}}function resolvePathname(a,o){let _e=o.replace(/\/+$/,"").split("/");return a.split("/").forEach(ct=>{ct===".."?_e.length>1&&_e.pop():ct!=="."&&_e.push(ct)}),_e.length>1?_e.join("/"):"/"}function getInvalidPathError(a,o,_e,tt){return"Cannot include a '"+a+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(tt)+"]. Please separate it out to the ")+("`to."+_e+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(a){return a.filter((o,_e)=>_e===0||o.route.path&&o.route.path.length>0)}function resolveTo(a,o,_e,tt){tt===void 0&&(tt=!1);let ct;typeof a=="string"?ct=parsePath(a):(ct=_extends$3({},a),invariant(!ct.pathname||!ct.pathname.includes("?"),getInvalidPathError("?","pathname","search",ct)),invariant(!ct.pathname||!ct.pathname.includes("#"),getInvalidPathError("#","pathname","hash",ct)),invariant(!ct.search||!ct.search.includes("#"),getInvalidPathError("#","search","hash",ct)));let gt=a===""||ct.pathname==="",rt=gt?"/":ct.pathname,it;if(tt||rt==null)it=_e;else{let at=o.length-1;if(rt.startsWith("..")){let ht=rt.split("/");for(;ht[0]==="..";)ht.shift(),at-=1;ct.pathname=ht.join("/")}it=at>=0?o[at]:"/"}let s=resolvePath(ct,it),et=rt&&rt!=="/"&&rt.endsWith("/"),nt=(gt||rt===".")&&_e.endsWith("/");return!s.pathname.endsWith("/")&&(et||nt)&&(s.pathname+="/"),s}const joinPaths=a=>a.join("/").replace(/\/\/+/g,"/"),normalizePathname=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,normalizeHash=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function isRouteErrorResponse(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/**
* React Router v6.17.0
*
* Copyright (c) Remix Software Inc.
@@ -55,7 +55,7 @@ Error generating stack: `+gt.message+`
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
- */function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(a){for(var o=1;os.pathnameBase)),rt=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{rt.current=!0}),reactExports.useCallback(function(s,et){if(et===void 0&&(et={}),!rt.current)return;if(typeof s=="number"){_e.go(s);return}let nt=resolveTo(s,JSON.parse(gt),ct,et.relative==="path");a==null&&o!=="/"&&(nt.pathname=nt.pathname==="/"?o:joinPaths([o,nt.pathname])),(et.replace?_e.replace:_e.push)(nt,et.state,et)},[o,_e,gt,ct,a])}function useParams(){let{matches:a}=reactExports.useContext(RouteContext),o=a[a.length-1];return o?o.params:{}}function useRoutes(a,o){return useRoutesImpl(a,o)}function useRoutesImpl(a,o,_e){useInRouterContext()||invariant(!1);let{navigator:tt}=reactExports.useContext(NavigationContext),{matches:ct}=reactExports.useContext(RouteContext),gt=ct[ct.length-1],rt=gt?gt.params:{};gt&>.pathname;let it=gt?gt.pathnameBase:"/";gt&>.route;let s=useLocation(),et;if(o){var nt;let lt=typeof o=="string"?parsePath(o):o;it==="/"||(nt=lt.pathname)!=null&&nt.startsWith(it)||invariant(!1),et=lt}else et=s;let at=et.pathname||"/",ht=it==="/"?at:at.slice(it.length)||"/",dt=matchRoutes(a,{pathname:ht}),ut=_renderMatches(dt&&dt.map(lt=>Object.assign({},lt,{params:Object.assign({},rt,lt.params),pathname:joinPaths([it,tt.encodeLocation?tt.encodeLocation(lt.pathname).pathname:lt.pathname]),pathnameBase:lt.pathnameBase==="/"?it:joinPaths([it,tt.encodeLocation?tt.encodeLocation(lt.pathnameBase).pathname:lt.pathnameBase])})),ct,_e);return o&&ut?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$2({pathname:"/",search:"",hash:"",state:null,key:"default"},et),navigationType:Action.Pop}},ut):ut}function DefaultErrorComponent(){let a=useRouteError(),o=isRouteErrorResponse(a)?a.status+" "+a.statusText:a instanceof Error?a.message:JSON.stringify(a),_e=a instanceof Error?a.stack:null,ct={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},gt=null;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},o),_e?reactExports.createElement("pre",{style:ct},_e):null,gt)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,_e){return _e.location!==o.location||_e.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error||_e.error,location:_e.location,revalidation:o.revalidation||_e.revalidation}}componentDidCatch(o,_e){console.error("React Router caught the following error during render",o,_e)}render(){return this.state.error?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(a){let{routeContext:o,match:_e,children:tt}=a,ct=reactExports.useContext(DataRouterContext);return ct&&ct.static&&ct.staticContext&&(_e.route.errorElement||_e.route.ErrorBoundary)&&(ct.staticContext._deepestRenderedBoundaryId=_e.route.id),reactExports.createElement(RouteContext.Provider,{value:o},tt)}function _renderMatches(a,o,_e){var tt;if(o===void 0&&(o=[]),_e===void 0&&(_e=null),a==null){var ct;if((ct=_e)!=null&&ct.errors)a=_e.matches;else return null}let gt=a,rt=(tt=_e)==null?void 0:tt.errors;if(rt!=null){let it=gt.findIndex(s=>s.route.id&&(rt==null?void 0:rt[s.route.id]));it>=0||invariant(!1),gt=gt.slice(0,Math.min(gt.length,it+1))}return gt.reduceRight((it,s,et)=>{let nt=s.route.id?rt==null?void 0:rt[s.route.id]:null,at=null;_e&&(at=s.route.errorElement||defaultErrorElement);let ht=o.concat(gt.slice(0,et+1)),dt=()=>{let ut;return nt?ut=at:s.route.Component?ut=reactExports.createElement(s.route.Component,null):s.route.element?ut=s.route.element:ut=it,reactExports.createElement(RenderedRoute,{match:s,routeContext:{outlet:it,matches:ht,isDataRoute:_e!=null},children:ut})};return _e&&(s.route.ErrorBoundary||s.route.errorElement||et===0)?reactExports.createElement(RenderErrorBoundary,{location:_e.location,revalidation:_e.revalidation,component:at,error:nt,children:dt(),routeContext:{outlet:null,matches:ht,isDataRoute:!0}}):dt()},null)}var DataRouterHook$1=function(a){return a.UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a}(DataRouterHook$1||{}),DataRouterStateHook$1=function(a){return a.UseBlocker="useBlocker",a.UseLoaderData="useLoaderData",a.UseActionData="useActionData",a.UseRouteError="useRouteError",a.UseNavigation="useNavigation",a.UseRouteLoaderData="useRouteLoaderData",a.UseMatches="useMatches",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a.UseRouteId="useRouteId",a}(DataRouterStateHook$1||{});function useDataRouterContext(a){let o=reactExports.useContext(DataRouterContext);return o||invariant(!1),o}function useDataRouterState(a){let o=reactExports.useContext(DataRouterStateContext);return o||invariant(!1),o}function useRouteContext(a){let o=reactExports.useContext(RouteContext);return o||invariant(!1),o}function useCurrentRouteId(a){let o=useRouteContext(),_e=o.matches[o.matches.length-1];return _e.route.id||invariant(!1),_e.route.id}function useRouteError(){var a;let o=reactExports.useContext(RouteErrorContext),_e=useDataRouterState(DataRouterStateHook$1.UseRouteError),tt=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return o||((a=_e.errors)==null?void 0:a[tt])}function useNavigateStable(){let{router:a}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),o=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),_e=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{_e.current=!0}),reactExports.useCallback(function(ct,gt){gt===void 0&&(gt={}),_e.current&&(typeof ct=="number"?a.navigate(ct):a.navigate(ct,_extends$2({fromRouteId:o},gt)))},[a,o])}function Route(a){invariant(!1)}function Router(a){let{basename:o="/",children:_e=null,location:tt,navigationType:ct=Action.Pop,navigator:gt,static:rt=!1}=a;useInRouterContext()&&invariant(!1);let it=o.replace(/^\/*/,"/"),s=reactExports.useMemo(()=>({basename:it,navigator:gt,static:rt}),[it,gt,rt]);typeof tt=="string"&&(tt=parsePath(tt));let{pathname:et="/",search:nt="",hash:at="",state:ht=null,key:dt="default"}=tt,ut=reactExports.useMemo(()=>{let lt=stripBasename(et,it);return lt==null?null:{location:{pathname:lt,search:nt,hash:at,state:ht,key:dt},navigationType:ct}},[it,et,nt,at,ht,dt,ct]);return ut==null?null:reactExports.createElement(NavigationContext.Provider,{value:s},reactExports.createElement(LocationContext.Provider,{children:_e,value:ut}))}function Routes(a){let{children:o,location:_e}=a;return useRoutes(createRoutesFromChildren(o),_e)}new Promise(()=>{});function createRoutesFromChildren(a,o){o===void 0&&(o=[]);let _e=[];return reactExports.Children.forEach(a,(tt,ct)=>{if(!reactExports.isValidElement(tt))return;let gt=[...o,ct];if(tt.type===reactExports.Fragment){_e.push.apply(_e,createRoutesFromChildren(tt.props.children,gt));return}tt.type!==Route&&invariant(!1),!tt.props.index||!tt.props.children||invariant(!1);let rt={id:tt.props.id||gt.join("-"),caseSensitive:tt.props.caseSensitive,element:tt.props.element,Component:tt.props.Component,index:tt.props.index,path:tt.props.path,loader:tt.props.loader,action:tt.props.action,errorElement:tt.props.errorElement,ErrorBoundary:tt.props.ErrorBoundary,hasErrorBoundary:tt.props.ErrorBoundary!=null||tt.props.errorElement!=null,shouldRevalidate:tt.props.shouldRevalidate,handle:tt.props.handle,lazy:tt.props.lazy};tt.props.children&&(rt.children=createRoutesFromChildren(tt.props.children,gt)),_e.push(rt)}),_e}/**
+ */function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(a){for(var o=1;os.pathnameBase)),rt=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{rt.current=!0}),reactExports.useCallback(function(s,et){if(et===void 0&&(et={}),!rt.current)return;if(typeof s=="number"){_e.go(s);return}let nt=resolveTo(s,JSON.parse(gt),ct,et.relative==="path");a==null&&o!=="/"&&(nt.pathname=nt.pathname==="/"?o:joinPaths([o,nt.pathname])),(et.replace?_e.replace:_e.push)(nt,et.state,et)},[o,_e,gt,ct,a])}function useParams(){let{matches:a}=reactExports.useContext(RouteContext),o=a[a.length-1];return o?o.params:{}}function useRoutes(a,o){return useRoutesImpl(a,o)}function useRoutesImpl(a,o,_e){useInRouterContext()||invariant(!1);let{navigator:tt}=reactExports.useContext(NavigationContext),{matches:ct}=reactExports.useContext(RouteContext),gt=ct[ct.length-1],rt=gt?gt.params:{};gt&>.pathname;let it=gt?gt.pathnameBase:"/";gt&>.route;let s=useLocation(),et;if(o){var nt;let lt=typeof o=="string"?parsePath(o):o;it==="/"||(nt=lt.pathname)!=null&&nt.startsWith(it)||invariant(!1),et=lt}else et=s;let at=et.pathname||"/",ht=it==="/"?at:at.slice(it.length)||"/",dt=matchRoutes(a,{pathname:ht}),pt=_renderMatches(dt&&dt.map(lt=>Object.assign({},lt,{params:Object.assign({},rt,lt.params),pathname:joinPaths([it,tt.encodeLocation?tt.encodeLocation(lt.pathname).pathname:lt.pathname]),pathnameBase:lt.pathnameBase==="/"?it:joinPaths([it,tt.encodeLocation?tt.encodeLocation(lt.pathnameBase).pathname:lt.pathnameBase])})),ct,_e);return o&&pt?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$2({pathname:"/",search:"",hash:"",state:null,key:"default"},et),navigationType:Action.Pop}},pt):pt}function DefaultErrorComponent(){let a=useRouteError(),o=isRouteErrorResponse(a)?a.status+" "+a.statusText:a instanceof Error?a.message:JSON.stringify(a),_e=a instanceof Error?a.stack:null,ct={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},gt=null;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},o),_e?reactExports.createElement("pre",{style:ct},_e):null,gt)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,_e){return _e.location!==o.location||_e.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error||_e.error,location:_e.location,revalidation:o.revalidation||_e.revalidation}}componentDidCatch(o,_e){console.error("React Router caught the following error during render",o,_e)}render(){return this.state.error?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(a){let{routeContext:o,match:_e,children:tt}=a,ct=reactExports.useContext(DataRouterContext);return ct&&ct.static&&ct.staticContext&&(_e.route.errorElement||_e.route.ErrorBoundary)&&(ct.staticContext._deepestRenderedBoundaryId=_e.route.id),reactExports.createElement(RouteContext.Provider,{value:o},tt)}function _renderMatches(a,o,_e){var tt;if(o===void 0&&(o=[]),_e===void 0&&(_e=null),a==null){var ct;if((ct=_e)!=null&&ct.errors)a=_e.matches;else return null}let gt=a,rt=(tt=_e)==null?void 0:tt.errors;if(rt!=null){let it=gt.findIndex(s=>s.route.id&&(rt==null?void 0:rt[s.route.id]));it>=0||invariant(!1),gt=gt.slice(0,Math.min(gt.length,it+1))}return gt.reduceRight((it,s,et)=>{let nt=s.route.id?rt==null?void 0:rt[s.route.id]:null,at=null;_e&&(at=s.route.errorElement||defaultErrorElement);let ht=o.concat(gt.slice(0,et+1)),dt=()=>{let pt;return nt?pt=at:s.route.Component?pt=reactExports.createElement(s.route.Component,null):s.route.element?pt=s.route.element:pt=it,reactExports.createElement(RenderedRoute,{match:s,routeContext:{outlet:it,matches:ht,isDataRoute:_e!=null},children:pt})};return _e&&(s.route.ErrorBoundary||s.route.errorElement||et===0)?reactExports.createElement(RenderErrorBoundary,{location:_e.location,revalidation:_e.revalidation,component:at,error:nt,children:dt(),routeContext:{outlet:null,matches:ht,isDataRoute:!0}}):dt()},null)}var DataRouterHook$1=function(a){return a.UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a}(DataRouterHook$1||{}),DataRouterStateHook$1=function(a){return a.UseBlocker="useBlocker",a.UseLoaderData="useLoaderData",a.UseActionData="useActionData",a.UseRouteError="useRouteError",a.UseNavigation="useNavigation",a.UseRouteLoaderData="useRouteLoaderData",a.UseMatches="useMatches",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a.UseRouteId="useRouteId",a}(DataRouterStateHook$1||{});function useDataRouterContext(a){let o=reactExports.useContext(DataRouterContext);return o||invariant(!1),o}function useDataRouterState(a){let o=reactExports.useContext(DataRouterStateContext);return o||invariant(!1),o}function useRouteContext(a){let o=reactExports.useContext(RouteContext);return o||invariant(!1),o}function useCurrentRouteId(a){let o=useRouteContext(),_e=o.matches[o.matches.length-1];return _e.route.id||invariant(!1),_e.route.id}function useRouteError(){var a;let o=reactExports.useContext(RouteErrorContext),_e=useDataRouterState(DataRouterStateHook$1.UseRouteError),tt=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return o||((a=_e.errors)==null?void 0:a[tt])}function useNavigateStable(){let{router:a}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),o=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),_e=reactExports.useRef(!1);return useIsomorphicLayoutEffect(()=>{_e.current=!0}),reactExports.useCallback(function(ct,gt){gt===void 0&&(gt={}),_e.current&&(typeof ct=="number"?a.navigate(ct):a.navigate(ct,_extends$2({fromRouteId:o},gt)))},[a,o])}function Route(a){invariant(!1)}function Router(a){let{basename:o="/",children:_e=null,location:tt,navigationType:ct=Action.Pop,navigator:gt,static:rt=!1}=a;useInRouterContext()&&invariant(!1);let it=o.replace(/^\/*/,"/"),s=reactExports.useMemo(()=>({basename:it,navigator:gt,static:rt}),[it,gt,rt]);typeof tt=="string"&&(tt=parsePath(tt));let{pathname:et="/",search:nt="",hash:at="",state:ht=null,key:dt="default"}=tt,pt=reactExports.useMemo(()=>{let lt=stripBasename(et,it);return lt==null?null:{location:{pathname:lt,search:nt,hash:at,state:ht,key:dt},navigationType:ct}},[it,et,nt,at,ht,dt,ct]);return pt==null?null:reactExports.createElement(NavigationContext.Provider,{value:s},reactExports.createElement(LocationContext.Provider,{children:_e,value:pt}))}function Routes(a){let{children:o,location:_e}=a;return useRoutes(createRoutesFromChildren(o),_e)}new Promise(()=>{});function createRoutesFromChildren(a,o){o===void 0&&(o=[]);let _e=[];return reactExports.Children.forEach(a,(tt,ct)=>{if(!reactExports.isValidElement(tt))return;let gt=[...o,ct];if(tt.type===reactExports.Fragment){_e.push.apply(_e,createRoutesFromChildren(tt.props.children,gt));return}tt.type!==Route&&invariant(!1),!tt.props.index||!tt.props.children||invariant(!1);let rt={id:tt.props.id||gt.join("-"),caseSensitive:tt.props.caseSensitive,element:tt.props.element,Component:tt.props.Component,index:tt.props.index,path:tt.props.path,loader:tt.props.loader,action:tt.props.action,errorElement:tt.props.errorElement,ErrorBoundary:tt.props.ErrorBoundary,hasErrorBoundary:tt.props.ErrorBoundary!=null||tt.props.errorElement!=null,shouldRevalidate:tt.props.shouldRevalidate,handle:tt.props.handle,lazy:tt.props.lazy};tt.props.children&&(rt.children=createRoutesFromChildren(tt.props.children,gt)),_e.push(rt)}),_e}/**
* React Router DOM v6.17.0
*
* Copyright (c) Remix Software Inc.
@@ -64,169 +64,8 @@ Error generating stack: `+gt.message+`
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
- */function createSearchParams(a){return a===void 0&&(a=""),new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((o,_e)=>{let tt=a[_e];return o.concat(Array.isArray(tt)?tt.map(ct=>[_e,ct]):[[_e,tt]])},[]))}function getSearchParamsForLocation(a,o){let _e=createSearchParams(a);return o&&o.forEach((tt,ct)=>{_e.has(ct)||o.getAll(ct).forEach(gt=>{_e.append(ct,gt)})}),_e}const START_TRANSITION="startTransition",startTransitionImpl=React$2[START_TRANSITION];function BrowserRouter(a){let{basename:o,children:_e,future:tt,window:ct}=a,gt=reactExports.useRef();gt.current==null&&(gt.current=createBrowserHistory({window:ct,v5Compat:!0}));let rt=gt.current,[it,s]=reactExports.useState({action:rt.action,location:rt.location}),{v7_startTransition:et}=tt||{},nt=reactExports.useCallback(at=>{et&&startTransitionImpl?startTransitionImpl(()=>s(at)):s(at)},[s,et]);return reactExports.useLayoutEffect(()=>rt.listen(nt),[rt,nt]),reactExports.createElement(Router,{basename:o,children:_e,location:it.location,navigationType:it.action,navigator:rt})}var DataRouterHook;(function(a){a.UseScrollRestoration="useScrollRestoration",a.UseSubmit="useSubmit",a.UseSubmitFetcher="useSubmitFetcher",a.UseFetcher="useFetcher",a.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(a){a.UseFetchers="useFetchers",a.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useSearchParams(a){let o=reactExports.useRef(createSearchParams(a)),_e=reactExports.useRef(!1),tt=useLocation(),ct=reactExports.useMemo(()=>getSearchParamsForLocation(tt.search,_e.current?null:o.current),[tt.search]),gt=useNavigate(),rt=reactExports.useCallback((it,s)=>{const et=createSearchParams(typeof it=="function"?it(ct):it);_e.current=!0,gt("?"+et,s)},[gt,ct]);return[ct,rt]}var lib={},uaParser_min={exports:{}};(function(a,o){(function(_e,tt){var ct="1.0.36",gt="",rt="?",it="function",s="undefined",et="object",nt="string",at="major",ht="model",dt="name",ut="type",lt="vendor",mt="version",ot="architecture",pt="console",ft="mobile",yt="tablet",vt="smarttv",bt="wearable",At="embedded",Nt=350,St="Amazon",wt="Apple",Mt="ASUS",Ht="BlackBerry",Ot="Browser",Dt="Chrome",Gt="Edge",nn="Firefox",zt="Google",Ft="Huawei",un="LG",vn="Microsoft",yn="Motorola",cn="Opera",gn="Samsung",bn="Sharp",fn="Sony",Tn="Xiaomi",_n="Zebra",Un="Facebook",Pn="Chromium OS",In="Mac OS",Rn=function(An,Wn){var Cn={};for(var Nn in An)Wn[Nn]&&Wn[Nn].length%2===0?Cn[Nn]=Wn[Nn].concat(An[Nn]):Cn[Nn]=An[Nn];return Cn},On=function(An){for(var Wn={},Cn=0;Cn0?st.length===2?typeof st[1]==it?this[st[0]]=st[1].call(this,Rt):this[st[0]]=st[1]:st.length===3?typeof st[1]===it&&!(st[1].exec&&st[1].test)?this[st[0]]=Rt?st[1].call(this,Rt,st[2]):tt:this[st[0]]=Rt?Rt.replace(st[1],st[2]):tt:st.length===4&&(this[st[0]]=Rt?st[3].call(this,Rt.replace(st[1],st[2])):tt):this[st]=Rt||tt;Cn+=2}},on=function(An,Wn){for(var Cn in Wn)if(typeof Wn[Cn]===et&&Wn[Cn].length>0){for(var Nn=0;Nn2&&(Tt[ht]="iPad",Tt[ut]=yt),Tt},this.getEngine=function(){var Tt={};return Tt[dt]=tt,Tt[mt]=tt,Zn.call(Tt,Nn,kt.engine),Tt},this.getOS=function(){var Tt={};return Tt[dt]=tt,Tt[mt]=tt,Zn.call(Tt,Nn,kt.os),st&&!Tt[dt]&&qt&&qt.platform!="Unknown"&&(Tt[dt]=qt.platform.replace(/chrome os/i,Pn).replace(/macos/i,In)),Tt},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Nn},this.setUA=function(Tt){return Nn=typeof Tt===nt&&Tt.length>Nt?Fn(Tt,Nt):Tt,this},this.setUA(Nn),this};$n.VERSION=ct,$n.BROWSER=On([dt,mt,at]),$n.CPU=On([ot]),$n.DEVICE=On([ht,lt,ut,pt,ft,vt,yt,bt,At]),$n.ENGINE=$n.OS=On([dt,mt]),a.exports&&(o=a.exports=$n),o.UAParser=$n;var Jn=typeof _e!==s&&(_e.jQuery||_e.Zepto);if(Jn&&!Jn.ua){var Kn=new $n;Jn.ua=Kn.getResult(),Jn.ua.get=function(){return Kn.getUA()},Jn.ua.set=function(An){Kn.setUA(An);var Wn=Kn.getResult();for(var Cn in Wn)Jn.ua[Cn]=Wn[Cn]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser_min,uaParser_min.exports);var uaParser_minExports=uaParser_min.exports;Object.defineProperty(lib,"__esModule",{value:!0});function _interopDefault(a){return a&&typeof a=="object"&&"default"in a?a.default:a}var React=reactExports,React__default=_interopDefault(React),UAParser$1=uaParser_minExports,ClientUAInstance=new UAParser$1,browser=ClientUAInstance.getBrowser(),cpu=ClientUAInstance.getCPU(),device=ClientUAInstance.getDevice(),engine=ClientUAInstance.getEngine(),os=ClientUAInstance.getOS(),ua=ClientUAInstance.getUA(),setUa=function(o){return ClientUAInstance.setUA(o)},parseUserAgent=function(o){if(!o){console.error("No userAgent string was provided");return}var _e=new UAParser$1(o);return{UA:_e,browser:_e.getBrowser(),cpu:_e.getCPU(),device:_e.getDevice(),engine:_e.getEngine(),os:_e.getOS(),ua:_e.getUA(),setUserAgent:function(ct){return _e.setUA(ct)}}},UAHelper=Object.freeze({ClientUAInstance,browser,cpu,device,engine,os,ua,setUa,parseUserAgent});function ownKeys(a,o){var _e=Object.keys(a);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(a);o&&(tt=tt.filter(function(ct){return Object.getOwnPropertyDescriptor(a,ct).enumerable})),_e.push.apply(_e,tt)}return _e}function _objectSpread2(a){for(var o=1;o=0)&&(_e[ct]=a[ct]);return _e}function _objectWithoutProperties(a,o){if(a==null)return{};var _e=_objectWithoutPropertiesLoose$1(a,o),tt,ct;if(Object.getOwnPropertySymbols){var gt=Object.getOwnPropertySymbols(a);for(ct=0;ct=0)&&Object.prototype.propertyIsEnumerable.call(a,tt)&&(_e[tt]=a[tt])}return _e}function _assertThisInitialized$1(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _possibleConstructorReturn(a,o){if(o&&(typeof o=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(a)}function _slicedToArray(a,o){return _arrayWithHoles(a)||_iterableToArrayLimit(a,o)||_unsupportedIterableToArray(a,o)||_nonIterableRest()}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _iterableToArrayLimit(a,o){var _e=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(_e!=null){var tt=[],ct=!0,gt=!1,rt,it;try{for(_e=_e.call(a);!(ct=(rt=_e.next()).done)&&(tt.push(rt.value),!(o&&tt.length===o));ct=!0);}catch(s){gt=!0,it=s}finally{try{!ct&&_e.return!=null&&_e.return()}finally{if(gt)throw it}}return tt}}function _unsupportedIterableToArray(a,o){if(a){if(typeof a=="string")return _arrayLikeToArray(a,o);var _e=Object.prototype.toString.call(a).slice(8,-1);if(_e==="Object"&&a.constructor&&(_e=a.constructor.name),_e==="Map"||_e==="Set")return Array.from(a);if(_e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_e))return _arrayLikeToArray(a,o)}}function _arrayLikeToArray(a,o){(o==null||o>a.length)&&(o=a.length);for(var _e=0,tt=new Array(o);_e1&&arguments[1]!==void 0?arguments[1]:"none";return o||_e},getNavigatorInstance=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},isIOS13Check=function(o){var _e=getNavigatorInstance();return _e&&_e.platform&&(_e.platform.indexOf(o)!==-1||_e.platform==="MacIntel"&&_e.maxTouchPoints>1&&!window.MSStream)},browserPayload=function(o,_e,tt,ct,gt){return{isBrowser:o,browserMajorVersion:setDefaults(_e.major),browserFullVersion:setDefaults(_e.version),browserName:setDefaults(_e.name),engineName:setDefaults(tt.name),engineVersion:setDefaults(tt.version),osName:setDefaults(ct.name),osVersion:setDefaults(ct.version),userAgent:setDefaults(gt)}},mobilePayload=function(o,_e,tt,ct){return _objectSpread2({},o,{vendor:setDefaults(_e.vendor),model:setDefaults(_e.model),os:setDefaults(tt.name),osVersion:setDefaults(tt.version),ua:setDefaults(ct)})},smartTvPayload=function(o,_e,tt,ct){return{isSmartTV:o,engineName:setDefaults(_e.name),engineVersion:setDefaults(_e.version),osName:setDefaults(tt.name),osVersion:setDefaults(tt.version),userAgent:setDefaults(ct)}},consolePayload=function(o,_e,tt,ct){return{isConsole:o,engineName:setDefaults(_e.name),engineVersion:setDefaults(_e.version),osName:setDefaults(tt.name),osVersion:setDefaults(tt.version),userAgent:setDefaults(ct)}},wearablePayload=function(o,_e,tt,ct){return{isWearable:o,engineName:setDefaults(_e.name),engineVersion:setDefaults(_e.version),osName:setDefaults(tt.name),osVersion:setDefaults(tt.version),userAgent:setDefaults(ct)}},embeddedPayload=function(o,_e,tt,ct,gt){return{isEmbedded:o,vendor:setDefaults(_e.vendor),model:setDefaults(_e.model),engineName:setDefaults(tt.name),engineVersion:setDefaults(tt.version),osName:setDefaults(ct.name),osVersion:setDefaults(ct.version),userAgent:setDefaults(gt)}};function deviceDetect(a){var o=a?parseUserAgent(a):UAHelper,_e=o.device,tt=o.browser,ct=o.engine,gt=o.os,rt=o.ua,it=checkDeviceType(_e.type),s=it.isBrowser,et=it.isMobile,nt=it.isTablet,at=it.isSmartTV,ht=it.isConsole,dt=it.isWearable,ut=it.isEmbedded;if(s)return browserPayload(s,tt,ct,gt,rt);if(at)return smartTvPayload(at,ct,gt,rt);if(ht)return consolePayload(ht,ct,gt,rt);if(et||nt)return mobilePayload(it,_e,gt,rt);if(dt)return wearablePayload(dt,ct,gt,rt);if(ut)return embeddedPayload(ut,_e,ct,gt,rt)}var isMobileType=function(o){var _e=o.type;return _e===DeviceTypes.Mobile},isTabletType=function(o){var _e=o.type;return _e===DeviceTypes.Tablet},isMobileAndTabletType=function(o){var _e=o.type;return _e===DeviceTypes.Mobile||_e===DeviceTypes.Tablet},isSmartTVType=function(o){var _e=o.type;return _e===DeviceTypes.SmartTv},isBrowserType=function(o){var _e=o.type;return _e===DeviceTypes.Browser},isWearableType=function(o){var _e=o.type;return _e===DeviceTypes.Wearable},isConsoleType=function(o){var _e=o.type;return _e===DeviceTypes.Console},isEmbeddedType=function(o){var _e=o.type;return _e===DeviceTypes.Embedded},getMobileVendor=function(o){var _e=o.vendor;return setDefaults(_e)},getMobileModel=function(o){var _e=o.model;return setDefaults(_e)},getDeviceType=function(o){var _e=o.type;return setDefaults(_e,"browser")},isAndroidType=function(o){var _e=o.name;return _e===OsTypes.Android},isWindowsType=function(o){var _e=o.name;return _e===OsTypes.Windows},isMacOsType=function(o){var _e=o.name;return _e===OsTypes.MAC_OS},isWinPhoneType=function(o){var _e=o.name;return _e===OsTypes.WindowsPhone},isIOSType=function(o){var _e=o.name;return _e===OsTypes.IOS},getOsVersion=function(o){var _e=o.version;return setDefaults(_e)},getOsName=function(o){var _e=o.name;return setDefaults(_e)},isChromeType=function(o){var _e=o.name;return _e===BrowserTypes.Chrome},isFirefoxType=function(o){var _e=o.name;return _e===BrowserTypes.Firefox},isChromiumType=function(o){var _e=o.name;return _e===BrowserTypes.Chromium},isEdgeType=function(o){var _e=o.name;return _e===BrowserTypes.Edge},isYandexType=function(o){var _e=o.name;return _e===BrowserTypes.Yandex},isSafariType=function(o){var _e=o.name;return _e===BrowserTypes.Safari||_e===BrowserTypes.MobileSafari},isMobileSafariType=function(o){var _e=o.name;return _e===BrowserTypes.MobileSafari},isOperaType=function(o){var _e=o.name;return _e===BrowserTypes.Opera},isIEType=function(o){var _e=o.name;return _e===BrowserTypes.InternetExplorer||_e===BrowserTypes.Ie},isMIUIType=function(o){var _e=o.name;return _e===BrowserTypes.MIUI},isSamsungBrowserType=function(o){var _e=o.name;return _e===BrowserTypes.SamsungBrowser},getBrowserFullVersion=function(o){var _e=o.version;return setDefaults(_e)},getBrowserVersion=function(o){var _e=o.major;return setDefaults(_e)},getBrowserName=function(o){var _e=o.name;return setDefaults(_e)},getEngineName=function(o){var _e=o.name;return setDefaults(_e)},getEngineVersion=function(o){var _e=o.version;return setDefaults(_e)},isElectronType=function(){var o=getNavigatorInstance(),_e=o&&o.userAgent&&o.userAgent.toLowerCase();return typeof _e=="string"?/electron/.test(_e):!1},isEdgeChromiumType=function(o){return typeof o=="string"&&o.indexOf("Edg/")!==-1},getIOS13=function(){var o=getNavigatorInstance();return o&&(/iPad|iPhone|iPod/.test(o.platform)||o.platform==="MacIntel"&&o.maxTouchPoints>1)&&!window.MSStream},getIPad13=function(){return isIOS13Check("iPad")},getIphone13=function(){return isIOS13Check("iPhone")},getIPod13=function(){return isIOS13Check("iPod")},getUseragent=function(o){return setDefaults(o)};function buildSelectorsObject(a){var o=a||UAHelper,_e=o.device,tt=o.browser,ct=o.os,gt=o.engine,rt=o.ua;return{isSmartTV:isSmartTVType(_e),isConsole:isConsoleType(_e),isWearable:isWearableType(_e),isEmbedded:isEmbeddedType(_e),isMobileSafari:isMobileSafariType(tt)||getIPad13(),isChromium:isChromiumType(tt),isMobile:isMobileAndTabletType(_e)||getIPad13(),isMobileOnly:isMobileType(_e),isTablet:isTabletType(_e)||getIPad13(),isBrowser:isBrowserType(_e),isDesktop:isBrowserType(_e),isAndroid:isAndroidType(ct),isWinPhone:isWinPhoneType(ct),isIOS:isIOSType(ct)||getIPad13(),isChrome:isChromeType(tt),isFirefox:isFirefoxType(tt),isSafari:isSafariType(tt),isOpera:isOperaType(tt),isIE:isIEType(tt),osVersion:getOsVersion(ct),osName:getOsName(ct),fullBrowserVersion:getBrowserFullVersion(tt),browserVersion:getBrowserVersion(tt),browserName:getBrowserName(tt),mobileVendor:getMobileVendor(_e),mobileModel:getMobileModel(_e),engineName:getEngineName(gt),engineVersion:getEngineVersion(gt),getUA:getUseragent(rt),isEdge:isEdgeType(tt)||isEdgeChromiumType(rt),isYandex:isYandexType(tt),deviceType:getDeviceType(_e),isIOS13:getIOS13(),isIPad13:getIPad13(),isIPhone13:getIphone13(),isIPod13:getIPod13(),isElectron:isElectronType(),isEdgeChromium:isEdgeChromiumType(rt),isLegacyEdge:isEdgeType(tt)&&!isEdgeChromiumType(rt),isWindows:isWindowsType(ct),isMacOs:isMacOsType(ct),isMIUI:isMIUIType(tt),isSamsungBrowser:isSamsungBrowserType(tt)}}var isSmartTV=isSmartTVType(device),isConsole=isConsoleType(device),isWearable=isWearableType(device),isEmbedded=isEmbeddedType(device),isMobileSafari=isMobileSafariType(browser)||getIPad13(),isChromium=isChromiumType(browser),isMobile=isMobileAndTabletType(device)||getIPad13(),isMobileOnly=isMobileType(device),isTablet=isTabletType(device)||getIPad13(),isBrowser$1=isBrowserType(device),isDesktop=isBrowserType(device),isAndroid=isAndroidType(os),isWinPhone=isWinPhoneType(os),isIOS=isIOSType(os)||getIPad13(),isChrome=isChromeType(browser),isFirefox=isFirefoxType(browser),isSafari=isSafariType(browser),isOpera=isOperaType(browser),isIE=isIEType(browser),osVersion=getOsVersion(os),osName=getOsName(os),fullBrowserVersion=getBrowserFullVersion(browser),browserVersion=getBrowserVersion(browser),browserName=getBrowserName(browser),mobileVendor=getMobileVendor(device),mobileModel=getMobileModel(device),engineName=getEngineName(engine),engineVersion=getEngineVersion(engine),getUA=getUseragent(ua),isEdge=isEdgeType(browser)||isEdgeChromiumType(ua),isYandex=isYandexType(browser),deviceType=getDeviceType(device),isIOS13=getIOS13(),isIPad13=getIPad13(),isIPhone13=getIphone13(),isIPod13=getIPod13(),isElectron=isElectronType(),isEdgeChromium=isEdgeChromiumType(ua),isLegacyEdge=isEdgeType(browser)&&!isEdgeChromiumType(ua),isWindows=isWindowsType(os),isMacOs=isMacOsType(os),isMIUI=isMIUIType(browser),isSamsungBrowser=isSamsungBrowserType(browser),getSelectorsByUserAgent=function(o){if(!o||typeof o!="string"){console.error("No valid user agent string was provided");return}var _e=parseUserAgent(o),tt=_e.device,ct=_e.browser,gt=_e.os,rt=_e.engine,it=_e.ua;return buildSelectorsObject({device:tt,browser:ct,os:gt,engine:rt,ua:it})},AndroidView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isAndroid?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},BrowserView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isBrowser$1?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},IEView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isIE?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},IOSView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isIOS?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},MobileView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isMobile?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},TabletView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isTablet?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},WinPhoneView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isWinPhone?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},MobileOnlyView=function(o){var _e=o.renderWithFragment,tt=o.children;o.viewClassName,o.style;var ct=_objectWithoutProperties(o,["renderWithFragment","children","viewClassName","style"]);return isMobileOnly?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},SmartTVView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isSmartTV?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},ConsoleView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isConsole?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},WearableView=function(o){var _e=o.renderWithFragment,tt=o.children,ct=_objectWithoutProperties(o,["renderWithFragment","children"]);return isWearable?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",ct,tt):null},CustomView=function(o){var _e=o.renderWithFragment,tt=o.children;o.viewClassName,o.style;var ct=o.condition,gt=_objectWithoutProperties(o,["renderWithFragment","children","viewClassName","style","condition"]);return ct?_e?React__default.createElement(React.Fragment,null,tt):React__default.createElement("div",gt,tt):null};function withOrientationChange(a){return function(o){_inherits(_e,o);function _e(tt){var ct;return _classCallCheck(this,_e),ct=_possibleConstructorReturn(this,_getPrototypeOf(_e).call(this,tt)),ct.isEventListenerAdded=!1,ct.handleOrientationChange=ct.handleOrientationChange.bind(_assertThisInitialized$1(ct)),ct.onOrientationChange=ct.onOrientationChange.bind(_assertThisInitialized$1(ct)),ct.onPageLoad=ct.onPageLoad.bind(_assertThisInitialized$1(ct)),ct.state={isLandscape:!1,isPortrait:!1},ct}return _createClass(_e,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var ct=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:ct===0,isLandscape:ct===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":_typeof(window))!==void 0&&isMobile&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return React__default.createElement(a,_extends$1({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),_e}(React__default.Component)}function useMobileOrientation(){var a=React.useState(function(){var gt=window.innerWidth>window.innerHeight?90:0;return{isPortrait:gt===0,isLandscape:gt===90,orientation:gt===0?"portrait":"landscape"}}),o=_slicedToArray(a,2),_e=o[0],tt=o[1],ct=React.useCallback(function(){var gt=window.innerWidth>window.innerHeight?90:0,rt={isPortrait:gt===0,isLandscape:gt===90,orientation:gt===0?"portrait":"landscape"};_e.orientation!==rt.orientation&&tt(rt)},[_e.orientation]);return React.useEffect(function(){return(typeof window>"u"?"undefined":_typeof(window))!==void 0&&isMobile&&(ct(),window.addEventListener("load",ct,!1),window.addEventListener("resize",ct,!1)),function(){window.removeEventListener("resize",ct,!1),window.removeEventListener("load",ct,!1)}},[ct]),_e}function useDeviceData(a){var o=a||window.navigator.userAgent;return parseUserAgent(o)}function useDeviceSelectors(a){var o=a||window.navigator.userAgent,_e=useDeviceData(o),tt=buildSelectorsObject(_e);return[tt,_e]}lib.AndroidView=AndroidView;lib.BrowserTypes=BrowserTypes;lib.BrowserView=BrowserView;lib.ConsoleView=ConsoleView;lib.CustomView=CustomView;lib.IEView=IEView;lib.IOSView=IOSView;lib.MobileOnlyView=MobileOnlyView;lib.MobileView=MobileView;lib.OsTypes=OsTypes;lib.SmartTVView=SmartTVView;lib.TabletView=TabletView;lib.WearableView=WearableView;lib.WinPhoneView=WinPhoneView;lib.browserName=browserName;lib.browserVersion=browserVersion;lib.deviceDetect=deviceDetect;lib.deviceType=deviceType;lib.engineName=engineName;lib.engineVersion=engineVersion;lib.fullBrowserVersion=fullBrowserVersion;lib.getSelectorsByUserAgent=getSelectorsByUserAgent;lib.getUA=getUA;lib.isAndroid=isAndroid;lib.isBrowser=isBrowser$1;lib.isChrome=isChrome;lib.isChromium=isChromium;lib.isConsole=isConsole;lib.isDesktop=isDesktop;lib.isEdge=isEdge;lib.isEdgeChromium=isEdgeChromium;lib.isElectron=isElectron;lib.isEmbedded=isEmbedded;lib.isFirefox=isFirefox;lib.isIE=isIE;lib.isIOS=isIOS;lib.isIOS13=isIOS13;lib.isIPad13=isIPad13;lib.isIPhone13=isIPhone13;lib.isIPod13=isIPod13;lib.isLegacyEdge=isLegacyEdge;lib.isMIUI=isMIUI;lib.isMacOs=isMacOs;var isMobile_1=lib.isMobile=isMobile;lib.isMobileOnly=isMobileOnly;lib.isMobileSafari=isMobileSafari;lib.isOpera=isOpera;lib.isSafari=isSafari;lib.isSamsungBrowser=isSamsungBrowser;lib.isSmartTV=isSmartTV;lib.isTablet=isTablet;lib.isWearable=isWearable;lib.isWinPhone=isWinPhone;lib.isWindows=isWindows;lib.isYandex=isYandex;lib.mobileModel=mobileModel;lib.mobileVendor=mobileVendor;lib.osName=osName;lib.osVersion=osVersion;lib.parseUserAgent=parseUserAgent;lib.setUserAgent=setUserAgent;lib.useDeviceData=useDeviceData;lib.useDeviceSelectors=useDeviceSelectors;lib.useMobileOrientation=useMobileOrientation;lib.withOrientationChange=withOrientationChange;var uaParser={exports:{}};(function(a,o){(function(_e,tt){var ct="1.0.36",gt="",rt="?",it="function",s="undefined",et="object",nt="string",at="major",ht="model",dt="name",ut="type",lt="vendor",mt="version",ot="architecture",pt="console",ft="mobile",yt="tablet",vt="smarttv",bt="wearable",At="embedded",Nt=350,St="Amazon",wt="Apple",Mt="ASUS",Ht="BlackBerry",Ot="Browser",Dt="Chrome",Gt="Edge",nn="Firefox",zt="Google",Ft="Huawei",un="LG",vn="Microsoft",yn="Motorola",cn="Opera",gn="Samsung",bn="Sharp",fn="Sony",Tn="Xiaomi",_n="Zebra",Un="Facebook",Pn="Chromium OS",In="Mac OS",Rn=function(An,Wn){var Cn={};for(var Nn in An)Wn[Nn]&&Wn[Nn].length%2===0?Cn[Nn]=Wn[Nn].concat(An[Nn]):Cn[Nn]=An[Nn];return Cn},On=function(An){for(var Wn={},Cn=0;Cn0?st.length===2?typeof st[1]==it?this[st[0]]=st[1].call(this,Rt):this[st[0]]=st[1]:st.length===3?typeof st[1]===it&&!(st[1].exec&&st[1].test)?this[st[0]]=Rt?st[1].call(this,Rt,st[2]):tt:this[st[0]]=Rt?Rt.replace(st[1],st[2]):tt:st.length===4&&(this[st[0]]=Rt?st[3].call(this,Rt.replace(st[1],st[2])):tt):this[st]=Rt||tt;Cn+=2}},on=function(An,Wn){for(var Cn in Wn)if(typeof Wn[Cn]===et&&Wn[Cn].length>0){for(var Nn=0;Nn2&&(Tt[ht]="iPad",Tt[ut]=yt),Tt},this.getEngine=function(){var Tt={};return Tt[dt]=tt,Tt[mt]=tt,Zn.call(Tt,Nn,kt.engine),Tt},this.getOS=function(){var Tt={};return Tt[dt]=tt,Tt[mt]=tt,Zn.call(Tt,Nn,kt.os),st&&!Tt[dt]&&qt&&qt.platform!="Unknown"&&(Tt[dt]=qt.platform.replace(/chrome os/i,Pn).replace(/macos/i,In)),Tt},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Nn},this.setUA=function(Tt){return Nn=typeof Tt===nt&&Tt.length>Nt?Fn(Tt,Nt):Tt,this},this.setUA(Nn),this};$n.VERSION=ct,$n.BROWSER=On([dt,mt,at]),$n.CPU=On([ot]),$n.DEVICE=On([ht,lt,ut,pt,ft,vt,yt,bt,At]),$n.ENGINE=$n.OS=On([dt,mt]),a.exports&&(o=a.exports=$n),o.UAParser=$n;var Jn=typeof _e!==s&&(_e.jQuery||_e.Zepto);if(Jn&&!Jn.ua){var Kn=new $n;Jn.ua=Kn.getResult(),Jn.ua.get=function(){return Kn.getUA()},Jn.ua.set=function(An){Kn.setUA(An);var Wn=Kn.getResult();for(var Cn in Wn)Jn.ua[Cn]=Wn[Cn]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports,base64={exports:{}};/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */base64.exports;(function(a,o){(function(_e){var tt=o,ct=a&&a.exports==tt&&a,gt=typeof commonjsGlobal=="object"&&commonjsGlobal;(gt.global===gt||gt.window===gt)&&(_e=gt);var rt=function(ut){this.message=ut};rt.prototype=new Error,rt.prototype.name="InvalidCharacterError";var it=function(ut){throw new rt(ut)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",et=/[\t\n\f\r ]/g,nt=function(ut){ut=String(ut).replace(et,"");var lt=ut.length;lt%4==0&&(ut=ut.replace(/==?$/,""),lt=ut.length),(lt%4==1||/[^+a-zA-Z0-9/]/.test(ut))&&it("Invalid character: the string to be decoded is not correctly encoded.");for(var mt=0,ot,pt,ft="",yt=-1;++yt>(-2*mt&6)));return ft},at=function(ut){ut=String(ut),/[^\0-\xFF]/.test(ut)&&it("The string to be encoded contains characters outside of the Latin1 range.");for(var lt=ut.length%3,mt="",ot=-1,pt,ft,yt,vt,bt=ut.length-lt;++ot>18&63)+s.charAt(vt>>12&63)+s.charAt(vt>>6&63)+s.charAt(vt&63);return lt==2?(pt=ut.charCodeAt(ot)<<8,ft=ut.charCodeAt(++ot),vt=pt+ft,mt+=s.charAt(vt>>10)+s.charAt(vt>>4&63)+s.charAt(vt<<2&63)+"="):lt==1&&(vt=ut.charCodeAt(ot),mt+=s.charAt(vt>>2)+s.charAt(vt<<4&63)+"=="),mt},ht={encode:at,decode:nt,version:"1.0.0"};if(tt&&!tt.nodeType)if(ct)ct.exports=ht;else for(var dt in ht)ht.hasOwnProperty(dt)&&(tt[dt]=ht[dt]);else _e.base64=ht})(commonjsGlobal)})(base64,base64.exports);var base64Exports=base64.exports;function commonjsRequire(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var apiRTC_min={exports:{}};(function(a,o){(function(tt){a.exports=tt()})(function(){return function(){function tt(ct,gt,rt){function it(nt,at){if(!gt[nt]){if(!ct[nt]){var ht=typeof commonjsRequire=="function"&&commonjsRequire;if(!at&&ht)return ht(nt,!0);if(s)return s(nt,!0);var dt=new Error("Cannot find module '"+nt+"'");throw dt.code="MODULE_NOT_FOUND",dt}var ut=gt[nt]={exports:{}};ct[nt][0].call(ut.exports,function(lt){return it(ct[nt][1][lt]||lt)},ut,ut.exports,tt,ct,gt,rt)}return gt[nt].exports}for(var s=typeof commonjsRequire=="function"&&commonjsRequire,et=0;et0&&arguments[0]!==void 0?arguments[0]:{}).window,ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},lt=it.log,mt=it.detectBrowser(dt),ot={browserDetails:mt,commonShim:ht,extractVersion:it.extractVersion,disableLog:it.disableLog,disableWarnings:it.disableWarnings};switch(mt.browser){case"chrome":if(!s||!s.shimPeerConnection||!ut.shimChrome)return lt("Chrome shim is not included in this adapter release."),ot;lt("adapter.js shimming chrome."),ot.browserShim=s,s.shimGetUserMedia(dt),s.shimMediaStream(dt),s.shimPeerConnection(dt),s.shimOnTrack(dt),s.shimAddTrackRemoveTrack(dt),s.shimGetSendersWithDtmf(dt),s.shimGetStats(dt),s.shimSenderReceiverGetStats(dt),s.fixNegotiationNeeded(dt),ht.shimRTCIceCandidate(dt),ht.shimConnectionState(dt),ht.shimMaxMessageSize(dt),ht.shimSendThrowTypeError(dt),ht.removeAllowExtmapMixed(dt);break;case"firefox":if(!nt||!nt.shimPeerConnection||!ut.shimFirefox)return lt("Firefox shim is not included in this adapter release."),ot;lt("adapter.js shimming firefox."),ot.browserShim=nt,nt.shimGetUserMedia(dt),nt.shimPeerConnection(dt),nt.shimOnTrack(dt),nt.shimRemoveStream(dt),nt.shimSenderGetStats(dt),nt.shimReceiverGetStats(dt),nt.shimRTCDataChannel(dt),ht.shimRTCIceCandidate(dt),ht.shimConnectionState(dt),ht.shimMaxMessageSize(dt),ht.shimSendThrowTypeError(dt);break;case"edge":if(!et||!et.shimPeerConnection||!ut.shimEdge)return lt("MS edge shim is not included in this adapter release."),ot;lt("adapter.js shimming edge."),ot.browserShim=et,et.shimGetUserMedia(dt),et.shimGetDisplayMedia(dt),et.shimPeerConnection(dt),et.shimReplaceTrack(dt),ht.shimMaxMessageSize(dt),ht.shimSendThrowTypeError(dt);break;case"safari":if(!at||!ut.shimSafari)return lt("Safari shim is not included in this adapter release."),ot;lt("adapter.js shimming safari."),ot.browserShim=at,at.shimRTCIceServerUrls(dt),at.shimCreateOfferLegacy(dt),at.shimCallbacksAPI(dt),at.shimLocalStreamsAPI(dt),at.shimRemoteStreamsAPI(dt),at.shimTrackEventTransceiver(dt),at.shimGetUserMedia(dt),ht.shimRTCIceCandidate(dt),ht.shimMaxMessageSize(dt),ht.shimSendThrowTypeError(dt),ht.removeAllowExtmapMixed(dt);break;default:lt("Unsupported browser!")}return ot};var it=rt(tt("./utils")),s=rt(tt("./chrome/chrome_shim")),et=rt(tt("./edge/edge_shim")),nt=rt(tt("./firefox/firefox_shim")),at=rt(tt("./safari/safari_shim")),ht=rt(tt("./common_shim"))},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(tt,ct,gt){function rt(at){at.RTCPeerConnection.prototype.getLocalStreams=function(){var mt=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(ot){return mt._shimmedLocalStreams[ot][0]})};var ht=at.RTCPeerConnection.prototype.addTrack;at.RTCPeerConnection.prototype.addTrack=function(mt,ot){if(!ot)return ht.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var pt=ht.apply(this,arguments);return this._shimmedLocalStreams[ot.id]?this._shimmedLocalStreams[ot.id].indexOf(pt)===-1&&this._shimmedLocalStreams[ot.id].push(pt):this._shimmedLocalStreams[ot.id]=[ot,pt],pt};var dt=at.RTCPeerConnection.prototype.addStream;at.RTCPeerConnection.prototype.addStream=function(mt){var ot=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},mt.getTracks().forEach(function(yt){if(ot.getSenders().find(function(vt){return vt.track===yt}))throw new DOMException("Track already exists.","InvalidAccessError")});var pt=this.getSenders();dt.apply(this,arguments);var ft=this.getSenders().filter(function(yt){return pt.indexOf(yt)===-1});this._shimmedLocalStreams[mt.id]=[mt].concat(ft)};var ut=at.RTCPeerConnection.prototype.removeStream;at.RTCPeerConnection.prototype.removeStream=function(mt){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[mt.id],ut.apply(this,arguments)};var lt=at.RTCPeerConnection.prototype.removeTrack;at.RTCPeerConnection.prototype.removeTrack=function(mt){var ot=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},mt&&Object.keys(this._shimmedLocalStreams).forEach(function(pt){var ft=ot._shimmedLocalStreams[pt].indexOf(mt);ft!==-1&&ot._shimmedLocalStreams[pt].splice(ft,1),ot._shimmedLocalStreams[pt].length===1&&delete ot._shimmedLocalStreams[pt]}),lt.apply(this,arguments)}}Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetDisplayMedia=gt.shimGetUserMedia=void 0;var it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(at){return typeof at}:function(at){return at&&typeof Symbol=="function"&&at.constructor===Symbol&&at!==Symbol.prototype?"symbol":typeof at},s=tt("./getusermedia");Object.defineProperty(gt,"shimGetUserMedia",{enumerable:!0,get:function(){return s.shimGetUserMedia}});var et=tt("./getdisplaymedia");Object.defineProperty(gt,"shimGetDisplayMedia",{enumerable:!0,get:function(){return et.shimGetDisplayMedia}}),gt.shimMediaStream=function(at){at.MediaStream=at.MediaStream||at.webkitMediaStream},gt.shimOnTrack=function(at){if((at===void 0?"undefined":it(at))!=="object"||!at.RTCPeerConnection||"ontrack"in at.RTCPeerConnection.prototype)nt.wrapPeerConnectionEvent(at,"track",function(dt){return dt.transceiver||Object.defineProperty(dt,"transceiver",{value:{receiver:dt.receiver}}),dt});else{Object.defineProperty(at.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(dt){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=dt)},enumerable:!0,configurable:!0});var ht=at.RTCPeerConnection.prototype.setRemoteDescription;at.RTCPeerConnection.prototype.setRemoteDescription=function(){var dt=this;return this._ontrackpoly||(this._ontrackpoly=function(ut){ut.stream.addEventListener("addtrack",function(lt){var mt=void 0;mt=at.RTCPeerConnection.prototype.getReceivers?dt.getReceivers().find(function(pt){return pt.track&&pt.track.id===lt.track.id}):{track:lt.track};var ot=new Event("track");ot.track=lt.track,ot.receiver=mt,ot.transceiver={receiver:mt},ot.streams=[ut.stream],dt.dispatchEvent(ot)}),ut.stream.getTracks().forEach(function(lt){var mt=void 0;mt=at.RTCPeerConnection.prototype.getReceivers?dt.getReceivers().find(function(pt){return pt.track&&pt.track.id===lt.id}):{track:lt};var ot=new Event("track");ot.track=lt,ot.receiver=mt,ot.transceiver={receiver:mt},ot.streams=[ut.stream],dt.dispatchEvent(ot)})},this.addEventListener("addstream",this._ontrackpoly)),ht.apply(this,arguments)}}},gt.shimGetSendersWithDtmf=function(at){if((at===void 0?"undefined":it(at))==="object"&&at.RTCPeerConnection&&!("getSenders"in at.RTCPeerConnection.prototype)&&"createDTMFSender"in at.RTCPeerConnection.prototype){var ht=function(pt,ft){return{track:ft,get dtmf(){return this._dtmf===void 0&&(ft.kind==="audio"?this._dtmf=pt.createDTMFSender(ft):this._dtmf=null),this._dtmf},_pc:pt}};if(!at.RTCPeerConnection.prototype.getSenders){at.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var dt=at.RTCPeerConnection.prototype.addTrack;at.RTCPeerConnection.prototype.addTrack=function(pt,ft){var yt=dt.apply(this,arguments);return yt||(yt=ht(this,pt),this._senders.push(yt)),yt};var ut=at.RTCPeerConnection.prototype.removeTrack;at.RTCPeerConnection.prototype.removeTrack=function(pt){ut.apply(this,arguments);var ft=this._senders.indexOf(pt);ft!==-1&&this._senders.splice(ft,1)}}var lt=at.RTCPeerConnection.prototype.addStream;at.RTCPeerConnection.prototype.addStream=function(pt){var ft=this;this._senders=this._senders||[],lt.apply(this,[pt]),pt.getTracks().forEach(function(yt){ft._senders.push(ht(ft,yt))})};var mt=at.RTCPeerConnection.prototype.removeStream;at.RTCPeerConnection.prototype.removeStream=function(pt){var ft=this;this._senders=this._senders||[],mt.apply(this,[pt]),pt.getTracks().forEach(function(yt){var vt=ft._senders.find(function(bt){return bt.track===yt});vt&&ft._senders.splice(ft._senders.indexOf(vt),1)})}}else if((at===void 0?"undefined":it(at))==="object"&&at.RTCPeerConnection&&"getSenders"in at.RTCPeerConnection.prototype&&"createDTMFSender"in at.RTCPeerConnection.prototype&&at.RTCRtpSender&&!("dtmf"in at.RTCRtpSender.prototype)){var ot=at.RTCPeerConnection.prototype.getSenders;at.RTCPeerConnection.prototype.getSenders=function(){var pt=this,ft=ot.apply(this,[]);return ft.forEach(function(yt){return yt._pc=pt}),ft},Object.defineProperty(at.RTCRtpSender.prototype,"dtmf",{get:function(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},gt.shimGetStats=function(at){if(at.RTCPeerConnection){var ht=at.RTCPeerConnection.prototype.getStats;at.RTCPeerConnection.prototype.getStats=function(dt,ut,lt){var mt=this,ot=arguments;if(arguments.length>0&&typeof dt=="function")return ht.apply(this,arguments);if(ht.length===0&&(arguments.length===0||typeof arguments[0]!="function"))return ht.apply(this,[]);var pt=function(vt){var bt={};return vt.result().forEach(function(At){var Nt={id:At.id,timestamp:At.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[At.type]||At.type};At.names().forEach(function(St){Nt[St]=At.stat(St)}),bt[Nt.id]=Nt}),bt},ft=function(vt){return new Map(Object.keys(vt).map(function(bt){return[bt,vt[bt]]}))};if(arguments.length>=2){var yt=function(vt){ot[1](ft(pt(vt)))};return ht.apply(this,[yt,arguments[0]])}return new Promise(function(vt,bt){ht.apply(mt,[function(At){vt(ft(pt(At)))},bt])}).then(ut,lt)}}},gt.shimSenderReceiverGetStats=function(at){if((at===void 0?"undefined":it(at))==="object"&&at.RTCPeerConnection&&at.RTCRtpSender&&at.RTCRtpReceiver){if(!("getStats"in at.RTCRtpSender.prototype)){var ht=at.RTCPeerConnection.prototype.getSenders;ht&&(at.RTCPeerConnection.prototype.getSenders=function(){var mt=this,ot=ht.apply(this,[]);return ot.forEach(function(pt){return pt._pc=mt}),ot});var dt=at.RTCPeerConnection.prototype.addTrack;dt&&(at.RTCPeerConnection.prototype.addTrack=function(){var mt=dt.apply(this,arguments);return mt._pc=this,mt}),at.RTCRtpSender.prototype.getStats=function(){var mt=this;return this._pc.getStats().then(function(ot){return nt.filterStats(ot,mt.track,!0)})}}if(!("getStats"in at.RTCRtpReceiver.prototype)){var ut=at.RTCPeerConnection.prototype.getReceivers;ut&&(at.RTCPeerConnection.prototype.getReceivers=function(){var mt=this,ot=ut.apply(this,[]);return ot.forEach(function(pt){return pt._pc=mt}),ot}),nt.wrapPeerConnectionEvent(at,"track",function(mt){return mt.receiver._pc=mt.srcElement,mt}),at.RTCRtpReceiver.prototype.getStats=function(){var mt=this;return this._pc.getStats().then(function(ot){return nt.filterStats(ot,mt.track,!1)})}}if("getStats"in at.RTCRtpSender.prototype&&"getStats"in at.RTCRtpReceiver.prototype){var lt=at.RTCPeerConnection.prototype.getStats;at.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof at.MediaStreamTrack){var mt=arguments[0],ot=void 0,pt=void 0,ft=void 0;return this.getSenders().forEach(function(yt){yt.track===mt&&(ot?ft=!0:ot=yt)}),this.getReceivers().forEach(function(yt){return yt.track===mt&&(pt?ft=!0:pt=yt),yt.track===mt}),ft||ot&&pt?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):ot?ot.getStats():pt?pt.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return lt.apply(this,arguments)}}}},gt.shimAddTrackRemoveTrackWithNative=rt,gt.shimAddTrackRemoveTrack=function(at){function ht(yt,vt){var bt=vt.sdp;return Object.keys(yt._reverseStreams||[]).forEach(function(At){var Nt=yt._reverseStreams[At],St=yt._streams[Nt.id];bt=bt.replace(new RegExp(St.id,"g"),Nt.id)}),new RTCSessionDescription({type:vt.type,sdp:bt})}function dt(yt,vt){var bt=vt.sdp;return Object.keys(yt._reverseStreams||[]).forEach(function(At){var Nt=yt._reverseStreams[At],St=yt._streams[Nt.id];bt=bt.replace(new RegExp(Nt.id,"g"),St.id)}),new RTCSessionDescription({type:vt.type,sdp:bt})}if(at.RTCPeerConnection){var ut=nt.detectBrowser(at);if(at.RTCPeerConnection.prototype.addTrack&&ut.version>=65)return rt(at);var lt=at.RTCPeerConnection.prototype.getLocalStreams;at.RTCPeerConnection.prototype.getLocalStreams=function(){var yt=this,vt=lt.apply(this);return this._reverseStreams=this._reverseStreams||{},vt.map(function(bt){return yt._reverseStreams[bt.id]})};var mt=at.RTCPeerConnection.prototype.addStream;at.RTCPeerConnection.prototype.addStream=function(yt){var vt=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},yt.getTracks().forEach(function(At){if(vt.getSenders().find(function(Nt){return Nt.track===At}))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[yt.id]){var bt=new at.MediaStream(yt.getTracks());this._streams[yt.id]=bt,this._reverseStreams[bt.id]=yt,yt=bt}mt.apply(this,[yt])};var ot=at.RTCPeerConnection.prototype.removeStream;at.RTCPeerConnection.prototype.removeStream=function(yt){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},ot.apply(this,[this._streams[yt.id]||yt]),delete this._reverseStreams[this._streams[yt.id]?this._streams[yt.id].id:yt.id],delete this._streams[yt.id]},at.RTCPeerConnection.prototype.addTrack=function(yt,vt){var bt=this;if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var At=[].slice.call(arguments,1);if(At.length!==1||!At[0].getTracks().find(function(wt){return wt===yt}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(function(wt){return wt.track===yt}))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var Nt=this._streams[vt.id];if(Nt)Nt.addTrack(yt),Promise.resolve().then(function(){bt.dispatchEvent(new Event("negotiationneeded"))});else{var St=new at.MediaStream([yt]);this._streams[vt.id]=St,this._reverseStreams[St.id]=vt,this.addStream(St)}return this.getSenders().find(function(wt){return wt.track===yt})},["createOffer","createAnswer"].forEach(function(yt){var vt=at.RTCPeerConnection.prototype[yt];at.RTCPeerConnection.prototype[yt]=function(){var bt=this,At=arguments;return arguments.length&&typeof arguments[0]=="function"?vt.apply(this,[function(Nt){var St=ht(bt,Nt);At[0].apply(null,[St])},function(Nt){At[1]&&At[1].apply(null,Nt)},arguments[2]]):vt.apply(this,arguments).then(function(Nt){return ht(bt,Nt)})}});var pt=at.RTCPeerConnection.prototype.setLocalDescription;at.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=dt(this,arguments[0]),pt.apply(this,arguments)):pt.apply(this,arguments)};var ft=Object.getOwnPropertyDescriptor(at.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(at.RTCPeerConnection.prototype,"localDescription",{get:function(){var yt=ft.get.apply(this);return yt.type===""?yt:ht(this,yt)}}),at.RTCPeerConnection.prototype.removeTrack=function(yt){var vt=this;if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!yt._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(yt._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var bt=void 0;Object.keys(this._streams).forEach(function(At){vt._streams[At].getTracks().find(function(Nt){return yt.track===Nt})&&(bt=vt._streams[At])}),bt&&(bt.getTracks().length===1?this.removeStream(this._reverseStreams[bt.id]):bt.removeTrack(yt.track),this.dispatchEvent(new Event("negotiationneeded")))}}},gt.shimPeerConnection=function(at){if(!at.RTCPeerConnection&&at.webkitRTCPeerConnection&&(at.RTCPeerConnection=at.webkitRTCPeerConnection),at.RTCPeerConnection){["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(dt){var ut=at.RTCPeerConnection.prototype[dt];at.RTCPeerConnection.prototype[dt]=function(){return arguments[0]=new(dt==="addIceCandidate"?at.RTCIceCandidate:at.RTCSessionDescription)(arguments[0]),ut.apply(this,arguments)}});var ht=at.RTCPeerConnection.prototype.addIceCandidate;at.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?ht.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},gt.fixNegotiationNeeded=function(at){nt.wrapPeerConnectionEvent(at,"negotiationneeded",function(ht){if(ht.target.signalingState==="stable")return ht})};var nt=function(at){if(at&&at.__esModule)return at;var ht={};if(at!=null)for(var dt in at)Object.prototype.hasOwnProperty.call(at,dt)&&(ht[dt]=at[dt]);return ht.default=at,ht}(tt("../utils.js"))},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetDisplayMedia=function(rt,it){rt.navigator.mediaDevices&&"getDisplayMedia"in rt.navigator.mediaDevices||rt.navigator.mediaDevices&&(typeof it=="function"?rt.navigator.mediaDevices.getDisplayMedia=function(s){return it(s).then(function(et){var nt=s.video&&s.video.width,at=s.video&&s.video.height,ht=s.video&&s.video.frameRate;return s.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:et,maxFrameRate:ht||3}},nt&&(s.video.mandatory.maxWidth=nt),at&&(s.video.mandatory.maxHeight=at),rt.navigator.mediaDevices.getUserMedia(s)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}},{}],5:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0});var rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et};gt.shimGetUserMedia=function(et){var nt=et&&et.navigator;if(nt.mediaDevices){var at=it.detectBrowser(et),ht=function(mt){if((mt===void 0?"undefined":rt(mt))!=="object"||mt.mandatory||mt.optional)return mt;var ot={};return Object.keys(mt).forEach(function(pt){if(pt!=="require"&&pt!=="advanced"&&pt!=="mediaSource"){var ft=rt(mt[pt])==="object"?mt[pt]:{ideal:mt[pt]};ft.exact!==void 0&&typeof ft.exact=="number"&&(ft.min=ft.max=ft.exact);var yt=function(bt,At){return bt?bt+At.charAt(0).toUpperCase()+At.slice(1):At==="deviceId"?"sourceId":At};if(ft.ideal!==void 0){ot.optional=ot.optional||[];var vt={};typeof ft.ideal=="number"?(vt[yt("min",pt)]=ft.ideal,ot.optional.push(vt),(vt={})[yt("max",pt)]=ft.ideal,ot.optional.push(vt)):(vt[yt("",pt)]=ft.ideal,ot.optional.push(vt))}ft.exact!==void 0&&typeof ft.exact!="number"?(ot.mandatory=ot.mandatory||{},ot.mandatory[yt("",pt)]=ft.exact):["min","max"].forEach(function(bt){ft[bt]!==void 0&&(ot.mandatory=ot.mandatory||{},ot.mandatory[yt(bt,pt)]=ft[bt])})}}),mt.advanced&&(ot.optional=(ot.optional||[]).concat(mt.advanced)),ot},dt=function(mt,ot){if(at.version>=61)return ot(mt);if((mt=JSON.parse(JSON.stringify(mt)))&&rt(mt.audio)==="object"){var pt=function(bt,At,Nt){At in bt&&!(Nt in bt)&&(bt[Nt]=bt[At],delete bt[At])};pt((mt=JSON.parse(JSON.stringify(mt))).audio,"autoGainControl","googAutoGainControl"),pt(mt.audio,"noiseSuppression","googNoiseSuppression"),mt.audio=ht(mt.audio)}if(mt&&rt(mt.video)==="object"){var ft=mt.video.facingMode;ft=ft&&((ft===void 0?"undefined":rt(ft))==="object"?ft:{ideal:ft});var yt=at.version<66;if(ft&&(ft.exact==="user"||ft.exact==="environment"||ft.ideal==="user"||ft.ideal==="environment")&&(!nt.mediaDevices.getSupportedConstraints||!nt.mediaDevices.getSupportedConstraints().facingMode||yt)){delete mt.video.facingMode;var vt=void 0;if(ft.exact==="environment"||ft.ideal==="environment"?vt=["back","rear"]:ft.exact!=="user"&&ft.ideal!=="user"||(vt=["front"]),vt)return nt.mediaDevices.enumerateDevices().then(function(bt){var At=(bt=bt.filter(function(Nt){return Nt.kind==="videoinput"})).find(function(Nt){return vt.some(function(St){return Nt.label.toLowerCase().includes(St)})});return!At&&bt.length&&vt.includes("back")&&(At=bt[bt.length-1]),At&&(mt.video.deviceId=ft.exact?{exact:At.deviceId}:{ideal:At.deviceId}),mt.video=ht(mt.video),s("chrome: "+JSON.stringify(mt)),ot(mt)})}mt.video=ht(mt.video)}return s("chrome: "+JSON.stringify(mt)),ot(mt)},ut=function(mt){return at.version>=64?mt:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[mt.name]||mt.name,message:mt.message,constraint:mt.constraint||mt.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(nt.getUserMedia=(function(mt,ot,pt){dt(mt,function(ft){nt.webkitGetUserMedia(ft,ot,function(yt){pt&&pt(ut(yt))})})}).bind(nt),nt.mediaDevices.getUserMedia){var lt=nt.mediaDevices.getUserMedia.bind(nt.mediaDevices);nt.mediaDevices.getUserMedia=function(mt){return dt(mt,function(ot){return lt(ot).then(function(pt){if(ot.audio&&!pt.getAudioTracks().length||ot.video&&!pt.getVideoTracks().length)throw pt.getTracks().forEach(function(ft){ft.stop()}),new DOMException("","NotFoundError");return pt},function(pt){return Promise.reject(ut(pt))})})}}}};var it=function(et){if(et&&et.__esModule)return et;var nt={};if(et!=null)for(var at in et)Object.prototype.hasOwnProperty.call(et,at)&&(nt[at]=et[at]);return nt.default=et,nt}(tt("../utils.js")),s=it.log},{"../utils.js":15}],6:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0});var rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et};gt.shimRTCIceCandidate=function(et){if(et.RTCIceCandidate&&!(et.RTCIceCandidate&&"foundation"in et.RTCIceCandidate.prototype)){var nt=et.RTCIceCandidate;et.RTCIceCandidate=function(at){if((at===void 0?"undefined":rt(at))==="object"&&at.candidate&&at.candidate.indexOf("a=")===0&&((at=JSON.parse(JSON.stringify(at))).candidate=at.candidate.substr(2)),at.candidate&&at.candidate.length){var ht=new nt(at),dt=it.default.parseCandidate(at.candidate),ut=Object.assign(ht,dt);return ut.toJSON=function(){return{candidate:ut.candidate,sdpMid:ut.sdpMid,sdpMLineIndex:ut.sdpMLineIndex,usernameFragment:ut.usernameFragment}},ut}return new nt(at)},et.RTCIceCandidate.prototype=nt.prototype,s.wrapPeerConnectionEvent(et,"icecandidate",function(at){return at.candidate&&Object.defineProperty(at,"candidate",{value:new et.RTCIceCandidate(at.candidate),writable:"false"}),at})}},gt.shimMaxMessageSize=function(et){if(!et.RTCSctpTransport&&et.RTCPeerConnection){var nt=s.detectBrowser(et);"sctp"in et.RTCPeerConnection.prototype||Object.defineProperty(et.RTCPeerConnection.prototype,"sctp",{get:function(){return this._sctp===void 0?null:this._sctp}});var at=function(mt){if(!mt||!mt.sdp)return!1;var ot=it.default.splitSections(mt.sdp);return ot.shift(),ot.some(function(pt){var ft=it.default.parseMLine(pt);return ft&&ft.kind==="application"&&ft.protocol.indexOf("SCTP")!==-1})},ht=function(mt){var ot=mt.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(ot===null||ot.length<2)return-1;var pt=parseInt(ot[1],10);return pt!==pt?-1:pt},dt=function(mt){var ot=65536;return nt.browser==="firefox"&&(ot=nt.version<57?mt===-1?16384:2147483637:nt.version<60?nt.version===57?65535:65536:2147483637),ot},ut=function(mt,ot){var pt=65536;nt.browser==="firefox"&&nt.version===57&&(pt=65535);var ft=it.default.matchPrefix(mt.sdp,"a=max-message-size:");return ft.length>0?pt=parseInt(ft[0].substr(19),10):nt.browser==="firefox"&&ot!==-1&&(pt=2147483637),pt},lt=et.RTCPeerConnection.prototype.setRemoteDescription;et.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,at(arguments[0])){var mt=ht(arguments[0]),ot=dt(mt),pt=ut(arguments[0],mt),ft=void 0;ft=ot===0&&pt===0?Number.POSITIVE_INFINITY:ot===0||pt===0?Math.max(ot,pt):Math.min(ot,pt);var yt={};Object.defineProperty(yt,"maxMessageSize",{get:function(){return ft}}),this._sctp=yt}return lt.apply(this,arguments)}}},gt.shimSendThrowTypeError=function(et){function nt(ht,dt){var ut=ht.send;ht.send=function(){var lt=arguments[0],mt=lt.length||lt.size||lt.byteLength;if(ht.readyState==="open"&&dt.sctp&&mt>dt.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+dt.sctp.maxMessageSize+" bytes)");return ut.apply(ht,arguments)}}if(et.RTCPeerConnection&&"createDataChannel"in et.RTCPeerConnection.prototype){var at=et.RTCPeerConnection.prototype.createDataChannel;et.RTCPeerConnection.prototype.createDataChannel=function(){var ht=at.apply(this,arguments);return nt(ht,this),ht},s.wrapPeerConnectionEvent(et,"datachannel",function(ht){return nt(ht.channel,ht.target),ht})}},gt.shimConnectionState=function(et){if(et.RTCPeerConnection&&!("connectionState"in et.RTCPeerConnection.prototype)){var nt=et.RTCPeerConnection.prototype;Object.defineProperty(nt,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(nt,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(at){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),at&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=at)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(function(at){var ht=nt[at];nt[at]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(dt){var ut=dt.target;if(ut._lastConnectionState!==ut.connectionState){ut._lastConnectionState=ut.connectionState;var lt=new Event("connectionstatechange",dt);ut.dispatchEvent(lt)}return dt},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),ht.apply(this,arguments)}})}},gt.removeAllowExtmapMixed=function(et){if(et.RTCPeerConnection){var nt=s.detectBrowser(et);if(!(nt.browser==="chrome"&&nt.version>=71||nt.browser==="safari"&&nt.version>=605)){var at=et.RTCPeerConnection.prototype.setRemoteDescription;et.RTCPeerConnection.prototype.setRemoteDescription=function(ht){return ht&&ht.sdp&&ht.sdp.indexOf(`
-a=extmap-allow-mixed`)!==-1&&(ht.sdp=ht.sdp.split(`
-`).filter(function(dt){return dt.trim()!=="a=extmap-allow-mixed"}).join(`
-`)),at.apply(this,arguments)}}}};var it=function(et){return et&&et.__esModule?et:{default:et}}(tt("sdp")),s=function(et){if(et&&et.__esModule)return et;var nt={};if(et!=null)for(var at in et)Object.prototype.hasOwnProperty.call(et,at)&&(nt[at]=et[at]);return nt.default=et,nt}(tt("./utils"))},{"./utils":15,sdp:17}],7:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetDisplayMedia=gt.shimGetUserMedia=void 0;var rt=tt("./getusermedia");Object.defineProperty(gt,"shimGetUserMedia",{enumerable:!0,get:function(){return rt.shimGetUserMedia}});var it=tt("./getdisplaymedia");Object.defineProperty(gt,"shimGetDisplayMedia",{enumerable:!0,get:function(){return it.shimGetDisplayMedia}}),gt.shimPeerConnection=function(at){var ht=s.detectBrowser(at);if(at.RTCIceGatherer&&(at.RTCIceCandidate||(at.RTCIceCandidate=function(lt){return lt}),at.RTCSessionDescription||(at.RTCSessionDescription=function(lt){return lt}),ht.version<15025)){var dt=Object.getOwnPropertyDescriptor(at.MediaStreamTrack.prototype,"enabled");Object.defineProperty(at.MediaStreamTrack.prototype,"enabled",{set:function(lt){dt.set.call(this,lt);var mt=new Event("enabled");mt.enabled=lt,this.dispatchEvent(mt)}})}!at.RTCRtpSender||"dtmf"in at.RTCRtpSender.prototype||Object.defineProperty(at.RTCRtpSender.prototype,"dtmf",{get:function(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=new at.RTCDtmfSender(this):this.track.kind==="video"&&(this._dtmf=null)),this._dtmf}}),at.RTCDtmfSender&&!at.RTCDTMFSender&&(at.RTCDTMFSender=at.RTCDtmfSender);var ut=(0,nt.default)(at,ht.version);at.RTCPeerConnection=function(lt){return lt&<.iceServers&&(lt.iceServers=(0,et.filterIceServers)(lt.iceServers,ht.version),s.log("ICE servers after filtering:",lt.iceServers)),new ut(lt)},at.RTCPeerConnection.prototype=ut.prototype},gt.shimReplaceTrack=function(at){!at.RTCRtpSender||"replaceTrack"in at.RTCRtpSender.prototype||(at.RTCRtpSender.prototype.replaceTrack=at.RTCRtpSender.prototype.setTrack)};var s=function(at){if(at&&at.__esModule)return at;var ht={};if(at!=null)for(var dt in at)Object.prototype.hasOwnProperty.call(at,dt)&&(ht[dt]=at[dt]);return ht.default=at,ht}(tt("../utils")),et=tt("./filtericeservers"),nt=function(at){return at&&at.__esModule?at:{default:at}}(tt("rtcpeerconnection-shim"))},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.filterIceServers=function(it,s){var et=!1;return(it=JSON.parse(JSON.stringify(it))).filter(function(nt){if(nt&&(nt.urls||nt.url)){var at=nt.urls||nt.url;nt.url&&!nt.urls&&rt.deprecated("RTCIceServer.url","RTCIceServer.urls");var ht=typeof at=="string";return ht&&(at=[at]),at=at.filter(function(dt){if(dt.indexOf("stun:")===0)return!1;var ut=dt.startsWith("turn")&&!dt.startsWith("turn:[")&&dt.includes("transport=udp");return ut&&!et?(et=!0,!0):ut&&!et}),delete nt.url,nt.urls=ht?at[0]:at,!!at.length}})};var rt=function(it){if(it&&it.__esModule)return it;var s={};if(it!=null)for(var et in it)Object.prototype.hasOwnProperty.call(it,et)&&(s[et]=it[et]);return s.default=it,s}(tt("../utils"))},{"../utils":15}],9:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetDisplayMedia=function(rt){"getDisplayMedia"in rt.navigator&&rt.navigator.mediaDevices&&(rt.navigator.mediaDevices&&"getDisplayMedia"in rt.navigator.mediaDevices||(rt.navigator.mediaDevices.getDisplayMedia=rt.navigator.getDisplayMedia.bind(rt.navigator)))}},{}],10:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetUserMedia=function(rt){var it=rt&&rt.navigator,s=function(nt){return{name:{PermissionDeniedError:"NotAllowedError"}[nt.name]||nt.name,message:nt.message,constraint:nt.constraint,toString:function(){return this.name}}},et=it.mediaDevices.getUserMedia.bind(it.mediaDevices);it.mediaDevices.getUserMedia=function(nt){return et(nt).catch(function(at){return Promise.reject(s(at))})}}},{}],11:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetDisplayMedia=gt.shimGetUserMedia=void 0;var rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},it=tt("./getusermedia");Object.defineProperty(gt,"shimGetUserMedia",{enumerable:!0,get:function(){return it.shimGetUserMedia}});var s=tt("./getdisplaymedia");Object.defineProperty(gt,"shimGetDisplayMedia",{enumerable:!0,get:function(){return s.shimGetDisplayMedia}}),gt.shimOnTrack=function(nt){(nt===void 0?"undefined":rt(nt))==="object"&&nt.RTCTrackEvent&&"receiver"in nt.RTCTrackEvent.prototype&&!("transceiver"in nt.RTCTrackEvent.prototype)&&Object.defineProperty(nt.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},gt.shimPeerConnection=function(nt){var at=et.detectBrowser(nt);if((nt===void 0?"undefined":rt(nt))==="object"&&(nt.RTCPeerConnection||nt.mozRTCPeerConnection)){!nt.RTCPeerConnection&&nt.mozRTCPeerConnection&&(nt.RTCPeerConnection=nt.mozRTCPeerConnection),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(lt){var mt=nt.RTCPeerConnection.prototype[lt];nt.RTCPeerConnection.prototype[lt]=function(){return arguments[0]=new(lt==="addIceCandidate"?nt.RTCIceCandidate:nt.RTCSessionDescription)(arguments[0]),mt.apply(this,arguments)}});var ht=nt.RTCPeerConnection.prototype.addIceCandidate;nt.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?ht.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())};var dt={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},ut=nt.RTCPeerConnection.prototype.getStats;nt.RTCPeerConnection.prototype.getStats=function(lt,mt,ot){return ut.apply(this,[lt||null]).then(function(pt){if(at.version<53&&!mt)try{pt.forEach(function(ft){ft.type=dt[ft.type]||ft.type})}catch(ft){if(ft.name!=="TypeError")throw ft;pt.forEach(function(yt,vt){pt.set(vt,Object.assign({},yt,{type:dt[yt.type]||yt.type}))})}return pt}).then(mt,ot)}}},gt.shimSenderGetStats=function(nt){if((nt===void 0?"undefined":rt(nt))==="object"&&nt.RTCPeerConnection&&nt.RTCRtpSender&&!(nt.RTCRtpSender&&"getStats"in nt.RTCRtpSender.prototype)){var at=nt.RTCPeerConnection.prototype.getSenders;at&&(nt.RTCPeerConnection.prototype.getSenders=function(){var dt=this,ut=at.apply(this,[]);return ut.forEach(function(lt){return lt._pc=dt}),ut});var ht=nt.RTCPeerConnection.prototype.addTrack;ht&&(nt.RTCPeerConnection.prototype.addTrack=function(){var dt=ht.apply(this,arguments);return dt._pc=this,dt}),nt.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},gt.shimReceiverGetStats=function(nt){if((nt===void 0?"undefined":rt(nt))==="object"&&nt.RTCPeerConnection&&nt.RTCRtpSender&&!(nt.RTCRtpSender&&"getStats"in nt.RTCRtpReceiver.prototype)){var at=nt.RTCPeerConnection.prototype.getReceivers;at&&(nt.RTCPeerConnection.prototype.getReceivers=function(){var ht=this,dt=at.apply(this,[]);return dt.forEach(function(ut){return ut._pc=ht}),dt}),et.wrapPeerConnectionEvent(nt,"track",function(ht){return ht.receiver._pc=ht.srcElement,ht}),nt.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},gt.shimRemoveStream=function(nt){!nt.RTCPeerConnection||"removeStream"in nt.RTCPeerConnection.prototype||(nt.RTCPeerConnection.prototype.removeStream=function(at){var ht=this;et.deprecated("removeStream","removeTrack"),this.getSenders().forEach(function(dt){dt.track&&at.getTracks().includes(dt.track)&&ht.removeTrack(dt)})})},gt.shimRTCDataChannel=function(nt){nt.DataChannel&&!nt.RTCDataChannel&&(nt.RTCDataChannel=nt.DataChannel)};var et=function(nt){if(nt&&nt.__esModule)return nt;var at={};if(nt!=null)for(var ht in nt)Object.prototype.hasOwnProperty.call(nt,ht)&&(at[ht]=nt[ht]);return at.default=nt,at}(tt("../utils"))},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0}),gt.shimGetDisplayMedia=function(rt,it){rt.navigator.mediaDevices&&"getDisplayMedia"in rt.navigator.mediaDevices||rt.navigator.mediaDevices&&(rt.navigator.mediaDevices.getDisplayMedia=function(s){if(!s||!s.video){var et=new DOMException("getDisplayMedia without video constraints is undefined");return et.name="NotFoundError",et.code=8,Promise.reject(et)}return s.video===!0?s.video={mediaSource:it}:s.video.mediaSource=it,rt.navigator.mediaDevices.getUserMedia(s)})}},{}],13:[function(tt,ct,gt){Object.defineProperty(gt,"__esModule",{value:!0});var rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};gt.shimGetUserMedia=function(s){var et=it.detectBrowser(s),nt=s&&s.navigator,at=s&&s.MediaStreamTrack;if(nt.getUserMedia=function(mt,ot,pt){it.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),nt.mediaDevices.getUserMedia(mt).then(ot,pt)},!(et.version>55&&"autoGainControl"in nt.mediaDevices.getSupportedConstraints())){var ht=function(mt,ot,pt){ot in mt&&!(pt in mt)&&(mt[pt]=mt[ot],delete mt[ot])},dt=nt.mediaDevices.getUserMedia.bind(nt.mediaDevices);if(nt.mediaDevices.getUserMedia=function(mt){return(mt===void 0?"undefined":rt(mt))==="object"&&rt(mt.audio)==="object"&&(mt=JSON.parse(JSON.stringify(mt)),ht(mt.audio,"autoGainControl","mozAutoGainControl"),ht(mt.audio,"noiseSuppression","mozNoiseSuppression")),dt(mt)},at&&at.prototype.getSettings){var ut=at.prototype.getSettings;at.prototype.getSettings=function(){var mt=ut.apply(this,arguments);return ht(mt,"mozAutoGainControl","autoGainControl"),ht(mt,"mozNoiseSuppression","noiseSuppression"),mt}}if(at&&at.prototype.applyConstraints){var lt=at.prototype.applyConstraints;at.prototype.applyConstraints=function(mt){return this.kind==="audio"&&(mt===void 0?"undefined":rt(mt))==="object"&&(mt=JSON.parse(JSON.stringify(mt)),ht(mt,"autoGainControl","mozAutoGainControl"),ht(mt,"noiseSuppression","mozNoiseSuppression")),lt.apply(this,[mt])}}}};var it=function(s){if(s&&s.__esModule)return s;var et={};if(s!=null)for(var nt in s)Object.prototype.hasOwnProperty.call(s,nt)&&(et[nt]=s[nt]);return et.default=s,et}(tt("../utils"))},{"../utils":15}],14:[function(tt,ct,gt){function rt(et){return et&&et.video!==void 0?Object.assign({},et,{video:s.compactObject(et.video)}):et}Object.defineProperty(gt,"__esModule",{value:!0});var it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et};gt.shimLocalStreamsAPI=function(et){if((et===void 0?"undefined":it(et))==="object"&&et.RTCPeerConnection){if("getLocalStreams"in et.RTCPeerConnection.prototype||(et.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in et.RTCPeerConnection.prototype)){var nt=et.RTCPeerConnection.prototype.addTrack;et.RTCPeerConnection.prototype.addStream=function(at){var ht=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(at)||this._localStreams.push(at),at.getTracks().forEach(function(dt){return nt.call(ht,dt,at)})},et.RTCPeerConnection.prototype.addTrack=function(at,ht){return ht&&(this._localStreams?this._localStreams.includes(ht)||this._localStreams.push(ht):this._localStreams=[ht]),nt.call(this,at,ht)}}"removeStream"in et.RTCPeerConnection.prototype||(et.RTCPeerConnection.prototype.removeStream=function(at){var ht=this;this._localStreams||(this._localStreams=[]);var dt=this._localStreams.indexOf(at);if(dt!==-1){this._localStreams.splice(dt,1);var ut=at.getTracks();this.getSenders().forEach(function(lt){ut.includes(lt.track)&&ht.removeTrack(lt)})}})}},gt.shimRemoteStreamsAPI=function(et){if((et===void 0?"undefined":it(et))==="object"&&et.RTCPeerConnection&&("getRemoteStreams"in et.RTCPeerConnection.prototype||(et.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in et.RTCPeerConnection.prototype))){Object.defineProperty(et.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(at){var ht=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=at),this.addEventListener("track",this._onaddstreampoly=function(dt){dt.streams.forEach(function(ut){if(ht._remoteStreams||(ht._remoteStreams=[]),!ht._remoteStreams.includes(ut)){ht._remoteStreams.push(ut);var lt=new Event("addstream");lt.stream=ut,ht.dispatchEvent(lt)}})})}});var nt=et.RTCPeerConnection.prototype.setRemoteDescription;et.RTCPeerConnection.prototype.setRemoteDescription=function(){var at=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(ht){ht.streams.forEach(function(dt){if(at._remoteStreams||(at._remoteStreams=[]),!(at._remoteStreams.indexOf(dt)>=0)){at._remoteStreams.push(dt);var ut=new Event("addstream");ut.stream=dt,at.dispatchEvent(ut)}})}),nt.apply(at,arguments)}}},gt.shimCallbacksAPI=function(et){if((et===void 0?"undefined":it(et))==="object"&&et.RTCPeerConnection){var nt=et.RTCPeerConnection.prototype,at=nt.createOffer,ht=nt.createAnswer,dt=nt.setLocalDescription,ut=nt.setRemoteDescription,lt=nt.addIceCandidate;nt.createOffer=function(ot,pt){var ft=arguments.length>=2?arguments[2]:arguments[0],yt=at.apply(this,[ft]);return pt?(yt.then(ot,pt),Promise.resolve()):yt},nt.createAnswer=function(ot,pt){var ft=arguments.length>=2?arguments[2]:arguments[0],yt=ht.apply(this,[ft]);return pt?(yt.then(ot,pt),Promise.resolve()):yt};var mt=function(ot,pt,ft){var yt=dt.apply(this,[ot]);return ft?(yt.then(pt,ft),Promise.resolve()):yt};nt.setLocalDescription=mt,mt=function(ot,pt,ft){var yt=ut.apply(this,[ot]);return ft?(yt.then(pt,ft),Promise.resolve()):yt},nt.setRemoteDescription=mt,mt=function(ot,pt,ft){var yt=lt.apply(this,[ot]);return ft?(yt.then(pt,ft),Promise.resolve()):yt},nt.addIceCandidate=mt}},gt.shimGetUserMedia=function(et){var nt=et&&et.navigator;if(nt.mediaDevices&&nt.mediaDevices.getUserMedia){var at=nt.mediaDevices,ht=at.getUserMedia.bind(at);nt.mediaDevices.getUserMedia=function(dt){return ht(rt(dt))}}!nt.getUserMedia&&nt.mediaDevices&&nt.mediaDevices.getUserMedia&&(nt.getUserMedia=(function(dt,ut,lt){nt.mediaDevices.getUserMedia(dt).then(ut,lt)}).bind(nt))},gt.shimConstraints=rt,gt.shimRTCIceServerUrls=function(et){var nt=et.RTCPeerConnection;et.RTCPeerConnection=function(at,ht){if(at&&at.iceServers){for(var dt=[],ut=0;ut=lt&&parseInt(mt[lt],10)}function s(dt){return(dt===void 0?"undefined":nt(dt))!=="object"?dt:Object.keys(dt).reduce(function(ut,lt){var mt=nt(dt[lt])==="object",ot=mt?s(dt[lt]):dt[lt],pt=mt&&!Object.keys(ot).length;return ot===void 0||pt?ut:Object.assign(ut,rt({},lt,ot))},{})}function et(dt,ut,lt){ut&&!lt.has(ut.id)&&(lt.set(ut.id,ut),Object.keys(ut).forEach(function(mt){mt.endsWith("Id")?et(dt,dt.get(ut[mt]),lt):mt.endsWith("Ids")&&ut[mt].forEach(function(ot){et(dt,dt.get(ot),lt)})}))}Object.defineProperty(gt,"__esModule",{value:!0});var nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(dt){return typeof dt}:function(dt){return dt&&typeof Symbol=="function"&&dt.constructor===Symbol&&dt!==Symbol.prototype?"symbol":typeof dt};gt.extractVersion=it,gt.wrapPeerConnectionEvent=function(dt,ut,lt){if(dt.RTCPeerConnection){var mt=dt.RTCPeerConnection.prototype,ot=mt.addEventListener;mt.addEventListener=function(ft,yt){if(ft!==ut)return ot.apply(this,arguments);var vt=function(bt){var At=lt(bt);At&&yt(At)};return this._eventMap=this._eventMap||{},this._eventMap[yt]=vt,ot.apply(this,[ft,vt])};var pt=mt.removeEventListener;mt.removeEventListener=function(ft,yt){if(ft!==ut||!this._eventMap||!this._eventMap[yt])return pt.apply(this,arguments);var vt=this._eventMap[yt];return delete this._eventMap[yt],pt.apply(this,[ft,vt])},Object.defineProperty(mt,"on"+ut,{get:function(){return this["_on"+ut]},set:function(ft){this["_on"+ut]&&(this.removeEventListener(ut,this["_on"+ut]),delete this["_on"+ut]),ft&&this.addEventListener(ut,this["_on"+ut]=ft)},enumerable:!0,configurable:!0})}},gt.disableLog=function(dt){return typeof dt!="boolean"?new Error("Argument type: "+(dt===void 0?"undefined":nt(dt))+". Please use a boolean."):(at=dt,dt?"adapter.js logging disabled":"adapter.js logging enabled")},gt.disableWarnings=function(dt){return typeof dt!="boolean"?new Error("Argument type: "+(dt===void 0?"undefined":nt(dt))+". Please use a boolean."):(ht=!dt,"adapter.js deprecation warnings "+(dt?"disabled":"enabled"))},gt.log=function(){if((typeof window>"u"?"undefined":nt(window))==="object"){if(at)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}},gt.deprecated=function(dt,ut){ht&&console.warn(dt+" is deprecated, please use "+ut+" instead.")},gt.detectBrowser=function(dt){var ut=dt.navigator,lt={browser:null,version:null};if(dt===void 0||!dt.navigator)return lt.browser="Not a browser.",lt;if(ut.mozGetUserMedia)lt.browser="firefox",lt.version=it(ut.userAgent,/Firefox\/(\d+)\./,1);else if(ut.webkitGetUserMedia||dt.isSecureContext===!1&&dt.webkitRTCPeerConnection&&!dt.RTCIceGatherer)lt.browser="chrome",lt.version=it(ut.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(ut.mediaDevices&&ut.userAgent.match(/Edge\/(\d+).(\d+)$/))lt.browser="edge",lt.version=it(ut.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!dt.RTCPeerConnection||!ut.userAgent.match(/AppleWebKit\/(\d+)\./))return lt.browser="Not a supported browser.",lt;lt.browser="safari",lt.version=it(ut.userAgent,/AppleWebKit\/(\d+)\./,1)}return lt},gt.compactObject=s,gt.walkStats=et,gt.filterStats=function(dt,ut,lt){var mt=lt?"outbound-rtp":"inbound-rtp",ot=new Map;if(ut===null)return ot;var pt=[];return dt.forEach(function(ft){ft.type==="track"&&ft.trackIdentifier===ut.id&&pt.push(ft)}),pt.forEach(function(ft){dt.forEach(function(yt){yt.type===mt&&yt.trackId===ft.id&&et(dt,yt,ot)})}),ot};var at=!0,ht=!0},{}],16:[function(tt,ct,gt){function rt(ut){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[ut.type]||ut.type}function it(ut,lt,mt,ot,pt){var ft=dt.writeRtpDescription(ut.kind,lt);if(ft+=dt.writeIceParameters(ut.iceGatherer.getLocalParameters()),ft+=dt.writeDtlsParameters(ut.dtlsTransport.getLocalParameters(),mt==="offer"?"actpass":pt||"active"),ft+="a=mid:"+ut.mid+`\r
-`,ut.rtpSender&&ut.rtpReceiver?ft+=`a=sendrecv\r
-`:ut.rtpSender?ft+=`a=sendonly\r
-`:ut.rtpReceiver?ft+=`a=recvonly\r
-`:ft+=`a=inactive\r
-`,ut.rtpSender){var yt=ut.rtpSender._initialTrackId||ut.rtpSender.track.id;ut.rtpSender._initialTrackId=yt;var vt="msid:"+(ot?ot.id:"-")+" "+yt+`\r
-`;ft+="a="+vt,ft+="a=ssrc:"+ut.sendEncodingParameters[0].ssrc+" "+vt,ut.sendEncodingParameters[0].rtx&&(ft+="a=ssrc:"+ut.sendEncodingParameters[0].rtx.ssrc+" "+vt,ft+="a=ssrc-group:FID "+ut.sendEncodingParameters[0].ssrc+" "+ut.sendEncodingParameters[0].rtx.ssrc+`\r
-`)}return ft+="a=ssrc:"+ut.sendEncodingParameters[0].ssrc+" cname:"+dt.localCName+`\r
-`,ut.rtpSender&&ut.sendEncodingParameters[0].rtx&&(ft+="a=ssrc:"+ut.sendEncodingParameters[0].rtx.ssrc+" cname:"+dt.localCName+`\r
-`),ft}function s(ut,lt){var mt=!1;return(ut=JSON.parse(JSON.stringify(ut))).filter(function(ot){if(ot&&(ot.urls||ot.url)){var pt=ot.urls||ot.url;ot.url&&!ot.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var ft=typeof pt=="string";return ft&&(pt=[pt]),pt=pt.filter(function(yt){return yt.indexOf("turn:")===0&&yt.indexOf("transport=udp")!==-1&&yt.indexOf("turn:[")===-1&&!mt?(mt=!0,!0):yt.indexOf("stun:")===0&<>=14393&&yt.indexOf("?transport=udp")===-1}),delete ot.url,ot.urls=ft?pt[0]:pt,!!pt.length}})}function et(ut,lt){var mt={codecs:[],headerExtensions:[],fecMechanisms:[]},ot=function(ft,yt){ft=parseInt(ft,10);for(var vt=0;vt0;Nt--)this._iceGatherers.push(new ut.RTCIceGatherer({iceServers:vt.iceServers,gatherPolicy:vt.iceTransportPolicy}));else vt.iceCandidatePoolSize=0;this._config=vt,this.transceivers=[],this._sdpSessionId=dt.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(ft.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(ft.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),ft.prototype.onicecandidate=null,ft.prototype.onaddstream=null,ft.prototype.ontrack=null,ft.prototype.onremovestream=null,ft.prototype.onsignalingstatechange=null,ft.prototype.oniceconnectionstatechange=null,ft.prototype.onconnectionstatechange=null,ft.prototype.onicegatheringstatechange=null,ft.prototype.onnegotiationneeded=null,ft.prototype.ondatachannel=null,ft.prototype._dispatchEvent=function(vt,bt){this._isClosed||(this.dispatchEvent(bt),typeof this["on"+vt]=="function"&&this["on"+vt](bt))},ft.prototype._emitGatheringStateChange=function(){var vt=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",vt)},ft.prototype.getConfiguration=function(){return this._config},ft.prototype.getLocalStreams=function(){return this.localStreams},ft.prototype.getRemoteStreams=function(){return this.remoteStreams},ft.prototype._createTransceiver=function(vt,bt){var At=this.transceivers.length>0,Nt={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:vt,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&At)Nt.iceTransport=this.transceivers[0].iceTransport,Nt.dtlsTransport=this.transceivers[0].dtlsTransport;else{var St=this._createIceAndDtlsTransports();Nt.iceTransport=St.iceTransport,Nt.dtlsTransport=St.dtlsTransport}return bt||this.transceivers.push(Nt),Nt},ft.prototype.addTrack=function(vt,bt){if(this._isClosed)throw ht("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");if(this.transceivers.find(function(St){return St.track===vt}))throw ht("InvalidAccessError","Track already exists.");for(var At,Nt=0;Nt=15025)vt.getTracks().forEach(function(Nt){bt.addTrack(Nt,vt)});else{var At=vt.clone();vt.getTracks().forEach(function(Nt,St){var wt=At.getTracks()[St];Nt.addEventListener("enabled",function(Mt){wt.enabled=Mt.enabled})}),At.getTracks().forEach(function(Nt){bt.addTrack(Nt,At)})}},ft.prototype.removeTrack=function(vt){if(this._isClosed)throw ht("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(vt instanceof ut.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var bt=this.transceivers.find(function(Nt){return Nt.rtpSender===vt});if(!bt)throw ht("InvalidAccessError","Sender was not created by this connection.");var At=bt.stream;bt.rtpSender.stop(),bt.rtpSender=null,bt.track=null,bt.stream=null,this.transceivers.map(function(Nt){return Nt.stream}).indexOf(At)===-1&&this.localStreams.indexOf(At)>-1&&this.localStreams.splice(this.localStreams.indexOf(At),1),this._maybeFireNegotiationNeeded()},ft.prototype.removeStream=function(vt){var bt=this;vt.getTracks().forEach(function(At){var Nt=bt.getSenders().find(function(St){return St.track===At});Nt&&bt.removeTrack(Nt)})},ft.prototype.getSenders=function(){return this.transceivers.filter(function(vt){return!!vt.rtpSender}).map(function(vt){return vt.rtpSender})},ft.prototype.getReceivers=function(){return this.transceivers.filter(function(vt){return!!vt.rtpReceiver}).map(function(vt){return vt.rtpReceiver})},ft.prototype._createIceGatherer=function(vt,bt){var At=this;if(bt&&vt>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var Nt=new ut.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(Nt,"state",{value:"new",writable:!0}),this.transceivers[vt].bufferedCandidateEvents=[],this.transceivers[vt].bufferCandidates=function(St){var wt=!St.candidate||Object.keys(St.candidate).length===0;Nt.state=wt?"completed":"gathering",At.transceivers[vt].bufferedCandidateEvents!==null&&At.transceivers[vt].bufferedCandidateEvents.push(St)},Nt.addEventListener("localcandidate",this.transceivers[vt].bufferCandidates),Nt},ft.prototype._gather=function(vt,bt){var At=this,Nt=this.transceivers[bt].iceGatherer;if(!Nt.onlocalcandidate){var St=this.transceivers[bt].bufferedCandidateEvents;this.transceivers[bt].bufferedCandidateEvents=null,Nt.removeEventListener("localcandidate",this.transceivers[bt].bufferCandidates),Nt.onlocalcandidate=function(wt){if(!(At.usingBundle&&bt>0)){var Mt=new Event("icecandidate");Mt.candidate={sdpMid:vt,sdpMLineIndex:bt};var Ht=wt.candidate,Ot=!Ht||Object.keys(Ht).length===0;if(Ot)Nt.state!=="new"&&Nt.state!=="gathering"||(Nt.state="completed");else{Nt.state==="new"&&(Nt.state="gathering"),Ht.component=1,Ht.ufrag=Nt.getLocalParameters().usernameFragment;var Dt=dt.writeCandidate(Ht);Mt.candidate=Object.assign(Mt.candidate,dt.parseCandidate(Dt)),Mt.candidate.candidate=Dt,Mt.candidate.toJSON=function(){return{candidate:Mt.candidate.candidate,sdpMid:Mt.candidate.sdpMid,sdpMLineIndex:Mt.candidate.sdpMLineIndex,usernameFragment:Mt.candidate.usernameFragment}}}var Gt=dt.getMediaSections(At._localDescription.sdp);Gt[Mt.candidate.sdpMLineIndex]+=Ot?`a=end-of-candidates\r
-`:"a="+Mt.candidate.candidate+`\r
-`,At._localDescription.sdp=dt.getDescription(At._localDescription.sdp)+Gt.join("");var nn=At.transceivers.every(function(zt){return zt.iceGatherer&&zt.iceGatherer.state==="completed"});At.iceGatheringState!=="gathering"&&(At.iceGatheringState="gathering",At._emitGatheringStateChange()),Ot||At._dispatchEvent("icecandidate",Mt),nn&&(At._dispatchEvent("icecandidate",new Event("icecandidate")),At.iceGatheringState="complete",At._emitGatheringStateChange())}},ut.setTimeout(function(){St.forEach(function(wt){Nt.onlocalcandidate(wt)})},0)}},ft.prototype._createIceAndDtlsTransports=function(){var vt=this,bt=new ut.RTCIceTransport(null);bt.onicestatechange=function(){vt._updateIceConnectionState(),vt._updateConnectionState()};var At=new ut.RTCDtlsTransport(bt);return At.ondtlsstatechange=function(){vt._updateConnectionState()},At.onerror=function(){Object.defineProperty(At,"state",{value:"failed",writable:!0}),vt._updateConnectionState()},{iceTransport:bt,dtlsTransport:At}},ft.prototype._disposeIceAndDtlsTransports=function(vt){var bt=this.transceivers[vt].iceGatherer;bt&&(delete bt.onlocalcandidate,delete this.transceivers[vt].iceGatherer);var At=this.transceivers[vt].iceTransport;At&&(delete At.onicestatechange,delete this.transceivers[vt].iceTransport);var Nt=this.transceivers[vt].dtlsTransport;Nt&&(delete Nt.ondtlsstatechange,delete Nt.onerror,delete this.transceivers[vt].dtlsTransport)},ft.prototype._transceive=function(vt,bt,At){var Nt=et(vt.localCapabilities,vt.remoteCapabilities);bt&&vt.rtpSender&&(Nt.encodings=vt.sendEncodingParameters,Nt.rtcp={cname:dt.localCName,compound:vt.rtcpParameters.compound},vt.recvEncodingParameters.length&&(Nt.rtcp.ssrc=vt.recvEncodingParameters[0].ssrc),vt.rtpSender.send(Nt)),At&&vt.rtpReceiver&&Nt.codecs.length>0&&(vt.kind==="video"&&vt.recvEncodingParameters&<<15019&&vt.recvEncodingParameters.forEach(function(St){delete St.rtx}),vt.recvEncodingParameters.length?Nt.encodings=vt.recvEncodingParameters:Nt.encodings=[{}],Nt.rtcp={compound:vt.rtcpParameters.compound},vt.rtcpParameters.cname&&(Nt.rtcp.cname=vt.rtcpParameters.cname),vt.sendEncodingParameters.length&&(Nt.rtcp.ssrc=vt.sendEncodingParameters[0].ssrc),vt.rtpReceiver.receive(Nt))},ft.prototype.setLocalDescription=function(vt){var bt=this;if(["offer","answer"].indexOf(vt.type)===-1)return Promise.reject(ht("TypeError",'Unsupported type "'+vt.type+'"'));if(!nt("setLocalDescription",vt.type,bt.signalingState)||bt._isClosed)return Promise.reject(ht("InvalidStateError","Can not set local "+vt.type+" in state "+bt.signalingState));var At,Nt;if(vt.type==="offer")At=dt.splitSections(vt.sdp),Nt=At.shift(),At.forEach(function(wt,Mt){var Ht=dt.parseRtpParameters(wt);bt.transceivers[Mt].localCapabilities=Ht}),bt.transceivers.forEach(function(wt,Mt){bt._gather(wt.mid,Mt)});else if(vt.type==="answer"){At=dt.splitSections(bt._remoteDescription.sdp),Nt=At.shift();var St=dt.matchPrefix(Nt,"a=ice-lite").length>0;At.forEach(function(wt,Mt){var Ht=bt.transceivers[Mt],Ot=Ht.iceGatherer,Dt=Ht.iceTransport,Gt=Ht.dtlsTransport,nn=Ht.localCapabilities,zt=Ht.remoteCapabilities;if(!(dt.isRejected(wt)&&dt.matchPrefix(wt,"a=bundle-only").length===0)&&!Ht.rejected){var Ft=dt.getIceParameters(wt,Nt),un=dt.getDtlsParameters(wt,Nt);St&&(un.role="server"),bt.usingBundle&&Mt!==0||(bt._gather(Ht.mid,Mt),Dt.state==="new"&&Dt.start(Ot,Ft,St?"controlling":"controlled"),Gt.state==="new"&&Gt.start(un));var vn=et(nn,zt);bt._transceive(Ht,vn.codecs.length>0,!1)}})}return bt._localDescription={type:vt.type,sdp:vt.sdp},vt.type==="offer"?bt._updateSignalingState("have-local-offer"):bt._updateSignalingState("stable"),Promise.resolve()},ft.prototype.setRemoteDescription=function(vt){var bt=this;if(["offer","answer"].indexOf(vt.type)===-1)return Promise.reject(ht("TypeError",'Unsupported type "'+vt.type+'"'));if(!nt("setRemoteDescription",vt.type,bt.signalingState)||bt._isClosed)return Promise.reject(ht("InvalidStateError","Can not set remote "+vt.type+" in state "+bt.signalingState));var At={};bt.remoteStreams.forEach(function(Dt){At[Dt.id]=Dt});var Nt=[],St=dt.splitSections(vt.sdp),wt=St.shift(),Mt=dt.matchPrefix(wt,"a=ice-lite").length>0,Ht=dt.matchPrefix(wt,"a=group:BUNDLE ").length>0;bt.usingBundle=Ht;var Ot=dt.matchPrefix(wt,"a=ice-options:")[0];return bt.canTrickleIceCandidates=!!Ot&&Ot.substr(14).split(" ").indexOf("trickle")>=0,St.forEach(function(Dt,Gt){var nn=dt.splitLines(Dt),zt=dt.getKind(Dt),Ft=dt.isRejected(Dt)&&dt.matchPrefix(Dt,"a=bundle-only").length===0,un=nn[0].substr(2).split(" ")[2],vn=dt.getDirection(Dt,wt),yn=dt.parseMsid(Dt),cn=dt.getMid(Dt)||dt.generateIdentifier();if(Ft||zt==="application"&&(un==="DTLS/SCTP"||un==="UDP/DTLS/SCTP"))bt.transceivers[Gt]={mid:cn,kind:zt,protocol:un,rejected:!0};else{!Ft&&bt.transceivers[Gt]&&bt.transceivers[Gt].rejected&&(bt.transceivers[Gt]=bt._createTransceiver(zt,!0));var gn,bn,fn,Tn,_n,Un,Pn,In,Rn,On,Ln,qn=dt.parseRtpParameters(Dt);Ft||(On=dt.getIceParameters(Dt,wt),(Ln=dt.getDtlsParameters(Dt,wt)).role="client"),Pn=dt.parseRtpEncodingParameters(Dt);var jn=dt.parseRtcpParameters(Dt),Fn=dt.matchPrefix(Dt,"a=end-of-candidates",wt).length>0,Zn=dt.matchPrefix(Dt,"a=candidate:").map(function(Bn){return dt.parseCandidate(Bn)}).filter(function(Bn){return Bn.component===1});if((vt.type==="offer"||vt.type==="answer")&&!Ft&&Ht&&Gt>0&&bt.transceivers[Gt]&&(bt._disposeIceAndDtlsTransports(Gt),bt.transceivers[Gt].iceGatherer=bt.transceivers[0].iceGatherer,bt.transceivers[Gt].iceTransport=bt.transceivers[0].iceTransport,bt.transceivers[Gt].dtlsTransport=bt.transceivers[0].dtlsTransport,bt.transceivers[Gt].rtpSender&&bt.transceivers[Gt].rtpSender.setTransport(bt.transceivers[0].dtlsTransport),bt.transceivers[Gt].rtpReceiver&&bt.transceivers[Gt].rtpReceiver.setTransport(bt.transceivers[0].dtlsTransport)),vt.type!=="offer"||Ft)vt.type!=="answer"||Ft||(bn=(gn=bt.transceivers[Gt]).iceGatherer,fn=gn.iceTransport,Tn=gn.dtlsTransport,_n=gn.rtpReceiver,Un=gn.sendEncodingParameters,In=gn.localCapabilities,bt.transceivers[Gt].recvEncodingParameters=Pn,bt.transceivers[Gt].remoteCapabilities=qn,bt.transceivers[Gt].rtcpParameters=jn,Zn.length&&fn.state==="new"&&(!Mt&&!Fn||Ht&&Gt!==0?Zn.forEach(function(Bn){at(gn.iceTransport,Bn)}):fn.setRemoteCandidates(Zn)),Ht&&Gt!==0||(fn.state==="new"&&fn.start(bn,On,"controlling"),Tn.state==="new"&&Tn.start(Ln)),!et(gn.localCapabilities,gn.remoteCapabilities).codecs.filter(function(Bn){return Bn.name.toLowerCase()==="rtx"}).length&&gn.sendEncodingParameters[0].rtx&&delete gn.sendEncodingParameters[0].rtx,bt._transceive(gn,vn==="sendrecv"||vn==="recvonly",vn==="sendrecv"||vn==="sendonly"),!_n||vn!=="sendrecv"&&vn!=="sendonly"?delete gn.rtpReceiver:(Rn=_n.track,yn?(At[yn.stream]||(At[yn.stream]=new ut.MediaStream),mt(Rn,At[yn.stream]),Nt.push([Rn,_n,At[yn.stream]])):(At.default||(At.default=new ut.MediaStream),mt(Rn,At.default),Nt.push([Rn,_n,At.default]))));else{(gn=bt.transceivers[Gt]||bt._createTransceiver(zt)).mid=cn,gn.iceGatherer||(gn.iceGatherer=bt._createIceGatherer(Gt,Ht)),Zn.length&&gn.iceTransport.state==="new"&&(!Fn||Ht&&Gt!==0?Zn.forEach(function(Bn){at(gn.iceTransport,Bn)}):gn.iceTransport.setRemoteCandidates(Zn)),In=ut.RTCRtpReceiver.getCapabilities(zt),lt<15019&&(In.codecs=In.codecs.filter(function(Bn){return Bn.name!=="rtx"})),Un=gn.sendEncodingParameters||[{ssrc:1001*(2*Gt+2)}];var on=!1;if(vn==="sendrecv"||vn==="sendonly"){if(on=!gn.rtpReceiver,_n=gn.rtpReceiver||new ut.RTCRtpReceiver(gn.dtlsTransport,zt),on){var Hn;Rn=_n.track,yn&&yn.stream==="-"||(yn?(At[yn.stream]||(At[yn.stream]=new ut.MediaStream,Object.defineProperty(At[yn.stream],"id",{get:function(){return yn.stream}})),Object.defineProperty(Rn,"id",{get:function(){return yn.track}}),Hn=At[yn.stream]):(At.default||(At.default=new ut.MediaStream),Hn=At.default)),Hn&&(mt(Rn,Hn),gn.associatedRemoteMediaStreams.push(Hn)),Nt.push([Rn,_n,Hn])}}else gn.rtpReceiver&&gn.rtpReceiver.track&&(gn.associatedRemoteMediaStreams.forEach(function(Bn){var zn=Bn.getTracks().find(function($n){return $n.id===gn.rtpReceiver.track.id});zn&&ot(zn,Bn)}),gn.associatedRemoteMediaStreams=[]);gn.localCapabilities=In,gn.remoteCapabilities=qn,gn.rtpReceiver=_n,gn.rtcpParameters=jn,gn.sendEncodingParameters=Un,gn.recvEncodingParameters=Pn,bt._transceive(bt.transceivers[Gt],!1,on)}}}),bt._dtlsRole===void 0&&(bt._dtlsRole=vt.type==="offer"?"active":"passive"),bt._remoteDescription={type:vt.type,sdp:vt.sdp},vt.type==="offer"?bt._updateSignalingState("have-remote-offer"):bt._updateSignalingState("stable"),Object.keys(At).forEach(function(Dt){var Gt=At[Dt];if(Gt.getTracks().length){if(bt.remoteStreams.indexOf(Gt)===-1){bt.remoteStreams.push(Gt);var nn=new Event("addstream");nn.stream=Gt,ut.setTimeout(function(){bt._dispatchEvent("addstream",nn)})}Nt.forEach(function(zt){var Ft=zt[0],un=zt[1];Gt.id===zt[2].id&&pt(bt,Ft,un,[Gt])})}}),Nt.forEach(function(Dt){Dt[2]||pt(bt,Dt[0],Dt[1],[])}),ut.setTimeout(function(){bt&&bt.transceivers&&bt.transceivers.forEach(function(Dt){Dt.iceTransport&&Dt.iceTransport.state==="new"&&Dt.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),Dt.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},ft.prototype.close=function(){this.transceivers.forEach(function(vt){vt.iceTransport&&vt.iceTransport.stop(),vt.dtlsTransport&&vt.dtlsTransport.stop(),vt.rtpSender&&vt.rtpSender.stop(),vt.rtpReceiver&&vt.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},ft.prototype._updateSignalingState=function(vt){this.signalingState=vt;var bt=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",bt)},ft.prototype._maybeFireNegotiationNeeded=function(){var vt=this;this.signalingState==="stable"&&this.needNegotiation!==!0&&(this.needNegotiation=!0,ut.setTimeout(function(){if(vt.needNegotiation){vt.needNegotiation=!1;var bt=new Event("negotiationneeded");vt._dispatchEvent("negotiationneeded",bt)}},0))},ft.prototype._updateIceConnectionState=function(){var vt,bt={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(Nt){Nt.iceTransport&&!Nt.rejected&&bt[Nt.iceTransport.state]++}),vt="new",bt.failed>0?vt="failed":bt.checking>0?vt="checking":bt.disconnected>0?vt="disconnected":bt.new>0?vt="new":bt.connected>0?vt="connected":bt.completed>0&&(vt="completed"),vt!==this.iceConnectionState){this.iceConnectionState=vt;var At=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",At)}},ft.prototype._updateConnectionState=function(){var vt,bt={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(Nt){Nt.iceTransport&&Nt.dtlsTransport&&!Nt.rejected&&(bt[Nt.iceTransport.state]++,bt[Nt.dtlsTransport.state]++)}),bt.connected+=bt.completed,vt="new",bt.failed>0?vt="failed":bt.connecting>0?vt="connecting":bt.disconnected>0?vt="disconnected":bt.new>0?vt="new":bt.connected>0&&(vt="connected"),vt!==this.connectionState){this.connectionState=vt;var At=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",At)}},ft.prototype.createOffer=function(){var vt=this;if(vt._isClosed)return Promise.reject(ht("InvalidStateError","Can not call createOffer after close"));var bt=vt.transceivers.filter(function(Mt){return Mt.kind==="audio"}).length,At=vt.transceivers.filter(function(Mt){return Mt.kind==="video"}).length,Nt=arguments[0];if(Nt){if(Nt.mandatory||Nt.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");Nt.offerToReceiveAudio!==void 0&&(bt=Nt.offerToReceiveAudio===!0?1:Nt.offerToReceiveAudio===!1?0:Nt.offerToReceiveAudio),Nt.offerToReceiveVideo!==void 0&&(At=Nt.offerToReceiveVideo===!0?1:Nt.offerToReceiveVideo===!1?0:Nt.offerToReceiveVideo)}for(vt.transceivers.forEach(function(Mt){Mt.kind==="audio"?--bt<0&&(Mt.wantReceive=!1):Mt.kind==="video"&&--At<0&&(Mt.wantReceive=!1)});bt>0||At>0;)bt>0&&(vt._createTransceiver("audio"),bt--),At>0&&(vt._createTransceiver("video"),At--);var St=dt.writeSessionBoilerplate(vt._sdpSessionId,vt._sdpSessionVersion++);vt.transceivers.forEach(function(Mt,Ht){var Ot=Mt.track,Dt=Mt.kind,Gt=Mt.mid||dt.generateIdentifier();Mt.mid=Gt,Mt.iceGatherer||(Mt.iceGatherer=vt._createIceGatherer(Ht,vt.usingBundle));var nn=ut.RTCRtpSender.getCapabilities(Dt);lt<15019&&(nn.codecs=nn.codecs.filter(function(Ft){return Ft.name!=="rtx"})),nn.codecs.forEach(function(Ft){Ft.name==="H264"&&Ft.parameters["level-asymmetry-allowed"]===void 0&&(Ft.parameters["level-asymmetry-allowed"]="1"),Mt.remoteCapabilities&&Mt.remoteCapabilities.codecs&&Mt.remoteCapabilities.codecs.forEach(function(un){Ft.name.toLowerCase()===un.name.toLowerCase()&&Ft.clockRate===un.clockRate&&(Ft.preferredPayloadType=un.payloadType)})}),nn.headerExtensions.forEach(function(Ft){(Mt.remoteCapabilities&&Mt.remoteCapabilities.headerExtensions||[]).forEach(function(un){Ft.uri===un.uri&&(Ft.id=un.id)})});var zt=Mt.sendEncodingParameters||[{ssrc:1001*(2*Ht+1)}];Ot&<>=15019&&Dt==="video"&&!zt[0].rtx&&(zt[0].rtx={ssrc:zt[0].ssrc+1}),Mt.wantReceive&&(Mt.rtpReceiver=new ut.RTCRtpReceiver(Mt.dtlsTransport,Dt)),Mt.localCapabilities=nn,Mt.sendEncodingParameters=zt}),vt._config.bundlePolicy!=="max-compat"&&(St+="a=group:BUNDLE "+vt.transceivers.map(function(Mt){return Mt.mid}).join(" ")+`\r
-`),St+=`a=ice-options:trickle\r
-`,vt.transceivers.forEach(function(Mt,Ht){St+=it(Mt,Mt.localCapabilities,"offer",Mt.stream,vt._dtlsRole),St+=`a=rtcp-rsize\r
-`,!Mt.iceGatherer||vt.iceGatheringState==="new"||Ht!==0&&vt.usingBundle||(Mt.iceGatherer.getLocalCandidates().forEach(function(Ot){Ot.component=1,St+="a="+dt.writeCandidate(Ot)+`\r
-`}),Mt.iceGatherer.state==="completed"&&(St+=`a=end-of-candidates\r
-`))});var wt=new ut.RTCSessionDescription({type:"offer",sdp:St});return Promise.resolve(wt)},ft.prototype.createAnswer=function(){var vt=this;if(vt._isClosed)return Promise.reject(ht("InvalidStateError","Can not call createAnswer after close"));if(vt.signalingState!=="have-remote-offer"&&vt.signalingState!=="have-local-pranswer")return Promise.reject(ht("InvalidStateError","Can not call createAnswer in signalingState "+vt.signalingState));var bt=dt.writeSessionBoilerplate(vt._sdpSessionId,vt._sdpSessionVersion++);vt.usingBundle&&(bt+="a=group:BUNDLE "+vt.transceivers.map(function(St){return St.mid}).join(" ")+`\r
-`),bt+=`a=ice-options:trickle\r
-`;var At=dt.getMediaSections(vt._remoteDescription.sdp).length;vt.transceivers.forEach(function(St,wt){if(!(wt+1>At)){if(St.rejected)return St.kind==="application"?St.protocol==="DTLS/SCTP"?bt+=`m=application 0 DTLS/SCTP 5000\r
-`:bt+="m=application 0 "+St.protocol+` webrtc-datachannel\r
-`:St.kind==="audio"?bt+=`m=audio 0 UDP/TLS/RTP/SAVPF 0\r
-a=rtpmap:0 PCMU/8000\r
-`:St.kind==="video"&&(bt+=`m=video 0 UDP/TLS/RTP/SAVPF 120\r
-a=rtpmap:120 VP8/90000\r
-`),void(bt+=`c=IN IP4 0.0.0.0\r
-a=inactive\r
-a=mid:`+St.mid+`\r
-`);if(St.stream){var Mt;St.kind==="audio"?Mt=St.stream.getAudioTracks()[0]:St.kind==="video"&&(Mt=St.stream.getVideoTracks()[0]),Mt&<>=15019&&St.kind==="video"&&!St.sendEncodingParameters[0].rtx&&(St.sendEncodingParameters[0].rtx={ssrc:St.sendEncodingParameters[0].ssrc+1})}var Ht=et(St.localCapabilities,St.remoteCapabilities);!Ht.codecs.filter(function(Ot){return Ot.name.toLowerCase()==="rtx"}).length&&St.sendEncodingParameters[0].rtx&&delete St.sendEncodingParameters[0].rtx,bt+=it(St,Ht,"answer",St.stream,vt._dtlsRole),St.rtcpParameters&&St.rtcpParameters.reducedSize&&(bt+=`a=rtcp-rsize\r
-`)}});var Nt=new ut.RTCSessionDescription({type:"answer",sdp:bt});return Promise.resolve(Nt)},ft.prototype.addIceCandidate=function(vt){var bt,At=this;return vt&&vt.sdpMLineIndex===void 0&&!vt.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(Nt,St){if(!At._remoteDescription)return St(ht("InvalidStateError","Can not add ICE candidate without a remote description"));if(vt&&vt.candidate!==""){var wt=vt.sdpMLineIndex;if(vt.sdpMid){for(var Mt=0;Mt0?dt.parseCandidate(vt.candidate):{};if(Ot.protocol==="tcp"&&(Ot.port===0||Ot.port===9)||Ot.component&&Ot.component!==1)return Nt();if((wt===0||wt>0&&Ht.iceTransport!==At.transceivers[0].iceTransport)&&!at(Ht.iceTransport,Ot))return St(ht("OperationError","Can not add ICE candidate"));var Dt=vt.candidate.trim();Dt.indexOf("a=")===0&&(Dt=Dt.substr(2)),(bt=dt.getMediaSections(At._remoteDescription.sdp))[wt]+="a="+(Ot.type?Dt:"end-of-candidates")+`\r
-`,At._remoteDescription.sdp=dt.getDescription(At._remoteDescription.sdp)+bt.join("")}else for(var Gt=0;Gt0?"m="+s:s).trim()+`\r
-`})},rt.getDescription=function(it){var s=rt.splitSections(it);return s&&s[0]},rt.getMediaSections=function(it){var s=rt.splitSections(it);return s.shift(),s},rt.matchPrefix=function(it,s){return rt.splitLines(it).filter(function(et){return et.indexOf(s)===0})},rt.parseCandidate=function(it){for(var s,et={foundation:(s=it.indexOf("a=candidate:")===0?it.substring(12).split(" "):it.substring(10).split(" "))[0],component:parseInt(s[1],10),protocol:s[2].toLowerCase(),priority:parseInt(s[3],10),ip:s[4],address:s[4],port:parseInt(s[5],10),type:s[7]},nt=8;nt0?s[0].split("/")[1]:"sendrecv",uri:s[1]}},rt.writeExtmap=function(it){return"a=extmap:"+(it.id||it.preferredId)+(it.direction&&it.direction!=="sendrecv"?"/"+it.direction:"")+" "+it.uri+`\r
-`},rt.parseFmtp=function(it){for(var s,et={},nt=it.substr(it.indexOf(" ")+1).split(";"),at=0;at-1?(et.attribute=it.substr(s+1,nt-s-1),et.value=it.substr(nt+1)):et.attribute=it.substr(s+1),et},rt.parseSsrcGroup=function(it){var s=it.substr(13).split(" ");return{semantics:s.shift(),ssrcs:s.map(function(et){return parseInt(et,10)})}},rt.getMid=function(it){var s=rt.matchPrefix(it,"a=mid:")[0];if(s)return s.substr(6)},rt.parseFingerprint=function(it){var s=it.substr(14).split(" ");return{algorithm:s[0].toLowerCase(),value:s[1]}},rt.getDtlsParameters=function(it,s){return{role:"auto",fingerprints:rt.matchPrefix(it+s,"a=fingerprint:").map(rt.parseFingerprint)}},rt.writeDtlsParameters=function(it,s){var et="a=setup:"+s+`\r
-`;return it.fingerprints.forEach(function(nt){et+="a=fingerprint:"+nt.algorithm+" "+nt.value+`\r
-`}),et},rt.getIceParameters=function(it,s){var et=rt.splitLines(it);return{usernameFragment:(et=et.concat(rt.splitLines(s))).filter(function(nt){return nt.indexOf("a=ice-ufrag:")===0})[0].substr(12),password:et.filter(function(nt){return nt.indexOf("a=ice-pwd:")===0})[0].substr(10)}},rt.writeIceParameters=function(it){return"a=ice-ufrag:"+it.usernameFragment+`\r
-a=ice-pwd:`+it.password+`\r
-`},rt.parseRtpParameters=function(it){for(var s={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},et=rt.splitLines(it)[0].split(" "),nt=3;nt0?"9":"0",et+=" UDP/TLS/RTP/SAVPF ",et+=s.codecs.map(function(at){return at.preferredPayloadType!==void 0?at.preferredPayloadType:at.payloadType}).join(" ")+`\r
-`,et+=`c=IN IP4 0.0.0.0\r
-`,et+=`a=rtcp:9 IN IP4 0.0.0.0\r
-`,s.codecs.forEach(function(at){et+=rt.writeRtpMap(at),et+=rt.writeFmtp(at),et+=rt.writeRtcpFb(at)});var nt=0;return s.codecs.forEach(function(at){at.maxptime>nt&&(nt=at.maxptime)}),nt>0&&(et+="a=maxptime:"+nt+`\r
-`),et+=`a=rtcp-mux\r
-`,s.headerExtensions&&s.headerExtensions.forEach(function(at){et+=rt.writeExtmap(at)}),et},rt.parseRtpEncodingParameters=function(it){var s,et=[],nt=rt.parseRtpParameters(it),at=nt.fecMechanisms.indexOf("RED")!==-1,ht=nt.fecMechanisms.indexOf("ULPFEC")!==-1,dt=rt.matchPrefix(it,"a=ssrc:").map(function(ot){return rt.parseSsrcMedia(ot)}).filter(function(ot){return ot.attribute==="cname"}),ut=dt.length>0&&dt[0].ssrc,lt=rt.matchPrefix(it,"a=ssrc-group:FID").map(function(ot){return ot.substr(17).split(" ").map(function(pt){return parseInt(pt,10)})});lt.length>0&<[0].length>1&<[0][0]===ut&&(s=lt[0][1]),nt.codecs.forEach(function(ot){if(ot.name.toUpperCase()==="RTX"&&ot.parameters.apt){var pt={ssrc:ut,codecPayloadType:parseInt(ot.parameters.apt,10)};ut&&s&&(pt.rtx={ssrc:s}),et.push(pt),at&&((pt=JSON.parse(JSON.stringify(pt))).fec={ssrc:ut,mechanism:ht?"red+ulpfec":"red"},et.push(pt))}}),et.length===0&&ut&&et.push({ssrc:ut});var mt=rt.matchPrefix(it,"b=");return mt.length&&(mt=mt[0].indexOf("b=TIAS:")===0?parseInt(mt[0].substr(7),10):mt[0].indexOf("b=AS:")===0?1e3*parseInt(mt[0].substr(5),10)*.95-16e3:void 0,et.forEach(function(ot){ot.maxBitrate=mt})),et},rt.parseRtcpParameters=function(it){var s={},et=rt.matchPrefix(it,"a=ssrc:").map(function(ht){return rt.parseSsrcMedia(ht)}).filter(function(ht){return ht.attribute==="cname"})[0];et&&(s.cname=et.value,s.ssrc=et.ssrc);var nt=rt.matchPrefix(it,"a=rtcp-rsize");s.reducedSize=nt.length>0,s.compound=nt.length===0;var at=rt.matchPrefix(it,"a=rtcp-mux");return s.mux=at.length>0,s},rt.parseMsid=function(it){var s,et=rt.matchPrefix(it,"a=msid:");if(et.length===1)return s=et[0].substr(7).split(" "),{stream:s[0],track:s[1]};var nt=rt.matchPrefix(it,"a=ssrc:").map(function(at){return rt.parseSsrcMedia(at)}).filter(function(at){return at.attribute==="msid"});return nt.length>0?(s=nt[0].value.split(" "),{stream:s[0],track:s[1]}):void 0},rt.generateSessionId=function(){return Math.random().toString().substr(2,21)},rt.writeSessionBoilerplate=function(it,s,et){var nt,at=s!==void 0?s:2;return nt=it||rt.generateSessionId(),`v=0\r
-o=`+(et||"thisisadapterortc")+" "+nt+" "+at+` IN IP4 127.0.0.1\r
-s=-\r
-t=0 0\r
-`},rt.writeMediaSection=function(it,s,et,nt){var at=rt.writeRtpDescription(it.kind,s);if(at+=rt.writeIceParameters(it.iceGatherer.getLocalParameters()),at+=rt.writeDtlsParameters(it.dtlsTransport.getLocalParameters(),et==="offer"?"actpass":"active"),at+="a=mid:"+it.mid+`\r
-`,it.direction?at+="a="+it.direction+`\r
-`:it.rtpSender&&it.rtpReceiver?at+=`a=sendrecv\r
-`:it.rtpSender?at+=`a=sendonly\r
-`:it.rtpReceiver?at+=`a=recvonly\r
-`:at+=`a=inactive\r
-`,it.rtpSender){var ht="msid:"+nt.id+" "+it.rtpSender.track.id+`\r
-`;at+="a="+ht,at+="a=ssrc:"+it.sendEncodingParameters[0].ssrc+" "+ht,it.sendEncodingParameters[0].rtx&&(at+="a=ssrc:"+it.sendEncodingParameters[0].rtx.ssrc+" "+ht,at+="a=ssrc-group:FID "+it.sendEncodingParameters[0].ssrc+" "+it.sendEncodingParameters[0].rtx.ssrc+`\r
-`)}return at+="a=ssrc:"+it.sendEncodingParameters[0].ssrc+" cname:"+rt.localCName+`\r
-`,it.rtpSender&&it.sendEncodingParameters[0].rtx&&(at+="a=ssrc:"+it.sendEncodingParameters[0].rtx.ssrc+" cname:"+rt.localCName+`\r
-`),at},rt.getDirection=function(it,s){for(var et=rt.splitLines(it),nt=0;nt-1?Mt:wt}function mt(wt,Mt){var Ht=(Mt=Mt||{}).body;if(wt instanceof mt){if(wt.bodyUsed)throw new TypeError("Already read");this.url=wt.url,this.credentials=wt.credentials,Mt.headers||(this.headers=new it(wt.headers)),this.method=wt.method,this.mode=wt.mode,Ht||wt._bodyInit==null||(Ht=wt._bodyInit,wt.bodyUsed=!0)}else this.url=String(wt);if(this.credentials=Mt.credentials||this.credentials||"omit",!Mt.headers&&this.headers||(this.headers=new it(Mt.headers)),this.method=lt(Mt.method||this.method||"GET"),this.mode=Mt.mode||this.mode||null,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Ht)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Ht)}function ot(wt){var Mt=new FormData;return wt.trim().split("&").forEach(function(Ht){if(Ht){var Ot=Ht.split("="),Dt=Ot.shift().replace(/\+/g," "),Gt=Ot.join("=").replace(/\+/g," ");Mt.append(decodeURIComponent(Dt),decodeURIComponent(Gt))}}),Mt}function pt(wt){var Mt=new it;return wt.split(/\r?\n/).forEach(function(Ht){var Ot=Ht.split(":"),Dt=Ot.shift().trim();if(Dt){var Gt=Ot.join(":").trim();Mt.append(Dt,Gt)}}),Mt}function ft(wt,Mt){Mt||(Mt={}),this.type="default",this.status="status"in Mt?Mt.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in Mt?Mt.statusText:"OK",this.headers=new it(Mt.headers),this.url=Mt.url||"",this._initBody(wt)}if(!tt.fetch){var yt={searchParams:"URLSearchParams"in tt,iterable:"Symbol"in tt&&"iterator"in Symbol,blob:"FileReader"in tt&&"Blob"in tt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in tt,arrayBuffer:"ArrayBuffer"in tt};if(yt.arrayBuffer)var vt=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],bt=function(wt){return wt&&DataView.prototype.isPrototypeOf(wt)},At=ArrayBuffer.isView||function(wt){return wt&&vt.indexOf(Object.prototype.toString.call(wt))>-1};it.prototype.append=function(wt,Mt){wt=ct(wt),Mt=gt(Mt);var Ht=this.map[wt];this.map[wt]=Ht?Ht+","+Mt:Mt},it.prototype.delete=function(wt){delete this.map[ct(wt)]},it.prototype.get=function(wt){return wt=ct(wt),this.has(wt)?this.map[wt]:null},it.prototype.has=function(wt){return this.map.hasOwnProperty(ct(wt))},it.prototype.set=function(wt,Mt){this.map[ct(wt)]=gt(Mt)},it.prototype.forEach=function(wt,Mt){for(var Ht in this.map)this.map.hasOwnProperty(Ht)&&wt.call(Mt,this.map[Ht],Ht,this)},it.prototype.keys=function(){var wt=[];return this.forEach(function(Mt,Ht){wt.push(Ht)}),rt(wt)},it.prototype.values=function(){var wt=[];return this.forEach(function(Mt){wt.push(Mt)}),rt(wt)},it.prototype.entries=function(){var wt=[];return this.forEach(function(Mt,Ht){wt.push([Ht,Mt])}),rt(wt)},yt.iterable&&(it.prototype[Symbol.iterator]=it.prototype.entries);var Nt=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];mt.prototype.clone=function(){return new mt(this,{body:this._bodyInit})},ut.call(mt.prototype),ut.call(ft.prototype),ft.prototype.clone=function(){return new ft(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new it(this.headers),url:this.url})},ft.error=function(){var wt=new ft(null,{status:0,statusText:""});return wt.type="error",wt};var St=[301,302,303,307,308];ft.redirect=function(wt,Mt){if(St.indexOf(Mt)===-1)throw new RangeError("Invalid status code");return new ft(null,{status:Mt,headers:{location:wt}})},tt.Headers=it,tt.Request=mt,tt.Response=ft,tt.fetch=function(wt,Mt){return new Promise(function(Ht,Ot){var Dt=new mt(wt,Mt),Gt=new XMLHttpRequest;Gt.onload=function(){var nn={status:Gt.status,statusText:Gt.statusText,headers:pt(Gt.getAllResponseHeaders()||"")};nn.url="responseURL"in Gt?Gt.responseURL:nn.headers.get("X-Request-URL");var zt="response"in Gt?Gt.response:Gt.responseText;Ht(new ft(zt,nn))},Gt.onerror=function(){Ot(new TypeError("Network request failed"))},Gt.ontimeout=function(){Ot(new TypeError("Network request failed"))},Gt.open(Dt.method,Dt.url,!0),Dt.credentials==="include"&&(Gt.withCredentials=!0),"responseType"in Gt&&yt.blob&&(Gt.responseType="blob"),Dt.headers.forEach(function(nn,zt){Gt.setRequestHeader(zt,nn)}),Gt.send(Dt._bodyInit===void 0?null:Dt._bodyInit)})},tt.fetch.polyfill=!0}}(typeof self<"u"?self:commonjsGlobal);var _e={};_e=function(){function tt(ut,lt){var mt,ot,pt,ft=[],yt=(ut=ut.push?ut:[ut]).length,vt=yt;for(mt=function(bt,At){At.length&&ft.push(bt),--vt||lt(ft)};yt--;)ot=ut[yt],(pt=at[ot])?mt(ot,pt):(ht[ot]=ht[ot]||[]).push(mt)}function ct(ut,lt){if(ut){var mt=ht[ut];if(at[ut]=lt,mt)for(;mt.length;)mt[0](ut,lt),mt.splice(0,1)}}function gt(ut,lt){ut.call&&(ut={success:ut}),lt.length?(ut.error||et)(lt):(ut.success||et)(ut)}function rt(ut,lt,mt,ot){var pt,ft,yt=document,vt=mt.async,bt=(mt.numRetries||0)+1,At=mt.before||et,Nt=ut.replace(/^(css|img)!/,""),St=mt.reqdelay||0;ot=ot||0,/(^css!|\.css$)/.test(ut)?(pt=!0,(ft=yt.createElement("link")).rel="stylesheet",ft.href=Nt):/(^img!|\.(png|gif|jpg|svg)$)/.test(ut)?(ft=yt.createElement("img")).src=Nt:((ft=yt.createElement("script")).src=ut,ft.async=vt===void 0||vt),ft.onload=ft.onerror=ft.onbeforeload=function(wt){var Mt=wt.type[0];if(pt&&"hideFocus"in ft)try{ft.sheet.cssText.length||(Mt="e")}catch{Mt="e"}if(Mt=="e"&&(ot+=1)"u"){var et={async:!0,numRetries:it.extJsLoadingRetryNb||100,reqdelay:it.extJsLoadingRetryDelay||200,success:function(){tt.rtcio=io,s.success()},error:function(nt){console.error("socket.io loading error"),s.error()},retrycb:function(nt,at){console.warn("socket.io loading retry :"+nt+" ,delay before retry :"+at),s.retrycb()}};it.socketioUrl!==void 0?_e([it.socketioUrl],"socketio",et):_e([rt+"://"+it.ccsServer+"/socket.io/v3/socket.io.js"],"socketio",et)}else console.log("Else loadjs io"),tt.rtcio=io,s.success()},tt.apiRTC_sioLoader=gt}(window);/*! For license information please see apiRTC-srcTmp.js.LICENSE.txt */(function(tt,ct){a.exports=ct()})(self,()=>(()=>{var tt={8364:function(rt,it,s){var et,nt=this&&this.__extends||(et=function(bt,At){return(et=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(Nt,St){Nt.__proto__=St}:function(Nt,St){for(var wt in St)Object.prototype.hasOwnProperty.call(St,wt)&&(Nt[wt]=St[wt])}))(bt,At)},function(bt,At){if(typeof At!="function"&&At!==null)throw new TypeError("Class extends value "+String(At)+" is not a constructor or null");function Nt(){this.constructor=bt}et(bt,At),bt.prototype=At===null?Object.create(At):(Nt.prototype=At.prototype,new Nt)}),at=(Object.defineProperty(it,"__esModule",{value:!0}),s(2043)),ht=s(7987),dt=at.getLogger("CloudAPI"),ut=(ht.reg(at),ht.apply(dt,{format:function(bt,At,Nt){return"".concat(Nt," - [").concat(bt,"] ").concat(At," : ")}}),dt.setDefaultLevel("error"),dt.setLevel("error"),"https://cloud.apizee.com"),lt="/api/v2/media/upload",mt="/api/v2/conversation/{convId}/media",ot="/api/v2/conferences",pt={updateWebconfTags:{fetchRetryCount:3,fetchRetryDelay:500}},ft=null,yt=function(){function bt(){if(this.cloudUrl=ut,this.JWTApzToken="",this.fetchRetries=100,this.fetchRetryDelay=200,ft!==null)return dt.debug("Cannot construct multiple CloudAPI, this is a singleton."),ft;ft=this}return bt.get=function(){return ft=ft===null?new bt:ft},bt.prototype.setLogLevel=function(At){dt.setLevel(At)},bt.prototype.getLogLevel=function(){var At="";switch(dt.getLevel()){case 0:At="trace";break;case 1:At="debug";break;case 2:At="info";break;case 3:At="warn";break;case 4:At="error";break;case 5:At="silent"}return At},bt.prototype.setCloudURL=function(At){dt.debug("setCloudURL :",At),this.cloudUrl=At},bt.prototype.setJWTApzToken=function(At){this.JWTApzToken=At},bt.prototype.setFetchRetries=function(At){dt.debug("setFetchRetries :",At),At!=null&&(this.fetchRetries=At)},bt.prototype.setFetchRetryDelay=function(At){dt.log("setFetchRetryDelay :",At),At!=null&&(this.fetchRetryDelay=At)},bt.prototype.request=function(At,Nt,St,wt,Mt,Ht){Mt===void 0&&(Mt={}),Ht===void 0&&(Ht={});var Ot=At.indexOf(this.cloudUrl)===-1?this.cloudUrl+At:At,Dt=null;return new Promise(function(Gt,nn){var zt,Ft=new XMLHttpRequest;if(Ht.hasOwnProperty("withCredentials")&&(Ft.withCredentials=Ht.withCredentials),Ft.onreadystatechange=function(bn){if(Ft.readyState===XMLHttpRequest.DONE)if(dt.debug("request onreadystatechange status :",Ft.status),200<=Ft.status&&Ft.status<300)if(Ft.responseText){var fn=null;try{fn=JSON.parse(Ft.responseText)}catch{fn=Ft.responseText}Gt(fn)}else Gt("No_responseTest");else{if(fn={status:Ft.status,text:Ft.statusText},Ft.responseText)try{fn.response=JSON.parse(Ft.responseText)}catch{fn.responseText=Ft.responseText}nn(fn)}},Ft.onprogress=function(bn){typeof wt=="function"&&wt(bn)},Ft.onerror=function(bn){nn(bn)},St==="GET")0{s.d(it,{_:()=>at}),s(2564);var et=s(1549).Y.get("ApiCCDataClient"),nt=apiCC.myWebRTC_Event,at=function(ht){this.sendData=function(dt,ut,lt){et.info("Call sending data function .... to :"+dt+" message :",ut);var mt,ot,pt=ht.channel.getNewCSeq(),ft=null;return mt={type:"dataMessage",senderId:ht.apiCCId,dstRoomId:dt,data:ut,cSeq:pt},ot=JSON.stringify(mt),et.log("C->S: "+ot),lt!==void 0?(et.log("Ack management activated"),ft=setTimeout(function(){lt({reason:"timeoutReached",cSeq:pt}),apiCC.session!==null&&apiCC.session!==void 0&&delete apiCC.session.messageTimeOutTable[pt]},ht.messageTimeOutTimer),et.log("timeOutId: "+ft),ht.messageTimeOutTable[pt]=ft,ht.channel.socket.emit("dataMessage",ot,function(yt){et.log("callback on dataMessage"),et.log("callback reason :"+yt.reason),et.log("cSeq :"+yt.cSeq),lt(yt),apiCC.session.messageTimeOutTable[pt]!==void 0?(et.log("clearing timeOutId: "+apiCC.session.messageTimeOutTable[pt]),clearTimeout(apiCC.session.messageTimeOutTable[pt]),apiCC.session!==null&&apiCC.session!==void 0&&delete apiCC.session.messageTimeOutTable[pt]):et.warn("messageTimeOutTable was already deleted : timeout may have been reached before Ack")})):(et.log("Ack management not activated"),ht.channel.socket.emit("dataMessage",ot)),pt},this.sendDataToGroup=function(dt,ut){et.info("[ApiCCDataClient] sendDataToGroup - "+dt);var lt,mt=ht.getConnectedUsersList(dt);for(lt=0;lt{s.d(it,{U:()=>ut}),s(9554),s(1539),s(4747),s(2564),s(2526),s(1817),s(2165),s(6992),s(8783),s(3948);var et=s(1549),nt=s(4708),at=s(940);function ht(lt){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mt){return typeof mt}:function(mt){return mt&&typeof Symbol=="function"&&mt.constructor===Symbol&&mt!==Symbol.prototype?"symbol":typeof mt},ht(lt)}var dt=et.Y.get("ApiCCIMClient"),ut=function(lt,mt){this.convTable=[],this.myWebRTC_Event=apiCC.myWebRTC_Event,this.nickname=lt.nickname,this.photoURL=null,this.userDataSetted=!1,this.myWebRTC_Stack=new at.S(lt.channel.socket),this.findIMIdWithDestID=function(ot){var pt,ft=this.convTable.length;for(dt.log("findIMIdWithDestID = "+ot),pt=0;ptS: "+vt),ft!==void 0?(dt.log("Ack management activated"),St=setTimeout(function(){ft({reason:"timeoutReached",cSeq:wt}),apiCC.session!==null&&apiCC.session!==void 0&&delete apiCC.session.messageTimeOutTable[wt]},lt.messageTimeOutTimer),dt.log("timeOutId: "+St),lt.messageTimeOutTable[wt]=St,lt.channel.socket.emit("IMMessage",vt,function(Mt){dt.log("callback on IMMessage"),dt.log("data :",Mt),dt.log("callback reason :"+Mt.reason),dt.log("callback convId :"+Mt.convId),dt.log("cSeq :"+Mt.cSeq),ft(Mt),apiCC.session.messageTimeOutTable[wt]!==void 0?(dt.log("clearing timeOutId: "+apiCC.session.messageTimeOutTable[wt]),clearTimeout(apiCC.session.messageTimeOutTable[wt]),apiCC.session!==null&&apiCC.session!==void 0&&delete apiCC.session.messageTimeOutTable[wt]):dt.warn("messageTimeOutTable was already deleted : timeout may have been reached before Ack")})):(dt.log("Ack management not activated"),lt.channel.socket.emit("IMMessage",vt)),this.conversation!==null&&(Nt.innerHTML="me : "+yt+"
",this.conversation.appendChild(Nt),this.conversation.scrollTop=this.conversation.scrollHeight),wt},this.newConversationCreated=function(ot){dt.debug("newConversationCreated :"+ot),dt.log("msg.dstRoomId :"+ot.dstRoomId),dt.log("msg.IMId :"+ot.IMId);var pt={dest_roomId:ot.dstRoomId,IMId:ot.IMId};this.addInConvTable(pt)},this.receiveMessage=function(ot){dt.info("Call receiveMessage message :"+ot);var pt,ft=null;pt={dest_roomId:ot.senderId,IMId:ot.IMId},this.addInConvTable(pt),this.conversation!==null&&((ft=document.createElement("message")).innerHTML=""+ot.nickname+": "+ot.data+"
",this.conversation.appendChild(ft),this.conversation.scrollTop=this.conversation.scrollHeight),this.myWebRTC_Event.createReceiveIMMessageEvent(ot.senderId,ot.nickname,ot.photoURL,ot.data,ot.UUCSeq,ot.IMId)},this.createGroupChat=function(ot,pt){var ft,yt;dt.info("createGroupChat with contacts : "+ot+","+pt),ft={type:"createGroupChat",nickname:this.nickname,photoURL:this.photoURL,contactId1:ot,contactId2:pt},yt=JSON.stringify(ft),dt.log("C->S: "+yt),lt.channel.socket.emit("createGroupChat",yt)},this.groupChatCreation=function(ot){dt.debug("groupChatCreation"),this.myWebRTC_Event.createGroupChatCreationEvent(ot.status,ot.groupChatId,ot.contactId1,ot.invitationSendedToInitialDestId,ot.contactId2,ot.invitationSendedToNewContactId)},this.joinGroupChat=function(ot){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};dt.debug("joinGroupChat : "+ot);var ft=null,yt=null;ft={type:"joinGroupChat",groupChatId:ot},pt.convId&&(ft.data={},ft.data.cloudConvId=pt.convId),yt=JSON.stringify(ft),dt.log("C->S: "+yt),lt.channel.socket.emit("joinGroupChat",yt)},this.groupChatInvitation=function(ot){dt.debug("groupChatInvitation"),this.myWebRTC_Event.createGroupChatInvitationEvent(ot.groupChatId,ot.senderId,ot.senderNickname,ot.senderPhotoURL,ot.contactList)},this.answerToGroupChatInvitation=function(ot,pt){var ft,yt;dt.debug("answerToGroupChatInvitation: "+ot+" : "+pt),pt===!0||pt===!1?(ft={type:"groupChatInvitationAnswer",groupChatId:ot,senderId:lt.apiCCId,nickname:this.nickname,photoURL:this.photoURL,accept:pt},yt=JSON.stringify(ft),dt.log("C->S: "+yt),lt.channel.socket.emit("groupChatInvitationAnswer",yt)):dt.log("accept value is not correct")},this.groupChatMemberUpdate=function(ot){dt.info("groupChatMemberUpdate"),this.myWebRTC_Event.createGroupChatMemberUpdateEvent(ot.groupChatId,ot.contactList,ot.status)},this.addUserInGroupChat=function(ot,pt){var ft,yt;dt.debug("addUser : "+pt+"in Group Chat with Id :"+ot),ft={type:"addUserInGroupChat",groupChatId:ot,nickname:this.nickname,photoURL:this.photoURL,contactId:pt},yt=JSON.stringify(ft),dt.log("C->S: "+yt),lt.channel.socket.emit("addUserInGroupChat",yt)},this.addUserInGroupChatAnswer=function(ot){dt.info("addUserInGroupChatAnswer"),this.myWebRTC_Event.createAddUserInGroupChatEvent(ot.invitationSended,ot.groupChatId,ot.contactId)},this.leaveGroupChat=function(ot){var pt,ft;dt.info("Leave Group Chat with Id :"+ot),pt={type:"leaveGroupChat",groupChatId:ot,nickname:this.nickname,photoURL:this.photoURL},ft=JSON.stringify(pt),dt.log("C->S: "+ft),lt.channel.socket.emit("leaveGroupChat",ft)},this.sendMessageToGroupChat=function(ot,pt,ft){var yt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};dt.info("Call sending message to Group Chat .... from :"+this.nickname+" message :"+pt);var vt=null,bt=null,At=apiCC.session.channel.getNewCSeq();vt={type:"groupChatMessage",groupChatId:ot,senderId:lt.apiCCId,nickname:this.nickname,cSeq:At,data:pt},(0,nt.Ym)(yt,"metadata","object")&&(vt.metadata=yt.metadata),bt=JSON.stringify(vt),ft!==null&&typeof ft=="function"?(apiCC.session.messageTimeOutTable[At]=setTimeout(function(){ft({reason:"timeoutReached",cSeq:At}),apiCC.session!==null&&apiCC.session!==void 0&&delete apiCC.session.messageTimeOutTable[At]},apiCC.session.messageTimeOutTimer),dt.log("C->S: "+bt),lt.channel.socket.emit("groupChatMessage",bt,function(Nt){clearTimeout(apiCC.session.messageTimeOutTable[Nt.cSeq]),apiCC.session!==null&&apiCC.session!==void 0&&delete apiCC.session.messageTimeOutTable[Nt.cSeq],ft(Nt)})):(dt.log("C->S: "+bt),lt.channel.socket.emit("groupChatMessage",bt))},this.receiveGroupChatMessage=function(ot){dt.info("receiveGroupChatMessage"),this.myWebRTC_Event.createReceiveGroupChatMessageEvent(ot.groupChatId,ot.senderId,ot.nickname,ot.data,ot.metadata)},this.getConversationHistory=function(ot){var pt,ft;dt.debug("getConversationHistory"),pt={type:"getConversationHistory",convId:ot},ft=JSON.stringify(pt),dt.log("C->S: "+ft),lt.channel.socket.emit("getConversationHistory",ft)},this.receiveConversationHistory=function(ot){dt.debug("receiveConversationHistory"),dt.log("msg.convId :"+ot.convId);var pt,ft=0,yt=[],vt=null;if(ot.convHistory!==null)for(dt.log("msg.convHistory.length :"+ot.convHistory.length),ft=ot.convHistory.length,yt=[],pt=0;ptS: "+ft),lt.channel.socket.emit("setUserData",ft),this.userDataSetted=!0},this.getUserData=function(ot){var pt,ft;dt.info("getUserData"),pt={type:"getUserData",contactId:ot},ft=JSON.stringify(pt),dt.log("C->S: "+ft),lt.channel.socket.emit("getUserData",ft)},this.receiveUserDataAnswer=function(ot){dt.info("receiveUserDataAnswer"),this.myWebRTC_Event.createUserDataAnswerEvent(ot.userFound,ot.contactId,ot.nickname,ot.photoURL)},this.receiveFetchUserDataAnswer=function(ot){dt.info("receiveFetchUserDataAnswer"),this.myWebRTC_Event.createFetchUserDataAnswerEvent(ot)},this.initialize=function(ot){var pt,ft;this.conversation=document.getElementById(ot),this.conversation===null&&(dt.log("conversationElementId Div Name is not correct : INCORRECT_DIV_NAME_CONVERSATION"),dt.log("conversationElementId is null")),pt={type:"registerIM",username:this.nickname},ft=JSON.stringify(pt),dt.log("C->S: "+ft),lt.channel.socket.emit("registerIM",ft)},this.initialize(mt)}},9213:(rt,it,s)=>{s.d(it,{X:()=>ht}),s(2564),s(2526),s(1817),s(1539);var et=s(1549),nt=s(4708),at=et.Y.get("ApiCCPointerSharingClient"),ht=function dt(ut){this.roomTable={},this.getRoomIds=function(){var lt=[],mt=null;for(mt in this.roomTable)lt.push(mt);return lt},this.roomExists=function(lt){return this.roomTable.hasOwnProperty(lt)},this.roomActive=function(lt){return this.roomTable.hasOwnProperty(lt)&&this.roomTable[lt].state===dt.STATE_ACTIVE},this.joinRoom=function(lt,mt){var ot=this;at.info("ApiCCPointerSharingClient::joinRoom()"),(0,nt.Ym)(mt,"object")||(mt={}),(0,nt.ki)(mt,"success","function")||(mt.success=function(){}),(0,nt.ki)(mt,"failure","function")||(mt.failure=function(){}),this.roomTable.hasOwnProperty(lt)?mt.failure("room already joined",lt):(this.roomTable[lt]={roomId:lt,state:dt.STATE_JOINING,joinRoomCallbacks:mt},this.roomTable[lt].joinRoomTimeoutId=setTimeout(function(){delete ot.roomTable[lt],mt.failure("timeout",lt)},15e3),apiCC.session.roomMgr.joinRoom(lt,"pointerSharing"))},this.leaveRoom=function(lt){this.roomTable.hasOwnProperty(lt)&&delete this.roomTable[lt],apiCC.session.roomMgr.leaveRoom(lt,"pointerSharing")},this.inviteInRoom=function(lt,mt,ot){at.info("ApiCCPointerSharingClient::inviteInRoom()"),apiCC.session.roomMgr.inviteInRoom(lt,mt,"pointerSharing",ot)},this.sendPointerLocation=function(lt,mt,ot,pt,ft){var yt;return!(!this.roomTable.hasOwnProperty(lt)||this.roomTable[lt].state!==dt.STATE_ACTIVE||(yt={type:"pointerLocation",source:mt,x:ot,y:pt},(0,nt.Ym)(ft,"object")&&(yt.data=ft),apiCC.session.roomMgr.sendMessageToRoom(lt,"pointerSharing",yt),0))},this.processMessageRoomJoin=function(lt){this.roomTable.hasOwnProperty(lt.roomId)&&this.roomTable[lt.roomId].state===dt.STATE_JOINING&&(clearTimeout(this.roomTable[lt.roomId].joinRoomTimeoutId),delete this.roomTable[lt.roomId].joinRoomTimeoutId,this.roomTable[lt.roomId].state=dt.STATE_ACTIVE,this.roomTable[lt.roomId].joinRoomCallbacks.success(lt.roomId),delete this.roomTable[lt.roomId].joinRoomCallbacks)},this.stop=function(){for(var lt=this.getRoomIds(),mt=lt.length;--mt>=0;)this.leaveRoom(lt[mt])}};ht.STATE_IDLE=Symbol("idle"),ht.STATE_JOINING=Symbol("joining"),ht.STATE_ACTIVE=Symbol("active"),ht.STATE_ERROR=Symbol("error")},3720:(rt,it,s)=>{s.d(it,{K:()=>Nt}),s(1058),s(8309),s(3710),s(1539),s(9714),s(2564),s(9554),s(4747),s(2772),s(561),s(6699),s(2479),s(2707),s(9601),s(8674),s(2526),s(1817),s(2165),s(6992),s(8783),s(3948),s(2443),s(3680),s(3706),s(2703),s(9070),s(8011),s(489),s(8304),s(7042);var et=s(1549),nt=et.Y.get("RoomManager"),at=function(St,wt){nt.debug("RoomManager"),this.myWebRTC_Event=apiCC.myWebRTC_Event,this.createRoom=function(Mt){var Ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};nt.info("RoomManager:createRoom with roomType : "+Mt);var Ot={type:"createRoom",roomType:Mt,nickname:St.nickname,photoURL:St.photoURL};Ht.convId&&(Ot.data||(Ot.data={}),Ot.data.cloudConvId=Ht.convId),Ht.webconf===!0&&(Ot.data||(Ot.data={}),Ot.data.webconf=!0);var Dt=JSON.stringify(Ot);nt.log("C->S: "+Dt),St.channel.socket.emit("createRoom",Dt)},this.roomCreation=function(Mt){nt.info("RoomManager:roomCreation"),this.myWebRTC_Event.createRoomCreationEvent(Mt.status,Mt.roomId,Mt.roomType),wt(Mt)},this.roomJoin=function(Mt){nt.info("RoomManager:roomJoin"),this.myWebRTC_Event.createRoomJoinedEvent(Mt.status,Mt.roomId,Mt.roomType),wt(Mt)},this.inviteInRoom=function(Mt,Ht,Ot,Dt){var Gt=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};nt.info("RoomManager:inviteInRoom with roomType:",Ot);var nn={type:"inviteInRoom",roomId:Mt,contactId:Ht,roomType:Ot,nickname:St.nickname,photoURL:St.photoURL,context:Dt};Gt.convId&&(nn.data||(nn.data={}),nn.data.cloudConvId=Gt.convId),Gt.webconf===!0&&(nn.data||(nn.data={}),nn.data.webconf=!0);var zt=JSON.stringify(nn);nt.log("C->S: "+zt),St.channel.socket.emit("inviteInRoom",zt)},this.inviteInRoomStatus=function(Mt){nt.info("inviteInRoomStatus"),wt(Mt)},this.roomInvitation=function(Mt){nt.info("roomInvitation",Mt);var Ht={};Mt.data&&(Mt.data.cloudConvId&&(Ht.cloudConvId=Mt.data.cloudConvId),Mt.data.webconf===!0&&(Ht.webconf=!0)),this.myWebRTC_Event.createRoomInvitationEvent(Mt.roomId,Mt.senderId,Mt.senderNickname,Mt.senderPhotoURL,Mt.contactList,Mt.roomType,Ht),wt(Mt)},this.requestContactListInRoom=function(Mt){nt.info("requestContactListInRoom :"+Mt);var Ht={type:"requestContactListInRoom",roomId:Mt},Ot=JSON.stringify(Ht);St.channel.socket.emit("requestContactListInRoom",Ot)},this.onContactListInRoom=function(Mt){nt.info("onContactListInRoom :"+Mt),this.myWebRTC_Event.createContactListInRoomEvent(Mt.roomId,Mt.contactList,Mt.roomType),wt(Mt)},this.answerToRoomInvitation=function(Mt,Ht,Ot){if(nt.info("answerToRoomInvitation:",Mt,Ht),Ht===!0||Ht===!1){var Dt={type:"roomInvitationAnswer",roomId:Mt,senderId:St.apiCCId,nickname:St.nickname,photoURL:St.photoURL,accept:Ht,roomType:Ot},Gt=JSON.stringify(Dt);nt.log("C->S: "+Gt),St.channel.socket.emit("roomInvitationAnswer",Gt)}else nt.log("accept value is not correct")},this.roomMemberUpdate=function(Mt){nt.info("roomMemberUpdate"),this.myWebRTC_Event.createRoomMemberUpdateEvent(Mt.roomId,Mt.contactList,Mt.status,Mt.roomType),wt(Mt)},this.sendMessageToRoom=function(Mt,Ht,Ot){nt.info("Call sending message to Room .... from :"+St.apiCCId+" message :"+Ot);var Dt={type:"roomMessage",roomId:Mt,senderId:St.apiCCId,nickname:St.nickname,roomType:Ht,data:Ot},Gt=JSON.stringify(Dt);nt.log("C->S: "+Gt),St.channel.socket.emit("roomMessage",Gt)},this.receiveRoomMessage=function(Mt){nt.info("receiveRoomMessage"),this.myWebRTC_Event.createReceiveRoomMessageEvent(Mt.roomId,Mt.senderId,Mt.nickname,Mt.data,Mt.roomType),wt(Mt)},this.joinRoom=function(Mt,Ht){var Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};nt.info("Join Room with Id:",Mt);var Dt={type:"joinRoom",roomId:Mt,nickname:St.nickname,photoURL:St.photoURL,roomType:Ht};Ot.convId&&(Dt.data||(Dt.data={}),Dt.data.cloudConvId=Ot.convId),Ot.webconf===!0&&(Dt.data||(Dt.data={}),Dt.data.webconf=!0);var Gt=JSON.stringify(Dt);nt.log("C->S: "+Gt),St.channel.socket.emit("joinRoom",Gt)},this.leaveRoom=function(Mt,Ht){nt.info("Leave Room with Id:",Mt);var Ot={type:"leaveRoom",roomId:Mt,nickname:St.nickname,photoURL:St.photoURL,roomType:Ht},Dt=JSON.stringify(Ot);nt.log("C->S: "+Dt),St.channel.socket.emit("leaveRoom",Dt)}},ht=(s(2023),s(1038),s(4916),s(9753),s(8765)),dt=s(5945);function ut(St,wt){(wt==null||wt>St.length)&&(wt=St.length);for(var Mt=0,Ht=new Array(wt);Mt"u"&&(lt.log("ApplicationUUID : "+window.location.hostname),Ot+="&applicationUUID="+window.location.hostname),Ot+="&apiLibType=apiRTC_JS",lt.log("requestOptions on connect :"+Ot),lt.log("session.ccsServer :"+St.ccsServer),wt="?channelId="+this.channelId+"&apiKey="+St.apiKey+"&apiVersion="+apiCC.version+"&apiCCSessionId="+St.apiCCSessionId+"&sessionId="+St.sessionId+Mt+Ht+Ot,zt=typeof apiRTC_React<"u"?"https":window.location.protocol==="http:"?"http":"https",dt.ag.name!=="iOS"&&dt.ag.name!=="Android"||(lt.log(dt.ag.name+" detected forcing protocol to https"),zt="https"),lt.info("CCS Connect, socket url is : "+zt+"://"+St.ccsServer+"/"+wt),this.ccsConnectionRetryNb=St.ccsConnectionRetryNb,this.ccsConnectionRetryDelay=St.ccsConnectionRetryDelay,this.socket=window.rtcio.connect(zt+"://"+St.ccsServer+"/"+wt,{forceNew:!0,multiplex:!1,withCredentials:!0,reconnectionAttempts:this.ccsConnectionRetryNb,reconnectionDelay:this.ccsConnectionRetryDelay}),this.socket.on("connect",this.callback(this,"onChannelOpened")).on("connect_error",this.callback(this,"onChannelConnectError")).on("message",this.callbackWithParams(this,"onChannelMessage")).on("disconnect",this.callback(this,"onChannelDisconnect")),this.socket.io.on("error",this.callback(this,"onChannelError")).on("reconnect",this.callback(this,"onChannelReconnect")).on("reconnect_attempt",this.callback(this,"onChannelReconnectAttempt")).on("reconnect_error",this.callback(this,"onChannelReconnectError")).on("reconnect_failed",this.callback(this,"onChannelReconnect_failed"))},this.onWhiteBoardDisconnection=function(){lt.info("onWhiteBoardDisconnection"),apiCC.session.closeWhiteBoardClient("NETWORK_DISCONNECTION")},this.onChannelDisconnect=function(wt){lt.info("onChannelDisconnect");var Mt=Date();lt.debug("date :"+Mt),apiCC.session.connectedUsersList.splice(0,apiCC.session.connectedUsersList.length),this.myWebRTC_Event.createChannelEvent("onChannelDisconnect",wt),this.channelHasBeenDisconnected=!0,apiCC.myApiCCWhiteBoardClient!==null&&(lt.log("apiCC.myApiCCWhiteBoardClient.roomId :"+apiCC.myApiCCWhiteBoardClient.roomId),apiCC.myApiCCWhiteBoardClient.roomId!==null?(lt.log("Disconnection with an ongoing whiteboard"),lt.error("Whiteboard disconnectionTimer is set to:",apiCC.myApiCCWhiteBoardClient.disconnectionTimer),apiCC.myApiCCWhiteBoardClient.whiteBoardDisconnectionTimeoutId=setTimeout(this.callback(this,"onWhiteBoardDisconnection"),apiCC.myApiCCWhiteBoardClient.disconnectionTimer)):lt.log("Disconnection without an ongoing whiteboard")),apiCC.session.JWTApzTokentimeOutId!==-1&&clearTimeout(apiCC.session.JWTApzTokentimeOutId)},this.onChannelReconnect_failed=function(){lt.info("onChannelReconnect_failed"),this.myWebRTC_Event.createChannelEvent("onChannelReconnect_failed")},this.onChannelReconnect=function(wt){lt.error("onChannelReconnect",wt);var Mt,Ht=null,Ot=0,Dt=[],Gt=null,nn=null,zt=null,Ft=!1,un=0,vn=null,yn=null;if(St.conversationSpace!==null&&St.conversationSpace!==void 0?(lt.debug("conversationSpace is set :",St.conversationSpace),St.joinConversationSpace(St.conversationSpace)):lt.debug("no conversationSpace defined"),St.userData!==void 0&&St.userData!==null&&(lt.debug("sending userData :",St.userData),St.setUserData(St.userData,!0)),St.presenceGroup!==null?(lt.debug("presenceGroup is set :",St.presenceGroup),St.sendPresenceGroupManagementCommand("join",St.presenceGroup)):lt.debug("no presenceGroup defined"),St.subscribeToPresenceGroup!==null?(lt.debug("subscribeToPresenceGroup is set :",St.subscribeToPresenceGroup),St.sendPresenceGroupManagementCommand("subscribe",St.subscribeToPresenceGroup)):lt.debug("no subscribeToPresenceGroup defined"),apiCC.session.apiCCIMClient!==null?apiCC.session.apiCCIMClient.userDataSetted===!0?(Ht={photoURL:apiCC.session.apiCCIMClient.photoURL},apiCC.session.apiCCIMClient.setUserData(Ht)):lt.log("apiCC.session.apiCCIMClient.userDataSetted !== true"):lt.log("apiCC.session.apiCCIMClient === null"),apiCC.session.apiCCWebRTCClient!==null){if(apiCC.session.apiCCWebRTCClient.webRTCClient.userMediaTable.length>0)for(Ft=!0,Mt=0;Mt0&&(Ft=!0),Ft===!0){lt.log("Sending reconnectContext to CCS"),nn={type:"reconnectContext",callList:Dt,whiteBoardRoomId:un},vn!==null&&vn.length>0&&(nn.pointerSharingRoomIds=vn);var fn=apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.sessionMCUs;if(fn.length>0){nn.updateSession=apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.createJoinSessionMessage(null),nn.updateSession.type="updateSession",nn.updateSessions=[];var Tn,_n=function(In,Rn){var On=typeof Symbol<"u"&&In[Symbol.iterator]||In["@@iterator"];if(!On){if(Array.isArray(In)||(On=function(on,Hn){if(on){if(typeof on=="string")return ut(on,Hn);var Bn=Object.prototype.toString.call(on).slice(8,-1);return Bn==="Object"&&on.constructor&&(Bn=on.constructor.name),Bn==="Map"||Bn==="Set"?Array.from(on):Bn==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Bn)?ut(on,Hn):void 0}}(In))||Rn&&In&&typeof In.length=="number"){On&&(In=On);var Ln=0,qn=function(){};return{s:qn,n:function(){return Ln>=In.length?{done:!0}:{done:!1,value:In[Ln++]}},e:function(on){throw on},f:qn}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var jn,Fn=!0,Zn=!1;return{s:function(){On=On.call(In)},n:function(){var on=On.next();return Fn=on.done,on},e:function(on){Zn=!0,jn=on},f:function(){try{Fn||On.return==null||On.return()}finally{if(Zn)throw jn}}}}(fn);try{for(_n.s();!(Tn=_n.n()).done;){var Un=Tn.value,Pn=apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.createJoinSessionMessage(null,{sessionMCU:Un});Pn.type="updateSession",nn.updateSessions.push(Pn)}}catch(In){_n.e(In)}finally{_n.f()}}zt=JSON.stringify(nn),lt.log("C->S: "+zt),apiCC.session.channel.socket.emit("reconnectContext",zt)}Dt.splice(0,Dt.length),this.myWebRTC_Event.createChannelEvent("onChannelReconnect",wt)},this.onChannelReconnecting=function(wt){lt.info("onChannelReconnecting",wt);var Mt=Date();lt.debug("date :"+Mt),this.myWebRTC_Event.createChannelEvent("onChannelReconnecting",wt)},this.onChannelOpened=function(){lt.info("Channel opened"),lt.log("this.channelId :"+this.channelId),this.channelReady=!0,this.channelHasBeenDisconnected===!1?St.onChannelOpened():(lt.log("onChannelOpened after a disconnection, no change on session"),this.channelHasBeenDisconnected=!1,St.ApiDBActivated!==!1&&St.ApiDBActivated!==void 0&&St.ApiDBActivated!==null&&(lt.log("apiDB initialisation"),apiDB.init(St.channel.socket))),this.updatePresenceGroupIsNeeded===!0&&(lt.log("Updating presence group"),St.leavePresenceGroup(this.oldPresenceGroup),St.joinPresenceGroup(this.newPresenceGroup)),this.updateSubscribeToPresenceGroupIsNeeded===!0&&(lt.log("Updating subscribe to presence group"),St.unsubscribePresenceGroup(this.oldSubscribeToPresenceGroup),St.subscribePresenceGroup(this.newSubscribeToPresenceGroup)),this.myWebRTC_Event.createChannelEvent("onChannelOpened")},this.onChannelMessage=function(wt,Mt){var Ht,Ot=null,Dt=null;try{Ot=JSON.parse(wt)}catch{return}(Ht=Ot.type==="checkCallStatus"||Ot.type==="apiRTCDataMessage"&&Ot.data&&["activeSpeaker","stopSpeaking"].indexOf(Ot.data.type)>=0)||lt.info("onChannelMessage S->C: "+wt),Ot.type==="IMMessage"&&(lt.log("IMMessage convId :"+Ot.IMId),Dt=Ot.IMId),Mt!==void 0&&(lt.trace("ack on message reception"),lt.trace("convId :"+Dt),Mt({reason:"ack",convId:Dt})),St.processSignalingMessage(Ot,{quiet:Ht})},this.onChannelConnectError=function(wt){lt.error("onChannelConnectError :",wt.message),this.myWebRTC_Event.createChannelEvent("onChannelConnectError",wt),this.checkIfConnectionAttemptNeedToBeStopped(wt)},this.onChannelReconnectError=function(wt){lt.log("onChannelReconnectError :",wt.message),this.myWebRTC_Event.createChannelEvent("onChannelReconnectError",wt),this.checkIfConnectionAttemptNeedToBeStopped(wt)},this.onChannelReconnectAttempt=function(wt){lt.log("onChannelReconnectAttempt :",wt),this.myWebRTC_Event.createChannelEvent("onChannelReconnectAttempt",wt),this.onChannelReconnecting(wt)},this.onChannelError=function(wt){lt.error("Channel error :",wt.message),this.checkIfConnectionAttemptNeedToBeStopped(wt),this.myWebRTC_Event.createChannelEvent("onChannelError",wt)},this.checkIfConnectionAttemptNeedToBeStopped=function(wt){lt.debug("checkIfConnectionAttemptNeedToBeStopped"),(wt.message==="not authorized"||wt.message.includes("access token failure:")||wt.message.includes("DISABLED_ENTERPRISE")||wt.message.includes("An account is needed")||wt.message.includes("ApiRTC update is needed")||wt.message.includes("applicationUUID is not authorized"))&&(lt.error("Stopping connection attempts"),this.socket.disconnect())},this.callback=function(wt,Mt){return this.closureHandler=function(Ht){return wt[Mt](Ht)},this.closureHandler},this.callbackWithParams=function(wt,Mt){return this.closureHandler=function(Ht,Ot,Dt){return wt[Mt](Ht,Ot,Dt)},this.closureHandler}},ot=s(4708),pt=s(940);function ft(St){return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(wt){return typeof wt}:function(wt){return wt&&typeof Symbol=="function"&&wt.constructor===Symbol&&wt!==Symbol.prototype?"symbol":typeof wt},ft(St)}function yt(){yt=function(){return St};var St={},wt=Object.prototype,Mt=wt.hasOwnProperty,Ht=typeof Symbol=="function"?Symbol:{},Ot=Ht.iterator||"@@iterator",Dt=Ht.asyncIterator||"@@asyncIterator",Gt=Ht.toStringTag||"@@toStringTag";function nn(jn,Fn,Zn){return Object.defineProperty(jn,Fn,{value:Zn,enumerable:!0,configurable:!0,writable:!0}),jn[Fn]}try{nn({},"")}catch{nn=function(Fn,Zn,on){return Fn[Zn]=on}}function zt(jn,Fn,Zn,on){var Hn=Fn&&Fn.prototype instanceof vn?Fn:vn,Bn=Object.create(Hn.prototype),zn=new On(on||[]);return Bn._invoke=function($n,Jn,Kn){var An="suspendedStart";return function(Wn,Cn){if(An==="executing")throw new Error("Generator is already running");if(An==="completed"){if(Wn==="throw")throw Cn;return{value:void 0,done:!0}}for(Kn.method=Wn,Kn.arg=Cn;;){var Nn=Kn.delegate;if(Nn){var qt=Pn(Nn,Kn);if(qt){if(qt===un)continue;return qt}}if(Kn.method==="next")Kn.sent=Kn._sent=Kn.arg;else if(Kn.method==="throw"){if(An==="suspendedStart")throw An="completed",Kn.arg;Kn.dispatchException(Kn.arg)}else Kn.method==="return"&&Kn.abrupt("return",Kn.arg);An="executing";var kt=Ft($n,Jn,Kn);if(kt.type==="normal"){if(An=Kn.done?"completed":"suspendedYield",kt.arg===un)continue;return{value:kt.arg,done:Kn.done}}kt.type==="throw"&&(An="completed",Kn.method="throw",Kn.arg=kt.arg)}}}(jn,Zn,zn),Bn}function Ft(jn,Fn,Zn){try{return{type:"normal",arg:jn.call(Fn,Zn)}}catch(on){return{type:"throw",arg:on}}}St.wrap=zt;var un={};function vn(){}function yn(){}function cn(){}var gn={};nn(gn,Ot,function(){return this});var bn=Object.getPrototypeOf,fn=bn&&bn(bn(Ln([])));fn&&fn!==wt&&Mt.call(fn,Ot)&&(gn=fn);var Tn=cn.prototype=vn.prototype=Object.create(gn);function _n(jn){["next","throw","return"].forEach(function(Fn){nn(jn,Fn,function(Zn){return this._invoke(Fn,Zn)})})}function Un(jn,Fn){function Zn(Hn,Bn,zn,$n){var Jn=Ft(jn[Hn],jn,Bn);if(Jn.type!=="throw"){var Kn=Jn.arg,An=Kn.value;return An&&ft(An)=="object"&&Mt.call(An,"__await")?Fn.resolve(An.__await).then(function(Wn){Zn("next",Wn,zn,$n)},function(Wn){Zn("throw",Wn,zn,$n)}):Fn.resolve(An).then(function(Wn){Kn.value=Wn,zn(Kn)},function(Wn){return Zn("throw",Wn,zn,$n)})}$n(Jn.arg)}var on;this._invoke=function(Hn,Bn){function zn(){return new Fn(function($n,Jn){Zn(Hn,Bn,$n,Jn)})}return on=on?on.then(zn,zn):zn()}}function Pn(jn,Fn){var Zn=jn.iterator[Fn.method];if(Zn===void 0){if(Fn.delegate=null,Fn.method==="throw"){if(jn.iterator.return&&(Fn.method="return",Fn.arg=void 0,Pn(jn,Fn),Fn.method==="throw"))return un;Fn.method="throw",Fn.arg=new TypeError("The iterator does not provide a 'throw' method")}return un}var on=Ft(Zn,jn.iterator,Fn.arg);if(on.type==="throw")return Fn.method="throw",Fn.arg=on.arg,Fn.delegate=null,un;var Hn=on.arg;return Hn?Hn.done?(Fn[jn.resultName]=Hn.value,Fn.next=jn.nextLoc,Fn.method!=="return"&&(Fn.method="next",Fn.arg=void 0),Fn.delegate=null,un):Hn:(Fn.method="throw",Fn.arg=new TypeError("iterator result is not an object"),Fn.delegate=null,un)}function In(jn){var Fn={tryLoc:jn[0]};1 in jn&&(Fn.catchLoc=jn[1]),2 in jn&&(Fn.finallyLoc=jn[2],Fn.afterLoc=jn[3]),this.tryEntries.push(Fn)}function Rn(jn){var Fn=jn.completion||{};Fn.type="normal",delete Fn.arg,jn.completion=Fn}function On(jn){this.tryEntries=[{tryLoc:"root"}],jn.forEach(In,this),this.reset(!0)}function Ln(jn){if(jn){var Fn=jn[Ot];if(Fn)return Fn.call(jn);if(typeof jn.next=="function")return jn;if(!isNaN(jn.length)){var Zn=-1,on=function Hn(){for(;++Zn=0;--on){var Hn=this.tryEntries[on],Bn=Hn.completion;if(Hn.tryLoc==="root")return Zn("end");if(Hn.tryLoc<=this.prev){var zn=Mt.call(Hn,"catchLoc"),$n=Mt.call(Hn,"finallyLoc");if(zn&&$n){if(this.prev=0;--Zn){var on=this.tryEntries[Zn];if(on.tryLoc<=this.prev&&Mt.call(on,"finallyLoc")&&this.prev=0;--Fn){var Zn=this.tryEntries[Fn];if(Zn.finallyLoc===jn)return this.complete(Zn.completion,Zn.afterLoc),Rn(Zn),un}},catch:function(jn){for(var Fn=this.tryEntries.length-1;Fn>=0;--Fn){var Zn=this.tryEntries[Fn];if(Zn.tryLoc===jn){var on=Zn.completion;if(on.type==="throw"){var Hn=on.arg;Rn(Zn)}return Hn}}throw new Error("illegal catch attempt")},delegateYield:function(jn,Fn,Zn){return this.delegate={iterator:Ln(jn),resultName:Fn,nextLoc:Zn},this.method==="next"&&(this.arg=void 0),un}},St}function vt(St,wt,Mt,Ht,Ot,Dt,Gt){try{var nn=St[Dt](Gt),zt=nn.value}catch(Ft){return void Mt(Ft)}nn.done?wt(zt):Promise.resolve(zt).then(Ht,Ot)}var bt=et.Y.get("ApiCCSession"),At=apiCC.myWebRTC_Event,Nt=function(St){var wt=this;this.apiCCId=null,this.apiCCSessionId=apiCC.randomString(22),this.apiKey=null,this.nickname=null,this.photoURL=null,this.apiCCWebRTCClient=null,this.apiCCIMClient=null,this.apiCCDataClient=null,this.apiCCIDSessionStorage=null,this.apiKeySessionStorage=null,this.apiCCIdPersistenceTimeout=5e3,this.channel=null,this.recordActivated=St.recordActivated,this.sessionId=null,this.apiCCPointerSharingClient=null,this.apiCCWhiteBoardClient=null,this.ccsServer=St.ccsServer,this.userData=St.userData,this.apiDBActivated=!0,St.ApiDBActivated=!0,this.webRTCPluginActivated=St.webRTCPluginActivated,this.token=St.token,this.JWTApzToken=null,this.JWTApzTokenRefreshTimer=396e5,this.JWTApzTokentimeOutId=-1,this.conversationSpace=St.conversationSpace,this.tryAudioCallAfterUserMediaError=St.tryAudioCallAfterUserMediaError,this.deactivateReloadOnCancel=St.deactivateReloadOnCancel,this.connectedUsersList=[],this.messageTimeOutTable=[],this.ccsConnectionRetryNb=St.ccsConnectionRetryNb,this.ccsConnectionRetryDelay=St.ccsConnectionRetryDelay,this.sequentialMessagesStorage={},this.cloudIsSecured=St.cloudIsSecured,St.messageTimeOutTimer!==void 0?this.messageTimeOutTimer=St.messageTimeOutTimer:this.messageTimeOutTimer=1e4,bt.log("messageTimeOutTimer set to : "+this.messageTimeOutTimer),St.presenceGroup!==void 0?this.presenceGroup=St.presenceGroup:this.presenceGroup=["default"],St.subscribeToPresenceGroup!==void 0?this.subscribeToPresenceGroup=St.subscribeToPresenceGroup:this.subscribeToPresenceGroup=["default"],this.presenceGroupAddedByApiRTC=[],this.subscribeToPresenceGroupAddedByApiRTC=[],this.remoteAccessInvitation=null,this.isDeviceWebRTCCompliant=function(){return apiCC.isWebRTCCompliant()},this.isDeviceDTLSCompliant=function(){var Ot=dt.E2.getBrowser(),Dt=parseInt(Ot.version,10);return!(Ot.name==="Chrome"&&Dt<44&&(bt.log("isDeviceDTLSCompliant FALSE : Chrome V < 44"),1))},this.userData===void 0||this.userData===null?(this.userData={},this.userData.webRtcCompliant=apiCC.webRTCCompliant,this.userData.dtlsCompliant=this.isDeviceDTLSCompliant()):this.userData.webRtcCompliant===void 0||this.userData.webRtcCompliant===null?(this.userData.webRtcCompliant=apiCC.webRTCCompliant,this.userData.dtlsCompliant=this.isDeviceDTLSCompliant()):bt.log("userData webRtcCompliant set to :",this.userData.webRtcCompliant),this.userData.osName=dt.BF,this.userData.browser=dt.Xh,this.userData.deviceType=dt.vO,this.userData.deviceVendor=dt.Cm,this.userData.browser_version=dt.dc,this.userData.browser_major_version=dt.PR,this.userData.apiRTCVersion=apiCC.version,this.userData.cpuArchitecture=dt.Ne,this.userData.engineName=dt.AA,this.userData.engineVersion=dt.TI,apiRTC.userAgentInstance!==void 0&&(this.userData.remoteAccessUserSupport=apiRTC.userAgentInstance.getCapabilities().remoteAccessUser),dt.BF==="Android"&&typeof cordova<"u"&&(this.userData.platform="Android"),typeof apiRTC_React<"u"&&(this.userData.react=!0);var Mt=function(){var Ot,Dt=(Ot=yt().mark(function Gt(){var nn,zt;return yt().wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,(0,dt.Ak)();case 2:return nn=Ft.sent,wt.userData.deviceModel=nn,Ft.next=6,(0,dt.RX)();case 6:zt=Ft.sent,wt.userData.osVersion=zt,apiCC.osVersion=zt,wt.startApiCCSession(St);case 10:case"end":return Ft.stop()}},Gt)}),function(){var Gt=this,nn=arguments;return new Promise(function(zt,Ft){var un=Ot.apply(Gt,nn);function vn(cn){vt(un,zt,Ft,vn,yn,"next",cn)}function yn(cn){vt(un,zt,Ft,vn,yn,"throw",cn)}vn(void 0)})});return function(){return Dt.apply(this,arguments)}}();function Ht(Ot){return Ot instanceof Array?(bt.log("data instanceof Array"),!0):(bt.log("data not instanceof Array"),!1)}Mt(),this.roomManagerEventHandler=function(Ot){if(bt.debug("roomManagerEventHandler, roomId :"+Ot.roomId+", type :"+Ot.type+", roomType :"+Ot.roomType),Ot.roomType==="whiteBoard"){if(apiCC.myApiCCWhiteBoardClient===null||apiCC.myApiCCWhiteBoardClient===void 0)return void bt.log("No whiteBoard created, leaving msg processing");Ot.type==="roomCreation"&&(bt.log("whiteBoard : roomCreation"),apiCC.myApiCCWhiteBoardClient.roomId=Ot.roomId,apiCC.myApiCCWhiteBoardClient.paperSheetId++,apiCC.myApiCCWhiteBoardClient.drawingId=0,apiCC.myApiCCWhiteBoardClient.sendDataToRoom({tool:"void",needCatchUp:"*||-1"})),Ot.type==="roomInvitation"&&(bt.log("whiteBoard : roomInvitation"),apiCC.myApiCCWhiteBoardClient.roomId=Ot.roomId),Ot.type==="roomMessage"&&apiCC.myApiCCWhiteBoardClient.messageProcessing(Ot.data),Ot.type==="roomJoin"&&(bt.log("whiteBoard : roomJoin"),apiCC.myApiCCWhiteBoardClient.roomJoined=!0,apiCC.myApiCCWhiteBoardClient.roomId=Ot.roomId)}else Ot.roomType==="pointerSharing"?apiCC.session.apiCCPointerSharingClient&&Ot.type==="roomJoin"&&apiCC.session.apiCCPointerSharingClient.processMessageRoomJoin(Ot):Ot.roomType==="coBrowsing"?Ot.type==="roomMessage"&&bt.log("coBrowsing : roomMessage :"+Ot):bt.log("roomManagerEventHandler for msg.roomType :"+Ot.roomType)},this.callback=function(Ot,Dt){return this.closureHandler=function(Gt){return Ot[Dt](Gt)},this.closureHandler},this.getSessionStorage=function(Ot){var Dt=sessionStorage.getItem(Ot);if(Dt===null)return null;try{var Gt=JSON.parse(Dt),nn=new Date(Gt.expiresAt);return new Date>=nn?(sessionStorage.removeItem(Ot),null):Gt.value}catch{bt.error("Something went wrong when parsing JSON from session storage values")}},this.generateApiCCID=function(){bt.debug("apiCCId is not defined by user, checking if apiCCId exist in sessionStorage"),typeof apiRTC_React>"u"&&(this.apiCCIDSessionStorage=this.getSessionStorage("apiCCId"),this.apiKeySessionStorage=this.getSessionStorage("apiKey")),this.apiCCIDSessionStorage!==null?(bt.log("apiCCId exist in sessionStorage : "+this.apiCCIDSessionStorage),this.apiKeySessionStorage!==null?(bt.log("apiKey exist in sessionStorage : "+this.apiKeySessionStorage),this.apiKeySessionStorage===this.apiKey?(bt.log("apiKey is the same, keeping apiCCId"),this.apiCCId=this.apiCCIDSessionStorage):(bt.log("apiKey is not the same, generating an apiCCId"),this.apiCCId=Math.floor(1000001*Math.random()).toString(),bt.log("Creation of new ApiRTC session with Id : "+this.apiCCId))):this.apiCCId=this.apiCCIDSessionStorage):(bt.log(" No apiCCId found on sessionStorage : generating an apiCCId"),this.apiCCId=String(1e5+Math.floor(9e5*Math.random())),bt.log("Creation of new ApiRTC session with Id : "+this.apiCCId))},this.getNumericIdFromAlpha=function(Ot){bt.log("getNumericIdFromAlpha new : "+Ot);var Dt,Gt=0;if(Ot.length===0)return Gt;for(Dt=0;Dt>>0)),Gt>>>0},this.startApiCCSession=function(Ot){if(bt.debug("startApiCCSession"),this.roomMgr=new at(this,this.callback(this,"roomManagerEventHandler")),Ot.xhrPolling===!0?this.xhrPolling=!0:this.xhrPolling=!1,Ot.appId!==void 0&&(this.appId=Ot.appId),Ot.siteId!==void 0&&(this.siteId=Ot.siteId),Ot.apiKey===void 0)return bt.error('Error : Initialisation parameters: "apikey" for session creation is not defined'),null;if(bt.log("Session creation with apiKey : "+Ot.apiKey),bt.log("Session creation with apiCCId : "+Ot.apiCCId),this.apiKey=Ot.apiKey,Ot.onReady===void 0&&typeof apiRTC_React>"u")return bt.error('Error : Initialisation parameters: "onReady" for session creation is not defined'),null;if(apiCC.addEventListener("sessionReady",Ot.onReady),typeof apiRTC_React>"u"&&(this.sessionId=this.getSessionStorage("sessionId")),Ot.apiCCId===void 0||Ot.apiCCId===""||Ot.apiCCId===null)this.generateApiCCID();else if(bt.log("Session creation with apiCCId defined by user : "+Ot.apiCCId),bt.debug("params.idConversionActivated : "+Ot.idConversionActivated),Ot.idConversionActivated===void 0||Ot.idConversionActivated===!0)if((0,ot._C)(Ot.apiCCId))this.apiCCId=Ot.apiCCId.toString();else{bt.log("Converting this Id in a numeric one");var Dt=this.getNumericIdFromAlpha(Ot.apiCCId);Dt+="",bt.log("Numeric Id is : "+Dt),(0,ot._C)(Dt)?(bt.warn("Id has been converted to a numeric one"),this.apiCCId=Dt.toString()):(bt.warn("Error : Defined apiCCId :"+Ot.apiCCId+" is not numeric. ApiCCID is generated"),this.generateApiCCID())}else bt.log("String id convertion is deactivated"),this.apiCCId=Ot.apiCCId.toString();Ot.apiCCIdPersistenceTimeout!==null&&typeof Ot.apiCCIdPersistenceTimeout=="number"&&Ot.apiCCIdPersistenceTimeout>=0&&(this.apiCCIdPersistenceTimeout=Ot.apiCCIdPersistenceTimeout),this.channel!==null&&(bt.log("this.channel is defined"),delete this.channel),this.channel=new mt(this),this.channel.initialize(),Ot.nickname!==null&&Ot.nickname!==void 0?(bt.log("Nickname is defined :"+Ot.nickname),this.nickname=Ot.nickname):(bt.log("Nickname is not defined, setting to apiCCId value :"+this.apiCCId),this.nickname=this.apiCCId),Ot.photoURL!==null&&Ot.photoURL!==void 0?(bt.log("photoURL is defined :"+Ot.photoURL),this.photoURL=Ot.photoURL):(bt.log("photoURL is not defined"),this.photoURL=null)},this.reOpenChannel=function(Ot,Dt){bt.info("reOpenChannel"),this.apiCCId=Ot.toString(),this.apiKey=Dt,this.channel.socket!==void 0&&this.channel.socket!==null&&this.channel.socket.disconnect(),this.channel.channelReady=!1,this.channel.socket=null,this.channel.channelId=this.apiCCId,this.channel.initialize(),this.apiCCWebRTCClient!==null&&this.apiCCWebRTCClient.webRTCClient!==null&&(this.apiCCWebRTCClient.webRTCClient.socket=this.channel.socket)},this.onChannelOpened=function(){bt.debug("ApiCCSession onChannelOpened"),St.ApiDBActivated!==!1&&St.ApiDBActivated!==void 0&&St.ApiDBActivated!==null&&(bt.log("apiDB initialisation"),apiDB.init(this.channel.socket)),At.createSessionReadyEvent(apiCC.session.apiCCId)},this.createWebRTCClient=function(Ot){bt.debug("createWebRTCClient");var Dt={};this.apiCCWebRTCClient=new apiCC.ApiCCWebRTCClient(this),apiCC.session.apiCCWebRTCClient.webRTCClient.setGumConfigWithDevicePresent(),Dt.audioDevicePresent=apiCC.mediaDeviceMgr.audioDevicePresent,Dt.videoDevicePresent=apiCC.mediaDeviceMgr.videoDevicePresent,apiCC.session.setUserData(Dt),setTimeout(function(){At.createWebRTCClientCreatedEvent()});var Gt=apiCC.getUserMediaStreamIds(),nn=Gt.length;for(bt.debug("listing accessToLocalMedia "+nn);--nn>=0;)if(apiCC.getUserMediaStream(Gt[nn]).accessToLocalMedia()){bt.debug("setting accessToLocalMedia to true"),this.apiCCWebRTCClient.webRTCClient.accessToLocalMedia=!0;break}return this.apiCCWebRTCClient},this.createPointerSharingClient=function(){return this.apiCCPointerSharingClient===null&&(this.apiCCPointerSharingClient=new apiCC.ApiCCPointerSharingClient(this)),this.apiCCPointerSharingClient},this.closePointerSharingClient=function(){this.apiCCPointerSharingClient!==null&&this.apiCCPointerSharingClient instanceof apiCC.ApiCCPointerSharingClient&&(this.apiCCPointerSharingClient.stop(),this.apiCCPointerSharingClient=null)},this.createWhiteBoard=function(Ot,Dt,Gt,nn){return bt.info("createWhiteBoard"),this.apiCCWhiteBoardClient=apiCC.createWhiteBoard(Ot,Dt,Gt,nn),this.apiCCWhiteBoardClient},this.closeWhiteBoardClient=function(Ot){bt.info("closeWhiteBoardClient"),apiCC.closeWhiteBoardClient(Ot)},this.createIMClient=function(Ot){return bt.debug("createIMClient"),this.apiCCIMClient=new apiCC.ApiCCIMClient(this,Ot),this.apiCCIMClient},this.createDataClient=function(){return bt.info("createDataClient"),this.apiCCDataClient=new apiCC.ApiCCDataClient(this),this.apiCCDataClient},this.updatingQuery=function(Ot){bt.debug("updatingQuery");var Dt=null,Gt=null,nn=null;return Dt=(0,ot.dD)(Ot),this.userData!==void 0?(Gt=JSON.stringify(this.userData),nn=encodeURIComponent(Gt),Dt.userData=nn,(0,ot.Wc)(Dt)):Ot},this.setUserData=function(Ot,Dt){bt.debug("setUserData in session :",Ot);var Gt,nn,zt,Ft=[],un=this.userData;if(this.userData!==void 0){if(this.userData=(0,ot.S6)(this.userData,Ot),bt.debug("this.userData :",this.userData),bt.debug("actualUserData :",un),bt.debug("forceSendData :",Dt),Dt!==!0&&JSON.stringify(this.userData)===JSON.stringify(un))return void bt.debug("userData is not changed, leaving userData processing")}else this.userData=Ot;for(Gt={type:"setUserData",userData:Ot},nn=JSON.stringify(Gt),bt.log("C->S: "+nn),this.channel.socket.emit("setUserData",nn),bt.log("socket.io 1.X : socket.io.opts.query :"+this.channel.socket.io.opts.query),this.channel.socket.io.opts.query=this.updatingQuery(this.channel.socket.io.opts.query),bt.log("socket.io 1.X : after update : socket.io.opts.query :"+this.channel.socket.io.opts.query),zt=0;ztS: "+nn),this.channel.socket.emit("presenceGroupManagement",nn)):bt.debug("leaving sendPresenceGroupManagementCommand for group deactivated")}else bt.error("group parameter value is not correct, need to be a JSON array")},this.sendConversationSpaceCommand=function(Ot,Dt){var Gt,nn;bt.debug("sendConversationSpaceCommand :"+Ot+" for conversationSpace : "+Dt),Gt={type:"conversationSpaceManagement",command:Ot,conversationSpace:Dt},nn=JSON.stringify(Gt),bt.log("C->S: "+nn),this.channel.socket.emit("conversationSpaceManagement",nn)},this.joinPresenceGroup=function(Ot,Dt){var Gt=this;Dt||((Dt={}).doneByApiRTC=!1),bt.debug("joinPresenceGroup :"+Ot),Ht(Ot)===!0?(this.sendPresenceGroupManagementCommand("join",Ot),Ot.forEach(function(nn){var zt=Gt.presenceGroupAddedByApiRTC.indexOf(nn);Gt.presenceGroup.indexOf(nn)===-1&&(Gt.presenceGroup.push(nn),Dt.doneByApiRTC&&zt===-1&&Gt.presenceGroupAddedByApiRTC.push(nn)),Dt.doneByApiRTC===!1&&zt!==-1&&Gt.presenceGroupAddedByApiRTC.splice(zt,1)})):bt.log("group parameter value is not correct, need to be a JSON array"),bt.debug("this.presenceGroup :"+this.presenceGroup)},this.leavePresenceGroup=function(Ot,Dt){var Gt=this;Dt||((Dt={}).doneByApiRTC=!1),bt.debug("leavePresenceGroup :"+Ot),Ht(Ot)===!0?Ot.forEach(function(nn){var zt=Gt.presenceGroupAddedByApiRTC.indexOf(nn);if(Dt.doneByApiRTC===!1||Dt.doneByApiRTC===!0&&zt!==-1){var Ft=Gt.presenceGroup.indexOf(nn);Ft!==-1&&Gt.presenceGroup.splice(Ft,1),Gt.sendPresenceGroupManagementCommand("leave",[nn])}zt!==-1&&Gt.presenceGroupAddedByApiRTC.splice(zt,1)}):bt.log("group parameter value is not correct, need to be a JSON array"),bt.debug("this.presenceGroup :"+this.presenceGroup)},this.subscribePresenceGroup=function(Ot,Dt){var Gt=this;Dt||((Dt={}).doneByApiRTC=!1),bt.debug("subscribePresenceGroup :"+Ot),Ht(Ot)===!0?(this.sendPresenceGroupManagementCommand("subscribe",Ot),Ot.forEach(function(nn){var zt=Gt.subscribeToPresenceGroupAddedByApiRTC.indexOf(nn);Gt.subscribeToPresenceGroup.indexOf(nn)===-1&&(Gt.subscribeToPresenceGroup.push(nn),Dt.doneByApiRTC&&Gt.subscribeToPresenceGroupAddedByApiRTC.indexOf(nn)===-1&&Gt.subscribeToPresenceGroupAddedByApiRTC.push(nn)),Dt.doneByApiRTC===!1&&zt!==-1&&Gt.subscribeToPresenceGroupAddedByApiRTC.splice(zt,1)})):bt.log("group parameter value is not correct, need to be a JSON array"),bt.debug("this.subscribeToPresenceGroup :"+this.subscribeToPresenceGroup)},this.unsubscribePresenceGroup=function(Ot,Dt){var Gt=this;Dt||((Dt={}).doneByApiRTC=!1),bt.debug("unsubscribePresenceGroup :"+Ot),Ht(Ot)===!0?Ot.forEach(function(nn){var zt=Gt.subscribeToPresenceGroupAddedByApiRTC.indexOf(nn);if(Dt.doneByApiRTC===!1||Dt.doneByApiRTC===!0&&zt!==-1){var Ft=Gt.subscribeToPresenceGroup.indexOf(nn);Ft!==-1&&Gt.subscribeToPresenceGroup.splice(Ft,1),Gt.sendPresenceGroupManagementCommand("unsubscribe",[nn])}zt!==-1&&Gt.subscribeToPresenceGroupAddedByApiRTC.splice(zt,1)}):bt.log("group parameter value is not correct, need to be a JSON array"),bt.debug("this.subscribeToPresenceGroup :"+this.subscribeToPresenceGroup)},this.joinConversationSpace=function(Ot){bt.info("joinConversationSpace :"+Ot),this.sendConversationSpaceCommand("join",Ot),this.conversationSpace=Ot},this.leaveConversationSpace=function(Ot){bt.info("leaveConversationSpace :"+Ot),Ot!=null&&this.conversationSpace===Ot?(this.sendConversationSpaceCommand("leave",Ot),this.conversationSpace=null):bt.debug("socket is not in the conversationSpace, we request to leave")},this.subscribeToCloudEvent=function(Ot,Dt){this.sendCloudEventsCommand("subscribe",Ot,Dt)},this.unsubscribeToCloudEvent=function(Ot,Dt){this.sendCloudEventsCommand("unsubscribe",Ot,Dt)},this.sendCloudEventsCommand=function(Ot,Dt,Gt){if(["subscribe","unsubscribe"].includes(Ot))if(Dt&&typeof Dt=="string"){if(Gt){if(ft(Gt)!=="object")return void bt.error("wrong headers format");for(var nn=0,zt=Object.values(Gt);nnS:",vn),this.channel.socket.emit("cloudEvents",vn)}else bt.error("wrong topic format");else bt.error("wrong command")},this.getConversationList=function(Ot){bt.info("getConversationList request");var Dt,Gt;Gt=Ot!==void 0?{type:"getConversationList",lastConversationNb:Ot}:{type:"getConversationList",lastConversationNb:50},Dt=JSON.stringify(Gt),bt.log("C->S: "+Dt),this.channel.socket.emit("getConversationList",Dt)},this.receiveConversationListAnswer=function(Ot){bt.info("receiveConversationListAnswer"),bt.log("msg.convList.length :"+Ot.convList.length);var Dt,Gt=Ot.convList.length,nn=[],zt=null;for(Dt=0;DtS: "+Dt),this.channel.socket.emit("getContactOccurrencesFromConversationList",Dt)},this.receiveContactOccurrencesFromConversationListAnswer=function(Ot){bt.info("receiveContactOccurrencesFromConversationListAnswer"),bt.log("msg.contactOccurrencesTable.length :"+Ot.contactOccurrencesTable.length),At.createReceiveContactOccurrencesFromConversationListAnswerEvent(Ot.contactOccurrencesTable)},this.getConversationDetailReport=function(Ot){var Dt,Gt;bt.info("getConversationDetailReport for convId :"+Ot),Dt={type:"getConversationDetailReport",convId:Ot},Gt=JSON.stringify(Dt),bt.log("C->S: "+Gt),this.channel.socket.emit("getConversationDetailReport",Gt)},this.receiveConversationDetailReportAnswer=function(Ot){bt.info("receiveConversationDetailReportAnswer"),bt.log("msg.CDR :"+Ot.CDR),At.createReceiveConversationDetailReportAnswerEvent(Ot.CDR)},this.manageConnectedUsersList=function(Ot,Dt,Gt,nn){bt.debug("manageConnectedUsersList");var zt,Ft,un,vn=!1,yn=0,cn=!1,gn="unset";for(bt.trace("manageConnectedUsersList.length :"+Ot.length),bt.trace("this.connectedUsersList.length :"+this.connectedUsersList.length),bt.log("state :"+Dt),bt.log("group :"+Gt),un=0;un1&&arguments[1]!==void 0?arguments[1]:{},Gt=null,nn=null,zt=!1,Ft=null,un=null,vn=!1,yn=null;if(Ot.type==="invite")this.apiCCWebRTCClient?(bt.log("this.webRTCPluginActivated =",this.webRTCPluginActivated),(dt.Xh==="IE"||dt.Xh==="Safari"&&dt.PR<11)&&this.webRTCPluginActivated===!0?(bt.log("managing call with WebRTC Plugin"),apiCC.manageWebRTCPlugin(function(){bt.log("manageWebRTCPlugin cb on Invite"),apiCC.session.apiCCWebRTCClient.webRTCClient.processInvite(Ot)},function(){bt.log("actionOnInstallationNeeded"),bt.log("sending bye to be done"),new pt.S(apiCC.session.channel.socket).sendBye(Ot.callId,Ot.calleeId,Ot.roomId,Ot.callerId,"WebRTC_Plugin_Installation_needed",Ot.data)})):(bt.log("managing call with browser"),this.apiCCWebRTCClient.webRTCClient.processInvite(Ot))):bt.warn("WebRTCClient is not created");else if(Ot.type==="200OK")this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.process200OK(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="candidate")this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.processCandidate(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="bye")this.apiCCWebRTCClient?(bt.log("bye message from:"+Ot.clientId+" for callId : "+Ot.callId),this.apiCCWebRTCClient.webRTCClient.onRemoteHangup(Ot.callId,Ot.clientId,Ot.roomId,Ot.reason,Ot.confId,Ot.data)):bt.warn("WebRTCClient is not created");else if(Ot.type==="update")this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.processUpdate(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="200update")this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.process200Update(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="newConversationCreated")this.apiCCIMClient?this.apiCCIMClient.newConversationCreated(Ot):bt.warn("IMClient is not created");else if(Ot.type==="IMMessage")this.apiCCIMClient?this.apiCCIMClient.receiveMessage(Ot):bt.warn("IMClient is not created");else if(Ot.type==="groupChatCreation")this.apiCCIMClient?this.apiCCIMClient.groupChatCreation(Ot):bt.warn("IMClient is not created");else if(Ot.type==="groupChatInvitation")this.apiCCIMClient?this.apiCCIMClient.groupChatInvitation(Ot):bt.warn("IMClient is not created");else if(Ot.type==="groupChatMemberUpdate")this.apiCCIMClient?this.apiCCIMClient.groupChatMemberUpdate(Ot):bt.warn("IMClient is not created");else if(Ot.type==="addUserInGroupChatAnswer")this.apiCCIMClient?this.apiCCIMClient.addUserInGroupChatAnswer(Ot):bt.warn("IMClient is not created");else if(Ot.type==="groupChatMessage")this.apiCCIMClient?this.apiCCIMClient.receiveGroupChatMessage(Ot):bt.warn("IMClient is not created");else if(Ot.type==="conversationHistoryAnswer")this.apiCCIMClient?this.apiCCIMClient.receiveConversationHistory(Ot):bt.warn("IMClient is not created");else if(Ot.type==="getUserDataAnswer")this.apiCCIMClient?this.apiCCIMClient.receiveUserDataAnswer(Ot):bt.warn("IMClient is not created");else if(Ot.type==="fetchUserDataAnswer")this.apiCCIMClient?this.apiCCIMClient.receiveFetchUserDataAnswer(Ot):bt.warn("IMClient is not created");else if(Ot.type==="dataMessage")this.apiCCDataClient?this.apiCCDataClient.receiveData(Ot):bt.warn("DataClient is not created");else if(Ot.type==="dataAck")this.apiCCWebRTCClient.webRTCClient.processDataAck(Ot);else if(Ot.type==="dataEndAck")this.apiCCWebRTCClient.webRTCClient.processDataEndAck(Ot);else if(Ot.type==="updateVideoQuality")this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processUpdateVideoQuality(Ot.callId,Ot.profile);else if(Ot.type==="apiRTCDataMessage")if(Dt.quiet||bt.debug("apiRTCDataMessage:",Ot),(0,ot.Ym)(Ot.data,"object"))if(Ot.data.type==="joinSessionAnswer")if(this.apiCCWebRTCClient){var cn={roomName:Ot.data.roomId};(0,ot.ki)(Ot.data,"convId","string")&&(cn.convId=Ot.data.convId),(0,ot.ki)(Ot.data,["data","mode"],"string")&&(cn.data={mode:Ot.data.data.mode}),(0,ot.ki)(Ot.data,["data","transition"],"string")&&Ot.data.data.transition==="mesh2janus"?this.apiCCWebRTCClient.webRTCClient.MCUClient.changeSessionMode(cn,"mesh2janus"):this.apiCCWebRTCClient.webRTCClient.MCUClient.updateSessionAnswer(cn,{createSession:!0})}else bt.warn("WebRTCClient is not created");else if(Ot.data.type==="slowLink"){if(this.apiCCWebRTCClient){var gn={};Ot.data.advice&&(gn.advice=Ot.data.advice),this.apiCCWebRTCClient.webRTCClient.processSlowLink(Ot.data.callId,gn)}}else if(Ot.data.type==="videoQualityChanged")At.createVideoQualityChangedEvent(Ot.data.callId,Ot.data.roomId,Ot.data.hint,Ot.data.profile);else if(Ot.data.type==="distantIceError")this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processDistantIceError(Ot.data);else if(Ot.data.type==="streamTrackChanged")this.apiCCWebRTCClient&&Ot.data.hasOwnProperty("mline")&&Ot.data.hasOwnProperty("muted")&&this.apiCCWebRTCClient.webRTCClient.processStreamTrackMuteChanged(Ot.data.callId,Ot.data.mline,Ot.data.muted);else if(Ot.data.type==="streamTrackStatusChanged")this.apiCCWebRTCClient&&Ot.data.hasOwnProperty("mline")&&Ot.data.hasOwnProperty("change")&&Ot.data.hasOwnProperty(Ot.data.change)&&this.apiCCWebRTCClient.webRTCClient.processStreamTrackStatusChanged(Ot.data.callId,Ot.data.mline,Ot.data[Ot.data.change]);else if(Ot.data.type==="configureEncodings")this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processConfigureEncodings(Ot.data);else if(Ot.data.type==="activeSpeaker")this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processAudioAmplitude(Ot.data,!0);else if(Ot.data.type==="stopSpeaking")this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processAudioAmplitude(Ot.data,!1);else if(Ot.data.type==="updateStream")this.apiCCWebRTCClient&&Ot.data.callId&&Ot.data.mline&&Ot.data.direction&&this.apiCCWebRTCClient.webRTCClient.processUpdateStream(Ot.data.callId,Ot.data.mline,Ot.data.direction);else if(Ot.data.type==="startRecording"){if(this.apiCCWebRTCClient)if(Ot.data.callId==="COMPOSITE")this.apiCCWebRTCClient.webRTCClient.MCUClient.startCompositeRecording(Ot.data.mediaType,Ot.data.customIdInFilename,Ot.data.convId,Ot.data.data);else{for(yn=this.apiCCWebRTCClient.webRTCClient.callsTable.length;--yn>=0;)if(this.apiCCWebRTCClient.webRTCClient.callsTable[yn].callId===Ot.data.callId){vn=!0;break}vn?this.apiCCWebRTCClient.webRTCClient.MCUClient.startRecording(Ot.data.mediaType,Ot.data.customIdInFilename,Ot.data.convId,Ot.data.callId,Ot.data.data):bt.info("cannot start recording (call not found)")}}else if(Ot.data.type==="startStreaming"){if(this.apiCCWebRTCClient){for(yn=this.apiCCWebRTCClient.webRTCClient.callsTable.length;--yn>=0;)if(this.apiCCWebRTCClient.webRTCClient.callsTable[yn].callId===Ot.data.callId){vn=!0;break}vn?this.apiCCWebRTCClient.webRTCClient.MCUClient.startStreaming(Ot.data.service,Ot.data.server,Ot.data.streamKey,Ot.data.callId):bt.info("cannot start streaming (call not found)")}}else if(Ot.data.type==="startCallStatsMonitoring"){if(this.apiCCWebRTCClient){for(bt.debug("startCallStatsMonitoring",Ot.data.callId),yn=this.apiCCWebRTCClient.webRTCClient.callsTable.length;--yn>=0;)if(this.apiCCWebRTCClient.webRTCClient.callsTable[yn].callId===Ot.data.callId){nn=this.apiCCWebRTCClient.webRTCClient.callsTable[yn];break}nn?["chrome","firefox"].indexOf(ot.wL.type)>=0?nn.csmIntervalId?bt.debug("call stats monitoring already started"):nn.csmIntervalId=setInterval(nn.callback(nn,"csmHandler"),nn.csmIntervalMs):bt.debug("call stats are only supported on chrome and firefox"):bt.debug("no such call")}}else Ot.data.type==="callOrder"?(bt.log("callOrder received"),this.apiCCWebRTCClient?(this.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector=Ot.senderId,Gt=this.apiCCWebRTCClient.webRTCClient.callWithNumber(Ot.data.caller,!0,{MCUType:"MCU-Callee",confId:Ot.data.confId,convId:Ot.data.convId,remoteMediaStreamId:Ot.data.mediaStreamId},Ft),this.apiCCWebRTCClient.webRTCClient.myWebRTC_Event.createIncomingCallEvent(this.clientId,Ot.data.caller,Ot.data.caller,Gt,!1,1,!1,"video",!0,"web","media")):bt.warn("WebRTCClient is not created")):Ot.data.type==="subscribeOrder"?(bt.log("subscribeOrder received :",Ot.data),this.apiCCWebRTCClient?(this.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector=Ot.senderId,Ot.data.data.subscribeOrder=!0,(un=[]).push(Ot.data.stream),this.apiCCWebRTCClient.webRTCClient.MCUClient.subscribeToStreams(un,"VIDEO",Ot.data.data,Ft,{noStreamCheck:!0})):bt.warn("WebRTCClient is not created")):Ot.data.type==="distantCallEstablished"?this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processDistantCallEstablished(Ot.data):Ot.data.type==="simulcastFeedChanged"?this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processSimulcastFeedChanged(Ot.data):bt.log("msg.data.type is not managed :"+Ot.data.type);else bt.log("msg.data === undefined");else if(Ot.type==="conversationListAnswer")this.receiveConversationListAnswer(Ot);else if(Ot.type==="contactOccurrencesFromConversationListAnswer")this.receiveContactOccurrencesFromConversationListAnswer(Ot);else if(Ot.type==="conversationDetailReport")this.receiveConversationDetailReportAnswer(Ot);else if(Ot.type==="updatePresence")bt.log("updatePresence"),this.updatePresence(Ot);else if(Ot.type==="updateUserStatus")bt.log("updateUserStatus"),this.updateUserStatus(Ot);else if(Ot.type==="receiveMCUSessionId")bt.log("receiveMCUSessionId"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.receiveSessionId(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="joinSessionAnswer")bt.log("joinSessionAnswer"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.joinSessionAnswer(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="updateSessionAnswer")bt.log("updateSessionAnswer"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.updateSessionAnswer(Ot,{updateCalls:!0}):bt.warn("WebRTCClient is not created");else if(Ot.type==="availableStreams")this.apiCCWebRTCClient?(bt.log("message availableStreams received"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.newAvailableStream(Ot.msg,"regular",function(fn,Tn,_n){At.createMCUAvailableStreamEvent([Tn],fn)}):bt.warn("WebRTCClient is not created")):bt.warn("WebRTCClient is not created");else if(Ot.type==="availableReplay")this.apiCCWebRTCClient?(bt.log("message availableReplay received"),this.apiCCWebRTCClient?(zt=this.apiCCWebRTCClient.webRTCClient.MCUClient.newAvailableReplay(Ot.msg),At.createMCUAvailableReplayEvent(Ot.msg,zt)):bt.warn("WebRTCClient is not created")):bt.warn("WebRTCClient is not created");else if(Ot.type==="availableComposite")this.apiCCWebRTCClient?(bt.log("message availableComposite received"),this.apiCCWebRTCClient?(zt=this.apiCCWebRTCClient.webRTCClient.MCUClient.newAvailableStream(Ot.msg,"composite"),At.createMCUAvailableCompositeEvent(Ot.msg,zt)):bt.warn("WebRTCClient is not created")):bt.warn("WebRTCClient is not created");else if(Ot.type==="onRemoveStream")this.apiCCWebRTCClient?(bt.log("message onRemoveStream received:",Ot),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.removeMCUStream(Ot.callId,Ot.msg.id,Ot.msg.reason):bt.warn("WebRTCClient is not created")):bt.warn("WebRTCClient is not created");else if(Ot.type==="availableStreamsUpdate")this.apiCCWebRTCClient?(bt.log("message availableStreamsUpdate received"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.updateAvailableStream(Ot.msg,"regular",function(fn,Tn,_n,Un){At.createMCUAvailableStreamUpdateEvent([Tn],fn)}):bt.warn("WebRTCClient is not created")):bt.warn("WebRTCClient is not created");else if(Ot.type==="checkCallStatus")this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.processCheckCallStatus(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="MCUSessionInvitation")bt.log("MCUSessionInvitation"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.receiveSessionInvitation(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="MCUSessionInvitationToGroupChat")bt.log("MCUSessionInvitationToGroupChat"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.receiveSessionInvitation(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="participantEjected")bt.log("participantEjected"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.participantEjected(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="recordingStarted")bt.log("recordingStarted"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.recordingStarted(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="recordingStopped")bt.log("recordingStopped"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.recordingStopped(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="recordingStreamAvailable")bt.log("recordingStreamAvailable"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.recordingStreamAvailable(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="streamingStarted")bt.log("streamingStarted"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.streamingStarted(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="streamingStopped")bt.log("streamingStopped"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.MCUClient.streamingStopped(Ot):bt.warn("WebRTCClient is not created");else if(Ot.type==="sessionId")bt.log("sessionId :"+Ot.sessionId),this.sessionId=Ot.sessionId,Ot.JWTApzToken!==void 0&&this.handleJWTApzToken(Ot.JWTApzToken);else if(Ot.type==="JWTTokenRefreshAnswer")bt.log("JWTTokenRefreshAnswer"),Ot.JWTApzToken!==void 0&&this.handleJWTApzToken(Ot.JWTApzToken);else if(Ot.type==="roomCreation")bt.log("roomCreation"),this.roomMgr.roomCreation(Ot);else if(Ot.type==="roomJoin")bt.log("roomJoined"),this.roomMgr.roomJoin(Ot);else if(Ot.type==="inviteInRoomStatus")bt.log("inviteInRoomStatus"),this.roomMgr.inviteInRoomStatus(Ot);else if(Ot.type==="contactListInRoom")bt.log("contactListInRoom"),this.roomMgr.onContactListInRoom(Ot);else if(Ot.type==="roomInvitation")bt.log("roomInvitation"),this.roomMgr.roomInvitation(Ot);else if(Ot.type==="roomMessage")bt.log("roomMessage"),this.roomMgr.receiveRoomMessage(Ot);else if(Ot.type==="roomMemberUpdate")bt.log("roomMemberUpdate"),this.roomMgr.roomMemberUpdate(Ot);else if(Ot.type==="agentReconnect"){var bn=this.apiCCWebRTCClient.webRTCClient.findCallWithCallId(Ot.callId);bn!=null&&bn.getUserMediaOnCall()}else Ot.type==="sequence"?(bt.log("Sequential message"),this.handleSequentialMessage(Ot)):Ot.type==="Ack"?bt.log("Ack received"):Ot.type==="receipt"?this.apiCCWebRTCClient&&this.apiCCWebRTCClient.webRTCClient.processReceipt(Ot):Ot.type==="error"?(bt.log("error received"),this.apiCCWebRTCClient?this.apiCCWebRTCClient.webRTCClient.processError(Ot):At.createErrorEvent(Ot.errorInfo,Ot.errorCode,Ot.callId,Ot.roomId,null,null,Ot.convId)):Ot.type==="enterpriseConfig"?(bt.log("enterpriseConfig received"),this.handleEnterpriseConfigMessage(Ot)):Ot.type==="AIEMessage"?(bt.log("AIEMessage received"),this.handleAIEMessage(Ot)):Ot.type==="cloudEventOccurred"?this.processCloudEventOccurred(Ot):bt.log("Error : No type for this message")},this.handleSequentialMessage=function(Ot){if(Ot.id!==void 0&&Ot.packetNum!==void 0&&Ot.totalPacketsNum!==void 0&&Ot.data!==void 0){bt.debug("Handle sequential message packet "+Ot.packetNum+"/"+Ot.totalPacketsNum,Ot);var Dt=[];if(wt.sequentialMessagesStorage[Ot.id]!==void 0&&(Dt=wt.sequentialMessagesStorage[Ot.id]),Dt.push(Ot),wt.sequentialMessagesStorage[Ot.id]=Dt,Dt.length===Ot.totalPacketsNum){Dt.sort(function(zt,Ft){return zt.packetNum-Ft.packetNum});var Gt="";Dt.forEach(function(zt){Gt+=zt.data}),delete wt.sequentialMessagesStorage[Ot.id];var nn=null;try{nn=JSON.parse(Gt)}catch(zt){return void bt.error("Error : can't parse sequential message JSON :",zt)}if(!nn)return void bt.error("Error : can't restore sequential message, it's null");bt.debug("Restored sequential message :",Gt),wt.processSignalingMessage(nn)}}else bt.error("Error : sequential message is inconsistent :",Ot)},this.handleEnterpriseConfigMessage=function(Ot){if(bt.debug("handleEnterpriseConfigMessage :",Ot),(0,ot.ki)(Ot,"sentry","boolean")&&Ot.sentry===!0){var Dt;Dt=window!==void 0&&window.location!==void 0&&window.location.protocol!==void 0&&window.location.protocol!=="https:"?"http":"https",apiCC.loadSentry(apiCC.initApiKey,Dt)}if((0,ot.ki)(Ot,"customJson","string")&&Ot.customJson!=="")try{bt.debug("customJson :",Ot.customJson),Ot.customJson=JSON.parse(Ot.customJson)}catch(Gt){bt.error(Gt)}if((0,ot.ki)(Ot,"iceServers","string")&&Ot.iceServers!=="")try{bt.debug("iceServers :",Ot.iceServers),Ot.iceServers=JSON.parse(Ot.iceServers),wt.apiCCWebRTCClient.setPcConfig(Ot.iceServers)}catch(Gt){bt.error(Gt)}(0,ot.ki)(Ot,"logLevel","string")&&Ot.logLevel!==""&&!isNaN(parseInt(Ot.logLevel))&&apiRTC.setLogLevel(parseInt(Ot.logLevel)),(0,ot.ki)(Ot,"ccs","object")&&(wt.ccsInfo=Object.assign({},Ot.ccs))},this.handleAIEMessage=function(Ot){switch(bt.debug("handleAIEMessage :",Ot),Ot.detail){case"modelLoaded":if(apiCC!==void 0&&Ot.userMediaStreamId!==void 0){var Dt=apiCC.getUserMediaStream(Ot.userMediaStreamId).mediaFilterManager;for(var Gt in Dt.filters)Dt.filters[Gt]!==void 0&&Dt.filters[Gt].streamAIE!==null&&Dt.filters[Gt].streamAIE.modelLoaded(Ot)}break;case"unknownModelName":bt.error("Unknown model name :",Ot.modelName);break;case"loadModelError":bt.error("Error while loading model :",Ot.info);break;default:bt.debug("Unknown detail :",Ot.detail)}},this.handleJWTApzToken=function(Ot){bt.debug("handleJWTApzToken :",Ot),wt.JWTApzToken=Ot,wt.cloudIsSecured===!0?(bt.debug("Setting JWTApzToken on cloudAPI"),apiCC.CloudApi.setJWTApzToken(wt.JWTApzToken)):bt.debug("JWTApzToken is not set on cloudAPI"),wt.JWTApzTokentimeOutId!==-1&&clearTimeout(wt.JWTApzTokentimeOutId),wt.JWTApzTokentimeOutId=setTimeout(function(){var Dt=JSON.stringify({type:"JWTTokenRefreshRequest"});bt.log("C->S: "+Dt),apiCC.session.channel.socket.emit("JWTTokenRefreshRequest",Dt)},wt.JWTApzTokenRefreshTimer)},this.fetchUserData=function(Ot){var Dt,Gt;bt.debug("fetchUserData"),Dt={type:"fetchUserData",id:Ot.id,apiKey:Ot.apiKey,timeout:Ot.timeout},Gt=JSON.stringify(Dt),bt.log("C->S: "+Gt),this.channel.socket.emit("fetchUserData",Gt)}}},7323:(rt,it,s)=>{s.d(it,{q:()=>jt}),s(4363),s(9653),s(3710),s(1539),s(9714),s(561),s(2564),s(4812),s(8309),s(9753),s(9554),s(4747),s(8674),s(7042),s(1038),s(8783),s(4916),s(2526),s(1817),s(2165),s(6992),s(3948);var et=s(1549),nt=s(5945),at=s(4708);function ht(Pt,Vt){for(var Qt=0;QtPt.length)&&(Vt=Pt.length);for(var Qt=0,rn=new Array(Vt);Qt0&&arguments[0]!==void 0&&arguments[0],Jt=0,sn=0,mn=0;if(rn)for(var an=0;an0&&arguments[0]!==void 0&&arguments[0],Jt=this.mean(rn),sn=ut(Jt,3),mn=sn[0],an=sn[1],hn=sn[2],wn=0,Mn=0,xn=0;if(rn)for(var En=0;En0&&arguments[0]!==void 0&&arguments[0],Jt=this.mean(rn),sn=ut(Jt,3),mn=sn[0],an=sn[1],hn=sn[2],wn=0,Mn=0,xn=0;if(rn)for(var En=0;En0&&arguments[0]!==void 0?arguments[0]:5,Jt=new OffscreenCanvas(this.width,this.height),sn=Jt.getContext("2d");Jt.width=this.width,Jt.height=this.height,sn.putImageData(this.image,0,0),sn.filter="blur("+rn+"px)",sn.drawImage(Jt,0,0);var mn=sn.getImageData(0,0,this.width,this.height);return mn}},{key:"threshold",value:function(rn,Jt,sn){var mn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:255,an=arguments.length>4&&arguments[4]!==void 0&&arguments[4],hn=new ImageData(this.image.data,this.width,this.height),wn=0;if(an){var Mn=wn;wn=mn,mn=Mn}for(var xn=0;xn0&&arguments[0]!==void 0)||arguments[0],Jt=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3,mn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;yt(this,Pt),this.blurMask=rn,this.smoothBorder=Jt,this.blurFactor=sn,this.smoothingFactor=mn,this.maskImage=null,this.net=null}var Vt,Qt;return Vt=Pt,Qt=[{key:"loadModel",value:function(){var rn=this;return new Promise(function(Jt,sn){bodyPix.load({architecture:"MobileNetV1",outputStride:16,multiplier:.75,quantBytes:2}).then(function(mn){rn.net=mn,Jt()})})}},{key:"computeMask",value:function(rn){var Jt=this;return new Promise(function(sn,mn){Jt.net.segmentPerson(rn).then(function(an){Jt.width=an.width,Jt.height=an.height,Jt.length=Jt.width*Jt.height;for(var hn=new Uint8ClampedArray(4*Jt.length),wn=0;wn1&&arguments[1]!==void 0?arguments[1]:null;Jt===null&&(Jt=this.maskImage);for(var sn=new Uint8ClampedArray(rn.width*rn.height*4),mn=0;mn3&&arguments[3]!==void 0?arguments[3]:null;mn===null&&(mn=this.maskImage);var an=new ft(Jt,rn.width,rn.height),hn=an.weightedSumMask(sn,mn);return hn}},{key:"setBackground",value:function(rn,Jt){var sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.superposeImages(rn,rn,Jt,sn)}},{key:"blurBackground",value:function(rn){var Jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,mn=new ft(rn,rn.width,rn.height),an=mn.blur(Jt);return this.setBackground(rn,an,sn)}}],Qt&&vt(Vt.prototype,Qt),Object.defineProperty(Vt,"prototype",{writable:!1}),Pt}();function At(Pt,Vt){if(!(Pt instanceof Vt))throw new TypeError("Cannot call a class as a function")}function Nt(Pt,Vt){for(var Qt=0;Qt1&&arguments[1]!==void 0?arguments[1]:480,sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:360,mn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;At(this,Pt),this.mediaStream=rn,this.backgroundMode="none",this.backgroundBlurFactor=10,this.canvasWidth=Jt,this.canvasHeight=sn,this.length=this.canvasWidth*this.canvasHeight,this.userMediaStreamId=mn;for(var an=new Uint8ClampedArray(4*this.length),hn=0;hn<4*this.length;hn++)an[hn]=255;this.backgroundImage=new ImageData(an,this.canvasWidth,this.canvasHeight);var wn=!0,Mn=!0,xn=5,En=-1;this.backSub=new bt(wn,Mn,xn,En),this.modelLoaded=!1,this.maskStreamLaunched=!1,this.backgroundSubtractionActivated=!1}var Vt,Qt;return Vt=Pt,Qt=[{key:"setBackgroundMode",value:function(rn){this.backgroundMode=rn}},{key:"setBackgroundImage",value:function(rn){this.backgroundImage=rn}},{key:"setBackgroundBlurFactor",value:function(rn){this.backgroundBlurFactor=rn}},{key:"loadModel",value:function(){St.debug("Loading model");var rn=this;return new Promise(function(Jt,sn){rn.backSub.loadModel().then(function(mn){rn.modelLoaded=!0,St.debug("Model loaded"),Jt()})})}},{key:"getMaskStream",value:function(){var rn=document.createElement("video");rn.srcObject=this.mediaStream;var Jt=document.createElement("canvas"),sn=Jt.getContext("2d");Jt.width=this.canvasWidth,Jt.height=this.canvasHeight;var mn=document.createElement("canvas"),an=mn.getContext("2d");mn.width=this.canvasWidth,mn.height=this.canvasHeight;var hn=this;rn.addEventListener("loadeddata",function(){rn.play(),requestAnimationFrame(cr),hn.modelLoaded?kn=!0:hn.loadModel().then(function(dr){kn=!0})});for(var wn=!0,Mn=new Uint8ClampedArray(4*this.length),xn=0;xn<4*this.length;xn++)Mn[xn]=255;var En=new ImageData(Mn,this.canvasWidth,this.canvasHeight);an.putImageData(En,0,0);var kn=!1,Vn=0,Xn=!0;function cr(){sn.drawImage(rn,0,0,Jt.width,Jt.height);var dr=sn.getImageData(0,0,Jt.width,Jt.height);if(hn.modelLoaded&&wn&&kn&&(Xn||hn.backgroundMode!=="none")){Xn&&(Xn=!1);var ur=new Date;wn=!1,hn.backSub.computeMask(dr).then(function(Cr){wn=!0,1/((new Date-ur)/1e3)<1&&++Vn>=10&&(kn=!1,St.error("The segmentation process cannot be handled"),wt.createBackgroundSubstractionStopComputeTimeEvent(hn.userMediaStreamId))})}hn.modelLoaded&&hn.backSub.maskImage!==null&&kn?an.putImageData(hn.backSub.maskImage,0,0):an.putImageData(En,0,0),hn.continueMaskComputation?requestAnimationFrame(cr):(St.debug("Mask computation stoped"),hn.continueMaskComputation=!0)}return this.continueMaskComputation=!0,this.maskMediaStream=mn.captureStream(),this.maskStreamLaunched=!0,this.maskMediaStream}},{key:"activateBackgroundSubtraction",value:function(){var rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(rn!==null&&this.setBackgroundMode(rn),this.backgroundSubtractionActivated)return this.processedMediaStream;this.maskStreamLaunched||this.getMaskStream();var Jt=document.createElement("video");Jt.srcObject=this.mediaStream;var sn=document.createElement("video");sn.srcObject=this.maskMediaStream;var mn=document.createElement("canvas"),an=mn.getContext("2d");mn.width=this.canvasWidth,mn.height=this.canvasHeight;var hn=document.createElement("canvas"),wn=hn.getContext("2d");hn.width=this.canvasWidth,hn.height=this.canvasHeight,this.continueBackgroundSubtraction=!0;var Mn=this;function xn(){an.drawImage(Jt,0,0,mn.width,mn.height);var En=an.getImageData(0,0,mn.width,mn.height);if(Mn.backgroundMode==="none")wn.putImageData(En,0,0);else{an.drawImage(sn,0,0,mn.width,mn.height);var kn=an.getImageData(0,0,mn.width,mn.height),Vn=null;switch(Mn.backgroundMode){case"image":Vn=Mn.backSub.setBackground(En,Mn.backgroundImage,kn);break;case"blur":default:Vn=Mn.backSub.blurBackground(En,Mn.backgroundBlurFactor,kn);break;case"transparent":Vn=Mn.backSub.applyTransparency(En,kn)}wn.putImageData(Vn,0,0)}Mn.continueBackgroundSubtraction?requestAnimationFrame(xn):(St.debug("Mask application stoped"),Mn.continueBackgroundSubtraction=!0)}return Jt.addEventListener("loadeddata",function(){Jt.play(),sn.play(),requestAnimationFrame(xn)}),this.processedMediaStream=hn.captureStream(30),this.backgroundSubtractionActivated=!0,this.processedMediaStream}},{key:"deactivateBackgroundSubtraction",value:function(){this.setBackgroundMode("none"),this.processedMediaStream=this.mediaStream,this.backgroundSubtractionActivated=!1,this.continueBackgroundSubtraction=!1,this.maskMediaStream=null,this.maskStreamLaunched=!1,this.continueMaskComputation=!1}}],Qt&&Nt(Vt.prototype,Qt),Object.defineProperty(Vt,"prototype",{writable:!1}),Pt}();function Ht(Pt){return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Vt){return typeof Vt}:function(Vt){return Vt&&typeof Symbol=="function"&&Vt.constructor===Symbol&&Vt!==Symbol.prototype?"symbol":typeof Vt},Ht(Pt)}function Ot(Pt,Vt){for(var Qt=0;Qt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var an,hn=nn(rn);if(Jt){var wn=nn(this).constructor;an=Reflect.construct(hn,arguments,wn)}else an=hn.apply(this,arguments);return Gt(this,an)});function mn(){var an;return function(hn,wn){if(!(hn instanceof wn))throw new TypeError("Cannot call a class as a function")}(this,mn),(an=sn.call(this)).streamSegmentation=null,an.userMediaStreamId=null,an}return Vt=mn,(Qt=[{key:"applyFilter",value:function(an,hn){var wn=this;zt.debug("Apply filter with descriptor:",hn);var Mn=an.getAudioTracks();Mn.length>0&&Mn.forEach(function(kn){an.removeTrack(kn)});var xn=an.getVideoTracks();if(xn.length===0)return Promise.reject("MediaStream has no video tracks");var En=xn[0].getSettings();return hn.options!==void 0&&hn.options.userMediaStreamId!==void 0&&(this.userMediaStreamId=hn.options.userMediaStreamId),this.streamSegmentation=new Mt(an,En.width,En.height,this.userMediaStreamId),this.loadTensorflow().then(function(kn){return wn.loadTensorflowModel()}).then(function(kn){return new Promise(function(Vn,Xn){zt.debug("Model loading..."),wn.streamSegmentation.loadModel().then(function(cr){zt.debug("Model loaded");var dr=null;hn.options!==void 0&&hn.options.backgroundMode!==void 0&&(hn.options.backgroundMode==="image"&&hn.options.image instanceof ImageData&&wn.streamSegmentation.setBackgroundImage(hn.options.image),dr=hn.options.backgroundMode);var ur=wn.streamSegmentation.activateBackgroundSubtraction(dr);Mn.forEach(function(Cr){ur.addTrack(Cr)}),Vn(ur)})})}).catch(function(kn){return Promise.reject(kn)})}},{key:"release",value:function(){this.streamSegmentation.deactivateBackgroundSubtraction(),this.streamSegmentation=null}},{key:"loadTensorflow",value:function(){return zt.debug("Tensorflow script loading..."),new Promise(function(an,hn){var wn={async:!0,numRetries:20,reqdelay:200,success:function(){zt.debug("Tensorflow script loaded"),an()},error:function(Mn){hn("Resources loading failed, depsNotFound: "+Mn)},retrycb:function(Mn,xn){zt.warn("Tensorflow loading retry :"+Mn+" ,delay before retry :"+xn)}};apiCC.resourcesLoader.loadjs(["https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.2"],"tensorflow",wn)})}},{key:"loadTensorflowModel",value:function(){return zt.debug("Tensorflow model script loading..."),new Promise(function(an,hn){var wn={async:!0,numRetries:20,reqdelay:200,success:function(){zt.debug("Tensorflow model script loaded"),an()},error:function(Mn){hn("Resources loading failed, depsNotFound: "+Mn)},retrycb:function(Mn,xn){zt.warn("Tensorflow model loading retry :"+Mn+" ,delay before retry :"+xn)}};apiCC.resourcesLoader.loadjs(["https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix@2.0"],"tensorflow-model",wn)})}}])&&Ot(Vt.prototype,Qt),Object.defineProperty(Vt,"prototype",{writable:!1}),mn}(dt);function un(Pt,Vt){var Qt=typeof Symbol<"u"&&Pt[Symbol.iterator]||Pt["@@iterator"];if(!Qt){if(Array.isArray(Pt)||(Qt=function(hn,wn){if(hn){if(typeof hn=="string")return vn(hn,wn);var Mn=Object.prototype.toString.call(hn).slice(8,-1);return Mn==="Object"&&hn.constructor&&(Mn=hn.constructor.name),Mn==="Map"||Mn==="Set"?Array.from(hn):Mn==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Mn)?vn(hn,wn):void 0}}(Pt))||Vt&&Pt&&typeof Pt.length=="number"){Qt&&(Pt=Qt);var rn=0,Jt=function(){};return{s:Jt,n:function(){return rn>=Pt.length?{done:!0}:{done:!1,value:Pt[rn++]}},e:function(hn){throw hn},f:Jt}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var sn,mn=!0,an=!1;return{s:function(){Qt=Qt.call(Pt)},n:function(){var hn=Qt.next();return mn=hn.done,hn},e:function(hn){an=!0,sn=hn},f:function(){try{mn||Qt.return==null||Qt.return()}finally{if(an)throw sn}}}}function vn(Pt,Vt){(Vt==null||Vt>Pt.length)&&(Vt=Pt.length);for(var Qt=0,rn=new Array(Vt);Qt1&&arguments[1]!==void 0?arguments[1]:.2,rn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Jt=Pt.yolo,sn={yolo:[]},mn=un(Jt);try{for(mn.s();!(Vt=mn.n()).done;){var an=Vt.value,hn=an.objectness;if(hn>Qt)if(rn!==null){var wn,Mn=an.bounding_box,xn=yn(Mn),En=0,kn=null,Vn=0,Xn=un(Jt);try{for(Xn.s();!(wn=Xn.n()).done;){var cr=wn.value,dr=cr.bounding_box,ur=cn(Mn,dr);ur!==1&&ur>En&&(En=ur,kn=cr,Vn=yn(cr.bounding_box))}}catch(Cr){Xn.e(Cr)}finally{Xn.f()}(kn===null||En0&&(xn=Mn+.75*(1-Mn)*Vn*kn.objectness)}}}catch(cr){En.e(cr)}finally{En.f()}var Xn={class:hn,objectness:xn,bounding_box:wn};Jt.yolo.push(Xn)}}catch(cr){sn.e(cr)}finally{sn.f()}return Jt}function fn(Pt,Vt){return function(Qt){if(Array.isArray(Qt))return Qt}(Pt)||function(Qt,rn){var Jt=Qt==null?null:typeof Symbol<"u"&&Qt[Symbol.iterator]||Qt["@@iterator"];if(Jt!=null){var sn,mn,an=[],hn=!0,wn=!1;try{for(Jt=Jt.call(Qt);!(hn=(sn=Jt.next()).done)&&(an.push(sn.value),!rn||an.length!==rn);hn=!0);}catch(Mn){wn=!0,mn=Mn}finally{try{hn||Jt.return==null||Jt.return()}finally{if(wn)throw mn}}return an}}(Pt,Vt)||function(Qt,rn){if(Qt){if(typeof Qt=="string")return Tn(Qt,rn);var Jt=Object.prototype.toString.call(Qt).slice(8,-1);return Jt==="Object"&&Qt.constructor&&(Jt=Qt.constructor.name),Jt==="Map"||Jt==="Set"?Array.from(Qt):Jt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Jt)?Tn(Qt,rn):void 0}}(Pt,Vt)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Tn(Pt,Vt){(Vt==null||Vt>Pt.length)&&(Vt=Pt.length);for(var Qt=0,rn=new Array(Vt);Qt0&&arguments[0]!==void 0?arguments[0]:0;this.memoryTime=rn,this.log=!0}},{key:"stopLogs",value:function(){this.log=!1,this.memoryTime=0}},{key:"activateSnapshots",value:function(){var rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.snapshot=!0,this.minSnapshotPeriod=rn}},{key:"stopSnapshots",value:function(){this.snapshot=!1,this.minSnapshotPeriod=0}},{key:"activateAnnotations",value:function(){this.lastAnnotations={yolo:[]},this.drawAnnotationsBool=!0,this.getAnnotations()}},{key:"stopAnnotations",value:function(){this.drawAnnotationsBool=!1}},{key:"getAnnotations",value:function(){var rn=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],Jt=document.createElement("video");Jt.srcObject=this.mediaStream;var sn=document.createElement("canvas"),mn=sn.getContext("2d");sn.width=this.canvasWidth,sn.height=this.canvasHeight;var an=document.createElement("canvas"),hn=an.getContext("2d");an.width=this.canvasWidth,an.height=this.canvasHeight;var wn=this;function Mn(br,Ir){for(var kr=br.split(","),Mr=kr[0].match(/:(.*?);/)[1],jr=atob(kr[1]),Wr=jr.length,Qr=new Uint8Array(Wr);Wr--;)Qr[Wr]=jr.charCodeAt(Wr);return new File([Qr],Ir,{type:Mr})}Jt.addEventListener("loadeddata",function(){Jt.play(),requestAnimationFrame(function(){_r(wn.aieUrl,wn.token,wn.loadedModel)})});var xn=!0,En={},kn=null,Vn=new Date;function Xn(br,Ir,kr){var Mr=Mn(sn.toDataURL("image/jpeg")),jr={pipelineCallId:wn.getOrCreatePipeline(),file:Mr,transferType:"plugin",pluginName:"httpPost",pluginData:{url:br,headers:{Authorization:"Token "+Ir},formData:{file:"$DATA",angled:1,model:kr,size:wn.resinzingSize}}};apiCC.session.apiCCWebRTCClient.webRTCClient.pushData(null,jr,null,{success:function(Wr){var Qr=(new Date-kn)/1e3,er=1/Qr;return Un.debug("Computation time:",Qr,"s ,FPS:",er),_r(br,Ir,kr),Wr.data.error!==void 0?Un.error("http post error :",Wr.data.error):Wr.data.result===void 0?Un.error("An error occured when trying to annotate a snapshot"):void cr(Wr.data)},failure:function(Wr,Qr,er){Un.error("## pushData:failure",Qr,er,Wr)}})}function cr(br){var Ir=br.result;wn.isReleased||(wn.lastRawAnnotations=Ir,Ir.yolo!==void 0&&ur(Ir),Ir.ocr===void 0&&Ir.codes===void 0||dr(Ir))}function dr(br){wn.lastAnnotations={ocr:br.ocr,codes:br.codes};var Ir="";if(br.ocr.length>1){Ir+="Words found : ";for(var kr=0;kr1){Ir+="Codes found : ";for(var Mr=0;Mr0&&(rn&&(br=bn(wn.lastRawAnnotations,br)),wn.scoreThresh!==null&&(br=gn(br,wn.scoreThresh)));for(var Ir={yolo:[]},kr={},Mr=wn.classFilter.split(", "),jr=0;jr1e3*wn.memoryTime)&&(En[nr]=Qr)}var Nr=er.sort().join(" ");Nr!==""&&(Cr(Nr),Sr())}}function Cr(br){wn.log&&Pn.createAIELogEvent(wn.userMediaStreamId,br)}function Sr(){if(wn.snapshot){var br=new Date,Ir=mn.getImageData(0,0,sn.width,sn.height);if(br-Vn>1e3*wn.minSnapshotPeriod){hn.putImageData(Ir,0,0),wn.drawAnnotations(wn.lastAnnotations,hn,wn.drawingConfig);var kr=an.toDataURL("image/png"),Mr=new Image;Mr.src=kr,Pn.createAIESnapshotEvent(wn.userMediaStreamId,Mr),Vn=br}}}function _r(br,Ir,kr){mn.drawImage(Jt,0,0,sn.width,sn.height),(xn||wn.drawAnnotationsBool)&&(xn&&(xn=!1),kn=new Date,Xn(br,Ir,kr))}}},{key:"getOrCreatePipeline",value:function(){if(this.callId!==null)return this.callId;var rn=this;return this.callId=apiCC.session.apiCCWebRTCClient.webRTCClient.pushData(null,{transferType:"pipeline"},null,{failure:function(Jt){Jt==="dataChannelClosed"?(Un.debug("dataChannelClosed : no activity on dataChannel timeout"),rn.callId=null):Un.error("dataChannel failure",Jt)}}),this.callId}},{key:"drawAnnotations",value:function(rn,Jt){var sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},mn=sn.color||"#ED5131",an=sn.textColor||"#FFFFFF",hn=sn.colorMap||null,wn=Object.prototype.hasOwnProperty.call(sn,wn)?sn.lineWidth:3,Mn=sn.font||"15px Arial";if(rn.yolo!==void 0&&rn.yolo.length>0)for(var xn=0;xn0){Mn=sn.font||"25px Arial";for(var br=0;br0){Mn=sn.font||"25px Arial";for(var Tr=0;Tr"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var an,hn=jn(rn);if(Jt){var wn=jn(this).constructor;an=Reflect.construct(hn,arguments,wn)}else an=hn.apply(this,arguments);return qn(this,an)});function mn(){var an;return function(hn,wn){if(!(hn instanceof wn))throw new TypeError("Cannot call a class as a function")}(this,mn),(an=sn.call(this)).userMediaStreamId=null,an.streamAIE=null,an}return Vt=mn,(Qt=[{key:"applyFilter",value:function(an,hn){var wn=this;return new Promise(function(Mn,xn){if(Fn.debug("Apply filter with descriptor :",hn),hn.options===void 0&&xn("Filter options object required"),hn.options.modelName===void 0)xn("modelName options required");else{var En=an.getAudioTracks();En.length>0&&En.forEach(function(kn){an.removeTrack(kn)}),wn.streamAIE=new In(an,hn.options),wn.streamAIE.loadModel().then(function(kn){En.forEach(function(Vn){kn.addTrack(Vn)}),Mn(kn)}).catch(function(kn){xn(kn)})}})}},{key:"release",value:function(){this.streamAIE.release()}}])&&On(Vt.prototype,Qt),Object.defineProperty(Vt,"prototype",{writable:!1}),mn}(dt);function on(Pt){return on=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Vt){return typeof Vt}:function(Vt){return Vt&&typeof Symbol=="function"&&Vt.constructor===Symbol&&Vt!==Symbol.prototype?"symbol":typeof Vt},on(Pt)}function Hn(Pt,Vt){for(var Qt=0;Qt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var an,hn=$n(rn);if(Jt){var wn=$n(this).constructor;an=Reflect.construct(hn,arguments,wn)}else an=hn.apply(this,arguments);return zn(this,an)});function mn(){var an;return function(hn,wn){if(!(hn instanceof wn))throw new TypeError("Cannot call a class as a function")}(this,mn),(an=sn.call(this)).mediaStream=null,an.mediaStreamSettings=null,an.processedMediaStream=null,an.net=null,an.lossRatio=null,an.processBackground=!1,an.bgImageData=null,an.videoElement=document.createElement("video"),an.canvas=document.createElement("canvas"),an.canvasContext=an.canvas.getContext("2d"),an}return Vt=mn,(Qt=[{key:"applyFilter",value:function(an,hn){var wn=this;return new Promise(function(Mn,xn){var En=an.getAudioTracks();En.length>0&&En.forEach(function(kn){an.removeTrack(kn)}),wn.loadTensorflow().then(function(){wn.loadTensorflowModel().then(function(){wn.videoElement.srcObject=an;var kn=wn;wn.videoElement.addEventListener("loadeddata",function(){kn.videoElement.play(),kn.mediaStream=an,kn.descriptors=hn,kn.processedMediaStream=kn.canvas.captureStream(),kn.mediaStreamSettings=kn.mediaStream.getVideoTracks()[0].getSettings(),kn.videoElement.height=240,kn.lossRatio=kn.mediaStreamSettings.height/kn.videoElement.height,kn.videoElement.width=kn.videoElement.height*kn.mediaStreamSettings.aspectRatio,kn.videoElement.onplaying=function(){kn.canvas.height=kn.videoElement.videoHeight,kn.canvas.width=kn.videoElement.videoWidth},kn.loadBodyPix().then(function(){En.forEach(function(Vn){kn.processedMediaStream.addTrack(Vn)}),Mn(kn.processedMediaStream)}).catch(function(Vn){Jn.error(Vn)})})}).catch(function(kn){Jn.error(kn)})}).catch(function(kn){Jn.error(kn)})})}},{key:"loadTensorflow",value:function(){return Jn.debug("Tensorflow script loading..."),new Promise(function(an,hn){var wn={async:!0,numRetries:20,reqdelay:200,success:function(){Jn.debug("Tensorflow script loaded"),an()},error:function(Mn){hn("Resources loading failed, depsNotFound: "+Mn)},retrycb:function(Mn,xn){Jn.warn("Tensorflow loading retry :"+Mn+" ,delay before retry :"+xn)}};apiCC.resourcesLoader.loadjs(["https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.2"],"tensorflow",wn)})}},{key:"loadTensorflowModel",value:function(){return Jn.debug("Tensorflow model script loading..."),new Promise(function(an,hn){var wn={async:!0,numRetries:20,reqdelay:200,success:function(){Jn.debug("Tensorflow model script loaded"),an()},error:function(Mn){hn("Resources loading failed, depsNotFound: "+Mn)},retrycb:function(Mn,xn){Jn.warn("Tensorflow model loading retry :"+Mn+" ,delay before retry :"+xn)}};apiCC.resourcesLoader.loadjs(["https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix@2.0"],"tensorflow-model",wn)})}},{key:"loadBodyPix",value:function(){var an=this;return new Promise(function(hn,wn){bodyPix.load({multiplier:.75,stride:32,quantBytes:4}).then(function(Mn){an.net=Mn,an.perform(),hn()}).catch(function(Mn){return wn(Mn)})})}},{key:"perform",value:function(){if(this.descriptors.options!==void 0&&this.descriptors.options.backgroundMode!==void 0)switch(this.processBackground=!0,this.descriptors.options.backgroundMode){case"blur":Jn.warn("This method is deprecated, please use Stream#blur method now."),this.videoElement.height=this.mediaStreamSettings.height,this.videoElement.width=this.mediaStreamSettings.width,this.canvas.height=this.videoElement.height,this.canvas.width=this.videoElement.width,this.blurBackground();break;case"transparent":this.noBackground();break;case"image":this.descriptors.options.image!==void 0?(this.resizeImageData(this.descriptors.options.image),this.imageBackground()):Jn.error("image option is required when creating the filter");break;default:Jn.debug("The backgroundMode : ",this.descriptors.options.backgroundMode," is not implemented. Refer to documentation for accepted values."),this.blurBackground()}else Jn.error("backgroundMode option is required")}},{key:"blurBackground",value:function(){var an=this;this.net.segmentPerson(this.videoElement).then(function(hn){an.blurBackground(),bodyPix.drawBokehEffect(an.canvas,an.videoElement,hn,9,2,!1)})}},{key:"noBackground",value:function(){var an=this;this.net.segmentPerson(this.videoElement).then(function(hn){an.canvasContext.drawImage(an.videoElement,0,0,an.videoElement.width,an.videoElement.height);for(var wn=an.canvasContext.getImageData(0,0,an.videoElement.width,an.videoElement.height),Mn=wn.data,xn=0;xn=wn?this.scaleImageData(an,hn):this.scaleImageData(an,wn)}},{key:"noBackgroundWithFullResolution",value:function(){var an=this;this.net.segmentPerson(this.videoElement).then(function(hn){an.canvasContext.drawImage(an.videoElement,0,0,an.canvas.width,an.canvas.height);for(var wn=an.canvasContext.getImageData(0,0,an.canvas.width,an.canvas.height),Mn=new Uint8ClampedArray(4*hn.width*hn.height),xn=0;xn=Pt.length?{done:!0}:{done:!1,value:Pt[rn++]}},e:function(hn){throw hn},f:Jt}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var sn,mn=!0,an=!1;return{s:function(){Qt=Qt.call(Pt)},n:function(){var hn=Qt.next();return mn=hn.done,hn},e:function(hn){an=!0,sn=hn},f:function(){try{mn||Qt.return==null||Qt.return()}finally{if(an)throw sn}}}}function Tt(Pt,Vt){(Vt==null||Vt>Pt.length)&&(Vt=Pt.length);for(var Qt=0,rn=new Array(Vt);Qt=15&&apiRTC.browserDetails.type!=="chrome"?this.gum_config={audio:!0,video:!0}:nt.Xh==="Chrome"&&nt.PR<49||nt.Xh==="Firefox"&&nt.PR<50?this.gum_config={audio:{mandatory:{},optional:[]},video:{mandatory:{},optional:[]}}:this.gum_config={audio:{},video:{}},this.inputs={},this.callbacks={},this.callType=null,this.audio=!1,this.audioDeviceLabel=null,this.audioMuted=!1,this.audioSilent=!1,this.video=!1,this.videoDeviceLabel=null,this.videoMuted=!1,this.videoSilent=!1,this.stream=null,this.streamStolen=!1,this.notifyUserMediaSuccess=!0,this.notifyUserMediaStop=!0,apiCC.session!==null&&apiCC.session!==void 0?this.tryAudioCallAfterUserMediaError=apiCC.session.tryAudioCallAfterUserMediaError:this.tryAudioCallAfterUserMediaError=!1,this.callInfoList=[],this.iOSMediaSelectionWorkAroundApplied=!1,this.getUserMediaTimeoutId=null,at.wL.type==="chrome"&&at.wL.version>=72&&at.wL.version<=73?this.displayMediaStreamConstraints={video:!0,audio:!1}:this.displayMediaStreamConstraints={video:!0,audio:!0},this.forceExtensionOnChrome=!1,this.filters=null,this.mediaFilterManager=null,this.videoSettings=!1,this.getVideoTrack=function(){if(!this.stream||typeof this.stream.getVideoTracks!="function")return null;var Pt=this.stream.getVideoTracks();return Pt&&Pt.length===1?Pt[0]:null},this.release=function(){var Pt=0,Vt=null,Qt=null,rn=null;if(Rt.debug("[ApiCCUserMediaStream] release; userMediaStreamId: "+this.userMediaStreamId),this.mediaFilterManager!==null&&(this.mediaFilterManager.release(),this.mediaFilterManager=null),apiCC.audioProcessor.stopAudioNodeCtx(this.nodeCtx),apiRTC.userAgentInstance!==void 0&&apiRTC.userAgentInstance!==null&&apiRTC.userAgentInstance.apiRTCStreamsList!==void 0&&apiRTC.userAgentInstance.apiRTCStreamsList!==null&&apiRTC.userAgentInstance.apiRTCStreamsList.delete(Number(this.userMediaStreamId)),this.stream!==null){if(this.streamStolen!==!0)if(typeof cordova<"u"&&cordova.plugins!==void 0&&cordova.plugins.iosrtc!==void 0)cordova!==void 0&&cordova.plugins!==void 0&&cordova.plugins.iosrtc!==void 0&&(Rt.debug("[ApiCCUserMediaStream] release on iosrtc cordova"),this.stream.onended=null);else if(nt.Xh==="Chrome"&&nt.PR<45||nt.Xh==="Firefox"&&nt.PR<44||nt.Xh==="Opera"&&nt.PR<34||nt.Xh==="Chromium"&&nt.PR<44||nt.Xh==="Chrome WebView"&&nt.PR<45)this.stream.onended=null,this.stream.stop();else for(this.stream.onended=null,Pt=(Vt=this.stream.getTracks()).length;--Pt>=0;)Vt[Pt].onended=null,Vt[Pt].stop();this.stream=null,this.streamStolen=!1,this.notifyUserMediaStop===!0&&((rn=this.getOwnerCallInfo())!==null&&(Qt=rn.callId),Lt.createUserMediaStopEvent(Qt,this.callType,this.userMediaStreamId)),this.callbacks.release(this)}},this.getUserMedia=function(){var Pt=this;if(Rt.debug("[ApiCCUserMediaStream] getUserMedia; userMediaStreamId: "+this.userMediaStreamId),this.stream===null)try{if(this.callType==="media")this.gum_config=apiCC.setAudioSourceIdInConstraint(this.inputs.audioSourceId,this.gum_config),this.gum_config=apiCC.setVideoSourceIdInConstraint(this.inputs.videoSourceId,this.gum_config),this.gum_config=apiCC.setVideoFacingModeInConstraint(this.inputs.facingMode,this.gum_config);else if(this.callType==="audio")this.gum_config=apiCC.setAudioSourceIdInConstraint(this.inputs.audioSourceId,this.gum_config),this.gum_config.video=!1;else{if(this.callType!=="videoOnly")return function(Vt){for(var Qt=apiCC.userMediaStreamTable.length;--Qt>=0;)if(apiCC.userMediaStreamTable[Qt].userMediaStreamId===Vt){apiCC.userMediaStreamTable.splice(Qt,1);break}}(this.userMediaStreamId),void setTimeout(this.callbacks.failure.bind(this,this,"wrong type"));this.gum_config.audio=!1,this.gum_config=apiCC.setVideoSourceIdInConstraint(this.inputs.videoSourceId,this.gum_config),this.gum_config=apiCC.setVideoFacingModeInConstraint(this.inputs.facingMode,this.gum_config)}apiCC.checkConstraintDependingOnDevice(this.gum_config),nt.Xh==="IE"&&nt.dc>8?apiCC.getUserMediaWithCB(this.gum_config,this.callback(this,"onUserMediaSuccess"),this.callback(this,"onUserMediaError")):(nt.Xh!=="Chrome"&&nt.Xh!=="Mobile Chrome"||this.isUserMediaAccessAllowed()===!0&&(this.getUserMediaTimeoutId=setTimeout(function(){Pt.onUserMediaError("timeout")},1e4)),apiCC.getUserMedia(this.gum_config).then(this.callback(this,"onUserMediaSuccess")).catch(this.callback(this,"onUserMediaError")))}catch(Vt){Rt.error("getUserMedia() failed. Is this a WebRTC capable browser?"),Rt.log("getUserMedia failed with exception: "+Vt.message)}},this.listenForMuteEvents=function(){var Pt,Vt=this,Qt=function(mn){var an=null,hn=null;mn.onmute=function(wn){Rt.debug("mute event :",mn),mn.kind==="audio"&&an===null?an=setTimeout(function(){Vt.audioSilent=!0,an=null,Vt.notifyMLineMuted(mn.kind,!0,"muted")},2520):mn.kind==="video"&&hn===null&&(hn=setTimeout(function(){Vt.videoSilent=!0,hn=null,Vt.notifyMLineMuted(mn.kind,!0,"muted")},2520))},mn.onunmute=function(wn){Rt.debug(mn.kind+" unmute event"),mn.kind==="audio"&&an!==null?(clearTimeout(an),an=null):mn.kind==="video"&&hn!==null?(clearTimeout(hn),hn=null):(mn.kind==="audio"?Vt.audioSilent=!1:mn.kind==="video"&&(Vt.videoSilent=!1),Vt.notifyMLineMuted(mn.kind,!1,"muted"))},mn.onended=function(wn){Rt.debug(mn.kind+" ended event"),mn.kind==="audio"&&an!==null?(clearTimeout(an),an=null):mn.kind==="video"&&(hn!==null&&(clearTimeout(hn),hn=null),Vt.callType!=="screenSharing"&&Vt.callType!=="screenSharingWithAudio"||Vt.stopScreenSharing())}},rn=st(this.stream.getVideoTracks());try{for(rn.s();!(Pt=rn.n()).done;)Qt(Pt.value)}catch(mn){rn.e(mn)}finally{rn.f()}var Jt,sn=st(this.stream.getAudioTracks());try{for(sn.s();!(Jt=sn.n()).done;)Qt(Jt.value)}catch(mn){sn.e(mn)}finally{sn.f()}this.callType!=="screenSharing"&&this.callType!=="screenSharingWithAudio"||(this.stream.onended=this.callback(this,"stopScreenSharing"))},this.onUserMediaSuccess=function(Pt){var Vt=this;this.applyFiltersIfNeeded(Pt).then(function(Qt){var rn=null,Jt=null,sn=!1,mn=Vt.getOwnerCallInfo(),an=Vt.getCall(mn);Rt.info("[ApiCCUserMediaStream] onUserMediaSuccess; userMediaStreamId: "+Vt.userMediaStreamId),Vt.getUserMediaTimeoutId!==null&&(clearTimeout(Vt.getUserMediaTimeoutId),Vt.getUserMediaTimeoutId=null),an&&(Rt.debug("call exist"),Jt=an.callee?an.callerId:an.calleeId,sn=an.restarted),Vt.updateMediaProperties(Qt),Vt.stream=Qt,nt.Xh!=="Chrome"&&nt.Xh!=="Mobile Safari"||Vt.setUserMediaAccessAllowed(!0),Vt.notifyUserMediaSuccess===!0&&(mn&&(rn=mn.callId),Lt.createUserMediaSuccessEvent(rn!==null,Vt.audio,Vt.audioDeviceLabel,Vt.video,Vt.videoDeviceLabel,Vt.callType,rn,Qt,Jt,sn,Vt.userMediaStreamId)),Vt.listenForMuteEvents(),Rt.debug("Starting a new getMediaDevices after userMediaSuccess"),apiCC.mediaDeviceMgr.getMediaDevices("updatedAfterGetUserMediaSuccess"),Vt.callbacks.success(Vt)})},this.updateMediaProperties=function(Pt){var Vt=!1,Qt="Unknown",rn="Unknown",Jt=!1,sn="Unknown";Pt.getAudioTracks().length>0&&(Vt=!0,Pt.getAudioTracks()[0].label&&(Qt=Pt.getAudioTracks()[0].label,rn=Pt.getAudioTracks()[0].id,apiCC.audioProcessor.listenToAudio(Pt,this)),Pt.getAudioTracks()[0].enabled===!1&&(this.audioMuted=!0),Pt.getAudioTracks()[0].muted===!0&&(this.audioSilent=!0)),Pt.getVideoTracks().length>0&&(Jt=!0,Pt.getVideoTracks()[0].label&&(sn=Pt.getVideoTracks()[0].label),Pt.getVideoTracks()[0].enabled===!1&&(this.videoMuted=!0),Pt.getVideoTracks()[0].muted===!0&&(this.videoSilent=!0)),this.audio=Vt,this.audioDeviceLabel=Qt,this.audioDeviceId=rn,this.video=Jt,this.videoDeviceLabel=sn},this.manageFailure=function(Pt){var Vt={};kt(Pt)==="object"?(Vt.message=Pt.message,Vt.code=Pt.code,Vt.name=Pt.name):Vt=Pt,this.callbacks.failure(this,Vt)},this.onUserMediaError=function(Pt){var Vt=function(sn){for(var mn=apiCC.userMediaStreamTable.length;--mn>=0;)if(apiCC.userMediaStreamTable[mn].userMediaStreamId===sn){apiCC.userMediaStreamTable.splice(mn,1);break}},Qt=null,rn=this.getOwnerCallInfo();if(Rt.info("[ApiCCUserMediaStream] onUserMediaError; userMediaStreamId: "+this.userMediaStreamId+", error: "+Pt),this.getUserMediaTimeoutId!==null&&(Pt!=="timeout"&&clearTimeout(this.getUserMediaTimeoutId),this.getUserMediaTimeoutId=null),nt.$6!=="electron"&&(nt.Xh==="Chrome"||nt.Xh==="Mobile Chrome")&&nt.PR>47&&window.location.protocol!=="https:"&&Rt.error("HTTPS is now mandatory to use getUserMedia()"),rn!==null&&(Qt=rn.callId),this.callType==="media"&&nt.ag.name==="iOS"&&nt.Xh==="Mobile Safari"&&this.iOSMediaSelectionWorkAroundApplied===!1||Lt.createUserMediaErrorEvent(Qt!==null,this.callType,Pt,this.userMediaStreamId,Qt,this.tryAudioCallAfterUserMediaError,this.gum_config),Pt!=="timeout"&&this.callType==="media")if(nt.ag.name==="iOS"&&nt.Xh==="Mobile Safari"&&this.iOSMediaSelectionWorkAroundApplied===!1){Rt.warn("try mediaDevice selection workaround on iOS / Mobile Safari - after MediaError"),this.iOSMediaSelectionWorkAroundApplied=!0,this.gum_config.video={};var Jt=apiCC.getMediaDeviceLabelFromDeviceid(this.inputs.videoSourceId);Rt.log("getMediaDeviceLabelFromDeviceid :",Jt),Jt==="Caméra arrière"||Jt==="Back Camera"?(Rt.log("Setting FacingMode to environment :",Jt),this.gum_config=apiCC.setVideoFacingModeInConstraint("environment",this.gum_config)):(Rt.log("Setting FacingMode to user :",Jt),this.gum_config=apiCC.setVideoFacingModeInConstraint("user",this.gum_config)),this.inputs.videoSourceId=null,this.getUserMedia()}else this.tryAudioCallAfterUserMediaError===!0?(Rt.warn("try AudioCall after UserMediaError is activated"),this.tryAudioCallAfterUserMediaError=!1,this.gum_config.video!==!1?(Rt.debug("[ApiCCUserMediaStream] Trying to getUserMedia with audioOnly"),this.inputs.videoSourceId=null,this.gum_config.video=!1,this.getUserMedia()):(Vt(this.userMediaStreamId),this.manageFailure(Pt))):(Vt(this.userMediaStreamId),this.manageFailure(Pt));else Vt(this.userMediaStreamId),this.manageFailure(Pt)},this.getDisplayMediaProcess=function(){var Pt=this;Rt.debug("using getDisplayMedia with browser :",nt.Xh),Rt.debug("displayMediaStreamConstraints :",this.displayMediaStreamConstraints),kt(this.displayMediaStreamConstraints)==="object"&&Array.isArray(this.displayMediaStreamConstraints)!==!0||(Rt.warn("Defined displayMediaStreamConstraints format is not correct, reinitialization ..."),at.wL.type==="chrome"&&at.wL.version>=72&&at.wL.version<=73?this.displayMediaStreamConstraints={video:!0,audio:!1}:this.displayMediaStreamConstraints={video:!0,audio:!0},Rt.debug("displayMediaStreamConstraints :",this.displayMediaStreamConstraints)),typeof apiRTC_React<"u"?(Rt.debug("getDisplayMedia - React version"),mediaDevices.getDisplayMedia(this.displayMediaStreamConstraints).then(function(Vt){Rt.info("getDisplayMedia React stream available"),Pt.onUserMediaSuccess(Vt)}).catch(function(Vt){Rt.debug("getDisplayMedia - React version error : ",Vt),Pt.onUserMediaError(Vt)})):navigator.getDisplayMedia?(Rt.debug("navigator.getDisplayMedia defined"),navigator.getDisplayMedia(this.displayMediaStreamConstraints).then(function(Vt){Rt.debug("getDisplayMedia stream available"),Pt.onUserMediaSuccess(Vt)}).catch(function(Vt){Rt.debug("getDisplayMedia error :",Vt),Pt.onUserMediaError(Vt)})):navigator.mediaDevices.getDisplayMedia?(Rt.debug("navigator.mediaDevices.getDisplayMedia defined"),navigator.mediaDevices.getDisplayMedia(this.displayMediaStreamConstraints).then(function(Vt){Rt.debug("getDisplayMedia stream available"),Pt.onUserMediaSuccess(Vt)}).catch(function(Vt){Rt.debug("getDisplayMedia error :",Vt),Pt.onUserMediaError(Vt)})):(Rt.debug("getDisplayMedia not available"),Lt.createDesktopCaptureEvent("Browser_Not_Compatible"))},this.getScreenMedia=function(){if(Rt.debug("[ApiCCUserMediaStream] getScreenMedia; userMediaStreamId: "+this.userMediaStreamId),this.stream===null)if(nt.Xh==="Chrome"||nt.Xh==="Firefox"&&nt.PR>=52)if(nt.Xh==="Chrome")if(Rt.log("shareScreen on Chrome"),nt.PR>=72&&this.forceExtensionOnChrome===!1)this.getDisplayMediaProcess();else{if(Rt.debug("this.captureSourceType :",this.captureSourceType),apiCC.apiRTCExtensionInstalled===!1)return apiCC.waitingShareScreenUserMediaStreamId=this.userMediaStreamId,function(Pt){Rt.debug("[ApiCCUserMediaStream] moveUserMediaEntryInWaitingScreen: "+Pt);for(var Vt=apiCC.userMediaStreamTable.length;--Vt>=0;)if(apiCC.userMediaStreamTable[Vt].userMediaStreamId===Pt){apiCC.waitingShareScreenUserMediaStream=apiCC.userMediaStreamTable.splice(Vt,1);break}}(this.userMediaStreamId),void apiCC.manageNotInstalledExtension("getScreenMedia","getScreenMedia",this.captureSourceType);this.captureSourceType!==void 0&&this.captureSourceType!==null||(this.captureSourceType=["screen","window","tab"]),Array.isArray(this.captureSourceType)===!1&&(Rt.warn("Defined captureSourceType format is not correct, reinitialization ..."),this.captureSourceType=["screen","window","tab"],Rt.debug("this.captureSourceType :",this.captureSourceType)),window.postMessage({command:"getDesktopId",callNumber:this.userMediaStreamId,remoteId:"getScreenMedia",captureSourceType:this.captureSourceType,browser_major_version:nt.PR},"*")}else Rt.log("shareScreen on Firefox"),nt.PR>=67?this.getDisplayMediaProcess():(this.captureSourceType!==void 0&&this.captureSourceType!==null||(this.captureSourceType="screen"),typeof this.captureSourceType=="string"&&(Rt.warn("Defined captureSourceType format is not correct, reinitialization ..."),this.captureSourceType="screen",Rt.debug("this.captureSourceType :",this.captureSourceType)),this.registerScreenMedia(this.captureSourceType));else this.getDisplayMediaProcess()},this.registerScreenMedia=function(Pt,Vt){var Qt=null,rn=this.getOwnerCallInfo(),Jt=this.getCall(rn),sn=null;if(Rt.debug("[ApiCCUserMediaStream] registerScreenMedia; userMediaStreamId: "+this.userMediaStreamId),Vt==="mediaError")Jt!==null?(sn=Jt.callee===!0?Jt.callerId:Jt.calleeId,Jt.callType==="screenSharing"||Jt.callType==="screenSharingWithAudio"?apiCC.session.apiCCWebRTCClient.webRTCClient.removeCallFromTableWithCallIdandRemoteId(Jt.callId,sn,"Media_Error"):Rt.log("switch video / screen : call is not removed"),window.location.protocol!=="https:"&&Rt.log("Please connect to your web page using 'HTTPS'. This is mandatory for desktop capture"),Lt.createDesktopCaptureEvent("UserMediaError",Jt.callId,sn)):(Rt.log("Call not found on message EventListener"),Lt.createDesktopCaptureEvent("UserMediaError")),function(mn){for(var an=apiCC.userMediaStreamTable.length;--an>=0;)if(apiCC.userMediaStreamTable[an].userMediaStreamId===mn){apiCC.userMediaStreamTable.splice(an,1);break}}(this.userMediaStreamId),this.callbacks.failure(this,"UserMediaError");else try{if(nt.Xh==="Chrome")Rt.log("desktopId: "+Vt),Qt={video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:Vt}}};else{if(Rt.log("captureSourceType: "+Pt),Pt!=="screen"&&Pt!=="window"&&Pt!=="application")return void Rt.error("captureSourceType value is not correct");Qt={video:{mediaSource:Pt}}}nt.Xh==="IE"&&nt.dc>8?apiCC.getUserMediaWithCB(Qt,this.callback(this,"onUserMediaSuccess"),this.callback(this,"onUserMediaError")):apiCC.getUserMedia(Qt).then(this.callback(this,"onUserMediaSuccess")).catch(this.callback(this,"onUserMediaError"))}catch(mn){Rt.error("getUserMedia() failed. Is this a WebRTC capable browser?"),Rt.log("getUserMedia failed with exception: "+mn.message)}},this.stopScreenSharing=function(){Rt.debug("[ApiCCUserMediaStream] stopScreenSharing; userMediaStreamId: "+this.userMediaStreamId);var Pt=!0;if(apiRTC.session.remoteAccessInvitation!==null&&this.userMediaStreamId===apiRTC.session.remoteAccessInvitation.screenSharingStreamId&&(Rt.debug("this is a remote access screenSharing, need to stop remote access"),apiRTC.session.remoteAccessInvitation.stop(!0,{code:"SCREEN_SHARING_STOP"})),apiCC.session&&apiCC.session.apiCCWebRTCClient&&apiCC.session.apiCCWebRTCClient.webRTCClient)for(var Vt=this.callInfoList.length;--Vt>=0;)this.callInfoList[Vt].owner===!0&&(Pt=!1),apiCC.session.apiCCWebRTCClient.webRTCClient.onHangup(this.callInfoList[Vt].callId);Pt===!0&&this.release()},this.getCall=function(Pt){var Vt=null;return Pt&&apiCC.session&&apiCC.session.apiCCWebRTCClient&&apiCC.session.apiCCWebRTCClient.webRTCClient&&(Pt.flavor==="call"?Vt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(Pt.callId):Pt.flavor==="userMedia"&&(Vt=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(Pt.callId))),Vt},this.getOwnerCallInfo=function(){for(var Pt=this.callInfoList.length;--Pt>=0;)if(this.callInfoList[Pt].owner===!0)return this.callInfoList[Pt];return null},this.getCallInfo=function(Pt){for(var Vt=this.callInfoList.length;--Vt>=0;)if(this.callInfoList[Vt].callId===Pt)return this.callInfoList[Vt];return null},this.containsCallInfo=function(Pt){for(var Vt=!1,Qt=this.callInfoList.length;--Qt>=0;)if(this.callInfoList[Qt].callId===Pt){Vt=!0;break}return Vt},this.addCallInfo=function(Pt,Vt,Qt){return Pt!==null&&typeof Pt=="string"&&(Vt!=="call"&&Vt!=="userMedia"&&(Vt="call"),Qt!==null&&typeof Qt=="boolean"||(Qt=!1),!this.containsCallInfo(Pt))&&(this.callInfoList.push({callId:Pt,flavor:Vt,owner:Qt}),!0)},this.removeCallInfo=function(Pt){for(var Vt=!1,Qt=this.callInfoList.length;--Qt>=0;)if(this.callInfoList[Qt].callId===Pt){this.callInfoList.splice(Qt,1),Vt=!0;break}return Vt},this.accessToLocalMedia=function(){return this.callType!=="screenSharing"&&this.callType!=="screenSharingWithAudio"&&this.callType!=="data"&&this.stream!==null},this.muteAudioOnStreams=function(){var Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"enabled";return Rt.debug("[ApiCCUserMediaStream] muteAudioOnStreams; userMediaStreamId: "+this.userMediaStreamId),this.stream.getAudioTracks().forEach(function(Vt){Vt.enabled=!1}),Pt==="enabled"?this.audioMuted=!0:Pt==="muted"&&(this.audioSilent=!0),this.notifyMLineMuted("audio",!0,Pt),{type:"audio",muted:!0}},this.unMuteAudioOnStreams=function(){var Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"enabled";return Rt.debug("[ApiCCUserMediaStream] unMuteAudioOnStreams; userMediaStreamId: "+this.userMediaStreamId),this.stream.getAudioTracks().forEach(function(Vt){Vt.enabled=!0}),Pt==="enabled"?this.audioMuted=!1:Pt==="muted"&&(this.audioSilent=!1),this.notifyMLineMuted("audio",!1,Pt),{type:"audio",muted:!1}},this.muteVideoOnStreams=function(){var Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"enabled";return Rt.debug("[ApiCCUserMediaStream] muteVideoOnStreams; userMediaStreamId: "+this.userMediaStreamId),this.stream.getVideoTracks().forEach(function(Vt){Vt.enabled=!1}),Pt==="enabled"?this.videoMuted=!0:Pt==="muted"&&(this.videoSilent=!0),this.notifyMLineMuted("video",!0,Pt),{type:"video",muted:!0}},this.unMuteVideoOnStreams=function(){var Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"enabled";return Rt.debug("[ApiCCUserMediaStream] unMuteVideoOnStreams; userMediaStreamId: "+this.userMediaStreamId),this.stream.getVideoTracks().forEach(function(Vt){Vt.enabled=!0}),Pt==="enabled"?this.videoMuted=!1:Pt==="muted"&&(this.videoSilent=!1),this.notifyMLineMuted("video",!1,Pt),{type:"video",muted:!1}},this.removeVideoTrackOnStreams=function(){var Pt;return Rt.debug("[ApiCCUserMediaStream] removeVideoTrackOnStreams; userMediaStreamId: "+this.userMediaStreamId),(Pt=this.stream.getVideoTracks()).length>0&&this.stream.removeTrack(Pt[0]),this.video=!1,{type:"video",present:!1}},this.notifyMLineMuted=function(Pt,Vt,Qt){var rn,Jt,sn=!0;if(apiCC.session&&apiCC.session.apiCCWebRTCClient&&apiCC.session.apiCCWebRTCClient.webRTCClient)for(var mn=this.callInfoList.length;--mn>=0;)this.callInfoList[mn].flavor==="call"?(rn=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(this.callInfoList[mn].callId),this.notifyMLineMutedCall(Pt,Vt,Qt,rn,null)):this.callInfoList[mn].flavor==="userMedia"&&(Jt=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(this.callInfoList[mn].callId),this.notifyMLineMutedCall(Pt,Vt,Qt,null,Jt)),this.callInfoList[mn].owner===!0&&(sn=!1);sn===!0&&this.notifyMLineMutedCall(Pt,Vt,Qt,null,null)},this.notifyMLineMutedCall=function(Pt,Vt,Qt,rn,Jt){Rt.debug("notifyMLineMutedCall; mline: "+Pt+", muted: "+Vt);var sn=[];Qt==="enabled"?sn=[Pt+"IsMuted"]:Qt==="muted"&&(sn=[Pt+"IsSilent"]);var mn={available:this.audio,deviceLabel:this.audioDeviceLabel,active:!0,muted:this.audioMuted,silent:this.audioSilent},an={available:this.video,deviceLabel:this.videoDeviceLabel,active:!0,muted:this.videoMuted,silent:this.videoSilent},hn=null;rn?(Pt==="audio"?rn.isLocalAudioMuted=Vt:Pt==="video"&&(rn.isLocalVideoMuted=Vt),rn.belongsToRoom()?(hn={clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:rn.callId,roomId:rn.sessionMCU.roomName,pubSub:apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector,mline:Pt},rn.data.mesh&&(hn.mesh=rn.data.mesh),Qt==="muted"?(hn.change="silent",hn.silent=Vt,rn.myWebRTC_Stack.sendInfo("streamTrackStatusChanged",hn)):Qt==="enabled"&&(hn.muted=Vt,rn.myWebRTC_Stack.sendInfo("streamTrackChanged",hn))):(hn={callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,calleeId:rn.callee?rn.callerId:rn.calleeId,callId:rn.callId,mline:Pt},Qt==="muted"?(hn.type="streamTrackStatusChanged",hn.change="silent",hn.silent=Vt):Qt==="enabled"&&(hn.type="streamTrackChanged",hn.muted=Vt),rn.myWebRTC_Stack.sendDataMessage(apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,hn)),mn.active=rn.localCallProfile.audioActive,an.active=rn.localCallProfile.videoActive,Lt.createLocalStreamUpdatedEvent(sn,mn,an,!0,rn.callType,rn.callId,this.stream,this.userMediaStreamId,"userAction")):Jt?(hn={clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Jt.userMediaId,roomId:Jt.sessionMCU.roomName,pubSub:apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector,mline:Pt},Qt==="muted"?(hn.change="silent",hn.silent=Vt,Jt.myWebRTC_Stack.sendInfo("streamTrackStatusChanged",hn)):Qt==="enabled"&&(hn.muted=Vt,Jt.myWebRTC_Stack.sendInfo("streamTrackChanged",hn)),Jt.audioSdpDirection==="inactive"&&(mn.active=!1),Jt.videoSdpDirection==="inactive"&&(an.active=!1),Lt.createLocalStreamUpdatedEvent(sn,mn,an,!0,Jt.callType,Jt.userMediaId,this.stream,this.userMediaStreamId,"userAction")):Lt.createLocalStreamUpdatedEvent(sn,mn,an,!1,null,null,this.stream,this.userMediaStreamId,"userAction")},this.notifyActiveSpeaker=function(Pt){var Vt,Qt,rn=!0;if(apiCC.session&&apiCC.session.apiCCWebRTCClient&&apiCC.session.apiCCWebRTCClient.webRTCClient)for(var Jt=this.callInfoList.length;--Jt>=0;)this.callInfoList[Jt].flavor==="call"?(Vt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(this.callInfoList[Jt].callId),this.notifyActiveSpeakerCall(Pt,Vt,null)):this.callInfoList[Jt].flavor==="userMedia"&&(Qt=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(this.callInfoList[Jt].callId),this.notifyActiveSpeakerCall(Pt,null,Qt)),this.callInfoList[Jt].owner===!0&&(rn=!1);rn===!0&&this.notifyActiveSpeakerCall(Pt,null,null)},this.notifyActiveSpeakerCall=function(Pt,Vt,Qt){var rn=null;Vt?(Vt.belongsToRoom()?(rn={clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Vt.callId,roomId:Vt.sessionMCU.roomName,pubSub:apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector,resolve:!0,descriptor:{audioAmplitude:Pt,streamID:this.userMediaStreamId}},Vt.data.mesh&&(rn.mesh=Vt.data.mesh),Vt.myWebRTC_Stack.sendInfo("activeSpeaker",rn)):(rn={type:"activeSpeaker",callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,calleeId:Vt.callee?Vt.callerId:Vt.calleeId,callId:Vt.callId,descriptor:{audioAmplitude:Pt,streamID:this.userMediaStreamId}},Vt.myWebRTC_Stack.sendDataMessage(apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,rn)),Lt.createAudioAmplitudeEvent(Pt,!0,Vt.callId,this.userMediaStreamId)):Qt?(rn={clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Qt.userMediaId,roomId:Qt.sessionMCU.roomName,pubSub:apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector,resolve:!0,descriptor:{audioAmplitude:Pt,streamID:this.userMediaStreamId}},Qt.myWebRTC_Stack.sendInfo("activeSpeaker",rn),Lt.createAudioAmplitudeEvent(Pt,!0,Qt.userMediaId,this.userMediaStreamId)):Lt.createAudioAmplitudeEvent(Pt,!0,null,this.userMediaStreamId)},this.notifyNotActiveSpeaker=function(Pt){var Vt,Qt,rn=!0;if(apiCC.session&&apiCC.session.apiCCWebRTCClient&&apiCC.session.apiCCWebRTCClient.webRTCClient)for(var Jt=this.callInfoList.length;--Jt>=0;)this.callInfoList[Jt].flavor==="call"?(Vt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(this.callInfoList[Jt].callId),this.notifyNotActiveSpeakerCall(Pt,Vt,null)):this.callInfoList[Jt].flavor==="userMedia"&&(Qt=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(this.callInfoList[Jt].callId),this.notifyNotActiveSpeakerCall(Pt,null,Qt)),this.callInfoList[Jt].owner===!0&&(rn=!1);rn===!0&&this.notifyNotActiveSpeakerCall(Pt,null,null)},this.notifyNotActiveSpeakerCall=function(Pt,Vt,Qt){var rn=null;Vt?(Vt.belongsToRoom()?(rn={clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Vt.callId,roomId:Vt.sessionMCU.roomName,pubSub:apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector,resolve:!0,descriptor:{audioAmplitude:Pt,streamID:this.userMediaStreamId}},Vt.data.mesh&&(rn.mesh=Vt.data.mesh),Vt.myWebRTC_Stack.sendInfo("stopSpeaking",rn)):(rn={type:"stopSpeaking",callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,calleeId:Vt.callee?Vt.callerId:Vt.calleeId,callId:Vt.callId,descriptor:{audioAmplitude:Pt,streamID:this.userMediaStreamId}},Vt.myWebRTC_Stack.sendDataMessage(apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,rn)),Lt.createAudioAmplitudeEvent(Pt,!1,Vt.callId,this.userMediaStreamId)):Qt?(rn={clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Qt.userMediaId,roomId:Qt.sessionMCU.roomName,pubSub:apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector,resolve:!0,descriptor:{audioAmplitude:Pt,streamID:this.userMediaStreamId}},Qt.myWebRTC_Stack.sendInfo("stopSpeaking",rn),Lt.createAudioAmplitudeEvent(Pt,!1,Qt.userMediaId,this.userMediaStreamId)):Lt.createAudioAmplitudeEvent(Pt,!1,null,this.userMediaStreamId)},this.callback=function(Pt,Vt){return this.closureHandler=function(Qt,rn){return Pt[Vt](Qt,rn)},this.closureHandler},this.isUserMediaAccessAllowed=function(){return localStorage!==null&&(typeof localStorage>"u"?"undefined":kt(localStorage))==="object"&&typeof localStorage.getItem=="function"?localStorage.getItem(Et)==="true":null},this.setUserMediaAccessAllowed=function(Pt){return localStorage!==null&&(typeof localStorage>"u"?"undefined":kt(localStorage))==="object"&&typeof localStorage.setItem=="function"?(localStorage.setItem(Et,Pt?"true":"false"),!!Pt):null},this.applyFiltersIfNeeded=function(Pt){return this.filters===null?Promise.resolve(Pt):(this.mediaFilterManager=new qt(Pt,this.filters,this.userMediaStreamId),this.mediaFilterManager.applyFilters())},this.getVideoSettings=function(){if(this.videoSettings!==!1)return this.videoSettings;var Pt=this.getVideoTrack();if(!Pt||typeof Pt.getSettings!="function")return this.videoSettings=null,this.videoSettings;var Vt=Pt.getSettings();return Vt?(this.videoSettings={},Object.prototype.hasOwnProperty.call(Vt,"width")&&(this.videoSettings.width=Vt.width),Object.prototype.hasOwnProperty.call(Vt,"height")&&(this.videoSettings.height=Vt.height),Object.prototype.hasOwnProperty.call(Vt,"frameRate")&&(this.videoSettings.frameRate=Vt.frameRate),this.videoSettings):(this.videoSettings=null,this.videoSettings)},this.isSimulcastCompliant=function(){return!!this.getVideoSettings()},this.getSimulcastProfile=function(){var Pt=this.getVideoSettings();if(!Pt)return null;var Vt={substream:{high:{active:!0,selectable:!0},medium:{active:!0,selectable:!0},low:{active:!0,selectable:!0}},temporal:{high:{active:!0,selectable:!0},medium:{active:!0,selectable:!0},low:{active:!0,selectable:!0}}};return at.wL.type==="chrome"&&((Pt.width<1280||Pt.height<720)&&(Vt.substream.low.selectable=!1),Vt.temporal.high.active=!1,Vt.temporal.high.selectable=!1),Vt}}},1192:(rt,it,s)=>{s.d(it,{D:()=>Nn}),s(3710),s(1539),s(9714),s(2772),s(8674);var et=s(1549),nt=(s(4916),s(5306),s(2564),s(4812),s(561),s(5735),s(3753),s(4603),s(6755),s(9554),s(4747),s(6992),s(8783),s(3948),s(9601),s(8309),s(8264),s(9575),s(2472),s(2990),s(8927),s(3105),s(5035),s(4345),s(7174),s(2846),s(4731),s(7209),s(6319),s(8867),s(7789),s(3739),s(9368),s(4483),s(2056),s(3462),s(678),s(7462),s(3824),s(5021),s(2974),s(5016),s(7042),s(7941),s(2526),s(1817),s(2165),s(5945)),at=s(4708),ht=s(940);function dt(qt){return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(kt){return typeof kt}:function(kt){return kt&&typeof Symbol=="function"&&kt.constructor===Symbol&&kt!==Symbol.prototype?"symbol":typeof kt},dt(qt)}function ut(){this.sdp={original:null,global:[],mlines:[]},this.mlines=[]}function lt(qt){var kt=new ut,st=qt.split(`\r
-`),Tt=0,Rt=null,Lt=null,Et=null,jt=null;for(kt.sdp.original=qt;Tt=0;)kt.mlines[Tt].type!=="audio"||kt.audio?kt.mlines[Tt].type!=="video"||kt.video||(kt.video=kt.mlines[Tt]):kt.audio=kt.mlines[Tt],kt.unifiedPlan===!0&&kt.mlines[Tt].mid!==String(Tt)&&(kt.unifiedPlan=!1);return kt.isAudioActive=mt.bind(null,kt,"audio"),kt.isVideoActive=mt.bind(null,kt,"video"),kt}function mt(qt,kt){return!(kt!=="audio"&&kt!=="video"||qt===null||dt(qt)!=="object"||!Object.prototype.hasOwnProperty.call(qt,kt)||qt[kt]===null||dt(qt[kt])!=="object"||qt[kt].direction!=="sendrecv"&&qt[kt].direction!=="sendonly"&&qt[kt].direction!=="recvonly")}s(3123),s(4765),s(4723),s(9600),s(1058),s(9826),ut.prototype.mungeForSimulcasting=function(){if(this.simulcasting!==!0){this.simulcasting=!0;for(var qt=0;qt=0;){var Pt=Math.floor(4294967295*Math.random());kt.ssrcs.push({original:Pt,ssrc:Pt,content:{cname:st,msid:Tt,mslabel:Rt,label:Lt}});var Vt=Math.floor(4294967295*Math.random());kt.ssrcs.push({original:Vt,ssrc:Vt,content:{cname:st,msid:Tt,mslabel:Rt,label:Lt}}),kt.ssrc_groups.fid.push([Pt,Vt]),Et.push(Pt)}kt.ssrc_groups.sim.push(Et)}}}},ut.prototype.generate=function(){for(var qt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},kt=[],st=0;st0&&(kt.push("a=fmtp:"),kt.push(sn),kt.push(" "),kt.push(wn.join(";")),kt.push(`\r
-`))}continue}continue}if(Jt[1]==="rtcp-fb"||Jt[1]==="fmtp")continue;throw new Error("internal error")}if(rn.match(/^a=mid:(\w+)$/))kt.push("a=mid:"),kt.push(jt.mid),kt.push(`\r
-`),jt.bandwidth>0&&(kt.push("b=AS:"),kt.push(jt.bandwidth),kt.push(`\r
-`),kt.push("b=TIAS:"),kt.push(jt.bandwidth),kt.push("000"),kt.push(`\r
-`));else if(rn!=="a=sendrecv"&&rn!=="a=recvonly"&&rn!=="a=sendonly"&&rn!=="a=inactive"){if(!rn.match(/^a=ssrc-group:SIM (.+)$/)){if(!rn.match(/^a=ssrc-group:FID (.+)$/)){if(rn.match(/^a=ssrc:(\d+) (.+)$/)){if(Pt)continue;Pt=!0;for(var xn=0;xn=0;st--)(Rt=this.extractSdp(qt[st],/a=rtpmap:(\d+) CN\/\d+/i))&&((Lt=Tt.indexOf(Rt))!==-1&&Tt.splice(Lt,1),qt.splice(st,1));return qt[kt]=Tt.join(" "),qt},this.extractSdp=function(qt,kt){var st=qt.match(kt);return st&&st.length==2?st[1]:null},this.setDefaultCodec=function(qt,kt){var st=0,Tt=qt.split(" "),Rt=Tt.slice(0,3);for(Rt.push(kt),st=3;stqt.length)&&(kt=qt.length);for(var st=0,Tt=new Array(kt);st=Jt.length?{done:!0}:{done:!1,value:Jt[an++]}},e:function(En){throw En},f:hn}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var wn,Mn=!0,xn=!1;return{s:function(){mn=mn.call(Jt)},n:function(){var En=mn.next();return Mn=En.done,En},e:function(En){xn=!0,wn=En},f:function(){try{Mn||mn.return==null||mn.return()}finally{if(xn)throw wn}}}}(Et);try{for(Pt.s();!(jt=Pt.n()).done;){var Vt=jt.value,Qt=Vt.match,rn=Vt.callback;Qt(this._err)&&rn(this._err,this._data,this._interrupted)}}catch(Jt){Pt.e(Jt)}finally{Pt.f()}}},{key:"clear",value:function(){this.clearTimeout(),this.removeCallback()}},{key:"setTimeout",value:function(Tt){function Rt(Lt,Et,jt){return Tt.apply(this,arguments)}return Rt.toString=function(){return Tt.toString()},Rt}(function(Tt,Rt,Lt){var Et=this;this.clearTimeout(),this._timeout=setTimeout(Rt===null?function(){Et._fulfill(null,Lt,!0)}:function(){Et._fulfill(typeof Rt=="string"?new Error(Rt):Rt,void 0,!0)},Tt)})},{key:"clearTimeout",value:function(Tt){function Rt(){return Tt.apply(this,arguments)}return Rt.toString=function(){return Tt.toString()},Rt}(function(){this._timeout!==null&&(clearTimeout(this._timeout),this._timeout=null)})},{key:"onFulfillment",value:function(Tt){this._callbacks.push({match:vt,callback:Tt})}},{key:"onSuccess",value:function(Tt){this._callbacks.push({match:bt,callback:Tt})}},{key:"onFailure",value:function(Tt){this._callbacks.push({match:At,callback:Tt})}},{key:"removeCallback",value:function(Tt){if(typeof Tt=="function"){var Rt=this._callbacks.findIndex(function(Lt){return Lt.callback===Tt});Rt>=0&&this._callbacks.splice(Rt,1)}else this._callbacks.splice(0,this._callbacks.length)}},{key:"fulfill",value:function(Tt,Rt){Tt===null?this._fulfill(null,Rt,!1):this._fulfill(typeof Tt=="string"?new Error(Tt):Tt,void 0,!1)}}],st&&yt(kt.prototype,st),Object.defineProperty(kt,"prototype",{writable:!1}),qt}(),St=(s(1249),s(7327),s(3843),function(qt,kt,st,Tt,Rt,Lt,Et,jt){this.rawStats={},this.rawStats.connectedPair=[],this.rawStats.audio_send=[],this.rawStats.audio_recv=[],this.rawStats.video_send=[],this.rawStats.video_recv=[],this.instantRTT=0,this.moyRttCP=[0,0,0,0,0,0,0,0,0,0],this.moyRttAS=[0,0,0,0,0,0,0,0,0,0],this.moyRttVS=[0,0,0,0,0,0,0,0,0,0],this.tauxPacketLossAS=[0],this.oldLostAS=this.oldSentAS=0,this.oldLostVS=this.oldLostVS=0,this.cptTaux=0,this.tauxPacketLossVS=[0],this.oldBandwidthAS=0,this.oldBandwidthVS=0,this.oldBandwidthAR=0,this.oldBandwidthVR=0,this.bandwidthAS=[0,0,0,0,0,0,0,0,0,0],this.bandwidthAR=[0,0,0,0,0,0,0,0,0,0],this.bandwidthVS=[0,0,0,0,0,0,0,0,0,0],this.bandwidthVR=[0,0,0,0,0,0,0,0,0,0],this.qosIn=0,this.qosInAverage=0,this.qosInAverageCount=0,this.qosAudioIn=0,this.qosAudioInAverage=0,this.qosAudioInAverageCount=0,this.qosVideoIn=0,this.qosVideoInAverage=0,this.qosVideoInAverageCount=0,this.qosOut=0,this.qosOutAverage=0,this.qosOutAverageCount=0,this.qosAudioOut=0,this.qosAudioOutAverage=0,this.qosAudioOutAverageCount=0,this.qosVideoOut=0,this.qosVideoOutAverage=0,this.qosVideoOutAverageCount=0,this.onQosChange=kt,this.onQosAudioChange=st,this.onQosVideoChange=Tt,this.cpt=0,this.cptRes=5,this.cptDb=60,this.saveStatsFlag=!0,this.tabQosIn=[],this.tabQosAudioIn=[],this.tabQosVideoIn=[],this.tabQosOut=[],this.tabQosAudioOut=[],this.tabQosVideoOut=[],this.tabTimestamp=[],this.tabDelay=[],this.tabJitterBufferAudio=[],this.tabJitterBufferVideo=[],this.tabAudioRtt=[],this.tabVideoRtt=[],this.tabAudioBW=[],this.tabVideoBW=[],this.clientId=Et,this.callId=Rt,this.apiKey=Lt,this.socket=jt,this.interval=qt,this.insertStats=function(Pt,Vt,Qt,rn){var Jt,sn,mn,an=null;for(this.cpt=this.cpt+this.interval,Jt=0;Jt=5&&Xn<10?Jt=2:Xn>=10&&(Jt=3),Vn!==null&&Vn[1]){var cr=8*this.Average(this.bandwidthVS)/1024;cr<240?an=1:cr>=240&&cr<330?an=2:cr>=330&&(an=3)}this.rawStats.audio_recv.googJitterBufferMs<60?sn=3:this.rawStats.audio_recv.googJitterBufferMs>=60&&this.rawStats.audio_recv.googJitterBufferMs<100?sn=2:this.rawStats.audio_recv.googJitterBufferMs>=100&&(sn=1),this.rawStats.audio_recv.googCurrentDelayMs<100?mn=3:this.rawStats.audio_recv.googCurrentDelayMs>=100&&this.rawStats.audio_recv.googCurrentDelayMs<200?mn=2:this.rawStats.audio_recv.googCurrentDelayMs>=200&&(mn=1),Vn!==null&&Vn[1]&&(this.rawStats.video_recv.googJitterBufferMs<100?hn=3:this.rawStats.video_recv.googJitterBufferMs>=100&&this.rawStats.video_recv.googJitterBufferMs<200?hn=2:this.rawStats.video_recv.googJitterBufferMs>=200&&(hn=1));var dr=!1,ur=!1,Cr=!1;Vn!==null&&Vn[1]?(Math.ceil((Jt+2*an+hn+sn+mn)/6)!=this.qosIn&&(dr=!0),this.qosIn=Math.ceil((Jt+2*an+hn+sn+mn)/6),this.qosInAverage=(this.qosInAverage*this.qosInAverageCount+this.qosIn)/(this.qosInAverageCount+1),this.qosInAverageCount++,Math.ceil((Jt+sn+mn)/3)!=this.qosAudioIn&&(ur=!0),this.qosAudioIn=Math.ceil((Jt+sn+mn)/3),this.qosAudioInAverage=(this.qosAudioInAverage*this.qosAudioInAverageCount+this.qosAudioIn)/(this.qosAudioInAverageCount+1),this.qosAudioInAverageCount++,Math.ceil((2*an+hn)/3)!=this.qosVideoIn&&(Cr=!0),this.qosVideoIn=Math.ceil((2*an+hn)/3),this.qosVideoInAverage=(this.qosVideoInAverage*this.qosVideoInAverageCount+this.qosVideoIn)/(this.qosVideoInAverageCount+1),this.qosVideoInAverageCount++):(Math.ceil((Jt+sn+mn)/3)!=this.qosOut&&(dr=!0),this.qosIn=Math.ceil((Jt+sn+mn)/3),this.qosInAverage=(this.qosInAverage*this.qosInAverageCount+this.qosIn)/(this.qosInAverageCount+1),this.qosInAverageCount++,Math.ceil((Jt+sn+mn)/3)!=this.qosAudioIn&&(ur=!0),this.qosAudioIn=Math.ceil((Jt+sn+mn)/3),this.qosAudioInAverage=(this.qosAudioInAverage*this.qosAudioInAverageCount+this.qosAudioIn)/(this.qosAudioInAverageCount+1),this.qosAudioInAverageCount++),this.RttAverage(this.moyRttAS)<80?Mn=3:this.RttAverage(this.moyRttAS)>=80&&this.RttAverage(this.moyRttAS)<150?Mn=2:this.RttAverage(this.moyRttAS)>=150&&(Mn=1),this.tauxPacketLossAS<=5?wn=3:this.tauxPacketLossAS>5&&this.tauxPacketLossAS<10?wn=2:this.tauxPacketLossAS>=10&&(wn=1),this.rawStats.audio_recv.googJitterReceived<80?xn=3:this.rawStats.audio_recv.googJitterReceived>=80&&this.rawStats.audio_recv.googJitterReceived<150?xn=2:this.rawStats.audio_recv.googJitterReceived>=150&&(xn=1),Vn!==null&&Vn[1]&&(this.tauxPacketLossVS<=5?En=3:this.tauxPacketLossVS>5&&this.tauxPacketLossVS<10?En=2:this.tauxPacketLossVS>=10&&(En=1),this.RttAverage(this.moyRttVS)<80?kn=3:this.RttAverage(this.moyRttVS)>=80&&this.RttAverage(this.moyRttVS)<150?kn=2:this.RttAverage(this.moyRttVS)>=150&&(kn=1)),Vn!==null&&Vn[1]?(Math.ceil((Mn+2*wn+xn+2*En+kn)/7)!=this.qosOut&&(dr=!0),this.qosOut=Math.ceil((Mn+2*wn+xn+2*En+kn)/7),this.qosOutAverage=(this.qosOutAverage*this.qosOutAverageCount+this.qosOut)/(this.qosOutAverageCount+1),this.qosOutAverageCount++,Math.ceil((Mn+2*wn+xn)/4)!=this.qosAudioOut&&(ur=!0),this.qosAudioOut=Math.ceil((Mn+2*wn+xn)/4),this.qosAudioOutAverage=(this.qosAudioOutAverage*this.qosAudioOutAverageCount+this.qosAudioOut)/(this.qosAudioOutAverageCount+1),this.qosAudioOutAverageCount++,Math.ceil((2*En+kn)/3)!=this.qosVideoOut&&(Cr=!0),this.qosVideoOut=Math.ceil((2*En+kn)/3),this.qosVideoOutAverage=(this.qosVideoOutAverage*this.qosVideoOutAverageCount+this.qosVideoOut)/(this.qosVideoOutAverageCount+1),this.qosVideoOutAverageCount++):(Math.ceil((Mn+2*wn+xn)/4)!=this.qosOut&&(dr=!0),this.qosOut=Math.ceil((Mn+2*wn+xn)/4),this.qosOutAverage=(this.qosOutAverage*this.qosOutAverageCount+this.qosOut)/(this.qosOutAverageCount+1),this.qosOutAverageCount++,Math.ceil((Mn+2*wn+xn)/4)!=this.qosAudioOut&&(ur=!0),this.qosAudioOut=Math.ceil((Mn+2*wn+xn)/4),this.qosAudioOutAverage=(this.qosAudioOutAverage*this.qosAudioOutAverageCount+this.qosAudioOut)/(this.qosAudioOutAverageCount+1),this.qosAudioOutAverageCount++),dr&&this.onQosChange(this.qosIn,this.qosOut),ur&&this.onQosAudioChange(this.qosAudioIn,this.qosAudioOut),Cr&&this.onQosVideoChange(this.qosVideoIn,this.qosVideoOut)},this.getCodecs=function(Pt){var Vt=!1,Qt=!1,rn=null,Jt=null;if(Pt!=null&&Pt.sdp!==void 0){for(var sn=Pt.sdp.split(`
-`),mn=0;mn0&&this.canceled!==!0?setTimeout(this.terminateTransfer.bind(this)):this.terminated!==!0&&(this.terminated=!0,this.recvDataEndAckTimeoutId&&(clearTimeout(this.recvDataEndAckTimeoutId),delete this.recvDataEndAckTimeoutId),delete this.call.dcfs,wt.debug("terminateTransfer; terminating"),this.call.pipelineCallId?(this.call.pipelineCall&&(delete this.call.pipelineCall.clientCall,delete this.call.pipelineCall,this.call.sendDataChannel=null),this.channel=null):setTimeout(function(){kt.channel.close(),kt.channel=null}),setTimeout(function(){if(kt.canceled===!0)Mt.createEvent({eventType:"onFileSended",callId:kt.call.callId,remoteId:kt.call.remoteId,name:kt.call.data.filename,error:"canceled"}),kt.call.callbacks.failure("canceled");else if(kt.call.failure)Mt.createEvent({eventType:"onFileSended",callId:kt.call.callId,remoteId:kt.call.remoteId,name:kt.call.data.filename,error:kt.call.failure}),kt.call.callbacks.failure(kt.call.failure);else{var st={eventType:"onFileSended",callId:kt.call.callId,remoteId:kt.call.remoteId,name:kt.call.data.filename};kt.call.success.data&&(st.data=kt.call.success.data),Mt.createEvent(st),kt.call.callbacks.success(kt.call.success)}apiCC.session.apiCCWebRTCClient.webRTCClient.onHangup(kt.call.callId)})):wt.warn("No data channel to send data, leaving terminateTransfer")},this.recvDataEndAckTimeout=function(){wt.error("recvDataEndAckTimeout"),this.call.failure="ackNotReceived",setTimeout(this.terminateTransfer.bind(this))},this.subsequentTransfer=function(){var kt,st=!1;if(wt.debug("subsequentTransfer; remByteCount: "+this.remByteCount),this.canceled!==!0)if(this.channel!==null)if(this.useBufferedAmount===!0&&this.channel.bufferedAmount>Ht)setTimeout(this.subsequentTransfer.bind(this));else try{for(;;){if(!(this.remByteCount>=this.chunkLength)){kt=this.data.slice(this.offset,this.offset+this.remByteCount),this.channel.send(kt),this.packetsSent+=1,wt.debug("packetSent "+this.packetsSent+" "+this.remByteCount),this.offset+=this.remByteCount,this.remByteCount-=this.remByteCount,st=!0;break}if(kt=this.data.slice(this.offset,this.offset+this.chunkLength),this.channel.send(kt),this.packetsSent+=1,wt.debug("packetSent "+this.packetsSent+" "+this.chunkLength),this.offset+=this.chunkLength,this.remByteCount-=this.chunkLength,this.remByteCount<=0){st=!0;break}if(this.useBufferedAmount!==!0||this.channel.bufferedAmount>Ht)break}st===!0?(Mt.createEvent({eventType:"onFileProgress",name:this.call.data.filename,sendChunkNb:this.packetsSent,fileSize:this.call.data.size,remainingSize:this.remByteCount,callId:this.call.callId,remoteId:this.call.remoteId,percentage:100}),this.call.callbacks.progress({state:"complete",filename:this.call.data.filename,size:this.call.data.size,remBytes:0,progress:100}),this.call.success={state:"complete",filename:this.call.data.filename,size:this.call.data.size,mediaURL:this.call.mediaURL,mediaId:this.call.mediaId},this.recvDataEndAckTimeoutId=setTimeout(this.recvDataEndAckTimeout.bind(this),3e4)):(Mt.createEvent({eventType:"onFileProgress",name:this.call.data.filename,sendChunkNb:this.packetsSent,fileSize:this.call.data.size,remainingSize:this.remByteCount,callId:this.call.callId,remoteId:this.call.remoteId,percentage:Math.floor(100*this.offset/this.call.data.size)}),this.call.callbacks.progress({state:"incomplete",filename:this.call.data.filename,size:this.call.data.size,remBytes:this.remByteCount,progress:Math.floor(100*this.offset/this.call.data.size)}),setTimeout(this.subsequentTransfer.bind(this)))}catch(Tt){return wt.error("transfer: "+Tt),this.call.failure="dataChannelFailed",void setTimeout(this.terminateTransfer.bind(this))}else wt.warn("No data channel to send data, leaving subsequentTransfer");else setTimeout(this.terminateTransfer.bind(this))},this.transfer=function(kt,st,Tt){var Rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Lt=Rt.hasOwnProperty("delay")?Rt.delay:100;if(wt.info("transfer",st,Lt),this.call.beginTimeoutId&&(clearTimeout(this.call.beginTimeoutId),delete this.call.beginTimeoutId),this.data=kt,this.channel=Tt,this.channel!==null){typeof this.channel.bufferedAmount=="number"&&this.channel.bufferedAmount>=0&&(wt.debug("browserDetails",at.wL),at.wL.type==="chrome"?at.wL.version>=37&&(this.useBufferedAmount=!0,wt.debug("useBufferedAmount enabled")):(this.useBufferedAmount=!0,wt.debug("useBufferedAmount enabled"))),this.chunkLength=8192,st>0?(this.offset=Math.floor(st/this.chunkLength)*this.chunkLength,this.remByteCount=this.data.byteLength-this.offset):(this.offset=0,this.remByteCount=this.data.byteLength),this.packetsSent=0;try{var Et={chunkLength:this.chunkLength,offset:this.offset,remBytes:this.remByteCount};this.call.pipelineCallId&&(Et.pluginName=qt.data.pluginName,Et.pluginData=qt.data.pluginData,qt.data.context&&(Et.context=qt.data.context)),this.channel.send(JSON.stringify(Et))}catch(jt){return wt.error("transfer:",jt),this.call.failure="dataChannelFailed",void setTimeout(this.terminateTransfer.bind(this))}Mt.createEvent({eventType:"onFileSending",callId:this.call.callId,remoteId:this.call.remoteId,name:this.call.data.filename}),setTimeout(this.subsequentTransfer.bind(this),Lt)}else wt.warn("No data channel to send data, leaving transfer")}},Dt=(et.Y.get("CallStatsMonitor"),function(qt,kt,st,Tt){this.interval=qt,this.browserType=kt,this.browserVersion=st,this.flavor=Tt,this.prevData={},this.prevDataThreshold=10/qt,this.prevDataThreshold<2&&(this.prevDataThreshold=2),this.STANDARD_STAT_KEYS={audioReceived:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},videoReceived:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},remoteAudioSent:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},remoteVideoSent:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},audioSent:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},videoSent:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},remoteAudioReceived:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1},remoteVideoReceived:{codecId:!1,id:!1,ssrc:!1,trackId:!1,transportId:!1}},this.refineStats_chrome_proprietary=function(Rt,Lt){var Et,jt;for(Et=0;Et=0){if(Pt.stat("mediaType")==="audio")for(Rt.audioReceived={timestamp:Math.floor(Date.parse(Pt.timestamp))/1e3,type:"inbound-rtp",isRemote:!1,mediaType:"audio",packetsReceived:0,bytesReceived:0},Vt=Pt.names(),jt=0;jt=0){if(Pt.stat("mediaType")==="audio")for(Rt.audioSent={timestamp:Math.floor(Date.parse(Pt.timestamp))/1e3,type:"outbound-rtp",isRemote:!1,mediaType:"audio",packetsSent:0,bytesSent:0},Vt=Pt.names(),jt=0;jt=0){if(jt.mediaType==="audio"){for(Vt in Rt.audioReceived={},Pt=Math.floor(Date.parse(jt.timestamp)/1e3),jt)Vt==="timestamp"?Rt.audioReceived.timestamp=Pt:Rt.audioReceived[Vt]=jt[Vt];Et=!0}else if(jt.mediaType==="video"){for(Vt in Rt.videoReceived={},Pt=Math.floor(Date.parse(jt.timestamp)/1e3),jt)Vt==="timestamp"?Rt.videoReceived.timestamp=Pt:Rt.videoReceived[Vt]=jt[Vt];Et=!0}}else if(jt.type==="ssrc"&&jt.id.indexOf("send")>=0){if(jt.mediaType==="audio"){for(Vt in Rt.audioSent={},Pt=Math.floor(Date.parse(jt.timestamp)/1e3),jt)Vt==="timestamp"?Rt.audioSent.timestamp=Pt:Rt.audioSent[Vt]=jt[Vt];Et=!0}else if(jt.mediaType==="video"){for(Vt in Rt.videoSent={},Pt=Math.floor(Date.parse(jt.timestamp)/1e3),jt)Vt==="timestamp"?Rt.videoSent.timestamp=Pt:Rt.videoSent[Vt]=jt[Vt];Et=!0}}}),Et},this.refineStats_chrome_58=function(Rt,Lt){var Et=this,jt=!1;return Lt.forEach(function(Pt){if(Pt.type!=="inbound-rtp"||Pt.isRemote){if(Pt.type==="outbound-rtp"&&!Pt.isRemote){if(Pt.mediaType==="audio"){Rt.audioSent={};var Vt=Math.floor(Pt.timestamp/1e3);for(var Qt in Pt)Et.STANDARD_STAT_KEYS.audioSent[Qt]!==!1&&(Qt==="timestamp"?Rt.audioSent.timestamp=Vt:Rt.audioSent[Qt]=Pt[Qt]);jt=!0}else if(Pt.mediaType==="video"){Rt.videoSent={};var rn=Math.floor(Pt.timestamp/1e3);for(var Jt in Pt)Et.STANDARD_STAT_KEYS.videoSent[Jt]!==!1&&(Jt==="timestamp"?Rt.videoSent.timestamp=rn:Rt.videoSent[Jt]=Pt[Jt]);jt=!0}}}else if(Pt.mediaType==="audio"||Pt.id.indexOf("Audio")>=0){Rt.audioReceived={};var sn=Math.floor(Pt.timestamp/1e3);for(var mn in Pt)Et.STANDARD_STAT_KEYS.audioReceived[mn]!==!1&&(mn==="timestamp"?Rt.audioReceived.timestamp=sn:Rt.audioReceived[mn]=Pt[mn]);jt=!0}else if(Pt.mediaType==="video"||Pt.id.indexOf("Video")>=0){Rt.videoReceived={};var an=Math.floor(Pt.timestamp/1e3);for(var hn in Pt)Et.STANDARD_STAT_KEYS.videoReceived[hn]!==!1&&(hn==="timestamp"?Rt.videoReceived.timestamp=an:Rt.videoReceived[hn]=Pt[hn]);jt=!0}}),jt},this.refineStats_firefox_legacy=function(Rt,Lt){var Et=!1,jt=this;return Lt.forEach(function(Pt){var Vt=null,Qt=null;if(Pt.type==="inbound-rtp"&&Pt.isRemote===!1){if(Pt.mediaType==="audio"){for(Vt in Rt.audioReceived={packetsReceived:0,bytesReceived:0},Qt=Math.floor(Pt.timestamp/1e3),Pt)jt.STANDARD_STAT_KEYS.audioReceived[Vt]!==!1&&(Vt==="timestamp"?Rt.audioReceived.timestamp=Qt:Rt.audioReceived[Vt]=Pt[Vt]);Et=!0}else if(Pt.mediaType==="video"){for(Vt in Rt.videoReceived={packetsReceived:0,bytesReceived:0,framesDecoded:0},Qt=Math.floor(Pt.timestamp/1e3),Pt)jt.STANDARD_STAT_KEYS.videoReceived[Vt]!==!1&&(Vt==="timestamp"?Rt.videoReceived.timestamp=Qt:Rt.videoReceived[Vt]=Pt[Vt]);Et=!0}}else if(Pt.type==="outbound-rtp"&&Pt.isRemote===!1){if(Pt.mediaType==="audio"){for(Vt in Rt.audioSent={packetsSent:0,bytesSent:0},Qt=Math.floor(Pt.timestamp/1e3),Pt)jt.STANDARD_STAT_KEYS.audioSent[Vt]!==!1&&(Vt==="timestamp"?Rt.audioSent.timestamp=Qt:Rt.audioSent[Vt]=Pt[Vt]);Et=!0}else if(Pt.mediaType==="video"){for(Vt in Rt.videoSent={packetsSent:0,bytesSent:0,framesEncoded:0},Qt=Math.floor(Pt.timestamp/1e3),Pt)jt.STANDARD_STAT_KEYS.videoSent[Vt]!==!1&&(Vt==="timestamp"?Rt.videoSent.timestamp=Qt:Rt.videoSent[Vt]=Pt[Vt]);Et=!0}}}),Et},this.refineStats_firefox_63=function(Rt,Lt){var Et=!1,jt=this;return Lt.forEach(function(Pt){if(Pt.type!=="inbound-rtp"||Pt.isRemote){if(Pt.type==="outbound-rtp"&&!Pt.isRemote){if(Pt.kind==="audio"){Rt.audioSent={packetsSent:0,bytesSent:0};var Vt=Math.floor(Pt.timestamp/1e3);for(var Qt in Pt)jt.STANDARD_STAT_KEYS.audioSent[Qt]!==!1&&(Qt==="timestamp"?Rt.audioSent.timestamp=Vt:Rt.audioSent[Qt]=Pt[Qt]);Et=!0}else if(Pt.kind==="video"){Rt.videoSent={packetsSent:0,bytesSent:0,framesEncoded:0};var rn=Math.floor(Pt.timestamp/1e3);for(var Jt in Pt)jt.STANDARD_STAT_KEYS.videoSent[Jt]!==!1&&(Jt==="timestamp"?Rt.videoSent.timestamp=rn:Rt.videoSent[Jt]=Pt[Jt]);Et=!0}}}else if(Pt.kind==="audio"){Rt.audioReceived={packetsReceived:0,bytesReceived:0};var sn=Math.floor(Pt.timestamp/1e3);for(var mn in Pt)jt.STANDARD_STAT_KEYS.audioReceived[mn]!==!1&&(mn==="timestamp"?Rt.audioReceived.timestamp=sn:Rt.audioReceived[mn]=Pt[mn]);Et=!0}else if(Pt.kind==="video"){Rt.videoReceived={packetsReceived:0,bytesReceived:0,framesDecoded:0};var an=Math.floor(Pt.timestamp/1e3);for(var hn in Pt)jt.STANDARD_STAT_KEYS.videoReceived[hn]!==!1&&(hn==="timestamp"?Rt.videoReceived.timestamp=an:Rt.videoReceived[hn]=Pt[hn]);Et=!0}}),Et},this.addCallStats=function(Rt){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Et={};if(this.refineStats!==void 0){if(this.refineStats(Et,Rt),Et.audioReceived!==void 0){if(this.prevData.audioReceived!==void 0){var jt=Et.audioReceived.timestamp-this.prevData.audioReceived[0].timestamp;jt>0?(Et.audioReceived.packetsReceivedPerSecond===void 0&&(Et.audioReceived.packetsReceivedPerSecond=Math.floor((Et.audioReceived.packetsReceived-this.prevData.audioReceived[0].packetsReceived)/jt)),Et.audioReceived.bitsReceivedPerSecond===void 0&&(Et.audioReceived.bitsReceivedPerSecond=Math.floor(8*(Et.audioReceived.bytesReceived-this.prevData.audioReceived[0].bytesReceived)/jt)),Et.audioReceived.packetsLostPerSecond===void 0&&(Et.audioReceived.packetsLostPerSecond=Math.floor((Et.audioReceived.packetsLost-this.prevData.audioReceived[0].packetsLost)/jt)),Et.audioReceived.packetLossRatio===void 0&&(Et.audioReceived.packetLossRatio=100*(Et.audioReceived.packetsLost-this.prevData.audioReceived[0].packetsLost)/(Et.audioReceived.packetsReceived-this.prevData.audioReceived[0].packetsReceived)),Et.audioReceived.samplingInterval=jt):(Et.audioReceived.packetsReceivedPerSecond===void 0&&(Et.audioReceived.packetsReceivedPerSecond=0),Et.audioReceived.bitsReceivedPerSecond===void 0&&(Et.audioReceived.bitsReceivedPerSecond=0),Et.audioReceived.packetsLostPerSecond===void 0&&(Et.audioReceived.packetsLostPerSecond=0),Et.audioReceived.packetLossRatio===void 0&&(Et.audioReceived.packetLossRatio=0),Et.audioReceived.samplingInterval=0)}else Et.audioReceived.packetsReceivedPerSecond===void 0&&(Et.audioReceived.packetsReceivedPerSecond=0),Et.audioReceived.bitsReceivedPerSecond===void 0&&(Et.audioReceived.bitsReceivedPerSecond=0),Et.audioReceived.packetsLostPerSecond===void 0&&(Et.audioReceived.packetsLostPerSecond=0),Et.audioReceived.packetLossRatio===void 0&&(Et.audioReceived.packetLossRatio=0),Et.audioReceived.samplingInterval=0,this.prevData.audioReceived=[];for(this.prevData.audioReceived.push(Et.audioReceived);this.prevData.audioReceived.length>this.prevDataThreshold;)this.prevData.audioReceived.shift()}if(Et.videoReceived!==void 0){if(this.prevData.videoReceived!==void 0){var Pt=Et.videoReceived.timestamp-this.prevData.videoReceived[0].timestamp;Pt>0?(Et.videoReceived.packetsReceivedPerSecond===void 0&&(Et.videoReceived.packetsReceivedPerSecond=Math.floor((Et.videoReceived.packetsReceived-this.prevData.videoReceived[0].packetsReceived)/Pt)),Et.videoReceived.bitsReceivedPerSecond===void 0&&(Et.videoReceived.bitsReceivedPerSecond=Math.floor(8*(Et.videoReceived.bytesReceived-this.prevData.videoReceived[0].bytesReceived)/Pt)),Et.videoReceived.packetsLostPerSecond===void 0&&(Et.videoReceived.packetsLostPerSecond=Math.floor((Et.videoReceived.packetsLost-this.prevData.videoReceived[0].packetsLost)/Pt)),Et.videoReceived.framesDecodedPerSecond===void 0&&(Et.videoReceived.framesDecodedPerSecond=Math.floor((Et.videoReceived.framesDecoded-this.prevData.videoReceived[0].framesDecoded)/Pt)),Et.videoReceived.packetLossRatio===void 0&&(Et.videoReceived.packetLossRatio=100*(Et.videoReceived.packetsLost-this.prevData.videoReceived[0].packetsLost)/(Et.videoReceived.packetsReceived-this.prevData.videoReceived[0].packetsReceived)),Et.videoReceived.samplingInterval=Pt):(Et.videoReceived.packetsReceivedPerSecond===void 0&&(Et.videoReceived.packetsReceivedPerSecond=0),Et.videoReceived.bitsReceivedPerSecond===void 0&&(Et.videoReceived.bitsReceivedPerSecond=0),Et.videoReceived.packetsLostPerSecond===void 0&&(Et.videoReceived.packetsLostPerSecond=0),Et.videoReceived.framesDecodedPerSecond===void 0&&(Et.videoReceived.framesDecodedPerSecond=0),Et.videoReceived.packetLossRatio===void 0&&(Et.videoReceived.packetLossRatio=0),Et.videoReceived.samplingInterval=0)}else Et.videoReceived.packetsReceivedPerSecond===void 0&&(Et.videoReceived.packetsReceivedPerSecond=0),Et.videoReceived.bitsReceivedPerSecond===void 0&&(Et.videoReceived.bitsReceivedPerSecond=0),Et.videoReceived.packetsLostPerSecond===void 0&&(Et.videoReceived.packetsLostPerSecond=0),Et.videoReceived.framesDecodedPerSecond===void 0&&(Et.videoReceived.framesDecodedPerSecond=0),Et.videoReceived.packetLossRatio===void 0&&(Et.videoReceived.packetLossRatio=0),Et.videoReceived.samplingInterval=0,this.prevData.videoReceived=[];for(this.prevData.videoReceived.push(Et.videoReceived);this.prevData.videoReceived.length>this.prevDataThreshold;)this.prevData.videoReceived.shift()}if(Et.audioSent!==void 0){if(this.prevData.audioSent!==void 0){var Vt=Et.audioSent.timestamp-this.prevData.audioSent[0].timestamp;Vt>0?(Et.audioSent.packetsSentPerSecond===void 0&&(Et.audioSent.packetsSentPerSecond=Math.floor((Et.audioSent.packetsSent-this.prevData.audioSent[0].packetsSent)/Vt)),Et.audioSent.bitsSentPerSecond===void 0&&(Et.audioSent.bitsSentPerSecond=Math.floor(8*(Et.audioSent.bytesSent-this.prevData.audioSent[0].bytesSent)/Vt)),Et.audioSent.samplingInterval=Vt):(Et.audioSent.packetsSentPerSecond===void 0&&(Et.audioSent.packetsSentPerSecond=0),Et.audioSent.bitsSentPerSecond===void 0&&(Et.audioSent.bitsSentPerSecond=0),Et.audioSent.samplingInterval=0)}else Et.audioSent.packetsSentPerSecond===void 0&&(Et.audioSent.packetsSentPerSecond=0),Et.audioSent.bitsSentPerSecond===void 0&&(Et.audioSent.bitsSentPerSecond=0),Et.audioSent.samplingInterval=0,this.prevData.audioSent=[];for(this.prevData.audioSent.push(Et.audioSent);this.prevData.audioSent.length>this.prevDataThreshold;)this.prevData.audioSent.shift()}if(Et.videoSent!==void 0){if(this.prevData.videoSent!==void 0){var Qt=Et.videoSent.timestamp-this.prevData.videoSent[0].timestamp;Qt>0?(Et.videoSent.packetsSentPerSecond===void 0&&(Et.videoSent.packetsSentPerSecond=Math.floor((Et.videoSent.packetsSent-this.prevData.videoSent[0].packetsSent)/Qt)),Et.videoSent.bitsSentPerSecond===void 0&&(Et.videoSent.bitsSentPerSecond=Math.floor(8*(Et.videoSent.bytesSent-this.prevData.videoSent[0].bytesSent)/Qt)),Et.videoSent.framesEncodedPerSecond===void 0&&(Et.videoSent.framesEncodedPerSecond=Math.floor((Et.videoSent.framesEncoded-this.prevData.videoSent[0].framesEncoded)/Qt)),Et.videoSent.samplingInterval=Qt):(Et.videoSent.packetsSentPerSecond===void 0&&(Et.videoSent.packetsSentPerSecond=0),Et.videoSent.bitsSentPerSecond===void 0&&(Et.videoSent.bitsSentPerSecond=0),Et.videoSent.framesEncodedPerSecond===void 0&&(Et.videoSent.framesEncodedPerSecond=0),Et.videoSent.samplingInterval=0)}else Et.videoSent.packetsSentPerSecond===void 0&&(Et.videoSent.packetsSentPerSecond=0),Et.videoSent.bitsSentPerSecond===void 0&&(Et.videoSent.bitsSentPerSecond=0),Et.videoSent.framesEncodedPerSecond===void 0&&(Et.videoSent.framesEncodedPerSecond=0),Et.videoSent.samplingInterval=0,this.prevData.videoSent=[];for(this.prevData.videoSent.push(Et.videoSent);this.prevData.videoSent.length>this.prevDataThreshold;)this.prevData.videoSent.shift()}}return Object.keys(Et).length>0&&typeof Lt.post=="function"&&Lt.post(Et),Et},this.browserType==="chrome"?Tt==="proprietary"?this.refineStats=this.refineStats_chrome_proprietary:this.browserVersion>=58?this.refineStats=this.refineStats_chrome_58:this.refineStats=this.refineStats_chrome_legacy:this.browserType==="firefox"?this.browserVersion>=63?this.refineStats=this.refineStats_firefox_63:this.refineStats=this.refineStats_firefox_legacy:this.browserType==="safari"&&(this.refineStats=this.refineStats_chrome_58)}),Gt=(s(658),function(){this.NarrowBandSpeechQuality=function(qt,kt){var st,Tt,Rt=1,Lt=1+qt/10,Et=1+qt/150,jt=(94.769-(st=80+2.5*(65-40*Math.log10(Lt/Et)+6*Math.exp(qt*qt*-.3)-14)))*(94.769-st)/4+100;return(Tt=93.193-((94.769-st)/2+Math.sqrt(jt)-1)*(1-Math.exp(-qt))-(0+kt/(kt+4.3)*95))<0&&(Rt=1),Tt<100&Tt>0&&(Rt=1+.035*Tt+Tt*(Tt-60)*(100-Tt)*7*1e-6),Tt>100&&(Rt=4.5),Rt},this.WideBandspeechQuality=function(qt,kt){var st,Tt,Rt,Lt=0,Et=1;qt<100&&(Lt=.08-qt+10),qt>=100&&(Lt=18);var jt=1+qt/10,Pt=1+qt/150,Vt=(129-(st=80+3*(65+Lt-40*Math.log10(jt/Pt)+6*Math.exp(qt*qt*-.3)-14)))*(129-st)/4+100;return(Rt=(Tt=129-((129-st)/2+Math.sqrt(Vt)-1)*(1-Math.exp(-qt))-(0+kt/(kt+4.3)*95))/1.29)<=0&&(Et=1),Rt<100&Rt>0&&(Et=1+.035*Tt+Tt*(Tt-60)*(100-Tt)*7*1e-6),Rt>=100&&(Et=4.5),Et},this.videoQuality=function(qt,kt,st,Tt,Rt){var Lt,Et,jt,Pt,Vt,Qt,rn,Jt,sn;return sn=kt>720?[0,2.77,.009,3.95,460,1.28,2.12,32e-5,1.28,262,1.98,22.84,7.999]:kt>576?[0,6.31,.008,3.68,262,1.28,1.97,33e-5,1.24,343,2.76,6.25,6.013]:kt>480?[0,6.96,.007,3.58,214,1.2,1.75,63e-5,1.13,171,4.25,7.98,12.001]:kt>288?[0,5.61,.01,3.38,182,1.31,2.23,75e-5,1.51,136,4.05,20.16,22.332]:[0,3.988,.013,3.625,89.25,1.125,.713,0,1.542,245.5,3.011,39.31,16.67],Qt=1+Math.pow(Tt/sn[4],sn[5]),Lt=sn[3]-sn[3]/Qt,Et=sn[1]+sn[2]*Tt,jt=sn[6]+sn[7]*Tt,rn=Math.pow(Math.log(Rt)-Math.log(Et),2),Jt=2*Math.pow(jt,2),Pt=Lt*Math.exp(-rn/Jt),Vt=sn[10]+sn[11]*Math.exp(-Rt/sn[8])+sn[12]*Math.exp(-Tt/sn[9]),1+Pt*Math.exp(-st/Vt)},this.audiovisualQuality=function(qt,kt,st,Tt){var Rt,Lt,Et,jt,Pt;return qt>0&&kt>0?(Rt=(Pt=[0,-.6966,-.8127,.4562,3.003,-.1638,.3626,.1291,.5457,-1251e-7,3.763,-.001065,.01465,-.001002,0])[9]*(st+Tt)+Pt[10],st>=Tt&&(Lt=Math.min(Pt[11]*(st-Tt)+Pt[12],0)),st=qt.length?{done:!0}:{done:!1,value:qt[Tt++]}},e:function(Pt){throw Pt},f:Rt}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Lt,Et=!0,jt=!1;return{s:function(){st=st.call(qt)},n:function(){var Pt=st.next();return Et=Pt.done,Pt},e:function(Pt){jt=!0,Lt=Pt},f:function(){try{Et||st.return==null||st.return()}finally{if(jt)throw Lt}}}}function zt(qt,kt){(kt==null||kt>qt.length)&&(kt=qt.length);for(var st=0,Tt=new Array(kt);st43?(this.mediaConstraintsAudioOnly={offerToReceiveAudio:!0,offerToReceiveVideo:!1},this.mediaConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1}):(this.mediaConstraintsAudioOnly={mandatory:{offerToReceiveAudio:!0,offerToReceiveVideo:!1}},this.mediaConstraints={mandatory:{offerToReceiveAudio:!0,offerToReceiveVideo:!0}}):nt.Xh==="Chrome"?nt.PR<55?(this.mediaConstraintsAudioOnly={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}},this.mediaConstraints={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}}):(this.mediaConstraintsAudioOnly={offerToReceiveAudio:1,offerToReceiveVideo:1},this.mediaConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1}):nt.Xh==="Edge"&&apiRTC.browserDetails.type!=="chrome"?(this.mediaConstraintsAudioOnly={offerToReceiveAudio:!0,offerToReceiveVideo:!1},this.mediaConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1}):(this.mediaConstraintsAudioOnly={offerToReceiveAudio:1,offerToReceiveVideo:1},this.mediaConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1}),nt.ag.name==="iOS"&&(Ft.log("Defining mediaConstraints for iOS "),this.mediaConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0}),this.trickleIce=qt.trickleIce,this.callLocalStream=null,this.generatedLocalStream=!1,this.audioOnly=!1,this.inviteSended=!1,this.sendInviteTrickleIceFalseTimeOutId=0,this.sendInviteTrickleIceFalseTimer=5e3,this.message200OKSended=!1,this.send200OKTrickleIceFalseTimeOutId=0,this.send200OKTrickleIceFalseTimer=5e3,this.message200OKReceived=!1,this.callCancelled=!1,this.screenSharing=!1,this.desktopId=0,this.pc_config=qt.pc_config,this.pc_constraints=qt.pc_constraints,this.audioFileMediaElement=null,this.videoReceivedWidth=640,this.videoReceivedHeight=480,this.videoSendWidth=640,this.videoSendHeight=480,this.videoReceivedDelay=0,this.audioReceivedDelay=0,this.audioSendDelay=0,this.videoSendDelay=0,this.videoSendPacketLossRatio=0,this.audioSendPacketLossRatio=0,this.getStatsInterval=qt.qosInterval,this.qm=null,this.statisticId=null,this.csmIntervalMs=qt.csmIntervalMs,this.csmIntervalId=null,this.remoteId=0,this.callType="media",this.localCallProfile={audio:!1,audioActive:!1,video:!1,videoActive:!1},this.remoteCallProfile={audio:!1,audioActive:!1,video:!1,videoActive:!1},this.disconnectionTimeoutId=0,this.disconnectionTimer=4e4,this.disconnectionWarningDelay=9e3,this.disconnectionWarningInterval=0,this.disconnectionWarningTimeout=0,this.disconnectionWarningCount=0,this.checkCandidateTypesTimer=1e4,this.checkCandidateTypesTimeoutId=0,this.checkCandidateTypesTimeoutTable=[],this.data={},this.screenStream=null,this.screenIsDisplayed=!1,this.addingDataChannelOnCallOngoing=!1,this.sendDataChannel=null,this.receiveDataChannel=null,this.receiveChunkNb={},this.firstDataPacket={},this.receivedSize={},this.receiveArrayToStoreChunks={},this.destCallType="media",this.mcuRemoteStream=null,this.userMediaAccessRequired=!0,this.settingUpMode="normal",this.remoteType="web",this.mediaTypeForIncomingCall=qt.mediaTypeForIncomingCall,this.mediaTypeForOutgoingCall=qt.mediaTypeForOutgoingCall,this.mediaRoutingMode=qt.mediaRoutingMode,this.stripAudioSDPActivated=!1,this.stripVideoSDPActivated=!1,this.iceState="notdefined",this.restarted=!1,this.audioSdpDirection=null,this.videoSdpDirection=null,this.isLocalAudioMuted=!1,this.isLocalVideoMuted=!1,this.isRemoteAudioMuted=!1,this.isRemoteVideoMuted=!1,this.isRemoteAudioSilent=!1,this.isRemoteVideoSilent=!1,this.isAccepted=!1,this.accessToMedia=!1,this.callConfiguration=null,this.captureSourceType=null,this.preferH264Codec=!1,this.preferVP8Codec=!1,this.preferVP9Codec=!1,this.candidateNb=0,this.sessionMCU=null,this.instanceId=0,this.retryUpdateMedia=!1,this.updateMediaOngoing=!1,this.setCallTurnServer=function(kt){Ft.info("setCallTurnServer :",kt);var st=JSON.stringify(this.pc_config);st=st.replace(/mp1.apizee.com/g,kt),this.pc_config=JSON.parse(st)},this.setCallMediaRoutingMode=function(kt){Ft.info("setCallMediaRoutingMode :",kt),kt==="hostOnly"?this.mediaRoutingMode=qt.mediaRoutingModeEnum.hostOnly:kt==="stun"?this.mediaRoutingMode=qt.mediaRoutingModeEnum.stun:kt==="stunOnly"?this.mediaRoutingMode=qt.mediaRoutingModeEnum.stunOnly:kt==="turn"?this.mediaRoutingMode=qt.mediaRoutingModeEnum.turn:kt==="turnOnly"?this.mediaRoutingMode=qt.mediaRoutingModeEnum.turnOnly:(Ft.log("parameter error when calling function : setCallMediaRoutingMode()"),this.myWebRTC_Event.createErrorEvent("parameter error when calling function : setCallMediaRoutingMode()","PARAMETER_ERROR_SETCALLMEDIAROUTINGMODE"))},this.checkDTLSCompliancy=function(){if(Ft.debug("checkDTLSCompliancy"),apiCC.session.isDeviceDTLSCompliant()===!1)Ft.log("Device not DTLS compliant, setting DtlsSrtpKeyAgreement: false"),this.pc_constraints={optional:[{DtlsSrtpKeyAgreement:!1}]};else{var kt=apiCC.session.isClientDTLSCompliant(this.remoteId);kt!==!1&&kt!=="false"||(Ft.log("Remote Device not DTLS compliant, setting DtlsSrtpKeyAgreement: false"),this.pc_constraints={optional:[{DtlsSrtpKeyAgreement:!1}]})}},this.sendData=function(kt,st){Ft.info("datachannel - sendData");var Tt=null,Rt=null;if(kt.file instanceof File)return Ft.log("File"),this.contentType=kt.file.type,this.originalDataType="File",Tt=new FileReader,Rt=this,Tt.onload=function(Lt){var Et=Lt.target.result||Tt.result;Rt.sendData({file:Et,name:kt.name,type:kt.type},st)},void Tt.readAsArrayBuffer(kt.file);new Ot(this).send(kt,this.sendDataChannel,st)},Ft.log("New Call for client with Id :"+qt.clientId),this.generateCallId=function(){this.callId=apiCC.generateCallId(),Ft.info("new call with callId :"+this.callId)},this.sendInviteTrickleIceFalse=function(){Ft.log("sendInviteTrickleIceFalse"),Ft.log("sendInvite on candidate timer reached"),this.myWebRTC_Stack.sendInvite(this.callId,this.callerId,qt.nickname,this.dest_roomId,this.dest_roomId,this.callType,{offer:this.pc.localDescription,data:this.data,stream:this.mcuRemoteStream,volatile:!!this.restarted}),this.inviteSended=!0},this.send200OkTrickleIceFalse=function(){Ft.log("send200OkTrickleIceFalse"),this.myWebRTC_Stack.send200OK(this.callId,this.callerId,this.calleeId,qt.nickname,this.dest_roomId,this.pc.localDescription,this.data),this.message200OKSended=!0},this.onSetLocalDescriptionSuccess=function(){Ft.info("onSetLocalDescriptionSuccess"),this.localDescriptionSetted=!0,this.asyncCallbacks&&this.asyncCallbacks.type==="subscribe"&&delete this.asyncCallbacks,this.trickleIce===!1&&(this.callee===!0?(Ft.info("starting send200OKTrickleIceFalseTimeOutId"),this.send200OKTrickleIceFalseTimeOutId=setTimeout(this.callback(this,"send200OkTrickleIceFalse"),this.send200OKTrickleIceFalseTimer)):(Ft.info("starting sendInviteTrickleIceFalseTimeOutId"),this.sendInviteTrickleIceFalseTimeOutId=setTimeout(this.callback(this,"sendInviteTrickleIceFalse"),this.sendInviteTrickleIceFalseTimer))),qt.rtpSenderSetParamatersCapable&&qt.evaluateVideoCap(this)},this.onSetLocalDescriptionFailure=function(kt){Ft.warn("onSetLocalDescriptionFailure",kt);var st=null,Tt=null;this.callControl&&(st=this.callControl.roomName,Tt=this.callControl.type),un.createErrorEvent("Set local Description Failure","SET_LOCAL_DESCRIPTION_FAILURE",this.callId,st,Tt),qt.onHangup(this.callId,"Local_Description_Failure")},this.onSetRemoteDescriptionSuccess=function(){Ft.info("onSetRemoteDescriptionSuccess");var kt=null;for(this.remoteDescriptionSetted=!0,this.restarting===!0&&delete this.restarting,this.data&&(this.data.mesh||this.data.subscribeOrder)||un.createCallEstablishedEvent(this.calleeId,this.callType,this.callId,this.destCallType);this.incomingcandidatesQueue.length;)kt=this.incomingcandidatesQueue.shift(),this.processCandidateMsg(kt);if(qt.clientIncomingCandidatesQueue[this.callId+"-"+this.instanceId]!==void 0){for(Ft.debug("Restoring candidate from client, this.callId :"+this.callId+" , instanceId :"+this.instanceId);qt.clientIncomingCandidatesQueue[this.callId+"-"+this.instanceId].length;)kt=qt.clientIncomingCandidatesQueue[this.callId+"-"+this.instanceId].shift(),this.processCandidateMsg(kt);delete qt.clientIncomingCandidatesQueue[this.callId+"-"+this.instanceId]}if(this.asyncCallbacks&&(this.asyncCallbacks.type==="addingUserMedia"?(this.asyncCallbacks.resolve(this.callConfiguration.userMediaStreamId),this.asyncCallbacks.timeoutId&&(clearTimeout(this.asyncCallbacks.timeoutId),delete this.asyncCallbacks.timeoutId),delete this.asyncCallbacks):this.asyncCallbacks.type==="updateCallConfiguration"&&(this.asyncCallbacks.resolve(),this.asyncCallbacks.timeoutId&&(clearTimeout(this.asyncCallbacks.timeoutId),delete this.asyncCallbacks.timeoutId),delete this.asyncCallbacks)),this.updateMediaOngoing=!1,this.retryUpdateMedia===!0){Ft.debug("an updateMedia was waiting for sig stable state or an other updateMedia end, updating Media now ..."),this.retryUpdateMedia=!1;var st=this.updateMedia(!1);Ft.debug("Retried updateMediaResult :",st)}},this.processCandidateMsg=function(kt){Ft.info("processCandidateMsg :",kt);var st=null;this.pc!==null?(kt.completeCandidate!==void 0?(Ft.trace("new behavior of 2.13.8"),st=new apiCC.myWebRTC_Adapter.RTCIceCandidate(kt.completeCandidate)):(Ft.log("old behavior < 2.13.8"),st=new apiCC.myWebRTC_Adapter.RTCIceCandidate({sdpMLineIndex:kt.label,candidate:kt.candidate})),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("addIceCandidate"),this.pc.addIceCandidate(st,function(){Ft.trace("addIceCandidate success")},function(Tt){Ft.warn("addIceCandidate failure: "+Tt),Tt=null})):(Ft.log("addIceCandidate - Promise version"),this.pc.addIceCandidate(st).then(function(){Ft.trace("addIceCandidate success")}).catch(function(Tt){Ft.warn("addIceCandidate failure: "+Tt),Tt=null}))):Ft.error("Error, call is not null but pc is null")},this.onSetRemoteDescriptionFailure=function(kt){Ft.warn("onSetRemoteDescriptionFailure :",kt);var st=null,Tt=null;this.callControl&&(st=this.callControl.roomName,Tt=this.callControl.type),un.createErrorEvent("Set remote Description Failure","SET_REMOTE_DESCRIPTION_FAILURE",this.callId,st,Tt),qt.onHangup(this.callId,"Remote_Description_Failure")},this.getUserMediaOnCall=function(){var kt=this,st=!1;if(Ft.info("getUserMediaOnCall, audio Only :"+this.audioOnly),Ft.info("getUserMediaOnCall, screenSharing activated :"+this.screenSharing),Ft.log("webRTCClient.gum_config :",qt.gum_config),this.callerId===qt.clientId){if(Ft.log("outgoing call"),this.mediaTypeForOutgoingCall==="VIDEO"||this.mediaTypeForOutgoingCall==="VIDEOONLY")if(Ft.log("mediaTypeForOutgoingCall :"+this.mediaTypeForOutgoingCall),this.mediaTypeForOutgoingCall==="VIDEOONLY"&&(st=!0),this.screenSharing!==!0){if(apiCC.mediaDeviceMgr.videoDevicePresent===!1){if(apiCC.mediaDeviceMgr.audioDevicePresent===!1)return Ft.log("getUserMediaOnCall without any device, calling without device"),void this.onUserMediaSuccessOnCall();Ft.log("video is not present :"+this.callType),this.callType==="media"&&(Ft.log("callType is media, but no webcam present, forcing callType to audio"),this.callType="audio",this.audioOnly=!0)}}else Ft.log("screenSharing, no device checking");else if(this.mediaTypeForOutgoingCall==="AUDIO")Ft.log("mediaTypeForOutgoingCall is AUDIO, setting call to audioOnly"),this.callType="audio",this.audioOnly=!0;else if(this.mediaTypeForOutgoingCall==="NONE"||this.mediaTypeForOutgoingCall==="DATA")return Ft.log("mediaTypeForOutgoingCall is NONE, call will be recvOnly"),void this.onUserMediaSuccessOnCall()}else if(Ft.log("incoming call"),this.mediaTypeForIncomingCall==="VIDEO"||this.mediaTypeForIncomingCall==="VIDEOONLY"){if(Ft.log("mediaTypeForIncomingCall :"+this.mediaTypeForIncomingCall),this.mediaTypeForIncomingCall==="VIDEOONLY"&&(st=!0),apiCC.mediaDeviceMgr.videoDevicePresent===!1){if(apiCC.mediaDeviceMgr.audioDevicePresent===!1)return Ft.log("getUserMediaOnCall without any device, calling without device"),void this.onUserMediaSuccessOnCall();Ft.log("video is not present :"+this.callType),this.callType==="media"&&(Ft.log("callType is media, but no webcam present, forcing callType to audio"),this.callType="audio",this.audioOnly=!0)}}else if(this.mediaTypeForIncomingCall==="AUDIO")Ft.log("mediaTypeForIncomingCall is AUDIO, setting call to audioOnly"),this.callType="audio",this.audioOnly=!0;else if(this.mediaTypeForIncomingCall==="NONE"||this.mediaTypeForIncomingCall==="DATA")return Ft.log("mediaTypeForIncomingCall is NONE, call will be recvOnly"),void this.onUserMediaSuccessOnCall();qt.getUserMediaOnGoing=!0;var Tt=null,Rt=null;if(Ft.log("this.screenSharing :"+this.screenSharing),Ft.log("this.audioOnly :"+this.audioOnly),this.screenSharing===!0)if(Ft.log("getScreenMedia"),nt.Xh==="Chrome")Ft.log("this.desktopId :"+this.desktopId),Tt={video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:this.desktopId}}};else{if(Ft.log("this.captureSourceType :"+this.captureSourceType),this.captureSourceType!=="screen"&&this.captureSourceType!=="window"&&this.captureSourceType!=="application")return void Ft.error("captureSourceType value is not correct");Tt={video:{mediaSource:this.captureSourceType}}}else this.audioOnly===!0?(Ft.log("this.audioOnly = true"),qt.gum_config=apiCC.setAudioSourceIdInConstraint(qt.audioSourceId,qt.gum_config),Rt=JSON.parse(JSON.stringify(qt.gum_config)),qt.allowAsymetricMediaCalls===!1?Rt.video=!1:Ft.log("allow AsymetricMediaCalls is activated"),Tt=Rt):(Ft.log("audio and video call"),Tt=(0,at.ws)({},qt.gum_config),st?Tt.audio=!1:Tt=apiCC.setAudioSourceIdInConstraint(qt.audioSourceId,Tt),Tt=apiCC.setVideoSourceIdInConstraint(qt.videoSourceId,Tt),Tt=apiCC.setVideoFacingModeInConstraint(qt.facingMode,Tt),typeof apiRTC_React<"u"&&(Tt={audio:!0,video:{mandatory:{minWidth:500,minHeight:300,minFrameRate:30},facingMode:"user"}}));apiCC.createUserMediaStream({callId:this.callId,type:this.callType,gum_config:Tt,success:function(Lt){Ft.debug("[getUserMediaOnCall] success; userMediaStreamId: "+Lt.userMediaStreamId),kt.callConfiguration!==void 0&&kt.callConfiguration!==null||(kt.callConfiguration={}),kt.callConfiguration.userMediaStreamId=Lt.userMediaStreamId,kt.onUserMediaSuccessOnCall(Lt.stream)},failure:function(Lt,Et){Ft.debug("[getUserMediaOnCall] failure; userMediaStreamId: "+Lt.userMediaStreamId),kt.onUserMediaErrorOnCall(Et)}})},this.handleToneChangeEvent=function(kt){Ft.debug("handleToneChangeEvent :",kt.tone),kt.tone!==""?Ft.debug("Tone played: "+kt.tone):Ft.debug("All tones have played.")},this.sendTones=function(kt,st,Tt){Ft.debug("sendTones :"),this.dtmfSender&&(Ft.debug("sendTones : Tones, duration, gap: ",kt,st,Tt),this.dtmfSender.insertDTMF(kt,st,Tt))},this.addStream=function(kt){var st,Tt=null,Rt=null,Lt=0,Et=!1,jt=null,Pt=[];if(nt.Xh==="Firefox"&&nt.PR<51||nt.Xh==="Chrome"&&nt.PR<65||nt.Xh==="Safari"&&nt.dc<12.1||nt.Xh==="Mobile Safari"&&nt.dc<12.1||apiRTC.osName==="iOS"&&typeof cordova<"u"&&cordova.plugins!==void 0&&cordova.plugins.iosrtc!==void 0)Ft.info("using addStream method"),this.pc.addStream(kt),Ft.debug("end addStream method");else{if(!(nt.Xh==="Firefox"&&nt.PR<59||nt.Xh==="Edge"&&apiRTC.browserDetails.type!=="chrome"||typeof apiRTC_React<"u")){for(Ft.info("using addTrack/replaceTrack method"),Tt=kt.getTracks(),st=0;st replaceTrack",Rt[Lt]);else{if(this.simulcast==="RID"&&Tt[st].kind==="video"&&at.wL.type==="chrome"){var Vt=[{rid:"h",active:!0,maxBitrate:9e5},{rid:"m",active:!0,maxBitrate:3e5,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:1e5,scaleResolutionDownBy:4}];this.callControl.callConfiguration.simulcast&&this.callControl.callConfiguration.simulcast.sendEncodings&&(Vt=this.callControl.callConfiguration.simulcast.sendEncodings.slice()),jt=this.pc.addTransceiver(Tt[st],{direction:"sendonly",streams:[kt],sendEncodings:Vt}).sender}else if(jt=this.pc.addTrack(Tt[st],kt),this.simulcast==="RID"&&Tt[st].kind==="video"&&at.wL.type==="firefox"){var Qt=jt.getParameters();Qt||(Qt={}),this.callControl.callConfiguration.simulcast&&this.callControl.callConfiguration.simulcast.sendEncodings?Qt.encodings=this.callControl.callConfiguration.simulcast.sendEncodings.slice():Qt.encodings=[{rid:"h",active:!0,maxBitrate:9e5},{rid:"m",active:!0,maxBitrate:3e5,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:1e5,scaleResolutionDownBy:4}],Pt.push(jt.setParameters(Qt))}Ft.debug("addStream -> addTrack",jt),this.rtpSenders[Tt[st].kind].push(jt)}}return Ft.debug("end addTrack/replaceTrack method"),this.rtpSenders.audio.length>0&&(this.dtmfSender=this.rtpSenders.audio[0].dtmf,this.dtmfSender&&(this.dtmfSender.ontonechange=this.handleToneChangeEvent)),new Promise(function(rn,Jt){Promise.all(Pt).then(function(sn){rn()}).catch(Jt)})}for(Ft.info("using addTrack method"),Tt=kt.getTracks(),st=0;st0&&(kt.getVideoTracks()[0].onended=this.callback(this,"stopScreenSharing")))):this.audioOnly===!0&&(this.callType="audio"),kt!==void 0&&(this.callLocalStream=kt),(0,at.yJ)()?(Ft.log("isHTTP true"),this.establishCall()):(Ft.log("webRTCClient.userAcceptOnIncomingCall :"+qt.userAcceptOnIncomingCall),Ft.log("this.callee :"+this.callee),this.data!==void 0&&Ft.log("this.data.MCUType :"+this.data.MCUType),qt.userAcceptOnIncomingCall!==!0||this.callee!==!0&&this.data.MCUType!=="MCU-Callee"||this.isAccepted!==!1?this.calleeId!=="LOCAL"?this.establishCall():Ft.log("call is not established as this is a LOCAL stream request"):Ft.log("Stand-by :: wait for establishCall"))},this.establishCall=function(){var kt=this;Ft.debug("establishCall()"),this.started!==!0||this.addingUserMedia!==!0||!this.belongsToRoom()||this.settingUpType!=="publish"||this.data&&this.data.hasOwnProperty("MCUType")||!this.sessionMCU||this.sessionMCU.hasOwnProperty("roomMode")||(this.restarting=!0,this.pc.close(),this.pc=null,this.started=!1,this.localDescriptionSetted=!1,this.remoteDescriptionSetted=!1,this.sendedSdpOfferMessage=null,this.receivedSdpOfferMessage=null,this.rtpSenders={audio:[],video:[]},this.addingUserMedia=!1,this.updateUserMedia=!1,this.updateCause=null,this.incomingcandidatesQueue=[],this.message200OKReceived=!1,this.statisticId&&(clearInterval(this.statisticId),this.statisticId=null),this.csmIntervalId&&(clearInterval(this.csmIntervalId),this.csmIntervalId=null),this.instanceId=apiCC.generateInstanceId(),this.data.instanceId=this.instanceId),this.dataCall!==!0&&this.checkingMutingState(),this.maybeStart();var st=null;this.callee&&this.addingUserMedia!==!0&&this.updateUserMedia!==!0?(st=new apiCC.myWebRTC_Adapter.RTCSessionDescription(this.receivedSdpOfferMessage),Ft.log("Avant setRemote pour le callee :",st),this.pc!==null?(qt.preferSendingH264Codec&&(Ft.log("Modification of SDP to set H264 as prefered sending codec"),st.sdp=qt.mySDPManager.maybePreferCodec(st.sdp,"video","H264")),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("establishCall : before setRemoteDescription for callee"),this.pc.setRemoteDescription(st,this.callback(this,"onSetRemoteDescriptionSuccess"),this.callback(this,"onSetRemoteDescriptionFailure"))):(Ft.log("establishCall : before setRemoteDescription for callee - Promise version"),this.pc.setRemoteDescription(st).then(this.callback(this,"onSetRemoteDescriptionSuccess")).catch(this.callback(this,"onSetRemoteDescriptionFailure")))):Ft.log("Error : PC is null"),this.doAnswer()):this.addingUserMedia===!0?(Ft.log("Adding local stream 1."),this.pc!==null?(this.callLocalStream===null&&qt.localStream!==null&&(this.callLocalStream=qt.localStream),this.callLocalStream!==null?(Ft.log("Add Stream of callLocalStream"),this.addStream(this.callLocalStream).then(function(){kt.updateMediaWithRetryManagement(!1)}).catch(function(Tt){Ft.error("failed to add stream",Tt)})):(Ft.log("No Stream to addStream"),this.updateMediaWithRetryManagement(!1))):Ft.error("Error : PC is null")):this.updateUserMedia===!0&&this.updateMediaWithRetryManagement(!1),Ft.log("End of establishCall()")},this.onUserMediaSuccessTestUni=function(){qt.getUserMediaOnGoing=!1,Ft.info("onUserMediaSuccessTestUni : User has not granted access to local media.");var kt=null,st={};qt.userMediaErrorDetected===!0&&(qt.userMediaErrorDetected=!1,st.userMediaErrorDetected=qt.userMediaErrorDetected,apiCC.session.setUserData(st)),qt.accessToLocalMedia=!0,this.maybeStart(),this.callee&&(kt=new apiCC.myWebRTC_Adapter.RTCSessionDescription(this.receivedSdpOfferMessage),qt.preferSendingH264Codec&&(Ft.log("Modification of SDP to set H264 as prefered sending codec"),kt.sdp=qt.mySDPManager.maybePreferCodec(kt.sdp,"video","H264")),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("onUserMediaSuccessTestUni : before setRemoteDescription for callee"),this.pc.setRemoteDescription(kt,this.callback(this,"onSetRemoteDescriptionSuccess"),this.callback(this,"onSetRemoteDescriptionFailure"))):(Ft.log("onUserMediaSuccessTestUni : before setRemoteDescription for callee - Promise version"),this.pc.setRemoteDescription(kt).then(this.callback(this,"onSetRemoteDescriptionSuccess")).catch(this.callback(this,"onSetRemoteDescriptionFailure"))),this.doAnswer())},this.onUserMediaErrorOnCall=function(kt){var st=this;Ft.log("onUserMediaErrorOnCall");var Tt={};qt.getUserMediaOnGoing=!1,setTimeout(function(){un.createErrorEvent(kt,"USER_MEDIA_ERROR",st.callId)}),Ft.error("Failed to get access to local media. Error code was "+kt.code),Ft.error(kt),kt=null,nt.$6!=="electron"&&(nt.Xh==="Chrome"||nt.Xh==="Mobile Chrome")&&nt.PR>47&&(Ft.log("browser_version > 47"),window.location.protocol!=="https:"&&Ft.error("HTTPS is now mandatory to use getUserMedia()")),this.screenSharing===!0&&(this.callType="screenSharing",window.location.protocol!=="https:"?(Ft.log("You need to be connected using HTTPS for screenSharing"),un.createDesktopCaptureEvent("UserMediaError_HTTPS_needed",this.callId,this.remoteId)):(Ft.log("screenSharing UserMediaError"),un.createDesktopCaptureEvent("UserMediaError",this.callId,this.remoteId))),this.callee===!0?(this.myWebRTC_Stack.sendBye(this.callId,this.calleeId,this.dest_roomId,this.callerId,"User_Media_Error",this.data),qt.removeCallFromTableWithCallIdandRemoteId(this.callId,this.callerId,"User_Media_Error")):(this.data!==void 0&&this.data!==null&&this.data.MCUType==="MCU-Callee"&&this.myWebRTC_Stack.sendBye(this.callId,this.callerId,this.dest_roomId,this.calleeId,"User_Media_Error",this.data),qt.removeCallFromTableWithCallIdandRemoteId(this.callId,this.calleeId,"User_Media_Error")),this.screenSharing===!1&&(qt.userMediaErrorDetected=!0,Tt.userMediaErrorDetected=qt.userMediaErrorDetected,apiCC.session.setUserData(Tt))},this.maybeStart=function(){Ft.debug("maybeStart"),!this.started&&qt.channelReady&&(qt.accessToLocalMedia||this.dataCall)&&(Ft.log("Creating PeerConnection."),this.createPeerConnection(),qt.unidirectionelCallOnly||this.screenSharing===!0?this.callee===!1&&(Ft.log("Adding local stream 2."),this.callLocalStream!==null?(Ft.log("Add Stream of callLocalStream"),this.addStream(this.callLocalStream)):qt.localStream!==null?(Ft.log("Add Stream of client.localStream"),this.addStream(qt.localStream),this.callLocalStream=qt.localStream):Ft.log("No Stream to add")):this.dataCall||(Ft.log("Adding local stream 3."),this.callLocalStream!==null?(Ft.log("Add Stream of callLocalStream"),this.addStream(this.callLocalStream)):qt.localStream!==null?(Ft.log("Add Stream of client.localStream"),this.addStream(qt.localStream),this.callLocalStream=qt.localStream):(Ft.log("No Stream to add"),this.belongsToRoom()||at.wL.type!=="safari"||typeof this.pc.addTransceiver!="function"||(Ft.debug("add transceivers"),this.pc.addTransceiver("audio",{direction:"recvonly"}),this.pc.addTransceiver("video",{direction:"recvonly"})))),this.started=!0,this.callee===!1&&(Ft.log("Before doCall()"),this.doCall())),Ft.log("End of maybeStart")},this.createDataChannel=function(){if(Ft.info("createDataChannel"),nt.Xh==="Edge"&&nt.PR<79&&apiRTC.browserDetails.type!=="chrome")Ft.warn("Cannot create DataChannel as it is not supported on Edge");else if(this.sendDataChannel===null)try{this.sendDataChannel=this.pc.createDataChannel("apiRTCDataChannel",{}),this.sendDataChannel.binaryType="arraybuffer",Ft.log("Created data channel"),Ft.log("Subscribing to dc events"),this.sendDataChannel.onopen=this.callback(this,"onSendDataChannelOpen"),this.sendDataChannel.onclose=this.callback(this,"onSendDataChannelClose"),this.sendDataChannel.onmessage=this.callback(this,"onSendDataChannelMessage"),this.sendDataChannel.onerror=this.callback(this,"onSendDataChannelError")}catch(kt){Ft.log("createDataChannel() failed with exception: "+kt.message)}else Ft.log("Datachannel already exist")},this.createPeerConnection=function(){Ft.info("createPeerConnection");try{Ft.log("createPeerConnection with pc_config:",JSON.stringify(this.pc_config)),Ft.log("and pc_constraints:",JSON.stringify(this.pc_constraints)),at.wL.type==="chrome"&&at.wL.version>=72&&at.wL.version<78?(Ft.debug("Chrome 72=+ and 78-, force sdpSemantics plan-b"),this.pc_config.sdpSemantics="plan-b"):apiRTC.osName==="iOS"&&typeof cordova<"u"&&cordova.plugins!==void 0&&cordova.plugins.iosrtc!==void 0?(Ft.debug("Cordova, force sdpSemantics plan-b"),this.pc_config.sdpSemantics="plan-b"):Ft.debug("sdpSemantics unified-plan is being used"),this.pc=new apiCC.myWebRTC_Adapter.RTCPeerConnection(this.pc_config,this.pc_constraints),this.dataCall&&this.createDataChannel(),this.pc.onicecandidate=this.callback(this,"onIceCandidate")}catch(kt){return Ft.log("Failed to create PeerConnection, exception: "+kt.message),void Ft.error("Cannot create RTCPeerConnection object; WebRTC is not supported by this browser.")}(nt.Xh==="Firefox"||nt.Xh==="Mobile Firefox")&&nt.PR>=53||nt.Xh==="Edge"||at.wL.type==="chrome"&&at.wL.version>=64?(this.pc.ontrack=this.callback(this,"onRemoteTrackAdded"),this.pc.onaddstream=this.callback(this,"onRemoteStreamAdded")):nt.Xh==="Safari"&&nt.PR>=12||nt.Xh==="Mobile Safari"&&nt.PR>=12||typeof apiRTC_React<"u"?this.pc.ontrack=this.callback(this,"onRemoteTrackAdded"):this.pc.onaddstream=this.callback(this,"onRemoteStreamAdded"),this.pc.onremovestream=this.callback(this,"onRemoteStreamRemoved"),this.pc.onnegotiationneeded=this.callback(this,"onNegotiationNeeded"),this.pc.onsignalingstatechange=this.callback(this,"onSignalingStateChange"),this.pc.oniceconnectionstatechange=this.callback(this,"onIceConnectionStateChange"),this.pc.ondatachannel=this.callback(this,"onDataChannel"),this.pc.onicegatheringstatechange=this.callback(this,"onIceGatheringStateChange"),this.pc.onconnectionstatechange=this.callback(this,"onConnectionStateChange"),qt.qosEnable&&(this.statisticId=setInterval(this.callback(this,"getStatistics"),this.getStatsInterval)),qt.csmEnable&&(this.csmLastResults={},this.csmIntervalId=setInterval(this.callback(this,"csmHandler"),this.csmIntervalMs))},this.onIceGatheringStateChange=function(kt){Ft.log("onIceGatheringStateChange"),this.pc!==null&&(Ft.info("onIceGatheringStateChange, Ice Gathering State is now : "+this.pc.iceGatheringState),this.pc.iceGatheringState==="complete"&&this.candidateNb===0&&Ft.warn("Warning, no candidate where retrieved for this call on client"))},this.onConnectionStateChange=function(kt){Ft.log("onConnectionStateChange event :",kt)},this.onDataChannel=function(kt){Ft.info("onDataChannel event"),this.receiveDataChannel=kt.channel,this.receiveDataChannel.binaryType="arraybuffer",this.sendDataChannel===null&&(Ft.log("Setting this.sendDataChannel with receivedDataChannel"),this.sendDataChannel=kt.channel,this.sendDataChannel.onopen=this.callback(this,"onSendDataChannelOpen"),this.sendDataChannel.onclose=this.callback(this,"onSendDataChannelClose"),this.sendDataChannel.onmessage=this.callback(this,"onSendDataChannelMessage"),this.sendDataChannel.onerror=this.callback(this,"onSendDataChannelError")),Ft.log("got dataChannel",kt.channel.label),Ft.log("Subscribing to dc events"),this.receiveDataChannel.onopen=this.callback(this,"onReceiveDataChannelOpen"),this.receiveDataChannel.onclose=this.callback(this,"onReceiveDataChannelClose"),this.receiveDataChannel.onmessage=this.callback(this,"onReceiveDataChannelMessage"),this.receiveDataChannel.onerror=this.callback(this,"onReceiveDataChannelError")},this.onSendDataChannelOpen=function(kt){Ft.info("onSendDataChannelOpen"),this.callType==="data"&&this.calleeId==="dataChannelConnector"&&(this.pushDataStatus&&this.pushDataStatus.type==="pipeline"?(this.pushDataStatus.state="ready",setTimeout(function(){qt.startNextPushData()})):this.transferStarted!==!0&&this.startTransfer()),un.createEvent({eventType:"sendDataChannelOpen",callId:this.callId,remoteId:this.remoteId,details:kt})},this.onSendDataChannelClose=function(kt){Ft.info("onSendDataChannelClose"),this.sendDataChannel=null,un!==null&&un.createEvent({eventType:"sendDataChannelClose",callId:this.callId,remoteId:this.remoteId,details:kt})},this.processOnDataChannelMessage=function(kt){var st,Tt,Rt=null,Lt=null,Et="",jt=0;if(Ft.info("processOnDataChannelMessage"),Rt=JSON.parse(kt.data),Ft.log("data.uuid :"+Rt.uuid),Ft.log("data.messageSize :"+Rt.messageSize),Ft.log("data.originalDataType :"+Rt.originalDataType),st=Rt.uuid,Rt.originalDataType==="ArrayBuffer"&&(Ft.log("ArrayBuffer conversion"),Rt.message=at.cw.decode(Rt.message)),Ft.log("data :"+Rt),Ft.log("data.uuid :"+st),Ft.log("receiveChunkNb[uuid] :"+this.receiveChunkNb[st]),this.receiveChunkNb[st]===void 0)Ft.log("receiving first packet for uuid :"+st),Ft.log("evt.data.message :"+kt.data),this.firstDataPacket[st]=Rt,this.receiveChunkNb[st]=1,this.receivedSize[st]=0,this.startingDate=new Date,this.transferDuration=0,un.createEvent({eventType:"onFileReceiving",remoteId:this.remoteId,callId:this.callId,name:Rt.name,uuid:st}),un.createEvent({eventType:"onFileProgress",sendChunkNb:this.receiveChunkNb[st],fileSize:this.firstDataPacket[st].size,remainingSize:this.firstDataPacket[st].size,callId:this.callId,uuid:st,remoteId:this.remoteId,lastPacket:!1,startingDate:this.startingDate,transferDuration:this.transferDuration,percentage:0,transferEnded:!1});else if(Ft.log("new packet for uuid :"+st),this.receiveChunkNb[st]+=1,Ft.log("data.messageSize :"+Rt.messageSize),Ft.log("data.message.length :"+Rt.message.length),jt=Rt.messageSize||Rt.message.length,Ft.log("receivedSize :"+jt),this.receiveArrayToStoreChunks[st]||(this.receiveArrayToStoreChunks[st]=[]),this.receiveArrayToStoreChunks[st].push(Rt.message),this.receivedSize[st]+=jt,this.transferDuration=new Date-this.startingDate,this.receivedSize[st]===this.firstDataPacket[st].size){if(Ft.log("End of data transfert"),Ft.log("this.firstDataPacket.type :"+this.firstDataPacket[st].type),this.firstDataPacket[st].type==="image/png-dataUrl"){for(Ft.log("Photo received from a takeSnapshot"),Tt=0;Tt0&&arguments[0]!==void 0?arguments[0]:{},Tt=st.hasOwnProperty("delay")?st.delay:100;this.transferStarted!==!0&&(Ft.info("startTransfer",Tt),this.transferStarted=!0,setTimeout(function(){kt.dcfs||(kt.dcfs=new Ot(kt),kt.data.offset>0?kt.dcfs.transfer(kt.fileContent.buffer,kt.data.offset,kt.sendDataChannel,{delay:Tt}):kt.dcfs.transfer(kt.fileContent.buffer,0,kt.sendDataChannel,{delay:Tt}))},Tt))},this.statisticsAnswer=function(kt){var st=kt.result(),Tt=null;this.qm||(this.qm=new St(this.getStatsInterval/1e3,this.callback(this,"onQosChange"),this.callback(this,"onQosAudioChange"),this.callback(this,"onQosVideoChange"),this.callId,qt.apiKey,qt.clientId,qt.socket)),st&&(this.qm.insertStats(st,this.sendedSdpOfferMessage,this.receivedSdpOfferMessage,qt.remoteVideo),Tt=this.qm.getAllStats(),qt.qosEnable&&un.createEvent({eventType:"onQosStatsUpdate",callId:this.callId,remoteId:this.remoteId,stats:Tt}),this.videoReceivedWidth=Tt.VideoRecv.FrameWidth,this.videoReceivedHeight=Tt.VideoRecv.FrameHeight,this.videoSendWidth=Tt.VideoSend.FrameWidth,this.videoSendHeight=Tt.VideoSend.FrameHeight,this.videoReceivedDelay=Tt.VideoRecv.delay,this.audioReceivedDelay=Tt.AudioRecv.delay,this.audioSendDelay=Tt.AudioSend.rtt,this.videoSendDelay=Tt.VideoSend.rtt,this.videoSendMoyDelay=Tt.VideoSend.moyRtt,this.videoSendPacketLossRatio=Tt.VideoSend.packetLostRatio,this.audioSendPacketLossRatio=Tt.AudioSend.packetLostRatio,this.videoSendEncodeUsagePercent=Tt.VideoSend.googEncodeUsagePercent,this.videoSendCpuLimitedResolution=Tt.VideoSend.googCpuLimitedResolution,this.videoSendBandwidthLimitedResolution=Tt.VideoSend.googBandwidthLimitedResolution,this.videoSendCpuLimitedResolution!==void 0&&JSON.parse(this.videoSendCpuLimitedResolution)===!0&&un.createEvent({eventType:"cpuLimited",callId:this.callId,encodeUsagePercent:this.videoSendEncodeUsagePercent}),this.videoSendBandwidthLimitedResolution!==void 0&&JSON.parse(this.videoSendBandwidthLimitedResolution)===!0&&un.createEvent({eventType:"bandwidthLimited",callId:this.callId}))},this.csmGetStatsHandler=function(kt){var st,Tt=this,Rt=null,Lt=null,Et={};if(this.csm||(this.csm=new Dt(this.csmIntervalMs/1e3,at.wL.type,at.wL.version,"standard"),this.csm.browserInfo={browserAbout:nt.Xh+" "+nt.dc,browserType:at.wL.type,browserVersion:at.wL.version},(0,at.Ym)(this.mcuRemoteStream,"attributes","object")&&(this.mcuRemoteStream.replay===!0?(0,at.Ym)(this.mcuRemoteStream.attributes.callerId,"string")&&(0,at.Ym)(this.mcuRemoteStream.attributes.callId,"string")&&(0,at.Ym)(this.mcuRemoteStream.attributes.recId,"string")&&(this.csm.callFeed={clientId:this.mcuRemoteStream.attributes.callerId,callId:this.mcuRemoteStream.attributes.callId,modifier:"replay",recId:this.mcuRemoteStream.attributes.recId}):(0,at.Ym)(this.mcuRemoteStream.attributes.callerId,"string")&&(0,at.Ym)(this.mcuRemoteStream.attributes.callId,"string")&&(this.csm.callFeed={clientId:this.mcuRemoteStream.attributes.callerId,callId:this.mcuRemoteStream.attributes.callId}))),Et.post=function(Pt){Tt.mos||(Tt.mos=new Gt),Pt.quality={},Pt.audioReceived?Tt.isRemoteAudioMuted?Pt.quality.mosS="Muted":Pt.audioReceived.bitsReceivedPerSecond!==0?(Pt.audioReceived.delay=parseInt(Tt.audioReceivedDelay,10),Pt.quality.mosS=Tt.mos.NarrowBandSpeechQuality(Pt.audioReceived.delay,Pt.audioReceived.packetLossRatio)):Pt.quality.mosS="NoStream":Pt.quality.mosS="NoStream",Pt.videoReceived?Tt.isRemoteVideoMuted?Pt.quality.mosV="Muted":Pt.videoReceived.bitsReceivedPerSecond!==0?(Pt.videoReceived.width=Tt.videoReceivedWidth,Pt.videoReceived.height=Tt.videoReceivedHeight,Pt.videoReceived.delay=parseInt(Tt.videoReceivedDelay,10),Pt.quality.mosV=Tt.mos.videoQuality(Pt.videoReceived.width,Pt.videoReceived.height,Pt.videoReceived.packetLossRatio,Math.floor(Pt.videoReceived.bitsReceivedPerSecond/1e3),Pt.videoReceived.framesDecodedPerSecond)):Pt.quality.mosV="NoStream":Pt.quality.mosV="NoStream",Pt.audioReceived&&Pt.videoReceived&&(Pt.quality.mosAV=Tt.mos.audiovisualQuality(Pt.quality.mosS,Pt.quality.mosV,Pt.audioReceived.delay,Pt.videoReceived.delay)),Pt.audioSent?Tt.isLocalAudioMuted?Pt.quality.mosSS="Muted":Pt.audioSent.bitsSentPerSecond!==0?(Pt.audioSent.delay=parseInt(Tt.audioSendDelay,10),Pt.audioSent.packetLossRatio=Tt.audioSendPacketLossRatio,Pt.quality.mosSS=Tt.mos.NarrowBandSpeechQuality(Pt.audioSent.delay,Pt.audioSent.packetLossRatio)):Pt.quality.mosSS="NoStream":Pt.quality.mosSS="NoStream",Pt.videoSent?Tt.isLocalVideoMuted?Pt.quality.mosSV="Muted":Pt.videoSent.bitsSentPerSecond!==0?(Pt.videoSent.width=Tt.videoSendWidth,Pt.videoSent.height=Tt.videoSendHeight,Pt.videoSent.delay=parseInt(Tt.videoSendDelay,10),Pt.videoSent.moyDelay=parseInt(Tt.videoSendMoyDelay,10),Pt.videoSent.packetLossRatio=Tt.videoSendPacketLossRatio,Pt.videoSent.encodeUsagePercent=Tt.videoSendEncodeUsagePercent,Pt.videoSent.cpuLimitedResolution=Tt.videoSendCpuLimitedResolution,Pt.videoSent.bandwidthLimitedResolution=Tt.videoSendBandwidthLimitedResolution,Pt.quality.mosSV=Tt.mos.videoQuality(Pt.videoSent.width,Pt.videoSent.height,Pt.videoSent.packetLossRatio,Math.floor(Pt.videoSent.bitsSentPerSecond/1e3),Pt.videoSent.framesEncodedPerSecond)):Pt.quality.mosSV="NoStream":Pt.quality.mosSV="NoStream",Pt.audioSent&&Pt.videoSent&&(Pt.quality.mosSAV=Tt.mos.audiovisualQuality(Pt.quality.mosSS,Pt.quality.mosSV,Pt.audioSent.delay,Pt.videoSent.delay))},st=this.csm.addCallStats(kt,Et),Object.keys(st).length!==0){!st.quality||st.quality.mosS==="Muted"&&st.quality.mosV==="Muted"&&st.quality.mosSS==="Muted"&&st.quality.mosSV==="Muted"||qt.qualityScoreEnable&&un.createEvent({eventType:"onCallScoreUpdate",callId:this.callId,score:st.quality}),this.csmLastResults=st,this.callLocalStream&&typeof this.callLocalStream.getVideoTracks=="function"&&(Rt=this.callLocalStream.getVideoTracks())&&Rt[0]&&typeof Rt[0].getSettings=="function"&&(Lt=Rt[0].getSettings());var jt={save:!0,clientId:qt.clientId,callId:this.callId,instanceId:this.instanceId,browserInfo:this.csm.browserInfo,stats:st};this.sessionMCU&&(jt.roomId=this.sessionMCU.roomName,jt.pubSub=qt.MCUClient.pubConnector),this.csm.callFeed&&(jt.callFeed=this.csm.callFeed),Lt&&(jt.videoSettings=Lt),this.data.mesh&&(jt.mesh=this.data.mesh),this.myWebRTC_Stack.sendInfo("callStats",jt),qt.csmEnable&&(this.data&&this.data.mesh&&(this.data.mesh.calleeCompositeUserId?this.data.mesh.calleeCompositeUserId===qt.compositeClientId:this.data.mesh.calleeId===qt.clientId)?un.createEvent({eventType:"onCallStatsUpdate",callId:this.data.mesh.calleeCallId,userId:this.data.mesh.callerId,stats:st}):un.createEvent({eventType:"onCallStatsUpdate",callId:this.callId,stats:st}))}},this.onQosChange=function(kt,st){un.createEvent({eventType:"onQosChange",callId:this.callId,remoteId:this.remoteId,qosIn:kt,qosOut:st})},this.onQosAudioChange=function(kt,st){un.createEvent({eventType:"onQosAudioChange",callId:this.callId,remoteId:this.remoteId,qosAudioIn:kt,qosAudioOut:st})},this.onQosVideoChange=function(kt,st){un.createEvent({eventType:"onQosVideoChange",callId:this.callId,remoteId:this.remoteId,qosVideoIn:kt,qosVideoOut:st})},this.getStatistics=function(){this.pc&&((nt.Xh==="Chrome"||nt.Xh==="Mobile Chrome")&&nt.PR>112?Ft.debug("getStats with callback in now deprecated on Chrome, getStatistics() / QoSMonitor can no more be used"):!this.pc.getStats||nt.Xh!=="Chrome"&&nt.Xh!=="Mobile Chrome"||this.pc.getStats(this.callback(this,"statisticsAnswer")))},this.csmHandler=function(){this.statisticId||this.getStatistics(),this.pc&&typeof this.pc.getStats=="function"&&this.pc.getStats(null).then(this.callback(this,"csmGetStatsHandler")).catch(function(kt){Ft.warn("failed to get stats",kt)})},this.doCall=function(){var kt=null;Ft.log("Sending offer to peer"),this.audioOnly?(Ft.log("audioOnly call :",this.mediaConstraintsAudioOnly),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createOffer"),this.pc.createOffer(this.callback(this,"setLocalAndSendMessageonOffer"),this.callback(this,"onCreateOfferFailure"),this.mediaConstraintsAudioOnly)):(Ft.log("createOffer - Promise version"),this.pc.createOffer(this.mediaConstraintsAudioOnly).then(this.callback(this,"setLocalAndSendMessageonOffer")).catch(this.callback(this,"onCreateOfferFailure")))):this.screenSharing===!0?(Ft.log("screenSharing call : one way media :",kt),kt={mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}},nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createOffer"),this.pc.createOffer(this.callback(this,"setLocalAndSendMessageonOffer"),this.callback(this,"onCreateOfferFailure"),kt)):(Ft.log("createOffer - Promise version"),this.pc.createOffer(kt).then(this.callback(this,"setLocalAndSendMessageonOffer")).catch(this.callback(this,"onCreateOfferFailure")))):this.dataCall===!0?(Ft.log("call is data only :",kt),kt=(nt.Xh==="Firefox"||nt.Xh==="Mobile Firefox")&&nt.PR>43?{offerToReceiveAudio:!1,offerToReceiveVideo:!1}:{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}},nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createOffer"),this.pc.createOffer(this.callback(this,"setLocalAndSendMessageonOffer"),this.callback(this,"onCreateOfferFailure"),kt)):(Ft.log("createOffer - Promise version"),this.pc.createOffer(kt).then(this.callback(this,"setLocalAndSendMessageonOffer")).catch(this.callback(this,"onCreateOfferFailure")))):(Ft.log("call is audio & video :",this.mediaConstraints),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createOffer"),this.pc.createOffer(this.callback(this,"setLocalAndSendMessageonOffer"),this.callback(this,"onCreateOfferFailure"),this.mediaConstraints)):(Ft.log("createOffer - Promise version"),this.pc.createOffer(this.mediaConstraints).then(this.callback(this,"setLocalAndSendMessageonOffer")).catch(this.callback(this,"onCreateOfferFailure"))))},this.doAnswer=function(){Ft.info("doAnswer");var kt=null;this.audioOnly?(Ft.log("audioOnly call"),kt=this.mediaConstraintsAudioOnly):kt=this.mediaConstraints,nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createAnswer"),this.pc.createAnswer(this.callback(this,"setLocalAndSendMessage"),this.callback(this,"onCreateAnswerFailure"),kt)):(Ft.log("createAnswer - Promise version"),this.pc.createAnswer(kt).then(this.callback(this,"setLocalAndSendMessage")).catch(this.callback(this,"onCreateAnswerFailure")))},this.doUpdateAnswer=function(){Ft.info("doUpdateAnswer");var kt=null;this.audioOnly?(Ft.log("audioOnly call"),kt=this.mediaConstraintsAudioOnly):kt=this.mediaConstraints,nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createAnswer"),this.pc.createAnswer(this.callback(this,"setLocalAndSendMessageUpdate"),this.callback(this,"onCreateAnswerFailure"),kt)):(Ft.log("createAnswer - Promise version"),this.pc.createAnswer(kt).then(this.callback(this,"setLocalAndSendMessageUpdate")).catch(this.callback(this,"onCreateAnswerFailure")))},this.updateMediaWithRetryManagement=function(kt){Ft.debug("updateMediaWithRetryManagement");var st=this.updateMedia(kt);Ft.debug("updateMediaResult :",st),st.reason!=="Sig_state_not_stable"&&st.reason!=="Update_already_ongoing"||(Ft.debug("updateMedia will be retried later for reason :",st.reason),this.retryUpdateMedia=!0)},this.updateMedia=function(kt){return Ft.debug("updateMedia, callId :",this.callId),Ft.log("iceRestartActivated :",kt),this.pc===null?(Ft.log("updateMedia, pc no more exist"),{status:"Not_Done",reason:"PC_Not_Exit"}):this.updateMediaOngoing===!0?(Ft.log("updateMedia, already ongoing"),{status:"Not_Done",reason:"Update_already_ongoing"}):(this.updateMediaOngoing=!0,this.pc.signalingState!=="stable"?{status:"Not_Done",reason:"Sig_state_not_stable"}:(Ft.log("Sending Update offer to peer."),this.audioOnly?(Ft.log("audioOnly call :",this.mediaConstraintsAudioOnly),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createOffer"),this.mediaConstraintsAudioOnly.mandatory!==void 0?this.mediaConstraintsAudioOnly.mandatory.IceRestart=!0:this.mediaConstraintsAudioOnly.iceRestart=!0,Ft.log("this.mediaConstraints :",this.mediaConstraintsAudioOnly),this.pc.createOffer(this.callback(this,"setLocalAndSendMessageonOfferUpdate"),this.callback(this,"onCreateOfferFailure"),this.mediaConstraintsAudioOnly)):(Ft.log("createOffer - Promise version"),kt===!0&&(this.mediaConstraintsAudioOnly.iceRestart=!0),Ft.log("this.mediaConstraints :",this.mediaConstraintsAudioOnly),this.pc.createOffer(this.mediaConstraintsAudioOnly).then(this.callback(this,"setLocalAndSendMessageonOfferUpdate")).catch(this.callback(this,"onCreateOfferFailure")))):nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("createOffer"),kt===!0&&(this.mediaConstraints.mandatory!==void 0?this.mediaConstraints.mandatory.IceRestart=!0:this.mediaConstraints.iceRestart=!0),Ft.log("this.mediaConstraints :",this.mediaConstraints),this.pc.createOffer(this.callback(this,"setLocalAndSendMessageonOfferUpdate"),this.callback(this,"onCreateOfferFailure"),this.mediaConstraints)):(Ft.log("createOffer - Promise version"),kt===!0&&(this.mediaConstraints.iceRestart=!0),Ft.log("this.mediaConstraints :",this.mediaConstraints),this.pc.createOffer(this.mediaConstraints).then(this.callback(this,"setLocalAndSendMessageonOfferUpdate")).catch(this.callback(this,"onCreateOfferFailure"))),{status:"OnGoing",reason:"OK"}))},this.manipulateSDP=function(kt,st){var Tt=null,Rt=!1;return Ft.log("manipulateSDP with type :",st),qt.receiveMediaDeactivated===!0&&(Ft.log("setting receiveMediaDeactivated in SDP :"+qt.receiveMediaDeactivated),kt.sdp=qt.mySDPManager.setSendOnly(kt.sdp)),qt.RTPMedia===!0&&(kt.sdp=kt.sdp.replace(/RTP\/SAVPF/g,"RTP/SF")),qt.audioBandwidth!==null&&(Ft.log("setting audioBandwidth in SDP :"+qt.audioBandwidth),kt.sdp=qt.mySDPManager.setAudioBandwidth(kt.sdp,qt.audioBandwidth)),qt.videoBandwidth!==null&&(Ft.log("setting videoBandwidth in SDP :"+qt.videoBandwidth),kt.sdp=qt.mySDPManager.setVideoBandwidth(kt.sdp,qt.videoBandwidth)),qt.dataBandwidth!==null&&(Ft.log("setting dataBandwidth in SDP :"+qt.dataBandwidth),kt.sdp=qt.mySDPManager.setDataBandwidth(kt.sdp,qt.dataBandwidth)),qt.preferOpusCodec===!0&&(Ft.log("setting preferOpusCodec"),kt.sdp=qt.mySDPManager.preferOpus(kt.sdp)),qt.preferVP9Codec!==!0&&this.preferVP9Codec!==!0||(Ft.log("Call prefer VP9 Codec"),kt.sdp=qt.mySDPManager.maybePreferCodec(kt.sdp,"video","VP9")),qt.preferH264Codec!==!0&&this.preferH264Codec!==!0||(Ft.log("Call prefer H264 Codec"),kt.sdp=qt.mySDPManager.maybePreferCodec(kt.sdp,"video","H264")),this.preferVP8Codec===!0&&(Ft.log("Call prefer VP8 Codec"),kt.sdp=qt.mySDPManager.maybePreferCodec(kt.sdp,"video","VP8")),qt.setStereo===!0&&(Ft.log("Set Stereo"),kt.sdp=qt.mySDPManager.setCodecParam(kt.sdp,"opus/48000","stereo","1")),kt=qt.mySDPManager.updateSDPcodecs(kt,kt.type,"audio",qt.allowedAudioCodecs),kt=qt.mySDPManager.updateSDPcodecs(kt,kt.type,"video",qt.allowedVideoCodecs),st==="OFFER"?this.settingUpType==="publish"&&this.mediaTypeForIncomingCall==="NONE"?(Tt=qt.mySDPManager.createGuideline(kt.sdp),this.mediaTypeForOutgoingCall==="VIDEO"?((0,at.ki)(Tt,"audio","object")&&Tt.audio.direction!=="sendonly"&&(Tt.audio.direction="sendonly",Rt=!0),(0,at.ki)(Tt,"video","object")&&Tt.video.direction!=="sendonly"&&(Tt.video.direction="sendonly",Rt=!0)):this.mediaTypeForOutgoingCall==="AUDIO"?((0,at.ki)(Tt,"audio","object")&&Tt.audio.direction!=="sendonly"&&(Tt.audio.direction="sendonly",Rt=!0),(0,at.ki)(Tt,"video","object")&&Tt.video.direction!=="inactive"&&(Tt.video.direction="inactive",Rt=!0)):this.mediaTypeForOutgoingCall==="VIDEOONLY"&&((0,at.ki)(Tt,"audio","object")&&Tt.audio.direction!=="inactive"&&(Tt.audio.direction="inactive",Rt=!0),(0,at.ki)(Tt,"video","object")&&Tt.video.direction!=="sendonly"&&(Tt.video.direction="sendonly",Rt=!0)),Rt===!0&&(kt.sdp=Tt.generate())):this.mediaTypeForOutgoingCall==="VIDEO"?Ft.log("mediaTypeForOutgoingCall is VIDEO"):this.mediaTypeForOutgoingCall==="AUDIO"||this.audioOnly===!0?(Ft.log("mediaTypeForOutgoingCall is AUDIO"),kt.sdp=qt.mySDPManager.setRecvOnlyForVideo(kt.sdp)):this.mediaTypeForOutgoingCall==="VIDEOONLY"?(Ft.log("mediaTypeForOutgoingCall is VIDEOONLY"),kt.sdp=qt.mySDPManager.setRecvOnlyForAudio(kt.sdp)):this.mediaTypeForOutgoingCall==="NONE"&&(Ft.log("mediaTypeForOutgoingCall is NONE"),kt.sdp=qt.mySDPManager.setRecvOnly(kt.sdp)):st==="ANSWER"&&(this.mediaTypeForIncomingCall==="VIDEO"?Ft.log("mediaTypeForIncomingCall is VIDEO"):this.mediaTypeForIncomingCall==="AUDIO"||this.audioOnly===!0?(Ft.log("mediaTypeForIncomingCall is AUDIO"),kt.sdp=qt.mySDPManager.setRecvOnlyForVideo(kt.sdp)):this.mediaTypeForIncomingCall==="VIDEOONLY"?(Ft.log("mediaTypeForIncomingCall is VIDEOONLY"),kt.sdp=qt.mySDPManager.setRecvOnlyForAudio(kt.sdp)):this.mediaTypeForIncomingCall==="NONE"&&(Ft.log("mediaTypeForIncomingCall is NONE"),kt.sdp=qt.mySDPManager.setRecvOnly(kt.sdp))),this.simulcast==="SDP"&&st==="OFFER"&&this.settingUpType==="publish"&&((Tt=qt.mySDPManager.createGuideline(kt.sdp)).mungeForSimulcasting(),kt.sdp=Tt.generate()),kt},this.setLocalAndSendMessageonOffer=function(kt){Ft.info("setLocalAndSendMessageonOffer"),Ft.log("sessionDescription = ",kt),Ft.log("sessionDescription.sdp = ",kt.sdp);var st=null;kt.sdp=this.manipulateSDP(kt,"OFFER").sdp,Ft.log("manipulated sessionDescription.sdp = ",kt.sdp),this.stripAudioSDPActivated===!0&&(kt.sdp=qt.mySDPManager.stripAudioMediaDescriptionFromSDP(kt.sdp)),this.stripVideoSDPActivated===!0&&(kt.sdp=qt.mySDPManager.stripVideoMediaDescriptionFromSDP(kt.sdp)),this.setLocalCallProfile(qt.evalCallProfileWithSdp(kt.sdp,"local","send")),this.sendedSdpOfferMessage=kt,this.dataCall===!0&&(Ft.log("setLocalAndSendMessageonOffer : data Call"),this.callType="data"),this.callCancelled===!1?qt.NtoNConf===!1?(Ft.log("Conf N to 1"),this.screenSharing===!0&&(st=qt.mySDPManager.getAudioMediaDescriptionPart(this.sendedSdpOfferMessage.sdp),this.callType=st!=null?"screenSharingWithAudio":"screenSharing"),this.data&&this.data.MCUType==="MCU-Caller"&&(this.data.mediaStreamId=this.callLocalStream.id),this.trickleIce===!0&&(this.myWebRTC_Stack.sendInvite(this.callId,this.callerId,qt.nickname,this.dest_roomId,this.dest_roomId,this.callType,{offer:kt,data:this.data,stream:this.mcuRemoteStream,volatile:!!this.restarted}),this.inviteSended=!0),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("setLocalAndSendMessageonOffer : before setLocalDescription"),this.pc.setLocalDescription(this.sendedSdpOfferMessage,this.callback(this,"onSetLocalDescriptionSuccess"),this.callback(this,"onSetLocalDescriptionFailure"))):(Ft.log("setLocalAndSendMessageonOffer : before setLocalDescription - Promise version"),this.pc.setLocalDescription(this.sendedSdpOfferMessage).then(this.callback(this,"onSetLocalDescriptionSuccess")).catch(this.callback(this,"onSetLocalDescriptionFailure")))):(Ft.log("Conf N to N"),this.myWebRTC_Stack.sendInviteBroadcast(this.callId,this.callerId,qt.nickname,this.dest_roomId,this.dest_roomId,kt),this.inviteSended=!0):(Ft.warn("Invite is not sent has call has been canceled"),qt.removeCallFromTableWithCallIdandRemoteId(this.callId,this.calleeId,"Call_Cancelled"),qt.callsTable.length===0&&Ft.log("No more established calls for client"))},this.setLocalAndSendMessageonOfferUpdate=function(kt){var st,Tt=null;Ft.info("setLocalAndSendMessageonOfferUpdate, sessionDescription :"+kt),this.sendedSdpOfferMessage=kt,Ft.log("sessionDescription.sdp = ",kt.sdp),((0,at.Ym)(this.audioSdpDirection,"string")||(0,at.Ym)(this.videoSdpDirection,"string"))&&(Tt=qt.mySDPManager.createGuideline(kt.sdp),(0,at.ki)(Tt,"audio","object")&&(0,at.Ym)(this.audioSdpDirection,"string")&&(Tt.audio.direction=this.audioSdpDirection),(0,at.ki)(Tt,"video","object")&&(0,at.Ym)(this.videoSdpDirection,"string")&&(Tt.video.direction=this.videoSdpDirection),kt.sdp=Tt.generate()),this.setLocalCallProfile(qt.evalCallProfileWithSdp(kt.sdp,"local","send"),!0),st=this.callee?this.callerId:this.calleeId,this.trickleIce===!0?(this.myWebRTC_Stack.sendUpdate(this.callId,this.callerId,this.calleeId,this.dest_roomId,st,kt,this.callType,this.data),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("setLocalAndSendMessageonOfferUpdate : before setLocalDescription"),this.pc.setLocalDescription(kt,this.callback(this,"onSetLocalDescriptionSuccess"),this.callback(this,"onSetLocalDescriptionFailure"))):(Ft.log("setLocalAndSendMessageonOfferUpdate : before setLocalDescription - Promise version"),this.pc.setLocalDescription(kt).then(this.callback(this,"onSetLocalDescriptionSuccess")).catch(this.callback(this,"onSetLocalDescriptionFailure")))):(Ft.log("Updating PC offer and answer after switch Stream"),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("setLocalAndSendMessageonOfferUpdate : before setLocalDescription"),this.pc.setLocalDescription(kt,this.callback(this,"onSetLocalDescriptionSuccess"),this.callback(this,"onSetLocalDescriptionFailure"))):(Ft.log("setLocalAndSendMessageonOfferUpdate : before setLocalDescription - Promise version"),this.pc.setLocalDescription(kt).then(this.callback(this,"onSetLocalDescriptionSuccess")).catch(this.callback(this,"onSetLocalDescriptionFailure"))),qt.preferSendingH264Codec&&(Ft.log("Modification of SDP to set H264 as prefered sending codec"),this.pc.remoteDescription.sdp=qt.mySDPManager.maybePreferCodec(this.pc.remoteDescription.sdp,"video","H264")),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("setLocalAndSendMessageonOfferUpdate : before setRemoteDescription"),this.pc.setRemoteDescription(this.pc.remoteDescription,this.callback(this,"onSetRemoteDescriptionSuccess"),this.callback(this,"onSetRemoteDescriptionFailure"))):(Ft.log("setLocalAndSendMessageonOfferUpdate : before setRemoteDescription - Promise version"),this.pc.setRemoteDescription(this.pc.remoteDescription).then(this.callback(this,"onSetRemoteDescriptionSuccess")).catch(this.callback(this,"onSetRemoteDescriptionFailure"))))},this.onCreateOfferFailure=function(kt){Ft.info("onCreateOfferFailure"+kt),kt=null},this.onCreateAnswerFailure=function(kt){Ft.info("onCreateAnswerFailure"+kt),kt=null},this.setLocalAndSendMessage=function(kt){var st;Ft.info("setLocalAndSendMessage"),Ft.log("sessionDescription.sdp = ",kt.sdp),this.pc!==null?(kt=this.manipulateSDP(kt,"ANSWER"),st=qt.mySDPManager.createGuideline(kt.sdp),this.setLocalCallProfile(qt.evalCallProfileWithSdpGuideline(st,kt.sdp,"local","send")),this.setRemoteCallProfile(qt.evalCallProfileWithSdpGuideline(st,kt.sdp,"local","receive")),Ft.log("manipulated sessionDescription.sdp = ",kt.sdp),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("setLocalAndSendMessage : before setLocalDescription"),this.pc.setLocalDescription(kt,this.callback(this,"onSetLocalDescriptionSuccess"),this.callback(this,"onSetLocalDescriptionFailure"))):(Ft.log("setLocalAndSendMessage : before setLocalDescription - Promise version"),this.pc.setLocalDescription(kt).then(this.callback(this,"onSetLocalDescriptionSuccess")).catch(this.callback(this,"onSetLocalDescriptionFailure"))),this.sendedSdpOfferMessage=kt,this.trickleIce===!0&&this.myWebRTC_Stack.send200OK(this.callId,this.callerId,this.calleeId,qt.nickname,this.dest_roomId,kt,this.data)):Ft.log("setLocalAndSendMessage, pc no more exist")},this.setLocalAndSendMessageUpdate=function(kt){var st;if(this.pc!==null){at.wL.type==="safari"&&(kt.sdp=this.manipulateSDP(kt,"OFFER").sdp),st=qt.mySDPManager.createGuideline(kt.sdp),this.mediaType==="AUDIOONLY"?st.hasOwnProperty("video")&&st.video.direction!=="inactive"&&(Ft.debug("Only audio was requested at call setup: deactivating video"),st.video.direction="inactive",kt.sdp=st.generate()):this.mediaType==="VIDEOONLY"&&st.hasOwnProperty("audio")&&st.audio.direction!=="inactive"&&(Ft.debug("Only video was requested at call setup: deactivating audio"),st.audio.direction="inactive",kt.sdp=st.generate()),this.setLocalCallProfile(qt.evalCallProfileWithSdpGuideline(st,kt.sdp,"local","send"),!0),this.setRemoteCallProfile(qt.evalCallProfileWithSdpGuideline(st,kt.sdp,"local","receive"),!0),this.updateOngoingTimeoutId&&(clearTimeout(this.updateOngoingTimeoutId),delete this.updateOngoingTimeoutId),nt.Xh==="Chrome"&&nt.PR<55||nt.Xh==="Firefox"&&nt.PR<50||nt.Xh==="IE"?(Ft.log("setLocalAndSendMessageUpdate : before setLocalDescription"),this.pc.setLocalDescription(kt,this.callback(this,"onSetLocalDescriptionSuccess"),this.callback(this,"onSetLocalDescriptionFailure"))):(Ft.log("setLocalAndSendMessageUpdate : before setLocalDescription - Promise version"),this.pc.setLocalDescription(kt).then(this.callback(this,"onSetLocalDescriptionSuccess")).catch(this.callback(this,"onSetLocalDescriptionFailure")));var Tt;Tt=this.callee?this.callerId:this.calleeId,this.myWebRTC_Stack.send200Update(this.callId,this.callerId,this.calleeId,this.dest_roomId,Tt,kt,this.data),this.asyncCallbacks&&this.asyncCallbacks.type==="updateMediaType"&&(Ft.debug("asyncCallbacks resolve"),this.asyncCallbacks.resolve(),this.asyncCallbacks.timeoutId&&(clearTimeout(this.asyncCallbacks.timeoutId),delete this.asyncCallbacks.timeoutId),delete this.asyncCallbacks)}else Ft.log("setLocalAndSendMessageUpdate, pc no more exist")},this.onIceCandidate=function(kt){try{Ft.debug("onIceCandidate :",JSON.stringify(kt.candidate))}catch(Lt){Ft.error(Lt)}var st,Tt=0,Rt=0;st=this.callee?this.callerId:this.calleeId,this.pc!==null&&(Ft.debug("Ice Connection State is now : "+this.pc.iceConnectionState),Ft.debug("Ice Gathering State is now : "+this.pc.iceGatheringState)),kt.candidate?(this.candidateNb+=1,this.trickleIce===!0?this.mediaRoutingMode===qt.mediaRoutingModeEnum.hostOnly?(Tt=kt.candidate.candidate.search("host"))!==-1?this.myWebRTC_Stack.sendCandidate(this.callId,this.callerId,this.calleeId,this.dest_roomId,st,kt.candidate.sdpMLineIndex,kt.candidate.sdpMid,kt.candidate.candidate,this.data,kt.candidate,{volatile:!!this.restarted}):Ft.log("Media routing mode is hostOnly and not a HOST Candidate : ignoring message"):this.mediaRoutingMode===qt.mediaRoutingModeEnum.stun?(Tt=kt.candidate.candidate.search("host"),Rt=kt.candidate.candidate.search("srflx"),Tt!==-1||Rt!==-1?this.myWebRTC_Stack.sendCandidate(this.callId,this.callerId,this.calleeId,this.dest_roomId,st,kt.candidate.sdpMLineIndex,kt.candidate.sdpMid,kt.candidate.candidate,this.data,kt.candidate,{volatile:!!this.restarted}):Ft.log("Media routing mode is stun and not a HOST or SRFLX Candidate : ignoring message")):this.mediaRoutingMode===qt.mediaRoutingModeEnum.stunOnly?(Tt=kt.candidate.candidate.search("srflx"))!==-1?this.myWebRTC_Stack.sendCandidate(this.callId,this.callerId,this.calleeId,this.dest_roomId,st,kt.candidate.sdpMLineIndex,kt.candidate.sdpMid,kt.candidate.candidate,this.data,kt.candidate,{volatile:!!this.restarted}):Ft.log("Media routing mode is stunOnly and not a SRFLX Candidate : ignoring message"):this.mediaRoutingMode===qt.mediaRoutingModeEnum.turn?(Ft.log("Media routing mode is turn : all candidates are considered"),this.myWebRTC_Stack.sendCandidate(this.callId,this.callerId,this.calleeId,this.dest_roomId,st,kt.candidate.sdpMLineIndex,kt.candidate.sdpMid,kt.candidate.candidate,this.data,kt.candidate,{volatile:!!this.restarted})):this.mediaRoutingMode===qt.mediaRoutingModeEnum.turnOnly&&((Tt=kt.candidate.candidate.search("relay"))!==-1?this.myWebRTC_Stack.sendCandidate(this.callId,this.callerId,this.calleeId,this.dest_roomId,st,kt.candidate.sdpMLineIndex,kt.candidate.sdpMid,kt.candidate.candidate,this.data,kt.candidate,{volatile:!!this.restarted}):Ft.log("Media routing mode is TurnOnly and not a RELAY Candidate : ignoring message")):Ft.log("trickleIce is deactivated : candidates are not sended")):(Ft.info("End of candidates."),this.trickleIce===!1&&(Ft.log("trickleIce === false"),this.callee===!0?(this.send200OKTrickleIceFalseTimeOutId!==0&&(clearTimeout(this.send200OKTrickleIceFalseTimeOutId),this.send200OKTrickleIceFalseTimeOutId=0),this.message200OKSended===!1?this.myWebRTC_Stack.send200OK(this.callId,this.callerId,this.calleeId,qt.nickname,this.dest_roomId,this.pc.localDescription,this.data):Ft.log("200OK already sended")):this.pc!==null&&(this.sendInviteTrickleIceFalseTimeOutId!==0&&(clearTimeout(this.sendInviteTrickleIceFalseTimeOutId),this.sendInviteTrickleIceFalseTimeOutId=0),this.inviteSended===!1?(Ft.log("sendInvite on end of candidate"),this.myWebRTC_Stack.sendInvite(this.callId,this.callerId,qt.nickname,this.dest_roomId,this.dest_roomId,this.callType,{offer:this.pc.localDescription,data:this.data,stream:this.mcuRemoteStream,volatile:!!this.restarted}),this.inviteSended=!0):Ft.log("Invite already sended"))))},this.combineRemoteStreams=function(kt,st,Tt,Rt){var Lt=kt.getTracks(),Et=Tt.getTracks();if(Lt.length===1&&Et.length===1&&(Lt[0].kind==="audio"&&Et[0].kind==="video"||Lt[0].kind==="video"&&Et[0].kind==="audio")){Ft.debug("combineRemoteStreams");var jt=new MediaStream;return jt.addTrack(Lt[0]),jt.addTrack(Et[0]),Rt==="internal"&&(Tt.removeTrack(Et[0]),this.onRemoteStreamRemoved({stream:Tt})),st==="internal"&&(kt.removeTrack(Lt[0]),this.onRemoteStreamRemoved({stream:kt})),this.onRemoteStreamAdded({stream:jt}),!0}return!1},this.checkRemoteStreamExists=function(kt,st){var Tt=!1,Rt=null,Lt=null,Et=null,jt=null,Pt=null;for(st&&Array.isArray(st)&&(jt=st.slice(0)),Rt=this.remoteMediaStreams.length;--Rt>=0;){if(this.remoteMediaStreams[Rt].id===kt){Tt=!0;break}if(jt)for(Et=(Lt=this.remoteMediaStreams[Rt].getTracks()).length;--Et>=0;)(Pt=st.indexOf(Lt[Et].id))>=0&&(jt[Pt]=!0)}if(!Tt&&jt){for(Pt=0,Et=jt.length;--Et>=0;)jt[Et]===!0&&(Pt+=1);Pt===jt.length&&(Tt=!0)}return Tt},this.onRemoteStreamAdded=function(kt){var st,Tt,Rt=this;if(Ft.info("onRemoteStreamAdded",kt),this.checkRemoteStreamExists(kt.stream.id,kt.stream.getTracks().map(function(Jt){return Jt.id})))Ft.debug("onRemoteStreamAdded: ignoring event; stream/track already known");else if(this.remoteMediaStreams.length!==1||!this.combineRemoteStreams(this.remoteMediaStreams[0],"internal",kt.stream,"event")){Ft.debug("onRemoteStreamAdded adding",kt.stream.id),kt.stream.id==="janus"&&this.data.remoteMediaStreamId&&(Ft.debug("onRemoteStreamAdded adding remoteMediaStreamId on stream :",this.data.remoteMediaStreamId),kt.stream.remoteMediaStreamId=this.data.remoteMediaStreamId),this.remoteMediaStreams.push(kt.stream),Ft.log("CallId is :"+this.callId),Ft.log("ClientId is :"+qt.clientId),this.sessionMCU&&this.sessionMCU.modeChangeKind==="new"&&qt.processRemoteStreamAdded(this,kt.stream),this.screenSharing===!0?this.callType="screenSharing":this.audioOnly===!0&&(this.callType="audio");var Lt,Et=function(Jt){var sn=null,mn=null;Jt.onmute=function(an){Ft.debug(Jt.kind+" mute event");var hn="";Jt.kind==="audio"&&sn===null?sn=setTimeout(function(){Rt.isRemoteAudioSilent=!0,hn="audioIsSilentLocally";var wn={},Mn={},xn=[];xn.push(hn),wn.available=Rt.remoteCallProfile.audio,wn.active=Rt.remoteCallProfile.audioActive,wn.muted=Rt.isRemoteAudioMuted,wn.silent=Rt.isRemoteAudioSilent,Mn.available=Rt.remoteCallProfile.video,Mn.active=Rt.remoteCallProfile.videoActive,Mn.muted=Rt.isRemoteVideoMuted,Mn.silent=Rt.isRemoteVideoSilent,Rt.myWebRTC_Event.createRemoteStreamUpdatedEvent(xn,wn,Mn,Rt.destCallType,Rt.callId,"browserAction"),sn=null},2520):Jt.kind==="video"&&mn===null&&(mn=setTimeout(function(){Rt.isRemoteVideoSilent=!0,hn="videoIsSilentLocally";var wn={},Mn={},xn=[];xn.push(hn),wn.available=Rt.remoteCallProfile.audio,wn.active=Rt.remoteCallProfile.audioActive,wn.muted=Rt.isRemoteAudioMuted,wn.silent=Rt.isRemoteAudioSilent,Mn.available=Rt.remoteCallProfile.video,Mn.active=Rt.remoteCallProfile.videoActive,Mn.muted=Rt.isRemoteVideoMuted,Mn.silent=Rt.isRemoteVideoSilent,Rt.myWebRTC_Event.createRemoteStreamUpdatedEvent(xn,wn,Mn,Rt.destCallType,Rt.callId,"browserAction"),mn=null},2520))},Jt.onunmute=function(an){if(Ft.debug(Jt.kind+" unmute event"),Jt.kind==="audio"&&sn!==null)clearTimeout(sn),sn=null;else if(Jt.kind==="video"&&mn!==null)clearTimeout(mn),mn=null;else{var hn="";Jt.kind==="audio"?(Rt.isRemoteAudioSilent=!1,hn="audioIsSilentLocally"):Jt.kind==="video"&&(Rt.isRemoteVideoSilent=!1,hn="videoIsSilentLocally");var wn={},Mn={},xn=[];xn.push(hn),wn.available=Rt.remoteCallProfile.audio,wn.active=Rt.remoteCallProfile.audioActive,wn.muted=Rt.isRemoteAudioMuted,wn.silent=Rt.isRemoteAudioSilent,Mn.available=Rt.remoteCallProfile.video,Mn.active=Rt.remoteCallProfile.videoActive,Mn.muted=Rt.isRemoteVideoMuted,Mn.silent=Rt.isRemoteVideoSilent,Rt.myWebRTC_Event.createRemoteStreamUpdatedEvent(xn,wn,Mn,Rt.destCallType,Rt.callId,"browserAction")}},Jt.onended=function(an){Ft.debug(Jt.kind+" ended event"),Jt.kind==="audio"&&sn!==null?(clearTimeout(sn),sn=null):Jt.kind==="video"&&mn!==null&&(clearTimeout(mn),mn=null)}},jt=nn(kt.stream.getVideoTracks());try{for(jt.s();!(Lt=jt.n()).done;){var Pt=Lt.value;Et(Pt),this.isRemoteVideoSilent=Pt.muted}}catch(Jt){jt.e(Jt)}finally{jt.f()}var Vt,Qt=nn(kt.stream.getAudioTracks());try{for(Qt.s();!(Vt=Qt.n()).done;){var rn=Vt.value;Et(rn),this.isRemoteAudioSilent=rn.muted}}catch(Jt){Qt.e(Jt)}finally{Qt.f()}st={available:this.remoteCallProfile.audio,active:this.remoteCallProfile.audioActive,muted:this.isRemoteAudioMuted,silent:this.isRemoteAudioSilent},Tt={available:this.remoteCallProfile.video,active:this.remoteCallProfile.videoActive,muted:this.isRemoteVideoMuted,silent:this.isRemoteVideoSilent},this.data!==null?this.data.mesh!==void 0?qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.stream,this.remoteId,this.destCallType,st,Tt):this.data.type==="publish"&&this.data.mode!=="passive"?Ft.warn("Filtering Remote stream added event (behavior on Chrome 44), no remote stream on publish calls"):this.data.subscribeOrder===!0&&this.data.pubCallId!==void 0?(Ft.debug("substitute callId: "+this.callId+" -> "+this.data.pubCallId),qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.data.pubCallId,kt.stream,this.remoteId,this.destCallType,st,Tt)):qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.stream,this.remoteId,this.destCallType,st,Tt):qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.stream,this.remoteId,this.destCallType,st,Tt)}},this.onRemoteTrackAdded=function(kt){var st,Tt;if(Ft.info("onRemoteTrackAdded",kt),kt.streams[0]!==void 0&&kt.track!==void 0){if(this.checkRemoteStreamExists(kt.streams[0].id,[kt.track.id]))Ft.debug("onRemoteTrackAdded: ignoring event; stream/track already known");else if(this.remoteMediaStreams.length!==1||!this.combineRemoteStreams(this.remoteMediaStreams[0],"internal",kt.streams[0],"event")){if(this.belongsToRoom()){if(this.callType==="audio"&&kt.track.kind!=="audio"||this.callType==="videoOnly"&&kt.track.kind!=="video"||this.callType==="media"&&kt.track.kind!=="video"||this.callType==="screenSharing"&&kt.track.kind!=="video"||this.callType==="screenSharingWithAudio"&&kt.track.kind!=="video")return void Ft.debug("onRemoteTrackAdded: ignoring event; callType: "+this.callType+", event.track.kind: "+kt.track.kind)}else if(this.destCallType==="audio"&&kt.track.kind!=="audio"||this.destCallType==="videoOnly"&&kt.track.kind!=="video"||this.destCallType==="media"&&kt.track.kind!=="video"||this.destCallType==="screenSharing"&&kt.track.kind!=="video"||this.destCallType==="screenSharingWithAudio"&&kt.track.kind!=="video")return Ft.debug("onRemoteTrackAdded: ignoring event; destCallType: "+this.destCallType+", event.track.kind: "+kt.track.kind),void(this.remoteMediaStreams.length===2&&this.combineRemoveStreams(this.remoteMediaStreams[0],"internal",this.remoteMediaStreams[1],"internal"));Ft.debug("onRemoteTrackAdded adding; stream.id: "+kt.streams[0].id),this.remoteMediaStreams.push(kt.streams[0]),Ft.log("CallId is :"+this.callId),Ft.log("ClientId is :"+qt.clientId),Ft.log("this.callType :"+this.callType),this.screenSharing===!0?this.callType="screenSharing":this.audioOnly===!0&&(this.callType="audio"),this.sessionMCU&&this.sessionMCU.modeChangeKind==="new"&&qt.processRemoteStreamAdded(this,kt.streams[0]),kt.streams[0].onaddtrack=function(Rt){Ft.debug("onRemoteTrackAdded ontrack.onaddtrack",Rt)},kt.streams[0].onremovetrack=(function(Rt){var Lt=null;if(Ft.debug("onRemoteTrackAdded ontrack.onremovetrack",Rt),this.updateOngoingTimeoutId)return Ft.debug("onRemoteTrackAdded onremovetrack: update ongoing"),void Ft.debug("onRemoteTrackAdded onremovetrack: ignoring event",Rt.track.kind);if(this.callType==="audio"&&Rt.track.kind!=="audio"||this.callType==="videoOnly"&&Rt.track.kind!=="video"||this.callType==="media"&&Rt.track.kind!=="video"||this.callType==="screenSharing"&&Rt.track.kind!=="video"||this.callType==="screenSharingWithAudio"&&Rt.track.kind!=="video")Ft.debug("onRemoteTrackAdded onremovetrack: ignoring event",Rt.track.kind);else if(Rt.target instanceof MediaStream){for(Lt=this.remoteMediaStreams.length;--Lt>=0;)if(this.remoteMediaStreams[Lt].id===Rt.target.id){Ft.debug("onRemoteTrackAdded onremovetrack removing",Rt.target.id),this.remoteMediaStreams.splice(Lt,1);break}qt.myWebRTC_Event.createRemoteStreamRemovedEvent(this.callType,this.callId,Rt.target,this.remoteId,this.destCallType)}else Ft.debug("onRemoteTrackAdded onremovetrack: ignoring event target not MediaStream")}).bind(this),st={available:this.remoteCallProfile.audio,active:this.remoteCallProfile.audioActive,muted:this.isRemoteAudioMuted,silent:this.isRemoteAudioSilent},Tt={available:this.remoteCallProfile.video,active:this.remoteCallProfile.videoActive,muted:this.isRemoteVideoMuted,silent:this.isRemoteVideoSilent},this.data!==null?this.data.mesh!==void 0?(this.callType==="audio"&&kt.track.kind==="audio"||this.callType==="videoOnly"&&kt.track.kind==="video"||this.callType==="media"&&kt.track.kind==="video"||this.callType==="screenSharing"&&kt.track.kind==="video"||this.callType==="screenSharingWithAudio"&&kt.track.kind==="video")&&qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.streams[0],this.remoteId,this.destCallType,st,Tt):this.data.type==="publish"&&this.data.mode!=="passive"?Ft.warn("Filtering Remote stream added event (behavior on Chrome 44), no remote stream on publish calls"):this.belongsToRoom()?(this.callType==="audio"&&kt.track.kind==="audio"||this.callType==="videoOnly"&&kt.track.kind==="video"||this.callType==="media"&&kt.track.kind==="video"||this.callType==="screenSharing"&&kt.track.kind==="video"||this.callType==="screenSharingWithAudio"&&kt.track.kind==="video")&&(this.data.subscribeOrder===!0&&this.data.pubCallId!==void 0?(Ft.debug("substitute callId: "+this.callId+" -> "+this.data.pubCallId),qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.data.pubCallId,kt.streams[0],this.remoteId,this.destCallType,st,Tt)):qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.streams[0],this.remoteId,this.destCallType,st,Tt)):(this.destCallType==="audio"&&kt.track.kind==="audio"||this.destCallType==="videoOnly"&&kt.track.kind==="video"||this.destCallType==="media"&&kt.track.kind==="video"||this.destCallType==="screenSharing"&&kt.track.kind==="video"||this.destCallType==="screenSharingWithAudio"&&kt.track.kind==="video")&&qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.streams[0],this.remoteId,this.destCallType,st,Tt):this.belongsToRoom()?(this.callType==="audio"&&kt.track.kind==="audio"||this.callType==="videoOnly"&&kt.track.kind==="video"||this.callType==="media"&&kt.track.kind==="video"||this.callType==="screenSharing"&&kt.track.kind==="video"||this.callType==="screenSharingWithAudio"&&kt.track.kind==="video")&&qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.streams[0],this.remoteId,this.destCallType,st,Tt):(this.destCallType==="audio"&&kt.track.kind==="audio"||this.destCallType==="videoOnly"&&kt.track.kind==="video"||this.destCallType==="media"&&kt.track.kind==="video"||this.destCallType==="screenSharing"&&kt.track.kind==="video"||this.destCallType==="screenSharingWithAudio"&&kt.track.kind==="video")&&qt.myWebRTC_Event.createRemoteStreamAddedEvent(this.callType,this.callId,kt.streams[0],this.remoteId,this.destCallType,st,Tt)}}else Ft.debug("onRemoteTrackAdded: ignoring event; event data are not correct")},this.onRemoteStreamRemoved=function(kt){var st=null;for(Ft.info("onRemoteStreamRemoved",kt),st=this.remoteMediaStreams.length;--st>=0;)if(this.remoteMediaStreams[st].id===kt.stream.id){Ft.debug("onRemoteStreamRemoved removing",kt.stream.id),this.remoteMediaStreams.splice(st,1);break}qt.myWebRTC_Event.createRemoteStreamRemovedEvent(this.callType,this.callId,kt.stream,this.remoteId,this.destCallType),kt=null},this.onNegotiationNeeded=function(kt){Ft.debug("onNegotiationNeeded",kt),kt=null,this.addingDataChannelOnCallOngoing&&(this.updateMediaWithRetryManagement(!1),this.addingDataChannelOnCallOngoing=!1)},this.onSignalingStateChange=function(kt){Ft.debug("onSignalingStateChange",kt),kt=null},this.onCallDisconnection=function(){Ft.info("onCallDisconnection; callId: "+this.callId);var kt=new Date;Ft.debug("date:",kt),this.disconnectionWarningInterval!==0&&(Ft.debug("date:",kt),Ft.debug("clearing disconnectionWarningInterval"),clearInterval(this.disconnectionWarningInterval),this.disconnectionWarningInterval=0),this.disconnectionWarningTimeout!==0&&(Ft.debug("date:",kt),Ft.debug("clearing disconnectionWarningTimeout"),clearTimeout(this.disconnectionWarningTimeout),this.disconnectionWarningTimeout=0),this.belongsToRoom()?qt.onHangup(this.callId,"disconnected"):qt.onHangup(this.callId,"Ice_disconnected")},this.sendDisconnectionWarning=function(){Ft.log("sendDisconnectionWarning()");var kt=null,st=null;if(this.callControl&&(kt=this.callControl.roomName,st=this.callControl.type),this.disconnectionWarningCount++,un.createEvent({eventType:"disconnectionWarning",callId:this.callId,remoteId:this.remoteId,tries:this.disconnectionWarningCount,roomName:kt,settingUpType:st}),(this.disconnectionWarningCount-1)*this.disconnectionWarningDelay>=this.disconnectionTimer&&this.disconnectionWarningInterval!==0){var Tt=Date();Ft.debug("date :"+Tt),Ft.debug("clearing disconnectionWarningInterval : no more warnings"),clearInterval(this.disconnectionWarningInterval),this.disconnectionWarningInterval=0}},this.createIceErrorDescriptor=function(kt,st){var Tt={};return kt==="disconnected"?Tt.iceState="disconnected":kt==="failed"?(Tt.iceState="failed",st===!0&&(Tt.previousIceState="disconnected")):Tt.iceState="unknown",Tt.callType=this.callType,this.belongsToRoom()?(Tt.context="conf",this.data.mesh?(Tt.mode="mesh",(this.data.mesh.callerCompositeUserId?this.data.mesh.callerCompositeUserId===qt.compositeClientId:this.data.mesh.callerId===qt.clientId)?(Tt.type="subscribe",Tt.clientId=this.data.mesh.callerId,Tt.remoteId=this.data.mesh.calleeId):(this.data.mesh.calleeCompositeUserId?this.data.mesh.calleeCompositeUserId===qt.compositeClientId:this.data.mesh.calleeId===qt.clientId)?(Tt.type="publish",Tt.clientId=this.data.mesh.calleeId,Tt.remoteId=this.data.mesh.callerId):Tt.type="unknown",Tt.mesh=this.data.mesh):(Tt.mode="sfu",this.settingUpType==="publish"||this.settingUpType==="shareScreen"?Tt.type="publish":this.settingUpType==="subscribe"?Tt.type="subscribe":Tt.type="unknown",this.callee?(Tt.clientId=this.calleeId,Tt.remoteId=this.callerId):(Tt.clientId=this.callerId,Tt.remoteId=this.calleeId)),this.mcuRemoteStream&&(Tt.stream=this.mcuRemoteStream)):(Tt.context="call",Tt.mode="p2p",this.callerId===qt.clientId?(Tt.clientId=this.callerId,Tt.remoteId=this.calleeId):this.calleeId===qt.clientId&&(Tt.clientId=this.calleeId,Tt.remoteId=this.callerId)),Tt},this.onIceConnectionStateChange=function(kt){Ft.debug("onIceConnectionStateChange: ",kt),kt=null;var st=0,Tt=null,Rt=null,Lt=null;this.pc!==null?(Ft.info("Ice Connection State is now : "+this.pc.iceConnectionState),this.iceState=this.pc.iceConnectionState,this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed"||this.pc.iceConnectionState==="checking"?(Ft.debug("iceConnectionState === connected or completed or checking"),Ft.debug("this.disconnectionTimeoutId :"+this.disconnectionTimeoutId),this.disconnectionTimeoutId!==0&&(st=Date(),Ft.debug("date:",st),Ft.debug("clearing disconnectionTimeout"),clearTimeout(this.disconnectionTimeoutId),this.disconnectionTimeoutId=0),this.disconnectionWarningInterval!==0&&(st=Date(),Ft.debug("date:",st),Ft.debug("clearing disconnectionWarningInterval"),clearInterval(this.disconnectionWarningInterval),this.disconnectionWarningInterval=0),this.pc.iceConnectionState!=="checking"&&(this.checkCandidateTypesTimeoutId=setTimeout(this.callback(this,"checkCandidateTypes"),this.checkCandidateTypesTimer),this.checkCandidateTypesTimeoutTable.push(this.checkCandidateTypesTimeoutId))):this.pc.iceConnectionState==="disconnected"?(this.callControl&&(Tt=this.callControl.roomName,Rt=this.callControl.type),(Lt=this.createIceErrorDescriptor("disconnected")).context==="conf"&&this.myWebRTC_Stack.sendInfo("iceError",{clientId:qt.clientId,callId:this.callId,roomId:this.sessionMCU.roomName,pubSub:qt.MCUClient.pubConnector,descriptor:Lt}),Ft.warn("disconnection detected"),un.createErrorEvent("iceDisconnection detected","ICE_CONNECTION_STATE_DISCONNECTED",this.callId,Tt,Rt,Lt),st=new Date,Ft.debug("date:",st),this.disconnectionTimeoutId=setTimeout(this.callback(this,"onCallDisconnection"),this.disconnectionTimer),this.disconnectionWarningCount=0,this.disconnectionWarningTimeout=setTimeout(this.callback(this,"sendDisconnectionWarning"),2e3),this.disconnectionWarningInterval=setInterval(this.callback(this,"sendDisconnectionWarning"),this.disconnectionWarningDelay)):this.pc.iceConnectionState==="failed"&&(this.callControl&&(Tt=this.callControl.roomName,Rt=this.callControl.type),(Lt=this.createIceErrorDescriptor("failed",this.disconnectionTimeoutId!==0)).context==="conf"&&this.myWebRTC_Stack.sendInfo("iceError",{clientId:qt.clientId,callId:this.callId,roomId:this.sessionMCU.roomName,pubSub:qt.MCUClient.pubConnector,descriptor:Lt}),Ft.warn("iceConnection failed detected"),un.createErrorEvent("iceConnection failed detected","ICE_CONNECTION_STATE_FAILED",this.callId,Tt,Rt,Lt),this.disconnectionTimeoutId!==0?this.belongsToRoom()&&(clearTimeout(this.disconnectionTimeoutId),this.disconnectionTimeoutId=0,qt.onHangup(this.callId,"disconnected")):this.belongsToRoom()&&(0,at.ki)(this.callControl,["autoRestart","counter"],"number")&&this.callControl.autoRestart.counter>0?qt.onHangup(this.callId,"disconnected"):(Ft.warn("Removing call with callId: "+this.callId),qt.removeCallFromTableWithCallIdAndSendBye(this.callId,"Ice_failed")))):Ft.log("Ice Connection State change with pc is null")},this.callback=function(kt,st){return this.closureHandler=function(Tt,Rt){return kt[st](Tt,Rt)},this.closureHandler},this.onSelectedCandidate=function(kt){if(this.selectedCandidate===void 0||this.selectedCandidate===null||this.selectedCandidate.LocalCandidateType!==kt.LocalCandidateType||this.selectedCandidate.RemoteCandidateType!==kt.RemoteCandidateType||this.selectedCandidate.LocalAddress!==kt.LocalAddress||this.selectedCandidate.RemoteAddress!==kt.RemoteAddress||this.selectedCandidate.TransportType!==kt.TransportType||this.selectedCandidate.LocalTransportType!==kt.LocalTransportType){Ft.debug("WebRTC_Call::onSelectedCandidate() :",kt),this.selectedCandidate=kt,this.callControl&&this.callControl.autoRestart&&(Ft.debug("selectedCandidate, this.callControl.autoRestart.counter:",this.callControl.autoRestart.counter),Ft.debug("selectedCandidate, this.callControl.autoRestart.callIdWhenStartingTimer:",this.callControl.autoRestart.callIdWhenStartingTimer),this.callControl.autoRestart.counter&&(Ft.debug("Reinit of autoRestart.counter"),this.callControl.autoRestart.counter=0,this.callControl.autoRestart.callIdWhenStartingTimer!==void 0&&qt.stopMaxCallRetriesTimer(this.callControl.autoRestart.callIdWhenStartingTimer))),this.myWebRTC_Event.createSelectedICECandidateEvent(this.callId,kt.LocalCandidateType,kt.RemoteCandidateType,kt.LocalAddress,kt.RemoteAddress,kt.TransportType,kt.LocalTransportType);var st=kt;st.callId=this.callId,st.clientId=qt.clientId,st.roomId=this.dest_roomId,this.data.pubSub!==void 0&&(st.pubSub=this.data.pubSub),this.data.confId!==void 0&&(st.confId=this.data.confId),this.data.mesh!==void 0&&(st.mesh=this.data.mesh),this.data.instanceId!==void 0&&(st.instanceId=this.data.instanceId),this.myWebRTC_Stack.sendInfo("callSelectedCandidate",st)}else Ft.debug("filtering duplicate candidate")},this.checkCandidateTypes=function(){Ft.debug("WebRTC_Call::checkCandidatesTypes()");var kt=this,st={LocalCandidateType:"unknow",RemoteCandidateType:"unknow",LocalAddress:"unknow",RemoteAddress:"unknow",TransportType:"unknow",LocalTransportType:"unknow",relayTransportType:"unknow"},Tt=["googLocalAddress","googLocalCandidateType","googRemoteAddress","googRemoteCandidateType","googTransportType"];this.pc===null?(Ft.warn("Peer connection is null : no candidates"),kt.myWebRTC_Event.createICECandidateTypeUpdateEvent(kt.callId,st.LocalCandidateType,st.RemoteCandidateType),kt.onSelectedCandidate(st)):typeof apiRTC_React<"u"?(Ft.debug("apiRTC_React : WebRTC_Call::checkCandidatesTypes()"),this.pc.getStats().then(function(Rt){var Lt=null;if(Rt.forEach(function(Pt){Pt.nominated===!0&&(Lt=Pt)}),Lt!==null){var Et=Rt.get(Lt.localCandidateId),jt=Rt.get(Lt.remoteCandidateId);st.LocalCandidateType=Et.candidateType,st.RemoteCandidateType=jt.candidateType,Et.address&&Et.port&&(st.LocalAddress=Et.address+":"+Et.port),jt.address&&jt.port&&(st.RemoteAddress=jt.address+":"+jt.port),st.TransportType=Et.protocol,Et.candidateType==="relay"&&Et.relayProtocol!==void 0&&(st.relayTransportType=Et.relayProtocol),kt.myWebRTC_Event.createICECandidateTypeUpdateEvent(kt.callId,st.LocalCandidateType,st.RemoteCandidateType),kt.onSelectedCandidate(st)}}).catch(function(Rt){Ft.error(Rt)})):at.wL.type==="chrome"&&nt.PR<=112?(Ft.debug("WebRTC_Call::checkCandidatesTypes() chrome <= 112"),this.pc.getStats(function(Rt){var Lt=Rt.result().filter(function(Et){return Et.id.indexOf("Conn-")===0&&Et.stat("googActiveConnection")==="true"})[0];Lt?(Tt.forEach(function(Et){st[Et.replace("goog","")]=Lt.stat(Et)}),kt.myWebRTC_Event.createICECandidateTypeUpdateEvent(kt.callId,st.LocalCandidateType,st.RemoteCandidateType),kt.onSelectedCandidate(st)):(kt.myWebRTC_Event.createICECandidateTypeUpdateEvent(kt.callId,st.LocalCandidateType,st.RemoteCandidateType),kt.onSelectedCandidate(st))})):at.wL.type==="chrome"||at.wL.type==="firefox"||at.wL.type==="safari"?(Ft.debug("WebRTC_Call::checkCandidatesTypes()"),this.pc.getStats(null).then(function(Rt){var Lt=null;if(Rt.forEach(function(Pt){Pt.selected===!0&&at.wL.type==="firefox"?(Lt!==null&&Ft.warn("multiple selected candidate-pairs"),Lt=Pt):Pt.nominated===!0&&(Lt=Pt)}),Lt!==null){var Et=Rt.get(Lt.localCandidateId),jt=Rt.get(Lt.remoteCandidateId);st.LocalCandidateType=Et.candidateType,st.RemoteCandidateType=jt.candidateType,Et.address&&Et.port?st.LocalAddress=Et.address+":"+Et.port:Et.ipAddress&&Et.portNumber&&(st.LocalAddress=Et.ipAddress+":"+Et.portNumber),jt.address&&jt.port?st.RemoteAddress=jt.address+":"+jt.port:jt.ipAddress&&jt.portNumber&&(st.RemoteAddress=jt.ipAddress+":"+jt.portNumber),st.TransportType=Et.protocol,Et.candidateType==="relay"&&Et.relayProtocol!==void 0&&(st.relayTransportType=Et.relayProtocol),kt.myWebRTC_Event.createICECandidateTypeUpdateEvent(kt.callId,st.LocalCandidateType,st.RemoteCandidateType),kt.onSelectedCandidate(st)}}).catch(function(Rt){Ft.warn("failed to get stats",Rt)})):(Ft.debug("checkCandidateTypes not Chrome or Firefox"),kt.myWebRTC_Event.createICECandidateTypeUpdateEvent(kt.callId,st.LocalCandidateType,st.RemoteCandidateType),kt.onSelectedCandidate(st))},this.belongsToRoom=function(){return!!(0,at.ki)(this.sessionMCU,"roomName","string")&&((0,at.ki)(this.data,"MCUType","string")&&(this.data.MCUType==="MCU-Caller"||this.data.MCUType==="MCU-Callee")&&(0,at.ki)(this.data,"confId","string")?this.data.confId===this.sessionMCU.roomName:this.dest_roomId===this.sessionMCU.roomName)},this.setLocalCallProfile=function(kt){var st=arguments.length>1&&arguments[1]!==void 0&&arguments[1],Tt=[],Rt={},Lt={},Et=null,jt=null,Pt="adaptation";this.dataCall!==!0&&this.settingUpType!=="subscribe"&&(this.localCallProfile.audioActive!==kt.audioActive&&Tt.push("audioIsActive"),this.localCallProfile.videoActive!==kt.videoActive&&Tt.push("videoIsActive"),this.localCallProfile=kt,this.screenSharing===!0?this.localCallProfile.audioActive===!0&&this.localCallProfile.videoActive===!0?this.callType!=="screenSharingWithAudio"&&(this.callType="screenSharingWithAudio",Tt.push("callType")):this.localCallProfile.audioActive===!0?this.callType!=="audio"&&(this.callType="audio",Tt.push("callType")):this.localCallProfile.videoActive===!0?this.callType!=="screenSharing"&&(this.callType="screenSharing",Tt.push("callType")):this.callType!=="inactive"&&(this.callType="inactive",Tt.push("callType")):this.localCallProfile.audioActive===!0&&this.localCallProfile.videoActive===!0?this.callType!=="media"&&(this.callType="media",Tt.push("callType")):this.localCallProfile.audioActive===!0?this.callType!=="audio"&&(this.callType="audio",Tt.push("callType")):this.localCallProfile.videoActive===!0?this.callType!=="videoOnly"&&(this.callType="videoOnly",Tt.push("callType")):this.callType!=="inactive"&&(this.callType="inactive",Tt.push("callType")),st===!0&&Tt.length>0&&(Rt.available=this.localCallProfile.audio,Rt.active=this.localCallProfile.audioActive,Rt.muted=this.isLocalAudioMuted,Rt.silent=this.isRemoteAudioSilent,Lt.available=this.localCallProfile.video,Lt.active=this.localCallProfile.videoActive,Lt.muted=this.isLocalVideoMuted,Lt.silent=this.isRemoteVideoSilent,this.callConfiguration&&this.callConfiguration.userMediaStreamId&&(Et=this.callConfiguration.userMediaStreamId,(jt=apiCC.getUserMediaStream(Et))&&(Rt.deviceLabel=jt.audioDeviceLabel,Lt.deviceLabel=jt.videoDeviceLabel)),this.updateCause&&(Pt=this.updateCause),this.myWebRTC_Event.createLocalStreamUpdatedEvent(Tt,Rt,Lt,!0,this.callType,this.callId,this.callLocalStream,Et,Pt)))},this.setRemoteCallProfile=function(kt){var st=arguments.length>1&&arguments[1]!==void 0&&arguments[1],Tt=[],Rt={},Lt={},Et="adaptation";this.dataCall!==!0&&(this.remoteCallProfile.audioActive!==kt.audioActive&&Tt.push("audioIsActive"),this.remoteCallProfile.videoActive!==kt.videoActive&&Tt.push("videoIsActive"),this.remoteCallProfile=kt,this.settingUpType==="subscribe"?(this.screenSharing===!0?this.remoteCallProfile.audioActive===!0&&this.remoteCallProfile.videoActive===!0?this.callType!=="screenSharingWithAudio"&&(this.callType="screenSharingWithAudio",Tt.push("callType")):this.remoteCallProfile.audioActive===!0?this.callType!=="audio"&&(this.callType="audio",Tt.push("callType")):this.remoteCallProfile.videoActive===!0?this.callType!=="screenSharing"&&(this.callType="screenSharing",Tt.push("callType")):this.callType!=="inactive"&&(this.callType="inactive",Tt.push("callType")):this.remoteCallProfile.audioActive===!0&&this.remoteCallProfile.videoActive===!0?this.callType!=="media"&&(this.callType="media",Tt.push("callType")):this.remoteCallProfile.audioActive===!0?this.callType!=="audio"&&(this.callType="audio",Tt.push("callType")):this.remoteCallProfile.videoActive===!0?this.callType!=="videoOnly"&&(this.callType="videoOnly",Tt.push("callType")):this.callType!=="inactive"&&(this.callType="inactive",Tt.push("callType")),st===!0&&Tt.length>0&&(Rt.available=this.remoteCallProfile.audio,Rt.active=this.remoteCallProfile.audioActive,Rt.muted=this.isRemoteAudioMuted,Rt.silent=this.isRemoteAudioSilent,Lt.available=this.remoteCallProfile.video,Lt.active=this.remoteCallProfile.videoActive,Lt.muted=this.isRemoteVideoMuted,Lt.silent=this.isRemoteVideoSilent,this.updateCause&&(Et=this.updateCause),this.myWebRTC_Event.createRemoteStreamUpdatedEvent(Tt,Rt,Lt,this.callType,this.callId,Et))):(this.screenSharing===!0?this.remoteCallProfile.audioActive===!0&&this.remoteCallProfile.videoActive===!0?this.destCallType!=="screenSharingWithAudio"&&(this.destCallType="screenSharingWithAudio",Tt.push("callType")):this.remoteCallProfile.audioActive===!0?this.destCallType!=="audio"&&(this.destCallType="audio",Tt.push("callType")):this.remoteCallProfile.videoActive===!0?this.destCallType!=="screenSharing"&&(this.destCallType="screenSharing",Tt.push("callType")):this.destCallType!=="inactive"&&(this.destCallType="inactive",Tt.push("callType")):this.settingUpType!=="publish"&&this.settingUpType!=="shareScreen"||(this.remoteCallProfile.audioActive===!0&&this.remoteCallProfile.videoActive===!0?this.destCallType!=="media"&&(this.destCallType="media",Tt.push("callType")):this.remoteCallProfile.audioActive===!0?this.destCallType!=="audio"&&(this.destCallType="audio",Tt.push("callType")):this.remoteCallProfile.videoActive===!0?this.destCallType!=="videoOnly"&&(this.destCallType="videoOnly",Tt.push("callType")):this.destCallType!=="inactive"&&(this.destCallType="inactive",Tt.push("callType"))),st===!0&&Tt.length>0&&(Rt.available=this.remoteCallProfile.audio,Rt.active=this.remoteCallProfile.audioActive,Rt.muted=this.isRemoteAudioMuted,Rt.silent=this.isRemoteAudioSilent,Lt.available=this.remoteCallProfile.video,Lt.active=this.remoteCallProfile.videoActive,Lt.muted=this.isRemoteVideoMuted,Lt.silent=this.isRemoteVideoSilent,this.updateCause&&(Et=this.updateCause),this.myWebRTC_Event.createRemoteStreamUpdatedEvent(Tt,Rt,Lt,this.destCallType,this.callId,Et))))},this.setMediaConstraintsToSendOnlyOffer=function(){at.wL.type==="firefox"?nt.PR>43?this.mediaConstraints={offerToReceiveAudio:!1,offerToReceiveVideo:!1}:this.mediaConstraints={mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}}:at.wL.type==="edge"?this.mediaConstraints={offerToReceiveAudio:0,offerToReceiveVideo:0}:at.wL.type==="chrome"&&at.wL.version<55?this.mediaConstraints={mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}}:this.mediaConstraints={offerToReceiveAudio:!1,offerToReceiveVideo:!1,mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}},this.mediaConstraintsAudioOnly=this.mediaConstraints},this.applyOutgoingBitrate=function(kt){var st=this;Ft.debug("applyOutgoingBitrate",this.callId,kt);for(var Tt=null,Rt=0;Rt1&&arguments[1]!==void 0?arguments[1]:{};if(Ft.debug("configureSimulcastEncodings",this.callId,kt,Tt.maxBitrate),this.simulcast==="RID"){for(var Rt=null,Lt=0;Lt=0;){var rn=Et.encodings[Qt];jt||rn.rid!=="h"?Pt||rn.rid!=="m"?Vt||rn.rid!=="l"||(Vt=rn):Pt=rn:jt=rn}if(jt&&Object.prototype.hasOwnProperty.call(jt,"maxBitrate")&&Pt&&Object.prototype.hasOwnProperty.call(Pt,"maxBitrate")&&Vt&&Object.prototype.hasOwnProperty.call(Vt,"maxBitrate")){var Jt=!1,sn=Math.floor(Vt.maxBitrate/1e3),mn=!1,an=!1;if(jt.active&&jt.maxBitrate>1&&(sn+=Math.floor(jt.maxBitrate/1e3),mn=!0),Pt.active&&Pt.maxBitrate>1&&(sn+=Math.floor(Pt.maxBitrate/1e3),an=!0),Ft.debug("currentStatus",sn,mn,an),kt==="changeMaxBitrate"){if(!(0,at.ki)(Tt,"maxBitrate","number"))return;var hn=Tt.maxBitrate;sn<=hn?(an||sn+this.callConfiguration.simulcast.encodings.medium.maxBitrate<=hn&&(at.wL.type==="chrome"?Pt.active=!0:at.wL.type==="firefox"&&(Pt.maxBitrate=1e3*this.callConfiguration.simulcast.encodings.medium.maxBitrate),this.callConfiguration.simulcast.encodings.medium.active=!0,an=!0,sn+=this.callConfiguration.simulcast.encodings.medium.maxBitrate,Jt=!0),mn||sn+this.callConfiguration.simulcast.encodings.high.maxBitrate<=hn&&(at.wL.type==="chrome"?jt.active=!0:at.wL.type==="firefox"&&(jt.maxBitrate=1e3*this.callConfiguration.simulcast.encodings.high.maxBitrate),this.callConfiguration.simulcast.encodings.high.active=!0,mn=!0,sn+=this.callConfiguration.simulcast.encodings.high.maxBitrate,Jt=!0)):(mn&&(mn=!1,this.callConfiguration.simulcast.encodings.high.active=!1,sn-=Math.floor(jt.maxBitrate/1e3),at.wL.type==="chrome"?jt.active=!1:at.wL.type==="firefox"&&(jt.maxBitrate=1),Jt=!0),sn>hn&&an&&(an=!1,this.callConfiguration.simulcast.encodings.medium.active=!1,sn-=Math.floor(Pt.maxBitrate/1e3),at.wL.type==="chrome"?Pt.active=!1:at.wL.type==="firefox"&&(Pt.maxBitrate=1),Jt=!0))}else kt==="disableEncoding"&&(mn?(mn=!1,this.callConfiguration.simulcast.encodings.high.active=!1,sn-=Math.floor(jt.maxBitrate/1e3),at.wL.type==="chrome"?jt.active=!1:at.wL.type==="firefox"&&(jt.maxBitrate=1),Jt=!0):an&&(an=!1,this.callConfiguration.simulcast.encodings.medium.active=!1,sn-=Math.floor(Pt.maxBitrate/1e3),at.wL.type==="chrome"?Pt.active=!1:at.wL.type==="firefox"&&(Pt.maxBitrate=1),Jt=!0));Ft.debug("applyChanges",sn,mn,an,Jt),Jt&&(Rt.setParameters(Et).catch(function(wn){Ft.error("configureEncodings - setParameters",st.callId,wn)}),this.myWebRTC_Stack.sendInfo("configureEncodings",{pubSub:qt.MCUClient.pubConnector,clientId:qt.clientId,roomId:this.sessionMCU.roomName,callId:this.callId,instanceId:this.instanceId,hint:"simulcast",encodings:this.callConfiguration.simulcast.encodings}))}else Ft.warn("cannot find h/m/l encodings",this.callId)}else Ft.warn("wrong encodings",this.callId,Et.encodings.length);else Ft.warn("no encodings configured",this.callId)}else Ft.warn("no such functions: getParameters/setParameters",this.callId);else Ft.warn("no such video rtpSender",this.callId)}}},yn=(s(4363),s(9653),function(qt){this.disconnectionTimer=15e3,Number.MAX_SAFE_INTEGER!==void 0?this.userMediaId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString():this.userMediaId=Math.floor(1000001*Math.random()).toString(),this.callType="media",this.audio=!1,this.video=!1,this.audioSdpDirection=null,this.videoSdpDirection=null,this.callConfiguration={},this.sessionMCU=null,this.myWebRTC_Stack=new ht.S(qt.socket),this.getUserMediaStream=function(){return this.callConfiguration&&this.callConfiguration.userMediaStreamId?apiCC.getUserMediaStream(this.callConfiguration.userMediaStreamId):null},this.releaseUserMediaStream=function(){if(this.callConfiguration&&this.callConfiguration.userMediaStreamId){var kt=this.callConfiguration.userMediaStreamId;return delete this.callConfiguration.userMediaStreamId,apiCC.releaseUserMediaStream(kt,this.userMediaId)}return!1},this.close=function(){(this.addAck||this.addTimeoutId)&&(delete this.addAck,clearTimeout(this.addTimeoutId),delete this.addTimeoutId)}});function cn(qt){return cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(kt){return typeof kt}:function(kt){return kt&&typeof Symbol=="function"&&kt.constructor===Symbol&&kt!==Symbol.prototype?"symbol":typeof kt},cn(qt)}function gn(qt,kt){var st=typeof Symbol<"u"&&qt[Symbol.iterator]||qt["@@iterator"];if(!st){if(Array.isArray(qt)||(st=function(Pt,Vt){if(Pt){if(typeof Pt=="string")return bn(Pt,Vt);var Qt=Object.prototype.toString.call(Pt).slice(8,-1);return Qt==="Object"&&Pt.constructor&&(Qt=Pt.constructor.name),Qt==="Map"||Qt==="Set"?Array.from(Pt):Qt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Qt)?bn(Pt,Vt):void 0}}(qt))||kt&&qt&&typeof qt.length=="number"){st&&(qt=st);var Tt=0,Rt=function(){};return{s:Rt,n:function(){return Tt>=qt.length?{done:!0}:{done:!1,value:qt[Tt++]}},e:function(Pt){throw Pt},f:Rt}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Lt,Et=!0,jt=!1;return{s:function(){st=st.call(qt)},n:function(){var Pt=st.next();return Et=Pt.done,Pt},e:function(Pt){jt=!0,Lt=Pt},f:function(){try{Et||st.return==null||st.return()}finally{if(jt)throw Lt}}}}function bn(qt,kt){(kt==null||kt>qt.length)&&(kt=qt.length);for(var st=0,Tt=new Array(kt);stS: "+Et),apiCC.session.channel.socket.emit("MCUSessionInvitation",Et)):fn.log("Session is null or undefined, MCU Session invitation is not sended")},this.sendSessionInvitationToGroupChat=function(st,Tt){if(fn.debug("sendSessionInvitationToGroupChat()"),st!=null)if(Tt!=null){var Rt,Lt;Rt={type:"MCUSessionInvitationToGroupChat",srcId:kt,groupChatId:st,sessionId:Tt},Lt=JSON.stringify(Rt),fn.log("C->S: "+Lt),apiCC.session.channel.socket.emit("MCUSessionInvitationToGroupChat",Lt)}else fn.log("Session is null or undefined, MCU Session invitation is not sended");else fn.log("groupChatId is null or undefined, MCU Session invitation is not sended")},this.receiveSessionInvitation=function(st){fn.debug("receiveSessionInvitation()"),fn.log("msg.sessionId :"+st.sessionId),fn.log("msg.token :"+st.token),fn.log("msg.groupChatId :"+st.groupChatId),Tn.createReceiveMCUSessionInvitationEvent(st.sessionId,st.token,st.groupChatId,st.srcId)},this.acceptSessionInvitation=function(st,Tt){fn.debug("acceptSessionInvitation()"),fn.log("sessionId :"+st),fn.log("token :"+Tt),this.publish(st,Tt)},this.leaveSession=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};fn.info("leaveSession()");var Rt=null,Lt=null,Et=null;if(!(Et=st?this.getSessionMCU(st):this.getSessionMCU(null,{first:!0})))return new Error("leaveSession: session not set");Tt.noHangup!==!0&&(apiCC.session.apiCCWebRTCClient.webRTCClient.removeAllCallsFromRoom(Et.roomName,"leaveSession"),this.meshOnHangup(null,null,{roomId:Et.roomName}));var jt=[],Pt={};jt.push(Et.roomName),Pt.doneByApiRTC=!0,apiCC.session.leavePresenceGroup(jt,Pt),apiCC.session.unsubscribePresenceGroup(jt,Pt),Rt={type:"leaveSession",roomId:Et.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,data:{pubSub:this.pubConnector}},Lt=JSON.stringify(Rt),fn.log("C->S: "+Lt),apiCC.session.channel.socket.emit("leaveSession",Lt),fn.debug("leaveSession: distant call clean up");for(var Vt=this.distantCalls.length;--Vt>=0;)this.distantCalls[Vt].roomId===Et.roomName&&(fn.debug("leaveSession: remove distant call descriptor",this.distantCalls[Vt]),this.distantCalls.splice(Vt,1));apiCC.session.apiCCWebRTCClient.webRTCClient.destroyCallControl({multi:!0,roomName:Et.roomName});for(var Qt=this.streamList.length;--Qt>=0;)this.streamList[Qt].roomId===Et.roomName&&this.streamList.splice(Qt,1);return this.removeSessionMCU(Et),"OK"},this.createJoinSessionMessage=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rt=null;st||(Rt=Tt.hasOwnProperty("sessionMCU")?Tt.sessionMCU:this.getSessionMCU(null,{first:!0}))&&(st=Rt.roomName);var Lt=Rt&&Rt.roomMode==="mesh"||this.meshModeEnabled===!0||Tt.meshModeEnabled===!0,Et=Rt&&Rt.meshOnly===!0||Tt.meshOnlyEnabled===!0,jt={type:"joinSession",roomId:st,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,data:{pubSub:this.pubConnector,meshModeEnabled:Lt,meshOnlyEnabled:Et,videoBandwidthSettings:apiCC.session.apiCCWebRTCClient.webRTCClient.videoBandwidthSettings,browserInfo:{browserAbout:nt.Xh+" "+nt.dc,browserType:at.wL.type,browserVersion:at.wL.version,osName:nt.BF,osVersion:apiCC.osVersion,deviceType:nt.vO}}};if(Tt.hasOwnProperty("transactionId")&&(jt.transactionId=Tt.transactionId),Tt.hasOwnProperty("convId")?jt.data.convId=Tt.convId:Rt&&Rt.hasOwnProperty("convId")&&(jt.data.convId=Rt.convId),Tt.moderationEnabled&&(jt.data.moderationEnabled=!0),Tt.moderator&&(jt.data.moderator=!0),Tt.qualityAdaptationEnabled&&(jt.data.qualityAdaptationEnabled=!0),Array.isArray(Tt.supportedVideoCodecs)){jt.data.supportedVideoCodecs=[];var Pt,Vt=gn(Tt.supportedVideoCodecs);try{for(Vt.s();!(Pt=Vt.n()).done;){var Qt=Pt.value;Qt==="h264"?jt.data.supportedVideoCodecs.push({codec:"h264",profilelevelid:"42e01f"}):typeof Qt=="string"?jt.data.supportedVideoCodecs.push({codec:Qt}):jt.data.supportedVideoCodecs.push(Qt)}}catch(rn){Vt.e(rn)}finally{Vt.f()}}else at.wL.type==="safari"&&(nt.Xh==="Safari"&&nt.dc<12.1||nt.Xh==="Mobile Safari"&&nt.dc<12.1)&&(jt.data.supportedVideoCodecs=[{codec:"h264",profilelevelid:"42e01f"}]);return jt.data.capabilities=this.browserCapabilities,jt},this.createSessionDescriptor=function(st){var Tt={roomId:st.roomName};return st.convId&&(Tt.convId=st.convId),st.roomMode&&(Tt.roomMode=st.roomMode),st.modeChangeKind&&(Tt.modeChangeKind=st.modeChangeKind),Tt},this.joinSession=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.getSessionMCU(st))return fn.warn("joinSession: session already set"),new Error("joinSession: session already set");if(this.getJoinSessionReq(st))return fn.warn("joinSession: session already requested"),new Error("joinSession: session already requested");var Rt={};Rt.roomId=st,Rt.transactionId=apiCC.randomString(12),this.joinSessionReqs.push(Rt);var Lt=Object.assign({},Tt);Lt.transactionId=Rt.transactionId,fn.info("joinSession() on ApiRTC MCU with roomId:",st);var Et=this.createJoinSessionMessage(st,Lt),jt=JSON.stringify(Et);return fn.log("C->S: "+jt),apiCC.session.channel.socket.emit("joinSession",jt),"OK"},this.joinSessionAnswer=function(st){if(fn.debug("joinSessionAnswer()"),this.getSessionMCU(st.roomName))fn.warn("joinSessionAnswer: session already set");else{var Tt=null;if(st.hasOwnProperty("transactionId")&&(Tt=this.getJoinSessionReq(null,{transactionId:st.transactionId})),Tt||(Tt=this.getJoinSessionReq(st.roomName)),Tt){this.removeJoinSessionReq(Tt);var Rt={};if(Rt.roomID=st.sessionId,Rt.roomName=st.roomName,st.hasOwnProperty("convId")&&(Rt.convId=st.convId),Rt.joinSessionAnswer={},(0,at.ki)(st,"data","object")?(st.data.failed===!0?(Rt.joinSessionAnswer.failed=!0,Rt.joinSessionAnswer.reason=st.data.reason):Rt.joinSessionAnswer.failed=!1,st.data.mode&&typeof st.data.mode=="string"&&(Rt.roomMode=st.data.mode,fn.debug("session joined with mode; roomMode: "+Rt.roomMode)),Rt.roomMode==="mesh"&&st.data.meshOnly===!0&&(Rt.meshOnly=!0,fn.debug("meshOnly"))):Rt.joinSessionAnswer.failed=!1,this.sessionMCUs.push(Rt),!Rt.joinSessionAnswer.failed){var Lt=[],Et={};Lt.push(st.roomName),Et.doneByApiRTC=!0,apiCC.session.joinPresenceGroup(Lt,Et),apiCC.session.subscribePresenceGroup(Lt,Et)}Tn.createJoinMCUSessionAnswerEvent(st.sessionId,st.token,st.groupChatId,st.initiator,Rt)}else fn.debug("joinSessionAnswer: no joinSession requested")}},this.changeSessionMode=function(st,Tt){var Rt=this.getSessionMCU(st.roomName);if(Rt)if(Rt.roomMode==="mesh"){for(var Lt=0,Et=qt.userMediaTable.length;--Et>=0;)if(qt.userMediaTable[Et].sessionMCU===Rt){fn.debug("changeSessionMode: userMedia",qt.userMediaTable[Et]),qt.userMediaTable[Et].distantCalls=[],Lt+=1;for(var jt=this.distantCalls.length;--jt>=0;)fn.debug("changeSessionMode: distantCall",this.distantCalls[jt]),this.distantCalls[jt].callMode==="mesh"&&this.distantCalls[jt].callFeed.callId===qt.userMediaTable[Et].userMediaId&&(fn.debug("changeSessionMode: match"),qt.userMediaTable[Et].distantCalls.push(this.distantCalls[jt]))}for(var Pt=0,Vt=qt.callControlTable.length;--Vt>=0;)qt.callControlTable[Vt].type==="subscribe"&&qt.callControlTable[Vt].roomName===Rt.roomName&&(Pt+=1,qt.callControlTable[Vt].autoRestart.force=!0);if(Tn.createMCURoomModeChangedEvent(Rt.roomName,"mesh","sfu","ongoing"),Lt===0&&Pt===0)delete Rt.roomMode,Tn.createMCURoomModeChangedEvent(Rt.roomName,"mesh","sfu","complete");else{Rt.modeChangeKind="old";var Qt={};Qt.roomID=st.roomName,Qt.roomName=st.roomName,st.hasOwnProperty("convId")&&(Qt.convId=st.convId),Qt.joinSessionAnswer={failed:!1},Qt.modeChangeKind="new",Qt.transitionTimeoutId=setTimeout((function(rn,Jt){delete Jt.transitionTimeoutId,qt.finalizeMeshToJanusTransition(rn,Jt,{force:!0})}).bind(this,Rt,Qt),3e4),this.sessionMCUs.push(Qt),this.transitionCount+=1}}else fn.warn("changeSessionMode: session not using mesh mode");else fn.warn("changeSessionMode: no session")},this.updateSessionAnswer=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};fn.debug("updateSessionAnswer");var Rt=this.getSessionMCU(st.roomName);if(!Rt){if(!Tt.createSession)return void fn.warn("updateSessionAnswer: no such session",st.roomName);fn.debug("force session creation; roomName: "+st.roomName),(Rt={}).roomID=st.roomName,Rt.roomName=st.roomName,st.hasOwnProperty("convId")&&(Rt.convId=st.convId),Rt.joinSessionAnswer={failed:!1},this.sessionMCUs.push(Rt);for(var Lt=apiCC.session.apiCCWebRTCClient.webRTCClient.callsTable.length;--Lt>=0;){var Et=apiCC.session.apiCCWebRTCClient.webRTCClient.callsTable[Lt];!Et.data||Et.data.MCUType!=="MCU-Caller"&&Et.data.MCUType!=="MCU-Callee"||Et.data.confId!==Rt.roomName||(Et.sessionMCU=Rt)}}var jt=!1;if(st.data&&st.data.mode==="mesh"?(Rt.roomMode="mesh",st.data.meshOnly===!0&&(Rt.meshOnly=!0)):(Rt.roomMode==="mesh"&&(jt=!0),delete Rt.roomMode),Rt.modeChangeKind==="new"){fn.debug("transition already ongoing");var Pt=this.getSessionMCU(null,{callback:function(hn){return hn.roomName===Rt.roomName&&hn.modeChangeKind==="old"}});Pt&&qt.finalizeMeshToJanusTransition(Pt,Rt,{force:!0})}else if(jt){fn.debug("transition NOT ongoing but should be"),Tn.createMCURoomModeChangedEvent(Rt.roomName,"mesh","sfu","ongoing"),Rt.modeChangeKind="old";var Vt={};Vt.roomID=Rt.roomID,Vt.roomName=Rt.roomName,Rt.hasOwnProperty("convId")&&(Vt.convId=Rt.convId),Vt.joinSessionAnswer={failed:!1},Vt.modeChangeKind="new",this.sessionMCUs.push(Vt),this.transitionCount+=1,qt.finalizeMeshToJanusTransition(Rt,Vt,{force:!0})}if(Tt.updateCalls)if(fn.debug("update stream list (prune)"),this.updateStreamList(st,{prune:!0}),Rt.roomMode==="mesh"){fn.debug("restart publish/shareScreen calls");for(var Qt=qt.userMediaTable.slice(),rn=Qt.length;--rn>=0;){var Jt=Qt[rn];Jt.sessionMCU===Rt&&qt.onHangup(Jt.userMediaId,"disconnected")}}else{fn.debug("roomMode is SFU, checking calls");for(var sn=qt.callsTable.slice(),mn=sn.length;--mn>=0;){var an=sn[mn];an.sessionMCU===Rt&&(an.settingUpType!=="publish"&&an.settingUpType!=="shareScreen"||an.data&&an.data.mesh||an.pc?an.message200OKReceived===!1&&(fn.debug("restart call without 200OK received"),qt.onHangup(an.callId,"disconnected")):(fn.debug("restart publish/shareScreen calls with no PeerConnection"),qt.onHangup(an.callId,"disconnected")))}}},this.processCheckCallStatus=function(st){this.updateStreamList(st)},this.updateStreamList=function(st){for(var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rt=(0,at.ki)(st,"availableStreams","array")?st.availableStreams.slice():null,Lt=(0,at.ki)(st,"availableComposite","array")?st.availableComposite.slice():null,Et=(0,at.ki)(st,"availableReplay","array")?st.availableReplay.slice():null,jt=this.streamList.length;--jt>=0;){var Pt=this.streamList[jt];if(Pt.type==="regular"){if(!Rt)continue;for(var Vt=Rt.length;--Vt>=0&&Rt[Vt].id!==Pt.streamInfo.id;);if(Vt>=0){(0,at.ki)(Pt,"clearDisputableEntry","function")&&Pt.clearDisputableEntry(),Rt.splice(Vt,1);continue}Tt.prune===!0?((0,at.ki)(Pt,"clearDisputableEntry","function")&&Pt.clearDisputableEntry(),apiCC.session.apiCCWebRTCClient.webRTCClient.destroyCallControl({type:"subscribe",stream:Pt.streamInfo}),Tn.createMCURemovedStreamEvent(Pt.streamInfo.id),this.streamList.splice(jt,1)):Pt.disputableTimeoutId||(Pt.disputableTimeoutId=setTimeout(Pn.bind(this,Pt.streamInfo.id),_n),Pt.clearDisputableEntry=In.bind(this,Pt.streamInfo.id),this.disputableStreamList.push(Pt))}else if(Pt.type==="composite"){if(!Lt)continue;for(var Qt=Lt.length;--Qt>=0&&Lt[Qt].id!==Pt.streamInfo.id;);if(Qt>=0){Lt.splice(Qt,1);continue}apiCC.session.apiCCWebRTCClient.webRTCClient.destroyCallControl({type:"subscribe",stream:Pt.streamInfo}),Tn.createMCURemovedStreamEvent(Pt.streamInfo.id),this.streamList.splice(jt,1)}else if(Pt.type==="replay"){if(!Et)continue;for(var rn=Et.length;--rn>=0&&Et[rn].id!==Pt.streamInfo.id;);rn>=0&&Et.splice(rn,1)}}if(Rt)for(var Jt=0;Jt2&&arguments[2]!==void 0?arguments[2]:{},Lt=this.streamList.length,Et=!1;for((0,at.ki)(Rt,"replay","boolean")&&Rt.replay===!0&&(Et=!0);--Lt>=0;){if(Et===!0){if(this.streamList[Lt].type!=="replay")continue}else if(this.streamList[Lt].type==="replay")continue;if(this.streamList[Lt].userId===st&&this.streamList[Lt].streamInfo.attributes.callId===Tt)return this.streamList[Lt].streamInfo}return null},this.newAvailableStream=function(st,Tt,Rt){fn.debug("newAvailableStream():",st);var Lt=!1,Et=!1,jt=this.getSessionMCU(st[0].room);if(jt){st[0].attributes.callerId!==kt&&(Lt=!0);for(var Pt=qt.getCallControls(["publish","shareScreen"],{addUserMedia:!0}),Vt=0;Vt=0&&(this.streamList[Qt].type!=="regular"||st[Vt].id!==this.streamList[Qt].streamInfo.id););Qt>=0?(Et=!0,(0,at.ki)(this.streamList[Qt],"clearDisputableEntry","function")?this.streamList[Qt].clearDisputableEntry():fn.debug("clearDisputableEntry is not set")):fn.debug("streamList is empty"),Lt=!Object.prototype.hasOwnProperty.call(Pt,st[Vt].attributes.callId);var rn={type:Tt,userId:st[Vt].attributes.callerId,roomId:jt.roomName,isRemoteStream:Lt,streamInfo:st[Vt]};if(Et===!0?this.streamList[Qt]=rn:this.streamList.push(rn),fn.log("this.streamList :",this.streamList),Lt!==!0)if(jt.roomMode==="mesh"){var Jt=qt.findUserMediaById(st[Vt].attributes.callId);Jt&&Jt.addAck===!0&&(delete Jt.addAck,clearTimeout(Jt.addTimeoutId),delete Jt.addTimeoutId,Tn.createCallEstablishedEvent(jt.roomName,Jt.callType,Jt.userMediaId,"none"))}else{var sn=qt.findCallWithCallId(st[Vt].attributes.callId),mn=apiCC.getUserMediaStream(sn.callConfiguration.userMediaStreamId);if(sn&&mn)for(var an=0,hn=["audioMuted","videoMuted"];an=0;)if(this.streamList[jt].streamInfo.id===st[Et].id){for(var Pt=[],Vt=0,Qt=["audio","audioMuted","video","videoMuted"];Vt0&&(0,at.Ym)(Rt,"function")&&Rt(Lt,st[Et],Tt,Pt);break}return Lt}fn.log("updateAvailableStream() but client is not in session")},this.newAvailableReplay=function(st){fn.info("newAvailableReplay() :",st);var Tt=!1,Rt=this.getSessionMCU(st[0].room);if(Rt){st[0].attributes.callerId!==kt&&(Tt=!0);for(var Lt=0;Lt4&&arguments[4]!==void 0?arguments[4]:{};fn.info("subscribeToStreams():",st);var jt,Pt,Vt=[],Qt=null,rn=null,Jt=null,sn=function(an){return setTimeout(function(){fn.warn("invite + SDP offer not received -> restart call"),qt.onHangup(an,"disconnected")},15e3)};for(Jt in st){if(jt=st[Jt],apiCC.session===null||apiCC.session===void 0)return fn.debug("no session, leaving subscribeToStreams()"),Vt;if((Qt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithStreamId(jt.id,{ignoreModeChangeKindOld:!0}))!==null){if(fn.debug("call already exists"),Et.force!==!0){Vt[Jt]=Qt.callId;continue}fn.debug("Force is true")}else fn.debug("call does not exist");for(Pt=this.streamList.length;--Pt>=0&&this.streamList[Pt].streamInfo.id!==jt.id;);if(Pt>=0){if(fn.debug("stream exists"),this.streamList[Pt].disputableTimeoutId){fn.debug("stream temporarily not available"),Vt[Jt]=null,Et.autoSub===!0&&((rn=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallControl({type:"subscribe",stream:jt}))||apiCC.session.apiCCWebRTCClient.webRTCClient.createCallControl({type:"subscribe",roomName:jt.room,mediaType:Tt,callConfiguration:Lt,data:Rt,stream:jt}));continue}}else if(fn.debug("stream does not exist"),Et.noStreamCheck!==!0){Vt[Jt]=null,Tn.createErrorEvent("stream not available","STREAM_NOT_AVAILABLE",null,jt.room,null,{stream:jt});continue}fn.info("stream:",jt);var mn=this.getSessionMCU(jt.room);mn&&((rn=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallControl({type:"subscribe",stream:jt}))||(rn=apiCC.session.apiCCWebRTCClient.webRTCClient.createCallControl({type:"subscribe",roomName:mn.roomName,mediaType:Tt,callConfiguration:Lt,data:Rt,stream:jt})),jt.attributes.callType!=="COMPOSITE"&&this.pubConnector==="janusConnector"?(Rt===void 0&&(Rt={}),Rt.mesh&&delete Rt.mesh,(0,at.Ym)(Lt,"qos","object")?(Rt.qos={},Lt.qos.videoForbidInactive===!1?Rt.qos.videoForbidInactive=!1:Rt.qos.videoForbidInactive=!0):(Rt.qos={},Rt.qos.videoForbidInactive=!0),(0,at.Ym)(Lt,"simulcast","object")&&(Rt.simulcast={},Lt.simulcast.streamQuality&&(Lt.simulcast.streamQuality==="high"?Rt.simulcast.substream=2:Lt.simulcast.streamQuality==="medium"?Rt.simulcast.substream=1:Lt.simulcast.streamQuality==="low"&&(Rt.simulcast.substream=0)),Lt.simulcast.streamFrameRate&&(Lt.simulcast.streamFrameRate==="high"?Rt.simulcast.temporal=2:Lt.simulcast.streamFrameRate==="medium"?Rt.simulcast.temporal=1:Lt.simulcast.streamFrameRate==="low"&&(Rt.simulcast.temporal=0))),(Qt=new vn(apiCC.session.apiCCWebRTCClient.webRTCClient)).instanceId=apiCC.generateInstanceId(),Qt.callControl=rn,(0,at.ki)(Qt.callControl.autoRestart,"counter","number")?(Qt.callControl.autoRestart.counter+=1,Qt.restarted=!0):Qt.callControl.autoRestart.counter=0,Qt.settingUpType="subscribe",Lt!=null&&Lt.turnServerAddress!==void 0&&Lt.turnServerAddress!==null&&Qt.setCallTurnServer(Lt.turnServerAddress),Qt.generateCallId(),rn.callId=Qt.callId,Qt.setupTimeoutId=sn(Qt.callId),Qt.callerId=mn.roomName,Qt.calleeId=apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,Qt.callee=!0,Qt.mcuRemoteStream=jt,Qt.dest_roomId=mn.roomName,Qt.callType=jt.attributes.callType,Qt.callControl.callType=jt.attributes.callType,jt.attributes.callType!=="audio"&&Tt!=="AUDIOONLY"||(Qt.audioOnly=!0,Qt.callControl.audioOnly=!0),Qt.remoteId=jt.attributes.callerId,Qt.remoteMailAddress=jt.attributes.mailAddress,Qt.streamId=jt.id,Qt.mediaType=Tt,Qt.sessionMCU=mn,fn.log("call.streamId: "+Qt.streamId),(0,at.Ym)(Rt,"object")?Qt.data=(0,at.ws)({},Rt):Qt.data={},Qt.data.pubSub="janusConnector",Qt.data.type="subscribe",Qt.data.mode="passive",Qt.data.mediaType=Tt,Qt.data.capabilities=this.browserCapabilities,Qt.data.cloudConvId=mn.convId,Qt.data.instanceId=Qt.instanceId,apiCC.session.apiCCWebRTCClient.webRTCClient.callsTable.push(Qt),Vt[Jt]=Qt.callId,Qt.myWebRTC_Stack.sendInvite(Qt.callId,apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,mn.roomName,mn.roomName,jt.attributes.callType,{mode:"passive",data:Qt.data,stream:jt,volatile:!!Qt.restarted})):((Qt=new vn(apiCC.session.apiCCWebRTCClient.webRTCClient)).instanceId=apiCC.generateInstanceId(),Qt.callControl=rn,(0,at.ki)(Qt.callControl.autoRestart,"counter","number")?(Qt.callControl.autoRestart.counter+=1,Qt.restarted=!0):Qt.callControl.autoRestart.counter=0,Qt.settingUpType="subscribe",Lt!=null&&Lt.turnServerAddress!==void 0&&Lt.turnServerAddress!==null&&Qt.setCallTurnServer(Lt.turnServerAddress),Rt===void 0&&(Rt={}),Qt.data=Rt,Qt.data.pubSub=this.pubConnector,Qt.data.type="subscribe",Qt.data.capabilities=this.browserCapabilities,Qt.data.cloudConvId=mn.convId,Qt.data.instanceId=Qt.instanceId,fn.log("mediaType: ",Tt),fn.log("stream.attributes.callType: ",jt.attributes.callType),Qt.callType=jt.attributes.callType,Qt.callControl.callType=jt.attributes.callType,jt.attributes.callType==="COMPOSITE"&&this.pubConnector==="janusConnector"||jt.attributes.callType==="audio"||Tt==="AUDIOONLY"?(fn.log("Setting call as audioOnly"),Qt.audioOnly=!0,Qt.callControl.audioOnly=!0,Qt.stripVideoSDPActivated=!0):Tt==="VIDEOONLY"&&(Qt.stripAudioSDPActivated=!0,Qt.callType="videoOnly",Qt.callControl.callType="videoOnly"),Qt.mcuRemoteStream=jt,Qt.dest_roomId=mn.roomName,Qt.calleeId=mn.roomName,Qt.generateCallId(),rn.callId=Qt.callId,Qt.callerId=apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,Qt.sessionMCU=mn,apiCC.session.apiCCWebRTCClient.webRTCClient.callsTable.push(Qt),Qt.createPeerConnection(),Qt.doCall(),Qt.started=!0,Qt.callType=jt.attributes.callType,Qt.remoteId=jt.attributes.callerId,Qt.remoteMailAddress=jt.attributes.mailAddress,jt.audio===!0?jt.video===!0?Qt.destCallType="media":Qt.destCallType="audio":jt.video===!0&&(Qt.destCallType="videoOnly"),jt.id===void 0&&fn.log("stream.id is undefined :",jt),Qt.streamId=jt.id,Qt.mediaType=Tt,fn.log("stream.attributes.callType: ",jt.attributes.callType),Vt[Jt]=Qt.callId),Qt.asyncCallbacks={},Qt.asyncCallbacks.type="subscribe")}return Vt},this.unsubscribe=function(st){fn.info("unsubscribe() :",st);var Tt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithStreamId(st);Tt===null?fn.log("error call not found on unsubscribe"):Tt.callId!==void 0&&apiCC.session.apiCCWebRTCClient.webRTCClient.onHangup(Tt.callId)},this.publish=function(st,Tt,Rt,Lt,Et,jt){fn.info("publish roomName :",st),fn.log("publish sessionId :",Tt),fn.log("publish token :",Rt),fn.log("publish callConfiguration :",Lt);var Pt=null,Vt=!1,Qt=!1,rn=null,Jt=null,sn=this.getSessionMCU(st);if(!sn)return fn.error("roomName does not match any sessionMCU"),null;if(Et!==null&&cn(Et)==="object"||(Et={}),this.pubConnector==="janusConnector"&&!Et.mesh&&jt&&jt.callControl&&jt.callControl.callId&&apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(jt.callControl.callId))return fn.debug("call already exists",jt.callControl.callId),jt.callControl.callId;if(Lt===!0||Lt==="true"?(fn.log("DEPRECATED ... please use callConfiguration JSON parameter : callConfiguration.audioOnly instead of audioOnly"),Vt=!0,Lt={}):Lt===!1||Lt==="false"?(fn.log("DEPRECATED ... please use callConfiguration JSON parameter : callConfiguration.audioOnly instead of audioOnly"),Lt={}):Lt!==null&&cn(Lt)==="object"||(Lt={}),Lt.audioOnly===!0&&Lt.videoOnly===!0)return Tn.createErrorEvent("Cannot publish without audio nor video","PUBLISH_FAILURE",null,st),null;if(Lt.audioOnly===!0&&(Vt=!0),Lt.videoOnly===!0&&(Qt=!0),["audioOnly","videoOnly","record","private"].forEach(function(an){Lt.hasOwnProperty(an)&&((0,at.ki)(Et,"callConfiguration","object")||(Et.callConfiguration={}),Et.callConfiguration[an]=Lt[an])}),sn.convId&&(Et.cloudConvId=sn.convId),(0,at.Ym)(Lt,"qos","object")?(Et.qos={},Lt.qos.videoMinBitrate?Et.qos.videoMinBitrate=Lt.qos.videoMinBitrate:Lt.qos.videoMinQuality&&["excellent","good","medium","bad"].indexOf(Lt.qos.videoMinQuality)>=0?Et.qos.videoMinQuality=Lt.qos.videoMinQuality:Et.qos.videoMinQuality="bad",Lt.qos.videoStartBitrate?Et.qos.videoStartBitrate=Lt.qos.videoStartBitrate:Lt.qos.videoStartQuality&&["upper","excellent","good","medium","bad"].indexOf(Lt.qos.videoStartQuality)>=0&&(Et.qos.videoStartQuality=Lt.qos.videoStartQuality),Lt.qos.videoForbidInactive===!1?Et.qos.videoForbidInactive=!1:Et.qos.videoForbidInactive=!0):Et.qos={videoMinQuality:"bad",videoForbidInactive:!0},Lt.simulcast&&(Lt.userMediaStreamId&&(Jt=apiCC.getUserMediaStream(Lt.userMediaStreamId))&&Jt.isSimulcastCompliant()||delete Lt.simulcast),function(an){if(!(0,at.ki)(an,"simulcast","object")||at.wL.type==="safari"&&an.simulcast.mode!=="SDP")return delete an.simulcast,!1;delete an.simulcast.sendEncodings,(0,at.ki)(an.simulcast,"maxBitrate","number")?at.wL.type==="chrome"&&at.wL.version>=78&&an.simulcast.mode!=="SDP"?(fn.debug("configure simulcast RID chrome maxBitrate"),!Ln(an.simulcast,an.simulcast.maxBitrate)&&(fn.warn("cannot configure simulcast"),delete an.simulcast)):at.wL.type==="firefox"?(fn.debug("configure simulcast RID firefox maxBitrate"),!Ln(an.simulcast,an.simulcast.maxBitrate)&&(fn.warn("cannot configure simulcast"),delete an.simulcast)):delete an.simulcast.encodings:(0,at.ki)(an.simulcast,"encodings","object")?at.wL.type==="chrome"&&at.wL.version>=78&&an.simulcast.mode!=="SDP"?(fn.debug("configure simulcast RID chrome encodings"),!On(an.simulcast)&&(fn.warn("cannot configure simulcast"),delete an.simulcast)):at.wL.type==="firefox"?(fn.debug("configure simulcast RID firefox encodings"),!On(an.simulcast)&&(fn.warn("cannot configure simulcast"),delete an.simulcast)):delete an.simulcast.encodings:at.wL.type==="chrome"&&at.wL.version>=78&&an.simulcast.mode!=="SDP"?(fn.debug("configure simulcast RID chrome default"),an.simulcast.encodings={high:{maxBitrate:900},medium:{maxBitrate:300,scaleResolutionDownBy:2},low:{maxBitrate:100,scaleResolutionDownBy:4}},!On(an.simulcast)&&delete an.simulcast):at.wL.type==="firefox"&&(fn.debug("configure simulcast RID firefox default"),an.simulcast.encodings={high:{maxBitrate:900},medium:{maxBitrate:300,scaleResolutionDownBy:2},low:{maxBitrate:100,scaleResolutionDownBy:4}},!On(an.simulcast))&&delete an.simulcast}(Lt),Lt.distributedBroadcastEnabled&&!Lt.simulcast&&(Et.distributedBroadcastEnabled=!0),["audioLabels","videoLabels"].forEach(function(an){(0,at.Ym)(Lt[an],"array")&&(Et[an]=[],Lt[an].forEach(function(hn){(0,at.Ym)(hn,"string")&&Et[an].push(hn)}))}),(0,at.Ym)(Lt,"context","object"))try{JSON.stringify(Lt.context),Et.context=Lt.context}catch{}if((0,at.Ym)(Lt,"profileType","string")&&(Et.profileType=Lt.profileType),(0,at.Ym)(Lt,"priority","number")&&Lt.priority>=0&&(Et.priority=Lt.priority),(0,at.Ym)(Lt,"downgradeProfileList","array")&&(Et.downgradeProfileList=Lt.downgradeProfileList),fn.debug("callConfiguration; audioOnly: "+Vt+", videoOnly: "+Qt),jt&&jt.forceScreenSharingCallType===!0)fn.debug("publish screenSharing");else if(apiCC.mediaDeviceMgr.videoDevicePresent===!1){if(apiCC.mediaDeviceMgr.audioDevicePresent===!1)return fn.debug("publish without any device, leaving publish ..."),Et.publishWithoutMediaDeviceDetected=!0,apiCC.session.setUserData(Et),Tn.createErrorEvent("Cannot publish without audio nor video","PUBLISH_FAILURE",null,st),null;Vt!==!0&&(fn.debug("publish video, but no webcam present, forcing callType to audio"),Vt=!0)}else apiCC.mediaDeviceMgr.audioDevicePresent===!1&&Qt!==!0&&(fn.debug("publish video, but no microphone present, forcing callType to videoOnly"),Qt=!0);if(Pt=new vn(apiCC.session.apiCCWebRTCClient.webRTCClient),Et.mesh!==void 0&&Et.instanceId!==void 0?(fn.debug("keeping instanceId "),Pt.instanceId=Et.instanceId):Pt.instanceId=apiCC.generateInstanceId(),this.pubConnector!=="janusConnector"||Et.mesh?(Pt.settingUpType="publish",Pt.generateCallId()):(Pt.settingUpType="publish",jt&&jt.callControl?(Pt.callControl=jt.callControl,Pt.callControl.autoRestart.counter+=1,Pt.callId=Pt.callControl.callId,Pt.restarted=!0):(Pt.callControl=apiCC.session.apiCCWebRTCClient.webRTCClient.createCallControl({type:"publish",roomName:st,callConfiguration:Lt,data:Et}),Pt.callControl.sessionId=Tt,Pt.callControl.token=Rt,Pt.callControl.autoRestart.counter=0,Pt.generateCallId(),Pt.callControl.callId=Pt.callId)),Lt!=null&&Lt.turnServerAddress!==void 0&&Lt.turnServerAddress!==null&&Pt.setCallTurnServer(Lt.turnServerAddress),Lt.userMediaStreamId&&((Jt=apiCC.getUserMediaStream(Lt.userMediaStreamId))?(Pt.callType=Jt.callType,fn.debug("Setting callType to "+Pt.callType),Pt.callType==="screenSharing"&&(Pt.screenSharing=!0)):(fn.debug("callConfiguration.userMediaStreamId is setted but stream is not present"),delete Lt.userMediaStreamId)),Pt.data=Et,Pt.data.instanceId=Pt.instanceId,Tt==="restarted"&&(Pt.restarted=!0),Pt.mediaTypeForIncomingCall="NONE",Vt===!0?(fn.log("Setting call as audioOnly"),Pt.audioOnly=!0,Pt.callType="audio",Pt.mediaTypeForOutgoingCall="AUDIO"):Qt===!0?(fn.log("Setting call as videoOnly"),Pt.callType="videoOnly",Pt.mediaTypeForOutgoingCall="VIDEOONLY"):fn.log("Not Setting call as audioOnly nor videoOnly"),Pt.dest_roomId=sn.roomName,Pt.calleeId=sn.roomName,Pt.data.pubSub=this.pubConnector,Pt.data.type="publish",Pt.data.capabilities=this.browserCapabilities,Pt.data.cloudConvId=sn.convId,Pt.callConfiguration=Lt,Pt.sessionMCU=sn,Pt.setMediaConstraintsToSendOnlyOffer(),Pt.callerId=apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,(0,at.Ym)(Lt,"simulcast","object")){var mn=null;Jt&&(mn=Jt.getSimulcastProfile()),at.wL.type==="chrome"&&at.wL.version>=78&&Lt.simulcast.mode!=="SDP"?(fn.debug("simulcast chrome 78+ -> RID",Lt.simulcast),Pt.simulcast="RID",Pt.data.simulcast={enabled:!0,mode:"RID"},Pt.data.simulcast.encodings=Object.assign({},Lt.simulcast.encodings),mn&&(Pt.data.simulcast.profile=mn)):at.wL.type==="chrome"?(fn.debug("simulcast chrome -> SDP",Lt.simulcast),Pt.simulcast="SDP",Pt.data.simulcast={enabled:!0,mode:"SDP"}):at.wL.type==="firefox"?(fn.debug("simulcast firefox -> RID",Lt.simulcast),Pt.simulcast="RID",Pt.data.simulcast={enabled:!0,mode:"RID"},Pt.data.simulcast.encodings=Object.assign({},Lt.simulcast.encodings),mn&&(Pt.data.simulcast.profile=mn)):at.wL.type==="safari"&&(fn.debug("simulcast safari -> SDP",Lt.simulcast),Pt.simulcast="SDP",Pt.data.simulcast={enabled:!0,mode:"SDP"})}return fn.log("webRTCClient.accessToLocalMedia :",qt.accessToLocalMedia),apiCC.session.apiCCWebRTCClient.webRTCClient.callsTable.push(Pt),this.publishCallId=Pt.callId,Pt.callControl&&Pt.callControl.autoRestart.stream&&fn.debug("call.callControl.autoRestart.stream.active :",Pt.callControl.autoRestart.stream.active),this.pubConnector==="janusConnector"&&Pt.callControl&&Pt.callControl.autoRestart.stream&&Pt.callControl.autoRestart.stream.active?(apiCC.session.apiCCWebRTCClient.webRTCClient.accessToLocalMedia=!0,Pt.callLocalStream=Pt.callControl.autoRestart.stream,Pt.establishCall(),Pt.callId):(Et.mesh!==void 0&&(rn=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(Et.mesh.calleeCallId))!==null&&rn.callConfiguration&&rn.callConfiguration.userMediaStreamId&&(Pt.callType=rn.callType,Lt.userMediaStreamId=rn.callConfiguration.userMediaStreamId),Lt.userMediaStreamId?((Jt=apiCC.getUserMediaStream(Lt.userMediaStreamId)).addCallInfo(Pt.callId),apiCC.session.apiCCWebRTCClient.webRTCClient.accessToLocalMedia=!0,this.pubConnector==="janusConnector"&&Pt.callControl&&(Pt.callControl.autoRestart.stream=Jt.stream),Pt.callConfiguration.userMediaStreamId=Jt.userMediaStreamId,Pt.callLocalStream=Jt.stream,Pt.establishCall(),Pt.callId):apiCC.userMediaStreamTable.length>0?((Jt=apiCC.userMediaStreamTable[0]).addCallInfo(Pt.callId),apiCC.session.apiCCWebRTCClient.webRTCClient.accessToLocalMedia=!0,this.pubConnector==="janusConnector"&&Pt.callControl&&(Pt.callControl.autoRestart.stream=Jt.stream),Pt.callConfiguration.userMediaStreamId=Jt.userMediaStreamId,Pt.callLocalStream=Jt.stream,Pt.establishCall(),Pt.callId):(apiCC.createUserMediaStream({callId:Pt.callId,type:Pt.callType,audioSourceId:qt.audioSourceId,videoSourceId:qt.videoSourceId,success:function(an){fn.debug("[publish] success; userMediaStreamId: "+an.userMediaStreamId),apiCC.session.apiCCWebRTCClient.webRTCClient.accessToLocalMedia=!0,apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.pubConnector==="janusConnector"&&Pt.callControl&&(Pt.callControl.autoRestart.stream=an.stream),Pt.callConfiguration.userMediaStreamId=an.userMediaStreamId,Pt.callLocalStream=an.stream,Pt.establishCall()}}),Pt.callId))},this.publishScreen=function(st,Tt,Rt,Lt){fn.info("publishScreen()");var Et=this.getSessionMCU(st);return Et?(Tt==null&&(Tt={}),Rt==null&&(Rt={}),Rt.record!==void 0&&(Tt.callConfiguration!==void 0||(Tt.callConfiguration={}),Tt.callConfiguration.record=Rt.record),Rt.private!==void 0&&(Tt.callConfiguration!==void 0||(Tt.callConfiguration={}),Tt.callConfiguration.private=Rt.private),Tt.pubSub=this.pubConnector,Tt.type="publish",apiCC.session.apiCCWebRTCClient.webRTCClient.shareScreen(Et.roomName,Tt,Lt,Rt)):(fn.error("roomId does not match any sessionMCU"),null)},this.unpublish=function(st){fn.info("unpublish call with callId :",st),apiCC.session.apiCCWebRTCClient.webRTCClient.onHangup(st),this.publishCallId=null},this.removeMCUStream=function(st,Tt,Rt){var Lt,Et=!1;for(Rt!=="Broken_by_MCU"&&Rt!=="disconnected"||(Et=!0),fn.debug("streamId:",Tt),fn.debug("reason:",Rt),fn.debug("quiet:",Et),Lt=0;Lt0,Vt=Tt!=null&&Tt.length>0,Qt={};if(!Pt&&!Vt||Rt==null||Rt.length===0)return!1;if(Lt===void 0){if(this.publishCallId===null)return fn.log("Cannot start streaming as no stream is published"),!1;Lt=this.publishCallId}var rn=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(Lt);return rn||(rn=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(Lt))?rn.sessionMCU?(Pt||(st="custom"),Qt.pubSub=this.pubConnector,Qt.service=st,Vt&&(Qt.server=Tt),Qt.streamKey=Rt,fn.log("startStreaming() on ApiRTC MCU with roomId:",rn.sessionMCU.roomName),Et={type:"startStreaming",roomId:rn.sessionMCU.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Lt,data:Qt},jt=JSON.stringify(Et),fn.log("C->S: "+jt),apiCC.session.channel.socket.emit("startStreaming",jt),!0):(fn.error("no such sessionMCU"),!1):(fn.error("callIdToStream does not match any call"),!1)},this.stopStreaming=function(st){var Tt,Rt;if(fn.info("stopStreaming"),st===void 0){if(this.publishCallId===null)return fn.log("Cannot stop streaming as no stream is published"),!1;st=this.publishCallId}var Lt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(st);if(!Lt)return fn.error("callIdToStream does not match any call"),!1;var Et=this.getSessionMCU(Lt.dest_roomId);return Et?(fn.log("stopStreaming() on ApiRTC MCU with roomId:",Et.roomName),Tt={type:"stopStreaming",roomId:Et.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:st,data:{pubSub:this.pubConnector}},Rt=JSON.stringify(Tt),fn.log("C->S: "+Rt),apiCC.session.channel.socket.emit("stopStreaming",Rt),!0):(fn.error("dest_roomId does not match any sessionMCU"),!1)},this.startRecording=function(st,Tt,Rt,Lt,Et){var jt,Pt;if(fn.info("startRecording"),Lt==null){if(this.publishCallId===null)return void fn.log("Call recording can not start as stream is not published");Lt=this.publishCallId}var Vt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(Lt);return Vt||(Vt=apiCC.session.apiCCWebRTCClient.webRTCClient.findUserMediaById(Lt))?Vt.sessionMCU?(st!=="AUDIO-ONLY"&&st!=="VIDEO-ONLY"&&(st="AUDIO-VIDEO"),Et==null&&(Et={}),Et.pubSub=this.pubConnector,fn.log("startRecording() on ApiRTC MCU with roomId :",Vt.sessionMCU.roomName),jt={type:"startRecording",roomId:Vt.sessionMCU.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:Lt,data:Et,customIdInFilename:Tt,mediaType:st,convId:Rt},Pt=JSON.stringify(jt),fn.log("C->S: "+Pt),void apiCC.session.channel.socket.emit("startRecording",Pt)):(fn.error("no such sessionMCU"),!1):(fn.error("callIdToRecord does not match any call"),!1)},this.stopRecording=function(st){var Tt,Rt;if(fn.info("stopRecording"),st===void 0){if(this.publishCallId===null)return void fn.log("Call recording can not stop as stream is not published");st=this.publishCallId}var Lt=apiCC.session.apiCCWebRTCClient.webRTCClient.findCallWithCallId(st);if(!Lt)return fn.error("callIdToRecord does not match any call"),!1;var Et=this.getSessionMCU(Lt.dest_roomId);if(!Et)return fn.error("dest_roomId does not match any sessionMCU"),!1;fn.log("stopRecording() on ApiRTC MCU with roomId :",Et.roomName),Tt={type:"stopRecording",roomId:Et.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:st,data:{pubSub:this.pubConnector}},Rt=JSON.stringify(Tt),fn.log("C->S: "+Rt),apiCC.session.channel.socket.emit("stopRecording",Rt)},this.recordingStarted=function(st){fn.info("recordingStarted:",st),Tn.createMCURecordingStartedEvent(st.roomName,st.callId,st.clientId,st.recordType,st.time,st.convId,st.mediaId,st.mediaURL,st.remoteId,st.recordedFileName,st.mediaType,st.descriptor)},this.recordingStopped=function(st){fn.info("recordingStopped:",st),Tn.createMCURecordingStoppedEvent(st.roomName,st.callId,st.clientId,st.recordType,st.time,st.convId,st.mediaId,st.mediaURL,st.remoteId,st.recordedFileName,st.mediaType,st.descriptor)},this.recordingStreamAvailable=function(st){fn.info("recordingStreamAvailable :",st),Tn.createMCURecordedStreamsAvailableEvent(st.roomName,st.callId,st.clientId,st.recordedFileName,st.convId,st.mediaId,st.mediaURL,st.recordType,st.remoteId,st.mediaType,st.descriptor),this.pubConnector==="janusConnector"&&st.hasOwnProperty("confId")&&st.hasOwnProperty("remoteId")&&Tn.createRecordedStreamsAvailableEvent(st.confId,st.clientId,st.remoteId,st.callId,st.convId,st.mediaId,st.mediaURL)},this.streamingStarted=function(st){fn.info("streamingStarted: ",st),Tn.createMCUStreamingStartedEvent(st.roomName,st.callId,st.clientId,st.time)},this.streamingStopped=function(st){fn.info("streamingStopped: ",st),Tn.createMCUStreamingStoppedEvent(st.roomName,st.callId,st.clientId,st.time)},this.startComposite=function(st){var Tt,Rt,Lt;(Lt=st?this.getSessionMCU(st):this.getSessionMCU(null,{first:!0}))?(fn.log("startComposite() on ApiRTC MCU with roomId :",Lt.roomName),Tt={type:"startComposite",roomId:Lt.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,data:{pubSub:this.pubConnector}},Rt=JSON.stringify(Tt),fn.log("C->S: "+Rt),apiCC.session.channel.socket.emit("startComposite",Rt)):fn.log("startComposite() but client is not in session")},this.stopComposite=function(st){var Tt,Rt,Lt;(Lt=st?this.getSessionMCU(st):this.getSessionMCU(null,{first:!0}))?(fn.log("stopComposite() on ApiRTC MCU with roomId :",Lt.roomName),Tt={type:"stopComposite",roomId:Lt.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,data:{pubSub:this.pubConnector}},Rt=JSON.stringify(Tt),fn.log("C->S: "+Rt),apiCC.session.channel.socket.emit("stopComposite",Rt)):fn.log("stopComposite() but client is not in session")},this.startCompositeRecording=function(st,Tt,Rt,Lt,Et){fn.info("startCompositeRecording with convId :",Rt);var jt,Pt,Vt;(Vt=Et?this.getSessionMCU(Et):this.getSessionMCU(null,{first:!0}))?(st!=="AUDIO-ONLY"&&st!=="VIDEO-ONLY"&&(st="AUDIO-VIDEO"),(Lt=(0,at.Ym)(Lt,"object")?(0,at.ws)({},Lt):{}).pubSub=this.pubConnector,["complete","efficient","audioOnly"].indexOf(Lt.mode)<0&&(Lt.mode="complete"),Lt.labelEnabled=Lt.labelEnabled===!0,(0,at.Ym)(Lt,"labels","array")||(Lt.labels=["microphone","camera","screenSharing","sip"]),fn.log("startRecording() on ApiRTC MCU with roomId :",Vt.roomName),jt={type:"startRecording",roomId:Vt.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:"COMPOSITE",data:Lt,customIdInFilename:Tt,mediaType:st,convId:Rt},Pt=JSON.stringify(jt),fn.log("C->S: "+Pt),apiCC.session.channel.socket.emit("startRecording",Pt)):fn.log("startCompositeRecording() but client is not in session")},this.stopCompositeRecording=function(st){fn.info("stopCompositeRecording");var Tt,Rt,Lt;(Lt=st?this.getSessionMCU(st):this.getSessionMCU(null,{first:!0}))?(fn.log("stopRecording() on ApiRTC MCU with roomId :",Lt.roomName),Tt={type:"stopRecording",roomId:Lt.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,callId:"COMPOSITE",data:{pubSub:this.pubConnector}},Rt=JSON.stringify(Tt),fn.log("C->S: "+Rt),apiCC.session.channel.socket.emit("stopRecording",Rt)):fn.log("stopCompositeRecording() but client is not in session")},this.inviteVoIP=function(st,Tt,Rt){var Lt=this;return new Promise(function(Et,jt){if(!st||typeof st!="string")return jt(new Error("wrong roomId"));if(!Lt.getSessionMCU(st))return jt(new Error("no such session"));if(!Tt||typeof Tt!="string")return jt(new Error("wrong convId"));if(!Rt||typeof Rt!="string")return jt(new Error("wrong phoneNumber"));var Pt="inviteVoIP-"+Rt;try{if(qt.hasReceiptHook(Pt))return jt(new Error("busy"));var Vt=new Nt;Vt.onSuccess(function(){return Et()}),Vt.onFailure(function(Jt){return jt(Jt)}),Vt.setTimeout(1e4,"timeout"),qt.createReceiptHook(Pt,Vt)}catch(Jt){return fn.debug("inviteVoIP: createReceiptHook",Jt),jt(new Error("internal error"))}var Qt={type:"inviteVoIP",clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,roomId:st,convId:Tt,phoneNumber:Rt,receiptId:Pt,data:{pubSub:"sipConnector"}},rn=JSON.stringify(Qt);fn.debug("C->S:",rn),apiCC.session.channel.socket.emit("inviteVoIP",rn)})},this.enforceMCU=function(st){var Tt;if(Tt=st?this.getSessionMCU(st):this.getSessionMCU(null,{first:!0})){var Rt={type:"info",infoType:"enforceMCU",data:{clientId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,roomId:Tt.roomName,pubSub:this.pubConnector}},Lt=JSON.stringify(Rt);fn.log("C->S: "+Lt),apiCC.session.channel.socket.emit("info",Lt)}else fn.log("enforceMCU() but client is not in session")},this.meshPublish=function(st,Tt,Rt,Lt,Et,jt){var Pt=!1,Vt=null,Qt=null,rn=this.getSessionMCU(st);if(!rn)return fn.error("meshPublish() - missing sessionMCU"),null;if(Lt===!0||Lt===!1||Lt==="true"||Lt==="false"?(fn.log("DEPRECATED ... please use callConfiguration JSON parameter : callConfiguration.audioOnly instead of audioOnly"),Pt=Lt,Lt={}):Lt!==null&&cn(Lt)==="object"||(Lt={}),Et!==null&&cn(Et)==="object"||(Et={}),(0,at.Ym)(Lt,"profileType","string")&&(Et.profileType=Lt.profileType),(0,at.Ym)(Lt,"priority","number")&&Lt.priority>=0&&(Et.priority=Lt.priority),(0,at.Ym)(Lt,"downgradeProfileList","array")&&(Et.downgradeProfileList=Lt.downgradeProfileList),Lt.audioOnly!==void 0&&(Pt=Lt.audioOnly,Et.callConfiguration!==void 0||(Et.callConfiguration={}),Et.callConfiguration.audioOnly=Lt.audioOnly),(0,at.Ym)(Lt,"context","object"))try{JSON.stringify(Lt.context),Et.context=Lt.context}catch{}return Vt=new yn(apiCC.session.apiCCWebRTCClient.webRTCClient),Pt!==!0&&Pt!=="true"||(fn.log("Setting call as audioOnly"),Vt.callType="audio"),Vt.roomId=st,Vt.sessionId=Tt,Vt.token=Rt,Vt.callConfiguration=Lt,Vt.data=Et,Vt.options=jt,Vt.sessionMCU=rn,apiCC.session.apiCCWebRTCClient.webRTCClient.userMediaTable.push(Vt),Lt.userMediaStreamId?((Qt=apiCC.getUserMediaStream(Lt.userMediaStreamId)).addCallInfo(Vt.userMediaId,"userMedia"),Vt.callConfiguration.userMediaStreamId=Qt.userMediaStreamId,Vt.callType=Qt.callType,Vt.audio=Qt.audio,Vt.video=Qt.video,Vt.audioMuted=Qt.audioMuted,Vt.videoMuted=Qt.videoMuted,apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.meshOnUserMediaSuccess(Vt),apiCC.checkMutingStateForUserMedia(Lt,Qt)):apiCC.createUserMediaStream({callId:Vt.userMediaId,callFlavor:"userMedia",type:Vt.callType,audioSourceId:apiCC.session.apiCCWebRTCClient.webRTCClient.audioSourceId,videoSourceId:apiCC.session.apiCCWebRTCClient.webRTCClient.videoSourceId,success:function(Jt){fn.debug("[meshPublish] success; userMediaStreamId: "+Jt.userMediaStreamId),Vt.callConfiguration.userMediaStreamId=Jt.userMediaStreamId,Vt.callType=Jt.callType,Vt.audio=Jt.audio,Vt.video=Jt.video,Vt.audioMuted=Jt.audioMuted,Vt.videoMuted=Jt.videoMuted,apiCC.session.apiCCWebRTCClient.webRTCClient.accessToLocalMedia=!0,apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.meshOnUserMediaSuccess(Vt),apiCC.checkMutingStateForUserMedia(Lt,Jt)}}),Vt.userMediaId},this.meshOnUserMediaSuccess=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0&&arguments[1],Rt=null,Lt=null;Tt===!0?((Rt={}).type="streamStatusChanged",Rt.callerId=qt.clientId,Rt.roomId=st.roomId,Rt.streams={},Rt.streams[st.userMediaId]={eventType:"modify",callId:st.userMediaId,callType:st.callType,audio:st.audio,video:st.video,audioMuted:st.audioMuted,videoMuted:st.videoMuted},Rt.data={},Rt.data.meshPublish=!0,Rt.data.pubSub=this.pubConnector,Lt=JSON.stringify(Rt),fn.log("C->S: "+Lt),apiCC.session.channel.socket.emit("streamStatusChanged",Lt)):(this.publishCallId=st.userMediaId,st.addAck=!0,st.addTimeoutId=setTimeout(function(){qt.onRemoteHangup(st.userMediaId,qt.clientId,st.roomId,"Unable_to_establish",null,null)},st.disconnectionTimer),(Rt={}).type="streamStatusChanged",Rt.callerId=qt.clientId,Rt.roomId=st.roomId,Rt.streams={},Rt.streams[st.userMediaId]={eventType:"add",callId:st.userMediaId,callType:st.callType,audio:st.audio,video:st.video,audioMuted:st.audioMuted,videoMuted:st.videoMuted},Rt.data=st.data,Rt.data.meshPublish=!0,Rt.data.pubSub=this.pubConnector,Lt=JSON.stringify(Rt),fn.log("C->S: "+Lt),apiCC.session.channel.socket.emit("streamStatusChanged",Lt))},this.meshPublishScreen=function(st,Tt,Rt,Lt,Et){var jt=null,Pt=null,Vt=this.getSessionMCU(st);return Vt?(Rt!==null&&cn(Rt)==="object"||(Rt={}),(jt=new yn(apiCC.session.apiCCWebRTCClient.webRTCClient)).roomId=st,jt.data=Tt,jt.callConfiguration=Rt,jt.captureSourceType=Lt,jt.sessionMCU=Vt,apiCC.session.apiCCWebRTCClient.webRTCClient.userMediaTable.push(jt),Rt.userMediaStreamId?((Pt=apiCC.getUserMediaStream(Rt.userMediaStreamId)).addCallInfo(jt.userMediaId,"userMedia"),jt.callConfiguration.userMediaStreamId=Pt.userMediaStreamId,jt.callType=Pt.callType,jt.audio=Pt.audio,jt.video=Pt.video,jt.audioMuted=Pt.audioMuted,jt.videoMuted=Pt.videoMuted,apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.meshOnUserMediaSuccess(jt)):apiCC.createUserMediaStream({callId:jt.userMediaId,callFlavor:"userMedia",type:"screenSharing",captureSourceType:Lt,success:function(Qt){fn.debug("[meshPublishScreen] success; userMediaStreamId: "+Qt.userMediaStreamId),jt.callConfiguration.userMediaStreamId=Qt.userMediaStreamId,jt.callType=Qt.callType,jt.audio=Qt.audio,jt.video=Qt.video,jt.audioMuted=Qt.audioMuted,jt.videoMuted=Qt.videoMuted,apiCC.session.apiCCWebRTCClient.webRTCClient.MCUClient.meshOnScreenMediaSuccess(jt)}}),jt.userMediaId):(fn.error("meshPublishScreen() - missing sessionMCU"),null)},this.meshOnScreenMediaSuccess=function(st){var Tt,Rt=null;st.addAck=!0,st.addTimeoutId=setTimeout(function(){qt.onRemoteHangup(st.userMediaId,qt.clientId,st.roomId,"Unable_to_establish",null,null)},st.disconnectionTimer),(Rt={}).type="streamStatusChanged",Rt.callerId=qt.clientId,Rt.roomId=st.roomId,Rt.streams={},Rt.streams[st.userMediaId]={eventType:"add",callId:st.userMediaId,callType:st.callType,audio:st.audio,video:st.video,audioMuted:st.audioMuted,videoMuted:st.videoMuted},Rt.data={},Rt.data.pubSub=this.pubConnector,Tt=JSON.stringify(Rt),fn.log("C->S: "+Tt),apiCC.session.channel.socket.emit("streamStatusChanged",Tt)},this.meshOnHangup=function(st,Tt){var Rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Lt=0,Et=null,jt=null,Pt=null;if(Tt!==null&&cn(Tt)==="object"||(Tt={}),st){if((Et=qt.findUserMediaById(st))!==null){for(Et.close(),Et.streamStolen!==!0&&(qt.myWebRTC_Event.createHangupEvent("local",qt.clientId,0,!0,null,Et.userMediaId,Et.callType),Et.releaseUserMediaStream()),(jt={}).type="streamStatusChanged",jt.callerId=qt.clientId,jt.roomId=Et.roomId,jt.streams={},jt.streams[Et.userMediaId]={eventType:"remove",callId:Et.userMediaId,callType:Et.callType},Rt.restart&&(jt.streams[Et.userMediaId].restart=!0),jt.data={},jt.data.pubSub=this.pubConnector,Pt=JSON.stringify(jt),fn.log("C->S: "+Pt),apiCC.session.channel.socket.emit("streamStatusChanged",Pt),Lt=qt.userMediaTable.length;--Lt>=0;)if(qt.userMediaTable[Lt]===Et){qt.userMediaTable.splice(Lt,1);break}}}else for(Lt=qt.userMediaTable.length;--Lt>=0;)Et=qt.userMediaTable[Lt],Rt.hasOwnProperty("roomId")&&Et.sessionMCU.roomName!==Rt.roomId||(qt.myWebRTC_Event.createHangupEvent("local",qt.clientId,0,!0,null,Et.userMediaId,Et.callType),Et.close(),Et.releaseUserMediaStream(),(jt={}).type="streamStatusChanged",jt.callerId=qt.clientId,jt.roomId=Et.roomId,jt.streams={},jt.streams[Et.userMediaId]={eventType:"remove",callId:Et.userMediaId,callType:Et.callType},jt.data={},jt.data.pubSub=this.pubConnector,Pt=JSON.stringify(jt),fn.log("C->S: "+Pt),apiCC.session.channel.socket.emit("streamStatusChanged",Pt),qt.userMediaTable.splice(Lt,1))},this.participantEjected=function(st){(0,at.Ym)(st.data,"clientId","string")&&qt.myWebRTC_Event.createMCUParticipantEjectedEvent(st.roomId,st.data.clientId,st.data.info)},this.ejectParticipant=function(st,Tt,Rt){var Lt;if(Lt=Rt?this.getSessionMCU(Rt):this.getSessionMCU(null,{first:!0})){var Et={type:"ejectParticipant",roomId:Lt.roomName,callerId:apiCC.session.apiCCWebRTCClient.webRTCClient.clientId,data:{pubSub:this.pubConnector,clientId:st}};Tt&&(Et.data.info=Tt);var jt=JSON.stringify(Et);fn.log("C->S: "+jt),apiCC.session.channel.socket.emit("ejectParticipant",jt)}else fn.debug("ejectParticipant() - missing sessionMCU")},this.getJoinSessionReq=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rt=null;if(!st){if(Tt.hasOwnProperty("transactionId")){for(var Lt=this.joinSessionReqs.length;--Lt>=0;)if(this.joinSessionReqs[Lt].transactionId===Tt.transactionId){Rt=this.joinSessionReqs[Lt];break}return Rt}return null}for(var Et=this.joinSessionReqs.length;--Et>=0;)if(this.joinSessionReqs[Et].roomId===st){Rt=this.joinSessionReqs[Et];break}return Rt},this.removeJoinSessionReq=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!st){if(Tt.all===!0)return this.joinSessionReqs.splice(0,this.joinSessionReqs.length),!0;Tt.hasOwnProperty("roomId")&&(st=this.getJoinSessionReq(Tt.roomId))}if(!st)return!1;for(var Rt=this.joinSessionReqs.length;--Rt>=0&&this.joinSessionReqs[Rt]!==st;);return Rt>=0&&(this.joinSessionReqs.splice(Rt,1),!0)},this.getSessionMCU=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rt=null;if(!st){if(Tt.first===!0)return this.sessionMCUs[0];if((0,at.Ym)(Tt.callback,"function")){fn.debug("getSessionMCU callback");for(var Lt=this.sessionMCUs.length;--Lt>=0;)if(Tt.callback(this.sessionMCUs[Lt])){Rt=this.sessionMCUs[Lt];break}}return Rt}for(var Et=this.sessionMCUs.length;--Et>=0;)if(this.sessionMCUs[Et].roomName===st){Rt=this.sessionMCUs[Et];break}return Rt},this.removeSessionMCU=function(st){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!st&&Tt.all===!0)return this.sessionMCUs.splice(0,this.sessionMCUs.length),!0;if(!st)return!1;for(var Rt=this.sessionMCUs.length;--Rt>=0&&this.sessionMCUs[Rt]!==st;);return Rt>=0&&(this.sessionMCUs.splice(Rt,1),!0)},this.callback=function(st,Tt){return this.closureHandler=function(Rt){return st[Tt](Rt)},this.closureHandler}};function Pn(qt){fn.debug("disputableEntryTimeout",qt);for(var kt=apiCC.session.apiCCWebRTCClient.webRTCClient,st=this.disputableStreamList.length;--st>=0;)if(this.disputableStreamList[st].streamInfo.id===qt){this.disputableStreamList.splice(st,1);break}for(var Tt=null,Rt=this.streamList.length;--Rt>=0;)if(this.streamList[Rt].streamInfo.id===qt){Tt=kt.destroyCallControl({type:"subscribe",stream:this.streamList[Rt].streamInfo}),this.streamList.splice(Rt,1);break}Tt&&Tt.callId&&Tn.createHangupEvent("remote",kt.clientId,Tt.roomName,!1,"Hangup_From_Callee",Tt.callId,Tt.callType),Tn.createMCURemovedStreamEvent(qt)}function In(qt){fn.debug("clearDisputableEntry",qt);for(var kt=this.disputableStreamList.length;--kt>=0;)if(this.disputableStreamList[kt].streamInfo.id===qt){this.disputableStreamList.splice(kt,1);break}for(var st=this.streamList.length;--st>=0;)if(this.streamList[st].streamInfo.id===qt){this.streamList[st].disputableTimeoutId&&(clearTimeout(this.streamList[st].disputableTimeoutId),delete this.streamList[st].disputableTimeoutId),delete this.streamList[st].clearDisputableEntry;break}}function Rn(qt){var kt={};return(0,at.ki)(qt,"maxBitrate","number")&&(kt.maxBitrate=qt.maxBitrate),(0,at.ki)(qt,"scaleResolutionDownBy","number")&&(kt.scaleResolutionDownBy=qt.scaleResolutionDownBy),kt}function On(qt){return(0,at.Ym)(qt.encodings,"object")?(0,at.ki)(qt.encodings.high,"maxBitrate","number")&&(0,at.ki)(qt.encodings.medium,"maxBitrate","number")&&(0,at.ki)(qt.encodings.low,"maxBitrate","number")?(qt.encodings.high=Object.assign({active:!0},Rn(qt.encodings.high)),qt.encodings.medium=Object.assign({active:!0},Rn(qt.encodings.medium)),qt.encodings.low=Object.assign({active:!0},Rn(qt.encodings.low)),qt.sendEncodings=[{rid:"h",active:!0},{rid:"m",active:!0},{rid:"l",active:!0}],qt.sendEncodings[0].maxBitrate=1e3*qt.encodings.high.maxBitrate,qt.sendEncodings[1].maxBitrate=1e3*qt.encodings.medium.maxBitrate,qt.sendEncodings[2].maxBitrate=1e3*qt.encodings.low.maxBitrate,(0,at.ki)(qt.encodings.medium,"scaleResolutionDownBy","number")&&(qt.sendEncodings[1].scaleResolutionDownBy=qt.encodings.medium.scaleResolutionDownBy),(0,at.ki)(qt.encodings.low,"scaleResolutionDownBy","number")&&(qt.sendEncodings[2].scaleResolutionDownBy=qt.encodings.low.scaleResolutionDownBy),!0):(fn.warn("no such maxBitrate"),!1):(fn.warn("no such encodings"),!1)}function Ln(qt,kt){if(kt<650)return!1;var st=Math.floor(9*kt/13),Tt=Math.floor(3*kt/13),Rt=kt-st-Tt;return qt.encodings={high:{maxBitrate:st},medium:{maxBitrate:Tt,scaleResolutionDownBy:2},low:{maxBitrate:Rt,scaleResolutionDownBy:4}},On(qt)}et.Y.get("CallControl");var qn=function(qt){this.type=qt.type,qt.callId&&(this.callId=qt.callId),qt.callType?this.callType=qt.callType:this.callType="media",Object.prototype.hasOwnProperty.call(qt,"audioOnly")&&(this.audioOnly=!!qt.audioOnly),qt.roomName&&(this.roomName=qt.roomName),qt.mediaType&&(this.mediaType=qt.mediaType),qt.callConfiguration&&(this.callConfiguration=qt.callConfiguration),qt.data&&(this.data=qt.data),qt.stream&&(this.stream=qt.stream),this.autoRestart={}},jn=function(){var qt=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];this.a=1,this.b=0,this.c=7,this.d=0,this.update=function(kt,st,Tt){var Rt=0;for(st==null&&(st=0),Tt==null&&(Tt=kt.length);Rt>12&15]+qt[this.d>>8&15]+qt[this.d>>4&15]+qt[15&this.d]+qt[this.c>>12&15]+qt[this.c>>8&15]+qt[this.c>>4&15]+qt[15&this.c]+qt[this.b>>12&15]+qt[this.b>>8&15]+qt[this.b>>4&15]+qt[15&this.b]+qt[this.a>>12&15]+qt[this.a>>8&15]+qt[this.a>>4&15]+qt[15&this.a]}};function Fn(qt,kt){return qt==="checksum64"?new jn:null}function Zn(qt){return Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(kt){return typeof kt}:function(kt){return kt&&typeof Symbol=="function"&&kt.constructor===Symbol&&kt!==Symbol.prototype?"symbol":typeof kt},Zn(qt)}var on=et.Y.get("WebRTC_Client"),Hn=apiCC.myWebRTC_Event,Bn=4e4,zn=function(qt){function kt(st,Tt,Rt){var Lt,Et=st.width,jt=Et<<2,Pt=st.height,Vt=null,Qt=0,rn=0,Jt=0,sn=0,mn=0,an=0,hn=0,wn=0,Mn=0,xn=0,En=0,kn=0,Vn=0,Xn=0,cr=0,dr=0;if(Tt){for(Vt=Tt.data,Rt<0&&(Rt=0),wn=1-((mn=(2.44413*(Qt=Rt>=2.5?.98711*Rt-.9633:Rt>=.5?3.97156-4.14554*Math.sqrt(1-.26891*Rt):2*Rt*(3.97156-4.14554*Math.sqrt(.865545)))+2.85619*(rn=Qt*Qt)+1.26661*(Jt=rn*Qt))/(sn=1.57825+2.44413*Qt+1.4281*rn+.422205*Jt))+(an=-(1.4281*rn+1.26661*Jt)/sn)+(hn=.422205*Jt/sn)),Lt=0;Lt<3;Lt++)for(Mn=0;Mn=En;xn-=4)kn=wn*Vt[xn]+mn*Vn+an*Xn+hn*cr,Vt[xn]=kn,cr=Xn,Xn=Vn,Vn=kn}for(Lt=0;Lt<3;Lt++)for(dr=0;dr=En;xn-=jt)kn=wn*Vt[xn]+mn*Vn+an*Xn+hn*cr,Vt[xn]=kn,cr=Xn,Xn=Vn,Vn=kn}return Tt}}this.localStream=null,this.remoteStream=null,this.channelReady=!1,this.socket=qt.channel.socket,this.clientId=qt.apiCCId,this.compositeClientId=qt.apiCCId+"@"+qt.apiCCSessionId,this.apiKey=qt.apiKey,this.isVideoMuted=!1,this.isAudioMuted=!1,this.receiptHooks={},this.callControlTable=[],this.userMediaTable=[],this.callsTable=[],this.callsRetriesTable={},this.restartCallDelay=1e3,this.maxCallsRetriesDuration=15e4,this.accessToLocalMedia=!1,this.unidirectionelCallOnly=!1,this.NtoNConf=!1,this.autoAnswer=!1,this.RTPMedia=!1,this.logoAdded=!1,this.preferOpusCodec=!1,this.preferVP9Codec=!1,typeof apiRTC_React<"u"&&nt.BF==="iOS"?(on.log("React and iOS : Setting H264 as preferred codec"),this.preferH264Codec=!0):this.preferH264Codec=!1,this.preferSendingH264Codec=!1,this.setStereo=!1,this.allowedAudioCodecs="",this.allowedVideoCodecs="",this.mediaRoutingModeEnum={hostOnly:1,stun:2,stunOnly:3,turn:4,turnOnly:5},this.mediaRoutingMode=this.mediaRoutingModeEnum.turn,this.myWebRTC_Event=apiCC.myWebRTC_Event,this.getUserMediaOnGoing=!1,this.userAcceptOnIncomingCall=!1,this.userAcceptOnIncomingCallBeforeGetUserMedia=!1,this.userAcceptOnIncomingDataCall=!1,this.userAcceptOnIncomingScreenSharingCall=!1,this.maxWidthRemoteVideo=0,this.maxHeightRemoteVideo=0,this.nickname=qt.nickname,this.allowMultipleCalls=!1,this.mySDPManager=new pt,this.MCUClient=new Un(this,this.clientId),this.audioSourceId=null,this.audioOutputId=null,this.videoSourceId=null,this.facingMode=null,this.apiRTCExtensionInstalled=!1,this.trickleIce=!0,this.waitingShareScreenCallId=0,this.waitingShareScreenDestNumber=0,this.waitingCaptureSourceType=null,this.qosEnable=!1,this.qosInterval=5e3,this.csmEnable=!1,this.qualityScoreEnable=!1,this.qualityScoreIntervalMs=5e3,this.csmIntervalMs=5e3,this.recordedCall=!1,this.audioBandwidth=null,this.videoBandwidth=null,this.videoRemoteBandwidth=null,this.videoBandwidthSettings={},this.dataBandwidth=null,this.pc_config="",this.clientIncomingCandidatesQueue=[],this.cleanStoredCallCandidateTimer=6e4,this.initializeGumConfig=function(){nt.Xh==="Edge"&&nt.PR>=15&&apiRTC.browserDetails.type!=="chrome"?this.gum_config={audio:!0,video:!0}:nt.Xh==="Chrome"&&nt.PR<49||nt.Xh==="Firefox"&&nt.PR<50?this.gum_config={audio:{mandatory:{},optional:[]},video:{mandatory:{},optional:[]}}:this.gum_config={audio:{},video:{}}},this.initializeGumConfig(),this.setGumConfigWithDevicePresent=function(){apiCC.mediaDeviceMgr.audioDevicePresent===!1&&(this.gum_config.audio=!1),apiCC.mediaDeviceMgr.videoDevicePresent===!1&&(this.gum_config.video=!1),apiCC.mediaDeviceMgr.audioDevicePresent===!1&&apiCC.mediaDeviceMgr.videoDevicePresent===!1&&(this.unidirectionelCallOnly=!0),on.log("this.gum_config:",this.gum_config)},this.userMediaErrorDetected=!1,this.lastUsedUserMediaConstraint=null,this.mediaTypeForIncomingCall="VIDEO",this.mediaTypeForOutgoingCall="VIDEO",this.allowAsymetricMediaCalls=!1,this.receiveMediaDeactivated=!1,this.configTurnServer=null,apiCC.myWebRTC_Adapter.adaptForIoSCordova(),this.pc_config={iceServers:[{urls:["turns:mp1.apizee.com:443?transport=udp","turns:mp1.apizee.com:443?transport=tcp","turn:mp1.apizee.com:443?transport=udp","turn:mp1.apizee.com:443?transport=tcp","turns:mp2.apizee.com:443?transport=udp","turns:mp2.apizee.com:443?transport=tcp","turn:mp2.apizee.com:443?transport=udp","turn:mp2.apizee.com:443?transport=tcp"],credential:"password",username:"anonymous"}]},nt.Xh==="Firefox"&&nt.PR<53?(on.log("createPeerConnection FIREFOX"),on.log("webrtcDetectedVersion : "+apiCC.myWebRTC_Adapter.webrtcDetectedVersion),nt.PR<38?this.pc_config={iceServers:[{url:"stun:mp1.apizee.com:443",credential:"password",username:"anonymous"},{url:"turn:mp1.apizee.com:443",credential:"password",username:"anonymous"}]}:nt.PR>=42?this.pc_config={iceServers:[{urls:["turn:mp1.apizee.com:443?transport=udp","turn:mp1.apizee.com:443?transport=tcp"],credential:"password",username:"anonymous"}]}:this.pc_config={iceServers:[{urls:"turn:mp1.apizee.com:443?transport=tcp",credential:"password",username:"anonymous"},{url:"turn:mp1.apizee.com:443?transport=tcp",credential:"password",username:"anonymous"}]}):nt.Xh==="IE"||nt.Xh==="Safari"&&nt.PR<11?(on.log("Browser is :"+nt.Xh+" - using Plugin"),this.pc_config={iceServers:[{url:"stun:mp1.apizee.com:443",credential:"password",username:"anonymous"},{url:"turn:mp1.apizee.com:443",credential:"password",username:"anonymous"}]}):nt.Xh==="Edge"&&nt.PR<45&&apiRTC.browserDetails.type!=="chrome"?(on.log("Browser is Edge < 45 - removing Turns config"),this.pc_config={iceServers:[{urls:["turn:mp1.apizee.com:443?transport=udp","turn:mp1.apizee.com:443?transport=tcp","turn:mp2.apizee.com:443?transport=udp","turn:mp2.apizee.com:443?transport=tcp"],credential:"password",username:"anonymous"}]}):on.log("default this.pc_config configuration"),this.pc_constraints={optional:[]},at.wL.type==="edge"?on.debug("not data channel capable"):at.wL.type==="safari"?at.wL.version>=11?this.dataChannelCapable=!0:on.debug("not data channel capable"):this.dataChannelCapable=!0,at.wL.type==="chrome"&&at.wL.version>=68||at.wL.type==="firefox"&&at.wL.version>=64||at.wL.type==="safari"&&at.wL.version>=12?(on.debug("RTCRtpSender#setParameters is available"),this.rtpSenderSetParamatersCapable=!0):(on.debug("RTCRtpSender#setParameters is NOT available"),this.rtpSenderSetParamatersCapable=!1),this.setClientTurnServer=function(st){on.info("setClientTurnServer :",st);var Tt=JSON.stringify(this.pc_config);Tt=Tt.replace(/mp1.apizee.com/g,st),this.pc_config=JSON.parse(Tt)},this.activateScreenSharing=function(st){apiCC.activateScreenSharing(st)},this.setGetUserMediaConfig=function(st){if(on.log("setGetUserMediaConfig :",st),navigator.mediaDevices!==null&&navigator.mediaDevices!==void 0&&navigator.mediaDevices.getSupportedConstraints!==null&&navigator.mediaDevices.getSupportedConstraints!==void 0){var Tt=navigator.mediaDevices.getSupportedConstraints();on.log("Supported Constraints :",Tt)}st.video!==void 0&&(st.video.height===void 0&&st.video.width===void 0||st.optional!==void 0&&(on.warn("contraints with both optional/mandatory and specific or advanced constraints usage : this may failed depending of browsers"),on.log("setGetUserMediaConfig : contraints modification to avoid both optional/mandatory and specific or advanced constraints usage"),st.optional.sourceId!==void 0&&(on.log("sourceId contraints modification to deviceId"),st.video.deviceId===void 0&&(st.video.deviceId={}),st.video.deviceId.ideal=st.optional.sourceId),delete st.optional)),on.log("this.gum_config :",this.gum_config),this.gum_config=st},this.getUserMedia=function(){try{this.gum_config=apiCC.setAudioSourceIdInConstraint(this.audioSourceId,this.gum_config),this.gum_config=apiCC.setVideoSourceIdInConstraint(this.videoSourceId,this.gum_config),this.lastUsedUserMediaConstraint=this.gum_config,nt.Xh==="IE"&&nt.dc>8?apiCC.getUserMediaWithCB(this.gum_config,this.callback(this,"onUserMediaSuccess"),this.callback(this,"onUserMediaError")):apiCC.getUserMedia(this.gum_config).then(this.callback(this,"onUserMediaSuccess")).catch(this.callback(this,"onUserMediaError"))}catch(st){on.error("getUserMedia() failed. Is this a WebRTC capable browser?"),on.log("getUserMedia failed with exception: "+st.message)}},this.onUserMediaSuccess=function(st){on.info("onUserMediaSuccess : User has granted access to local media."),this.accessToLocalMedia=!0;var Tt=!1,Rt="Unknown",Lt=!1,Et="Unknown";this.localStream=st,st.getAudioTracks().length>0&&(Tt=!0,st.getAudioTracks()[0].label&&(Rt=st.getAudioTracks()[0].label),on.log("Using audio device: "+Rt)),st.getVideoTracks().length>0&&(Lt=!0,st.getVideoTracks()[0].label&&(Et=st.getVideoTracks()[0].label),on.log("Using video device: "+Et)),this.myWebRTC_Event.createUserMediaSuccessEvent(!1,Tt,Rt,Lt,Et,"media",null,st,null,!1)},this.onUserMediaError=function(st){on.info("onUserMediaError : Failed to get access to local media. Error : ",st),on.error(st),this.accessToLocalMedia=!1,nt.$6!=="electron"&&(nt.Xh==="Chrome"||nt.Xh==="Mobile Chrome")&&nt.PR>47&&(on.log("browser_version > 47"),window.location.protocol!=="https:"&&on.error("HTTPS is now mandatory to use getUserMedia()")),this.myWebRTC_Event.createUserMediaErrorEvent(!1,"media",st,null,null,null,this.gum_config),st=null,apiCC.session.tryAudioCallAfterUserMediaError===!0?(on.log("this.lastUsedUserMediaConstraint :",this.lastUsedUserMediaConstraint),on.log("this.lastUsedUserMediaConstraint.video :",this.lastUsedUserMediaConstraint.video),this.lastUsedUserMediaConstraint.video!==!1?(on.log("this.lastUsedUserMediaConstraint.audio :",this.lastUsedUserMediaConstraint.audio),on.log("UserMediaError, Trying to getUserMedia with audioOnly"),this.videoSourceId=null,this.gum_config.video=!1,this.getUserMedia()):on.log("onUserMediaError without video")):on.log("try AudioCall after UserMediaError is not activated")},this.evalCallProfileWithSdp=function(st,Tt,Rt){return this.evalCallProfileWithSdpGuideline(this.mySDPManager.createGuideline(st),st,Tt,Rt)},this.evalCallProfileWithSdpGuideline=function(st,Tt,Rt,Lt){var Et={};return st.hasOwnProperty("audio")?(Et.audio=!0,Et.audioActive=Rt==="local"&&Lt==="send"?st.audio.direction==="sendrecv"||st.audio.direction==="sendonly":Rt==="local"&&Lt==="receive"||Rt==="remote"&&Lt==="send"?st.audio.direction==="sendrecv"||st.audio.direction==="recvonly":Rt==="remote"&&Lt==="receive"&&(st.audio.direction==="sendrecv"||st.audio.direction==="sendonly")):(Et.audio=!1,Et.audioActive=!1),st.hasOwnProperty("video")?(Et.video=!0,Et.videoActive=Rt==="local"&&Lt==="send"?st.video.direction==="sendrecv"||st.video.direction==="sendonly":Rt==="local"&&Lt==="receive"||Rt==="remote"&&Lt==="send"?st.video.direction==="sendrecv"||st.video.direction==="recvonly":Rt==="remote"&&Lt==="receive"&&(st.video.direction==="sendrecv"||st.video.direction==="sendonly")):(Et.video=!1,Et.videoActive=!1),Et},this.checkDestCallTypeWithSDP=function(st,Tt){on.debug("checkDestCallTypeWithSDP");var Rt=this.mySDPManager.createGuideline(st),Lt=!1,Et=!1;!Rt.audio||Rt.audio.direction!=="sendrecv"&&Rt.audio.direction!=="sendonly"||(Lt=!0),!Rt.video||Rt.video.direction!=="sendrecv"&&Rt.video.direction!=="sendonly"||(Et=!0),Tt.destCallType=Lt===!0?Et===!0?"media":"audio":Et===!0?"videoOnly":"inactive",on.debug("call.destCallType: "+Tt.destCallType),Tt.callee!==!0||Rt.audio&&Rt.audio.direction!=="sendonly"||Rt.video&&Rt.video.direction!=="sendonly"||(Tt.userMediaAccessRequired=!1,Tt.mediaTypeForOutgoingCall="NONE",on.debug("access to user media not required"))},this.evaluateVideoCap=function(st){delete st.videoCap,st.belongsToRoom()?st.settingUpType!=="publish"&&st.settingUpType!=="shareScreen"||st.localCallProfile&&st.localCallProfile.video&&st.localCallProfile.videoActive&&this.evalOutgoingVideoBandwithCap(st):(this.rtpSenderSetParamatersCapable||!st.callee)&&st.localCallProfile&&st.localCallProfile.video&&st.localCallProfile.videoActive&&this.evalOutgoingVideoBandwithCap(st)},this.processInvite=function(st){on.info("processInvite() - invite received from :"+st.callerId);var Tt,Rt=0,Lt=null,Et=null,jt=null,Pt=null,Vt=!1,Qt=null,rn=null,Jt=null,sn={};if(st.data!==void 0&&st.data.type==="publish"&&st.data.mesh!==void 0){if(on.info("received invite publish mesh; mesh: "+JSON.stringify(st.data.mesh)),(Lt=this.findCallWithCallIdAndInstanceId(st.data.mesh.callerCallId,st.data.instanceId))==null)return void on.error("cannot find call; callId: "+st.data.mesh.callerCallId);Lt.userMediaAccessRequired=!1,Lt.data.mesh=st.data.mesh,Lt.setupTimeoutId&&(clearTimeout(Lt.setupTimeoutId),delete Lt.setupTimeoutId),Vt=!0}else{if(st.data!==void 0&&st.data.type==="subscribe"&&st.data.mesh!==void 0){if(on.debug("received invite subscribe mesh; mesh: ",st.data.mesh),(Et=this.findUserMediaById(st.data.mesh.calleeCallId))!==null)if(this.MCUClient.distantCalls.push({early:!0,roomId:st.roomId,clientId:st.data.mesh.callerId,callId:st.data.mesh.callerCallId,callMode:"mesh",callDirection:"recvonly",callFeed:{clientId:st.data.mesh.calleeId,callId:st.data.mesh.calleeCallId}}),setTimeout((function(hn,wn,Mn){on.debug("early distant call descriptor timeout");for(var xn=this.MCUClient.distantCalls.length;--xn>=0;)if(this.MCUClient.distantCalls[xn].early&&this.MCUClient.distantCalls[xn].roomId===hn&&this.MCUClient.distantCalls[xn].clientId===wn&&this.MCUClient.distantCalls[xn].callId===Mn){on.debug("remove early distant call descriptor: timeout"),this.MCUClient.distantCalls.splice(xn,1);break}}).bind(this,st.roomId,st.data.callerId,st.data.callerCallId),3e4),Et.callType==="screenSharing"||Et.callType==="screenSharingWithAudio")sn.type="publish",sn.mesh=st.data.mesh,sn.instanceId=st.data.instanceId,this.MCUClient.publishScreen(st.roomId,sn,null,Et.captureSourceType);else{var mn=(0,at.ws)({},Et.callConfiguration);st.data.mediaType==="AUDIOONLY"?mn.audioOnly=!0:st.data.mediaType==="VIDEOONLY"&&(mn.videoOnly=!0),(jt=apiCC.getUserMediaStream(mn.userMediaStreamId))&&(jt.audioMuted&&jt.videoMuted?mn.muted="VIDEO":jt.audioMuted?mn.muted="AUDIOONLY":jt.videoMuted?mn.muted="VIDEOONLY":delete mn.muted),delete mn.distributedBroadcastEnabled,delete mn.simulcast,sn.type="publish",sn.mesh=st.data.mesh,sn.instanceId=st.data.instanceId,this.MCUClient.publish(st.roomId,null,null,mn,sn,null)}else on.debug("media not found: sending bye : Call_not_found"),new ht.S(apiCC.session.channel.socket).sendBye(st.callId,st.calleeId,st.roomId,st.callerId,"Call_not_found",st.data);return}if(st.data!==void 0&&st.data.type==="publish"&&st.data.mode==="passive"){if((Lt=this.findCallWithCallIdAndRemoteIdAndInstanceId(st.callId,st.callerId,st.data.instanceId))==null)return void on.debug("cannot find call; callId: "+st.callId+", callerId: "+st.callerId+", instanceId: "+st.data.instanceId);Lt.userMediaAccessRequired=!1,Lt.setupTimeoutId&&(clearTimeout(Lt.setupTimeoutId),delete Lt.setupTimeoutId),Vt=!0}else(Lt=new vn(this)).callId=st.callId,Lt.instanceId=st.data.instanceId,Lt.callerId=st.callerId,Lt.calleeId=this.clientId,Lt.callee=!0,Lt.remoteId=st.callerId}if(Lt.dest_roomId=st.roomId,Lt.data!==void 0&&Vt===!0)for(Jt in st.data)st.data.hasOwnProperty(Jt)&&(Lt.data[Jt]=st.data[Jt]);else Lt.data=st.data;if(Lt.data.instanceId=Lt.instanceId,st.data!==void 0&&st.data.pubSub==="sipConnector"&&(Lt.trickleIce=!1,Lt.remoteType="sip"),Lt.checkDTLSCompliancy(),nt.Xh==="Edge"&&apiRTC.browserDetails.type!=="chrome"&&(Qt=apiCC.session.getConnectedUserInfo(st.callerId,"userData"),on.log("destUserInfo :",Qt),Qt!=="User_Not_Found"&&Qt!==void 0&&((rn=JSON.parse(Qt)).browser!=="Chrome"&&rn.browser!=="Mobile Chrome"||rn.osName!=="Android"||(on.log("Browser is Edge and caller is Chrome on Android, setting VP8 as prefered codec for the call"),Lt.preferVP8Codec=!0))),st.data!==void 0&&st.data.type==="publish"&&st.data.mode==="passive"&&st.stream!==void 0&&st.stream.id!==void 0&&(Lt.streamId=st.stream.id,on.log("call.streamId: "+Lt.streamId)),Rt=this.callsTable.length,on.log("processInvite() - Actual call Number is :"+Rt),st.callType==="screenSharing"||st.callType==="screenSharingWithAudio")Lt.screenSharing=!0,Lt.callType=st.callType;else if(st.callType!=="data"){if(this.allowMultipleCalls===!1){for(on.log("processInvite() - Refusing double call checking ..."),Tt=0;Tt