@byteplus/rtc 4.36.0 → 4.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Copyright (c) 2020 The BytePlusRTC project authors. All Rights Reserved.
3
3
  * @brief BytePlusRTC Advance API
4
- * version: 4.36.0
4
+ * version: 4.36.1
5
5
  */
6
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BytePlusRTC=t()}(this,(function(){"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y=function(){return y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},y.apply(this,arguments)};function E(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function S(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function b(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function T(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function I(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function A(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}!function(e){e[e.VIDEO_SOURCE_TYPE_EXTERNAL=0]="VIDEO_SOURCE_TYPE_EXTERNAL",e[e.VIDEO_SOURCE_TYPE_INTERNAL=1]="VIDEO_SOURCE_TYPE_INTERNAL"}(n||(n={})),function(e){e[e.AUDIO_SOURCE_TYPE_EXTERNAL=0]="AUDIO_SOURCE_TYPE_EXTERNAL",e[e.AUDIO_SOURCE_TYPE_INTERNAL=1]="AUDIO_SOURCE_TYPE_INTERNAL"}(i||(i={})),function(e){e[e.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",e[e.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING"}(o||(o={})),function(e){e[e.AUTO_SUBSCRIBE_MODE=0]="AUTO_SUBSCRIBE_MODE",e[e.MANUAL_SUBSCRIBE_MODE=1]="MANUAL_SUBSCRIBE_MODE"}(a||(a={})),function(e){e[e.MUTE_STATE_OFF=0]="MUTE_STATE_OFF",e[e.MUTE_STATE_ON=1]="MUTE_STATE_ON"}(s||(s={})),function(e){e[e.SUBSCRIBE_SUCC=0]="SUBSCRIBE_SUCC",e[e.SUBSCRIBE_FAIL=1]="SUBSCRIBE_FAIL"}(c||(c={})),function(e){e[e.PUBLISH_SUCC=0]="PUBLISH_SUCC",e[e.PUBLISH_FAIL=1]="PUBLISH_FAIL"}(u||(u={})),function(e){e[e.MIRROR_MODE_OFF=0]="MIRROR_MODE_OFF",e[e.MIRROR_MODE_ON=1]="MIRROR_MODE_ON"}(d||(d={})),function(e){e[e.RTC_PAUSE_RESUME_CONTROL_AUDIO=0]="RTC_PAUSE_RESUME_CONTROL_AUDIO",e[e.RTC_PAUSE_RESUME_CONTROL_VIDEO=1]="RTC_PAUSE_RESUME_CONTROL_VIDEO",e[e.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO=2]="RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO"}(l||(l={})),function(e){e[e.RENDER_MODE_HIDDEN=0]="RENDER_MODE_HIDDEN",e[e.RENDER_MODE_FIT=1]="RENDER_MODE_FIT"}(f||(f={})),function(e){e[e.STREAM_INDEX_MAIN=0]="STREAM_INDEX_MAIN",e[e.STREAM_INDEX_SCREEN=1]="STREAM_INDEX_SCREEN"}(h||(h={})),function(e){e[e.AUDIO_ONLY=0]="AUDIO_ONLY",e[e.VIDEO_ONLY=1]="VIDEO_ONLY",e[e.AUDIO_AND_VIDEO=2]="AUDIO_AND_VIDEO",e[e.NONE=3]="NONE"}(p||(p={})),function(e){e[e.STREAM_REMOVE_REASON_UNPUBLISH=0]="STREAM_REMOVE_REASON_UNPUBLISH",e[e.STREAM_REMOVE_REASON_PUBLISH_FAILED=1]="STREAM_REMOVE_REASON_PUBLISH_FAILED",e[e.STREAM_REMOVE_REASON_KEEP_LIVE_FAILED=2]="STREAM_REMOVE_REASON_KEEP_LIVE_FAILED",e[e.STREAM_REMOVE_REASON_CLIENT_DISCONNECTED=3]="STREAM_REMOVE_REASON_CLIENT_DISCONNECTED",e[e.STREAM_REMOVE_REASON_REPUBLISH=4]="STREAM_REMOVE_REASON_REPUBLISH",e[e.STREAM_REMOVE_REASON_OTHER=5]="STREAM_REMOVE_REASON_OTHER"}(_||(_={})),function(e){e[e.CONNECTION_START=0]="CONNECTION_START",e[e.CONNECTION_STATE_DISCONNECTED=1]="CONNECTION_STATE_DISCONNECTED",e[e.CONNECTION_STATE_CONNECTING=2]="CONNECTION_STATE_CONNECTING",e[e.CONNECTION_STATE_CONNECTED=3]="CONNECTION_STATE_CONNECTED",e[e.CONNECTION_STATE_RECONNECTING=4]="CONNECTION_STATE_RECONNECTING",e[e.CONNECTION_STATE_RECONNECTED=5]="CONNECTION_STATE_RECONNECTED"}(v||(v={})),function(e){e[e.MIRROR_TYPE_NONE=0]="MIRROR_TYPE_NONE",e[e.MIRROR_TYPE_RENDER=1]="MIRROR_TYPE_RENDER"}(m||(m={})),function(e){e[e.domestic=0]="domestic",e[e.overseas=1]="overseas"}(g||(g={}));var R,C,O,w=Object.freeze({__proto__:null,get VideoSourceType(){return n},get AudioSourceType(){return i},get ChannelProfile(){return o},get SubscribeMode(){return a},get MuteState(){return s},get SubscribeState(){return c},get PublishState(){return u},get MirrorMode(){return d},get PauseResumeControlMediaType(){return l},get VideoRenderMode(){return f},get StreamIndex(){return h},get SubscribeMediaType(){return p},get StreamRemoveReason(){return _},get ConnectionState(){return v},get MirrorType(){return m},get LogChannel(){return g}});!function(e){e[e.AUTO=0]="AUTO",e[e.MODE_L=1]="MODE_L",e[e.MODE_R=2]="MODE_R",e[e.MODE_MIX=3]="MODE_MIX"}(R||(R={})),function(e){e[e.PLAYOUT=0]="PLAYOUT",e[e.PUBLISH=1]="PUBLISH",e[e.PLAYOUT_AND_PUBLISH=2]="PLAYOUT_AND_PUBLISH"}(C||(C={})),function(e){e[e.AUDIO_MIXING_STATE_PRELOADED=0]="AUDIO_MIXING_STATE_PRELOADED",e[e.AUDIO_MIXING_STATE_PLAYING=1]="AUDIO_MIXING_STATE_PLAYING",e[e.AUDIO_MIXING_STATE_PAUSED=2]="AUDIO_MIXING_STATE_PAUSED",e[e.AUDIO_MIXING_STATE_STOPPED=3]="AUDIO_MIXING_STATE_STOPPED",e[e.AUDIO_MIXING_STATE_FAILED=4]="AUDIO_MIXING_STATE_FAILED",e[e.AUDIO_MIXING_STATE_FINISHED=5]="AUDIO_MIXING_STATE_FINISHED",e[e.AUDIO_MIXING_STATE_PCM_ENABLED=6]="AUDIO_MIXING_STATE_PCM_ENABLED",e[e.AUDIO_MIXING_STATE_PCM_DISABLED=7]="AUDIO_MIXING_STATE_PCM_DISABLED"}(O||(O={}));var N,k=Object.freeze({__proto__:null,get AudioMixingDualMonoMode(){return R},get AudioMixingType(){return C},get AudioMixingState(){return O}});!function(e){e.onTrackEnded="onTrackEnded",e.onPlayerEvent="onPlayerEvent",e.onAutoplayFailed="onAutoplayFailed",e.onUserJoined="onUserJoined",e.onUserLeave="onUserLeave",e.onConnectionStateChanged="onConnectionStateChanged",e.onStreamAdd="onStreamAdd",e.onStreamRemove="onStreamRemove",e.onRoomMessageReceived="onRoomMessageReceived",e.onRoomBinaryMessageReceived="onRoomBinaryMessageReceived",e.onUserMessageReceived="onUserMessageReceived",e.onUserBinaryMessageReceived="onUserBinaryMessageReceived",e.onUserMuteAudio="onUserMuteAudio",e.onUserMuteVideo="onUserMuteVideo",e.onVideoFirstFrameRendered="onVideoFirstFrameRendered",e.onVideoFirstFrameDecoded="onVideoFirstFrameDecoded",e.onAudioFirstFrameDecoded="onAudioFirstFrameDecoded",e.onMediaDeviceStateChanged="onMediaDeviceStateChanged",e.onRemoteStreamStats="onRemoteStreamStats",e.onLocalStreamStats="onLocalStreamStats",e.onAudioVolumeIndication="onAudioVolumeIndication",e.onAudioPlaybackDeviceChanged="onAudioPlaybackDeviceChanged",e.onUserStartVideoCapture="onUserStartVideoCapture",e.onUserStopVideoCapture="onUserStopVideoCapture",e.onUserStartAudioCapture="onUserStartAudioCapture",e.onUserStopAudioCapture="onUserStopAudioCapture",e.onAutoPublishResult="onAutoPublishResult",e.onAutoSubscribeResult="onAutoSubscribeResult",e.onLiveTranscodingResult="onLiveTranscodingResult",e.onSEIMessageReceived="onSEIMessageReceived",e.onError="onError",e.onAudioMixingStateChanged="onAudioMixingStateChanged"}(N||(N={}));var D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},P=function(e){return e&&e.Math==Math&&e},M=P("object"==typeof globalThis&&globalThis)||P("object"==typeof window&&window)||P("object"==typeof self&&self)||P("object"==typeof D&&D)||function(){return this}()||Function("return this")(),U={},L=function(e){try{return!!e()}catch(e){return!0}},x=!L((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),B=!L((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),V=B,j=Function.prototype.call,F=V?j.bind(j):function(){return j.apply(j,arguments)},G={},z={}.propertyIsEnumerable,H=Object.getOwnPropertyDescriptor,W=H&&!z.call({1:2},1);G.f=W?function(e){var t=H(this,e);return!!t&&t.enumerable}:z;var Y,K,X=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},q=B,J=Function.prototype,Z=J.bind,$=J.call,Q=q&&Z.bind($,$),ee=q?function(e){return e&&Q(e)}:function(e){return e&&function(){return $.apply(e,arguments)}},te=ee,re=te({}.toString),ne=te("".slice),ie=function(e){return ne(re(e),8,-1)},oe=ee,ae=L,se=ie,ce=M.Object,ue=oe("".split),de=ae((function(){return!ce("z").propertyIsEnumerable(0)}))?function(e){return"String"==se(e)?ue(e,""):ce(e)}:ce,le=M.TypeError,fe=function(e){if(null==e)throw le("Can't call method on "+e);return e},he=de,pe=fe,_e=function(e){return he(pe(e))},ve=function(e){return"function"==typeof e},me=ve,ge=function(e){return"object"==typeof e?null!==e:me(e)},ye=M,Ee=ve,Se=function(e){return Ee(e)?e:void 0},be=function(e,t){return arguments.length<2?Se(ye[e]):ye[e]&&ye[e][t]},Te=ee({}.isPrototypeOf),Ie=be("navigator","userAgent")||"",Ae=M,Re=Ie,Ce=Ae.process,Oe=Ae.Deno,we=Ce&&Ce.versions||Oe&&Oe.version,Ne=we&&we.v8;Ne&&(K=(Y=Ne.split("."))[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!K&&Re&&(!(Y=Re.match(/Edge\/(\d+)/))||Y[1]>=74)&&(Y=Re.match(/Chrome\/(\d+)/))&&(K=+Y[1]);var ke=K,De=ke,Pe=L,Me=!!Object.getOwnPropertySymbols&&!Pe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&De&&De<41})),Ue=Me&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Le=be,xe=ve,Be=Te,Ve=Ue,je=M.Object,Fe=Ve?function(e){return"symbol"==typeof e}:function(e){var t=Le("Symbol");return xe(t)&&Be(t.prototype,je(e))},Ge=M.String,ze=function(e){try{return Ge(e)}catch(e){return"Object"}},He=ve,We=ze,Ye=M.TypeError,Ke=function(e){if(He(e))return e;throw Ye(We(e)+" is not a function")},Xe=Ke,qe=function(e,t){var r=e[t];return null==r?void 0:Xe(r)},Je=F,Ze=ve,$e=ge,Qe=M.TypeError,et={exports:{}},tt=M,rt=Object.defineProperty,nt=function(e,t){try{rt(tt,e,{value:t,configurable:!0,writable:!0})}catch(r){tt[e]=t}return t},it=nt,ot="__core-js_shared__",at=M[ot]||it(ot,{}),st=at;(et.exports=function(e,t){return st[e]||(st[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.0/LICENSE",source:"https://github.com/zloirock/core-js"});var ct=fe,ut=M.Object,dt=function(e){return ut(ct(e))},lt=dt,ft=ee({}.hasOwnProperty),ht=Object.hasOwn||function(e,t){return ft(lt(e),t)},pt=ee,_t=0,vt=Math.random(),mt=pt(1..toString),gt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+mt(++_t+vt,36)},yt=M,Et=et.exports,St=ht,bt=gt,Tt=Me,It=Ue,At=Et("wks"),Rt=yt.Symbol,Ct=Rt&&Rt.for,Ot=It?Rt:Rt&&Rt.withoutSetter||bt,wt=function(e){if(!St(At,e)||!Tt&&"string"!=typeof At[e]){var t="Symbol."+e;Tt&&St(Rt,e)?At[e]=Rt[e]:At[e]=It&&Ct?Ct(t):Ot(t)}return At[e]},Nt=F,kt=ge,Dt=Fe,Pt=qe,Mt=function(e,t){var r,n;if("string"===t&&Ze(r=e.toString)&&!$e(n=Je(r,e)))return n;if(Ze(r=e.valueOf)&&!$e(n=Je(r,e)))return n;if("string"!==t&&Ze(r=e.toString)&&!$e(n=Je(r,e)))return n;throw Qe("Can't convert object to primitive value")},Ut=wt,Lt=M.TypeError,xt=Ut("toPrimitive"),Bt=function(e,t){if(!kt(e)||Dt(e))return e;var r,n=Pt(e,xt);if(n){if(void 0===t&&(t="default"),r=Nt(n,e,t),!kt(r)||Dt(r))return r;throw Lt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Mt(e,t)},Vt=Bt,jt=Fe,Ft=function(e){var t=Vt(e,"string");return jt(t)?t:t+""},Gt=ge,zt=M.document,Ht=Gt(zt)&&Gt(zt.createElement),Wt=function(e){return Ht?zt.createElement(e):{}},Yt=Wt,Kt=!x&&!L((function(){return 7!=Object.defineProperty(Yt("div"),"a",{get:function(){return 7}}).a})),Xt=x,qt=F,Jt=G,Zt=X,$t=_e,Qt=Ft,er=ht,tr=Kt,rr=Object.getOwnPropertyDescriptor;U.f=Xt?rr:function(e,t){if(e=$t(e),t=Qt(t),tr)try{return rr(e,t)}catch(e){}if(er(e,t))return Zt(!qt(Jt.f,e,t),e[t])};var nr={},ir=x&&L((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),or=M,ar=ge,sr=or.String,cr=or.TypeError,ur=function(e){if(ar(e))return e;throw cr(sr(e)+" is not an object")},dr=x,lr=Kt,fr=ir,hr=ur,pr=Ft,_r=M.TypeError,vr=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,gr="enumerable",yr="configurable",Er="writable";nr.f=dr?fr?function(e,t,r){if(hr(e),t=pr(t),hr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&Er in r&&!r.writable){var n=mr(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:yr in r?r.configurable:n.configurable,enumerable:gr in r?r.enumerable:n.enumerable,writable:!1})}return vr(e,t,r)}:vr:function(e,t,r){if(hr(e),t=pr(t),hr(r),lr)try{return vr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw _r("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Sr=nr,br=X,Tr=x?function(e,t,r){return Sr.f(e,t,br(1,r))}:function(e,t,r){return e[t]=r,e},Ir={exports:{}},Ar=ve,Rr=at,Cr=ee(Function.toString);Ar(Rr.inspectSource)||(Rr.inspectSource=function(e){return Cr(e)});var Or,wr,Nr,kr=Rr.inspectSource,Dr=ve,Pr=kr,Mr=M.WeakMap,Ur=Dr(Mr)&&/native code/.test(Pr(Mr)),Lr=et.exports,xr=gt,Br=Lr("keys"),Vr=function(e){return Br[e]||(Br[e]=xr(e))},jr={},Fr=Ur,Gr=M,zr=ee,Hr=ge,Wr=Tr,Yr=ht,Kr=at,Xr=Vr,qr=jr,Jr="Object already initialized",Zr=Gr.TypeError,$r=Gr.WeakMap;if(Fr||Kr.state){var Qr=Kr.state||(Kr.state=new $r),en=zr(Qr.get),tn=zr(Qr.has),rn=zr(Qr.set);Or=function(e,t){if(tn(Qr,e))throw new Zr(Jr);return t.facade=e,rn(Qr,e,t),t},wr=function(e){return en(Qr,e)||{}},Nr=function(e){return tn(Qr,e)}}else{var nn=Xr("state");qr[nn]=!0,Or=function(e,t){if(Yr(e,nn))throw new Zr(Jr);return t.facade=e,Wr(e,nn,t),t},wr=function(e){return Yr(e,nn)?e[nn]:{}},Nr=function(e){return Yr(e,nn)}}var on={set:Or,get:wr,has:Nr,enforce:function(e){return Nr(e)?wr(e):Or(e,{})},getterFor:function(e){return function(t){var r;if(!Hr(t)||(r=wr(t)).type!==e)throw Zr("Incompatible receiver, "+e+" required");return r}}},an=x,sn=ht,cn=Function.prototype,un=an&&Object.getOwnPropertyDescriptor,dn=sn(cn,"name"),ln={EXISTS:dn,PROPER:dn&&"something"===function(){}.name,CONFIGURABLE:dn&&(!an||an&&un(cn,"name").configurable)},fn=M,hn=ve,pn=ht,_n=Tr,vn=nt,mn=kr,gn=ln.CONFIGURABLE,yn=on.get,En=on.enforce,Sn=String(String).split("String");(Ir.exports=function(e,t,r,n){var i,o=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:t;hn(r)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!pn(r,"name")||gn&&r.name!==c)&&_n(r,"name",c),(i=En(r)).source||(i.source=Sn.join("string"==typeof c?c:""))),e!==fn?(o?!s&&e[t]&&(a=!0):delete e[t],a?e[t]=r:_n(e,t,r)):a?e[t]=r:vn(t,r)})(Function.prototype,"toString",(function(){return hn(this)&&yn(this).source||mn(this)}));var bn={},Tn=Math.ceil,In=Math.floor,An=function(e){var t=+e;return t!=t||0===t?0:(t>0?In:Tn)(t)},Rn=An,Cn=Math.max,On=Math.min,wn=function(e,t){var r=Rn(e);return r<0?Cn(r+t,0):On(r,t)},Nn=An,kn=Math.min,Dn=function(e){return e>0?kn(Nn(e),9007199254740991):0},Pn=Dn,Mn=function(e){return Pn(e.length)},Un=_e,Ln=wn,xn=Mn,Bn=function(e){return function(t,r,n){var i,o=Un(t),a=xn(o),s=Ln(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},Vn={includes:Bn(!0),indexOf:Bn(!1)},jn=ht,Fn=_e,Gn=Vn.indexOf,zn=jr,Hn=ee([].push),Wn=function(e,t){var r,n=Fn(e),i=0,o=[];for(r in n)!jn(zn,r)&&jn(n,r)&&Hn(o,r);for(;t.length>i;)jn(n,r=t[i++])&&(~Gn(o,r)||Hn(o,r));return o},Yn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Kn=Wn,Xn=Yn.concat("length","prototype");bn.f=Object.getOwnPropertyNames||function(e){return Kn(e,Xn)};var qn={};qn.f=Object.getOwnPropertySymbols;var Jn=be,Zn=bn,$n=qn,Qn=ur,ei=ee([].concat),ti=Jn("Reflect","ownKeys")||function(e){var t=Zn.f(Qn(e)),r=$n.f;return r?ei(t,r(e)):t},ri=ht,ni=ti,ii=U,oi=nr,ai=L,si=ve,ci=/#|\.prototype\./,ui=function(e,t){var r=li[di(e)];return r==hi||r!=fi&&(si(t)?ai(t):!!t)},di=ui.normalize=function(e){return String(e).replace(ci,".").toLowerCase()},li=ui.data={},fi=ui.NATIVE="N",hi=ui.POLYFILL="P",pi=ui,_i=M,vi=U.f,mi=Tr,gi=Ir.exports,yi=nt,Ei=function(e,t,r){for(var n=ni(t),i=oi.f,o=ii.f,a=0;a<n.length;a++){var s=n[a];ri(e,s)||r&&ri(r,s)||i(e,s,o(t,s))}},Si=pi,bi=function(e,t){var r,n,i,o,a,s=e.target,c=e.global,u=e.stat;if(r=c?_i:u?_i[s]||yi(s,{}):(_i[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=vi(r,n))&&a.value:r[n],!Si(c?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Ei(o,i)}(e.sham||i&&i.sham)&&mi(o,"sham",!0),gi(r,n,o,e)}},Ti=bi,Ii=ee,Ai=M.Date,Ri=Ii(Ai.prototype.getTime);Ti({target:"Date",stat:!0},{now:function(){return Ri(new Ai)}});var Ci=ee,Oi=Ir.exports,wi=Date.prototype,Ni="Invalid Date",ki="toString",Di=Ci(wi.toString),Pi=Ci(wi.getTime);String(new Date(NaN))!=Ni&&Oi(wi,ki,(function(){var e=Pi(this);return e==e?Di(this):Ni}));let Mi=!0,Ui=!0;function Li(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function xi(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Bi(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Mi=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Vi(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ui=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function ji(){if("object"==typeof window){if(Mi)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function Fi(e,t){Ui&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Gi(e){return"[object Object]"===Object.prototype.toString.call(e)}function zi(e){return Gi(e)?Object.keys(e).reduce((function(t,r){const n=Gi(e[r]),i=n?zi(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function Hi(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?Hi(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{Hi(e,e.get(t),r)}))})))}function Wi(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&Hi(e,r,i)}))})),i}const Yi=ji;function Ki(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const a=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let a=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&r.length&&t.includes("back")&&(a=r[r.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=n(e.video),Yi("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return Yi("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function Xi(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function qi(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else xi(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Ji(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Zi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function $i(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Wi(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),xi(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Wi(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Qi(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function eo(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Qi(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}function a(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find((e=>e.track===t));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function to(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function ro(e,t){xi(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}var no=Object.freeze({__proto__:null,shimMediaStream:Xi,shimOnTrack:qi,shimGetSendersWithDtmf:Ji,shimGetStats:Zi,shimSenderReceiverGetStats:$i,shimAddTrackRemoveTrackWithNative:Qi,shimAddTrackRemoveTrack:eo,shimPeerConnection:to,fixNegotiationNeeded:ro,shimGetUserMedia:Ki,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function io(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){Fi("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function oo(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ao(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function so(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function co(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),xi(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function uo(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){Fi("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function lo(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function fo(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],r=e&&"sendEncodings"in e;r&&e.sendEncodings.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function ho(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function po(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function _o(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var vo=Object.freeze({__proto__:null,shimOnTrack:oo,shimPeerConnection:ao,shimSenderGetStats:so,shimReceiverGetStats:co,shimRemoveStream:uo,shimRTCDataChannel:lo,shimAddTransceiver:fo,shimGetParameters:ho,shimCreateOffer:po,shimCreateAnswer:_o,shimGetUserMedia:io,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}});function mo(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function go(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function yo(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=s,s=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=s,s=function(e,t,r){const n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=s}function Eo(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r(So(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function So(e){return e&&void 0!==e.video?Object.assign({},e,{video:zi(e.video)}):e}function bo(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];!n.hasOwnProperty("urls")&&n.hasOwnProperty("url")?(Fi("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function To(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Io(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function Ao(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ro=Object.freeze({__proto__:null,shimLocalStreamsAPI:mo,shimRemoteStreamsAPI:go,shimCallbacksAPI:yo,shimGetUserMedia:Eo,shimConstraints:So,shimRTCIceServerUrls:bo,shimTrackEventTransceiver:To,shimCreateOfferLegacy:Io,shimAudioContext:Ao}),Co={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){let t=e.substr(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},t.parseSsrcGroup=function(e){const t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substr(6)},t.parseFingerprint=function(e){const t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");for(let i=3;i<n.length;i++){const o=n[i],a=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){const n=t.parseRtpMap(a),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[0].ssrc;let c;const u=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substr(17).split(" ").map((e=>parseInt(e,10)))));u.length>0&&u[0].length>1&&u[0][0]===s&&(c=u[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&s&&r.push({ssrc:s});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=d}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substr(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substr(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:r.fmt,maxMessageSize:i};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substr(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substr(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(Co);var Oo=Co.exports,wo=Object.freeze(e({__proto__:null,default:Oo},[Co.exports]));function No(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Oo.parseCandidate(e.candidate),i=Object.assign(r,n);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,xi(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function ko(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=function(e){if(!e||!e.sdp)return!1;const t=Oo.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Oo.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r},i=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r},o=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Oo.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(r(arguments[0])){const e=n(arguments[0]),t=i(e),r=o(arguments[0],e);let a;a=0===t&&0===r?Number.POSITIVE_INFINITY:0===t||0===r?Math.max(t,r):Math.min(t,r);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>a}),this._sctp=s}return a.apply(this,arguments)}}function Do(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},xi(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Po(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function Mo(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function Uo(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Lo(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return r.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>r.apply(this,[e])))})}var xo=Object.freeze({__proto__:null,shimRTCIceCandidate:No,shimMaxMessageSize:ko,shimSendThrowTypeError:Do,shimConnectionState:Po,removeExtmapAllowMixed:Mo,shimAddIceCandidateNullOrEmpty:Uo,shimParameterlessSetLocalDescription:Lo});!function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=ji,n=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=Li(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=Li(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=Li(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),i={browserDetails:n,commonShim:xo,extractVersion:Li,disableLog:Bi,disableWarnings:Vi,sdp:wo};switch(n.browser){case"chrome":if(!no||!to||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(null===n.version)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=no,Uo(e,n),Lo(e),Ki(e,n),Xi(e),to(e,n),qi(e),eo(e,n),Ji(e),Zi(e),$i(e),ro(e,n),No(e),Po(e),ko(e,n),Do(e),Mo(e,n);break;case"firefox":if(!vo||!ao||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=vo,Uo(e,n),Lo(e),io(e,n),ao(e,n),oo(e),uo(e),so(e),co(e),lo(e),fo(e),ho(e),po(e),_o(e),No(e),Po(e),ko(e,n),Do(e);break;case"safari":if(!Ro||!t.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=Ro,Uo(e,n),Lo(e),bo(e),Io(e),yo(e),mo(e),go(e),To(e),Eo(e),Ao(e),No(e),ko(e,n),Do(e),Mo(e,n);break;default:r("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});var Bo={},Vo=Wn,jo=Yn,Fo=Object.keys||function(e){return Vo(e,jo)},Go=x,zo=ir,Ho=nr,Wo=ur,Yo=_e,Ko=Fo;Bo.f=Go&&!zo?Object.defineProperties:function(e,t){Wo(e);for(var r,n=Yo(t),i=Ko(t),o=i.length,a=0;o>a;)Ho.f(e,r=i[a++],n[r]);return e};var Xo,qo=be("document","documentElement"),Jo=ur,Zo=Bo,$o=Yn,Qo=jr,ea=qo,ta=Wt,ra=Vr("IE_PROTO"),na=function(){},ia=function(e){return"<script>"+e+"</"+"script>"},oa=function(e){e.write(ia("")),e.close();var t=e.parentWindow.Object;return e=null,t},aa=function(){try{Xo=new ActiveXObject("htmlfile")}catch(e){}var e,t;aa="undefined"!=typeof document?document.domain&&Xo?oa(Xo):((t=ta("iframe")).style.display="none",ea.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ia("document.F=Object")),e.close(),e.F):oa(Xo);for(var r=$o.length;r--;)delete aa.prototype[$o[r]];return aa()};Qo[ra]=!0;var sa=Object.create||function(e,t){var r;return null!==e?(na.prototype=Jo(e),r=new na,na.prototype=null,r[ra]=e):r=aa(),void 0===t?r:Zo.f(r,t)},ca=sa,ua=nr,da=wt("unscopables"),la=Array.prototype;null==la[da]&&ua.f(la,da,{configurable:!0,value:ca(null)});var fa,ha,pa,_a=function(e){la[da][e]=!0},va={},ma=!L((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ga=M,ya=ht,Ea=ve,Sa=dt,ba=ma,Ta=Vr("IE_PROTO"),Ia=ga.Object,Aa=Ia.prototype,Ra=ba?Ia.getPrototypeOf:function(e){var t=Sa(e);if(ya(t,Ta))return t[Ta];var r=t.constructor;return Ea(r)&&t instanceof r?r.prototype:t instanceof Ia?Aa:null},Ca=L,Oa=ve,wa=Ra,Na=Ir.exports,ka=wt("iterator"),Da=!1;[].keys&&("next"in(pa=[].keys())?(ha=wa(wa(pa)))!==Object.prototype&&(fa=ha):Da=!0);var Pa=null==fa||Ca((function(){var e={};return fa[ka].call(e)!==e}));Pa&&(fa={}),Oa(fa[ka])||Na(fa,ka,(function(){return this}));var Ma={IteratorPrototype:fa,BUGGY_SAFARI_ITERATORS:Da},Ua=nr.f,La=ht,xa=wt("toStringTag"),Ba=function(e,t,r){e&&!r&&(e=e.prototype),e&&!La(e,xa)&&Ua(e,xa,{configurable:!0,value:t})},Va=Ma.IteratorPrototype,ja=sa,Fa=X,Ga=Ba,za=va,Ha=function(){return this},Wa=function(e,t,r,n){var i=t+" Iterator";return e.prototype=ja(Va,{next:Fa(+!n,r)}),Ga(e,i,!1),za[i]=Ha,e},Ya=M,Ka=ve,Xa=Ya.String,qa=Ya.TypeError,Ja=ee,Za=ur,$a=function(e){if("object"==typeof e||Ka(e))return e;throw qa("Can't set "+Xa(e)+" as a prototype")},Qa=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Ja(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Za(r),$a(n),t?e(r,n):r.__proto__=n,r}}():void 0),es=bi,ts=F,rs=ln,ns=ve,is=Wa,os=Ra,as=Qa,ss=Ba,cs=Tr,us=Ir.exports,ds=va,ls=rs.PROPER,fs=rs.CONFIGURABLE,hs=Ma.IteratorPrototype,ps=Ma.BUGGY_SAFARI_ITERATORS,_s=wt("iterator"),vs="keys",ms="values",gs="entries",ys=function(){return this},Es=function(e,t,r,n,i,o,a){is(r,t,n);var s,c,u,d=function(e){if(e===i&&_)return _;if(!ps&&e in h)return h[e];switch(e){case vs:case ms:case gs:return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,h=e.prototype,p=h[_s]||h["@@iterator"]||i&&h[i],_=!ps&&p||d(i),v="Array"==t&&h.entries||p;if(v&&(s=os(v.call(new e)))!==Object.prototype&&s.next&&(os(s)!==hs&&(as?as(s,hs):ns(s[_s])||us(s,_s,ys)),ss(s,l,!0)),ls&&i==ms&&p&&p.name!==ms&&(fs?cs(h,"name",ms):(f=!0,_=function(){return ts(p,this)})),i)if(c={values:d(ms),keys:o?_:d(vs),entries:d(gs)},a)for(u in c)(ps||f||!(u in h))&&us(h,u,c[u]);else es({target:t,proto:!0,forced:ps||f},c);return h[_s]!==_&&us(h,_s,_,{name:i}),ds[t]=_,c},Ss=_e,bs=_a,Ts=va,Is=on,As=nr.f,Rs=Es,Cs=x,Os="Array Iterator",ws=Is.set,Ns=Is.getterFor(Os),ks=Rs(Array,"Array",(function(e,t){ws(this,{type:Os,target:Ss(e),index:0,kind:t})}),(function(){var e=Ns(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Ds=Ts.Arguments=Ts.Array;if(bs("keys"),bs("values"),bs("entries"),Cs&&"values"!==Ds.name)try{As(Ds,"name",{value:"values"})}catch(e){}var Ps={exports:{}},Ms={},Us=Ft,Ls=nr,xs=X,Bs=function(e,t,r){var n=Us(t);n in e?Ls.f(e,n,xs(0,r)):e[n]=r},Vs=wn,js=Mn,Fs=Bs,Gs=M.Array,zs=Math.max,Hs=function(e,t,r){for(var n=js(e),i=Vs(t,n),o=Vs(void 0===r?n:r,n),a=Gs(zs(o-i,0)),s=0;i<o;i++,s++)Fs(a,s,e[i]);return a.length=s,a},Ws=ie,Ys=_e,Ks=bn.f,Xs=Hs,qs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Ms.f=function(e){return qs&&"Window"==Ws(e)?function(e){try{return Ks(e)}catch(e){return Xs(qs)}}(e):Ks(Ys(e))};var Js=L((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Zs=L,$s=ge,Qs=ie,ec=Js,tc=Object.isExtensible,rc=Zs((function(){tc(1)}))||ec?function(e){return!!$s(e)&&((!ec||"ArrayBuffer"!=Qs(e))&&(!tc||tc(e)))}:tc,nc=!L((function(){return Object.isExtensible(Object.preventExtensions({}))})),ic=bi,oc=ee,ac=jr,sc=ge,cc=ht,uc=nr.f,dc=bn,lc=Ms,fc=rc,hc=nc,pc=!1,_c=gt("meta"),vc=0,mc=function(e){uc(e,_c,{value:{objectID:"O"+vc++,weakData:{}}})},gc=Ps.exports={enable:function(){gc.enable=function(){},pc=!0;var e=dc.f,t=oc([].splice),r={};r[_c]=1,e(r).length&&(dc.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===_c){t(n,i,1);break}return n},ic({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:lc.f}))},fastKey:function(e,t){if(!sc(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!cc(e,_c)){if(!fc(e))return"F";if(!t)return"E";mc(e)}return e[_c].objectID},getWeakData:function(e,t){if(!cc(e,_c)){if(!fc(e))return!0;if(!t)return!1;mc(e)}return e[_c].weakData},onFreeze:function(e){return hc&&pc&&fc(e)&&!cc(e,_c)&&mc(e),e}};ac[_c]=!0;var yc=Ke,Ec=B,Sc=ee(ee.bind),bc=function(e,t){return yc(e),void 0===t?e:Ec?Sc(e,t):function(){return e.apply(t,arguments)}},Tc=va,Ic=wt("iterator"),Ac=Array.prototype,Rc=function(e){return void 0!==e&&(Tc.Array===e||Ac[Ic]===e)},Cc={};Cc[wt("toStringTag")]="z";var Oc="[object z]"===String(Cc),wc=M,Nc=Oc,kc=ve,Dc=ie,Pc=wt("toStringTag"),Mc=wc.Object,Uc="Arguments"==Dc(function(){return arguments}()),Lc=Nc?Dc:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Mc(e),Pc))?r:Uc?Dc(t):"Object"==(n=Dc(t))&&kc(t.callee)?"Arguments":n},xc=Lc,Bc=qe,Vc=va,jc=wt("iterator"),Fc=function(e){if(null!=e)return Bc(e,jc)||Bc(e,"@@iterator")||Vc[xc(e)]},Gc=F,zc=Ke,Hc=ur,Wc=ze,Yc=Fc,Kc=M.TypeError,Xc=function(e,t){var r=arguments.length<2?Yc(e):t;if(zc(r))return Hc(Gc(r,e));throw Kc(Wc(e)+" is not iterable")},qc=F,Jc=ur,Zc=qe,$c=function(e,t,r){var n,i;Jc(e);try{if(!(n=Zc(e,"return"))){if("throw"===t)throw r;return r}n=qc(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Jc(n),r},Qc=bc,eu=F,tu=ur,ru=ze,nu=Rc,iu=Mn,ou=Te,au=Xc,su=Fc,cu=$c,uu=M.TypeError,du=function(e,t){this.stopped=e,this.result=t},lu=du.prototype,fu=function(e,t,r){var n,i,o,a,s,c,u,d=r&&r.that,l=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),p=Qc(t,d),_=function(e){return n&&cu(n,"normal",e),new du(!0,e)},v=function(e){return l?(tu(e),h?p(e[0],e[1],_):p(e[0],e[1])):h?p(e,_):p(e)};if(f)n=e;else{if(!(i=su(e)))throw uu(ru(e)+" is not iterable");if(nu(i)){for(o=0,a=iu(e);a>o;o++)if((s=v(e[o]))&&ou(lu,s))return s;return new du(!1)}n=au(e,i)}for(c=n.next;!(u=eu(c,n)).done;){try{s=v(u.value)}catch(e){cu(n,"throw",e)}if("object"==typeof s&&s&&ou(lu,s))return s}return new du(!1)},hu=Te,pu=M.TypeError,_u=function(e,t){if(hu(t,e))return e;throw pu("Incorrect invocation")},vu=wt("iterator"),mu=!1;try{var gu=0,yu={next:function(){return{done:!!gu++}},return:function(){mu=!0}};yu[vu]=function(){return this},Array.from(yu,(function(){throw 2}))}catch(e){}var Eu=function(e,t){if(!t&&!mu)return!1;var r=!1;try{var n={};n[vu]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Su=ve,bu=ge,Tu=Qa,Iu=function(e,t,r){var n,i;return Tu&&Su(n=t.constructor)&&n!==r&&bu(i=n.prototype)&&i!==r.prototype&&Tu(e,i),e},Au=bi,Ru=M,Cu=ee,Ou=pi,wu=Ir.exports,Nu=Ps.exports,ku=fu,Du=_u,Pu=ve,Mu=ge,Uu=L,Lu=Eu,xu=Ba,Bu=Iu,Vu=function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=n?"set":"add",a=Ru[e],s=a&&a.prototype,c=a,u={},d=function(e){var t=Cu(s[e]);wu(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!Mu(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!Mu(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!Mu(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(Ou(e,!Pu(a)||!(i||s.forEach&&!Uu((function(){(new a).entries().next()})))))c=r.getConstructor(t,e,n,o),Nu.enable();else if(Ou(e,!0)){var l=new c,f=l[o](i?{}:-0,1)!=l,h=Uu((function(){l.has(1)})),p=Lu((function(e){new a(e)})),_=!i&&Uu((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((c=t((function(e,t){Du(e,s);var r=Bu(new a,e,c);return null!=t&&ku(t,r[o],{that:r,AS_ENTRIES:n}),r}))).prototype=s,s.constructor=c),(h||_)&&(d("delete"),d("has"),n&&d("get")),(_||f)&&d(o),i&&s.clear&&delete s.clear}return u[e]=c,Au({global:!0,forced:c!=a},u),xu(c,e),i||r.setStrong(c,e,n),c},ju=Ir.exports,Fu=function(e,t,r){for(var n in t)ju(e,n,t[n],r);return e},Gu=be,zu=nr,Hu=x,Wu=wt("species"),Yu=function(e){var t=Gu(e),r=zu.f;Hu&&t&&!t[Wu]&&r(t,Wu,{configurable:!0,get:function(){return this}})},Ku=nr.f,Xu=sa,qu=Fu,Ju=bc,Zu=_u,$u=fu,Qu=Es,ed=Yu,td=x,rd=Ps.exports.fastKey,nd=on.set,id=on.getterFor,od={getConstructor:function(e,t,r,n){var i=e((function(e,i){Zu(e,o),nd(e,{type:t,index:Xu(null),first:void 0,last:void 0,size:0}),td||(e.size=0),null!=i&&$u(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=id(t),s=function(e,t,r){var n,i,o=a(e),s=c(e,t);return s?s.value=r:(o.last=s={index:i=rd(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),td?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var r,n=a(e),i=rd(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return qu(o,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,td?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=c(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),td?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=Ju(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),qu(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),td&&Ku(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=id(t),o=id(n);Qu(e,t,(function(e,t){nd(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),ed(t)}};Vu("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),od);var ad=Lc,sd=Oc?{}.toString:function(){return"[object "+ad(this)+"]"},cd=Oc,ud=Ir.exports,dd=sd;cd||ud(Object.prototype,"toString",dd,{unsafe:!0});var ld=Lc,fd=M.String,hd=function(e){if("Symbol"===ld(e))throw TypeError("Cannot convert a Symbol value to a string");return fd(e)},pd=ee,_d=An,vd=hd,md=fe,gd=pd("".charAt),yd=pd("".charCodeAt),Ed=pd("".slice),Sd=function(e){return function(t,r){var n,i,o=vd(md(t)),a=_d(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=yd(o,a))<55296||n>56319||a+1===s||(i=yd(o,a+1))<56320||i>57343?e?gd(o,a):n:e?Ed(o,a,a+2):i-56320+(n-55296<<10)+65536}},bd={codeAt:Sd(!1),charAt:Sd(!0)},Td=bd.charAt,Id=hd,Ad=on,Rd=Es,Cd="String Iterator",Od=Ad.set,wd=Ad.getterFor(Cd);Rd(String,"String",(function(e){Od(this,{type:Cd,string:Id(e),index:0})}),(function(){var e,t=wd(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Td(r,n),t.index+=e.length,{value:e,done:!1})}));var Nd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},kd=Wt("span").classList,Dd=kd&&kd.constructor&&kd.constructor.prototype,Pd=Dd===Object.prototype?void 0:Dd,Md=M,Ud=Nd,Ld=Pd,xd=ks,Bd=Tr,Vd=wt,jd=Vd("iterator"),Fd=Vd("toStringTag"),Gd=xd.values,zd=function(e,t){if(e){if(e[jd]!==Gd)try{Bd(e,jd,Gd)}catch(t){e[jd]=Gd}if(e[Fd]||Bd(e,Fd,t),Ud[t])for(var r in xd)if(e[r]!==xd[r])try{Bd(e,r,xd[r])}catch(t){e[r]=xd[r]}}};for(var Hd in Ud)zd(Md[Hd]&&Md[Hd].prototype,Hd);zd(Ld,"DOMTokenList");var Wd=bi,Yd=x,Kd=nr.f;Wd({target:"Object",stat:!0,forced:Object.defineProperty!==Kd,sham:!Yd},{defineProperty:Kd});var Xd=ee([].slice),qd=ee,Jd=Ke,Zd=ge,$d=ht,Qd=Xd,el=B,tl=M.Function,rl=qd([].concat),nl=qd([].join),il={},ol=function(e,t,r){if(!$d(il,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";il[t]=tl("C,a","return new C("+nl(n,",")+")")}return il[t](e,r)},al=el?tl.bind:function(e){var t=Jd(this),r=t.prototype,n=Qd(arguments,1),i=function(){var r=rl(n,Qd(arguments));return this instanceof i?ol(t,r.length,r):t.apply(e,r)};return Zd(r)&&(i.prototype=r),i},sl=al;bi({target:"Function",proto:!0,forced:Function.bind!==sl},{bind:sl});var cl=L,ul=function(e,t){var r=[][e];return!!r&&cl((function(){r.call(null,t||function(){throw 1},1)}))},dl=bi,ll=de,fl=_e,hl=ul,pl=ee([].join),_l=ll!=Object,vl=hl("join",",");dl({target:"Array",proto:!0,forced:_l||!vl},{join:function(e){return pl(fl(this),void 0===e?",":e)}});var ml=ie,gl=Array.isArray||function(e){return"Array"==ml(e)},yl=ee,El=L,Sl=ve,bl=Lc,Tl=kr,Il=function(){},Al=[],Rl=be("Reflect","construct"),Cl=/^\s*(?:class|function)\b/,Ol=yl(Cl.exec),wl=!Cl.exec(Il),Nl=function(e){if(!Sl(e))return!1;try{return Rl(Il,Al,e),!0}catch(e){return!1}},kl=function(e){if(!Sl(e))return!1;switch(bl(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return wl||!!Ol(Cl,Tl(e))}catch(e){return!0}};kl.sham=!0;var Dl=!Rl||El((function(){var e;return Nl(Nl.call)||!Nl(Object)||!Nl((function(){e=!0}))||e}))?kl:Nl,Pl=M,Ml=gl,Ul=Dl,Ll=ge,xl=wt("species"),Bl=Pl.Array,Vl=function(e){var t;return Ml(e)&&(t=e.constructor,(Ul(t)&&(t===Bl||Ml(t.prototype))||Ll(t)&&null===(t=t[xl]))&&(t=void 0)),void 0===t?Bl:t},jl=function(e,t){return new(Vl(e))(0===t?0:t)},Fl=bc,Gl=de,zl=dt,Hl=Mn,Wl=jl,Yl=ee([].push),Kl=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,d,l){for(var f,h,p=zl(c),_=Gl(p),v=Fl(u,d),m=Hl(_),g=0,y=l||Wl,E=t?y(c,m):r||a?y(c,0):void 0;m>g;g++)if((s||g in _)&&(h=v(f=_[g],g,p),e))if(t)E[g]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return g;case 2:Yl(E,f)}else switch(e){case 4:return!1;case 7:Yl(E,f)}return o?-1:n||i?i:E}},Xl={forEach:Kl(0),map:Kl(1),filter:Kl(2),some:Kl(3),every:Kl(4),find:Kl(5),findIndex:Kl(6),filterReject:Kl(7)},ql=Xl.forEach,Jl=ul("forEach")?[].forEach:function(e){return ql(this,e,arguments.length>1?arguments[1]:void 0)};bi({target:"Array",proto:!0,forced:[].forEach!=Jl},{forEach:Jl});var Zl=M,$l=Nd,Ql=Pd,ef=Jl,tf=Tr,rf=function(e){if(e&&e.forEach!==ef)try{tf(e,"forEach",ef)}catch(t){e.forEach=ef}};for(var nf in $l)$l[nf]&&rf(Zl[nf]&&Zl[nf].prototype);rf(Ql);var of=bi,af=Xl.find,sf=_a,cf="find",uf=!0;cf in[]&&Array(1).find((function(){uf=!1})),of({target:"Array",proto:!0,forced:uf},{find:function(e){return af(this,e,arguments.length>1?arguments[1]:void 0)}}),sf(cf);var df=L,lf=ke,ff=wt("species"),hf=function(e){return lf>=51||!df((function(){var t=[];return(t.constructor={})[ff]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},pf=bi,_f=M,vf=L,mf=gl,gf=ge,yf=dt,Ef=Mn,Sf=Bs,bf=jl,Tf=hf,If=ke,Af=wt("isConcatSpreadable"),Rf=9007199254740991,Cf="Maximum allowed index exceeded",Of=_f.TypeError,wf=If>=51||!vf((function(){var e=[];return e[Af]=!1,e.concat()[0]!==e})),Nf=Tf("concat"),kf=function(e){if(!gf(e))return!1;var t=e[Af];return void 0!==t?!!t:mf(e)};pf({target:"Array",proto:!0,forced:!wf||!Nf},{concat:function(e){var t,r,n,i,o,a=yf(this),s=bf(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(kf(o=-1===t?a:arguments[t])){if(c+(i=Ef(o))>Rf)throw Of(Cf);for(r=0;r<i;r++,c++)r in o&&Sf(s,c,o[r])}else{if(c>=Rf)throw Of(Cf);Sf(s,c++,o)}return s.length=c,s}});var Df,Pf,Mf,Uf,Lf=M.Promise,xf=Dl,Bf=ze,Vf=M.TypeError,jf=function(e){if(xf(e))return e;throw Vf(Bf(e)+" is not a constructor")},Ff=ur,Gf=jf,zf=wt("species"),Hf=function(e,t){var r,n=Ff(e).constructor;return void 0===n||null==(r=Ff(n)[zf])?t:Gf(r)},Wf=B,Yf=Function.prototype,Kf=Yf.apply,Xf=Yf.call,qf="object"==typeof Reflect&&Reflect.apply||(Wf?Xf.bind(Kf):function(){return Xf.apply(Kf,arguments)}),Jf=M.TypeError,Zf=function(e,t){if(e<t)throw Jf("Not enough arguments");return e},$f=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ie),Qf="process"==ie(M.process),eh=M,th=qf,rh=bc,nh=ve,ih=ht,oh=L,ah=qo,sh=Xd,ch=Wt,uh=Zf,dh=$f,lh=Qf,fh=eh.setImmediate,hh=eh.clearImmediate,ph=eh.process,_h=eh.Dispatch,vh=eh.Function,mh=eh.MessageChannel,gh=eh.String,yh=0,Eh={},Sh="onreadystatechange";try{Df=eh.location}catch(e){}var bh=function(e){if(ih(Eh,e)){var t=Eh[e];delete Eh[e],t()}},Th=function(e){return function(){bh(e)}},Ih=function(e){bh(e.data)},Ah=function(e){eh.postMessage(gh(e),Df.protocol+"//"+Df.host)};fh&&hh||(fh=function(e){uh(arguments.length,1);var t=nh(e)?e:vh(e),r=sh(arguments,1);return Eh[++yh]=function(){th(t,void 0,r)},Pf(yh),yh},hh=function(e){delete Eh[e]},lh?Pf=function(e){ph.nextTick(Th(e))}:_h&&_h.now?Pf=function(e){_h.now(Th(e))}:mh&&!dh?(Uf=(Mf=new mh).port2,Mf.port1.onmessage=Ih,Pf=rh(Uf.postMessage,Uf)):eh.addEventListener&&nh(eh.postMessage)&&!eh.importScripts&&Df&&"file:"!==Df.protocol&&!oh(Ah)?(Pf=Ah,eh.addEventListener("message",Ih,!1)):Pf=Sh in ch("script")?function(e){ah.appendChild(ch("script")).onreadystatechange=function(){ah.removeChild(this),bh(e)}}:function(e){setTimeout(Th(e),0)});var Rh,Ch,Oh,wh,Nh,kh,Dh,Ph,Mh={set:fh,clear:hh},Uh=M,Lh=/ipad|iphone|ipod/i.test(Ie)&&void 0!==Uh.Pebble,xh=/web0s(?!.*chrome)/i.test(Ie),Bh=M,Vh=bc,jh=U.f,Fh=Mh.set,Gh=$f,zh=Lh,Hh=xh,Wh=Qf,Yh=Bh.MutationObserver||Bh.WebKitMutationObserver,Kh=Bh.document,Xh=Bh.process,qh=Bh.Promise,Jh=jh(Bh,"queueMicrotask"),Zh=Jh&&Jh.value;Zh||(Rh=function(){var e,t;for(Wh&&(e=Xh.domain)&&e.exit();Ch;){t=Ch.fn,Ch=Ch.next;try{t()}catch(e){throw Ch?wh():Oh=void 0,e}}Oh=void 0,e&&e.enter()},Gh||Wh||Hh||!Yh||!Kh?!zh&&qh&&qh.resolve?((Dh=qh.resolve(void 0)).constructor=qh,Ph=Vh(Dh.then,Dh),wh=function(){Ph(Rh)}):Wh?wh=function(){Xh.nextTick(Rh)}:(Fh=Vh(Fh,Bh),wh=function(){Fh(Rh)}):(Nh=!0,kh=Kh.createTextNode(""),new Yh(Rh).observe(kh,{characterData:!0}),wh=function(){kh.data=Nh=!Nh}));var $h=Zh||function(e){var t={fn:e,next:void 0};Oh&&(Oh.next=t),Ch||(Ch=t,wh()),Oh=t},Qh={},ep=Ke,tp=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=ep(t),this.reject=ep(r)};Qh.f=function(e){return new tp(e)};var rp=ur,np=ge,ip=Qh,op=M,ap=function(){this.head=null,this.tail=null};ap.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var sp,cp,up,dp,lp=ap,fp="object"==typeof window,hp=bi,pp=M,_p=be,vp=F,mp=Lf,gp=Ir.exports,yp=Fu,Ep=Qa,Sp=Ba,bp=Yu,Tp=Ke,Ip=ve,Ap=ge,Rp=_u,Cp=kr,Op=fu,wp=Eu,Np=Hf,kp=Mh.set,Dp=$h,Pp=function(e,t){if(rp(e),np(t)&&t.constructor===e)return t;var r=ip.f(e);return(0,r.resolve)(t),r.promise},Mp=function(e,t){var r=op.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Up=Qh,Lp=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},xp=lp,Bp=on,Vp=pi,jp=fp,Fp=Qf,Gp=ke,zp=wt("species"),Hp="Promise",Wp=Bp.getterFor(Hp),Yp=Bp.set,Kp=Bp.getterFor(Hp),Xp=mp&&mp.prototype,qp=mp,Jp=Xp,Zp=pp.TypeError,$p=pp.document,Qp=pp.process,e_=Up.f,t_=e_,r_=!!($p&&$p.createEvent&&pp.dispatchEvent),n_=Ip(pp.PromiseRejectionEvent),i_="unhandledrejection",o_=!1,a_=Vp(Hp,(function(){var e=Cp(qp),t=e!==String(qp);if(!t&&66===Gp)return!0;if(Gp>=51&&/native code/.test(e))return!1;var r=new qp((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[zp]=n,!(o_=r.then((function(){}))instanceof n)||!t&&jp&&!n_})),s_=a_||!wp((function(e){qp.all(e).catch((function(){}))})),c_=function(e){var t;return!(!Ap(e)||!Ip(t=e.then))&&t},u_=function(e,t){var r,n,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&p_(t),t.rejection=1),!0===s?r=o:(d&&d.enter(),r=s(o),d&&(d.exit(),i=!0)),r===e.promise?u(Zp("Promise-chain cycle")):(n=c_(r))?vp(n,r,c,u):c(r)):u(o)}catch(e){d&&!i&&d.exit(),u(e)}},d_=function(e,t){e.notified||(e.notified=!0,Dp((function(){for(var r,n=e.reactions;r=n.get();)u_(r,e);e.notified=!1,t&&!e.rejection&&f_(e)})))},l_=function(e,t,r){var n,i;r_?((n=$p.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),pp.dispatchEvent(n)):n={promise:t,reason:r},!n_&&(i=pp["on"+e])?i(n):e===i_&&Mp("Unhandled promise rejection",r)},f_=function(e){vp(kp,pp,(function(){var t,r=e.facade,n=e.value;if(h_(e)&&(t=Lp((function(){Fp?Qp.emit("unhandledRejection",n,r):l_(i_,r,n)})),e.rejection=Fp||h_(e)?2:1,t.error))throw t.value}))},h_=function(e){return 1!==e.rejection&&!e.parent},p_=function(e){vp(kp,pp,(function(){var t=e.facade;Fp?Qp.emit("rejectionHandled",t):l_("rejectionhandled",t,e.value)}))},__=function(e,t,r){return function(n){e(t,n,r)}},v_=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,d_(e,!0))},m_=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Zp("Promise can't be resolved itself");var n=c_(t);n?Dp((function(){var r={done:!1};try{vp(n,t,__(m_,r,e),__(v_,r,e))}catch(t){v_(r,t,e)}})):(e.value=t,e.state=1,d_(e,!1))}catch(t){v_({done:!1},t,e)}}};if(a_&&(Jp=(qp=function(e){Rp(this,Jp),Tp(e),vp(sp,this);var t=Wp(this);try{e(__(m_,t),__(v_,t))}catch(e){v_(t,e)}}).prototype,(sp=function(e){Yp(this,{type:Hp,done:!1,notified:!1,parent:!1,reactions:new xp,rejection:!1,state:0,value:void 0})}).prototype=yp(Jp,{then:function(e,t){var r=Kp(this),n=e_(Np(this,qp));return r.parent=!0,n.ok=!Ip(e)||e,n.fail=Ip(t)&&t,n.domain=Fp?Qp.domain:void 0,0==r.state?r.reactions.add(n):Dp((function(){u_(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),cp=function(){var e=new sp,t=Wp(e);this.promise=e,this.resolve=__(m_,t),this.reject=__(v_,t)},Up.f=e_=function(e){return e===qp||e===up?new cp(e):t_(e)},Ip(mp)&&Xp!==Object.prototype)){dp=Xp.then,o_||(gp(Xp,"then",(function(e,t){var r=this;return new qp((function(e,t){vp(dp,r,e,t)})).then(e,t)}),{unsafe:!0}),gp(Xp,"catch",Jp.catch,{unsafe:!0}));try{delete Xp.constructor}catch(e){}Ep&&Ep(Xp,Jp)}hp({global:!0,wrap:!0,forced:a_},{Promise:qp}),Sp(qp,Hp,!1),bp(Hp),up=_p(Hp),hp({target:Hp,stat:!0,forced:a_},{reject:function(e){var t=e_(this);return vp(t.reject,void 0,e),t.promise}}),hp({target:Hp,stat:!0,forced:a_},{resolve:function(e){return Pp(this,e)}}),hp({target:Hp,stat:!0,forced:s_},{all:function(e){var t=this,r=e_(t),n=r.resolve,i=r.reject,o=Lp((function(){var r=Tp(t.resolve),o=[],a=0,s=1;Op(e,(function(e){var c=a++,u=!1;s++,vp(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=e_(t),n=r.reject,i=Lp((function(){var i=Tp(t.resolve);Op(e,(function(e){vp(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),bi({target:"Array",stat:!0},{isArray:gl});var g_=bi,y_=M,E_=gl,S_=Dl,b_=ge,T_=wn,I_=Mn,A_=_e,R_=Bs,C_=wt,O_=Xd,w_=hf("slice"),N_=C_("species"),k_=y_.Array,D_=Math.max;g_({target:"Array",proto:!0,forced:!w_},{slice:function(e,t){var r,n,i,o=A_(this),a=I_(o),s=T_(e,a),c=T_(void 0===t?a:t,a);if(E_(o)&&(r=o.constructor,(S_(r)&&(r===k_||E_(r.prototype))||b_(r)&&null===(r=r[N_]))&&(r=void 0),r===k_||void 0===r))return O_(o,s,c);for(n=new(void 0===r?k_:r)(D_(c-s,0)),i=0;s<c;s++,i++)s in o&&R_(n,i,o[s]);return n.length=i,n}});var P_=Hs,M_=Math.floor,U_=function(e,t){var r=e.length,n=M_(r/2);return r<8?L_(e,t):x_(e,U_(P_(e,0,n),t),U_(P_(e,n),t),t)},L_=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},x_=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e},B_=U_,V_=Ie.match(/firefox\/(\d+)/i),j_=!!V_&&+V_[1],F_=/MSIE|Trident/.test(Ie),G_=Ie.match(/AppleWebKit\/(\d+)\./),z_=!!G_&&+G_[1],H_=bi,W_=ee,Y_=Ke,K_=dt,X_=Mn,q_=hd,J_=L,Z_=B_,$_=ul,Q_=j_,ev=F_,tv=ke,rv=z_,nv=[],iv=W_(nv.sort),ov=W_(nv.push),av=J_((function(){nv.sort(void 0)})),sv=J_((function(){nv.sort(null)})),cv=$_("sort"),uv=!J_((function(){if(tv)return tv<70;if(!(Q_&&Q_>3)){if(ev)return!0;if(rv)return rv<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)nv.push({k:t+n,v:r})}for(nv.sort((function(e,t){return t.v-e.v})),n=0;n<nv.length;n++)t=nv[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));H_({target:"Array",proto:!0,forced:av||!sv||!cv||!uv},{sort:function(e){void 0!==e&&Y_(e);var t=K_(this);if(uv)return void 0===e?iv(t):iv(t,e);var r,n,i=[],o=X_(t);for(n=0;n<o;n++)n in t&&ov(i,t[n]);for(Z_(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:q_(t)>q_(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<o;)delete t[n++];return t}});var dv="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,lv=An,fv=Dn,hv=M.RangeError,pv=function(e){if(void 0===e)return 0;var t=lv(e),r=fv(t);if(t!==r)throw hv("Wrong length or index");return r},_v=M.Array,vv=Math.abs,mv=Math.pow,gv=Math.floor,yv=Math.log,Ev=Math.LN2,Sv={pack:function(e,t,r){var n,i,o,a=_v(r),s=8*r-t-1,c=(1<<s)-1,u=c>>1,d=23===t?mv(2,-24)-mv(2,-77):0,l=e<0||0===e&&1/e<0?1:0,f=0;for((e=vv(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=gv(yv(e)/Ev),e*(o=mv(2,-n))<1&&(n--,o*=2),(e+=n+u>=1?d/o:d*mv(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*mv(2,t),n+=u):(i=e*mv(2,u-1)*mv(2,t),n=0));t>=8;)a[f++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)a[f++]=255&n,n/=256,s-=8;return a[--f]|=128*l,a},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=n-1,u=e[c--],d=127&u;for(u>>=7;s>0;)d=256*d+e[c--],s-=8;for(r=d&(1<<-s)-1,d>>=-s,s+=t;s>0;)r=256*r+e[c--],s-=8;if(0===d)d=1-a;else{if(d===o)return r?NaN:u?-1/0:1/0;r+=mv(2,t),d-=a}return(u?-1:1)*r*mv(2,d-t)}},bv=dt,Tv=wn,Iv=Mn,Av=function(e){for(var t=bv(this),r=Iv(t),n=arguments.length,i=Tv(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:Tv(o,r);a>i;)t[i++]=e;return t},Rv=M,Cv=ee,Ov=x,wv=dv,Nv=ln,kv=Tr,Dv=Fu,Pv=L,Mv=_u,Uv=An,Lv=Dn,xv=pv,Bv=Sv,Vv=Ra,jv=Qa,Fv=bn.f,Gv=nr.f,zv=Av,Hv=Hs,Wv=Ba,Yv=Nv.PROPER,Kv=Nv.CONFIGURABLE,Xv=on.get,qv=on.set,Jv="ArrayBuffer",Zv="DataView",$v="Wrong index",Qv=Rv.ArrayBuffer,em=Qv,tm=em&&em.prototype,rm=Rv.DataView,nm=rm&&rm.prototype,im=Object.prototype,om=Rv.Array,am=Rv.RangeError,sm=Cv(zv),cm=Cv([].reverse),um=Bv.pack,dm=Bv.unpack,lm=function(e){return[255&e]},fm=function(e){return[255&e,e>>8&255]},hm=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},pm=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},_m=function(e){return um(e,23,4)},vm=function(e){return um(e,52,8)},mm=function(e,t){Gv(e.prototype,t,{get:function(){return Xv(this)[t]}})},gm=function(e,t,r,n){var i=xv(r),o=Xv(e);if(i+t>o.byteLength)throw am($v);var a=Xv(o.buffer).bytes,s=i+o.byteOffset,c=Hv(a,s,s+t);return n?c:cm(c)},ym=function(e,t,r,n,i,o){var a=xv(r),s=Xv(e);if(a+t>s.byteLength)throw am($v);for(var c=Xv(s.buffer).bytes,u=a+s.byteOffset,d=n(+i),l=0;l<t;l++)c[u+l]=d[o?l:t-l-1]};if(wv){var Em=Yv&&Qv.name!==Jv;if(Pv((function(){Qv(1)}))&&Pv((function(){new Qv(-1)}))&&!Pv((function(){return new Qv,new Qv(1.5),new Qv(NaN),Em&&!Kv})))Em&&Kv&&kv(Qv,"name",Jv);else{(em=function(e){return Mv(this,tm),new Qv(xv(e))}).prototype=tm;for(var Sm,bm=Fv(Qv),Tm=0;bm.length>Tm;)(Sm=bm[Tm++])in em||kv(em,Sm,Qv[Sm]);tm.constructor=em}jv&&Vv(nm)!==im&&jv(nm,im);var Im=new rm(new em(2)),Am=Cv(nm.setInt8);Im.setInt8(0,2147483648),Im.setInt8(1,2147483649),!Im.getInt8(0)&&Im.getInt8(1)||Dv(nm,{setInt8:function(e,t){Am(this,e,t<<24>>24)},setUint8:function(e,t){Am(this,e,t<<24>>24)}},{unsafe:!0})}else tm=(em=function(e){Mv(this,tm);var t=xv(e);qv(this,{bytes:sm(om(t),0),byteLength:t}),Ov||(this.byteLength=t)}).prototype,nm=(rm=function(e,t,r){Mv(this,nm),Mv(e,tm);var n=Xv(e).byteLength,i=Uv(t);if(i<0||i>n)throw am("Wrong offset");if(i+(r=void 0===r?n-i:Lv(r))>n)throw am("Wrong length");qv(this,{buffer:e,byteLength:r,byteOffset:i}),Ov||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,Ov&&(mm(em,"byteLength"),mm(rm,"buffer"),mm(rm,"byteLength"),mm(rm,"byteOffset")),Dv(nm,{getInt8:function(e){return gm(this,1,e)[0]<<24>>24},getUint8:function(e){return gm(this,1,e)[0]},getInt16:function(e){var t=gm(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=gm(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return pm(gm(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return pm(gm(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return dm(gm(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return dm(gm(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){ym(this,1,e,lm,t)},setUint8:function(e,t){ym(this,1,e,lm,t)},setInt16:function(e,t){ym(this,2,e,fm,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){ym(this,2,e,fm,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){ym(this,4,e,hm,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){ym(this,4,e,hm,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){ym(this,4,e,_m,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){ym(this,8,e,vm,t,arguments.length>2?arguments[2]:void 0)}});Wv(em,Jv),Wv(rm,Zv);var Rm={ArrayBuffer:em,DataView:rm},Cm=bi,Om=ee,wm=L,Nm=ur,km=wn,Dm=Dn,Pm=Hf,Mm=Rm.ArrayBuffer,Um=Rm.DataView,Lm=Um.prototype,xm=Om(Mm.prototype.slice),Bm=Om(Lm.getUint8),Vm=Om(Lm.setUint8);Cm({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:wm((function(){return!new Mm(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(xm&&void 0===t)return xm(Nm(this),e);for(var r=Nm(this).byteLength,n=km(e,r),i=km(void 0===t?r:t,r),o=new(Pm(this,Mm))(Dm(i-n)),a=new Um(this),s=new Um(o),c=0;n<i;)Vm(s,c++,Bm(a,n++));return o}});var jm,Fm,Gm,zm={exports:{}},Hm=dv,Wm=x,Ym=M,Km=ve,Xm=ge,qm=ht,Jm=Lc,Zm=ze,$m=Tr,Qm=Ir.exports,eg=nr.f,tg=Te,rg=Ra,ng=Qa,ig=wt,og=gt,ag=Ym.Int8Array,sg=ag&&ag.prototype,cg=Ym.Uint8ClampedArray,ug=cg&&cg.prototype,dg=ag&&rg(ag),lg=sg&&rg(sg),fg=Object.prototype,hg=Ym.TypeError,pg=ig("toStringTag"),_g=og("TYPED_ARRAY_TAG"),vg=og("TYPED_ARRAY_CONSTRUCTOR"),mg=Hm&&!!ng&&"Opera"!==Jm(Ym.opera),gg=!1,yg={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Eg={BigInt64Array:8,BigUint64Array:8},Sg=function(e){if(!Xm(e))return!1;var t=Jm(e);return qm(yg,t)||qm(Eg,t)};for(jm in yg)(Gm=(Fm=Ym[jm])&&Fm.prototype)?$m(Gm,vg,Fm):mg=!1;for(jm in Eg)(Gm=(Fm=Ym[jm])&&Fm.prototype)&&$m(Gm,vg,Fm);if((!mg||!Km(dg)||dg===Function.prototype)&&(dg=function(){throw hg("Incorrect invocation")},mg))for(jm in yg)Ym[jm]&&ng(Ym[jm],dg);if((!mg||!lg||lg===fg)&&(lg=dg.prototype,mg))for(jm in yg)Ym[jm]&&ng(Ym[jm].prototype,lg);if(mg&&rg(ug)!==lg&&ng(ug,lg),Wm&&!qm(lg,pg))for(jm in gg=!0,eg(lg,pg,{get:function(){return Xm(this)?this[_g]:void 0}}),yg)Ym[jm]&&$m(Ym[jm],_g,jm);var bg={NATIVE_ARRAY_BUFFER_VIEWS:mg,TYPED_ARRAY_CONSTRUCTOR:vg,TYPED_ARRAY_TAG:gg&&_g,aTypedArray:function(e){if(Sg(e))return e;throw hg("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Km(e)&&(!ng||tg(dg,e)))return e;throw hg(Zm(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(Wm){if(r)for(var i in yg){var o=Ym[i];if(o&&qm(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}lg[e]&&!r||Qm(lg,e,r?t:mg&&sg[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(Wm){if(ng){if(r)for(n in yg)if((i=Ym[n])&&qm(i,e))try{delete i[e]}catch(e){}if(dg[e]&&!r)return;try{return Qm(dg,e,r?t:mg&&dg[e]||t)}catch(e){}}for(n in yg)!(i=Ym[n])||i[e]&&!r||Qm(i,e,t)}},isView:function(e){if(!Xm(e))return!1;var t=Jm(e);return"DataView"===t||qm(yg,t)||qm(Eg,t)},isTypedArray:Sg,TypedArray:dg,TypedArrayPrototype:lg},Tg=M,Ig=L,Ag=Eu,Rg=bg.NATIVE_ARRAY_BUFFER_VIEWS,Cg=Tg.ArrayBuffer,Og=Tg.Int8Array,wg=!Rg||!Ig((function(){Og(1)}))||!Ig((function(){new Og(-1)}))||!Ag((function(e){new Og,new Og(null),new Og(1.5),new Og(e)}),!0)||Ig((function(){return 1!==new Og(new Cg(2),1,void 0).length})),Ng=ge,kg=Math.floor,Dg=Number.isInteger||function(e){return!Ng(e)&&isFinite(e)&&kg(e)===e},Pg=An,Mg=M.RangeError,Ug=function(e){var t=Pg(e);if(t<0)throw Mg("The argument can't be less than 0");return t},Lg=M.RangeError,xg=function(e,t){var r=Ug(e);if(r%t)throw Lg("Wrong offset");return r},Bg=bc,Vg=F,jg=jf,Fg=dt,Gg=Mn,zg=Xc,Hg=Fc,Wg=Rc,Yg=bg.aTypedArrayConstructor,Kg=bi,Xg=M,qg=F,Jg=x,Zg=wg,$g=bg,Qg=Rm,ey=_u,ty=X,ry=Tr,ny=Dg,iy=Dn,oy=pv,ay=xg,sy=Ft,cy=ht,uy=Lc,dy=ge,ly=Fe,fy=sa,hy=Te,py=Qa,_y=bn.f,vy=function(e){var t,r,n,i,o,a,s=jg(this),c=Fg(e),u=arguments.length,d=u>1?arguments[1]:void 0,l=void 0!==d,f=Hg(c);if(f&&!Wg(f))for(a=(o=zg(c,f)).next,c=[];!(i=Vg(a,o)).done;)c.push(i.value);for(l&&u>2&&(d=Bg(d,arguments[2])),r=Gg(c),n=new(Yg(s))(r),t=0;r>t;t++)n[t]=l?d(c[t],t):c[t];return n},my=Xl.forEach,gy=Yu,yy=nr,Ey=U,Sy=Iu,by=on.get,Ty=on.set,Iy=yy.f,Ay=Ey.f,Ry=Math.round,Cy=Xg.RangeError,Oy=Qg.ArrayBuffer,wy=Oy.prototype,Ny=Qg.DataView,ky=$g.NATIVE_ARRAY_BUFFER_VIEWS,Dy=$g.TYPED_ARRAY_CONSTRUCTOR,Py=$g.TYPED_ARRAY_TAG,My=$g.TypedArray,Uy=$g.TypedArrayPrototype,Ly=$g.aTypedArrayConstructor,xy=$g.isTypedArray,By="BYTES_PER_ELEMENT",Vy="Wrong length",jy=function(e,t){Ly(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},Fy=function(e,t){Iy(e,t,{get:function(){return by(this)[t]}})},Gy=function(e){var t;return hy(wy,e)||"ArrayBuffer"==(t=uy(e))||"SharedArrayBuffer"==t},zy=function(e,t){return xy(e)&&!ly(t)&&t in e&&ny(+t)&&t>=0},Hy=function(e,t){return t=sy(t),zy(e,t)?ty(2,e[t]):Ay(e,t)},Wy=function(e,t,r){return t=sy(t),!(zy(e,t)&&dy(r)&&cy(r,"value"))||cy(r,"get")||cy(r,"set")||r.configurable||cy(r,"writable")&&!r.writable||cy(r,"enumerable")&&!r.enumerable?Iy(e,t,r):(e[t]=r.value,e)};Jg?(ky||(Ey.f=Hy,yy.f=Wy,Fy(Uy,"buffer"),Fy(Uy,"byteOffset"),Fy(Uy,"byteLength"),Fy(Uy,"length")),Kg({target:"Object",stat:!0,forced:!ky},{getOwnPropertyDescriptor:Hy,defineProperty:Wy}),zm.exports=function(e,t,r){var n=e.match(/\d+$/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=Xg[i],c=s,u=c&&c.prototype,d={},l=function(e,t){Iy(e,t,{get:function(){return function(e,t){var r=by(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=by(e);r&&(i=(i=Ry(i))<0?0:i>255?255:255&i),o.view[a](t*n+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};ky?Zg&&(c=t((function(e,t,r,i){return ey(e,u),Sy(dy(t)?Gy(t)?void 0!==i?new s(t,ay(r,n),i):void 0!==r?new s(t,ay(r,n)):new s(t):xy(t)?jy(c,t):qg(vy,c,t):new s(oy(t)),e,c)})),py&&py(c,My),my(_y(s),(function(e){e in c||ry(c,e,s[e])})),c.prototype=u):(c=t((function(e,t,r,i){ey(e,u);var o,a,s,d=0,f=0;if(dy(t)){if(!Gy(t))return xy(t)?jy(c,t):qg(vy,c,t);o=t,f=ay(r,n);var h=t.byteLength;if(void 0===i){if(h%n)throw Cy(Vy);if((a=h-f)<0)throw Cy(Vy)}else if((a=iy(i)*n)+f>h)throw Cy(Vy);s=a/n}else s=oy(t),o=new Oy(a=s*n);for(Ty(e,{buffer:o,byteOffset:f,byteLength:a,length:s,view:new Ny(o)});d<s;)l(e,d++)})),py&&py(c,My),u=c.prototype=fy(Uy)),u.constructor!==c&&ry(u,"constructor",c),ry(u,Dy,c),Py&&ry(u,Py,i),d[i]=c,Kg({global:!0,forced:c!=s,sham:!ky},d),By in c||ry(c,By,n),By in u||ry(u,By,n),gy(i)}):zm.exports=function(){},(0,zm.exports)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var Yy=dt,Ky=wn,Xy=Mn,qy=Math.min,Jy=[].copyWithin||function(e,t){var r=Yy(this),n=Xy(r),i=Ky(e,n),o=Ky(t,n),a=arguments.length>2?arguments[2]:void 0,s=qy((void 0===a?n:Ky(a,n))-o,n-i),c=1;for(o<i&&i<o+s&&(c=-1,o+=s-1,i+=s-1);s-- >0;)o in r?r[i]=r[o]:delete r[i],i+=c,o+=c;return r},Zy=bg,$y=ee(Jy),Qy=Zy.aTypedArray;(0,Zy.exportTypedArrayMethod)("copyWithin",(function(e,t){return $y(Qy(this),e,t,arguments.length>2?arguments[2]:void 0)}));var eE=Xl.every,tE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("every",(function(e){return eE(tE(this),e,arguments.length>1?arguments[1]:void 0)}));var rE=F,nE=Av,iE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return rE(nE,iE(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}));var oE=Mn,aE=Hf,sE=bg.TYPED_ARRAY_CONSTRUCTOR,cE=bg.aTypedArrayConstructor,uE=function(e){return cE(aE(e,e[sE]))},dE=function(e,t){for(var r=0,n=oE(t),i=new e(n);n>r;)i[r]=t[r++];return i},lE=uE,fE=Xl.filter,hE=function(e,t){return dE(lE(e),t)},pE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("filter",(function(e){var t=fE(pE(this),e,arguments.length>1?arguments[1]:void 0);return hE(this,t)}));var _E=Xl.find,vE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("find",(function(e){return _E(vE(this),e,arguments.length>1?arguments[1]:void 0)}));var mE=Xl.findIndex,gE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("findIndex",(function(e){return mE(gE(this),e,arguments.length>1?arguments[1]:void 0)}));var yE=Xl.forEach,EE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("forEach",(function(e){yE(EE(this),e,arguments.length>1?arguments[1]:void 0)}));var SE=Vn.includes,bE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("includes",(function(e){return SE(bE(this),e,arguments.length>1?arguments[1]:void 0)}));var TE=Vn.indexOf,IE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("indexOf",(function(e){return TE(IE(this),e,arguments.length>1?arguments[1]:void 0)}));var AE=M,RE=L,CE=ee,OE=bg,wE=ks,NE=wt("iterator"),kE=AE.Uint8Array,DE=CE(wE.values),PE=CE(wE.keys),ME=CE(wE.entries),UE=OE.aTypedArray,LE=OE.exportTypedArrayMethod,xE=kE&&kE.prototype,BE=!RE((function(){xE[NE].call([1])})),VE=!!xE&&xE.values&&xE[NE]===xE.values&&"values"===xE.values.name,jE=function(){return DE(UE(this))};LE("entries",(function(){return ME(UE(this))}),BE),LE("keys",(function(){return PE(UE(this))}),BE),LE("values",jE,BE||!VE,{name:"values"}),LE(NE,jE,BE||!VE,{name:"values"});var FE=bg.aTypedArray,GE=bg.exportTypedArrayMethod,zE=ee([].join);GE("join",(function(e){return zE(FE(this),e)}));var HE=qf,WE=_e,YE=An,KE=Mn,XE=ul,qE=Math.min,JE=[].lastIndexOf,ZE=!!JE&&1/[1].lastIndexOf(1,-0)<0,$E=XE("lastIndexOf"),QE=ZE||!$E?function(e){if(ZE)return HE(JE,this,arguments)||0;var t=WE(this),r=KE(t),n=r-1;for(arguments.length>1&&(n=qE(n,YE(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:JE,eS=qf,tS=QE,rS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return eS(tS,rS(this),t>1?[e,arguments[1]]:[e])}));var nS=Xl.map,iS=uE,oS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("map",(function(e){return nS(oS(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(iS(e))(t)}))}));var aS=Ke,sS=dt,cS=de,uS=Mn,dS=M.TypeError,lS=function(e){return function(t,r,n,i){aS(r);var o=sS(t),a=cS(o),s=uS(o),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw dS("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(i=r(i,a[c],c,o));return i}},fS={left:lS(!1),right:lS(!0)},hS=fS.left,pS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return hS(pS(this),e,t,t>1?arguments[1]:void 0)}));var _S=fS.right,vS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return _S(vS(this),e,t,t>1?arguments[1]:void 0)}));var mS=bg.aTypedArray,gS=bg.exportTypedArrayMethod,yS=Math.floor;gS("reverse",(function(){for(var e,t=this,r=mS(t).length,n=yS(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var ES=M,SS=F,bS=bg,TS=Mn,IS=xg,AS=dt,RS=L,CS=ES.RangeError,OS=ES.Int8Array,wS=OS&&OS.prototype,NS=wS&&wS.set,kS=bS.aTypedArray,DS=bS.exportTypedArrayMethod,PS=!RS((function(){var e=new Uint8ClampedArray(2);return SS(NS,e,{length:1,0:3},1),3!==e[1]})),MS=PS&&bS.NATIVE_ARRAY_BUFFER_VIEWS&&RS((function(){var e=new OS(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));DS("set",(function(e){kS(this);var t=IS(arguments.length>1?arguments[1]:void 0,1),r=AS(e);if(PS)return SS(NS,this,r,t);var n=this.length,i=TS(r),o=0;if(i+t>n)throw CS("Wrong length");for(;o<i;)this[t+o]=r[o++]}),!PS||MS);var US=uE,LS=Xd,xS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("slice",(function(e,t){for(var r=LS(xS(this),e,t),n=US(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),L((function(){new Int8Array(1).slice()})));var BS=Xl.some,VS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("some",(function(e){return BS(VS(this),e,arguments.length>1?arguments[1]:void 0)}));var jS=M,FS=ee,GS=L,zS=Ke,HS=B_,WS=bg,YS=j_,KS=F_,XS=ke,qS=z_,JS=jS.Array,ZS=WS.aTypedArray,$S=WS.exportTypedArrayMethod,QS=jS.Uint16Array,eb=QS&&FS(QS.prototype.sort),tb=!(!eb||GS((function(){eb(new QS(2),null)}))&&GS((function(){eb(new QS(2),{})}))),rb=!!eb&&!GS((function(){if(XS)return XS<74;if(YS)return YS<67;if(KS)return!0;if(qS)return qS<602;var e,t,r=new QS(516),n=JS(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(eb(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));$S("sort",(function(e){return void 0!==e&&zS(e),rb?eb(this,e):HS(ZS(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!rb||tb);var nb=Dn,ib=wn,ob=uE,ab=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("subarray",(function(e,t){var r=ab(this),n=r.length,i=ib(e,n);return new(ob(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,nb((void 0===t?n:ib(t,n))-i))}));var sb=qf,cb=bg,ub=L,db=Xd,lb=M.Int8Array,fb=cb.aTypedArray,hb=cb.exportTypedArrayMethod,pb=[].toLocaleString,_b=!!lb&&ub((function(){pb.call(new lb(1))}));hb("toLocaleString",(function(){return sb(pb,_b?db(fb(this)):fb(this),db(arguments))}),ub((function(){return[1,2].toLocaleString()!=new lb([1,2]).toLocaleString()}))||!ub((function(){lb.prototype.toLocaleString.call([1,2])})));var vb=bg.exportTypedArrayMethod,mb=L,gb=ee,yb=M.Uint8Array,Eb=yb&&yb.prototype||{},Sb=[].toString,bb=gb([].join);mb((function(){Sb.call({})}))&&(Sb=function(){return bb(this)});var Tb=Eb.toString!=Sb;vb("toString",Sb,Tb);var Ib=bi,Ab=M,Rb=qf,Cb=ve,Ob=Xd,wb=Zf,Nb=/MSIE .\./.test(Ie),kb=Ab.Function,Db=function(e){return function(t,r){var n=wb(arguments.length,1)>2,i=Cb(t)?t:kb(t),o=n?Ob(arguments,2):void 0;return e(n?function(){Rb(i,this,o)}:i,r)}};Ib({global:!0,bind:!0,forced:Nb},{setTimeout:Db(Ab.setTimeout),setInterval:Db(Ab.setInterval)});var Pb=bi,Mb=Xl.findIndex,Ub=_a,Lb="findIndex",xb=!0;Lb in[]&&Array(1).findIndex((function(){xb=!1})),Pb({target:"Array",proto:!0,forced:xb},{findIndex:function(e){return Mb(this,e,arguments.length>1?arguments[1]:void 0)}}),Ub(Lb);var Bb=bi,Vb=M,jb=wn,Fb=An,Gb=Mn,zb=dt,Hb=jl,Wb=Bs,Yb=hf("splice"),Kb=Vb.TypeError,Xb=Math.max,qb=Math.min,Jb=9007199254740991,Zb="Maximum allowed length exceeded";Bb({target:"Array",proto:!0,forced:!Yb},{splice:function(e,t){var r,n,i,o,a,s,c=zb(this),u=Gb(c),d=jb(e,u),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=u-d):(r=l-2,n=qb(Xb(Fb(t),0),u-d)),u+r-n>Jb)throw Kb(Zb);for(i=Hb(c,n),o=0;o<n;o++)(a=d+o)in c&&Wb(i,o,c[a]);if(i.length=n,r<n){for(o=d;o<u-n;o++)s=o+r,(a=o+n)in c?c[s]=c[a]:delete c[s];for(o=u;o>u-n+r;o--)delete c[o-1]}else if(r>n)for(o=u-n;o>d;o--)s=o+r-1,(a=o+n-1)in c?c[s]=c[a]:delete c[s];for(o=0;o<r;o++)c[o+d]=arguments[o+2];return c.length=u-n+r,i}});var $b=Vn.includes,Qb=_a;bi({target:"Array",proto:!0},{includes:function(e){return $b(this,e,arguments.length>1?arguments[1]:void 0)}}),Qb("includes");var eT=ge,tT=ie,rT=wt("match"),nT=function(e){var t;return eT(e)&&(void 0!==(t=e[rT])?!!t:"RegExp"==tT(e))},iT=nT,oT=M.TypeError,aT=function(e){if(iT(e))throw oT("The method doesn't accept regular expressions");return e},sT=wt("match"),cT=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[sT]=!1,"/./"[e](t)}catch(e){}}return!1},uT=bi,dT=aT,lT=fe,fT=hd,hT=cT,pT=ee("".indexOf);uT({target:"String",proto:!0,forced:!hT("includes")},{includes:function(e){return!!~pT(fT(lT(this)),fT(dT(e)),arguments.length>1?arguments[1]:void 0)}});var _T=Yu,vT="ArrayBuffer",mT=Rm.ArrayBuffer;bi({global:!0,forced:M.ArrayBuffer!==mT},{ArrayBuffer:mT}),_T(vT);var gT=dt,yT=Fo;bi({target:"Object",stat:!0,forced:L((function(){yT(1)}))},{keys:function(e){return yT(gT(e))}});var ET,ST,bT=ur,TT=function(){var e=bT(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},IT=L,AT=M.RegExp,RT=IT((function(){var e=AT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),CT=RT||IT((function(){return!AT("a","y").sticky})),OT={BROKEN_CARET:RT||IT((function(){var e=AT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:CT,UNSUPPORTED_Y:RT},wT=L,NT=M.RegExp,kT=wT((function(){var e=NT(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),DT=L,PT=M.RegExp,MT=DT((function(){var e=PT("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),UT=F,LT=ee,xT=hd,BT=TT,VT=OT,jT=et.exports,FT=sa,GT=on.get,zT=kT,HT=MT,WT=jT("native-string-replace",String.prototype.replace),YT=RegExp.prototype.exec,KT=YT,XT=LT("".charAt),qT=LT("".indexOf),JT=LT("".replace),ZT=LT("".slice),$T=(ST=/b*/g,UT(YT,ET=/a/,"a"),UT(YT,ST,"a"),0!==ET.lastIndex||0!==ST.lastIndex),QT=VT.BROKEN_CARET,eI=void 0!==/()??/.exec("")[1];($T||eI||QT||zT||HT)&&(KT=function(e){var t,r,n,i,o,a,s,c=this,u=GT(c),d=xT(e),l=u.raw;if(l)return l.lastIndex=c.lastIndex,t=UT(KT,l,d),c.lastIndex=l.lastIndex,t;var f=u.groups,h=QT&&c.sticky,p=UT(BT,c),_=c.source,v=0,m=d;if(h&&(p=JT(p,"y",""),-1===qT(p,"g")&&(p+="g"),m=ZT(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==XT(d,c.lastIndex-1))&&(_="(?: "+_+")",m=" "+m,v++),r=new RegExp("^(?:"+_+")",p)),eI&&(r=new RegExp("^"+_+"$(?!\\s)",p)),$T&&(n=c.lastIndex),i=UT(YT,h?r:c,m),h?i?(i.input=ZT(i.input,v),i[0]=ZT(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:$T&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),eI&&i&&i.length>1&&UT(WT,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&f)for(i.groups=a=FT(null),o=0;o<f.length;o++)a[(s=f[o])[0]]=i[s[1]];return i});var tI,rI,nI=KT;bi({target:"RegExp",proto:!0,forced:/./.exec!==nI},{exec:nI}),function(e){e.INVALID_ENGINE="INVALID_ENGINE",e.INVALID_PARAMS="INVALID_PARAMS",e.INVALID_TOKEN="INVALID_TOKEN",e.JOIN_ROOM_FAILED="JOIN_ROOM_FAILED",e.REPEAT_JOIN="REPEAT_JOIN",e.REPEAT_PUBLISH="REPEAT_PUBLISH",e.PUBLISH_BEFORE_JOIN="PUBLISH_BEFORE_JOIN",e.UNPUBLISH_BEFORE_JOIN="UNPUBLISH_BEFORE_JOIN",e.SUBSCRIBE_BEFORE_JOIN="SUBSCRIBE_BEFORE_JOIN",e.UNSUBSCRIBE_BEFORE_JOIN="UNSUBSCRIBE_BEFORE_JOIN",e.NO_PUBLISH_PERMISSION="NO_PUBLISH_PERMISSION",e.STREAM_NOT_EXIST="STREAM_NOT_EXIST",e.EMPTY_STREAM="EMPTY_STREAM",e.NOT_CONNECTED_YET="NOT_CONNECTED_YET",e.IM_BEFORE_JOIN="IM_BEFORE_JOIN",e.USER_NOT_EXIST="USER_NOT_EXIST",e.ALREADY_IN_ROOM="ALREADY_IN_ROOM",e.DUPLICATE_LOGIN="DUPLICATE_LOGIN",e.REPEAT_CAPTURE="REPEAT_CAPTURE",e.GET_VIDEO_TRACK_FAILED="GET_VIDEO_TRACK_FAILED",e.GET_AUDIO_TRACK_FAILED="GET_AUDIO_TRACK_FAILED",e.GET_SCREEN_TRACK_FAILED="GET_SCREEN_TRACK_FAILED",e.STREAM_TYPE_NOT_MATCH="STREAM_TYPE_NOT_MATCH",e.CANT_FIND_DOM="CANT_FIND_DOM",e.INVALID_DEVICE_ID="INVALID_DEVICE_ID",e.NO_PERMISSION="NO_PERMISSION",e.NOT_SUPPORTED="NOT_SUPPORTED",e.ICE_SERVER_WRONG="ICE_SERVER_WRONG",e.ESTABLISH_DATACHANNEL_FAILED="ESTABLISH_DATACHANNEL_FAILED",e.LOAD_RESOURCES_FAILED="LOAD_RESOURCES_FAILED",e.SIGNALING_CHANNEL_NOT_OPEN="SIGNALING_CHANNEL_NOT_OPEN",e.TIME_OUT="TIME_OUT",e.REFUSE_OPERATION_IN_DISCONNECT="REFUSE_OPERATION_IN_DISCONNECT",e.ADD_TRANSCEIVER_FAILED="ADD_TRANSCEIVER_FAILED",e.UPDATE_TRACK_FAILED="UPDATE_TRACK_FAILED",e.PUBLISH_FAILED="PUBLISH_FAILED",e.UNPUBLISH_FAILED="UNPUBLISH_FAILED",e.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",e.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",e.OPERATION_CANCEL="OPERATION_CANCEL",e.UNEXPECTED_ERROR="UNEXPECTED_ERROR"}(tI||(tI={})),function(e){e[e.AUDIO_MIXING_ERROR_OK=0]="AUDIO_MIXING_ERROR_OK",e[e.AUDIO_MIXING_ERROR_PRELOAD_FAILED=1]="AUDIO_MIXING_ERROR_PRELOAD_FAILED",e[e.AUDIO_MIXING_ERROR_START_FAILED=2]="AUDIO_MIXING_ERROR_START_FAILED",e[e.AUDIO_MIXING_ERROR_ID_NOT_FOUND=3]="AUDIO_MIXING_ERROR_ID_NOT_FOUND",e[e.AUDIO_MIXING_ERROR_SET_POSITION_FAILED=4]="AUDIO_MIXING_ERROR_SET_POSITION_FAILED",e[e.AUDIO_MIXING_ERROR_INVALID_VOLUME=5]="AUDIO_MIXING_ERROR_INVALID_VOLUME",e[e.AUDIO_MIXING_ERROR_LOAD_CONFLICT=6]="AUDIO_MIXING_ERROR_LOAD_CONFLICT",e[e.AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH=7]="AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH",e[e.AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH=8]="AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH",e[e.AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK=9]="AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK"}(rI||(rI={}));var iI=function(e,t,r){this.code=e,this.message=t,this.error=r};function oI(e){return oI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oI(e)}var aI=x,sI=ee,cI=Fo,uI=_e,dI=sI(G.f),lI=sI([].push),fI=function(e){return function(t){for(var r,n=uI(t),i=cI(n),o=i.length,a=0,s=[];o>a;)r=i[a++],aI&&!dI(n,r)||lI(s,e?[r,n[r]]:n[r]);return s}},hI={entries:fI(!0),values:fI(!1)}.entries;bi({target:"Object",stat:!0},{entries:function(e){return hI(e)}});var pI=ee,_I=Ir.exports,vI=nI,mI=L,gI=wt,yI=Tr,EI=gI("species"),SI=RegExp.prototype,bI=function(e,t,r,n){var i=gI(e),o=!mI((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!mI((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[EI]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var s=pI(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var a=pI(e),c=t.exec;return c===vI||c===SI.exec?o&&!i?{done:!0,value:s(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));_I(String.prototype,e,c[0]),_I(SI,i,c[1])}n&&yI(SI[i],"sham",!0)},TI=bd.charAt,II=function(e,t,r){return t+(r?TI(e,t).length:1)},AI=F,RI=ur,CI=ve,OI=ie,wI=nI,NI=M.TypeError,kI=function(e,t){var r=e.exec;if(CI(r)){var n=AI(r,e,t);return null!==n&&RI(n),n}if("RegExp"===OI(e))return AI(wI,e,t);throw NI("RegExp#exec called on incompatible receiver")},DI=F,PI=ur,MI=Dn,UI=hd,LI=fe,xI=qe,BI=II,VI=kI;bI("match",(function(e,t,r){return[function(t){var r=LI(this),n=null==t?void 0:xI(t,e);return n?DI(n,t,r):new RegExp(t)[e](UI(r))},function(e){var n=PI(this),i=UI(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return VI(n,i);var a=n.unicode;n.lastIndex=0;for(var s,c=[],u=0;null!==(s=VI(n,i));){var d=UI(s[0]);c[u]=d,""===d&&(n.lastIndex=BI(i,MI(n.lastIndex),a)),u++}return 0===u?null:c}]}));var jI=An,FI=hd,GI=fe,zI=M.RangeError,HI=ee,WI=Dn,YI=hd,KI=fe,XI=HI((function(e){var t=FI(GI(this)),r="",n=jI(e);if(n<0||n==1/0)throw zI("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),qI=HI("".slice),JI=Math.ceil,ZI=function(e){return function(t,r,n){var i,o,a=YI(KI(t)),s=WI(r),c=a.length,u=void 0===n?" ":YI(n);return s<=c||""==u?a:((o=XI(u,JI((i=s-c)/u.length))).length>i&&(o=qI(o,0,i)),e?a+o:o+a)}},$I={start:ZI(!1),end:ZI(!0)},QI=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Ie),eA=$I.end;bi({target:"String",proto:!0,forced:QI},{padEnd:function(e){return eA(this,e,arguments.length>1?arguments[1]:void 0)}});var tA=ee,rA=ln.PROPER,nA=Ir.exports,iA=ur,oA=Te,aA=hd,sA=L,cA=TT,uA="toString",dA=RegExp.prototype,lA=dA.toString,fA=tA(cA),hA=sA((function(){return"/a/b"!=lA.call({source:"a",flags:"b"})})),pA=rA&&lA.name!=uA;(hA||pA)&&nA(RegExp.prototype,uA,(function(){var e=iA(this),t=aA(e.source),r=e.flags;return"/"+t+"/"+aA(void 0===r&&oA(dA,e)&&!("flags"in dA)?fA(e):r)}),{unsafe:!0});var _A=qf,vA=F,mA=ee,gA=bI,yA=nT,EA=ur,SA=fe,bA=Hf,TA=II,IA=Dn,AA=hd,RA=qe,CA=Hs,OA=kI,wA=nI,NA=L,kA=OT.UNSUPPORTED_Y,DA=4294967295,PA=Math.min,MA=[].push,UA=mA(/./.exec),LA=mA(MA),xA=mA("".slice),BA=!NA((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));gA("split",(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=AA(SA(this)),i=void 0===r?DA:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!yA(e))return vA(t,n,e,i);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,l=new RegExp(e.source,u+"g");(o=vA(wA,l,n))&&!((a=l.lastIndex)>d&&(LA(c,xA(n,d,o.index)),o.length>1&&o.index<n.length&&_A(MA,c,CA(o,1)),s=o[0].length,d=a,c.length>=i));)l.lastIndex===o.index&&l.lastIndex++;return d===n.length?!s&&UA(l,"")||LA(c,""):LA(c,xA(n,d)),c.length>i?CA(c,0,i):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:vA(t,this,e,r)}:t,[function(t,r){var i=SA(this),o=null==t?void 0:RA(t,e);return o?vA(o,t,i,r):vA(n,AA(i),t,r)},function(e,i){var o=EA(this),a=AA(e),s=r(n,o,a,i,n!==t);if(s.done)return s.value;var c=bA(o,RegExp),u=o.unicode,d=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(kA?"g":"y"),l=new c(kA?"^(?:"+o.source+")":o,d),f=void 0===i?DA:i>>>0;if(0===f)return[];if(0===a.length)return null===OA(l,a)?[a]:[];for(var h=0,p=0,_=[];p<a.length;){l.lastIndex=kA?0:p;var v,m=OA(l,kA?xA(a,p):a);if(null===m||(v=PA(IA(l.lastIndex+(kA?p:0)),a.length))===h)p=TA(a,p,u);else{if(LA(_,xA(a,h,p)),_.length===f)return _;for(var g=1;g<=m.length-1;g++)if(LA(_,m[g]),_.length===f)return _;p=h=v}}return LA(_,xA(a,h)),_}]}),!BA,kA);var VA=Xl.map;bi({target:"Array",proto:!0,forced:!hf("map")},{map:function(e){return VA(this,e,arguments.length>1?arguments[1]:void 0)}});var jA="\t\n\v\f\r                 \u2028\u2029\ufeff",FA=fe,GA=hd,zA=ee("".replace),HA="[\t\n\v\f\r                 \u2028\u2029\ufeff]",WA=RegExp("^"+HA+HA+"*"),YA=RegExp(HA+HA+"*$"),KA=function(e){return function(t){var r=GA(FA(t));return 1&e&&(r=zA(r,WA,"")),2&e&&(r=zA(r,YA,"")),r}},XA={start:KA(1),end:KA(2),trim:KA(3)},qA=M,JA=L,ZA=ee,$A=hd,QA=XA.trim,eR=jA,tR=qA.parseInt,rR=qA.Symbol,nR=rR&&rR.iterator,iR=/^[+-]?0x/i,oR=ZA(iR.exec),aR=8!==tR(eR+"08")||22!==tR(eR+"0x16")||nR&&!JA((function(){tR(Object(nR))}))?function(e,t){var r=QA($A(e));return tR(r,t>>>0||(oR(iR,r)?16:10))}:tR;bi({target:"Number",stat:!0,forced:Number.parseInt!=aR},{parseInt:aR});var sR=ee(1..valueOf),cR=x,uR=M,dR=ee,lR=pi,fR=Ir.exports,hR=ht,pR=Iu,_R=Te,vR=Fe,mR=Bt,gR=L,yR=bn.f,ER=U.f,SR=nr.f,bR=sR,TR=XA.trim,IR="Number",AR=uR.Number,RR=AR.prototype,CR=uR.TypeError,OR=dR("".slice),wR=dR("".charCodeAt),NR=function(e){var t=mR(e,"number");return"bigint"==typeof t?t:kR(t)},kR=function(e){var t,r,n,i,o,a,s,c,u=mR(e,"number");if(vR(u))throw CR("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=TR(u),43===(t=wR(u,0))||45===t){if(88===(r=wR(u,2))||120===r)return NaN}else if(48===t){switch(wR(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(a=(o=OR(u,2)).length,s=0;s<a;s++)if((c=wR(o,s))<48||c>i)return NaN;return parseInt(o,n)}return+u};if(lR(IR,!AR(" 0o1")||!AR("0b1")||AR("+0x1"))){for(var DR,PR=function(e){var t=arguments.length<1?0:AR(NR(e)),r=this;return _R(RR,r)&&gR((function(){bR(r)}))?pR(Object(t),r,PR):t},MR=cR?yR(AR):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),UR=0;MR.length>UR;UR++)hR(AR,DR=MR[UR])&&!hR(PR,DR)&&SR(PR,DR,ER(AR,DR));PR.prototype=RR,RR.constructor=PR,fR(uR,IR,PR)}bi({target:"ArrayBuffer",stat:!0,forced:!bg.NATIVE_ARRAY_BUFFER_VIEWS},{isView:bg.isView}),bi({global:!0,forced:!dv},{DataView:Rm.DataView});var LR=ur,xR=$c,BR=bc,VR=F,jR=dt,FR=function(e,t,r,n){try{return n?t(LR(r)[0],r[1]):t(r)}catch(t){xR(e,"throw",t)}},GR=Rc,zR=Dl,HR=Mn,WR=Bs,YR=Xc,KR=Fc,XR=M.Array,qR=function(e){var t=jR(e),r=zR(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=BR(i,n>2?arguments[2]:void 0));var a,s,c,u,d,l,f=KR(t),h=0;if(!f||this==XR&&GR(f))for(a=HR(t),s=r?new this(a):XR(a);a>h;h++)l=o?i(t[h],h):t[h],WR(s,h,l);else for(d=(u=YR(t,f)).next,s=r?new this:[];!(c=VR(d,u)).done;h++)l=o?FR(u,i,[c.value,h],!0):c.value,WR(s,h,l);return s.length=h,s},JR=qR;bi({target:"Array",stat:!0,forced:!Eu((function(e){Array.from(e)}))},{from:JR});var ZR=bi,$R=gl,QR=ee([].reverse),eC=[1,2];ZR({target:"Array",proto:!0,forced:String(eC)===String(eC.reverse())},{reverse:function(){return $R(this)&&(this.length=this.length),QR(this)}});var tC,rC=x,nC=ln.EXISTS,iC=ee,oC=nr.f,aC=Function.prototype,sC=iC(aC.toString),cC=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,uC=iC(cC.exec);rC&&!nC&&oC(aC,"name",{configurable:!0,get:function(){try{return uC(cC,sC(this))[1]}catch(e){return""}}});var dC=new Uint8Array(16);function lC(){if(!tC&&!(tC="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tC(dC)}var fC=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function hC(e){return"string"==typeof e&&fC.test(e)}for(var pC=[],_C=0;_C<256;++_C)pC.push((_C+256).toString(16).substr(1));function vC(e,t,r){var n=(e=e||{}).random||(e.rng||lC)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(pC[e[t+0]]+pC[e[t+1]]+pC[e[t+2]]+pC[e[t+3]]+"-"+pC[e[t+4]]+pC[e[t+5]]+"-"+pC[e[t+6]]+pC[e[t+7]]+"-"+pC[e[t+8]]+pC[e[t+9]]+"-"+pC[e[t+10]]+pC[e[t+11]]+pC[e[t+12]]+pC[e[t+13]]+pC[e[t+14]]+pC[e[t+15]]).toLowerCase();if(!hC(r))throw TypeError("Stringified UUID is invalid");return r}(n)}const mC="3.7.2",gC="function"==typeof atob,yC="function"==typeof btoa,EC="function"==typeof Buffer,SC="function"==typeof TextDecoder?new TextDecoder:void 0,bC="function"==typeof TextEncoder?new TextEncoder:void 0,TC=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),IC=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(TC),AC=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,RC=String.fromCharCode.bind(String),CC="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),OC=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),wC=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),NC=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=TC[t>>18&63]+TC[t>>12&63]+TC[t>>6&63]+TC[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},kC=yC?e=>btoa(e):EC?e=>Buffer.from(e,"binary").toString("base64"):NC,DC=EC?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(RC.apply(null,e.subarray(r,r+4096)));return kC(t.join(""))},PC=(e,t=!1)=>t?OC(DC(e)):DC(e),MC=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?RC(192|t>>>6)+RC(128|63&t):RC(224|t>>>12&15)+RC(128|t>>>6&63)+RC(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return RC(240|t>>>18&7)+RC(128|t>>>12&63)+RC(128|t>>>6&63)+RC(128|63&t)},UC=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,LC=e=>e.replace(UC,MC),xC=EC?e=>Buffer.from(e,"utf8").toString("base64"):bC?e=>DC(bC.encode(e)):e=>kC(LC(e)),BC=(e,t=!1)=>t?OC(xC(e)):xC(e),VC=e=>BC(e,!0),jC=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,FC=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return RC(55296+(t>>>10))+RC(56320+(1023&t));case 3:return RC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return RC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},GC=e=>e.replace(jC,FC),zC=e=>{if(e=e.replace(/\s+/g,""),!AC.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=IC[e.charAt(o++)]<<18|IC[e.charAt(o++)]<<12|(r=IC[e.charAt(o++)])<<6|(n=IC[e.charAt(o++)]),i+=64===r?RC(t>>16&255):64===n?RC(t>>16&255,t>>8&255):RC(t>>16&255,t>>8&255,255&t);return i},HC=gC?e=>atob(wC(e)):EC?e=>Buffer.from(e,"base64").toString("binary"):zC,WC=EC?e=>CC(Buffer.from(e,"base64")):e=>CC(HC(e),(e=>e.charCodeAt(0))),YC=e=>WC(XC(e)),KC=EC?e=>Buffer.from(e,"base64").toString("utf8"):SC?e=>SC.decode(WC(e)):e=>GC(HC(e)),XC=e=>wC(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),qC=e=>KC(XC(e)),JC=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ZC=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,JC(t));e("fromBase64",(function(){return qC(this)})),e("toBase64",(function(e){return BC(this,e)})),e("toBase64URI",(function(){return BC(this,!0)})),e("toBase64URL",(function(){return BC(this,!0)})),e("toUint8Array",(function(){return YC(this)}))},$C=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,JC(t));e("toBase64",(function(e){return PC(this,e)})),e("toBase64URI",(function(){return PC(this,!0)})),e("toBase64URL",(function(){return PC(this,!0)}))},QC={version:mC,VERSION:"3.7.2",atob:HC,atobPolyfill:zC,btoa:kC,btoaPolyfill:NC,fromBase64:qC,toBase64:BC,encode:BC,encodeURI:VC,encodeURL:VC,utob:LC,btou:GC,decode:qC,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:PC,toUint8Array:YC,extendString:ZC,extendUint8Array:$C,extendBuiltins:()=>{ZC(),$C()}};var eO={encodeBase64:QC.encode,decodeBase64:QC.decode},tO=new TextDecoder,rO=new TextEncoder,nO=function(){return vC()},iO=function(){return Date.now()};function oO(e){for(var t,r,n,i,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];var s=0;try{for(var c=T(o),u=c.next();!u.done;u=c.next()){s+=(p=u.value).length}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}var d=new e(s),l=0;try{for(var f=T(o),h=f.next();!h.done;h=f.next()){var p=h.value;d.set(p,l),l+=p.length}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return d}var aO=function(){function e(){}return e.token2auth=function(t,r,n,i){return i?"Bearer ".concat(i):"Basic ".concat(e.createUnsafeToken(t,r,n))},e.createUnsafeToken=function(e,t,r){return eO.encodeBase64([e,t,r].join(":"))},e.merge=function(t,r){var n,i;void 0===t&&(t={}),void 0===r&&(r={});try{for(var o=T(Object.entries(t)),a=o.next();!a.done;a=o.next()){var s=I(a.value,2),c=s[0],u=s[1];null!==u&&"object"===oI(u)?e.merge(t[c],r[c]):void 0!==r[c]&&(t[c]=r[c])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.ab2str=function(e){return tO.decode(e)},e.ab2obj=function(t){try{var r=e.ab2str(t);return JSON.parse(r)}catch(e){return{}}},e.str2ab=function(e){return rO.encode(e).buffer},e}();function sO(){for(var e=(+"".concat(Math.random()).slice(-7).padEnd(7,"0")).toString(2).padEnd(28,"1").split(""),t=[];e.length;)t.push(e.splice(0,7));return t.map((function(e,r){var n=r===t.length-1?"0":"1";return Number.parseInt(n+e.join(""),2)}))}function cO(e){return e.map((function e(t){if(t instanceof HTMLElement)return t.toString();if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){var r=ArrayBuffer.isView(t)?t.buffer:t,n=r.byteLength,i=[];if(n>10){var o=new DataView(r),a=Array.from({length:5}).map((function(e,t){return o.getUint8(t)})),s=Array.from({length:5}).map((function(e,t){return n-1-t})).reverse().map((function(e){return o.getUint8(e)}));i=A(A(A([],I(a),!1),["..."],!1),I(s),!1)}else i=Array.from(new Uint8Array(r));return"".concat(t.constructor.name,"(").concat(n,") [").concat(i.join(", "),"]")}if(Array.isArray(t))return t.map(e);if("[object Object]"===Object.prototype.toString.call(t)){var c={};for(var u in t)c[u]=e(t[u]);return c}return t}))}function uO(e,t){if("boolean"!=typeof e)throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,": The value should be boolean type."))}function dO(e,t,r,n){if(void 0===r&&(r=1),void 0===n&&(n=1e4),e<r||e>n||"number"!=typeof e)throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,": the value range is [").concat(r,", ").concat(n,"]. integer only"))}function lO(e,t,r,n){if(void 0===r&&(r=1),void 0===n&&(n=255),null==e)throw new iI(tI.INVALID_PARAMS,"".concat(t," cannot be empty"));if(!function(e,t,r){void 0===t&&(t=1);void 0===r&&(r=255);return"string"==typeof e&&e.length<=r&&e.length>=t}(e,r,n))throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,": The value should be string type. Length of the string: [").concat(r,",").concat(n,"]"))}function fO(e,t,r){if(!r.includes(e))throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,": The value can only be set as ").concat(JSON.stringify(r)))}function hO(e,t){if(_O(e))throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,", should not be empty"))}function pO(e){var t,r;try{var n=navigator.mediaDevices.getSupportedConstraints();try{for(var i=T(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]||delete e[a]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}catch(e){}}function _O(e){return null==e}function vO(e){hO(e,"userInfo"),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new iI(tI.INVALID_PARAMS,"The userId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(e.userId),_O(e.extraInfo)||lO(e.extraInfo,"userInfo.extraInfo",1,200)}function mO(e){hO(e,"videoPlayerOption")}function gO(e,t){var r,n;if(void 0===t&&(t=64),!e||0===(null===(r=e)||void 0===r?void 0:r.byteLength))throw new iI(tI.INVALID_PARAMS,"The message cannot be empty");if((null==(n=e instanceof ArrayBuffer?e:aO.str2ab(JSON.stringify(e)))?void 0:n.byteLength)>1e3*t)throw new iI(tI.INVALID_PARAMS,"The message length must be less than ".concat(t,"K"))}function yO(e){return![N.onRemoteStreamStats,N.onLocalStreamStats].includes(e)}var EO=Xl.filter;bi({target:"Array",proto:!0,forced:!hf("filter")},{filter:function(e){return EO(this,e,arguments.length>1?arguments[1]:void 0)}});var SO={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,d=this._events[s],l=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,i),!0;case 5:return d.fn.call(d.context,t,n,i,o),!0;case 6:return d.fn.call(d.context,t,n,i,o,a),!0}for(u=1,c=new Array(l-1);u<l;u++)c[u-1]=arguments[u];d.fn.apply(d.context,c)}else{var f,h=d.length;for(u=0;u<h;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),l){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,n);break;case 4:d[u].fn.call(d[u].context,t,n,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];d[u].fn.apply(d[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var c=0,u=[],d=s.length;c<d;c++)(s[c].fn!==t||i&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(SO);var bO=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},TO=F,IO=ur,AO=fe,RO=bO,CO=hd,OO=qe,wO=kI;bI("search",(function(e,t,r){return[function(t){var r=AO(this),n=null==t?void 0:OO(t,e);return n?TO(n,t,r):new RegExp(t)[e](CO(r))},function(e){var n=IO(this),i=CO(e),o=r(t,n,i);if(o.done)return o.value;var a=n.lastIndex;RO(a,0)||(n.lastIndex=0);var s=wO(n,i);return RO(n.lastIndex,a)||(n.lastIndex=a),null===s?-1:s.index}]}));var NO="[VERTC]",kO=["#0050b3","#0050b3","#0050b3","#0050b3"],DO=location.search.includes("_rtc_debug_"),PO=function(){function e(e,t,r){this._module=e,this._indent=t}return e.prototype.print=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(DO){for(var n="",i=0;i<this._indent;i++)n+=" ";console.log.apply(console,A(["%c".concat(NO).concat(n,"[").concat(this._module,".").concat(e,"] ").concat(t.shift()),"color:".concat(kO[this._indent],";")],I(t),!1))}},e}(),MO=new PO("VERTC",0),UO=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.safeEmit=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this.listenerCount(t);try{return e.prototype.emit.apply(this,A([t],I(r),!1))}catch(e){return MO.print("safaEmit","safeEmit() | event listener threw an error [event:%s]:%o",t,e),Boolean(i)}},t.prototype.safeEmitAsPromise=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return S(this,void 0,void 0,(function(){var r=this;return b(this,(function(n){return[2,new Promise((function(n,i){try{r.emit.apply(r,A(A([e],I(t),!1),[n,i],!1))}catch(t){MO.print("safeEmitAsPromise","safeEmitAsPromise() | event listener threw an error [event:%s]:%o",e,t),i(t)}}))]}))}))},t}(SO.exports.EventEmitter),LO=ht,xO=function(e){return void 0!==e&&(LO(e,"value")||LO(e,"writable"))},BO=F,VO=ge,jO=ur,FO=xO,GO=U,zO=Ra;bi({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,o=arguments.length<3?t:arguments[2];return jO(t)===o?t[r]:(n=GO.f(t,r))?FO(n)?n.value:void 0===n.get?void 0:BO(n.get,o):VO(i=zO(t))?e(i,r,o):void 0}});var HO=bi,WO=F,YO=ur,KO=ge,XO=xO,qO=nr,JO=U,ZO=Ra,$O=X;var QO=L((function(){var e=function(){},t=qO.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}));HO({target:"Reflect",stat:!0,forced:QO},{set:function e(t,r,n){var i,o,a,s=arguments.length<4?t:arguments[3],c=JO.f(YO(t),r);if(!c){if(KO(o=ZO(t)))return e(o,r,n,s);c=$O(0)}if(XO(c)){if(!1===c.writable||!KO(s))return!1;if(i=JO.f(s,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=n,qO.f(s,r,i)}else qO.f(s,r,$O(0,n))}else{if(void 0===(a=c.set))return!1;WO(a,s,n)}return!0}});var ew,tw=bi,rw=ee,nw=U.f,iw=Dn,ow=hd,aw=aT,sw=fe,cw=cT,uw=rw("".endsWith),dw=rw("".slice),lw=Math.min,fw=cw("endsWith");tw({target:"String",proto:!0,forced:!!(fw||(ew=nw(String.prototype,"endsWith"),!ew||ew.writable))&&!fw},{endsWith:function(e){var t=ow(sw(this));aw(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:lw(iw(r),n),o=ow(e);return uw?uw(t,o,i):dw(t,i-o.length,i)===o}});var hw="rtc-access.rtcplus.com,rtc-access-sg.rtcplus.com,rtc-access-va.rtcplus.com,rtc-access-fr.rtcplus.com".split(",");function pw(e){return void 0===e&&(e=""),e.endsWith("com")||e.endsWith("net")||e.endsWith("org")?"https://".concat(e,"/dispatch/v1/AccessInfo?Action=GetAccessInfo"):e}var _w="https://web-log-report.rtcplus.com/video/v1/webrtc_log/",vw={VERSION:"4.36.0",ICE_CONFIG_REQUEST_URLS_INTERNAL:hw.map(pw),ICE_CONFIG_REQUEST_URLS:[],EXPECTED_ADDR:"",LOG_SERVER_URL:_w};function mw(e,t){if("VERSION"!==e)return"ICE_CONFIG_REQUEST_URLS"===e?("string"==typeof t&&(t=[t]),void(vw.ICE_CONFIG_REQUEST_URLS=t.map(pw))):void("LOG_SERVER_URL"!==e||t!==g.overseas?"LOG_SERVER_URL"!==e||t!==g.domestic?vw[e]=t:vw.LOG_SERVER_URL=_w:vw.LOG_SERVER_URL="https://web-log-report.rtcplus.com/video/v1/webrtc_log/")}function gw(e){return vw[e]}function yw(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g;return{type:"transcode",action:e,transcodeMeta:{transcode:{url:t.url},audio:{codec:(null===(r=t.audio)||void 0===r?void 0:r.codec)||"AAC",bitRate:1e3*((null===(n=t.audio)||void 0===n?void 0:n.kBitRate)||48),sampleRate:1e3*((null===(i=t.audio)||void 0===i?void 0:i.sampleRate)||44.1),channels:(null===(o=t.audio)||void 0===o?void 0:o.channels)||1,profile:(null===(a=t.audio)||void 0===a?void 0:a.AACProfile)||"LC"},video:{codec:(null===(s=t.video)||void 0===s?void 0:s.codec)||"H264",fps:(null===(c=t.video)||void 0===c?void 0:c.fps)||15,gop:(null===(u=t.video)||void 0===u?void 0:u.gop)||30,lowLatency:null===(l=null===(d=t.video)||void 0===d?void 0:d.lowLatency)||void 0===l||l,bitRate:1e3*((null===(f=t.video)||void 0===f?void 0:f.kBitRate)||40),width:(null===(h=t.video)||void 0===h?void 0:h.width)||640,height:(null===(p=t.video)||void 0===p?void 0:p.height)||360},layout:{canvas:{bgnd:(null===(_=t.layout)||void 0===_?void 0:_.backgroundColor)||"#000000"},regions:(null===(m=null===(v=t.layout)||void 0===v?void 0:v.regions)||void 0===m?void 0:m.map((function(e){return{alpha:Math.min(Math.max(+e.alpha,0),1),uid:e.userId,zorder:e.zorder,x:Math.min(Math.max(+e.x,0),1),y:Math.min(Math.max(+e.y,0),1),w:Math.min(Math.max(+e.w,0),1),h:Math.min(Math.max(+e.h,0),1),renderMode:e.renderMode||1,contentControl:e.contentControl||0,screen:e.isScreenStream,local_user:e.isLocalUser}})))||[],app_data:(null===(g=t.layout)||void 0===g?void 0:g.appData)||""}}}}var Ew=bi,Sw=Vn.indexOf,bw=ul,Tw=ee([].indexOf),Iw=!!Tw&&1/Tw([1],1,-0)<0,Aw=bw("indexOf");Ew({target:"Array",proto:!0,forced:Iw||!Aw},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Iw?Tw(this,e,t)||0:Sw(this,e,t)}});var Rw={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},i={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(Rw);var Cw={},Ow={},ww={},Nw=Rw;function kw(e){for(var t=e.length;--t>=0;)e[t]=0}var Dw=256,Pw=286,Mw=30,Uw=15,Lw=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],xw=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Bw=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Vw=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],jw=new Array(576);kw(jw);var Fw=new Array(60);kw(Fw);var Gw=new Array(512);kw(Gw);var zw=new Array(256);kw(zw);var Hw=new Array(29);kw(Hw);var Ww,Yw,Kw,Xw=new Array(Mw);function qw(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Jw(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Zw(e){return e<256?Gw[e]:Gw[256+(e>>>7)]}function $w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Qw(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,$w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function eN(e,t,r){Qw(e,r[2*t],r[2*t+1])}function tN(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function rN(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=Uw;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=tN(o[s]++,s))}}function nN(e){var t;for(t=0;t<Pw;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Mw;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function iN(e){e.bi_valid>8?$w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function oN(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function aN(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&oN(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!oN(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function sN(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?eN(e,i,t):(eN(e,(o=zw[i])+Dw+1,t),0!==(a=Lw[o])&&Qw(e,i-=Hw[o],a),eN(e,o=Zw(--n),r),0!==(a=xw[o])&&Qw(e,n-=Xw[o],a))}while(s<e.last_lit);eN(e,256,t)}function cN(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==o[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)aN(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],aN(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,aN(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,c=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,l=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=Uw;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,_++),c[2*n+1]=o,n>u||(e.bl_count[o]++,a=0,n>=h&&(a=f[n-h]),s=c[2*n],e.opt_len+=s*(o+a),l&&(e.static_len+=s*(d[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),rN(o,u,e.bl_count)}function uN(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<c&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(c=138,u=3):i===a?(c=6,u=3):(c=7,u=4))}function dN(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<c&&i===a)){if(s<u)do{eN(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(eN(e,i,e.bl_tree),s--),eN(e,16,e.bl_tree),Qw(e,s-3,2)):s<=10?(eN(e,17,e.bl_tree),Qw(e,s-3,3)):(eN(e,18,e.bl_tree),Qw(e,s-11,7));s=0,o=i,0===a?(c=138,u=3):i===a?(c=6,u=3):(c=7,u=4)}}kw(Xw);var lN=!1;function fN(e,t,r,n){Qw(e,0+(n?1:0),3),function(e,t,r,n){iN(e),n&&($w(e,r),$w(e,~r)),Nw.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}ww._tr_init=function(e){lN||(!function(){var e,t,r,n,i,o=new Array(16);for(r=0,n=0;n<28;n++)for(Hw[n]=r,e=0;e<1<<Lw[n];e++)zw[r++]=n;for(zw[r-1]=n,i=0,n=0;n<16;n++)for(Xw[n]=i,e=0;e<1<<xw[n];e++)Gw[i++]=n;for(i>>=7;n<Mw;n++)for(Xw[n]=i<<7,e=0;e<1<<xw[n]-7;e++)Gw[256+i++]=n;for(t=0;t<=Uw;t++)o[t]=0;for(e=0;e<=143;)jw[2*e+1]=8,e++,o[8]++;for(;e<=255;)jw[2*e+1]=9,e++,o[9]++;for(;e<=279;)jw[2*e+1]=7,e++,o[7]++;for(;e<=287;)jw[2*e+1]=8,e++,o[8]++;for(rN(jw,287,o),e=0;e<Mw;e++)Fw[2*e+1]=5,Fw[2*e]=tN(e,5);Ww=new qw(jw,Lw,257,Pw,Uw),Yw=new qw(Fw,xw,0,Mw,Uw),Kw=new qw(new Array(0),Bw,0,19,7)}(),lN=!0),e.l_desc=new Jw(e.dyn_ltree,Ww),e.d_desc=new Jw(e.dyn_dtree,Yw),e.bl_desc=new Jw(e.bl_tree,Kw),e.bi_buf=0,e.bi_valid=0,nN(e)},ww._tr_stored_block=fN,ww._tr_flush_block=function(e,t,r,n){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Dw;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),cN(e,e.l_desc),cN(e,e.d_desc),a=function(e){var t;for(uN(e,e.dyn_ltree,e.l_desc.max_code),uN(e,e.dyn_dtree,e.d_desc.max_code),cN(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Vw[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?fN(e,t,r,n):4===e.strategy||o===i?(Qw(e,2+(n?1:0),3),sN(e,jw,Fw)):(Qw(e,4+(n?1:0),3),function(e,t,r,n){var i;for(Qw(e,t-257,5),Qw(e,r-1,5),Qw(e,n-4,4),i=0;i<n;i++)Qw(e,e.bl_tree[2*Vw[i]+1],3);dN(e,e.dyn_ltree,t-1),dN(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),sN(e,e.dyn_ltree,e.dyn_dtree)),nN(e),n&&iN(e)},ww._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(zw[r]+Dw+1)]++,e.dyn_dtree[2*Zw(t)]++),e.last_lit===e.lit_bufsize-1},ww._tr_align=function(e){Qw(e,2,3),eN(e,256,jw),function(e){16===e.bi_valid?($w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var hN=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};var pN=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var _N,vN=function(e,t,r,n){var i=pN,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},mN={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},gN=Rw,yN=ww,EN=hN,SN=vN,bN=mN,TN=-2,IN=258,AN=262,RN=103,CN=113,ON=666;function wN(e,t){return e.msg=bN[t],t}function NN(e){return(e<<1)-(e>4?9:0)}function kN(e){for(var t=e.length;--t>=0;)e[t]=0}function DN(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(gN.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function PN(e,t){yN._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,DN(e.strm)}function MN(e,t){e.pending_buf[e.pending++]=t}function UN(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function LN(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-AN?e.strstart-(e.w_size-AN):0,u=e.window,d=e.w_mask,l=e.prev,f=e.strstart+IN,h=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===h&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<f);if(n=IN-(f-o),o=f-IN,n>a){if(e.match_start=t,a=n,n>=s)break;h=u[o+a-1],p=u[o+a]}}}while((t=l[t&d])>c&&0!=--i);return a<=e.lookahead?a:e.lookahead}function xN(e){var t,r,n,i,o,a,s,c,u,d,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-AN)){gN.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=l?n-l:0}while(--r);t=r=l;do{n=e.prev[--t],e.prev[t]=n>=l?n-l:0}while(--r);i+=l}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,c=e.strstart+e.lookahead,u=i,d=void 0,(d=a.avail_in)>u&&(d=u),r=0===d?0:(a.avail_in-=d,gN.arraySet(s,a.input,a.next_in,d,c),1===a.state.wrap?a.adler=EN(a.adler,s,d,c):2===a.state.wrap&&(a.adler=SN(a.adler,s,d,c)),a.next_in+=d,a.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<AN&&0!==e.strm.avail_in)}function BN(e,t){for(var r,n;;){if(e.lookahead<AN){if(xN(e),e.lookahead<AN&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-AN&&(e.match_length=LN(e,r)),e.match_length>=3)if(n=yN._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=yN._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}function VN(e,t){for(var r,n,i;;){if(e.lookahead<AN){if(xN(e),e.lookahead<AN&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-AN&&(e.match_length=LN(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=yN._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(PN(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=yN._tr_tally(e,0,e.window[e.strstart-1]))&&PN(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=yN._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}function jN(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function FN(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new gN.Buf16(1146),this.dyn_dtree=new gN.Buf16(122),this.bl_tree=new gN.Buf16(78),kN(this.dyn_ltree),kN(this.dyn_dtree),kN(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new gN.Buf16(16),this.heap=new gN.Buf16(573),kN(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new gN.Buf16(573),kN(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function GN(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:CN,e.adler=2===t.wrap?0:1,t.last_flush=0,yN._tr_init(t),0):wN(e,TN)}function zN(e){var t,r=GN(e);return 0===r&&((t=e.state).window_size=2*t.w_size,kN(t.head),t.max_lazy_match=_N[t.level].max_lazy,t.good_match=_N[t.level].good_length,t.nice_match=_N[t.level].nice_length,t.max_chain_length=_N[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function HN(e,t,r,n,i,o){if(!e)return TN;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return wN(e,TN);8===n&&(n=9);var s=new FN;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new gN.Buf8(2*s.w_size),s.head=new gN.Buf16(s.hash_size),s.prev=new gN.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new gN.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,zN(e)}_N=[new jN(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(xN(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,PN(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-AN&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(PN(e,!1),e.strm.avail_out),1)})),new jN(4,4,8,4,BN),new jN(4,5,16,8,BN),new jN(4,6,32,32,BN),new jN(4,4,16,16,VN),new jN(8,16,32,32,VN),new jN(8,16,128,128,VN),new jN(8,32,128,256,VN),new jN(32,128,258,1024,VN),new jN(32,258,258,4096,VN)],Ow.deflateInit=function(e,t){return HN(e,t,8,15,8,0)},Ow.deflateInit2=HN,Ow.deflateReset=zN,Ow.deflateResetKeep=GN,Ow.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?TN:(e.state.gzhead=t,0):TN},Ow.deflate=function(e,t){var r,n,i,o;if(!e||!e.state||t>5||t<0)return e?wN(e,TN):TN;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===ON&&4!==t)return wN(e,0===e.avail_out?-5:TN);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,MN(n,31),MN(n,139),MN(n,8),n.gzhead?(MN(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),MN(n,255&n.gzhead.time),MN(n,n.gzhead.time>>8&255),MN(n,n.gzhead.time>>16&255),MN(n,n.gzhead.time>>24&255),MN(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),MN(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(MN(n,255&n.gzhead.extra.length),MN(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=SN(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(MN(n,0),MN(n,0),MN(n,0),MN(n,0),MN(n,0),MN(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),MN(n,3),n.status=CN);else{var a=8+(n.w_bits-8<<4)<<8;a|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=CN,UN(n,a),0!==n.strstart&&(UN(n,e.adler>>>16),UN(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),DN(e),i=n.pending,n.pending!==n.pending_buf_size));)MN(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),DN(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,MN(n,o)}while(0!==o);n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),DN(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,MN(n,o)}while(0!==o);n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=RN)}else n.status=RN;if(n.status===RN&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&DN(e),n.pending+2<=n.pending_buf_size&&(MN(n,255&e.adler),MN(n,e.adler>>8&255),e.adler=0,n.status=CN)):n.status=CN),0!==n.pending){if(DN(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&NN(t)<=NN(r)&&4!==t)return wN(e,-5);if(n.status===ON&&0!==e.avail_in)return wN(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&n.status!==ON){var s=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(xN(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=yN._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=IN){if(xN(e),e.lookahead<=IN&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+IN;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=IN-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=yN._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=yN._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}(n,t):_N[n.level].func(n,t);if(3!==s&&4!==s||(n.status=ON),1===s||3===s)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===s&&(1===t?yN._tr_align(n):5!==t&&(yN._tr_stored_block(n,0,0,!1),3===t&&(kN(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),DN(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(MN(n,255&e.adler),MN(n,e.adler>>8&255),MN(n,e.adler>>16&255),MN(n,e.adler>>24&255),MN(n,255&e.total_in),MN(n,e.total_in>>8&255),MN(n,e.total_in>>16&255),MN(n,e.total_in>>24&255)):(UN(n,e.adler>>>16),UN(n,65535&e.adler)),DN(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},Ow.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==RN&&t!==CN&&t!==ON?wN(e,TN):(e.state=null,t===CN?wN(e,-3):0):TN},Ow.deflateSetDictionary=function(e,t){var r,n,i,o,a,s,c,u,d=t.length;if(!e||!e.state)return TN;if(2===(o=(r=e.state).wrap)||1===o&&42!==r.status||r.lookahead)return TN;for(1===o&&(e.adler=EN(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===o&&(kN(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new gN.Buf8(r.w_size),gN.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),a=e.avail_in,s=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,xN(r);r.lookahead>=3;){n=r.strstart,i=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=2,xN(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=c,e.avail_in=a,r.wrap=o,0},Ow.deflateInfo="pako deflate (from Nodeca project)";var WN={},YN=Rw,KN=!0,XN=!0;try{String.fromCharCode.apply(null,[0])}catch(e){KN=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){XN=!1}for(var qN=new YN.Buf8(256),JN=0;JN<256;JN++)qN[JN]=JN>=252?6:JN>=248?5:JN>=240?4:JN>=224?3:JN>=192?2:1;function ZN(e,t){if(t<65534&&(e.subarray&&XN||!e.subarray&&KN))return String.fromCharCode.apply(null,YN.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}qN[254]=qN[254]=1,WN.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new YN.Buf8(s),o=0,i=0;o<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},WN.buf2binstring=function(e){return ZN(e,e.length)},WN.binstring2buf=function(e){for(var t=new YN.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},WN.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)s[n++]=i;else if((o=qN[i])>4)s[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return ZN(s,n)},WN.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+qN[e[r]]>t?r:t};var $N=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},QN=Ow,ek=Rw,tk=WN,rk=mN,nk=$N,ik=Object.prototype.toString;function ok(e){if(!(this instanceof ok))return new ok(e);this.options=ek.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nk,this.strm.avail_out=0;var r=QN.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(rk[r]);if(t.header&&QN.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?tk.string2buf(t.dictionary):"[object ArrayBuffer]"===ik.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=QN.deflateSetDictionary(this.strm,n)))throw new Error(rk[r]);this._dict_set=!0}}function ak(e,t){var r=new ok(t);if(r.push(e,!0),r.err)throw r.msg||rk[r.err];return r.result}ok.prototype.push=function(e,t){var r,n,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=tk.string2buf(e):"[object ArrayBuffer]"===ik.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new ek.Buf8(o),i.next_out=0,i.avail_out=o),1!==(r=QN.deflate(i,n))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(tk.buf2binstring(ek.shrinkBuf(i.output,i.next_out))):this.onData(ek.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=QN.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==n||(this.onEnd(0),i.avail_out=0,!0)},ok.prototype.onData=function(e){this.chunks.push(e)},ok.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ek.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Cw.Deflate=ok,Cw.deflate=ak,Cw.deflateRaw=function(e,t){return(t=t||{}).raw=!0,ak(e,t)},Cw.gzip=function(e,t){return(t=t||{}).gzip=!0,ak(e,t)};var sk={},ck={},uk=Rw,dk=15,lk=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],fk=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],hk=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],pk=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],_k=Rw,vk=hN,mk=vN,gk=function(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T,I,A,R;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,l=r.wnext,f=r.window,h=r.hold,p=r.bits,_=r.lencode,v=r.distcode,m=(1<<r.lenbits)-1,g=(1<<r.distbits)-1;e:do{p<15&&(h+=A[n++]<<p,p+=8,h+=A[n++]<<p,p+=8),y=_[h&m];t:for(;;){if(h>>>=E=y>>>24,p-=E,0===(E=y>>>16&255))R[o++]=65535&y;else{if(!(16&E)){if(0==(64&E)){y=_[(65535&y)+(h&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&y,(E&=15)&&(p<E&&(h+=A[n++]<<p,p+=8),S+=h&(1<<E)-1,h>>>=E,p-=E),p<15&&(h+=A[n++]<<p,p+=8,h+=A[n++]<<p,p+=8),y=v[h&g];r:for(;;){if(h>>>=E=y>>>24,p-=E,!(16&(E=y>>>16&255))){if(0==(64&E)){y=v[(65535&y)+(h&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(b=65535&y,p<(E&=15)&&(h+=A[n++]<<p,(p+=8)<E&&(h+=A[n++]<<p,p+=8)),(b+=h&(1<<E)-1)>c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=E,p-=E,b>(E=o-a)){if((E=b-E)>d&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(T=0,I=f,0===l){if(T+=u-E,E<S){S-=E;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}}else if(l<E){if(T+=u+l-E,(E-=l)<S){S-=E;do{R[o++]=f[T++]}while(--E);if(T=0,l<S){S-=E=l;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}}}else if(T+=l-E,E<S){S-=E;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}for(;S>2;)R[o++]=I[T++],R[o++]=I[T++],R[o++]=I[T++],S-=3;S&&(R[o++]=I[T++],S>1&&(R[o++]=I[T++]))}else{T=o-b;do{R[o++]=R[T++],R[o++]=R[T++],R[o++]=R[T++],S-=3}while(S>2);S&&(R[o++]=R[T++],S>1&&(R[o++]=R[T++]))}break}}break}}while(n<i&&o<s);n-=S=p>>3,h&=(1<<(p-=S<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=p},yk=function(e,t,r,n,i,o,a,s){var c,u,d,l,f,h,p,_,v,m=s.bits,g=0,y=0,E=0,S=0,b=0,T=0,I=0,A=0,R=0,C=0,O=null,w=0,N=new uk.Buf16(16),k=new uk.Buf16(16),D=null,P=0;for(g=0;g<=dk;g++)N[g]=0;for(y=0;y<n;y++)N[t[r+y]]++;for(b=m,S=dk;S>=1&&0===N[S];S--);if(b>S&&(b=S),0===S)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<S&&0===N[E];E++);for(b<E&&(b=E),A=1,g=1;g<=dk;g++)if(A<<=1,(A-=N[g])<0)return-1;if(A>0&&(0===e||1!==S))return-1;for(k[1]=0,g=1;g<dk;g++)k[g+1]=k[g]+N[g];for(y=0;y<n;y++)0!==t[r+y]&&(a[k[t[r+y]]++]=y);if(0===e?(O=D=a,h=19):1===e?(O=lk,w-=257,D=fk,P-=257,h=256):(O=hk,D=pk,h=-1),C=0,y=0,g=E,f=o,T=b,I=0,d=-1,l=(R=1<<b)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){p=g-I,a[y]<h?(_=0,v=a[y]):a[y]>h?(_=D[P+a[y]],v=O[w+a[y]]):(_=96,v=0),c=1<<g-I,E=u=1<<T;do{i[f+(C>>I)+(u-=c)]=p<<24|_<<16|v|0}while(0!==u);for(c=1<<g-1;C&c;)c>>=1;if(0!==c?(C&=c-1,C+=c):C=0,y++,0==--N[g]){if(g===S)break;g=t[r+a[y]]}if(g>b&&(C&l)!==d){for(0===I&&(I=b),f+=E,A=1<<(T=g-I);T+I<S&&!((A-=N[T+I])<=0);)T++,A<<=1;if(R+=1<<T,1===e&&R>852||2===e&&R>592)return 1;i[d=C&l]=b<<24|T<<16|f-o|0}}return 0!==C&&(i[f+C]=g-I<<24|64<<16|0),s.bits=b,0},Ek=-2,Sk=12,bk=30;function Tk(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Ik(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new _k.Buf16(320),this.work=new _k.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ak(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new _k.Buf32(852),t.distcode=t.distdyn=new _k.Buf32(592),t.sane=1,t.back=-1,0):Ek}function Rk(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,Ak(e)):Ek}function Ck(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ek:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Rk(e))):Ek}function Ok(e,t){var r,n;return e?(n=new Ik,e.state=n,n.window=null,0!==(r=Ck(e,t))&&(e.state=null),r):Ek}var wk,Nk,kk=!0;function Dk(e){if(kk){var t;for(wk=new _k.Buf32(512),Nk=new _k.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(yk(1,e.lens,0,288,wk,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;yk(2,e.lens,0,32,Nk,0,e.work,{bits:5}),kk=!1}e.lencode=wk,e.lenbits=9,e.distcode=Nk,e.distbits=5}function Pk(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _k.Buf8(o.wsize)),n>=o.wsize?(_k.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),_k.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(_k.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}ck.inflateReset=Rk,ck.inflateReset2=Ck,ck.inflateResetKeep=Ak,ck.inflateInit=function(e){return Ok(e,15)},ck.inflateInit2=Ok,ck.inflate=function(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T,I,A,R=0,C=new _k.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ek;(r=e.state).mode===Sk&&(r.mode=13),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,u=r.hold,d=r.bits,l=s,f=c,T=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(2&r.wrap&&35615===u){r.check=0,C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0),u=0,d=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=bk;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=bk;break}if(d-=4,b=8+(15&(u>>>=4)),0===r.wbits)r.wbits=b;else if(b>r.wbits){e.msg="invalid window size",r.mode=bk;break}r.dmax=1<<b,e.adler=r.check=1,r.mode=512&u?10:Sk,u=0,d=0;break;case 2:for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(r.flags=u,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=bk;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=bk;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0)),u=0,d=0,r.mode=3;case 3:for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.head&&(r.head.time=u),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=mk(r.check,C,4,0)),u=0,d=0,r.mode=4;case 4:for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0)),u=0,d=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0)),u=0,d=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=r.length)>s&&(h=s),h&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_k.arraySet(r.head.extra,n,o,h,b)),512&r.flags&&(r.check=mk(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;h=0;do{b=n[o+h++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b))}while(b&&h<s);if(512&r.flags&&(r.check=mk(r.check,n,h,o)),s-=h,o+=h,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;h=0;do{b=n[o+h++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b))}while(b&&h<s);if(512&r.flags&&(r.check=mk(r.check,n,h,o)),s-=h,o+=h,b)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=bk;break}u=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Sk;break;case 10:for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}e.adler=r.check=Tk(u),u=0,d=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,2;e.adler=r.check=1,r.mode=Sk;case Sk:if(5===t||6===t)break e;case 13:if(r.last){u>>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}switch(r.last=1&u,d-=1,3&(u>>>=1)){case 0:r.mode=14;break;case 1:if(Dk(r),r.mode=20,6===t){u>>>=2,d-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=bk}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=bk;break}if(r.length=65535&u,u=0,d=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(h>s&&(h=s),h>c&&(h=c),0===h)break e;_k.arraySet(i,n,o,h,a),s-=h,o+=h,c-=h,a+=h,r.length-=h;break}r.mode=Sk;break;case 17:for(;d<14;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(r.nlen=257+(31&u),u>>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=bk;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;d<3;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.lens[O[r.have++]]=7&u,u>>>=3,d-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},T=yk(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid code lengths set",r.mode=bk;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;m=(R=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(g<16)u>>>=v,d-=v,r.lens[r.have++]=g;else{if(16===g){for(A=v+2;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u>>>=v,d-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=bk;break}b=r.lens[r.have-1],h=3+(3&u),u>>>=2,d-=2}else if(17===g){for(A=v+3;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}d-=v,b=0,h=3+(7&(u>>>=v)),u>>>=3,d-=3}else{for(A=v+7;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}d-=v,b=0,h=11+(127&(u>>>=v)),u>>>=7,d-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=bk;break}for(;h--;)r.lens[r.have++]=b}}if(r.mode===bk)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=bk;break}if(r.lenbits=9,I={bits:r.lenbits},T=yk(1,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid literal/lengths set",r.mode=bk;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},T=yk(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,T){e.msg="invalid distances set",r.mode=bk;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,gk(e,f),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,u=r.hold,d=r.bits,r.mode===Sk&&(r.back=-1);break}for(r.back=0;m=(R=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(m&&0==(240&m)){for(y=v,E=m,S=g;m=(R=r.lencode[S+((u&(1<<y+E)-1)>>y)])>>>16&255,g=65535&R,!(y+(v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}u>>>=y,d-=y,r.back+=y}if(u>>>=v,d-=v,r.back+=v,r.length=g,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=Sk;break}if(64&m){e.msg="invalid literal/length code",r.mode=bk;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(A=r.extra;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(R=r.distcode[u&(1<<r.distbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(0==(240&m)){for(y=v,E=m,S=g;m=(R=r.distcode[S+((u&(1<<y+E)-1)>>y)])>>>16&255,g=65535&R,!(y+(v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}u>>>=y,d-=y,r.back+=y}if(u>>>=v,d-=v,r.back+=v,64&m){e.msg="invalid distance code",r.mode=bk;break}r.offset=g,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(A=r.extra;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=bk;break}r.mode=25;case 25:if(0===c)break e;if(h=f-c,r.offset>h){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=bk;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),_=r.window}else _=i,p=a-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do{i[a++]=_[p++]}while(--h);0===r.length&&(r.mode=21);break;case 26:if(0===c)break e;i[a++]=r.length,c--,r.mode=21;break;case 27:if(r.wrap){for(;d<32;){if(0===s)break e;s--,u|=n[o++]<<d,d+=8}if(f-=c,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?mk(r.check,i,f,a-f):vk(r.check,i,f,a-f)),f=c,(r.flags?u:Tk(u))!==r.check){e.msg="incorrect data check",r.mode=bk;break}u=0,d=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=bk;break}u=0,d=0}r.mode=29;case 29:T=1;break e;case bk:T=-3;break e;case 31:return-4;default:return Ek}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,(r.wsize||f!==e.avail_out&&r.mode<bk&&(r.mode<27||4!==t))&&Pk(e,e.output,e.next_out,f-e.avail_out),l-=e.avail_in,f-=e.avail_out,e.total_in+=l,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?mk(r.check,i,f,e.next_out-f):vk(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Sk?128:0)+(20===r.mode||15===r.mode?256:0),(0===l&&0===f||4===t)&&0===T&&(T=-5),T},ck.inflateEnd=function(e){if(!e||!e.state)return Ek;var t=e.state;return t.window&&(t.window=null),e.state=null,0},ck.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?Ek:(r.head=t,t.done=!1,0):Ek},ck.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?Ek:11===r.mode&&vk(1,t,n,0)!==r.check?-3:Pk(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):Ek},ck.inflateInfo="pako inflate (from Nodeca project)";var Mk={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var Uk=ck,Lk=Rw,xk=WN,Bk=Mk,Vk=mN,jk=$N,Fk=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Gk=Object.prototype.toString;function zk(e){if(!(this instanceof zk))return new zk(e);this.options=Lk.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jk,this.strm.avail_out=0;var r=Uk.inflateInit2(this.strm,t.windowBits);if(r!==Bk.Z_OK)throw new Error(Vk[r]);if(this.header=new Fk,Uk.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=xk.string2buf(t.dictionary):"[object ArrayBuffer]"===Gk.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Uk.inflateSetDictionary(this.strm,t.dictionary))!==Bk.Z_OK))throw new Error(Vk[r])}function Hk(e,t){var r=new zk(t);if(r.push(e,!0),r.err)throw r.msg||Vk[r.err];return r.result}zk.prototype.push=function(e,t){var r,n,i,o,a,s=this.strm,c=this.options.chunkSize,u=this.options.dictionary,d=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?Bk.Z_FINISH:Bk.Z_NO_FLUSH,"string"==typeof e?s.input=xk.binstring2buf(e):"[object ArrayBuffer]"===Gk.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new Lk.Buf8(c),s.next_out=0,s.avail_out=c),(r=Uk.inflate(s,Bk.Z_NO_FLUSH))===Bk.Z_NEED_DICT&&u&&(r=Uk.inflateSetDictionary(this.strm,u)),r===Bk.Z_BUF_ERROR&&!0===d&&(r=Bk.Z_OK,d=!1),r!==Bk.Z_STREAM_END&&r!==Bk.Z_OK)return this.onEnd(r),this.ended=!0,!1;s.next_out&&(0!==s.avail_out&&r!==Bk.Z_STREAM_END&&(0!==s.avail_in||n!==Bk.Z_FINISH&&n!==Bk.Z_SYNC_FLUSH)||("string"===this.options.to?(i=xk.utf8border(s.output,s.next_out),o=s.next_out-i,a=xk.buf2string(s.output,i),s.next_out=o,s.avail_out=c-o,o&&Lk.arraySet(s.output,s.output,i,o,0),this.onData(a)):this.onData(Lk.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(d=!0)}while((s.avail_in>0||0===s.avail_out)&&r!==Bk.Z_STREAM_END);return r===Bk.Z_STREAM_END&&(n=Bk.Z_FINISH),n===Bk.Z_FINISH?(r=Uk.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Bk.Z_OK):n!==Bk.Z_SYNC_FLUSH||(this.onEnd(Bk.Z_OK),s.avail_out=0,!0)},zk.prototype.onData=function(e){this.chunks.push(e)},zk.prototype.onEnd=function(e){e===Bk.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Lk.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},sk.Inflate=zk,sk.inflate=Hk,sk.inflateRaw=function(e,t){return(t=t||{}).raw=!0,Hk(e,t)},sk.ungzip=Hk;var Wk={};(0,Rw.assign)(Wk,Cw,sk,Mk);var Yk,Kk,Xk,qk,Jk,Zk,$k,Qk,eD,tD,rD,nD,iD,oD,aD,sD,cD,uD,dD,lD,fD,hD,pD,_D,vD,mD,gD,yD,ED,SD,bD,TD,ID,AD,RD,CD,OD,wD,ND,kD,DD,PD,MD,UD,LD,xD,BD=Wk,VD=x,jD=ee,FD=F,GD=L,zD=Fo,HD=qn,WD=G,YD=dt,KD=de,XD=Object.assign,qD=Object.defineProperty,JD=jD([].concat),ZD=!XD||GD((function(){if(VD&&1!==XD({b:1},XD(qD({},"a",{enumerable:!0,get:function(){qD(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=XD({},e)[r]||zD(XD({},t)).join("")!=n}))?function(e,t){for(var r=YD(e),n=arguments.length,i=1,o=HD.f,a=WD.f;n>i;)for(var s,c=KD(arguments[i++]),u=o?JD(zD(c),o(c)):zD(c),d=u.length,l=0;d>l;)s=u[l++],VD&&!FD(a,c,s)||(r[s]=c[s]);return r}:XD,$D=ZD;bi({target:"Object",stat:!0,forced:Object.assign!==$D},{assign:$D}),function(e){e.RTC_SDK_API_CALL="rtc_sdk_api_call",e.RTC_SDK_CALLBACK="rtc_sdk_callback",e.RTC_RECONNECT="rtc_reconnect",e.RTC_RECONNECTED="rtc_reconnected",e.RTC_GET_ACCESS="rtc_get_access",e.RTC_PRE_ICE_STATE="rtc_pre_ice_state",e.RTC_NODE_CHANGE="rtc_node_change",e.RTC_SIGNALING_MSG_ERROR="rtc_signaling_msg_error",e.RTC_SIGNALING="rtc_signaling",e.RTC_JOIN_ROOM="rtc_join_room",e.RTC_LEAVE_ROOM="rtc_leave_room",e.RTC_BEGIN_CREATE_OFFER="rtc_begin_create_offer",e.RTC_CREATE_OFFER="rtc_create_offer",e.RTC_SET_DESCRIPTION="rtc_set_description",e.RTC_RECV_ANSWER="rtc_recv_answer",e.FIRST_REMOTE_AUDIO_RENDER="first_remote_audio_render",e.FIRST_REMOTE_VIDEO_RENDER="first_remote_video_render",e.RTC_PUBLISH_STAT="rtc_publish_stat",e.RTC_SUBSCRIBE_STAT="rtc_subscribe_stat",e.RTC_AUDIO_DEVICE="rtc_audio_device",e.RTC_MEDIA_STATISTICS="rtc_media_statistics",e.RTC_MESSAGE_STATISTICS="rtc_message_statistics",e.RTC_ERROR="rtc_error",e.RTC_INVOKE_STATUS="rtc_invoke_status",e.RTC_FIRST_FRAME="rtc_first_frame",e.RTC_MUTE_REMOTE="rtc_mute_remote",e.SDK_INIT_ENGINE="sdk_init_engine",e.JOIN_ROOM="join_room",e.P2P_CONNECTION_STATUS="p2p_connection_status",e.P2P_CONNECT_CLOSED="p2p_connect_closed",e.RTC_DEVICE_ERROR="rtc_device_error",e.RTC_VIDEO_DEVICE="rtc_video_device",e.RTC_VIDEO_CAPTURE_EVENT="rtc_video_capture_event",e.RTC_ENCODE_FIRST_FRAME="rtc_encode_first_frame",e.RTC_FIRST_FRAME_ENCODED="rtc_first_frame_encoded",e.RTC_SEND_FIRST_PACKET="rtc_send_first_packet",e.RTC_RECV_FIRST_PACKET="rtc_recv_first_packet",e.RTC_RECV_FIRST_FRAME="rtc_recv_first_frame",e.RTC_DECODE_FIRST_FRAME="rtc_decode_first_frame"}(Yk||(Yk={})),function(e){e.RTC="rtc"}(Kk||(Kk={})),function(e){e.W_5="5"}(Xk||(Xk={})),function(e){e.IOS="ios",e.ANDROID="android",e.WEB="web",e.WINDOWS="windows",e.MAC="mac",e.LINUX="linux"}(qk||(qk={})),function(e){e.UNKNOWN="unknown",e.DISCONNECTED="disconnected",e.LAN="lan",e.WIFI="wifi",e.W_2="2g",e.W_3="3g",e.W_4="4g",e.W_5="5g"}(Jk||(Jk={})),function(e){e.UNKNOWN="unknown",e.BROADCASTER="broadcaster",e.AUDIENCE="audience",e.SILENTAUDIENCE="silentAudience"}(Zk||(Zk={})),function(e){e.WEBSOCKET_RECONNECTING="websocket reconnecting",e.PEERCONNECTION_RECONNECTING="peerconnection reconnecting",e.DISCONNECTED="DISCONNECTED",e.LAN="LAN",e.WIFI="WIFI",e.W_2="2G",e.W_3="3G",e.W_4="4G",e.W_5="5G",e.UNKNOWN="UNKNOWN"}($k||($k={})),function(e){e.WEBSOCKET="websocket",e.NETWORKCHANGED="networkChanged",e.PEERCONNECTION="peerconnection"}(Qk||(Qk={})),function(e){e.WEBSOCKET_RECONNECTED="websocket reconnected",e.PEERCONNECTION_RECONNECTED="peerconnection reconnected"}(eD||(eD={})),function(e){e.WEBSOCKET="websocket",e.NETWORKCHANGED="networkChanged",e.PEERCONNECTION="peerconnection"}(tD||(tD={})),function(e){e.REQUEST="request",e.RESPONSE="response",e.KCP_REQUEST="kcp request",e.KCP_RESPONSE="kcp response",e.QUIC_REQUEST="quic request",e.QUIC_RESPONSE="quic response"}(rD||(rD={})),function(e){e.NEW="NEW",e.CHECKING="CHECKING",e.CONNECTED="CONNECTED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.DISCONNECTED="DISCONNECTED",e.CLOSED="CLOSED",e.DATACHANNEL_CONNECTING="DATACHANNEL_CONNECTING",e.DATACHANNEL_OPEN="DATACHANNEL_OPEN",e.DATACHANNEL_CLOSING="DATACHANNEL_CLOSING",e.DATACHANNEL_CLOSED="DATACHANNEL_CLOSED"}(nD||(nD={})),function(e){e.SUCCEED="succeed",e.MESSAGE_ID_ERROR="message id error",e.ZIP_FAILED="zip failed",e.UNZIP_FAILED="unzip failed",e.MESSAGE_KEY_EMPTY="message key empty",e.MESSAGE_KEY_PARSE_FAILED="message key parse failed",e.MESSAGE_KEY_INVALID="message key invalid",e.ENCRYPT_FAILED="encrypt failed",e.DECRYPT_FAILED="decrypt failed",e.MESSAGE_TOO_BIG="message too big",e.INVALID_DATA="invalid data",e.MESSAGE_PARSE_FAILED="message parse failed"}(iD||(iD={})),function(e){e.CALL_JOINROOM="call-joinRoom",e.JOINROOM="joinRoom",e.CALL_RECONNECTED="call-reconnected",e.RECONNECTED="reconnected",e.CALL_PUBLISH="call-publish",e.PUBLISH="publish",e.CALL_UPDATESTREAMATTRIBUTES="call-updateStreamAttributes",e.UPDATESTREAMATTRIBUTES="updateStreamAttributes",e.CALL_UNPUBLISH="call-unpublish",e.UNPUBLISH="unpublish",e.CALL_SUBSCRIBE="call-subscribe",e.SUBSCRIBE="subscribe",e.CALL_UPDATESUBSCRIBE="call-updateSubscribe",e.UPDATESUBSCRIBE="updateSubscribe",e.CALL_UNSUBSCRIBE="call-unsubscribe",e.UNSUBSCRIBE="unsubscribe",e.CALL_UPDATEUSERATTRIBUTES="call-updateUserAttributes",e.UPDATEUSERATTRIBUTES="updateUserAttributes",e.CALL_LEAVEROOM="call-leaveRoom",e.LEAVEROOM="leaveRoom",e.ON_USERCONNECTION="on-userConnection",e.ON_USERDISCONNECTION="on-userDisconnection",e.ON_ONADDSTREAM="on-onAddStream",e.ON_ONPUSHSTREAM="on-onPushStream",e.ON_ONREMOVESTREAM="on-onRemoveStream",e.ON_ONPUSHTRACK="on-onPushTrack",e.ON_ONREMOVETRACK="on-onRemoveTrack",e.ON_ONUPDATEUSERATTRIBUTES="on-onUpdateUserAttributes",e.ON_ONUPDATEROOMATTRIBUTES="on-onUpdateRoomAttributes",e.ON_ONUPDATESTREAMATTRIBUTES="on-onUpdateStreamAttributes",e.ON_STREAMFAILED="on-streamFailed",e.ON_POSTPROCESSINGMESSAGE="on-postProcessingMessage",e.ON_ENGINECONTROLMESSAGE="on-engineControlMessage",e.ON_WEBSOCKETENGINECUSTOMMESSAGE="on-websocketEngineCustomMessage",e.UNKNOWN="unknown",e.CALL_UPDATEPUBLISHSTREAMCHANNEL="call-updatePublishStreamChannel",e.UPDATEPUBLISHSTREAMCHANNEL="updatePublishStreamChannel",e.CALL_UPDATESUBSCRIBESTREAMCHANNEL="call-updateSubscribeStreamChannel",e.UPDATESUBSCRIBESTREAMCHANNEL="updateSubscribeStreamChannel",e.ON_ONSTREAMCHANNELCHANGE="on-onStreamChannelChange",e.P2PDIRECT="p2pdirect",e.INTERNAL_CUSTOM="internal_custom",e.REPORT="report",e.CONNECTION_CONTROL="connection_control",e.ON_INTERNAL_CUSTOM="on_internal_custom",e.CONTROLMESSAGE="controlMessage",e.CALL_LOGIN="call-login",e.LOGIN="login",e.CALL_RECONNECTLOGIN="call-reconnectLogin",e.RECONNECTLOGIN="reconnectLogin",e.CALL_LOGOUT="call-logout",e.LOGOUT="logout",e.CALL_UPDATELOGINTOKEN="call-updateLoginToken",e.UPDATELOGINTOKEN="updateLoginToken",e.CALL_SETSERVERPARAMS="call-setServerParams",e.SETSERVERPARAMS="setServerParams",e.CALL_GETPEERONLINESTATUS="call-getPeerOnlineStatus",e.GETPEERONLINESTATUS="getPeerOnlineStatus",e.ON_ONSCENECONFIG="on-onSceneConfig",e.ON_STREAMCONTROLMESSAGE="on-streamControlMessage",e.CALL_STARTPUSHSTREAM="call-startPushStream",e.STARTPUSHSTREAM="startPushStream",e.CALL_STOPPUSHSTREAM="call-stopPushStream",e.STOPPUSHSTREAM="stopPushStream",e.CALL_STARTPULLSTREAM="call-startPullStream",e.STARTPULLSTREAM="startPullStream",e.CALL_STOPPULLSTREAM="call-stopPullStream",e.STOPPULLSTREAM="stopPullStream",e.CALL_UPDATEPULLSTREAM="call-updatePullStream",e.UPDATEPULLSTREAM="updatePullStream",e.ON_ONSTREAMPUSHEDBYOTHER="on-onStreamPushedByOther"}(oD||(oD={})),function(e){e.UP="up",e.DOWN="down",e.DIRECT="direct"}(aD||(aD={})),function(e){e.UP="up",e.DOWN="down",e.PRE="pre"}(sD||(sD={})),function(e){e.UP="up",e.DOWN="down",e.PRE="pre"}(cD||(cD={})),function(e){e.W_0="0",e.W_1="1"}(uD||(uD={})),function(e){e.UP="up",e.DOWN="down"}(dD||(dD={})),function(e){e.ANSWER="answer",e.INCRANSWER="incranswer"}(lD||(lD={})),function(e){e.UP="up",e.DOWN="down"}(fD||(fD={})),function(e){e.SUCCESS="success",e.FAIL="fail"}(hD||(hD={})),function(e){e.W_0="0",e.W_1="1"}(pD||(pD={})),function(e){e.LEAVE_ROOM="leave room",e.ACK_FAILED="ack failed",e.SET_ANSWER_SDP_FAILED="set answer sdp failed",e.ICE_FAILED="ice failed",e.STREAM_FAILED="stream failed",e.NETWORK_RECONNECTED="network reconnected",e.JOIN_ROOM_ACK_FAILED="join room ack failed",e.UNKNOWN="unknown"}(_D||(_D={})),function(e){e.SUCCESS="success",e.FAIL="fail",e.IGNORE="ignore"}(vD||(vD={})),function(e){e.LEAVE_ROOM="leave room",e.ACK_FAILED="ack failed",e.SET_ANSWER_SDP_FAILED="set answer sdp failed",e.ICE_FAILED="ice failed",e.STREAM_FAILED="stream failed",e.NETWORK_RECONNECTED="network reconnected",e.ON_STREAM_REMOVE="on stream remove",e.PUBLISH_MUTE="publish mute",e.UNKNOWN="unknown",e.ON_STREAM_REMOVE_CLIENT_UNPUBLISHED="on stream remove:client unpublished",e.ON_STREAM_REMOVE_PUBLISH_FAILED="on stream remove:publish failed",e.ON_STREAM_REMOVE_STREAM_REMOVED="on stream remove:stream removed",e.ON_STREAM_REMOVE_CLIENT_DISCONNECTED="on stream remove:client disconnected",e.ON_STREAM_REMOVE_CLIENT_REPUBLISH="on stream remove:client republish"}(mD||(mD={})),function(e){e.PLAYOUT_DEVICE_SWITCH="playout_device_switch",e.RECORD_DEVICE_SWITCH="record_device_switch",e.UNKNOWN="unknown"}(gD||(gD={})),function(e){e.BEGIN_SEND="begin_send",e.SENT_END="sent_end",e.BEGIN_RECV="begin_recv",e.RECV_END="recv_end"}(yD||(yD={})),function(e){e.AUDIO="audio",e.VIDEO="video",e.SCREEN_VIDEO="screen_video",e.SCREEN_AUDIO="screen_audio"}(ED||(ED={})),function(e){e.LOGIN="login",e.PUBLISHER="publisher",e.UNMUTE="unmute",e.ENABLE="enable",e.PUSH="push",e.PUBLISH="publish",e.ONDEMAND="ondemand",e.SUBSCRIBE="subscribe",e.PUSH_TRACK="push_track",e.REMOTE_UNMUTE="remote_unmute",e.P2P="p2p"}(SD||(SD={})),function(e){e.TIMEOUT="timeout",e.AUDIENCE="audience",e.MUTE="mute",e.DISABLE="disable",e.STOP_PUSH="stop_push",e.UNPUBLISH="unpublish",e.NO_DEMAND="no_demand",e.LEAVE_ROOM="leave_room",e.UNSUBSCRIBE="unsubscribe",e.REMOVE_TRACK="remove_track",e.REMOTE_MUTE="remote_mute",e.USER_LEAVE="user_leave"}(bD||(bD={})),function(e){e.AUDIO="audio",e.VIDEO="video"}(TD||(TD={})),function(e){e.BEGIN="begin",e.END="end"}(ID||(ID={})),function(e){e.BEGIN="begin",e.END="end"}(AD||(AD={})),function(e){e.LEAVE_ROOM="leave_room",e.ACK_FAILED="ack_failed",e.TOKEN_ERROR="token_error",e.SIGNALING_ERROR="signaling_error",e.TIMEOUT_10="timeout_10",e.TIMEOUT_60="timeout_60"}(RD||(RD={})),function(e){e.UNKNOWN="unknown",e.NEW="new",e.CHECKING="checking",e.CONNECTED="connected",e.FAILED="failed",e.SELECTED="selected",e.CLOSING="closing",e.CLOSED="closed"}(CD||(CD={})),function(e){e.NOMINAL="Nominal",e.FAIR="Fair",e.SERIOUS="Serious",e.CRITICAL="Critical",e.UNKNWON="Unknwon"}(OD||(OD={})),function(e){e.UNKNOWN="UNKNOWN",e.AUDIO_RECORD="AUDIO_RECORD",e.AUDIO_PLAYOUT="AUDIO_PLAYOUT",e.VIDEO="VIDEO",e.SHARE_AUDIO_RECORD="SHARE_AUDIO_RECORD",e.SHARE_VIDEO="SHARE_VIDEO"}(wD||(wD={})),function(e){e.P2P="p2p",e.P2P_OUTSIDE_ROOM="p2p_outside_room",e.P2SERVER="p2server"}(ND||(ND={})),function(e){e.START="start",e.START_CAPTURE_RESULT="start_capture_result",e.STARTED="started",e.RUNNING_FAILED="running_failed",e.STOP="stop",e.STOPPED="stopped"}(kD||(kD={})),function(e){e.DSHOW="dshow",e.MF="mf",e.AVCAPTURESESSION="avcapturesession",e.CAMERA1="camera1",e.CAMERA2="camera2"}(DD||(DD={})),function(e){e.SUCCESS="success",e.CAMERA_DEVICE_NO_PERMISSION="camera_device_no_permission",e.CAMERA_DEVICE_BUSY="camera_device_busy",e.CAMERA_DEVICE_FAILURE="camera_device_failure",e.CAMERA_DEVICE_NOT_FOUND="camera_device_not_found",e.CAMERA_DEVICE_DISCONNECTED="camera_device_disconnected",e.TIMEOUT="timeout",e.ABORT="abort"}(PD||(PD={})),function(e){e.UNKNOWN="unknown",e.MUSIC="music",e.HIGHQUALITY_COMMUNICATION="highquality_communication",e.COMMUNICATION="communication",e.MEDIA="media",e.GAME_STREAMING="game_streaming"}(MD||(MD={})),function(e){e.UNKNOWN="unknown",e.MEDIA="media",e.COMMUNICATION="communication"}(UD||(UD={})),function(e){e.UNKNOWN="unknown",e.SLEEP="Sleep",e.AWAKE="Awake"}(LD||(LD={})),function(e){e.UNKNOWN="unknown",e.PRODUCT="product",e.BOE="boe",e.TEST="test"}(xD||(xD={}));var QD,eP,tP,rP=function(){function e(){}return e.prototype.setStats=function(e){var t=this;Object.keys(e).forEach((function(r){t["_"+r]=e[r]})),aP.StartUp()},Object.defineProperty(e.prototype,"event_key",{get:function(){return this._event_key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_id",{get:function(){return this._device_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_app_id",{get:function(){return this._rtc_app_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"product_line",{get:function(){return this._product_line},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_version",{get:function(){return this._report_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"os",{get:function(){return this._os},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sdk_version",{get:function(){return this._rtc_sdk_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_timestamp",{get:function(){return this._rtc_timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sdk_git_commit",{get:function(){return this._rtc_sdk_git_commit},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_id",{get:function(){return this._report_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connection_id",{get:function(){return this._connection_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sid",{get:function(){return this._rtc_sid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"engine_session_id",{get:function(){return this._engine_session_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_business_id",{get:function(){return this._rtc_business_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"project_key",{get:function(){return this._project_key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"network_type",{get:function(){return this._network_type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"app_version",{get:function(){return this._app_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aid",{get:function(){return this._aid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_model",{get:function(){return this._device_model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_brand",{get:function(){return this._device_brand},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"common_extra_info",{get:function(){return this._common_extra_info},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"had_selected_p2p",{get:function(){return this._had_selected_p2p},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_env_type",{get:function(){return this._rtc_env_type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"room_id",{get:function(){return this._room_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"user_id",{get:function(){return this._user_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_session_id",{get:function(){return this._rtc_session_id},enumerable:!1,configurable:!0}),e}(),nP=new rP,iP=vw.LOG_SERVER_URL,oP=function(){function e(){var e=this;this.report_id=0,this.dataBuffer=[],this.posting=!1,this.report_common={},this.preSucTime=0,this.errSendDelay=100,"undefined"!=typeof window&&window.addEventListener("beforeunload",(function(){clearTimeout(e.errSendTimer),clearTimeout(e.sucSendTimer),e.send(null,!0)}))}return e.prototype.push=function(e,t){t?this.send(e):(this.dataBuffer.push(e),!this.posting&&!this.errSendTimer&&Date.now()-this.preSucTime>2e3&&(clearTimeout(this.sucSendTimer),this.send()))},e.prototype.unshift=function(e){this.dataBuffer=e.concat(this.dataBuffer)},e.prototype.send=function(e,t){var r=this;if(e||this.dataBuffer.length){var n={data:e||this.dataBuffer.splice(0,4e3),header:this.report_common,from:"web",os:"web",version:"1"},i=new XMLHttpRequest;if(i.timeout=1e4,i.onreadystatechange=function(){if(4===i.readyState){e||(r.posting=!1);var o=void 0;if(200===i.status||304===i.status)try{o=JSON.parse(i.responseText)}catch(e){}o&&0===o.StatusCode?e||t||r.sucSend():e?r.send(e):(r.unshift(n.data),t?r.send():r.errSend())}},i.open("POST",iP,!0),e||(this.posting=!0),location.search.includes("_rtc_debug_"))i.send(JSON.stringify(n));else{var o=BD.gzip(JSON.stringify(n));i.setRequestHeader("Content-Encoding","gzip"),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.send(o)}}},e.prototype.sucSend=function(){this.errSendDelay=100,this.preSucTime=Date.now(),this.sucSendTimer=setTimeout(this.send.bind(this),2e3)},e.prototype.errSend=function(){var e=this;this.errSendTimer=setTimeout((function(){e.send(),e.errSendTimer=null}),this.errSendDelay),this.errSendDelay*=2},e.prototype.StartUp=function(){var e=this.report_common,t=nP.event_key,r=nP.device_id,n=nP.rtc_app_id,i=nP.product_line,o=nP.report_version,a=nP.os,s=nP.rtc_sdk_version,c=nP.rtc_timestamp,u=nP.rtc_sdk_git_commit,d=nP.report_id,l=nP.connection_id,f=nP.rtc_sid,h=nP.engine_session_id,p=nP.rtc_business_id,_=nP.project_key,v=nP.network_type,m=nP.app_version,g=nP.aid,y=nP.device_model,E=nP.device_brand,S=nP.common_extra_info,b=nP.had_selected_p2p,T=nP.rtc_env_type;Object.assign(e,{event_key:t,device_id:r,rtc_app_id:n,product_line:i,report_version:o,os:a,rtc_sdk_version:s,rtc_timestamp:c,rtc_sdk_git_commit:u,report_id:d,connection_id:l,rtc_sid:f,engine_session_id:h,rtc_business_id:p,project_key:_,network_type:v,app_version:m,aid:g,device_model:y,device_brand:E,common_extra_info:S,had_selected_p2p:b,rtc_env_type:T}),nP.room_id&&(e.room_id=nP.room_id),nP.user_id&&(e.user_id=nP.user_id),nP.rtc_session_id&&(e.rtc_session_id=nP.rtc_session_id)},e.prototype.rtcSdkApiCall=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_sdk_api_call",report_id:this.report_id++,rtc_timestamp:Date.now(),sdk_api_name:e,error_code:t,message:r},n);this.push(i)},e.prototype.rtcSdkCallback=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_sdk_callback",report_id:this.report_id++,rtc_timestamp:Date.now(),sdk_callback_name:e,error_code:t,message:r},n);this.push(i)},e.prototype.rtcReconnect=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_reconnect",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reconnect_id:r,reconnect_type:n},i);this.push(o)},e.prototype.rtcReconnected=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_reconnected",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,reconnect_type:t},r);this.push(n)},e.prototype.rtcGetAccess=function(e,t,r,n,i,o,a){void 0===a&&(a={});var s=y({event_key:"rtc_get_access",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,elapse:r,type:n,host:i,connect_session_id:o},a);this.push(s)},e.prototype.rtcPreIceState=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_pre_ice_state",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,ice_state:t},r);this.push(n)},e.prototype.rtcNodeChange=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_node_change",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reason:r},n);this.push(i)},e.prototype.rtcSignalingMsgError=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_signaling_msg_error",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reason:r},n);this.push(i)},e.prototype.rtcSignaling=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"rtc_signaling",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,signaling_event:r,signaling_type:n,direction:i},o);this.push(a)},e.prototype.rtcJoinRoom=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_join_room",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,deviceModel:t,deviceManufacturer:r,elapse:n},i);this.push(o)},e.prototype.rtcLeaveRoom=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_leave_room",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,elapse:r},n);this.push(i)},e.prototype.rtcBeginCreateOffer=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_begin_create_offer",report_id:this.report_id++,rtc_timestamp:Date.now(),direction:e,stream_id:t,stream_user_id:r},n);this.push(i)},e.prototype.rtcCreateOffer=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"rtc_create_offer",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,direction:t,stream_id:r,stream_user_id:n,elapse:i},o);this.push(a)},e.prototype.rtcSetDescription=function(e,t,r,n,i,o,a,s){void 0===s&&(s={});var c=y({event_key:"rtc_set_description",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,is_local:r,direction:n,stream_id:i,stream_user_id:o,elapse:a},s);this.push(c)},e.prototype.rtcRecvAnswer=function(e,t,r,n,i,o,a,s){void 0===s&&(s={});var c=y({event_key:"rtc_recv_answer",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,answer_type:t,sequence_id:r,message:n,direction:i,stream_id:o,stream_user_id:a},s);this.push(c)},e.prototype.firstRemoteAudioRender=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"first_remote_audio_render",report_id:this.report_id++,rtc_timestamp:Date.now(),stream_id:e,stream_user_id:t},r);this.push(n)},e.prototype.firstRemoteVideoRender=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"first_remote_video_render",report_id:this.report_id++,rtc_timestamp:Date.now(),stream_id:e,stream_user_id:t},r);this.push(n)},e.prototype.rtcPublishStat=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_publish_stat",report_id:this.report_id++,rtc_timestamp:Date.now(),result:e,is_screen:t,start:r,message:n},i);this.push(o)},e.prototype.rtcSubscribeStat=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_subscribe_stat",report_id:this.report_id++,rtc_timestamp:Date.now(),result:e,start:t,message:r,stream_user_id:n},i);this.push(o)},e.prototype.rtcAudioDevice=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_audio_device",report_id:this.report_id++,rtc_timestamp:Date.now(),audio_event:e,message:t,error_code:r},n);this.push(i)},e.prototype.rtcMediaStatistics=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_media_statistics",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcMessageStatistics=function(e,t,r,n){void 0===n&&(n={});var i=y(y(y(y({event_key:"rtc_message_statistics",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),{media_server_ip:r}),n);this.push(i)},e.prototype.rtcError=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_error",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,error_code:t},r);this.push(n)},e.prototype.rtcInvokeStatus=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"rtc_invoke_status",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,error_code:t,sdk_api_name:r,stream_id:n,elapse:i},o);this.push(a)},e.prototype.rtcFirstFrame=function(e,t){void 0===t&&(t={});var r=y(y({event_key:"rtc_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t);this.push(r)},e.prototype.rtcMuteRemote=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_mute_remote",report_id:this.report_id++,rtc_timestamp:Date.now()},e),{media_type:t}),r);this.push(n)},e.prototype.sdkInitEngine=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"sdk_init_engine",report_id:this.report_id++,rtc_timestamp:Date.now(),start:e,type:t},r);this.push(n)},e.prototype.joinRoom=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"join_room",report_id:this.report_id++,rtc_timestamp:Date.now(),type:e,start:t,result:r,reason:n},i);this.push(o)},e.prototype.p2pConnectionStatus=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"p2p_connection_status",report_id:this.report_id++,rtc_timestamp:Date.now(),room_id:e,user_id:t,peer_user_id:r,status:n,elapse:i},o);this.push(a)},e.prototype.p2pConnectClosed=function(e,t){void 0===t&&(t={});var r=y({event_key:"p2p_connect_closed",report_id:this.report_id++,rtc_timestamp:Date.now(),p2p_selected:e},t);this.push(r)},e.prototype.rtcDeviceError=function(e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v){void 0===v&&(v={});var m=y({event_key:"rtc_device_error",report_id:this.report_id++,rtc_timestamp:Date.now(),device_type:e,device_stage:t,error_code:r,system_error_code:n,system_api:i,call_parameters:o,location:a,message:s,media_device_id:c,media_device_name:u,elapse:d,scenario:l,event_session_id:f,device_pid:h,device_vid:p,media_mode:_},v);this.push(m)},e.prototype.rtcVideoDevice=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_video_device",report_id:this.report_id++,rtc_timestamp:Date.now(),media_device_id:e,media_device_name:t},r);this.push(n)},e.prototype.rtcVideoCaptureEvent=function(e,t){void 0===t&&(t={});var r=y(y({event_key:"rtc_video_capture_event",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t);this.push(r)},e.prototype.rtcEncodeFirstFrame=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_encode_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcFirstFrameEncoded=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_first_frame_encoded",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcSendFirstPacket=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_send_first_packet",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcRecvFirstPacket=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_recv_first_packet",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcRecvFirstFrame=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_recv_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcDecodeFirstFrame=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_decode_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e}(),aP=new oP;function sP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t,r,n){if("function"==typeof n.value){var i=n.value;n.value=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o={};return e.forEach((function(e,r){o[e]=t[r]})),aP.rtcSdkApiCall(r,0,JSON.stringify(cO(t)),o),i.apply(this,t)}}}}function cP(e,t,r){void 0===r&&(r=0),aP.rtcSdkCallback(e,r,JSON.stringify(t))}function uP(e,t,r){void 0===r&&(r=0),aP.rtcInvokeStatus(JSON.stringify(t),r,e,"",0)}!function(e){e.streamRemovedBySchedule308="stream removed",e.clientRePublish="client republish",e.publishStreamFaied="publish failed",e.clientUnPublish="client unpublished",e.clientDisconnected="client disconnected",e.videoMuted="video muted"}(QD||(QD={})),function(e){e.ON_ADD_STREAM="onAddStream",e.ON_REMOVE_STREAM="onRemoveStream",e.USER_DISCONNECTION="userDisconnection",e.USER_CONNECTION="userConnection",e.ON_UPDATE_STREAM_ATTRIBUTES="onUpdateStreamAttributes",e.ON_UPDATE_ROOM_ATTRIBUTES="onUpdateRoomAttributes",e.ON_PUSH_TRACK="onPushTrack",e.ON_REMOVE_TRACK="onRemoveTrack",e.ON_CUSTOM_MESSAGE="onCustomMessage",e.NODE_CHANGE="nodeChange",e.USER_MESSAGE_RECEIVED="userMessageReceived",e.USER_BINARY_MESSAGE_RECEIVED="userBinaryMessageReceived",e.POST_PROCESSING_MESSAGE="postProcessingMessage"}(eP||(eP={})),function(e){e.ON_CONNECTION_STATE_CHANGE="onConnectionStateChange",e.ABNORMAL_DISCONNECTION="normalConnection"}(tP||(tP={}));var dP=new PO("DataChannelSignaling",3),lP=0,fP=1,hP=0,pP=0,_P=function(e){function t(t){var r=t.appId,n=t.roomId,i=t.clientId,o=t.dataChannel,a=e.call(this)||this;return a._appId=r,a._roomId=n,a._clientId=i,a._dataChannel=o,a._resolveCallbacks=new Map,a._rejectCallbacks=new Map,a._p2pResolveCallbacks=new Map,a._p2pRejectCallbacks=new Map,a._p2pMessageId=0,a._rttIds={},a._signalingType=new Map,a._timer={},a._clearDataChannelListener=a._handleHandler(),window.__rtc_mock_signaling__=a.emit.bind(a),a}return r(t,e),t.prototype.destroy=function(){this._dataChannel&&(this._clearDataChannelListener(),this._dataChannel.close()),this._resolveCallbacks=new Map,this._rejectCallbacks=new Map,this._p2pResolveCallbacks=new Map,this._p2pRejectCallbacks=new Map,this._p2pMessageId=0,this._rttIds={},this._signalingType=new Map,this._timer={}},t.prototype.sendSignaling=function(e,t){var r=this;return aP.rtcSignaling(0,JSON.stringify(t),"call-".concat(e),"Send",aD.UP),new Promise((function(n,i){if(!r._dataChannel||"open"!==r._dataChannel.readyState)return i(new iI(tI.SIGNALING_CHANNEL_NOT_OPEN,"DataChannel not open"));var o=[2,1],a=sO();o=o.concat(a);var s=a.join("-");r._resolveCallbacks.set(s,n),r._rejectCallbacks.set(s,i),r._signalingType.set(s,e),r._timer[s]=setTimeout((function(){i(new iI(tI.TIME_OUT,"Signaling message time out"))}),1e4),dP.print("Signal",">>>>>> [".concat(e,"][").concat(s,"]"),t),r._sendMessage(e,o,t)}))},t.prototype.sendPingMessage=function(){var e="CheckConnectivity",t=sO(),r={ts:(new Date).getTime()};aP.rtcSignaling(0,JSON.stringify(r),"call-".concat(e),"Send",aD.UP),dP.print("Signal",">>>>>> [".concat(e,"][").concat(t.join("-"),"] ping")),this._sendMessage(e,A([2,9],I(t),!1),r)},t.prototype.sendP2PMessage=function(e,t){var r=t instanceof ArrayBuffer,n=r?eO.encodeBase64(aO.ab2str(t)):JSON.stringify(t);return this._sendP2PMessage(e,n,!1,!1,r)},t.prototype._sendP2PMessage=function(e,t,r,n,i,o){var a=this;void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1);var s=this._p2pMessageId++,c=o||{ver:1,id:+s,time:Date.now(),dir:lP,type:hP,err:pP,app:this._appId,room:this._roomId,from:this._clientId,to:e,binary:i,msg:t};return n||-1!==(null==t?void 0:t.indexOf("__web__rtc__rtt__"))||dP.print("_sendP2PMessage [DC Signaling p2p >>]",JSON.stringify(c)),new Promise((function(e,i){if(!a._dataChannel||"open"!==a._dataChannel.readyState)return i(new iI(tI.SIGNALING_CHANNEL_NOT_OPEN,"DataChannel not open"));var o=[2,5];(null==t?void 0:t.indexOf("__web__rtc__rtt__"))>-1&&(a._rttIds[s]=s,n=!0);var u=sO();o=o.concat(u),r||(a._p2pResolveCallbacks.set(s,e),a._p2pRejectCallbacks.set(s,i),a._timer[s]=setTimeout((function(){i(new iI(tI.TIME_OUT,"P2P message timeout"))}),1e4)),a._sendMessage("p2p",o,c)}))},t.prototype._sendMessage=function(e,t,r){return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){return n=aO.str2ab(JSON.stringify([e,r])),i=oO(Uint8Array,t,new Uint8Array(n)),this._dataChannel.send(i.buffer),[2]}))}))},t.prototype._dispartData=function(e){var t={messageType:0,compress:!1,direction:"ack"},r="",n=(new Uint8Array([]),new Uint8Array(e)),i=n[0],o=n[1],a=1&o;t.messageType=(60&o)>>2,t.compress=16==(16&i),t.direction=2==(2&o)?"ack":"send";var s=0;if(a||"ack"===t.direction){for(var c=2;c<=6;c++){var u=n[c];if(128!=(128&u)){s=c-2+1;break}}r=n.slice(2,2+s).join("-")}return{config:t,id:r,data:n.slice(2+s),needAck:a}},t.prototype._feedbackSignaling=function(e,t){void 0===e&&(e="");var r=e.split("-").map((function(e){return+e})),n=[2,3];n=n.concat(r);var i=r.join("-");dP.print("Signal",">>>>>> [".concat(t,"-res][").concat(i,"]")),this._sendMessage("".concat(t,"-res"),n,"")},t.prototype._feedbackMessage=function(e){var t,r=(null===(t=null==e?void 0:e.msg)||void 0===t?void 0:t.indexOf("__web__rtc__rtt__"))>-1;e.dir=fP,e.msg="",this._sendP2PMessage(e.to,"",!0,r,!1,e)},t.prototype._handleFeedback=function(e){var t=(e=y({},e)).id,r=this._p2pResolveCallbacks.get(t),n=this._p2pRejectCallbacks.get(t);if(clearTimeout(this._timer[t]),this._p2pResolveCallbacks.delete(t),this._p2pRejectCallbacks.delete(t),e.err===pP)"function"==typeof r&&r(t);else"function"==typeof n&&n(e)},t.prototype._handleMessage=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,d,l,f,h,p,_,v,m;return b(this,(function(g){switch(g.label){case 0:return n=this._dispartData(e),i=n.config,o=n.id,a=n.data,s=a,i.compress&&((c=new BD.Inflate).push(s,!0),s=c.result),[4,aO.ab2str(s)];case 1:u=g.sent(),d=[];try{d=JSON.parse(u)}catch(e){return e instanceof Error&&aP.rtcSignalingMsgError(-1,e.message,iD.MESSAGE_PARSE_FAILED),[2]}switch(l="p2p",i.messageType){case 0:"ack"===i.direction?(f=this._resolveCallbacks.get(o),h=this._rejectCallbacks.get(o),p=d[0]||{},clearTimeout(this._timer[o]),this._resolveCallbacks.delete(o),this._rejectCallbacks.delete(o),200===(null==p?void 0:p.code)?"function"==typeof f&&f(p):"function"==typeof h&&h(p),(l=this._signalingType.get(o))&&(this._signalingType.delete(o),dP.print("Signal","<<<<<< [".concat(l,"-ack]"),p)),aP.rtcSignaling(0,u,l,"Ack",aD.DOWN)):Array.isArray(d)&&(l=d[0],d=d[1],dP.print("Signal","<<<<<< ".concat(l),d,o),this._feedbackSignaling(o,l),d.binary&&"string"==typeof d.message&&(d.message=aO.str2ab(eO.decodeBase64(d.message))),this.emit(l,y({},d)),aP.rtcSignaling(0,u,"on-".concat(l),"Recv",aD.DOWN));break;case 1:switch(Array.isArray(d)&&(l=d[0],d=d[1]),_=null==d?void 0:d.id,this._rttIds[_]||(null==d?void 0:d.dir)===fP||(null===(t=null==d?void 0:d.msg)||void 0===t?void 0:t.indexOf("__web__rtc__rtt__"))>-1?delete this._rttIds[_]:dP.print("Signal","<<<<<< p2p response",d),d.dir){case lP:-1===(null===(r=null==d?void 0:d.msg)||void 0===r?void 0:r.indexOf("__web__rtc__rtt__"))&&(v=d.binary,m=d.msg,this.emit(v?eP.USER_BINARY_MESSAGE_RECEIVED:eP.USER_MESSAGE_RECEIVED,y(y({},d),{msg:v?aO.str2ab(eO.decodeBase64(m)):m}))),this._feedbackMessage(d);break;case fP:this._handleFeedback(d)}break;case 2:dP.print("Signal","<<<<<< pong"),aP.rtcSignaling(0,u,"CheckConnectivity","Recv",aD.DOWN)}return[2]}}))}))},t.prototype._handleHandler=function(){var e=this,t=function(t){dP.print("_handleHandler","dataChannel close",t),e.emit("close",t)},r=function(t){dP.print("_handleHandler","dataChannel error",t),e.emit("close",t)},n=function(t){e._handleMessage(t.data)};return this._dataChannel.addEventListener("close",t),this._dataChannel.addEventListener("error",r),this._dataChannel.addEventListener("message",n),function(){e._dataChannel.removeEventListener("close",t),e._dataChannel.removeEventListener("error",r),e._dataChannel.removeEventListener("message",n)}},t}(SO.exports.EventEmitter),vP=function(){function e(){this.isSending=!1}return e.prototype.ajax=function(e){var t=this,r=e.method,n=e.url,i=e.body,o=void 0===i?{}:i,a=e.headers,s=void 0===a?{}:a,c=e.stringify,u=void 0===c||c;return new Promise((function(e,i){var a,c;t.isSending=!0;var d=new XMLHttpRequest;d.open(r,n,!0);try{for(var l=T(Object.entries(s)),f=l.next();!f.done;f=l.next()){var h=I(f.value,2),p=h[0],_=h[1];d.setRequestHeader(p,_)}}catch(e){a={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error}}d.onreadystatechange=function(){4===d.readyState&&(t.isSending=!1,200===d.status?e(JSON.parse(d.responseText)):i({message:d.statusText,code:d.status})),0===d.status&&i({code:0,message:"Request abort"})},d.onerror=function(e){var r=tI.UNEXPECTED_ERROR;t.isSending=!1,i({code:r,message:d.responseText||"unknown"})},u&&(o=JSON.stringify(o)),d.send(o),t.xhr=d}))},e.prototype.get=function(e,t){return this.ajax({method:"GET",url:e,headers:t})},e.prototype.post=function(e,t,r,n){return this.ajax({method:"POST",url:e,body:t,headers:r,stringify:n})},e.prototype.abort=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}(),mP="RTC_DEVICE_ID",gP="RTC_DEFAULT_SDP",yP="RTC_ACCESS_NODE",EP="RTC_ACCESS_URLS",SP=function(){function e(){}return e.prototype.get=function(e){var t=localStorage.getItem(e);if(!t)return null;try{var r=JSON.parse(t);return r.ttl>0&&Date.now()-r.saveTime>r.ttl?(this.delete(e),null):r.message}catch(e){return null}},e.prototype.set=function(e,t,r){void 0===r&&(r=-1);var n={ttl:r,saveTime:Date.now(),message:t};try{return localStorage.setItem(e,JSON.stringify(n)),!0}catch(e){return!1}},e.prototype.delete=function(e){try{return localStorage.removeItem(e),!0}catch(e){return!1}},e}(),bP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getDeviceId=function(){var e=this.get(mP);return e||(e=vC()),this.set(mP,e),e},t.prototype.getDefaultSdp=function(){return this.get(gP)},t.prototype.setDefaultSdp=function(e){return this.set(gP,e,108e6)},t.prototype.getAccessNode=function(e){return this.get("".concat(yP,"_").concat(e,"-BytePlus"))},t.prototype.setAccessNode=function(e,t,r){return this.set("".concat(yP,"_").concat(e,"-BytePlus"),t,1e3*r)},t.prototype.getAccessUrls=function(){return this.get("".concat(EP,"-BytePlus"))},t.prototype.setAccessUrls=function(e){var t=e.map((function(e){var t=e.host,r=e.path;return"https://".concat(t).concat(r)}));return this.set("".concat(EP,"-BytePlus"),t)},t.prototype.clearAccessUrls=function(){this.delete("".concat(EP,"-BytePlus"))},t}(SP),TP=new bP,IP=new PO("ICE Request",3),AP=function(){function e(){this._request=new vP}return e.prototype.getAccessNode=function(e,t,r,n,i,o){return S(this,void 0,void 0,(function(){var a;return b(this,(function(s){return(a=TP.getAccessNode(e))?(this.getAccessNodeFromServer(e,t,r,n,i,o),uP("es.R.node.cache",a),[2,Promise.resolve(a)]):[2,this.getAccessNodeFromServer(e,t,r,n,i,o)]}))}))},e.prototype.getAccessNodeFromServer=function(e,t,r,n,i,o){return S(this,void 0,void 0,(function(){var a,s,c=this;return b(this,(function(u){return a=TP.getAccessUrls(),s=!0,uP("es.R.req.cache.urls",a),(null==a?void 0:a.length)>0||(a=vw.ICE_CONFIG_REQUEST_URLS,s=!1,uP("es.R.req.external.urls",a)),(null==a?void 0:a.length)>0||(a=vw.ICE_CONFIG_REQUEST_URLS_INTERNAL,s=!1,uP("es.R.req.internal.urls",a)),[2,this.getICEConfigFromServer(a,e,t,r,n,i,o).then((function(t){var r=t.nodes[0];return TP.setAccessNode(e,r,t.ttl||11200),TP.setAccessUrls(t.dispatchDomains),r})).catch((function(a){if(s)return uP("es.R.req.fallback",""),TP.clearAccessUrls(),c.getAccessNodeFromServer(e,t,r,n,i,o);throw a}))]}))}))},e.prototype.getICEConfigFromServer=function(e,t,r,n,i,o,a){var s;return S(this,void 0,void 0,(function(){var c,u,d,l=this;return b(this,(function(f){return c={appID:t,roomID:r,userID:n,deviceID:i,connectSessionID:nO(),os:"web",sdkVersion:vw.VERSION,expectedAddr:gw("EXPECTED_ADDR"),productPlatform:"BytePlus"},o&&a&&(c.feedbackInfo=[{feedbackIP:null===(s=a.publicIPs[0])||void 0===s?void 0:s.ip,feedbackReason:{type:"NodeChanged",reason:o}}],delete c.expectedAddr),u=Date.now(),aP.rtcGetAccess(0,JSON.stringify(c),0,rD.REQUEST,e.join(","),c.connectSessionID),d=e.map((function(e,t){return S(l,void 0,void 0,(function(){var r,n,i;return b(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._request.post(e,c)];case 1:return r=o.sent(),[3,3];case 2:throw n=o.sent(),new iI(tI.ICE_SERVER_WRONG,"get ICE config failed",n);case 3:if(200!==r.code)throw new iI(tI.ICE_SERVER_WRONG,"get ICE config failed",{server_code:r.code,message:JSON.stringify(r)});if(!(i=r.nodes[0]))throw new iI(tI.ICE_SERVER_WRONG,"ICE config server return empty nodes",{code:r.code,message:JSON.stringify(r)});return[2,{result:r,firstNode:i,index:t}]}}))}))})),[2,Promise.race(d).then((function(t){var r=t.result;t.firstNode;var n=t.index;return aP.rtcGetAccess(200,JSON.stringify(r),Date.now()-u,rD.RESPONSE,e[n],c.connectSessionID),r})).catch((function(t){throw aP.rtcGetAccess(t.error.code||t.error.server_code,t.error.message,Date.now()-u,rD.RESPONSE,e.join(","),c.connectSessionID),t}))]}))}))},e.prototype.abort=function(){this._request.isSending&&(IP.print("abort","HTTP Request of [getICEConfigFromServer] abort"),this._request.abort())},e}(),RP=fS.left,CP=ke,OP=Qf;bi({target:"Array",proto:!0,forced:!ul("reduce")||!OP&&CP>79&&CP<83},{reduce:function(e){var t=arguments.length;return RP(this,e,t,t>1?arguments[1]:void 0)}});var wP={},NP={},kP={exports:{}},DP=kP.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(DP).forEach((function(e){DP[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},r=function(e,r,n){var i=e.name&&e.names;e.push&&!r[e.push]?r[e.push]=[]:i&&!r[e.name]&&(r[e.name]={});var o=e.push?{}:i?r[e.name]:r;!function(e,r,n,i){if(i&&!n)r[i]=t(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(r[n[o]]=t(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&r[e.push].push(o)},n=kP.exports,i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(i).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(n[t]||[]).length;s+=1){var c=n[t][s];if(c.reg.test(i))return r(c,a,i)}})),t.media=o,t};var o=function(e,r){var n=r.split(/=(.+)/,2);return 2===n.length?e[n[0]]=t(n[1]):1===n.length&&r.length>1&&(e[n[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var r=[],n=e.split(" ").map(t),i=0;i<n.length;i+=3)r.push({component:n[i],ip:n[i+1],port:n[i+2]});return r},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var r,n=!1;return"~"!==e[0]?r=t(e):(r=t(e.substring(1,e.length)),n=!0),{scid:r,paused:n}}))}))}}(NP);var PP=kP.exports,MP=/%[sdv%]/g,UP=function(e){var t=1,r=arguments,n=r.length;return e.replace(MP,(function(e){if(t>=n)return e;var i=r[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},LP=function(e,t,r){var n=[e+"="+(t.format instanceof Function?t.format(t.push?r:r[t.name]):t.format)];if(t.names)for(var i=0;i<t.names.length;i+=1){var o=t.names[i];t.name?n.push(r[t.name][o]):n.push(r[t.names[i]])}else n.push(r[t.name]);return UP.apply(null,n)},xP=["v","o","s","i","u","e","p","c","b","t","r","z","a"],BP=["i","c","b","a"],VP=NP,jP=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var r=t.outerOrder||xP,n=t.innerOrder||BP,i=[];return r.forEach((function(t){PP[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(LP(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(LP(t,r,e))}))}))})),e.media.forEach((function(e){i.push(LP("m",PP.m[0],e)),n.forEach((function(t){PP[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(LP(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(LP(t,r,e))}))}))}))})),i.join("\r\n")+"\r\n"};wP.write=jP,wP.parse=VP.parse,wP.parseParams=VP.parseParams,wP.parseFmtpConfig=VP.parseFmtpConfig,wP.parsePayloads=VP.parsePayloads,wP.parseRemoteCandidates=VP.parseRemoteCandidates,wP.parseImageAttributes=VP.parseImageAttributes,wP.parseSimulcastStreamList=VP.parseSimulcastStreamList;var FP=function(){function e(e){this._iceConfigNode=e}return e.prototype.modifyByIceNode=function(e){var t,r=this._iceConfigNode.iceParams,n=wP.parse(e);return null===(t=n.media)||void 0===t||t.forEach((function(e){e.iceUfrag=null==r?void 0:r.clientIceUfrag,e.icePwd=null==r?void 0:r.clientIcePwd,e.iceOptions="renomination"})),wP.write(n)},e}(),GP=function(){function e(e){this._iceConfigNode=e}return e.prototype.modifyByIceNode=function(e){var t,r=this,n=this._iceConfigNode.certFingerprint,i=wP.parse(e);return(null==i?void 0:i.fingerprint)&&(i.fingerprint={type:"sha-256",hash:n}),null===(t=null==i?void 0:i.media)||void 0===t||t.forEach((function(e){return r.modifyMlineByIceNode(e)})),wP.write(i)},e.prototype.modifyMlineByIceNode=function(e){var t=this._iceConfigNode,r=t.publicIPs,n=t.certFingerprint,i=t.iceParams;e.fingerprint&&(e.fingerprint={type:"sha-256",hash:n}),e.icePwd=i.serverIcePwd,this._iceUfrag||(this._iceUfrag=$P(i.serverIceUfrag),nP.setStats({connection_id:this._iceUfrag})),e.iceUfrag=this._iceUfrag,e.setup="active",this._candidates||(this._candidates=ZP(r)),e.candidates=this._candidates,e.iceOptions="renomination","application"===e.type&&(e.sctpmap={sctpmapNumber:5e3,app:"webrtc-datachannel",maxMessageSize:262144})},e}();function zP(e,t){var r,n=wP.parse(e),i=[];return n.media=n.media.map((function(e){return t.includes(e.mid+"")?(e.direction="inactive",e.port=0,delete e.ext,delete e.ssrcs,delete e.ssrcGroups,delete e.simulcast,delete e.simulcast_03,delete e.rids,delete e.extmapAllowMixed,delete e.bundleOnly):"inactive"!==e.direction&&i.push(e.mid),e})),(null===(r=n.groups)||void 0===r?void 0:r[0])&&(n.groups[0].mids=i.join(" ")),n}var HP,WP,YP,KP,XP,qP=function(e,t){var r,n;try{var i=wP.parse(e),o=wP.parse(t),a="".concat(null===(r=o.groups)||void 0===r?void 0:r[0].mids).split(" "),s="".concat(null===(n=i.groups)||void 0===n?void 0:n[0].mids).split(" "),c={};a.forEach((function(e){return c[e]=e}));var u={};s.forEach((function(e){c[e]||(u[e]=e)}));var d="",l="";return i.media=i.media.filter((function(e){return u[e.mid]&&"audio"===e.type?d="".concat(e.mid):u[e.mid]&&"video"===e.type&&(l="".concat(e.mid)),u[e.mid]})),delete i.groups,delete i.msidSemantic,{partialSdp:wP.write(i),audioMid:d,videoMid:l}}catch(e){return null}},JP=function(e,t){var r;try{var n=wP.parse(e),i=[];return null===(r=n.media)||void 0===r||r.forEach((function(e){(null==t?void 0:t.includes("".concat(e.mid)))&&i.push(e)})),n.media=i,delete n.groups,delete n.msidSemantic,wP.write(n)}catch(e){return""}},ZP=function(e){if(!Array.isArray(e))return[];var t=0,r=2130706431,n=[];return e.forEach((function(e){var i={component:1,ip:e.ip,type:"host",generation:e.generation};e.udpPorts&&e.udpPorts.forEach((function(e){n.push(y(y({},i),{foundation:t++,transport:"udp",port:e,priority:r}))})),e.tcpPorts&&e.tcpPorts.forEach((function(e){n.push(y(y({},i),{foundation:t++,transport:"tcp",port:e,tcptype:"passive",priority:2130705431}))}))})),n},$P=function(e){var t=new TextEncoder,r=t.encode("PREC"),n=new Uint8Array(aO.str2ab(e)),i=t.encode(Date.now().toString()).slice(-4),o=new Uint8Array(4);o[0]=0,o[1]=1,o[2]=1,o[3]=1;var a=oO(Uint8Array,r,n,i,o),s=aO.ab2str(a.buffer);return eO.encodeBase64(s)},QP="safari"===(HP="none",null!==window.navigator.userAgent.match("Firefox")?HP="mozilla":null!==window.navigator.userAgent.match("Chrome")?(HP="chrome-stable",null!==window.navigator.userAgent.match("Electron")&&(HP="electron")):(null!==window.navigator.userAgent.match("Safari")||null!==window.navigator.userAgent.match("AppleWebKit"))&&(HP="safari"),HP);!function(e){e.codec="codec",e.inboundRtp="inbound-rtp",e.outboundRtp="outbound-rtp",e.remoteInboundRtp="remote-inbound-rtp",e.remoteOutboundRtp="remote-outbound-rtp",e.mediaSource="media-source",e.csrc="csrc",e.peerConnection="peer-connection",e.dataChannel="data-channel",e.stream="stream",e.track="track",e.transceiver="transceiver",e.sender="sender",e.receiver="receiver",e.transport="transport",e.sctpTransport="sctp-transport",e.candidatePair="candidate-pair",e.localCandidate="local-candidate",e.remoteCandidate="remote-candidate",e.certificate="certificate",e.iceServer="ice-server"}(WP||(WP={})),function(e){e[e.encode=0]="encode",e[e.decode=1]="decode"}(YP||(YP={})),function(e){e[e.none=0]="none",e[e.cpu=1]="cpu",e[e.bandwidth=2]="bandwidth",e[e.other=3]="other"}(KP||(KP={})),function(e){e[e.unknown=0]="unknown",e[e.controlling=1]="controlling",e[e.controlled=2]="controlled"}(XP||(XP={}));var eM=function(){function e(e){this.peer=e,this.stats=[]}return e.prototype.handleCodec=function(e){return e},e.prototype.handleInboundRtp=function(e){return e},e.prototype.handleOutboundRtp=function(e){var t=e.ssrc;return t&&(e.rtxSsrc=t),e},e.prototype.handleRemoteInboundRtp=function(e){return e},e.prototype.handleRemoteOutboundRtp=function(e){return e},e.prototype.handleMediaSource=function(e){return e},e.prototype.handleCsrc=function(e){return e},e.prototype.handlePeerConnection=function(e){return e},e.prototype.handleDataChannel=function(e){return e},e.prototype.handleStream=function(e){return e},e.prototype.handleTrack=function(e){return e},e.prototype.handleTransceiver=function(e){return e},e.prototype.handleSender=function(e){return e},e.prototype.handleReceiver=function(e){return e},e.prototype.handleTransport=function(e){return e},e.prototype.handleSctpTransport=function(e){return e},e.prototype.handleCandidatePair=function(e){return e},e.prototype.handleLocalCandidate=function(e){return e},e.prototype.handleRemoteCandidate=function(e){return e},e.prototype.handleCertificate=function(e){return e},e.prototype.handleIceServer=function(e){return e},e.prototype.processStats=function(e){var t=this;e.forEach((function(e){var r;switch(e.type){case WP.candidatePair:r=t.handleCandidatePair;break;case WP.certificate:r=t.handleCertificate;break;case WP.remoteCandidate:r=t.handleRemoteCandidate;break;case WP.remoteInboundRtp:r=t.handleInboundRtp;break;case WP.remoteOutboundRtp:r=t.handleOutboundRtp;break;case WP.sctpTransport:r=t.handleSctpTransport;break;case WP.sender:r=t.handleSender;break;case WP.stream:r=t.handleStream;break;case WP.track:r=t.handleTrack;break;case WP.transceiver:r=t.handleTransceiver;break;case WP.transport:r=t.handleTransport;break;case WP.codec:r=t.handleCodec;break;case WP.csrc:r=t.handleCsrc;break;case WP.dataChannel:r=t.handleDataChannel;break;case WP.iceServer:r=t.handleIceServer;break;case WP.mediaSource:r=t.handleMediaSource;break;case WP.outboundRtp:r=t.handleOutboundRtp;break;case WP.inboundRtp:r=t.handleInboundRtp;break;case WP.peerConnection:r=t.handlePeerConnection;break;case WP.receiver:r=t.handleReceiver;break;case WP.localCandidate:r=t.handleLocalCandidate;break;default:r=function(e){return e}}r=r.bind(t),t.stats.push(r(e))}))},e.prototype.getExtraStats=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){return[2,new Promise((function(t,r){if(QP||void 0!==window.InstallTrigger)return t(e.stats);try{e.peer.getStats((function(r){r.result().forEach((function(t){if(!tM.includes(t.type)){var r={};t.names().forEach((function(e){r[e]=t.stat(e)})),r.id=t.id,r.type=t.type,r.timestamp=t.timestamp,e.stats.push(r)}})),t(e.stats)}))}catch(e){r(e)}}))]}))}))},e.prototype.getStats=function(e){return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),[4,this.peer.getStats(e)];case 1:t=r.sent(),this.processStats(t),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,this.getExtraStats()];case 3:case 4:return r.sent(),[3,5];case 5:return[3,7];case 6:return r.sent(),[3,7];case 7:return[2,this.stats]}}))}))},e}(),tM=["codec","inbound-rtp","outbound-rtp","remote-inbound-rtp","remote-outbound-rtp","media-source","csrc","peer-connection","data-channel","stream","track","transceiver","sender","receiver","transport","sctp-transport","candidate-pair","local-candidate","remote-candidate","certificate","ice-server"],rM=function(){var e;try{var t=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.toLowerCase();if(t.indexOf("ucbrowser")>-1&&t.indexOf("iphone"))return!1}catch(e){return!1}return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)},nM=function(){return"undefined"!=typeof TransformStream&&void 0!==RTCRtpSender.prototype.createEncodedStreams&&void 0!==RTCRtpReceiver.prototype.createEncodedStreams},iM=new PO("BasicHandler",3),oM=nM(),aM={iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",encodedInsertableStreams:!!oM||void 0},sM=function(e){function t(){var t=e.call(this)||this;return t._peerConnection=new RTCPeerConnection(aM),t._dataChannel=t._peerConnection.createDataChannel("signaling"),t._dataChannel.binaryType="arraybuffer",t._peerConnection.ontrack=function(e){var r,n;iM.print("constructor","pc.ontrack ".concat(e.track.kind," ").concat(e.track.id," ").concat(null===(n=null===(r=e.streams)||void 0===r?void 0:r[0])||void 0===n?void 0:n.id)),t.emit("ontrack",e)},t._peerConnection.onconnectionstatechange=function(e){iM.print("constructor","onconnectionstatechange ".concat(t._peerConnection.iceConnectionState," -> ").concat(t._peerConnection.connectionState)),"failed"!==t._peerConnection.iceConnectionState&&"closed"!==t._peerConnection.iceConnectionState&&"failed"!==t._peerConnection.connectionState||t.emit("disconnect")},t._peerConnection.oniceconnectionstatechange=function(){var e=t._peerConnection.iceConnectionState;aP.rtcPreIceState(e,nD["".concat(e.toUpperCase())])},t}return r(t,e),t.prototype.connect=function(e){return S(this,void 0,void 0,(function(){var t,r,n=this;return b(this,(function(i){switch(i.label){case 0:return iM.print("connect","invoke connect"),[4,this._peerConnection.createOffer()];case 1:return t=i.sent(),this._localSdp=new FP(e),[4,this.setLocalDescription(t.sdp)];case 2:return i.sent(),uP("es.connect.offer",t.sdp),this._remoteSdp=new GP(e),r=this._remoteSdp.modifyByIceNode(t.sdp),[4,this.setRemoteDescription(r)];case 3:return i.sent(),uP("es.connect.answer",r),[4,new Promise((function(e,t){n._dataChannel.onopen=function(){iM.print("connect","dataChannel open"),uP("es.dc.open",""),e("")},n._dataChannel.onerror=function(e){aP.rtcSignalingMsgError(e.error.sdpLineNumber,e.error.errorDetail,iD.INVALID_DATA),uP("es.dc.error",""),t(e)},n._dataChannel.onclose=function(e){uP("es.dc.close",""),t(e)}}))];case 4:return i.sent(),iM.print("connect","dataChannel establish success"),[2,this._dataChannel]}}))}))},t.prototype.disconnect=function(){this._peerConnection.close(),this._dataChannel.close(),this._peerConnection.ontrack=null},t.prototype.destroy=function(){this.disconnect(),this._localSdp=void 0,this._remoteSdp=void 0},t.prototype.publish=function(e){var t;return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g;return b(this,(function(E){switch(E.label){case 0:if(r=e.stream,n=null==e?void 0:e.videoTrack,i=null==e?void 0:e.audioTrack,o={},a=[],Array.isArray(null==e?void 0:e.videoEncodeConfig))for(s=null==e?void 0:e.videoEncodeConfig.length,c=null==n?void 0:n.getTrack(),u={width:640,height:480,framerate:30},c&&(d=null==c?void 0:c.getSettings(),u={width:Math.floor(d.width),height:Math.floor(d.height),framerate:Math.floor(d.frameRate)}),o.sendEncodings=[],l=0;l<s;l++)f=null==e?void 0:e.videoEncodeConfig[l],h={maxBitrate:1e3*f.maxKbps},p=Math.pow(2,l),s>1&&(h.rid="".concat(l),h.scaleResolutionDownBy=p),null===(t=o.sendEncodings)||void 0===t||t.unshift(h),a.push({width:Math.floor(u.width/p),height:Math.floor(u.height/p),framerate:u.framerate,maxkbps:f.maxKbps,rid:"".concat(l)});return iM.print("publish videoTransceiverInit videoDescriptions","",o,a),_=null==i?void 0:i.getTrack(),(null==i?void 0:i.mixType)!==C.PLAYOUT&&(null==i?void 0:i.mixedAudioTrack)&&(_=null==i?void 0:i.mixedAudioTrack),e.audioTransceiver=this._peerConnection.addTransceiver(_||"audio",{direction:"sendonly",streams:[r]}),oM&&e.initAudioEncodedTransform(),e.videoTransceiver=this._peerConnection.addTransceiver((null==n?void 0:n.getTrack())||"video",y({direction:"sendonly",streams:[r]},o)),oM&&e.initVideoEncodedTransform(),iM.print("sender.getParameters()",e.videoTransceiver.sender.getParameters()),v=iO(),aP.rtcBeginCreateOffer(sD.UP,e.streamId,e.userId),[4,this._peerConnection.createOffer()];case 1:if(m=E.sent(),aP.rtcCreateOffer(0,cD.UP,e.streamId,e.userId,iO()-v),g=qP(m.sdp,this.getLocalDescriptionSdp()),!m.sdp||!g)throw new iI(tI.ADD_TRANSCEIVER_FAILED,"createOffer failed");return[2,y(y({sdp:m.sdp},g),{type:"incroffer",semantics:"unified-plan",videoDescriptions:a})]}}))}))},t.prototype.subscribe=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a;return b(this,(function(s){switch(s.label){case 0:return r="incroffer",n="unified-plan",t?[2,{sdp:this.getLocalDescriptionSdp(),partialSdp:JP(this.getLocalDescriptionSdp(),[t.audioMid,t.videoMid]),audioMid:t.audioMid,videoMid:t.videoMid,type:r,semantics:n}]:(e.audioTransceiver=this._peerConnection.addTransceiver("audio",{direction:"recvonly"}),oM&&e.initAudioEncodedTransform(),e.videoTransceiver=this._peerConnection.addTransceiver("video",{direction:"recvonly"}),oM&&e.initVideoEncodedTransform(),i=iO(),aP.rtcBeginCreateOffer(sD.DOWN,e.streamId,e.userId),[4,this._peerConnection.createOffer()]);case 1:if(o=s.sent(),aP.rtcCreateOffer(0,cD.DOWN,e.streamId,e.userId,iO()-i),a=qP(o.sdp,this.getLocalDescriptionSdp()),!o.sdp||!a)throw new iI(tI.ADD_TRANSCEIVER_FAILED,"createOffer failed");return[2,y(y({sdp:o.sdp},a),{type:r,semantics:n})]}}))}))},t.prototype.setAnswerSdp=function(e,t,r,n,i){var o;return S(this,void 0,void 0,(function(){var a,s,c,u,d,l;return b(this,(function(f){switch(f.label){case 0:return aP.rtcRecvAnswer(0,lD.INCRANSWER,0,t,i,n.streamId,n.userId),a=this._peerConnection.remoteDescription,s=wP.parse(null==a?void 0:a.sdp),c=null===(o=s.media)||void 0===o?void 0:o.reduce((function(e,t){return e[t.mid]=t,e}),{}),wP.parse(t).media.forEach((function(e){return c[e.mid]=e})),u=[],d=wP.parse(e),l=d.media.map((function(e){r&&r[e.mid]&&(e.mid=r[e.mid]),"inactive"!==e.direction&&u.push(e.mid);var t=c[e.mid];return t.port=e.port,t})),s.media=l,d.groups=[{mids:u.join(" "),type:"BUNDLE"}],s.groups=d.groups,[4,this.setLocalDescription(wP.write(d),n,i)];case 1:return f.sent(),[4,this.setRemoteDescription(wP.write(s),n,i)];case 2:return f.sent(),[2]}}))}))},t.prototype.setLocalDescription=function(e,t,r){var n;return S(this,void 0,void 0,(function(){var i,o,a,s;return b(this,(function(c){switch(c.label){case 0:i=null===(n=this._localSdp)||void 0===n?void 0:n.modifyByIceNode(e),o=new RTCSessionDescription({type:"offer",sdp:i}),a=iO(),c.label=1;case 1:return c.trys.push([1,3,,4]),iM.print("setOffer","set offer: ",o),[4,this._peerConnection.setLocalDescription(o)];case 2:return c.sent(),t&&aP.rtcSetDescription(0,"",uD.W_1,r,t.streamId,t.userId,iO()-a),[3,4];case 3:throw(s=c.sent())instanceof Error&&t&&aP.rtcSetDescription(-1,s.message,uD.W_1,r,t.streamId,t.userId,iO()-a),s;case 4:return[2]}}))}))},t.prototype.setRemoteDescription=function(e,t,r){return S(this,void 0,void 0,(function(){var n,i,o;return b(this,(function(a){switch(a.label){case 0:n=new RTCSessionDescription({type:"answer",sdp:e}),i=iO(),a.label=1;case 1:return a.trys.push([1,3,,4]),iM.print("setAnswer","set answer: ",n),[4,this._peerConnection.setRemoteDescription(n)];case 2:return a.sent(),t&&aP.rtcSetDescription(0,"",uD.W_0,r,t.streamId,t.userId,iO()-i),[3,4];case 3:throw(o=a.sent())instanceof Error&&t&&aP.rtcSetDescription(-1,o.message,uD.W_0,r,t.streamId,t.userId,iO()-i),o;case 4:return[2]}}))}))},t.prototype.getLocalDescriptionSdp=function(){var e,t,r,n;if(null===(t=null===(e=this._peerConnection)||void 0===e?void 0:e.localDescription)||void 0===t?void 0:t.sdp)return null===(n=null===(r=this._peerConnection)||void 0===r?void 0:r.localDescription)||void 0===n?void 0:n.sdp;throw Error()},t.prototype.getRemoteDescriptionSdp=function(){var e,t,r,n;if(null===(t=null===(e=this._peerConnection)||void 0===e?void 0:e.remoteDescription)||void 0===t?void 0:t.sdp)return null===(n=null===(r=this._peerConnection)||void 0===r?void 0:r.remoteDescription)||void 0===n?void 0:n.sdp;throw Error()},t.prototype.closeMLine=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i,o,a,s=this;return b(this,(function(c){switch(c.label){case 0:return iM.print("closeMids","closeMids: ",e),n=this.getLocalDescriptionSdp(),i=zP(n,e),o=this.getRemoteDescriptionSdp(),a=zP(o,e),[4,this.setLocalDescription(wP.write(i))];case 1:return c.sent(),(null===(t=null==i?void 0:i.media)||void 0===t?void 0:t.length)!==(null===(r=null==a?void 0:a.media)||void 0===r?void 0:r.length)&&i.media.slice(a.media.length).forEach((function(e){var t;null===(t=s._remoteSdp)||void 0===t||t.modifyMlineByIceNode(e),a.media.push(e)})),Array.isArray(i.media)&&Array.isArray(a.media)&&i.media.forEach((function(e,t){a.media[t]&&(a.media[t].mid=e.mid)})),[4,this.setRemoteDescription(wP.write(a))];case 2:return c.sent(),[2]}}))}))},t.prototype.getDefaultSdp=function(){return S(this,void 0,void 0,(function(){var e,t,r;return b(this,(function(n){switch(n.label){case 0:return(e=TP.getDefaultSdp())?[3,2]:((t=new RTCPeerConnection(aM)).createDataChannel("default"),t.addTransceiver("audio",{direction:"recvonly"}),t.addTransceiver("video",{direction:"recvonly"}),[4,t.createOffer()]);case 1:r=n.sent(),e=null==r?void 0:r.sdp,t.close(),TP.setDefaultSdp(e),n.label=2;case 2:return[2,{sdp:e,semantics:"unified-plan",type:"offer"}]}}))}))},t.prototype.getStats=function(e){return t=this._peerConnection,r=e,S(void 0,void 0,void 0,(function(){var e;return b(this,(function(n){switch(n.label){case 0:return e=[],t instanceof RTCPeerConnection?[4,new eM(t).getStats(r)]:[2,e];case 1:return[2,e=n.sent()]}}))}));var t,r},t.prototype.rollback=function(e,t){var r;return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return iM.print("rollback()","signalingState: %o",this._peerConnection.signalingState),"stable"!==this._peerConnection.signalingState?[3,2]:[4,null===(r=this._peerConnection)||void 0===r?void 0:r.setLocalDescription(new RTCSessionDescription({sdp:e,type:"offer"}))];case 1:n.sent(),n.label=2;case 2:return[4,this.closeMLine(t)];case 3:return n.sent(),[2]}}))}))},Object.defineProperty(t.prototype,"pc",{get:function(){return this._peerConnection},enumerable:!1,configurable:!0}),t}(SO.exports.EventEmitter),cM=new PO("Locker",2),uM=1,dM=function(){function e(e){this.lockingPromise=Promise.resolve(),this.locks=0,this.name="",this.lockId=uM++,e&&(this.name=e),cM.print("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}return Object.defineProperty(e.prototype,"isLocked",{get:function(){return this.locks>0},enumerable:!1,configurable:!0}),e.prototype.lock=function(){var e,t=this;this.locks+=1,cM.print("[lock-".concat(this.name,"-").concat(this.lockId,"] locked, current queue ").concat(this.locks,"."));var r=new Promise((function(r){e=function(){t.locks-=1,cM.print("[lock-".concat(t.name,"-").concat(t.lockId,"] unlocked, current queue ").concat(t.locks,".")),r()}})),n=this.lockingPromise.then((function(){return e}));return this.lockingPromise=this.lockingPromise.then((function(){return r})),n},e}(),lM=Math.log,fM=Math.LOG10E;bi({target:"Math",stat:!0},{log10:Math.log10||function(e){return lM(e)*fM}}),bi({target:"Number",stat:!0},{isNaN:function(e){return e!=e}}),new PO("Stats",2);var hM,pM=function(){function e(e,t){this._client=e,this._handler=t,this.dataChannelRTT={},this._rttTimer={},this._remoteStreamStasEvtIntervals={},this._localStreamStasEvtIntervals={},this._firstFrameStarted={},this._videoInWaiting={}}return e.prototype.setRemoteStreamStatsEvtInterval=function(e){var t,r,n=this;this.getDataChannelRTT(e.userId);var i={audio:{},video:{},remoteStream:e},o=null===(t=e.audioTrack)||void 0===t?void 0:t.getTrack(),a=null===(r=e.videoTrack)||void 0===r?void 0:r.getTrack();this.getRemoteAudioStats(o,i),this.getRemoteVideoStats(a,i),this.delRemoteStreamStatsEvtInterval(e);this._remoteStreamStasEvtIntervals[e.streamId]=setInterval((function(){return S(n,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return[4,S(n,void 0,void 0,(function(){var t,r,n,o,a,s;return b(this,(function(c){switch(c.label){case 0:return t=null===(a=e.audioTrack)||void 0===a?void 0:a.getTrack(),r=null===(s=e.videoTrack)||void 0===s?void 0:s.getTrack(),[4,this.getRemoteAudioStats(t,i)];case 1:return n=c.sent(),[4,this.getRemoteVideoStats(r,i)];case 2:return(o=c.sent()).isScreen=e.isScreen,[2,{audioStats:n,videoStats:o,isScreen:e.isScreen,userId:e.userId}]}}))}))];case 1:return t=r.sent(),this._client.emit("onRemoteStreamStats",t),[2]}}))}))}),2e3)},e.prototype.delRemoteStreamStatsEvtInterval=function(e){clearInterval(this._remoteStreamStasEvtIntervals[e.streamId])},e.prototype.unsubscribe=function(e){this.delRemoteStreamStatsEvtInterval(e),clearTimeout(this._rttTimer[e.userId]),this._videoInWaiting[e.streamId]=!1,this._firstFrameStarted["".concat(e.streamId,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:e.isScreen?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-audio")],event_session_id:e.streamId,result:!1,reason:bD.UNSUBSCRIBE,stream_user_id:e.userId}),delete this._firstFrameStarted["".concat(e.streamId,"-audio")]),this._firstFrameStarted["".concat(e.streamId,"-video")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:e.isScreen?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-video")],event_session_id:e.streamId,result:!1,reason:bD.UNSUBSCRIBE,stream_user_id:e.userId}),delete this._firstFrameStarted["".concat(e.streamId,"-video")])},e.prototype.getRemoteAudioStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p=this;return b(this,(function(_){switch(_.label){case 0:return r={},n={timestamp:Date.now()},i=t.remoteStream,o=i.streamId,a=i.userId,s=i.isScreen,c=i.audioMid,u=i.hasAudio,d={media_type:"audio",direction:"down",stream_id:o,stream_user_id:a,vid:c,remote_muted:!u},e&&this._handler?(t.audioStart||(t.audioStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_RECV,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.SUBSCRIBE,start:t.audioStart,event_session_id:o,stream_user_id:a}),u?this._firstFrameStarted["".concat(o,"-audio")]=t.audioStart:aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:t.audioStart,event_session_id:o,result:!1,reason:bD.DISABLE,stream_user_id:a})),[4,this._handler.getStats(e)]):[2,r];case 1:return(l=_.sent()).length?(l.forEach((function(e){var i=e.type,c=e.packetsLost,u=e.packetsReceived,l=e.bytesReceived,f=e.jitterBufferDelay,h=e.jitterBufferEmittedCount,_=e.clockRate,v=e.channels,m=e.totalSamplesReceived,g=e.concealedSamples,y=e.concealmentEvents,E=e.totalRoundTripTime,S=e.state,b=e.currentRoundTripTime,T=e.audioLevel,I=e.totalAudioEnergy,A=e.totalSamplesDuration,R=e.mimeType,C=e.googDecodingNormal,O=e.fecPacketsReceived,w=e.availableIncomingBitrate,N=e.availableOutgoingBitrate,k=e.bytesSent,D=e.nominated,P=e.id,M=e.writable,U=e.jitter,L=e.candidateType,x=e.ip,B=e.networkType,V=e.port,j=e.protocol,F=e.audioOutputLevel,G=e.requestsReceived,z=e.responsesReceived,H=e.requestsSent,W=e.consentRequestsSent,Y=e.responsesSent,K=e.ssrc,X=e.kind;"inbound-rtp"===i?(n.packetsLost=c,n.packetsReceived=u,d.packets=u,n.bytesReceived=l,d.bytes=l,r.jitterBufferDelay=f/h*1e3,d.jitter_buffer_delay=r.jitterBufferDelay,n.totalSamplesReceived=m,r.concealedSamples=g,n.concealedSamples=g,d.concealed_samples=g,r.concealmentEvents=y,d.fec_packets_received=O,d.jitter=1e3*U,d.ssrc=K,d.total_samples_received=m,m>0&&p._firstFrameStarted["".concat(o,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.SUBSCRIBE,event_session_id:o,result:!0,start:t.audioStart,stream_user_id:a}),delete p._firstFrameStarted["".concat(o,"-audio")])):"codec"===i?(r.recordSampleRate=_,r.numChannels=v,d.codec=R):"candidate-pair"===i?(d.ice_available_incoming_bitrate=w,d.ice_available_outgoing_bitrate=N,d.ice_bytes_received=l,d.ice_bytes_sent=k,d.ice_nominated=+D,d.ice_pair_id=P,d.ice_pair_rtt=b,d.rtt=1e3*b,d.ice_pair_state=S,d.ice_pair_writable=M,d.recv_ping_requests=G,d.recv_ping_responses=z,d.sent_ping_requests_before_first_response=H,d.sent_ping_requests_total=H+W,d.sent_ping_responses=Y,"succeeded"===S&&(r.rtt=1e3*b,r.total_rtt=1e3*E)):"track"===i&&"audio"===X?(d.audio_level=-10*Math.log10(Math.pow(T,2)),d.volume=255*T,d.total_audio_energy=I,d.total_samples_duration=A):"ssrc"===i?(d.decoding_normal=C,d.recv_level=F):"local-candidate"===i?(d.local_candidate_type=L,d.local_ip=x,d.local_network_type=B,d.local_port=V,d.protocol=j):"remote-candidate"===i&&(d.remote_candidate_type=L,d.remote_ip=x,d.remote_port=V)})),(f=t.audio).timestamp?(r.audioLossRate=(n.packetsLost-f.packetsLost)/(n.packetsReceived-f.packetsReceived+(n.packetsLost-f.packetsLost)),r.audioLossRate=Number.isNaN(r.audioLossRate)?0:r.audioLossRate,d.packets_lost=Math.round(n.packetsLost-f.packetsLost),d.fraction_lost=r.audioLossRate,d.packets_lost_rate=r.audioLossRate,r.statsInterval=n.timestamp-f.timestamp,r.receivedKBitrate=(n.bytesReceived-f.bytesReceived||0)/r.statsInterval,d.bitrate=Math.round(8e3*r.receivedKBitrate),d.bandwidth=Math.round(d.bitrate/1024),d.interval_concealed_samples=n.concealedSamples-f.concealedSamples,d.interval_samples_received=n.totalSamplesReceived-f.totalSamplesReceived,r.receivedSampleRate=1e3*d.interval_samples_received/r.statsInterval,t.audio=n,this.dataChannelRTT[t.remoteStream.userId]&&(h=this.dataChannelRTT[t.remoteStream.userId]/2,r.e2eDelay=h+(r.jitterBufferDelay||0),d.web_e2e_delay=r.e2eDelay,d.total_rtt_ms=h),t.remoteStream.subAudio&&aP.rtcMediaStatistics(d,{}),[2,r]):(t.audio=n,[2,r])):[2,r]}}))}))},e.prototype.getRemoteVideoStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p=this;return b(this,(function(_){switch(_.label){case 0:return r={},n={timestamp:Date.now()},i=t.remoteStream,o=i.streamId,a=i.userId,s=i.isScreen,c=i.hasVideo,u={media_type:"video",direction:"down",stream_id:o,stream_user_id:a,vid:t.remoteStream.videoMid,remote_muted:!c},e&&this._handler?(t.videoStart||(t.videoStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_RECV,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.SUBSCRIBE,start:t.videoStart,event_session_id:o,stream_user_id:a}),c?this._firstFrameStarted["".concat(o,"-video")]=t.videoStart:aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:t.videoStart,event_session_id:o,result:!1,reason:bD.DISABLE,stream_user_id:a})),[4,this._handler.getStats(e)]):[2,r];case 1:return(d=_.sent()).length?(d.forEach((function(e){var i=e.type,c=e.frameHeight,d=e.frameWidth,l=e.packetsLost,f=e.packetsReceived,h=e.bytesReceived,_=e.framesDecoded,v=e.roundTripTime,m=e.jitterBufferDelay,g=e.jitterBufferEmittedCount,y=e.mimeType,E=e.firCount,S=e.availableIncomingBitrate,b=e.availableOutgoingBitrate,T=e.bytesSent,I=e.nominated,A=e.id,R=e.currentRoundTripTime,C=e.state,O=e.writable,w=e.candidateType,N=e.ip,k=e.networkType,D=e.port,P=e.nackCount,M=e.pliCount,U=e.protocol,L=e.requestsReceived,x=e.responsesReceived,B=e.requestsSent,V=e.consentRequestsSent,j=e.responsesSent,F=e.ssrc;e.totalRoundTripTime;var G=e.jitter,z=e.framesReceived,H=e.keyFramesDecoded,W=e.totalDecodeTime,Y=e.decoderImplementation,K=e.lastPacketReceivedTimestamp;"inbound-rtp"===i?(r.width=d,u.frame_size_width=d,r.height=c,u.frame_size_height=c,n.packetsLost=l,u.packets_lost=l,n.packetsReceived=f,u.packets=f,n.bytesReceived=h,u.bytes=h,n.framesDecoded=_,n.jitterBufferDelay=m/g*1e3,u.jitter_buffer_delay=n.jitterBufferDelay,u.fir_count=E,u.nack_count=P,u.pli_count=M,u.ssrc=F,u.jitter=G,u.frames_received=z,u.frames_decoded=_,u.key_frames_decoded=H,u.total_decode_time=W,u.decoder_implementation=Y,u.last_packet_received_timestamp=K,_>0&&p._firstFrameStarted["".concat(o,"-video")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.SUBSCRIBE,event_session_id:o,result:!0,start:t.videoStart,stream_user_id:a}),delete p._firstFrameStarted["".concat(o,"-video")])):"remote-outbound-rtp"===i?(r.rtt=1e3*v,u.rtt=v):"codec"===i?u.codec=y:"candidate-pair"===i?(u.ice_available_incoming_bitrate=S,u.ice_available_outgoing_bitrate=b,u.ice_bytes_received=h,u.ice_bytes_sent=T,u.ice_nominated=+I,u.ice_pair_id=A,u.ice_pair_rtt=R,u.rtt=1e3*R,u.ice_pair_state=C,u.ice_pair_writable=O,u.recv_ping_requests=L,u.recv_ping_responses=x,u.sent_ping_requests_before_first_response=B,u.sent_ping_requests_total=B+V,u.sent_ping_responses=j):"local-candidate"===i?(u.local_candidate_type=w,u.local_ip=N,u.local_network_type=k,u.local_port=D,u.protocol=U):"remote-candidate"===i&&(u.remote_candidate_type=w,u.remote_ip=N,u.remote_port=D)})),l=t.video,f=t.remoteStream,l.timestamp?(r.videoLossRate=(n.packetsLost-l.packetsLost)/(n.packetsReceived-l.packetsReceived+(n.packetsLost-l.packetsLost)),r.videoLossRate=Number.isNaN(r.videoLossRate)?0:r.videoLossRate,u.fraction_lost=r.videoLossRate,u.packets_lost_rate=r.videoLossRate,r.statsInterval=n.timestamp-l.timestamp,r.receivedKBitrate=(n.bytesReceived-l.bytesReceived||0)/r.statsInterval,u.bitrate=Math.round(8e3*r.receivedKBitrate),u.bandwidth=Math.round(u.bitrate/1024),r.decoderOutputFrameRate=1e3*(n.framesDecoded-l.framesDecoded)/r.statsInterval,u.frame_rate_decoded=Math.round(r.decoderOutputFrameRate),u.frame_rate_received=u.frame_rate_decoded,t.video=n,this.dataChannelRTT[t.remoteStream.userId]&&(h=this.dataChannelRTT[t.remoteStream.userId]/2,r.e2eDelay=h+n.jitterBufferDelay,u.web_e2e_delay=r.e2eDelay,u.total_rtt_ms=h),f.subVideo&&(this.processStall(f,u),aP.rtcMediaStatistics(u,{})),[2,r]):(t.video=n,[2,r])):[2,r]}}))}))},e.prototype.processStall=function(e,t){var r=0,n=0,i=0;e.recordedVideoFrames.forEach((function(e){e.isStall&&(r+=e.stallCount,n+=e.stallDuration),i=e.playTime})),e.recordedVideoFrames.length||(n=2e3,r=this._videoInWaiting[e.streamId]?0:1,this._videoInWaiting[e.streamId]=!0);var o=e.recordedVideoFrames.pop();o&&(o.isStall?this._videoInWaiting[e.streamId]=!0:this._videoInWaiting[e.streamId]=!1),e.recordedVideoFrames=[],t.stall_count=r,t.stall_duration=n,t.play_time=i},e.prototype.setLocalStreamStatsEvtInterval=function(e){var t,r,n=this,i={audio:{},video:{},localStream:e,firstframeReported:!1},o=null===(t=e.audioTrack)||void 0===t?void 0:t.getTrack(),a=null===(r=e.videoTrack)||void 0===r?void 0:r.getTrack();this.getAudioStats(o,i),this.getVideoStats(a,i),this.delLocalStreamStatsEvtInterval(e);this._localStreamStasEvtIntervals[e.streamId]=setInterval((function(){return S(n,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return[4,S(n,void 0,void 0,(function(){var t,r,n,o,a,s;return b(this,(function(c){switch(c.label){case 0:return t=null===(a=e.audioTrack)||void 0===a?void 0:a.getTrack(),r=null===(s=e.videoTrack)||void 0===s?void 0:s.getTrack(),[4,this.getAudioStats(t,i)];case 1:return n=c.sent(),[4,this.getVideoStats(r,i)];case 2:return(o=c.sent()).isScreen=e.isScreen,[2,{audioStats:n,videoStats:o,isScreen:e.isScreen}]}}))}))];case 1:return t=r.sent(),this._client.emit("onLocalStreamStats",t),[2]}}))}))}),2e3)},e.prototype.delLocalStreamStatsEvtInterval=function(e){clearInterval(this._localStreamStasEvtIntervals[e.streamId])},e.prototype.unpublish=function(e){this.delLocalStreamStatsEvtInterval(e),this._firstFrameStarted["".concat(e.streamId,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:e.isScreen?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-audio")],event_session_id:e.streamId,result:!1,reason:bD.UNPUBLISH}),delete this._firstFrameStarted["".concat(e.streamId,"-audio")]),this._firstFrameStarted["".concat(e.streamId,"-video")]&&(aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:e.isScreen?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-video")],event_session_id:e.streamId,result:!1,reason:bD.UNPUBLISH}),delete this._firstFrameStarted["".concat(e.streamId,"-video")])},e.prototype.getAudioStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l=this;return b(this,(function(f){switch(f.label){case 0:return r={},n={timestamp:Date.now()},i=t.localStream,o=i.streamId,a=i.audioMid,s=i.isScreen,c={media_type:"audio",direction:"up",stream_id:o,vid:a},e&&this._handler?(t.audioStart||(t.audioStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_SEND,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:t.audioStart,event_session_id:o}),this._firstFrameStarted["".concat(o,"-audio")]=t.audioStart),[4,this._handler.getStats(e)]):[2,r];case 1:return(u=f.sent()).length?(u.forEach((function(e){var i=e.type,a=e.packetsSent,u=e.packetsLost,d=e.bytesSent,f=e.clockRate,h=e.roundTripTime,p=e.channels,_=e.audioLevel,v=e.googRtt,m=e.mimeType,g=e.availableIncomingBitrate,y=e.availableOutgoingBitrate,E=e.bytesReceived,S=e.nominated,b=e.id,T=e.currentRoundTripTime,I=e.state,A=e.writable,R=e.requestsReceived,C=e.responsesReceived,O=e.requestsSent,w=e.consentRequestsSent,N=e.responsesSent,k=e.jitter,D=e.candidateType,P=e.ip,M=e.networkType,U=e.port,L=e.protocol,x=e.nackCount,B=e.retransmittedBytesSent,V=e.retransmittedPacketsSent,j=e.roundTripTimeMeasurements,F=e.audioInputLevel,G=e.ssrc,z=e.totalAudioEnergy,H=e.totalSamplesDuration,W=e.mediaType;"outbound-rtp"===i?(n.packetsSent=a,a>0&&l._firstFrameStarted["".concat(o,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,event_session_id:o,result:!0,start:t.audioStart}),delete l._firstFrameStarted["".concat(o,"-audio")]),n.bytesSent=d,c.bytes=d,c.packets=a,c.nack_count=x,c.ssrc=G,c.retransmitted_bytes_sent=B,c.retransmitted_packets_sent=V):"remote-inbound-rtp"===i?(n.packetsLost=u,c.packets_lost=u,c.jitter=1e3*k,r.rtt=1e3*h,c.rtt=r.rtt,c.round_trip_time_measurements=j):"codec"===i?(r.recordSampleRate=f,r.numChannels=p,c.codec=m):"media-source"===i?(c.audio_level=-10*Math.log10(Math.pow(_,2)),c.volume=255*_,c.total_audio_energy=z,c.total_samples_duration=H):"ssrc"===i&&"audio"===W?(c.audio_network_elapse=v,c.send_level=F):"candidate-pair"===i?(c.ice_available_incoming_bitrate=g,c.ice_available_outgoing_bitrate=y,c.ice_bytes_received=E,c.ice_bytes_sent=d,c.ice_nominated=+S,c.ice_pair_id=b,c.ice_pair_rtt=T,c.ice_pair_state=I,c.ice_pair_writable=A,c.recv_ping_requests=R,c.recv_ping_responses=C,c.sent_ping_requests_before_first_response=O,c.sent_ping_requests_total=O+w,c.sent_ping_responses=N):"local-candidate"===i?(c.local_candidate_type=D,c.local_ip=P,c.local_network_type=M,c.local_port=U,c.protocol=L):"remote-candidate"===i&&(c.remote_candidate_type=D,c.remote_ip=P,c.remote_port=U)})),(d=t.audio).timestamp?(r.audioLossRate=(n.packetsLost-d.packetsLost)/(n.packetsSent-d.packetsSent),r.audioLossRate=Number.isNaN(r.audioLossRate)?0:r.audioLossRate,c.fraction_lost=r.audioLossRate,r.statsInterval=n.timestamp-d.timestamp,r.sentKBitrate=(n.bytesSent-d.bytesSent||0)/r.statsInterval,c.bitrate=Math.round(8e3*r.sentKBitrate),c.bandwidth=Math.round(c.bitrate/1024),t.audio=n,aP.rtcMediaStatistics(c,{}),[2,r]):(t.audio=n,[2,r])):[2,r]}}))}))},e.prototype.getVideoStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l=this;return b(this,(function(f){switch(f.label){case 0:return r={},n={timestamp:Date.now()},i=t.localStream,o=i.streamId,a=i.videoMid,s=i.isScreen,c={media_type:"video",direction:"up",stream_id:o,vid:a},e&&this._handler?(t.videoStart||(t.videoStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_SEND,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:t.videoStart,event_session_id:o}),this._firstFrameStarted["".concat(o,"-video")]=t.videoStart),[4,this._handler.getStats(e)]):[2,r];case 1:return(u=f.sent()).length?(u.forEach((function(e){var i=e.type,a=e.framesEncoded,u=e.packetsLost,d=e.bytesSent,f=e.framesSent,h=e.roundTripTime,p=e.mimeType,_=e.totalSamplesReceived,v=e.frameWidth,m=e.frameHeight,g=e.clockRate,y=e.packetsSent,E=e.googActualEncBitrate,S=e.googAvailableReceiveBandwidth,b=e.googAvailableSendBandwidth,T=e.googAvgEncodeMs,I=e.googBucketDelay,A=e.googEncodeUsagePercent,R=e.googFrameRateInput,C=e.availableIncomingBitrate,O=e.availableOutgoingBitrate,w=e.bytesReceived,N=e.nominated,k=e.id,D=e.currentRoundTripTime,P=e.state,M=e.writable,U=e.candidateType,L=e.ip,x=e.networkType,B=e.port,V=e.nackCount,j=e.pliCount,F=e.protocol,G=e.qpSum,z=e.requestsReceived,H=e.responsesReceived,W=e.googRetransmitBitrate,Y=e.requestsSent,K=e.consentRequestsSent,X=e.responsesSent,q=e.ssrc,J=e.googTargetEncBitrate,Z=e.googTransmitBitrate,$=e.googRtt,Q=e.retransmittedPacketsSent,ee=e.encoderImplementation,te=e.jitter;"outbound-rtp"===i?(n.framesEncoded=a,n.bytesSent=d,c.bytes=d,n.framesSent=f,f>0&&l._firstFrameStarted["".concat(o,"-video")]&&(t.firstframeVideoReported=!0,aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:t.videoStart,event_session_id:o,result:!0}),delete l._firstFrameStarted["".concat(o,"-video")]),r.encodedFrameWidth=v,r.encodedFrameHeight=m,c.frame_size_height=m,c.frame_size_width=v,n.packetsSent=y,c.packets=y,c.nack_count=V,c.pli_count=j,c.qp_sum=G,c.ssrc=q,c.retransmitted_packets_sent=Q,c.encoder_implementation=ee):"remote-inbound-rtp"===i?(n.packetsLost=u,r.rtt=1e3*h,c.rtt=r.rtt,c.jitter=te,c.packets_lost=u):"codec"===i?(r.codecType=p,c.codec=p,r.inputFrameRate=g):"track"===i?n.totalSamplesReceived=_:"candidate-pair"===i?(c.ice_available_incoming_bitrate=C,c.ice_available_outgoing_bitrate=O,c.ice_bytes_received=w,c.ice_bytes_sent=d,c.ice_nominated=+N,c.ice_pair_id=k,c.ice_pair_rtt=D,c.ice_pair_state=P,c.ice_pair_writable=M,c.recv_ping_requests=z,c.recv_ping_responses=H,c.sent_ping_requests_before_first_response=Y,c.sent_ping_requests_total=Y+K,c.sent_ping_responses=X):"local-candidate"===i?(c.local_candidate_type=U,c.local_ip=L,c.local_network_type=x,c.local_port=B,c.protocol=F):"remote-candidate"===i?(c.remote_candidate_type=U,c.remote_ip=L,c.remote_port=B):"VideoBwe"===i?(c.actual_enc_bitrate=E,c.available_receive_bandwidth=S,c.available_send_bandwidth=b,c.bucket_delay=I,c.retransmit_bitrate=W,c.target_enc_bitrate=J,c.transmit_bitrate=Z):"ssrc"===i&&(c.video_network_elapse=$,c.avg_encode_ms=T,c.encode_usage_percent=A,c.frame_rate_input=R)})),(d=t.video).timestamp?(r.statsInterval=n.timestamp-d.timestamp,r.encodedFrameCount=n.framesSent-d.framesSent,r.sentKBitrate=(n.bytesSent-d.bytesSent||0)/r.statsInterval,c.bitrate=Math.round(8e3*r.sentKBitrate),c.bandwidth=Math.round(c.bitrate/1024),r.encoderOutputFrameRate=1e3*(n.framesEncoded-d.framesEncoded)/r.statsInterval,c.frame_rate_encoded=Math.round(r.encoderOutputFrameRate),r.sentFrameRate=1e3*(n.framesSent-d.framesSent)/r.statsInterval,c.frame_rate_sent=Math.round(r.sentFrameRate),r.videoLossRate=(n.packetsLost-d.packetsLost)/(n.packetsSent-d.packetsSent),r.videoLossRate=Number.isNaN(r.videoLossRate)?0:r.videoLossRate,c.fraction_lost=r.videoLossRate,t.video=n,aP.rtcMediaStatistics(c,{}),[2,r]):(t.video=n,[2,r])):[2,r]}}))}))},e.prototype.getDataChannelRTT=function(e){var t,r=this,n=iO();null===(t=this._client.sendUserMessage(e,"__web__rtc__rtt__"))||void 0===t||t.then((function(t){if("timeout"!==t){var i=Date.now()-n;i>0&&i<2e3&&(r.dataChannelRTT[e]=i)}else clearTimeout(r._rttTimer[e])})).catch((function(){clearTimeout(r._rttTimer[e])})),clearTimeout(this._rttTimer[e]),this._rttTimer[e]=setTimeout((function(){r.getDataChannelRTT(e)}),2e3)},e.prototype.destroy=function(){var e=this;Object.keys(this._localStreamStasEvtIntervals).forEach((function(t){clearInterval(e._localStreamStasEvtIntervals[t])})),Object.keys(this._remoteStreamStasEvtIntervals).forEach((function(t){clearInterval(e._remoteStreamStasEvtIntervals[t])})),Object.keys(this._rttTimer).forEach((function(t){clearTimeout(e._rttTimer[t])})),this._rttTimer={},this.dataChannelRTT={},this._videoInWaiting={}},e}(),_M=new PO("MediaServerClient",2),vM=5e3;!function(e){e.DISCONNECTED="disconnected",e.DISCONNECTING="disconnecting",e.CONNECTED="connected",e.CONNECTING="connecting"}(hM||(hM={}));var mM=function(e,t){_M.print(e,"userId: %o, subAudio: %o, subVideo: %o, paused: %o, audioMid: %o, videoMid: %o, workaround_1_: %o, sequenceId: %o",t.userId,t.subAudio,t.subVideo,t.paused,t.audioMid,t.videoMid,t._workaround_1_,t.sequenceId)},gM=function(e){function t(){var t=e.call(this)||this;return t._ontrackCallbackMap=new Map,t._pubSubLock=new dM("pubSubLock"),t._joinLeaveLock=new dM("joinLeaveLock"),t._state=hM.DISCONNECTED,t._roomAttributes={multiChatMode:!1,bigRoomMode:!1},t}return r(t,e),t.prototype._addHandlerEvents=function(){var e,t=this;null===(e=this._handler)||void 0===e||e.once("disconnect",(function(){_M.print("emit ABNORMAL_DISCONNECTION ice"),t.safeEmit(tP.ABNORMAL_DISCONNECTION)}))},t.prototype._addSignalEventHandler=function(){var e,t=this;[eP.ON_ADD_STREAM,eP.ON_REMOVE_STREAM,eP.USER_CONNECTION,eP.USER_DISCONNECTION,eP.ON_UPDATE_STREAM_ATTRIBUTES,eP.ON_UPDATE_ROOM_ATTRIBUTES,eP.ON_PUSH_TRACK,eP.ON_REMOVE_TRACK,eP.NODE_CHANGE,eP.ON_CUSTOM_MESSAGE,eP.USER_MESSAGE_RECEIVED,eP.USER_BINARY_MESSAGE_RECEIVED,eP.POST_PROCESSING_MESSAGE].forEach((function(e){var r;null===(r=t._dataChannelSignal)||void 0===r||r.on(e,(function(r){t.safeEmit(e,r)}))})),null===(e=this._dataChannelSignal)||void 0===e||e.once("close",(function(){_M.print("emit ABNORMAL_DISCONNECTION datachannel"),t.safeEmit(tP.ABNORMAL_DISCONNECTION)}))},t.prototype._removeSignalEventHandler=function(){var e,t;null===(e=this._dataChannelSignal)||void 0===e||e.removeAllListeners(),null===(t=this._handler)||void 0===t||t.removeAllListeners()},Object.defineProperty(t.prototype,"connectionState",{get:function(){return this._state},set:function(e){this._state!==e&&(this.safeEmit(tP.ON_CONNECTION_STATE_CHANGE,{prev:this._state,next:e}),this._state=e)},enumerable:!1,configurable:!0}),t.prototype.join=function(e,t,r,n){var i,o;return void 0===t&&(t={}),void 0===r&&(r=!1),S(this,void 0,void 0,(function(){var a,s,c,u,d,l,f,h,p=this;return b(this,(function(_){switch(_.label){case 0:return _M.print("join()","info: %o, params: %o, reconnect: %o, controlMessage: %o",e,t,r,n),this._appId=e.appId,this._token=e.token,this._roomId=e.roomId,this._clientId=e.userInfo.userId,this._businessId=e.userInfo.businessId,this._userInfo=e.userInfo,this._sessionId=vC(),nP.setStats({rtc_session_id:this._sessionId}),this.connectionState=hM.CONNECTING,this._handler&&(this._removeSignalEventHandler(),this._handler.destroy()),t.node?(a=t.node,uP("es.join.nodeChange",t),[3,3]):[3,1];case 1:return Promise.resolve().then((function(){return p.emit("onGetIceConfigHook")})),this._iceConfigRequestManager=new AP,[4,null===(i=this._iceConfigRequestManager)||void 0===i?void 0:i.getAccessNode(this._appId,this._roomId,this._clientId,TP.getDeviceId(),null==t?void 0:t.reason,this._prevICENode)];case 2:if(!(a=_.sent()))throw uP("es.join.getNodeFailed",""),new iI(tI.ICE_SERVER_WRONG,"get ICE config failed");uP("es.join.getNodeSuccess",a),_.label=3;case 3:this._prevICENode=a,this._handler=new sM,this._addHandlerEvents(),this._statsReport=new pM(this,this._handler),Promise.resolve().then((function(){return p.emit("onEstablishConnectionHook")})),_.label=4;case 4:return _.trys.push([4,6,,7]),[4,this._handler.connect(a)];case 5:return s=_.sent(),_M.print("join","establish peerConnection success"),[3,7];case 6:throw c=_.sent(),this.connectionState=hM.DISCONNECTED,new iI(tI.ESTABLISH_DATACHANNEL_FAILED,"establish dataChannel failed",c);case 7:return this._dataChannelSignal=new _P({appId:this._appId,roomId:this._roomId,clientId:this._clientId,dataChannel:s}),this._addSignalEventHandler(),this._dataChannelSignal.sendPingMessage(),[4,null===(o=this._handler)||void 0===o?void 0:o.getDefaultSdp()];case 8:u=_.sent(),d={Authorization:aO.token2auth(this._appId,this._roomId,this._clientId,this._token),sessionId:this._sessionId,timestamp:Date.now(),controlMessage:n,userAttributes:{extra_info:this._userInfo.extraInfo,role:this._userInfo.role},params:{deviceType:"web",userAgent:window.navigator.userAgent,sdkVersion:vw.VERSION,deviceId:TP.getDeviceId(),appId:this._appId,roomId:this._roomId,userId:this._clientId,businessId:this._businessId},options:{enableUnBundleMode:!0},sdpInfo:u},Promise.resolve().then((function(){return p.emit("onSendingJoinMessageHook")})),_.label=9;case 9:return _.trys.push([9,11,,12]),l=r?"reconnected":"joinRoom",[4,this._dataChannelSignal.sendSignaling(l,d)];case 10:return f=_.sent(),_M.print("join","send join message success"),this._authorization=d.Authorization,this.connectionState=hM.CONNECTED,[2,f];case 11:if(h=_.sent(),this.connectionState=hM.DISCONNECTED,705===(null==h?void 0:h.code))throw new iI(tI.INVALID_TOKEN,(null==h?void 0:h.message)||"Invalid token");if(200!==(null==h?void 0:h.code))throw new iI(tI.JOIN_ROOM_FAILED,(null==h?void 0:h.message)||"Join room failed");return[3,12];case 12:return[2]}}))}))},t.prototype.publish=function(e){var t,r,n,i,o,a,s,c;return S(this,void 0,void 0,(function(){var u,d,l,f,h,p,_,v,m,g,E;return b(this,(function(S){switch(S.label){case 0:_M.print("publish()","localStream: %o",e),u=e.videoTrack,d=e.audioTrack,l=iO(),f="",h="",p="",S.label=1;case 1:return S.trys.push([1,5,,8]),[4,null===(t=this._handler)||void 0===t?void 0:t.publish(e)];case 2:if(!(_=S.sent()))throw new iI(tI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");return f=_.audioMid,h=_.videoMid,p=_.sdp,e.pubAttributes={localaudio:!!d,localvideo:!!u,videostream:!!(null===(r=null==u?void 0:u.getTrack())||void 0===r?void 0:r.enabled),audiostream:!!(null===(n=null==d?void 0:d.getTrack())||void 0===n?void 0:n.enabled)},v={attributes:y({videoDescriptions:_.videoDescriptions},e.pubAttributes),audio:!0,video:!0,screen:e.isScreen,audioMid:f,videoMid:h,sdpInfo:{msid:e.stream.id,type:_.type,sdp:_.partialSdp,semantics:_.semantics}},[4,null===(i=this._dataChannelSignal)||void 0===i?void 0:i.sendSignaling("publish",v)];case 3:if(200!==(null==(m=S.sent())?void 0:m.code))throw new iI(tI.PUBLISH_FAILED,(null==m?void 0:m.message)||"publish failed");return g=null===(o=null==m?void 0:m.relayMessage)||void 0===o?void 0:o.sdp,[4,null===(a=this._handler)||void 0===a?void 0:a.setAnswerSdp(_.sdp,g,void 0,e,dD.UP)];case 4:return S.sent(),e.streamId=m.streamId,e.videoMid=h,e.audioMid=f,aP.rtcPublishStat(hD.SUCCESS,pD.W_0,l,_D.UNKNOWN),null===(s=this._statsReport)||void 0===s||s.setLocalStreamStatsEvtInterval(e),[2];case 5:return(E=S.sent())instanceof Error&&aP.rtcPublishStat(hD.FAIL,pD.W_0,l,E.message),f&&h?[4,null===(c=this._handler)||void 0===c?void 0:c.rollback(p,[f,h])]:[3,7];case 6:S.sent(),S.label=7;case 7:throw E;case 8:return[2]}}))}))},t.prototype.updatePubTrack=function(e){var t,r,n,i,o,a;return S(this,void 0,void 0,(function(){var s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,A;return b(this,(function(b){switch(b.label){case 0:_M.print("updatePubTrack()","localStream: %o",e),s=e.videoTrack,c=e.audioTrack,null===(t=e.videoTransceiver)||void 0===t||t.sender.replaceTrack((null==s?void 0:s.getTrack())||null),c?(u=c.mixType,d=c.mixedAudioTrack,l=null==c?void 0:c.getTrack(),d&&u!==C.PLAYOUT&&!0===l.enabled&&(l=d),null===(r=e.audioTransceiver)||void 0===r||r.sender.replaceTrack(l)):null===(n=e.audioTransceiver)||void 0===n||n.sender.replaceTrack(null),f={localaudio:!!c,localvideo:!!s,videostream:!!(null===(i=null==s?void 0:s.getTrack())||void 0===i?void 0:i.enabled),audiostream:!!(null===(o=null==c?void 0:c.getTrack())||void 0===o?void 0:o.enabled)},h={};try{for(p=T(Object.entries(f)),_=p.next();!_.done;_=p.next())v=I(_.value,2),m=v[0],(g=v[1])!==Reflect.get(e.pubAttributes,m)&&Reflect.set(h,m,g)}catch(e){S={error:e}}finally{try{_&&!_.done&&(A=p.return)&&A.call(p)}finally{if(S)throw S.error}}return Object.keys(h).length?(e.pubAttributes=f,y={roomId:this._roomId,streamId:e.streamId,attributes:h},[4,null===(a=this._dataChannelSignal)||void 0===a?void 0:a.sendSignaling("updateStreamAttributes",y)]):[2];case 1:if(200!==(null==(E=b.sent())?void 0:E.code))throw new iI(tI.UPDATE_TRACK_FAILED,(null==E?void 0:E.message)||"update track failed");return[2]}}))}))},t.prototype.unpublish=function(e){var t,r,n;return S(this,void 0,void 0,(function(){var i,o;return b(this,(function(a){switch(a.label){case 0:return _M.print("unpublish()","localStream: %o",e),i={roomId:this._roomId,initStreamId:e.initStreamId,streamId:e.streamId},[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("unpublish",i)];case 1:if(200!==(null==(o=a.sent())?void 0:o.code))throw new iI(tI.UNPUBLISH_FAILED,(null==o?void 0:o.message)||"unpublish failed");return[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])];case 2:return a.sent(),null===(n=this._statsReport)||void 0===n||n.unpublish(e),[2]}}))}))},t.prototype.subscribe=function(e,t,r){var n,i,o,a,s,c,u,d,l;return S(this,void 0,void 0,(function(){var f,h,_,v,m,g,y,E,S,T,I,A,R,C,O,w,N,k,D,P;return b(this,(function(b){switch(b.label){case 0:if(e.hasSubscribed)return[2,this._updateSubTrack(e,t,r)];_M.print("subscribe()","mediaType: %o, config: %o",t,r),mM("subscribe()",e),f=!1,h=!1,t===p.VIDEO_ONLY?f=!0:t===p.AUDIO_ONLY?h=!0:t===p.AUDIO_AND_VIDEO?(f=!0,h=!0):t===p.NONE&&(f=!1,h=!1),_=iO(),v=e.audioMid,m=e.videoMid,y=!1,b.label=1;case 1:return b.trys.push([1,12,,15]),v&&m?(y=!0,[4,null===(n=this._handler)||void 0===n?void 0:n.subscribe(e,{audioMid:v,videoMid:m})]):[3,3];case 2:return g=b.sent(),[3,5];case 3:return[4,null===(i=this._handler)||void 0===i?void 0:i.subscribe(e)];case 4:if(!(g=b.sent()))throw new iI(tI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");v=g.audioMid,m=g.videoMid,b.label=5;case 5:return E={audio:!this._multiChatMode(),video:!0,data:!0,screen:e.isScreen,browser:"chrome-stable",videoMid:m,audioMid:v,sdpInfo:{sdp:null==g?void 0:g.partialSdp,semantics:null==g?void 0:g.semantics,type:null==g?void 0:g.type},streamUserId:e.userId,streamId:e.streamId,config:{enableMediaType:{audio:!!this._multiChatMode()||h,video:f},qualityLayer:{spatialLayer:r.videoIndex,temporalLayer:r.videoIndex}}},[4,null===(o=this._dataChannelSignal)||void 0===o?void 0:o.sendSignaling("subscribe",E)];case 6:if(200!==(null==(S=b.sent())?void 0:S.code))throw new iI(tI.SUBSCRIBE_FAILED,(null==S?void 0:S.message)||"subscribe failed");return T=[],I=!this._multiChatMode(),!(v&&m)&&T.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new iI(tI.TIME_OUT,"wait video timeout for userId: ".concat(e.userId)))}),vM);e.on("ontrack",(function r(i){"video"===i.mediaType&&(_M.print("remoteStream ".concat(e.userId," received video track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),I&&T.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new iI(tI.TIME_OUT,"wait audio timeout for userId: ".concat(e.userId)))}),vM);e.on("ontrack",(function r(i){"audio"===i.mediaType&&(_M.print("remoteStream ".concat(e.userId," received audio track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),A=function(t){e.ontrack(t)},null===(a=this._handler)||void 0===a||a.on("ontrack",A),this._ontrackCallbackMap.set(e,A),R=null==S?void 0:S.relayMessage,C=R.audioMid,O=R.videoMid,w=R.sequenceId,N=R.sdp,y&&v!==C?(_M.print("subscribe","mid mot match",v,C),[4,null===(s=this._handler)||void 0===s?void 0:s.closeMLine([v,m])]):[3,9];case 7:return b.sent(),[4,null===(c=this._handler)||void 0===c?void 0:c.subscribe(e)];case 8:if(!(g=b.sent()))throw new iI(tI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");v=g.audioMid,m=g.videoMid,b.label=9;case 9:return(P={})[v]=C,P[m]=O,k=P,e.videoMid=O,e.audioMid=C,e.sequenceId=w,e.subConfig=r,e._workaround_1_=!1,e.paused=!1,e.subMediaType=t,e.hasSubscribed=!0,[4,null===(u=this._handler)||void 0===u?void 0:u.setAnswerSdp(null==g?void 0:g.sdp,N,k,e,dD.DOWN)];case 10:return b.sent(),[4,Promise.all(T)];case 11:return b.sent(),this._multiChatMode()||(e.subAudio=h),e.subVideo=f,aP.rtcSubscribeStat(vD.SUCCESS,_,mD.UNKNOWN,e.userId),null===(d=this._statsReport)||void 0===d||d.setRemoteStreamStatsEvtInterval(e),[2];case 12:return(D=b.sent())instanceof Error&&aP.rtcSubscribeStat(vD.FAIL,_,D.message,e.userId),v&&m?[4,null===(l=this._handler)||void 0===l?void 0:l.rollback(null==g?void 0:g.sdp,[v,m])]:[3,14];case 13:b.sent(),b.label=14;case 14:throw D;case 15:return[2]}}))}))},t.prototype.controlMessage=function(e){var t;return S(this,void 0,void 0,(function(){return b(this,(function(r){switch(r.label){case 0:return _M.print("controlMessage()","params: %o",e),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("controlMessage",y(y({},e),{roomId:this._roomId}))];case 1:return r.sent(),[2]}}))}))},t.prototype.updateUserAttributes=function(e){var t;return S(this,void 0,void 0,(function(){return b(this,(function(r){switch(r.label){case 0:return _M.print("updateUserAttributes()","attributes: %o",e),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("updateUserAttributes",{roomId:this._roomId,sessionId:this._sessionId,attributes:e})];case 1:return r.sent(),[2]}}))}))},t.prototype.updateSubTrack=function(e,t,r){return S(this,void 0,void 0,(function(){return b(this,(function(n){return[2,this._updateSubTrack(e,t,r)]}))}))},t.prototype._updateSubTrack=function(e,t,r){var n;return S(this,void 0,void 0,(function(){var i,o,a,s;return b(this,(function(c){switch(c.label){case 0:return _M.print("updateSubTrack()","mediaType: %o, config: %o",t,r),mM("updateSubTrack()",e),i=!1,o=!1,t===p.VIDEO_ONLY?(i=!0,o=!1):t===p.AUDIO_ONLY?(o=!0,i=!1):t===p.AUDIO_AND_VIDEO?(i=!0,o=!0):t===p.NONE&&(i=!1,o=!1),a={roomId:this._roomId,streamList:[e.streamId],config:{enableMediaType:{video:i,audio:!!this._multiChatMode()||o},qualityLayer:{spatialLayer:r.videoIndex,temporalLayer:r.videoIndex}}},[4,null===(n=this._dataChannelSignal)||void 0===n?void 0:n.sendSignaling("updateSubscribe",a)];case 1:if(200!==(null==(s=c.sent())?void 0:s.code))throw new iI(tI.UPDATE_TRACK_FAILED,(null==s?void 0:s.message)||"update track failed");return e.paused=!i,this._multiChatMode()||(e.subAudio=o),e.subVideo=i,e.subMediaType=t,e.subConfig=r,[2,e]}}))}))},t.prototype.subscribe4pushTrack=function(e,t){var r,n,i,o,a;return S(this,void 0,void 0,(function(){var s,c,u,d,l,f,h,p,_,v,m,g,y;return b(this,(function(E){switch(E.label){case 0:if(_M.print("subscribe4pushTrack()","streamInfo: %o",t),mM("subscribe4pushTrack()",e),s=null==t?void 0:t.message,c=s.audioMid,u=s.videoMid,d=s.sequenceId,l=s.sdp,e.subAudio=!0,d<e.sequenceId)return _M.print("subscribe4pushTrack","sequenceId return",d,e.sequenceId),[2];f=e.audioMid,h=e.videoMid,E.label=1;case 1:return E.trys.push([1,8,,11]),f&&h?[4,null===(r=this._handler)||void 0===r?void 0:r.subscribe(e,{audioMid:f,videoMid:h})]:[3,3];case 2:return p=E.sent(),[3,5];case 3:return[4,null===(n=this._handler)||void 0===n?void 0:n.subscribe(e)];case 4:if(!(p=E.sent()))throw new iI(tI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");f=p.audioMid,h=p.videoMid,E.label=5;case 5:return(y={})[f]=c,y[h]=u,_=y,_M.print("onpushtrack midmap",e.userId,_),e.audioMid=c,e.videoMid=u,e.sequenceId=d,v=[],e.audioTrack||v.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new iI(tI.TIME_OUT,"wait audio timeout for userId: ".concat(e.userId)))}),vM);e.on("ontrack",(function r(i){"audio"===i.mediaType&&(_M.print("remoteStream ".concat(e.userId," received audio track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),m=function(t){e.ontrack(t)},null===(i=this._handler)||void 0===i||i.on("ontrack",m),this._ontrackCallbackMap.set(e,m),[4,null===(o=this._handler)||void 0===o?void 0:o.setAnswerSdp(null==p?void 0:p.sdp,l,_,e,dD.DOWN)];case 6:return E.sent(),[4,Promise.all(v)];case 7:return E.sent(),[2];case 8:return g=E.sent(),p?[4,null===(a=this._handler)||void 0===a?void 0:a.rollback(null==p?void 0:p.sdp,[f,h])]:[3,10];case 9:E.sent(),E.label=10;case 10:throw g;case 11:return[2]}}))}))},t.prototype.unsubscribe4removeTrack=function(e,t){var r;return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return mM("unsubscribe4removeTrack()",e),_M.print("unsubscribe4removeTrack()","sequenceId: ",t.sequenceId),t.sequenceId<e.sequenceId?(_M.print("unsubscribe4removeTrack()","sequenceId return"),[2]):(e.subAudio=!1,e.subVideo||e.paused?(e.sequenceId=t.sequenceId,[2]):[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])]);case 1:return n.sent(),_M.print("clean unsubscribe4removeTrack"),e.clean(),e.resetHasSubscribed(),[2]}}))}))},t.prototype.unsubscribe=function(e){var t,r,n;return S(this,void 0,void 0,(function(){var i;return b(this,(function(o){switch(o.label){case 0:mM("unsubscribe()",e),i={roomId:this._roomId,streamId:e.streamId,userId:e.userId},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("unsubscribe",i)];case 2:case 3:return o.sent(),[3,4];case 4:return e.hasSubscribed=!1,e.subVideo=!1,e.paused=!1,e._workaround_1_||(e.subAudio=!1),e.subAudio?[3,6]:[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])];case 5:o.sent(),_M.print("unsubscribe","clean unsub ".concat(e.userId)),e.clean(),e.resetHasSubscribed(),this.removeOnTrackListener(e),null===(n=this._statsReport)||void 0===n||n.unsubscribe(e),o.label=6;case 6:return[2]}}))}))},t.prototype.removeOnTrackListener=function(e){var t,r=this._ontrackCallbackMap.get(e);r&&(null===(t=this._handler)||void 0===t||t.off("ontrack",r),this._ontrackCallbackMap.delete(e))},t.prototype.handleRemoveStream=function(e,t){return S(this,void 0,void 0,(function(){return b(this,(function(r){return mM("handleRemoveStream()",e),e.subVideo=!1,t.message&&t.message!==QD.videoMuted?e._workaround_1_=!1:e._workaround_1_=!0,this.unsubscribe(e),[2]}))}))},t.prototype.leave=function(){var e;return S(this,void 0,void 0,(function(){var t,r;return b(this,(function(n){switch(n.label){case 0:return _M.print("leave()"),(this.connectionState=hM.CONNECTED)?(this.connectionState=hM.DISCONNECTING,t={Authorization:this._authorization,roomId:this._roomId,sessionId:this._sessionId},[4,this._joinLeaveLock.lock()]):[3,7];case 1:r=n.sent(),n.label=2;case 2:return n.trys.push([2,4,5,6]),[4,null===(e=this._dataChannelSignal)||void 0===e?void 0:e.sendSignaling("leaveRoom",t)];case 3:case 4:return n.sent(),[3,6];case 5:return r(),[7];case 6:return[3,8];case 7:return[2,Promise.resolve()];case 8:return[2]}}))}))},t.prototype.destroy=function(){var e,t,r,n;_M.print("destroy()"),this._token=void 0,this._appId=void 0,this._roomId=void 0,this._clientId=void 0,this._authorization=void 0,this._sessionId=void 0,null===(e=this._handler)||void 0===e||e.destroy(),null===(t=this._dataChannelSignal)||void 0===t||t.destroy(),null===(r=this._iceConfigRequestManager)||void 0===r||r.abort(),this._handler=void 0,this._dataChannelSignal=void 0,this._iceConfigRequestManager=void 0,this._removeSignalEventHandler(),null===(n=this._statsReport)||void 0===n||n.destroy(),this.connectionState=hM.DISCONNECTED,this.emit("INTERRUPT")},t.prototype.sendUserMessage=function(e,t){var r;return null===(r=this._dataChannelSignal)||void 0===r?void 0:r.sendP2PMessage(e,t)},t.prototype.sendRoomMessage=function(e){var t;return null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("customMessage",e)},t.prototype._multiChatMode=function(){var e;return null===(e=this._roomAttributes)||void 0===e?void 0:e.multiChatMode},Object.defineProperty(t.prototype,"handler",{get:function(){return this._handler},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomAttributes",{set:function(e){this._roomAttributes=e},enumerable:!1,configurable:!0}),E([SM],t.prototype,"join",null),E([EM,yM],t.prototype,"publish",null),E([EM,yM],t.prototype,"updatePubTrack",null),E([EM,yM],t.prototype,"unpublish",null),E([EM,yM],t.prototype,"subscribe",null),E([yM],t.prototype,"controlMessage",null),E([yM],t.prototype,"updateUserAttributes",null),E([EM,yM],t.prototype,"updateSubTrack",null),E([EM,yM],t.prototype,"subscribe4pushTrack",null),E([EM,yM],t.prototype,"unsubscribe4removeTrack",null),E([EM,yM],t.prototype,"unsubscribe",null),E([EM,yM],t.prototype,"handleRemoveStream",null),t}(UO);function yM(e,t,r){var n=r.value;return r.value=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return S(this,void 0,void 0,(function(){return b(this,(function(r){switch(r.label){case 0:return this._handler&&this._state===hM.CONNECTED?[4,n.apply(this,e)]:[3,2];case 1:return r.sent(),[3,3];case 2:throw new iI(tI.NOT_CONNECTED_YET,"error in ".concat(t,": try again after joined"));case 3:return[2]}}))}))},r}function EM(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return[4,this._pubSubLock.lock()];case 1:t=r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,n.apply(this,e)];case 3:return[2,r.sent()];case 4:return t(),[7];case 5:return[2]}}))}))},r}function SM(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S(this,void 0,void 0,(function(){var t,r=this;return b(this,(function(i){return t=!1,[2,new Promise((function(i,o){return S(r,void 0,void 0,(function(){var r,a;return b(this,(function(s){switch(s.label){case 0:this.on("INTERRUPT",(function(){t=!0,o(new iI(tI.OPERATION_CANCEL,"operation not finish when leave"))})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n.apply(this,e)];case 2:return r=s.sent(),i(r),[3,4];case 3:return a=s.sent(),t||o(a),[3,4];case 4:return[2]}}))}))}))]}))}))},r}var bM=ee,TM=Fu,IM=Ps.exports.getWeakData,AM=ur,RM=ge,CM=_u,OM=fu,wM=ht,NM=on.set,kM=on.getterFor,DM=Xl.find,PM=Xl.findIndex,MM=bM([].splice),UM=0,LM=function(e){return e.frozen||(e.frozen=new xM)},xM=function(){this.entries=[]},BM=function(e,t){return DM(e.entries,(function(e){return e[0]===t}))};xM.prototype={get:function(e){var t=BM(this,e);if(t)return t[1]},has:function(e){return!!BM(this,e)},set:function(e,t){var r=BM(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=PM(this.entries,(function(t){return t[0]===e}));return~t&&MM(this.entries,t,1),!!~t}};var VM,jM={getConstructor:function(e,t,r,n){var i=e((function(e,i){CM(e,o),NM(e,{type:t,id:UM++,frozen:void 0}),null!=i&&OM(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=kM(t),s=function(e,t,r){var n=a(e),i=IM(AM(t),!0);return!0===i?LM(n).set(t,r):i[n.id]=r,e};return TM(o,{delete:function(e){var t=a(this);if(!RM(e))return!1;var r=IM(e);return!0===r?LM(t).delete(e):r&&wM(r,t.id)&&delete r[t.id]},has:function(e){var t=a(this);if(!RM(e))return!1;var r=IM(e);return!0===r?LM(t).has(e):r&&wM(r,t.id)}}),TM(o,r?{get:function(e){var t=a(this);if(RM(e)){var r=IM(e);return!0===r?LM(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}},FM=M,GM=ee,zM=Fu,HM=Ps.exports,WM=Vu,YM=jM,KM=ge,XM=rc,qM=on.enforce,JM=Ur,ZM=!FM.ActiveXObject&&"ActiveXObject"in FM,$M=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},QM=WM("WeakMap",$M,YM);if(JM&&ZM){VM=YM.getConstructor($M,"WeakMap",!0),HM.enable();var eU=QM.prototype,tU=GM(eU.delete),rU=GM(eU.has),nU=GM(eU.get),iU=GM(eU.set);zM(eU,{delete:function(e){if(KM(e)&&!XM(e)){var t=qM(this);return t.frozen||(t.frozen=new VM),tU(this,e)||t.frozen.delete(e)}return tU(this,e)},has:function(e){if(KM(e)&&!XM(e)){var t=qM(this);return t.frozen||(t.frozen=new VM),rU(this,e)||t.frozen.has(e)}return rU(this,e)},get:function(e){if(KM(e)&&!XM(e)){var t=qM(this);return t.frozen||(t.frozen=new VM),rU(this,e)?nU(this,e):t.frozen.get(e)}return nU(this,e)},set:function(e,t){if(KM(e)&&!XM(e)){var r=qM(this);r.frozen||(r.frozen=new VM),rU(this,e)?iU(this,e,t):r.frozen.set(e,t)}else iU(this,e,t);return this}})}var oU=new(function(e){function t(){var t=e.call(this)||this;return t._hasVideoPermission=!1,t._hasAudioPermission=!1,t.inited=!1,t.deviceMap=new Map,t._handleDeviceChange=t._handleDeviceChange.bind(t),t.refreshDevices(),t}return r(t,e),t.prototype.refreshDevices=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){switch(t.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:return t.sent().filter((function(e){return""!==e.deviceId})).forEach((function(t){e.deviceMap.set(t.deviceId,{deviceName:t.label,deviceInfo:t,deviceId:t.deviceId,deviceType:t.kind,deviceState:"active"})})),this.inited||this.initListener(),this.inited=!0,[2]}}))}))},t.prototype.initListener=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){return navigator.mediaDevices.addEventListener("devicechange",this._handleDeviceChange),[2]}))}))},t.prototype._handleDeviceChange=function(){return S(this,void 0,void 0,(function(){var e,t,r=this;return b(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:return e=n.sent(),t=Array.from(this.deviceMap.values()),e.forEach((function(e){var t=r.deviceMap.get(e.deviceId);r.deviceMap.set(e.deviceId,{deviceName:e.label,deviceType:e.kind,deviceId:e.deviceId,deviceInfo:e,deviceState:"active"}),t&&"inactive"!==t.deviceState||r.emit("onMediaDeviceStateChanged",{deviceName:e.label,deviceType:e.kind,deviceId:e.deviceId,deviceInfo:e,deviceState:"active"})})),t.forEach((function(t){e.find((function(e){return e.deviceId===t.deviceId}))||(t.deviceState="inactive",r.deviceMap.delete(t.deviceId),r.emit(N.onMediaDeviceStateChanged,t))})),[2]}}))}))},t.prototype.getVideoPermission=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){switch(t.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new iI(tI.NOT_SUPPORTED,"GetUserMedia not supported");if(this.hasVideoPermission)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(t){t&&(t.getTracks().forEach((function(e){return e.stop()})),e.hasVideoPermission=!0,e.inited||e.refreshDevices())}))];case 2:case 3:return t.sent(),[3,4];case 4:return[2,this.hasVideoPermission]}}))}))},t.prototype.getAudioPermission=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){switch(t.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new iI(tI.NOT_SUPPORTED,"GetUserMedia not supported");if(this.hasAudioPermission)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){t&&(t.getTracks().forEach((function(e){return e.stop()})),e.hasAudioPermission=!0,e.inited||e.refreshDevices())}))];case 2:case 3:return t.sent(),[3,4];case 4:return[2,this.hasAudioPermission]}}))}))},t.prototype.getDevices=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.getAudioPermission()];case 1:case 2:return e.sent(),[3,3];case 3:return e.trys.push([3,5,,6]),[4,this.getVideoPermission()];case 4:case 5:return e.sent(),[3,6];case 6:return[4,this.refreshDevices()];case 7:return e.sent(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState}))]}}))}))},t.prototype.getMicrophones=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return[4,this.refreshDevices()];case 1:return e.sent(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"audioinput"===e.deviceType}))]}}))}))},t.prototype.getCameras=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){return this.refreshDevices(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"videoinput"===e.deviceType}))]}))}))},t.prototype.getAudioPlayback=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){return this.refreshDevices(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"audiooutput"===e.deviceType}))]}))}))},t.prototype.getDeviceById=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this.getDevices()];case 1:return[2,t.sent().find((function(t){return t.deviceId===e}))]}}))}))},Object.defineProperty(t.prototype,"hasAudioPermission",{get:function(){return this._hasAudioPermission},set:function(e){if(!e)throw new iI(tI.NO_PERMISSION,"Cannot revoke audio permission");this.refreshDevices(),this._hasAudioPermission=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasVideoPermission",{get:function(){return this._hasVideoPermission},set:function(e){if(!e)throw new iI(tI.NO_PERMISSION,"Cannot revoke Video permission");this.inited||this.refreshDevices(),this._hasVideoPermission=!0},enumerable:!1,configurable:!0}),t}(UO)),aU=window.AudioContext||window.webkitAudioContext,sU=function(){function e(){}return e.prototype.getAudioContextInstance=function(){return this._audioContextInstance||(this._audioContextInstance=new aU),this._audioContextInstance},e}(),cU=function(){function e(e){var t=uU.getAudioContextInstance();this._track=e;var r=new MediaStream;r.addTrack(e);var n=t.createMediaStreamSource(r),i=t.createAnalyser();n.connect(i),this._analyserNode=i}return e.prototype.getAudioLevel=function(){var e=new Uint8Array(2048);this._analyserNode.getByteTimeDomainData(e);var t=0;return e.forEach((function(e){return t=Math.max(t,Math.abs(e-128))})),t/128*255},e}(),uU=new sU,dU=new PO("VERTC",0),lU=new WeakMap,fU=function(e){return lU.get(e)},hU=function(e){function t(t,r){var n=e.call(this)||this;return n._trackId=t,n.mediaType=r,n}return r(t,e),t.prototype.getId=function(){return this._trackId},t}(UO),pU=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i._mediaTrack=t,i._initListeners(),i}return r(t,e),t.prototype.getTrack=function(){return this._mediaTrack},t.prototype.close=function(){var e;return null===(e=this._mediaTrack)||void 0===e?void 0:e.stop()},t.prototype._initListeners=function(){var e=this;this._mediaTrack instanceof MediaStreamTrack&&this._mediaTrack.addEventListener("ended",(function(){aP.rtcError("track-ended mediaType: ".concat(e._mediaTrack.kind),-1001),e.emit("track-ended",e)}))},t}(hU),_U=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i._mediaTrack=t,i}return r(t,e),t.prototype.getTrack=function(){return this._mediaTrack},t}(hU),vU=function(e){function t(t,r){return e.call(this,t,r,"video")||this}return r(t,e),t.prototype.updateVideoCaptureConfig=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return this.videoCaptureConfig?(dU.print("updateVideoEncoderConfig","update localVideoTrack: ",this.videoCaptureConfig),[4,null===(e=this.getTrack())||void 0===e?void 0:e.applyConstraints(this.videoCaptureConfig)]):[2];case 1:return t.sent(),[2]}}))}))},t}(pU),mU=function(e){function t(t,r){var n=e.call(this,t,r,"audio")||this;return n.mixType=C.PLAYOUT_AND_PUBLISH,n}return r(t,e),t.prototype.getAudioLevel=function(){return this._audioLevelFetcher||(this._audioLevelFetcher=new cU(this.getTrack())),this._audioLevelFetcher.getAudioLevel()},t.prototype.updateAudioCaptureConfig=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return this.audioCaptureConfig?(dU.print("updateAudioCaptureConfig","update localAudioTrack: ",this.audioCaptureConfig),[4,null===(e=this.getTrack())||void 0===e?void 0:e.applyConstraints(this.audioCaptureConfig)]):[2];case 1:return t.sent(),[2]}}))}))},t}(pU),gU=function(e){function t(t,r){return e.call(this,t,r,"video")||this}return r(t,e),t}(_U),yU=function(e){function t(t,r){return e.call(this,t,r,"audio")||this}return r(t,e),t.prototype.getAudioLevel=function(){return this._audioLevelFetcher||(this._audioLevelFetcher=new cU(this.getTrack())),this._audioLevelFetcher.getAudioLevel()},t}(_U),EU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(mU),SU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(vU),bU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(vU),TU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(mU),IU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(vU),AU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(mU);function RU(e){var t;return S(this,void 0,void 0,(function(){var r,n,i,o,a,s;return b(this,(function(c){switch(c.label){case 0:n=(null===(t=null==e?void 0:e.deviceId)||void 0===t?void 0:t.exact)||"default",c.label=1;case 1:return c.trys.push([1,3,,4]),dU.print("createCameraVideoTrack","constraints:",e),aP.rtcVideoCaptureEvent({event_type:kD.START,media_device_id:n}),i=iO(),[4,navigator.mediaDevices.getUserMedia({video:e})];case 2:return r=c.sent(),aP.rtcVideoCaptureEvent({event_type:kD.START_CAPTURE_RESULT,media_device_id:n,reason:PD.SUCCESS,elapse:iO()-i}),oU.hasVideoPermission=!0,[3,4];case 3:throw o=c.sent(),aP.rtcVideoCaptureEvent({event_type:kD.RUNNING_FAILED,media_device_id:n,error_code:o.code,reason:JSON.stringify(o)}),new iI(tI.GET_VIDEO_TRACK_FAILED,"throw error from getUserMedia",o);case 4:return a=r.getVideoTracks()[0],lU.set(a,r),(s=new SU(a,nO())).videoCaptureConfig=e,[2,s]}}))}))}function CU(e){var t;return S(this,void 0,void 0,(function(){var r,n,i,o,a;return b(this,(function(s){switch(s.label){case 0:dU.print("createCameraVideoTrack","constraints:",e),n=(null===(t=null==e?void 0:e.deviceId)||void 0===t?void 0:t.exact)||"default",s.label=1;case 1:return s.trys.push([1,3,,4]),aP.rtcVideoCaptureEvent({event_type:kD.START,media_device_id:n}),i=iO(),[4,navigator.mediaDevices.getUserMedia({audio:e})];case 2:return r=s.sent(),aP.rtcVideoCaptureEvent({event_type:kD.START_CAPTURE_RESULT,media_device_id:n,reason:PD.SUCCESS,elapse:iO()-i}),oU.hasAudioPermission=!0,[3,4];case 3:throw o=s.sent(),aP.rtcVideoCaptureEvent({event_type:kD.RUNNING_FAILED,media_device_id:n,error_code:o.code,reason:JSON.stringify(o)}),new iI(tI.GET_AUDIO_TRACK_FAILED,"throw error from getUserMedia",o);case 4:return a=r.getAudioTracks()[0],lU.set(a,r),[2,new EU(a,nO())]}}))}))}function OU(e){return void 0===e&&(e=!1),S(this,void 0,void 0,(function(){var t,r,n;return b(this,(function(i){switch(i.label){case 0:dU.print("createScreenStream","withAudio:",e),i.label=1;case 1:return i.trys.push([1,3,,4]),aP.rtcVideoCaptureEvent({event_type:kD.START,media_device_id:"screen"}),r=iO(),[4,navigator.mediaDevices.getDisplayMedia({video:!0,audio:e})];case 2:return t=i.sent(),aP.rtcVideoCaptureEvent({event_type:kD.START_CAPTURE_RESULT,media_device_id:"screen",reason:PD.SUCCESS,elapse:iO()-r}),[3,4];case 3:throw n=i.sent(),aP.rtcVideoCaptureEvent({event_type:kD.RUNNING_FAILED,media_device_id:"screen",error_code:n.code,reason:JSON.stringify(n)}),new iI(tI.GET_SCREEN_TRACK_FAILED,"throw error from getDisplayMedia",n);case 4:return[2,t]}}))}))}var wU,NU,kU=function(){function e(){}return e.getNalunits=function(t){if(t.length-t.position<4)return[];var r=t.position;return 1===t.getInt32(r)||0===t.getInt16(r)&&1===t.getInt8(r+2)?e.getAnnexbNals(t):e.getAvccNals(t)},e.getAnnexbNals=function(t){for(var r=[],n=e.getHeaderPositionAnnexB(t),i=n.pos,o=i;i<t.length-4;){var a=new Uint8Array(t.buffer.slice(i,i+n.headerLength));n.pos===t.position&&t.skip(n.headerLength),o=(n=e.getHeaderPositionAnnexB(t)).pos;var s={header:a,body:new Uint8Array(t.buffer.slice(i+a.byteLength,o)),type:-1};e.analyseNal(s),s.type<=9&&0!==s.type&&r.push(s),t.skip(o-t.position),i=o}return r},e.getAvccNals=function(t){for(var r=[];t.position<t.length-4;){var n=t.getInt32(t.position);if(!(t.length-t.position>=n))break;var i=new Uint8Array(t.buffer.slice(t.position,t.position+4));t.skip(4);var o=new Uint8Array(t.buffer.slice(t.position,t.position+n));t.skip(n);var a={header:i,body:o,type:-1};e.analyseNal(a),a.type<=9&&0!==a.type&&r.push(a)}return r},e.analyseNal=function(e){var t=31&e.body[0];switch(e.type=t,t){case 1:e.ndr=!0;break;case 5:e.idr=!0;break;case 6:e.sei=!0;break;case 7:e.sps=!0;break;case 8:e.pps=!0}},e.getHeaderPositionAnnexB=function(e){for(var t=e.position,r=0,n=e.length;3!==r&&4!==r&&t<n-4;)0===e.getInt16(t)?1===e.getInt16(t+2)?r=4:1===e.getInt8(t+2)?r=3:t++:t++;return t===n-4&&(0===e.getInt16(t)?1===e.getInt16(t+2)?r=4:t=n:(t++,0===e.getInt16(t)&&1===e.getInt8(t)?r=3:t=n)),{pos:t,headerLength:r}},e.getAvcc=function(e,t){var r=new Uint8Array(e.byteLength+t.byteLength+11);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;var n=6;return r.set(new Uint8Array([e.byteLength>>>8&255,255&e.byteLength]),n),n+=2,r.set(e,n),r[n+=e.byteLength]=1,n++,r.set(new Uint8Array([t.byteLength>>>8&255,255&t.byteLength]),n),n+=2,r.set(t,n),r},e}(),DU=function(){function e(e){this._position=0,this._dataview=new DataView(e)}return Object.defineProperty(e.prototype,"length",{get:function(){return this.buffer.byteLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._dataview.buffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!1,configurable:!0}),e.prototype.back=function(e){this.position-=e},e.prototype.getUint8=function(e){return this._dataview.getUint8(e)},e.prototype.getInt8=function(e){return this._dataview.getInt8(e)},e.prototype.getInt16=function(e){return this._dataview.getInt16(e)},e.prototype.getUint16=function(e){return this._dataview.getUint16(e)},e.prototype.getUint32=function(e){return this._dataview.getUint32(e)},e.prototype.getInt32=function(e){return this._dataview.getInt32(e)},e.prototype.skip=function(t){for(var r=Math.floor(t/4),n=t%4,i=0;i<r;i++)e.readByte(this,4);n>0&&e.readByte(this,n)},e.readByte=function(e,t,r){var n;switch(t){case 1:n=r?e.getInt8(e.position):e.getUint8(e.position);break;case 2:n=r?e.getInt16(e.position):e.getUint16(e.position);break;case 3:if(r)throw new Error("not supported for readByte 3");n=e.getUint8(e.position)<<16,n|=e.getUint8(e.position+1)<<8,n|=e.getUint8(e.position+2);break;case 4:n=r?e.getInt32(e.position):e.getUint32(e.position);break;case 8:if(r)throw new Error("not supported for readBody 8");n=e.getUint32(e.position)<<32,n|=e.getUint32(e.position+4);break;default:n=""}return e.position+=t,n},e.prototype.readUint8=function(){return e.readByte(this,1)},e.prototype.readUint16=function(){return e.readByte(this,2)},e.prototype.readUint24=function(){return e.readByte(this,3)},e.prototype.readUint32=function(){return e.readByte(this,4)},e.prototype.readUint64=function(){return e.readByte(this,8)},e.prototype.readInt8=function(){return e.readByte(this,1,!0)},e.prototype.readInt16=function(){return e.readByte(this,2,!0)},e.prototype.readInt32=function(){return e.readByte(this,4,!0)},e.prototype.writeUint32=function(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])},e}(),PU=new PO("Stream",0),MU=function(){function e(){this.isScreen=!1,this.seiList=[],this.stream=new MediaStream,this.pubAttributes={localaudio:!1,localvideo:!1,videostream:!1,audiostream:!1}}return Object.defineProperty(e.prototype,"hasPublished",{get:function(){return this.videoTransceiver&&this.audioTransceiver},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmptyStream",{get:function(){return!this.audioTrack&&!this.videoTrack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initStreamId",{get:function(){return this.stream.id},enumerable:!1,configurable:!0}),e.prototype.initVideoEncodedTransform=function(){var e=this;if(this.videoTransceiver&&this.videoTransceiver.sender){var t=this.videoTransceiver.sender;if(nM()){var r=t.createEncodedStreams(),n=r.readable,i=r.writable,o=new TransformStream({transform:function(t,r){var n=e.seiList[0];if(n){var i=new Uint8Array(n.content.byteLength+5);i.set([0,0,0,1,6]),i.set(n.content,5);var o=new Uint8Array(i.byteLength+t.data.byteLength);0===n.repeatCount&&e.seiList.splice(0,1),n.repeatCount--,o.set(new Uint8Array(t.data)),o.set(i,t.data.byteLength),t.data=o.buffer,r.enqueue(t)}else r.enqueue(t)}});n.pipeThrough(o).pipeTo(i)}}else PU.print("no sender found when trying to bind encodedTransform")},e.prototype.initAudioEncodedTransform=function(){if(this.audioTransceiver&&this.audioTransceiver.sender){var e=this.audioTransceiver.sender.createEncodedStreams(),t=e.readable,r=e.writable;t.pipeThrough(new TransformStream({transform:function(e,t){t.enqueue(e)}})).pipeTo(r)}else PU.print("no sender found when trying to bind encodedTransform")},e.prototype.clean=function(){this.audioMid=void 0,this.videoMid=void 0,this.videoTransceiver=void 0,this.audioTransceiver=void 0},e.prototype.updateVideoBitrate=function(e){var t,r=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.maxKbps;if("number"==typeof r&&r&&this.videoTransceiver){var n=this.videoTransceiver.sender,i=n.getParameters();i.encodings&&0!==i.encodings.length||(i.encodings=[{}]),i.encodings[0].maxBitrate=1e3*r,PU.print("updateVideoBitrate","set sendEncodings: ",i),n.setParameters(i)}},e.prototype.switchTrackEnableState=function(e,t){var r;"audio"===e?r=this.audioTrack:"video"===e&&(r=this.videoTrack);var n=null==r?void 0:r.getTrack();return!(!n||(null==n?void 0:n.enabled)===t)&&(n.enabled=t,!0)},e}(),UU=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o.userId=t,o.isScreen=n,o.streamId=r,o.hasAudio=i.localaudio,o.hasVideo=i.localvideo,o._attributes=i,o.subVideo=!1,o.subAudio=!1,o._sequenceId=0,o.subMediaType=p.NONE,o.recordedVideoFrames=[],o.subConfig={videoIndex:0},o.hasSubscribed=!1,o}return r(t,e),Object.defineProperty(t.prototype,"sequenceId",{get:function(){return this._sequenceId||-1},set:function(e){"number"==typeof e&&(this._sequenceId=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){return this._attributes},set:function(e){this.hasVideo=e.localvideo,this.hasAudio=e.localaudio,this._attributes=e},enumerable:!1,configurable:!0}),t.prototype.initVideoEncodedTransform=function(){var e=this;if(this.videoTransceiver&&this.videoTransceiver.receiver){var t=this.videoTransceiver.receiver.createEncodedStreams(),r=t.readable,n=t.writable;r.pipeThrough(new TransformStream({transform:function(t,r){var n=kU.getNalunits(new DU(t.data)).find((function(e){return e.sei}));n&&e.safeEmit("onSEIMessage",n.body.slice(1)),r.enqueue(t)}})).pipeTo(n)}else PU.print("no receiver found when trying to bind encodedTransform")},t.prototype.initAudioEncodedTransform=function(){if(this.audioTransceiver&&this.audioTransceiver.receiver){var e=this.audioTransceiver.receiver.createEncodedStreams(),t=e.readable,r=e.writable;t.pipeThrough(new TransformStream({transform:function(e,t){t.enqueue(e)}})).pipeTo(r)}else PU.print("no receiver found when trying to bind encodedTransform")},t.prototype.ontrack=function(e){var t,r,n;if((null===(r=null===(t=e.streams)||void 0===t?void 0:t[0])||void 0===r?void 0:r.id)===this.streamId){var i=e.track;"video"===(null==i?void 0:i.kind)?this._setVideoTrack(i):"audio"===(null===(n=e.track)||void 0===n?void 0:n.kind)&&this._setAudioTrack(i),this._setStream(e.streams[0])}this.safeEmit("ontrack",e)},t.prototype.clean=function(){PU.print("clean","exec stream.clean ".concat(this.streamId," ").concat(this.userId)),this.subAudio=!1,this.subVideo=!1,this.audioMid=void 0,this.videoMid=void 0,this.sequenceId=0,this.videoTrack=void 0,this.audioTrack=void 0,this.stream=void 0,this.videoTransceiver=void 0,this.audioTransceiver=void 0,this.recordedVideoFrames=[],this.paused=!1,this._workaround_1_=!1},t.prototype.resetHasSubscribed=function(){this.hasSubscribed=!1},t.prototype._setStream=function(e){var t=this;this.stream=e,e.onaddtrack=function(e){"video"===e.track.kind?t._setVideoTrack(e.track):"audio"===e.track.kind&&t._setAudioTrack(e.track)}},t.prototype._setAudioTrack=function(e){var t,r;(null===(r=null===(t=this.audioTrack)||void 0===t?void 0:t.getTrack())||void 0===r?void 0:r.id)!==(null==e?void 0:e.id)&&(this.audioTrack=new yU(e,nO()),this.emit("ontrack",this.audioTrack))},t.prototype._setVideoTrack=function(e){var t,r;(null===(r=null===(t=this.videoTrack)||void 0===t?void 0:t.getTrack())||void 0===r?void 0:r.id)!==(null==e?void 0:e.id)&&(this.videoTrack=new gU(e,nO()),this.emit("ontrack",this.videoTrack))},t}(UO);!function(e){e[e.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",e[e.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING"}(wU||(wU={})),function(e){e.RESUBSCRIBE="resubscribe",e.STREAM_FAILED="stream_failed",e.SUBSCRIBE_PUSH_TRACK="subscribe_push_track",e.REMOVE_PUSH_TRACK="remove_push_track",e.VIDEO_FIRST_FRAME="video_first_frame",e.ON_USER_MUTE_AUDIO="on_user_mute_audio",e.ON_USER_MUTE_VIDEO="on_user_mute_video",e.ON_USER_START_AUDIO_CAPTURE="on_user_start_audio_capture",e.ON_USER_STOP_AUDIO_CAPTURE="on_user_stop_audio_capture",e.ON_USER_START_VIDEO_CAPTURE="on_user_start_video_capture",e.ON_USER_STOP_VIDEO_CAPTURE="on_user_stop_video_capture",e.ON_SEI_MESSAGED_RECEIVED="on_sei_messaged_received",e.ON_PUBLISH_RESULT="on_publish_result"}(NU||(NU={}));var LU=new PO("Room",1),xU=function(e){function t(t){var r=e.call(this)||this;return r._remoteUsers=new Map,r._remoteStreams=new Map,r._roomConfig=t,r._mediaServerClient=new gM,r._addHandlerEventHandler(),r._isReconnecting=!1,r}return r(t,e),Object.defineProperty(t.prototype,"hasScreenPublished",{get:function(){var e;return null===(e=this._localScreenStream)||void 0===e?void 0:e.hasPublished},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPublished",{get:function(){var e;return null===(e=this._localStream)||void 0===e?void 0:e.hasPublished},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionState",{get:function(){return this._mediaServerClient.connectionState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteUsers",{get:function(){return this._remoteUsers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteStreams",{get:function(){return this._remoteStreams},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localStream",{get:function(){return this._localStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localScreenStream",{get:function(){return this._localScreenStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomInfo",{get:function(){return this._roomInfo},enumerable:!1,configurable:!0}),t.prototype._addHandlerEventHandler=function(){var e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m=this;null===(e=this._mediaServerClient)||void 0===e||e.on(eP.ON_ADD_STREAM,this._onAddStream.bind(this)),null===(t=this._mediaServerClient)||void 0===t||t.on(eP.ON_REMOVE_STREAM,this._onRemoveStream.bind(this)),null===(r=this._mediaServerClient)||void 0===r||r.on(eP.USER_CONNECTION,this._onUserConnection.bind(this)),null===(n=this._mediaServerClient)||void 0===n||n.on(eP.USER_DISCONNECTION,this._onUserDisconnection.bind(this)),null===(i=this._mediaServerClient)||void 0===i||i.on(eP.ON_UPDATE_ROOM_ATTRIBUTES,this._onUpdateRoomAttributes.bind(this)),null===(o=this._mediaServerClient)||void 0===o||o.on(eP.ON_UPDATE_STREAM_ATTRIBUTES,this._onUpdateStreamAttributes.bind(this)),null===(a=this._mediaServerClient)||void 0===a||a.on(eP.ON_PUSH_TRACK,this._onPushTrack.bind(this)),null===(s=this._mediaServerClient)||void 0===s||s.on(eP.ON_REMOVE_TRACK,this._onRemoveTrack.bind(this)),null===(c=this._mediaServerClient)||void 0===c||c.on(eP.NODE_CHANGE,this._nodeChange.bind(this)),null===(u=this._mediaServerClient)||void 0===u||u.on(eP.ON_CUSTOM_MESSAGE,this._onCustomMessage.bind(this)),null===(d=this._mediaServerClient)||void 0===d||d.on(eP.USER_MESSAGE_RECEIVED,this._onUserMessageReceived.bind(this)),null===(l=this._mediaServerClient)||void 0===l||l.on(eP.USER_BINARY_MESSAGE_RECEIVED,this._onUserBinaryMessageReceived.bind(this)),null===(f=this._mediaServerClient)||void 0===f||f.on(eP.POST_PROCESSING_MESSAGE,this._onPostProcessingMessage.bind(this)),null===(h=this._mediaServerClient)||void 0===h||h.on(tP.ON_CONNECTION_STATE_CHANGE,this._onConnectionStateChange.bind(this)),null===(p=this._mediaServerClient)||void 0===p||p.on(tP.ABNORMAL_DISCONNECTION,this._handleAbnormalDisconnection.bind(this)),null===(_=this._mediaServerClient)||void 0===_||_.on("onRemoteStreamStats",(function(e){m.emit("onRemoteStreamStats",e)})),null===(v=this._mediaServerClient)||void 0===v||v.on("onLocalStreamStats",(function(e){m.emit("onLocalStreamStats",e)}))},t.prototype._removeHandlerEventHandler=function(){var e;null===(e=this._mediaServerClient)||void 0===e||e.removeAllListeners()},t.prototype.join=function(e,t,r,n,i){return S(this,void 0,void 0,(function(){var o=this;return b(this,(function(a){return nP.setStats({rtc_app_id:e,room_id:t,user_id:n.userId}),LU.print("join()"),[2,new Promise((function(a,s){return S(o,void 0,void 0,(function(){var o;return b(this,(function(c){return this._joinResolveCallback=a,this._joinRejectCallback=s,this._controlMessage=i,this._roomInfo={appId:e,roomId:t,token:r,userInfo:n},o=iO(),aP.joinRoom(AD.BEGIN,o,!1,""),this._join((function(e){aP.joinRoom(AD.END,o,!0,e.message),a(e)}),(function(e){aP.joinRoom(AD.END,o,!1,e.message),s(e)})),[2]}))}))}))]}))}))},t.prototype._join=function(e,t,r){var n;return void 0===r&&(r=!1),S(this,void 0,void 0,(function(){var i,o,a;return b(this,(function(s){switch(s.label){case 0:i=iO(),LU.print("_join()"),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._mediaServerClient.join(this._roomInfo,{node:this._getAccessNode,reason:this._getAccessFeedback},r,this._controlMessage)];case 2:return o=s.sent(),this._mediaServerClient.roomAttributes=o.roomAttributes,this._joinResolveCallback=void 0,this._joinRejectCallback=void 0,this._getAccessFeedback=void 0,this._getAccessNode=void 0,"function"==typeof e&&e(null===(n=this._roomInfo)||void 0===n?void 0:n.userInfo),this._isReconnecting=!1,aP.rtcJoinRoom(0,"web","web",iO()-i),this._onJoinSucc(o,r),[3,4];case 3:return(a=s.sent()).code!==tI.OPERATION_CANCEL&&"function"==typeof t?[2,t(a)]:[3,4];case 4:return[2]}}))}))},t.prototype.publishScreen=function(e,t,r){return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return LU.print("publishScreen()"),this._localScreenStream||(this._localScreenStream=new MU,this._localScreenStream.isScreen=!0),this._localScreenStream.videoTrack=t,this._localScreenStream.audioTrack=r,this._localScreenStream.videoEncodeConfig=e,this._localScreenStream.hasPublished?[3,2]:[4,this._mediaServerClient.publish(this._localScreenStream)];case 1:return n.sent(),[3,4];case 2:return[4,this.updatePubScreenTrack()];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype.updatePubScreenTrack=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("updatePubScreenTrack","Invoke updatePubScreenTrack"),this._localScreenStream?[4,this._mediaServerClient.updatePubTrack(this._localScreenStream)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.unpublishScreen=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("unpublish","Invoke unpublishScreen"),this._localScreenStream?[4,this._mediaServerClient.unpublish(this._localScreenStream)]:[3,2];case 1:e.sent(),this._localScreenStream.clean(),this._localScreenStream=void 0,e.label=2;case 2:return[2]}}))}))},t.prototype.controlMessage=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return LU.print("controlMessage","Invoke controlMessage"),this._controlMessage=e,[4,this._mediaServerClient.controlMessage(e)];case 1:return t.sent(),"stopped"===e.action&&delete this._controlMessage,[2]}}))}))},t.prototype.updateUserAttributes=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return LU.print("updateUserAttributes","Invoke updateUserAttributes"),e.role&&this._roomInfo&&(this._roomInfo.userInfo.role=e.role),[4,this._mediaServerClient.updateUserAttributes(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.publish=function(e,t,r){return S(this,void 0,void 0,(function(){var n;return b(this,(function(i){switch(i.label){case 0:if(LU.print("publish","Invoke publish"),this._localStream||(this._localStream=new MU),this._localStream.videoTrack=t,this._localStream.audioTrack=r,this._localStream.videoEncodeConfig=e,this._localStream.hasPublished)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._mediaServerClient.publish(this._localStream)];case 2:return i.sent(),this.emit(NU.ON_PUBLISH_RESULT,{isScreen:!1,state:u.PUBLISH_SUCC}),[3,4];case 3:throw n=i.sent(),this.emit(NU.ON_PUBLISH_RESULT,{isScreen:!1,state:u.PUBLISH_FAIL}),n;case 4:return[3,7];case 5:return[4,this.updatePubTrack()];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))},t.prototype.updatePubTrack=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("updatePubTrack","Invoke updatePubTrack"),this._localStream?[4,this._mediaServerClient.updatePubTrack(this._localStream)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.unpublish=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("unpublish","Invoke unpublish"),this._localStream?[4,this._mediaServerClient.unpublish(this._localStream)]:[3,2];case 1:e.sent(),this._localStream.clean(),this._localStream=void 0,e.label=2;case 2:return[2]}}))}))},t.prototype.subscribe=function(e,t,r){return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return LU.print("subscribe","remoteStream %o",e),[4,this._mediaServerClient.subscribe(e,t,r)];case 1:return n.sent(),[2]}}))}))},t.prototype.updateSubTrack=function(e,t,r){var n,i;return S(this,void 0,void 0,(function(){return b(this,(function(o){return LU.print("updateSubTrack","Invoke updateSubTrack"),e.subMediaType===t&&(null===(n=null==e?void 0:e.subConfig)||void 0===n?void 0:n.videoIndex)===(null==r?void 0:r.videoIndex)?[2,Promise.resolve(e)]:[2,null===(i=this._mediaServerClient)||void 0===i?void 0:i.updateSubTrack(e,t,r)]}))}))},t.prototype.unsubscribe=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return LU.print("unsubscribe","Invoke unsubscribe"),[4,this._mediaServerClient.unsubscribe(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.leave=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:LU.print("leave","Invoke leave"),e=iO(),r.label=1;case 1:return r.trys.push([1,3,4,5]),clearTimeout(this._reconnectTimer),[4,this._mediaServerClient.leave()];case 2:return r.sent(),aP.rtcLeaveRoom(0,"",iO()-e),[3,5];case 3:return(t=r.sent())instanceof Error&&aP.rtcLeaveRoom(-1,t.message,iO()-e),[3,5];case 4:return this.destroy(),[7];case 5:return[2]}}))}))},t.prototype.destroy=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("destroy","Invoke destroy"),this.connectionState!==hM.CONNECTED?[3,2]:[4,this.leave()];case 1:e.sent(),e.label=2;case 2:return this._destroyAndInitMediaServerClient(),this._roomInfo=void 0,this._remoteUsers=new Map,this._remoteStreams=new Map,this._localStream=void 0,this._localScreenStream=void 0,this._removeHandlerEventHandler(),[2]}}))}))},t.prototype.updateToken=function(e){LU.print("updateToken","Invoke updateToken"),this._roomInfo&&(this._roomInfo.token=e)},t.prototype.muteLocalTrack=function(e,t){var r,n;return S(this,void 0,void 0,(function(){var i,o;return b(this,(function(a){switch(a.label){case 0:return this._localStream&&(null===(r=this._localStream)||void 0===r?void 0:r.hasPublished)?(i=t!==s.MUTE_STATE_OFF,(o=this._localStream.switchTrackEnableState(e,i))?[4,null===(n=this._mediaServerClient)||void 0===n?void 0:n.updatePubTrack(this._localStream)]:[3,2]):[2,!1];case 1:a.sent(),a.label=2;case 2:return[2,o]}}))}))},t.prototype.pauseAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return b(this,(function(c){t=[];try{for(r=T(this._remoteStreams.values()),n=r.next();!n.done;n=r.next())i=n.value,Array.isArray(i)&&i.forEach((function(r){if(r.hasSubscribed){var n=null;switch(e){case l.RTC_PAUSE_RESUME_CONTROL_AUDIO:r.subMediaType===p.AUDIO_ONLY?n=p.NONE:r.subMediaType===p.AUDIO_AND_VIDEO&&(n=p.VIDEO_ONLY);break;case l.RTC_PAUSE_RESUME_CONTROL_VIDEO:r.subMediaType===p.VIDEO_ONLY?n=p.NONE:r.subMediaType===p.AUDIO_AND_VIDEO&&(n=p.AUDIO_ONLY);break;case l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO:r.subMediaType!==p.NONE&&(n=p.NONE)}if(null!==n){var i=s.updateSubTrack(r,n,r.subConfig);i&&t.push(i)}}}))}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2,Promise.all(t)]}))}))},t.prototype.resumeAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return b(this,(function(c){t=[];try{for(r=T(this._remoteStreams.values()),n=r.next();!n.done;n=r.next())i=n.value,Array.isArray(i)&&i.forEach((function(r){if(r.hasSubscribed){var n=null;switch(e){case l.RTC_PAUSE_RESUME_CONTROL_AUDIO:r.subMediaType===p.NONE?n=p.AUDIO_ONLY:r.subMediaType===p.VIDEO_ONLY&&(n=p.AUDIO_AND_VIDEO);break;case l.RTC_PAUSE_RESUME_CONTROL_VIDEO:r.subMediaType===p.NONE?n=p.VIDEO_ONLY:r.subMediaType===p.AUDIO_ONLY&&(n=p.AUDIO_AND_VIDEO);break;case l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO:r.subMediaType!==p.AUDIO_AND_VIDEO&&(n=p.AUDIO_AND_VIDEO)}if(null!==n){var i=s.updateSubTrack(r,n,r.subConfig);i&&t.push(i)}}}))}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2,Promise.all(t)]}))}))},t.prototype.sendUserMessage=function(e,t){var r;return this._remoteUsers.has(e)?null===(r=this._mediaServerClient)||void 0===r?void 0:r.sendUserMessage(e,t):Promise.reject(new iI(tI.USER_NOT_EXIST,"User does not exist"))},t.prototype.sendRoomMessage=function(e,t){var r,n;void 0===t&&(t=!1);var i={clientId:null===(r=this._roomInfo)||void 0===r?void 0:r.userInfo.userId,binary:t,message:""};if(t){var o=aO.ab2str(e);i.message=eO.encodeBase64(o)}else i.message=e;return null===(n=this._mediaServerClient)||void 0===n?void 0:n.sendRoomMessage(i)},t.prototype._destroyAndInitMediaServerClient=function(){LU.print("_destroyAndInitMediaServerClient()"),this._mediaServerClient&&(this._mediaServerClient.destroy(),this._removeHandlerEventHandler()),this._mediaServerClient=new gM,this._addHandlerEventHandler()},t.prototype._onJoinSucc=function(e,t){var r,n,i,o,a,s=this;LU.print("JoinSuccess()");var c=[],u=[],d=[],l=[];null===(a=e.clientsDetail)||void 0===a||a.forEach((function(t){if(t.clientId!==e.clientId){var r=s._remoteUsers.get(t.clientId);r?r._stillExist=!0:c.push(t)}}));try{for(var f=T(this._remoteUsers.values()),h=f.next();!h.done;h=f.next()){var p=h.value;p._stillExist?delete p._stillExist:u.push({clientId:p.userId,leaveReason:"Left during disconnection"})}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}e.streams.forEach((function(e){var t=s._findRemoteStreamByScreen(e.clientId,e.screen);t?(t.stillExist=!0,t.streamId=e.streamId):l.push(e)}));try{for(var _=T(this._remoteStreams.values()),v=_.next();!v.done;v=_.next()){var m=v.value;Array.isArray(m)&&m.forEach((function(e){e.stillExist?delete e.stillExist:d.push({clientId:e.userId,streamId:e.streamId,message:QD.clientDisconnected})}))}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}setTimeout((function(){u.forEach((function(e){return s._onUserDisconnection(e)})),c.forEach((function(e){return s._onUserConnection(e)})),d.forEach((function(e){return s._onRemoveStream(e)})),l.forEach((function(e){return s._onAddStream(e)})),t&&s._handleSendOrRecvStreamAfterReconnect()}))},t.prototype._handleSendOrRecvStreamAfterReconnect=function(){var e,t,r=this;this._localStream&&(this._localStream.clean(),this._mediaServerClient.publish(this._localStream).catch((function(e){}))),this._localScreenStream&&(this._localScreenStream.clean(),this._mediaServerClient.publish(this._localScreenStream).catch((function(e){})));try{for(var n=T(this._remoteStreams.values()),i=n.next();!i.done;i=n.next()){var o=i.value;Array.isArray(o)&&o.forEach((function(e){return S(r,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:if(!e.hasSubscribed)return[3,4];e.resetHasSubscribed(),r.label=1;case 1:return r.trys.push([1,3,,4]),LU.print("start resubscribe ".concat(e.userId," with ").concat(e.subMediaType)),[4,this._mediaServerClient.subscribe(e,e.subMediaType,e.subConfig)];case 2:return r.sent(),LU.print("success resubscribe ".concat(e.userId," with ").concat(e.subMediaType)),this.safeEmit(NU.RESUBSCRIBE,{stream:e}),[3,4];case 3:return t=r.sent(),LU.print("failed resubscribe ".concat(e.userId," with ").concat(e.subMediaType,", error:").concat(t)),e.clean(),null==e||e.resetHasSubscribed(),[3,4];case 4:return[2]}}))}))}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype._findRemoteStream=function(e,t){var r=this._remoteStreams.get(e);return Array.isArray(r)?r.find((function(e){return e.streamId===t})):null},t.prototype._findRemoteStreamByScreen=function(e,t){var r=this._remoteStreams.get(e);return Array.isArray(r)?r.find((function(e){return e.isScreen===t})):null},t.prototype._onAddStream=function(e,t){var r;if(void 0===t&&(t=!0),e.clientId!==(null===(r=this._roomInfo)||void 0===r?void 0:r.userInfo.userId)){var n=this._findRemoteStream(e.clientId,e.streamId);if(!n){n=new UU(e.clientId,e.streamId,e.screen,e.attributes),this._initStreamListeners(n);var i=this._remoteStreams.get(e.clientId);i?i.push(n):this._remoteStreams.set(e.clientId,[n])}return t&&this.safeEmit(eP.ON_ADD_STREAM,{stream:n}),!n.isScreen&&n.hasVideo&&this.safeEmit(NU.ON_USER_START_VIDEO_CAPTURE,{userId:n.userId}),!n.isScreen&&n.hasAudio&&this.safeEmit(NU.ON_USER_START_AUDIO_CAPTURE,{userId:n.userId}),n}},t.prototype._onUserConnection=function(e){var t;if(e.clientId!==(null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo.userId)){var r={userId:e.clientId,extraInfo:e.attributes.extra_info};this._remoteUsers.set(e.clientId,y(y({},r),{_stillExist:!0})),this.safeEmit(eP.USER_CONNECTION,{userInfo:r})}},t.prototype._onUserDisconnection=function(e){var t,r,n=this,i=e.clientId,o=e.leaveReason,a=this._remoteUsers.get(i);this._remoteUsers.delete(i);var s=this._remoteStreams.get(i);Array.isArray(s)&&s.length&&(s.forEach((function(e){n.safeEmit(eP.ON_REMOVE_STREAM,{stream:e,reason:"Client leave"})})),this._remoteStreams.delete(i)),"userDuplicateLogin"===e.tag&&i===(null===(r=null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo)||void 0===r?void 0:r.userId)&&(a={userId:i},o=e.tag),this.safeEmit(eP.USER_DISCONNECTION,{userInfo:{userId:null==a?void 0:a.userId},reason:o})},t.prototype._onRemoveStream=function(e){var t,r,n=this;if(e.clientId!==(null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo.userId)){var i=this._remoteStreams.get(e.clientId);if(i){var o=i.find((function(t){return t.streamId==e.streamId}));o&&(null===(r=this._mediaServerClient)||void 0===r||r.handleRemoveStream(o,e).then((function(){if(!(null==o?void 0:o._workaround_1_)){var t=n._remoteStreams.get(e.clientId);if(!t)return;t=t.filter((function(t){return t.streamId!==e.streamId})),n._remoteStreams.set(e.clientId,t)}})),this.safeEmit(eP.ON_REMOVE_STREAM,{stream:o,reason:e.message}))}}},t.prototype._onUpdateRoomAttributes=function(e){e.roomAttributes&&(this._mediaServerClient.roomAttributes=e.roomAttributes)},t.prototype._onUpdateStreamAttributes=function(e){var t=e.clientId,r=e.streamId,n=e.attributes,i=this._findRemoteStream(t,r);if(i){var o=i.attributes,a=y(y({},o),n);i.attributes=a,a.localaudio!==o.localaudio&&(a.localaudio?this.safeEmit(NU.ON_USER_START_AUDIO_CAPTURE,{userId:t}):this.safeEmit(NU.ON_USER_STOP_AUDIO_CAPTURE,{userId:t})),a.localvideo!==o.localvideo&&(a.localvideo?this.safeEmit(NU.ON_USER_START_VIDEO_CAPTURE,{userId:t}):this.safeEmit(NU.ON_USER_STOP_VIDEO_CAPTURE,{userId:t})),a.audiostream!==o.audiostream&&(a.audiostream?this.safeEmit(NU.ON_USER_MUTE_AUDIO,{userInfo:{userId:t},muteState:s.MUTE_STATE_ON}):this.safeEmit(NU.ON_USER_MUTE_AUDIO,{userInfo:{userId:t},muteState:s.MUTE_STATE_OFF})),a.videostream!==o.videostream&&(a.videostream?this.safeEmit(NU.ON_USER_MUTE_VIDEO,{userInfo:{userId:t},muteState:s.MUTE_STATE_ON}):this.safeEmit(NU.ON_USER_MUTE_VIDEO,{userInfo:{userId:t},muteState:s.MUTE_STATE_OFF}))}},t.prototype._onPushTrack=function(e){var t=this,r=e.clientId,n=e.streamId,i=this._findRemoteStream(r,n);i||(i=this._onAddStream(e,!1)),this._mediaServerClient.subscribe4pushTrack(i,e).then((function(){return t.safeEmit(NU.SUBSCRIBE_PUSH_TRACK,{stream:i})})).catch((function(e){LU.print("subscribe push track failed: ".concat(e))}))},t.prototype._onRemoveTrack=function(e){var t=this,r=e.clientId,n=e.streamId,i=e.message,o=this._findRemoteStream(r,n);o&&this._mediaServerClient.unsubscribe4removeTrack(o,i).then((function(){var e;if(o._workaround_1_){var i=null===(e=t._remoteStreams.get(r))||void 0===e?void 0:e.filter((function(e){return e.streamId!==n}));t._remoteStreams.set(r,i||[])}t.safeEmit(NU.REMOVE_PUSH_TRACK,{stream:o})})).catch((function(e){LU.print("remove push track failed: ".concat(e))}))},t.prototype._nodeChange=function(e){var t=e.nodes,r=e.reason;this._destroyAndInitMediaServerClient(),Array.isArray(t)&&t.length?this._getAccessNode=t[0]:this._getAccessFeedback=r,aP.rtcNodeChange(0,JSON.stringify(e),JSON.stringify(r)),this._joinResolveCallback&&this._joinRejectCallback?this._join(this._joinResolveCallback,this._joinRejectCallback):this._reconnect()},t.prototype._reconnect=function(){var e,t,r=this;this._isReconnecting=!0,aP.rtcReconnect(1002,$k.PEERCONNECTION_RECONNECTING,this._roomInfo.userInfo.userId,Qk.PEERCONNECTION);try{for(var n=T(this._remoteStreams.values()),i=n.next();!i.done;i=n.next()){var o=i.value;Array.isArray(o)&&o.forEach((function(e){return e.clean()}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._join((function(){aP.rtcReconnected(eD.PEERCONNECTION_RECONNECTED,tD.PEERCONNECTION)}),(function(e){LU.print("Reconnecting error, will reconnect after 3s",e),r._reconnectTimer=setTimeout(r._reconnect.bind(r),3e3)}),!0)},t.prototype._handleAbnormalDisconnection=function(){LU.print("on ABNORMAL_DISCONNECTION"),this._destroyAndInitMediaServerClient(),navigator.onLine?this._reconnect():this._reconnectTimer=setTimeout(this._reconnect.bind(this),3e3)},t.prototype._onConnectionStateChange=function(e){var t;if(e.next===hM.DISCONNECTED)t=v.CONNECTION_STATE_DISCONNECTED;else if(e.next===hM.CONNECTED)t=this._isReconnecting?v.CONNECTION_STATE_RECONNECTED:v.CONNECTION_STATE_CONNECTED;else{if(e.next!==hM.CONNECTING)return;t=this._isReconnecting?v.CONNECTION_STATE_RECONNECTING:v.CONNECTION_STATE_CONNECTING}this.safeEmit(tP.ON_CONNECTION_STATE_CHANGE,{state:t})},t.prototype._initStreamListeners=function(e){var t=this;e.on("ontrack",(function(e){e.track})),e.on("onSEIMessage",(function(r){var n;t.emit(NU.ON_SEI_MESSAGED_RECEIVED,{sei:r,remoteStreamKey:{userId:e.userId,roomId:null===(n=t._roomInfo)||void 0===n?void 0:n.roomId,streamIndex:e.isScreen?h.STREAM_INDEX_SCREEN:h.STREAM_INDEX_MAIN}})}))},t.prototype._onCustomMessage=function(e){this.safeEmit(eP.ON_CUSTOM_MESSAGE,e)},t.prototype._onUserMessageReceived=function(e){var t=e.msg;try{t=JSON.parse(t)}catch(e){}this.safeEmit(eP.USER_MESSAGE_RECEIVED,{userId:e.from,message:t})},t.prototype._onUserBinaryMessageReceived=function(e){this.safeEmit(eP.USER_BINARY_MESSAGE_RECEIVED,{userId:e.from,message:e.msg})},t.prototype._onPostProcessingMessage=function(e){var t,r=(null===(t=e.body)||void 0===t?void 0:t.error)||0;this.safeEmit(eP.POST_PROCESSING_MESSAGE,{code:r,message:["success","parameter error","subscription timeout","ffmpeg error","cdn error"][r]})},t}(UO),BU=function(e,t){return void 0===t&&(t={}),t.id&&(e.id=t.id),t.classList&&t.classList.forEach((function(t){e.classList.add(t)})),t.style&&Object.assign(e.style,t.style),t.attributes&&Object.entries(t.attributes).forEach((function(t){var r=I(t,2),n=r[0],i=r[1];e.setAttribute(n,i)})),e},VU=new PO("Player",0),jU=["play","playing","pause","ended","error","seeking","seeked","waiting","canplay","canplaythrough","durationchange","volumechange","loadedmetadata","loadeddata","loadstart","timeupdate"],FU={playsinline:"","webkit-playsinline":""},GU={playsinline:"","webkit-playsinline":"","x5-playsinline":"","x5-video-player-type":"h5","x-webkit-airplay":"allow",preload:"",muted:""},zU=function(){function e(){this.videoCache=[],this.audioCache=[]}return e.prototype.getOrCreate=function(e,t){var r="audio"===e?FU:GU;if("video"===e&&this.videoCache.length>0){if(n=this.videoCache.pop())return BU(n,{style:t,attributes:r}),n}else if("audio"===e&&this.audioCache.length>0){var n;if(n=this.audioCache.pop())return BU(n,{style:t,attributes:r}),n}return function(e,t){void 0===t&&(t={});var r=document.createElement(e);return t.id&&(r.id=t.id),t.classList&&t.classList.forEach((function(e){r.classList.add(e)})),t.style&&Object.assign(r.style,t.style),t.attributes&&Object.entries(t.attributes).forEach((function(e){var t=I(e,2),n=t[0],i=t[1];r.setAttribute(n,i)})),r}(e,{style:t,attributes:r})},e.prototype.recycle=function(e){for(;e.attributes.length>0;)e.removeAttribute(e.attributes[0].name);e instanceof HTMLVideoElement?this.videoCache.push(e):this.audioCache.push(e)},e}(),HU=new zU,WU=function(e){function t(t){var r=e.call(this)||this;r.emitVideoEvent=function(e){var t,n,i={type:"video",rawEvent:e,readyState:(null===(t=r._videoDom)||void 0===t?void 0:t.readyState)||0,userId:r.userId,eventName:e.type,currentTime:(null===(n=r._videoDom)||void 0===n?void 0:n.currentTime)||0,isScreen:r.isScreen};r.emit("playback_event",i)},r._internalPlay=function(){var e;if(null===(e=r._videoDom)||void 0===e?void 0:e.paused)return r._videoDom.play()};var n=t.renderDom,i=t.userId;r.renderMode=void 0!==t.renderMode?t.renderMode:f.RENDER_MODE_FIT;var o="string"==typeof n?document.getElementById(n):n;if(!o)throw new iI(tI.CANT_FIND_DOM,"can't find dom");return r._containerDom=o,r.userId=i,r.isScreen=!!t.isScreen,r._initVideo(),r}return r(t,e),t.prototype._initVideo=function(){this._videoDom||(this._videoDom=HU.getOrCreate("video",{width:"100%",height:"100%",background:"black"}),this._videoDom.id="".concat(this.userId,"_").concat(nO()),this.renderMode===f.RENDER_MODE_FIT?this._videoDom.style.objectFit="contain":this._videoDom.style.objectFit="cover"),this._initListeners()},t.prototype._initListeners=function(){var e=this;this._videoDom&&jU.forEach((function(t){var r;null===(r=e._videoDom)||void 0===r||r.addEventListener(t,e.emitVideoEvent)}))},t.prototype._removeListeners=function(){var e=this;this._videoDom&&(jU.forEach((function(t){var r;null===(r=e._videoDom)||void 0===r||r.removeEventListener(t,e.emitVideoEvent)})),this._videoDom.addEventListener("canplay",this._internalPlay),this._videoDom.addEventListener("loadeddata",this._internalPlay))},t.prototype._recordFrame=function(e){var t=this;this.on("playback_event",(function(r){var n;if("timeupdate"===r.eventName){if(void 0===t.__cumulativeTime&&(t.__cumulativeTime=0),0===(null===(n=t._videoDom)||void 0===n?void 0:n.currentTime))return;if(t._videoDom.currentTime>t.__cumulativeTime){var i=Math.floor(1e3*(t._videoDom.currentTime-t.__cumulativeTime)),o=t._videoDom.currentTime-t.__cumulativeTime>.5;e.recordedVideoFrames.push({playTime:t._videoDom.currentTime,isStall:o,stallCount:o?1:0,stallDuration:i%2e3})}t.__cumulativeTime=t._videoDom.currentTime}}))},t.prototype.playVideo=function(e,t){var r;return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){return n=this._videoDom,VU.print("playVideo","play video track: ".concat(this.userId)),n&&n.srcObject instanceof MediaStream&&n.srcObject.getTrackById(null===(r=e.getTrack())||void 0===r?void 0:r.id)||(n||(this._initVideo(),n=this._videoDom),VU.print("playVideo","play video by dom: ".concat(null==n?void 0:n.id)),(i=new MediaStream).addTrack(e.getTrack()),n.srcObject=i,this._containerDom.appendChild(n),n.addEventListener("canplay",this._internalPlay),n.addEventListener("loadeddata",this._internalPlay),t&&this._recordFrame(t)),[2]}))}))},t.prototype.updateSrcObject=function(e){var t=e.getTrack();if(t&&this._videoDom){var r=new MediaStream;r.addTrack(t),this._videoDom.srcObject=r}},t.prototype.mirror=function(e){VU.print("mirror","".concat(this.userId," set mirror: ").concat(e)),this._videoDom&&(this._videoDom.style.transform=e?"rotateY(180deg)":"")},t.prototype.stop=function(){var e=this._containerDom;VU.print("stop","stop video track: ".concat(this.userId)),this._videoDom&&(this._videoDom.srcObject=null,e&&e.contains(this._videoDom)&&e.removeChild(this._videoDom),HU.recycle(this._videoDom),this._removeListeners(),delete this._videoDom),this._videoDom=void 0,this.__cumulativeTime=void 0},t.prototype.destroy=function(){this.stop(),e.prototype.removeAllListeners.call(this)},Object.defineProperty(t.prototype,"domElement",{get:function(){return this._videoDom},enumerable:!1,configurable:!0}),t}(SO.exports.EventEmitter),YU=function(e){function t(t,r){var n=e.call(this)||this;if(n.emitVideoEvent=function(e){var t,r,i={type:"audio",rawEvent:e,readyState:(null===(t=n._audioDom)||void 0===t?void 0:t.readyState)||0,userId:n.userId,eventName:e.type,currentTime:(null===(r=n._audioDom)||void 0===r?void 0:r.currentTime)||0};n.emit("playback_event",i)},n._internalPlay=function(){var e;if(null===(e=n._audioDom)||void 0===e?void 0:e.paused){var t=n._audioDom.play();(null==t?void 0:t.then)&&t.catch((function(e){var t;aP.rtcError("autoplay failed, userId: ".concat(n.userId),-1e3),n.emit("playback_event",{type:"audio",rawEvent:e,readyState:n._audioDom.readyState||0,userId:n.userId,eventName:"autoplay-error",currentTime:(null===(t=n._audioDom)||void 0===t?void 0:t.currentTime)||0})}))}},r){var i=document.getElementById(r);if(!i)throw new iI(tI.CANT_FIND_DOM,"can't find dom");n._containerDom=i}else n._containerDom=document.body;return n.userId=t,n._initAudio(),n}return r(t,e),t.prototype._initAudio=function(){this._audioDom||(this._audioDom=HU.getOrCreate("audio",{display:"none"}),this._audioDom.id="".concat(this.userId,"_").concat(nO()),this._containerDom.appendChild(this._audioDom)),this._initListeners()},t.prototype._initListeners=function(){var e=this;this._audioDom&&jU.forEach((function(t){var r;null===(r=e._audioDom)||void 0===r||r.addEventListener(t,e.emitVideoEvent)}))},t.prototype._removeListeners=function(){var e=this;this._audioDom&&(jU.forEach((function(t){var r;null===(r=e._audioDom)||void 0===r||r.removeEventListener(t,e.emitVideoEvent)})),this._audioDom.removeEventListener("canplay",this._internalPlay),this._audioDom.removeEventListener("loadeddata",this._internalPlay))},t.prototype.playAudio=function(e){var t;return S(this,void 0,void 0,(function(){var r,n;return b(this,(function(i){return VU.print("playAudio","play audio track: ".concat(this.userId)),(r=this._audioDom)&&r.srcObject instanceof MediaStream&&r.srcObject.getTrackById(null===(t=e.getTrack())||void 0===t?void 0:t.id)||(r||(this._initAudio(),r=this._audioDom),(n=new MediaStream).addTrack(e.getTrack()),r.srcObject=n,null==r||r.addEventListener("canplay",this._internalPlay),null==r||r.addEventListener("loadeddata",this._internalPlay)),[2]}))}))},t.prototype.manuallyPlay=function(){if(VU.print("Invoke AudioPlayer.manuallyPlay"),!this._audioDom)throw new iI(tI.INVALID_PARAMS,"Player not found");var e=this._audioDom.play();return(null==e?void 0:e.then)?e:Promise.resolve(e)},t.prototype.setPlaybackDevice=function(e){return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return VU.print("setPlaybackDevice","setPlaybackDevice: ".concat(e)),[4,oU.getAudioPlayback()];case 1:return t=r.sent(),t.map((function(e){return e.deviceId})).includes(e)&&this._audioDom&&this._audioDom.setSinkId?[4,this._audioDom.setSinkId(e)]:[2];case 2:return r.sent(),[2]}}))}))},t.prototype.stop=function(){var e=this._containerDom;VU.print("stopAudio","stop audio track: ".concat(this.userId)),this._audioDom&&(this._audioDom.srcObject=null,e&&e.contains(this._audioDom)&&e.removeChild(this._audioDom),HU.recycle(this._audioDom),this._removeListeners(),delete this._audioDom),this._audioDom=void 0},Object.defineProperty(t.prototype,"domElement",{get:function(){return this._audioDom},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.stop(),e.prototype.removeAllListeners.call(this)},t}(SO.exports.EventEmitter),KU={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,c=64,u=128,d=256,l=1/0,f=9007199254740991,h=NaN,p=4294967295,_=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",c],["rearg",d]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",E="[object Error]",S="[object Function]",b="[object GeneratorFunction]",T="[object Map]",I="[object Number]",A="[object Object]",R="[object Promise]",C="[object RegExp]",O="[object Set]",w="[object String]",N="[object Symbol]",k="[object WeakMap]",P="[object ArrayBuffer]",M="[object DataView]",U="[object Float32Array]",L="[object Float64Array]",x="[object Int8Array]",B="[object Int16Array]",V="[object Int32Array]",j="[object Uint8Array]",F="[object Uint8ClampedArray]",G="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,q=RegExp(K.source),J=RegExp(X.source),Z=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,_e=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,be=/['\n\r\u2028\u2029\\]/g,Te="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ie="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Re="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",we="['’]",Ne="[\\ud800-\\udfff]",ke="["+Oe+"]",De="["+Te+"]",Pe="\\d+",Me="[\\u2700-\\u27bf]",Ue="["+Ae+"]",Le="[^\\ud800-\\udfff"+Oe+Pe+Ie+Ae+Re+"]",xe="\\ud83c[\\udffb-\\udfff]",Be="[^\\ud800-\\udfff]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Re+"]",Ge="(?:"+Ue+"|"+Le+")",ze="(?:"+Fe+"|"+Le+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+De+"|"+xe+")"+"?",Ke="[\\ufe0e\\ufe0f]?",Xe=Ke+Ye+("(?:\\u200d(?:"+[Be,Ve,je].join("|")+")"+Ke+Ye+")*"),qe="(?:"+[Me,Ve,je].join("|")+")"+Xe,Je="(?:"+[Be+De+"?",De,Ve,je,Ne].join("|")+")",Ze=RegExp(we,"g"),$e=RegExp(De,"g"),Qe=RegExp(xe+"(?="+xe+")|"+Je+Xe,"g"),et=RegExp([Fe+"?"+Ue+"+"+He+"(?="+[ke,Fe,"$"].join("|")+")",ze+"+"+We+"(?="+[ke,Fe+Ge,"$"].join("|")+")",Fe+"?"+Ge+"+"+He,Fe+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,qe].join("|"),"g"),tt=RegExp("[\\u200d\\ud800-\\udfff"+Te+Ce+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,ot={};ot[U]=ot[L]=ot[x]=ot[B]=ot[V]=ot[j]=ot[F]=ot[G]=ot[z]=!0,ot[v]=ot[m]=ot[P]=ot[g]=ot[M]=ot[y]=ot[E]=ot[S]=ot[T]=ot[I]=ot[A]=ot[C]=ot[O]=ot[w]=ot[k]=!1;var at={};at[v]=at[m]=at[P]=at[M]=at[g]=at[y]=at[U]=at[L]=at[x]=at[B]=at[V]=at[T]=at[I]=at[A]=at[C]=at[O]=at[w]=at[N]=at[j]=at[F]=at[G]=at[z]=!0,at[E]=at[S]=at[k]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ut=parseInt,dt="object"==typeof D&&D&&D.Object===Object&&D,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||lt||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,_t=pt&&pt.exports===ht,vt=_t&&dt.process,mt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,Et=mt&&mt.isMap,St=mt&&mt.isRegExp,bt=mt&&mt.isSet,Tt=mt&&mt.isTypedArray;function It(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function At(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function Rt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function wt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Nt(e,t){return!!(null==e?0:e.length)&&jt(e,t,0)>-1}function kt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Dt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Mt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Ut(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Lt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var xt=Ht("length");function Bt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function jt(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,Gt,r)}function Ft(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Gt(e){return e!=e}function zt(e,t){var r=null==e?0:e.length;return r?Kt(e,t)/r:h}function Ht(e){return function(t){return null==t?r:t[e]}}function Wt(e){return function(t){return null==e?r:e[t]}}function Yt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Kt(e,t){for(var n,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Xt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qt(e){return e?e.slice(0,hr(e)+1).replace(oe,""):e}function Jt(e){return function(t){return e(t)}}function Zt(e,t){return Dt(t,(function(t){return e[t]}))}function $t(e,t){return e.has(t)}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&jt(t,e[r],0)>-1;);return r}function er(e,t){for(var r=e.length;r--&&jt(t,e[r],0)>-1;);return r}function tr(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var rr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Wt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ir(e){return"\\"+st[e]}function or(e){return tt.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function sr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var s=e[r];s!==t&&s!==o||(e[r]=o,a[i++]=r)}return a}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function dr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function lr(e){return or(e)?function(e){var t=Qe.lastIndex=0;for(;Qe.test(e);)++t;return t}(e):xt(e)}function fr(e){return or(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function hr(e){for(var t=e.length;t--&&ae.test(e.charAt(t)););return t}var pr=Wt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var _r=function e(t){var D=(t=null==t?ft:_r.defaults(ft.Object(),t,_r.pick(ft,nt))).Array,ae=t.Date,Te=t.Error,Ie=t.Function,Ae=t.Math,Re=t.Object,Ce=t.RegExp,Oe=t.String,we=t.TypeError,Ne=D.prototype,ke=Ie.prototype,De=Re.prototype,Pe=t["__core-js_shared__"],Me=ke.toString,Ue=De.hasOwnProperty,Le=0,xe=function(){var e=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=De.toString,Ve=Me.call(Re),je=ft._,Fe=Ce("^"+Me.call(Ue).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=_t?t.Buffer:r,ze=t.Symbol,He=t.Uint8Array,We=Ge?Ge.allocUnsafe:r,Ye=sr(Re.getPrototypeOf,Re),Ke=Re.create,Xe=De.propertyIsEnumerable,qe=Ne.splice,Je=ze?ze.isConcatSpreadable:r,Qe=ze?ze.iterator:r,tt=ze?ze.toStringTag:r,st=function(){try{var e=ho(Re,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,lt=ae&&ae.now!==ft.Date.now&&ae.now,ht=t.setTimeout!==ft.setTimeout&&t.setTimeout,pt=Ae.ceil,vt=Ae.floor,mt=Re.getOwnPropertySymbols,xt=Ge?Ge.isBuffer:r,Wt=t.isFinite,vr=Ne.join,mr=sr(Re.keys,Re),gr=Ae.max,yr=Ae.min,Er=ae.now,Sr=t.parseInt,br=Ae.random,Tr=Ne.reverse,Ir=ho(t,"DataView"),Ar=ho(t,"Map"),Rr=ho(t,"Promise"),Cr=ho(t,"Set"),Or=ho(t,"WeakMap"),wr=ho(Re,"create"),Nr=Or&&new Or,kr={},Dr=jo(Ir),Pr=jo(Ar),Mr=jo(Rr),Ur=jo(Cr),Lr=jo(Or),xr=ze?ze.prototype:r,Br=xr?xr.valueOf:r,Vr=xr?xr.toString:r;function jr(e){if(ns(e)&&!Ya(e)&&!(e instanceof Hr)){if(e instanceof zr)return e;if(Ue.call(e,"__wrapped__"))return Fo(e)}return new zr(e)}var Fr=function(){function e(){}return function(t){if(!rs(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Gr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Yr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Xr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Kr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new Yr(e);this.size=t.size}function Jr(e,t){var r=Ya(e),n=!r&&Wa(e),i=!r&&!n&&Ja(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Xt(e.length,Oe):[],c=s.length;for(var u in e)!t&&!Ue.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Eo(u,c))||s.push(u);return s}function Zr(e){var t=e.length;return t?e[qn(0,t-1)]:r}function $r(e,t){return xo(Ni(e),cn(t,0,e.length))}function Qr(e){return xo(Ni(e))}function en(e,t,n){(n!==r&&!Ga(e[t],n)||n===r&&!(t in e))&&an(e,t,n)}function tn(e,t,n){var i=e[t];Ue.call(e,t)&&Ga(i,n)&&(n!==r||t in e)||an(e,t,n)}function rn(e,t){for(var r=e.length;r--;)if(Ga(e[r][0],t))return r;return-1}function nn(e,t,r,n){return hn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function on(e,t){return e&&ki(t,Ps(t),e)}function an(e,t,r){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function sn(e,t){for(var n=-1,i=t.length,o=D(i),a=null==e;++n<i;)o[n]=a?r:Os(e,t[n]);return o}function cn(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,d=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!rs(e))return e;var l=Ya(e);if(l){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ue.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ni(e,s)}else{var f=vo(e),h=f==S||f==b;if(Ja(e))return Ii(e,c);if(f==A||f==v||h&&!o){if(s=u||h?{}:go(e),!c)return u?function(e,t){return ki(e,_o(e),t)}(e,function(e,t){return e&&ki(t,Ms(t),e)}(s,e)):function(e,t){return ki(e,po(e),t)}(e,on(s,e))}else{if(!at[f])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case P:return Ai(e);case g:case y:return new n(+e);case M:return function(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case U:case L:case x:case B:case V:case j:case F:case G:case z:return Ri(e,r);case T:return new n;case I:case w:return new n(e);case C:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new n;case N:return i=e,Br?Re(Br.call(i)):{}}var i}(e,f,c)}}a||(a=new qr);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):is(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var _=l?r:(d?u?oo:io:u?Ms:Ps)(e);return Rt(_||e,(function(r,i){_&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function dn(e,t,n){var i=n.length;if(null==e)return!i;for(e=Re(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function ln(e,t,i){if("function"!=typeof e)throw new we(n);return Po((function(){e.apply(r,i)}),t)}function fn(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Dt(t,Jt(r))),n?(o=kt,a=!1):t.length>=200&&(o=$t,a=!1,t=new Xr(t));e:for(;++i<s;){var d=e[i],l=null==r?d:r(d);if(d=n||0!==d?d:0,a&&l==l){for(var f=u;f--;)if(t[f]===l)continue e;c.push(d)}else o(t,l,n)||c.push(d)}return c}jr.templateSettings={escape:Z,evaluate:$,interpolate:Q,variable:"",imports:{_:jr}},jr.prototype=Gr.prototype,jr.prototype.constructor=jr,zr.prototype=Fr(Gr.prototype),zr.prototype.constructor=zr,Hr.prototype=Fr(Gr.prototype),Hr.prototype.constructor=Hr,Wr.prototype.clear=function(){this.__data__=wr?wr(null):{},this.size=0},Wr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wr.prototype.get=function(e){var t=this.__data__;if(wr){var n=t[e];return n===i?r:n}return Ue.call(t,e)?t[e]:r},Wr.prototype.has=function(e){var t=this.__data__;return wr?t[e]!==r:Ue.call(t,e)},Wr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wr&&t===r?i:t,this},Yr.prototype.clear=function(){this.__data__=[],this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0)&&(r==t.length-1?t.pop():qe.call(t,r,1),--this.size,!0)},Yr.prototype.get=function(e){var t=this.__data__,n=rn(t,e);return n<0?r:t[n][1]},Yr.prototype.has=function(e){return rn(this.__data__,e)>-1},Yr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Kr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ar||Yr),string:new Wr}},Kr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Kr.prototype.get=function(e){return lo(this,e).get(e)},Kr.prototype.has=function(e){return lo(this,e).has(e)},Kr.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(e){return this.__data__.set(e,i),this},Xr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new Yr,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Yr){var n=r.__data__;if(!Ar||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Kr(n)}return r.set(e,t),this.size=r.size,this};var hn=Mi(Sn),pn=Mi(bn,!0);function _n(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function vn(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(c===r?s==s&&!ds(s):n(s,c)))var c=s,u=a}return u}function mn(e,t){var r=[];return hn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function gn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?gn(s,t-1,r,n,i):Pt(i,s):n||(i[i.length]=s)}return i}var yn=Ui(),En=Ui(!0);function Sn(e,t){return e&&yn(e,t,Ps)}function bn(e,t){return e&&En(e,t,Ps)}function Tn(e,t){return wt(t,(function(t){return Qa(e[t])}))}function In(e,t){for(var n=0,i=(t=Ei(t,e)).length;null!=e&&n<i;)e=e[Vo(t[n++])];return n&&n==i?e:r}function An(e,t,r){var n=t(e);return Ya(e)?n:Pt(n,r(e))}function Rn(e){return null==e?e===r?"[object Undefined]":"[object Null]":tt&&tt in Re(e)?function(e){var t=Ue.call(e,tt),n=e[tt];try{e[tt]=r;var i=!0}catch(e){}var o=Be.call(e);i&&(t?e[tt]=n:delete e[tt]);return o}(e):function(e){return Be.call(e)}(e)}function Cn(e,t){return e>t}function On(e,t){return null!=e&&Ue.call(e,t)}function wn(e,t){return null!=e&&t in Re(e)}function Nn(e,t,n){for(var i=n?kt:Nt,o=e[0].length,a=e.length,s=a,c=D(a),u=1/0,d=[];s--;){var l=e[s];s&&t&&(l=Dt(l,Jt(t))),u=yr(l.length,u),c[s]=!n&&(t||o>=120&&l.length>=120)?new Xr(s&&l):r}l=e[0];var f=-1,h=c[0];e:for(;++f<o&&d.length<u;){var p=l[f],_=t?t(p):p;if(p=n||0!==p?p:0,!(h?$t(h,_):i(d,_,n))){for(s=a;--s;){var v=c[s];if(!(v?$t(v,_):i(e[s],_,n)))continue e}h&&h.push(_),d.push(p)}}return d}function kn(e,t,n){var i=null==(e=wo(e,t=Ei(t,e)))?e:e[Vo($o(t))];return null==i?r:It(i,e,n)}function Dn(e){return ns(e)&&Rn(e)==v}function Pn(e,t,n,i,o){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ya(e),c=Ya(t),u=s?m:vo(e),d=c?m:vo(t),l=(u=u==v?A:u)==A,f=(d=d==v?A:d)==A,h=u==d;if(h&&Ja(e)){if(!Ja(t))return!1;s=!0,l=!1}if(h&&!l)return a||(a=new qr),s||ls(e)?ro(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case g:case y:case I:return Ga(+e,+t);case E:return e.name==t.name&&e.message==t.message;case C:case w:return e==t+"";case T:var s=ar;case O:var c=1&n;if(s||(s=ur),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=ro(s(e),s(t),n,i,o,a);return a.delete(e),d;case N:if(Br)return Br.call(e)==Br.call(t)}return!1}(e,t,u,n,i,o,a);if(!(1&n)){var p=l&&Ue.call(e,"__wrapped__"),_=f&&Ue.call(t,"__wrapped__");if(p||_){var S=p?e.value():e,b=_?t.value():t;return a||(a=new qr),o(S,b,n,i,a)}}if(!h)return!1;return a||(a=new qr),function(e,t,n,i,o,a){var s=1&n,c=io(e),u=c.length,d=io(t).length;if(u!=d&&!s)return!1;var l=u;for(;l--;){var f=c[l];if(!(s?f in t:Ue.call(t,f)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var _=!0;a.set(e,t),a.set(t,e);var v=s;for(;++l<u;){var m=e[f=c[l]],g=t[f];if(i)var y=s?i(g,m,f,t,e,a):i(m,g,f,e,t,a);if(!(y===r?m===g||o(m,g,n,i,a):y)){_=!1;break}v||(v="constructor"==f)}if(_&&!v){var E=e.constructor,S=t.constructor;E==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof S&&S instanceof S||(_=!1)}return a.delete(e),a.delete(t),_}(e,t,n,i,o,a)}(e,t,n,i,Pn,o))}function Mn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Re(e);o--;){var c=n[o];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<a;){var u=(c=n[o])[0],d=e[u],l=c[1];if(s&&c[2]){if(d===r&&!(u in e))return!1}else{var f=new qr;if(i)var h=i(d,l,u,e,t,f);if(!(h===r?Pn(l,d,3,i,f):h))return!1}}return!0}function Un(e){return!(!rs(e)||(t=e,xe&&xe in t))&&(Qa(e)?Fe:me).test(jo(e));var t}function Ln(e){return"function"==typeof e?e:null==e?oc:"object"==typeof e?Ya(e)?Gn(e[0],e[1]):Fn(e):pc(e)}function xn(e){if(!Ao(e))return mr(e);var t=[];for(var r in Re(e))Ue.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Bn(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var r in Re(e))t.push(r);return t}(e);var t=Ao(e),r=[];for(var n in e)("constructor"!=n||!t&&Ue.call(e,n))&&r.push(n);return r}function Vn(e,t){return e<t}function jn(e,t){var r=-1,n=Xa(e)?D(e.length):[];return hn(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function Fn(e){var t=fo(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(r){return r===e||Mn(r,e,t)}}function Gn(e,t){return bo(e)&&Ro(t)?Co(Vo(e),t):function(n){var i=Os(n,e);return i===r&&i===t?ws(n,e):Pn(t,i,3)}}function zn(e,t,n,i,o){e!==t&&yn(t,(function(a,s){if(o||(o=new qr),rs(a))!function(e,t,n,i,o,a,s){var c=ko(e,n),u=ko(t,n),d=s.get(u);if(d)return void en(e,n,d);var l=a?a(c,u,n+"",e,t,s):r,f=l===r;if(f){var h=Ya(u),p=!h&&Ja(u),_=!h&&!p&&ls(u);l=u,h||p||_?Ya(c)?l=c:qa(c)?l=Ni(c):p?(f=!1,l=Ii(u,!0)):_?(f=!1,l=Ri(u,!0)):l=[]:as(u)||Wa(u)?(l=c,Wa(c)?l=ys(c):rs(c)&&!Qa(c)||(l=go(u))):f=!1}f&&(s.set(u,l),o(l,u,i,a,s),s.delete(u));en(e,n,l)}(e,t,s,n,zn,i,o);else{var c=i?i(ko(e,s),a,s+"",e,t,o):r;c===r&&(c=a),en(e,s,c)}}),Ms)}function Hn(e,t){var n=e.length;if(n)return Eo(t+=t<0?n:0,n)?e[t]:r}function Wn(e,t,r){t=t.length?Dt(t,(function(e){return Ya(e)?function(t){return In(t,1===e.length?e[0]:e)}:e})):[oc];var n=-1;t=Dt(t,Jt(uo()));var i=jn(e,(function(e,r,i){var o=Dt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;for(;++n<a;){var c=Ci(i[n],o[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Yn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=In(e,a);r(s,a)&&ei(o,Ei(a,e),s)}return o}function Kn(e,t,r,n){var i=n?Ft:jt,o=-1,a=t.length,s=e;for(e===t&&(t=Ni(t)),r&&(s=Dt(e,Jt(r)));++o<a;)for(var c=0,u=t[o],d=r?r(u):u;(c=i(s,d,c,n))>-1;)s!==e&&qe.call(s,c,1),qe.call(e,c,1);return e}function Xn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;Eo(i)?qe.call(e,i,1):fi(e,i)}}return e}function qn(e,t){return e+vt(br()*(t-e+1))}function Jn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=vt(t/2))&&(e+=e)}while(t);return r}function Zn(e,t){return Mo(Oo(e,t,oc),e+"")}function $n(e){return Zr(Gs(e))}function Qn(e,t){var r=Gs(e);return xo(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!rs(e))return e;for(var o=-1,a=(t=Ei(t,e)).length,s=a-1,c=e;null!=c&&++o<a;){var u=Vo(t[o]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=s){var l=c[u];(d=i?i(l,u,c):r)===r&&(d=rs(l)?l:Eo(t[o+1])?[]:{})}tn(c,u,d),c=c[u]}return e}var ti=Nr?function(e,t){return Nr.set(e,t),e}:oc,ri=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:rc(t),writable:!0})}:oc;function ni(e){return xo(Gs(e))}function ii(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=D(i);++n<i;)o[n]=e[n+t];return o}function oi(e,t){var r;return hn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ai(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!ds(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return si(e,t,oc,r)}function si(e,t,n,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,c=null===t,u=ds(t),d=t===r;o<a;){var l=vt((o+a)/2),f=n(e[l]),h=f!==r,p=null===f,_=f==f,v=ds(f);if(s)var m=i||_;else m=d?_&&(i||h):c?_&&h&&(i||!p):u?_&&h&&!p&&(i||!v):!p&&!v&&(i?f<=t:f<t);m?o=l+1:a=l}return yr(a,4294967294)}function ci(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Ga(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function ui(e){return"number"==typeof e?e:ds(e)?h:+e}function di(e){if("string"==typeof e)return e;if(Ya(e))return Dt(e,di)+"";if(ds(e))return Vr?Vr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function li(e,t,r){var n=-1,i=Nt,o=e.length,a=!0,s=[],c=s;if(r)a=!1,i=kt;else if(o>=200){var u=t?null:Ji(e);if(u)return ur(u);a=!1,i=$t,c=new Xr}else c=t?[]:s;e:for(;++n<o;){var d=e[n],l=t?t(d):d;if(d=r||0!==d?d:0,a&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue e;t&&c.push(l),s.push(d)}else i(c,l,r)||(c!==s&&c.push(l),s.push(d))}return s}function fi(e,t){return null==(e=wo(e,t=Ei(t,e)))||delete e[Vo($o(t))]}function hi(e,t,r,n){return ei(e,t,r(In(e,t)),n)}function pi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ii(e,n?0:o,n?o+1:i):ii(e,n?o+1:0,n?i:o)}function _i(e,t){var r=e;return r instanceof Hr&&(r=r.value()),Mt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),r)}function vi(e,t,r){var n=e.length;if(n<2)return n?li(e[0]):[];for(var i=-1,o=D(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=fn(o[i]||a,e[s],t,r));return li(gn(o,1),t,r)}function mi(e,t,n){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var c=i<a?t[i]:r;n(s,e[i],c)}return s}function gi(e){return qa(e)?e:[]}function yi(e){return"function"==typeof e?e:oc}function Ei(e,t){return Ya(e)?e:bo(e,t)?[e]:Bo(Es(e))}var Si=Zn;function bi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ii(e,t,n)}var Ti=dt||function(e){return ft.clearTimeout(e)};function Ii(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function Ai(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Ri(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ds(e),s=t!==r,c=null===t,u=t==t,d=ds(t);if(!c&&!d&&!a&&e>t||a&&s&&u&&!c&&!d||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!d&&e<t||d&&n&&o&&!i&&!a||c&&n&&o||!s&&o||!u)return-1}return 0}function Oi(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,c=t.length,u=gr(o-a,0),d=D(c+u),l=!n;++s<c;)d[s]=t[s];for(;++i<a;)(l||i<o)&&(d[r[i]]=e[i]);for(;u--;)d[s++]=e[i++];return d}function wi(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,c=-1,u=t.length,d=gr(o-s,0),l=D(d+u),f=!n;++i<d;)l[i]=e[i];for(var h=i;++c<u;)l[h+c]=t[c];for(;++a<s;)(f||i<o)&&(l[h+r[a]]=e[i++]);return l}function Ni(e,t){var r=-1,n=e.length;for(t||(t=D(n));++r<n;)t[r]=e[r];return t}function ki(e,t,n,i){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=i?i(n[c],e[c],c,n,e):r;u===r&&(u=e[c]),o?an(n,c,u):tn(n,c,u)}return n}function Di(e,t){return function(r,n){var i=Ya(r)?At:nn,o=t?t():{};return i(r,e,uo(n,2),o)}}function Pi(e){return Zn((function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&So(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Re(t);++i<o;){var c=n[i];c&&e(t,c,i,a)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Xa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Re(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ui(e){return function(t,r,n){for(var i=-1,o=Re(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}function Li(e){return function(t){var n=or(t=Es(t))?fr(t):r,i=n?n[0]:t.charAt(0),o=n?bi(n,1).join(""):t.slice(1);return i[e]()+o}}function xi(e){return function(t){return Mt(Qs(Ws(t).replace(Ze,"")),e,"")}}function Bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return rs(n)?n:r}}function Vi(e){return function(t,n,i){var o=Re(t);if(!Xa(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[a?t[s]:s]:r}}function ji(e){return no((function(t){var i=t.length,o=i,a=zr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new we(n);if(a&&!c&&"wrapper"==so(s))var c=new zr([],!0)}for(o=c?o:i;++o<i;){var u=so(s=t[o]),d="wrapper"==u?ao(s):r;c=d&&To(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?c[so(d[0])].apply(c,d[3]):1==s.length&&To(s)?c[u]():c.thru(s)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&Ya(r))return c.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}}))}function Fi(e,t,n,i,o,a,s,c,d,l){var f=t&u,h=1&t,p=2&t,_=24&t,v=512&t,m=p?r:Bi(e);return function r(){for(var u=arguments.length,g=D(u),y=u;y--;)g[y]=arguments[y];if(_)var E=co(r),S=tr(g,E);if(i&&(g=Oi(g,i,o,_)),a&&(g=wi(g,a,s,_)),u-=S,_&&u<l){var b=cr(g,E);return Xi(e,t,Fi,r.placeholder,n,g,b,c,d,l-u)}var T=h?n:this,I=p?T[e]:e;return u=g.length,c?g=No(g,c):v&&u>1&&g.reverse(),f&&d<u&&(g.length=d),this&&this!==ft&&this instanceof r&&(I=m||Bi(I)),I.apply(T,g)}}function Gi(e,t){return function(r,n){return function(e,t,r,n){return Sn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function zi(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=di(n),i=di(i)):(n=ui(n),i=ui(i)),o=e(n,i)}return o}}function Hi(e){return no((function(t){return t=Dt(t,Jt(uo())),Zn((function(r){var n=this;return e(t,(function(e){return It(e,n,r)}))}))}))}function Wi(e,t){var n=(t=t===r?" ":di(t)).length;if(n<2)return n?Jn(t,e):t;var i=Jn(t,pt(e/lr(t)));return or(t)?bi(fr(i),0,e).join(""):i.slice(0,e)}function Yi(e){return function(t,n,i){return i&&"number"!=typeof i&&So(t,n,i)&&(n=i=r),t=_s(t),n===r?(n=t,t=0):n=_s(n),function(e,t,r,n){for(var i=-1,o=gr(pt((t-e)/(r||1)),0),a=D(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:_s(i),e)}}function Ki(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Xi(e,t,n,i,o,a,u,d,l,f){var h=8&t;t|=h?s:c,4&(t&=~(h?c:s))||(t&=-4);var p=[e,t,o,h?a:r,h?u:r,h?r:a,h?r:u,d,l,f],_=n.apply(r,p);return To(e)&&Do(_,p),_.placeholder=i,Uo(_,e,t)}function qi(e){var t=Ae[e];return function(e,r){if(e=gs(e),(r=null==r?0:yr(vs(r),292))&&Wt(e)){var n=(Es(e)+"e").split("e");return+((n=(Es(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Ji=Cr&&1/ur(new Cr([,-0]))[1]==l?function(e){return new Cr(e)}:dc;function Zi(e){return function(t){var r=vo(t);return r==T?ar(t):r==O?dr(t):function(e,t){return Dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function $i(e,t,i,l,f,h,p,_){var v=2&t;if(!v&&"function"!=typeof e)throw new we(n);var m=l?l.length:0;if(m||(t&=-97,l=f=r),p=p===r?p:gr(vs(p),0),_=_===r?_:vs(_),m-=f?f.length:0,t&c){var g=l,y=f;l=f=r}var E=v?r:ao(e),S=[e,t,i,l,f,g,y,h,p,_];if(E&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,s=n==u&&8==r||n==u&&r==d&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?Oi(l,c,t[4]):c,e[4]=l?cr(e[3],o):t[4]}(c=t[5])&&(l=e[5],e[5]=l?wi(l,c,t[6]):c,e[6]=l?cr(e[5],o):t[6]);(c=t[7])&&(e[7]=c);n&u&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(S,E),e=S[0],t=S[1],i=S[2],l=S[3],f=S[4],!(_=S[9]=S[9]===r?v?0:e.length:gr(S[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==a?function(e,t,n){var i=Bi(e);return function o(){for(var a=arguments.length,s=D(a),c=a,u=co(o);c--;)s[c]=arguments[c];var d=a<3&&s[0]!==u&&s[a-1]!==u?[]:cr(s,u);return(a-=d.length)<n?Xi(e,t,Fi,o.placeholder,r,s,d,r,r,n-a):It(this&&this!==ft&&this instanceof o?i:e,this,s)}}(e,t,_):t!=s&&33!=t||f.length?Fi.apply(r,S):function(e,t,r,n){var i=1&t,o=Bi(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=n.length,d=D(u+s),l=this&&this!==ft&&this instanceof t?o:e;++c<u;)d[c]=n[c];for(;s--;)d[c++]=arguments[++a];return It(l,i?r:this,d)}}(e,t,i,l);else var b=function(e,t,r){var n=1&t,i=Bi(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Uo((E?ti:Do)(b,S),e,t)}function Qi(e,t,n,i){return e===r||Ga(e,De[n])&&!Ue.call(i,n)?t:e}function eo(e,t,n,i,o,a){return rs(e)&&rs(t)&&(a.set(t,e),zn(e,t,r,eo,a),a.delete(t)),e}function to(e){return as(e)?r:e}function ro(e,t,n,i,o,a){var s=1&n,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var d=a.get(e),l=a.get(t);if(d&&l)return d==t&&l==e;var f=-1,h=!0,p=2&n?new Xr:r;for(a.set(e,t),a.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var m=s?i(v,_,f,t,e,a):i(_,v,f,e,t,a);if(m!==r){if(m)continue;h=!1;break}if(p){if(!Lt(t,(function(e,t){if(!$t(p,t)&&(_===e||o(_,e,n,i,a)))return p.push(t)}))){h=!1;break}}else if(_!==v&&!o(_,v,n,i,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function no(e){return Mo(Oo(e,r,Ko),e+"")}function io(e){return An(e,Ps,po)}function oo(e){return An(e,Ms,_o)}var ao=Nr?function(e){return Nr.get(e)}:dc;function so(e){for(var t=e.name+"",r=kr[t],n=Ue.call(kr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(Ue.call(jr,"placeholder")?jr:e).placeholder}function uo(){var e=jr.iteratee||ac;return e=e===ac?Ln:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function fo(e){for(var t=Ps(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ro(i)]}return t}function ho(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Un(n)?n:r}var po=mt?function(e){return null==e?[]:(e=Re(e),wt(mt(e),(function(t){return Xe.call(e,t)})))}:mc,_o=mt?function(e){for(var t=[];e;)Pt(t,po(e)),e=Ye(e);return t}:mc,vo=Rn;function mo(e,t,r){for(var n=-1,i=(t=Ei(t,e)).length,o=!1;++n<i;){var a=Vo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ts(i)&&Eo(a,i)&&(Ya(e)||Wa(e))}function go(e){return"function"!=typeof e.constructor||Ao(e)?{}:Fr(Ye(e))}function yo(e){return Ya(e)||Wa(e)||!!(Je&&e&&e[Je])}function Eo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,r){if(!rs(r))return!1;var n=typeof t;return!!("number"==n?Xa(r)&&Eo(t,r.length):"string"==n&&t in r)&&Ga(r[t],e)}function bo(e,t){if(Ya(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ds(e))||(te.test(e)||!ee.test(e)||null!=t&&e in Re(t))}function To(e){var t=so(e),r=jr[t];if("function"!=typeof r||!(t in Hr.prototype))return!1;if(e===r)return!0;var n=ao(r);return!!n&&e===n[0]}(Ir&&vo(new Ir(new ArrayBuffer(1)))!=M||Ar&&vo(new Ar)!=T||Rr&&vo(Rr.resolve())!=R||Cr&&vo(new Cr)!=O||Or&&vo(new Or)!=k)&&(vo=function(e){var t=Rn(e),n=t==A?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Dr:return M;case Pr:return T;case Mr:return R;case Ur:return O;case Lr:return k}return t});var Io=Pe?Qa:gc;function Ao(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||De)}function Ro(e){return e==e&&!rs(e)}function Co(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Re(n)))}}function Oo(e,t,n){return t=gr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=gr(r.length-t,0),a=D(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=D(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),It(e,this,s)}}function wo(e,t){return t.length<2?e:In(e,ii(t,0,-1))}function No(e,t){for(var n=e.length,i=yr(t.length,n),o=Ni(e);i--;){var a=t[i];e[i]=Eo(a,n)?o[a]:r}return e}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Do=Lo(ti),Po=ht||function(e,t){return ft.setTimeout(e,t)},Mo=Lo(ri);function Uo(e,t,r){var n=t+"";return Mo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Rt(_,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function Lo(e){var t=0,n=0;return function(){var i=Er(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function xo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=qn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Bo=function(e){var t=La(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,r,n,i){t.push(n?i.replace(fe,"$1"):r||e)})),t}));function Vo(e){if("string"==typeof e||ds(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Hr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=Ni(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Go=Zn((function(e,t){return qa(e)?fn(e,gn(t,1,qa,!0)):[]})),zo=Zn((function(e,t){var n=$o(t);return qa(n)&&(n=r),qa(e)?fn(e,gn(t,1,qa,!0),uo(n,2)):[]})),Ho=Zn((function(e,t){var n=$o(t);return qa(n)&&(n=r),qa(e)?fn(e,gn(t,1,qa,!0),r,n):[]}));function Wo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=gr(n+i,0)),Vt(e,uo(t,3),i)}function Yo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=vs(n),o=n<0?gr(i+o,0):yr(o,i-1)),Vt(e,uo(t,3),o,!0)}function Ko(e){return(null==e?0:e.length)?gn(e,1):[]}function Xo(e){return e&&e.length?e[0]:r}var qo=Zn((function(e){var t=Dt(e,gi);return t.length&&t[0]===e[0]?Nn(t):[]})),Jo=Zn((function(e){var t=$o(e),n=Dt(e,gi);return t===$o(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Nn(n,uo(t,2)):[]})),Zo=Zn((function(e){var t=$o(e),n=Dt(e,gi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Nn(n,r,t):[]}));function $o(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Qo=Zn(ea);function ea(e,t){return e&&e.length&&t&&t.length?Kn(e,t):e}var ta=no((function(e,t){var r=null==e?0:e.length,n=sn(e,t);return Xn(e,Dt(t,(function(e){return Eo(e,r)?+e:e})).sort(Ci)),n}));function ra(e){return null==e?e:Tr.call(e)}var na=Zn((function(e){return li(gn(e,1,qa,!0))})),ia=Zn((function(e){var t=$o(e);return qa(t)&&(t=r),li(gn(e,1,qa,!0),uo(t,2))})),oa=Zn((function(e){var t=$o(e);return t="function"==typeof t?t:r,li(gn(e,1,qa,!0),r,t)}));function aa(e){if(!e||!e.length)return[];var t=0;return e=wt(e,(function(e){if(qa(e))return t=gr(e.length,t),!0})),Xt(t,(function(t){return Dt(e,Ht(t))}))}function sa(e,t){if(!e||!e.length)return[];var n=aa(e);return null==t?n:Dt(n,(function(e){return It(t,r,e)}))}var ca=Zn((function(e,t){return qa(e)?fn(e,t):[]})),ua=Zn((function(e){return vi(wt(e,qa))})),da=Zn((function(e){var t=$o(e);return qa(t)&&(t=r),vi(wt(e,qa),uo(t,2))})),la=Zn((function(e){var t=$o(e);return t="function"==typeof t?t:r,vi(wt(e,qa),r,t)})),fa=Zn(aa);var ha=Zn((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,sa(e,n)}));function pa(e){var t=jr(e);return t.__chain__=!0,t}function _a(e,t){return t(e)}var va=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&Eo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:_a,args:[o],thisArg:r}),new zr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ma=Di((function(e,t,r){Ue.call(e,r)?++e[r]:an(e,r,1)}));var ga=Vi(Wo),ya=Vi(Yo);function Ea(e,t){return(Ya(e)?Rt:hn)(e,uo(t,3))}function Sa(e,t){return(Ya(e)?Ct:pn)(e,uo(t,3))}var ba=Di((function(e,t,r){Ue.call(e,r)?e[r].push(t):an(e,r,[t])}));var Ta=Zn((function(e,t,r){var n=-1,i="function"==typeof t,o=Xa(e)?D(e.length):[];return hn(e,(function(e){o[++n]=i?It(t,e,r):kn(e,t,r)})),o})),Ia=Di((function(e,t,r){an(e,r,t)}));function Aa(e,t){return(Ya(e)?Dt:jn)(e,uo(t,3))}var Ra=Di((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ca=Zn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&So(e,t[0],t[1])?t=[]:r>2&&So(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,gn(t,1),[])})),Oa=lt||function(){return ft.Date.now()};function wa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,$i(e,u,r,r,r,r,t)}function Na(e,t){var i;if("function"!=typeof t)throw new we(n);return e=vs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var ka=Zn((function(e,t,r){var n=1;if(r.length){var i=cr(r,co(ka));n|=s}return $i(e,n,t,r,i)})),Da=Zn((function(e,t,r){var n=3;if(r.length){var i=cr(r,co(Da));n|=s}return $i(t,n,e,r,i)}));function Pa(e,t,i){var o,a,s,c,u,d,l=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new we(n);function _(t){var n=o,i=a;return o=a=r,l=t,c=e.apply(i,n)}function v(e){return l=e,u=Po(g,t),f?_(e):c}function m(e){var n=e-d;return d===r||n>=t||n<0||h&&e-l>=s}function g(){var e=Oa();if(m(e))return y(e);u=Po(g,function(e){var r=t-(e-d);return h?yr(r,s-(e-l)):r}(e))}function y(e){return u=r,p&&o?_(e):(o=a=r,c)}function E(){var e=Oa(),n=m(e);if(o=arguments,a=this,d=e,n){if(u===r)return v(d);if(h)return Ti(u),u=Po(g,t),_(d)}return u===r&&(u=Po(g,t)),c}return t=gs(t)||0,rs(i)&&(f=!!i.leading,s=(h="maxWait"in i)?gr(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),E.cancel=function(){u!==r&&Ti(u),l=0,o=d=a=u=r},E.flush=function(){return u===r?c:y(Oa())},E}var Ma=Zn((function(e,t){return ln(e,1,t)})),Ua=Zn((function(e,t,r){return ln(e,gs(t)||0,r)}));function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new we(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(La.Cache||Kr),r}function xa(e){if("function"!=typeof e)throw new we(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=Kr;var Ba=Si((function(e,t){var r=(t=1==t.length&&Ya(t[0])?Dt(t[0],Jt(uo())):Dt(gn(t,1),Jt(uo()))).length;return Zn((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return It(e,this,n)}))})),Va=Zn((function(e,t){var n=cr(t,co(Va));return $i(e,s,r,t,n)})),ja=Zn((function(e,t){var n=cr(t,co(ja));return $i(e,c,r,t,n)})),Fa=no((function(e,t){return $i(e,d,r,r,r,t)}));function Ga(e,t){return e===t||e!=e&&t!=t}var za=Ki(Cn),Ha=Ki((function(e,t){return e>=t})),Wa=Dn(function(){return arguments}())?Dn:function(e){return ns(e)&&Ue.call(e,"callee")&&!Xe.call(e,"callee")},Ya=D.isArray,Ka=gt?Jt(gt):function(e){return ns(e)&&Rn(e)==P};function Xa(e){return null!=e&&ts(e.length)&&!Qa(e)}function qa(e){return ns(e)&&Xa(e)}var Ja=xt||gc,Za=yt?Jt(yt):function(e){return ns(e)&&Rn(e)==y};function $a(e){if(!ns(e))return!1;var t=Rn(e);return t==E||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Qa(e){if(!rs(e))return!1;var t=Rn(e);return t==S||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function es(e){return"number"==typeof e&&e==vs(e)}function ts(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var is=Et?Jt(Et):function(e){return ns(e)&&vo(e)==T};function os(e){return"number"==typeof e||ns(e)&&Rn(e)==I}function as(e){if(!ns(e)||Rn(e)!=A)return!1;var t=Ye(e);if(null===t)return!0;var r=Ue.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Ve}var ss=St?Jt(St):function(e){return ns(e)&&Rn(e)==C};var cs=bt?Jt(bt):function(e){return ns(e)&&vo(e)==O};function us(e){return"string"==typeof e||!Ya(e)&&ns(e)&&Rn(e)==w}function ds(e){return"symbol"==typeof e||ns(e)&&Rn(e)==N}var ls=Tt?Jt(Tt):function(e){return ns(e)&&ts(e.length)&&!!ot[Rn(e)]};var fs=Ki(Vn),hs=Ki((function(e,t){return e<=t}));function ps(e){if(!e)return[];if(Xa(e))return us(e)?fr(e):Ni(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=vo(e);return(t==T?ar:t==O?ur:Gs)(e)}function _s(e){return e?(e=gs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=_s(e),r=t%1;return t==t?r?t-r:t:0}function ms(e){return e?cn(vs(e),0,p):0}function gs(e){if("number"==typeof e)return e;if(ds(e))return h;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var r=ve.test(e);return r||ge.test(e)?ut(e.slice(2),r?2:8):_e.test(e)?h:+e}function ys(e){return ki(e,Ms(e))}function Es(e){return null==e?"":di(e)}var Ss=Pi((function(e,t){if(Ao(t)||Xa(t))ki(t,Ps(t),e);else for(var r in t)Ue.call(t,r)&&tn(e,r,t[r])})),bs=Pi((function(e,t){ki(t,Ms(t),e)})),Ts=Pi((function(e,t,r,n){ki(t,Ms(t),e,n)})),Is=Pi((function(e,t,r,n){ki(t,Ps(t),e,n)})),As=no(sn);var Rs=Zn((function(e,t){e=Re(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&So(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Ms(a),c=-1,u=s.length;++c<u;){var d=s[c],l=e[d];(l===r||Ga(l,De[d])&&!Ue.call(e,d))&&(e[d]=a[d])}return e})),Cs=Zn((function(e){return e.push(r,eo),It(Ls,r,e)}));function Os(e,t,n){var i=null==e?r:In(e,t);return i===r?n:i}function ws(e,t){return null!=e&&mo(e,t,wn)}var Ns=Gi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),e[t]=r}),rc(oc)),ks=Gi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),Ue.call(e,t)?e[t].push(r):e[t]=[r]}),uo),Ds=Zn(kn);function Ps(e){return Xa(e)?Jr(e):xn(e)}function Ms(e){return Xa(e)?Jr(e,!0):Bn(e)}var Us=Pi((function(e,t,r){zn(e,t,r)})),Ls=Pi((function(e,t,r,n){zn(e,t,r,n)})),xs=no((function(e,t){var r={};if(null==e)return r;var n=!1;t=Dt(t,(function(t){return t=Ei(t,e),n||(n=t.length>1),t})),ki(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)fi(r,t[i]);return r}));var Bs=no((function(e,t){return null==e?{}:function(e,t){return Yn(e,t,(function(t,r){return ws(e,r)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var r=Dt(oo(e),(function(e){return[e]}));return t=uo(t),Yn(e,r,(function(e,r){return t(e,r[0])}))}var js=Zi(Ps),Fs=Zi(Ms);function Gs(e){return null==e?[]:Zt(e,Ps(e))}var zs=xi((function(e,t,r){return t=t.toLowerCase(),e+(r?Hs(t):t)}));function Hs(e){return $s(Es(e).toLowerCase())}function Ws(e){return(e=Es(e))&&e.replace(Ee,rr).replace($e,"")}var Ys=xi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ks=xi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Xs=Li("toLowerCase");var qs=xi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Js=xi((function(e,t,r){return e+(r?" ":"")+$s(t)}));var Zs=xi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$s=Li("toUpperCase");function Qs(e,t,n){return e=Es(e),(t=n?r:t)===r?function(e){return rt.test(e)}(e)?function(e){return e.match(et)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var ec=Zn((function(e,t){try{return It(e,r,t)}catch(e){return $a(e)?e:new Te(e)}})),tc=no((function(e,t){return Rt(t,(function(t){t=Vo(t),an(e,t,ka(e[t],e))})),e}));function rc(e){return function(){return e}}var nc=ji(),ic=ji(!0);function oc(e){return e}function ac(e){return Ln("function"==typeof e?e:un(e,1))}var sc=Zn((function(e,t){return function(r){return kn(r,e,t)}})),cc=Zn((function(e,t){return function(r){return kn(e,r,t)}}));function uc(e,t,r){var n=Ps(t),i=Tn(t,n);null!=r||rs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Tn(t,Ps(t)));var o=!(rs(r)&&"chain"in r&&!r.chain),a=Qa(e);return Rt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=Ni(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})})),e}function dc(){}var lc=Hi(Dt),fc=Hi(Ot),hc=Hi(Lt);function pc(e){return bo(e)?Ht(Vo(e)):function(e){return function(t){return In(t,e)}}(e)}var _c=Yi(),vc=Yi(!0);function mc(){return[]}function gc(){return!1}var yc=zi((function(e,t){return e+t}),0),Ec=qi("ceil"),Sc=zi((function(e,t){return e/t}),1),bc=qi("floor");var Tc,Ic=zi((function(e,t){return e*t}),1),Ac=qi("round"),Rc=zi((function(e,t){return e-t}),0);return jr.after=function(e,t){if("function"!=typeof t)throw new we(n);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},jr.ary=wa,jr.assign=Ss,jr.assignIn=bs,jr.assignInWith=Ts,jr.assignWith=Is,jr.at=As,jr.before=Na,jr.bind=ka,jr.bindAll=tc,jr.bindKey=Da,jr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},jr.chain=pa,jr.chunk=function(e,t,n){t=(n?So(e,t,n):t===r)?1:gr(vs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=D(pt(i/t));o<i;)s[a++]=ii(e,o,o+=t);return s},jr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},jr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=D(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Pt(Ya(r)?Ni(r):[r],gn(t,1))},jr.cond=function(e){var t=null==e?0:e.length,r=uo();return e=t?Dt(e,(function(e){if("function"!=typeof e[1])throw new we(n);return[r(e[0]),e[1]]})):[],Zn((function(r){for(var n=-1;++n<t;){var i=e[n];if(It(i[0],this,r))return It(i[1],this,r)}}))},jr.conforms=function(e){return function(e){var t=Ps(e);return function(r){return dn(r,e,t)}}(un(e,1))},jr.constant=rc,jr.countBy=ma,jr.create=function(e,t){var r=Fr(e);return null==t?r:on(r,t)},jr.curry=function e(t,n,i){var o=$i(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},jr.curryRight=function e(t,n,i){var o=$i(t,a,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},jr.debounce=Pa,jr.defaults=Rs,jr.defaultsDeep=Cs,jr.defer=Ma,jr.delay=Ua,jr.difference=Go,jr.differenceBy=zo,jr.differenceWith=Ho,jr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=n||t===r?1:vs(t))<0?0:t,i):[]},jr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,0,(t=i-(t=n||t===r?1:vs(t)))<0?0:t):[]},jr.dropRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0,!0):[]},jr.dropWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0):[]},jr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&So(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=vs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:vs(i))<0&&(i+=o),i=n>i?0:ms(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},jr.filter=function(e,t){return(Ya(e)?wt:mn)(e,uo(t,3))},jr.flatMap=function(e,t){return gn(Aa(e,t),1)},jr.flatMapDeep=function(e,t){return gn(Aa(e,t),l)},jr.flatMapDepth=function(e,t,n){return n=n===r?1:vs(n),gn(Aa(e,t),n)},jr.flatten=Ko,jr.flattenDeep=function(e){return(null==e?0:e.length)?gn(e,l):[]},jr.flattenDepth=function(e,t){return(null==e?0:e.length)?gn(e,t=t===r?1:vs(t)):[]},jr.flip=function(e){return $i(e,512)},jr.flow=nc,jr.flowRight=ic,jr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},jr.functions=function(e){return null==e?[]:Tn(e,Ps(e))},jr.functionsIn=function(e){return null==e?[]:Tn(e,Ms(e))},jr.groupBy=ba,jr.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},jr.intersection=qo,jr.intersectionBy=Jo,jr.intersectionWith=Zo,jr.invert=Ns,jr.invertBy=ks,jr.invokeMap=Ta,jr.iteratee=ac,jr.keyBy=Ia,jr.keys=Ps,jr.keysIn=Ms,jr.map=Aa,jr.mapKeys=function(e,t){var r={};return t=uo(t,3),Sn(e,(function(e,n,i){an(r,t(e,n,i),e)})),r},jr.mapValues=function(e,t){var r={};return t=uo(t,3),Sn(e,(function(e,n,i){an(r,n,t(e,n,i))})),r},jr.matches=function(e){return Fn(un(e,1))},jr.matchesProperty=function(e,t){return Gn(e,un(t,1))},jr.memoize=La,jr.merge=Us,jr.mergeWith=Ls,jr.method=sc,jr.methodOf=cc,jr.mixin=uc,jr.negate=xa,jr.nthArg=function(e){return e=vs(e),Zn((function(t){return Hn(t,e)}))},jr.omit=xs,jr.omitBy=function(e,t){return Vs(e,xa(uo(t)))},jr.once=function(e){return Na(2,e)},jr.orderBy=function(e,t,n,i){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=i?r:n)||(n=null==n?[]:[n]),Wn(e,t,n))},jr.over=lc,jr.overArgs=Ba,jr.overEvery=fc,jr.overSome=hc,jr.partial=Va,jr.partialRight=ja,jr.partition=Ra,jr.pick=Bs,jr.pickBy=Vs,jr.property=pc,jr.propertyOf=function(e){return function(t){return null==e?r:In(e,t)}},jr.pull=Qo,jr.pullAll=ea,jr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Kn(e,t,uo(r,2)):e},jr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Kn(e,t,r,n):e},jr.pullAt=ta,jr.range=_c,jr.rangeRight=vc,jr.rearg=Fa,jr.reject=function(e,t){return(Ya(e)?wt:mn)(e,xa(uo(t,3)))},jr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=uo(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Xn(e,i),r},jr.rest=function(e,t){if("function"!=typeof e)throw new we(n);return Zn(e,t=t===r?t:vs(t))},jr.reverse=ra,jr.sampleSize=function(e,t,n){return t=(n?So(e,t,n):t===r)?1:vs(t),(Ya(e)?$r:Qn)(e,t)},jr.set=function(e,t,r){return null==e?e:ei(e,t,r)},jr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ei(e,t,n,i)},jr.shuffle=function(e){return(Ya(e)?Qr:ni)(e)},jr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&So(e,t,n)?(t=0,n=i):(t=null==t?0:vs(t),n=n===r?i:vs(n)),ii(e,t,n)):[]},jr.sortBy=Ca,jr.sortedUniq=function(e){return e&&e.length?ci(e):[]},jr.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},jr.split=function(e,t,n){return n&&"number"!=typeof n&&So(e,t,n)&&(t=n=r),(n=n===r?p:n>>>0)?(e=Es(e))&&("string"==typeof t||null!=t&&!ss(t))&&!(t=di(t))&&or(e)?bi(fr(e),0,n):e.split(t,n):[]},jr.spread=function(e,t){if("function"!=typeof e)throw new we(n);return t=null==t?0:gr(vs(t),0),Zn((function(r){var n=r[t],i=bi(r,0,t);return n&&Pt(i,n),It(e,this,i)}))},jr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},jr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:vs(t))<0?0:t):[]},jr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:vs(t)))<0?0:t,i):[]},jr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},jr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},jr.tap=function(e,t){return t(e),e},jr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new we(n);return rs(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Pa(e,t,{leading:i,maxWait:t,trailing:o})},jr.thru=_a,jr.toArray=ps,jr.toPairs=js,jr.toPairsIn=Fs,jr.toPath=function(e){return Ya(e)?Dt(e,Vo):ds(e)?[e]:Ni(Bo(Es(e)))},jr.toPlainObject=ys,jr.transform=function(e,t,r){var n=Ya(e),i=n||Ja(e)||ls(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:rs(e)&&Qa(o)?Fr(Ye(e)):{}}return(i?Rt:Sn)(e,(function(e,n,i){return t(r,e,n,i)})),r},jr.unary=function(e){return wa(e,1)},jr.union=na,jr.unionBy=ia,jr.unionWith=oa,jr.uniq=function(e){return e&&e.length?li(e):[]},jr.uniqBy=function(e,t){return e&&e.length?li(e,uo(t,2)):[]},jr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?li(e,r,t):[]},jr.unset=function(e,t){return null==e||fi(e,t)},jr.unzip=aa,jr.unzipWith=sa,jr.update=function(e,t,r){return null==e?e:hi(e,t,yi(r))},jr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,yi(n),i)},jr.values=Gs,jr.valuesIn=function(e){return null==e?[]:Zt(e,Ms(e))},jr.without=ca,jr.words=Qs,jr.wrap=function(e,t){return Va(yi(t),e)},jr.xor=ua,jr.xorBy=da,jr.xorWith=la,jr.zip=fa,jr.zipObject=function(e,t){return mi(e||[],t||[],tn)},jr.zipObjectDeep=function(e,t){return mi(e||[],t||[],ei)},jr.zipWith=ha,jr.entries=js,jr.entriesIn=Fs,jr.extend=bs,jr.extendWith=Ts,uc(jr,jr),jr.add=yc,jr.attempt=ec,jr.camelCase=zs,jr.capitalize=Hs,jr.ceil=Ec,jr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=gs(n))==n?n:0),t!==r&&(t=(t=gs(t))==t?t:0),cn(gs(e),t,n)},jr.clone=function(e){return un(e,4)},jr.cloneDeep=function(e){return un(e,5)},jr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},jr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},jr.conformsTo=function(e,t){return null==t||dn(e,t,Ps(t))},jr.deburr=Ws,jr.defaultTo=function(e,t){return null==e||e!=e?t:e},jr.divide=Sc,jr.endsWith=function(e,t,n){e=Es(e),t=di(t);var i=e.length,o=n=n===r?i:cn(vs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},jr.eq=Ga,jr.escape=function(e){return(e=Es(e))&&J.test(e)?e.replace(X,nr):e},jr.escapeRegExp=function(e){return(e=Es(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},jr.every=function(e,t,n){var i=Ya(e)?Ot:_n;return n&&So(e,t,n)&&(t=r),i(e,uo(t,3))},jr.find=ga,jr.findIndex=Wo,jr.findKey=function(e,t){return Bt(e,uo(t,3),Sn)},jr.findLast=ya,jr.findLastIndex=Yo,jr.findLastKey=function(e,t){return Bt(e,uo(t,3),bn)},jr.floor=bc,jr.forEach=Ea,jr.forEachRight=Sa,jr.forIn=function(e,t){return null==e?e:yn(e,uo(t,3),Ms)},jr.forInRight=function(e,t){return null==e?e:En(e,uo(t,3),Ms)},jr.forOwn=function(e,t){return e&&Sn(e,uo(t,3))},jr.forOwnRight=function(e,t){return e&&bn(e,uo(t,3))},jr.get=Os,jr.gt=za,jr.gte=Ha,jr.has=function(e,t){return null!=e&&mo(e,t,On)},jr.hasIn=ws,jr.head=Xo,jr.identity=oc,jr.includes=function(e,t,r,n){e=Xa(e)?e:Gs(e),r=r&&!n?vs(r):0;var i=e.length;return r<0&&(r=gr(i+r,0)),us(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&jt(e,t,r)>-1},jr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=gr(n+i,0)),jt(e,t,i)},jr.inRange=function(e,t,n){return t=_s(t),n===r?(n=t,t=0):n=_s(n),function(e,t,r){return e>=yr(t,r)&&e<gr(t,r)}(e=gs(e),t,n)},jr.invoke=Ds,jr.isArguments=Wa,jr.isArray=Ya,jr.isArrayBuffer=Ka,jr.isArrayLike=Xa,jr.isArrayLikeObject=qa,jr.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Rn(e)==g},jr.isBuffer=Ja,jr.isDate=Za,jr.isElement=function(e){return ns(e)&&1===e.nodeType&&!as(e)},jr.isEmpty=function(e){if(null==e)return!0;if(Xa(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||Ja(e)||ls(e)||Wa(e)))return!e.length;var t=vo(e);if(t==T||t==O)return!e.size;if(Ao(e))return!xn(e).length;for(var r in e)if(Ue.call(e,r))return!1;return!0},jr.isEqual=function(e,t){return Pn(e,t)},jr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Pn(e,t,r,n):!!i},jr.isError=$a,jr.isFinite=function(e){return"number"==typeof e&&Wt(e)},jr.isFunction=Qa,jr.isInteger=es,jr.isLength=ts,jr.isMap=is,jr.isMatch=function(e,t){return e===t||Mn(e,t,fo(t))},jr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Mn(e,t,fo(t),n)},jr.isNaN=function(e){return os(e)&&e!=+e},jr.isNative=function(e){if(Io(e))throw new Te("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Un(e)},jr.isNil=function(e){return null==e},jr.isNull=function(e){return null===e},jr.isNumber=os,jr.isObject=rs,jr.isObjectLike=ns,jr.isPlainObject=as,jr.isRegExp=ss,jr.isSafeInteger=function(e){return es(e)&&e>=-9007199254740991&&e<=f},jr.isSet=cs,jr.isString=us,jr.isSymbol=ds,jr.isTypedArray=ls,jr.isUndefined=function(e){return e===r},jr.isWeakMap=function(e){return ns(e)&&vo(e)==k},jr.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Rn(e)},jr.join=function(e,t){return null==e?"":vr.call(e,t)},jr.kebabCase=Ys,jr.last=$o,jr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=vs(n))<0?gr(i+o,0):yr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Vt(e,Gt,o,!0)},jr.lowerCase=Ks,jr.lowerFirst=Xs,jr.lt=fs,jr.lte=hs,jr.max=function(e){return e&&e.length?vn(e,oc,Cn):r},jr.maxBy=function(e,t){return e&&e.length?vn(e,uo(t,2),Cn):r},jr.mean=function(e){return zt(e,oc)},jr.meanBy=function(e,t){return zt(e,uo(t,2))},jr.min=function(e){return e&&e.length?vn(e,oc,Vn):r},jr.minBy=function(e,t){return e&&e.length?vn(e,uo(t,2),Vn):r},jr.stubArray=mc,jr.stubFalse=gc,jr.stubObject=function(){return{}},jr.stubString=function(){return""},jr.stubTrue=function(){return!0},jr.multiply=Ic,jr.nth=function(e,t){return e&&e.length?Hn(e,vs(t)):r},jr.noConflict=function(){return ft._===this&&(ft._=je),this},jr.noop=dc,jr.now=Oa,jr.pad=function(e,t,r){e=Es(e);var n=(t=vs(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(vt(i),r)+e+Wi(pt(i),r)},jr.padEnd=function(e,t,r){e=Es(e);var n=(t=vs(t))?lr(e):0;return t&&n<t?e+Wi(t-n,r):e},jr.padStart=function(e,t,r){e=Es(e);var n=(t=vs(t))?lr(e):0;return t&&n<t?Wi(t-n,r)+e:e},jr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),Sr(Es(e).replace(oe,""),t||0)},jr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&So(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=_s(e),t===r?(t=e,e=0):t=_s(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=br();return yr(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return qn(e,t)},jr.reduce=function(e,t,r){var n=Ya(e)?Mt:Yt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},jr.reduceRight=function(e,t,r){var n=Ya(e)?Ut:Yt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},jr.repeat=function(e,t,n){return t=(n?So(e,t,n):t===r)?1:vs(t),Jn(Es(e),t)},jr.replace=function(){var e=arguments,t=Es(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jr.result=function(e,t,n){var i=-1,o=(t=Ei(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[Vo(t[i])];a===r&&(i=o,a=n),e=Qa(a)?a.call(e):a}return e},jr.round=Ac,jr.runInContext=e,jr.sample=function(e){return(Ya(e)?Zr:$n)(e)},jr.size=function(e){if(null==e)return 0;if(Xa(e))return us(e)?lr(e):e.length;var t=vo(e);return t==T||t==O?e.size:xn(e).length},jr.snakeCase=qs,jr.some=function(e,t,n){var i=Ya(e)?Lt:oi;return n&&So(e,t,n)&&(t=r),i(e,uo(t,3))},jr.sortedIndex=function(e,t){return ai(e,t)},jr.sortedIndexBy=function(e,t,r){return si(e,t,uo(r,2))},jr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ai(e,t);if(n<r&&Ga(e[n],t))return n}return-1},jr.sortedLastIndex=function(e,t){return ai(e,t,!0)},jr.sortedLastIndexBy=function(e,t,r){return si(e,t,uo(r,2),!0)},jr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=ai(e,t,!0)-1;if(Ga(e[r],t))return r}return-1},jr.startCase=Js,jr.startsWith=function(e,t,r){return e=Es(e),r=null==r?0:cn(vs(r),0,e.length),t=di(t),e.slice(r,r+t.length)==t},jr.subtract=Rc,jr.sum=function(e){return e&&e.length?Kt(e,oc):0},jr.sumBy=function(e,t){return e&&e.length?Kt(e,uo(t,2)):0},jr.template=function(e,t,n){var i=jr.templateSettings;n&&So(e,t,n)&&(t=r),e=Es(e),t=Ts({},t,i,Qi);var o,a,s=Ts({},t.imports,i.imports,Qi),c=Ps(s),u=Zt(s,c),d=0,l=t.interpolate||Se,f="__p += '",h=Ce((t.escape||Se).source+"|"+l.source+"|"+(l===Q?he:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),p="//# sourceURL="+(Ue.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";e.replace(h,(function(t,r,n,i,s,c){return n||(n=i),f+=e.slice(d,c).replace(be,ir),r&&(o=!0,f+="' +\n__e("+r+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=c+t.length,t})),f+="';\n";var _=Ue.call(t,"variable")&&t.variable;if(_){if(le.test(_))throw new Te("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(H,""):f).replace(W,"$1").replace(Y,"$1;"),f="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=ec((function(){return Ie(c,p+"return "+f).apply(r,u)}));if(v.source=f,$a(v))throw v;return v},jr.times=function(e,t){if((e=vs(e))<1||e>f)return[];var r=p,n=yr(e,p);t=uo(t),e-=p;for(var i=Xt(n,t);++r<e;)t(r);return i},jr.toFinite=_s,jr.toInteger=vs,jr.toLength=ms,jr.toLower=function(e){return Es(e).toLowerCase()},jr.toNumber=gs,jr.toSafeInteger=function(e){return e?cn(vs(e),-9007199254740991,f):0===e?e:0},jr.toString=Es,jr.toUpper=function(e){return Es(e).toUpperCase()},jr.trim=function(e,t,n){if((e=Es(e))&&(n||t===r))return qt(e);if(!e||!(t=di(t)))return e;var i=fr(e),o=fr(t);return bi(i,Qt(i,o),er(i,o)+1).join("")},jr.trimEnd=function(e,t,n){if((e=Es(e))&&(n||t===r))return e.slice(0,hr(e)+1);if(!e||!(t=di(t)))return e;var i=fr(e);return bi(i,0,er(i,fr(t))+1).join("")},jr.trimStart=function(e,t,n){if((e=Es(e))&&(n||t===r))return e.replace(oe,"");if(!e||!(t=di(t)))return e;var i=fr(e);return bi(i,Qt(i,fr(t))).join("")},jr.truncate=function(e,t){var n=30,i="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?vs(t.length):n,i="omission"in t?di(t.omission):i}var a=(e=Es(e)).length;if(or(e)){var s=fr(e);a=s.length}if(n>=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?bi(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),ss(o)){if(e.slice(c).search(o)){var d,l=u;for(o.global||(o=Ce(o.source,Es(pe.exec(o))+"g")),o.lastIndex=0;d=o.exec(l);)var f=d.index;u=u.slice(0,f===r?c:f)}}else if(e.indexOf(di(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},jr.unescape=function(e){return(e=Es(e))&&q.test(e)?e.replace(K,pr):e},jr.uniqueId=function(e){var t=++Le;return Es(e)+t},jr.upperCase=Zs,jr.upperFirst=$s,jr.each=Ea,jr.eachRight=Sa,jr.first=Xo,uc(jr,(Tc={},Sn(jr,(function(e,t){Ue.call(jr.prototype,t)||(Tc[t]=e)})),Tc),{chain:!1}),jr.VERSION="4.17.21",Rt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){jr[e].placeholder=jr})),Rt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:gr(vs(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=yr(n,i.__takeCount__):i.__views__.push({size:yr(n,p),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Rt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Rt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Rt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(oc)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Zn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return kn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(xa(uo(e)))},Hr.prototype.slice=function(e,t){e=vs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=vs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(p)},Sn(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=jr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(jr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],d=c||Ya(t),l=function(e){var t=o.apply(jr,Pt([e],s));return i&&f?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(c=d=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,_=c&&!h;if(!a&&d){t=_?t:new Hr(this);var v=e.apply(t,s);return v.__actions__.push({func:_a,args:[l],thisArg:r}),new zr(v,f)}return p&&_?e.apply(this,s):(v=this.thru(l),p?i?v.value()[0]:v.value():v)})})),Rt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);jr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[r]((function(r){return t.apply(Ya(r)?r:[],e)}))}})),Sn(Hr.prototype,(function(e,t){var r=jr[t];if(r){var n=r.name+"";Ue.call(kr,n)||(kr[n]=[]),kr[n].push({name:t,func:r})}})),kr[Fi(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ya(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=yr(t,e+a);break;case"takeRight":e=gr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,u=n?s:a-1,d=this.__iteratees__,l=d.length,f=0,h=yr(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return _i(e,this.__actions__);var p=[];e:for(;c--&&f<h;){for(var _=-1,v=e[u+=t];++_<l;){var m=d[_],g=m.iteratee,y=m.type,E=g(v);if(2==y)v=E;else if(!E){if(1==y)continue e;break e}}p[f++]=v}return p},jr.prototype.at=va,jr.prototype.chain=function(){return pa(this)},jr.prototype.commit=function(){return new zr(this.value(),this.__chain__)},jr.prototype.next=function(){this.__values__===r&&(this.__values__=ps(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},jr.prototype.plant=function(e){for(var t,n=this;n instanceof Gr;){var i=Fo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},jr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:_a,args:[ra],thisArg:r}),new zr(t,this.__chain__)}return this.thru(ra)},jr.prototype.toJSON=jr.prototype.valueOf=jr.prototype.value=function(){return _i(this.__wrapped__,this.__actions__)},jr.prototype.first=jr.prototype.head,Qe&&(jr.prototype[Qe]=function(){return this}),jr}();pt?((pt.exports=_r)._=_r,ht._=_r):ft._=_r}).call(D)}(KU,KU.exports);var XU=L,qU=wt("iterator"),JU=!XU((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[qU]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),ZU=ee,$U=2147483647,QU=/[^\0-\u007E]/,eL=/[.\u3002\uFF0E\uFF61]/g,tL="Overflow: input needs wider integers to process",rL=M.RangeError,nL=ZU(eL.exec),iL=Math.floor,oL=String.fromCharCode,aL=ZU("".charCodeAt),sL=ZU([].join),cL=ZU([].push),uL=ZU("".replace),dL=ZU("".split),lL=ZU("".toLowerCase),fL=function(e){return e+22+75*(e<26)},hL=function(e,t,r){var n=0;for(e=r?iL(e/700):e>>1,e+=iL(e/t);e>455;)e=iL(e/35),n+=36;return iL(n+36*e/(e+38))},pL=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=aL(e,r++);if(i>=55296&&i<=56319&&r<n){var o=aL(e,r++);56320==(64512&o)?cL(t,((1023&i)<<10)+(1023&o)+65536):(cL(t,i),r--)}else cL(t,i)}return t}(e);var r,n,i=e.length,o=128,a=0,s=72;for(r=0;r<e.length;r++)(n=e[r])<128&&cL(t,oL(n));var c=t.length,u=c;for(c&&cL(t,"-");u<i;){var d=$U;for(r=0;r<e.length;r++)(n=e[r])>=o&&n<d&&(d=n);var l=u+1;if(d-o>iL(($U-a)/l))throw rL(tL);for(a+=(d-o)*l,o=d,r=0;r<e.length;r++){if((n=e[r])<o&&++a>$U)throw rL(tL);if(n==o){for(var f=a,h=36;;){var p=h<=s?1:h>=s+26?26:h-s;if(f<p)break;var _=f-p,v=36-p;cL(t,oL(fL(p+_%v))),f=iL(_/v),h+=36}cL(t,oL(fL(f))),s=hL(a,l,u==c),a=0,u++}}a++,o++}return sL(t,"")},_L=bi,vL=M,mL=be,gL=F,yL=ee,EL=JU,SL=Ir.exports,bL=Fu,TL=Ba,IL=Wa,AL=on,RL=_u,CL=ve,OL=ht,wL=bc,NL=Lc,kL=ur,DL=ge,PL=hd,ML=sa,UL=X,LL=Xc,xL=Fc,BL=Zf,VL=B_,jL=wt("iterator"),FL="URLSearchParams",GL="URLSearchParamsIterator",zL=AL.set,HL=AL.getterFor(FL),WL=AL.getterFor(GL),YL=mL("fetch"),KL=mL("Request"),XL=mL("Headers"),qL=KL&&KL.prototype,JL=XL&&XL.prototype,ZL=vL.RegExp,$L=vL.TypeError,QL=vL.decodeURIComponent,ex=vL.encodeURIComponent,tx=yL("".charAt),rx=yL([].join),nx=yL([].push),ix=yL("".replace),ox=yL([].shift),ax=yL([].splice),sx=yL("".split),cx=yL("".slice),ux=/\+/g,dx=Array(4),lx=function(e){return dx[e-1]||(dx[e-1]=ZL("((?:%[\\da-f]{2}){"+e+"})","gi"))},fx=function(e){try{return QL(e)}catch(t){return e}},hx=function(e){var t=ix(e,ux," "),r=4;try{return QL(t)}catch(e){for(;r;)t=ix(t,lx(r--),fx);return t}},px=/[!'()~]|%20/g,_x={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},vx=function(e){return _x[e]},mx=function(e){return ix(ex(e),px,vx)},gx=IL((function(e,t){zL(this,{type:GL,iterator:LL(HL(e).entries),kind:t})}),"Iterator",(function(){var e=WL(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),yx=function(e){this.entries=[],this.url=null,void 0!==e&&(DL(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===tx(e,0)?cx(e,1):e:PL(e)))};yx.prototype={type:FL,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,a,s,c=xL(e);if(c)for(r=(t=LL(e,c)).next;!(n=gL(r,t)).done;){if(o=(i=LL(kL(n.value))).next,(a=gL(o,i)).done||(s=gL(o,i)).done||!gL(o,i).done)throw $L("Expected sequence with length 2");nx(this.entries,{key:PL(a.value),value:PL(s.value)})}else for(var u in e)OL(e,u)&&nx(this.entries,{key:u,value:PL(e[u])})},parseQuery:function(e){if(e)for(var t,r,n=sx(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=sx(t,"="),nx(this.entries,{key:hx(ox(r)),value:hx(rx(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],nx(r,mx(e.key)+"="+mx(e.value));return rx(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ex=function(){RL(this,Sx);var e=arguments.length>0?arguments[0]:void 0;zL(this,new yx(e))},Sx=Ex.prototype;if(bL(Sx,{append:function(e,t){BL(arguments.length,2);var r=HL(this);nx(r.entries,{key:PL(e),value:PL(t)}),r.updateURL()},delete:function(e){BL(arguments.length,1);for(var t=HL(this),r=t.entries,n=PL(e),i=0;i<r.length;)r[i].key===n?ax(r,i,1):i++;t.updateURL()},get:function(e){BL(arguments.length,1);for(var t=HL(this).entries,r=PL(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){BL(arguments.length,1);for(var t=HL(this).entries,r=PL(e),n=[],i=0;i<t.length;i++)t[i].key===r&&nx(n,t[i].value);return n},has:function(e){BL(arguments.length,1);for(var t=HL(this).entries,r=PL(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){BL(arguments.length,1);for(var r,n=HL(this),i=n.entries,o=!1,a=PL(e),s=PL(t),c=0;c<i.length;c++)(r=i[c]).key===a&&(o?ax(i,c--,1):(o=!0,r.value=s));o||nx(i,{key:a,value:s}),n.updateURL()},sort:function(){var e=HL(this);VL(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=HL(this).entries,n=wL(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new gx(this,"keys")},values:function(){return new gx(this,"values")},entries:function(){return new gx(this,"entries")}},{enumerable:!0}),SL(Sx,jL,Sx.entries,{name:"entries"}),SL(Sx,"toString",(function(){return HL(this).serialize()}),{enumerable:!0}),TL(Ex,FL),_L({global:!0,forced:!EL},{URLSearchParams:Ex}),!EL&&CL(XL)){var bx=yL(JL.has),Tx=yL(JL.set),Ix=function(e){if(DL(e)){var t,r=e.body;if(NL(r)===FL)return t=e.headers?new XL(e.headers):new XL,bx(t,"content-type")||Tx(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),ML(e,{body:UL(0,PL(r)),headers:UL(0,t)})}return e};if(CL(YL)&&_L({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return YL(e,arguments.length>1?Ix(arguments[1]):{})}}),CL(KL)){var Ax=function(e){return RL(this,qL),new KL(e,arguments.length>1?Ix(arguments[1]):{})};qL.constructor=Ax,Ax.prototype=qL,_L({global:!0,forced:!0},{Request:Ax})}}var Rx,Cx={URLSearchParams:Ex,getState:HL},Ox=bi,wx=x,Nx=JU,kx=M,Dx=bc,Px=ee,Mx=Bo.f,Ux=Ir.exports,Lx=_u,xx=ht,Bx=ZD,Vx=qR,jx=Hs,Fx=bd.codeAt,Gx=function(e){var t,r,n=[],i=dL(uL(lL(e),eL,"."),".");for(t=0;t<i.length;t++)r=i[t],cL(n,nL(QU,r)?"xn--"+pL(r):r);return sL(n,".")},zx=hd,Hx=Ba,Wx=Zf,Yx=Cx,Kx=on,Xx=Kx.set,qx=Kx.getterFor("URL"),Jx=Yx.URLSearchParams,Zx=Yx.getState,$x=kx.URL,Qx=kx.TypeError,eB=kx.parseInt,tB=Math.floor,rB=Math.pow,nB=Px("".charAt),iB=Px(/./.exec),oB=Px([].join),aB=Px(1..toString),sB=Px([].pop),cB=Px([].push),uB=Px("".replace),dB=Px([].shift),lB=Px("".split),fB=Px("".slice),hB=Px("".toLowerCase),pB=Px([].unshift),_B="Invalid scheme",vB="Invalid host",mB="Invalid port",gB=/[a-z]/i,yB=/[\d+-.a-z]/i,EB=/\d/,SB=/^0x/i,bB=/^[0-7]+$/,TB=/^\d+$/,IB=/^[\da-f]+$/i,AB=/[\0\t\n\r #%/:<>?@[\\\]^|]/,RB=/[\0\t\n\r #/:<>?@[\\\]^|]/,CB=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,OB=/[\t\n\r]/g,wB=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)pB(t,e%256),e=tB(e/256);return oB(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=aB(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},NB={},kB=Bx({},NB,{" ":1,'"':1,"<":1,">":1,"`":1}),DB=Bx({},kB,{"#":1,"?":1,"{":1,"}":1}),PB=Bx({},DB,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),MB=function(e,t){var r=Fx(e,0);return r>32&&r<127&&!xx(t,e)?e:encodeURIComponent(e)},UB={ftp:21,file:null,http:80,https:443,ws:80,wss:443},LB=function(e,t){var r;return 2==e.length&&iB(gB,nB(e,0))&&(":"==(r=nB(e,1))||!t&&"|"==r)},xB=function(e){var t;return e.length>1&&LB(fB(e,0,2))&&(2==e.length||"/"===(t=nB(e,2))||"\\"===t||"?"===t||"#"===t)},BB=function(e){return"."===e||"%2e"===hB(e)},VB={},jB={},FB={},GB={},zB={},HB={},WB={},YB={},KB={},XB={},qB={},JB={},ZB={},$B={},QB={},eV={},tV={},rV={},nV={},iV={},oV={},aV=function(e,t,r){var n,i,o,a=zx(e);if(t){if(i=this.parse(a))throw Qx(i);this.searchParams=null}else{if(void 0!==r&&(n=new aV(r,!0)),i=this.parse(a,null,n))throw Qx(i);(o=Zx(new Jx)).bindURL(this),this.searchParams=o}};aV.prototype={type:"URL",parse:function(e,t,r){var n,i,o,a,s,c=this,u=t||VB,d=0,l="",f=!1,h=!1,p=!1;for(e=zx(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=uB(e,CB,"")),e=uB(e,OB,""),n=Vx(e);d<=n.length;){switch(i=n[d],u){case VB:if(!i||!iB(gB,i)){if(t)return _B;u=FB;continue}l+=hB(i),u=jB;break;case jB:if(i&&(iB(yB,i)||"+"==i||"-"==i||"."==i))l+=hB(i);else{if(":"!=i){if(t)return _B;l="",u=FB,d=0;continue}if(t&&(c.isSpecial()!=xx(UB,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,t)return void(c.isSpecial()&&UB[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?u=$B:c.isSpecial()&&r&&r.scheme==c.scheme?u=GB:c.isSpecial()?u=YB:"/"==n[d+1]?(u=zB,d++):(c.cannotBeABaseURL=!0,cB(c.path,""),u=nV)}break;case FB:if(!r||r.cannotBeABaseURL&&"#"!=i)return _B;if(r.cannotBeABaseURL&&"#"==i){c.scheme=r.scheme,c.path=jx(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=oV;break}u="file"==r.scheme?$B:HB;continue;case GB:if("/"!=i||"/"!=n[d+1]){u=HB;continue}u=KB,d++;break;case zB:if("/"==i){u=XB;break}u=rV;continue;case HB:if(c.scheme=r.scheme,i==Rx)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.query=r.query;else if("/"==i||"\\"==i&&c.isSpecial())u=WB;else if("?"==i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.query="",u=iV;else{if("#"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.path.length--,u=rV;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.query=r.query,c.fragment="",u=oV}break;case WB:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=rV;continue}u=XB}else u=KB;break;case YB:if(u=KB,"/"!=i||"/"!=nB(l,d+1))continue;d++;break;case KB:if("/"!=i&&"\\"!=i){u=XB;continue}break;case XB:if("@"==i){f&&(l="%40"+l),f=!0,o=Vx(l);for(var _=0;_<o.length;_++){var v=o[_];if(":"!=v||p){var m=MB(v,PB);p?c.password+=m:c.username+=m}else p=!0}l=""}else if(i==Rx||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(f&&""==l)return"Invalid authority";d-=Vx(l).length+1,l="",u=qB}else l+=i;break;case qB:case JB:if(t&&"file"==c.scheme){u=eV;continue}if(":"!=i||h){if(i==Rx||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==l)return vB;if(t&&""==l&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(l))return a;if(l="",u=tV,t)return;continue}"["==i?h=!0:"]"==i&&(h=!1),l+=i}else{if(""==l)return vB;if(a=c.parseHost(l))return a;if(l="",u=ZB,t==JB)return}break;case ZB:if(!iB(EB,i)){if(i==Rx||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||t){if(""!=l){var g=eB(l,10);if(g>65535)return mB;c.port=c.isSpecial()&&g===UB[c.scheme]?null:g,l=""}if(t)return;u=tV;continue}return mB}l+=i;break;case $B:if(c.scheme="file","/"==i||"\\"==i)u=QB;else{if(!r||"file"!=r.scheme){u=rV;continue}if(i==Rx)c.host=r.host,c.path=jx(r.path),c.query=r.query;else if("?"==i)c.host=r.host,c.path=jx(r.path),c.query="",u=iV;else{if("#"!=i){xB(oB(jx(n,d),""))||(c.host=r.host,c.path=jx(r.path),c.shortenPath()),u=rV;continue}c.host=r.host,c.path=jx(r.path),c.query=r.query,c.fragment="",u=oV}}break;case QB:if("/"==i||"\\"==i){u=eV;break}r&&"file"==r.scheme&&!xB(oB(jx(n,d),""))&&(LB(r.path[0],!0)?cB(c.path,r.path[0]):c.host=r.host),u=rV;continue;case eV:if(i==Rx||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&LB(l))u=rV;else if(""==l){if(c.host="",t)return;u=tV}else{if(a=c.parseHost(l))return a;if("localhost"==c.host&&(c.host=""),t)return;l="",u=tV}continue}l+=i;break;case tV:if(c.isSpecial()){if(u=rV,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=Rx&&(u=rV,"/"!=i))continue}else c.fragment="",u=oV;else c.query="",u=iV;break;case rV:if(i==Rx||"/"==i||"\\"==i&&c.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=hB(s=l))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||cB(c.path,"")):BB(l)?"/"==i||"\\"==i&&c.isSpecial()||cB(c.path,""):("file"==c.scheme&&!c.path.length&&LB(l)&&(c.host&&(c.host=""),l=nB(l,0)+":"),cB(c.path,l)),l="","file"==c.scheme&&(i==Rx||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)dB(c.path);"?"==i?(c.query="",u=iV):"#"==i&&(c.fragment="",u=oV)}else l+=MB(i,DB);break;case nV:"?"==i?(c.query="",u=iV):"#"==i?(c.fragment="",u=oV):i!=Rx&&(c.path[0]+=MB(i,NB));break;case iV:t||"#"!=i?i!=Rx&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":MB(i,NB)):(c.fragment="",u=oV);break;case oV:i!=Rx&&(c.fragment+=MB(i,kB))}d++}},parseHost:function(e){var t,r,n;if("["==nB(e,0)){if("]"!=nB(e,e.length-1))return vB;if(t=function(e){var t,r,n,i,o,a,s,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,f=function(){return nB(e,l)};if(":"==f()){if(":"!=nB(e,1))return;l+=2,d=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=r=0;r<4&&iB(IB,f());)t=16*t+eB(f(),16),l++,r++;if("."==f()){if(0==r)return;if(l-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;l++}if(!iB(EB,f()))return;for(;iB(EB,f());){if(o=eB(f(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==f()){if(l++,!f())return}else if(f())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(a=u-d,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[d+a-1],c[d+--a]=s;else if(8!=u)return;return c}(fB(e,1,-1)),!t)return vB;this.host=t}else if(this.isSpecial()){if(e=Gx(e),iB(AB,e))return vB;if(t=function(e){var t,r,n,i,o,a,s,c=lB(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(o=10,i.length>1&&"0"==nB(i,0)&&(o=iB(SB,i)?16:8,i=fB(i,8==o?1:2)),""===i)a=0;else{if(!iB(10==o?TB:8==o?bB:IB,i))return e;a=eB(i,o)}cB(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=rB(256,5-t))return null}else if(a>255)return null;for(s=sB(r),n=0;n<r.length;n++)s+=r[n]*rB(256,3-n);return s}(e),null===t)return vB;this.host=t}else{if(iB(RB,e))return vB;for(t="",r=Vx(e),n=0;n<r.length;n++)t+=MB(r[n],NB);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return xx(UB,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&LB(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,o=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=wB(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+oB(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw Qx(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new sV(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+wB(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(zx(e)+":",VB)},getUsername:function(){return this.username},setUsername:function(e){var t=Vx(zx(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=MB(t[r],PB)}},getPassword:function(){return this.password},setPassword:function(e){var t=Vx(zx(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=MB(t[r],PB)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?wB(e):wB(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,qB)},getHostname:function(){var e=this.host;return null===e?"":wB(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,JB)},getPort:function(){var e=this.port;return null===e?"":zx(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=zx(e))?this.port=null:this.parse(e,ZB))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+oB(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,tV))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=zx(e))?this.query=null:("?"==nB(e,0)&&(e=fB(e,1)),this.query="",this.parse(e,iV)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=zx(e))?("#"==nB(e,0)&&(e=fB(e,1)),this.fragment="",this.parse(e,oV)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var sV=function(e){var t=Lx(this,cV),r=Wx(arguments.length,1)>1?arguments[1]:void 0,n=Xx(t,new aV(e,!1,r));wx||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},cV=sV.prototype,uV=function(e,t){return{get:function(){return qx(this)[e]()},set:t&&function(e){return qx(this)[t](e)},configurable:!0,enumerable:!0}};if(wx&&Mx(cV,{href:uV("serialize","setHref"),origin:uV("getOrigin"),protocol:uV("getProtocol","setProtocol"),username:uV("getUsername","setUsername"),password:uV("getPassword","setPassword"),host:uV("getHost","setHost"),hostname:uV("getHostname","setHostname"),port:uV("getPort","setPort"),pathname:uV("getPathname","setPathname"),search:uV("getSearch","setSearch"),searchParams:uV("getSearchParams"),hash:uV("getHash","setHash")}),Ux(cV,"toJSON",(function(){return qx(this).serialize()}),{enumerable:!0}),Ux(cV,"toString",(function(){return qx(this).serialize()}),{enumerable:!0}),$x){var dV=$x.createObjectURL,lV=$x.revokeObjectURL;dV&&Ux(sV,"createObjectURL",Dx(dV,$x)),lV&&Ux(sV,"revokeObjectURL",Dx(lV,$x))}Hx(sV,"URL"),Ox({global:!0,forced:!Nx,sham:!wx},{URL:sV});var fV,hV=function(){function e(e){this._sharedAudioContext=new AudioContext,this._audioDestination=this._sharedAudioContext.createMediaStreamDestination(),this._localGainNode=this._sharedAudioContext.createGain(),this._bufferGainNode=this._sharedAudioContext.createGain(),this.mixingMap=new Map,this.resourcesCache=new Map,this.volumeConfig=new Map,this.cachedBuffer=[],this._context=e,this._localGainNode.gain.value=1}return e.prototype.mixMediaStream=function(e){this._localSource&&this._localSource.disconnect(this._localGainNode),this._localSource=this._sharedAudioContext.createMediaStreamSource(e),this._localSource.connect(this._localGainNode).connect(this._audioDestination)},e.prototype.startAudioMixing=function(e,t,r){return S(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,d,l,f,h,p,_=this;return b(this,(function(v){switch(v.label){case 0:if(n=r.playCount,fO(i=r.type,"mixingType",KU.exports.values(C)),!(o=this._context.getLocalAudioTrack()))return[2];if((a=fU(o.getTrack()))&&this.mixMediaStream(a),(s=this.mixingMap.get(e))&&s.audioNode){s.audioNode.pause(),this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_STOPPED,error:rI.AUDIO_MIXING_ERROR_OK});try{s.gainNode.disconnect(this._audioDestination),s.audioSource.disconnect(s.gainNode)}catch(e){}}return(u=this.resourcesCache.get(e))&&u.filePath===t?(c=u.getAudioNode(),[3,3]):[3,1];case 1:return[4,fetch(t,{mode:"cors",credentials:"include"}).then((function(t){if(t.ok)return t.arrayBuffer();throw _._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_FAILED,error:rI.AUDIO_MIXING_ERROR_START_FAILED}),new iI(tI.LOAD_RESOURCES_FAILED,t.statusText)}))];case 2:d=v.sent(),c=new Audio(URL.createObjectURL(new Blob([d]))),v.label=3;case 3:return c.crossOrigin="anonymous",n<=0?c.loop=!0:n>0&&(l=n,c.onended=function(){--l>0?c.play():_._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_FINISHED,error:rI.AUDIO_MIXING_ERROR_OK})}),[4,c.play()];case 4:if(v.sent(),f=this._sharedAudioContext.createMediaElementSource(c),h=this._sharedAudioContext.createGain(),p=this.volumeConfig.get(e),h.gain.value=p?p/100:1,f.connect(h).connect(this._audioDestination),this.mixingMap.set(e,{audioSource:f,audioNode:c,gainNode:h,type:"file"}),i===C.PUBLISH)try{h.disconnect(this._sharedAudioContext.destination)}catch(e){}else h.connect(this._sharedAudioContext.destination);return this._context.updateLocalAudioTrack(this._audioDestination.stream.getAudioTracks()[0],r.type),this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_PLAYING,error:rI.AUDIO_MIXING_ERROR_OK}),[2]}}))}))},e.prototype.stopAudioMixing=function(e){var t=this.mixingMap.get(e);t&&"file"===t.type&&(this.mixingMap.delete(e),t.audioNode.pause(),t.audioSource.disconnect(t.gainNode),t.gainNode.disconnect(this._audioDestination),this._context.updateLocalAudioTrack()),this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_STOPPED,error:rI.AUDIO_MIXING_ERROR_OK})},e.prototype.pauseAudioMixing=function(e){var t=this.mixingMap.get(e);t&&(this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_PAUSED,error:rI.AUDIO_MIXING_ERROR_OK}),t.audioNode.pause())},e.prototype.resumeAudioMixing=function(e){var t=this.mixingMap.get(e);t&&(this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_PLAYING,error:rI.AUDIO_MIXING_ERROR_OK}),t.audioNode.play())},e.prototype.preloadAudioMixing=function(e,t){return S(this,void 0,void 0,(function(){var r,n=this;return b(this,(function(i){switch(i.label){case 0:return this.stopAudioMixing(e),[4,fetch(t,{mode:"cors",credentials:"include"}).then((function(t){if(t.ok)return t.arrayBuffer();throw n._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_FAILED,error:rI.AUDIO_MIXING_ERROR_PRELOAD_FAILED}),new iI(tI.LOAD_RESOURCES_FAILED,t.statusText)})).catch((function(e){throw new iI(tI.LOAD_RESOURCES_FAILED,"Load resources failed",e)}))];case 1:return r=i.sent(),this.resourcesCache.set(e,{getAudioNode:function(){return new Audio(URL.createObjectURL(new Blob([r])))},filePath:t}),[2]}}))}))},e.prototype.unloadAudioMixing=function(e){this.resourcesCache.has(e)&&this.resourcesCache.delete(e)},e.prototype.getAudioMixingVolume=function(e){var t=this.mixingMap.get(e);return t?100*t.gainNode.gain.value:0},e.prototype.setAudioMixingVolume=function(e,t){t<0?t=0:t>400&&(t=400),this.volumeConfig.set(e,t);var r=this.mixingMap.get(e);r&&(r.gainNode.gain.value=Number(t)/100)},e.prototype.getAudioMixingDuration=function(e){var t=this.mixingMap.get(e),r=this.mixingMap.get(e);return t||r?t?1e3*t.audioNode.duration:r?1e3*r.audioNode.duration:0:0},e.prototype.getAudioMixingCurrentPosition=function(e){var t=this.mixingMap.get(e);return t?1e3*t.audioNode.currentTime:0},e.prototype.setAudioMixingPosition=function(e,t){var r=this.mixingMap.get(e);r&&(r.audioNode.currentTime=t/1e3,r.audioNode.play())},e.prototype.enableAudioMixingBuffer=function(e){fO(e,"type",KU.exports.values(C));var t=this._context.getLocalAudioTrack();if(t){var r=fU(t.getTrack());if(r&&this.mixMediaStream(r),e===C.PUBLISH)try{this._bufferGainNode.disconnect(this._sharedAudioContext.destination)}catch(e){}else this._bufferGainNode.connect(this._sharedAudioContext.destination);this._context.updateLocalAudioTrack(this._audioDestination.stream.getAudioTracks()[0],e),this._bufferGainNode.connect(this._audioDestination)}},e.prototype.disableAudioMixingBuffer=function(){if(this.cachedBuffer=[],this._audioBufferSource){try{this._audioBufferSource.disconnect(this._bufferGainNode),this._bufferGainNode.disconnect(this._audioDestination),this._bufferGainNode.disconnect(this._sharedAudioContext.destination)}catch(e){}finally{this._audioBufferSource=void 0}this._context.updateLocalAudioTrack()}},e.prototype.pushAudioMixingBuffer=function(e){var t=this;this._audioBufferSource&&this.cachedBuffer.push(e),this._audioBufferSource=this._sharedAudioContext.createBufferSource(),this._audioBufferSource.buffer=e,this._audioBufferSource.connect(this._bufferGainNode),this._audioBufferSource.start(),this._audioBufferSource.onended=function(){var e;if(null===(e=t._audioBufferSource)||void 0===e||e.disconnect(t._bufferGainNode),t._audioBufferSource=void 0,t.cachedBuffer.length){var r=t.cachedBuffer.shift();r&&t.pushAudioMixingBuffer(r)}}},e.prototype.stopAll=function(){var e=this;if(this._localSource)try{this._localSource.disconnect(this._localGainNode),delete this._localSource}catch(e){}this.mixingMap.forEach((function(t,r){e.stopAudioMixing(r)}))},Object.defineProperty(e.prototype,"mixTrack",{get:function(){return this._audioDestination.stream.getAudioTracks()[0]},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){var e=this._sharedAudioContext;"closed"!==e.state&&"function"==typeof e.close&&e.close(),this.cachedBuffer=[],this.mixingMap.clear(),this.resourcesCache.clear(),this.volumeConfig.clear()},E([sP("id","filePath","options")],e.prototype,"startAudioMixing",null),E([sP("id")],e.prototype,"stopAudioMixing",null),E([sP("id")],e.prototype,"pauseAudioMixing",null),E([sP("id")],e.prototype,"resumeAudioMixing",null),E([sP("id")],e.prototype,"preloadAudioMixing",null),E([sP("id")],e.prototype,"unloadAudioMixing",null),E([sP("id")],e.prototype,"getAudioMixingVolume",null),E([sP("id","volume")],e.prototype,"setAudioMixingVolume",null),E([sP("id")],e.prototype,"getAudioMixingDuration",null),E([sP("id")],e.prototype,"getAudioMixingCurrentPosition",null),E([sP("id","position")],e.prototype,"setAudioMixingPosition",null),E([sP("type")],e.prototype,"enableAudioMixingBuffer",null),E([sP()],e.prototype,"disableAudioMixingBuffer",null),E([sP("buffer")],e.prototype,"pushAudioMixingBuffer",null),e}();!function(e){e.NORMAL_USER="normalUser",e.SILENT_USER="silentUser"}(fV||(fV={}));var pV=new PO("Engine",0),_V=function(e){function t(t){var r=e.call(this)||this;return r._visibility=!0,r._remoteVideoPlayer=new Map,r._remoteScreenPlayer=new Map,r._remoteAudioPlayer=new Map,r._videoStreamConstraints={},r._audioStreamConstraints={},r._videoStreamEncodeConfig=[{maxKbps:500}],r._screenStreamEncodeConfig=[{maxKbps:500}],r._pauseAllSubscribeState={audio:!1,video:!1},r._mirrorType=m.MIRROR_TYPE_RENDER,r._updateMixAudioTrack=function(e,t){return void 0===t&&(t=C.PLAYOUT_AND_PUBLISH),S(r,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("_updateMixAudioTrack()"),this._localAudioTrack?(e?(this._localAudioTrack.mixType=t,this._localAudioTrack.mixedAudioTrack=e):(delete this._localAudioTrack.mixType,delete this._localAudioTrack.mixedAudioTrack),(null===(r=this._room)||void 0===r?void 0:r.hasPublished)?[4,this._updatePublish()]:[3,2]):(e&&(this._tempMixingAudioTrack={track:e,type:t}),[2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},r._onAudioMixingMessage=function(e){r.safeEmit(N.onAudioMixingStateChanged,e)},r._appId=t,r._pubLock=new dM("pubLock"),r._addDeviceEventHandler(),r._audioMixingManager=new hV({getLocalAudioTrack:function(){return r._localAudioTrack},updateLocalAudioTrack:r._updateMixAudioTrack,emitMessage:r._onAudioMixingMessage}),window["__rtc_engine__".concat(Math.floor(100*Math.random()+1))]=r,r._trackSourceType={video:n.VIDEO_SOURCE_TYPE_INTERNAL,screenVideo:n.VIDEO_SOURCE_TYPE_INTERNAL,audio:i.AUDIO_SOURCE_TYPE_INTERNAL,screenAudio:i.AUDIO_SOURCE_TYPE_INTERNAL},r}return r(t,e),Object.defineProperty(t.prototype,"appId",{get:function(){return this._appId},enumerable:!1,configurable:!0}),t.prototype.updateToken=function(e){var t;pV.print("updateToken()","token: %s",e),lO(e,"token"),null===(t=this._room)||void 0===t||t.updateToken(e)},t.prototype.switchCamera=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){switch(o.label){case 0:return pV.print("switchCamera()","deviceId: %s",e),lO(e,"deviceId"),e===(null===(r=null===(t=this._videoStreamConstraints)||void 0===t?void 0:t.deviceId)||void 0===r?void 0:r.exact)?[2]:((n=this._videoStreamConstraints).deviceId={exact:e},this._videoStreamConstraints=n,[4,RU(n)]);case 1:return i=o.sent(),this._initLocalTrackEvents(i),this._localVideoTrack&&this._localVideoTrack.close(),this._localVideoTrack=i,this._videoPlayer&&(this._videoPlayer.stop(),this._videoPlayer.playVideo(i),this._videoPlayer.mirror(!!this._mirrorType)),this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,3]:[2];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},t.prototype.switchMicrophone=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){switch(o.label){case 0:return pV.print("switchMicrophone()","deviceId: %s",e),lO(e,"deviceId"),e===(null===(r=null===(t=this._videoStreamConstraints)||void 0===t?void 0:t.deviceId)||void 0===r?void 0:r.exact)?[2]:((n=this._audioStreamConstraints).deviceId={exact:e},this._audioStreamConstraints=n,[4,CU(n)]);case 1:return i=o.sent(),this._initLocalTrackEvents(i),this._localAudioTrack&&this._localAudioTrack.close(),this._localAudioTrack=i,this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,3]:[2];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},t.prototype._addDeviceEventHandler=function(){oU.on(N.onMediaDeviceStateChanged,this._onDeviceStateChange.bind(this))},t.prototype._addHandlerEventHandler=function(){var e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T=this;null===(e=this._room)||void 0===e||e.on(eP.ON_ADD_STREAM,this._onAddStream.bind(this)),null===(t=this._room)||void 0===t||t.on(eP.ON_REMOVE_STREAM,this._onRemoveStream.bind(this)),null===(r=this._room)||void 0===r||r.on(eP.USER_CONNECTION,this._onUserConnection.bind(this)),null===(n=this._room)||void 0===n||n.on(eP.USER_DISCONNECTION,this._onUserDisconnection.bind(this)),null===(i=this._room)||void 0===i||i.on(eP.ON_CUSTOM_MESSAGE,this._onCustomMessage.bind(this)),null===(o=this._room)||void 0===o||o.on(eP.USER_MESSAGE_RECEIVED,this._onUserMessageReceived.bind(this)),null===(a=this._room)||void 0===a||a.on(eP.USER_BINARY_MESSAGE_RECEIVED,this._onUserBinaryMessageReceived.bind(this)),null===(s=this._room)||void 0===s||s.on(eP.POST_PROCESSING_MESSAGE,this._onLiveTranscodingResult.bind(this)),null===(c=this._room)||void 0===c||c.on(tP.ON_CONNECTION_STATE_CHANGE,this._onConnectionStateChange.bind(this)),null===(u=this._room)||void 0===u||u.on(NU.RESUBSCRIBE,this._onResubscribe.bind(this)),null===(d=this._room)||void 0===d||d.on(NU.SUBSCRIBE_PUSH_TRACK,this._onSubscribePushTrack.bind(this)),null===(l=this._room)||void 0===l||l.on(NU.REMOVE_PUSH_TRACK,this._onRemovePushTrack.bind(this)),null===(f=this._room)||void 0===f||f.on(NU.VIDEO_FIRST_FRAME,this._onVideoFirstFrameDecoded.bind(this)),null===(h=this._room)||void 0===h||h.on(NU.ON_PUBLISH_RESULT,(function(e){var t;(null===(t=T._room)||void 0===t?void 0:t._roomConfig.isAutoPublish)&&T.safeEmit(N.onAutoPublishResult,e)})),null===(p=this._room)||void 0===p||p.on("onRemoteStreamStats",(function(e){T.safeEmit(N.onRemoteStreamStats,e)})),null===(_=this._room)||void 0===_||_.on("onLocalStreamStats",(function(e){T.safeEmit(N.onLocalStreamStats,e)})),null===(v=this._room)||void 0===v||v.on(NU.ON_USER_MUTE_AUDIO,this._onUserMuteAudio.bind(this)),null===(m=this._room)||void 0===m||m.on(NU.ON_USER_MUTE_VIDEO,this._onUserMuteVideo.bind(this)),null===(g=this._room)||void 0===g||g.on(NU.ON_USER_START_AUDIO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStartAudioCapture,{userId:t})})),null===(y=this._room)||void 0===y||y.on(NU.ON_USER_STOP_AUDIO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStopAudioCapture,{userId:t})})),null===(E=this._room)||void 0===E||E.on(NU.ON_USER_START_VIDEO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStartVideoCapture,{userId:t})})),null===(S=this._room)||void 0===S||S.on(NU.ON_USER_STOP_VIDEO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStopVideoCapture,{userId:t})})),null===(b=this._room)||void 0===b||b.on(NU.ON_SEI_MESSAGED_RECEIVED,(function(e){T.safeEmit(N.onSEIMessageReceived,e)}))},t.prototype.safeEmit=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return yO(t)&&cP(t,JSON.stringify(cO(r))),e.prototype.safeEmit.apply(this,A([t],I(r),!1))},t.prototype._removeHandlerEventHandler=function(){var e;null===(e=this._room)||void 0===e||e.removeAllListeners()},t.prototype.joinRoom=function(e,t,r,n){return void 0===n&&(n={isAutoPublish:!1,isAutoSubscribeAudio:!1,isAutoSubscribeVideo:!1}),S(this,void 0,void 0,(function(){var i;return b(this,(function(o){switch(o.label){case 0:if(pV.print("joinRoom()","token: %o roomId: %o, userInfo: %o, roomConfig: %o",e,t,r,n),_O(e)||lO(e,"token"),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new iI(tI.INVALID_PARAMS,"The RoomId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(t),vO(r),function(e){hO(e,"roomConfig"),uO(e.isAutoPublish,"roomConfig.isAutoPublish"),uO(e.isAutoSubscribeAudio,"roomConfig.isAutoSubscribeAudio"),uO(e.isAutoSubscribeVideo,"roomConfig.isAutoSubscribeVideo")}(n),!this._room||this._room.connectionState===hM.DISCONNECTED)return[3,1];throw new iI(tI.REPEAT_JOIN,"Already joined");case 1:return this._room=new xU(n),this._addHandlerEventHandler(),i=this._liveTranscodeConfig&&yw("started",this._liveTranscodeConfig),[4,this._room.join(this._appId,t,e,y(y({},r),{businessId:this._businessId,role:this._visibility?fV.NORMAL_USER:fV.SILENT_USER}),i)];case 2:return o.sent(),this._roomConfig=n,(this._localAudioTrack||this._localVideoTrack)&&n.isAutoPublish?[4,this._updatePublish()]:[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t.prototype.leaveRoom=function(){var e;pV.print("leaveRoom()"),this._removeHandlerEventHandler(),null===(e=this._room)||void 0===e||e.leave().catch,this._liveTranscodeConfig&&this.stopLiveTranscoding(),this._room=void 0,this._remoteAudioPlayer.forEach((function(e){return e.stop()})),this._remoteAudioPlayer=new Map,this._remoteScreenPlayer.forEach((function(e){return e.stop()})),this._remoteScreenPlayer=new Map,this._remoteVideoPlayer.forEach((function(e){return e.stop()})),this._remoteVideoPlayer=new Map,this._roomConfig=void 0},t.prototype.destroy=function(){var e,t,r;pV.print("destroy()"),this.removeAllListeners(),this._removeHandlerEventHandler(),null===(e=this._room)||void 0===e||e.destroy(),this._room=void 0,null===(t=this._videoPlayer)||void 0===t||t.destroy(),null===(r=this._audioPlayer)||void 0===r||r.destroy(),this._videoPlayer=void 0,this._audioPlayer=void 0,this._screenPlayer=void 0,this._videoStreamConstraints={},this._audioStreamConstraints={},this._videoStreamEncodeConfig=[{maxKbps:500}],this._screenStreamEncodeConfig=[{maxKbps:500}],this._pauseAllSubscribeState={audio:!1,video:!1},clearInterval(this._audioVolumeIndicationTimer),this._audioVolumeIndicationTimer=void 0,this._localAudioTrack&&(this._localAudioTrack.close(),this._localAudioTrack=void 0),this._localVideoTrack&&(this._localVideoTrack.close(),this._localVideoTrack=void 0),this._localScreenAudioTrack&&(this._localScreenAudioTrack.close(),this._localScreenAudioTrack=void 0),this._localScreenVideoTrack&&(this._localScreenVideoTrack.close(),this._localScreenVideoTrack=void 0),this._remoteAudioPlayer.forEach((function(e){return e.stop()})),this._remoteAudioPlayer=new Map,this._remoteScreenPlayer.forEach((function(e){return e.stop()})),this._remoteScreenPlayer=new Map,this._remoteVideoPlayer.forEach((function(e){return e.stop()})),this._remoteVideoPlayer=new Map,this._roomConfig=void 0,this._audioMixingManager.destroy()},t.prototype.publish=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:if(pV.print("publish()"),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.PUBLISH_BEFORE_JOIN,"join first");return[4,this._updatePublish()];case 1:return e.sent(),[2]}}))}))},t.prototype.unpublish=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:if(pV.print("unpublish()"),!this._room)throw new iI(tI.UNPUBLISH_BEFORE_JOIN,"join first");return[4,this._pubLock.lock()];case 1:e=r.sent(),r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.unpublish()];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof iI?t:new iI(tI.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype.subscribeUserStream=function(e,t,r,n){var i,o,a,s;return void 0===r&&(r=h.STREAM_INDEX_MAIN),void 0===n&&(n={videoIndex:0}),S(this,void 0,void 0,(function(){var u,d,l,f,_,v;return b(this,(function(m){switch(m.label){case 0:if(pV.print("subscribeStream()","userId: %o, mediaType: %o, streamType: %o, configure: %o",e,t,r,n),lO(e,"userId"),fO(t,"mediaType",[p.AUDIO_AND_VIDEO,p.AUDIO_ONLY,p.VIDEO_ONLY,p.NONE]),fO(r,"streamType",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),dO(n.videoIndex,"config.videoIndex",0,2),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.SUBSCRIBE_BEFORE_JOIN,"join first");if(u=this._room.remoteStreams.get(e),l=r===h.STREAM_INDEX_SCREEN,!(d=l?null==u?void 0:u.find((function(e){return e.isScreen})):null==u?void 0:u.find((function(e){return!e.isScreen}))))throw new iI(tI.STREAM_NOT_EXIST,"stream not exist");m.label=1;case 1:return m.trys.push([1,3,,4]),f=t,this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video?t=p.NONE:this._pauseAllSubscribeState.audio&&!this._pauseAllSubscribeState.video?t===p.AUDIO_AND_VIDEO?t=p.VIDEO_ONLY:t===p.AUDIO_ONLY&&(t=p.NONE):!this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video&&(t===p.AUDIO_AND_VIDEO?t=p.AUDIO_ONLY:t===p.VIDEO_ONLY&&(t=p.NONE)),t!==f&&pV.print("subscribeUserStream","due to pauseAllState change sub mediaType from ".concat(f," to ").concat(t)),[4,this._room.subscribe(d,t,n)];case 2:return m.sent(),t!==p.AUDIO_AND_VIDEO&&t!==p.AUDIO_ONLY||this._updateAudioPlayerState(d),t!==p.AUDIO_AND_VIDEO&&t!==p.VIDEO_ONLY||this._updateVideoPlayerState(d),((null===(i=this._roomConfig)||void 0===i?void 0:i.isAutoSubscribeAudio)||(null===(o=this._roomConfig)||void 0===o?void 0:o.isAutoSubscribeVideo))&&(d.audioTrack||d.videoTrack)&&(v={userId:e,isScreen:l,state:c.SUBSCRIBE_SUCC},this.safeEmit(N.onAutoSubscribeResult,v)),[3,4];case 3:throw _=m.sent(),((null===(a=this._roomConfig)||void 0===a?void 0:a.isAutoSubscribeAudio)||(null===(s=this._roomConfig)||void 0===s?void 0:s.isAutoSubscribeVideo))&&(v={userId:e,isScreen:l,state:c.SUBSCRIBE_FAIL},this.safeEmit(N.onAutoSubscribeResult,v)),_;case 4:return[2]}}))}))},t.prototype.unSubscribe=function(e,t){return S(this,void 0,void 0,(function(){var r,n;return b(this,(function(i){switch(i.label){case 0:if(pV.print("unSubscribe()","userId: %s, isScreen: %o",e,t),lO(e,"userId"),uO(t,"isScreen"),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.SUBSCRIBE_BEFORE_JOIN,"join first");if(r=this._room.remoteStreams.get(e),!(n=t?null==r?void 0:r.find((function(e){return e.isScreen})):null==r?void 0:r.find((function(e){return!e.isScreen}))))throw new iI(tI.STREAM_NOT_EXIST,"stream not exist");return[4,this._room.unsubscribe(n)];case 1:return i.sent(),this._updateAudioPlayerState(n),this._updateVideoPlayerState(n),[2]}}))}))},t.prototype.startVideoCapture=function(e){return S(this,void 0,void 0,(function(){var t,r,n;return b(this,(function(i){switch(i.label){case 0:if(pV.print("startVideoCapture()","deviceId: %s",e),_O(e)||lO(e,"deviceId"),this._localVideoTrack)throw new iI(tI.REPEAT_CAPTURE,"Has already capture");return t=this._videoStreamConstraints,e&&(t.deviceId={exact:e},this._videoStreamConstraints=t),[4,RU(t)];case 1:return r=i.sent(),this._initLocalTrackEvents(r),this._localVideoTrack=r,this._videoPlayer&&this._videoPlayer.playVideo(r),this._room?(n=this._room._roomConfig.isAutoPublish,this._room.hasPublished||n?[4,this._updatePublish()]:[3,3]):[2];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},t.prototype.stopVideoCapture=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:if(pV.print("stopVideoCapture()"),this._trackSourceType.video===n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as internal first");return this._videoPlayer&&this._videoPlayer.stop(),null===(e=this._localVideoTrack)||void 0===e||e.close(),this._localVideoTrack=void 0,this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,2]:[2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.startAudioCapture=function(e){return S(this,void 0,void 0,(function(){var t,r,n;return b(this,(function(i){switch(i.label){case 0:if(pV.print("startAudioCapture()","deviceId: $o",e),_O(e)||lO(e,"deviceId"),this._localAudioTrack)throw new iI(tI.REPEAT_CAPTURE,"Has already capture");return t=this._audioStreamConstraints,e&&(t.deviceId={exact:e},this._audioStreamConstraints=t),[4,CU(t)];case 1:return r=i.sent(),this._initLocalTrackEvents(r),this._localAudioTrack=r,this._tempMixingAudioTrack&&(this._localAudioTrack.mixType=this._tempMixingAudioTrack.type,this._localAudioTrack.mixedAudioTrack=this._tempMixingAudioTrack.track,delete this._tempMixingAudioTrack),this._room?(n=this._room._roomConfig.isAutoPublish,this._room.hasPublished||n?[4,this._updatePublish()]:[3,3]):[2];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},t.prototype.stopAudioCapture=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:if(pV.print("stopAudioCapture()"),null===(e=this._localAudioTrack)||void 0===e||e.close(),this._localAudioTrack=void 0,this._audioMixingManager.stopAll(),this._trackSourceType.audio===i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as internal first");return this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,2]:[2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.getAudioMixingManager=function(){return pV.print("getAudioMixingManager()"),this._audioMixingManager},t.prototype.startScreenCapture=function(e){var t,r;return void 0===e&&(e={}),S(this,void 0,void 0,(function(){var o,a,s,c;return b(this,(function(u){switch(u.label){case 0:if(pV.print("startScreenCapture()","config: %o",e),null===(t=this._localScreenVideoTrack)||void 0===t||t.close(),this._localScreenVideoTrack=void 0,o=e.enableAudio,a=void 0!==o&&o,this._trackSourceType.screenVideo===n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as internal first");if(this._trackSourceType.screenAudio===i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as internal first");return[4,OU(a)];case 1:return s=u.sent(),this._localScreenVideoTrack=new bU(s.getVideoTracks()[0],nO()),(c=s.getAudioTracks()).length&&(this._localScreenAudioTrack=new TU(c[0],nO()),this._initLocalTrackEvents(this._localScreenAudioTrack)),null===(r=this._screenPlayer)||void 0===r||r.playVideo(this._localScreenVideoTrack),this._initLocalTrackEvents(this._localScreenVideoTrack),[2]}}))}))},t.prototype.stopScreenCapture=function(){var e,t,r;return S(this,void 0,void 0,(function(){return b(this,(function(n){return pV.print("stopScreenCapture()"),null===(e=this._screenPlayer)||void 0===e||e.stop(),null===(t=this._localScreenVideoTrack)||void 0===t||t.close(),this._localScreenVideoTrack=void 0,null===(r=this._localScreenAudioTrack)||void 0===r||r.close(),this._localScreenAudioTrack=void 0,[2]}))}))},t.prototype.publishScreen=function(){return S(this,void 0,void 0,(function(){var e;return b(this,(function(t){switch(t.label){case 0:if(pV.print("publishScreen()"),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.PUBLISH_BEFORE_JOIN,"join first");if(!this._visibility)throw new iI(tI.NO_PUBLISH_PERMISSION,"no publish permission");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._room.publishScreen(this._screenStreamEncodeConfig,this._localScreenVideoTrack,this._localScreenAudioTrack)];case 2:return t.sent(),[3,4];case 3:throw(e=t.sent())instanceof iI?e:new iI(tI.UNEXPECTED_ERROR,"unexpected error",e);case 4:return[2]}}))}))},t.prototype.unpublishScreen=function(){return S(this,void 0,void 0,(function(){var e;return b(this,(function(t){switch(t.label){case 0:if(pV.print("unpublishScreen()"),!this._room)throw new iI(tI.UNPUBLISH_BEFORE_JOIN,"join first");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._room.unpublishScreen()];case 2:return t.sent(),[3,4];case 3:throw(e=t.sent())instanceof iI?e:new iI(tI.UNEXPECTED_ERROR,"unexpected error",e);case 4:return[2]}}))}))},t.prototype.setLocalVideoPlayer=function(e,t){var r,n;pV.print("setLocalVideoPlayer()","streamIndex: %o, videoPlayerOption: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),t&&t.renderDom?(mO(t),e==h.STREAM_INDEX_MAIN?(this._videoPlayer=new WU(t),this._initPlayerEvents(this._videoPlayer),this._localVideoTrack&&this._videoPlayer.playVideo(this._localVideoTrack),this._videoPlayer.mirror(!!this._mirrorType)):(this._screenPlayer=new WU(y(y({},t),{isScreen:!0})),this._initPlayerEvents(this._screenPlayer),this._localScreenVideoTrack&&this._screenPlayer.playVideo(this._localScreenVideoTrack))):e==h.STREAM_INDEX_MAIN?(null===(r=this._videoPlayer)||void 0===r||r.destroy(),delete this._videoPlayer):(null===(n=this._screenPlayer)||void 0===n||n.destroy(),delete this._screenPlayer)},t.prototype.startLiveTranscoding=function(e){var t;return S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:pV.print("startLiveTranscoding()","transcode: %o",e),lO(e.url,"liveTranscode.url"),this._liveTranscodeConfig=e,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this._room)||void 0===t?void 0:t.controlMessage(yw("started",this._liveTranscodeConfig))];case 2:return n.sent(),[3,4];case 3:throw(r=n.sent())instanceof iI?r:new iI(tI.UNEXPECTED_ERROR,"unexpected error",r);case 4:return[2]}}))}))},t.prototype.updateLiveTranscoding=function(e){var t;return S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:if(pV.print("updateLiveTranscoding()","transcode: %o",e),!this._liveTranscodeConfig)return[2];this._liveTranscodeConfig=KU.exports.assignIn(this._liveTranscodeConfig,e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this._room)||void 0===t?void 0:t.controlMessage(yw("layoutChanged",this._liveTranscodeConfig))];case 2:return n.sent(),[3,4];case 3:throw(r=n.sent())instanceof iI?r:new iI(tI.UNEXPECTED_ERROR,"unexpected error",r);case 4:return[2]}}))}))},t.prototype.stopLiveTranscoding=function(){var e;return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:if(pV.print("stopLiveTranscoding()"),!this._liveTranscodeConfig)return[2];delete this._liveTranscodeConfig,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null===(e=this._room)||void 0===e?void 0:e.controlMessage({action:"stopped",type:"transcode"})];case 2:return r.sent(),[3,4];case 3:throw(t=r.sent())instanceof iI?t:new iI(tI.UNEXPECTED_ERROR,"unexpected error",t);case 4:return[2]}}))}))},t.prototype.setBusinessId=function(e){if(pV.print("setBusinessId()","businessId: %s",e),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new iI(tI.INVALID_PARAMS,"The businessId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(e),this._room)throw new iI(tI.ALREADY_IN_ROOM,"You should invoke setBusinessId before joinRoom");nP.setStats({rtc_business_id:e}),this._businessId=e},t.prototype.setUserVisibility=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:if(pV.print("setUserVisibility()","enable: %o",e),e=!!e,this._visibility===e)return[2];if(!this._room)return this._visibility=e,[2];if(this._room.connectionState!==hM.CONNECTED)throw new iI(tI.NOT_CONNECTED_YET,"server not connected");return!e?[4,this._room.unpublish()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this._room.updateUserAttributes({role:e?fV.NORMAL_USER:fV.SILENT_USER})];case 3:return t.sent(),this._visibility=e,[2]}}))}))},t.prototype._initPlayerEvents=function(e){var t=this;e.on("playback_event",(function(r){var n,i;switch(r.eventName){case"timeupdate":return;case"loadeddata":if("audio"===r.type)t.safeEmit(N.onAudioFirstFrameDecoded,{userId:e.userId}),aP.firstRemoteAudioRender("",r.userId);else{var o={userId:e.userId,height:(null===(n=e.domElement)||void 0===n?void 0:n.videoHeight)||0,width:(null===(i=e.domElement)||void 0===i?void 0:i.videoWidth)||0};t.safeEmit(N.onVideoFirstFrameDecoded,o),t.safeEmit(N.onVideoFirstFrameRendered,o),aP.firstRemoteVideoRender("",r.userId)}break;case"autoplay-error":return void t.safeEmit(N.onAutoplayFailed,r)}t.safeEmit(N.onPlayerEvent,r)}))},t.prototype._initLocalTrackEvents=function(e){var t=this;e.on("track-ended",(function(e){var r=!1;e!==t._localScreenAudioTrack&&e!==t._localScreenVideoTrack||(r=!0),t.safeEmit(N.onTrackEnded,{kind:e.getTrack().kind,isScreen:r})}))},t.prototype.setRemoteVideoPlayer=function(e,t){var r,n,i,o,a,s;if(pV.print("setRemoteVideoPlayer()","streamIndex: %o, videoPlayerOption: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),t.renderDom){mO(t);var c=t.userId;if(e==h.STREAM_INDEX_MAIN){var u=new WU(t);this._initPlayerEvents(u),this._remoteVideoPlayer.set(c,u),(d=null===(o=null===(i=this._room)||void 0===i?void 0:i.remoteStreams.get(c))||void 0===o?void 0:o.find((function(e){return!e.isScreen})))&&this._updateVideoPlayerState(d)}else{var d;u=new WU(y(y({},t),{isScreen:!0}));this._remoteScreenPlayer.set(c,u),this._initPlayerEvents(u),(d=null===(s=null===(a=this._room)||void 0===a?void 0:a.remoteStreams.get(c))||void 0===s?void 0:s.find((function(e){return e.isScreen})))&&this._updateVideoPlayerState(d)}}else e==h.STREAM_INDEX_MAIN?(null===(r=this._videoPlayer)||void 0===r||r.destroy(),delete this._videoPlayer):(null===(n=this._screenPlayer)||void 0===n||n.destroy(),delete this._screenPlayer)},t.prototype.setLocalVideoMirrorType=function(e){pV.print("setLocalVideoMirrorType()","mirrorType: %o",e),fO(e,"mirrorType",[m.MIRROR_TYPE_NONE,m.MIRROR_TYPE_RENDER]),this._mirrorType=e,this._videoPlayer&&this._videoPlayer.mirror(!!e)},t.prototype.setAudioPlaybackDevice=function(e){var t;return S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("setAudioPlaybackDevice()","deviceId: %s",e),lO(e,"deviceId"),void 0===HTMLAudioElement.prototype.setSinkId?(pV.print("setAudioPlaybackDevice failed","setSinkId not supported by current browser"),[2]):[4,oU.getDeviceById(e)];case 1:if(!(r=n.sent()))throw new iI(tI.INVALID_DEVICE_ID,"audio playback device id ".concat(e," is invalid"));return this._remoteAudioPlayer.forEach((function(t){t.setPlaybackDevice(e)})),null===(t=this._audioPlayer)||void 0===t||t.setPlaybackDevice(e),this._audioPlaybackDeviceId=e,r&&this.safeEmit(N.onAudioPlaybackDeviceChanged,r),aP.rtcAudioDevice(gD.PLAYOUT_DEVICE_SWITCH,e,0),[2]}}))}))},t.prototype.play=function(e){return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){if(pV.print("play()","userId: %s",e),lO(e,"userId"),(t=this._remoteAudioPlayer.get(e))||(t=this._audioPlayer),!t)throw new iI(tI.INVALID_PARAMS,"Player not found");return[2,t.manuallyPlay()]}))}))},t.prototype.muteLocalAudio=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(pV.print("muteLocalAudio()","muteState: %o",e),fO(e,"muteState",[s.MUTE_STATE_OFF,s.MUTE_STATE_ON]),!this._room)throw new iI(tI.UNPUBLISH_BEFORE_JOIN,"join first");return[2,this._room.muteLocalTrack("audio",e)]}))}))},t.prototype.muteLocalVideo=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(pV.print("muteLocalVideo()","muteState: %o",e),fO(e,"muteState",[s.MUTE_STATE_OFF,s.MUTE_STATE_ON]),!this._room)throw new iI(tI.UNPUBLISH_BEFORE_JOIN,"join first");return[2,this._room.muteLocalTrack("video",e)]}))}))},t.prototype.pauseAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){return pV.print("pauseAllSubscribedStream()","mediaType: %o",e),fO(e,"mediaType",[l.RTC_PAUSE_RESUME_CONTROL_AUDIO,l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO,l.RTC_PAUSE_RESUME_CONTROL_VIDEO]),this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video?[2,Promise.resolve()]:(e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO?this._pauseAllSubscribeState.audio=!0:e===l.RTC_PAUSE_RESUME_CONTROL_VIDEO?this._pauseAllSubscribeState.video=!0:e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO&&(this._pauseAllSubscribeState.audio=!0,this._pauseAllSubscribeState.video=!0),this._room?[2,this._room.pauseAllSubscribedStream(e).then((function(){}))]:[2,Promise.resolve()])}))}))},t.prototype.resumeAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return pV.print("resumeAllSubscribedStream()","mediaType: %o",e),fO(e,"mediaType",[l.RTC_PAUSE_RESUME_CONTROL_AUDIO,l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO,l.RTC_PAUSE_RESUME_CONTROL_VIDEO]),this._pauseAllSubscribeState.audio||this._pauseAllSubscribeState.video?(e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO?this._pauseAllSubscribeState.audio=!1:e===l.RTC_PAUSE_RESUME_CONTROL_VIDEO?this._pauseAllSubscribeState.video=!1:e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO&&(this._pauseAllSubscribeState.audio=!1,this._pauseAllSubscribeState.video=!1),this._room?[2,this._room.resumeAllSubscribedStream(e).then((function(){var e,r;null===(r=null===(e=t._room)||void 0===e?void 0:e.remoteStreams)||void 0===r||r.forEach((function(e){Array.isArray(e)&&e.forEach((function(e){t._updateAudioPlayerState(e),t._updateVideoPlayerState(e)}))}))}))]:[2,Promise.resolve()]):[2,Promise.resolve()]}))}))},t.prototype.sendUserMessage=function(e,t){return S(this,void 0,void 0,(function(){return b(this,(function(r){if(lO(e,"userId",1,128),gO(t),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendUserMessage(e,t)]}))}))},t.prototype.sendUserBinaryMessage=function(e,t){return S(this,void 0,void 0,(function(){return b(this,(function(r){if(lO(e,"userId",1,128),function(e,t){if(!(e instanceof ArrayBuffer))throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,", should be ArrayBuffer"))}(t,"message"),gO(t),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendUserMessage(e,t)]}))}))},t.prototype.sendRoomMessage=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(gO(e),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendRoomMessage(e)]}))}))},t.prototype.sendRoomBinaryMessage=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(gO(e),!this._room||this._room.connectionState!==hM.CONNECTED)throw new iI(tI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendRoomMessage(e,!0)]}))}))},t.prototype.setAudioCaptureConfig=function(e){var t;return void 0===e&&(e={}),S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("setAudioCaptureConfig()","config: %o",e),delete e.deviceId,pO(e),r=this._audioStreamConstraints.deviceId,this._audioStreamConstraints=e,r&&(this._audioStreamConstraints.deviceId=r),this._localAudioTrack?(this._localAudioTrack.audioCaptureConfig=this._audioStreamConstraints,[4,null===(t=this._localAudioTrack)||void 0===t?void 0:t.updateAudioCaptureConfig()]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setVideoCaptureConfig=function(e){var t;return void 0===e&&(e={}),S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("setVideoCaptureConfig()","config: %o",e),delete e.deviceId,pO(e),r=this._videoStreamConstraints.deviceId,this._videoStreamConstraints=e,r&&(this._videoStreamConstraints.deviceId=r),this._localVideoTrack?(this._localVideoTrack.videoCaptureConfig=this._videoStreamConstraints,[4,null===(t=this._localVideoTrack)||void 0===t?void 0:t.updateVideoCaptureConfig()]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setVideoEncoderConfig=function(e,t){var r,n,i,o,a,s,c,u;return S(this,void 0,void 0,(function(){return b(this,(function(d){if(pV.print("setVideoEncoderConfig()","streamIndex: %o, descriptions: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),function(e,t){if(!Array.isArray(e))throw new iI(tI.INVALID_PARAMS,"Invalid ".concat(t,", should be array"))}(t,"descriptions"),t.length>3&&(t=t.slice(0,3)),t.sort((function(e,t){return t.maxKbps-e.maxKbps})),e===h.STREAM_INDEX_MAIN){if(null===(n=null===(r=this._room)||void 0===r?void 0:r.localStream)||void 0===n?void 0:n.hasPublished){if(1!==this._videoStreamEncodeConfig.length||1!==(null==t?void 0:t.length))throw new iI(tI.INVALID_PARAMS,"After publishing, only non simulcast streams can be modified");null===(o=null===(i=this._room)||void 0===i?void 0:i.localStream)||void 0===o||o.updateVideoBitrate(t)}this._videoStreamEncodeConfig=t}else{if(null===(s=null===(a=this._room)||void 0===a?void 0:a.localScreenStream)||void 0===s?void 0:s.hasPublished){if(1!==this._screenStreamEncodeConfig.length||1!==(null==t?void 0:t.length))throw new iI(tI.INVALID_PARAMS,"After publishing, only non simulcast streams can be modified");null===(u=null===(c=this._room)||void 0===c?void 0:c.localScreenStream)||void 0===u||u.updateVideoBitrate([t[0]])}this._screenStreamEncodeConfig=t}return[2]}))}))},t.prototype.sendSEIMessage=function(e,t,r){var n,i,o,a,s,c;pV.print("sendSEIMessage()","streamIdex: %o, message: %o, repeatCount: %o",e,t,r),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),dO(r,"repeatCount",0,30);var u="string"==typeof t?new Uint8Array(aO.str2ab(t)):t;if(t.length){var d;if(e===h.STREAM_INDEX_MAIN){if(!(null===(i=null===(n=this._room)||void 0===n?void 0:n.localStream)||void 0===i?void 0:i.hasPublished))return;d=null===(o=this._room)||void 0===o?void 0:o.localStream}else{if(!(null===(s=null===(a=this._room)||void 0===a?void 0:a.localScreenStream)||void 0===s?void 0:s.hasPublished))return;d=null===(c=this._room)||void 0===c?void 0:c.localScreenStream}if(u.byteLength>4096)pV.print("sei size must not bigger than 4KB");else{var l=nO();d.seiList.push({content:u,uuid:l,repeatCount:r}),setTimeout((function(){if(d){var e=d.seiList.findIndex((function(e){return e.uuid===l}));e&&d.seiList.splice(e,1)}}),2e3)}}else pV.print("sei message must not be empty")},t.prototype.setAudioVolumeIndicationInterval=function(e){var t=this;pV.print("setAudioVolumeIndicationInterval()","interval %o: ",e),("number"!=typeof e||e<200)&&(e=200);var r=[];this._audioVolumeIndicationTimer&&clearInterval(this._audioVolumeIndicationTimer),this._audioVolumeIndicationTimer=setInterval((function(){var e,n,i,o;r=[],null===(e=t._room)||void 0===e||e.remoteStreams.forEach((function(e,t){var n,i;if(0!==e.length){var o=null===(i=null===(n=e[0])||void 0===n?void 0:n.audioTrack)||void 0===i?void 0:i.getAudioLevel();r.push({userId:t,volume:o||0})}}));var a=null===(n=t._localAudioTrack)||void 0===n?void 0:n.getAudioLevel();r.push({userId:(null===(o=null===(i=t._room)||void 0===i?void 0:i.roomInfo)||void 0===o?void 0:o.userInfo.userId)||"local_user",volume:a||0}),t.safeEmit(N.onAudioVolumeIndication,{speakers:r})}),e)},t.prototype.setVideoSourceType=function(e,t){var r,i,o,a,s;return S(this,void 0,void 0,(function(){var c,u;return b(this,(function(d){switch(d.label){case 0:return pV.print("setVideoSourceType()","index: %o, videoSourceType: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),fO(t,"VideoSourceType",[n.VIDEO_SOURCE_TYPE_EXTERNAL,n.VIDEO_SOURCE_TYPE_INTERNAL]),c=e===h.STREAM_INDEX_MAIN?"video":"screenVideo",this._trackSourceType[c]===t?[3,4]:(this._trackSourceType[c]=t,pV.print("setVideoSourceType","set ".concat(c," source type to ").concat(t)),this._localVideoTrack&&e===h.STREAM_INDEX_MAIN?(t===n.VIDEO_SOURCE_TYPE_EXTERNAL&&this._localVideoTrack.close(),null===(r=this._videoPlayer)||void 0===r||r.stop(),this._localVideoTrack=void 0,u=null===(i=this._room)||void 0===i?void 0:i._roomConfig.isAutoPublish,(null===(o=this._room)||void 0===o?void 0:o.hasPublished)||u?[4,this._updatePublish()]:[3,2]):[3,2]);case 1:d.sent(),d.label=2;case 2:return this._localScreenVideoTrack&&e===h.STREAM_INDEX_SCREEN?(t===n.VIDEO_SOURCE_TYPE_EXTERNAL&&this._localScreenVideoTrack.close(),null===(a=this._screenPlayer)||void 0===a||a.stop(),this._localScreenVideoTrack=void 0,(null===(s=this._room)||void 0===s?void 0:s.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4]):[3,4];case 3:d.sent(),d.label=4;case 4:return[2]}}))}))},t.prototype.setExternalVideoTrack=function(e,t){var r,i,o,a,s;return S(this,void 0,void 0,(function(){var c;return b(this,(function(u){switch(u.label){case 0:if(pV.print("setExternalVideoTrack()","index: %o, track: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),e!==h.STREAM_INDEX_MAIN)return[3,2];if(this._trackSourceType.video!==n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as external first");return this._localVideoTrack=new IU(t,nO()),this._initLocalTrackEvents(this._localVideoTrack),null===(r=this._videoPlayer)||void 0===r||r.playVideo(this._localVideoTrack),c=null===(i=this._room)||void 0===i?void 0:i._roomConfig.isAutoPublish,(null===(o=this._room)||void 0===o?void 0:o.hasPublished)||c?[4,this._updatePublish()]:[3,2];case 1:u.sent(),u.label=2;case 2:if(e!==h.STREAM_INDEX_SCREEN)return[3,4];if(this._trackSourceType.screenVideo!==n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as external first");return this._localScreenVideoTrack=new IU(t,nO()),this._initLocalTrackEvents(this._localScreenVideoTrack),null===(a=this._screenPlayer)||void 0===a||a.playVideo(this._localScreenVideoTrack),(null===(s=this._room)||void 0===s?void 0:s.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4];case 3:u.sent(),u.label=4;case 4:return[2]}}))}))},t.prototype.setAudioSourceType=function(e,t){var r,n,o;return S(this,void 0,void 0,(function(){var a,s;return b(this,(function(c){switch(c.label){case 0:return pV.print("setAudioSourceType()","index: %o, audioSourceType: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),fO(t,"audioSourceType",[i.AUDIO_SOURCE_TYPE_EXTERNAL,i.AUDIO_SOURCE_TYPE_INTERNAL]),a=e===h.STREAM_INDEX_MAIN?"audio":"screenAudio",this._trackSourceType[a]===t?[3,4]:(this._trackSourceType[a]=t,pV.print("setVideoSourceType","set ".concat(a," source type to ").concat(t)),this._localAudioTrack&&e===h.STREAM_INDEX_MAIN?(this._trackSourceType.audio===i.AUDIO_SOURCE_TYPE_EXTERNAL&&this._localAudioTrack.close(),this._localAudioTrack=void 0,s=null===(r=this._room)||void 0===r?void 0:r._roomConfig.isAutoPublish,(null===(n=this._room)||void 0===n?void 0:n.hasPublished)||s?[4,this._updatePublish()]:[3,2]):[3,2]);case 1:c.sent(),c.label=2;case 2:return this._localScreenAudioTrack&&e===h.STREAM_INDEX_SCREEN?(this._trackSourceType.audio===i.AUDIO_SOURCE_TYPE_EXTERNAL&&this._localScreenAudioTrack.close(),this._localScreenAudioTrack=void 0,(null===(o=this._room)||void 0===o?void 0:o.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4]):[3,4];case 3:c.sent(),c.label=4;case 4:return[2]}}))}))},t.prototype.setExternalAudioTrack=function(e,t){var r,n,o;return S(this,void 0,void 0,(function(){var a;return b(this,(function(s){switch(s.label){case 0:if(pV.print("setExternalAudioTrack()","index: %o, track: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),e!==h.STREAM_INDEX_MAIN)return[3,2];if(this._trackSourceType.audio!==i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as external first");return this._localAudioTrack=new AU(t,nO()),this._initLocalTrackEvents(this._localAudioTrack),a=null===(r=this._room)||void 0===r?void 0:r._roomConfig.isAutoPublish,(null===(n=this._room)||void 0===n?void 0:n.hasPublished)||a?[4,this._updatePublish()]:[3,2];case 1:s.sent(),s.label=2;case 2:if(e!==h.STREAM_INDEX_SCREEN)return[3,4];if(this._trackSourceType.screenAudio!==i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new iI(tI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as external first");return this._localScreenAudioTrack=new AU(t,nO()),this._initLocalTrackEvents(this._localScreenAudioTrack),(null===(o=this._room)||void 0===o?void 0:o.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))},t.prototype._updatePublish=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:if(pV.print("_updatePublish()"),!this._visibility)throw new iI(tI.NO_PUBLISH_PERMISSION,"no publish permission");return[4,this._pubLock.lock()];case 1:if(e=r.sent(),!this._room||this._room.connectionState!==hM.CONNECTED)return e(),[2];r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.publish(this._videoStreamEncodeConfig,this._localVideoTrack,this._localAudioTrack)];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof iI?t:new iI(tI.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype._updateScreenPublish=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:return pV.print("_updateScreenPublish()"),[4,this._pubLock.lock()];case 1:if(e=r.sent(),!this._room||this._room.connectionState!==hM.CONNECTED)return e(),[2];r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.publishScreen(this._screenStreamEncodeConfig,this._localScreenVideoTrack,this._localScreenAudioTrack)];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof iI?t:new iI(tI.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype._updateAudioPlayerState=function(e){pV.print("_updateAudioPlayerState()");var t,r=e.userId,n=e.isScreen;if(t=n?this._remoteAudioPlayer.get("".concat(r,"_screen")):this._remoteAudioPlayer.get(r),e.audioTrack){if(!t){var i=n?"".concat(r,"_screen"):r;t=new YU(i),this._initPlayerEvents(t),this._remoteAudioPlayer.set(i,t),this._audioPlaybackDeviceId&&t.setPlaybackDevice(this._audioPlaybackDeviceId)}t.playAudio(e.audioTrack)}else null==t||t.stop()},t.prototype._updateVideoPlayerState=function(e){pV.print("_updateVideoPlayerState()");var t,r=e.userId;t=e.isScreen?this._remoteScreenPlayer.get(r):this._remoteVideoPlayer.get(r),e.videoTrack?t&&t.playVideo(e.videoTrack,e):null==t||t.stop()},t.prototype._onAddStream=function(e){var t,r,n,i,o=e.stream,a={userId:o.userId,isScreen:o.isScreen,hasVideo:o.hasVideo,hasAudio:o.hasAudio,videoStreamDescriptions:o.attributes.videoDescriptions};this.safeEmit(N.onStreamAdd,{stream:a});var s=null;(null===(t=this._roomConfig)||void 0===t?void 0:t.isAutoSubscribeAudio)&&(s=p.AUDIO_ONLY),(null===(r=this._roomConfig)||void 0===r?void 0:r.isAutoSubscribeVideo)&&(s=p.VIDEO_ONLY),(null===(n=this._roomConfig)||void 0===n?void 0:n.isAutoSubscribeVideo)&&(null===(i=this._roomConfig)||void 0===i?void 0:i.isAutoSubscribeAudio)&&(s=p.AUDIO_AND_VIDEO),pV.print("_onAddStream","autoSubType: ".concat(s)),null===s||o.isScreen||this.subscribeUserStream(o.userId,s)},t.prototype._onRemoveStream=function(e){var t=e.stream,r={userId:t.userId,isScreen:t.isScreen,hasVideo:t.hasVideo,hasAudio:t.hasAudio,videoStreamDescriptions:[]},n=vV[e.reason]||_.STREAM_REMOVE_REASON_OTHER;this.safeEmit(N.onStreamRemove,{stream:r,reason:n}),this._stopRemotePlayer(t.userId,t.isScreen)},t.prototype._onUserConnection=function(e){this.safeEmit(N.onUserJoined,e)},t.prototype._onUserDisconnection=function(e){var t,r,n,i;(null===(t=null==e?void 0:e.userInfo)||void 0===t?void 0:t.userId)===(null===(i=null===(n=null===(r=this._room)||void 0===r?void 0:r.roomInfo)||void 0===n?void 0:n.userInfo)||void 0===i?void 0:i.userId)?"userDuplicateLogin"===(null==e?void 0:e.reason)&&this.safeEmit(N.onError,{errorCode:tI.DUPLICATE_LOGIN}):this.safeEmit(N.onUserLeave,{userInfo:e.userInfo,reason:"userLeave"===e.reason?0:1})},t.prototype._onConnectionStateChange=function(e){this.safeEmit(N.onConnectionStateChanged,e)},t.prototype._stopRemotePlayer=function(e,t){var r=t?"".concat(e,"_screen"):e,n=this._remoteAudioPlayer.get(r),i=this._remoteVideoPlayer.get(r);n&&n.stop(),i&&i.stop()},t.prototype._onResubscribe=function(e){e.stream&&(this._stopRemotePlayer(e.stream.userId,e.stream.isScreen),this._updateAudioPlayerState(e.stream),this._updateVideoPlayerState(e.stream))},t.prototype._onSubscribePushTrack=function(e){e.stream&&this._updateAudioPlayerState(e.stream)},t.prototype._onRemovePushTrack=function(e){e.stream&&this._updateAudioPlayerState(e.stream)},t.prototype._onVideoFirstFrameDecoded=function(e){this.safeEmit(N.onVideoFirstFrameDecoded,e)},t.prototype._onDeviceStateChange=function(e){this.safeEmit(N.onMediaDeviceStateChanged,e)},t.prototype._onUserMuteAudio=function(e){this.safeEmit(N.onUserMuteAudio,e)},t.prototype._onUserMuteVideo=function(e){this.safeEmit(N.onUserMuteVideo,e)},t.prototype._onCustomMessage=function(e){var t=e.message;e.binary?this.safeEmit(N.onRoomBinaryMessageReceived,{userId:e.clientId,message:t}):this.safeEmit(N.onRoomMessageReceived,{userId:e.clientId,message:t})},t.prototype._onUserMessageReceived=function(e){this.safeEmit(N.onUserMessageReceived,e)},t.prototype._onUserBinaryMessageReceived=function(e){this.safeEmit(N.onUserBinaryMessageReceived,e)},t.prototype._onLiveTranscodingResult=function(e){this.safeEmit(N.onLiveTranscodingResult,e)},E([sP()],t.prototype,"updateToken",null),E([sP()],t.prototype,"switchCamera",null),E([sP()],t.prototype,"switchMicrophone",null),E([sP()],t.prototype,"joinRoom",null),E([sP()],t.prototype,"leaveRoom",null),E([sP()],t.prototype,"destroy",null),E([sP()],t.prototype,"publish",null),E([sP()],t.prototype,"unpublish",null),E([sP()],t.prototype,"subscribeUserStream",null),E([sP()],t.prototype,"unSubscribe",null),E([sP()],t.prototype,"startVideoCapture",null),E([sP()],t.prototype,"stopVideoCapture",null),E([sP()],t.prototype,"startAudioCapture",null),E([sP()],t.prototype,"stopAudioCapture",null),E([sP()],t.prototype,"getAudioMixingManager",null),E([sP()],t.prototype,"startScreenCapture",null),E([sP()],t.prototype,"stopScreenCapture",null),E([sP()],t.prototype,"publishScreen",null),E([sP()],t.prototype,"unpublishScreen",null),E([sP()],t.prototype,"setLocalVideoPlayer",null),E([sP()],t.prototype,"startLiveTranscoding",null),E([sP()],t.prototype,"updateLiveTranscoding",null),E([sP()],t.prototype,"stopLiveTranscoding",null),E([sP()],t.prototype,"setBusinessId",null),E([sP()],t.prototype,"setUserVisibility",null),E([sP()],t.prototype,"setRemoteVideoPlayer",null),E([sP()],t.prototype,"setLocalVideoMirrorType",null),E([sP()],t.prototype,"setAudioPlaybackDevice",null),E([sP()],t.prototype,"play",null),E([sP()],t.prototype,"muteLocalAudio",null),E([sP()],t.prototype,"muteLocalVideo",null),E([sP()],t.prototype,"pauseAllSubscribedStream",null),E([sP()],t.prototype,"resumeAllSubscribedStream",null),E([sP()],t.prototype,"sendUserMessage",null),E([sP()],t.prototype,"sendUserBinaryMessage",null),E([sP()],t.prototype,"sendRoomMessage",null),E([sP()],t.prototype,"sendRoomBinaryMessage",null),E([sP()],t.prototype,"setAudioCaptureConfig",null),E([sP()],t.prototype,"setVideoCaptureConfig",null),E([sP()],t.prototype,"setVideoEncoderConfig",null),E([sP()],t.prototype,"sendSEIMessage",null),E([sP()],t.prototype,"setAudioVolumeIndicationInterval",null),E([sP()],t.prototype,"setVideoSourceType",null),E([sP()],t.prototype,"setExternalVideoTrack",null),E([sP()],t.prototype,"setAudioSourceType",null),E([sP()],t.prototype,"setExternalAudioTrack",null),t}(UO),vV={"client unpublished":_.STREAM_REMOVE_REASON_UNPUBLISH,"publish failed":_.STREAM_REMOVE_REASON_PUBLISH_FAILED,"stream removed":_.STREAM_REMOVE_REASON_KEEP_LIVE_FAILED,"client disconnected":_.STREAM_REMOVE_REASON_CLIENT_DISCONNECTED,"client republish":_.STREAM_REMOVE_REASON_REPUBLISH},mV=new PO("VERTC",0),gV=function(e){return mV.print("createEngine","Invoke VERTC.createEngine"),lO(e,"appId"),nP.setStats({rtc_app_id:e,rtc_sdk_version:AV(),product_line:Kk.RTC,report_version:Xk.W_5,os:qk.WEB,device_id:TP.getDeviceId()}),aP.sdkInitEngine(Date.now(),ID.BEGIN),new _V(e)},yV=function(e){if(mV.print("destroyEngine","Invoke VERTC.destroyEngine"),!(e instanceof _V))throw new iI(tI.INVALID_ENGINE,"Invalid engine object");e.destroy(),aP.sdkInitEngine(Date.now(),ID.END)},EV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getDevices()]}))}))},SV=function(e){return void 0===e&&(e={video:!0,audio:!0}),S(void 0,void 0,void 0,(function(){var t,r,n,i,o;return b(this,(function(a){switch(a.label){case 0:if(t=e.video,r=e.audio,n={video:!1,audio:!1},!t)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),i=n,[4,oU.getVideoPermission()];case 2:return i.video=a.sent(),[3,4];case 3:return a.sent(),[3,4];case 4:if(!r)return[3,8];a.label=5;case 5:return a.trys.push([5,7,,8]),o=n,[4,oU.getAudioPermission()];case 6:return o.audio=a.sent(),[3,8];case 7:return a.sent(),[3,8];case 8:return[2,n]}}))}))},bV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getMicrophones()]}))}))},TV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getCameras()]}))}))},IV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getAudioPlayback()]}))}))},AV=function(){return vw.VERSION},RV=new function(){this.getSdkVersion=AV,this.createEngine=gV,this.destroyEngine=yV,this.getDevices=EV,this.enableDevices=SV,this.getMicrophones=bV,this.getCameras=TV,this.getAudioPlayback=IV,this.getParameter=gw,this.setParameter=mw,this.isSupported=rM,this.events=N,this.ErrorCode=tI,this.platform="BytePlus"};return y(y(y(y({},RV),w),k),{events:N})}));
6
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BytePlusRTC=t()}(this,(function(){"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y=function(){return y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},y.apply(this,arguments)};function E(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function S(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function b(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function T(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function I(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function A(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}!function(e){e[e.VIDEO_SOURCE_TYPE_EXTERNAL=0]="VIDEO_SOURCE_TYPE_EXTERNAL",e[e.VIDEO_SOURCE_TYPE_INTERNAL=1]="VIDEO_SOURCE_TYPE_INTERNAL"}(n||(n={})),function(e){e[e.AUDIO_SOURCE_TYPE_EXTERNAL=0]="AUDIO_SOURCE_TYPE_EXTERNAL",e[e.AUDIO_SOURCE_TYPE_INTERNAL=1]="AUDIO_SOURCE_TYPE_INTERNAL"}(i||(i={})),function(e){e[e.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",e[e.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING"}(o||(o={})),function(e){e[e.AUTO_SUBSCRIBE_MODE=0]="AUTO_SUBSCRIBE_MODE",e[e.MANUAL_SUBSCRIBE_MODE=1]="MANUAL_SUBSCRIBE_MODE"}(a||(a={})),function(e){e[e.MUTE_STATE_OFF=0]="MUTE_STATE_OFF",e[e.MUTE_STATE_ON=1]="MUTE_STATE_ON"}(s||(s={})),function(e){e[e.SUBSCRIBE_SUCC=0]="SUBSCRIBE_SUCC",e[e.SUBSCRIBE_FAIL=1]="SUBSCRIBE_FAIL"}(c||(c={})),function(e){e[e.PUBLISH_SUCC=0]="PUBLISH_SUCC",e[e.PUBLISH_FAIL=1]="PUBLISH_FAIL"}(u||(u={})),function(e){e[e.MIRROR_MODE_OFF=0]="MIRROR_MODE_OFF",e[e.MIRROR_MODE_ON=1]="MIRROR_MODE_ON"}(d||(d={})),function(e){e[e.RTC_PAUSE_RESUME_CONTROL_AUDIO=0]="RTC_PAUSE_RESUME_CONTROL_AUDIO",e[e.RTC_PAUSE_RESUME_CONTROL_VIDEO=1]="RTC_PAUSE_RESUME_CONTROL_VIDEO",e[e.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO=2]="RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO"}(l||(l={})),function(e){e[e.RENDER_MODE_HIDDEN=0]="RENDER_MODE_HIDDEN",e[e.RENDER_MODE_FIT=1]="RENDER_MODE_FIT"}(f||(f={})),function(e){e[e.STREAM_INDEX_MAIN=0]="STREAM_INDEX_MAIN",e[e.STREAM_INDEX_SCREEN=1]="STREAM_INDEX_SCREEN"}(h||(h={})),function(e){e[e.AUDIO_ONLY=0]="AUDIO_ONLY",e[e.VIDEO_ONLY=1]="VIDEO_ONLY",e[e.AUDIO_AND_VIDEO=2]="AUDIO_AND_VIDEO",e[e.NONE=3]="NONE"}(p||(p={})),function(e){e[e.STREAM_REMOVE_REASON_UNPUBLISH=0]="STREAM_REMOVE_REASON_UNPUBLISH",e[e.STREAM_REMOVE_REASON_PUBLISH_FAILED=1]="STREAM_REMOVE_REASON_PUBLISH_FAILED",e[e.STREAM_REMOVE_REASON_KEEP_LIVE_FAILED=2]="STREAM_REMOVE_REASON_KEEP_LIVE_FAILED",e[e.STREAM_REMOVE_REASON_CLIENT_DISCONNECTED=3]="STREAM_REMOVE_REASON_CLIENT_DISCONNECTED",e[e.STREAM_REMOVE_REASON_REPUBLISH=4]="STREAM_REMOVE_REASON_REPUBLISH",e[e.STREAM_REMOVE_REASON_OTHER=5]="STREAM_REMOVE_REASON_OTHER"}(_||(_={})),function(e){e[e.CONNECTION_START=0]="CONNECTION_START",e[e.CONNECTION_STATE_DISCONNECTED=1]="CONNECTION_STATE_DISCONNECTED",e[e.CONNECTION_STATE_CONNECTING=2]="CONNECTION_STATE_CONNECTING",e[e.CONNECTION_STATE_CONNECTED=3]="CONNECTION_STATE_CONNECTED",e[e.CONNECTION_STATE_RECONNECTING=4]="CONNECTION_STATE_RECONNECTING",e[e.CONNECTION_STATE_RECONNECTED=5]="CONNECTION_STATE_RECONNECTED"}(v||(v={})),function(e){e[e.MIRROR_TYPE_NONE=0]="MIRROR_TYPE_NONE",e[e.MIRROR_TYPE_RENDER=1]="MIRROR_TYPE_RENDER"}(m||(m={})),function(e){e[e.domestic=0]="domestic",e[e.overseas=1]="overseas"}(g||(g={}));var R,C,O,w=Object.freeze({__proto__:null,get VideoSourceType(){return n},get AudioSourceType(){return i},get ChannelProfile(){return o},get SubscribeMode(){return a},get MuteState(){return s},get SubscribeState(){return c},get PublishState(){return u},get MirrorMode(){return d},get PauseResumeControlMediaType(){return l},get VideoRenderMode(){return f},get StreamIndex(){return h},get SubscribeMediaType(){return p},get StreamRemoveReason(){return _},get ConnectionState(){return v},get MirrorType(){return m},get LogChannel(){return g}});!function(e){e[e.AUTO=0]="AUTO",e[e.MODE_L=1]="MODE_L",e[e.MODE_R=2]="MODE_R",e[e.MODE_MIX=3]="MODE_MIX"}(R||(R={})),function(e){e[e.PLAYOUT=0]="PLAYOUT",e[e.PUBLISH=1]="PUBLISH",e[e.PLAYOUT_AND_PUBLISH=2]="PLAYOUT_AND_PUBLISH"}(C||(C={})),function(e){e[e.AUDIO_MIXING_STATE_PRELOADED=0]="AUDIO_MIXING_STATE_PRELOADED",e[e.AUDIO_MIXING_STATE_PLAYING=1]="AUDIO_MIXING_STATE_PLAYING",e[e.AUDIO_MIXING_STATE_PAUSED=2]="AUDIO_MIXING_STATE_PAUSED",e[e.AUDIO_MIXING_STATE_STOPPED=3]="AUDIO_MIXING_STATE_STOPPED",e[e.AUDIO_MIXING_STATE_FAILED=4]="AUDIO_MIXING_STATE_FAILED",e[e.AUDIO_MIXING_STATE_FINISHED=5]="AUDIO_MIXING_STATE_FINISHED",e[e.AUDIO_MIXING_STATE_PCM_ENABLED=6]="AUDIO_MIXING_STATE_PCM_ENABLED",e[e.AUDIO_MIXING_STATE_PCM_DISABLED=7]="AUDIO_MIXING_STATE_PCM_DISABLED"}(O||(O={}));var N,k=Object.freeze({__proto__:null,get AudioMixingDualMonoMode(){return R},get AudioMixingType(){return C},get AudioMixingState(){return O}});!function(e){e.onTrackEnded="onTrackEnded",e.onPlayerEvent="onPlayerEvent",e.onAutoplayFailed="onAutoplayFailed",e.onUserJoined="onUserJoined",e.onUserLeave="onUserLeave",e.onConnectionStateChanged="onConnectionStateChanged",e.onStreamAdd="onStreamAdd",e.onStreamRemove="onStreamRemove",e.onRoomMessageReceived="onRoomMessageReceived",e.onRoomBinaryMessageReceived="onRoomBinaryMessageReceived",e.onUserMessageReceived="onUserMessageReceived",e.onUserBinaryMessageReceived="onUserBinaryMessageReceived",e.onUserMuteAudio="onUserMuteAudio",e.onUserMuteVideo="onUserMuteVideo",e.onVideoFirstFrameRendered="onVideoFirstFrameRendered",e.onVideoFirstFrameDecoded="onVideoFirstFrameDecoded",e.onAudioFirstFrameDecoded="onAudioFirstFrameDecoded",e.onMediaDeviceStateChanged="onMediaDeviceStateChanged",e.onRemoteStreamStats="onRemoteStreamStats",e.onLocalStreamStats="onLocalStreamStats",e.onAudioVolumeIndication="onAudioVolumeIndication",e.onAudioPlaybackDeviceChanged="onAudioPlaybackDeviceChanged",e.onUserStartVideoCapture="onUserStartVideoCapture",e.onUserStopVideoCapture="onUserStopVideoCapture",e.onUserStartAudioCapture="onUserStartAudioCapture",e.onUserStopAudioCapture="onUserStopAudioCapture",e.onAutoPublishResult="onAutoPublishResult",e.onAutoSubscribeResult="onAutoSubscribeResult",e.onLiveTranscodingResult="onLiveTranscodingResult",e.onSEIMessageReceived="onSEIMessageReceived",e.onError="onError",e.onAudioMixingStateChanged="onAudioMixingStateChanged"}(N||(N={}));var D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},P=function(e){return e&&e.Math==Math&&e},M=P("object"==typeof globalThis&&globalThis)||P("object"==typeof window&&window)||P("object"==typeof self&&self)||P("object"==typeof D&&D)||function(){return this}()||Function("return this")(),U={},L=function(e){try{return!!e()}catch(e){return!0}},x=!L((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),B=!L((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),V=B,j=Function.prototype.call,F=V?j.bind(j):function(){return j.apply(j,arguments)},G={},z={}.propertyIsEnumerable,H=Object.getOwnPropertyDescriptor,W=H&&!z.call({1:2},1);G.f=W?function(e){var t=H(this,e);return!!t&&t.enumerable}:z;var Y,K,X=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},q=B,J=Function.prototype,Z=J.bind,$=J.call,Q=q&&Z.bind($,$),ee=q?function(e){return e&&Q(e)}:function(e){return e&&function(){return $.apply(e,arguments)}},te=ee,re=te({}.toString),ne=te("".slice),ie=function(e){return ne(re(e),8,-1)},oe=ee,ae=L,se=ie,ce=M.Object,ue=oe("".split),de=ae((function(){return!ce("z").propertyIsEnumerable(0)}))?function(e){return"String"==se(e)?ue(e,""):ce(e)}:ce,le=M.TypeError,fe=function(e){if(null==e)throw le("Can't call method on "+e);return e},he=de,pe=fe,_e=function(e){return he(pe(e))},ve=function(e){return"function"==typeof e},me=ve,ge=function(e){return"object"==typeof e?null!==e:me(e)},ye=M,Ee=ve,Se=function(e){return Ee(e)?e:void 0},be=function(e,t){return arguments.length<2?Se(ye[e]):ye[e]&&ye[e][t]},Te=ee({}.isPrototypeOf),Ie=be("navigator","userAgent")||"",Ae=M,Re=Ie,Ce=Ae.process,Oe=Ae.Deno,we=Ce&&Ce.versions||Oe&&Oe.version,Ne=we&&we.v8;Ne&&(K=(Y=Ne.split("."))[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!K&&Re&&(!(Y=Re.match(/Edge\/(\d+)/))||Y[1]>=74)&&(Y=Re.match(/Chrome\/(\d+)/))&&(K=+Y[1]);var ke=K,De=ke,Pe=L,Me=!!Object.getOwnPropertySymbols&&!Pe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&De&&De<41})),Ue=Me&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Le=be,xe=ve,Be=Te,Ve=Ue,je=M.Object,Fe=Ve?function(e){return"symbol"==typeof e}:function(e){var t=Le("Symbol");return xe(t)&&Be(t.prototype,je(e))},Ge=M.String,ze=function(e){try{return Ge(e)}catch(e){return"Object"}},He=ve,We=ze,Ye=M.TypeError,Ke=function(e){if(He(e))return e;throw Ye(We(e)+" is not a function")},Xe=Ke,qe=function(e,t){var r=e[t];return null==r?void 0:Xe(r)},Je=F,Ze=ve,$e=ge,Qe=M.TypeError,et={exports:{}},tt=M,rt=Object.defineProperty,nt=function(e,t){try{rt(tt,e,{value:t,configurable:!0,writable:!0})}catch(r){tt[e]=t}return t},it=nt,ot="__core-js_shared__",at=M[ot]||it(ot,{}),st=at;(et.exports=function(e,t){return st[e]||(st[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.0/LICENSE",source:"https://github.com/zloirock/core-js"});var ct=fe,ut=M.Object,dt=function(e){return ut(ct(e))},lt=dt,ft=ee({}.hasOwnProperty),ht=Object.hasOwn||function(e,t){return ft(lt(e),t)},pt=ee,_t=0,vt=Math.random(),mt=pt(1..toString),gt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+mt(++_t+vt,36)},yt=M,Et=et.exports,St=ht,bt=gt,Tt=Me,It=Ue,At=Et("wks"),Rt=yt.Symbol,Ct=Rt&&Rt.for,Ot=It?Rt:Rt&&Rt.withoutSetter||bt,wt=function(e){if(!St(At,e)||!Tt&&"string"!=typeof At[e]){var t="Symbol."+e;Tt&&St(Rt,e)?At[e]=Rt[e]:At[e]=It&&Ct?Ct(t):Ot(t)}return At[e]},Nt=F,kt=ge,Dt=Fe,Pt=qe,Mt=function(e,t){var r,n;if("string"===t&&Ze(r=e.toString)&&!$e(n=Je(r,e)))return n;if(Ze(r=e.valueOf)&&!$e(n=Je(r,e)))return n;if("string"!==t&&Ze(r=e.toString)&&!$e(n=Je(r,e)))return n;throw Qe("Can't convert object to primitive value")},Ut=wt,Lt=M.TypeError,xt=Ut("toPrimitive"),Bt=function(e,t){if(!kt(e)||Dt(e))return e;var r,n=Pt(e,xt);if(n){if(void 0===t&&(t="default"),r=Nt(n,e,t),!kt(r)||Dt(r))return r;throw Lt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Mt(e,t)},Vt=Bt,jt=Fe,Ft=function(e){var t=Vt(e,"string");return jt(t)?t:t+""},Gt=ge,zt=M.document,Ht=Gt(zt)&&Gt(zt.createElement),Wt=function(e){return Ht?zt.createElement(e):{}},Yt=Wt,Kt=!x&&!L((function(){return 7!=Object.defineProperty(Yt("div"),"a",{get:function(){return 7}}).a})),Xt=x,qt=F,Jt=G,Zt=X,$t=_e,Qt=Ft,er=ht,tr=Kt,rr=Object.getOwnPropertyDescriptor;U.f=Xt?rr:function(e,t){if(e=$t(e),t=Qt(t),tr)try{return rr(e,t)}catch(e){}if(er(e,t))return Zt(!qt(Jt.f,e,t),e[t])};var nr={},ir=x&&L((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),or=M,ar=ge,sr=or.String,cr=or.TypeError,ur=function(e){if(ar(e))return e;throw cr(sr(e)+" is not an object")},dr=x,lr=Kt,fr=ir,hr=ur,pr=Ft,_r=M.TypeError,vr=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,gr="enumerable",yr="configurable",Er="writable";nr.f=dr?fr?function(e,t,r){if(hr(e),t=pr(t),hr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&Er in r&&!r.writable){var n=mr(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:yr in r?r.configurable:n.configurable,enumerable:gr in r?r.enumerable:n.enumerable,writable:!1})}return vr(e,t,r)}:vr:function(e,t,r){if(hr(e),t=pr(t),hr(r),lr)try{return vr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw _r("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Sr=nr,br=X,Tr=x?function(e,t,r){return Sr.f(e,t,br(1,r))}:function(e,t,r){return e[t]=r,e},Ir={exports:{}},Ar=ve,Rr=at,Cr=ee(Function.toString);Ar(Rr.inspectSource)||(Rr.inspectSource=function(e){return Cr(e)});var Or,wr,Nr,kr=Rr.inspectSource,Dr=ve,Pr=kr,Mr=M.WeakMap,Ur=Dr(Mr)&&/native code/.test(Pr(Mr)),Lr=et.exports,xr=gt,Br=Lr("keys"),Vr=function(e){return Br[e]||(Br[e]=xr(e))},jr={},Fr=Ur,Gr=M,zr=ee,Hr=ge,Wr=Tr,Yr=ht,Kr=at,Xr=Vr,qr=jr,Jr="Object already initialized",Zr=Gr.TypeError,$r=Gr.WeakMap;if(Fr||Kr.state){var Qr=Kr.state||(Kr.state=new $r),en=zr(Qr.get),tn=zr(Qr.has),rn=zr(Qr.set);Or=function(e,t){if(tn(Qr,e))throw new Zr(Jr);return t.facade=e,rn(Qr,e,t),t},wr=function(e){return en(Qr,e)||{}},Nr=function(e){return tn(Qr,e)}}else{var nn=Xr("state");qr[nn]=!0,Or=function(e,t){if(Yr(e,nn))throw new Zr(Jr);return t.facade=e,Wr(e,nn,t),t},wr=function(e){return Yr(e,nn)?e[nn]:{}},Nr=function(e){return Yr(e,nn)}}var on={set:Or,get:wr,has:Nr,enforce:function(e){return Nr(e)?wr(e):Or(e,{})},getterFor:function(e){return function(t){var r;if(!Hr(t)||(r=wr(t)).type!==e)throw Zr("Incompatible receiver, "+e+" required");return r}}},an=x,sn=ht,cn=Function.prototype,un=an&&Object.getOwnPropertyDescriptor,dn=sn(cn,"name"),ln={EXISTS:dn,PROPER:dn&&"something"===function(){}.name,CONFIGURABLE:dn&&(!an||an&&un(cn,"name").configurable)},fn=M,hn=ve,pn=ht,_n=Tr,vn=nt,mn=kr,gn=ln.CONFIGURABLE,yn=on.get,En=on.enforce,Sn=String(String).split("String");(Ir.exports=function(e,t,r,n){var i,o=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:t;hn(r)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!pn(r,"name")||gn&&r.name!==c)&&_n(r,"name",c),(i=En(r)).source||(i.source=Sn.join("string"==typeof c?c:""))),e!==fn?(o?!s&&e[t]&&(a=!0):delete e[t],a?e[t]=r:_n(e,t,r)):a?e[t]=r:vn(t,r)})(Function.prototype,"toString",(function(){return hn(this)&&yn(this).source||mn(this)}));var bn={},Tn=Math.ceil,In=Math.floor,An=function(e){var t=+e;return t!=t||0===t?0:(t>0?In:Tn)(t)},Rn=An,Cn=Math.max,On=Math.min,wn=function(e,t){var r=Rn(e);return r<0?Cn(r+t,0):On(r,t)},Nn=An,kn=Math.min,Dn=function(e){return e>0?kn(Nn(e),9007199254740991):0},Pn=Dn,Mn=function(e){return Pn(e.length)},Un=_e,Ln=wn,xn=Mn,Bn=function(e){return function(t,r,n){var i,o=Un(t),a=xn(o),s=Ln(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},Vn={includes:Bn(!0),indexOf:Bn(!1)},jn=ht,Fn=_e,Gn=Vn.indexOf,zn=jr,Hn=ee([].push),Wn=function(e,t){var r,n=Fn(e),i=0,o=[];for(r in n)!jn(zn,r)&&jn(n,r)&&Hn(o,r);for(;t.length>i;)jn(n,r=t[i++])&&(~Gn(o,r)||Hn(o,r));return o},Yn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Kn=Wn,Xn=Yn.concat("length","prototype");bn.f=Object.getOwnPropertyNames||function(e){return Kn(e,Xn)};var qn={};qn.f=Object.getOwnPropertySymbols;var Jn=be,Zn=bn,$n=qn,Qn=ur,ei=ee([].concat),ti=Jn("Reflect","ownKeys")||function(e){var t=Zn.f(Qn(e)),r=$n.f;return r?ei(t,r(e)):t},ri=ht,ni=ti,ii=U,oi=nr,ai=L,si=ve,ci=/#|\.prototype\./,ui=function(e,t){var r=li[di(e)];return r==hi||r!=fi&&(si(t)?ai(t):!!t)},di=ui.normalize=function(e){return String(e).replace(ci,".").toLowerCase()},li=ui.data={},fi=ui.NATIVE="N",hi=ui.POLYFILL="P",pi=ui,_i=M,vi=U.f,mi=Tr,gi=Ir.exports,yi=nt,Ei=function(e,t,r){for(var n=ni(t),i=oi.f,o=ii.f,a=0;a<n.length;a++){var s=n[a];ri(e,s)||r&&ri(r,s)||i(e,s,o(t,s))}},Si=pi,bi=function(e,t){var r,n,i,o,a,s=e.target,c=e.global,u=e.stat;if(r=c?_i:u?_i[s]||yi(s,{}):(_i[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=vi(r,n))&&a.value:r[n],!Si(c?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Ei(o,i)}(e.sham||i&&i.sham)&&mi(o,"sham",!0),gi(r,n,o,e)}},Ti=bi,Ii=ee,Ai=M.Date,Ri=Ii(Ai.prototype.getTime);Ti({target:"Date",stat:!0},{now:function(){return Ri(new Ai)}});var Ci=ee,Oi=Ir.exports,wi=Date.prototype,Ni="Invalid Date",ki="toString",Di=Ci(wi.toString),Pi=Ci(wi.getTime);String(new Date(NaN))!=Ni&&Oi(wi,ki,(function(){var e=Pi(this);return e==e?Di(this):Ni}));let Mi=!0,Ui=!0;function Li(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function xi(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Bi(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Mi=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Vi(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ui=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function ji(){if("object"==typeof window){if(Mi)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function Fi(e,t){Ui&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Gi(e){return"[object Object]"===Object.prototype.toString.call(e)}function zi(e){return Gi(e)?Object.keys(e).reduce((function(t,r){const n=Gi(e[r]),i=n?zi(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function Hi(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?Hi(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{Hi(e,e.get(t),r)}))})))}function Wi(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&Hi(e,r,i)}))})),i}const Yi=ji;function Ki(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const a=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let a=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&r.length&&t.includes("back")&&(a=r[r.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=n(e.video),Yi("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return Yi("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function Xi(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function qi(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else xi(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Ji(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Zi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function $i(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Wi(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),xi(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Wi(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Qi(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function eo(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Qi(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}function a(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find((e=>e.track===t));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function to(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function ro(e,t){xi(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}var no=Object.freeze({__proto__:null,shimMediaStream:Xi,shimOnTrack:qi,shimGetSendersWithDtmf:Ji,shimGetStats:Zi,shimSenderReceiverGetStats:$i,shimAddTrackRemoveTrackWithNative:Qi,shimAddTrackRemoveTrack:eo,shimPeerConnection:to,fixNegotiationNeeded:ro,shimGetUserMedia:Ki,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function io(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){Fi("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function oo(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ao(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function so(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function co(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),xi(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function uo(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){Fi("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function lo(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function fo(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],r=e&&"sendEncodings"in e;r&&e.sendEncodings.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function ho(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function po(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function _o(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var vo=Object.freeze({__proto__:null,shimOnTrack:oo,shimPeerConnection:ao,shimSenderGetStats:so,shimReceiverGetStats:co,shimRemoveStream:uo,shimRTCDataChannel:lo,shimAddTransceiver:fo,shimGetParameters:ho,shimCreateOffer:po,shimCreateAnswer:_o,shimGetUserMedia:io,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}});function mo(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function go(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function yo(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=s,s=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=s,s=function(e,t,r){const n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=s}function Eo(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r(So(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function So(e){return e&&void 0!==e.video?Object.assign({},e,{video:zi(e.video)}):e}function bo(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];!n.hasOwnProperty("urls")&&n.hasOwnProperty("url")?(Fi("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function To(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Io(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function Ao(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ro=Object.freeze({__proto__:null,shimLocalStreamsAPI:mo,shimRemoteStreamsAPI:go,shimCallbacksAPI:yo,shimGetUserMedia:Eo,shimConstraints:So,shimRTCIceServerUrls:bo,shimTrackEventTransceiver:To,shimCreateOfferLegacy:Io,shimAudioContext:Ao}),Co={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){let t=e.substr(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},t.parseSsrcGroup=function(e){const t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substr(6)},t.parseFingerprint=function(e){const t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");for(let i=3;i<n.length;i++){const o=n[i],a=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){const n=t.parseRtpMap(a),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[0].ssrc;let c;const u=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substr(17).split(" ").map((e=>parseInt(e,10)))));u.length>0&&u[0].length>1&&u[0][0]===s&&(c=u[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&s&&r.push({ssrc:s});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=d}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substr(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substr(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:r.fmt,maxMessageSize:i};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substr(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substr(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(Co);var Oo=Co.exports,wo=Object.freeze(e({__proto__:null,default:Oo},[Co.exports]));function No(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const r=new t(e),n=Oo.parseCandidate(e.candidate),i=Object.assign(r,n);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,xi(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function ko(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=function(e){if(!e||!e.sdp)return!1;const t=Oo.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Oo.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r},i=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r},o=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=Oo.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(r(arguments[0])){const e=n(arguments[0]),t=i(e),r=o(arguments[0],e);let a;a=0===t&&0===r?Number.POSITIVE_INFINITY:0===t||0===r?Math.max(t,r):Math.min(t,r);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>a}),this._sctp=s}return a.apply(this,arguments)}}function Do(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},xi(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Po(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function Mo(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return r.apply(this,arguments)}}function Uo(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Lo(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return r.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>r.apply(this,[e])))})}var xo=Object.freeze({__proto__:null,shimRTCIceCandidate:No,shimMaxMessageSize:ko,shimSendThrowTypeError:Do,shimConnectionState:Po,removeExtmapAllowMixed:Mo,shimAddIceCandidateNullOrEmpty:Uo,shimParameterlessSetLocalDescription:Lo});!function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=ji,n=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=Li(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=Li(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=Li(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),i={browserDetails:n,commonShim:xo,extractVersion:Li,disableLog:Bi,disableWarnings:Vi,sdp:wo};switch(n.browser){case"chrome":if(!no||!to||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(null===n.version)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=no,Uo(e,n),Lo(e),Ki(e,n),Xi(e),to(e,n),qi(e),eo(e,n),Ji(e),Zi(e),$i(e),ro(e,n),No(e),Po(e),ko(e,n),Do(e),Mo(e,n);break;case"firefox":if(!vo||!ao||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=vo,Uo(e,n),Lo(e),io(e,n),ao(e,n),oo(e),uo(e),so(e),co(e),lo(e),fo(e),ho(e),po(e),_o(e),No(e),Po(e),ko(e,n),Do(e);break;case"safari":if(!Ro||!t.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=Ro,Uo(e,n),Lo(e),bo(e),Io(e),yo(e),mo(e),go(e),To(e),Eo(e),Ao(e),No(e),ko(e,n),Do(e),Mo(e,n);break;default:r("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});var Bo={},Vo=Wn,jo=Yn,Fo=Object.keys||function(e){return Vo(e,jo)},Go=x,zo=ir,Ho=nr,Wo=ur,Yo=_e,Ko=Fo;Bo.f=Go&&!zo?Object.defineProperties:function(e,t){Wo(e);for(var r,n=Yo(t),i=Ko(t),o=i.length,a=0;o>a;)Ho.f(e,r=i[a++],n[r]);return e};var Xo,qo=be("document","documentElement"),Jo=ur,Zo=Bo,$o=Yn,Qo=jr,ea=qo,ta=Wt,ra=Vr("IE_PROTO"),na=function(){},ia=function(e){return"<script>"+e+"</"+"script>"},oa=function(e){e.write(ia("")),e.close();var t=e.parentWindow.Object;return e=null,t},aa=function(){try{Xo=new ActiveXObject("htmlfile")}catch(e){}var e,t;aa="undefined"!=typeof document?document.domain&&Xo?oa(Xo):((t=ta("iframe")).style.display="none",ea.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ia("document.F=Object")),e.close(),e.F):oa(Xo);for(var r=$o.length;r--;)delete aa.prototype[$o[r]];return aa()};Qo[ra]=!0;var sa=Object.create||function(e,t){var r;return null!==e?(na.prototype=Jo(e),r=new na,na.prototype=null,r[ra]=e):r=aa(),void 0===t?r:Zo.f(r,t)},ca=sa,ua=nr,da=wt("unscopables"),la=Array.prototype;null==la[da]&&ua.f(la,da,{configurable:!0,value:ca(null)});var fa,ha,pa,_a=function(e){la[da][e]=!0},va={},ma=!L((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ga=M,ya=ht,Ea=ve,Sa=dt,ba=ma,Ta=Vr("IE_PROTO"),Ia=ga.Object,Aa=Ia.prototype,Ra=ba?Ia.getPrototypeOf:function(e){var t=Sa(e);if(ya(t,Ta))return t[Ta];var r=t.constructor;return Ea(r)&&t instanceof r?r.prototype:t instanceof Ia?Aa:null},Ca=L,Oa=ve,wa=Ra,Na=Ir.exports,ka=wt("iterator"),Da=!1;[].keys&&("next"in(pa=[].keys())?(ha=wa(wa(pa)))!==Object.prototype&&(fa=ha):Da=!0);var Pa=null==fa||Ca((function(){var e={};return fa[ka].call(e)!==e}));Pa&&(fa={}),Oa(fa[ka])||Na(fa,ka,(function(){return this}));var Ma={IteratorPrototype:fa,BUGGY_SAFARI_ITERATORS:Da},Ua=nr.f,La=ht,xa=wt("toStringTag"),Ba=function(e,t,r){e&&!r&&(e=e.prototype),e&&!La(e,xa)&&Ua(e,xa,{configurable:!0,value:t})},Va=Ma.IteratorPrototype,ja=sa,Fa=X,Ga=Ba,za=va,Ha=function(){return this},Wa=function(e,t,r,n){var i=t+" Iterator";return e.prototype=ja(Va,{next:Fa(+!n,r)}),Ga(e,i,!1),za[i]=Ha,e},Ya=M,Ka=ve,Xa=Ya.String,qa=Ya.TypeError,Ja=ee,Za=ur,$a=function(e){if("object"==typeof e||Ka(e))return e;throw qa("Can't set "+Xa(e)+" as a prototype")},Qa=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Ja(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Za(r),$a(n),t?e(r,n):r.__proto__=n,r}}():void 0),es=bi,ts=F,rs=ln,ns=ve,is=Wa,os=Ra,as=Qa,ss=Ba,cs=Tr,us=Ir.exports,ds=va,ls=rs.PROPER,fs=rs.CONFIGURABLE,hs=Ma.IteratorPrototype,ps=Ma.BUGGY_SAFARI_ITERATORS,_s=wt("iterator"),vs="keys",ms="values",gs="entries",ys=function(){return this},Es=function(e,t,r,n,i,o,a){is(r,t,n);var s,c,u,d=function(e){if(e===i&&_)return _;if(!ps&&e in h)return h[e];switch(e){case vs:case ms:case gs:return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,h=e.prototype,p=h[_s]||h["@@iterator"]||i&&h[i],_=!ps&&p||d(i),v="Array"==t&&h.entries||p;if(v&&(s=os(v.call(new e)))!==Object.prototype&&s.next&&(os(s)!==hs&&(as?as(s,hs):ns(s[_s])||us(s,_s,ys)),ss(s,l,!0)),ls&&i==ms&&p&&p.name!==ms&&(fs?cs(h,"name",ms):(f=!0,_=function(){return ts(p,this)})),i)if(c={values:d(ms),keys:o?_:d(vs),entries:d(gs)},a)for(u in c)(ps||f||!(u in h))&&us(h,u,c[u]);else es({target:t,proto:!0,forced:ps||f},c);return h[_s]!==_&&us(h,_s,_,{name:i}),ds[t]=_,c},Ss=_e,bs=_a,Ts=va,Is=on,As=nr.f,Rs=Es,Cs=x,Os="Array Iterator",ws=Is.set,Ns=Is.getterFor(Os),ks=Rs(Array,"Array",(function(e,t){ws(this,{type:Os,target:Ss(e),index:0,kind:t})}),(function(){var e=Ns(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Ds=Ts.Arguments=Ts.Array;if(bs("keys"),bs("values"),bs("entries"),Cs&&"values"!==Ds.name)try{As(Ds,"name",{value:"values"})}catch(e){}var Ps={exports:{}},Ms={},Us=Ft,Ls=nr,xs=X,Bs=function(e,t,r){var n=Us(t);n in e?Ls.f(e,n,xs(0,r)):e[n]=r},Vs=wn,js=Mn,Fs=Bs,Gs=M.Array,zs=Math.max,Hs=function(e,t,r){for(var n=js(e),i=Vs(t,n),o=Vs(void 0===r?n:r,n),a=Gs(zs(o-i,0)),s=0;i<o;i++,s++)Fs(a,s,e[i]);return a.length=s,a},Ws=ie,Ys=_e,Ks=bn.f,Xs=Hs,qs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Ms.f=function(e){return qs&&"Window"==Ws(e)?function(e){try{return Ks(e)}catch(e){return Xs(qs)}}(e):Ks(Ys(e))};var Js=L((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Zs=L,$s=ge,Qs=ie,ec=Js,tc=Object.isExtensible,rc=Zs((function(){tc(1)}))||ec?function(e){return!!$s(e)&&((!ec||"ArrayBuffer"!=Qs(e))&&(!tc||tc(e)))}:tc,nc=!L((function(){return Object.isExtensible(Object.preventExtensions({}))})),ic=bi,oc=ee,ac=jr,sc=ge,cc=ht,uc=nr.f,dc=bn,lc=Ms,fc=rc,hc=nc,pc=!1,_c=gt("meta"),vc=0,mc=function(e){uc(e,_c,{value:{objectID:"O"+vc++,weakData:{}}})},gc=Ps.exports={enable:function(){gc.enable=function(){},pc=!0;var e=dc.f,t=oc([].splice),r={};r[_c]=1,e(r).length&&(dc.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===_c){t(n,i,1);break}return n},ic({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:lc.f}))},fastKey:function(e,t){if(!sc(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!cc(e,_c)){if(!fc(e))return"F";if(!t)return"E";mc(e)}return e[_c].objectID},getWeakData:function(e,t){if(!cc(e,_c)){if(!fc(e))return!0;if(!t)return!1;mc(e)}return e[_c].weakData},onFreeze:function(e){return hc&&pc&&fc(e)&&!cc(e,_c)&&mc(e),e}};ac[_c]=!0;var yc=Ke,Ec=B,Sc=ee(ee.bind),bc=function(e,t){return yc(e),void 0===t?e:Ec?Sc(e,t):function(){return e.apply(t,arguments)}},Tc=va,Ic=wt("iterator"),Ac=Array.prototype,Rc=function(e){return void 0!==e&&(Tc.Array===e||Ac[Ic]===e)},Cc={};Cc[wt("toStringTag")]="z";var Oc="[object z]"===String(Cc),wc=M,Nc=Oc,kc=ve,Dc=ie,Pc=wt("toStringTag"),Mc=wc.Object,Uc="Arguments"==Dc(function(){return arguments}()),Lc=Nc?Dc:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Mc(e),Pc))?r:Uc?Dc(t):"Object"==(n=Dc(t))&&kc(t.callee)?"Arguments":n},xc=Lc,Bc=qe,Vc=va,jc=wt("iterator"),Fc=function(e){if(null!=e)return Bc(e,jc)||Bc(e,"@@iterator")||Vc[xc(e)]},Gc=F,zc=Ke,Hc=ur,Wc=ze,Yc=Fc,Kc=M.TypeError,Xc=function(e,t){var r=arguments.length<2?Yc(e):t;if(zc(r))return Hc(Gc(r,e));throw Kc(Wc(e)+" is not iterable")},qc=F,Jc=ur,Zc=qe,$c=function(e,t,r){var n,i;Jc(e);try{if(!(n=Zc(e,"return"))){if("throw"===t)throw r;return r}n=qc(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Jc(n),r},Qc=bc,eu=F,tu=ur,ru=ze,nu=Rc,iu=Mn,ou=Te,au=Xc,su=Fc,cu=$c,uu=M.TypeError,du=function(e,t){this.stopped=e,this.result=t},lu=du.prototype,fu=function(e,t,r){var n,i,o,a,s,c,u,d=r&&r.that,l=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),p=Qc(t,d),_=function(e){return n&&cu(n,"normal",e),new du(!0,e)},v=function(e){return l?(tu(e),h?p(e[0],e[1],_):p(e[0],e[1])):h?p(e,_):p(e)};if(f)n=e;else{if(!(i=su(e)))throw uu(ru(e)+" is not iterable");if(nu(i)){for(o=0,a=iu(e);a>o;o++)if((s=v(e[o]))&&ou(lu,s))return s;return new du(!1)}n=au(e,i)}for(c=n.next;!(u=eu(c,n)).done;){try{s=v(u.value)}catch(e){cu(n,"throw",e)}if("object"==typeof s&&s&&ou(lu,s))return s}return new du(!1)},hu=Te,pu=M.TypeError,_u=function(e,t){if(hu(t,e))return e;throw pu("Incorrect invocation")},vu=wt("iterator"),mu=!1;try{var gu=0,yu={next:function(){return{done:!!gu++}},return:function(){mu=!0}};yu[vu]=function(){return this},Array.from(yu,(function(){throw 2}))}catch(e){}var Eu=function(e,t){if(!t&&!mu)return!1;var r=!1;try{var n={};n[vu]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Su=ve,bu=ge,Tu=Qa,Iu=function(e,t,r){var n,i;return Tu&&Su(n=t.constructor)&&n!==r&&bu(i=n.prototype)&&i!==r.prototype&&Tu(e,i),e},Au=bi,Ru=M,Cu=ee,Ou=pi,wu=Ir.exports,Nu=Ps.exports,ku=fu,Du=_u,Pu=ve,Mu=ge,Uu=L,Lu=Eu,xu=Ba,Bu=Iu,Vu=function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=n?"set":"add",a=Ru[e],s=a&&a.prototype,c=a,u={},d=function(e){var t=Cu(s[e]);wu(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!Mu(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!Mu(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!Mu(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(Ou(e,!Pu(a)||!(i||s.forEach&&!Uu((function(){(new a).entries().next()})))))c=r.getConstructor(t,e,n,o),Nu.enable();else if(Ou(e,!0)){var l=new c,f=l[o](i?{}:-0,1)!=l,h=Uu((function(){l.has(1)})),p=Lu((function(e){new a(e)})),_=!i&&Uu((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((c=t((function(e,t){Du(e,s);var r=Bu(new a,e,c);return null!=t&&ku(t,r[o],{that:r,AS_ENTRIES:n}),r}))).prototype=s,s.constructor=c),(h||_)&&(d("delete"),d("has"),n&&d("get")),(_||f)&&d(o),i&&s.clear&&delete s.clear}return u[e]=c,Au({global:!0,forced:c!=a},u),xu(c,e),i||r.setStrong(c,e,n),c},ju=Ir.exports,Fu=function(e,t,r){for(var n in t)ju(e,n,t[n],r);return e},Gu=be,zu=nr,Hu=x,Wu=wt("species"),Yu=function(e){var t=Gu(e),r=zu.f;Hu&&t&&!t[Wu]&&r(t,Wu,{configurable:!0,get:function(){return this}})},Ku=nr.f,Xu=sa,qu=Fu,Ju=bc,Zu=_u,$u=fu,Qu=Es,ed=Yu,td=x,rd=Ps.exports.fastKey,nd=on.set,id=on.getterFor,od={getConstructor:function(e,t,r,n){var i=e((function(e,i){Zu(e,o),nd(e,{type:t,index:Xu(null),first:void 0,last:void 0,size:0}),td||(e.size=0),null!=i&&$u(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=id(t),s=function(e,t,r){var n,i,o=a(e),s=c(e,t);return s?s.value=r:(o.last=s={index:i=rd(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),td?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var r,n=a(e),i=rd(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return qu(o,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,td?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=c(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),td?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=Ju(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),qu(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),td&&Ku(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=id(t),o=id(n);Qu(e,t,(function(e,t){nd(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),ed(t)}};Vu("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),od);var ad=Lc,sd=Oc?{}.toString:function(){return"[object "+ad(this)+"]"},cd=Oc,ud=Ir.exports,dd=sd;cd||ud(Object.prototype,"toString",dd,{unsafe:!0});var ld=Lc,fd=M.String,hd=function(e){if("Symbol"===ld(e))throw TypeError("Cannot convert a Symbol value to a string");return fd(e)},pd=ee,_d=An,vd=hd,md=fe,gd=pd("".charAt),yd=pd("".charCodeAt),Ed=pd("".slice),Sd=function(e){return function(t,r){var n,i,o=vd(md(t)),a=_d(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=yd(o,a))<55296||n>56319||a+1===s||(i=yd(o,a+1))<56320||i>57343?e?gd(o,a):n:e?Ed(o,a,a+2):i-56320+(n-55296<<10)+65536}},bd={codeAt:Sd(!1),charAt:Sd(!0)},Td=bd.charAt,Id=hd,Ad=on,Rd=Es,Cd="String Iterator",Od=Ad.set,wd=Ad.getterFor(Cd);Rd(String,"String",(function(e){Od(this,{type:Cd,string:Id(e),index:0})}),(function(){var e,t=wd(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Td(r,n),t.index+=e.length,{value:e,done:!1})}));var Nd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},kd=Wt("span").classList,Dd=kd&&kd.constructor&&kd.constructor.prototype,Pd=Dd===Object.prototype?void 0:Dd,Md=M,Ud=Nd,Ld=Pd,xd=ks,Bd=Tr,Vd=wt,jd=Vd("iterator"),Fd=Vd("toStringTag"),Gd=xd.values,zd=function(e,t){if(e){if(e[jd]!==Gd)try{Bd(e,jd,Gd)}catch(t){e[jd]=Gd}if(e[Fd]||Bd(e,Fd,t),Ud[t])for(var r in xd)if(e[r]!==xd[r])try{Bd(e,r,xd[r])}catch(t){e[r]=xd[r]}}};for(var Hd in Ud)zd(Md[Hd]&&Md[Hd].prototype,Hd);zd(Ld,"DOMTokenList");var Wd=bi,Yd=x,Kd=nr.f;Wd({target:"Object",stat:!0,forced:Object.defineProperty!==Kd,sham:!Yd},{defineProperty:Kd});var Xd=ee([].slice),qd=ee,Jd=Ke,Zd=ge,$d=ht,Qd=Xd,el=B,tl=M.Function,rl=qd([].concat),nl=qd([].join),il={},ol=function(e,t,r){if(!$d(il,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";il[t]=tl("C,a","return new C("+nl(n,",")+")")}return il[t](e,r)},al=el?tl.bind:function(e){var t=Jd(this),r=t.prototype,n=Qd(arguments,1),i=function(){var r=rl(n,Qd(arguments));return this instanceof i?ol(t,r.length,r):t.apply(e,r)};return Zd(r)&&(i.prototype=r),i},sl=al;bi({target:"Function",proto:!0,forced:Function.bind!==sl},{bind:sl});var cl=L,ul=function(e,t){var r=[][e];return!!r&&cl((function(){r.call(null,t||function(){throw 1},1)}))},dl=bi,ll=de,fl=_e,hl=ul,pl=ee([].join),_l=ll!=Object,vl=hl("join",",");dl({target:"Array",proto:!0,forced:_l||!vl},{join:function(e){return pl(fl(this),void 0===e?",":e)}});var ml=ie,gl=Array.isArray||function(e){return"Array"==ml(e)},yl=ee,El=L,Sl=ve,bl=Lc,Tl=kr,Il=function(){},Al=[],Rl=be("Reflect","construct"),Cl=/^\s*(?:class|function)\b/,Ol=yl(Cl.exec),wl=!Cl.exec(Il),Nl=function(e){if(!Sl(e))return!1;try{return Rl(Il,Al,e),!0}catch(e){return!1}},kl=function(e){if(!Sl(e))return!1;switch(bl(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return wl||!!Ol(Cl,Tl(e))}catch(e){return!0}};kl.sham=!0;var Dl=!Rl||El((function(){var e;return Nl(Nl.call)||!Nl(Object)||!Nl((function(){e=!0}))||e}))?kl:Nl,Pl=M,Ml=gl,Ul=Dl,Ll=ge,xl=wt("species"),Bl=Pl.Array,Vl=function(e){var t;return Ml(e)&&(t=e.constructor,(Ul(t)&&(t===Bl||Ml(t.prototype))||Ll(t)&&null===(t=t[xl]))&&(t=void 0)),void 0===t?Bl:t},jl=function(e,t){return new(Vl(e))(0===t?0:t)},Fl=bc,Gl=de,zl=dt,Hl=Mn,Wl=jl,Yl=ee([].push),Kl=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,d,l){for(var f,h,p=zl(c),_=Gl(p),v=Fl(u,d),m=Hl(_),g=0,y=l||Wl,E=t?y(c,m):r||a?y(c,0):void 0;m>g;g++)if((s||g in _)&&(h=v(f=_[g],g,p),e))if(t)E[g]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return g;case 2:Yl(E,f)}else switch(e){case 4:return!1;case 7:Yl(E,f)}return o?-1:n||i?i:E}},Xl={forEach:Kl(0),map:Kl(1),filter:Kl(2),some:Kl(3),every:Kl(4),find:Kl(5),findIndex:Kl(6),filterReject:Kl(7)},ql=Xl.forEach,Jl=ul("forEach")?[].forEach:function(e){return ql(this,e,arguments.length>1?arguments[1]:void 0)};bi({target:"Array",proto:!0,forced:[].forEach!=Jl},{forEach:Jl});var Zl=M,$l=Nd,Ql=Pd,ef=Jl,tf=Tr,rf=function(e){if(e&&e.forEach!==ef)try{tf(e,"forEach",ef)}catch(t){e.forEach=ef}};for(var nf in $l)$l[nf]&&rf(Zl[nf]&&Zl[nf].prototype);rf(Ql);var of=bi,af=Xl.find,sf=_a,cf="find",uf=!0;cf in[]&&Array(1).find((function(){uf=!1})),of({target:"Array",proto:!0,forced:uf},{find:function(e){return af(this,e,arguments.length>1?arguments[1]:void 0)}}),sf(cf);var df=L,lf=ke,ff=wt("species"),hf=function(e){return lf>=51||!df((function(){var t=[];return(t.constructor={})[ff]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},pf=bi,_f=M,vf=L,mf=gl,gf=ge,yf=dt,Ef=Mn,Sf=Bs,bf=jl,Tf=hf,If=ke,Af=wt("isConcatSpreadable"),Rf=9007199254740991,Cf="Maximum allowed index exceeded",Of=_f.TypeError,wf=If>=51||!vf((function(){var e=[];return e[Af]=!1,e.concat()[0]!==e})),Nf=Tf("concat"),kf=function(e){if(!gf(e))return!1;var t=e[Af];return void 0!==t?!!t:mf(e)};pf({target:"Array",proto:!0,forced:!wf||!Nf},{concat:function(e){var t,r,n,i,o,a=yf(this),s=bf(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(kf(o=-1===t?a:arguments[t])){if(c+(i=Ef(o))>Rf)throw Of(Cf);for(r=0;r<i;r++,c++)r in o&&Sf(s,c,o[r])}else{if(c>=Rf)throw Of(Cf);Sf(s,c++,o)}return s.length=c,s}});var Df,Pf,Mf,Uf,Lf=M.Promise,xf=Dl,Bf=ze,Vf=M.TypeError,jf=function(e){if(xf(e))return e;throw Vf(Bf(e)+" is not a constructor")},Ff=ur,Gf=jf,zf=wt("species"),Hf=function(e,t){var r,n=Ff(e).constructor;return void 0===n||null==(r=Ff(n)[zf])?t:Gf(r)},Wf=B,Yf=Function.prototype,Kf=Yf.apply,Xf=Yf.call,qf="object"==typeof Reflect&&Reflect.apply||(Wf?Xf.bind(Kf):function(){return Xf.apply(Kf,arguments)}),Jf=M.TypeError,Zf=function(e,t){if(e<t)throw Jf("Not enough arguments");return e},$f=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ie),Qf="process"==ie(M.process),eh=M,th=qf,rh=bc,nh=ve,ih=ht,oh=L,ah=qo,sh=Xd,ch=Wt,uh=Zf,dh=$f,lh=Qf,fh=eh.setImmediate,hh=eh.clearImmediate,ph=eh.process,_h=eh.Dispatch,vh=eh.Function,mh=eh.MessageChannel,gh=eh.String,yh=0,Eh={},Sh="onreadystatechange";try{Df=eh.location}catch(e){}var bh=function(e){if(ih(Eh,e)){var t=Eh[e];delete Eh[e],t()}},Th=function(e){return function(){bh(e)}},Ih=function(e){bh(e.data)},Ah=function(e){eh.postMessage(gh(e),Df.protocol+"//"+Df.host)};fh&&hh||(fh=function(e){uh(arguments.length,1);var t=nh(e)?e:vh(e),r=sh(arguments,1);return Eh[++yh]=function(){th(t,void 0,r)},Pf(yh),yh},hh=function(e){delete Eh[e]},lh?Pf=function(e){ph.nextTick(Th(e))}:_h&&_h.now?Pf=function(e){_h.now(Th(e))}:mh&&!dh?(Uf=(Mf=new mh).port2,Mf.port1.onmessage=Ih,Pf=rh(Uf.postMessage,Uf)):eh.addEventListener&&nh(eh.postMessage)&&!eh.importScripts&&Df&&"file:"!==Df.protocol&&!oh(Ah)?(Pf=Ah,eh.addEventListener("message",Ih,!1)):Pf=Sh in ch("script")?function(e){ah.appendChild(ch("script")).onreadystatechange=function(){ah.removeChild(this),bh(e)}}:function(e){setTimeout(Th(e),0)});var Rh,Ch,Oh,wh,Nh,kh,Dh,Ph,Mh={set:fh,clear:hh},Uh=M,Lh=/ipad|iphone|ipod/i.test(Ie)&&void 0!==Uh.Pebble,xh=/web0s(?!.*chrome)/i.test(Ie),Bh=M,Vh=bc,jh=U.f,Fh=Mh.set,Gh=$f,zh=Lh,Hh=xh,Wh=Qf,Yh=Bh.MutationObserver||Bh.WebKitMutationObserver,Kh=Bh.document,Xh=Bh.process,qh=Bh.Promise,Jh=jh(Bh,"queueMicrotask"),Zh=Jh&&Jh.value;Zh||(Rh=function(){var e,t;for(Wh&&(e=Xh.domain)&&e.exit();Ch;){t=Ch.fn,Ch=Ch.next;try{t()}catch(e){throw Ch?wh():Oh=void 0,e}}Oh=void 0,e&&e.enter()},Gh||Wh||Hh||!Yh||!Kh?!zh&&qh&&qh.resolve?((Dh=qh.resolve(void 0)).constructor=qh,Ph=Vh(Dh.then,Dh),wh=function(){Ph(Rh)}):Wh?wh=function(){Xh.nextTick(Rh)}:(Fh=Vh(Fh,Bh),wh=function(){Fh(Rh)}):(Nh=!0,kh=Kh.createTextNode(""),new Yh(Rh).observe(kh,{characterData:!0}),wh=function(){kh.data=Nh=!Nh}));var $h=Zh||function(e){var t={fn:e,next:void 0};Oh&&(Oh.next=t),Ch||(Ch=t,wh()),Oh=t},Qh={},ep=Ke,tp=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=ep(t),this.reject=ep(r)};Qh.f=function(e){return new tp(e)};var rp=ur,np=ge,ip=Qh,op=M,ap=function(){this.head=null,this.tail=null};ap.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var sp,cp,up,dp,lp=ap,fp="object"==typeof window,hp=bi,pp=M,_p=be,vp=F,mp=Lf,gp=Ir.exports,yp=Fu,Ep=Qa,Sp=Ba,bp=Yu,Tp=Ke,Ip=ve,Ap=ge,Rp=_u,Cp=kr,Op=fu,wp=Eu,Np=Hf,kp=Mh.set,Dp=$h,Pp=function(e,t){if(rp(e),np(t)&&t.constructor===e)return t;var r=ip.f(e);return(0,r.resolve)(t),r.promise},Mp=function(e,t){var r=op.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Up=Qh,Lp=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},xp=lp,Bp=on,Vp=pi,jp=fp,Fp=Qf,Gp=ke,zp=wt("species"),Hp="Promise",Wp=Bp.getterFor(Hp),Yp=Bp.set,Kp=Bp.getterFor(Hp),Xp=mp&&mp.prototype,qp=mp,Jp=Xp,Zp=pp.TypeError,$p=pp.document,Qp=pp.process,e_=Up.f,t_=e_,r_=!!($p&&$p.createEvent&&pp.dispatchEvent),n_=Ip(pp.PromiseRejectionEvent),i_="unhandledrejection",o_=!1,a_=Vp(Hp,(function(){var e=Cp(qp),t=e!==String(qp);if(!t&&66===Gp)return!0;if(Gp>=51&&/native code/.test(e))return!1;var r=new qp((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[zp]=n,!(o_=r.then((function(){}))instanceof n)||!t&&jp&&!n_})),s_=a_||!wp((function(e){qp.all(e).catch((function(){}))})),c_=function(e){var t;return!(!Ap(e)||!Ip(t=e.then))&&t},u_=function(e,t){var r,n,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&p_(t),t.rejection=1),!0===s?r=o:(d&&d.enter(),r=s(o),d&&(d.exit(),i=!0)),r===e.promise?u(Zp("Promise-chain cycle")):(n=c_(r))?vp(n,r,c,u):c(r)):u(o)}catch(e){d&&!i&&d.exit(),u(e)}},d_=function(e,t){e.notified||(e.notified=!0,Dp((function(){for(var r,n=e.reactions;r=n.get();)u_(r,e);e.notified=!1,t&&!e.rejection&&f_(e)})))},l_=function(e,t,r){var n,i;r_?((n=$p.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),pp.dispatchEvent(n)):n={promise:t,reason:r},!n_&&(i=pp["on"+e])?i(n):e===i_&&Mp("Unhandled promise rejection",r)},f_=function(e){vp(kp,pp,(function(){var t,r=e.facade,n=e.value;if(h_(e)&&(t=Lp((function(){Fp?Qp.emit("unhandledRejection",n,r):l_(i_,r,n)})),e.rejection=Fp||h_(e)?2:1,t.error))throw t.value}))},h_=function(e){return 1!==e.rejection&&!e.parent},p_=function(e){vp(kp,pp,(function(){var t=e.facade;Fp?Qp.emit("rejectionHandled",t):l_("rejectionhandled",t,e.value)}))},__=function(e,t,r){return function(n){e(t,n,r)}},v_=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,d_(e,!0))},m_=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Zp("Promise can't be resolved itself");var n=c_(t);n?Dp((function(){var r={done:!1};try{vp(n,t,__(m_,r,e),__(v_,r,e))}catch(t){v_(r,t,e)}})):(e.value=t,e.state=1,d_(e,!1))}catch(t){v_({done:!1},t,e)}}};if(a_&&(Jp=(qp=function(e){Rp(this,Jp),Tp(e),vp(sp,this);var t=Wp(this);try{e(__(m_,t),__(v_,t))}catch(e){v_(t,e)}}).prototype,(sp=function(e){Yp(this,{type:Hp,done:!1,notified:!1,parent:!1,reactions:new xp,rejection:!1,state:0,value:void 0})}).prototype=yp(Jp,{then:function(e,t){var r=Kp(this),n=e_(Np(this,qp));return r.parent=!0,n.ok=!Ip(e)||e,n.fail=Ip(t)&&t,n.domain=Fp?Qp.domain:void 0,0==r.state?r.reactions.add(n):Dp((function(){u_(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),cp=function(){var e=new sp,t=Wp(e);this.promise=e,this.resolve=__(m_,t),this.reject=__(v_,t)},Up.f=e_=function(e){return e===qp||e===up?new cp(e):t_(e)},Ip(mp)&&Xp!==Object.prototype)){dp=Xp.then,o_||(gp(Xp,"then",(function(e,t){var r=this;return new qp((function(e,t){vp(dp,r,e,t)})).then(e,t)}),{unsafe:!0}),gp(Xp,"catch",Jp.catch,{unsafe:!0}));try{delete Xp.constructor}catch(e){}Ep&&Ep(Xp,Jp)}hp({global:!0,wrap:!0,forced:a_},{Promise:qp}),Sp(qp,Hp,!1),bp(Hp),up=_p(Hp),hp({target:Hp,stat:!0,forced:a_},{reject:function(e){var t=e_(this);return vp(t.reject,void 0,e),t.promise}}),hp({target:Hp,stat:!0,forced:a_},{resolve:function(e){return Pp(this,e)}}),hp({target:Hp,stat:!0,forced:s_},{all:function(e){var t=this,r=e_(t),n=r.resolve,i=r.reject,o=Lp((function(){var r=Tp(t.resolve),o=[],a=0,s=1;Op(e,(function(e){var c=a++,u=!1;s++,vp(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=e_(t),n=r.reject,i=Lp((function(){var i=Tp(t.resolve);Op(e,(function(e){vp(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),bi({target:"Array",stat:!0},{isArray:gl});var g_=bi,y_=M,E_=gl,S_=Dl,b_=ge,T_=wn,I_=Mn,A_=_e,R_=Bs,C_=wt,O_=Xd,w_=hf("slice"),N_=C_("species"),k_=y_.Array,D_=Math.max;g_({target:"Array",proto:!0,forced:!w_},{slice:function(e,t){var r,n,i,o=A_(this),a=I_(o),s=T_(e,a),c=T_(void 0===t?a:t,a);if(E_(o)&&(r=o.constructor,(S_(r)&&(r===k_||E_(r.prototype))||b_(r)&&null===(r=r[N_]))&&(r=void 0),r===k_||void 0===r))return O_(o,s,c);for(n=new(void 0===r?k_:r)(D_(c-s,0)),i=0;s<c;s++,i++)s in o&&R_(n,i,o[s]);return n.length=i,n}});var P_=Hs,M_=Math.floor,U_=function(e,t){var r=e.length,n=M_(r/2);return r<8?L_(e,t):x_(e,U_(P_(e,0,n),t),U_(P_(e,n),t),t)},L_=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},x_=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e},B_=U_,V_=Ie.match(/firefox\/(\d+)/i),j_=!!V_&&+V_[1],F_=/MSIE|Trident/.test(Ie),G_=Ie.match(/AppleWebKit\/(\d+)\./),z_=!!G_&&+G_[1],H_=bi,W_=ee,Y_=Ke,K_=dt,X_=Mn,q_=hd,J_=L,Z_=B_,$_=ul,Q_=j_,ev=F_,tv=ke,rv=z_,nv=[],iv=W_(nv.sort),ov=W_(nv.push),av=J_((function(){nv.sort(void 0)})),sv=J_((function(){nv.sort(null)})),cv=$_("sort"),uv=!J_((function(){if(tv)return tv<70;if(!(Q_&&Q_>3)){if(ev)return!0;if(rv)return rv<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)nv.push({k:t+n,v:r})}for(nv.sort((function(e,t){return t.v-e.v})),n=0;n<nv.length;n++)t=nv[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));H_({target:"Array",proto:!0,forced:av||!sv||!cv||!uv},{sort:function(e){void 0!==e&&Y_(e);var t=K_(this);if(uv)return void 0===e?iv(t):iv(t,e);var r,n,i=[],o=X_(t);for(n=0;n<o;n++)n in t&&ov(i,t[n]);for(Z_(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:q_(t)>q_(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<o;)delete t[n++];return t}});var dv="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,lv=An,fv=Dn,hv=M.RangeError,pv=function(e){if(void 0===e)return 0;var t=lv(e),r=fv(t);if(t!==r)throw hv("Wrong length or index");return r},_v=M.Array,vv=Math.abs,mv=Math.pow,gv=Math.floor,yv=Math.log,Ev=Math.LN2,Sv={pack:function(e,t,r){var n,i,o,a=_v(r),s=8*r-t-1,c=(1<<s)-1,u=c>>1,d=23===t?mv(2,-24)-mv(2,-77):0,l=e<0||0===e&&1/e<0?1:0,f=0;for((e=vv(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=gv(yv(e)/Ev),e*(o=mv(2,-n))<1&&(n--,o*=2),(e+=n+u>=1?d/o:d*mv(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*mv(2,t),n+=u):(i=e*mv(2,u-1)*mv(2,t),n=0));t>=8;)a[f++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)a[f++]=255&n,n/=256,s-=8;return a[--f]|=128*l,a},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=n-1,u=e[c--],d=127&u;for(u>>=7;s>0;)d=256*d+e[c--],s-=8;for(r=d&(1<<-s)-1,d>>=-s,s+=t;s>0;)r=256*r+e[c--],s-=8;if(0===d)d=1-a;else{if(d===o)return r?NaN:u?-1/0:1/0;r+=mv(2,t),d-=a}return(u?-1:1)*r*mv(2,d-t)}},bv=dt,Tv=wn,Iv=Mn,Av=function(e){for(var t=bv(this),r=Iv(t),n=arguments.length,i=Tv(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:Tv(o,r);a>i;)t[i++]=e;return t},Rv=M,Cv=ee,Ov=x,wv=dv,Nv=ln,kv=Tr,Dv=Fu,Pv=L,Mv=_u,Uv=An,Lv=Dn,xv=pv,Bv=Sv,Vv=Ra,jv=Qa,Fv=bn.f,Gv=nr.f,zv=Av,Hv=Hs,Wv=Ba,Yv=Nv.PROPER,Kv=Nv.CONFIGURABLE,Xv=on.get,qv=on.set,Jv="ArrayBuffer",Zv="DataView",$v="Wrong index",Qv=Rv.ArrayBuffer,em=Qv,tm=em&&em.prototype,rm=Rv.DataView,nm=rm&&rm.prototype,im=Object.prototype,om=Rv.Array,am=Rv.RangeError,sm=Cv(zv),cm=Cv([].reverse),um=Bv.pack,dm=Bv.unpack,lm=function(e){return[255&e]},fm=function(e){return[255&e,e>>8&255]},hm=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},pm=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},_m=function(e){return um(e,23,4)},vm=function(e){return um(e,52,8)},mm=function(e,t){Gv(e.prototype,t,{get:function(){return Xv(this)[t]}})},gm=function(e,t,r,n){var i=xv(r),o=Xv(e);if(i+t>o.byteLength)throw am($v);var a=Xv(o.buffer).bytes,s=i+o.byteOffset,c=Hv(a,s,s+t);return n?c:cm(c)},ym=function(e,t,r,n,i,o){var a=xv(r),s=Xv(e);if(a+t>s.byteLength)throw am($v);for(var c=Xv(s.buffer).bytes,u=a+s.byteOffset,d=n(+i),l=0;l<t;l++)c[u+l]=d[o?l:t-l-1]};if(wv){var Em=Yv&&Qv.name!==Jv;if(Pv((function(){Qv(1)}))&&Pv((function(){new Qv(-1)}))&&!Pv((function(){return new Qv,new Qv(1.5),new Qv(NaN),Em&&!Kv})))Em&&Kv&&kv(Qv,"name",Jv);else{(em=function(e){return Mv(this,tm),new Qv(xv(e))}).prototype=tm;for(var Sm,bm=Fv(Qv),Tm=0;bm.length>Tm;)(Sm=bm[Tm++])in em||kv(em,Sm,Qv[Sm]);tm.constructor=em}jv&&Vv(nm)!==im&&jv(nm,im);var Im=new rm(new em(2)),Am=Cv(nm.setInt8);Im.setInt8(0,2147483648),Im.setInt8(1,2147483649),!Im.getInt8(0)&&Im.getInt8(1)||Dv(nm,{setInt8:function(e,t){Am(this,e,t<<24>>24)},setUint8:function(e,t){Am(this,e,t<<24>>24)}},{unsafe:!0})}else tm=(em=function(e){Mv(this,tm);var t=xv(e);qv(this,{bytes:sm(om(t),0),byteLength:t}),Ov||(this.byteLength=t)}).prototype,nm=(rm=function(e,t,r){Mv(this,nm),Mv(e,tm);var n=Xv(e).byteLength,i=Uv(t);if(i<0||i>n)throw am("Wrong offset");if(i+(r=void 0===r?n-i:Lv(r))>n)throw am("Wrong length");qv(this,{buffer:e,byteLength:r,byteOffset:i}),Ov||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,Ov&&(mm(em,"byteLength"),mm(rm,"buffer"),mm(rm,"byteLength"),mm(rm,"byteOffset")),Dv(nm,{getInt8:function(e){return gm(this,1,e)[0]<<24>>24},getUint8:function(e){return gm(this,1,e)[0]},getInt16:function(e){var t=gm(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=gm(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return pm(gm(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return pm(gm(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return dm(gm(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return dm(gm(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){ym(this,1,e,lm,t)},setUint8:function(e,t){ym(this,1,e,lm,t)},setInt16:function(e,t){ym(this,2,e,fm,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){ym(this,2,e,fm,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){ym(this,4,e,hm,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){ym(this,4,e,hm,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){ym(this,4,e,_m,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){ym(this,8,e,vm,t,arguments.length>2?arguments[2]:void 0)}});Wv(em,Jv),Wv(rm,Zv);var Rm={ArrayBuffer:em,DataView:rm},Cm=bi,Om=ee,wm=L,Nm=ur,km=wn,Dm=Dn,Pm=Hf,Mm=Rm.ArrayBuffer,Um=Rm.DataView,Lm=Um.prototype,xm=Om(Mm.prototype.slice),Bm=Om(Lm.getUint8),Vm=Om(Lm.setUint8);Cm({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:wm((function(){return!new Mm(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(xm&&void 0===t)return xm(Nm(this),e);for(var r=Nm(this).byteLength,n=km(e,r),i=km(void 0===t?r:t,r),o=new(Pm(this,Mm))(Dm(i-n)),a=new Um(this),s=new Um(o),c=0;n<i;)Vm(s,c++,Bm(a,n++));return o}});var jm,Fm,Gm,zm={exports:{}},Hm=dv,Wm=x,Ym=M,Km=ve,Xm=ge,qm=ht,Jm=Lc,Zm=ze,$m=Tr,Qm=Ir.exports,eg=nr.f,tg=Te,rg=Ra,ng=Qa,ig=wt,og=gt,ag=Ym.Int8Array,sg=ag&&ag.prototype,cg=Ym.Uint8ClampedArray,ug=cg&&cg.prototype,dg=ag&&rg(ag),lg=sg&&rg(sg),fg=Object.prototype,hg=Ym.TypeError,pg=ig("toStringTag"),_g=og("TYPED_ARRAY_TAG"),vg=og("TYPED_ARRAY_CONSTRUCTOR"),mg=Hm&&!!ng&&"Opera"!==Jm(Ym.opera),gg=!1,yg={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Eg={BigInt64Array:8,BigUint64Array:8},Sg=function(e){if(!Xm(e))return!1;var t=Jm(e);return qm(yg,t)||qm(Eg,t)};for(jm in yg)(Gm=(Fm=Ym[jm])&&Fm.prototype)?$m(Gm,vg,Fm):mg=!1;for(jm in Eg)(Gm=(Fm=Ym[jm])&&Fm.prototype)&&$m(Gm,vg,Fm);if((!mg||!Km(dg)||dg===Function.prototype)&&(dg=function(){throw hg("Incorrect invocation")},mg))for(jm in yg)Ym[jm]&&ng(Ym[jm],dg);if((!mg||!lg||lg===fg)&&(lg=dg.prototype,mg))for(jm in yg)Ym[jm]&&ng(Ym[jm].prototype,lg);if(mg&&rg(ug)!==lg&&ng(ug,lg),Wm&&!qm(lg,pg))for(jm in gg=!0,eg(lg,pg,{get:function(){return Xm(this)?this[_g]:void 0}}),yg)Ym[jm]&&$m(Ym[jm],_g,jm);var bg={NATIVE_ARRAY_BUFFER_VIEWS:mg,TYPED_ARRAY_CONSTRUCTOR:vg,TYPED_ARRAY_TAG:gg&&_g,aTypedArray:function(e){if(Sg(e))return e;throw hg("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Km(e)&&(!ng||tg(dg,e)))return e;throw hg(Zm(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(Wm){if(r)for(var i in yg){var o=Ym[i];if(o&&qm(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}lg[e]&&!r||Qm(lg,e,r?t:mg&&sg[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(Wm){if(ng){if(r)for(n in yg)if((i=Ym[n])&&qm(i,e))try{delete i[e]}catch(e){}if(dg[e]&&!r)return;try{return Qm(dg,e,r?t:mg&&dg[e]||t)}catch(e){}}for(n in yg)!(i=Ym[n])||i[e]&&!r||Qm(i,e,t)}},isView:function(e){if(!Xm(e))return!1;var t=Jm(e);return"DataView"===t||qm(yg,t)||qm(Eg,t)},isTypedArray:Sg,TypedArray:dg,TypedArrayPrototype:lg},Tg=M,Ig=L,Ag=Eu,Rg=bg.NATIVE_ARRAY_BUFFER_VIEWS,Cg=Tg.ArrayBuffer,Og=Tg.Int8Array,wg=!Rg||!Ig((function(){Og(1)}))||!Ig((function(){new Og(-1)}))||!Ag((function(e){new Og,new Og(null),new Og(1.5),new Og(e)}),!0)||Ig((function(){return 1!==new Og(new Cg(2),1,void 0).length})),Ng=ge,kg=Math.floor,Dg=Number.isInteger||function(e){return!Ng(e)&&isFinite(e)&&kg(e)===e},Pg=An,Mg=M.RangeError,Ug=function(e){var t=Pg(e);if(t<0)throw Mg("The argument can't be less than 0");return t},Lg=M.RangeError,xg=function(e,t){var r=Ug(e);if(r%t)throw Lg("Wrong offset");return r},Bg=bc,Vg=F,jg=jf,Fg=dt,Gg=Mn,zg=Xc,Hg=Fc,Wg=Rc,Yg=bg.aTypedArrayConstructor,Kg=bi,Xg=M,qg=F,Jg=x,Zg=wg,$g=bg,Qg=Rm,ey=_u,ty=X,ry=Tr,ny=Dg,iy=Dn,oy=pv,ay=xg,sy=Ft,cy=ht,uy=Lc,dy=ge,ly=Fe,fy=sa,hy=Te,py=Qa,_y=bn.f,vy=function(e){var t,r,n,i,o,a,s=jg(this),c=Fg(e),u=arguments.length,d=u>1?arguments[1]:void 0,l=void 0!==d,f=Hg(c);if(f&&!Wg(f))for(a=(o=zg(c,f)).next,c=[];!(i=Vg(a,o)).done;)c.push(i.value);for(l&&u>2&&(d=Bg(d,arguments[2])),r=Gg(c),n=new(Yg(s))(r),t=0;r>t;t++)n[t]=l?d(c[t],t):c[t];return n},my=Xl.forEach,gy=Yu,yy=nr,Ey=U,Sy=Iu,by=on.get,Ty=on.set,Iy=yy.f,Ay=Ey.f,Ry=Math.round,Cy=Xg.RangeError,Oy=Qg.ArrayBuffer,wy=Oy.prototype,Ny=Qg.DataView,ky=$g.NATIVE_ARRAY_BUFFER_VIEWS,Dy=$g.TYPED_ARRAY_CONSTRUCTOR,Py=$g.TYPED_ARRAY_TAG,My=$g.TypedArray,Uy=$g.TypedArrayPrototype,Ly=$g.aTypedArrayConstructor,xy=$g.isTypedArray,By="BYTES_PER_ELEMENT",Vy="Wrong length",jy=function(e,t){Ly(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},Fy=function(e,t){Iy(e,t,{get:function(){return by(this)[t]}})},Gy=function(e){var t;return hy(wy,e)||"ArrayBuffer"==(t=uy(e))||"SharedArrayBuffer"==t},zy=function(e,t){return xy(e)&&!ly(t)&&t in e&&ny(+t)&&t>=0},Hy=function(e,t){return t=sy(t),zy(e,t)?ty(2,e[t]):Ay(e,t)},Wy=function(e,t,r){return t=sy(t),!(zy(e,t)&&dy(r)&&cy(r,"value"))||cy(r,"get")||cy(r,"set")||r.configurable||cy(r,"writable")&&!r.writable||cy(r,"enumerable")&&!r.enumerable?Iy(e,t,r):(e[t]=r.value,e)};Jg?(ky||(Ey.f=Hy,yy.f=Wy,Fy(Uy,"buffer"),Fy(Uy,"byteOffset"),Fy(Uy,"byteLength"),Fy(Uy,"length")),Kg({target:"Object",stat:!0,forced:!ky},{getOwnPropertyDescriptor:Hy,defineProperty:Wy}),zm.exports=function(e,t,r){var n=e.match(/\d+$/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=Xg[i],c=s,u=c&&c.prototype,d={},l=function(e,t){Iy(e,t,{get:function(){return function(e,t){var r=by(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=by(e);r&&(i=(i=Ry(i))<0?0:i>255?255:255&i),o.view[a](t*n+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};ky?Zg&&(c=t((function(e,t,r,i){return ey(e,u),Sy(dy(t)?Gy(t)?void 0!==i?new s(t,ay(r,n),i):void 0!==r?new s(t,ay(r,n)):new s(t):xy(t)?jy(c,t):qg(vy,c,t):new s(oy(t)),e,c)})),py&&py(c,My),my(_y(s),(function(e){e in c||ry(c,e,s[e])})),c.prototype=u):(c=t((function(e,t,r,i){ey(e,u);var o,a,s,d=0,f=0;if(dy(t)){if(!Gy(t))return xy(t)?jy(c,t):qg(vy,c,t);o=t,f=ay(r,n);var h=t.byteLength;if(void 0===i){if(h%n)throw Cy(Vy);if((a=h-f)<0)throw Cy(Vy)}else if((a=iy(i)*n)+f>h)throw Cy(Vy);s=a/n}else s=oy(t),o=new Oy(a=s*n);for(Ty(e,{buffer:o,byteOffset:f,byteLength:a,length:s,view:new Ny(o)});d<s;)l(e,d++)})),py&&py(c,My),u=c.prototype=fy(Uy)),u.constructor!==c&&ry(u,"constructor",c),ry(u,Dy,c),Py&&ry(u,Py,i),d[i]=c,Kg({global:!0,forced:c!=s,sham:!ky},d),By in c||ry(c,By,n),By in u||ry(u,By,n),gy(i)}):zm.exports=function(){},(0,zm.exports)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var Yy=dt,Ky=wn,Xy=Mn,qy=Math.min,Jy=[].copyWithin||function(e,t){var r=Yy(this),n=Xy(r),i=Ky(e,n),o=Ky(t,n),a=arguments.length>2?arguments[2]:void 0,s=qy((void 0===a?n:Ky(a,n))-o,n-i),c=1;for(o<i&&i<o+s&&(c=-1,o+=s-1,i+=s-1);s-- >0;)o in r?r[i]=r[o]:delete r[i],i+=c,o+=c;return r},Zy=bg,$y=ee(Jy),Qy=Zy.aTypedArray;(0,Zy.exportTypedArrayMethod)("copyWithin",(function(e,t){return $y(Qy(this),e,t,arguments.length>2?arguments[2]:void 0)}));var eE=Xl.every,tE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("every",(function(e){return eE(tE(this),e,arguments.length>1?arguments[1]:void 0)}));var rE=F,nE=Av,iE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return rE(nE,iE(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}));var oE=Mn,aE=Hf,sE=bg.TYPED_ARRAY_CONSTRUCTOR,cE=bg.aTypedArrayConstructor,uE=function(e){return cE(aE(e,e[sE]))},dE=function(e,t){for(var r=0,n=oE(t),i=new e(n);n>r;)i[r]=t[r++];return i},lE=uE,fE=Xl.filter,hE=function(e,t){return dE(lE(e),t)},pE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("filter",(function(e){var t=fE(pE(this),e,arguments.length>1?arguments[1]:void 0);return hE(this,t)}));var _E=Xl.find,vE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("find",(function(e){return _E(vE(this),e,arguments.length>1?arguments[1]:void 0)}));var mE=Xl.findIndex,gE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("findIndex",(function(e){return mE(gE(this),e,arguments.length>1?arguments[1]:void 0)}));var yE=Xl.forEach,EE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("forEach",(function(e){yE(EE(this),e,arguments.length>1?arguments[1]:void 0)}));var SE=Vn.includes,bE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("includes",(function(e){return SE(bE(this),e,arguments.length>1?arguments[1]:void 0)}));var TE=Vn.indexOf,IE=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("indexOf",(function(e){return TE(IE(this),e,arguments.length>1?arguments[1]:void 0)}));var AE=M,RE=L,CE=ee,OE=bg,wE=ks,NE=wt("iterator"),kE=AE.Uint8Array,DE=CE(wE.values),PE=CE(wE.keys),ME=CE(wE.entries),UE=OE.aTypedArray,LE=OE.exportTypedArrayMethod,xE=kE&&kE.prototype,BE=!RE((function(){xE[NE].call([1])})),VE=!!xE&&xE.values&&xE[NE]===xE.values&&"values"===xE.values.name,jE=function(){return DE(UE(this))};LE("entries",(function(){return ME(UE(this))}),BE),LE("keys",(function(){return PE(UE(this))}),BE),LE("values",jE,BE||!VE,{name:"values"}),LE(NE,jE,BE||!VE,{name:"values"});var FE=bg.aTypedArray,GE=bg.exportTypedArrayMethod,zE=ee([].join);GE("join",(function(e){return zE(FE(this),e)}));var HE=qf,WE=_e,YE=An,KE=Mn,XE=ul,qE=Math.min,JE=[].lastIndexOf,ZE=!!JE&&1/[1].lastIndexOf(1,-0)<0,$E=XE("lastIndexOf"),QE=ZE||!$E?function(e){if(ZE)return HE(JE,this,arguments)||0;var t=WE(this),r=KE(t),n=r-1;for(arguments.length>1&&(n=qE(n,YE(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:JE,eS=qf,tS=QE,rS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return eS(tS,rS(this),t>1?[e,arguments[1]]:[e])}));var nS=Xl.map,iS=uE,oS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("map",(function(e){return nS(oS(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(iS(e))(t)}))}));var aS=Ke,sS=dt,cS=de,uS=Mn,dS=M.TypeError,lS=function(e){return function(t,r,n,i){aS(r);var o=sS(t),a=cS(o),s=uS(o),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw dS("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(i=r(i,a[c],c,o));return i}},fS={left:lS(!1),right:lS(!0)},hS=fS.left,pS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return hS(pS(this),e,t,t>1?arguments[1]:void 0)}));var _S=fS.right,vS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return _S(vS(this),e,t,t>1?arguments[1]:void 0)}));var mS=bg.aTypedArray,gS=bg.exportTypedArrayMethod,yS=Math.floor;gS("reverse",(function(){for(var e,t=this,r=mS(t).length,n=yS(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var ES=M,SS=F,bS=bg,TS=Mn,IS=xg,AS=dt,RS=L,CS=ES.RangeError,OS=ES.Int8Array,wS=OS&&OS.prototype,NS=wS&&wS.set,kS=bS.aTypedArray,DS=bS.exportTypedArrayMethod,PS=!RS((function(){var e=new Uint8ClampedArray(2);return SS(NS,e,{length:1,0:3},1),3!==e[1]})),MS=PS&&bS.NATIVE_ARRAY_BUFFER_VIEWS&&RS((function(){var e=new OS(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));DS("set",(function(e){kS(this);var t=IS(arguments.length>1?arguments[1]:void 0,1),r=AS(e);if(PS)return SS(NS,this,r,t);var n=this.length,i=TS(r),o=0;if(i+t>n)throw CS("Wrong length");for(;o<i;)this[t+o]=r[o++]}),!PS||MS);var US=uE,LS=Xd,xS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("slice",(function(e,t){for(var r=LS(xS(this),e,t),n=US(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),L((function(){new Int8Array(1).slice()})));var BS=Xl.some,VS=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("some",(function(e){return BS(VS(this),e,arguments.length>1?arguments[1]:void 0)}));var jS=M,FS=ee,GS=L,zS=Ke,HS=B_,WS=bg,YS=j_,KS=F_,XS=ke,qS=z_,JS=jS.Array,ZS=WS.aTypedArray,$S=WS.exportTypedArrayMethod,QS=jS.Uint16Array,eb=QS&&FS(QS.prototype.sort),tb=!(!eb||GS((function(){eb(new QS(2),null)}))&&GS((function(){eb(new QS(2),{})}))),rb=!!eb&&!GS((function(){if(XS)return XS<74;if(YS)return YS<67;if(KS)return!0;if(qS)return qS<602;var e,t,r=new QS(516),n=JS(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(eb(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));$S("sort",(function(e){return void 0!==e&&zS(e),rb?eb(this,e):HS(ZS(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!rb||tb);var nb=Dn,ib=wn,ob=uE,ab=bg.aTypedArray;(0,bg.exportTypedArrayMethod)("subarray",(function(e,t){var r=ab(this),n=r.length,i=ib(e,n);return new(ob(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,nb((void 0===t?n:ib(t,n))-i))}));var sb=qf,cb=bg,ub=L,db=Xd,lb=M.Int8Array,fb=cb.aTypedArray,hb=cb.exportTypedArrayMethod,pb=[].toLocaleString,_b=!!lb&&ub((function(){pb.call(new lb(1))}));hb("toLocaleString",(function(){return sb(pb,_b?db(fb(this)):fb(this),db(arguments))}),ub((function(){return[1,2].toLocaleString()!=new lb([1,2]).toLocaleString()}))||!ub((function(){lb.prototype.toLocaleString.call([1,2])})));var vb=bg.exportTypedArrayMethod,mb=L,gb=ee,yb=M.Uint8Array,Eb=yb&&yb.prototype||{},Sb=[].toString,bb=gb([].join);mb((function(){Sb.call({})}))&&(Sb=function(){return bb(this)});var Tb=Eb.toString!=Sb;vb("toString",Sb,Tb);var Ib=bi,Ab=M,Rb=qf,Cb=ve,Ob=Xd,wb=Zf,Nb=/MSIE .\./.test(Ie),kb=Ab.Function,Db=function(e){return function(t,r){var n=wb(arguments.length,1)>2,i=Cb(t)?t:kb(t),o=n?Ob(arguments,2):void 0;return e(n?function(){Rb(i,this,o)}:i,r)}};Ib({global:!0,bind:!0,forced:Nb},{setTimeout:Db(Ab.setTimeout),setInterval:Db(Ab.setInterval)});var Pb=bi,Mb=Xl.findIndex,Ub=_a,Lb="findIndex",xb=!0;Lb in[]&&Array(1).findIndex((function(){xb=!1})),Pb({target:"Array",proto:!0,forced:xb},{findIndex:function(e){return Mb(this,e,arguments.length>1?arguments[1]:void 0)}}),Ub(Lb);var Bb=bi,Vb=M,jb=wn,Fb=An,Gb=Mn,zb=dt,Hb=jl,Wb=Bs,Yb=hf("splice"),Kb=Vb.TypeError,Xb=Math.max,qb=Math.min,Jb=9007199254740991,Zb="Maximum allowed length exceeded";Bb({target:"Array",proto:!0,forced:!Yb},{splice:function(e,t){var r,n,i,o,a,s,c=zb(this),u=Gb(c),d=jb(e,u),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=u-d):(r=l-2,n=qb(Xb(Fb(t),0),u-d)),u+r-n>Jb)throw Kb(Zb);for(i=Hb(c,n),o=0;o<n;o++)(a=d+o)in c&&Wb(i,o,c[a]);if(i.length=n,r<n){for(o=d;o<u-n;o++)s=o+r,(a=o+n)in c?c[s]=c[a]:delete c[s];for(o=u;o>u-n+r;o--)delete c[o-1]}else if(r>n)for(o=u-n;o>d;o--)s=o+r-1,(a=o+n-1)in c?c[s]=c[a]:delete c[s];for(o=0;o<r;o++)c[o+d]=arguments[o+2];return c.length=u-n+r,i}});var $b=ee(1..valueOf),Qb="\t\n\v\f\r                 \u2028\u2029\ufeff",eT=fe,tT=hd,rT=ee("".replace),nT="[\t\n\v\f\r                 \u2028\u2029\ufeff]",iT=RegExp("^"+nT+nT+"*"),oT=RegExp(nT+nT+"*$"),aT=function(e){return function(t){var r=tT(eT(t));return 1&e&&(r=rT(r,iT,"")),2&e&&(r=rT(r,oT,"")),r}},sT={start:aT(1),end:aT(2),trim:aT(3)},cT=x,uT=M,dT=ee,lT=pi,fT=Ir.exports,hT=ht,pT=Iu,_T=Te,vT=Fe,mT=Bt,gT=L,yT=bn.f,ET=U.f,ST=nr.f,bT=$b,TT=sT.trim,IT="Number",AT=uT.Number,RT=AT.prototype,CT=uT.TypeError,OT=dT("".slice),wT=dT("".charCodeAt),NT=function(e){var t=mT(e,"number");return"bigint"==typeof t?t:kT(t)},kT=function(e){var t,r,n,i,o,a,s,c,u=mT(e,"number");if(vT(u))throw CT("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=TT(u),43===(t=wT(u,0))||45===t){if(88===(r=wT(u,2))||120===r)return NaN}else if(48===t){switch(wT(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(a=(o=OT(u,2)).length,s=0;s<a;s++)if((c=wT(o,s))<48||c>i)return NaN;return parseInt(o,n)}return+u};if(lT(IT,!AT(" 0o1")||!AT("0b1")||AT("+0x1"))){for(var DT,PT=function(e){var t=arguments.length<1?0:AT(NT(e)),r=this;return _T(RT,r)&&gT((function(){bT(r)}))?pT(Object(t),r,PT):t},MT=cT?yT(AT):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),UT=0;MT.length>UT;UT++)hT(AT,DT=MT[UT])&&!hT(PT,DT)&&ST(PT,DT,ET(AT,DT));PT.prototype=RT,RT.constructor=PT,fT(uT,IT,PT)}var LT=Vn.includes,xT=_a;bi({target:"Array",proto:!0},{includes:function(e){return LT(this,e,arguments.length>1?arguments[1]:void 0)}}),xT("includes");var BT=ge,VT=ie,jT=wt("match"),FT=function(e){var t;return BT(e)&&(void 0!==(t=e[jT])?!!t:"RegExp"==VT(e))},GT=FT,zT=M.TypeError,HT=function(e){if(GT(e))throw zT("The method doesn't accept regular expressions");return e},WT=wt("match"),YT=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[WT]=!1,"/./"[e](t)}catch(e){}}return!1},KT=bi,XT=HT,qT=fe,JT=hd,ZT=YT,$T=ee("".indexOf);KT({target:"String",proto:!0,forced:!ZT("includes")},{includes:function(e){return!!~$T(JT(qT(this)),JT(XT(e)),arguments.length>1?arguments[1]:void 0)}});var QT=Yu,eI="ArrayBuffer",tI=Rm.ArrayBuffer;bi({global:!0,forced:M.ArrayBuffer!==tI},{ArrayBuffer:tI}),QT(eI);var rI=dt,nI=Fo;bi({target:"Object",stat:!0,forced:L((function(){nI(1)}))},{keys:function(e){return nI(rI(e))}});var iI,oI,aI=ur,sI=function(){var e=aI(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},cI=L,uI=M.RegExp,dI=cI((function(){var e=uI("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),lI=dI||cI((function(){return!uI("a","y").sticky})),fI={BROKEN_CARET:dI||cI((function(){var e=uI("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:lI,UNSUPPORTED_Y:dI},hI=L,pI=M.RegExp,_I=hI((function(){var e=pI(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),vI=L,mI=M.RegExp,gI=vI((function(){var e=mI("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),yI=F,EI=ee,SI=hd,bI=sI,TI=fI,II=et.exports,AI=sa,RI=on.get,CI=_I,OI=gI,wI=II("native-string-replace",String.prototype.replace),NI=RegExp.prototype.exec,kI=NI,DI=EI("".charAt),PI=EI("".indexOf),MI=EI("".replace),UI=EI("".slice),LI=(oI=/b*/g,yI(NI,iI=/a/,"a"),yI(NI,oI,"a"),0!==iI.lastIndex||0!==oI.lastIndex),xI=TI.BROKEN_CARET,BI=void 0!==/()??/.exec("")[1];(LI||BI||xI||CI||OI)&&(kI=function(e){var t,r,n,i,o,a,s,c=this,u=RI(c),d=SI(e),l=u.raw;if(l)return l.lastIndex=c.lastIndex,t=yI(kI,l,d),c.lastIndex=l.lastIndex,t;var f=u.groups,h=xI&&c.sticky,p=yI(bI,c),_=c.source,v=0,m=d;if(h&&(p=MI(p,"y",""),-1===PI(p,"g")&&(p+="g"),m=UI(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==DI(d,c.lastIndex-1))&&(_="(?: "+_+")",m=" "+m,v++),r=new RegExp("^(?:"+_+")",p)),BI&&(r=new RegExp("^"+_+"$(?!\\s)",p)),LI&&(n=c.lastIndex),i=yI(NI,h?r:c,m),h?i?(i.input=UI(i.input,v),i[0]=UI(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:LI&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),BI&&i&&i.length>1&&yI(wI,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&f)for(i.groups=a=AI(null),o=0;o<f.length;o++)a[(s=f[o])[0]]=i[s[1]];return i});var VI,jI,FI=kI;bi({target:"RegExp",proto:!0,forced:/./.exec!==FI},{exec:FI}),function(e){e.INVALID_ENGINE="INVALID_ENGINE",e.INVALID_PARAMS="INVALID_PARAMS",e.INVALID_TOKEN="INVALID_TOKEN",e.JOIN_ROOM_FAILED="JOIN_ROOM_FAILED",e.REPEAT_JOIN="REPEAT_JOIN",e.REPEAT_PUBLISH="REPEAT_PUBLISH",e.PUBLISH_BEFORE_JOIN="PUBLISH_BEFORE_JOIN",e.UNPUBLISH_BEFORE_JOIN="UNPUBLISH_BEFORE_JOIN",e.SUBSCRIBE_BEFORE_JOIN="SUBSCRIBE_BEFORE_JOIN",e.UNSUBSCRIBE_BEFORE_JOIN="UNSUBSCRIBE_BEFORE_JOIN",e.NO_PUBLISH_PERMISSION="NO_PUBLISH_PERMISSION",e.STREAM_NOT_EXIST="STREAM_NOT_EXIST",e.EMPTY_STREAM="EMPTY_STREAM",e.NOT_CONNECTED_YET="NOT_CONNECTED_YET",e.IM_BEFORE_JOIN="IM_BEFORE_JOIN",e.USER_NOT_EXIST="USER_NOT_EXIST",e.ALREADY_IN_ROOM="ALREADY_IN_ROOM",e.DUPLICATE_LOGIN="DUPLICATE_LOGIN",e.REPEAT_CAPTURE="REPEAT_CAPTURE",e.GET_VIDEO_TRACK_FAILED="GET_VIDEO_TRACK_FAILED",e.GET_AUDIO_TRACK_FAILED="GET_AUDIO_TRACK_FAILED",e.GET_SCREEN_TRACK_FAILED="GET_SCREEN_TRACK_FAILED",e.STREAM_TYPE_NOT_MATCH="STREAM_TYPE_NOT_MATCH",e.CANT_FIND_DOM="CANT_FIND_DOM",e.INVALID_DEVICE_ID="INVALID_DEVICE_ID",e.NO_PERMISSION="NO_PERMISSION",e.NOT_SUPPORTED="NOT_SUPPORTED",e.ICE_SERVER_WRONG="ICE_SERVER_WRONG",e.ESTABLISH_DATACHANNEL_FAILED="ESTABLISH_DATACHANNEL_FAILED",e.LOAD_RESOURCES_FAILED="LOAD_RESOURCES_FAILED",e.SIGNALING_CHANNEL_NOT_OPEN="SIGNALING_CHANNEL_NOT_OPEN",e.TIME_OUT="TIME_OUT",e.REFUSE_OPERATION_IN_DISCONNECT="REFUSE_OPERATION_IN_DISCONNECT",e.ADD_TRANSCEIVER_FAILED="ADD_TRANSCEIVER_FAILED",e.UPDATE_TRACK_FAILED="UPDATE_TRACK_FAILED",e.PUBLISH_FAILED="PUBLISH_FAILED",e.UNPUBLISH_FAILED="UNPUBLISH_FAILED",e.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",e.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",e.OPERATION_CANCEL="OPERATION_CANCEL",e.UNEXPECTED_ERROR="UNEXPECTED_ERROR"}(VI||(VI={})),function(e){e[e.AUDIO_MIXING_ERROR_OK=0]="AUDIO_MIXING_ERROR_OK",e[e.AUDIO_MIXING_ERROR_PRELOAD_FAILED=1]="AUDIO_MIXING_ERROR_PRELOAD_FAILED",e[e.AUDIO_MIXING_ERROR_START_FAILED=2]="AUDIO_MIXING_ERROR_START_FAILED",e[e.AUDIO_MIXING_ERROR_ID_NOT_FOUND=3]="AUDIO_MIXING_ERROR_ID_NOT_FOUND",e[e.AUDIO_MIXING_ERROR_SET_POSITION_FAILED=4]="AUDIO_MIXING_ERROR_SET_POSITION_FAILED",e[e.AUDIO_MIXING_ERROR_INVALID_VOLUME=5]="AUDIO_MIXING_ERROR_INVALID_VOLUME",e[e.AUDIO_MIXING_ERROR_LOAD_CONFLICT=6]="AUDIO_MIXING_ERROR_LOAD_CONFLICT",e[e.AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH=7]="AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH",e[e.AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH=8]="AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH",e[e.AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK=9]="AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK"}(jI||(jI={}));var GI=function(e,t,r){this.code=e,this.message=t,this.error=r};function zI(e){return zI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zI(e)}var HI=x,WI=ee,YI=Fo,KI=_e,XI=WI(G.f),qI=WI([].push),JI=function(e){return function(t){for(var r,n=KI(t),i=YI(n),o=i.length,a=0,s=[];o>a;)r=i[a++],HI&&!XI(n,r)||qI(s,e?[r,n[r]]:n[r]);return s}},ZI={entries:JI(!0),values:JI(!1)}.entries;bi({target:"Object",stat:!0},{entries:function(e){return ZI(e)}});var $I=ee,QI=Ir.exports,eA=FI,tA=L,rA=wt,nA=Tr,iA=rA("species"),oA=RegExp.prototype,aA=function(e,t,r,n){var i=rA(e),o=!tA((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!tA((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[iA]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var s=$I(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var a=$I(e),c=t.exec;return c===eA||c===oA.exec?o&&!i?{done:!0,value:s(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));QI(String.prototype,e,c[0]),QI(oA,i,c[1])}n&&nA(oA[i],"sham",!0)},sA=bd.charAt,cA=function(e,t,r){return t+(r?sA(e,t).length:1)},uA=F,dA=ur,lA=ve,fA=ie,hA=FI,pA=M.TypeError,_A=function(e,t){var r=e.exec;if(lA(r)){var n=uA(r,e,t);return null!==n&&dA(n),n}if("RegExp"===fA(e))return uA(hA,e,t);throw pA("RegExp#exec called on incompatible receiver")},vA=F,mA=ur,gA=Dn,yA=hd,EA=fe,SA=qe,bA=cA,TA=_A;aA("match",(function(e,t,r){return[function(t){var r=EA(this),n=null==t?void 0:SA(t,e);return n?vA(n,t,r):new RegExp(t)[e](yA(r))},function(e){var n=mA(this),i=yA(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return TA(n,i);var a=n.unicode;n.lastIndex=0;for(var s,c=[],u=0;null!==(s=TA(n,i));){var d=yA(s[0]);c[u]=d,""===d&&(n.lastIndex=bA(i,gA(n.lastIndex),a)),u++}return 0===u?null:c}]}));var IA=An,AA=hd,RA=fe,CA=M.RangeError,OA=ee,wA=Dn,NA=hd,kA=fe,DA=OA((function(e){var t=AA(RA(this)),r="",n=IA(e);if(n<0||n==1/0)throw CA("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),PA=OA("".slice),MA=Math.ceil,UA=function(e){return function(t,r,n){var i,o,a=NA(kA(t)),s=wA(r),c=a.length,u=void 0===n?" ":NA(n);return s<=c||""==u?a:((o=DA(u,MA((i=s-c)/u.length))).length>i&&(o=PA(o,0,i)),e?a+o:o+a)}},LA={start:UA(!1),end:UA(!0)},xA=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Ie),BA=LA.end;bi({target:"String",proto:!0,forced:xA},{padEnd:function(e){return BA(this,e,arguments.length>1?arguments[1]:void 0)}});var VA=ee,jA=ln.PROPER,FA=Ir.exports,GA=ur,zA=Te,HA=hd,WA=L,YA=sI,KA="toString",XA=RegExp.prototype,qA=XA.toString,JA=VA(YA),ZA=WA((function(){return"/a/b"!=qA.call({source:"a",flags:"b"})})),$A=jA&&qA.name!=KA;(ZA||$A)&&FA(RegExp.prototype,KA,(function(){var e=GA(this),t=HA(e.source),r=e.flags;return"/"+t+"/"+HA(void 0===r&&zA(XA,e)&&!("flags"in XA)?JA(e):r)}),{unsafe:!0});var QA=qf,eR=F,tR=ee,rR=aA,nR=FT,iR=ur,oR=fe,aR=Hf,sR=cA,cR=Dn,uR=hd,dR=qe,lR=Hs,fR=_A,hR=FI,pR=L,_R=fI.UNSUPPORTED_Y,vR=4294967295,mR=Math.min,gR=[].push,yR=tR(/./.exec),ER=tR(gR),SR=tR("".slice),bR=!pR((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));rR("split",(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=uR(oR(this)),i=void 0===r?vR:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!nR(e))return eR(t,n,e,i);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,l=new RegExp(e.source,u+"g");(o=eR(hR,l,n))&&!((a=l.lastIndex)>d&&(ER(c,SR(n,d,o.index)),o.length>1&&o.index<n.length&&QA(gR,c,lR(o,1)),s=o[0].length,d=a,c.length>=i));)l.lastIndex===o.index&&l.lastIndex++;return d===n.length?!s&&yR(l,"")||ER(c,""):ER(c,SR(n,d)),c.length>i?lR(c,0,i):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:eR(t,this,e,r)}:t,[function(t,r){var i=oR(this),o=null==t?void 0:dR(t,e);return o?eR(o,t,i,r):eR(n,uR(i),t,r)},function(e,i){var o=iR(this),a=uR(e),s=r(n,o,a,i,n!==t);if(s.done)return s.value;var c=aR(o,RegExp),u=o.unicode,d=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(_R?"g":"y"),l=new c(_R?"^(?:"+o.source+")":o,d),f=void 0===i?vR:i>>>0;if(0===f)return[];if(0===a.length)return null===fR(l,a)?[a]:[];for(var h=0,p=0,_=[];p<a.length;){l.lastIndex=_R?0:p;var v,m=fR(l,_R?SR(a,p):a);if(null===m||(v=mR(cR(l.lastIndex+(_R?p:0)),a.length))===h)p=sR(a,p,u);else{if(ER(_,SR(a,h,p)),_.length===f)return _;for(var g=1;g<=m.length-1;g++)if(ER(_,m[g]),_.length===f)return _;p=h=v}}return ER(_,SR(a,h)),_}]}),!bR,_R);var TR=Xl.map;bi({target:"Array",proto:!0,forced:!hf("map")},{map:function(e){return TR(this,e,arguments.length>1?arguments[1]:void 0)}});var IR=M,AR=L,RR=ee,CR=hd,OR=sT.trim,wR=Qb,NR=IR.parseInt,kR=IR.Symbol,DR=kR&&kR.iterator,PR=/^[+-]?0x/i,MR=RR(PR.exec),UR=8!==NR(wR+"08")||22!==NR(wR+"0x16")||DR&&!AR((function(){NR(Object(DR))}))?function(e,t){var r=OR(CR(e));return NR(r,t>>>0||(MR(PR,r)?16:10))}:NR;bi({target:"Number",stat:!0,forced:Number.parseInt!=UR},{parseInt:UR});bi({target:"ArrayBuffer",stat:!0,forced:!bg.NATIVE_ARRAY_BUFFER_VIEWS},{isView:bg.isView}),bi({global:!0,forced:!dv},{DataView:Rm.DataView});var LR=ur,xR=$c,BR=bc,VR=F,jR=dt,FR=function(e,t,r,n){try{return n?t(LR(r)[0],r[1]):t(r)}catch(t){xR(e,"throw",t)}},GR=Rc,zR=Dl,HR=Mn,WR=Bs,YR=Xc,KR=Fc,XR=M.Array,qR=function(e){var t=jR(e),r=zR(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=BR(i,n>2?arguments[2]:void 0));var a,s,c,u,d,l,f=KR(t),h=0;if(!f||this==XR&&GR(f))for(a=HR(t),s=r?new this(a):XR(a);a>h;h++)l=o?i(t[h],h):t[h],WR(s,h,l);else for(d=(u=YR(t,f)).next,s=r?new this:[];!(c=VR(d,u)).done;h++)l=o?FR(u,i,[c.value,h],!0):c.value,WR(s,h,l);return s.length=h,s},JR=qR;bi({target:"Array",stat:!0,forced:!Eu((function(e){Array.from(e)}))},{from:JR});var ZR=bi,$R=gl,QR=ee([].reverse),eC=[1,2];ZR({target:"Array",proto:!0,forced:String(eC)===String(eC.reverse())},{reverse:function(){return $R(this)&&(this.length=this.length),QR(this)}});var tC,rC=x,nC=ln.EXISTS,iC=ee,oC=nr.f,aC=Function.prototype,sC=iC(aC.toString),cC=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,uC=iC(cC.exec);rC&&!nC&&oC(aC,"name",{configurable:!0,get:function(){try{return uC(cC,sC(this))[1]}catch(e){return""}}});var dC=new Uint8Array(16);function lC(){if(!tC&&!(tC="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tC(dC)}var fC=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function hC(e){return"string"==typeof e&&fC.test(e)}for(var pC=[],_C=0;_C<256;++_C)pC.push((_C+256).toString(16).substr(1));function vC(e,t,r){var n=(e=e||{}).random||(e.rng||lC)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(pC[e[t+0]]+pC[e[t+1]]+pC[e[t+2]]+pC[e[t+3]]+"-"+pC[e[t+4]]+pC[e[t+5]]+"-"+pC[e[t+6]]+pC[e[t+7]]+"-"+pC[e[t+8]]+pC[e[t+9]]+"-"+pC[e[t+10]]+pC[e[t+11]]+pC[e[t+12]]+pC[e[t+13]]+pC[e[t+14]]+pC[e[t+15]]).toLowerCase();if(!hC(r))throw TypeError("Stringified UUID is invalid");return r}(n)}const mC="3.7.2",gC="function"==typeof atob,yC="function"==typeof btoa,EC="function"==typeof Buffer,SC="function"==typeof TextDecoder?new TextDecoder:void 0,bC="function"==typeof TextEncoder?new TextEncoder:void 0,TC=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),IC=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(TC),AC=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,RC=String.fromCharCode.bind(String),CC="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),OC=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),wC=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),NC=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=TC[t>>18&63]+TC[t>>12&63]+TC[t>>6&63]+TC[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},kC=yC?e=>btoa(e):EC?e=>Buffer.from(e,"binary").toString("base64"):NC,DC=EC?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(RC.apply(null,e.subarray(r,r+4096)));return kC(t.join(""))},PC=(e,t=!1)=>t?OC(DC(e)):DC(e),MC=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?RC(192|t>>>6)+RC(128|63&t):RC(224|t>>>12&15)+RC(128|t>>>6&63)+RC(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return RC(240|t>>>18&7)+RC(128|t>>>12&63)+RC(128|t>>>6&63)+RC(128|63&t)},UC=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,LC=e=>e.replace(UC,MC),xC=EC?e=>Buffer.from(e,"utf8").toString("base64"):bC?e=>DC(bC.encode(e)):e=>kC(LC(e)),BC=(e,t=!1)=>t?OC(xC(e)):xC(e),VC=e=>BC(e,!0),jC=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,FC=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return RC(55296+(t>>>10))+RC(56320+(1023&t));case 3:return RC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return RC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},GC=e=>e.replace(jC,FC),zC=e=>{if(e=e.replace(/\s+/g,""),!AC.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=IC[e.charAt(o++)]<<18|IC[e.charAt(o++)]<<12|(r=IC[e.charAt(o++)])<<6|(n=IC[e.charAt(o++)]),i+=64===r?RC(t>>16&255):64===n?RC(t>>16&255,t>>8&255):RC(t>>16&255,t>>8&255,255&t);return i},HC=gC?e=>atob(wC(e)):EC?e=>Buffer.from(e,"base64").toString("binary"):zC,WC=EC?e=>CC(Buffer.from(e,"base64")):e=>CC(HC(e),(e=>e.charCodeAt(0))),YC=e=>WC(XC(e)),KC=EC?e=>Buffer.from(e,"base64").toString("utf8"):SC?e=>SC.decode(WC(e)):e=>GC(HC(e)),XC=e=>wC(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),qC=e=>KC(XC(e)),JC=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ZC=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,JC(t));e("fromBase64",(function(){return qC(this)})),e("toBase64",(function(e){return BC(this,e)})),e("toBase64URI",(function(){return BC(this,!0)})),e("toBase64URL",(function(){return BC(this,!0)})),e("toUint8Array",(function(){return YC(this)}))},$C=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,JC(t));e("toBase64",(function(e){return PC(this,e)})),e("toBase64URI",(function(){return PC(this,!0)})),e("toBase64URL",(function(){return PC(this,!0)}))},QC={version:mC,VERSION:"3.7.2",atob:HC,atobPolyfill:zC,btoa:kC,btoaPolyfill:NC,fromBase64:qC,toBase64:BC,encode:BC,encodeURI:VC,encodeURL:VC,utob:LC,btou:GC,decode:qC,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:PC,toUint8Array:YC,extendString:ZC,extendUint8Array:$C,extendBuiltins:()=>{ZC(),$C()}};var eO={encodeBase64:QC.encode,decodeBase64:QC.decode},tO=new TextDecoder,rO=new TextEncoder,nO=function(){return vC()},iO=function(){return Date.now()};function oO(e){for(var t,r,n,i,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];var s=0;try{for(var c=T(o),u=c.next();!u.done;u=c.next()){s+=(p=u.value).length}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}var d=new e(s),l=0;try{for(var f=T(o),h=f.next();!h.done;h=f.next()){var p=h.value;d.set(p,l),l+=p.length}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return d}var aO=function(){function e(){}return e.token2auth=function(t,r,n,i){return i?"Bearer ".concat(i):"Basic ".concat(e.createUnsafeToken(t,r,n))},e.createUnsafeToken=function(e,t,r){return eO.encodeBase64([e,t,r].join(":"))},e.merge=function(t,r){var n,i;void 0===t&&(t={}),void 0===r&&(r={});try{for(var o=T(Object.entries(t)),a=o.next();!a.done;a=o.next()){var s=I(a.value,2),c=s[0],u=s[1];null!==u&&"object"===zI(u)?e.merge(t[c],r[c]):void 0!==r[c]&&(t[c]=r[c])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.ab2str=function(e){return tO.decode(e)},e.ab2obj=function(t){try{var r=e.ab2str(t);return JSON.parse(r)}catch(e){return{}}},e.str2ab=function(e){return rO.encode(e).buffer},e}();function sO(){for(var e=(+"".concat(Math.random()).slice(-7).padEnd(7,"0")).toString(2).padEnd(28,"1").split(""),t=[];e.length;)t.push(e.splice(0,7));return t.map((function(e,r){var n=r===t.length-1?"0":"1";return Number.parseInt(n+e.join(""),2)}))}function cO(e){return e.map((function e(t){if(t instanceof HTMLElement)return t.toString();if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){var r=ArrayBuffer.isView(t)?t.buffer:t,n=r.byteLength,i=[];if(n>10){var o=new DataView(r),a=Array.from({length:5}).map((function(e,t){return o.getUint8(t)})),s=Array.from({length:5}).map((function(e,t){return n-1-t})).reverse().map((function(e){return o.getUint8(e)}));i=A(A(A([],I(a),!1),["..."],!1),I(s),!1)}else i=Array.from(new Uint8Array(r));return"".concat(t.constructor.name,"(").concat(n,") [").concat(i.join(", "),"]")}if(Array.isArray(t))return t.map(e);if("[object Object]"===Object.prototype.toString.call(t)){var c={};for(var u in t)c[u]=e(t[u]);return c}return t}))}function uO(e,t){if("boolean"!=typeof e)throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,": The value should be boolean type."))}function dO(e,t,r,n){if(void 0===r&&(r=1),void 0===n&&(n=Number.POSITIVE_INFINITY),e<r||e>n||"number"!=typeof e)throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,": the value range is [").concat(r,", ").concat(n,"]. integer only"))}function lO(e,t,r,n){if(void 0===r&&(r=1),void 0===n&&(n=Number.POSITIVE_INFINITY),null==e)throw new GI(VI.INVALID_PARAMS,"".concat(t," cannot be empty"));if(!function(e,t,r){void 0===t&&(t=1);void 0===r&&(r=Number.POSITIVE_INFINITY);return"string"==typeof e&&e.length<=r&&e.length>=t}(e,r,n))throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,": The value should be string type. Length of the string: [").concat(r,",").concat(n,"]"))}function fO(e,t,r){if(!r.includes(e))throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,": The value can only be set as ").concat(JSON.stringify(r)))}function hO(e,t){if(_O(e))throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,", should not be empty"))}function pO(e){var t,r;try{var n=navigator.mediaDevices.getSupportedConstraints();try{for(var i=T(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]||delete e[a]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}catch(e){}}function _O(e){return null==e}function vO(e){hO(e,"userInfo"),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new GI(VI.INVALID_PARAMS,"The userId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(e.userId),_O(e.extraInfo)||lO(e.extraInfo,"userInfo.extraInfo",1,200)}function mO(e){hO(e,"videoPlayerOption")}function gO(e,t){var r,n;if(void 0===t&&(t=64),!e||0===(null===(r=e)||void 0===r?void 0:r.byteLength))throw new GI(VI.INVALID_PARAMS,"The message cannot be empty");if((null==(n=e instanceof ArrayBuffer?e:aO.str2ab(JSON.stringify(e)))?void 0:n.byteLength)>1e3*t)throw new GI(VI.INVALID_PARAMS,"The message length must be less than ".concat(t,"K"))}function yO(e){return![N.onRemoteStreamStats,N.onLocalStreamStats].includes(e)}var EO=Xl.filter;bi({target:"Array",proto:!0,forced:!hf("filter")},{filter:function(e){return EO(this,e,arguments.length>1?arguments[1]:void 0)}});var SO={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,d=this._events[s],l=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,i),!0;case 5:return d.fn.call(d.context,t,n,i,o),!0;case 6:return d.fn.call(d.context,t,n,i,o,a),!0}for(u=1,c=new Array(l-1);u<l;u++)c[u-1]=arguments[u];d.fn.apply(d.context,c)}else{var f,h=d.length;for(u=0;u<h;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),l){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,n);break;case 4:d[u].fn.call(d[u].context,t,n,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];d[u].fn.apply(d[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var c=0,u=[],d=s.length;c<d;c++)(s[c].fn!==t||i&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(SO);var bO=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},TO=F,IO=ur,AO=fe,RO=bO,CO=hd,OO=qe,wO=_A;aA("search",(function(e,t,r){return[function(t){var r=AO(this),n=null==t?void 0:OO(t,e);return n?TO(n,t,r):new RegExp(t)[e](CO(r))},function(e){var n=IO(this),i=CO(e),o=r(t,n,i);if(o.done)return o.value;var a=n.lastIndex;RO(a,0)||(n.lastIndex=0);var s=wO(n,i);return RO(n.lastIndex,a)||(n.lastIndex=a),null===s?-1:s.index}]}));var NO="[VERTC]",kO=["#0050b3","#0050b3","#0050b3","#0050b3"],DO=location.search.includes("_rtc_debug_"),PO=function(){function e(e,t,r){this._module=e,this._indent=t}return e.prototype.print=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(DO){for(var n="",i=0;i<this._indent;i++)n+=" ";console.log.apply(console,A(["%c".concat(NO).concat(n,"[").concat(this._module,".").concat(e,"] ").concat(t.shift()),"color:".concat(kO[this._indent],";")],I(t),!1))}},e}(),MO=new PO("VERTC",0),UO=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.safeEmit=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this.listenerCount(t);try{return e.prototype.emit.apply(this,A([t],I(r),!1))}catch(e){return MO.print("safaEmit","safeEmit() | event listener threw an error [event:%s]:%o",t,e),Boolean(i)}},t.prototype.safeEmitAsPromise=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return S(this,void 0,void 0,(function(){var r=this;return b(this,(function(n){return[2,new Promise((function(n,i){try{r.emit.apply(r,A(A([e],I(t),!1),[n,i],!1))}catch(t){MO.print("safeEmitAsPromise","safeEmitAsPromise() | event listener threw an error [event:%s]:%o",e,t),i(t)}}))]}))}))},t}(SO.exports.EventEmitter),LO=ht,xO=function(e){return void 0!==e&&(LO(e,"value")||LO(e,"writable"))},BO=F,VO=ge,jO=ur,FO=xO,GO=U,zO=Ra;bi({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,o=arguments.length<3?t:arguments[2];return jO(t)===o?t[r]:(n=GO.f(t,r))?FO(n)?n.value:void 0===n.get?void 0:BO(n.get,o):VO(i=zO(t))?e(i,r,o):void 0}});var HO=bi,WO=F,YO=ur,KO=ge,XO=xO,qO=nr,JO=U,ZO=Ra,$O=X;var QO=L((function(){var e=function(){},t=qO.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}));HO({target:"Reflect",stat:!0,forced:QO},{set:function e(t,r,n){var i,o,a,s=arguments.length<4?t:arguments[3],c=JO.f(YO(t),r);if(!c){if(KO(o=ZO(t)))return e(o,r,n,s);c=$O(0)}if(XO(c)){if(!1===c.writable||!KO(s))return!1;if(i=JO.f(s,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=n,qO.f(s,r,i)}else qO.f(s,r,$O(0,n))}else{if(void 0===(a=c.set))return!1;WO(a,s,n)}return!0}});var ew,tw=bi,rw=ee,nw=U.f,iw=Dn,ow=hd,aw=HT,sw=fe,cw=YT,uw=rw("".endsWith),dw=rw("".slice),lw=Math.min,fw=cw("endsWith");tw({target:"String",proto:!0,forced:!!(fw||(ew=nw(String.prototype,"endsWith"),!ew||ew.writable))&&!fw},{endsWith:function(e){var t=ow(sw(this));aw(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:lw(iw(r),n),o=ow(e);return uw?uw(t,o,i):dw(t,i-o.length,i)===o}});var hw="rtc-access.rtcplus.com,rtc-access-sg.rtcplus.com,rtc-access-va.rtcplus.com,rtc-access-fr.rtcplus.com".split(",");function pw(e){return void 0===e&&(e=""),e.endsWith("com")||e.endsWith("net")||e.endsWith("org")?"https://".concat(e,"/dispatch/v1/AccessInfo?Action=GetAccessInfo"):e}var _w="https://web-log-report.rtcplus.com/video/v1/webrtc_log/",vw={VERSION:"4.36.1",ICE_CONFIG_REQUEST_URLS_INTERNAL:hw.map(pw),ICE_CONFIG_REQUEST_URLS:[],EXPECTED_ADDR:"",LOG_SERVER_URL:_w};function mw(e,t){if("VERSION"!==e)return"ICE_CONFIG_REQUEST_URLS"===e?("string"==typeof t&&(t=[t]),void(vw.ICE_CONFIG_REQUEST_URLS=t.map(pw))):void("LOG_SERVER_URL"!==e||t!==g.overseas?"LOG_SERVER_URL"!==e||t!==g.domestic?vw[e]=t:vw.LOG_SERVER_URL=_w:vw.LOG_SERVER_URL="https://web-log-report.rtcplus.com/video/v1/webrtc_log/")}function gw(e){return vw[e]}function yw(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g;return{type:"transcode",action:e,transcodeMeta:{transcode:{url:t.url},audio:{codec:(null===(r=t.audio)||void 0===r?void 0:r.codec)||"AAC",bitRate:1e3*((null===(n=t.audio)||void 0===n?void 0:n.kBitRate)||48),sampleRate:1e3*((null===(i=t.audio)||void 0===i?void 0:i.sampleRate)||44.1),channels:(null===(o=t.audio)||void 0===o?void 0:o.channels)||1,profile:(null===(a=t.audio)||void 0===a?void 0:a.AACProfile)||"LC"},video:{codec:(null===(s=t.video)||void 0===s?void 0:s.codec)||"H264",fps:(null===(c=t.video)||void 0===c?void 0:c.fps)||15,gop:(null===(u=t.video)||void 0===u?void 0:u.gop)||30,lowLatency:null===(l=null===(d=t.video)||void 0===d?void 0:d.lowLatency)||void 0===l||l,bitRate:1e3*((null===(f=t.video)||void 0===f?void 0:f.kBitRate)||40),width:(null===(h=t.video)||void 0===h?void 0:h.width)||640,height:(null===(p=t.video)||void 0===p?void 0:p.height)||360},layout:{canvas:{bgnd:(null===(_=t.layout)||void 0===_?void 0:_.backgroundColor)||"#000000"},regions:(null===(m=null===(v=t.layout)||void 0===v?void 0:v.regions)||void 0===m?void 0:m.map((function(e){return{alpha:Math.min(Math.max(+e.alpha,0),1),uid:e.userId,zorder:e.zorder,x:Math.min(Math.max(+e.x,0),1),y:Math.min(Math.max(+e.y,0),1),w:Math.min(Math.max(+e.w,0),1),h:Math.min(Math.max(+e.h,0),1),renderMode:e.renderMode||1,contentControl:e.contentControl||0,screen:e.isScreenStream,local_user:e.isLocalUser}})))||[],app_data:(null===(g=t.layout)||void 0===g?void 0:g.appData)||""}}}}var Ew=bi,Sw=Vn.indexOf,bw=ul,Tw=ee([].indexOf),Iw=!!Tw&&1/Tw([1],1,-0)<0,Aw=bw("indexOf");Ew({target:"Array",proto:!0,forced:Iw||!Aw},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Iw?Tw(this,e,t)||0:Sw(this,e,t)}});var Rw={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},i={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(Rw);var Cw={},Ow={},ww={},Nw=Rw;function kw(e){for(var t=e.length;--t>=0;)e[t]=0}var Dw=256,Pw=286,Mw=30,Uw=15,Lw=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],xw=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Bw=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Vw=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],jw=new Array(576);kw(jw);var Fw=new Array(60);kw(Fw);var Gw=new Array(512);kw(Gw);var zw=new Array(256);kw(zw);var Hw=new Array(29);kw(Hw);var Ww,Yw,Kw,Xw=new Array(Mw);function qw(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Jw(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Zw(e){return e<256?Gw[e]:Gw[256+(e>>>7)]}function $w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Qw(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,$w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function eN(e,t,r){Qw(e,r[2*t],r[2*t+1])}function tN(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function rN(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=Uw;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=tN(o[s]++,s))}}function nN(e){var t;for(t=0;t<Pw;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Mw;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function iN(e){e.bi_valid>8?$w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function oN(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function aN(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&oN(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!oN(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function sN(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?eN(e,i,t):(eN(e,(o=zw[i])+Dw+1,t),0!==(a=Lw[o])&&Qw(e,i-=Hw[o],a),eN(e,o=Zw(--n),r),0!==(a=xw[o])&&Qw(e,n-=Xw[o],a))}while(s<e.last_lit);eN(e,256,t)}function cN(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==o[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)aN(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],aN(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,aN(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,c=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,l=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=Uw;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,_++),c[2*n+1]=o,n>u||(e.bl_count[o]++,a=0,n>=h&&(a=f[n-h]),s=c[2*n],e.opt_len+=s*(o+a),l&&(e.static_len+=s*(d[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),rN(o,u,e.bl_count)}function uN(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<c&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(c=138,u=3):i===a?(c=6,u=3):(c=7,u=4))}function dN(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<c&&i===a)){if(s<u)do{eN(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(eN(e,i,e.bl_tree),s--),eN(e,16,e.bl_tree),Qw(e,s-3,2)):s<=10?(eN(e,17,e.bl_tree),Qw(e,s-3,3)):(eN(e,18,e.bl_tree),Qw(e,s-11,7));s=0,o=i,0===a?(c=138,u=3):i===a?(c=6,u=3):(c=7,u=4)}}kw(Xw);var lN=!1;function fN(e,t,r,n){Qw(e,0+(n?1:0),3),function(e,t,r,n){iN(e),n&&($w(e,r),$w(e,~r)),Nw.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}ww._tr_init=function(e){lN||(!function(){var e,t,r,n,i,o=new Array(16);for(r=0,n=0;n<28;n++)for(Hw[n]=r,e=0;e<1<<Lw[n];e++)zw[r++]=n;for(zw[r-1]=n,i=0,n=0;n<16;n++)for(Xw[n]=i,e=0;e<1<<xw[n];e++)Gw[i++]=n;for(i>>=7;n<Mw;n++)for(Xw[n]=i<<7,e=0;e<1<<xw[n]-7;e++)Gw[256+i++]=n;for(t=0;t<=Uw;t++)o[t]=0;for(e=0;e<=143;)jw[2*e+1]=8,e++,o[8]++;for(;e<=255;)jw[2*e+1]=9,e++,o[9]++;for(;e<=279;)jw[2*e+1]=7,e++,o[7]++;for(;e<=287;)jw[2*e+1]=8,e++,o[8]++;for(rN(jw,287,o),e=0;e<Mw;e++)Fw[2*e+1]=5,Fw[2*e]=tN(e,5);Ww=new qw(jw,Lw,257,Pw,Uw),Yw=new qw(Fw,xw,0,Mw,Uw),Kw=new qw(new Array(0),Bw,0,19,7)}(),lN=!0),e.l_desc=new Jw(e.dyn_ltree,Ww),e.d_desc=new Jw(e.dyn_dtree,Yw),e.bl_desc=new Jw(e.bl_tree,Kw),e.bi_buf=0,e.bi_valid=0,nN(e)},ww._tr_stored_block=fN,ww._tr_flush_block=function(e,t,r,n){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Dw;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),cN(e,e.l_desc),cN(e,e.d_desc),a=function(e){var t;for(uN(e,e.dyn_ltree,e.l_desc.max_code),uN(e,e.dyn_dtree,e.d_desc.max_code),cN(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Vw[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?fN(e,t,r,n):4===e.strategy||o===i?(Qw(e,2+(n?1:0),3),sN(e,jw,Fw)):(Qw(e,4+(n?1:0),3),function(e,t,r,n){var i;for(Qw(e,t-257,5),Qw(e,r-1,5),Qw(e,n-4,4),i=0;i<n;i++)Qw(e,e.bl_tree[2*Vw[i]+1],3);dN(e,e.dyn_ltree,t-1),dN(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),sN(e,e.dyn_ltree,e.dyn_dtree)),nN(e),n&&iN(e)},ww._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(zw[r]+Dw+1)]++,e.dyn_dtree[2*Zw(t)]++),e.last_lit===e.lit_bufsize-1},ww._tr_align=function(e){Qw(e,2,3),eN(e,256,jw),function(e){16===e.bi_valid?($w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var hN=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};var pN=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var _N,vN=function(e,t,r,n){var i=pN,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},mN={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},gN=Rw,yN=ww,EN=hN,SN=vN,bN=mN,TN=-2,IN=258,AN=262,RN=103,CN=113,ON=666;function wN(e,t){return e.msg=bN[t],t}function NN(e){return(e<<1)-(e>4?9:0)}function kN(e){for(var t=e.length;--t>=0;)e[t]=0}function DN(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(gN.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function PN(e,t){yN._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,DN(e.strm)}function MN(e,t){e.pending_buf[e.pending++]=t}function UN(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function LN(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-AN?e.strstart-(e.w_size-AN):0,u=e.window,d=e.w_mask,l=e.prev,f=e.strstart+IN,h=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===h&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<f);if(n=IN-(f-o),o=f-IN,n>a){if(e.match_start=t,a=n,n>=s)break;h=u[o+a-1],p=u[o+a]}}}while((t=l[t&d])>c&&0!=--i);return a<=e.lookahead?a:e.lookahead}function xN(e){var t,r,n,i,o,a,s,c,u,d,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-AN)){gN.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=l?n-l:0}while(--r);t=r=l;do{n=e.prev[--t],e.prev[t]=n>=l?n-l:0}while(--r);i+=l}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,c=e.strstart+e.lookahead,u=i,d=void 0,(d=a.avail_in)>u&&(d=u),r=0===d?0:(a.avail_in-=d,gN.arraySet(s,a.input,a.next_in,d,c),1===a.state.wrap?a.adler=EN(a.adler,s,d,c):2===a.state.wrap&&(a.adler=SN(a.adler,s,d,c)),a.next_in+=d,a.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<AN&&0!==e.strm.avail_in)}function BN(e,t){for(var r,n;;){if(e.lookahead<AN){if(xN(e),e.lookahead<AN&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-AN&&(e.match_length=LN(e,r)),e.match_length>=3)if(n=yN._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=yN._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}function VN(e,t){for(var r,n,i;;){if(e.lookahead<AN){if(xN(e),e.lookahead<AN&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-AN&&(e.match_length=LN(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=yN._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(PN(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=yN._tr_tally(e,0,e.window[e.strstart-1]))&&PN(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=yN._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}function jN(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function FN(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new gN.Buf16(1146),this.dyn_dtree=new gN.Buf16(122),this.bl_tree=new gN.Buf16(78),kN(this.dyn_ltree),kN(this.dyn_dtree),kN(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new gN.Buf16(16),this.heap=new gN.Buf16(573),kN(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new gN.Buf16(573),kN(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function GN(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:CN,e.adler=2===t.wrap?0:1,t.last_flush=0,yN._tr_init(t),0):wN(e,TN)}function zN(e){var t,r=GN(e);return 0===r&&((t=e.state).window_size=2*t.w_size,kN(t.head),t.max_lazy_match=_N[t.level].max_lazy,t.good_match=_N[t.level].good_length,t.nice_match=_N[t.level].nice_length,t.max_chain_length=_N[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function HN(e,t,r,n,i,o){if(!e)return TN;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return wN(e,TN);8===n&&(n=9);var s=new FN;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new gN.Buf8(2*s.w_size),s.head=new gN.Buf16(s.hash_size),s.prev=new gN.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new gN.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,zN(e)}_N=[new jN(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(xN(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,PN(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-AN&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(PN(e,!1),e.strm.avail_out),1)})),new jN(4,4,8,4,BN),new jN(4,5,16,8,BN),new jN(4,6,32,32,BN),new jN(4,4,16,16,VN),new jN(8,16,32,32,VN),new jN(8,16,128,128,VN),new jN(8,32,128,256,VN),new jN(32,128,258,1024,VN),new jN(32,258,258,4096,VN)],Ow.deflateInit=function(e,t){return HN(e,t,8,15,8,0)},Ow.deflateInit2=HN,Ow.deflateReset=zN,Ow.deflateResetKeep=GN,Ow.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?TN:(e.state.gzhead=t,0):TN},Ow.deflate=function(e,t){var r,n,i,o;if(!e||!e.state||t>5||t<0)return e?wN(e,TN):TN;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===ON&&4!==t)return wN(e,0===e.avail_out?-5:TN);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,MN(n,31),MN(n,139),MN(n,8),n.gzhead?(MN(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),MN(n,255&n.gzhead.time),MN(n,n.gzhead.time>>8&255),MN(n,n.gzhead.time>>16&255),MN(n,n.gzhead.time>>24&255),MN(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),MN(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(MN(n,255&n.gzhead.extra.length),MN(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=SN(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(MN(n,0),MN(n,0),MN(n,0),MN(n,0),MN(n,0),MN(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),MN(n,3),n.status=CN);else{var a=8+(n.w_bits-8<<4)<<8;a|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=CN,UN(n,a),0!==n.strstart&&(UN(n,e.adler>>>16),UN(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),DN(e),i=n.pending,n.pending!==n.pending_buf_size));)MN(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),DN(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,MN(n,o)}while(0!==o);n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),DN(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,MN(n,o)}while(0!==o);n.gzhead.hcrc&&n.pending>i&&(e.adler=SN(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=RN)}else n.status=RN;if(n.status===RN&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&DN(e),n.pending+2<=n.pending_buf_size&&(MN(n,255&e.adler),MN(n,e.adler>>8&255),e.adler=0,n.status=CN)):n.status=CN),0!==n.pending){if(DN(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&NN(t)<=NN(r)&&4!==t)return wN(e,-5);if(n.status===ON&&0!==e.avail_in)return wN(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&n.status!==ON){var s=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(xN(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=yN._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=IN){if(xN(e),e.lookahead<=IN&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+IN;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=IN-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=yN._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=yN._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(PN(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(PN(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(PN(e,!1),0===e.strm.avail_out)?1:2}(n,t):_N[n.level].func(n,t);if(3!==s&&4!==s||(n.status=ON),1===s||3===s)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===s&&(1===t?yN._tr_align(n):5!==t&&(yN._tr_stored_block(n,0,0,!1),3===t&&(kN(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),DN(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(MN(n,255&e.adler),MN(n,e.adler>>8&255),MN(n,e.adler>>16&255),MN(n,e.adler>>24&255),MN(n,255&e.total_in),MN(n,e.total_in>>8&255),MN(n,e.total_in>>16&255),MN(n,e.total_in>>24&255)):(UN(n,e.adler>>>16),UN(n,65535&e.adler)),DN(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},Ow.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==RN&&t!==CN&&t!==ON?wN(e,TN):(e.state=null,t===CN?wN(e,-3):0):TN},Ow.deflateSetDictionary=function(e,t){var r,n,i,o,a,s,c,u,d=t.length;if(!e||!e.state)return TN;if(2===(o=(r=e.state).wrap)||1===o&&42!==r.status||r.lookahead)return TN;for(1===o&&(e.adler=EN(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===o&&(kN(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new gN.Buf8(r.w_size),gN.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),a=e.avail_in,s=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,xN(r);r.lookahead>=3;){n=r.strstart,i=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=2,xN(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=c,e.avail_in=a,r.wrap=o,0},Ow.deflateInfo="pako deflate (from Nodeca project)";var WN={},YN=Rw,KN=!0,XN=!0;try{String.fromCharCode.apply(null,[0])}catch(e){KN=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){XN=!1}for(var qN=new YN.Buf8(256),JN=0;JN<256;JN++)qN[JN]=JN>=252?6:JN>=248?5:JN>=240?4:JN>=224?3:JN>=192?2:1;function ZN(e,t){if(t<65534&&(e.subarray&&XN||!e.subarray&&KN))return String.fromCharCode.apply(null,YN.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}qN[254]=qN[254]=1,WN.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new YN.Buf8(s),o=0,i=0;o<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},WN.buf2binstring=function(e){return ZN(e,e.length)},WN.binstring2buf=function(e){for(var t=new YN.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},WN.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)s[n++]=i;else if((o=qN[i])>4)s[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return ZN(s,n)},WN.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+qN[e[r]]>t?r:t};var $N=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},QN=Ow,ek=Rw,tk=WN,rk=mN,nk=$N,ik=Object.prototype.toString;function ok(e){if(!(this instanceof ok))return new ok(e);this.options=ek.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nk,this.strm.avail_out=0;var r=QN.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(rk[r]);if(t.header&&QN.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?tk.string2buf(t.dictionary):"[object ArrayBuffer]"===ik.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=QN.deflateSetDictionary(this.strm,n)))throw new Error(rk[r]);this._dict_set=!0}}function ak(e,t){var r=new ok(t);if(r.push(e,!0),r.err)throw r.msg||rk[r.err];return r.result}ok.prototype.push=function(e,t){var r,n,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=tk.string2buf(e):"[object ArrayBuffer]"===ik.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new ek.Buf8(o),i.next_out=0,i.avail_out=o),1!==(r=QN.deflate(i,n))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(tk.buf2binstring(ek.shrinkBuf(i.output,i.next_out))):this.onData(ek.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=QN.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==n||(this.onEnd(0),i.avail_out=0,!0)},ok.prototype.onData=function(e){this.chunks.push(e)},ok.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ek.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Cw.Deflate=ok,Cw.deflate=ak,Cw.deflateRaw=function(e,t){return(t=t||{}).raw=!0,ak(e,t)},Cw.gzip=function(e,t){return(t=t||{}).gzip=!0,ak(e,t)};var sk={},ck={},uk=Rw,dk=15,lk=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],fk=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],hk=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],pk=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],_k=Rw,vk=hN,mk=vN,gk=function(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T,I,A,R;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,l=r.wnext,f=r.window,h=r.hold,p=r.bits,_=r.lencode,v=r.distcode,m=(1<<r.lenbits)-1,g=(1<<r.distbits)-1;e:do{p<15&&(h+=A[n++]<<p,p+=8,h+=A[n++]<<p,p+=8),y=_[h&m];t:for(;;){if(h>>>=E=y>>>24,p-=E,0===(E=y>>>16&255))R[o++]=65535&y;else{if(!(16&E)){if(0==(64&E)){y=_[(65535&y)+(h&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&y,(E&=15)&&(p<E&&(h+=A[n++]<<p,p+=8),S+=h&(1<<E)-1,h>>>=E,p-=E),p<15&&(h+=A[n++]<<p,p+=8,h+=A[n++]<<p,p+=8),y=v[h&g];r:for(;;){if(h>>>=E=y>>>24,p-=E,!(16&(E=y>>>16&255))){if(0==(64&E)){y=v[(65535&y)+(h&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(b=65535&y,p<(E&=15)&&(h+=A[n++]<<p,(p+=8)<E&&(h+=A[n++]<<p,p+=8)),(b+=h&(1<<E)-1)>c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=E,p-=E,b>(E=o-a)){if((E=b-E)>d&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(T=0,I=f,0===l){if(T+=u-E,E<S){S-=E;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}}else if(l<E){if(T+=u+l-E,(E-=l)<S){S-=E;do{R[o++]=f[T++]}while(--E);if(T=0,l<S){S-=E=l;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}}}else if(T+=l-E,E<S){S-=E;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}for(;S>2;)R[o++]=I[T++],R[o++]=I[T++],R[o++]=I[T++],S-=3;S&&(R[o++]=I[T++],S>1&&(R[o++]=I[T++]))}else{T=o-b;do{R[o++]=R[T++],R[o++]=R[T++],R[o++]=R[T++],S-=3}while(S>2);S&&(R[o++]=R[T++],S>1&&(R[o++]=R[T++]))}break}}break}}while(n<i&&o<s);n-=S=p>>3,h&=(1<<(p-=S<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=p},yk=function(e,t,r,n,i,o,a,s){var c,u,d,l,f,h,p,_,v,m=s.bits,g=0,y=0,E=0,S=0,b=0,T=0,I=0,A=0,R=0,C=0,O=null,w=0,N=new uk.Buf16(16),k=new uk.Buf16(16),D=null,P=0;for(g=0;g<=dk;g++)N[g]=0;for(y=0;y<n;y++)N[t[r+y]]++;for(b=m,S=dk;S>=1&&0===N[S];S--);if(b>S&&(b=S),0===S)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<S&&0===N[E];E++);for(b<E&&(b=E),A=1,g=1;g<=dk;g++)if(A<<=1,(A-=N[g])<0)return-1;if(A>0&&(0===e||1!==S))return-1;for(k[1]=0,g=1;g<dk;g++)k[g+1]=k[g]+N[g];for(y=0;y<n;y++)0!==t[r+y]&&(a[k[t[r+y]]++]=y);if(0===e?(O=D=a,h=19):1===e?(O=lk,w-=257,D=fk,P-=257,h=256):(O=hk,D=pk,h=-1),C=0,y=0,g=E,f=o,T=b,I=0,d=-1,l=(R=1<<b)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){p=g-I,a[y]<h?(_=0,v=a[y]):a[y]>h?(_=D[P+a[y]],v=O[w+a[y]]):(_=96,v=0),c=1<<g-I,E=u=1<<T;do{i[f+(C>>I)+(u-=c)]=p<<24|_<<16|v|0}while(0!==u);for(c=1<<g-1;C&c;)c>>=1;if(0!==c?(C&=c-1,C+=c):C=0,y++,0==--N[g]){if(g===S)break;g=t[r+a[y]]}if(g>b&&(C&l)!==d){for(0===I&&(I=b),f+=E,A=1<<(T=g-I);T+I<S&&!((A-=N[T+I])<=0);)T++,A<<=1;if(R+=1<<T,1===e&&R>852||2===e&&R>592)return 1;i[d=C&l]=b<<24|T<<16|f-o|0}}return 0!==C&&(i[f+C]=g-I<<24|64<<16|0),s.bits=b,0},Ek=-2,Sk=12,bk=30;function Tk(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Ik(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new _k.Buf16(320),this.work=new _k.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ak(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new _k.Buf32(852),t.distcode=t.distdyn=new _k.Buf32(592),t.sane=1,t.back=-1,0):Ek}function Rk(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,Ak(e)):Ek}function Ck(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ek:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Rk(e))):Ek}function Ok(e,t){var r,n;return e?(n=new Ik,e.state=n,n.window=null,0!==(r=Ck(e,t))&&(e.state=null),r):Ek}var wk,Nk,kk=!0;function Dk(e){if(kk){var t;for(wk=new _k.Buf32(512),Nk=new _k.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(yk(1,e.lens,0,288,wk,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;yk(2,e.lens,0,32,Nk,0,e.work,{bits:5}),kk=!1}e.lencode=wk,e.lenbits=9,e.distcode=Nk,e.distbits=5}function Pk(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _k.Buf8(o.wsize)),n>=o.wsize?(_k.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),_k.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(_k.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}ck.inflateReset=Rk,ck.inflateReset2=Ck,ck.inflateResetKeep=Ak,ck.inflateInit=function(e){return Ok(e,15)},ck.inflateInit2=Ok,ck.inflate=function(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T,I,A,R=0,C=new _k.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ek;(r=e.state).mode===Sk&&(r.mode=13),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,u=r.hold,d=r.bits,l=s,f=c,T=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(2&r.wrap&&35615===u){r.check=0,C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0),u=0,d=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=bk;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=bk;break}if(d-=4,b=8+(15&(u>>>=4)),0===r.wbits)r.wbits=b;else if(b>r.wbits){e.msg="invalid window size",r.mode=bk;break}r.dmax=1<<b,e.adler=r.check=1,r.mode=512&u?10:Sk,u=0,d=0;break;case 2:for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(r.flags=u,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=bk;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=bk;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0)),u=0,d=0,r.mode=3;case 3:for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.head&&(r.head.time=u),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=mk(r.check,C,4,0)),u=0,d=0,r.mode=4;case 4:for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0)),u=0,d=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=mk(r.check,C,2,0)),u=0,d=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=r.length)>s&&(h=s),h&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_k.arraySet(r.head.extra,n,o,h,b)),512&r.flags&&(r.check=mk(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;h=0;do{b=n[o+h++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b))}while(b&&h<s);if(512&r.flags&&(r.check=mk(r.check,n,h,o)),s-=h,o+=h,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;h=0;do{b=n[o+h++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b))}while(b&&h<s);if(512&r.flags&&(r.check=mk(r.check,n,h,o)),s-=h,o+=h,b)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=bk;break}u=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Sk;break;case 10:for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}e.adler=r.check=Tk(u),u=0,d=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,2;e.adler=r.check=1,r.mode=Sk;case Sk:if(5===t||6===t)break e;case 13:if(r.last){u>>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}switch(r.last=1&u,d-=1,3&(u>>>=1)){case 0:r.mode=14;break;case 1:if(Dk(r),r.mode=20,6===t){u>>>=2,d-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=bk}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=bk;break}if(r.length=65535&u,u=0,d=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(h>s&&(h=s),h>c&&(h=c),0===h)break e;_k.arraySet(i,n,o,h,a),s-=h,o+=h,c-=h,a+=h,r.length-=h;break}r.mode=Sk;break;case 17:for(;d<14;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(r.nlen=257+(31&u),u>>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=bk;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;d<3;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.lens[O[r.have++]]=7&u,u>>>=3,d-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},T=yk(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid code lengths set",r.mode=bk;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;m=(R=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(g<16)u>>>=v,d-=v,r.lens[r.have++]=g;else{if(16===g){for(A=v+2;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u>>>=v,d-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=bk;break}b=r.lens[r.have-1],h=3+(3&u),u>>>=2,d-=2}else if(17===g){for(A=v+3;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}d-=v,b=0,h=3+(7&(u>>>=v)),u>>>=3,d-=3}else{for(A=v+7;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}d-=v,b=0,h=11+(127&(u>>>=v)),u>>>=7,d-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=bk;break}for(;h--;)r.lens[r.have++]=b}}if(r.mode===bk)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=bk;break}if(r.lenbits=9,I={bits:r.lenbits},T=yk(1,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid literal/lengths set",r.mode=bk;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},T=yk(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,T){e.msg="invalid distances set",r.mode=bk;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,gk(e,f),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,u=r.hold,d=r.bits,r.mode===Sk&&(r.back=-1);break}for(r.back=0;m=(R=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(m&&0==(240&m)){for(y=v,E=m,S=g;m=(R=r.lencode[S+((u&(1<<y+E)-1)>>y)])>>>16&255,g=65535&R,!(y+(v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}u>>>=y,d-=y,r.back+=y}if(u>>>=v,d-=v,r.back+=v,r.length=g,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=Sk;break}if(64&m){e.msg="invalid literal/length code",r.mode=bk;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(A=r.extra;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(R=r.distcode[u&(1<<r.distbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(0==(240&m)){for(y=v,E=m,S=g;m=(R=r.distcode[S+((u&(1<<y+E)-1)>>y)])>>>16&255,g=65535&R,!(y+(v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}u>>>=y,d-=y,r.back+=y}if(u>>>=v,d-=v,r.back+=v,64&m){e.msg="invalid distance code",r.mode=bk;break}r.offset=g,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(A=r.extra;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=bk;break}r.mode=25;case 25:if(0===c)break e;if(h=f-c,r.offset>h){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=bk;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),_=r.window}else _=i,p=a-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do{i[a++]=_[p++]}while(--h);0===r.length&&(r.mode=21);break;case 26:if(0===c)break e;i[a++]=r.length,c--,r.mode=21;break;case 27:if(r.wrap){for(;d<32;){if(0===s)break e;s--,u|=n[o++]<<d,d+=8}if(f-=c,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?mk(r.check,i,f,a-f):vk(r.check,i,f,a-f)),f=c,(r.flags?u:Tk(u))!==r.check){e.msg="incorrect data check",r.mode=bk;break}u=0,d=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=bk;break}u=0,d=0}r.mode=29;case 29:T=1;break e;case bk:T=-3;break e;case 31:return-4;default:return Ek}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,(r.wsize||f!==e.avail_out&&r.mode<bk&&(r.mode<27||4!==t))&&Pk(e,e.output,e.next_out,f-e.avail_out),l-=e.avail_in,f-=e.avail_out,e.total_in+=l,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?mk(r.check,i,f,e.next_out-f):vk(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Sk?128:0)+(20===r.mode||15===r.mode?256:0),(0===l&&0===f||4===t)&&0===T&&(T=-5),T},ck.inflateEnd=function(e){if(!e||!e.state)return Ek;var t=e.state;return t.window&&(t.window=null),e.state=null,0},ck.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?Ek:(r.head=t,t.done=!1,0):Ek},ck.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?Ek:11===r.mode&&vk(1,t,n,0)!==r.check?-3:Pk(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):Ek},ck.inflateInfo="pako inflate (from Nodeca project)";var Mk={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var Uk=ck,Lk=Rw,xk=WN,Bk=Mk,Vk=mN,jk=$N,Fk=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Gk=Object.prototype.toString;function zk(e){if(!(this instanceof zk))return new zk(e);this.options=Lk.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jk,this.strm.avail_out=0;var r=Uk.inflateInit2(this.strm,t.windowBits);if(r!==Bk.Z_OK)throw new Error(Vk[r]);if(this.header=new Fk,Uk.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=xk.string2buf(t.dictionary):"[object ArrayBuffer]"===Gk.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Uk.inflateSetDictionary(this.strm,t.dictionary))!==Bk.Z_OK))throw new Error(Vk[r])}function Hk(e,t){var r=new zk(t);if(r.push(e,!0),r.err)throw r.msg||Vk[r.err];return r.result}zk.prototype.push=function(e,t){var r,n,i,o,a,s=this.strm,c=this.options.chunkSize,u=this.options.dictionary,d=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?Bk.Z_FINISH:Bk.Z_NO_FLUSH,"string"==typeof e?s.input=xk.binstring2buf(e):"[object ArrayBuffer]"===Gk.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new Lk.Buf8(c),s.next_out=0,s.avail_out=c),(r=Uk.inflate(s,Bk.Z_NO_FLUSH))===Bk.Z_NEED_DICT&&u&&(r=Uk.inflateSetDictionary(this.strm,u)),r===Bk.Z_BUF_ERROR&&!0===d&&(r=Bk.Z_OK,d=!1),r!==Bk.Z_STREAM_END&&r!==Bk.Z_OK)return this.onEnd(r),this.ended=!0,!1;s.next_out&&(0!==s.avail_out&&r!==Bk.Z_STREAM_END&&(0!==s.avail_in||n!==Bk.Z_FINISH&&n!==Bk.Z_SYNC_FLUSH)||("string"===this.options.to?(i=xk.utf8border(s.output,s.next_out),o=s.next_out-i,a=xk.buf2string(s.output,i),s.next_out=o,s.avail_out=c-o,o&&Lk.arraySet(s.output,s.output,i,o,0),this.onData(a)):this.onData(Lk.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(d=!0)}while((s.avail_in>0||0===s.avail_out)&&r!==Bk.Z_STREAM_END);return r===Bk.Z_STREAM_END&&(n=Bk.Z_FINISH),n===Bk.Z_FINISH?(r=Uk.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Bk.Z_OK):n!==Bk.Z_SYNC_FLUSH||(this.onEnd(Bk.Z_OK),s.avail_out=0,!0)},zk.prototype.onData=function(e){this.chunks.push(e)},zk.prototype.onEnd=function(e){e===Bk.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Lk.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},sk.Inflate=zk,sk.inflate=Hk,sk.inflateRaw=function(e,t){return(t=t||{}).raw=!0,Hk(e,t)},sk.ungzip=Hk;var Wk={};(0,Rw.assign)(Wk,Cw,sk,Mk);var Yk,Kk,Xk,qk,Jk,Zk,$k,Qk,eD,tD,rD,nD,iD,oD,aD,sD,cD,uD,dD,lD,fD,hD,pD,_D,vD,mD,gD,yD,ED,SD,bD,TD,ID,AD,RD,CD,OD,wD,ND,kD,DD,PD,MD,UD,LD,xD,BD=Wk,VD=x,jD=ee,FD=F,GD=L,zD=Fo,HD=qn,WD=G,YD=dt,KD=de,XD=Object.assign,qD=Object.defineProperty,JD=jD([].concat),ZD=!XD||GD((function(){if(VD&&1!==XD({b:1},XD(qD({},"a",{enumerable:!0,get:function(){qD(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=XD({},e)[r]||zD(XD({},t)).join("")!=n}))?function(e,t){for(var r=YD(e),n=arguments.length,i=1,o=HD.f,a=WD.f;n>i;)for(var s,c=KD(arguments[i++]),u=o?JD(zD(c),o(c)):zD(c),d=u.length,l=0;d>l;)s=u[l++],VD&&!FD(a,c,s)||(r[s]=c[s]);return r}:XD,$D=ZD;bi({target:"Object",stat:!0,forced:Object.assign!==$D},{assign:$D}),function(e){e.RTC_SDK_API_CALL="rtc_sdk_api_call",e.RTC_SDK_CALLBACK="rtc_sdk_callback",e.RTC_RECONNECT="rtc_reconnect",e.RTC_RECONNECTED="rtc_reconnected",e.RTC_GET_ACCESS="rtc_get_access",e.RTC_PRE_ICE_STATE="rtc_pre_ice_state",e.RTC_NODE_CHANGE="rtc_node_change",e.RTC_SIGNALING_MSG_ERROR="rtc_signaling_msg_error",e.RTC_SIGNALING="rtc_signaling",e.RTC_JOIN_ROOM="rtc_join_room",e.RTC_LEAVE_ROOM="rtc_leave_room",e.RTC_BEGIN_CREATE_OFFER="rtc_begin_create_offer",e.RTC_CREATE_OFFER="rtc_create_offer",e.RTC_SET_DESCRIPTION="rtc_set_description",e.RTC_RECV_ANSWER="rtc_recv_answer",e.FIRST_REMOTE_AUDIO_RENDER="first_remote_audio_render",e.FIRST_REMOTE_VIDEO_RENDER="first_remote_video_render",e.RTC_PUBLISH_STAT="rtc_publish_stat",e.RTC_SUBSCRIBE_STAT="rtc_subscribe_stat",e.RTC_AUDIO_DEVICE="rtc_audio_device",e.RTC_MEDIA_STATISTICS="rtc_media_statistics",e.RTC_MESSAGE_STATISTICS="rtc_message_statistics",e.RTC_ERROR="rtc_error",e.RTC_INVOKE_STATUS="rtc_invoke_status",e.RTC_FIRST_FRAME="rtc_first_frame",e.RTC_MUTE_REMOTE="rtc_mute_remote",e.SDK_INIT_ENGINE="sdk_init_engine",e.JOIN_ROOM="join_room",e.P2P_CONNECTION_STATUS="p2p_connection_status",e.P2P_CONNECT_CLOSED="p2p_connect_closed",e.RTC_DEVICE_ERROR="rtc_device_error",e.RTC_VIDEO_DEVICE="rtc_video_device",e.RTC_VIDEO_CAPTURE_EVENT="rtc_video_capture_event",e.RTC_ENCODE_FIRST_FRAME="rtc_encode_first_frame",e.RTC_FIRST_FRAME_ENCODED="rtc_first_frame_encoded",e.RTC_SEND_FIRST_PACKET="rtc_send_first_packet",e.RTC_RECV_FIRST_PACKET="rtc_recv_first_packet",e.RTC_RECV_FIRST_FRAME="rtc_recv_first_frame",e.RTC_DECODE_FIRST_FRAME="rtc_decode_first_frame"}(Yk||(Yk={})),function(e){e.RTC="rtc"}(Kk||(Kk={})),function(e){e.W_5="5"}(Xk||(Xk={})),function(e){e.IOS="ios",e.ANDROID="android",e.WEB="web",e.WINDOWS="windows",e.MAC="mac",e.LINUX="linux"}(qk||(qk={})),function(e){e.UNKNOWN="unknown",e.DISCONNECTED="disconnected",e.LAN="lan",e.WIFI="wifi",e.W_2="2g",e.W_3="3g",e.W_4="4g",e.W_5="5g"}(Jk||(Jk={})),function(e){e.UNKNOWN="unknown",e.BROADCASTER="broadcaster",e.AUDIENCE="audience",e.SILENTAUDIENCE="silentAudience"}(Zk||(Zk={})),function(e){e.WEBSOCKET_RECONNECTING="websocket reconnecting",e.PEERCONNECTION_RECONNECTING="peerconnection reconnecting",e.DISCONNECTED="DISCONNECTED",e.LAN="LAN",e.WIFI="WIFI",e.W_2="2G",e.W_3="3G",e.W_4="4G",e.W_5="5G",e.UNKNOWN="UNKNOWN"}($k||($k={})),function(e){e.WEBSOCKET="websocket",e.NETWORKCHANGED="networkChanged",e.PEERCONNECTION="peerconnection"}(Qk||(Qk={})),function(e){e.WEBSOCKET_RECONNECTED="websocket reconnected",e.PEERCONNECTION_RECONNECTED="peerconnection reconnected"}(eD||(eD={})),function(e){e.WEBSOCKET="websocket",e.NETWORKCHANGED="networkChanged",e.PEERCONNECTION="peerconnection"}(tD||(tD={})),function(e){e.REQUEST="request",e.RESPONSE="response",e.KCP_REQUEST="kcp request",e.KCP_RESPONSE="kcp response",e.QUIC_REQUEST="quic request",e.QUIC_RESPONSE="quic response"}(rD||(rD={})),function(e){e.NEW="NEW",e.CHECKING="CHECKING",e.CONNECTED="CONNECTED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.DISCONNECTED="DISCONNECTED",e.CLOSED="CLOSED",e.DATACHANNEL_CONNECTING="DATACHANNEL_CONNECTING",e.DATACHANNEL_OPEN="DATACHANNEL_OPEN",e.DATACHANNEL_CLOSING="DATACHANNEL_CLOSING",e.DATACHANNEL_CLOSED="DATACHANNEL_CLOSED"}(nD||(nD={})),function(e){e.SUCCEED="succeed",e.MESSAGE_ID_ERROR="message id error",e.ZIP_FAILED="zip failed",e.UNZIP_FAILED="unzip failed",e.MESSAGE_KEY_EMPTY="message key empty",e.MESSAGE_KEY_PARSE_FAILED="message key parse failed",e.MESSAGE_KEY_INVALID="message key invalid",e.ENCRYPT_FAILED="encrypt failed",e.DECRYPT_FAILED="decrypt failed",e.MESSAGE_TOO_BIG="message too big",e.INVALID_DATA="invalid data",e.MESSAGE_PARSE_FAILED="message parse failed"}(iD||(iD={})),function(e){e.CALL_JOINROOM="call-joinRoom",e.JOINROOM="joinRoom",e.CALL_RECONNECTED="call-reconnected",e.RECONNECTED="reconnected",e.CALL_PUBLISH="call-publish",e.PUBLISH="publish",e.CALL_UPDATESTREAMATTRIBUTES="call-updateStreamAttributes",e.UPDATESTREAMATTRIBUTES="updateStreamAttributes",e.CALL_UNPUBLISH="call-unpublish",e.UNPUBLISH="unpublish",e.CALL_SUBSCRIBE="call-subscribe",e.SUBSCRIBE="subscribe",e.CALL_UPDATESUBSCRIBE="call-updateSubscribe",e.UPDATESUBSCRIBE="updateSubscribe",e.CALL_UNSUBSCRIBE="call-unsubscribe",e.UNSUBSCRIBE="unsubscribe",e.CALL_UPDATEUSERATTRIBUTES="call-updateUserAttributes",e.UPDATEUSERATTRIBUTES="updateUserAttributes",e.CALL_LEAVEROOM="call-leaveRoom",e.LEAVEROOM="leaveRoom",e.ON_USERCONNECTION="on-userConnection",e.ON_USERDISCONNECTION="on-userDisconnection",e.ON_ONADDSTREAM="on-onAddStream",e.ON_ONPUSHSTREAM="on-onPushStream",e.ON_ONREMOVESTREAM="on-onRemoveStream",e.ON_ONPUSHTRACK="on-onPushTrack",e.ON_ONREMOVETRACK="on-onRemoveTrack",e.ON_ONUPDATEUSERATTRIBUTES="on-onUpdateUserAttributes",e.ON_ONUPDATEROOMATTRIBUTES="on-onUpdateRoomAttributes",e.ON_ONUPDATESTREAMATTRIBUTES="on-onUpdateStreamAttributes",e.ON_STREAMFAILED="on-streamFailed",e.ON_POSTPROCESSINGMESSAGE="on-postProcessingMessage",e.ON_ENGINECONTROLMESSAGE="on-engineControlMessage",e.ON_WEBSOCKETENGINECUSTOMMESSAGE="on-websocketEngineCustomMessage",e.UNKNOWN="unknown",e.CALL_UPDATEPUBLISHSTREAMCHANNEL="call-updatePublishStreamChannel",e.UPDATEPUBLISHSTREAMCHANNEL="updatePublishStreamChannel",e.CALL_UPDATESUBSCRIBESTREAMCHANNEL="call-updateSubscribeStreamChannel",e.UPDATESUBSCRIBESTREAMCHANNEL="updateSubscribeStreamChannel",e.ON_ONSTREAMCHANNELCHANGE="on-onStreamChannelChange",e.P2PDIRECT="p2pdirect",e.INTERNAL_CUSTOM="internal_custom",e.REPORT="report",e.CONNECTION_CONTROL="connection_control",e.ON_INTERNAL_CUSTOM="on_internal_custom",e.CONTROLMESSAGE="controlMessage",e.CALL_LOGIN="call-login",e.LOGIN="login",e.CALL_RECONNECTLOGIN="call-reconnectLogin",e.RECONNECTLOGIN="reconnectLogin",e.CALL_LOGOUT="call-logout",e.LOGOUT="logout",e.CALL_UPDATELOGINTOKEN="call-updateLoginToken",e.UPDATELOGINTOKEN="updateLoginToken",e.CALL_SETSERVERPARAMS="call-setServerParams",e.SETSERVERPARAMS="setServerParams",e.CALL_GETPEERONLINESTATUS="call-getPeerOnlineStatus",e.GETPEERONLINESTATUS="getPeerOnlineStatus",e.ON_ONSCENECONFIG="on-onSceneConfig",e.ON_STREAMCONTROLMESSAGE="on-streamControlMessage",e.CALL_STARTPUSHSTREAM="call-startPushStream",e.STARTPUSHSTREAM="startPushStream",e.CALL_STOPPUSHSTREAM="call-stopPushStream",e.STOPPUSHSTREAM="stopPushStream",e.CALL_STARTPULLSTREAM="call-startPullStream",e.STARTPULLSTREAM="startPullStream",e.CALL_STOPPULLSTREAM="call-stopPullStream",e.STOPPULLSTREAM="stopPullStream",e.CALL_UPDATEPULLSTREAM="call-updatePullStream",e.UPDATEPULLSTREAM="updatePullStream",e.ON_ONSTREAMPUSHEDBYOTHER="on-onStreamPushedByOther"}(oD||(oD={})),function(e){e.UP="up",e.DOWN="down",e.DIRECT="direct"}(aD||(aD={})),function(e){e.UP="up",e.DOWN="down",e.PRE="pre"}(sD||(sD={})),function(e){e.UP="up",e.DOWN="down",e.PRE="pre"}(cD||(cD={})),function(e){e.W_0="0",e.W_1="1"}(uD||(uD={})),function(e){e.UP="up",e.DOWN="down"}(dD||(dD={})),function(e){e.ANSWER="answer",e.INCRANSWER="incranswer"}(lD||(lD={})),function(e){e.UP="up",e.DOWN="down"}(fD||(fD={})),function(e){e.SUCCESS="success",e.FAIL="fail"}(hD||(hD={})),function(e){e.W_0="0",e.W_1="1"}(pD||(pD={})),function(e){e.LEAVE_ROOM="leave room",e.ACK_FAILED="ack failed",e.SET_ANSWER_SDP_FAILED="set answer sdp failed",e.ICE_FAILED="ice failed",e.STREAM_FAILED="stream failed",e.NETWORK_RECONNECTED="network reconnected",e.JOIN_ROOM_ACK_FAILED="join room ack failed",e.UNKNOWN="unknown"}(_D||(_D={})),function(e){e.SUCCESS="success",e.FAIL="fail",e.IGNORE="ignore"}(vD||(vD={})),function(e){e.LEAVE_ROOM="leave room",e.ACK_FAILED="ack failed",e.SET_ANSWER_SDP_FAILED="set answer sdp failed",e.ICE_FAILED="ice failed",e.STREAM_FAILED="stream failed",e.NETWORK_RECONNECTED="network reconnected",e.ON_STREAM_REMOVE="on stream remove",e.PUBLISH_MUTE="publish mute",e.UNKNOWN="unknown",e.ON_STREAM_REMOVE_CLIENT_UNPUBLISHED="on stream remove:client unpublished",e.ON_STREAM_REMOVE_PUBLISH_FAILED="on stream remove:publish failed",e.ON_STREAM_REMOVE_STREAM_REMOVED="on stream remove:stream removed",e.ON_STREAM_REMOVE_CLIENT_DISCONNECTED="on stream remove:client disconnected",e.ON_STREAM_REMOVE_CLIENT_REPUBLISH="on stream remove:client republish"}(mD||(mD={})),function(e){e.PLAYOUT_DEVICE_SWITCH="playout_device_switch",e.RECORD_DEVICE_SWITCH="record_device_switch",e.UNKNOWN="unknown"}(gD||(gD={})),function(e){e.BEGIN_SEND="begin_send",e.SENT_END="sent_end",e.BEGIN_RECV="begin_recv",e.RECV_END="recv_end"}(yD||(yD={})),function(e){e.AUDIO="audio",e.VIDEO="video",e.SCREEN_VIDEO="screen_video",e.SCREEN_AUDIO="screen_audio"}(ED||(ED={})),function(e){e.LOGIN="login",e.PUBLISHER="publisher",e.UNMUTE="unmute",e.ENABLE="enable",e.PUSH="push",e.PUBLISH="publish",e.ONDEMAND="ondemand",e.SUBSCRIBE="subscribe",e.PUSH_TRACK="push_track",e.REMOTE_UNMUTE="remote_unmute",e.P2P="p2p"}(SD||(SD={})),function(e){e.TIMEOUT="timeout",e.AUDIENCE="audience",e.MUTE="mute",e.DISABLE="disable",e.STOP_PUSH="stop_push",e.UNPUBLISH="unpublish",e.NO_DEMAND="no_demand",e.LEAVE_ROOM="leave_room",e.UNSUBSCRIBE="unsubscribe",e.REMOVE_TRACK="remove_track",e.REMOTE_MUTE="remote_mute",e.USER_LEAVE="user_leave"}(bD||(bD={})),function(e){e.AUDIO="audio",e.VIDEO="video"}(TD||(TD={})),function(e){e.BEGIN="begin",e.END="end"}(ID||(ID={})),function(e){e.BEGIN="begin",e.END="end"}(AD||(AD={})),function(e){e.LEAVE_ROOM="leave_room",e.ACK_FAILED="ack_failed",e.TOKEN_ERROR="token_error",e.SIGNALING_ERROR="signaling_error",e.TIMEOUT_10="timeout_10",e.TIMEOUT_60="timeout_60"}(RD||(RD={})),function(e){e.UNKNOWN="unknown",e.NEW="new",e.CHECKING="checking",e.CONNECTED="connected",e.FAILED="failed",e.SELECTED="selected",e.CLOSING="closing",e.CLOSED="closed"}(CD||(CD={})),function(e){e.NOMINAL="Nominal",e.FAIR="Fair",e.SERIOUS="Serious",e.CRITICAL="Critical",e.UNKNWON="Unknwon"}(OD||(OD={})),function(e){e.UNKNOWN="UNKNOWN",e.AUDIO_RECORD="AUDIO_RECORD",e.AUDIO_PLAYOUT="AUDIO_PLAYOUT",e.VIDEO="VIDEO",e.SHARE_AUDIO_RECORD="SHARE_AUDIO_RECORD",e.SHARE_VIDEO="SHARE_VIDEO"}(wD||(wD={})),function(e){e.P2P="p2p",e.P2P_OUTSIDE_ROOM="p2p_outside_room",e.P2SERVER="p2server"}(ND||(ND={})),function(e){e.START="start",e.START_CAPTURE_RESULT="start_capture_result",e.STARTED="started",e.RUNNING_FAILED="running_failed",e.STOP="stop",e.STOPPED="stopped"}(kD||(kD={})),function(e){e.DSHOW="dshow",e.MF="mf",e.AVCAPTURESESSION="avcapturesession",e.CAMERA1="camera1",e.CAMERA2="camera2"}(DD||(DD={})),function(e){e.SUCCESS="success",e.CAMERA_DEVICE_NO_PERMISSION="camera_device_no_permission",e.CAMERA_DEVICE_BUSY="camera_device_busy",e.CAMERA_DEVICE_FAILURE="camera_device_failure",e.CAMERA_DEVICE_NOT_FOUND="camera_device_not_found",e.CAMERA_DEVICE_DISCONNECTED="camera_device_disconnected",e.TIMEOUT="timeout",e.ABORT="abort"}(PD||(PD={})),function(e){e.UNKNOWN="unknown",e.MUSIC="music",e.HIGHQUALITY_COMMUNICATION="highquality_communication",e.COMMUNICATION="communication",e.MEDIA="media",e.GAME_STREAMING="game_streaming"}(MD||(MD={})),function(e){e.UNKNOWN="unknown",e.MEDIA="media",e.COMMUNICATION="communication"}(UD||(UD={})),function(e){e.UNKNOWN="unknown",e.SLEEP="Sleep",e.AWAKE="Awake"}(LD||(LD={})),function(e){e.UNKNOWN="unknown",e.PRODUCT="product",e.BOE="boe",e.TEST="test"}(xD||(xD={}));var QD,eP,tP,rP=function(){function e(){}return e.prototype.setStats=function(e){var t=this;Object.keys(e).forEach((function(r){t["_"+r]=e[r]})),aP.StartUp()},Object.defineProperty(e.prototype,"event_key",{get:function(){return this._event_key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_id",{get:function(){return this._device_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_app_id",{get:function(){return this._rtc_app_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"product_line",{get:function(){return this._product_line},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_version",{get:function(){return this._report_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"os",{get:function(){return this._os},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sdk_version",{get:function(){return this._rtc_sdk_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_timestamp",{get:function(){return this._rtc_timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sdk_git_commit",{get:function(){return this._rtc_sdk_git_commit},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_id",{get:function(){return this._report_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connection_id",{get:function(){return this._connection_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sid",{get:function(){return this._rtc_sid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"engine_session_id",{get:function(){return this._engine_session_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_business_id",{get:function(){return this._rtc_business_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"project_key",{get:function(){return this._project_key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"network_type",{get:function(){return this._network_type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"app_version",{get:function(){return this._app_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aid",{get:function(){return this._aid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_model",{get:function(){return this._device_model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_brand",{get:function(){return this._device_brand},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"common_extra_info",{get:function(){return this._common_extra_info},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"had_selected_p2p",{get:function(){return this._had_selected_p2p},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_env_type",{get:function(){return this._rtc_env_type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"room_id",{get:function(){return this._room_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"user_id",{get:function(){return this._user_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_session_id",{get:function(){return this._rtc_session_id},enumerable:!1,configurable:!0}),e}(),nP=new rP,iP=vw.LOG_SERVER_URL,oP=function(){function e(){var e=this;this.report_id=0,this.dataBuffer=[],this.posting=!1,this.report_common={},this.preSucTime=0,this.errSendDelay=100,"undefined"!=typeof window&&window.addEventListener("beforeunload",(function(){clearTimeout(e.errSendTimer),clearTimeout(e.sucSendTimer),e.send(null,!0)}))}return e.prototype.push=function(e,t){t?this.send(e):(this.dataBuffer.push(e),!this.posting&&!this.errSendTimer&&Date.now()-this.preSucTime>2e3&&(clearTimeout(this.sucSendTimer),this.send()))},e.prototype.unshift=function(e){this.dataBuffer=e.concat(this.dataBuffer)},e.prototype.send=function(e,t){var r=this;if(e||this.dataBuffer.length){var n={data:e||this.dataBuffer.splice(0,4e3),header:this.report_common,from:"web",os:"web",version:"1"},i=new XMLHttpRequest;if(i.timeout=1e4,i.onreadystatechange=function(){if(4===i.readyState){e||(r.posting=!1);var o=void 0;if(200===i.status||304===i.status)try{o=JSON.parse(i.responseText)}catch(e){}o&&0===o.StatusCode?e||t||r.sucSend():e?r.send(e):(r.unshift(n.data),t?r.send():r.errSend())}},i.open("POST",iP,!0),e||(this.posting=!0),location.search.includes("_rtc_debug_"))i.send(JSON.stringify(n));else{var o=BD.gzip(JSON.stringify(n));i.setRequestHeader("Content-Encoding","gzip"),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.send(o)}}},e.prototype.sucSend=function(){this.errSendDelay=100,this.preSucTime=Date.now(),this.sucSendTimer=setTimeout(this.send.bind(this),2e3)},e.prototype.errSend=function(){var e=this;this.errSendTimer=setTimeout((function(){e.send(),e.errSendTimer=null}),this.errSendDelay),this.errSendDelay*=2},e.prototype.StartUp=function(){var e=this.report_common,t=nP.event_key,r=nP.device_id,n=nP.rtc_app_id,i=nP.product_line,o=nP.report_version,a=nP.os,s=nP.rtc_sdk_version,c=nP.rtc_timestamp,u=nP.rtc_sdk_git_commit,d=nP.report_id,l=nP.connection_id,f=nP.rtc_sid,h=nP.engine_session_id,p=nP.rtc_business_id,_=nP.project_key,v=nP.network_type,m=nP.app_version,g=nP.aid,y=nP.device_model,E=nP.device_brand,S=nP.common_extra_info,b=nP.had_selected_p2p,T=nP.rtc_env_type;Object.assign(e,{event_key:t,device_id:r,rtc_app_id:n,product_line:i,report_version:o,os:a,rtc_sdk_version:s,rtc_timestamp:c,rtc_sdk_git_commit:u,report_id:d,connection_id:l,rtc_sid:f,engine_session_id:h,rtc_business_id:p,project_key:_,network_type:v,app_version:m,aid:g,device_model:y,device_brand:E,common_extra_info:S,had_selected_p2p:b,rtc_env_type:T}),nP.room_id&&(e.room_id=nP.room_id),nP.user_id&&(e.user_id=nP.user_id),nP.rtc_session_id&&(e.rtc_session_id=nP.rtc_session_id)},e.prototype.rtcSdkApiCall=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_sdk_api_call",report_id:this.report_id++,rtc_timestamp:Date.now(),sdk_api_name:e,error_code:t,message:r},n);this.push(i)},e.prototype.rtcSdkCallback=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_sdk_callback",report_id:this.report_id++,rtc_timestamp:Date.now(),sdk_callback_name:e,error_code:t,message:r},n);this.push(i)},e.prototype.rtcReconnect=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_reconnect",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reconnect_id:r,reconnect_type:n},i);this.push(o)},e.prototype.rtcReconnected=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_reconnected",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,reconnect_type:t},r);this.push(n)},e.prototype.rtcGetAccess=function(e,t,r,n,i,o,a){void 0===a&&(a={});var s=y({event_key:"rtc_get_access",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,elapse:r,type:n,host:i,connect_session_id:o},a);this.push(s)},e.prototype.rtcPreIceState=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_pre_ice_state",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,ice_state:t},r);this.push(n)},e.prototype.rtcNodeChange=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_node_change",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reason:r},n);this.push(i)},e.prototype.rtcSignalingMsgError=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_signaling_msg_error",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reason:r},n);this.push(i)},e.prototype.rtcSignaling=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"rtc_signaling",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,signaling_event:r,signaling_type:n,direction:i},o);this.push(a)},e.prototype.rtcJoinRoom=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_join_room",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,deviceModel:t,deviceManufacturer:r,elapse:n},i);this.push(o)},e.prototype.rtcLeaveRoom=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_leave_room",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,elapse:r},n);this.push(i)},e.prototype.rtcBeginCreateOffer=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_begin_create_offer",report_id:this.report_id++,rtc_timestamp:Date.now(),direction:e,stream_id:t,stream_user_id:r},n);this.push(i)},e.prototype.rtcCreateOffer=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"rtc_create_offer",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,direction:t,stream_id:r,stream_user_id:n,elapse:i},o);this.push(a)},e.prototype.rtcSetDescription=function(e,t,r,n,i,o,a,s){void 0===s&&(s={});var c=y({event_key:"rtc_set_description",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,is_local:r,direction:n,stream_id:i,stream_user_id:o,elapse:a},s);this.push(c)},e.prototype.rtcRecvAnswer=function(e,t,r,n,i,o,a,s){void 0===s&&(s={});var c=y({event_key:"rtc_recv_answer",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,answer_type:t,sequence_id:r,message:n,direction:i,stream_id:o,stream_user_id:a},s);this.push(c)},e.prototype.firstRemoteAudioRender=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"first_remote_audio_render",report_id:this.report_id++,rtc_timestamp:Date.now(),stream_id:e,stream_user_id:t},r);this.push(n)},e.prototype.firstRemoteVideoRender=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"first_remote_video_render",report_id:this.report_id++,rtc_timestamp:Date.now(),stream_id:e,stream_user_id:t},r);this.push(n)},e.prototype.rtcPublishStat=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_publish_stat",report_id:this.report_id++,rtc_timestamp:Date.now(),result:e,is_screen:t,start:r,message:n},i);this.push(o)},e.prototype.rtcSubscribeStat=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"rtc_subscribe_stat",report_id:this.report_id++,rtc_timestamp:Date.now(),result:e,start:t,message:r,stream_user_id:n},i);this.push(o)},e.prototype.rtcAudioDevice=function(e,t,r,n){void 0===n&&(n={});var i=y({event_key:"rtc_audio_device",report_id:this.report_id++,rtc_timestamp:Date.now(),audio_event:e,message:t,error_code:r},n);this.push(i)},e.prototype.rtcMediaStatistics=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_media_statistics",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcMessageStatistics=function(e,t,r,n){void 0===n&&(n={});var i=y(y(y(y({event_key:"rtc_message_statistics",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),{media_server_ip:r}),n);this.push(i)},e.prototype.rtcError=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_error",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,error_code:t},r);this.push(n)},e.prototype.rtcInvokeStatus=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"rtc_invoke_status",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,error_code:t,sdk_api_name:r,stream_id:n,elapse:i},o);this.push(a)},e.prototype.rtcFirstFrame=function(e,t){void 0===t&&(t={});var r=y(y({event_key:"rtc_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t);this.push(r)},e.prototype.rtcMuteRemote=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_mute_remote",report_id:this.report_id++,rtc_timestamp:Date.now()},e),{media_type:t}),r);this.push(n)},e.prototype.sdkInitEngine=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"sdk_init_engine",report_id:this.report_id++,rtc_timestamp:Date.now(),start:e,type:t},r);this.push(n)},e.prototype.joinRoom=function(e,t,r,n,i){void 0===i&&(i={});var o=y({event_key:"join_room",report_id:this.report_id++,rtc_timestamp:Date.now(),type:e,start:t,result:r,reason:n},i);this.push(o)},e.prototype.p2pConnectionStatus=function(e,t,r,n,i,o){void 0===o&&(o={});var a=y({event_key:"p2p_connection_status",report_id:this.report_id++,rtc_timestamp:Date.now(),room_id:e,user_id:t,peer_user_id:r,status:n,elapse:i},o);this.push(a)},e.prototype.p2pConnectClosed=function(e,t){void 0===t&&(t={});var r=y({event_key:"p2p_connect_closed",report_id:this.report_id++,rtc_timestamp:Date.now(),p2p_selected:e},t);this.push(r)},e.prototype.rtcDeviceError=function(e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v){void 0===v&&(v={});var m=y({event_key:"rtc_device_error",report_id:this.report_id++,rtc_timestamp:Date.now(),device_type:e,device_stage:t,error_code:r,system_error_code:n,system_api:i,call_parameters:o,location:a,message:s,media_device_id:c,media_device_name:u,elapse:d,scenario:l,event_session_id:f,device_pid:h,device_vid:p,media_mode:_},v);this.push(m)},e.prototype.rtcVideoDevice=function(e,t,r){void 0===r&&(r={});var n=y({event_key:"rtc_video_device",report_id:this.report_id++,rtc_timestamp:Date.now(),media_device_id:e,media_device_name:t},r);this.push(n)},e.prototype.rtcVideoCaptureEvent=function(e,t){void 0===t&&(t={});var r=y(y({event_key:"rtc_video_capture_event",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t);this.push(r)},e.prototype.rtcEncodeFirstFrame=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_encode_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcFirstFrameEncoded=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_first_frame_encoded",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcSendFirstPacket=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_send_first_packet",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcRecvFirstPacket=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_recv_first_packet",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcRecvFirstFrame=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_recv_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcDecodeFirstFrame=function(e,t,r){void 0===r&&(r={});var n=y(y(y({event_key:"rtc_decode_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e}(),aP=new oP;function sP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t,r,n){if("function"==typeof n.value){var i=n.value;n.value=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o={};return e.forEach((function(e,r){o[e]=t[r]})),aP.rtcSdkApiCall(r,0,JSON.stringify(cO(t)),o),i.apply(this,t)}}}}function cP(e,t,r){void 0===r&&(r=0),aP.rtcSdkCallback(e,r,JSON.stringify(t))}function uP(e,t,r){void 0===r&&(r=0),aP.rtcInvokeStatus(JSON.stringify(t),r,e,"",0)}!function(e){e.streamRemovedBySchedule308="stream removed",e.clientRePublish="client republish",e.publishStreamFaied="publish failed",e.clientUnPublish="client unpublished",e.clientDisconnected="client disconnected",e.videoMuted="video muted"}(QD||(QD={})),function(e){e.ON_ADD_STREAM="onAddStream",e.ON_REMOVE_STREAM="onRemoveStream",e.USER_DISCONNECTION="userDisconnection",e.USER_CONNECTION="userConnection",e.ON_UPDATE_STREAM_ATTRIBUTES="onUpdateStreamAttributes",e.ON_UPDATE_ROOM_ATTRIBUTES="onUpdateRoomAttributes",e.ON_PUSH_TRACK="onPushTrack",e.ON_REMOVE_TRACK="onRemoveTrack",e.ON_CUSTOM_MESSAGE="onCustomMessage",e.NODE_CHANGE="nodeChange",e.USER_MESSAGE_RECEIVED="userMessageReceived",e.USER_BINARY_MESSAGE_RECEIVED="userBinaryMessageReceived",e.POST_PROCESSING_MESSAGE="postProcessingMessage"}(eP||(eP={})),function(e){e.ON_CONNECTION_STATE_CHANGE="onConnectionStateChange",e.ABNORMAL_DISCONNECTION="normalConnection"}(tP||(tP={}));var dP=new PO("DataChannelSignaling",3),lP=0,fP=1,hP=0,pP=0,_P=function(e){function t(t){var r=t.appId,n=t.roomId,i=t.clientId,o=t.dataChannel,a=e.call(this)||this;return a._appId=r,a._roomId=n,a._clientId=i,a._dataChannel=o,a._resolveCallbacks=new Map,a._rejectCallbacks=new Map,a._p2pResolveCallbacks=new Map,a._p2pRejectCallbacks=new Map,a._p2pMessageId=0,a._rttIds={},a._signalingType=new Map,a._timer={},a._clearDataChannelListener=a._handleHandler(),window.__rtc_mock_signaling__=a.emit.bind(a),a}return r(t,e),t.prototype.destroy=function(){this._dataChannel&&(this._clearDataChannelListener(),this._dataChannel.close()),this._resolveCallbacks=new Map,this._rejectCallbacks=new Map,this._p2pResolveCallbacks=new Map,this._p2pRejectCallbacks=new Map,this._p2pMessageId=0,this._rttIds={},this._signalingType=new Map,this._timer={}},t.prototype.sendSignaling=function(e,t){var r=this;return aP.rtcSignaling(0,JSON.stringify(t),"call-".concat(e),"Send",aD.UP),new Promise((function(n,i){if(!r._dataChannel||"open"!==r._dataChannel.readyState)return i(new GI(VI.SIGNALING_CHANNEL_NOT_OPEN,"DataChannel not open"));var o=[2,1],a=sO();o=o.concat(a);var s=a.join("-");r._resolveCallbacks.set(s,n),r._rejectCallbacks.set(s,i),r._signalingType.set(s,e),r._timer[s]=setTimeout((function(){i(new GI(VI.TIME_OUT,"Signaling message time out"))}),1e4),dP.print("Signal",">>>>>> [".concat(e,"][").concat(s,"]"),t),r._sendMessage(e,o,t)}))},t.prototype.sendPingMessage=function(){var e="CheckConnectivity",t=sO(),r={ts:(new Date).getTime()};aP.rtcSignaling(0,JSON.stringify(r),"call-".concat(e),"Send",aD.UP),dP.print("Signal",">>>>>> [".concat(e,"][").concat(t.join("-"),"] ping")),this._sendMessage(e,A([2,9],I(t),!1),r)},t.prototype.sendP2PMessage=function(e,t){var r=t instanceof ArrayBuffer,n=r?eO.encodeBase64(aO.ab2str(t)):JSON.stringify(t);return this._sendP2PMessage(e,n,!1,!1,r)},t.prototype._sendP2PMessage=function(e,t,r,n,i,o){var a=this;void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1);var s=this._p2pMessageId++,c=o||{ver:1,id:+s,time:Date.now(),dir:lP,type:hP,err:pP,app:this._appId,room:this._roomId,from:this._clientId,to:e,binary:i,msg:t};return n||-1!==(null==t?void 0:t.indexOf("__web__rtc__rtt__"))||dP.print("_sendP2PMessage [DC Signaling p2p >>]",JSON.stringify(c)),new Promise((function(e,i){if(!a._dataChannel||"open"!==a._dataChannel.readyState)return i(new GI(VI.SIGNALING_CHANNEL_NOT_OPEN,"DataChannel not open"));var o=[2,5];(null==t?void 0:t.indexOf("__web__rtc__rtt__"))>-1&&(a._rttIds[s]=s,n=!0);var u=sO();o=o.concat(u),r||(a._p2pResolveCallbacks.set(s,e),a._p2pRejectCallbacks.set(s,i),a._timer[s]=setTimeout((function(){i(new GI(VI.TIME_OUT,"P2P message timeout"))}),1e4)),a._sendMessage("p2p",o,c)}))},t.prototype._sendMessage=function(e,t,r){return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){return n=aO.str2ab(JSON.stringify([e,r])),i=oO(Uint8Array,t,new Uint8Array(n)),this._dataChannel.send(i.buffer),[2]}))}))},t.prototype._dispartData=function(e){var t={messageType:0,compress:!1,direction:"ack"},r="",n=(new Uint8Array([]),new Uint8Array(e)),i=n[0],o=n[1],a=1&o;t.messageType=(60&o)>>2,t.compress=16==(16&i),t.direction=2==(2&o)?"ack":"send";var s=0;if(a||"ack"===t.direction){for(var c=2;c<=6;c++){var u=n[c];if(128!=(128&u)){s=c-2+1;break}}r=n.slice(2,2+s).join("-")}return{config:t,id:r,data:n.slice(2+s),needAck:a}},t.prototype._feedbackSignaling=function(e,t){void 0===e&&(e="");var r=e.split("-").map((function(e){return+e})),n=[2,3];n=n.concat(r);var i=r.join("-");dP.print("Signal",">>>>>> [".concat(t,"-res][").concat(i,"]")),this._sendMessage("".concat(t,"-res"),n,"")},t.prototype._feedbackMessage=function(e){var t,r=(null===(t=null==e?void 0:e.msg)||void 0===t?void 0:t.indexOf("__web__rtc__rtt__"))>-1;e.dir=fP,e.msg="",this._sendP2PMessage(e.to,"",!0,r,!1,e)},t.prototype._handleFeedback=function(e){var t=(e=y({},e)).id,r=this._p2pResolveCallbacks.get(t),n=this._p2pRejectCallbacks.get(t);if(clearTimeout(this._timer[t]),this._p2pResolveCallbacks.delete(t),this._p2pRejectCallbacks.delete(t),e.err===pP)"function"==typeof r&&r(t);else"function"==typeof n&&n(e)},t.prototype._handleMessage=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,d,l,f,h,p,_,v,m;return b(this,(function(g){switch(g.label){case 0:return n=this._dispartData(e),i=n.config,o=n.id,a=n.data,s=a,i.compress&&((c=new BD.Inflate).push(s,!0),s=c.result),[4,aO.ab2str(s)];case 1:u=g.sent(),d=[];try{d=JSON.parse(u)}catch(e){return e instanceof Error&&aP.rtcSignalingMsgError(-1,e.message,iD.MESSAGE_PARSE_FAILED),[2]}switch(l="p2p",i.messageType){case 0:"ack"===i.direction?(f=this._resolveCallbacks.get(o),h=this._rejectCallbacks.get(o),p=d[0]||{},clearTimeout(this._timer[o]),this._resolveCallbacks.delete(o),this._rejectCallbacks.delete(o),200===(null==p?void 0:p.code)?"function"==typeof f&&f(p):"function"==typeof h&&h(p),(l=this._signalingType.get(o))&&(this._signalingType.delete(o),dP.print("Signal","<<<<<< [".concat(l,"-ack]"),p)),aP.rtcSignaling(0,u,l,"Ack",aD.DOWN)):Array.isArray(d)&&(l=d[0],d=d[1],dP.print("Signal","<<<<<< ".concat(l),d,o),this._feedbackSignaling(o,l),d.binary&&"string"==typeof d.message&&(d.message=aO.str2ab(eO.decodeBase64(d.message))),this.emit(l,y({},d)),aP.rtcSignaling(0,u,"on-".concat(l),"Recv",aD.DOWN));break;case 1:switch(Array.isArray(d)&&(l=d[0],d=d[1]),_=null==d?void 0:d.id,this._rttIds[_]||(null==d?void 0:d.dir)===fP||(null===(t=null==d?void 0:d.msg)||void 0===t?void 0:t.indexOf("__web__rtc__rtt__"))>-1?delete this._rttIds[_]:dP.print("Signal","<<<<<< p2p response",d),d.dir){case lP:-1===(null===(r=null==d?void 0:d.msg)||void 0===r?void 0:r.indexOf("__web__rtc__rtt__"))&&(v=d.binary,m=d.msg,this.emit(v?eP.USER_BINARY_MESSAGE_RECEIVED:eP.USER_MESSAGE_RECEIVED,y(y({},d),{msg:v?aO.str2ab(eO.decodeBase64(m)):m}))),this._feedbackMessage(d);break;case fP:this._handleFeedback(d)}break;case 2:dP.print("Signal","<<<<<< pong"),aP.rtcSignaling(0,u,"CheckConnectivity","Recv",aD.DOWN)}return[2]}}))}))},t.prototype._handleHandler=function(){var e=this,t=function(t){dP.print("_handleHandler","dataChannel close",t),e.emit("close",t)},r=function(t){dP.print("_handleHandler","dataChannel error",t),e.emit("close",t)},n=function(t){e._handleMessage(t.data)};return this._dataChannel.addEventListener("close",t),this._dataChannel.addEventListener("error",r),this._dataChannel.addEventListener("message",n),function(){e._dataChannel.removeEventListener("close",t),e._dataChannel.removeEventListener("error",r),e._dataChannel.removeEventListener("message",n)}},t}(SO.exports.EventEmitter),vP=function(){function e(){this.isSending=!1}return e.prototype.ajax=function(e){var t=this,r=e.method,n=e.url,i=e.body,o=void 0===i?{}:i,a=e.headers,s=void 0===a?{}:a,c=e.stringify,u=void 0===c||c;return new Promise((function(e,i){var a,c;t.isSending=!0;var d=new XMLHttpRequest;d.open(r,n,!0);try{for(var l=T(Object.entries(s)),f=l.next();!f.done;f=l.next()){var h=I(f.value,2),p=h[0],_=h[1];d.setRequestHeader(p,_)}}catch(e){a={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error}}d.onreadystatechange=function(){4===d.readyState&&(t.isSending=!1,200===d.status?e(JSON.parse(d.responseText)):i({message:d.statusText,code:d.status})),0===d.status&&i({code:0,message:"Request abort"})},d.onerror=function(e){var r=VI.UNEXPECTED_ERROR;t.isSending=!1,i({code:r,message:d.responseText||"unknown"})},u&&(o=JSON.stringify(o)),d.send(o),t.xhr=d}))},e.prototype.get=function(e,t){return this.ajax({method:"GET",url:e,headers:t})},e.prototype.post=function(e,t,r,n){return this.ajax({method:"POST",url:e,body:t,headers:r,stringify:n})},e.prototype.abort=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}(),mP="RTC_DEVICE_ID",gP="RTC_DEFAULT_SDP",yP="RTC_ACCESS_NODE",EP="RTC_ACCESS_URLS",SP=function(){function e(){}return e.prototype.get=function(e){var t=localStorage.getItem(e);if(!t)return null;try{var r=JSON.parse(t);return r.ttl>0&&Date.now()-r.saveTime>r.ttl?(this.delete(e),null):r.message}catch(e){return null}},e.prototype.set=function(e,t,r){void 0===r&&(r=-1);var n={ttl:r,saveTime:Date.now(),message:t};try{return localStorage.setItem(e,JSON.stringify(n)),!0}catch(e){return!1}},e.prototype.delete=function(e){try{return localStorage.removeItem(e),!0}catch(e){return!1}},e}(),bP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getDeviceId=function(){var e=this.get(mP);return e||(e=vC()),this.set(mP,e),e},t.prototype.getDefaultSdp=function(){return this.get(gP)},t.prototype.setDefaultSdp=function(e){return this.set(gP,e,108e6)},t.prototype.getAccessNode=function(e){return this.get("".concat(yP,"_").concat(e,"-BytePlus"))},t.prototype.setAccessNode=function(e,t,r){return this.set("".concat(yP,"_").concat(e,"-BytePlus"),t,1e3*r)},t.prototype.getAccessUrls=function(){return this.get("".concat(EP,"-BytePlus"))},t.prototype.setAccessUrls=function(e){var t=e.map((function(e){var t=e.host,r=e.path;return"https://".concat(t).concat(r)}));return this.set("".concat(EP,"-BytePlus"),t)},t.prototype.clearAccessUrls=function(){this.delete("".concat(EP,"-BytePlus"))},t}(SP),TP=new bP,IP=new PO("ICE Request",3),AP=function(){function e(){this._request=new vP}return e.prototype.getAccessNode=function(e,t,r,n,i,o){return S(this,void 0,void 0,(function(){var a;return b(this,(function(s){return(a=TP.getAccessNode(e))?(this.getAccessNodeFromServer(e,t,r,n,i,o),uP("es.R.node.cache",a),[2,Promise.resolve(a)]):[2,this.getAccessNodeFromServer(e,t,r,n,i,o)]}))}))},e.prototype.getAccessNodeFromServer=function(e,t,r,n,i,o){return S(this,void 0,void 0,(function(){var a,s,c=this;return b(this,(function(u){return a=TP.getAccessUrls(),s=!0,uP("es.R.req.cache.urls",a),(null==a?void 0:a.length)>0||(a=vw.ICE_CONFIG_REQUEST_URLS,s=!1,uP("es.R.req.external.urls",a)),(null==a?void 0:a.length)>0||(a=vw.ICE_CONFIG_REQUEST_URLS_INTERNAL,s=!1,uP("es.R.req.internal.urls",a)),[2,this.getICEConfigFromServer(a,e,t,r,n,i,o).then((function(t){var r=t.nodes[0];return TP.setAccessNode(e,r,t.ttl||11200),TP.setAccessUrls(t.dispatchDomains),r})).catch((function(a){if(s)return uP("es.R.req.fallback",""),TP.clearAccessUrls(),c.getAccessNodeFromServer(e,t,r,n,i,o);throw a}))]}))}))},e.prototype.getICEConfigFromServer=function(e,t,r,n,i,o,a){var s;return S(this,void 0,void 0,(function(){var c,u,d,l=this;return b(this,(function(f){return c={appID:t,roomID:r,userID:n,deviceID:i,connectSessionID:nO(),os:"web",sdkVersion:vw.VERSION,expectedAddr:gw("EXPECTED_ADDR"),productPlatform:"BytePlus"},o&&a&&(c.feedbackInfo=[{feedbackIP:null===(s=a.publicIPs[0])||void 0===s?void 0:s.ip,feedbackReason:{type:"NodeChanged",reason:o}}],delete c.expectedAddr),u=Date.now(),aP.rtcGetAccess(0,JSON.stringify(c),0,rD.REQUEST,e.join(","),c.connectSessionID),d=e.map((function(e,t){return S(l,void 0,void 0,(function(){var r,n,i;return b(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._request.post(e,c)];case 1:return r=o.sent(),[3,3];case 2:throw n=o.sent(),new GI(VI.ICE_SERVER_WRONG,"get ICE config failed",n);case 3:if(200!==r.code)throw new GI(VI.ICE_SERVER_WRONG,"get ICE config failed",{server_code:r.code,message:JSON.stringify(r)});if(!(i=r.nodes[0]))throw new GI(VI.ICE_SERVER_WRONG,"ICE config server return empty nodes",{code:r.code,message:JSON.stringify(r)});return[2,{result:r,firstNode:i,index:t}]}}))}))})),[2,Promise.race(d).then((function(t){var r=t.result;t.firstNode;var n=t.index;return aP.rtcGetAccess(200,JSON.stringify(r),Date.now()-u,rD.RESPONSE,e[n],c.connectSessionID),r})).catch((function(t){throw aP.rtcGetAccess(t.error.code||t.error.server_code,t.error.message,Date.now()-u,rD.RESPONSE,e.join(","),c.connectSessionID),t}))]}))}))},e.prototype.abort=function(){this._request.isSending&&(IP.print("abort","HTTP Request of [getICEConfigFromServer] abort"),this._request.abort())},e}(),RP=fS.left,CP=ke,OP=Qf;bi({target:"Array",proto:!0,forced:!ul("reduce")||!OP&&CP>79&&CP<83},{reduce:function(e){var t=arguments.length;return RP(this,e,t,t>1?arguments[1]:void 0)}});var wP={},NP={},kP={exports:{}},DP=kP.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(DP).forEach((function(e){DP[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},r=function(e,r,n){var i=e.name&&e.names;e.push&&!r[e.push]?r[e.push]=[]:i&&!r[e.name]&&(r[e.name]={});var o=e.push?{}:i?r[e.name]:r;!function(e,r,n,i){if(i&&!n)r[i]=t(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(r[n[o]]=t(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&r[e.push].push(o)},n=kP.exports,i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(i).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(n[t]||[]).length;s+=1){var c=n[t][s];if(c.reg.test(i))return r(c,a,i)}})),t.media=o,t};var o=function(e,r){var n=r.split(/=(.+)/,2);return 2===n.length?e[n[0]]=t(n[1]):1===n.length&&r.length>1&&(e[n[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var r=[],n=e.split(" ").map(t),i=0;i<n.length;i+=3)r.push({component:n[i],ip:n[i+1],port:n[i+2]});return r},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var r,n=!1;return"~"!==e[0]?r=t(e):(r=t(e.substring(1,e.length)),n=!0),{scid:r,paused:n}}))}))}}(NP);var PP=kP.exports,MP=/%[sdv%]/g,UP=function(e){var t=1,r=arguments,n=r.length;return e.replace(MP,(function(e){if(t>=n)return e;var i=r[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},LP=function(e,t,r){var n=[e+"="+(t.format instanceof Function?t.format(t.push?r:r[t.name]):t.format)];if(t.names)for(var i=0;i<t.names.length;i+=1){var o=t.names[i];t.name?n.push(r[t.name][o]):n.push(r[t.names[i]])}else n.push(r[t.name]);return UP.apply(null,n)},xP=["v","o","s","i","u","e","p","c","b","t","r","z","a"],BP=["i","c","b","a"],VP=NP,jP=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var r=t.outerOrder||xP,n=t.innerOrder||BP,i=[];return r.forEach((function(t){PP[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(LP(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(LP(t,r,e))}))}))})),e.media.forEach((function(e){i.push(LP("m",PP.m[0],e)),n.forEach((function(t){PP[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(LP(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(LP(t,r,e))}))}))}))})),i.join("\r\n")+"\r\n"};wP.write=jP,wP.parse=VP.parse,wP.parseParams=VP.parseParams,wP.parseFmtpConfig=VP.parseFmtpConfig,wP.parsePayloads=VP.parsePayloads,wP.parseRemoteCandidates=VP.parseRemoteCandidates,wP.parseImageAttributes=VP.parseImageAttributes,wP.parseSimulcastStreamList=VP.parseSimulcastStreamList;var FP=function(){function e(e){this._iceConfigNode=e}return e.prototype.modifyByIceNode=function(e){var t,r=this._iceConfigNode.iceParams,n=wP.parse(e);return null===(t=n.media)||void 0===t||t.forEach((function(e){e.iceUfrag=null==r?void 0:r.clientIceUfrag,e.icePwd=null==r?void 0:r.clientIcePwd,e.iceOptions="renomination"})),wP.write(n)},e}(),GP=function(){function e(e){this._iceConfigNode=e}return e.prototype.modifyByIceNode=function(e){var t,r=this,n=this._iceConfigNode.certFingerprint,i=wP.parse(e);return(null==i?void 0:i.fingerprint)&&(i.fingerprint={type:"sha-256",hash:n}),null===(t=null==i?void 0:i.media)||void 0===t||t.forEach((function(e){return r.modifyMlineByIceNode(e)})),wP.write(i)},e.prototype.modifyMlineByIceNode=function(e){var t=this._iceConfigNode,r=t.publicIPs,n=t.certFingerprint,i=t.iceParams;e.fingerprint&&(e.fingerprint={type:"sha-256",hash:n}),e.icePwd=i.serverIcePwd,this._iceUfrag||(this._iceUfrag=$P(i.serverIceUfrag),nP.setStats({connection_id:this._iceUfrag})),e.iceUfrag=this._iceUfrag,e.setup="active",this._candidates||(this._candidates=ZP(r)),e.candidates=this._candidates,e.iceOptions="renomination","application"===e.type&&(e.sctpmap={sctpmapNumber:5e3,app:"webrtc-datachannel",maxMessageSize:262144})},e}();function zP(e,t){var r,n=wP.parse(e),i=[];return n.media=n.media.map((function(e){return t.includes(e.mid+"")?(e.direction="inactive",e.port=0,delete e.ext,delete e.ssrcs,delete e.ssrcGroups,delete e.simulcast,delete e.simulcast_03,delete e.rids,delete e.extmapAllowMixed,delete e.bundleOnly):"inactive"!==e.direction&&i.push(e.mid),e})),(null===(r=n.groups)||void 0===r?void 0:r[0])&&(n.groups[0].mids=i.join(" ")),n}var HP,WP,YP,KP,XP,qP=function(e,t){var r,n;try{var i=wP.parse(e),o=wP.parse(t),a="".concat(null===(r=o.groups)||void 0===r?void 0:r[0].mids).split(" "),s="".concat(null===(n=i.groups)||void 0===n?void 0:n[0].mids).split(" "),c={};a.forEach((function(e){return c[e]=e}));var u={};s.forEach((function(e){c[e]||(u[e]=e)}));var d="",l="";return i.media=i.media.filter((function(e){return u[e.mid]&&"audio"===e.type?d="".concat(e.mid):u[e.mid]&&"video"===e.type&&(l="".concat(e.mid)),u[e.mid]})),delete i.groups,delete i.msidSemantic,{partialSdp:wP.write(i),audioMid:d,videoMid:l}}catch(e){return null}},JP=function(e,t){var r;try{var n=wP.parse(e),i=[];return null===(r=n.media)||void 0===r||r.forEach((function(e){(null==t?void 0:t.includes("".concat(e.mid)))&&i.push(e)})),n.media=i,delete n.groups,delete n.msidSemantic,wP.write(n)}catch(e){return""}},ZP=function(e){if(!Array.isArray(e))return[];var t=0,r=2130706431,n=[];return e.forEach((function(e){var i={component:1,ip:e.ip,type:"host",generation:e.generation};e.udpPorts&&e.udpPorts.forEach((function(e){n.push(y(y({},i),{foundation:t++,transport:"udp",port:e,priority:r}))})),e.tcpPorts&&e.tcpPorts.forEach((function(e){n.push(y(y({},i),{foundation:t++,transport:"tcp",port:e,tcptype:"passive",priority:2130705431}))}))})),n},$P=function(e){var t=new TextEncoder,r=t.encode("PREC"),n=new Uint8Array(aO.str2ab(e)),i=t.encode(Date.now().toString()).slice(-4),o=new Uint8Array(4);o[0]=0,o[1]=1,o[2]=1,o[3]=1;var a=oO(Uint8Array,r,n,i,o),s=aO.ab2str(a.buffer);return eO.encodeBase64(s)},QP="safari"===(HP="none",null!==window.navigator.userAgent.match("Firefox")?HP="mozilla":null!==window.navigator.userAgent.match("Chrome")?(HP="chrome-stable",null!==window.navigator.userAgent.match("Electron")&&(HP="electron")):(null!==window.navigator.userAgent.match("Safari")||null!==window.navigator.userAgent.match("AppleWebKit"))&&(HP="safari"),HP);!function(e){e.codec="codec",e.inboundRtp="inbound-rtp",e.outboundRtp="outbound-rtp",e.remoteInboundRtp="remote-inbound-rtp",e.remoteOutboundRtp="remote-outbound-rtp",e.mediaSource="media-source",e.csrc="csrc",e.peerConnection="peer-connection",e.dataChannel="data-channel",e.stream="stream",e.track="track",e.transceiver="transceiver",e.sender="sender",e.receiver="receiver",e.transport="transport",e.sctpTransport="sctp-transport",e.candidatePair="candidate-pair",e.localCandidate="local-candidate",e.remoteCandidate="remote-candidate",e.certificate="certificate",e.iceServer="ice-server"}(WP||(WP={})),function(e){e[e.encode=0]="encode",e[e.decode=1]="decode"}(YP||(YP={})),function(e){e[e.none=0]="none",e[e.cpu=1]="cpu",e[e.bandwidth=2]="bandwidth",e[e.other=3]="other"}(KP||(KP={})),function(e){e[e.unknown=0]="unknown",e[e.controlling=1]="controlling",e[e.controlled=2]="controlled"}(XP||(XP={}));var eM=function(){function e(e){this.peer=e,this.stats=[]}return e.prototype.handleCodec=function(e){return e},e.prototype.handleInboundRtp=function(e){return e},e.prototype.handleOutboundRtp=function(e){var t=e.ssrc;return t&&(e.rtxSsrc=t),e},e.prototype.handleRemoteInboundRtp=function(e){return e},e.prototype.handleRemoteOutboundRtp=function(e){return e},e.prototype.handleMediaSource=function(e){return e},e.prototype.handleCsrc=function(e){return e},e.prototype.handlePeerConnection=function(e){return e},e.prototype.handleDataChannel=function(e){return e},e.prototype.handleStream=function(e){return e},e.prototype.handleTrack=function(e){return e},e.prototype.handleTransceiver=function(e){return e},e.prototype.handleSender=function(e){return e},e.prototype.handleReceiver=function(e){return e},e.prototype.handleTransport=function(e){return e},e.prototype.handleSctpTransport=function(e){return e},e.prototype.handleCandidatePair=function(e){return e},e.prototype.handleLocalCandidate=function(e){return e},e.prototype.handleRemoteCandidate=function(e){return e},e.prototype.handleCertificate=function(e){return e},e.prototype.handleIceServer=function(e){return e},e.prototype.processStats=function(e){var t=this;e.forEach((function(e){var r;switch(e.type){case WP.candidatePair:r=t.handleCandidatePair;break;case WP.certificate:r=t.handleCertificate;break;case WP.remoteCandidate:r=t.handleRemoteCandidate;break;case WP.remoteInboundRtp:r=t.handleInboundRtp;break;case WP.remoteOutboundRtp:r=t.handleOutboundRtp;break;case WP.sctpTransport:r=t.handleSctpTransport;break;case WP.sender:r=t.handleSender;break;case WP.stream:r=t.handleStream;break;case WP.track:r=t.handleTrack;break;case WP.transceiver:r=t.handleTransceiver;break;case WP.transport:r=t.handleTransport;break;case WP.codec:r=t.handleCodec;break;case WP.csrc:r=t.handleCsrc;break;case WP.dataChannel:r=t.handleDataChannel;break;case WP.iceServer:r=t.handleIceServer;break;case WP.mediaSource:r=t.handleMediaSource;break;case WP.outboundRtp:r=t.handleOutboundRtp;break;case WP.inboundRtp:r=t.handleInboundRtp;break;case WP.peerConnection:r=t.handlePeerConnection;break;case WP.receiver:r=t.handleReceiver;break;case WP.localCandidate:r=t.handleLocalCandidate;break;default:r=function(e){return e}}r=r.bind(t),t.stats.push(r(e))}))},e.prototype.getExtraStats=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){return[2,new Promise((function(t,r){if(QP||void 0!==window.InstallTrigger)return t(e.stats);try{e.peer.getStats((function(r){r.result().forEach((function(t){if(!tM.includes(t.type)){var r={};t.names().forEach((function(e){r[e]=t.stat(e)})),r.id=t.id,r.type=t.type,r.timestamp=t.timestamp,e.stats.push(r)}})),t(e.stats)}))}catch(e){r(e)}}))]}))}))},e.prototype.getStats=function(e){return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),[4,this.peer.getStats(e)];case 1:t=r.sent(),this.processStats(t),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,this.getExtraStats()];case 3:case 4:return r.sent(),[3,5];case 5:return[3,7];case 6:return r.sent(),[3,7];case 7:return[2,this.stats]}}))}))},e}(),tM=["codec","inbound-rtp","outbound-rtp","remote-inbound-rtp","remote-outbound-rtp","media-source","csrc","peer-connection","data-channel","stream","track","transceiver","sender","receiver","transport","sctp-transport","candidate-pair","local-candidate","remote-candidate","certificate","ice-server"],rM=function(){var e;try{var t=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.toLowerCase();if(t.indexOf("ucbrowser")>-1&&t.indexOf("iphone"))return!1}catch(e){return!1}return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)},nM=function(){return"undefined"!=typeof TransformStream&&void 0!==RTCRtpSender.prototype.createEncodedStreams&&void 0!==RTCRtpReceiver.prototype.createEncodedStreams},iM=new PO("BasicHandler",3),oM=nM(),aM={iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",encodedInsertableStreams:!!oM||void 0},sM=function(e){function t(){var t=e.call(this)||this;return t._peerConnection=new RTCPeerConnection(aM),t._dataChannel=t._peerConnection.createDataChannel("signaling"),t._dataChannel.binaryType="arraybuffer",t._peerConnection.ontrack=function(e){var r,n;iM.print("constructor","pc.ontrack ".concat(e.track.kind," ").concat(e.track.id," ").concat(null===(n=null===(r=e.streams)||void 0===r?void 0:r[0])||void 0===n?void 0:n.id)),t.emit("ontrack",e)},t._peerConnection.onconnectionstatechange=function(e){iM.print("constructor","onconnectionstatechange ".concat(t._peerConnection.iceConnectionState," -> ").concat(t._peerConnection.connectionState)),"failed"!==t._peerConnection.iceConnectionState&&"closed"!==t._peerConnection.iceConnectionState&&"failed"!==t._peerConnection.connectionState||t.emit("disconnect")},t._peerConnection.oniceconnectionstatechange=function(){var e=t._peerConnection.iceConnectionState;aP.rtcPreIceState(e,nD["".concat(e.toUpperCase())])},t}return r(t,e),t.prototype.connect=function(e){return S(this,void 0,void 0,(function(){var t,r,n=this;return b(this,(function(i){switch(i.label){case 0:return iM.print("connect","invoke connect"),[4,this._peerConnection.createOffer()];case 1:return t=i.sent(),this._localSdp=new FP(e),[4,this.setLocalDescription(t.sdp)];case 2:return i.sent(),uP("es.connect.offer",t.sdp),this._remoteSdp=new GP(e),r=this._remoteSdp.modifyByIceNode(t.sdp),[4,this.setRemoteDescription(r)];case 3:return i.sent(),uP("es.connect.answer",r),[4,new Promise((function(e,t){n._dataChannel.onopen=function(){iM.print("connect","dataChannel open"),uP("es.dc.open",""),e("")},n._dataChannel.onerror=function(e){aP.rtcSignalingMsgError(e.error.sdpLineNumber,e.error.errorDetail,iD.INVALID_DATA),uP("es.dc.error",""),t(e)},n._dataChannel.onclose=function(e){uP("es.dc.close",""),t(e)}}))];case 4:return i.sent(),iM.print("connect","dataChannel establish success"),[2,this._dataChannel]}}))}))},t.prototype.disconnect=function(){this._peerConnection.close(),this._dataChannel.close(),this._peerConnection.ontrack=null},t.prototype.destroy=function(){this.disconnect(),this._localSdp=void 0,this._remoteSdp=void 0},t.prototype.publish=function(e){var t;return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g;return b(this,(function(E){switch(E.label){case 0:if(r=e.stream,n=null==e?void 0:e.videoTrack,i=null==e?void 0:e.audioTrack,o={},a=[],Array.isArray(null==e?void 0:e.videoEncodeConfig))for(s=null==e?void 0:e.videoEncodeConfig.length,c=null==n?void 0:n.getTrack(),u={width:640,height:480,framerate:30},c&&(d=null==c?void 0:c.getSettings(),u={width:Math.floor(d.width),height:Math.floor(d.height),framerate:Math.floor(d.frameRate)}),o.sendEncodings=[],l=0;l<s;l++)f=null==e?void 0:e.videoEncodeConfig[l],h={maxBitrate:1e3*f.maxKbps},p=Math.pow(2,l),s>1&&(h.rid="".concat(l),h.scaleResolutionDownBy=p),null===(t=o.sendEncodings)||void 0===t||t.unshift(h),a.push({width:Math.floor(u.width/p),height:Math.floor(u.height/p),framerate:u.framerate,maxkbps:f.maxKbps,rid:"".concat(l)});return iM.print("publish videoTransceiverInit videoDescriptions","",o,a),_=null==i?void 0:i.getTrack(),(null==i?void 0:i.mixType)!==C.PLAYOUT&&(null==i?void 0:i.mixedAudioTrack)&&(_=null==i?void 0:i.mixedAudioTrack),e.audioTransceiver=this._peerConnection.addTransceiver(_||"audio",{direction:"sendonly",streams:[r]}),oM&&e.initAudioEncodedTransform(),e.videoTransceiver=this._peerConnection.addTransceiver((null==n?void 0:n.getTrack())||"video",y({direction:"sendonly",streams:[r]},o)),oM&&e.initVideoEncodedTransform(),iM.print("sender.getParameters()",e.videoTransceiver.sender.getParameters()),v=iO(),aP.rtcBeginCreateOffer(sD.UP,e.streamId,e.userId),[4,this._peerConnection.createOffer()];case 1:if(m=E.sent(),aP.rtcCreateOffer(0,cD.UP,e.streamId,e.userId,iO()-v),g=qP(m.sdp,this.getLocalDescriptionSdp()),!m.sdp||!g)throw new GI(VI.ADD_TRANSCEIVER_FAILED,"createOffer failed");return[2,y(y({sdp:m.sdp},g),{type:"incroffer",semantics:"unified-plan",videoDescriptions:a})]}}))}))},t.prototype.subscribe=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a;return b(this,(function(s){switch(s.label){case 0:return r="incroffer",n="unified-plan",t?[2,{sdp:this.getLocalDescriptionSdp(),partialSdp:JP(this.getLocalDescriptionSdp(),[t.audioMid,t.videoMid]),audioMid:t.audioMid,videoMid:t.videoMid,type:r,semantics:n}]:(e.audioTransceiver=this._peerConnection.addTransceiver("audio",{direction:"recvonly"}),oM&&e.initAudioEncodedTransform(),e.videoTransceiver=this._peerConnection.addTransceiver("video",{direction:"recvonly"}),oM&&e.initVideoEncodedTransform(),i=iO(),aP.rtcBeginCreateOffer(sD.DOWN,e.streamId,e.userId),[4,this._peerConnection.createOffer()]);case 1:if(o=s.sent(),aP.rtcCreateOffer(0,cD.DOWN,e.streamId,e.userId,iO()-i),a=qP(o.sdp,this.getLocalDescriptionSdp()),!o.sdp||!a)throw new GI(VI.ADD_TRANSCEIVER_FAILED,"createOffer failed");return[2,y(y({sdp:o.sdp},a),{type:r,semantics:n})]}}))}))},t.prototype.setAnswerSdp=function(e,t,r,n,i){var o;return S(this,void 0,void 0,(function(){var a,s,c,u,d,l;return b(this,(function(f){switch(f.label){case 0:return aP.rtcRecvAnswer(0,lD.INCRANSWER,0,t,i,n.streamId,n.userId),a=this._peerConnection.remoteDescription,s=wP.parse(null==a?void 0:a.sdp),c=null===(o=s.media)||void 0===o?void 0:o.reduce((function(e,t){return e[t.mid]=t,e}),{}),wP.parse(t).media.forEach((function(e){return c[e.mid]=e})),u=[],d=wP.parse(e),l=d.media.map((function(e){r&&r[e.mid]&&(e.mid=r[e.mid]),"inactive"!==e.direction&&u.push(e.mid);var t=c[e.mid];return t.port=e.port,t})),s.media=l,d.groups=[{mids:u.join(" "),type:"BUNDLE"}],s.groups=d.groups,[4,this.setLocalDescription(wP.write(d),n,i)];case 1:return f.sent(),[4,this.setRemoteDescription(wP.write(s),n,i)];case 2:return f.sent(),[2]}}))}))},t.prototype.setLocalDescription=function(e,t,r){var n;return S(this,void 0,void 0,(function(){var i,o,a,s;return b(this,(function(c){switch(c.label){case 0:i=null===(n=this._localSdp)||void 0===n?void 0:n.modifyByIceNode(e),o=new RTCSessionDescription({type:"offer",sdp:i}),a=iO(),c.label=1;case 1:return c.trys.push([1,3,,4]),iM.print("setOffer","set offer: ",o),[4,this._peerConnection.setLocalDescription(o)];case 2:return c.sent(),t&&aP.rtcSetDescription(0,"",uD.W_1,r,t.streamId,t.userId,iO()-a),[3,4];case 3:throw(s=c.sent())instanceof Error&&t&&aP.rtcSetDescription(-1,s.message,uD.W_1,r,t.streamId,t.userId,iO()-a),s;case 4:return[2]}}))}))},t.prototype.setRemoteDescription=function(e,t,r){return S(this,void 0,void 0,(function(){var n,i,o;return b(this,(function(a){switch(a.label){case 0:n=new RTCSessionDescription({type:"answer",sdp:e}),i=iO(),a.label=1;case 1:return a.trys.push([1,3,,4]),iM.print("setAnswer","set answer: ",n),[4,this._peerConnection.setRemoteDescription(n)];case 2:return a.sent(),t&&aP.rtcSetDescription(0,"",uD.W_0,r,t.streamId,t.userId,iO()-i),[3,4];case 3:throw(o=a.sent())instanceof Error&&t&&aP.rtcSetDescription(-1,o.message,uD.W_0,r,t.streamId,t.userId,iO()-i),o;case 4:return[2]}}))}))},t.prototype.getLocalDescriptionSdp=function(){var e,t,r,n;if(null===(t=null===(e=this._peerConnection)||void 0===e?void 0:e.localDescription)||void 0===t?void 0:t.sdp)return null===(n=null===(r=this._peerConnection)||void 0===r?void 0:r.localDescription)||void 0===n?void 0:n.sdp;throw Error()},t.prototype.getRemoteDescriptionSdp=function(){var e,t,r,n;if(null===(t=null===(e=this._peerConnection)||void 0===e?void 0:e.remoteDescription)||void 0===t?void 0:t.sdp)return null===(n=null===(r=this._peerConnection)||void 0===r?void 0:r.remoteDescription)||void 0===n?void 0:n.sdp;throw Error()},t.prototype.closeMLine=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i,o,a,s=this;return b(this,(function(c){switch(c.label){case 0:return iM.print("closeMids","closeMids: ",e),n=this.getLocalDescriptionSdp(),i=zP(n,e),o=this.getRemoteDescriptionSdp(),a=zP(o,e),[4,this.setLocalDescription(wP.write(i))];case 1:return c.sent(),(null===(t=null==i?void 0:i.media)||void 0===t?void 0:t.length)!==(null===(r=null==a?void 0:a.media)||void 0===r?void 0:r.length)&&i.media.slice(a.media.length).forEach((function(e){var t;null===(t=s._remoteSdp)||void 0===t||t.modifyMlineByIceNode(e),a.media.push(e)})),Array.isArray(i.media)&&Array.isArray(a.media)&&i.media.forEach((function(e,t){a.media[t]&&(a.media[t].mid=e.mid)})),[4,this.setRemoteDescription(wP.write(a))];case 2:return c.sent(),[2]}}))}))},t.prototype.getDefaultSdp=function(){return S(this,void 0,void 0,(function(){var e,t,r;return b(this,(function(n){switch(n.label){case 0:return(e=TP.getDefaultSdp())?[3,2]:((t=new RTCPeerConnection(aM)).createDataChannel("default"),t.addTransceiver("audio",{direction:"recvonly"}),t.addTransceiver("video",{direction:"recvonly"}),[4,t.createOffer()]);case 1:r=n.sent(),e=null==r?void 0:r.sdp,t.close(),TP.setDefaultSdp(e),n.label=2;case 2:return[2,{sdp:e,semantics:"unified-plan",type:"offer"}]}}))}))},t.prototype.getStats=function(e){return t=this._peerConnection,r=e,S(void 0,void 0,void 0,(function(){var e;return b(this,(function(n){switch(n.label){case 0:return e=[],t instanceof RTCPeerConnection?[4,new eM(t).getStats(r)]:[2,e];case 1:return[2,e=n.sent()]}}))}));var t,r},t.prototype.rollback=function(e,t){var r;return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return iM.print("rollback()","signalingState: %o",this._peerConnection.signalingState),"stable"!==this._peerConnection.signalingState?[3,2]:[4,null===(r=this._peerConnection)||void 0===r?void 0:r.setLocalDescription(new RTCSessionDescription({sdp:e,type:"offer"}))];case 1:n.sent(),n.label=2;case 2:return[4,this.closeMLine(t)];case 3:return n.sent(),[2]}}))}))},Object.defineProperty(t.prototype,"pc",{get:function(){return this._peerConnection},enumerable:!1,configurable:!0}),t}(SO.exports.EventEmitter),cM=new PO("Locker",2),uM=1,dM=function(){function e(e){this.lockingPromise=Promise.resolve(),this.locks=0,this.name="",this.lockId=uM++,e&&(this.name=e),cM.print("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}return Object.defineProperty(e.prototype,"isLocked",{get:function(){return this.locks>0},enumerable:!1,configurable:!0}),e.prototype.lock=function(){var e,t=this;this.locks+=1,cM.print("[lock-".concat(this.name,"-").concat(this.lockId,"] locked, current queue ").concat(this.locks,"."));var r=new Promise((function(r){e=function(){t.locks-=1,cM.print("[lock-".concat(t.name,"-").concat(t.lockId,"] unlocked, current queue ").concat(t.locks,".")),r()}})),n=this.lockingPromise.then((function(){return e}));return this.lockingPromise=this.lockingPromise.then((function(){return r})),n},e}(),lM=Math.log,fM=Math.LOG10E;bi({target:"Math",stat:!0},{log10:Math.log10||function(e){return lM(e)*fM}}),bi({target:"Number",stat:!0},{isNaN:function(e){return e!=e}}),new PO("Stats",2);var hM,pM=function(){function e(e,t){this._client=e,this._handler=t,this.dataChannelRTT={},this._rttTimer={},this._remoteStreamStasEvtIntervals={},this._localStreamStasEvtIntervals={},this._firstFrameStarted={},this._videoInWaiting={}}return e.prototype.setRemoteStreamStatsEvtInterval=function(e){var t,r,n=this;this.getDataChannelRTT(e.userId);var i={audio:{},video:{},remoteStream:e},o=null===(t=e.audioTrack)||void 0===t?void 0:t.getTrack(),a=null===(r=e.videoTrack)||void 0===r?void 0:r.getTrack();this.getRemoteAudioStats(o,i),this.getRemoteVideoStats(a,i),this.delRemoteStreamStatsEvtInterval(e);this._remoteStreamStasEvtIntervals[e.streamId]=setInterval((function(){return S(n,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return[4,S(n,void 0,void 0,(function(){var t,r,n,o,a,s;return b(this,(function(c){switch(c.label){case 0:return t=null===(a=e.audioTrack)||void 0===a?void 0:a.getTrack(),r=null===(s=e.videoTrack)||void 0===s?void 0:s.getTrack(),[4,this.getRemoteAudioStats(t,i)];case 1:return n=c.sent(),[4,this.getRemoteVideoStats(r,i)];case 2:return(o=c.sent()).isScreen=e.isScreen,[2,{audioStats:n,videoStats:o,isScreen:e.isScreen,userId:e.userId}]}}))}))];case 1:return t=r.sent(),this._client.emit("onRemoteStreamStats",t),[2]}}))}))}),2e3)},e.prototype.delRemoteStreamStatsEvtInterval=function(e){clearInterval(this._remoteStreamStasEvtIntervals[e.streamId])},e.prototype.unsubscribe=function(e){this.delRemoteStreamStatsEvtInterval(e),clearTimeout(this._rttTimer[e.userId]),this._videoInWaiting[e.streamId]=!1,this._firstFrameStarted["".concat(e.streamId,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:e.isScreen?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-audio")],event_session_id:e.streamId,result:!1,reason:bD.UNSUBSCRIBE,stream_user_id:e.userId}),delete this._firstFrameStarted["".concat(e.streamId,"-audio")]),this._firstFrameStarted["".concat(e.streamId,"-video")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:e.isScreen?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-video")],event_session_id:e.streamId,result:!1,reason:bD.UNSUBSCRIBE,stream_user_id:e.userId}),delete this._firstFrameStarted["".concat(e.streamId,"-video")])},e.prototype.getRemoteAudioStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p=this;return b(this,(function(_){switch(_.label){case 0:return r={},n={timestamp:Date.now()},i=t.remoteStream,o=i.streamId,a=i.userId,s=i.isScreen,c=i.audioMid,u=i.hasAudio,d={media_type:"audio",direction:"down",stream_id:o,stream_user_id:a,vid:c,remote_muted:!u},e&&this._handler?(t.audioStart||(t.audioStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_RECV,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.SUBSCRIBE,start:t.audioStart,event_session_id:o,stream_user_id:a}),u?this._firstFrameStarted["".concat(o,"-audio")]=t.audioStart:aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:t.audioStart,event_session_id:o,result:!1,reason:bD.DISABLE,stream_user_id:a})),[4,this._handler.getStats(e)]):[2,r];case 1:return(l=_.sent()).length?(l.forEach((function(e){var i=e.type,c=e.packetsLost,u=e.packetsReceived,l=e.bytesReceived,f=e.jitterBufferDelay,h=e.jitterBufferEmittedCount,_=e.clockRate,v=e.channels,m=e.totalSamplesReceived,g=e.concealedSamples,y=e.concealmentEvents,E=e.totalRoundTripTime,S=e.state,b=e.currentRoundTripTime,T=e.audioLevel,I=e.totalAudioEnergy,A=e.totalSamplesDuration,R=e.mimeType,C=e.googDecodingNormal,O=e.fecPacketsReceived,w=e.availableIncomingBitrate,N=e.availableOutgoingBitrate,k=e.bytesSent,D=e.nominated,P=e.id,M=e.writable,U=e.jitter,L=e.candidateType,x=e.ip,B=e.networkType,V=e.port,j=e.protocol,F=e.audioOutputLevel,G=e.requestsReceived,z=e.responsesReceived,H=e.requestsSent,W=e.consentRequestsSent,Y=e.responsesSent,K=e.ssrc,X=e.kind;"inbound-rtp"===i?(n.packetsLost=c,n.packetsReceived=u,d.packets=u,n.bytesReceived=l,d.bytes=l,r.jitterBufferDelay=f/h*1e3,d.jitter_buffer_delay=r.jitterBufferDelay,n.totalSamplesReceived=m,r.concealedSamples=g,n.concealedSamples=g,d.concealed_samples=g,r.concealmentEvents=y,d.fec_packets_received=O,d.jitter=1e3*U,d.ssrc=K,d.total_samples_received=m,m>0&&p._firstFrameStarted["".concat(o,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.SUBSCRIBE,event_session_id:o,result:!0,start:t.audioStart,stream_user_id:a}),delete p._firstFrameStarted["".concat(o,"-audio")])):"codec"===i?(r.recordSampleRate=_,r.numChannels=v,d.codec=R):"candidate-pair"===i?(d.ice_available_incoming_bitrate=w,d.ice_available_outgoing_bitrate=N,d.ice_bytes_received=l,d.ice_bytes_sent=k,d.ice_nominated=+D,d.ice_pair_id=P,d.ice_pair_rtt=b,d.rtt=1e3*b,d.ice_pair_state=S,d.ice_pair_writable=M,d.recv_ping_requests=G,d.recv_ping_responses=z,d.sent_ping_requests_before_first_response=H,d.sent_ping_requests_total=H+W,d.sent_ping_responses=Y,"succeeded"===S&&(r.rtt=1e3*b,r.total_rtt=1e3*E)):"track"===i&&"audio"===X?(d.audio_level=-10*Math.log10(Math.pow(T,2)),d.volume=255*T,d.total_audio_energy=I,d.total_samples_duration=A):"ssrc"===i?(d.decoding_normal=C,d.recv_level=F):"local-candidate"===i?(d.local_candidate_type=L,d.local_ip=x,d.local_network_type=B,d.local_port=V,d.protocol=j):"remote-candidate"===i&&(d.remote_candidate_type=L,d.remote_ip=x,d.remote_port=V)})),(f=t.audio).timestamp?(r.audioLossRate=(n.packetsLost-f.packetsLost)/(n.packetsReceived-f.packetsReceived+(n.packetsLost-f.packetsLost)),r.audioLossRate=Number.isNaN(r.audioLossRate)?0:r.audioLossRate,d.packets_lost=Math.round(n.packetsLost-f.packetsLost),d.fraction_lost=r.audioLossRate,d.packets_lost_rate=r.audioLossRate,r.statsInterval=n.timestamp-f.timestamp,r.receivedKBitrate=(n.bytesReceived-f.bytesReceived||0)/r.statsInterval,d.bitrate=Math.round(8e3*r.receivedKBitrate),d.bandwidth=Math.round(d.bitrate/1024),d.interval_concealed_samples=n.concealedSamples-f.concealedSamples,d.interval_samples_received=n.totalSamplesReceived-f.totalSamplesReceived,r.receivedSampleRate=1e3*d.interval_samples_received/r.statsInterval,t.audio=n,this.dataChannelRTT[t.remoteStream.userId]&&(h=this.dataChannelRTT[t.remoteStream.userId]/2,r.e2eDelay=h+(r.jitterBufferDelay||0),d.web_e2e_delay=r.e2eDelay,d.total_rtt_ms=h),t.remoteStream.subAudio&&aP.rtcMediaStatistics(d,{}),[2,r]):(t.audio=n,[2,r])):[2,r]}}))}))},e.prototype.getRemoteVideoStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p=this;return b(this,(function(_){switch(_.label){case 0:return r={},n={timestamp:Date.now()},i=t.remoteStream,o=i.streamId,a=i.userId,s=i.isScreen,c=i.hasVideo,u={media_type:"video",direction:"down",stream_id:o,stream_user_id:a,vid:t.remoteStream.videoMid,remote_muted:!c},e&&this._handler?(t.videoStart||(t.videoStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_RECV,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.SUBSCRIBE,start:t.videoStart,event_session_id:o,stream_user_id:a}),c?this._firstFrameStarted["".concat(o,"-video")]=t.videoStart:aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:t.videoStart,event_session_id:o,result:!1,reason:bD.DISABLE,stream_user_id:a})),[4,this._handler.getStats(e)]):[2,r];case 1:return(d=_.sent()).length?(d.forEach((function(e){var i=e.type,c=e.frameHeight,d=e.frameWidth,l=e.packetsLost,f=e.packetsReceived,h=e.bytesReceived,_=e.framesDecoded,v=e.roundTripTime,m=e.jitterBufferDelay,g=e.jitterBufferEmittedCount,y=e.mimeType,E=e.firCount,S=e.availableIncomingBitrate,b=e.availableOutgoingBitrate,T=e.bytesSent,I=e.nominated,A=e.id,R=e.currentRoundTripTime,C=e.state,O=e.writable,w=e.candidateType,N=e.ip,k=e.networkType,D=e.port,P=e.nackCount,M=e.pliCount,U=e.protocol,L=e.requestsReceived,x=e.responsesReceived,B=e.requestsSent,V=e.consentRequestsSent,j=e.responsesSent,F=e.ssrc;e.totalRoundTripTime;var G=e.jitter,z=e.framesReceived,H=e.keyFramesDecoded,W=e.totalDecodeTime,Y=e.decoderImplementation,K=e.lastPacketReceivedTimestamp;"inbound-rtp"===i?(r.width=d,u.frame_size_width=d,r.height=c,u.frame_size_height=c,n.packetsLost=l,u.packets_lost=l,n.packetsReceived=f,u.packets=f,n.bytesReceived=h,u.bytes=h,n.framesDecoded=_,n.jitterBufferDelay=m/g*1e3,u.jitter_buffer_delay=n.jitterBufferDelay,u.fir_count=E,u.nack_count=P,u.pli_count=M,u.ssrc=F,u.jitter=G,u.frames_received=z,u.frames_decoded=_,u.key_frames_decoded=H,u.total_decode_time=W,u.decoder_implementation=Y,u.last_packet_received_timestamp=K,_>0&&p._firstFrameStarted["".concat(o,"-video")]&&(aP.rtcFirstFrame({event_type:yD.RECV_END,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.SUBSCRIBE,event_session_id:o,result:!0,start:t.videoStart,stream_user_id:a}),delete p._firstFrameStarted["".concat(o,"-video")])):"remote-outbound-rtp"===i?(r.rtt=1e3*v,u.rtt=v):"codec"===i?u.codec=y:"candidate-pair"===i?(u.ice_available_incoming_bitrate=S,u.ice_available_outgoing_bitrate=b,u.ice_bytes_received=h,u.ice_bytes_sent=T,u.ice_nominated=+I,u.ice_pair_id=A,u.ice_pair_rtt=R,u.rtt=1e3*R,u.ice_pair_state=C,u.ice_pair_writable=O,u.recv_ping_requests=L,u.recv_ping_responses=x,u.sent_ping_requests_before_first_response=B,u.sent_ping_requests_total=B+V,u.sent_ping_responses=j):"local-candidate"===i?(u.local_candidate_type=w,u.local_ip=N,u.local_network_type=k,u.local_port=D,u.protocol=U):"remote-candidate"===i&&(u.remote_candidate_type=w,u.remote_ip=N,u.remote_port=D)})),l=t.video,f=t.remoteStream,l.timestamp?(r.videoLossRate=(n.packetsLost-l.packetsLost)/(n.packetsReceived-l.packetsReceived+(n.packetsLost-l.packetsLost)),r.videoLossRate=Number.isNaN(r.videoLossRate)?0:r.videoLossRate,u.fraction_lost=r.videoLossRate,u.packets_lost_rate=r.videoLossRate,r.statsInterval=n.timestamp-l.timestamp,r.receivedKBitrate=(n.bytesReceived-l.bytesReceived||0)/r.statsInterval,u.bitrate=Math.round(8e3*r.receivedKBitrate),u.bandwidth=Math.round(u.bitrate/1024),r.decoderOutputFrameRate=1e3*(n.framesDecoded-l.framesDecoded)/r.statsInterval,u.frame_rate_decoded=Math.round(r.decoderOutputFrameRate),u.frame_rate_received=u.frame_rate_decoded,t.video=n,this.dataChannelRTT[t.remoteStream.userId]&&(h=this.dataChannelRTT[t.remoteStream.userId]/2,r.e2eDelay=h+n.jitterBufferDelay,u.web_e2e_delay=r.e2eDelay,u.total_rtt_ms=h),f.subVideo&&(this.processStall(f,u),aP.rtcMediaStatistics(u,{})),[2,r]):(t.video=n,[2,r])):[2,r]}}))}))},e.prototype.processStall=function(e,t){var r=0,n=0,i=0;e.recordedVideoFrames.forEach((function(e){e.isStall&&(r+=e.stallCount,n+=e.stallDuration),i=e.playTime})),e.recordedVideoFrames.length||(n=2e3,r=this._videoInWaiting[e.streamId]?0:1,this._videoInWaiting[e.streamId]=!0);var o=e.recordedVideoFrames.pop();o&&(o.isStall?this._videoInWaiting[e.streamId]=!0:this._videoInWaiting[e.streamId]=!1),e.recordedVideoFrames=[],t.stall_count=r,t.stall_duration=n,t.play_time=i},e.prototype.setLocalStreamStatsEvtInterval=function(e){var t,r,n=this,i={audio:{},video:{},localStream:e,firstframeReported:!1},o=null===(t=e.audioTrack)||void 0===t?void 0:t.getTrack(),a=null===(r=e.videoTrack)||void 0===r?void 0:r.getTrack();this.getAudioStats(o,i),this.getVideoStats(a,i),this.delLocalStreamStatsEvtInterval(e);this._localStreamStasEvtIntervals[e.streamId]=setInterval((function(){return S(n,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return[4,S(n,void 0,void 0,(function(){var t,r,n,o,a,s;return b(this,(function(c){switch(c.label){case 0:return t=null===(a=e.audioTrack)||void 0===a?void 0:a.getTrack(),r=null===(s=e.videoTrack)||void 0===s?void 0:s.getTrack(),[4,this.getAudioStats(t,i)];case 1:return n=c.sent(),[4,this.getVideoStats(r,i)];case 2:return(o=c.sent()).isScreen=e.isScreen,[2,{audioStats:n,videoStats:o,isScreen:e.isScreen}]}}))}))];case 1:return t=r.sent(),this._client.emit("onLocalStreamStats",t),[2]}}))}))}),2e3)},e.prototype.delLocalStreamStatsEvtInterval=function(e){clearInterval(this._localStreamStasEvtIntervals[e.streamId])},e.prototype.unpublish=function(e){this.delLocalStreamStatsEvtInterval(e),this._firstFrameStarted["".concat(e.streamId,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:e.isScreen?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-audio")],event_session_id:e.streamId,result:!1,reason:bD.UNPUBLISH}),delete this._firstFrameStarted["".concat(e.streamId,"-audio")]),this._firstFrameStarted["".concat(e.streamId,"-video")]&&(aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:e.isScreen?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-video")],event_session_id:e.streamId,result:!1,reason:bD.UNPUBLISH}),delete this._firstFrameStarted["".concat(e.streamId,"-video")])},e.prototype.getAudioStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l=this;return b(this,(function(f){switch(f.label){case 0:return r={},n={timestamp:Date.now()},i=t.localStream,o=i.streamId,a=i.audioMid,s=i.isScreen,c={media_type:"audio",direction:"up",stream_id:o,vid:a},e&&this._handler?(t.audioStart||(t.audioStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_SEND,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,start:t.audioStart,event_session_id:o}),this._firstFrameStarted["".concat(o,"-audio")]=t.audioStart),[4,this._handler.getStats(e)]):[2,r];case 1:return(u=f.sent()).length?(u.forEach((function(e){var i=e.type,a=e.packetsSent,u=e.packetsLost,d=e.bytesSent,f=e.clockRate,h=e.roundTripTime,p=e.channels,_=e.audioLevel,v=e.googRtt,m=e.mimeType,g=e.availableIncomingBitrate,y=e.availableOutgoingBitrate,E=e.bytesReceived,S=e.nominated,b=e.id,T=e.currentRoundTripTime,I=e.state,A=e.writable,R=e.requestsReceived,C=e.responsesReceived,O=e.requestsSent,w=e.consentRequestsSent,N=e.responsesSent,k=e.jitter,D=e.candidateType,P=e.ip,M=e.networkType,U=e.port,L=e.protocol,x=e.nackCount,B=e.retransmittedBytesSent,V=e.retransmittedPacketsSent,j=e.roundTripTimeMeasurements,F=e.audioInputLevel,G=e.ssrc,z=e.totalAudioEnergy,H=e.totalSamplesDuration,W=e.mediaType;"outbound-rtp"===i?(n.packetsSent=a,a>0&&l._firstFrameStarted["".concat(o,"-audio")]&&(aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:s?ED.SCREEN_AUDIO:ED.AUDIO,type:SD.PUBLISH,event_session_id:o,result:!0,start:t.audioStart}),delete l._firstFrameStarted["".concat(o,"-audio")]),n.bytesSent=d,c.bytes=d,c.packets=a,c.nack_count=x,c.ssrc=G,c.retransmitted_bytes_sent=B,c.retransmitted_packets_sent=V):"remote-inbound-rtp"===i?(n.packetsLost=u,c.packets_lost=u,c.jitter=1e3*k,r.rtt=1e3*h,c.rtt=r.rtt,c.round_trip_time_measurements=j):"codec"===i?(r.recordSampleRate=f,r.numChannels=p,c.codec=m):"media-source"===i?(c.audio_level=-10*Math.log10(Math.pow(_,2)),c.volume=255*_,c.total_audio_energy=z,c.total_samples_duration=H):"ssrc"===i&&"audio"===W?(c.audio_network_elapse=v,c.send_level=F):"candidate-pair"===i?(c.ice_available_incoming_bitrate=g,c.ice_available_outgoing_bitrate=y,c.ice_bytes_received=E,c.ice_bytes_sent=d,c.ice_nominated=+S,c.ice_pair_id=b,c.ice_pair_rtt=T,c.ice_pair_state=I,c.ice_pair_writable=A,c.recv_ping_requests=R,c.recv_ping_responses=C,c.sent_ping_requests_before_first_response=O,c.sent_ping_requests_total=O+w,c.sent_ping_responses=N):"local-candidate"===i?(c.local_candidate_type=D,c.local_ip=P,c.local_network_type=M,c.local_port=U,c.protocol=L):"remote-candidate"===i&&(c.remote_candidate_type=D,c.remote_ip=P,c.remote_port=U)})),(d=t.audio).timestamp?(r.audioLossRate=(n.packetsLost-d.packetsLost)/(n.packetsSent-d.packetsSent),r.audioLossRate=Number.isNaN(r.audioLossRate)?0:r.audioLossRate,c.fraction_lost=r.audioLossRate,r.statsInterval=n.timestamp-d.timestamp,r.sentKBitrate=(n.bytesSent-d.bytesSent||0)/r.statsInterval,c.bitrate=Math.round(8e3*r.sentKBitrate),c.bandwidth=Math.round(c.bitrate/1024),t.audio=n,aP.rtcMediaStatistics(c,{}),[2,r]):(t.audio=n,[2,r])):[2,r]}}))}))},e.prototype.getVideoStats=function(e,t){return S(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l=this;return b(this,(function(f){switch(f.label){case 0:return r={},n={timestamp:Date.now()},i=t.localStream,o=i.streamId,a=i.videoMid,s=i.isScreen,c={media_type:"video",direction:"up",stream_id:o,vid:a},e&&this._handler?(t.videoStart||(t.videoStart=iO(),aP.rtcFirstFrame({event_type:yD.BEGIN_SEND,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:t.videoStart,event_session_id:o}),this._firstFrameStarted["".concat(o,"-video")]=t.videoStart),[4,this._handler.getStats(e)]):[2,r];case 1:return(u=f.sent()).length?(u.forEach((function(e){var i=e.type,a=e.framesEncoded,u=e.packetsLost,d=e.bytesSent,f=e.framesSent,h=e.roundTripTime,p=e.mimeType,_=e.totalSamplesReceived,v=e.frameWidth,m=e.frameHeight,g=e.clockRate,y=e.packetsSent,E=e.googActualEncBitrate,S=e.googAvailableReceiveBandwidth,b=e.googAvailableSendBandwidth,T=e.googAvgEncodeMs,I=e.googBucketDelay,A=e.googEncodeUsagePercent,R=e.googFrameRateInput,C=e.availableIncomingBitrate,O=e.availableOutgoingBitrate,w=e.bytesReceived,N=e.nominated,k=e.id,D=e.currentRoundTripTime,P=e.state,M=e.writable,U=e.candidateType,L=e.ip,x=e.networkType,B=e.port,V=e.nackCount,j=e.pliCount,F=e.protocol,G=e.qpSum,z=e.requestsReceived,H=e.responsesReceived,W=e.googRetransmitBitrate,Y=e.requestsSent,K=e.consentRequestsSent,X=e.responsesSent,q=e.ssrc,J=e.googTargetEncBitrate,Z=e.googTransmitBitrate,$=e.googRtt,Q=e.retransmittedPacketsSent,ee=e.encoderImplementation,te=e.jitter;"outbound-rtp"===i?(n.framesEncoded=a,n.bytesSent=d,c.bytes=d,n.framesSent=f,f>0&&l._firstFrameStarted["".concat(o,"-video")]&&(t.firstframeVideoReported=!0,aP.rtcFirstFrame({event_type:yD.SENT_END,media_type:s?ED.SCREEN_VIDEO:ED.VIDEO,type:SD.PUBLISH,start:t.videoStart,event_session_id:o,result:!0}),delete l._firstFrameStarted["".concat(o,"-video")]),r.encodedFrameWidth=v,r.encodedFrameHeight=m,c.frame_size_height=m,c.frame_size_width=v,n.packetsSent=y,c.packets=y,c.nack_count=V,c.pli_count=j,c.qp_sum=G,c.ssrc=q,c.retransmitted_packets_sent=Q,c.encoder_implementation=ee):"remote-inbound-rtp"===i?(n.packetsLost=u,r.rtt=1e3*h,c.rtt=r.rtt,c.jitter=te,c.packets_lost=u):"codec"===i?(r.codecType=p,c.codec=p,r.inputFrameRate=g):"track"===i?n.totalSamplesReceived=_:"candidate-pair"===i?(c.ice_available_incoming_bitrate=C,c.ice_available_outgoing_bitrate=O,c.ice_bytes_received=w,c.ice_bytes_sent=d,c.ice_nominated=+N,c.ice_pair_id=k,c.ice_pair_rtt=D,c.ice_pair_state=P,c.ice_pair_writable=M,c.recv_ping_requests=z,c.recv_ping_responses=H,c.sent_ping_requests_before_first_response=Y,c.sent_ping_requests_total=Y+K,c.sent_ping_responses=X):"local-candidate"===i?(c.local_candidate_type=U,c.local_ip=L,c.local_network_type=x,c.local_port=B,c.protocol=F):"remote-candidate"===i?(c.remote_candidate_type=U,c.remote_ip=L,c.remote_port=B):"VideoBwe"===i?(c.actual_enc_bitrate=E,c.available_receive_bandwidth=S,c.available_send_bandwidth=b,c.bucket_delay=I,c.retransmit_bitrate=W,c.target_enc_bitrate=J,c.transmit_bitrate=Z):"ssrc"===i&&(c.video_network_elapse=$,c.avg_encode_ms=T,c.encode_usage_percent=A,c.frame_rate_input=R)})),(d=t.video).timestamp?(r.statsInterval=n.timestamp-d.timestamp,r.encodedFrameCount=n.framesSent-d.framesSent,r.sentKBitrate=(n.bytesSent-d.bytesSent||0)/r.statsInterval,c.bitrate=Math.round(8e3*r.sentKBitrate),c.bandwidth=Math.round(c.bitrate/1024),r.encoderOutputFrameRate=1e3*(n.framesEncoded-d.framesEncoded)/r.statsInterval,c.frame_rate_encoded=Math.round(r.encoderOutputFrameRate),r.sentFrameRate=1e3*(n.framesSent-d.framesSent)/r.statsInterval,c.frame_rate_sent=Math.round(r.sentFrameRate),r.videoLossRate=(n.packetsLost-d.packetsLost)/(n.packetsSent-d.packetsSent),r.videoLossRate=Number.isNaN(r.videoLossRate)?0:r.videoLossRate,c.fraction_lost=r.videoLossRate,t.video=n,aP.rtcMediaStatistics(c,{}),[2,r]):(t.video=n,[2,r])):[2,r]}}))}))},e.prototype.getDataChannelRTT=function(e){var t,r=this,n=iO();null===(t=this._client.sendUserMessage(e,"__web__rtc__rtt__"))||void 0===t||t.then((function(t){if("timeout"!==t){var i=Date.now()-n;i>0&&i<2e3&&(r.dataChannelRTT[e]=i)}else clearTimeout(r._rttTimer[e])})).catch((function(){clearTimeout(r._rttTimer[e])})),clearTimeout(this._rttTimer[e]),this._rttTimer[e]=setTimeout((function(){r.getDataChannelRTT(e)}),2e3)},e.prototype.destroy=function(){var e=this;Object.keys(this._localStreamStasEvtIntervals).forEach((function(t){clearInterval(e._localStreamStasEvtIntervals[t])})),Object.keys(this._remoteStreamStasEvtIntervals).forEach((function(t){clearInterval(e._remoteStreamStasEvtIntervals[t])})),Object.keys(this._rttTimer).forEach((function(t){clearTimeout(e._rttTimer[t])})),this._rttTimer={},this.dataChannelRTT={},this._videoInWaiting={}},e}(),_M=new PO("MediaServerClient",2),vM=5e3;!function(e){e.DISCONNECTED="disconnected",e.DISCONNECTING="disconnecting",e.CONNECTED="connected",e.CONNECTING="connecting"}(hM||(hM={}));var mM=function(e,t){_M.print(e,"userId: %o, subAudio: %o, subVideo: %o, paused: %o, audioMid: %o, videoMid: %o, workaround_1_: %o, sequenceId: %o",t.userId,t.subAudio,t.subVideo,t.paused,t.audioMid,t.videoMid,t._workaround_1_,t.sequenceId)},gM=function(e){function t(){var t=e.call(this)||this;return t._ontrackCallbackMap=new Map,t._pubSubLock=new dM("pubSubLock"),t._joinLeaveLock=new dM("joinLeaveLock"),t._state=hM.DISCONNECTED,t._roomAttributes={multiChatMode:!1,bigRoomMode:!1},t}return r(t,e),t.prototype._addHandlerEvents=function(){var e,t=this;null===(e=this._handler)||void 0===e||e.once("disconnect",(function(){_M.print("emit ABNORMAL_DISCONNECTION ice"),t.safeEmit(tP.ABNORMAL_DISCONNECTION)}))},t.prototype._addSignalEventHandler=function(){var e,t=this;[eP.ON_ADD_STREAM,eP.ON_REMOVE_STREAM,eP.USER_CONNECTION,eP.USER_DISCONNECTION,eP.ON_UPDATE_STREAM_ATTRIBUTES,eP.ON_UPDATE_ROOM_ATTRIBUTES,eP.ON_PUSH_TRACK,eP.ON_REMOVE_TRACK,eP.NODE_CHANGE,eP.ON_CUSTOM_MESSAGE,eP.USER_MESSAGE_RECEIVED,eP.USER_BINARY_MESSAGE_RECEIVED,eP.POST_PROCESSING_MESSAGE].forEach((function(e){var r;null===(r=t._dataChannelSignal)||void 0===r||r.on(e,(function(r){t.safeEmit(e,r)}))})),null===(e=this._dataChannelSignal)||void 0===e||e.once("close",(function(){_M.print("emit ABNORMAL_DISCONNECTION datachannel"),t.safeEmit(tP.ABNORMAL_DISCONNECTION)}))},t.prototype._removeSignalEventHandler=function(){var e,t;null===(e=this._dataChannelSignal)||void 0===e||e.removeAllListeners(),null===(t=this._handler)||void 0===t||t.removeAllListeners()},Object.defineProperty(t.prototype,"connectionState",{get:function(){return this._state},set:function(e){this._state!==e&&(this.safeEmit(tP.ON_CONNECTION_STATE_CHANGE,{prev:this._state,next:e}),this._state=e)},enumerable:!1,configurable:!0}),t.prototype.join=function(e,t,r,n){var i,o;return void 0===t&&(t={}),void 0===r&&(r=!1),S(this,void 0,void 0,(function(){var a,s,c,u,d,l,f,h,p=this;return b(this,(function(_){switch(_.label){case 0:return _M.print("join()","info: %o, params: %o, reconnect: %o, controlMessage: %o",e,t,r,n),this._appId=e.appId,this._token=e.token,this._roomId=e.roomId,this._clientId=e.userInfo.userId,this._businessId=e.userInfo.businessId,this._userInfo=e.userInfo,this._sessionId=vC(),nP.setStats({rtc_session_id:this._sessionId}),this.connectionState=hM.CONNECTING,this._handler&&(this._removeSignalEventHandler(),this._handler.destroy()),t.node?(a=t.node,uP("es.join.nodeChange",t),[3,3]):[3,1];case 1:return Promise.resolve().then((function(){return p.emit("onGetIceConfigHook")})),this._iceConfigRequestManager=new AP,[4,null===(i=this._iceConfigRequestManager)||void 0===i?void 0:i.getAccessNode(this._appId,this._roomId,this._clientId,TP.getDeviceId(),null==t?void 0:t.reason,this._prevICENode)];case 2:if(!(a=_.sent()))throw uP("es.join.getNodeFailed",""),new GI(VI.ICE_SERVER_WRONG,"get ICE config failed");uP("es.join.getNodeSuccess",a),_.label=3;case 3:this._prevICENode=a,this._handler=new sM,this._addHandlerEvents(),this._statsReport=new pM(this,this._handler),Promise.resolve().then((function(){return p.emit("onEstablishConnectionHook")})),_.label=4;case 4:return _.trys.push([4,6,,7]),[4,this._handler.connect(a)];case 5:return s=_.sent(),_M.print("join","establish peerConnection success"),[3,7];case 6:throw c=_.sent(),this.connectionState=hM.DISCONNECTED,new GI(VI.ESTABLISH_DATACHANNEL_FAILED,"establish dataChannel failed",c);case 7:return this._dataChannelSignal=new _P({appId:this._appId,roomId:this._roomId,clientId:this._clientId,dataChannel:s}),this._addSignalEventHandler(),this._dataChannelSignal.sendPingMessage(),[4,null===(o=this._handler)||void 0===o?void 0:o.getDefaultSdp()];case 8:u=_.sent(),d={Authorization:aO.token2auth(this._appId,this._roomId,this._clientId,this._token),sessionId:this._sessionId,timestamp:Date.now(),controlMessage:n,userAttributes:{extra_info:this._userInfo.extraInfo,role:this._userInfo.role},params:{deviceType:"web",userAgent:window.navigator.userAgent,sdkVersion:vw.VERSION,deviceId:TP.getDeviceId(),appId:this._appId,roomId:this._roomId,userId:this._clientId,businessId:this._businessId},options:{enableUnBundleMode:!0},sdpInfo:u},Promise.resolve().then((function(){return p.emit("onSendingJoinMessageHook")})),_.label=9;case 9:return _.trys.push([9,11,,12]),l=r?"reconnected":"joinRoom",[4,this._dataChannelSignal.sendSignaling(l,d)];case 10:return f=_.sent(),_M.print("join","send join message success"),this._authorization=d.Authorization,this.connectionState=hM.CONNECTED,[2,f];case 11:if(h=_.sent(),this.connectionState=hM.DISCONNECTED,705===(null==h?void 0:h.code))throw new GI(VI.INVALID_TOKEN,(null==h?void 0:h.message)||"Invalid token");if(200!==(null==h?void 0:h.code))throw new GI(VI.JOIN_ROOM_FAILED,(null==h?void 0:h.message)||"Join room failed");return[3,12];case 12:return[2]}}))}))},t.prototype.publish=function(e){var t,r,n,i,o,a,s,c;return S(this,void 0,void 0,(function(){var u,d,l,f,h,p,_,v,m,g,E;return b(this,(function(S){switch(S.label){case 0:_M.print("publish()","localStream: %o",e),u=e.videoTrack,d=e.audioTrack,l=iO(),f="",h="",p="",S.label=1;case 1:return S.trys.push([1,5,,8]),[4,null===(t=this._handler)||void 0===t?void 0:t.publish(e)];case 2:if(!(_=S.sent()))throw new GI(VI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");return f=_.audioMid,h=_.videoMid,p=_.sdp,e.pubAttributes={localaudio:!!d,localvideo:!!u,videostream:!!(null===(r=null==u?void 0:u.getTrack())||void 0===r?void 0:r.enabled),audiostream:!!(null===(n=null==d?void 0:d.getTrack())||void 0===n?void 0:n.enabled)},v={attributes:y({videoDescriptions:_.videoDescriptions},e.pubAttributes),audio:!0,video:!0,screen:e.isScreen,audioMid:f,videoMid:h,sdpInfo:{msid:e.stream.id,type:_.type,sdp:_.partialSdp,semantics:_.semantics}},[4,null===(i=this._dataChannelSignal)||void 0===i?void 0:i.sendSignaling("publish",v)];case 3:if(200!==(null==(m=S.sent())?void 0:m.code))throw new GI(VI.PUBLISH_FAILED,(null==m?void 0:m.message)||"publish failed");return g=null===(o=null==m?void 0:m.relayMessage)||void 0===o?void 0:o.sdp,[4,null===(a=this._handler)||void 0===a?void 0:a.setAnswerSdp(_.sdp,g,void 0,e,dD.UP)];case 4:return S.sent(),e.streamId=m.streamId,e.videoMid=h,e.audioMid=f,aP.rtcPublishStat(hD.SUCCESS,pD.W_0,l,_D.UNKNOWN),null===(s=this._statsReport)||void 0===s||s.setLocalStreamStatsEvtInterval(e),[2];case 5:return(E=S.sent())instanceof Error&&aP.rtcPublishStat(hD.FAIL,pD.W_0,l,E.message),f&&h?[4,null===(c=this._handler)||void 0===c?void 0:c.rollback(p,[f,h])]:[3,7];case 6:S.sent(),S.label=7;case 7:throw E;case 8:return[2]}}))}))},t.prototype.updatePubTrack=function(e){var t,r,n,i,o,a;return S(this,void 0,void 0,(function(){var s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,A;return b(this,(function(b){switch(b.label){case 0:_M.print("updatePubTrack()","localStream: %o",e),s=e.videoTrack,c=e.audioTrack,null===(t=e.videoTransceiver)||void 0===t||t.sender.replaceTrack((null==s?void 0:s.getTrack())||null),c?(u=c.mixType,d=c.mixedAudioTrack,l=null==c?void 0:c.getTrack(),d&&u!==C.PLAYOUT&&!0===l.enabled&&(l=d),null===(r=e.audioTransceiver)||void 0===r||r.sender.replaceTrack(l)):null===(n=e.audioTransceiver)||void 0===n||n.sender.replaceTrack(null),f={localaudio:!!c,localvideo:!!s,videostream:!!(null===(i=null==s?void 0:s.getTrack())||void 0===i?void 0:i.enabled),audiostream:!!(null===(o=null==c?void 0:c.getTrack())||void 0===o?void 0:o.enabled)},h={};try{for(p=T(Object.entries(f)),_=p.next();!_.done;_=p.next())v=I(_.value,2),m=v[0],(g=v[1])!==Reflect.get(e.pubAttributes,m)&&Reflect.set(h,m,g)}catch(e){S={error:e}}finally{try{_&&!_.done&&(A=p.return)&&A.call(p)}finally{if(S)throw S.error}}return Object.keys(h).length?(e.pubAttributes=f,y={roomId:this._roomId,streamId:e.streamId,attributes:h},[4,null===(a=this._dataChannelSignal)||void 0===a?void 0:a.sendSignaling("updateStreamAttributes",y)]):[2];case 1:if(200!==(null==(E=b.sent())?void 0:E.code))throw new GI(VI.UPDATE_TRACK_FAILED,(null==E?void 0:E.message)||"update track failed");return[2]}}))}))},t.prototype.unpublish=function(e){var t,r,n;return S(this,void 0,void 0,(function(){var i,o;return b(this,(function(a){switch(a.label){case 0:return _M.print("unpublish()","localStream: %o",e),i={roomId:this._roomId,initStreamId:e.initStreamId,streamId:e.streamId},[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("unpublish",i)];case 1:if(200!==(null==(o=a.sent())?void 0:o.code))throw new GI(VI.UNPUBLISH_FAILED,(null==o?void 0:o.message)||"unpublish failed");return[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])];case 2:return a.sent(),null===(n=this._statsReport)||void 0===n||n.unpublish(e),[2]}}))}))},t.prototype.subscribe=function(e,t,r){var n,i,o,a,s,c,u,d,l;return S(this,void 0,void 0,(function(){var f,h,_,v,m,g,y,E,S,T,I,A,R,C,O,w,N,k,D,P;return b(this,(function(b){switch(b.label){case 0:if(e.hasSubscribed)return[2,this._updateSubTrack(e,t,r)];_M.print("subscribe()","mediaType: %o, config: %o",t,r),mM("subscribe()",e),f=!1,h=!1,t===p.VIDEO_ONLY?f=!0:t===p.AUDIO_ONLY?h=!0:t===p.AUDIO_AND_VIDEO?(f=!0,h=!0):t===p.NONE&&(f=!1,h=!1),_=iO(),v=e.audioMid,m=e.videoMid,y=!1,b.label=1;case 1:return b.trys.push([1,12,,15]),v&&m?(y=!0,[4,null===(n=this._handler)||void 0===n?void 0:n.subscribe(e,{audioMid:v,videoMid:m})]):[3,3];case 2:return g=b.sent(),[3,5];case 3:return[4,null===(i=this._handler)||void 0===i?void 0:i.subscribe(e)];case 4:if(!(g=b.sent()))throw new GI(VI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");v=g.audioMid,m=g.videoMid,b.label=5;case 5:return E={audio:!this._multiChatMode(),video:!0,data:!0,screen:e.isScreen,browser:"chrome-stable",videoMid:m,audioMid:v,sdpInfo:{sdp:null==g?void 0:g.partialSdp,semantics:null==g?void 0:g.semantics,type:null==g?void 0:g.type},streamUserId:e.userId,streamId:e.streamId,config:{enableMediaType:{audio:!!this._multiChatMode()||h,video:f},qualityLayer:{spatialLayer:r.videoIndex,temporalLayer:r.videoIndex}}},[4,null===(o=this._dataChannelSignal)||void 0===o?void 0:o.sendSignaling("subscribe",E)];case 6:if(200!==(null==(S=b.sent())?void 0:S.code))throw new GI(VI.SUBSCRIBE_FAILED,(null==S?void 0:S.message)||"subscribe failed");return T=[],I=!this._multiChatMode(),!(v&&m)&&T.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new GI(VI.TIME_OUT,"wait video timeout for userId: ".concat(e.userId)))}),vM);e.on("ontrack",(function r(i){"video"===i.mediaType&&(_M.print("remoteStream ".concat(e.userId," received video track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),I&&T.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new GI(VI.TIME_OUT,"wait audio timeout for userId: ".concat(e.userId)))}),vM);e.on("ontrack",(function r(i){"audio"===i.mediaType&&(_M.print("remoteStream ".concat(e.userId," received audio track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),A=function(t){e.ontrack(t)},null===(a=this._handler)||void 0===a||a.on("ontrack",A),this._ontrackCallbackMap.set(e,A),R=null==S?void 0:S.relayMessage,C=R.audioMid,O=R.videoMid,w=R.sequenceId,N=R.sdp,y&&v!==C?(_M.print("subscribe","mid mot match",v,C),[4,null===(s=this._handler)||void 0===s?void 0:s.closeMLine([v,m])]):[3,9];case 7:return b.sent(),[4,null===(c=this._handler)||void 0===c?void 0:c.subscribe(e)];case 8:if(!(g=b.sent()))throw new GI(VI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");v=g.audioMid,m=g.videoMid,b.label=9;case 9:return(P={})[v]=C,P[m]=O,k=P,e.videoMid=O,e.audioMid=C,e.sequenceId=w,e.subConfig=r,e._workaround_1_=!1,e.paused=!1,e.subMediaType=t,e.hasSubscribed=!0,[4,null===(u=this._handler)||void 0===u?void 0:u.setAnswerSdp(null==g?void 0:g.sdp,N,k,e,dD.DOWN)];case 10:return b.sent(),[4,Promise.all(T)];case 11:return b.sent(),this._multiChatMode()||(e.subAudio=h),e.subVideo=f,aP.rtcSubscribeStat(vD.SUCCESS,_,mD.UNKNOWN,e.userId),null===(d=this._statsReport)||void 0===d||d.setRemoteStreamStatsEvtInterval(e),[2];case 12:return(D=b.sent())instanceof Error&&aP.rtcSubscribeStat(vD.FAIL,_,D.message,e.userId),v&&m?[4,null===(l=this._handler)||void 0===l?void 0:l.rollback(null==g?void 0:g.sdp,[v,m])]:[3,14];case 13:b.sent(),b.label=14;case 14:throw D;case 15:return[2]}}))}))},t.prototype.controlMessage=function(e){var t;return S(this,void 0,void 0,(function(){return b(this,(function(r){switch(r.label){case 0:return _M.print("controlMessage()","params: %o",e),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("controlMessage",y(y({},e),{roomId:this._roomId}))];case 1:return r.sent(),[2]}}))}))},t.prototype.updateUserAttributes=function(e){var t;return S(this,void 0,void 0,(function(){return b(this,(function(r){switch(r.label){case 0:return _M.print("updateUserAttributes()","attributes: %o",e),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("updateUserAttributes",{roomId:this._roomId,sessionId:this._sessionId,attributes:e})];case 1:return r.sent(),[2]}}))}))},t.prototype.updateSubTrack=function(e,t,r){return S(this,void 0,void 0,(function(){return b(this,(function(n){return[2,this._updateSubTrack(e,t,r)]}))}))},t.prototype._updateSubTrack=function(e,t,r){var n;return S(this,void 0,void 0,(function(){var i,o,a,s;return b(this,(function(c){switch(c.label){case 0:return _M.print("updateSubTrack()","mediaType: %o, config: %o",t,r),mM("updateSubTrack()",e),i=!1,o=!1,t===p.VIDEO_ONLY?(i=!0,o=!1):t===p.AUDIO_ONLY?(o=!0,i=!1):t===p.AUDIO_AND_VIDEO?(i=!0,o=!0):t===p.NONE&&(i=!1,o=!1),a={roomId:this._roomId,streamList:[e.streamId],config:{enableMediaType:{video:i,audio:!!this._multiChatMode()||o},qualityLayer:{spatialLayer:r.videoIndex,temporalLayer:r.videoIndex}}},[4,null===(n=this._dataChannelSignal)||void 0===n?void 0:n.sendSignaling("updateSubscribe",a)];case 1:if(200!==(null==(s=c.sent())?void 0:s.code))throw new GI(VI.UPDATE_TRACK_FAILED,(null==s?void 0:s.message)||"update track failed");return e.paused=!i,this._multiChatMode()||(e.subAudio=o),e.subVideo=i,e.subMediaType=t,e.subConfig=r,[2,e]}}))}))},t.prototype.subscribe4pushTrack=function(e,t){var r,n,i,o,a;return S(this,void 0,void 0,(function(){var s,c,u,d,l,f,h,p,_,v,m,g,y;return b(this,(function(E){switch(E.label){case 0:if(_M.print("subscribe4pushTrack()","streamInfo: %o",t),mM("subscribe4pushTrack()",e),s=null==t?void 0:t.message,c=s.audioMid,u=s.videoMid,d=s.sequenceId,l=s.sdp,e.subAudio=!0,d<e.sequenceId)return _M.print("subscribe4pushTrack","sequenceId return",d,e.sequenceId),[2];f=e.audioMid,h=e.videoMid,E.label=1;case 1:return E.trys.push([1,8,,11]),f&&h?[4,null===(r=this._handler)||void 0===r?void 0:r.subscribe(e,{audioMid:f,videoMid:h})]:[3,3];case 2:return p=E.sent(),[3,5];case 3:return[4,null===(n=this._handler)||void 0===n?void 0:n.subscribe(e)];case 4:if(!(p=E.sent()))throw new GI(VI.ADD_TRANSCEIVER_FAILED,"add transceiver failed");f=p.audioMid,h=p.videoMid,E.label=5;case 5:return(y={})[f]=c,y[h]=u,_=y,_M.print("onpushtrack midmap",e.userId,_),e.audioMid=c,e.videoMid=u,e.sequenceId=d,v=[],e.audioTrack||v.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new GI(VI.TIME_OUT,"wait audio timeout for userId: ".concat(e.userId)))}),vM);e.on("ontrack",(function r(i){"audio"===i.mediaType&&(_M.print("remoteStream ".concat(e.userId," received audio track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),m=function(t){e.ontrack(t)},null===(i=this._handler)||void 0===i||i.on("ontrack",m),this._ontrackCallbackMap.set(e,m),[4,null===(o=this._handler)||void 0===o?void 0:o.setAnswerSdp(null==p?void 0:p.sdp,l,_,e,dD.DOWN)];case 6:return E.sent(),[4,Promise.all(v)];case 7:return E.sent(),[2];case 8:return g=E.sent(),p?[4,null===(a=this._handler)||void 0===a?void 0:a.rollback(null==p?void 0:p.sdp,[f,h])]:[3,10];case 9:E.sent(),E.label=10;case 10:throw g;case 11:return[2]}}))}))},t.prototype.unsubscribe4removeTrack=function(e,t){var r;return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return mM("unsubscribe4removeTrack()",e),_M.print("unsubscribe4removeTrack()","sequenceId: ",t.sequenceId),t.sequenceId<e.sequenceId?(_M.print("unsubscribe4removeTrack()","sequenceId return"),[2]):(e.subAudio=!1,e.subVideo||e.paused?(e.sequenceId=t.sequenceId,[2]):[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])]);case 1:return n.sent(),_M.print("clean unsubscribe4removeTrack"),e.clean(),e.resetHasSubscribed(),[2]}}))}))},t.prototype.unsubscribe=function(e){var t,r,n;return S(this,void 0,void 0,(function(){var i;return b(this,(function(o){switch(o.label){case 0:mM("unsubscribe()",e),i={roomId:this._roomId,streamId:e.streamId,userId:e.userId},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("unsubscribe",i)];case 2:case 3:return o.sent(),[3,4];case 4:return e.hasSubscribed=!1,e.subVideo=!1,e.paused=!1,e._workaround_1_||(e.subAudio=!1),e.subAudio?[3,6]:[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])];case 5:o.sent(),_M.print("unsubscribe","clean unsub ".concat(e.userId)),e.clean(),e.resetHasSubscribed(),this.removeOnTrackListener(e),null===(n=this._statsReport)||void 0===n||n.unsubscribe(e),o.label=6;case 6:return[2]}}))}))},t.prototype.removeOnTrackListener=function(e){var t,r=this._ontrackCallbackMap.get(e);r&&(null===(t=this._handler)||void 0===t||t.off("ontrack",r),this._ontrackCallbackMap.delete(e))},t.prototype.handleRemoveStream=function(e,t){return S(this,void 0,void 0,(function(){return b(this,(function(r){return mM("handleRemoveStream()",e),e.subVideo=!1,t.message&&t.message!==QD.videoMuted?e._workaround_1_=!1:e._workaround_1_=!0,this.unsubscribe(e),[2]}))}))},t.prototype.leave=function(){var e;return S(this,void 0,void 0,(function(){var t,r;return b(this,(function(n){switch(n.label){case 0:return _M.print("leave()"),(this.connectionState=hM.CONNECTED)?(this.connectionState=hM.DISCONNECTING,t={Authorization:this._authorization,roomId:this._roomId,sessionId:this._sessionId},[4,this._joinLeaveLock.lock()]):[3,7];case 1:r=n.sent(),n.label=2;case 2:return n.trys.push([2,4,5,6]),[4,null===(e=this._dataChannelSignal)||void 0===e?void 0:e.sendSignaling("leaveRoom",t)];case 3:case 4:return n.sent(),[3,6];case 5:return r(),[7];case 6:return[3,8];case 7:return[2,Promise.resolve()];case 8:return[2]}}))}))},t.prototype.destroy=function(){var e,t,r,n;_M.print("destroy()"),this._token=void 0,this._appId=void 0,this._roomId=void 0,this._clientId=void 0,this._authorization=void 0,this._sessionId=void 0,null===(e=this._handler)||void 0===e||e.destroy(),null===(t=this._dataChannelSignal)||void 0===t||t.destroy(),null===(r=this._iceConfigRequestManager)||void 0===r||r.abort(),this._handler=void 0,this._dataChannelSignal=void 0,this._iceConfigRequestManager=void 0,this._removeSignalEventHandler(),null===(n=this._statsReport)||void 0===n||n.destroy(),this.connectionState=hM.DISCONNECTED,this.emit("INTERRUPT")},t.prototype.sendUserMessage=function(e,t){var r;return null===(r=this._dataChannelSignal)||void 0===r?void 0:r.sendP2PMessage(e,t)},t.prototype.sendRoomMessage=function(e){var t;return null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("customMessage",e)},t.prototype._multiChatMode=function(){var e;return null===(e=this._roomAttributes)||void 0===e?void 0:e.multiChatMode},Object.defineProperty(t.prototype,"handler",{get:function(){return this._handler},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomAttributes",{set:function(e){this._roomAttributes=e},enumerable:!1,configurable:!0}),E([SM],t.prototype,"join",null),E([EM,yM],t.prototype,"publish",null),E([EM,yM],t.prototype,"updatePubTrack",null),E([EM,yM],t.prototype,"unpublish",null),E([EM,yM],t.prototype,"subscribe",null),E([yM],t.prototype,"controlMessage",null),E([yM],t.prototype,"updateUserAttributes",null),E([EM,yM],t.prototype,"updateSubTrack",null),E([EM,yM],t.prototype,"subscribe4pushTrack",null),E([EM,yM],t.prototype,"unsubscribe4removeTrack",null),E([EM,yM],t.prototype,"unsubscribe",null),E([EM,yM],t.prototype,"handleRemoveStream",null),t}(UO);function yM(e,t,r){var n=r.value;return r.value=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return S(this,void 0,void 0,(function(){return b(this,(function(r){switch(r.label){case 0:return this._handler&&this._state===hM.CONNECTED?[4,n.apply(this,e)]:[3,2];case 1:return r.sent(),[3,3];case 2:throw new GI(VI.NOT_CONNECTED_YET,"error in ".concat(t,": try again after joined"));case 3:return[2]}}))}))},r}function EM(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return[4,this._pubSubLock.lock()];case 1:t=r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,n.apply(this,e)];case 3:return[2,r.sent()];case 4:return t(),[7];case 5:return[2]}}))}))},r}function SM(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S(this,void 0,void 0,(function(){var t,r=this;return b(this,(function(i){return t=!1,[2,new Promise((function(i,o){return S(r,void 0,void 0,(function(){var r,a;return b(this,(function(s){switch(s.label){case 0:this.on("INTERRUPT",(function(){t=!0,o(new GI(VI.OPERATION_CANCEL,"operation not finish when leave"))})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n.apply(this,e)];case 2:return r=s.sent(),i(r),[3,4];case 3:return a=s.sent(),t||o(a),[3,4];case 4:return[2]}}))}))}))]}))}))},r}var bM=ee,TM=Fu,IM=Ps.exports.getWeakData,AM=ur,RM=ge,CM=_u,OM=fu,wM=ht,NM=on.set,kM=on.getterFor,DM=Xl.find,PM=Xl.findIndex,MM=bM([].splice),UM=0,LM=function(e){return e.frozen||(e.frozen=new xM)},xM=function(){this.entries=[]},BM=function(e,t){return DM(e.entries,(function(e){return e[0]===t}))};xM.prototype={get:function(e){var t=BM(this,e);if(t)return t[1]},has:function(e){return!!BM(this,e)},set:function(e,t){var r=BM(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=PM(this.entries,(function(t){return t[0]===e}));return~t&&MM(this.entries,t,1),!!~t}};var VM,jM={getConstructor:function(e,t,r,n){var i=e((function(e,i){CM(e,o),NM(e,{type:t,id:UM++,frozen:void 0}),null!=i&&OM(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=kM(t),s=function(e,t,r){var n=a(e),i=IM(AM(t),!0);return!0===i?LM(n).set(t,r):i[n.id]=r,e};return TM(o,{delete:function(e){var t=a(this);if(!RM(e))return!1;var r=IM(e);return!0===r?LM(t).delete(e):r&&wM(r,t.id)&&delete r[t.id]},has:function(e){var t=a(this);if(!RM(e))return!1;var r=IM(e);return!0===r?LM(t).has(e):r&&wM(r,t.id)}}),TM(o,r?{get:function(e){var t=a(this);if(RM(e)){var r=IM(e);return!0===r?LM(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}},FM=M,GM=ee,zM=Fu,HM=Ps.exports,WM=Vu,YM=jM,KM=ge,XM=rc,qM=on.enforce,JM=Ur,ZM=!FM.ActiveXObject&&"ActiveXObject"in FM,$M=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},QM=WM("WeakMap",$M,YM);if(JM&&ZM){VM=YM.getConstructor($M,"WeakMap",!0),HM.enable();var eU=QM.prototype,tU=GM(eU.delete),rU=GM(eU.has),nU=GM(eU.get),iU=GM(eU.set);zM(eU,{delete:function(e){if(KM(e)&&!XM(e)){var t=qM(this);return t.frozen||(t.frozen=new VM),tU(this,e)||t.frozen.delete(e)}return tU(this,e)},has:function(e){if(KM(e)&&!XM(e)){var t=qM(this);return t.frozen||(t.frozen=new VM),rU(this,e)||t.frozen.has(e)}return rU(this,e)},get:function(e){if(KM(e)&&!XM(e)){var t=qM(this);return t.frozen||(t.frozen=new VM),rU(this,e)?nU(this,e):t.frozen.get(e)}return nU(this,e)},set:function(e,t){if(KM(e)&&!XM(e)){var r=qM(this);r.frozen||(r.frozen=new VM),rU(this,e)?iU(this,e,t):r.frozen.set(e,t)}else iU(this,e,t);return this}})}var oU=new(function(e){function t(){var t=e.call(this)||this;return t._hasVideoPermission=!1,t._hasAudioPermission=!1,t.inited=!1,t.deviceMap=new Map,t._handleDeviceChange=t._handleDeviceChange.bind(t),t.refreshDevices(),t}return r(t,e),t.prototype.refreshDevices=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){switch(t.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:return t.sent().filter((function(e){return""!==e.deviceId})).forEach((function(t){e.deviceMap.set(t.deviceId,{deviceName:t.label,deviceInfo:t,deviceId:t.deviceId,deviceType:t.kind,deviceState:"active"})})),this.inited||this.initListener(),this.inited=!0,[2]}}))}))},t.prototype.initListener=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){return navigator.mediaDevices.addEventListener("devicechange",this._handleDeviceChange),[2]}))}))},t.prototype._handleDeviceChange=function(){return S(this,void 0,void 0,(function(){var e,t,r=this;return b(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:return e=n.sent(),t=Array.from(this.deviceMap.values()),e.forEach((function(e){var t=r.deviceMap.get(e.deviceId);r.deviceMap.set(e.deviceId,{deviceName:e.label,deviceType:e.kind,deviceId:e.deviceId,deviceInfo:e,deviceState:"active"}),t&&"inactive"!==t.deviceState||r.emit("onMediaDeviceStateChanged",{deviceName:e.label,deviceType:e.kind,deviceId:e.deviceId,deviceInfo:e,deviceState:"active"})})),t.forEach((function(t){e.find((function(e){return e.deviceId===t.deviceId}))||(t.deviceState="inactive",r.deviceMap.delete(t.deviceId),r.emit(N.onMediaDeviceStateChanged,t))})),[2]}}))}))},t.prototype.getVideoPermission=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){switch(t.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new GI(VI.NOT_SUPPORTED,"GetUserMedia not supported");if(this.hasVideoPermission)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(t){t&&(t.getTracks().forEach((function(e){return e.stop()})),e.hasVideoPermission=!0,e.inited||e.refreshDevices())}))];case 2:case 3:return t.sent(),[3,4];case 4:return[2,this.hasVideoPermission]}}))}))},t.prototype.getAudioPermission=function(){return S(this,void 0,void 0,(function(){var e=this;return b(this,(function(t){switch(t.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new GI(VI.NOT_SUPPORTED,"GetUserMedia not supported");if(this.hasAudioPermission)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){t&&(t.getTracks().forEach((function(e){return e.stop()})),e.hasAudioPermission=!0,e.inited||e.refreshDevices())}))];case 2:case 3:return t.sent(),[3,4];case 4:return[2,this.hasAudioPermission]}}))}))},t.prototype.getDevices=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.getAudioPermission()];case 1:case 2:return e.sent(),[3,3];case 3:return e.trys.push([3,5,,6]),[4,this.getVideoPermission()];case 4:case 5:return e.sent(),[3,6];case 6:return[4,this.refreshDevices()];case 7:return e.sent(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState}))]}}))}))},t.prototype.getMicrophones=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return[4,this.refreshDevices()];case 1:return e.sent(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"audioinput"===e.deviceType}))]}}))}))},t.prototype.getCameras=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){return this.refreshDevices(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"videoinput"===e.deviceType}))]}))}))},t.prototype.getAudioPlayback=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){return this.refreshDevices(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"audiooutput"===e.deviceType}))]}))}))},t.prototype.getDeviceById=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return[4,this.getDevices()];case 1:return[2,t.sent().find((function(t){return t.deviceId===e}))]}}))}))},Object.defineProperty(t.prototype,"hasAudioPermission",{get:function(){return this._hasAudioPermission},set:function(e){if(!e)throw new GI(VI.NO_PERMISSION,"Cannot revoke audio permission");this.refreshDevices(),this._hasAudioPermission=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasVideoPermission",{get:function(){return this._hasVideoPermission},set:function(e){if(!e)throw new GI(VI.NO_PERMISSION,"Cannot revoke Video permission");this.inited||this.refreshDevices(),this._hasVideoPermission=!0},enumerable:!1,configurable:!0}),t}(UO)),aU=window.AudioContext||window.webkitAudioContext,sU=function(){function e(){}return e.prototype.getAudioContextInstance=function(){return this._audioContextInstance||(this._audioContextInstance=new aU),this._audioContextInstance},e}(),cU=function(){function e(e){var t=uU.getAudioContextInstance();this._track=e;var r=new MediaStream;r.addTrack(e);var n=t.createMediaStreamSource(r),i=t.createAnalyser();n.connect(i),this._analyserNode=i}return e.prototype.getAudioLevel=function(){var e=new Uint8Array(2048);this._analyserNode.getByteTimeDomainData(e);var t=0;return e.forEach((function(e){return t=Math.max(t,Math.abs(e-128))})),t/128*255},e}(),uU=new sU,dU=new PO("VERTC",0),lU=new WeakMap,fU=function(e){return lU.get(e)},hU=function(e){function t(t,r){var n=e.call(this)||this;return n._trackId=t,n.mediaType=r,n}return r(t,e),t.prototype.getId=function(){return this._trackId},t}(UO),pU=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i._mediaTrack=t,i._initListeners(),i}return r(t,e),t.prototype.getTrack=function(){return this._mediaTrack},t.prototype.close=function(){var e;return null===(e=this._mediaTrack)||void 0===e?void 0:e.stop()},t.prototype._initListeners=function(){var e=this;this._mediaTrack instanceof MediaStreamTrack&&this._mediaTrack.addEventListener("ended",(function(){aP.rtcError("track-ended mediaType: ".concat(e._mediaTrack.kind),-1001),e.emit("track-ended",e)}))},t}(hU),_U=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i._mediaTrack=t,i}return r(t,e),t.prototype.getTrack=function(){return this._mediaTrack},t}(hU),vU=function(e){function t(t,r){return e.call(this,t,r,"video")||this}return r(t,e),t.prototype.updateVideoCaptureConfig=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return this.videoCaptureConfig?(dU.print("updateVideoEncoderConfig","update localVideoTrack: ",this.videoCaptureConfig),[4,null===(e=this.getTrack())||void 0===e?void 0:e.applyConstraints(this.videoCaptureConfig)]):[2];case 1:return t.sent(),[2]}}))}))},t}(pU),mU=function(e){function t(t,r){var n=e.call(this,t,r,"audio")||this;return n.mixType=C.PLAYOUT_AND_PUBLISH,n}return r(t,e),t.prototype.getAudioLevel=function(){return this._audioLevelFetcher||(this._audioLevelFetcher=new cU(this.getTrack())),this._audioLevelFetcher.getAudioLevel()},t.prototype.updateAudioCaptureConfig=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return this.audioCaptureConfig?(dU.print("updateAudioCaptureConfig","update localAudioTrack: ",this.audioCaptureConfig),[4,null===(e=this.getTrack())||void 0===e?void 0:e.applyConstraints(this.audioCaptureConfig)]):[2];case 1:return t.sent(),[2]}}))}))},t}(pU),gU=function(e){function t(t,r){return e.call(this,t,r,"video")||this}return r(t,e),t}(_U),yU=function(e){function t(t,r){return e.call(this,t,r,"audio")||this}return r(t,e),t.prototype.getAudioLevel=function(){return this._audioLevelFetcher||(this._audioLevelFetcher=new cU(this.getTrack())),this._audioLevelFetcher.getAudioLevel()},t}(_U),EU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(mU),SU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(vU),bU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(vU),TU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(mU),IU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(vU),AU=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(mU);function RU(e){var t;return S(this,void 0,void 0,(function(){var r,n,i,o,a,s;return b(this,(function(c){switch(c.label){case 0:n=(null===(t=null==e?void 0:e.deviceId)||void 0===t?void 0:t.exact)||"default",c.label=1;case 1:return c.trys.push([1,3,,4]),dU.print("createCameraVideoTrack","constraints:",e),aP.rtcVideoCaptureEvent({event_type:kD.START,media_device_id:n}),i=iO(),[4,navigator.mediaDevices.getUserMedia({video:e})];case 2:return r=c.sent(),aP.rtcVideoCaptureEvent({event_type:kD.START_CAPTURE_RESULT,media_device_id:n,reason:PD.SUCCESS,elapse:iO()-i}),oU.hasVideoPermission=!0,[3,4];case 3:throw o=c.sent(),aP.rtcVideoCaptureEvent({event_type:kD.RUNNING_FAILED,media_device_id:n,error_code:o.code,reason:JSON.stringify(o)}),new GI(VI.GET_VIDEO_TRACK_FAILED,"throw error from getUserMedia",o);case 4:return a=r.getVideoTracks()[0],lU.set(a,r),(s=new SU(a,nO())).videoCaptureConfig=e,[2,s]}}))}))}function CU(e){var t;return S(this,void 0,void 0,(function(){var r,n,i,o,a;return b(this,(function(s){switch(s.label){case 0:dU.print("createCameraVideoTrack","constraints:",e),n=(null===(t=null==e?void 0:e.deviceId)||void 0===t?void 0:t.exact)||"default",s.label=1;case 1:return s.trys.push([1,3,,4]),aP.rtcVideoCaptureEvent({event_type:kD.START,media_device_id:n}),i=iO(),[4,navigator.mediaDevices.getUserMedia({audio:e})];case 2:return r=s.sent(),aP.rtcVideoCaptureEvent({event_type:kD.START_CAPTURE_RESULT,media_device_id:n,reason:PD.SUCCESS,elapse:iO()-i}),oU.hasAudioPermission=!0,[3,4];case 3:throw o=s.sent(),aP.rtcVideoCaptureEvent({event_type:kD.RUNNING_FAILED,media_device_id:n,error_code:o.code,reason:JSON.stringify(o)}),new GI(VI.GET_AUDIO_TRACK_FAILED,"throw error from getUserMedia",o);case 4:return a=r.getAudioTracks()[0],lU.set(a,r),[2,new EU(a,nO())]}}))}))}function OU(e){return void 0===e&&(e=!1),S(this,void 0,void 0,(function(){var t,r,n;return b(this,(function(i){switch(i.label){case 0:dU.print("createScreenStream","withAudio:",e),i.label=1;case 1:return i.trys.push([1,3,,4]),aP.rtcVideoCaptureEvent({event_type:kD.START,media_device_id:"screen"}),r=iO(),[4,navigator.mediaDevices.getDisplayMedia({video:!0,audio:e})];case 2:return t=i.sent(),aP.rtcVideoCaptureEvent({event_type:kD.START_CAPTURE_RESULT,media_device_id:"screen",reason:PD.SUCCESS,elapse:iO()-r}),[3,4];case 3:throw n=i.sent(),aP.rtcVideoCaptureEvent({event_type:kD.RUNNING_FAILED,media_device_id:"screen",error_code:n.code,reason:JSON.stringify(n)}),new GI(VI.GET_SCREEN_TRACK_FAILED,"throw error from getDisplayMedia",n);case 4:return[2,t]}}))}))}var wU,NU,kU=function(){function e(){}return e.getNalunits=function(t){if(t.length-t.position<4)return[];var r=t.position;return 1===t.getInt32(r)||0===t.getInt16(r)&&1===t.getInt8(r+2)?e.getAnnexbNals(t):e.getAvccNals(t)},e.getAnnexbNals=function(t){for(var r=[],n=e.getHeaderPositionAnnexB(t),i=n.pos,o=i;i<t.length-4;){var a=new Uint8Array(t.buffer.slice(i,i+n.headerLength));n.pos===t.position&&t.skip(n.headerLength),o=(n=e.getHeaderPositionAnnexB(t)).pos;var s={header:a,body:new Uint8Array(t.buffer.slice(i+a.byteLength,o)),type:-1};e.analyseNal(s),s.type<=9&&0!==s.type&&r.push(s),t.skip(o-t.position),i=o}return r},e.getAvccNals=function(t){for(var r=[];t.position<t.length-4;){var n=t.getInt32(t.position);if(!(t.length-t.position>=n))break;var i=new Uint8Array(t.buffer.slice(t.position,t.position+4));t.skip(4);var o=new Uint8Array(t.buffer.slice(t.position,t.position+n));t.skip(n);var a={header:i,body:o,type:-1};e.analyseNal(a),a.type<=9&&0!==a.type&&r.push(a)}return r},e.analyseNal=function(e){var t=31&e.body[0];switch(e.type=t,t){case 1:e.ndr=!0;break;case 5:e.idr=!0;break;case 6:e.sei=!0;break;case 7:e.sps=!0;break;case 8:e.pps=!0}},e.getHeaderPositionAnnexB=function(e){for(var t=e.position,r=0,n=e.length;3!==r&&4!==r&&t<n-4;)0===e.getInt16(t)?1===e.getInt16(t+2)?r=4:1===e.getInt8(t+2)?r=3:t++:t++;return t===n-4&&(0===e.getInt16(t)?1===e.getInt16(t+2)?r=4:t=n:(t++,0===e.getInt16(t)&&1===e.getInt8(t)?r=3:t=n)),{pos:t,headerLength:r}},e.getAvcc=function(e,t){var r=new Uint8Array(e.byteLength+t.byteLength+11);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;var n=6;return r.set(new Uint8Array([e.byteLength>>>8&255,255&e.byteLength]),n),n+=2,r.set(e,n),r[n+=e.byteLength]=1,n++,r.set(new Uint8Array([t.byteLength>>>8&255,255&t.byteLength]),n),n+=2,r.set(t,n),r},e}(),DU=function(){function e(e){this._position=0,this._dataview=new DataView(e)}return Object.defineProperty(e.prototype,"length",{get:function(){return this.buffer.byteLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._dataview.buffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!1,configurable:!0}),e.prototype.back=function(e){this.position-=e},e.prototype.getUint8=function(e){return this._dataview.getUint8(e)},e.prototype.getInt8=function(e){return this._dataview.getInt8(e)},e.prototype.getInt16=function(e){return this._dataview.getInt16(e)},e.prototype.getUint16=function(e){return this._dataview.getUint16(e)},e.prototype.getUint32=function(e){return this._dataview.getUint32(e)},e.prototype.getInt32=function(e){return this._dataview.getInt32(e)},e.prototype.skip=function(t){for(var r=Math.floor(t/4),n=t%4,i=0;i<r;i++)e.readByte(this,4);n>0&&e.readByte(this,n)},e.readByte=function(e,t,r){var n;switch(t){case 1:n=r?e.getInt8(e.position):e.getUint8(e.position);break;case 2:n=r?e.getInt16(e.position):e.getUint16(e.position);break;case 3:if(r)throw new Error("not supported for readByte 3");n=e.getUint8(e.position)<<16,n|=e.getUint8(e.position+1)<<8,n|=e.getUint8(e.position+2);break;case 4:n=r?e.getInt32(e.position):e.getUint32(e.position);break;case 8:if(r)throw new Error("not supported for readBody 8");n=e.getUint32(e.position)<<32,n|=e.getUint32(e.position+4);break;default:n=""}return e.position+=t,n},e.prototype.readUint8=function(){return e.readByte(this,1)},e.prototype.readUint16=function(){return e.readByte(this,2)},e.prototype.readUint24=function(){return e.readByte(this,3)},e.prototype.readUint32=function(){return e.readByte(this,4)},e.prototype.readUint64=function(){return e.readByte(this,8)},e.prototype.readInt8=function(){return e.readByte(this,1,!0)},e.prototype.readInt16=function(){return e.readByte(this,2,!0)},e.prototype.readInt32=function(){return e.readByte(this,4,!0)},e.prototype.writeUint32=function(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])},e}(),PU=new PO("Stream",0),MU=function(){function e(){this.isScreen=!1,this.seiList=[],this.stream=new MediaStream,this.pubAttributes={localaudio:!1,localvideo:!1,videostream:!1,audiostream:!1}}return Object.defineProperty(e.prototype,"hasPublished",{get:function(){return this.videoTransceiver&&this.audioTransceiver},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmptyStream",{get:function(){return!this.audioTrack&&!this.videoTrack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initStreamId",{get:function(){return this.stream.id},enumerable:!1,configurable:!0}),e.prototype.initVideoEncodedTransform=function(){var e=this;if(this.videoTransceiver&&this.videoTransceiver.sender){var t=this.videoTransceiver.sender;if(nM()){var r=t.createEncodedStreams(),n=r.readable,i=r.writable,o=new TransformStream({transform:function(t,r){var n=e.seiList[0];if(n){var i=new Uint8Array(n.content.byteLength+5);i.set([0,0,0,1,6]),i.set(n.content,5);var o=new Uint8Array(i.byteLength+t.data.byteLength);0===n.repeatCount&&e.seiList.splice(0,1),n.repeatCount--,o.set(new Uint8Array(t.data)),o.set(i,t.data.byteLength),t.data=o.buffer,r.enqueue(t)}else r.enqueue(t)}});n.pipeThrough(o).pipeTo(i)}}else PU.print("no sender found when trying to bind encodedTransform")},e.prototype.initAudioEncodedTransform=function(){if(this.audioTransceiver&&this.audioTransceiver.sender){var e=this.audioTransceiver.sender.createEncodedStreams(),t=e.readable,r=e.writable;t.pipeThrough(new TransformStream({transform:function(e,t){t.enqueue(e)}})).pipeTo(r)}else PU.print("no sender found when trying to bind encodedTransform")},e.prototype.clean=function(){this.audioMid=void 0,this.videoMid=void 0,this.videoTransceiver=void 0,this.audioTransceiver=void 0},e.prototype.updateVideoBitrate=function(e){var t,r=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.maxKbps;if("number"==typeof r&&r&&this.videoTransceiver){var n=this.videoTransceiver.sender,i=n.getParameters();i.encodings&&0!==i.encodings.length||(i.encodings=[{}]),i.encodings[0].maxBitrate=1e3*r,PU.print("updateVideoBitrate","set sendEncodings: ",i),n.setParameters(i)}},e.prototype.switchTrackEnableState=function(e,t){var r;"audio"===e?r=this.audioTrack:"video"===e&&(r=this.videoTrack);var n=null==r?void 0:r.getTrack();return!(!n||(null==n?void 0:n.enabled)===t)&&(n.enabled=t,!0)},e}(),UU=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o.userId=t,o.isScreen=n,o.streamId=r,o.hasAudio=i.localaudio,o.hasVideo=i.localvideo,o._attributes=i,o.subVideo=!1,o.subAudio=!1,o._sequenceId=0,o.subMediaType=p.NONE,o.recordedVideoFrames=[],o.subConfig={videoIndex:0},o.hasSubscribed=!1,o}return r(t,e),Object.defineProperty(t.prototype,"sequenceId",{get:function(){return this._sequenceId||-1},set:function(e){"number"==typeof e&&(this._sequenceId=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){return this._attributes},set:function(e){this.hasVideo=e.localvideo,this.hasAudio=e.localaudio,this._attributes=e},enumerable:!1,configurable:!0}),t.prototype.initVideoEncodedTransform=function(){var e=this;if(this.videoTransceiver&&this.videoTransceiver.receiver){var t=this.videoTransceiver.receiver.createEncodedStreams(),r=t.readable,n=t.writable;r.pipeThrough(new TransformStream({transform:function(t,r){var n=kU.getNalunits(new DU(t.data)).find((function(e){return e.sei}));n&&e.safeEmit("onSEIMessage",n.body.slice(1)),r.enqueue(t)}})).pipeTo(n)}else PU.print("no receiver found when trying to bind encodedTransform")},t.prototype.initAudioEncodedTransform=function(){if(this.audioTransceiver&&this.audioTransceiver.receiver){var e=this.audioTransceiver.receiver.createEncodedStreams(),t=e.readable,r=e.writable;t.pipeThrough(new TransformStream({transform:function(e,t){t.enqueue(e)}})).pipeTo(r)}else PU.print("no receiver found when trying to bind encodedTransform")},t.prototype.ontrack=function(e){var t,r,n;if((null===(r=null===(t=e.streams)||void 0===t?void 0:t[0])||void 0===r?void 0:r.id)===this.streamId){var i=e.track;"video"===(null==i?void 0:i.kind)?this._setVideoTrack(i):"audio"===(null===(n=e.track)||void 0===n?void 0:n.kind)&&this._setAudioTrack(i),this._setStream(e.streams[0])}this.safeEmit("ontrack",e)},t.prototype.clean=function(){PU.print("clean","exec stream.clean ".concat(this.streamId," ").concat(this.userId)),this.subAudio=!1,this.subVideo=!1,this.audioMid=void 0,this.videoMid=void 0,this.sequenceId=0,this.videoTrack=void 0,this.audioTrack=void 0,this.stream=void 0,this.videoTransceiver=void 0,this.audioTransceiver=void 0,this.recordedVideoFrames=[],this.paused=!1,this._workaround_1_=!1},t.prototype.resetHasSubscribed=function(){this.hasSubscribed=!1},t.prototype._setStream=function(e){var t=this;this.stream=e,e.onaddtrack=function(e){"video"===e.track.kind?t._setVideoTrack(e.track):"audio"===e.track.kind&&t._setAudioTrack(e.track)}},t.prototype._setAudioTrack=function(e){var t,r;(null===(r=null===(t=this.audioTrack)||void 0===t?void 0:t.getTrack())||void 0===r?void 0:r.id)!==(null==e?void 0:e.id)&&(this.audioTrack=new yU(e,nO()),this.emit("ontrack",this.audioTrack))},t.prototype._setVideoTrack=function(e){var t,r;(null===(r=null===(t=this.videoTrack)||void 0===t?void 0:t.getTrack())||void 0===r?void 0:r.id)!==(null==e?void 0:e.id)&&(this.videoTrack=new gU(e,nO()),this.emit("ontrack",this.videoTrack))},t}(UO);!function(e){e[e.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",e[e.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING"}(wU||(wU={})),function(e){e.RESUBSCRIBE="resubscribe",e.STREAM_FAILED="stream_failed",e.SUBSCRIBE_PUSH_TRACK="subscribe_push_track",e.REMOVE_PUSH_TRACK="remove_push_track",e.VIDEO_FIRST_FRAME="video_first_frame",e.ON_USER_MUTE_AUDIO="on_user_mute_audio",e.ON_USER_MUTE_VIDEO="on_user_mute_video",e.ON_USER_START_AUDIO_CAPTURE="on_user_start_audio_capture",e.ON_USER_STOP_AUDIO_CAPTURE="on_user_stop_audio_capture",e.ON_USER_START_VIDEO_CAPTURE="on_user_start_video_capture",e.ON_USER_STOP_VIDEO_CAPTURE="on_user_stop_video_capture",e.ON_SEI_MESSAGED_RECEIVED="on_sei_messaged_received",e.ON_PUBLISH_RESULT="on_publish_result"}(NU||(NU={}));var LU=new PO("Room",1),xU=function(e){function t(t){var r=e.call(this)||this;return r._remoteUsers=new Map,r._remoteStreams=new Map,r._roomConfig=t,r._mediaServerClient=new gM,r._addHandlerEventHandler(),r._isReconnecting=!1,r}return r(t,e),Object.defineProperty(t.prototype,"hasScreenPublished",{get:function(){var e;return null===(e=this._localScreenStream)||void 0===e?void 0:e.hasPublished},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPublished",{get:function(){var e;return null===(e=this._localStream)||void 0===e?void 0:e.hasPublished},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionState",{get:function(){return this._mediaServerClient.connectionState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteUsers",{get:function(){return this._remoteUsers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteStreams",{get:function(){return this._remoteStreams},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localStream",{get:function(){return this._localStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localScreenStream",{get:function(){return this._localScreenStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomInfo",{get:function(){return this._roomInfo},enumerable:!1,configurable:!0}),t.prototype._addHandlerEventHandler=function(){var e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m=this;null===(e=this._mediaServerClient)||void 0===e||e.on(eP.ON_ADD_STREAM,this._onAddStream.bind(this)),null===(t=this._mediaServerClient)||void 0===t||t.on(eP.ON_REMOVE_STREAM,this._onRemoveStream.bind(this)),null===(r=this._mediaServerClient)||void 0===r||r.on(eP.USER_CONNECTION,this._onUserConnection.bind(this)),null===(n=this._mediaServerClient)||void 0===n||n.on(eP.USER_DISCONNECTION,this._onUserDisconnection.bind(this)),null===(i=this._mediaServerClient)||void 0===i||i.on(eP.ON_UPDATE_ROOM_ATTRIBUTES,this._onUpdateRoomAttributes.bind(this)),null===(o=this._mediaServerClient)||void 0===o||o.on(eP.ON_UPDATE_STREAM_ATTRIBUTES,this._onUpdateStreamAttributes.bind(this)),null===(a=this._mediaServerClient)||void 0===a||a.on(eP.ON_PUSH_TRACK,this._onPushTrack.bind(this)),null===(s=this._mediaServerClient)||void 0===s||s.on(eP.ON_REMOVE_TRACK,this._onRemoveTrack.bind(this)),null===(c=this._mediaServerClient)||void 0===c||c.on(eP.NODE_CHANGE,this._nodeChange.bind(this)),null===(u=this._mediaServerClient)||void 0===u||u.on(eP.ON_CUSTOM_MESSAGE,this._onCustomMessage.bind(this)),null===(d=this._mediaServerClient)||void 0===d||d.on(eP.USER_MESSAGE_RECEIVED,this._onUserMessageReceived.bind(this)),null===(l=this._mediaServerClient)||void 0===l||l.on(eP.USER_BINARY_MESSAGE_RECEIVED,this._onUserBinaryMessageReceived.bind(this)),null===(f=this._mediaServerClient)||void 0===f||f.on(eP.POST_PROCESSING_MESSAGE,this._onPostProcessingMessage.bind(this)),null===(h=this._mediaServerClient)||void 0===h||h.on(tP.ON_CONNECTION_STATE_CHANGE,this._onConnectionStateChange.bind(this)),null===(p=this._mediaServerClient)||void 0===p||p.on(tP.ABNORMAL_DISCONNECTION,this._handleAbnormalDisconnection.bind(this)),null===(_=this._mediaServerClient)||void 0===_||_.on("onRemoteStreamStats",(function(e){m.emit("onRemoteStreamStats",e)})),null===(v=this._mediaServerClient)||void 0===v||v.on("onLocalStreamStats",(function(e){m.emit("onLocalStreamStats",e)}))},t.prototype._removeHandlerEventHandler=function(){var e;null===(e=this._mediaServerClient)||void 0===e||e.removeAllListeners()},t.prototype.join=function(e,t,r,n,i){return S(this,void 0,void 0,(function(){var o=this;return b(this,(function(a){return nP.setStats({rtc_app_id:e,room_id:t,user_id:n.userId}),LU.print("join()"),[2,new Promise((function(a,s){return S(o,void 0,void 0,(function(){var o;return b(this,(function(c){return this._joinResolveCallback=a,this._joinRejectCallback=s,this._controlMessage=i,this._roomInfo={appId:e,roomId:t,token:r,userInfo:n},o=iO(),aP.joinRoom(AD.BEGIN,o,!1,""),this._join((function(e){aP.joinRoom(AD.END,o,!0,e.message),a(e)}),(function(e){aP.joinRoom(AD.END,o,!1,e.message),s(e)})),[2]}))}))}))]}))}))},t.prototype._join=function(e,t,r){var n;return void 0===r&&(r=!1),S(this,void 0,void 0,(function(){var i,o,a;return b(this,(function(s){switch(s.label){case 0:i=iO(),LU.print("_join()"),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._mediaServerClient.join(this._roomInfo,{node:this._getAccessNode,reason:this._getAccessFeedback},r,this._controlMessage)];case 2:return o=s.sent(),this._mediaServerClient.roomAttributes=o.roomAttributes,this._joinResolveCallback=void 0,this._joinRejectCallback=void 0,this._getAccessFeedback=void 0,this._getAccessNode=void 0,"function"==typeof e&&e(null===(n=this._roomInfo)||void 0===n?void 0:n.userInfo),this._isReconnecting=!1,aP.rtcJoinRoom(0,"web","web",iO()-i),this._onJoinSucc(o,r),[3,4];case 3:return(a=s.sent()).code!==VI.OPERATION_CANCEL&&"function"==typeof t?[2,t(a)]:[3,4];case 4:return[2]}}))}))},t.prototype.publishScreen=function(e,t,r){return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return LU.print("publishScreen()"),this._localScreenStream||(this._localScreenStream=new MU,this._localScreenStream.isScreen=!0),this._localScreenStream.videoTrack=t,this._localScreenStream.audioTrack=r,this._localScreenStream.videoEncodeConfig=e,this._localScreenStream.hasPublished?[3,2]:[4,this._mediaServerClient.publish(this._localScreenStream)];case 1:return n.sent(),[3,4];case 2:return[4,this.updatePubScreenTrack()];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype.updatePubScreenTrack=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("updatePubScreenTrack","Invoke updatePubScreenTrack"),this._localScreenStream?[4,this._mediaServerClient.updatePubTrack(this._localScreenStream)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.unpublishScreen=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("unpublish","Invoke unpublishScreen"),this._localScreenStream?[4,this._mediaServerClient.unpublish(this._localScreenStream)]:[3,2];case 1:e.sent(),this._localScreenStream.clean(),this._localScreenStream=void 0,e.label=2;case 2:return[2]}}))}))},t.prototype.controlMessage=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return LU.print("controlMessage","Invoke controlMessage"),this._controlMessage=e,[4,this._mediaServerClient.controlMessage(e)];case 1:return t.sent(),"stopped"===e.action&&delete this._controlMessage,[2]}}))}))},t.prototype.updateUserAttributes=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return LU.print("updateUserAttributes","Invoke updateUserAttributes"),e.role&&this._roomInfo&&(this._roomInfo.userInfo.role=e.role),[4,this._mediaServerClient.updateUserAttributes(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.publish=function(e,t,r){return S(this,void 0,void 0,(function(){var n;return b(this,(function(i){switch(i.label){case 0:if(LU.print("publish","Invoke publish"),this._localStream||(this._localStream=new MU),this._localStream.videoTrack=t,this._localStream.audioTrack=r,this._localStream.videoEncodeConfig=e,this._localStream.hasPublished)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._mediaServerClient.publish(this._localStream)];case 2:return i.sent(),this.emit(NU.ON_PUBLISH_RESULT,{isScreen:!1,state:u.PUBLISH_SUCC}),[3,4];case 3:throw n=i.sent(),this.emit(NU.ON_PUBLISH_RESULT,{isScreen:!1,state:u.PUBLISH_FAIL}),n;case 4:return[3,7];case 5:return[4,this.updatePubTrack()];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))},t.prototype.updatePubTrack=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("updatePubTrack","Invoke updatePubTrack"),this._localStream?[4,this._mediaServerClient.updatePubTrack(this._localStream)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.unpublish=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("unpublish","Invoke unpublish"),this._localStream?[4,this._mediaServerClient.unpublish(this._localStream)]:[3,2];case 1:e.sent(),this._localStream.clean(),this._localStream=void 0,e.label=2;case 2:return[2]}}))}))},t.prototype.subscribe=function(e,t,r){return S(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return LU.print("subscribe","remoteStream %o",e),[4,this._mediaServerClient.subscribe(e,t,r)];case 1:return n.sent(),[2]}}))}))},t.prototype.updateSubTrack=function(e,t,r){var n,i;return S(this,void 0,void 0,(function(){return b(this,(function(o){return LU.print("updateSubTrack","Invoke updateSubTrack"),e.subMediaType===t&&(null===(n=null==e?void 0:e.subConfig)||void 0===n?void 0:n.videoIndex)===(null==r?void 0:r.videoIndex)?[2,Promise.resolve(e)]:[2,null===(i=this._mediaServerClient)||void 0===i?void 0:i.updateSubTrack(e,t,r)]}))}))},t.prototype.unsubscribe=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return LU.print("unsubscribe","Invoke unsubscribe"),[4,this._mediaServerClient.unsubscribe(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.leave=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:LU.print("leave","Invoke leave"),e=iO(),r.label=1;case 1:return r.trys.push([1,3,4,5]),clearTimeout(this._reconnectTimer),[4,this._mediaServerClient.leave()];case 2:return r.sent(),aP.rtcLeaveRoom(0,"",iO()-e),[3,5];case 3:return(t=r.sent())instanceof Error&&aP.rtcLeaveRoom(-1,t.message,iO()-e),[3,5];case 4:return this.destroy(),[7];case 5:return[2]}}))}))},t.prototype.destroy=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return LU.print("destroy","Invoke destroy"),this.connectionState!==hM.CONNECTED?[3,2]:[4,this.leave()];case 1:e.sent(),e.label=2;case 2:return this._destroyAndInitMediaServerClient(),this._roomInfo=void 0,this._remoteUsers=new Map,this._remoteStreams=new Map,this._localStream=void 0,this._localScreenStream=void 0,this._removeHandlerEventHandler(),[2]}}))}))},t.prototype.updateToken=function(e){LU.print("updateToken","Invoke updateToken"),this._roomInfo&&(this._roomInfo.token=e)},t.prototype.muteLocalTrack=function(e,t){var r,n;return S(this,void 0,void 0,(function(){var i,o;return b(this,(function(a){switch(a.label){case 0:return this._localStream&&(null===(r=this._localStream)||void 0===r?void 0:r.hasPublished)?(i=t!==s.MUTE_STATE_OFF,(o=this._localStream.switchTrackEnableState(e,i))?[4,null===(n=this._mediaServerClient)||void 0===n?void 0:n.updatePubTrack(this._localStream)]:[3,2]):[2,!1];case 1:a.sent(),a.label=2;case 2:return[2,o]}}))}))},t.prototype.pauseAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return b(this,(function(c){t=[];try{for(r=T(this._remoteStreams.values()),n=r.next();!n.done;n=r.next())i=n.value,Array.isArray(i)&&i.forEach((function(r){if(r.hasSubscribed){var n=null;switch(e){case l.RTC_PAUSE_RESUME_CONTROL_AUDIO:r.subMediaType===p.AUDIO_ONLY?n=p.NONE:r.subMediaType===p.AUDIO_AND_VIDEO&&(n=p.VIDEO_ONLY);break;case l.RTC_PAUSE_RESUME_CONTROL_VIDEO:r.subMediaType===p.VIDEO_ONLY?n=p.NONE:r.subMediaType===p.AUDIO_AND_VIDEO&&(n=p.AUDIO_ONLY);break;case l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO:r.subMediaType!==p.NONE&&(n=p.NONE)}if(null!==n){var i=s.updateSubTrack(r,n,r.subConfig);i&&t.push(i)}}}))}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2,Promise.all(t)]}))}))},t.prototype.resumeAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return b(this,(function(c){t=[];try{for(r=T(this._remoteStreams.values()),n=r.next();!n.done;n=r.next())i=n.value,Array.isArray(i)&&i.forEach((function(r){if(r.hasSubscribed){var n=null;switch(e){case l.RTC_PAUSE_RESUME_CONTROL_AUDIO:r.subMediaType===p.NONE?n=p.AUDIO_ONLY:r.subMediaType===p.VIDEO_ONLY&&(n=p.AUDIO_AND_VIDEO);break;case l.RTC_PAUSE_RESUME_CONTROL_VIDEO:r.subMediaType===p.NONE?n=p.VIDEO_ONLY:r.subMediaType===p.AUDIO_ONLY&&(n=p.AUDIO_AND_VIDEO);break;case l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO:r.subMediaType!==p.AUDIO_AND_VIDEO&&(n=p.AUDIO_AND_VIDEO)}if(null!==n){var i=s.updateSubTrack(r,n,r.subConfig);i&&t.push(i)}}}))}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2,Promise.all(t)]}))}))},t.prototype.sendUserMessage=function(e,t){var r;return this._remoteUsers.has(e)?null===(r=this._mediaServerClient)||void 0===r?void 0:r.sendUserMessage(e,t):Promise.reject(new GI(VI.USER_NOT_EXIST,"User does not exist"))},t.prototype.sendRoomMessage=function(e,t){var r,n;void 0===t&&(t=!1);var i={clientId:null===(r=this._roomInfo)||void 0===r?void 0:r.userInfo.userId,binary:t,message:""};if(t){var o=aO.ab2str(e);i.message=eO.encodeBase64(o)}else i.message=e;return null===(n=this._mediaServerClient)||void 0===n?void 0:n.sendRoomMessage(i)},t.prototype._destroyAndInitMediaServerClient=function(){LU.print("_destroyAndInitMediaServerClient()"),this._mediaServerClient&&(this._mediaServerClient.destroy(),this._removeHandlerEventHandler()),this._mediaServerClient=new gM,this._addHandlerEventHandler()},t.prototype._onJoinSucc=function(e,t){var r,n,i,o,a,s=this;LU.print("JoinSuccess()");var c=[],u=[],d=[],l=[];null===(a=e.clientsDetail)||void 0===a||a.forEach((function(t){if(t.clientId!==e.clientId){var r=s._remoteUsers.get(t.clientId);r?r._stillExist=!0:c.push(t)}}));try{for(var f=T(this._remoteUsers.values()),h=f.next();!h.done;h=f.next()){var p=h.value;p._stillExist?delete p._stillExist:u.push({clientId:p.userId,leaveReason:"Left during disconnection"})}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}e.streams.forEach((function(e){var t=s._findRemoteStreamByScreen(e.clientId,e.screen);t?(t.stillExist=!0,t.streamId=e.streamId):l.push(e)}));try{for(var _=T(this._remoteStreams.values()),v=_.next();!v.done;v=_.next()){var m=v.value;Array.isArray(m)&&m.forEach((function(e){e.stillExist?delete e.stillExist:d.push({clientId:e.userId,streamId:e.streamId,message:QD.clientDisconnected})}))}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}setTimeout((function(){u.forEach((function(e){return s._onUserDisconnection(e)})),c.forEach((function(e){return s._onUserConnection(e)})),d.forEach((function(e){return s._onRemoveStream(e)})),l.forEach((function(e){return s._onAddStream(e)})),t&&s._handleSendOrRecvStreamAfterReconnect()}))},t.prototype._handleSendOrRecvStreamAfterReconnect=function(){var e,t,r=this;this._localStream&&(this._localStream.clean(),this._mediaServerClient.publish(this._localStream).catch((function(e){}))),this._localScreenStream&&(this._localScreenStream.clean(),this._mediaServerClient.publish(this._localScreenStream).catch((function(e){})));try{for(var n=T(this._remoteStreams.values()),i=n.next();!i.done;i=n.next()){var o=i.value;Array.isArray(o)&&o.forEach((function(e){return S(r,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:if(!e.hasSubscribed)return[3,4];e.resetHasSubscribed(),r.label=1;case 1:return r.trys.push([1,3,,4]),LU.print("start resubscribe ".concat(e.userId," with ").concat(e.subMediaType)),[4,this._mediaServerClient.subscribe(e,e.subMediaType,e.subConfig)];case 2:return r.sent(),LU.print("success resubscribe ".concat(e.userId," with ").concat(e.subMediaType)),this.safeEmit(NU.RESUBSCRIBE,{stream:e}),[3,4];case 3:return t=r.sent(),LU.print("failed resubscribe ".concat(e.userId," with ").concat(e.subMediaType,", error:").concat(t)),e.clean(),null==e||e.resetHasSubscribed(),[3,4];case 4:return[2]}}))}))}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype._findRemoteStream=function(e,t){var r=this._remoteStreams.get(e);return Array.isArray(r)?r.find((function(e){return e.streamId===t})):null},t.prototype._findRemoteStreamByScreen=function(e,t){var r=this._remoteStreams.get(e);return Array.isArray(r)?r.find((function(e){return e.isScreen===t})):null},t.prototype._onAddStream=function(e,t){var r;if(void 0===t&&(t=!0),e.clientId!==(null===(r=this._roomInfo)||void 0===r?void 0:r.userInfo.userId)){var n=this._findRemoteStream(e.clientId,e.streamId);if(!n){n=new UU(e.clientId,e.streamId,e.screen,e.attributes),this._initStreamListeners(n);var i=this._remoteStreams.get(e.clientId);i?i.push(n):this._remoteStreams.set(e.clientId,[n])}return t&&this.safeEmit(eP.ON_ADD_STREAM,{stream:n}),!n.isScreen&&n.hasVideo&&this.safeEmit(NU.ON_USER_START_VIDEO_CAPTURE,{userId:n.userId}),!n.isScreen&&n.hasAudio&&this.safeEmit(NU.ON_USER_START_AUDIO_CAPTURE,{userId:n.userId}),n}},t.prototype._onUserConnection=function(e){var t;if(e.clientId!==(null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo.userId)){var r={userId:e.clientId,extraInfo:e.attributes.extra_info};this._remoteUsers.set(e.clientId,y(y({},r),{_stillExist:!0})),this.safeEmit(eP.USER_CONNECTION,{userInfo:r})}},t.prototype._onUserDisconnection=function(e){var t,r,n=this,i=e.clientId,o=e.leaveReason,a=this._remoteUsers.get(i);this._remoteUsers.delete(i);var s=this._remoteStreams.get(i);Array.isArray(s)&&s.length&&(s.forEach((function(e){n.safeEmit(eP.ON_REMOVE_STREAM,{stream:e,reason:"Client leave"})})),this._remoteStreams.delete(i)),"userDuplicateLogin"===e.tag&&i===(null===(r=null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo)||void 0===r?void 0:r.userId)&&(a={userId:i},o=e.tag),this.safeEmit(eP.USER_DISCONNECTION,{userInfo:{userId:null==a?void 0:a.userId},reason:o})},t.prototype._onRemoveStream=function(e){var t,r,n=this;if(e.clientId!==(null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo.userId)){var i=this._remoteStreams.get(e.clientId);if(i){var o=i.find((function(t){return t.streamId==e.streamId}));o&&(null===(r=this._mediaServerClient)||void 0===r||r.handleRemoveStream(o,e).then((function(){if(!(null==o?void 0:o._workaround_1_)){var t=n._remoteStreams.get(e.clientId);if(!t)return;t=t.filter((function(t){return t.streamId!==e.streamId})),n._remoteStreams.set(e.clientId,t)}})),this.safeEmit(eP.ON_REMOVE_STREAM,{stream:o,reason:e.message}))}}},t.prototype._onUpdateRoomAttributes=function(e){e.roomAttributes&&(this._mediaServerClient.roomAttributes=e.roomAttributes)},t.prototype._onUpdateStreamAttributes=function(e){var t=e.clientId,r=e.streamId,n=e.attributes,i=this._findRemoteStream(t,r);if(i){var o=i.attributes,a=y(y({},o),n);i.attributes=a,a.localaudio!==o.localaudio&&(a.localaudio?this.safeEmit(NU.ON_USER_START_AUDIO_CAPTURE,{userId:t}):this.safeEmit(NU.ON_USER_STOP_AUDIO_CAPTURE,{userId:t})),a.localvideo!==o.localvideo&&(a.localvideo?this.safeEmit(NU.ON_USER_START_VIDEO_CAPTURE,{userId:t}):this.safeEmit(NU.ON_USER_STOP_VIDEO_CAPTURE,{userId:t})),a.audiostream!==o.audiostream&&(a.audiostream?this.safeEmit(NU.ON_USER_MUTE_AUDIO,{userInfo:{userId:t},muteState:s.MUTE_STATE_ON}):this.safeEmit(NU.ON_USER_MUTE_AUDIO,{userInfo:{userId:t},muteState:s.MUTE_STATE_OFF})),a.videostream!==o.videostream&&(a.videostream?this.safeEmit(NU.ON_USER_MUTE_VIDEO,{userInfo:{userId:t},muteState:s.MUTE_STATE_ON}):this.safeEmit(NU.ON_USER_MUTE_VIDEO,{userInfo:{userId:t},muteState:s.MUTE_STATE_OFF}))}},t.prototype._onPushTrack=function(e){var t=this,r=e.clientId,n=e.streamId,i=this._findRemoteStream(r,n);i||(i=this._onAddStream(e,!1)),this._mediaServerClient.subscribe4pushTrack(i,e).then((function(){return t.safeEmit(NU.SUBSCRIBE_PUSH_TRACK,{stream:i})})).catch((function(e){LU.print("subscribe push track failed: ".concat(e))}))},t.prototype._onRemoveTrack=function(e){var t=this,r=e.clientId,n=e.streamId,i=e.message,o=this._findRemoteStream(r,n);o&&this._mediaServerClient.unsubscribe4removeTrack(o,i).then((function(){var e;if(o._workaround_1_){var i=null===(e=t._remoteStreams.get(r))||void 0===e?void 0:e.filter((function(e){return e.streamId!==n}));t._remoteStreams.set(r,i||[])}t.safeEmit(NU.REMOVE_PUSH_TRACK,{stream:o})})).catch((function(e){LU.print("remove push track failed: ".concat(e))}))},t.prototype._nodeChange=function(e){var t=e.nodes,r=e.reason;this._destroyAndInitMediaServerClient(),Array.isArray(t)&&t.length?this._getAccessNode=t[0]:this._getAccessFeedback=r,aP.rtcNodeChange(0,JSON.stringify(e),JSON.stringify(r)),this._joinResolveCallback&&this._joinRejectCallback?this._join(this._joinResolveCallback,this._joinRejectCallback):this._reconnect()},t.prototype._reconnect=function(){var e,t,r=this;this._isReconnecting=!0,aP.rtcReconnect(1002,$k.PEERCONNECTION_RECONNECTING,this._roomInfo.userInfo.userId,Qk.PEERCONNECTION);try{for(var n=T(this._remoteStreams.values()),i=n.next();!i.done;i=n.next()){var o=i.value;Array.isArray(o)&&o.forEach((function(e){return e.clean()}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._join((function(){aP.rtcReconnected(eD.PEERCONNECTION_RECONNECTED,tD.PEERCONNECTION)}),(function(e){LU.print("Reconnecting error, will reconnect after 3s",e),r._reconnectTimer=setTimeout(r._reconnect.bind(r),3e3)}),!0)},t.prototype._handleAbnormalDisconnection=function(){LU.print("on ABNORMAL_DISCONNECTION"),this._destroyAndInitMediaServerClient(),navigator.onLine?this._reconnect():this._reconnectTimer=setTimeout(this._reconnect.bind(this),3e3)},t.prototype._onConnectionStateChange=function(e){var t;if(e.next===hM.DISCONNECTED)t=v.CONNECTION_STATE_DISCONNECTED;else if(e.next===hM.CONNECTED)t=this._isReconnecting?v.CONNECTION_STATE_RECONNECTED:v.CONNECTION_STATE_CONNECTED;else{if(e.next!==hM.CONNECTING)return;t=this._isReconnecting?v.CONNECTION_STATE_RECONNECTING:v.CONNECTION_STATE_CONNECTING}this.safeEmit(tP.ON_CONNECTION_STATE_CHANGE,{state:t})},t.prototype._initStreamListeners=function(e){var t=this;e.on("ontrack",(function(e){e.track})),e.on("onSEIMessage",(function(r){var n;t.emit(NU.ON_SEI_MESSAGED_RECEIVED,{sei:r,remoteStreamKey:{userId:e.userId,roomId:null===(n=t._roomInfo)||void 0===n?void 0:n.roomId,streamIndex:e.isScreen?h.STREAM_INDEX_SCREEN:h.STREAM_INDEX_MAIN}})}))},t.prototype._onCustomMessage=function(e){this.safeEmit(eP.ON_CUSTOM_MESSAGE,e)},t.prototype._onUserMessageReceived=function(e){var t=e.msg;try{t=JSON.parse(t)}catch(e){}this.safeEmit(eP.USER_MESSAGE_RECEIVED,{userId:e.from,message:t})},t.prototype._onUserBinaryMessageReceived=function(e){this.safeEmit(eP.USER_BINARY_MESSAGE_RECEIVED,{userId:e.from,message:e.msg})},t.prototype._onPostProcessingMessage=function(e){var t,r=(null===(t=e.body)||void 0===t?void 0:t.error)||0;this.safeEmit(eP.POST_PROCESSING_MESSAGE,{code:r,message:["success","parameter error","subscription timeout","ffmpeg error","cdn error"][r]})},t}(UO),BU=function(e,t){return void 0===t&&(t={}),t.id&&(e.id=t.id),t.classList&&t.classList.forEach((function(t){e.classList.add(t)})),t.style&&Object.assign(e.style,t.style),t.attributes&&Object.entries(t.attributes).forEach((function(t){var r=I(t,2),n=r[0],i=r[1];e.setAttribute(n,i)})),e},VU=new PO("Player",0),jU=["play","playing","pause","ended","error","seeking","seeked","waiting","canplay","canplaythrough","durationchange","volumechange","loadedmetadata","loadeddata","loadstart","timeupdate"],FU={playsinline:"","webkit-playsinline":""},GU={playsinline:"","webkit-playsinline":"","x5-playsinline":"","x5-video-player-type":"h5","x-webkit-airplay":"allow",preload:"",muted:""},zU=function(){function e(){this.videoCache=[],this.audioCache=[]}return e.prototype.getOrCreate=function(e,t){var r="audio"===e?FU:GU;if("video"===e&&this.videoCache.length>0){if(n=this.videoCache.pop())return BU(n,{style:t,attributes:r}),n}else if("audio"===e&&this.audioCache.length>0){var n;if(n=this.audioCache.pop())return BU(n,{style:t,attributes:r}),n}return function(e,t){void 0===t&&(t={});var r=document.createElement(e);return t.id&&(r.id=t.id),t.classList&&t.classList.forEach((function(e){r.classList.add(e)})),t.style&&Object.assign(r.style,t.style),t.attributes&&Object.entries(t.attributes).forEach((function(e){var t=I(e,2),n=t[0],i=t[1];r.setAttribute(n,i)})),r}(e,{style:t,attributes:r})},e.prototype.recycle=function(e){for(;e.attributes.length>0;)e.removeAttribute(e.attributes[0].name);e instanceof HTMLVideoElement?this.videoCache.push(e):this.audioCache.push(e)},e}(),HU=new zU,WU=function(e){function t(t){var r=e.call(this)||this;r.emitVideoEvent=function(e){var t,n,i={type:"video",rawEvent:e,readyState:(null===(t=r._videoDom)||void 0===t?void 0:t.readyState)||0,userId:r.userId,eventName:e.type,currentTime:(null===(n=r._videoDom)||void 0===n?void 0:n.currentTime)||0,isScreen:r.isScreen};r.emit("playback_event",i)},r._internalPlay=function(){var e;if(null===(e=r._videoDom)||void 0===e?void 0:e.paused)return r._videoDom.play()};var n=t.renderDom,i=t.userId;r.renderMode=void 0!==t.renderMode?t.renderMode:f.RENDER_MODE_FIT;var o="string"==typeof n?document.getElementById(n):n;if(!o)throw new GI(VI.CANT_FIND_DOM,"can't find dom");return r._containerDom=o,r.userId=i,r.isScreen=!!t.isScreen,r._initVideo(),r}return r(t,e),t.prototype._initVideo=function(){this._videoDom||(this._videoDom=HU.getOrCreate("video",{width:"100%",height:"100%",background:"black"}),this._videoDom.id="".concat(this.userId,"_").concat(nO()),this.renderMode===f.RENDER_MODE_FIT?this._videoDom.style.objectFit="contain":this._videoDom.style.objectFit="cover"),this._initListeners()},t.prototype._initListeners=function(){var e=this;this._videoDom&&jU.forEach((function(t){var r;null===(r=e._videoDom)||void 0===r||r.addEventListener(t,e.emitVideoEvent)}))},t.prototype._removeListeners=function(){var e=this;this._videoDom&&(jU.forEach((function(t){var r;null===(r=e._videoDom)||void 0===r||r.removeEventListener(t,e.emitVideoEvent)})),this._videoDom.addEventListener("canplay",this._internalPlay),this._videoDom.addEventListener("loadeddata",this._internalPlay))},t.prototype._recordFrame=function(e){var t=this;this.on("playback_event",(function(r){var n;if("timeupdate"===r.eventName){if(void 0===t.__cumulativeTime&&(t.__cumulativeTime=0),0===(null===(n=t._videoDom)||void 0===n?void 0:n.currentTime))return;if(t._videoDom.currentTime>t.__cumulativeTime){var i=Math.floor(1e3*(t._videoDom.currentTime-t.__cumulativeTime)),o=t._videoDom.currentTime-t.__cumulativeTime>.5;e.recordedVideoFrames.push({playTime:t._videoDom.currentTime,isStall:o,stallCount:o?1:0,stallDuration:i%2e3})}t.__cumulativeTime=t._videoDom.currentTime}}))},t.prototype.playVideo=function(e,t){var r;return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){return n=this._videoDom,VU.print("playVideo","play video track: ".concat(this.userId)),n&&n.srcObject instanceof MediaStream&&n.srcObject.getTrackById(null===(r=e.getTrack())||void 0===r?void 0:r.id)||(n||(this._initVideo(),n=this._videoDom),VU.print("playVideo","play video by dom: ".concat(null==n?void 0:n.id)),(i=new MediaStream).addTrack(e.getTrack()),n.srcObject=i,this._containerDom.appendChild(n),n.addEventListener("canplay",this._internalPlay),n.addEventListener("loadeddata",this._internalPlay),t&&this._recordFrame(t)),[2]}))}))},t.prototype.updateSrcObject=function(e){var t=e.getTrack();if(t&&this._videoDom){var r=new MediaStream;r.addTrack(t),this._videoDom.srcObject=r}},t.prototype.mirror=function(e){VU.print("mirror","".concat(this.userId," set mirror: ").concat(e)),this._videoDom&&(this._videoDom.style.transform=e?"rotateY(180deg)":"")},t.prototype.stop=function(){var e=this._containerDom;VU.print("stop","stop video track: ".concat(this.userId)),this._videoDom&&(this._videoDom.srcObject=null,e&&e.contains(this._videoDom)&&e.removeChild(this._videoDom),HU.recycle(this._videoDom),this._removeListeners(),delete this._videoDom),this._videoDom=void 0,this.__cumulativeTime=void 0},t.prototype.destroy=function(){this.stop(),e.prototype.removeAllListeners.call(this)},Object.defineProperty(t.prototype,"domElement",{get:function(){return this._videoDom},enumerable:!1,configurable:!0}),t}(SO.exports.EventEmitter),YU=function(e){function t(t,r){var n=e.call(this)||this;if(n.emitVideoEvent=function(e){var t,r,i={type:"audio",rawEvent:e,readyState:(null===(t=n._audioDom)||void 0===t?void 0:t.readyState)||0,userId:n.userId,eventName:e.type,currentTime:(null===(r=n._audioDom)||void 0===r?void 0:r.currentTime)||0};n.emit("playback_event",i)},n._internalPlay=function(){var e;if(null===(e=n._audioDom)||void 0===e?void 0:e.paused){var t=n._audioDom.play();(null==t?void 0:t.then)&&t.catch((function(e){var t;aP.rtcError("autoplay failed, userId: ".concat(n.userId),-1e3),n.emit("playback_event",{type:"audio",rawEvent:e,readyState:n._audioDom.readyState||0,userId:n.userId,eventName:"autoplay-error",currentTime:(null===(t=n._audioDom)||void 0===t?void 0:t.currentTime)||0})}))}},r){var i=document.getElementById(r);if(!i)throw new GI(VI.CANT_FIND_DOM,"can't find dom");n._containerDom=i}else n._containerDom=document.body;return n.userId=t,n._initAudio(),n}return r(t,e),t.prototype._initAudio=function(){this._audioDom||(this._audioDom=HU.getOrCreate("audio",{display:"none"}),this._audioDom.id="".concat(this.userId,"_").concat(nO()),this._containerDom.appendChild(this._audioDom)),this._initListeners()},t.prototype._initListeners=function(){var e=this;this._audioDom&&jU.forEach((function(t){var r;null===(r=e._audioDom)||void 0===r||r.addEventListener(t,e.emitVideoEvent)}))},t.prototype._removeListeners=function(){var e=this;this._audioDom&&(jU.forEach((function(t){var r;null===(r=e._audioDom)||void 0===r||r.removeEventListener(t,e.emitVideoEvent)})),this._audioDom.removeEventListener("canplay",this._internalPlay),this._audioDom.removeEventListener("loadeddata",this._internalPlay))},t.prototype.playAudio=function(e){var t;return S(this,void 0,void 0,(function(){var r,n;return b(this,(function(i){return VU.print("playAudio","play audio track: ".concat(this.userId)),(r=this._audioDom)&&r.srcObject instanceof MediaStream&&r.srcObject.getTrackById(null===(t=e.getTrack())||void 0===t?void 0:t.id)||(r||(this._initAudio(),r=this._audioDom),(n=new MediaStream).addTrack(e.getTrack()),r.srcObject=n,null==r||r.addEventListener("canplay",this._internalPlay),null==r||r.addEventListener("loadeddata",this._internalPlay)),[2]}))}))},t.prototype.manuallyPlay=function(){if(VU.print("Invoke AudioPlayer.manuallyPlay"),!this._audioDom)throw new GI(VI.INVALID_PARAMS,"Player not found");var e=this._audioDom.play();return(null==e?void 0:e.then)?e:Promise.resolve(e)},t.prototype.setPlaybackDevice=function(e){return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:return VU.print("setPlaybackDevice","setPlaybackDevice: ".concat(e)),[4,oU.getAudioPlayback()];case 1:return t=r.sent(),t.map((function(e){return e.deviceId})).includes(e)&&this._audioDom&&this._audioDom.setSinkId?[4,this._audioDom.setSinkId(e)]:[2];case 2:return r.sent(),[2]}}))}))},t.prototype.stop=function(){var e=this._containerDom;VU.print("stopAudio","stop audio track: ".concat(this.userId)),this._audioDom&&(this._audioDom.srcObject=null,e&&e.contains(this._audioDom)&&e.removeChild(this._audioDom),HU.recycle(this._audioDom),this._removeListeners(),delete this._audioDom),this._audioDom=void 0},Object.defineProperty(t.prototype,"domElement",{get:function(){return this._audioDom},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.stop(),e.prototype.removeAllListeners.call(this)},t}(SO.exports.EventEmitter),KU={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,c=64,u=128,d=256,l=1/0,f=9007199254740991,h=NaN,p=4294967295,_=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",c],["rearg",d]],v="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",E="[object Error]",S="[object Function]",b="[object GeneratorFunction]",T="[object Map]",I="[object Number]",A="[object Object]",R="[object Promise]",C="[object RegExp]",O="[object Set]",w="[object String]",N="[object Symbol]",k="[object WeakMap]",P="[object ArrayBuffer]",M="[object DataView]",U="[object Float32Array]",L="[object Float64Array]",x="[object Int8Array]",B="[object Int16Array]",V="[object Int32Array]",j="[object Uint8Array]",F="[object Uint8ClampedArray]",G="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,q=RegExp(K.source),J=RegExp(X.source),Z=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,_e=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,Ee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,be=/['\n\r\u2028\u2029\\]/g,Te="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ie="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Re="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",we="['’]",Ne="[\\ud800-\\udfff]",ke="["+Oe+"]",De="["+Te+"]",Pe="\\d+",Me="[\\u2700-\\u27bf]",Ue="["+Ae+"]",Le="[^\\ud800-\\udfff"+Oe+Pe+Ie+Ae+Re+"]",xe="\\ud83c[\\udffb-\\udfff]",Be="[^\\ud800-\\udfff]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Re+"]",Ge="(?:"+Ue+"|"+Le+")",ze="(?:"+Fe+"|"+Le+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+De+"|"+xe+")"+"?",Ke="[\\ufe0e\\ufe0f]?",Xe=Ke+Ye+("(?:\\u200d(?:"+[Be,Ve,je].join("|")+")"+Ke+Ye+")*"),qe="(?:"+[Me,Ve,je].join("|")+")"+Xe,Je="(?:"+[Be+De+"?",De,Ve,je,Ne].join("|")+")",Ze=RegExp(we,"g"),$e=RegExp(De,"g"),Qe=RegExp(xe+"(?="+xe+")|"+Je+Xe,"g"),et=RegExp([Fe+"?"+Ue+"+"+He+"(?="+[ke,Fe,"$"].join("|")+")",ze+"+"+We+"(?="+[ke,Fe+Ge,"$"].join("|")+")",Fe+"?"+Ge+"+"+He,Fe+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,qe].join("|"),"g"),tt=RegExp("[\\u200d\\ud800-\\udfff"+Te+Ce+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,ot={};ot[U]=ot[L]=ot[x]=ot[B]=ot[V]=ot[j]=ot[F]=ot[G]=ot[z]=!0,ot[v]=ot[m]=ot[P]=ot[g]=ot[M]=ot[y]=ot[E]=ot[S]=ot[T]=ot[I]=ot[A]=ot[C]=ot[O]=ot[w]=ot[k]=!1;var at={};at[v]=at[m]=at[P]=at[M]=at[g]=at[y]=at[U]=at[L]=at[x]=at[B]=at[V]=at[T]=at[I]=at[A]=at[C]=at[O]=at[w]=at[N]=at[j]=at[F]=at[G]=at[z]=!0,at[E]=at[S]=at[k]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ut=parseInt,dt="object"==typeof D&&D&&D.Object===Object&&D,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||lt||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&e&&!e.nodeType&&e,_t=pt&&pt.exports===ht,vt=_t&&dt.process,mt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,Et=mt&&mt.isMap,St=mt&&mt.isRegExp,bt=mt&&mt.isSet,Tt=mt&&mt.isTypedArray;function It(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function At(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function Rt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ot(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function wt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Nt(e,t){return!!(null==e?0:e.length)&&jt(e,t,0)>-1}function kt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Dt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Mt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Ut(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Lt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var xt=Ht("length");function Bt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function jt(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,Gt,r)}function Ft(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Gt(e){return e!=e}function zt(e,t){var r=null==e?0:e.length;return r?Kt(e,t)/r:h}function Ht(e){return function(t){return null==t?r:t[e]}}function Wt(e){return function(t){return null==e?r:e[t]}}function Yt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Kt(e,t){for(var n,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Xt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qt(e){return e?e.slice(0,hr(e)+1).replace(oe,""):e}function Jt(e){return function(t){return e(t)}}function Zt(e,t){return Dt(t,(function(t){return e[t]}))}function $t(e,t){return e.has(t)}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&jt(t,e[r],0)>-1;);return r}function er(e,t){for(var r=e.length;r--&&jt(t,e[r],0)>-1;);return r}function tr(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var rr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Wt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ir(e){return"\\"+st[e]}function or(e){return tt.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function sr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var s=e[r];s!==t&&s!==o||(e[r]=o,a[i++]=r)}return a}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function dr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function lr(e){return or(e)?function(e){var t=Qe.lastIndex=0;for(;Qe.test(e);)++t;return t}(e):xt(e)}function fr(e){return or(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function hr(e){for(var t=e.length;t--&&ae.test(e.charAt(t)););return t}var pr=Wt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var _r=function e(t){var D=(t=null==t?ft:_r.defaults(ft.Object(),t,_r.pick(ft,nt))).Array,ae=t.Date,Te=t.Error,Ie=t.Function,Ae=t.Math,Re=t.Object,Ce=t.RegExp,Oe=t.String,we=t.TypeError,Ne=D.prototype,ke=Ie.prototype,De=Re.prototype,Pe=t["__core-js_shared__"],Me=ke.toString,Ue=De.hasOwnProperty,Le=0,xe=function(){var e=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=De.toString,Ve=Me.call(Re),je=ft._,Fe=Ce("^"+Me.call(Ue).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=_t?t.Buffer:r,ze=t.Symbol,He=t.Uint8Array,We=Ge?Ge.allocUnsafe:r,Ye=sr(Re.getPrototypeOf,Re),Ke=Re.create,Xe=De.propertyIsEnumerable,qe=Ne.splice,Je=ze?ze.isConcatSpreadable:r,Qe=ze?ze.iterator:r,tt=ze?ze.toStringTag:r,st=function(){try{var e=ho(Re,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,lt=ae&&ae.now!==ft.Date.now&&ae.now,ht=t.setTimeout!==ft.setTimeout&&t.setTimeout,pt=Ae.ceil,vt=Ae.floor,mt=Re.getOwnPropertySymbols,xt=Ge?Ge.isBuffer:r,Wt=t.isFinite,vr=Ne.join,mr=sr(Re.keys,Re),gr=Ae.max,yr=Ae.min,Er=ae.now,Sr=t.parseInt,br=Ae.random,Tr=Ne.reverse,Ir=ho(t,"DataView"),Ar=ho(t,"Map"),Rr=ho(t,"Promise"),Cr=ho(t,"Set"),Or=ho(t,"WeakMap"),wr=ho(Re,"create"),Nr=Or&&new Or,kr={},Dr=jo(Ir),Pr=jo(Ar),Mr=jo(Rr),Ur=jo(Cr),Lr=jo(Or),xr=ze?ze.prototype:r,Br=xr?xr.valueOf:r,Vr=xr?xr.toString:r;function jr(e){if(ns(e)&&!Ya(e)&&!(e instanceof Hr)){if(e instanceof zr)return e;if(Ue.call(e,"__wrapped__"))return Fo(e)}return new zr(e)}var Fr=function(){function e(){}return function(t){if(!rs(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Gr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Yr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Xr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Kr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new Yr(e);this.size=t.size}function Jr(e,t){var r=Ya(e),n=!r&&Wa(e),i=!r&&!n&&Ja(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Xt(e.length,Oe):[],c=s.length;for(var u in e)!t&&!Ue.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Eo(u,c))||s.push(u);return s}function Zr(e){var t=e.length;return t?e[qn(0,t-1)]:r}function $r(e,t){return xo(Ni(e),cn(t,0,e.length))}function Qr(e){return xo(Ni(e))}function en(e,t,n){(n!==r&&!Ga(e[t],n)||n===r&&!(t in e))&&an(e,t,n)}function tn(e,t,n){var i=e[t];Ue.call(e,t)&&Ga(i,n)&&(n!==r||t in e)||an(e,t,n)}function rn(e,t){for(var r=e.length;r--;)if(Ga(e[r][0],t))return r;return-1}function nn(e,t,r,n){return hn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function on(e,t){return e&&ki(t,Ps(t),e)}function an(e,t,r){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function sn(e,t){for(var n=-1,i=t.length,o=D(i),a=null==e;++n<i;)o[n]=a?r:Os(e,t[n]);return o}function cn(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,d=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!rs(e))return e;var l=Ya(e);if(l){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ue.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ni(e,s)}else{var f=vo(e),h=f==S||f==b;if(Ja(e))return Ii(e,c);if(f==A||f==v||h&&!o){if(s=u||h?{}:go(e),!c)return u?function(e,t){return ki(e,_o(e),t)}(e,function(e,t){return e&&ki(t,Ms(t),e)}(s,e)):function(e,t){return ki(e,po(e),t)}(e,on(s,e))}else{if(!at[f])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case P:return Ai(e);case g:case y:return new n(+e);case M:return function(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case U:case L:case x:case B:case V:case j:case F:case G:case z:return Ri(e,r);case T:return new n;case I:case w:return new n(e);case C:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new n;case N:return i=e,Br?Re(Br.call(i)):{}}var i}(e,f,c)}}a||(a=new qr);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):is(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var _=l?r:(d?u?oo:io:u?Ms:Ps)(e);return Rt(_||e,(function(r,i){_&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function dn(e,t,n){var i=n.length;if(null==e)return!i;for(e=Re(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function ln(e,t,i){if("function"!=typeof e)throw new we(n);return Po((function(){e.apply(r,i)}),t)}function fn(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Dt(t,Jt(r))),n?(o=kt,a=!1):t.length>=200&&(o=$t,a=!1,t=new Xr(t));e:for(;++i<s;){var d=e[i],l=null==r?d:r(d);if(d=n||0!==d?d:0,a&&l==l){for(var f=u;f--;)if(t[f]===l)continue e;c.push(d)}else o(t,l,n)||c.push(d)}return c}jr.templateSettings={escape:Z,evaluate:$,interpolate:Q,variable:"",imports:{_:jr}},jr.prototype=Gr.prototype,jr.prototype.constructor=jr,zr.prototype=Fr(Gr.prototype),zr.prototype.constructor=zr,Hr.prototype=Fr(Gr.prototype),Hr.prototype.constructor=Hr,Wr.prototype.clear=function(){this.__data__=wr?wr(null):{},this.size=0},Wr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wr.prototype.get=function(e){var t=this.__data__;if(wr){var n=t[e];return n===i?r:n}return Ue.call(t,e)?t[e]:r},Wr.prototype.has=function(e){var t=this.__data__;return wr?t[e]!==r:Ue.call(t,e)},Wr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wr&&t===r?i:t,this},Yr.prototype.clear=function(){this.__data__=[],this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0)&&(r==t.length-1?t.pop():qe.call(t,r,1),--this.size,!0)},Yr.prototype.get=function(e){var t=this.__data__,n=rn(t,e);return n<0?r:t[n][1]},Yr.prototype.has=function(e){return rn(this.__data__,e)>-1},Yr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Kr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ar||Yr),string:new Wr}},Kr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Kr.prototype.get=function(e){return lo(this,e).get(e)},Kr.prototype.has=function(e){return lo(this,e).has(e)},Kr.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(e){return this.__data__.set(e,i),this},Xr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new Yr,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Yr){var n=r.__data__;if(!Ar||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Kr(n)}return r.set(e,t),this.size=r.size,this};var hn=Mi(Sn),pn=Mi(bn,!0);function _n(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function vn(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(c===r?s==s&&!ds(s):n(s,c)))var c=s,u=a}return u}function mn(e,t){var r=[];return hn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function gn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?gn(s,t-1,r,n,i):Pt(i,s):n||(i[i.length]=s)}return i}var yn=Ui(),En=Ui(!0);function Sn(e,t){return e&&yn(e,t,Ps)}function bn(e,t){return e&&En(e,t,Ps)}function Tn(e,t){return wt(t,(function(t){return Qa(e[t])}))}function In(e,t){for(var n=0,i=(t=Ei(t,e)).length;null!=e&&n<i;)e=e[Vo(t[n++])];return n&&n==i?e:r}function An(e,t,r){var n=t(e);return Ya(e)?n:Pt(n,r(e))}function Rn(e){return null==e?e===r?"[object Undefined]":"[object Null]":tt&&tt in Re(e)?function(e){var t=Ue.call(e,tt),n=e[tt];try{e[tt]=r;var i=!0}catch(e){}var o=Be.call(e);i&&(t?e[tt]=n:delete e[tt]);return o}(e):function(e){return Be.call(e)}(e)}function Cn(e,t){return e>t}function On(e,t){return null!=e&&Ue.call(e,t)}function wn(e,t){return null!=e&&t in Re(e)}function Nn(e,t,n){for(var i=n?kt:Nt,o=e[0].length,a=e.length,s=a,c=D(a),u=1/0,d=[];s--;){var l=e[s];s&&t&&(l=Dt(l,Jt(t))),u=yr(l.length,u),c[s]=!n&&(t||o>=120&&l.length>=120)?new Xr(s&&l):r}l=e[0];var f=-1,h=c[0];e:for(;++f<o&&d.length<u;){var p=l[f],_=t?t(p):p;if(p=n||0!==p?p:0,!(h?$t(h,_):i(d,_,n))){for(s=a;--s;){var v=c[s];if(!(v?$t(v,_):i(e[s],_,n)))continue e}h&&h.push(_),d.push(p)}}return d}function kn(e,t,n){var i=null==(e=wo(e,t=Ei(t,e)))?e:e[Vo($o(t))];return null==i?r:It(i,e,n)}function Dn(e){return ns(e)&&Rn(e)==v}function Pn(e,t,n,i,o){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ya(e),c=Ya(t),u=s?m:vo(e),d=c?m:vo(t),l=(u=u==v?A:u)==A,f=(d=d==v?A:d)==A,h=u==d;if(h&&Ja(e)){if(!Ja(t))return!1;s=!0,l=!1}if(h&&!l)return a||(a=new qr),s||ls(e)?ro(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case g:case y:case I:return Ga(+e,+t);case E:return e.name==t.name&&e.message==t.message;case C:case w:return e==t+"";case T:var s=ar;case O:var c=1&n;if(s||(s=ur),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=ro(s(e),s(t),n,i,o,a);return a.delete(e),d;case N:if(Br)return Br.call(e)==Br.call(t)}return!1}(e,t,u,n,i,o,a);if(!(1&n)){var p=l&&Ue.call(e,"__wrapped__"),_=f&&Ue.call(t,"__wrapped__");if(p||_){var S=p?e.value():e,b=_?t.value():t;return a||(a=new qr),o(S,b,n,i,a)}}if(!h)return!1;return a||(a=new qr),function(e,t,n,i,o,a){var s=1&n,c=io(e),u=c.length,d=io(t).length;if(u!=d&&!s)return!1;var l=u;for(;l--;){var f=c[l];if(!(s?f in t:Ue.call(t,f)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var _=!0;a.set(e,t),a.set(t,e);var v=s;for(;++l<u;){var m=e[f=c[l]],g=t[f];if(i)var y=s?i(g,m,f,t,e,a):i(m,g,f,e,t,a);if(!(y===r?m===g||o(m,g,n,i,a):y)){_=!1;break}v||(v="constructor"==f)}if(_&&!v){var E=e.constructor,S=t.constructor;E==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof S&&S instanceof S||(_=!1)}return a.delete(e),a.delete(t),_}(e,t,n,i,o,a)}(e,t,n,i,Pn,o))}function Mn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Re(e);o--;){var c=n[o];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<a;){var u=(c=n[o])[0],d=e[u],l=c[1];if(s&&c[2]){if(d===r&&!(u in e))return!1}else{var f=new qr;if(i)var h=i(d,l,u,e,t,f);if(!(h===r?Pn(l,d,3,i,f):h))return!1}}return!0}function Un(e){return!(!rs(e)||(t=e,xe&&xe in t))&&(Qa(e)?Fe:me).test(jo(e));var t}function Ln(e){return"function"==typeof e?e:null==e?oc:"object"==typeof e?Ya(e)?Gn(e[0],e[1]):Fn(e):pc(e)}function xn(e){if(!Ao(e))return mr(e);var t=[];for(var r in Re(e))Ue.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Bn(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var r in Re(e))t.push(r);return t}(e);var t=Ao(e),r=[];for(var n in e)("constructor"!=n||!t&&Ue.call(e,n))&&r.push(n);return r}function Vn(e,t){return e<t}function jn(e,t){var r=-1,n=Xa(e)?D(e.length):[];return hn(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function Fn(e){var t=fo(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(r){return r===e||Mn(r,e,t)}}function Gn(e,t){return bo(e)&&Ro(t)?Co(Vo(e),t):function(n){var i=Os(n,e);return i===r&&i===t?ws(n,e):Pn(t,i,3)}}function zn(e,t,n,i,o){e!==t&&yn(t,(function(a,s){if(o||(o=new qr),rs(a))!function(e,t,n,i,o,a,s){var c=ko(e,n),u=ko(t,n),d=s.get(u);if(d)return void en(e,n,d);var l=a?a(c,u,n+"",e,t,s):r,f=l===r;if(f){var h=Ya(u),p=!h&&Ja(u),_=!h&&!p&&ls(u);l=u,h||p||_?Ya(c)?l=c:qa(c)?l=Ni(c):p?(f=!1,l=Ii(u,!0)):_?(f=!1,l=Ri(u,!0)):l=[]:as(u)||Wa(u)?(l=c,Wa(c)?l=ys(c):rs(c)&&!Qa(c)||(l=go(u))):f=!1}f&&(s.set(u,l),o(l,u,i,a,s),s.delete(u));en(e,n,l)}(e,t,s,n,zn,i,o);else{var c=i?i(ko(e,s),a,s+"",e,t,o):r;c===r&&(c=a),en(e,s,c)}}),Ms)}function Hn(e,t){var n=e.length;if(n)return Eo(t+=t<0?n:0,n)?e[t]:r}function Wn(e,t,r){t=t.length?Dt(t,(function(e){return Ya(e)?function(t){return In(t,1===e.length?e[0]:e)}:e})):[oc];var n=-1;t=Dt(t,Jt(uo()));var i=jn(e,(function(e,r,i){var o=Dt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;for(;++n<a;){var c=Ci(i[n],o[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Yn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=In(e,a);r(s,a)&&ei(o,Ei(a,e),s)}return o}function Kn(e,t,r,n){var i=n?Ft:jt,o=-1,a=t.length,s=e;for(e===t&&(t=Ni(t)),r&&(s=Dt(e,Jt(r)));++o<a;)for(var c=0,u=t[o],d=r?r(u):u;(c=i(s,d,c,n))>-1;)s!==e&&qe.call(s,c,1),qe.call(e,c,1);return e}function Xn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;Eo(i)?qe.call(e,i,1):fi(e,i)}}return e}function qn(e,t){return e+vt(br()*(t-e+1))}function Jn(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=vt(t/2))&&(e+=e)}while(t);return r}function Zn(e,t){return Mo(Oo(e,t,oc),e+"")}function $n(e){return Zr(Gs(e))}function Qn(e,t){var r=Gs(e);return xo(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!rs(e))return e;for(var o=-1,a=(t=Ei(t,e)).length,s=a-1,c=e;null!=c&&++o<a;){var u=Vo(t[o]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=s){var l=c[u];(d=i?i(l,u,c):r)===r&&(d=rs(l)?l:Eo(t[o+1])?[]:{})}tn(c,u,d),c=c[u]}return e}var ti=Nr?function(e,t){return Nr.set(e,t),e}:oc,ri=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:rc(t),writable:!0})}:oc;function ni(e){return xo(Gs(e))}function ii(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=D(i);++n<i;)o[n]=e[n+t];return o}function oi(e,t){var r;return hn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ai(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!ds(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return si(e,t,oc,r)}function si(e,t,n,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,c=null===t,u=ds(t),d=t===r;o<a;){var l=vt((o+a)/2),f=n(e[l]),h=f!==r,p=null===f,_=f==f,v=ds(f);if(s)var m=i||_;else m=d?_&&(i||h):c?_&&h&&(i||!p):u?_&&h&&!p&&(i||!v):!p&&!v&&(i?f<=t:f<t);m?o=l+1:a=l}return yr(a,4294967294)}function ci(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Ga(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function ui(e){return"number"==typeof e?e:ds(e)?h:+e}function di(e){if("string"==typeof e)return e;if(Ya(e))return Dt(e,di)+"";if(ds(e))return Vr?Vr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function li(e,t,r){var n=-1,i=Nt,o=e.length,a=!0,s=[],c=s;if(r)a=!1,i=kt;else if(o>=200){var u=t?null:Ji(e);if(u)return ur(u);a=!1,i=$t,c=new Xr}else c=t?[]:s;e:for(;++n<o;){var d=e[n],l=t?t(d):d;if(d=r||0!==d?d:0,a&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue e;t&&c.push(l),s.push(d)}else i(c,l,r)||(c!==s&&c.push(l),s.push(d))}return s}function fi(e,t){return null==(e=wo(e,t=Ei(t,e)))||delete e[Vo($o(t))]}function hi(e,t,r,n){return ei(e,t,r(In(e,t)),n)}function pi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ii(e,n?0:o,n?o+1:i):ii(e,n?o+1:0,n?i:o)}function _i(e,t){var r=e;return r instanceof Hr&&(r=r.value()),Mt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),r)}function vi(e,t,r){var n=e.length;if(n<2)return n?li(e[0]):[];for(var i=-1,o=D(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=fn(o[i]||a,e[s],t,r));return li(gn(o,1),t,r)}function mi(e,t,n){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var c=i<a?t[i]:r;n(s,e[i],c)}return s}function gi(e){return qa(e)?e:[]}function yi(e){return"function"==typeof e?e:oc}function Ei(e,t){return Ya(e)?e:bo(e,t)?[e]:Bo(Es(e))}var Si=Zn;function bi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ii(e,t,n)}var Ti=dt||function(e){return ft.clearTimeout(e)};function Ii(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function Ai(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Ri(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ds(e),s=t!==r,c=null===t,u=t==t,d=ds(t);if(!c&&!d&&!a&&e>t||a&&s&&u&&!c&&!d||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!d&&e<t||d&&n&&o&&!i&&!a||c&&n&&o||!s&&o||!u)return-1}return 0}function Oi(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,c=t.length,u=gr(o-a,0),d=D(c+u),l=!n;++s<c;)d[s]=t[s];for(;++i<a;)(l||i<o)&&(d[r[i]]=e[i]);for(;u--;)d[s++]=e[i++];return d}function wi(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,c=-1,u=t.length,d=gr(o-s,0),l=D(d+u),f=!n;++i<d;)l[i]=e[i];for(var h=i;++c<u;)l[h+c]=t[c];for(;++a<s;)(f||i<o)&&(l[h+r[a]]=e[i++]);return l}function Ni(e,t){var r=-1,n=e.length;for(t||(t=D(n));++r<n;)t[r]=e[r];return t}function ki(e,t,n,i){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=i?i(n[c],e[c],c,n,e):r;u===r&&(u=e[c]),o?an(n,c,u):tn(n,c,u)}return n}function Di(e,t){return function(r,n){var i=Ya(r)?At:nn,o=t?t():{};return i(r,e,uo(n,2),o)}}function Pi(e){return Zn((function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&So(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Re(t);++i<o;){var c=n[i];c&&e(t,c,i,a)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Xa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Re(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ui(e){return function(t,r,n){for(var i=-1,o=Re(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}function Li(e){return function(t){var n=or(t=Es(t))?fr(t):r,i=n?n[0]:t.charAt(0),o=n?bi(n,1).join(""):t.slice(1);return i[e]()+o}}function xi(e){return function(t){return Mt(Qs(Ws(t).replace(Ze,"")),e,"")}}function Bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return rs(n)?n:r}}function Vi(e){return function(t,n,i){var o=Re(t);if(!Xa(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[a?t[s]:s]:r}}function ji(e){return no((function(t){var i=t.length,o=i,a=zr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new we(n);if(a&&!c&&"wrapper"==so(s))var c=new zr([],!0)}for(o=c?o:i;++o<i;){var u=so(s=t[o]),d="wrapper"==u?ao(s):r;c=d&&To(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?c[so(d[0])].apply(c,d[3]):1==s.length&&To(s)?c[u]():c.thru(s)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&Ya(r))return c.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}}))}function Fi(e,t,n,i,o,a,s,c,d,l){var f=t&u,h=1&t,p=2&t,_=24&t,v=512&t,m=p?r:Bi(e);return function r(){for(var u=arguments.length,g=D(u),y=u;y--;)g[y]=arguments[y];if(_)var E=co(r),S=tr(g,E);if(i&&(g=Oi(g,i,o,_)),a&&(g=wi(g,a,s,_)),u-=S,_&&u<l){var b=cr(g,E);return Xi(e,t,Fi,r.placeholder,n,g,b,c,d,l-u)}var T=h?n:this,I=p?T[e]:e;return u=g.length,c?g=No(g,c):v&&u>1&&g.reverse(),f&&d<u&&(g.length=d),this&&this!==ft&&this instanceof r&&(I=m||Bi(I)),I.apply(T,g)}}function Gi(e,t){return function(r,n){return function(e,t,r,n){return Sn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function zi(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=di(n),i=di(i)):(n=ui(n),i=ui(i)),o=e(n,i)}return o}}function Hi(e){return no((function(t){return t=Dt(t,Jt(uo())),Zn((function(r){var n=this;return e(t,(function(e){return It(e,n,r)}))}))}))}function Wi(e,t){var n=(t=t===r?" ":di(t)).length;if(n<2)return n?Jn(t,e):t;var i=Jn(t,pt(e/lr(t)));return or(t)?bi(fr(i),0,e).join(""):i.slice(0,e)}function Yi(e){return function(t,n,i){return i&&"number"!=typeof i&&So(t,n,i)&&(n=i=r),t=_s(t),n===r?(n=t,t=0):n=_s(n),function(e,t,r,n){for(var i=-1,o=gr(pt((t-e)/(r||1)),0),a=D(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:_s(i),e)}}function Ki(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Xi(e,t,n,i,o,a,u,d,l,f){var h=8&t;t|=h?s:c,4&(t&=~(h?c:s))||(t&=-4);var p=[e,t,o,h?a:r,h?u:r,h?r:a,h?r:u,d,l,f],_=n.apply(r,p);return To(e)&&Do(_,p),_.placeholder=i,Uo(_,e,t)}function qi(e){var t=Ae[e];return function(e,r){if(e=gs(e),(r=null==r?0:yr(vs(r),292))&&Wt(e)){var n=(Es(e)+"e").split("e");return+((n=(Es(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Ji=Cr&&1/ur(new Cr([,-0]))[1]==l?function(e){return new Cr(e)}:dc;function Zi(e){return function(t){var r=vo(t);return r==T?ar(t):r==O?dr(t):function(e,t){return Dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function $i(e,t,i,l,f,h,p,_){var v=2&t;if(!v&&"function"!=typeof e)throw new we(n);var m=l?l.length:0;if(m||(t&=-97,l=f=r),p=p===r?p:gr(vs(p),0),_=_===r?_:vs(_),m-=f?f.length:0,t&c){var g=l,y=f;l=f=r}var E=v?r:ao(e),S=[e,t,i,l,f,g,y,h,p,_];if(E&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,s=n==u&&8==r||n==u&&r==d&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?Oi(l,c,t[4]):c,e[4]=l?cr(e[3],o):t[4]}(c=t[5])&&(l=e[5],e[5]=l?wi(l,c,t[6]):c,e[6]=l?cr(e[5],o):t[6]);(c=t[7])&&(e[7]=c);n&u&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(S,E),e=S[0],t=S[1],i=S[2],l=S[3],f=S[4],!(_=S[9]=S[9]===r?v?0:e.length:gr(S[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==a?function(e,t,n){var i=Bi(e);return function o(){for(var a=arguments.length,s=D(a),c=a,u=co(o);c--;)s[c]=arguments[c];var d=a<3&&s[0]!==u&&s[a-1]!==u?[]:cr(s,u);return(a-=d.length)<n?Xi(e,t,Fi,o.placeholder,r,s,d,r,r,n-a):It(this&&this!==ft&&this instanceof o?i:e,this,s)}}(e,t,_):t!=s&&33!=t||f.length?Fi.apply(r,S):function(e,t,r,n){var i=1&t,o=Bi(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=n.length,d=D(u+s),l=this&&this!==ft&&this instanceof t?o:e;++c<u;)d[c]=n[c];for(;s--;)d[c++]=arguments[++a];return It(l,i?r:this,d)}}(e,t,i,l);else var b=function(e,t,r){var n=1&t,i=Bi(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Uo((E?ti:Do)(b,S),e,t)}function Qi(e,t,n,i){return e===r||Ga(e,De[n])&&!Ue.call(i,n)?t:e}function eo(e,t,n,i,o,a){return rs(e)&&rs(t)&&(a.set(t,e),zn(e,t,r,eo,a),a.delete(t)),e}function to(e){return as(e)?r:e}function ro(e,t,n,i,o,a){var s=1&n,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var d=a.get(e),l=a.get(t);if(d&&l)return d==t&&l==e;var f=-1,h=!0,p=2&n?new Xr:r;for(a.set(e,t),a.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var m=s?i(v,_,f,t,e,a):i(_,v,f,e,t,a);if(m!==r){if(m)continue;h=!1;break}if(p){if(!Lt(t,(function(e,t){if(!$t(p,t)&&(_===e||o(_,e,n,i,a)))return p.push(t)}))){h=!1;break}}else if(_!==v&&!o(_,v,n,i,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function no(e){return Mo(Oo(e,r,Ko),e+"")}function io(e){return An(e,Ps,po)}function oo(e){return An(e,Ms,_o)}var ao=Nr?function(e){return Nr.get(e)}:dc;function so(e){for(var t=e.name+"",r=kr[t],n=Ue.call(kr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(Ue.call(jr,"placeholder")?jr:e).placeholder}function uo(){var e=jr.iteratee||ac;return e=e===ac?Ln:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function fo(e){for(var t=Ps(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ro(i)]}return t}function ho(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Un(n)?n:r}var po=mt?function(e){return null==e?[]:(e=Re(e),wt(mt(e),(function(t){return Xe.call(e,t)})))}:mc,_o=mt?function(e){for(var t=[];e;)Pt(t,po(e)),e=Ye(e);return t}:mc,vo=Rn;function mo(e,t,r){for(var n=-1,i=(t=Ei(t,e)).length,o=!1;++n<i;){var a=Vo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ts(i)&&Eo(a,i)&&(Ya(e)||Wa(e))}function go(e){return"function"!=typeof e.constructor||Ao(e)?{}:Fr(Ye(e))}function yo(e){return Ya(e)||Wa(e)||!!(Je&&e&&e[Je])}function Eo(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,r){if(!rs(r))return!1;var n=typeof t;return!!("number"==n?Xa(r)&&Eo(t,r.length):"string"==n&&t in r)&&Ga(r[t],e)}function bo(e,t){if(Ya(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ds(e))||(te.test(e)||!ee.test(e)||null!=t&&e in Re(t))}function To(e){var t=so(e),r=jr[t];if("function"!=typeof r||!(t in Hr.prototype))return!1;if(e===r)return!0;var n=ao(r);return!!n&&e===n[0]}(Ir&&vo(new Ir(new ArrayBuffer(1)))!=M||Ar&&vo(new Ar)!=T||Rr&&vo(Rr.resolve())!=R||Cr&&vo(new Cr)!=O||Or&&vo(new Or)!=k)&&(vo=function(e){var t=Rn(e),n=t==A?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Dr:return M;case Pr:return T;case Mr:return R;case Ur:return O;case Lr:return k}return t});var Io=Pe?Qa:gc;function Ao(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||De)}function Ro(e){return e==e&&!rs(e)}function Co(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Re(n)))}}function Oo(e,t,n){return t=gr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=gr(r.length-t,0),a=D(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=D(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),It(e,this,s)}}function wo(e,t){return t.length<2?e:In(e,ii(t,0,-1))}function No(e,t){for(var n=e.length,i=yr(t.length,n),o=Ni(e);i--;){var a=t[i];e[i]=Eo(a,n)?o[a]:r}return e}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Do=Lo(ti),Po=ht||function(e,t){return ft.setTimeout(e,t)},Mo=Lo(ri);function Uo(e,t,r){var n=t+"";return Mo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Rt(_,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function Lo(e){var t=0,n=0;return function(){var i=Er(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function xo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=qn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Bo=function(e){var t=La(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,r,n,i){t.push(n?i.replace(fe,"$1"):r||e)})),t}));function Vo(e){if("string"==typeof e||ds(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Hr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=Ni(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Go=Zn((function(e,t){return qa(e)?fn(e,gn(t,1,qa,!0)):[]})),zo=Zn((function(e,t){var n=$o(t);return qa(n)&&(n=r),qa(e)?fn(e,gn(t,1,qa,!0),uo(n,2)):[]})),Ho=Zn((function(e,t){var n=$o(t);return qa(n)&&(n=r),qa(e)?fn(e,gn(t,1,qa,!0),r,n):[]}));function Wo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=gr(n+i,0)),Vt(e,uo(t,3),i)}function Yo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=vs(n),o=n<0?gr(i+o,0):yr(o,i-1)),Vt(e,uo(t,3),o,!0)}function Ko(e){return(null==e?0:e.length)?gn(e,1):[]}function Xo(e){return e&&e.length?e[0]:r}var qo=Zn((function(e){var t=Dt(e,gi);return t.length&&t[0]===e[0]?Nn(t):[]})),Jo=Zn((function(e){var t=$o(e),n=Dt(e,gi);return t===$o(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Nn(n,uo(t,2)):[]})),Zo=Zn((function(e){var t=$o(e),n=Dt(e,gi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Nn(n,r,t):[]}));function $o(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Qo=Zn(ea);function ea(e,t){return e&&e.length&&t&&t.length?Kn(e,t):e}var ta=no((function(e,t){var r=null==e?0:e.length,n=sn(e,t);return Xn(e,Dt(t,(function(e){return Eo(e,r)?+e:e})).sort(Ci)),n}));function ra(e){return null==e?e:Tr.call(e)}var na=Zn((function(e){return li(gn(e,1,qa,!0))})),ia=Zn((function(e){var t=$o(e);return qa(t)&&(t=r),li(gn(e,1,qa,!0),uo(t,2))})),oa=Zn((function(e){var t=$o(e);return t="function"==typeof t?t:r,li(gn(e,1,qa,!0),r,t)}));function aa(e){if(!e||!e.length)return[];var t=0;return e=wt(e,(function(e){if(qa(e))return t=gr(e.length,t),!0})),Xt(t,(function(t){return Dt(e,Ht(t))}))}function sa(e,t){if(!e||!e.length)return[];var n=aa(e);return null==t?n:Dt(n,(function(e){return It(t,r,e)}))}var ca=Zn((function(e,t){return qa(e)?fn(e,t):[]})),ua=Zn((function(e){return vi(wt(e,qa))})),da=Zn((function(e){var t=$o(e);return qa(t)&&(t=r),vi(wt(e,qa),uo(t,2))})),la=Zn((function(e){var t=$o(e);return t="function"==typeof t?t:r,vi(wt(e,qa),r,t)})),fa=Zn(aa);var ha=Zn((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,sa(e,n)}));function pa(e){var t=jr(e);return t.__chain__=!0,t}function _a(e,t){return t(e)}var va=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&Eo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:_a,args:[o],thisArg:r}),new zr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ma=Di((function(e,t,r){Ue.call(e,r)?++e[r]:an(e,r,1)}));var ga=Vi(Wo),ya=Vi(Yo);function Ea(e,t){return(Ya(e)?Rt:hn)(e,uo(t,3))}function Sa(e,t){return(Ya(e)?Ct:pn)(e,uo(t,3))}var ba=Di((function(e,t,r){Ue.call(e,r)?e[r].push(t):an(e,r,[t])}));var Ta=Zn((function(e,t,r){var n=-1,i="function"==typeof t,o=Xa(e)?D(e.length):[];return hn(e,(function(e){o[++n]=i?It(t,e,r):kn(e,t,r)})),o})),Ia=Di((function(e,t,r){an(e,r,t)}));function Aa(e,t){return(Ya(e)?Dt:jn)(e,uo(t,3))}var Ra=Di((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ca=Zn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&So(e,t[0],t[1])?t=[]:r>2&&So(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,gn(t,1),[])})),Oa=lt||function(){return ft.Date.now()};function wa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,$i(e,u,r,r,r,r,t)}function Na(e,t){var i;if("function"!=typeof t)throw new we(n);return e=vs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var ka=Zn((function(e,t,r){var n=1;if(r.length){var i=cr(r,co(ka));n|=s}return $i(e,n,t,r,i)})),Da=Zn((function(e,t,r){var n=3;if(r.length){var i=cr(r,co(Da));n|=s}return $i(t,n,e,r,i)}));function Pa(e,t,i){var o,a,s,c,u,d,l=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new we(n);function _(t){var n=o,i=a;return o=a=r,l=t,c=e.apply(i,n)}function v(e){return l=e,u=Po(g,t),f?_(e):c}function m(e){var n=e-d;return d===r||n>=t||n<0||h&&e-l>=s}function g(){var e=Oa();if(m(e))return y(e);u=Po(g,function(e){var r=t-(e-d);return h?yr(r,s-(e-l)):r}(e))}function y(e){return u=r,p&&o?_(e):(o=a=r,c)}function E(){var e=Oa(),n=m(e);if(o=arguments,a=this,d=e,n){if(u===r)return v(d);if(h)return Ti(u),u=Po(g,t),_(d)}return u===r&&(u=Po(g,t)),c}return t=gs(t)||0,rs(i)&&(f=!!i.leading,s=(h="maxWait"in i)?gr(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),E.cancel=function(){u!==r&&Ti(u),l=0,o=d=a=u=r},E.flush=function(){return u===r?c:y(Oa())},E}var Ma=Zn((function(e,t){return ln(e,1,t)})),Ua=Zn((function(e,t,r){return ln(e,gs(t)||0,r)}));function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new we(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(La.Cache||Kr),r}function xa(e){if("function"!=typeof e)throw new we(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=Kr;var Ba=Si((function(e,t){var r=(t=1==t.length&&Ya(t[0])?Dt(t[0],Jt(uo())):Dt(gn(t,1),Jt(uo()))).length;return Zn((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return It(e,this,n)}))})),Va=Zn((function(e,t){var n=cr(t,co(Va));return $i(e,s,r,t,n)})),ja=Zn((function(e,t){var n=cr(t,co(ja));return $i(e,c,r,t,n)})),Fa=no((function(e,t){return $i(e,d,r,r,r,t)}));function Ga(e,t){return e===t||e!=e&&t!=t}var za=Ki(Cn),Ha=Ki((function(e,t){return e>=t})),Wa=Dn(function(){return arguments}())?Dn:function(e){return ns(e)&&Ue.call(e,"callee")&&!Xe.call(e,"callee")},Ya=D.isArray,Ka=gt?Jt(gt):function(e){return ns(e)&&Rn(e)==P};function Xa(e){return null!=e&&ts(e.length)&&!Qa(e)}function qa(e){return ns(e)&&Xa(e)}var Ja=xt||gc,Za=yt?Jt(yt):function(e){return ns(e)&&Rn(e)==y};function $a(e){if(!ns(e))return!1;var t=Rn(e);return t==E||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Qa(e){if(!rs(e))return!1;var t=Rn(e);return t==S||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function es(e){return"number"==typeof e&&e==vs(e)}function ts(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var is=Et?Jt(Et):function(e){return ns(e)&&vo(e)==T};function os(e){return"number"==typeof e||ns(e)&&Rn(e)==I}function as(e){if(!ns(e)||Rn(e)!=A)return!1;var t=Ye(e);if(null===t)return!0;var r=Ue.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Ve}var ss=St?Jt(St):function(e){return ns(e)&&Rn(e)==C};var cs=bt?Jt(bt):function(e){return ns(e)&&vo(e)==O};function us(e){return"string"==typeof e||!Ya(e)&&ns(e)&&Rn(e)==w}function ds(e){return"symbol"==typeof e||ns(e)&&Rn(e)==N}var ls=Tt?Jt(Tt):function(e){return ns(e)&&ts(e.length)&&!!ot[Rn(e)]};var fs=Ki(Vn),hs=Ki((function(e,t){return e<=t}));function ps(e){if(!e)return[];if(Xa(e))return us(e)?fr(e):Ni(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=vo(e);return(t==T?ar:t==O?ur:Gs)(e)}function _s(e){return e?(e=gs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=_s(e),r=t%1;return t==t?r?t-r:t:0}function ms(e){return e?cn(vs(e),0,p):0}function gs(e){if("number"==typeof e)return e;if(ds(e))return h;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var r=ve.test(e);return r||ge.test(e)?ut(e.slice(2),r?2:8):_e.test(e)?h:+e}function ys(e){return ki(e,Ms(e))}function Es(e){return null==e?"":di(e)}var Ss=Pi((function(e,t){if(Ao(t)||Xa(t))ki(t,Ps(t),e);else for(var r in t)Ue.call(t,r)&&tn(e,r,t[r])})),bs=Pi((function(e,t){ki(t,Ms(t),e)})),Ts=Pi((function(e,t,r,n){ki(t,Ms(t),e,n)})),Is=Pi((function(e,t,r,n){ki(t,Ps(t),e,n)})),As=no(sn);var Rs=Zn((function(e,t){e=Re(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&So(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Ms(a),c=-1,u=s.length;++c<u;){var d=s[c],l=e[d];(l===r||Ga(l,De[d])&&!Ue.call(e,d))&&(e[d]=a[d])}return e})),Cs=Zn((function(e){return e.push(r,eo),It(Ls,r,e)}));function Os(e,t,n){var i=null==e?r:In(e,t);return i===r?n:i}function ws(e,t){return null!=e&&mo(e,t,wn)}var Ns=Gi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),e[t]=r}),rc(oc)),ks=Gi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),Ue.call(e,t)?e[t].push(r):e[t]=[r]}),uo),Ds=Zn(kn);function Ps(e){return Xa(e)?Jr(e):xn(e)}function Ms(e){return Xa(e)?Jr(e,!0):Bn(e)}var Us=Pi((function(e,t,r){zn(e,t,r)})),Ls=Pi((function(e,t,r,n){zn(e,t,r,n)})),xs=no((function(e,t){var r={};if(null==e)return r;var n=!1;t=Dt(t,(function(t){return t=Ei(t,e),n||(n=t.length>1),t})),ki(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)fi(r,t[i]);return r}));var Bs=no((function(e,t){return null==e?{}:function(e,t){return Yn(e,t,(function(t,r){return ws(e,r)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var r=Dt(oo(e),(function(e){return[e]}));return t=uo(t),Yn(e,r,(function(e,r){return t(e,r[0])}))}var js=Zi(Ps),Fs=Zi(Ms);function Gs(e){return null==e?[]:Zt(e,Ps(e))}var zs=xi((function(e,t,r){return t=t.toLowerCase(),e+(r?Hs(t):t)}));function Hs(e){return $s(Es(e).toLowerCase())}function Ws(e){return(e=Es(e))&&e.replace(Ee,rr).replace($e,"")}var Ys=xi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ks=xi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Xs=Li("toLowerCase");var qs=xi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Js=xi((function(e,t,r){return e+(r?" ":"")+$s(t)}));var Zs=xi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$s=Li("toUpperCase");function Qs(e,t,n){return e=Es(e),(t=n?r:t)===r?function(e){return rt.test(e)}(e)?function(e){return e.match(et)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var ec=Zn((function(e,t){try{return It(e,r,t)}catch(e){return $a(e)?e:new Te(e)}})),tc=no((function(e,t){return Rt(t,(function(t){t=Vo(t),an(e,t,ka(e[t],e))})),e}));function rc(e){return function(){return e}}var nc=ji(),ic=ji(!0);function oc(e){return e}function ac(e){return Ln("function"==typeof e?e:un(e,1))}var sc=Zn((function(e,t){return function(r){return kn(r,e,t)}})),cc=Zn((function(e,t){return function(r){return kn(e,r,t)}}));function uc(e,t,r){var n=Ps(t),i=Tn(t,n);null!=r||rs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Tn(t,Ps(t)));var o=!(rs(r)&&"chain"in r&&!r.chain),a=Qa(e);return Rt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=Ni(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})})),e}function dc(){}var lc=Hi(Dt),fc=Hi(Ot),hc=Hi(Lt);function pc(e){return bo(e)?Ht(Vo(e)):function(e){return function(t){return In(t,e)}}(e)}var _c=Yi(),vc=Yi(!0);function mc(){return[]}function gc(){return!1}var yc=zi((function(e,t){return e+t}),0),Ec=qi("ceil"),Sc=zi((function(e,t){return e/t}),1),bc=qi("floor");var Tc,Ic=zi((function(e,t){return e*t}),1),Ac=qi("round"),Rc=zi((function(e,t){return e-t}),0);return jr.after=function(e,t){if("function"!=typeof t)throw new we(n);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},jr.ary=wa,jr.assign=Ss,jr.assignIn=bs,jr.assignInWith=Ts,jr.assignWith=Is,jr.at=As,jr.before=Na,jr.bind=ka,jr.bindAll=tc,jr.bindKey=Da,jr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},jr.chain=pa,jr.chunk=function(e,t,n){t=(n?So(e,t,n):t===r)?1:gr(vs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=D(pt(i/t));o<i;)s[a++]=ii(e,o,o+=t);return s},jr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},jr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=D(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Pt(Ya(r)?Ni(r):[r],gn(t,1))},jr.cond=function(e){var t=null==e?0:e.length,r=uo();return e=t?Dt(e,(function(e){if("function"!=typeof e[1])throw new we(n);return[r(e[0]),e[1]]})):[],Zn((function(r){for(var n=-1;++n<t;){var i=e[n];if(It(i[0],this,r))return It(i[1],this,r)}}))},jr.conforms=function(e){return function(e){var t=Ps(e);return function(r){return dn(r,e,t)}}(un(e,1))},jr.constant=rc,jr.countBy=ma,jr.create=function(e,t){var r=Fr(e);return null==t?r:on(r,t)},jr.curry=function e(t,n,i){var o=$i(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},jr.curryRight=function e(t,n,i){var o=$i(t,a,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},jr.debounce=Pa,jr.defaults=Rs,jr.defaultsDeep=Cs,jr.defer=Ma,jr.delay=Ua,jr.difference=Go,jr.differenceBy=zo,jr.differenceWith=Ho,jr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=n||t===r?1:vs(t))<0?0:t,i):[]},jr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,0,(t=i-(t=n||t===r?1:vs(t)))<0?0:t):[]},jr.dropRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0,!0):[]},jr.dropWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0):[]},jr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&So(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=vs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:vs(i))<0&&(i+=o),i=n>i?0:ms(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},jr.filter=function(e,t){return(Ya(e)?wt:mn)(e,uo(t,3))},jr.flatMap=function(e,t){return gn(Aa(e,t),1)},jr.flatMapDeep=function(e,t){return gn(Aa(e,t),l)},jr.flatMapDepth=function(e,t,n){return n=n===r?1:vs(n),gn(Aa(e,t),n)},jr.flatten=Ko,jr.flattenDeep=function(e){return(null==e?0:e.length)?gn(e,l):[]},jr.flattenDepth=function(e,t){return(null==e?0:e.length)?gn(e,t=t===r?1:vs(t)):[]},jr.flip=function(e){return $i(e,512)},jr.flow=nc,jr.flowRight=ic,jr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},jr.functions=function(e){return null==e?[]:Tn(e,Ps(e))},jr.functionsIn=function(e){return null==e?[]:Tn(e,Ms(e))},jr.groupBy=ba,jr.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},jr.intersection=qo,jr.intersectionBy=Jo,jr.intersectionWith=Zo,jr.invert=Ns,jr.invertBy=ks,jr.invokeMap=Ta,jr.iteratee=ac,jr.keyBy=Ia,jr.keys=Ps,jr.keysIn=Ms,jr.map=Aa,jr.mapKeys=function(e,t){var r={};return t=uo(t,3),Sn(e,(function(e,n,i){an(r,t(e,n,i),e)})),r},jr.mapValues=function(e,t){var r={};return t=uo(t,3),Sn(e,(function(e,n,i){an(r,n,t(e,n,i))})),r},jr.matches=function(e){return Fn(un(e,1))},jr.matchesProperty=function(e,t){return Gn(e,un(t,1))},jr.memoize=La,jr.merge=Us,jr.mergeWith=Ls,jr.method=sc,jr.methodOf=cc,jr.mixin=uc,jr.negate=xa,jr.nthArg=function(e){return e=vs(e),Zn((function(t){return Hn(t,e)}))},jr.omit=xs,jr.omitBy=function(e,t){return Vs(e,xa(uo(t)))},jr.once=function(e){return Na(2,e)},jr.orderBy=function(e,t,n,i){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=i?r:n)||(n=null==n?[]:[n]),Wn(e,t,n))},jr.over=lc,jr.overArgs=Ba,jr.overEvery=fc,jr.overSome=hc,jr.partial=Va,jr.partialRight=ja,jr.partition=Ra,jr.pick=Bs,jr.pickBy=Vs,jr.property=pc,jr.propertyOf=function(e){return function(t){return null==e?r:In(e,t)}},jr.pull=Qo,jr.pullAll=ea,jr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Kn(e,t,uo(r,2)):e},jr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Kn(e,t,r,n):e},jr.pullAt=ta,jr.range=_c,jr.rangeRight=vc,jr.rearg=Fa,jr.reject=function(e,t){return(Ya(e)?wt:mn)(e,xa(uo(t,3)))},jr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=uo(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Xn(e,i),r},jr.rest=function(e,t){if("function"!=typeof e)throw new we(n);return Zn(e,t=t===r?t:vs(t))},jr.reverse=ra,jr.sampleSize=function(e,t,n){return t=(n?So(e,t,n):t===r)?1:vs(t),(Ya(e)?$r:Qn)(e,t)},jr.set=function(e,t,r){return null==e?e:ei(e,t,r)},jr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ei(e,t,n,i)},jr.shuffle=function(e){return(Ya(e)?Qr:ni)(e)},jr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&So(e,t,n)?(t=0,n=i):(t=null==t?0:vs(t),n=n===r?i:vs(n)),ii(e,t,n)):[]},jr.sortBy=Ca,jr.sortedUniq=function(e){return e&&e.length?ci(e):[]},jr.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},jr.split=function(e,t,n){return n&&"number"!=typeof n&&So(e,t,n)&&(t=n=r),(n=n===r?p:n>>>0)?(e=Es(e))&&("string"==typeof t||null!=t&&!ss(t))&&!(t=di(t))&&or(e)?bi(fr(e),0,n):e.split(t,n):[]},jr.spread=function(e,t){if("function"!=typeof e)throw new we(n);return t=null==t?0:gr(vs(t),0),Zn((function(r){var n=r[t],i=bi(r,0,t);return n&&Pt(i,n),It(e,this,i)}))},jr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},jr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:vs(t))<0?0:t):[]},jr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:vs(t)))<0?0:t,i):[]},jr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},jr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},jr.tap=function(e,t){return t(e),e},jr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new we(n);return rs(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Pa(e,t,{leading:i,maxWait:t,trailing:o})},jr.thru=_a,jr.toArray=ps,jr.toPairs=js,jr.toPairsIn=Fs,jr.toPath=function(e){return Ya(e)?Dt(e,Vo):ds(e)?[e]:Ni(Bo(Es(e)))},jr.toPlainObject=ys,jr.transform=function(e,t,r){var n=Ya(e),i=n||Ja(e)||ls(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:rs(e)&&Qa(o)?Fr(Ye(e)):{}}return(i?Rt:Sn)(e,(function(e,n,i){return t(r,e,n,i)})),r},jr.unary=function(e){return wa(e,1)},jr.union=na,jr.unionBy=ia,jr.unionWith=oa,jr.uniq=function(e){return e&&e.length?li(e):[]},jr.uniqBy=function(e,t){return e&&e.length?li(e,uo(t,2)):[]},jr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?li(e,r,t):[]},jr.unset=function(e,t){return null==e||fi(e,t)},jr.unzip=aa,jr.unzipWith=sa,jr.update=function(e,t,r){return null==e?e:hi(e,t,yi(r))},jr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,yi(n),i)},jr.values=Gs,jr.valuesIn=function(e){return null==e?[]:Zt(e,Ms(e))},jr.without=ca,jr.words=Qs,jr.wrap=function(e,t){return Va(yi(t),e)},jr.xor=ua,jr.xorBy=da,jr.xorWith=la,jr.zip=fa,jr.zipObject=function(e,t){return mi(e||[],t||[],tn)},jr.zipObjectDeep=function(e,t){return mi(e||[],t||[],ei)},jr.zipWith=ha,jr.entries=js,jr.entriesIn=Fs,jr.extend=bs,jr.extendWith=Ts,uc(jr,jr),jr.add=yc,jr.attempt=ec,jr.camelCase=zs,jr.capitalize=Hs,jr.ceil=Ec,jr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=gs(n))==n?n:0),t!==r&&(t=(t=gs(t))==t?t:0),cn(gs(e),t,n)},jr.clone=function(e){return un(e,4)},jr.cloneDeep=function(e){return un(e,5)},jr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},jr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},jr.conformsTo=function(e,t){return null==t||dn(e,t,Ps(t))},jr.deburr=Ws,jr.defaultTo=function(e,t){return null==e||e!=e?t:e},jr.divide=Sc,jr.endsWith=function(e,t,n){e=Es(e),t=di(t);var i=e.length,o=n=n===r?i:cn(vs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},jr.eq=Ga,jr.escape=function(e){return(e=Es(e))&&J.test(e)?e.replace(X,nr):e},jr.escapeRegExp=function(e){return(e=Es(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},jr.every=function(e,t,n){var i=Ya(e)?Ot:_n;return n&&So(e,t,n)&&(t=r),i(e,uo(t,3))},jr.find=ga,jr.findIndex=Wo,jr.findKey=function(e,t){return Bt(e,uo(t,3),Sn)},jr.findLast=ya,jr.findLastIndex=Yo,jr.findLastKey=function(e,t){return Bt(e,uo(t,3),bn)},jr.floor=bc,jr.forEach=Ea,jr.forEachRight=Sa,jr.forIn=function(e,t){return null==e?e:yn(e,uo(t,3),Ms)},jr.forInRight=function(e,t){return null==e?e:En(e,uo(t,3),Ms)},jr.forOwn=function(e,t){return e&&Sn(e,uo(t,3))},jr.forOwnRight=function(e,t){return e&&bn(e,uo(t,3))},jr.get=Os,jr.gt=za,jr.gte=Ha,jr.has=function(e,t){return null!=e&&mo(e,t,On)},jr.hasIn=ws,jr.head=Xo,jr.identity=oc,jr.includes=function(e,t,r,n){e=Xa(e)?e:Gs(e),r=r&&!n?vs(r):0;var i=e.length;return r<0&&(r=gr(i+r,0)),us(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&jt(e,t,r)>-1},jr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=gr(n+i,0)),jt(e,t,i)},jr.inRange=function(e,t,n){return t=_s(t),n===r?(n=t,t=0):n=_s(n),function(e,t,r){return e>=yr(t,r)&&e<gr(t,r)}(e=gs(e),t,n)},jr.invoke=Ds,jr.isArguments=Wa,jr.isArray=Ya,jr.isArrayBuffer=Ka,jr.isArrayLike=Xa,jr.isArrayLikeObject=qa,jr.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Rn(e)==g},jr.isBuffer=Ja,jr.isDate=Za,jr.isElement=function(e){return ns(e)&&1===e.nodeType&&!as(e)},jr.isEmpty=function(e){if(null==e)return!0;if(Xa(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||Ja(e)||ls(e)||Wa(e)))return!e.length;var t=vo(e);if(t==T||t==O)return!e.size;if(Ao(e))return!xn(e).length;for(var r in e)if(Ue.call(e,r))return!1;return!0},jr.isEqual=function(e,t){return Pn(e,t)},jr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Pn(e,t,r,n):!!i},jr.isError=$a,jr.isFinite=function(e){return"number"==typeof e&&Wt(e)},jr.isFunction=Qa,jr.isInteger=es,jr.isLength=ts,jr.isMap=is,jr.isMatch=function(e,t){return e===t||Mn(e,t,fo(t))},jr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Mn(e,t,fo(t),n)},jr.isNaN=function(e){return os(e)&&e!=+e},jr.isNative=function(e){if(Io(e))throw new Te("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Un(e)},jr.isNil=function(e){return null==e},jr.isNull=function(e){return null===e},jr.isNumber=os,jr.isObject=rs,jr.isObjectLike=ns,jr.isPlainObject=as,jr.isRegExp=ss,jr.isSafeInteger=function(e){return es(e)&&e>=-9007199254740991&&e<=f},jr.isSet=cs,jr.isString=us,jr.isSymbol=ds,jr.isTypedArray=ls,jr.isUndefined=function(e){return e===r},jr.isWeakMap=function(e){return ns(e)&&vo(e)==k},jr.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Rn(e)},jr.join=function(e,t){return null==e?"":vr.call(e,t)},jr.kebabCase=Ys,jr.last=$o,jr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=vs(n))<0?gr(i+o,0):yr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Vt(e,Gt,o,!0)},jr.lowerCase=Ks,jr.lowerFirst=Xs,jr.lt=fs,jr.lte=hs,jr.max=function(e){return e&&e.length?vn(e,oc,Cn):r},jr.maxBy=function(e,t){return e&&e.length?vn(e,uo(t,2),Cn):r},jr.mean=function(e){return zt(e,oc)},jr.meanBy=function(e,t){return zt(e,uo(t,2))},jr.min=function(e){return e&&e.length?vn(e,oc,Vn):r},jr.minBy=function(e,t){return e&&e.length?vn(e,uo(t,2),Vn):r},jr.stubArray=mc,jr.stubFalse=gc,jr.stubObject=function(){return{}},jr.stubString=function(){return""},jr.stubTrue=function(){return!0},jr.multiply=Ic,jr.nth=function(e,t){return e&&e.length?Hn(e,vs(t)):r},jr.noConflict=function(){return ft._===this&&(ft._=je),this},jr.noop=dc,jr.now=Oa,jr.pad=function(e,t,r){e=Es(e);var n=(t=vs(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(vt(i),r)+e+Wi(pt(i),r)},jr.padEnd=function(e,t,r){e=Es(e);var n=(t=vs(t))?lr(e):0;return t&&n<t?e+Wi(t-n,r):e},jr.padStart=function(e,t,r){e=Es(e);var n=(t=vs(t))?lr(e):0;return t&&n<t?Wi(t-n,r)+e:e},jr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),Sr(Es(e).replace(oe,""),t||0)},jr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&So(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=_s(e),t===r?(t=e,e=0):t=_s(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=br();return yr(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return qn(e,t)},jr.reduce=function(e,t,r){var n=Ya(e)?Mt:Yt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},jr.reduceRight=function(e,t,r){var n=Ya(e)?Ut:Yt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},jr.repeat=function(e,t,n){return t=(n?So(e,t,n):t===r)?1:vs(t),Jn(Es(e),t)},jr.replace=function(){var e=arguments,t=Es(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jr.result=function(e,t,n){var i=-1,o=(t=Ei(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[Vo(t[i])];a===r&&(i=o,a=n),e=Qa(a)?a.call(e):a}return e},jr.round=Ac,jr.runInContext=e,jr.sample=function(e){return(Ya(e)?Zr:$n)(e)},jr.size=function(e){if(null==e)return 0;if(Xa(e))return us(e)?lr(e):e.length;var t=vo(e);return t==T||t==O?e.size:xn(e).length},jr.snakeCase=qs,jr.some=function(e,t,n){var i=Ya(e)?Lt:oi;return n&&So(e,t,n)&&(t=r),i(e,uo(t,3))},jr.sortedIndex=function(e,t){return ai(e,t)},jr.sortedIndexBy=function(e,t,r){return si(e,t,uo(r,2))},jr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ai(e,t);if(n<r&&Ga(e[n],t))return n}return-1},jr.sortedLastIndex=function(e,t){return ai(e,t,!0)},jr.sortedLastIndexBy=function(e,t,r){return si(e,t,uo(r,2),!0)},jr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=ai(e,t,!0)-1;if(Ga(e[r],t))return r}return-1},jr.startCase=Js,jr.startsWith=function(e,t,r){return e=Es(e),r=null==r?0:cn(vs(r),0,e.length),t=di(t),e.slice(r,r+t.length)==t},jr.subtract=Rc,jr.sum=function(e){return e&&e.length?Kt(e,oc):0},jr.sumBy=function(e,t){return e&&e.length?Kt(e,uo(t,2)):0},jr.template=function(e,t,n){var i=jr.templateSettings;n&&So(e,t,n)&&(t=r),e=Es(e),t=Ts({},t,i,Qi);var o,a,s=Ts({},t.imports,i.imports,Qi),c=Ps(s),u=Zt(s,c),d=0,l=t.interpolate||Se,f="__p += '",h=Ce((t.escape||Se).source+"|"+l.source+"|"+(l===Q?he:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),p="//# sourceURL="+(Ue.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";e.replace(h,(function(t,r,n,i,s,c){return n||(n=i),f+=e.slice(d,c).replace(be,ir),r&&(o=!0,f+="' +\n__e("+r+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=c+t.length,t})),f+="';\n";var _=Ue.call(t,"variable")&&t.variable;if(_){if(le.test(_))throw new Te("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(H,""):f).replace(W,"$1").replace(Y,"$1;"),f="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=ec((function(){return Ie(c,p+"return "+f).apply(r,u)}));if(v.source=f,$a(v))throw v;return v},jr.times=function(e,t){if((e=vs(e))<1||e>f)return[];var r=p,n=yr(e,p);t=uo(t),e-=p;for(var i=Xt(n,t);++r<e;)t(r);return i},jr.toFinite=_s,jr.toInteger=vs,jr.toLength=ms,jr.toLower=function(e){return Es(e).toLowerCase()},jr.toNumber=gs,jr.toSafeInteger=function(e){return e?cn(vs(e),-9007199254740991,f):0===e?e:0},jr.toString=Es,jr.toUpper=function(e){return Es(e).toUpperCase()},jr.trim=function(e,t,n){if((e=Es(e))&&(n||t===r))return qt(e);if(!e||!(t=di(t)))return e;var i=fr(e),o=fr(t);return bi(i,Qt(i,o),er(i,o)+1).join("")},jr.trimEnd=function(e,t,n){if((e=Es(e))&&(n||t===r))return e.slice(0,hr(e)+1);if(!e||!(t=di(t)))return e;var i=fr(e);return bi(i,0,er(i,fr(t))+1).join("")},jr.trimStart=function(e,t,n){if((e=Es(e))&&(n||t===r))return e.replace(oe,"");if(!e||!(t=di(t)))return e;var i=fr(e);return bi(i,Qt(i,fr(t))).join("")},jr.truncate=function(e,t){var n=30,i="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?vs(t.length):n,i="omission"in t?di(t.omission):i}var a=(e=Es(e)).length;if(or(e)){var s=fr(e);a=s.length}if(n>=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?bi(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),ss(o)){if(e.slice(c).search(o)){var d,l=u;for(o.global||(o=Ce(o.source,Es(pe.exec(o))+"g")),o.lastIndex=0;d=o.exec(l);)var f=d.index;u=u.slice(0,f===r?c:f)}}else if(e.indexOf(di(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},jr.unescape=function(e){return(e=Es(e))&&q.test(e)?e.replace(K,pr):e},jr.uniqueId=function(e){var t=++Le;return Es(e)+t},jr.upperCase=Zs,jr.upperFirst=$s,jr.each=Ea,jr.eachRight=Sa,jr.first=Xo,uc(jr,(Tc={},Sn(jr,(function(e,t){Ue.call(jr.prototype,t)||(Tc[t]=e)})),Tc),{chain:!1}),jr.VERSION="4.17.21",Rt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){jr[e].placeholder=jr})),Rt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:gr(vs(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=yr(n,i.__takeCount__):i.__views__.push({size:yr(n,p),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Rt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Rt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Rt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(oc)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Zn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return kn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(xa(uo(e)))},Hr.prototype.slice=function(e,t){e=vs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=vs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(p)},Sn(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=jr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(jr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],d=c||Ya(t),l=function(e){var t=o.apply(jr,Pt([e],s));return i&&f?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(c=d=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,_=c&&!h;if(!a&&d){t=_?t:new Hr(this);var v=e.apply(t,s);return v.__actions__.push({func:_a,args:[l],thisArg:r}),new zr(v,f)}return p&&_?e.apply(this,s):(v=this.thru(l),p?i?v.value()[0]:v.value():v)})})),Rt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);jr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[r]((function(r){return t.apply(Ya(r)?r:[],e)}))}})),Sn(Hr.prototype,(function(e,t){var r=jr[t];if(r){var n=r.name+"";Ue.call(kr,n)||(kr[n]=[]),kr[n].push({name:t,func:r})}})),kr[Fi(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ya(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=yr(t,e+a);break;case"takeRight":e=gr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,u=n?s:a-1,d=this.__iteratees__,l=d.length,f=0,h=yr(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return _i(e,this.__actions__);var p=[];e:for(;c--&&f<h;){for(var _=-1,v=e[u+=t];++_<l;){var m=d[_],g=m.iteratee,y=m.type,E=g(v);if(2==y)v=E;else if(!E){if(1==y)continue e;break e}}p[f++]=v}return p},jr.prototype.at=va,jr.prototype.chain=function(){return pa(this)},jr.prototype.commit=function(){return new zr(this.value(),this.__chain__)},jr.prototype.next=function(){this.__values__===r&&(this.__values__=ps(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},jr.prototype.plant=function(e){for(var t,n=this;n instanceof Gr;){var i=Fo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},jr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:_a,args:[ra],thisArg:r}),new zr(t,this.__chain__)}return this.thru(ra)},jr.prototype.toJSON=jr.prototype.valueOf=jr.prototype.value=function(){return _i(this.__wrapped__,this.__actions__)},jr.prototype.first=jr.prototype.head,Qe&&(jr.prototype[Qe]=function(){return this}),jr}();pt?((pt.exports=_r)._=_r,ht._=_r):ft._=_r}).call(D)}(KU,KU.exports);var XU=L,qU=wt("iterator"),JU=!XU((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[qU]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),ZU=ee,$U=2147483647,QU=/[^\0-\u007E]/,eL=/[.\u3002\uFF0E\uFF61]/g,tL="Overflow: input needs wider integers to process",rL=M.RangeError,nL=ZU(eL.exec),iL=Math.floor,oL=String.fromCharCode,aL=ZU("".charCodeAt),sL=ZU([].join),cL=ZU([].push),uL=ZU("".replace),dL=ZU("".split),lL=ZU("".toLowerCase),fL=function(e){return e+22+75*(e<26)},hL=function(e,t,r){var n=0;for(e=r?iL(e/700):e>>1,e+=iL(e/t);e>455;)e=iL(e/35),n+=36;return iL(n+36*e/(e+38))},pL=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=aL(e,r++);if(i>=55296&&i<=56319&&r<n){var o=aL(e,r++);56320==(64512&o)?cL(t,((1023&i)<<10)+(1023&o)+65536):(cL(t,i),r--)}else cL(t,i)}return t}(e);var r,n,i=e.length,o=128,a=0,s=72;for(r=0;r<e.length;r++)(n=e[r])<128&&cL(t,oL(n));var c=t.length,u=c;for(c&&cL(t,"-");u<i;){var d=$U;for(r=0;r<e.length;r++)(n=e[r])>=o&&n<d&&(d=n);var l=u+1;if(d-o>iL(($U-a)/l))throw rL(tL);for(a+=(d-o)*l,o=d,r=0;r<e.length;r++){if((n=e[r])<o&&++a>$U)throw rL(tL);if(n==o){for(var f=a,h=36;;){var p=h<=s?1:h>=s+26?26:h-s;if(f<p)break;var _=f-p,v=36-p;cL(t,oL(fL(p+_%v))),f=iL(_/v),h+=36}cL(t,oL(fL(f))),s=hL(a,l,u==c),a=0,u++}}a++,o++}return sL(t,"")},_L=bi,vL=M,mL=be,gL=F,yL=ee,EL=JU,SL=Ir.exports,bL=Fu,TL=Ba,IL=Wa,AL=on,RL=_u,CL=ve,OL=ht,wL=bc,NL=Lc,kL=ur,DL=ge,PL=hd,ML=sa,UL=X,LL=Xc,xL=Fc,BL=Zf,VL=B_,jL=wt("iterator"),FL="URLSearchParams",GL="URLSearchParamsIterator",zL=AL.set,HL=AL.getterFor(FL),WL=AL.getterFor(GL),YL=mL("fetch"),KL=mL("Request"),XL=mL("Headers"),qL=KL&&KL.prototype,JL=XL&&XL.prototype,ZL=vL.RegExp,$L=vL.TypeError,QL=vL.decodeURIComponent,ex=vL.encodeURIComponent,tx=yL("".charAt),rx=yL([].join),nx=yL([].push),ix=yL("".replace),ox=yL([].shift),ax=yL([].splice),sx=yL("".split),cx=yL("".slice),ux=/\+/g,dx=Array(4),lx=function(e){return dx[e-1]||(dx[e-1]=ZL("((?:%[\\da-f]{2}){"+e+"})","gi"))},fx=function(e){try{return QL(e)}catch(t){return e}},hx=function(e){var t=ix(e,ux," "),r=4;try{return QL(t)}catch(e){for(;r;)t=ix(t,lx(r--),fx);return t}},px=/[!'()~]|%20/g,_x={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},vx=function(e){return _x[e]},mx=function(e){return ix(ex(e),px,vx)},gx=IL((function(e,t){zL(this,{type:GL,iterator:LL(HL(e).entries),kind:t})}),"Iterator",(function(){var e=WL(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),yx=function(e){this.entries=[],this.url=null,void 0!==e&&(DL(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===tx(e,0)?cx(e,1):e:PL(e)))};yx.prototype={type:FL,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,a,s,c=xL(e);if(c)for(r=(t=LL(e,c)).next;!(n=gL(r,t)).done;){if(o=(i=LL(kL(n.value))).next,(a=gL(o,i)).done||(s=gL(o,i)).done||!gL(o,i).done)throw $L("Expected sequence with length 2");nx(this.entries,{key:PL(a.value),value:PL(s.value)})}else for(var u in e)OL(e,u)&&nx(this.entries,{key:u,value:PL(e[u])})},parseQuery:function(e){if(e)for(var t,r,n=sx(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=sx(t,"="),nx(this.entries,{key:hx(ox(r)),value:hx(rx(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],nx(r,mx(e.key)+"="+mx(e.value));return rx(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ex=function(){RL(this,Sx);var e=arguments.length>0?arguments[0]:void 0;zL(this,new yx(e))},Sx=Ex.prototype;if(bL(Sx,{append:function(e,t){BL(arguments.length,2);var r=HL(this);nx(r.entries,{key:PL(e),value:PL(t)}),r.updateURL()},delete:function(e){BL(arguments.length,1);for(var t=HL(this),r=t.entries,n=PL(e),i=0;i<r.length;)r[i].key===n?ax(r,i,1):i++;t.updateURL()},get:function(e){BL(arguments.length,1);for(var t=HL(this).entries,r=PL(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){BL(arguments.length,1);for(var t=HL(this).entries,r=PL(e),n=[],i=0;i<t.length;i++)t[i].key===r&&nx(n,t[i].value);return n},has:function(e){BL(arguments.length,1);for(var t=HL(this).entries,r=PL(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){BL(arguments.length,1);for(var r,n=HL(this),i=n.entries,o=!1,a=PL(e),s=PL(t),c=0;c<i.length;c++)(r=i[c]).key===a&&(o?ax(i,c--,1):(o=!0,r.value=s));o||nx(i,{key:a,value:s}),n.updateURL()},sort:function(){var e=HL(this);VL(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=HL(this).entries,n=wL(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new gx(this,"keys")},values:function(){return new gx(this,"values")},entries:function(){return new gx(this,"entries")}},{enumerable:!0}),SL(Sx,jL,Sx.entries,{name:"entries"}),SL(Sx,"toString",(function(){return HL(this).serialize()}),{enumerable:!0}),TL(Ex,FL),_L({global:!0,forced:!EL},{URLSearchParams:Ex}),!EL&&CL(XL)){var bx=yL(JL.has),Tx=yL(JL.set),Ix=function(e){if(DL(e)){var t,r=e.body;if(NL(r)===FL)return t=e.headers?new XL(e.headers):new XL,bx(t,"content-type")||Tx(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),ML(e,{body:UL(0,PL(r)),headers:UL(0,t)})}return e};if(CL(YL)&&_L({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return YL(e,arguments.length>1?Ix(arguments[1]):{})}}),CL(KL)){var Ax=function(e){return RL(this,qL),new KL(e,arguments.length>1?Ix(arguments[1]):{})};qL.constructor=Ax,Ax.prototype=qL,_L({global:!0,forced:!0},{Request:Ax})}}var Rx,Cx={URLSearchParams:Ex,getState:HL},Ox=bi,wx=x,Nx=JU,kx=M,Dx=bc,Px=ee,Mx=Bo.f,Ux=Ir.exports,Lx=_u,xx=ht,Bx=ZD,Vx=qR,jx=Hs,Fx=bd.codeAt,Gx=function(e){var t,r,n=[],i=dL(uL(lL(e),eL,"."),".");for(t=0;t<i.length;t++)r=i[t],cL(n,nL(QU,r)?"xn--"+pL(r):r);return sL(n,".")},zx=hd,Hx=Ba,Wx=Zf,Yx=Cx,Kx=on,Xx=Kx.set,qx=Kx.getterFor("URL"),Jx=Yx.URLSearchParams,Zx=Yx.getState,$x=kx.URL,Qx=kx.TypeError,eB=kx.parseInt,tB=Math.floor,rB=Math.pow,nB=Px("".charAt),iB=Px(/./.exec),oB=Px([].join),aB=Px(1..toString),sB=Px([].pop),cB=Px([].push),uB=Px("".replace),dB=Px([].shift),lB=Px("".split),fB=Px("".slice),hB=Px("".toLowerCase),pB=Px([].unshift),_B="Invalid scheme",vB="Invalid host",mB="Invalid port",gB=/[a-z]/i,yB=/[\d+-.a-z]/i,EB=/\d/,SB=/^0x/i,bB=/^[0-7]+$/,TB=/^\d+$/,IB=/^[\da-f]+$/i,AB=/[\0\t\n\r #%/:<>?@[\\\]^|]/,RB=/[\0\t\n\r #/:<>?@[\\\]^|]/,CB=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,OB=/[\t\n\r]/g,wB=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)pB(t,e%256),e=tB(e/256);return oB(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=aB(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},NB={},kB=Bx({},NB,{" ":1,'"':1,"<":1,">":1,"`":1}),DB=Bx({},kB,{"#":1,"?":1,"{":1,"}":1}),PB=Bx({},DB,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),MB=function(e,t){var r=Fx(e,0);return r>32&&r<127&&!xx(t,e)?e:encodeURIComponent(e)},UB={ftp:21,file:null,http:80,https:443,ws:80,wss:443},LB=function(e,t){var r;return 2==e.length&&iB(gB,nB(e,0))&&(":"==(r=nB(e,1))||!t&&"|"==r)},xB=function(e){var t;return e.length>1&&LB(fB(e,0,2))&&(2==e.length||"/"===(t=nB(e,2))||"\\"===t||"?"===t||"#"===t)},BB=function(e){return"."===e||"%2e"===hB(e)},VB={},jB={},FB={},GB={},zB={},HB={},WB={},YB={},KB={},XB={},qB={},JB={},ZB={},$B={},QB={},eV={},tV={},rV={},nV={},iV={},oV={},aV=function(e,t,r){var n,i,o,a=zx(e);if(t){if(i=this.parse(a))throw Qx(i);this.searchParams=null}else{if(void 0!==r&&(n=new aV(r,!0)),i=this.parse(a,null,n))throw Qx(i);(o=Zx(new Jx)).bindURL(this),this.searchParams=o}};aV.prototype={type:"URL",parse:function(e,t,r){var n,i,o,a,s,c=this,u=t||VB,d=0,l="",f=!1,h=!1,p=!1;for(e=zx(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=uB(e,CB,"")),e=uB(e,OB,""),n=Vx(e);d<=n.length;){switch(i=n[d],u){case VB:if(!i||!iB(gB,i)){if(t)return _B;u=FB;continue}l+=hB(i),u=jB;break;case jB:if(i&&(iB(yB,i)||"+"==i||"-"==i||"."==i))l+=hB(i);else{if(":"!=i){if(t)return _B;l="",u=FB,d=0;continue}if(t&&(c.isSpecial()!=xx(UB,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,t)return void(c.isSpecial()&&UB[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?u=$B:c.isSpecial()&&r&&r.scheme==c.scheme?u=GB:c.isSpecial()?u=YB:"/"==n[d+1]?(u=zB,d++):(c.cannotBeABaseURL=!0,cB(c.path,""),u=nV)}break;case FB:if(!r||r.cannotBeABaseURL&&"#"!=i)return _B;if(r.cannotBeABaseURL&&"#"==i){c.scheme=r.scheme,c.path=jx(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=oV;break}u="file"==r.scheme?$B:HB;continue;case GB:if("/"!=i||"/"!=n[d+1]){u=HB;continue}u=KB,d++;break;case zB:if("/"==i){u=XB;break}u=rV;continue;case HB:if(c.scheme=r.scheme,i==Rx)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.query=r.query;else if("/"==i||"\\"==i&&c.isSpecial())u=WB;else if("?"==i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.query="",u=iV;else{if("#"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.path.length--,u=rV;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=jx(r.path),c.query=r.query,c.fragment="",u=oV}break;case WB:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=rV;continue}u=XB}else u=KB;break;case YB:if(u=KB,"/"!=i||"/"!=nB(l,d+1))continue;d++;break;case KB:if("/"!=i&&"\\"!=i){u=XB;continue}break;case XB:if("@"==i){f&&(l="%40"+l),f=!0,o=Vx(l);for(var _=0;_<o.length;_++){var v=o[_];if(":"!=v||p){var m=MB(v,PB);p?c.password+=m:c.username+=m}else p=!0}l=""}else if(i==Rx||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(f&&""==l)return"Invalid authority";d-=Vx(l).length+1,l="",u=qB}else l+=i;break;case qB:case JB:if(t&&"file"==c.scheme){u=eV;continue}if(":"!=i||h){if(i==Rx||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==l)return vB;if(t&&""==l&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(l))return a;if(l="",u=tV,t)return;continue}"["==i?h=!0:"]"==i&&(h=!1),l+=i}else{if(""==l)return vB;if(a=c.parseHost(l))return a;if(l="",u=ZB,t==JB)return}break;case ZB:if(!iB(EB,i)){if(i==Rx||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||t){if(""!=l){var g=eB(l,10);if(g>65535)return mB;c.port=c.isSpecial()&&g===UB[c.scheme]?null:g,l=""}if(t)return;u=tV;continue}return mB}l+=i;break;case $B:if(c.scheme="file","/"==i||"\\"==i)u=QB;else{if(!r||"file"!=r.scheme){u=rV;continue}if(i==Rx)c.host=r.host,c.path=jx(r.path),c.query=r.query;else if("?"==i)c.host=r.host,c.path=jx(r.path),c.query="",u=iV;else{if("#"!=i){xB(oB(jx(n,d),""))||(c.host=r.host,c.path=jx(r.path),c.shortenPath()),u=rV;continue}c.host=r.host,c.path=jx(r.path),c.query=r.query,c.fragment="",u=oV}}break;case QB:if("/"==i||"\\"==i){u=eV;break}r&&"file"==r.scheme&&!xB(oB(jx(n,d),""))&&(LB(r.path[0],!0)?cB(c.path,r.path[0]):c.host=r.host),u=rV;continue;case eV:if(i==Rx||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&LB(l))u=rV;else if(""==l){if(c.host="",t)return;u=tV}else{if(a=c.parseHost(l))return a;if("localhost"==c.host&&(c.host=""),t)return;l="",u=tV}continue}l+=i;break;case tV:if(c.isSpecial()){if(u=rV,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=Rx&&(u=rV,"/"!=i))continue}else c.fragment="",u=oV;else c.query="",u=iV;break;case rV:if(i==Rx||"/"==i||"\\"==i&&c.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=hB(s=l))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||cB(c.path,"")):BB(l)?"/"==i||"\\"==i&&c.isSpecial()||cB(c.path,""):("file"==c.scheme&&!c.path.length&&LB(l)&&(c.host&&(c.host=""),l=nB(l,0)+":"),cB(c.path,l)),l="","file"==c.scheme&&(i==Rx||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)dB(c.path);"?"==i?(c.query="",u=iV):"#"==i&&(c.fragment="",u=oV)}else l+=MB(i,DB);break;case nV:"?"==i?(c.query="",u=iV):"#"==i?(c.fragment="",u=oV):i!=Rx&&(c.path[0]+=MB(i,NB));break;case iV:t||"#"!=i?i!=Rx&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":MB(i,NB)):(c.fragment="",u=oV);break;case oV:i!=Rx&&(c.fragment+=MB(i,kB))}d++}},parseHost:function(e){var t,r,n;if("["==nB(e,0)){if("]"!=nB(e,e.length-1))return vB;if(t=function(e){var t,r,n,i,o,a,s,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,f=function(){return nB(e,l)};if(":"==f()){if(":"!=nB(e,1))return;l+=2,d=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=r=0;r<4&&iB(IB,f());)t=16*t+eB(f(),16),l++,r++;if("."==f()){if(0==r)return;if(l-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;l++}if(!iB(EB,f()))return;for(;iB(EB,f());){if(o=eB(f(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==f()){if(l++,!f())return}else if(f())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(a=u-d,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[d+a-1],c[d+--a]=s;else if(8!=u)return;return c}(fB(e,1,-1)),!t)return vB;this.host=t}else if(this.isSpecial()){if(e=Gx(e),iB(AB,e))return vB;if(t=function(e){var t,r,n,i,o,a,s,c=lB(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(o=10,i.length>1&&"0"==nB(i,0)&&(o=iB(SB,i)?16:8,i=fB(i,8==o?1:2)),""===i)a=0;else{if(!iB(10==o?TB:8==o?bB:IB,i))return e;a=eB(i,o)}cB(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=rB(256,5-t))return null}else if(a>255)return null;for(s=sB(r),n=0;n<r.length;n++)s+=r[n]*rB(256,3-n);return s}(e),null===t)return vB;this.host=t}else{if(iB(RB,e))return vB;for(t="",r=Vx(e),n=0;n<r.length;n++)t+=MB(r[n],NB);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return xx(UB,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&LB(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,o=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=wB(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+oB(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw Qx(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new sV(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+wB(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(zx(e)+":",VB)},getUsername:function(){return this.username},setUsername:function(e){var t=Vx(zx(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=MB(t[r],PB)}},getPassword:function(){return this.password},setPassword:function(e){var t=Vx(zx(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=MB(t[r],PB)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?wB(e):wB(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,qB)},getHostname:function(){var e=this.host;return null===e?"":wB(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,JB)},getPort:function(){var e=this.port;return null===e?"":zx(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=zx(e))?this.port=null:this.parse(e,ZB))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+oB(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,tV))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=zx(e))?this.query=null:("?"==nB(e,0)&&(e=fB(e,1)),this.query="",this.parse(e,iV)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=zx(e))?("#"==nB(e,0)&&(e=fB(e,1)),this.fragment="",this.parse(e,oV)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var sV=function(e){var t=Lx(this,cV),r=Wx(arguments.length,1)>1?arguments[1]:void 0,n=Xx(t,new aV(e,!1,r));wx||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},cV=sV.prototype,uV=function(e,t){return{get:function(){return qx(this)[e]()},set:t&&function(e){return qx(this)[t](e)},configurable:!0,enumerable:!0}};if(wx&&Mx(cV,{href:uV("serialize","setHref"),origin:uV("getOrigin"),protocol:uV("getProtocol","setProtocol"),username:uV("getUsername","setUsername"),password:uV("getPassword","setPassword"),host:uV("getHost","setHost"),hostname:uV("getHostname","setHostname"),port:uV("getPort","setPort"),pathname:uV("getPathname","setPathname"),search:uV("getSearch","setSearch"),searchParams:uV("getSearchParams"),hash:uV("getHash","setHash")}),Ux(cV,"toJSON",(function(){return qx(this).serialize()}),{enumerable:!0}),Ux(cV,"toString",(function(){return qx(this).serialize()}),{enumerable:!0}),$x){var dV=$x.createObjectURL,lV=$x.revokeObjectURL;dV&&Ux(sV,"createObjectURL",Dx(dV,$x)),lV&&Ux(sV,"revokeObjectURL",Dx(lV,$x))}Hx(sV,"URL"),Ox({global:!0,forced:!Nx,sham:!wx},{URL:sV});var fV,hV=function(){function e(e){this._sharedAudioContext=new AudioContext,this._audioDestination=this._sharedAudioContext.createMediaStreamDestination(),this._localGainNode=this._sharedAudioContext.createGain(),this._bufferGainNode=this._sharedAudioContext.createGain(),this.mixingMap=new Map,this.resourcesCache=new Map,this.volumeConfig=new Map,this.cachedBuffer=[],this._context=e,this._localGainNode.gain.value=1}return e.prototype.mixMediaStream=function(e){this._localSource&&this._localSource.disconnect(this._localGainNode),this._localSource=this._sharedAudioContext.createMediaStreamSource(e),this._localSource.connect(this._localGainNode).connect(this._audioDestination)},e.prototype.startAudioMixing=function(e,t,r){return S(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,d,l,f,h,p,_=this;return b(this,(function(v){switch(v.label){case 0:if(n=r.playCount,fO(i=r.type,"mixingType",KU.exports.values(C)),!(o=this._context.getLocalAudioTrack()))return[2];if((a=fU(o.getTrack()))&&this.mixMediaStream(a),(s=this.mixingMap.get(e))&&s.audioNode){s.audioNode.pause(),this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_STOPPED,error:jI.AUDIO_MIXING_ERROR_OK});try{s.gainNode.disconnect(this._audioDestination),s.audioSource.disconnect(s.gainNode)}catch(e){}}return(u=this.resourcesCache.get(e))&&u.filePath===t?(c=u.getAudioNode(),[3,3]):[3,1];case 1:return[4,fetch(t,{mode:"cors",credentials:"include"}).then((function(t){if(t.ok)return t.arrayBuffer();throw _._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_FAILED,error:jI.AUDIO_MIXING_ERROR_START_FAILED}),new GI(VI.LOAD_RESOURCES_FAILED,t.statusText)}))];case 2:d=v.sent(),c=new Audio(URL.createObjectURL(new Blob([d]))),v.label=3;case 3:return c.crossOrigin="anonymous",n<=0?c.loop=!0:n>0&&(l=n,c.onended=function(){--l>0?c.play():_._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_FINISHED,error:jI.AUDIO_MIXING_ERROR_OK})}),[4,c.play()];case 4:if(v.sent(),f=this._sharedAudioContext.createMediaElementSource(c),h=this._sharedAudioContext.createGain(),p=this.volumeConfig.get(e),h.gain.value=p?p/100:1,f.connect(h).connect(this._audioDestination),this.mixingMap.set(e,{audioSource:f,audioNode:c,gainNode:h,type:"file"}),i===C.PUBLISH)try{h.disconnect(this._sharedAudioContext.destination)}catch(e){}else h.connect(this._sharedAudioContext.destination);return this._context.updateLocalAudioTrack(this._audioDestination.stream.getAudioTracks()[0],r.type),this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_PLAYING,error:jI.AUDIO_MIXING_ERROR_OK}),[2]}}))}))},e.prototype.stopAudioMixing=function(e){var t=this.mixingMap.get(e);t&&"file"===t.type&&(this.mixingMap.delete(e),t.audioNode.pause(),t.audioSource.disconnect(t.gainNode),t.gainNode.disconnect(this._audioDestination),this._context.updateLocalAudioTrack()),this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_STOPPED,error:jI.AUDIO_MIXING_ERROR_OK})},e.prototype.pauseAudioMixing=function(e){var t=this.mixingMap.get(e);t&&(this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_PAUSED,error:jI.AUDIO_MIXING_ERROR_OK}),t.audioNode.pause())},e.prototype.resumeAudioMixing=function(e){var t=this.mixingMap.get(e);t&&(this._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_PLAYING,error:jI.AUDIO_MIXING_ERROR_OK}),t.audioNode.play())},e.prototype.preloadAudioMixing=function(e,t){return S(this,void 0,void 0,(function(){var r,n=this;return b(this,(function(i){switch(i.label){case 0:return this.stopAudioMixing(e),[4,fetch(t,{mode:"cors",credentials:"include"}).then((function(t){if(t.ok)return t.arrayBuffer();throw n._context.emitMessage({mixId:e,state:O.AUDIO_MIXING_STATE_FAILED,error:jI.AUDIO_MIXING_ERROR_PRELOAD_FAILED}),new GI(VI.LOAD_RESOURCES_FAILED,t.statusText)})).catch((function(e){throw new GI(VI.LOAD_RESOURCES_FAILED,"Load resources failed",e)}))];case 1:return r=i.sent(),this.resourcesCache.set(e,{getAudioNode:function(){return new Audio(URL.createObjectURL(new Blob([r])))},filePath:t}),[2]}}))}))},e.prototype.unloadAudioMixing=function(e){this.resourcesCache.has(e)&&this.resourcesCache.delete(e)},e.prototype.getAudioMixingVolume=function(e){var t=this.mixingMap.get(e);return t?100*t.gainNode.gain.value:0},e.prototype.setAudioMixingVolume=function(e,t){t<0?t=0:t>400&&(t=400),this.volumeConfig.set(e,t);var r=this.mixingMap.get(e);r&&(r.gainNode.gain.value=Number(t)/100)},e.prototype.getAudioMixingDuration=function(e){var t=this.mixingMap.get(e),r=this.mixingMap.get(e);return t||r?t?1e3*t.audioNode.duration:r?1e3*r.audioNode.duration:0:0},e.prototype.getAudioMixingCurrentPosition=function(e){var t=this.mixingMap.get(e);return t?1e3*t.audioNode.currentTime:0},e.prototype.setAudioMixingPosition=function(e,t){var r=this.mixingMap.get(e);r&&(r.audioNode.currentTime=t/1e3,r.audioNode.play())},e.prototype.enableAudioMixingBuffer=function(e){fO(e,"type",KU.exports.values(C));var t=this._context.getLocalAudioTrack();if(t){var r=fU(t.getTrack());if(r&&this.mixMediaStream(r),e===C.PUBLISH)try{this._bufferGainNode.disconnect(this._sharedAudioContext.destination)}catch(e){}else this._bufferGainNode.connect(this._sharedAudioContext.destination);this._context.updateLocalAudioTrack(this._audioDestination.stream.getAudioTracks()[0],e),this._bufferGainNode.connect(this._audioDestination)}},e.prototype.disableAudioMixingBuffer=function(){if(this.cachedBuffer=[],this._audioBufferSource){try{this._audioBufferSource.disconnect(this._bufferGainNode),this._bufferGainNode.disconnect(this._audioDestination),this._bufferGainNode.disconnect(this._sharedAudioContext.destination)}catch(e){}finally{this._audioBufferSource=void 0}this._context.updateLocalAudioTrack()}},e.prototype.pushAudioMixingBuffer=function(e){var t=this;this._audioBufferSource&&this.cachedBuffer.push(e),this._audioBufferSource=this._sharedAudioContext.createBufferSource(),this._audioBufferSource.buffer=e,this._audioBufferSource.connect(this._bufferGainNode),this._audioBufferSource.start(),this._audioBufferSource.onended=function(){var e;if(null===(e=t._audioBufferSource)||void 0===e||e.disconnect(t._bufferGainNode),t._audioBufferSource=void 0,t.cachedBuffer.length){var r=t.cachedBuffer.shift();r&&t.pushAudioMixingBuffer(r)}}},e.prototype.stopAll=function(){var e=this;if(this._localSource)try{this._localSource.disconnect(this._localGainNode),delete this._localSource}catch(e){}this.mixingMap.forEach((function(t,r){e.stopAudioMixing(r)}))},Object.defineProperty(e.prototype,"mixTrack",{get:function(){return this._audioDestination.stream.getAudioTracks()[0]},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){var e=this._sharedAudioContext;"closed"!==e.state&&"function"==typeof e.close&&e.close(),this.cachedBuffer=[],this.mixingMap.clear(),this.resourcesCache.clear(),this.volumeConfig.clear()},E([sP("id","filePath","options")],e.prototype,"startAudioMixing",null),E([sP("id")],e.prototype,"stopAudioMixing",null),E([sP("id")],e.prototype,"pauseAudioMixing",null),E([sP("id")],e.prototype,"resumeAudioMixing",null),E([sP("id")],e.prototype,"preloadAudioMixing",null),E([sP("id")],e.prototype,"unloadAudioMixing",null),E([sP("id")],e.prototype,"getAudioMixingVolume",null),E([sP("id","volume")],e.prototype,"setAudioMixingVolume",null),E([sP("id")],e.prototype,"getAudioMixingDuration",null),E([sP("id")],e.prototype,"getAudioMixingCurrentPosition",null),E([sP("id","position")],e.prototype,"setAudioMixingPosition",null),E([sP("type")],e.prototype,"enableAudioMixingBuffer",null),E([sP()],e.prototype,"disableAudioMixingBuffer",null),E([sP("buffer")],e.prototype,"pushAudioMixingBuffer",null),e}();!function(e){e.NORMAL_USER="normalUser",e.SILENT_USER="silentUser"}(fV||(fV={}));var pV=new PO("Engine",0),_V=function(e){function t(t){var r=e.call(this)||this;return r._visibility=!0,r._remoteVideoPlayer=new Map,r._remoteScreenPlayer=new Map,r._remoteAudioPlayer=new Map,r._videoStreamConstraints={},r._audioStreamConstraints={},r._videoStreamEncodeConfig=[{maxKbps:500}],r._screenStreamEncodeConfig=[{maxKbps:500}],r._pauseAllSubscribeState={audio:!1,video:!1},r._mirrorType=m.MIRROR_TYPE_RENDER,r._updateMixAudioTrack=function(e,t){return void 0===t&&(t=C.PLAYOUT_AND_PUBLISH),S(r,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("_updateMixAudioTrack()"),this._localAudioTrack?(e?(this._localAudioTrack.mixType=t,this._localAudioTrack.mixedAudioTrack=e):(delete this._localAudioTrack.mixType,delete this._localAudioTrack.mixedAudioTrack),(null===(r=this._room)||void 0===r?void 0:r.hasPublished)?[4,this._updatePublish()]:[3,2]):(e&&(this._tempMixingAudioTrack={track:e,type:t}),[2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},r._onAudioMixingMessage=function(e){r.safeEmit(N.onAudioMixingStateChanged,e)},r._appId=t,r._pubLock=new dM("pubLock"),r._addDeviceEventHandler(),r._audioMixingManager=new hV({getLocalAudioTrack:function(){return r._localAudioTrack},updateLocalAudioTrack:r._updateMixAudioTrack,emitMessage:r._onAudioMixingMessage}),window["__rtc_engine__".concat(Math.floor(100*Math.random()+1))]=r,r._trackSourceType={video:n.VIDEO_SOURCE_TYPE_INTERNAL,screenVideo:n.VIDEO_SOURCE_TYPE_INTERNAL,audio:i.AUDIO_SOURCE_TYPE_INTERNAL,screenAudio:i.AUDIO_SOURCE_TYPE_INTERNAL},r}return r(t,e),Object.defineProperty(t.prototype,"appId",{get:function(){return this._appId},enumerable:!1,configurable:!0}),t.prototype.updateToken=function(e){var t;pV.print("updateToken()","token: %s",e),lO(e,"token"),null===(t=this._room)||void 0===t||t.updateToken(e)},t.prototype.switchCamera=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){switch(o.label){case 0:return pV.print("switchCamera()","deviceId: %s",e),lO(e,"deviceId"),e===(null===(r=null===(t=this._videoStreamConstraints)||void 0===t?void 0:t.deviceId)||void 0===r?void 0:r.exact)?[2]:((n=this._videoStreamConstraints).deviceId={exact:e},this._videoStreamConstraints=n,[4,RU(n)]);case 1:return i=o.sent(),this._initLocalTrackEvents(i),this._localVideoTrack&&this._localVideoTrack.close(),this._localVideoTrack=i,this._videoPlayer&&(this._videoPlayer.stop(),this._videoPlayer.playVideo(i),this._videoPlayer.mirror(!!this._mirrorType)),this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,3]:[2];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},t.prototype.switchMicrophone=function(e){var t,r;return S(this,void 0,void 0,(function(){var n,i;return b(this,(function(o){switch(o.label){case 0:return pV.print("switchMicrophone()","deviceId: %s",e),lO(e,"deviceId"),e===(null===(r=null===(t=this._videoStreamConstraints)||void 0===t?void 0:t.deviceId)||void 0===r?void 0:r.exact)?[2]:((n=this._audioStreamConstraints).deviceId={exact:e},this._audioStreamConstraints=n,[4,CU(n)]);case 1:return i=o.sent(),this._initLocalTrackEvents(i),this._localAudioTrack&&this._localAudioTrack.close(),this._localAudioTrack=i,this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,3]:[2];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},t.prototype._addDeviceEventHandler=function(){oU.on(N.onMediaDeviceStateChanged,this._onDeviceStateChange.bind(this))},t.prototype._addHandlerEventHandler=function(){var e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T=this;null===(e=this._room)||void 0===e||e.on(eP.ON_ADD_STREAM,this._onAddStream.bind(this)),null===(t=this._room)||void 0===t||t.on(eP.ON_REMOVE_STREAM,this._onRemoveStream.bind(this)),null===(r=this._room)||void 0===r||r.on(eP.USER_CONNECTION,this._onUserConnection.bind(this)),null===(n=this._room)||void 0===n||n.on(eP.USER_DISCONNECTION,this._onUserDisconnection.bind(this)),null===(i=this._room)||void 0===i||i.on(eP.ON_CUSTOM_MESSAGE,this._onCustomMessage.bind(this)),null===(o=this._room)||void 0===o||o.on(eP.USER_MESSAGE_RECEIVED,this._onUserMessageReceived.bind(this)),null===(a=this._room)||void 0===a||a.on(eP.USER_BINARY_MESSAGE_RECEIVED,this._onUserBinaryMessageReceived.bind(this)),null===(s=this._room)||void 0===s||s.on(eP.POST_PROCESSING_MESSAGE,this._onLiveTranscodingResult.bind(this)),null===(c=this._room)||void 0===c||c.on(tP.ON_CONNECTION_STATE_CHANGE,this._onConnectionStateChange.bind(this)),null===(u=this._room)||void 0===u||u.on(NU.RESUBSCRIBE,this._onResubscribe.bind(this)),null===(d=this._room)||void 0===d||d.on(NU.SUBSCRIBE_PUSH_TRACK,this._onSubscribePushTrack.bind(this)),null===(l=this._room)||void 0===l||l.on(NU.REMOVE_PUSH_TRACK,this._onRemovePushTrack.bind(this)),null===(f=this._room)||void 0===f||f.on(NU.VIDEO_FIRST_FRAME,this._onVideoFirstFrameDecoded.bind(this)),null===(h=this._room)||void 0===h||h.on(NU.ON_PUBLISH_RESULT,(function(e){var t;(null===(t=T._room)||void 0===t?void 0:t._roomConfig.isAutoPublish)&&T.safeEmit(N.onAutoPublishResult,e)})),null===(p=this._room)||void 0===p||p.on("onRemoteStreamStats",(function(e){T.safeEmit(N.onRemoteStreamStats,e)})),null===(_=this._room)||void 0===_||_.on("onLocalStreamStats",(function(e){T.safeEmit(N.onLocalStreamStats,e)})),null===(v=this._room)||void 0===v||v.on(NU.ON_USER_MUTE_AUDIO,this._onUserMuteAudio.bind(this)),null===(m=this._room)||void 0===m||m.on(NU.ON_USER_MUTE_VIDEO,this._onUserMuteVideo.bind(this)),null===(g=this._room)||void 0===g||g.on(NU.ON_USER_START_AUDIO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStartAudioCapture,{userId:t})})),null===(y=this._room)||void 0===y||y.on(NU.ON_USER_STOP_AUDIO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStopAudioCapture,{userId:t})})),null===(E=this._room)||void 0===E||E.on(NU.ON_USER_START_VIDEO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStartVideoCapture,{userId:t})})),null===(S=this._room)||void 0===S||S.on(NU.ON_USER_STOP_VIDEO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(N.onUserStopVideoCapture,{userId:t})})),null===(b=this._room)||void 0===b||b.on(NU.ON_SEI_MESSAGED_RECEIVED,(function(e){T.safeEmit(N.onSEIMessageReceived,e)}))},t.prototype.safeEmit=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return yO(t)&&cP(t,JSON.stringify(cO(r))),e.prototype.safeEmit.apply(this,A([t],I(r),!1))},t.prototype._removeHandlerEventHandler=function(){var e;null===(e=this._room)||void 0===e||e.removeAllListeners()},t.prototype.joinRoom=function(e,t,r,n){return void 0===n&&(n={isAutoPublish:!1,isAutoSubscribeAudio:!1,isAutoSubscribeVideo:!1}),S(this,void 0,void 0,(function(){var i;return b(this,(function(o){switch(o.label){case 0:if(pV.print("joinRoom()","token: %o roomId: %o, userInfo: %o, roomConfig: %o",e,t,r,n),_O(e)||lO(e,"token"),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new GI(VI.INVALID_PARAMS,"The RoomId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(t),vO(r),function(e){hO(e,"roomConfig"),uO(e.isAutoPublish,"roomConfig.isAutoPublish"),uO(e.isAutoSubscribeAudio,"roomConfig.isAutoSubscribeAudio"),uO(e.isAutoSubscribeVideo,"roomConfig.isAutoSubscribeVideo")}(n),!this._room||this._room.connectionState===hM.DISCONNECTED)return[3,1];throw new GI(VI.REPEAT_JOIN,"Already joined");case 1:return this._room=new xU(n),this._addHandlerEventHandler(),i=this._liveTranscodeConfig&&yw("started",this._liveTranscodeConfig),[4,this._room.join(this._appId,t,e,y(y({},r),{businessId:this._businessId,role:this._visibility?fV.NORMAL_USER:fV.SILENT_USER}),i)];case 2:return o.sent(),this._roomConfig=n,(this._localAudioTrack||this._localVideoTrack)&&n.isAutoPublish?[4,this._updatePublish()]:[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t.prototype.leaveRoom=function(){var e;pV.print("leaveRoom()"),this._removeHandlerEventHandler(),null===(e=this._room)||void 0===e||e.leave().catch,this._liveTranscodeConfig&&this.stopLiveTranscoding(),this._room=void 0,this._remoteAudioPlayer.forEach((function(e){return e.stop()})),this._remoteAudioPlayer=new Map,this._remoteScreenPlayer.forEach((function(e){return e.stop()})),this._remoteScreenPlayer=new Map,this._remoteVideoPlayer.forEach((function(e){return e.stop()})),this._remoteVideoPlayer=new Map,this._roomConfig=void 0},t.prototype.destroy=function(){var e,t,r;pV.print("destroy()"),this.removeAllListeners(),this._removeHandlerEventHandler(),null===(e=this._room)||void 0===e||e.destroy(),this._room=void 0,null===(t=this._videoPlayer)||void 0===t||t.destroy(),null===(r=this._audioPlayer)||void 0===r||r.destroy(),this._videoPlayer=void 0,this._audioPlayer=void 0,this._screenPlayer=void 0,this._videoStreamConstraints={},this._audioStreamConstraints={},this._videoStreamEncodeConfig=[{maxKbps:500}],this._screenStreamEncodeConfig=[{maxKbps:500}],this._pauseAllSubscribeState={audio:!1,video:!1},clearInterval(this._audioVolumeIndicationTimer),this._audioVolumeIndicationTimer=void 0,this._localAudioTrack&&(this._localAudioTrack.close(),this._localAudioTrack=void 0),this._localVideoTrack&&(this._localVideoTrack.close(),this._localVideoTrack=void 0),this._localScreenAudioTrack&&(this._localScreenAudioTrack.close(),this._localScreenAudioTrack=void 0),this._localScreenVideoTrack&&(this._localScreenVideoTrack.close(),this._localScreenVideoTrack=void 0),this._remoteAudioPlayer.forEach((function(e){return e.stop()})),this._remoteAudioPlayer=new Map,this._remoteScreenPlayer.forEach((function(e){return e.stop()})),this._remoteScreenPlayer=new Map,this._remoteVideoPlayer.forEach((function(e){return e.stop()})),this._remoteVideoPlayer=new Map,this._roomConfig=void 0,this._audioMixingManager.destroy()},t.prototype.publish=function(){return S(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:if(pV.print("publish()"),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.PUBLISH_BEFORE_JOIN,"join first");return[4,this._updatePublish()];case 1:return e.sent(),[2]}}))}))},t.prototype.unpublish=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:if(pV.print("unpublish()"),!this._room)throw new GI(VI.UNPUBLISH_BEFORE_JOIN,"join first");return[4,this._pubLock.lock()];case 1:e=r.sent(),r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.unpublish()];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof GI?t:new GI(VI.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype.subscribeUserStream=function(e,t,r,n){var i,o,a,s;return void 0===r&&(r=h.STREAM_INDEX_MAIN),void 0===n&&(n={videoIndex:0}),S(this,void 0,void 0,(function(){var u,d,l,f,_,v;return b(this,(function(m){switch(m.label){case 0:if(pV.print("subscribeStream()","userId: %o, mediaType: %o, streamType: %o, configure: %o",e,t,r,n),lO(e,"userId"),fO(t,"mediaType",[p.AUDIO_AND_VIDEO,p.AUDIO_ONLY,p.VIDEO_ONLY,p.NONE]),fO(r,"streamType",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),dO(n.videoIndex,"config.videoIndex",0,2),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.SUBSCRIBE_BEFORE_JOIN,"join first");if(u=this._room.remoteStreams.get(e),l=r===h.STREAM_INDEX_SCREEN,!(d=l?null==u?void 0:u.find((function(e){return e.isScreen})):null==u?void 0:u.find((function(e){return!e.isScreen}))))throw new GI(VI.STREAM_NOT_EXIST,"stream not exist");m.label=1;case 1:return m.trys.push([1,3,,4]),f=t,this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video?t=p.NONE:this._pauseAllSubscribeState.audio&&!this._pauseAllSubscribeState.video?t===p.AUDIO_AND_VIDEO?t=p.VIDEO_ONLY:t===p.AUDIO_ONLY&&(t=p.NONE):!this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video&&(t===p.AUDIO_AND_VIDEO?t=p.AUDIO_ONLY:t===p.VIDEO_ONLY&&(t=p.NONE)),t!==f&&pV.print("subscribeUserStream","due to pauseAllState change sub mediaType from ".concat(f," to ").concat(t)),[4,this._room.subscribe(d,t,n)];case 2:return m.sent(),t!==p.AUDIO_AND_VIDEO&&t!==p.AUDIO_ONLY||this._updateAudioPlayerState(d),t!==p.AUDIO_AND_VIDEO&&t!==p.VIDEO_ONLY||this._updateVideoPlayerState(d),((null===(i=this._roomConfig)||void 0===i?void 0:i.isAutoSubscribeAudio)||(null===(o=this._roomConfig)||void 0===o?void 0:o.isAutoSubscribeVideo))&&(d.audioTrack||d.videoTrack)&&(v={userId:e,isScreen:l,state:c.SUBSCRIBE_SUCC},this.safeEmit(N.onAutoSubscribeResult,v)),[3,4];case 3:throw _=m.sent(),((null===(a=this._roomConfig)||void 0===a?void 0:a.isAutoSubscribeAudio)||(null===(s=this._roomConfig)||void 0===s?void 0:s.isAutoSubscribeVideo))&&(v={userId:e,isScreen:l,state:c.SUBSCRIBE_FAIL},this.safeEmit(N.onAutoSubscribeResult,v)),_;case 4:return[2]}}))}))},t.prototype.unSubscribe=function(e,t){return S(this,void 0,void 0,(function(){var r,n;return b(this,(function(i){switch(i.label){case 0:if(pV.print("unSubscribe()","userId: %s, isScreen: %o",e,t),lO(e,"userId"),uO(t,"isScreen"),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.SUBSCRIBE_BEFORE_JOIN,"join first");if(r=this._room.remoteStreams.get(e),!(n=t?null==r?void 0:r.find((function(e){return e.isScreen})):null==r?void 0:r.find((function(e){return!e.isScreen}))))throw new GI(VI.STREAM_NOT_EXIST,"stream not exist");return[4,this._room.unsubscribe(n)];case 1:return i.sent(),this._updateAudioPlayerState(n),this._updateVideoPlayerState(n),[2]}}))}))},t.prototype.startVideoCapture=function(e){return S(this,void 0,void 0,(function(){var t,r,n;return b(this,(function(i){switch(i.label){case 0:if(pV.print("startVideoCapture()","deviceId: %s",e),_O(e)||lO(e,"deviceId"),this._localVideoTrack)throw new GI(VI.REPEAT_CAPTURE,"Has already capture");return t=this._videoStreamConstraints,e&&(t.deviceId={exact:e},this._videoStreamConstraints=t),[4,RU(t)];case 1:return r=i.sent(),this._initLocalTrackEvents(r),this._localVideoTrack=r,this._videoPlayer&&this._videoPlayer.playVideo(r),this._room?(n=this._room._roomConfig.isAutoPublish,this._room.hasPublished||n?[4,this._updatePublish()]:[3,3]):[2];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},t.prototype.stopVideoCapture=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:if(pV.print("stopVideoCapture()"),this._trackSourceType.video===n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as internal first");return this._videoPlayer&&this._videoPlayer.stop(),null===(e=this._localVideoTrack)||void 0===e||e.close(),this._localVideoTrack=void 0,this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,2]:[2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.startAudioCapture=function(e){return S(this,void 0,void 0,(function(){var t,r,n;return b(this,(function(i){switch(i.label){case 0:if(pV.print("startAudioCapture()","deviceId: $o",e),_O(e)||lO(e,"deviceId"),this._localAudioTrack)throw new GI(VI.REPEAT_CAPTURE,"Has already capture");return t=this._audioStreamConstraints,e&&(t.deviceId={exact:e},this._audioStreamConstraints=t),[4,CU(t)];case 1:return r=i.sent(),this._initLocalTrackEvents(r),this._localAudioTrack=r,this._tempMixingAudioTrack&&(this._localAudioTrack.mixType=this._tempMixingAudioTrack.type,this._localAudioTrack.mixedAudioTrack=this._tempMixingAudioTrack.track,delete this._tempMixingAudioTrack),this._room?(n=this._room._roomConfig.isAutoPublish,this._room.hasPublished||n?[4,this._updatePublish()]:[3,3]):[2];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},t.prototype.stopAudioCapture=function(){var e;return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:if(pV.print("stopAudioCapture()"),null===(e=this._localAudioTrack)||void 0===e||e.close(),this._localAudioTrack=void 0,this._audioMixingManager.stopAll(),this._trackSourceType.audio===i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as internal first");return this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,2]:[2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.getAudioMixingManager=function(){return pV.print("getAudioMixingManager()"),this._audioMixingManager},t.prototype.startScreenCapture=function(e){var t,r;return void 0===e&&(e={}),S(this,void 0,void 0,(function(){var o,a,s,c;return b(this,(function(u){switch(u.label){case 0:if(pV.print("startScreenCapture()","config: %o",e),null===(t=this._localScreenVideoTrack)||void 0===t||t.close(),this._localScreenVideoTrack=void 0,o=e.enableAudio,a=void 0!==o&&o,this._trackSourceType.screenVideo===n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as internal first");if(this._trackSourceType.screenAudio===i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as internal first");return[4,OU(a)];case 1:return s=u.sent(),this._localScreenVideoTrack=new bU(s.getVideoTracks()[0],nO()),(c=s.getAudioTracks()).length&&(this._localScreenAudioTrack=new TU(c[0],nO()),this._initLocalTrackEvents(this._localScreenAudioTrack)),null===(r=this._screenPlayer)||void 0===r||r.playVideo(this._localScreenVideoTrack),this._initLocalTrackEvents(this._localScreenVideoTrack),[2]}}))}))},t.prototype.stopScreenCapture=function(){var e,t,r;return S(this,void 0,void 0,(function(){return b(this,(function(n){return pV.print("stopScreenCapture()"),null===(e=this._screenPlayer)||void 0===e||e.stop(),null===(t=this._localScreenVideoTrack)||void 0===t||t.close(),this._localScreenVideoTrack=void 0,null===(r=this._localScreenAudioTrack)||void 0===r||r.close(),this._localScreenAudioTrack=void 0,[2]}))}))},t.prototype.publishScreen=function(){return S(this,void 0,void 0,(function(){var e;return b(this,(function(t){switch(t.label){case 0:if(pV.print("publishScreen()"),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.PUBLISH_BEFORE_JOIN,"join first");if(!this._visibility)throw new GI(VI.NO_PUBLISH_PERMISSION,"no publish permission");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._room.publishScreen(this._screenStreamEncodeConfig,this._localScreenVideoTrack,this._localScreenAudioTrack)];case 2:return t.sent(),[3,4];case 3:throw(e=t.sent())instanceof GI?e:new GI(VI.UNEXPECTED_ERROR,"unexpected error",e);case 4:return[2]}}))}))},t.prototype.unpublishScreen=function(){return S(this,void 0,void 0,(function(){var e;return b(this,(function(t){switch(t.label){case 0:if(pV.print("unpublishScreen()"),!this._room)throw new GI(VI.UNPUBLISH_BEFORE_JOIN,"join first");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._room.unpublishScreen()];case 2:return t.sent(),[3,4];case 3:throw(e=t.sent())instanceof GI?e:new GI(VI.UNEXPECTED_ERROR,"unexpected error",e);case 4:return[2]}}))}))},t.prototype.setLocalVideoPlayer=function(e,t){var r,n;pV.print("setLocalVideoPlayer()","streamIndex: %o, videoPlayerOption: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),t&&t.renderDom?(mO(t),e==h.STREAM_INDEX_MAIN?(this._videoPlayer=new WU(t),this._initPlayerEvents(this._videoPlayer),this._localVideoTrack&&this._videoPlayer.playVideo(this._localVideoTrack),this._videoPlayer.mirror(!!this._mirrorType)):(this._screenPlayer=new WU(y(y({},t),{isScreen:!0})),this._initPlayerEvents(this._screenPlayer),this._localScreenVideoTrack&&this._screenPlayer.playVideo(this._localScreenVideoTrack))):e==h.STREAM_INDEX_MAIN?(null===(r=this._videoPlayer)||void 0===r||r.destroy(),delete this._videoPlayer):(null===(n=this._screenPlayer)||void 0===n||n.destroy(),delete this._screenPlayer)},t.prototype.startLiveTranscoding=function(e){var t;return S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:pV.print("startLiveTranscoding()","transcode: %o",e),lO(e.url,"liveTranscode.url"),this._liveTranscodeConfig=e,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this._room)||void 0===t?void 0:t.controlMessage(yw("started",this._liveTranscodeConfig))];case 2:return n.sent(),[3,4];case 3:throw(r=n.sent())instanceof GI?r:new GI(VI.UNEXPECTED_ERROR,"unexpected error",r);case 4:return[2]}}))}))},t.prototype.updateLiveTranscoding=function(e){var t;return S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:if(pV.print("updateLiveTranscoding()","transcode: %o",e),!this._liveTranscodeConfig)return[2];this._liveTranscodeConfig=KU.exports.assignIn(this._liveTranscodeConfig,e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this._room)||void 0===t?void 0:t.controlMessage(yw("layoutChanged",this._liveTranscodeConfig))];case 2:return n.sent(),[3,4];case 3:throw(r=n.sent())instanceof GI?r:new GI(VI.UNEXPECTED_ERROR,"unexpected error",r);case 4:return[2]}}))}))},t.prototype.stopLiveTranscoding=function(){var e;return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){switch(r.label){case 0:if(pV.print("stopLiveTranscoding()"),!this._liveTranscodeConfig)return[2];delete this._liveTranscodeConfig,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null===(e=this._room)||void 0===e?void 0:e.controlMessage({action:"stopped",type:"transcode"})];case 2:return r.sent(),[3,4];case 3:throw(t=r.sent())instanceof GI?t:new GI(VI.UNEXPECTED_ERROR,"unexpected error",t);case 4:return[2]}}))}))},t.prototype.setBusinessId=function(e){if(pV.print("setBusinessId()","businessId: %s",e),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new GI(VI.INVALID_PARAMS,"The businessId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(e),this._room)throw new GI(VI.ALREADY_IN_ROOM,"You should invoke setBusinessId before joinRoom");nP.setStats({rtc_business_id:e}),this._businessId=e},t.prototype.setUserVisibility=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:if(pV.print("setUserVisibility()","enable: %o",e),e=!!e,this._visibility===e)return[2];if(!this._room)return this._visibility=e,[2];if(this._room.connectionState!==hM.CONNECTED)throw new GI(VI.NOT_CONNECTED_YET,"server not connected");return!e?[4,this._room.unpublish()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this._room.updateUserAttributes({role:e?fV.NORMAL_USER:fV.SILENT_USER})];case 3:return t.sent(),this._visibility=e,[2]}}))}))},t.prototype._initPlayerEvents=function(e){var t=this;e.on("playback_event",(function(r){var n,i;switch(r.eventName){case"timeupdate":return;case"loadeddata":if("audio"===r.type)t.safeEmit(N.onAudioFirstFrameDecoded,{userId:e.userId}),aP.firstRemoteAudioRender("",r.userId);else{var o={userId:e.userId,height:(null===(n=e.domElement)||void 0===n?void 0:n.videoHeight)||0,width:(null===(i=e.domElement)||void 0===i?void 0:i.videoWidth)||0};t.safeEmit(N.onVideoFirstFrameDecoded,o),t.safeEmit(N.onVideoFirstFrameRendered,o),aP.firstRemoteVideoRender("",r.userId)}break;case"autoplay-error":return void t.safeEmit(N.onAutoplayFailed,r)}t.safeEmit(N.onPlayerEvent,r)}))},t.prototype._initLocalTrackEvents=function(e){var t=this;e.on("track-ended",(function(e){var r=!1;e!==t._localScreenAudioTrack&&e!==t._localScreenVideoTrack||(r=!0),t.safeEmit(N.onTrackEnded,{kind:e.getTrack().kind,isScreen:r})}))},t.prototype.setRemoteVideoPlayer=function(e,t){var r,n,i,o,a,s;if(pV.print("setRemoteVideoPlayer()","streamIndex: %o, videoPlayerOption: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),t.renderDom){mO(t);var c=t.userId;if(e==h.STREAM_INDEX_MAIN){var u=new WU(t);this._initPlayerEvents(u),this._remoteVideoPlayer.set(c,u),(d=null===(o=null===(i=this._room)||void 0===i?void 0:i.remoteStreams.get(c))||void 0===o?void 0:o.find((function(e){return!e.isScreen})))&&this._updateVideoPlayerState(d)}else{var d;u=new WU(y(y({},t),{isScreen:!0}));this._remoteScreenPlayer.set(c,u),this._initPlayerEvents(u),(d=null===(s=null===(a=this._room)||void 0===a?void 0:a.remoteStreams.get(c))||void 0===s?void 0:s.find((function(e){return e.isScreen})))&&this._updateVideoPlayerState(d)}}else e==h.STREAM_INDEX_MAIN?(null===(r=this._videoPlayer)||void 0===r||r.destroy(),delete this._videoPlayer):(null===(n=this._screenPlayer)||void 0===n||n.destroy(),delete this._screenPlayer)},t.prototype.setLocalVideoMirrorType=function(e){pV.print("setLocalVideoMirrorType()","mirrorType: %o",e),fO(e,"mirrorType",[m.MIRROR_TYPE_NONE,m.MIRROR_TYPE_RENDER]),this._mirrorType=e,this._videoPlayer&&this._videoPlayer.mirror(!!e)},t.prototype.setAudioPlaybackDevice=function(e){var t;return S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("setAudioPlaybackDevice()","deviceId: %s",e),lO(e,"deviceId"),void 0===HTMLAudioElement.prototype.setSinkId?(pV.print("setAudioPlaybackDevice failed","setSinkId not supported by current browser"),[2]):[4,oU.getDeviceById(e)];case 1:if(!(r=n.sent()))throw new GI(VI.INVALID_DEVICE_ID,"audio playback device id ".concat(e," is invalid"));return this._remoteAudioPlayer.forEach((function(t){t.setPlaybackDevice(e)})),null===(t=this._audioPlayer)||void 0===t||t.setPlaybackDevice(e),this._audioPlaybackDeviceId=e,r&&this.safeEmit(N.onAudioPlaybackDeviceChanged,r),aP.rtcAudioDevice(gD.PLAYOUT_DEVICE_SWITCH,e,0),[2]}}))}))},t.prototype.play=function(e){return S(this,void 0,void 0,(function(){var t;return b(this,(function(r){if(pV.print("play()","userId: %s",e),lO(e,"userId"),(t=this._remoteAudioPlayer.get(e))||(t=this._audioPlayer),!t)throw new GI(VI.INVALID_PARAMS,"Player not found");return[2,t.manuallyPlay()]}))}))},t.prototype.muteLocalAudio=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(pV.print("muteLocalAudio()","muteState: %o",e),fO(e,"muteState",[s.MUTE_STATE_OFF,s.MUTE_STATE_ON]),!this._room)throw new GI(VI.UNPUBLISH_BEFORE_JOIN,"join first");return[2,this._room.muteLocalTrack("audio",e)]}))}))},t.prototype.muteLocalVideo=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(pV.print("muteLocalVideo()","muteState: %o",e),fO(e,"muteState",[s.MUTE_STATE_OFF,s.MUTE_STATE_ON]),!this._room)throw new GI(VI.UNPUBLISH_BEFORE_JOIN,"join first");return[2,this._room.muteLocalTrack("video",e)]}))}))},t.prototype.pauseAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){return pV.print("pauseAllSubscribedStream()","mediaType: %o",e),fO(e,"mediaType",[l.RTC_PAUSE_RESUME_CONTROL_AUDIO,l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO,l.RTC_PAUSE_RESUME_CONTROL_VIDEO]),this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video?[2,Promise.resolve()]:(e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO?this._pauseAllSubscribeState.audio=!0:e===l.RTC_PAUSE_RESUME_CONTROL_VIDEO?this._pauseAllSubscribeState.video=!0:e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO&&(this._pauseAllSubscribeState.audio=!0,this._pauseAllSubscribeState.video=!0),this._room?[2,this._room.pauseAllSubscribedStream(e).then((function(){}))]:[2,Promise.resolve()])}))}))},t.prototype.resumeAllSubscribedStream=function(e){return S(this,void 0,void 0,(function(){var t=this;return b(this,(function(r){return pV.print("resumeAllSubscribedStream()","mediaType: %o",e),fO(e,"mediaType",[l.RTC_PAUSE_RESUME_CONTROL_AUDIO,l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO,l.RTC_PAUSE_RESUME_CONTROL_VIDEO]),this._pauseAllSubscribeState.audio||this._pauseAllSubscribeState.video?(e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO?this._pauseAllSubscribeState.audio=!1:e===l.RTC_PAUSE_RESUME_CONTROL_VIDEO?this._pauseAllSubscribeState.video=!1:e===l.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO&&(this._pauseAllSubscribeState.audio=!1,this._pauseAllSubscribeState.video=!1),this._room?[2,this._room.resumeAllSubscribedStream(e).then((function(){var e,r;null===(r=null===(e=t._room)||void 0===e?void 0:e.remoteStreams)||void 0===r||r.forEach((function(e){Array.isArray(e)&&e.forEach((function(e){t._updateAudioPlayerState(e),t._updateVideoPlayerState(e)}))}))}))]:[2,Promise.resolve()]):[2,Promise.resolve()]}))}))},t.prototype.sendUserMessage=function(e,t){return S(this,void 0,void 0,(function(){return b(this,(function(r){if(lO(e,"userId",1,128),gO(t),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendUserMessage(e,t)]}))}))},t.prototype.sendUserBinaryMessage=function(e,t){return S(this,void 0,void 0,(function(){return b(this,(function(r){if(lO(e,"userId",1,128),function(e,t){if(!(e instanceof ArrayBuffer))throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,", should be ArrayBuffer"))}(t,"message"),gO(t),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendUserMessage(e,t)]}))}))},t.prototype.sendRoomMessage=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(gO(e),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendRoomMessage(e)]}))}))},t.prototype.sendRoomBinaryMessage=function(e){return S(this,void 0,void 0,(function(){return b(this,(function(t){if(gO(e),!this._room||this._room.connectionState!==hM.CONNECTED)throw new GI(VI.IM_BEFORE_JOIN,"join first");return[2,this._room.sendRoomMessage(e,!0)]}))}))},t.prototype.setAudioCaptureConfig=function(e){var t;return void 0===e&&(e={}),S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("setAudioCaptureConfig()","config: %o",e),delete e.deviceId,pO(e),r=this._audioStreamConstraints.deviceId,this._audioStreamConstraints=e,r&&(this._audioStreamConstraints.deviceId=r),this._localAudioTrack?(this._localAudioTrack.audioCaptureConfig=this._audioStreamConstraints,[4,null===(t=this._localAudioTrack)||void 0===t?void 0:t.updateAudioCaptureConfig()]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setVideoCaptureConfig=function(e){var t;return void 0===e&&(e={}),S(this,void 0,void 0,(function(){var r;return b(this,(function(n){switch(n.label){case 0:return pV.print("setVideoCaptureConfig()","config: %o",e),delete e.deviceId,pO(e),r=this._videoStreamConstraints.deviceId,this._videoStreamConstraints=e,r&&(this._videoStreamConstraints.deviceId=r),this._localVideoTrack?(this._localVideoTrack.videoCaptureConfig=this._videoStreamConstraints,[4,null===(t=this._localVideoTrack)||void 0===t?void 0:t.updateVideoCaptureConfig()]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setVideoEncoderConfig=function(e,t){var r,n,i,o,a,s,c,u;return S(this,void 0,void 0,(function(){return b(this,(function(d){if(pV.print("setVideoEncoderConfig()","streamIndex: %o, descriptions: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),function(e,t){if(!Array.isArray(e))throw new GI(VI.INVALID_PARAMS,"Invalid ".concat(t,", should be array"))}(t,"descriptions"),t.length>3&&(t=t.slice(0,3)),t.sort((function(e,t){return t.maxKbps-e.maxKbps})),e===h.STREAM_INDEX_MAIN){if(null===(n=null===(r=this._room)||void 0===r?void 0:r.localStream)||void 0===n?void 0:n.hasPublished){if(1!==this._videoStreamEncodeConfig.length||1!==(null==t?void 0:t.length))throw new GI(VI.INVALID_PARAMS,"After publishing, only non simulcast streams can be modified");null===(o=null===(i=this._room)||void 0===i?void 0:i.localStream)||void 0===o||o.updateVideoBitrate(t)}this._videoStreamEncodeConfig=t}else{if(null===(s=null===(a=this._room)||void 0===a?void 0:a.localScreenStream)||void 0===s?void 0:s.hasPublished){if(1!==this._screenStreamEncodeConfig.length||1!==(null==t?void 0:t.length))throw new GI(VI.INVALID_PARAMS,"After publishing, only non simulcast streams can be modified");null===(u=null===(c=this._room)||void 0===c?void 0:c.localScreenStream)||void 0===u||u.updateVideoBitrate([t[0]])}this._screenStreamEncodeConfig=t}return[2]}))}))},t.prototype.sendSEIMessage=function(e,t,r){var n,i,o,a,s,c;pV.print("sendSEIMessage()","streamIdex: %o, message: %o, repeatCount: %o",e,t,r),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),dO(r,"repeatCount",0,30);var u="string"==typeof t?new Uint8Array(aO.str2ab(t)):t;if(t.length){var d;if(e===h.STREAM_INDEX_MAIN){if(!(null===(i=null===(n=this._room)||void 0===n?void 0:n.localStream)||void 0===i?void 0:i.hasPublished))return;d=null===(o=this._room)||void 0===o?void 0:o.localStream}else{if(!(null===(s=null===(a=this._room)||void 0===a?void 0:a.localScreenStream)||void 0===s?void 0:s.hasPublished))return;d=null===(c=this._room)||void 0===c?void 0:c.localScreenStream}if(u.byteLength>4096)pV.print("sei size must not bigger than 4KB");else{var l=nO();d.seiList.push({content:u,uuid:l,repeatCount:r}),setTimeout((function(){if(d){var e=d.seiList.findIndex((function(e){return e.uuid===l}));e&&d.seiList.splice(e,1)}}),2e3)}}else pV.print("sei message must not be empty")},t.prototype.setAudioVolumeIndicationInterval=function(e){var t=this;pV.print("setAudioVolumeIndicationInterval()","interval %o: ",e),("number"!=typeof e||e<200)&&(e=200);var r=[];this._audioVolumeIndicationTimer&&clearInterval(this._audioVolumeIndicationTimer),this._audioVolumeIndicationTimer=setInterval((function(){var e,n,i,o;r=[],null===(e=t._room)||void 0===e||e.remoteStreams.forEach((function(e,t){var n,i;if(0!==e.length){var o=null===(i=null===(n=e[0])||void 0===n?void 0:n.audioTrack)||void 0===i?void 0:i.getAudioLevel();r.push({userId:t,volume:o||0})}}));var a=null===(n=t._localAudioTrack)||void 0===n?void 0:n.getAudioLevel();r.push({userId:(null===(o=null===(i=t._room)||void 0===i?void 0:i.roomInfo)||void 0===o?void 0:o.userInfo.userId)||"local_user",volume:a||0}),t.safeEmit(N.onAudioVolumeIndication,{speakers:r})}),e)},t.prototype.setVideoSourceType=function(e,t){var r,i,o,a,s;return S(this,void 0,void 0,(function(){var c,u;return b(this,(function(d){switch(d.label){case 0:return pV.print("setVideoSourceType()","index: %o, videoSourceType: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),fO(t,"VideoSourceType",[n.VIDEO_SOURCE_TYPE_EXTERNAL,n.VIDEO_SOURCE_TYPE_INTERNAL]),c=e===h.STREAM_INDEX_MAIN?"video":"screenVideo",this._trackSourceType[c]===t?[3,4]:(this._trackSourceType[c]=t,pV.print("setVideoSourceType","set ".concat(c," source type to ").concat(t)),this._localVideoTrack&&e===h.STREAM_INDEX_MAIN?(t===n.VIDEO_SOURCE_TYPE_EXTERNAL&&this._localVideoTrack.close(),null===(r=this._videoPlayer)||void 0===r||r.stop(),this._localVideoTrack=void 0,u=null===(i=this._room)||void 0===i?void 0:i._roomConfig.isAutoPublish,(null===(o=this._room)||void 0===o?void 0:o.hasPublished)||u?[4,this._updatePublish()]:[3,2]):[3,2]);case 1:d.sent(),d.label=2;case 2:return this._localScreenVideoTrack&&e===h.STREAM_INDEX_SCREEN?(t===n.VIDEO_SOURCE_TYPE_EXTERNAL&&this._localScreenVideoTrack.close(),null===(a=this._screenPlayer)||void 0===a||a.stop(),this._localScreenVideoTrack=void 0,(null===(s=this._room)||void 0===s?void 0:s.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4]):[3,4];case 3:d.sent(),d.label=4;case 4:return[2]}}))}))},t.prototype.setExternalVideoTrack=function(e,t){var r,i,o,a,s;return S(this,void 0,void 0,(function(){var c;return b(this,(function(u){switch(u.label){case 0:if(pV.print("setExternalVideoTrack()","index: %o, track: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),e!==h.STREAM_INDEX_MAIN)return[3,2];if(this._trackSourceType.video!==n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as external first");return this._localVideoTrack=new IU(t,nO()),this._initLocalTrackEvents(this._localVideoTrack),null===(r=this._videoPlayer)||void 0===r||r.playVideo(this._localVideoTrack),c=null===(i=this._room)||void 0===i?void 0:i._roomConfig.isAutoPublish,(null===(o=this._room)||void 0===o?void 0:o.hasPublished)||c?[4,this._updatePublish()]:[3,2];case 1:u.sent(),u.label=2;case 2:if(e!==h.STREAM_INDEX_SCREEN)return[3,4];if(this._trackSourceType.screenVideo!==n.VIDEO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as external first");return this._localScreenVideoTrack=new IU(t,nO()),this._initLocalTrackEvents(this._localScreenVideoTrack),null===(a=this._screenPlayer)||void 0===a||a.playVideo(this._localScreenVideoTrack),(null===(s=this._room)||void 0===s?void 0:s.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4];case 3:u.sent(),u.label=4;case 4:return[2]}}))}))},t.prototype.setAudioSourceType=function(e,t){var r,n,o;return S(this,void 0,void 0,(function(){var a,s;return b(this,(function(c){switch(c.label){case 0:return pV.print("setAudioSourceType()","index: %o, audioSourceType: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),fO(t,"audioSourceType",[i.AUDIO_SOURCE_TYPE_EXTERNAL,i.AUDIO_SOURCE_TYPE_INTERNAL]),a=e===h.STREAM_INDEX_MAIN?"audio":"screenAudio",this._trackSourceType[a]===t?[3,4]:(this._trackSourceType[a]=t,pV.print("setVideoSourceType","set ".concat(a," source type to ").concat(t)),this._localAudioTrack&&e===h.STREAM_INDEX_MAIN?(this._trackSourceType.audio===i.AUDIO_SOURCE_TYPE_EXTERNAL&&this._localAudioTrack.close(),this._localAudioTrack=void 0,s=null===(r=this._room)||void 0===r?void 0:r._roomConfig.isAutoPublish,(null===(n=this._room)||void 0===n?void 0:n.hasPublished)||s?[4,this._updatePublish()]:[3,2]):[3,2]);case 1:c.sent(),c.label=2;case 2:return this._localScreenAudioTrack&&e===h.STREAM_INDEX_SCREEN?(this._trackSourceType.audio===i.AUDIO_SOURCE_TYPE_EXTERNAL&&this._localScreenAudioTrack.close(),this._localScreenAudioTrack=void 0,(null===(o=this._room)||void 0===o?void 0:o.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4]):[3,4];case 3:c.sent(),c.label=4;case 4:return[2]}}))}))},t.prototype.setExternalAudioTrack=function(e,t){var r,n,o;return S(this,void 0,void 0,(function(){var a;return b(this,(function(s){switch(s.label){case 0:if(pV.print("setExternalAudioTrack()","index: %o, track: %o",e,t),fO(e,"streamIndex",[h.STREAM_INDEX_MAIN,h.STREAM_INDEX_SCREEN]),e!==h.STREAM_INDEX_MAIN)return[3,2];if(this._trackSourceType.audio!==i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as external first");return this._localAudioTrack=new AU(t,nO()),this._initLocalTrackEvents(this._localAudioTrack),a=null===(r=this._room)||void 0===r?void 0:r._roomConfig.isAutoPublish,(null===(n=this._room)||void 0===n?void 0:n.hasPublished)||a?[4,this._updatePublish()]:[3,2];case 1:s.sent(),s.label=2;case 2:if(e!==h.STREAM_INDEX_SCREEN)return[3,4];if(this._trackSourceType.screenAudio!==i.AUDIO_SOURCE_TYPE_EXTERNAL)throw new GI(VI.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as external first");return this._localScreenAudioTrack=new AU(t,nO()),this._initLocalTrackEvents(this._localScreenAudioTrack),(null===(o=this._room)||void 0===o?void 0:o.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))},t.prototype._updatePublish=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:if(pV.print("_updatePublish()"),!this._visibility)throw new GI(VI.NO_PUBLISH_PERMISSION,"no publish permission");return[4,this._pubLock.lock()];case 1:if(e=r.sent(),!this._room||this._room.connectionState!==hM.CONNECTED)return e(),[2];r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.publish(this._videoStreamEncodeConfig,this._localVideoTrack,this._localAudioTrack)];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof GI?t:new GI(VI.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype._updateScreenPublish=function(){return S(this,void 0,void 0,(function(){var e,t;return b(this,(function(r){switch(r.label){case 0:return pV.print("_updateScreenPublish()"),[4,this._pubLock.lock()];case 1:if(e=r.sent(),!this._room||this._room.connectionState!==hM.CONNECTED)return e(),[2];r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.publishScreen(this._screenStreamEncodeConfig,this._localScreenVideoTrack,this._localScreenAudioTrack)];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof GI?t:new GI(VI.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype._updateAudioPlayerState=function(e){pV.print("_updateAudioPlayerState()");var t,r=e.userId,n=e.isScreen;if(t=n?this._remoteAudioPlayer.get("".concat(r,"_screen")):this._remoteAudioPlayer.get(r),e.audioTrack){if(!t){var i=n?"".concat(r,"_screen"):r;t=new YU(i),this._initPlayerEvents(t),this._remoteAudioPlayer.set(i,t),this._audioPlaybackDeviceId&&t.setPlaybackDevice(this._audioPlaybackDeviceId)}t.playAudio(e.audioTrack)}else null==t||t.stop()},t.prototype._updateVideoPlayerState=function(e){pV.print("_updateVideoPlayerState()");var t,r=e.userId;t=e.isScreen?this._remoteScreenPlayer.get(r):this._remoteVideoPlayer.get(r),e.videoTrack?t&&t.playVideo(e.videoTrack,e):null==t||t.stop()},t.prototype._onAddStream=function(e){var t,r,n,i,o=e.stream,a={userId:o.userId,isScreen:o.isScreen,hasVideo:o.hasVideo,hasAudio:o.hasAudio,videoStreamDescriptions:o.attributes.videoDescriptions};this.safeEmit(N.onStreamAdd,{stream:a});var s=null;(null===(t=this._roomConfig)||void 0===t?void 0:t.isAutoSubscribeAudio)&&(s=p.AUDIO_ONLY),(null===(r=this._roomConfig)||void 0===r?void 0:r.isAutoSubscribeVideo)&&(s=p.VIDEO_ONLY),(null===(n=this._roomConfig)||void 0===n?void 0:n.isAutoSubscribeVideo)&&(null===(i=this._roomConfig)||void 0===i?void 0:i.isAutoSubscribeAudio)&&(s=p.AUDIO_AND_VIDEO),pV.print("_onAddStream","autoSubType: ".concat(s)),null===s||o.isScreen||this.subscribeUserStream(o.userId,s)},t.prototype._onRemoveStream=function(e){var t=e.stream,r={userId:t.userId,isScreen:t.isScreen,hasVideo:t.hasVideo,hasAudio:t.hasAudio,videoStreamDescriptions:[]},n=vV[e.reason]||_.STREAM_REMOVE_REASON_OTHER;this.safeEmit(N.onStreamRemove,{stream:r,reason:n}),this._stopRemotePlayer(t.userId,t.isScreen)},t.prototype._onUserConnection=function(e){this.safeEmit(N.onUserJoined,e)},t.prototype._onUserDisconnection=function(e){var t,r,n,i;(null===(t=null==e?void 0:e.userInfo)||void 0===t?void 0:t.userId)===(null===(i=null===(n=null===(r=this._room)||void 0===r?void 0:r.roomInfo)||void 0===n?void 0:n.userInfo)||void 0===i?void 0:i.userId)?"userDuplicateLogin"===(null==e?void 0:e.reason)&&this.safeEmit(N.onError,{errorCode:VI.DUPLICATE_LOGIN}):this.safeEmit(N.onUserLeave,{userInfo:e.userInfo,reason:"userLeave"===e.reason?0:1})},t.prototype._onConnectionStateChange=function(e){this.safeEmit(N.onConnectionStateChanged,e)},t.prototype._stopRemotePlayer=function(e,t){var r=t?"".concat(e,"_screen"):e,n=this._remoteAudioPlayer.get(r),i=this._remoteVideoPlayer.get(r);n&&n.stop(),i&&i.stop()},t.prototype._onResubscribe=function(e){e.stream&&(this._stopRemotePlayer(e.stream.userId,e.stream.isScreen),this._updateAudioPlayerState(e.stream),this._updateVideoPlayerState(e.stream))},t.prototype._onSubscribePushTrack=function(e){e.stream&&this._updateAudioPlayerState(e.stream)},t.prototype._onRemovePushTrack=function(e){e.stream&&this._updateAudioPlayerState(e.stream)},t.prototype._onVideoFirstFrameDecoded=function(e){this.safeEmit(N.onVideoFirstFrameDecoded,e)},t.prototype._onDeviceStateChange=function(e){this.safeEmit(N.onMediaDeviceStateChanged,e)},t.prototype._onUserMuteAudio=function(e){this.safeEmit(N.onUserMuteAudio,e)},t.prototype._onUserMuteVideo=function(e){this.safeEmit(N.onUserMuteVideo,e)},t.prototype._onCustomMessage=function(e){var t=e.message;e.binary?this.safeEmit(N.onRoomBinaryMessageReceived,{userId:e.clientId,message:t}):this.safeEmit(N.onRoomMessageReceived,{userId:e.clientId,message:t})},t.prototype._onUserMessageReceived=function(e){this.safeEmit(N.onUserMessageReceived,e)},t.prototype._onUserBinaryMessageReceived=function(e){this.safeEmit(N.onUserBinaryMessageReceived,e)},t.prototype._onLiveTranscodingResult=function(e){this.safeEmit(N.onLiveTranscodingResult,e)},E([sP()],t.prototype,"updateToken",null),E([sP()],t.prototype,"switchCamera",null),E([sP()],t.prototype,"switchMicrophone",null),E([sP()],t.prototype,"joinRoom",null),E([sP()],t.prototype,"leaveRoom",null),E([sP()],t.prototype,"destroy",null),E([sP()],t.prototype,"publish",null),E([sP()],t.prototype,"unpublish",null),E([sP()],t.prototype,"subscribeUserStream",null),E([sP()],t.prototype,"unSubscribe",null),E([sP()],t.prototype,"startVideoCapture",null),E([sP()],t.prototype,"stopVideoCapture",null),E([sP()],t.prototype,"startAudioCapture",null),E([sP()],t.prototype,"stopAudioCapture",null),E([sP()],t.prototype,"getAudioMixingManager",null),E([sP()],t.prototype,"startScreenCapture",null),E([sP()],t.prototype,"stopScreenCapture",null),E([sP()],t.prototype,"publishScreen",null),E([sP()],t.prototype,"unpublishScreen",null),E([sP()],t.prototype,"setLocalVideoPlayer",null),E([sP()],t.prototype,"startLiveTranscoding",null),E([sP()],t.prototype,"updateLiveTranscoding",null),E([sP()],t.prototype,"stopLiveTranscoding",null),E([sP()],t.prototype,"setBusinessId",null),E([sP()],t.prototype,"setUserVisibility",null),E([sP()],t.prototype,"setRemoteVideoPlayer",null),E([sP()],t.prototype,"setLocalVideoMirrorType",null),E([sP()],t.prototype,"setAudioPlaybackDevice",null),E([sP()],t.prototype,"play",null),E([sP()],t.prototype,"muteLocalAudio",null),E([sP()],t.prototype,"muteLocalVideo",null),E([sP()],t.prototype,"pauseAllSubscribedStream",null),E([sP()],t.prototype,"resumeAllSubscribedStream",null),E([sP()],t.prototype,"sendUserMessage",null),E([sP()],t.prototype,"sendUserBinaryMessage",null),E([sP()],t.prototype,"sendRoomMessage",null),E([sP()],t.prototype,"sendRoomBinaryMessage",null),E([sP()],t.prototype,"setAudioCaptureConfig",null),E([sP()],t.prototype,"setVideoCaptureConfig",null),E([sP()],t.prototype,"setVideoEncoderConfig",null),E([sP()],t.prototype,"sendSEIMessage",null),E([sP()],t.prototype,"setAudioVolumeIndicationInterval",null),E([sP()],t.prototype,"setVideoSourceType",null),E([sP()],t.prototype,"setExternalVideoTrack",null),E([sP()],t.prototype,"setAudioSourceType",null),E([sP()],t.prototype,"setExternalAudioTrack",null),t}(UO),vV={"client unpublished":_.STREAM_REMOVE_REASON_UNPUBLISH,"publish failed":_.STREAM_REMOVE_REASON_PUBLISH_FAILED,"stream removed":_.STREAM_REMOVE_REASON_KEEP_LIVE_FAILED,"client disconnected":_.STREAM_REMOVE_REASON_CLIENT_DISCONNECTED,"client republish":_.STREAM_REMOVE_REASON_REPUBLISH},mV=new PO("VERTC",0),gV=function(e){return mV.print("createEngine","Invoke VERTC.createEngine"),lO(e,"appId"),nP.setStats({rtc_app_id:e,rtc_sdk_version:AV(),product_line:Kk.RTC,report_version:Xk.W_5,os:qk.WEB,device_id:TP.getDeviceId()}),aP.sdkInitEngine(Date.now(),ID.BEGIN),new _V(e)},yV=function(e){if(mV.print("destroyEngine","Invoke VERTC.destroyEngine"),!(e instanceof _V))throw new GI(VI.INVALID_ENGINE,"Invalid engine object");e.destroy(),aP.sdkInitEngine(Date.now(),ID.END)},EV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getDevices()]}))}))},SV=function(e){return void 0===e&&(e={video:!0,audio:!0}),S(void 0,void 0,void 0,(function(){var t,r,n,i,o;return b(this,(function(a){switch(a.label){case 0:if(t=e.video,r=e.audio,n={video:!1,audio:!1},!t)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),i=n,[4,oU.getVideoPermission()];case 2:return i.video=a.sent(),[3,4];case 3:return a.sent(),[3,4];case 4:if(!r)return[3,8];a.label=5;case 5:return a.trys.push([5,7,,8]),o=n,[4,oU.getAudioPermission()];case 6:return o.audio=a.sent(),[3,8];case 7:return a.sent(),[3,8];case 8:return[2,n]}}))}))},bV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getMicrophones()]}))}))},TV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getCameras()]}))}))},IV=function(){return S(void 0,void 0,void 0,(function(){return b(this,(function(e){return[2,oU.getAudioPlayback()]}))}))},AV=function(){return vw.VERSION},RV=new function(){this.getSdkVersion=AV,this.createEngine=gV,this.destroyEngine=yV,this.getDevices=EV,this.enableDevices=SV,this.getMicrophones=bV,this.getCameras=TV,this.getAudioPlayback=IV,this.getParameter=gw,this.setParameter=mw,this.isSupported=rM,this.events=N,this.ErrorCode=VI,this.platform="BytePlus"};return y(y(y(y({},RV),w),k),{events:N})}));