diff --git a/dist/index.esm.js b/dist/index.esm.js index ad0859f..3420ab5 100644 --- a/dist/index.esm.js +++ b/dist/index.esm.js @@ -1 +1 @@ -function e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function t(t){for(var o=1;o=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function d(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},u(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var c=function(){return c=Object.assign||function(e){for(var t,o=1,n=arguments.length;o0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=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 m(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,r,i=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s}function v(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,o=this,n=o.hasError,r=o.isStopped,i=o.observers;return n||r?A:(this.currentObservers=null,i.push(e),new I((function(){t.currentObservers=null,E(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,o=t.hasError,n=t.thrownError,r=t.isStopped;o?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new $;return e.source=this,e},t.create=function(e,t){return new Z(e,t)},t}($),Z=function(e){function t(t,o){var n=e.call(this)||this;return n.destination=t,n.source=o,n}return l(t,e),t.prototype.next=function(e){var t,o;null===(o=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===o||o.call(t,e)},t.prototype.error=function(e){var t,o;null===(o=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===o||o.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,o;return null!==(o=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==o?o:A},t}(Q),Y=function(e){function t(t){var o=e.call(this)||this;return o._value=t,o}return l(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var o=e.prototype._subscribe.call(this,t);return!o.closed&&t.next(this._value),o},t.prototype.getValue=function(){var e=this,t=e.hasError,o=e.thrownError,n=e._value;if(t)throw o;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Q),X={now:function(){return(X.delegate||Date).now()},delegate:void 0},ee=function(e){function t(t,o,n){void 0===t&&(t=1/0),void 0===o&&(o=1/0),void 0===n&&(n=X);var r=e.call(this)||this;return r._bufferSize=t,r._windowTime=o,r._timestampProvider=n,r._buffer=[],r._infiniteTimeWindow=!0,r._infiniteTimeWindow=o===1/0,r._bufferSize=Math.max(1,t),r._windowTime=Math.max(1,o),r}return l(t,e),t.prototype.next=function(t){var o=this,n=o.isStopped,r=o._buffer,i=o._infiniteTimeWindow,s=o._timestampProvider,a=o._windowTime;n||(r.push(t),!i&&r.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),o=this._infiniteTimeWindow,n=this._buffer.slice(),r=0;r0?e.prototype.requestAsyncId.call(this,t,o,n):(t.actions.push(this),t._scheduled||(t._scheduled=de.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,o,n){var r;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,o,n);var i=t.actions;null!=o&&(null===(r=i[i.length-1])||void 0===r?void 0:r.id)!==o&&(de.clearImmediate(o),t._scheduled===o&&(t._scheduled=void 0))},t}(ne),le=function(){function e(t,o){void 0===o&&(o=e.now),this.schedulerActionCtor=t,this.now=o}return e.prototype.schedule=function(e,t,o){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(o,t)},e.now=X.now,e}(),ce=function(e){function t(t,o){void 0===o&&(o=le.now);var n=e.call(this,t,o)||this;return n.actions=[],n._active=!1,n}return l(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var o;this._active=!0;do{if(o=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,o){for(;e=t.shift();)e.unsubscribe();throw o}}},t}(le),pe=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var o,n=this.actions;e=e||n.shift();do{if(o=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw o}},t}(ce))(ue),he=new ce(ne),me=he,ve=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n.scheduler=t,n.work=o,n}return l(t,e),t.prototype.schedule=function(t,o){return void 0===o&&(o=0),o>0?e.prototype.schedule.call(this,t,o):(this.delay=o,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,o){return o>0||this.closed?e.prototype.execute.call(this,t,o):this._execute(t,o)},t.prototype.requestAsyncId=function(t,o,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,o,n):(t.flush(this),0)},t}(ne),ge=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(ce))(ve),fe=new $((function(e){return e.complete()}));function ye(e){return e&&y(e.schedule)}function Se(e){return e[e.length-1]}function be(e){return y(Se(e))?e.pop():void 0}function Ee(e){return ye(Se(e))?e.pop():void 0}var Ie=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Ae(e){return y(null==e?void 0:e.then)}function Ce(e){return y(e[x])}function _e(e){return Symbol.asyncIterator&&y(null==e?void 0:e[Symbol.asyncIterator])}function Re(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var we="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Oe(e){return y(null==e?void 0:e[we])}function Te(e){return function(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=o.apply(e,t||[]),i=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){r[e]&&(n[e]=function(t){return new Promise((function(o,n){i.push([e,t,o,n])>1||a(e,t)}))})}function a(e,t){try{!function(e){e.value instanceof g?Promise.resolve(e.value.v).then(d,u):l(i[0][2],e)}(r[e](t))}catch(e){l(i[0][3],e)}}function d(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}(this,arguments,(function(){var t,o,n;return p(this,(function(r){switch(r.label){case 0:t=e.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,g(t.read())];case 3:return o=r.sent(),n=o.value,o.done?[4,g(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,g(n)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function De(e){return y(null==e?void 0:e.getReader)}function Pe(e){if(e instanceof $)return e;if(null!=e){if(Ce(e))return r=e,new $((function(e){var t=r[x]();if(y(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ie(e))return n=e,new $((function(e){for(var t=0;t0&&c(r)}),void 0,void 0,(function(){(null==i?void 0:i.closed)||null==i||i.unsubscribe(),a=null}))),!u&&c(null!=n?"number"==typeof n?n:+n-d.now():r)}))}function Ge(e){throw new $e(e)}function ze(e,t){return G((function(o,n){var r=0;o.subscribe(z(n,(function(o){n.next(e.call(t,o,r++))})))}))}var Ke=Array.isArray;function qe(e){return ze((function(t){return function(e,t){return Ke(t)?e.apply(void 0,v([],m(t))):e(t)}(e,t)}))}var Je=Array.isArray,Qe=Object.getPrototypeOf,Ze=Object.prototype,Ye=Object.keys;function Xe(e,t,o){return void 0===o&&(o=1/0),y(t)?Xe((function(o,n){return ze((function(e,r){return t(o,e,n,r)}))(Pe(e(o,n)))}),o):("number"==typeof t&&(o=t),G((function(t,n){return function(e,t,o,n,r,i,s,a){var d=[],u=0,l=0,c=!1,p=function(){!c||d.length||u||t.complete()},h=function(e){return u=2))}function At(e){return G((function(t,o){var n=!1,r=0;t.subscribe(z(o,(function(t){return(n||(n=!e(t,r++)))&&o.next(t)})))}))}function Ct(){for(var e=[],t=0;t1?o-1:0),r=1;r1?t-1:0),n=1;n2?o-2:0),s=2;s2?o-2:0),r=2;r{const t=e(...o);if(!t)throw new TypeError(`combineEpics: one of the provided Epics "${e.name||""}" does not return a stream. Double check you're not missing a return statement!`);return t.pipe(gt(((e,t)=>(setTimeout((()=>{throw e}),0),t))))})))};try{Object.defineProperty(n,"name",{value:`combineEpics(${t.map((e=>e.name||"")).join(", ")})`})}catch(e){}return n}function fn(){for(var e=arguments.length,t=new Array(e),o=0;oObject.values(e))))}function yn(e,t){return e.pipe($t(`${Uo}`),mt((e=>e.payload.evt===t)))}function Sn(e,t){return e.pipe($t(`${Ho}`),mt((e=>e.payload.evt===t)))}function bn(e,t){return e.pipe($t(`${xo}`),mt((e=>e.payload.evt===t)))}function En(e,t){return e.pipe($t(`${Uo}`,`${Ho}`),mt((e=>e.payload.evt===t)))}function In(e,t){return e.pipe($t(`${Qo}`),mt((e=>Array.isArray(t)?t.indexOf(e.payload.type)>-1:e.payload.type===t)))}function An(e,t){return e.pipe($t(`${Jo}`),mt((()=>{const{media:{assetsPath:e,mediaConstraints:o}}=t.value;return void 0!==e&&void 0!==o})),_t((()=>{const{media:{isMediaAgentInitialized:o}}=t.value;return o?Ue([0]):e.pipe($t(`${pn}`),mt((e=>!!e.payload)),ft(1))})))}const Cn="3.7.5",_n=Cn,Rn="function"==typeof atob,wn="function"==typeof btoa,On="function"==typeof Buffer,Tn="function"==typeof TextDecoder?new TextDecoder:void 0,Dn="function"==typeof TextEncoder?new TextEncoder:void 0,Pn=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),kn=(()=>{let e={};return Pn.forEach(((t,o)=>e[t]=o)),e})(),Mn=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ln=String.fromCharCode.bind(String),Nn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Vn=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),Un=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),jn=e=>{let t,o,n,r,i="";const s=e.length%3;for(let s=0;s255||(n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=o<<16|n<<8|r,i+=Pn[t>>18&63]+Pn[t>>12&63]+Pn[t>>6&63]+Pn[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},xn=wn?e=>btoa(e):On?e=>Buffer.from(e,"binary").toString("base64"):jn,Bn=On?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let o=0,n=e.length;ot?Vn(Bn(e)):Bn(e),Hn=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Ln(192|t>>>6)+Ln(128|63&t):Ln(224|t>>>12&15)+Ln(128|t>>>6&63)+Ln(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Ln(240|t>>>18&7)+Ln(128|t>>>12&63)+Ln(128|t>>>6&63)+Ln(128|63&t)},$n=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Wn=e=>e.replace($n,Hn),Gn=On?e=>Buffer.from(e,"utf8").toString("base64"):Dn?e=>Bn(Dn.encode(e)):e=>xn(Wn(e)),zn=(e,t=!1)=>t?Vn(Gn(e)):Gn(e),Kn=e=>zn(e,!0),qn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Jn=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 Ln(55296+(t>>>10))+Ln(56320+(1023&t));case 3:return Ln((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Ln((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Qn=e=>e.replace(qn,Jn),Zn=e=>{if(e=e.replace(/\s+/g,""),!Mn.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,o,n,r="";for(let i=0;i>16&255):64===n?Ln(t>>16&255,t>>8&255):Ln(t>>16&255,t>>8&255,255&t);return r},Yn=Rn?e=>atob(Un(e)):On?e=>Buffer.from(e,"base64").toString("binary"):Zn,Xn=On?e=>Nn(Buffer.from(e,"base64")):e=>Nn(Yn(e).split("").map((e=>e.charCodeAt(0)))),er=e=>Xn(or(e)),tr=On?e=>Buffer.from(e,"base64").toString("utf8"):Tn?e=>Tn.decode(Xn(e)):e=>Qn(Yn(e)),or=e=>Un(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),nr=e=>tr(or(e)),rr=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ir=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,rr(t));e("fromBase64",(function(){return nr(this)})),e("toBase64",(function(e){return zn(this,e)})),e("toBase64URI",(function(){return zn(this,!0)})),e("toBase64URL",(function(){return zn(this,!0)})),e("toUint8Array",(function(){return er(this)}))},sr=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,rr(t));e("toBase64",(function(e){return Fn(this,e)})),e("toBase64URI",(function(){return Fn(this,!0)})),e("toBase64URL",(function(){return Fn(this,!0)}))},ar={version:Cn,VERSION:_n,atob:Yn,atobPolyfill:Zn,btoa:xn,btoaPolyfill:jn,fromBase64:nr,toBase64:zn,encode:zn,encodeURI:Kn,encodeURL:Kn,utob:Wn,btou:Qn,decode:nr,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:Fn,toUint8Array:er,extendString:ir,extendUint8Array:sr,extendBuiltins:()=>{ir(),sr()}};function dr(e){return ar.encode(e,!0)}function ur(e){return ar.decode(e)}function lr(e){return ar.encode(e,!1)}const cr={"-":"+",_:"/",".":"="};function pr(e){const t=e.replace(/[-_.]/g,(e=>cr[e]));return Uint8Array.from(window.atob(t),(e=>e.charCodeAt(0)))}const hr=e=>{const t=e.charCodeAt(0);return t<=parseInt("0x7F",16)?1:t<=parseInt("0x7FF",16)?2:t<=parseInt("0xFFFF",16)?3:t<=parseInt("0x1FFFFF",16)?4:t<=parseInt("0x3FFFFFF",16)?5:6},mr=(e,t)=>{const o=e.split(".").map((e=>Number(e))).slice(0,3),n=t.split(".").map((e=>Number(e))).slice(0,3);let r=0;for(let e=0;e<3;e++){const t=ei){r=1;break}}return r},vr=e=>{var t;let o=(new Date).getTime(),n=1e3*(null===(t=performance)||void 0===t?void 0:t.now())||0;const r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{let t=16*Math.random();return o>0?(t=(o+t)%16|0,o=Math.floor(o/16)):(t=(n+t)%16|0,n=Math.floor(n/16)),("x"===e?t:3&t|8).toString(16)}));return"string"==typeof e||"number"==typeof e?r+":"+e:r+""};function gr(e,t){if(e===t)return!0;if(!e||!t)return!1;const o=Object.keys(e),n=Object.keys(t),r=o.length;if(n.length!==r)return!1;for(let n=0;ne>>10==t>>10,yr=(e,t)=>new Promise((o=>{setTimeout((()=>{o(e())}),t)})),Sr=e=>{const t=`${Math.floor(1e4*Math.random())}`;return e.indexOf("@")>-1?e.replace("@",t):`${e}${t}`},br=e=>{try{const t=new URL(e);return!("data:"===t.protocol&&"null"===t.origin)&&t.origin!==location.origin}catch(e){return!0}},Er=e=>{const t=e.split(".")[1];if("string"==typeof t){let o=t.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{const e=decodeURIComponent(window.atob(o).replace(/(.)/g,(function(e,t){let o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o})));return JSON.parse(e)}catch(e){console.error("Invalid token specified: invalid base64")}}};function Ir(e){return e&&e.endsWith("/")?e.slice(0,e.length-1):e}function Ar(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Cr(e){return`${e.tagName}${e.id?`#${e.id}`:""}${e.className?`${e.className.split(" ").map((e=>`.${e}`)).join("")}`:""}`}function _r(e){const t=function(e){const t=e&&e.getRootNode();if(t&&"#document"!==t.nodeName&&t.host)return Cr(t.host)}(e);return`${t?`${t}>`:""}${Cr(e)}`}function Rr(e){return"object"==typeof e&&null!==e?e instanceof HTMLElement?_r(e):ArrayBuffer.isView(e)?Ar(e.buffer):Array.isArray(e)?e.map((e=>Rr(e))):Object.keys(e).reduce(((t,o)=>({...t,[`${o}`]:Rr(e[o])})),{}):e}let wr=function(e){return e[e.Success=0]="Success",e[e.MeetingIsOver=6]="MeetingIsOver",e[e.UserFull=9]="UserFull",e[e.MeetingLocked=9]="MeetingLocked",e[e.WebinarBlockedEmail=3033]="WebinarBlockedEmail",e[e.MeetingNotStarted=3008]="MeetingNotStarted",e[e.MeetingHasClosed=103003]="MeetingHasClosed",e[e.UserHasBeenRemoved=103039]="UserHasBeenRemoved",e[e.MMRIBReject=103043]="MMRIBReject",e[e.MMRConfParticipantExists=103044]="MMRConfParticipantExists",e}({}),Or=function(e){return e[e.Unknown=0]="Unknown",e[e.Normal=1]="Normal",e[e.Userrequest=2]="Userrequest",e[e.SdkConnection=3]="SdkConnection",e[e.Reconnect=5]="Reconnect",e[e.PtRequest=6]="PtRequest",e[e.KickedByHost=7]="KickedByHost",e[e.EndByHost=8]="EndByHost",e[e.EndByHostStartAnotherMeeting=9]="EndByHostStartAnotherMeeting",e[e.FreeMeetingTimeout=10]="FreeMeetingTimeout",e[e.JBHTimeout=11]="JBHTimeout",e[e.EndBySingleStatus=12]="EndBySingleStatus",e[e.WebinarNeedRegister=13]="WebinarNeedRegister",e[e.ArchiveFail=14]="ArchiveFail",e[e.EndByNone=15]="EndByNone",e[e.EndByAdmin=16]="EndByAdmin",e[e.DuplicateSession=17]="DuplicateSession",e[e.MeetingTransfer=18]="MeetingTransfer",e}({}),Tr=function(e){return e[e.WaitingRoomFailover=1]="WaitingRoomFailover",e[e.WebEndAndRejoin=2]="WebEndAndRejoin",e}({}),Dr=function(e){return e[e.Success=0]="Success",e[e.CommonError=200]="CommonError",e[e.WrongPasscode=3004]="WrongPasscode",e[e.RoleTypeMissing=3010]="RoleTypeMissing",e[e.InvalidParameter=4003]="InvalidParameter",e}({}),Pr=function(e){return e[e.Success=0]="Success",e[e.AnotherMeetingInProgress=3e3]="AnotherMeetingInProgress",e[e.MeetingNotExist=3001]="MeetingNotExist",e[e.NotHost=3003]="NotHost",e[e.WrongPasscode=3004]="WrongPasscode",e[e.MissingEmail=3005]="MissingEmail",e[e.MeetingNotStarted=3008]="MeetingNotStarted",e[e.UserHasBeenRemoved=3009]="UserHasBeenRemoved",e[e.RoleTypeMissing=3010]="RoleTypeMissing",e[e.WebinarEnforceLogin=3034]="WebinarEnforceLogin",e[e.RealNameMissing=3082]="RealNameMissing",e[e.RegisterRequired=3099]="RegisterRequired",e[e.SsoLoginWindow=6024]="SsoLoginWindow",e[e.ZoomLoginWindow=3051]="ZoomLoginWindow",e[e.ZoomSpecificLoginWindow=3052]="ZoomSpecificLoginWindow",e[e.LoginRequired=3100]="LoginRequired",e[e.Reconnecting=4e3]="Reconnecting",e[e.Disconnect=4001]="Disconnect",e[e.InvalidParameter=4003]="InvalidParameter",e[e.DeniedRegisterWithPanelist=3032]="DeniedRegisterWithPanelist",e[e.ServiceOffline=403]="ServiceOffline",e[e.RwcEmpty=3621]="RwcEmpty",e[e.RwcError=3622]="RwcError",e[e.FrequentCall=3633]="FrequentCall",e[e.FrequentJoin=3634]="FrequentJoin",e[e.WasmFail=3635]="WasmFail",e[e.CommonError=200]="CommonError",e[e.Upgrade=1e4]="Upgrade",e}({});Pr.Success,Pr.RegisterRequired,Pr.LoginRequired,Pr.SsoLoginWindow,Pr.ZoomLoginWindow,Pr.ZoomSpecificLoginWindow,Pr.MissingEmail,Pr.MeetingNotExist,Pr.NotHost,Pr.WrongPasscode,Pr.RoleTypeMissing,Pr.AnotherMeetingInProgress,Pr.MeetingNotStarted,Pr.InvalidParameter,Pr.Reconnecting,Pr.UserHasBeenRemoved,Pr.WebinarEnforceLogin,Pr.Disconnect,Pr.DeniedRegisterWithPanelist,Pr.RwcEmpty,Pr.RwcError,Pr.FrequentCall,Pr.FrequentJoin,Pr.WasmFail,Pr.Upgrade;const kr={3004:{"apac.errorcodes_pac_mn_wrong":3714},3005:{"apac.errorcodes_web_has_in_progress":3e3},3008:{"apac.errorcodes_not_start":3008},3027:{"apac.errorcodes_host_email_as_attendee":3627},3033:{"apac.errorcodes_denied_email":3620},1005:{"apac.errorcodes_no_response_from_web":3621},131005:{"apac.errorcodes_no_response_from_web":3621},1001:{"apac.errorcodes_host_inactive":3625},131001:{"apac.errorcodes_host_inactive":3625},131013:{"meeting ended":4004},103039:{"apac.errorcodes_be_removed":3009},6:{"meeting ended":4004},9:{"meeting is at capacity":4005},12:{"meeting locked":4006},103043:{"reject for information barriers":4007},103044:{"participant exist":4008}};function Mr(e,t){let o={code:200,i18nKey:"apac.errorcodes_fail"};if(void 0!==kr[e]){const t=kr[e],n=Object.keys(t)[0];return o={code:t[n],i18nKey:n},{reason:n.startsWith("apac")?"":n,errorCode:o.code}}return{code:200,reason:"connection error"}}const Lr=["bLock","bHoldUponEntry","viewOnly","listenOnlyPhone","bAllowRaiseHand","bAllowAttendeeRename","bBroadcast","bAllowPlayChimeForEnterOrExit","bIbDisableShare","bIbDisableChat","encryptKey","bNoHostTimeOut","bAllowShowCount","bHasAST","bHasRMC","gatewayKey","encryptKey"],Nr={bChime:"bAllowPlayChimeForEnterOrExit",bHasAST:"hasAst",bHasRMC:"hasRmc",topic:e=>({meetingTopic:ur(e)}),gatewayKey:e=>{const[,t,o]=e.split(".");return t&&o?{gatewayUser:{userId:Number(t),sn:o}}:{}},encryptKey:e=>({gcmSessinKey:pr(e)})},Vr=so("GET_MEETING_INFO"),Ur=so("GET_INSTANT_MEETING_INFO");so("LOGON_ZOOM_DOMAIN"),so("VERIFY_ZOOM_RECAPTCHA"),so("LOGON_THIRD_PARTY_DOMAIN");const jr=so("PING_RWC_SERVER"),xr=so("MEETING_FAILOVER"),Br=so("LEAVE_MEETING"),Fr=so("LEAVE_WAITING_ROOM"),Hr=so("END_MEETING");so("REGISTER_WEBINAR");const $r=so("TRIGGER_IDLE_CHECK"),Wr=so("END_OF_ZE_WORLD"),{setMeetingInfo:Gr,setMeetingJoinInfo:zr,setWindownOpen:Kr,setAppidSignature:qr,setZtk:Jr,setZsk:Qr,setTkMtkguid:Zr,setPingRwcTimestamp:Yr,setInMeetingInfo:Xr,setMeetingAttribute:ei,resetMeeting:ti,setIsHost:oi,setIsCohost:ni,setMeetingIsOnHold:ri,setIsMeetingReset:ii,setAudioVideoBeforeOnHold:si,setCurrentUserAudioBeforeReset:ai,setIsCurrentUserMutedBeforeReset:di,setMeetingStatus:ui,setMeetingRegion:li,setIsCurrentUserStartVideoBeforeReset:ci,setJoinMeetingTimeStamp:pi,setActiveAppInfo:hi,setMeetingIdleStartTime:mi,setSessionIdleTimeoutMinutes:vi,setIsAudioBridgeEnabled:gi,addDiscardedRwcHost:fi,setSharePronounType:yi,setIsStayAwakeDuringTheSession:Si,setMeetingJoinSuccessTimestamp:bi,resetFailoverRecord:Ei,setFailoverReason:Ii,setIsQuicklyLeaveMeetingAfterRefresh:Ai,setMeetingInfoTimestamp:Ci,setIsEnableZmkFromRwg:_i}=wo({SET_MEETING_INFO:e=>e,SET_MEETING_JOIN_INFO:e=>e,SET_WINDOWN_OPEN:e=>e,SET_APPID_SIGNATURE:e=>e,SET_ZTK:e=>e,SET_ZSK:e=>e,SET_TK_MTKGUID:e=>e,SET_PING_RWC_TIMESTAMP:e=>e,SET_IN_MEETING_INFO:e=>e,SET_MEETING_ATTRIBUTE:e=>{if(Lr.some((t=>e&&void 0!==e[t]))){let t=e;return Object.keys(Nr).some((t=>void 0!==e[t]))&&(t=Object.keys(e).reduce(((t,o)=>{const n=Nr[o];return"function"==typeof n?Object.assign(t,n(e[o])):"string"==typeof n?t[n]=e[o]:(t[o],e[o]),t}),{})),t}return{}},SET_IS_HOST:e=>e&&e.bHost,SET_IS_COHOST:e=>e&&e.bCoHost,RESET_MEETING:e=>e,SET_MEETING_IS_ON_HOLD:e=>e,SET_IS_MEETING_RESET:e=>e,SET_AUDIO_VIDEO_BEFORE_ON_HOLD:e=>e,SET_CURRENT_USER_AUDIO_BEFORE_RESET:e=>e,SET_IS_CURRENT_USER_MUTED_BEFORE_RESET:e=>e,SET_MEETING_STATUS:e=>e,SET_MEETING_REGION:e=>e,SET_IS_CURRENT_USER_START_VIDEO_BEFORE_RESET:e=>e,SET_JOIN_MEETING_TIME_STAMP:e=>e,SET_ACTIVE_APP_INFO:e=>e,SET_MEETING_IDLE_START_TIME:e=>e,SET_SESSION_IDLE_TIMEOUT_MINUTES:e=>e,SET_IS_AUDIO_BRIDGE_ENABLED:e=>e,ADD_DISCARDED_RWC_HOST:e=>e,SET_SHARE_PRONOUN_TYPE:e=>e,SET_IS_STAY_AWAKE_DURING_THE_SESSION:e=>e,SET_MEETING_JOIN_SUCCESS_TIMESTAMP:e=>e,RESET_FAILOVER_RECORD:e=>e,SET_FAILOVER_REASON:e=>e,SET_IS_QUICKLY_LEAVE_MEETING_AFTER_REFRESH:e=>e,SET_MEETING_INFO_TIMESTAMP:e=>e,SET_IS_ENABLE_ZMK_FROM_RWG:e=>e});let Ri=function(e){return e.Failover="failover",e.OnHold="on hold",e.Promote="promote",e.Depromote="depromote",e.JoinBreakoutRoom="join breakout room",e.MoveToBreakoutRoom="move to breakout room",e.BackToMainSession="back to main session",e}({});const wi="js_media.min.js";let Oi=function(e){return e.CDN="CDN",e.Global="Global",e.CN="CN",e}({}),Ti=function(e){return e.Connected="Connected",e.Reconnecting="Reconnecting",e.Closed="Closed",e.Fail="Fail",e}({}),Di=function(e){return e.Initial="initial",e.Joined="joined",e.Closed="closed",e}({}),Pi=function(e){return e.AudioBridgeEnable="M:1,2;V:1,2",e.AudioDecodeInWorklet="M:6;V:3",e.VideoFullHD="M:8;V:4",e.VideoShareFullHD="M:9;V:5",e.WebGL2Render="M:20;V:8",e.WebGPURender="M:21;V:9",e.ZMKFromRWG="M:19;V:10",e}({}),ki=function(e){return e[e.NormalCase=-1]="NormalCase",e[e.NoHeartbeat=0]="NoHeartbeat",e[e.NoHeartbeatMChannel=1]="NoHeartbeatMChannel",e[e.NetworkChange=2]="NetworkChange",e[e.NotifyUiFailover=3]="NotifyUiFailover",e[e.InvalidParameters=4]="InvalidParameters",e[e.OnError=5]="OnError",e[e.OnErrorMChannel=6]="OnErrorMChannel",e[e.Disconnect=7]="Disconnect",e[e.DisconnectMChannel=8]="DisconnectMChannel",e[e.DisconnectXmpp=9]="DisconnectXmpp",e[e.RefreshPage=10]="RefreshPage",e}({});const Mi=["8-29","9-21"];let Li=function(e){return e.LocalStorage="LocalStorage",e.SessionStorage="SessionStorage",e.Memory="Memory",e}({});const Ni=dr("{}");class Vi{constructor(e){this.sessionStorageKey=void 0,this.localStorageKey=void 0,this.sessionCache=void 0,this.localCache=void 0,this.memoryCache=void 0,this.sessionStorageKey=dr(`zoom-storage-${e}`),this.localStorageKey=dr("zoom-local-storage"),this.memoryCache={};try{this.sessionCache=JSON.parse(ur(sessionStorage.getItem(this.sessionStorageKey)||Ni)),this.localCache=JSON.parse(ur(localStorage.getItem(this.localStorageKey)||Ni))}catch(e){console.error(e),this.sessionCache={},this.localCache={}}}static init(e){this.instance=new Vi(e)}static get(e){if(void 0===this.instance)throw new Error("read before initial");return this.instance.getValue(e).value}static set(e,t,o){if(void 0===this.instance)throw new Error("set before initial");return this.instance.setValue(e,t,o)}static remove(e){if(void 0===this.instance)throw new Error("remove before initial");return this.instance.removeValue(e)}static clearSession(){if(void 0===this.instance)throw new Error("clear before initial");return this.instance.memoryCache={},this.instance.sessionCache={},this.instance.localCache={},sessionStorage.removeItem(this.instance.sessionStorageKey)}getValue(e){return this.sessionCache.hasOwnProperty(e)?{value:this.sessionCache[e],type:Li.SessionStorage}:this.localCache.hasOwnProperty(e)?{value:this.localCache[e],type:Li.LocalStorage}:{value:this.memoryCache[e],type:Li.Memory}}setValue(e,t,o){if(!e)throw new Error("key is null");switch(o){case Li.SessionStorage:{const o=this.sessionCache[e];let n=t;return"function"==typeof t&&(n=t(o)),o!==n&&(this.sessionCache[e]=n,this.flushValue(Li.SessionStorage)),n}case Li.LocalStorage:{const o=this.localCache[e];let n=t;return"function"==typeof t&&(n=t(o)),o!==n&&(this.localCache[e]=n,this.flushValue(Li.LocalStorage)),n}case Li.Memory:{const o=this.memoryCache[e];let n=t;return"function"==typeof t&&(n=t(o)),this.memoryCache[e]=n,n}default:return null}}removeValue(e){const{type:t}=this.getValue(e);switch(t){case Li.SessionStorage:delete this.sessionCache[e],this.flushValue(Li.SessionStorage);break;case Li.LocalStorage:delete this.localCache[e],this.flushValue(Li.LocalStorage);break;case Li.Memory:delete this.memoryCache[e]}}flushValue(e){e===Li.SessionStorage?sessionStorage.setItem(this.sessionStorageKey,dr(JSON.stringify(this.sessionCache))):e===Li.LocalStorage&&localStorage.setItem(this.localStorageKey,dr(JSON.stringify(this.localCache)))}}Vi.instance=void 0;let Ui=function(e){return e.WebclientOpt="WEB_CLIENT_OPT",e.WebclientWebinarToken="WEB_CLIENT_WEBINAR_TOKEN",e.WebclientMeetingToken="WEB_CLIENT_MEETING_TOKEN",e.WebclientZtk="WEB_CLIENT_ZTK",e.WebclientZsk="WEB_CLIENT_ZSK",e.WebclientTk="WEB_CLIENT_TK",e.WebclientIVState="WEB_CLIENT_IV_STATE",e.WebclientIsOnHold="WEB_CLIENT_IS_ON_HOLD",e.WebclientParticipantId="WEB_CLIENT_PARTICIPANT_ID",e.WebclientZoomId="WEB_CLIENT_ZOOM_ID",e.WebclientUserName="WEB_CLIENT_USER_NAME",e.WebclientUserEmail="WEB_CLIENT_USER_EMAIL",e.WebclientBreakoutRoomAttendeeStatus="WEB_CLIENT_BO_ATTENDEE_STATUS",e.WebclientBreakoutRoomCommand="WEB_CLIENT_BO_COMMAND",e.WebclientAudioEncryptKey="WEB_CLIENT_AUDIO_ENCRYPT_KEY",e.WebclientVideoEncryptKey="WEB_CLIENT_VIDEO_ENCRYPT_KEY",e.WebclientSharingEncryptKey="WEB_CLIENT_SHARING_ENCRYPT_KEY",e.WebclientFailoverCount="WEB_CLIENT_FAILOVER_COUNT",e.WebclientRecordingToken="WEB_CLIENT_RECORDING_TOKEN",e}({}),ji=function(e){return e.WebclientDeviceId="WEBCLIENT_DEVICE_ID",e.VSDKLogTrackingId="ZM_VSDK_LOG_TRACKING_IDS",e}({}),xi=function(e){return e.EnforceWebRTCAudio="ENFORCE_WEB_RTC_AUDIO",e.DisableAutoReportLogs="DISABLE_AUTO_REPORT_LOGS",e}({});function Bi(e,t){const o=t.match(e);return o&&o.length>0&&o[1]||""}function Fi(e,t){const o=t.match(e);return o&&o.length>1&&o[2]||""}const Hi=/version\/(\d+(\.?_?\d+)+)/i,$i=[{test:[/opera/i],describe:e=>["Opera(Legacy)",Bi(Hi,e)||Bi(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/opr\/|opios/i],describe:e=>["Opera",Bi(/(?:opr|opios)[\s/](\S+)/i,e)||Bi(Hi,e)]},{test:[/SamsungBrowser/i],describe:e=>["Samsung Internet for Android",Bi(Hi,e)||Bi(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/micromessenger/i],describe:e=>["WeChat",Bi(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Bi(Hi,e)]},{test:[/qqbrowser/i],describe:e=>[/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser",Bi(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Bi(Hi,e)]},{test:[/msie|trident/i],describe:e=>["Internet Explorer",Bi(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e)]},{test:[/\sedg\//i],describe:e=>["Microsoft Edge",Bi(/\sedg\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/edg([ea]|ios)/i],describe:e=>["Microsoft Edge(Legacy)",Fi(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/firefox|iceweasel|fxios/i],describe:e=>["Firefox",Bi(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/electron/i],describe:e=>["Electron",Bi(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/chromium/i],describe:e=>["Chromium",Bi(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Bi(Hi,e)]},{test:[/chrome|crios|crmo/i],describe:e=>["Chrome",Bi(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e)]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android Browser",Bi(Hi,e)]},{test:[/safari|applewebkit/i],describe:e=>["Safari",Bi(Hi,e)]}],Wi=[{test:[/windows /i],describe:e=>["Windows",Bi(/Windows ((NT|XP)( \d\d?.\d)?)/i,e)]},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:e=>["iOS",Fi(/(Version\/)(\d[\d.]+)/,e)]},{test:[/macintosh/i],describe:e=>["macOS",Bi(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,".")]},{test:[/(ipod|iphone|ipad)/i],describe:e=>["iOS",Bi(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".")]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android",Bi(/android[\s/-](\d+(\.\d+)*)/i,e)]},{test:[/linux/i],describe:()=>["Linux"]},{test:[/CrOS/],describe:()=>["Chrome OS"]}];class Gi{constructor(){this.value=void 0,this.gpu=void 0}get isSupported(){if(void 0===this.value)if("function"==typeof window.OffscreenCanvas){const e=new OffscreenCanvas(1,1);e.addEventListener("webglcontextlost",(e=>{e.preventDefault()}));const t=e.getContext("webgl");if(this.value=!!t,t){const e=t.getExtension("WEBGL_debug_renderer_info");e&&(this.gpu=t.getParameter(e.UNMASKED_RENDERER_WEBGL))}}else this.value=!1;return this.value}}const zi=new class{constructor(){this._browser=void 0,this._os=void 0,this._browserVersion=void 0,this._osVersion=void 0,this._offscreenCanvasCapality=void 0,this._clientHintsData=void 0,this._offscreenCanvasCapality=new Gi,"userAgentData"in navigator&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","formFactor","model","platformVersion","wow64"]).then((e=>{this._clientHintsData=e,this._os&&this._osVersion&&this._clientHintsData.platform&&this._clientHintsData.platformVersion&&(this._os=this._clientHintsData.platform,this._osVersion=this._clientHintsData.platformVersion)})).catch((e=>{console.warn(e)}))}_getBrowserVersion(){var e,t;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(t=e.brands)&&void 0!==t&&t.length){const e=this._clientHintsData.brands.filter((e=>!/(Chromium|Not.*Brand)/i.test(e.brand)))[0];e&&(this._browser=e.brand);const t=this._clientHintsData.brands.find((e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}));t?(this._browserVersion=t.version,this._browser||(this._browser=t.brand)):this._browserVersion=e.version}else{const e=navigator.userAgent,t=$i.find((t=>"function"==typeof t.test?t.test(e):t.test.some((t=>t.test(e)))));if(t){const o=t.describe(e);this._browser=o[0],this._browserVersion=o[1],this.isIOSMobile&&(this._browser="ios-safari")}else this._browser="unknown",this._browserVersion="0"}}_getOSVersion(){var e,t;if(null!==(e=this._clientHintsData)&&void 0!==e&&e.platform&&null!==(t=this._clientHintsData)&&void 0!==t&&t.platformVersion)this._os=this._clientHintsData.platform,this._osVersion=this._clientHintsData.platformVersion;else{const e=navigator.userAgent,t=Wi.find((t=>"function"==typeof t.test?t.test(e):t.test.some((t=>t.test(e)))));if(t){const o=t.describe(e);this._os=o[0],this._osVersion=o[1]}else this._os="unknown",this._osVersion="0"}}get browser(){return this._browser||this._getBrowserVersion(),this._browser}get browserVersion(){return this._browserVersion||this._getBrowserVersion(),this._browserVersion}get os(){return this._os||this._getOSVersion(),this._os}get osVersion(){return this._osVersion||this._getOSVersion(),this._osVersion}get isIE(){return"Internet Explorer"===this.browser}get isLegacyEdge(){return"Microsoft Edge(Legacy)"===this.browser}get isLegacyOpera(){return"Opera(Legacy)"===this.browser}get isFirefox(){return"Firefox"===this.browser}get isSafari(){return"Safari"===this.browser}get isChrome(){var e,t,o;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(t=e.brands)&&void 0!==t&&t.length)return null===(o=this._clientHintsData)||void 0===o?void 0:o.brands.some((e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLocaleLowerCase())}));const{userAgent:n}=navigator;return!this.isLegacyOpera&&!this.isLegacyEdge&&/chrome/i.test(n)&&/webkit/i.test(n)}get isLegacyChrome(){var e;return this.isChrome&&"function"!=typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getDisplayMedia)}get isMacOS(){return"macOS"===this.os}get isIPad(){var e;return/iPad/i.test(navigator.userAgent)||this.isMacOS&&(null===(e=navigator)||void 0===e?void 0:e.maxTouchPoints)>2}get isIOSMobile(){return"iOS"===this.os||this.isIPad}get architecture(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.architecture)&&void 0!==e?e:""}get isArm(){return this.architecture?"arm"===this.architecture:/arm/i.test(navigator.userAgent)}get isChromeOS(){return"Chrome OS"===this.os}get isAndroidBrowser(){var e;return"android"===(null===(e=this.os)||void 0===e?void 0:e.toLowerCase())}get isArmChromeOS(){return this.isArm&&this.isChromeOS}get isAndroidOrIOSBrowser(){return this.isAndroidBrowser||this.isIOSMobile}get isSupportEssentialAudioAndVideoAbility(){return"object"==typeof WebAssembly&&"function"==typeof Worker}get isSupportAudioWorklet(){return"function"==typeof AudioWorklet}get isSupportImageCapture(){return"ImageCapture"in window}get isSupportMediaStreamTrackProcessor(){return"MediaStreamTrackProcessor"in window}get isSupportOffscreenCanvas(){return this._offscreenCanvasCapality.isSupported}get gpu(){return this._offscreenCanvasCapality.isSupported?this._offscreenCanvasCapality.gpu:""}get bitness(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.bitness)&&void 0!==e?e:""}get model(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.model)&&void 0!==e?e:""}get wow64(){var e;if("windows"===this.os.toLowerCase())return null===(e=this._clientHintsData)||void 0===e?void 0:e.wow64}get isSupportSendScreenSharing(){return"getDisplayMedia"in navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}};function Ki(){return zi.isAndroidOrIOSBrowser||!!Vi.get(xi.EnforceWebRTCAudio)}const qi=()=>zi.isIE,Ji=()=>{var e;return zi.isSupportOffscreenCanvas&&(null===(e=navigator)||void 0===e?void 0:e.hardwareConcurrency)>=2&&"function"==typeof requestAnimationFrame&&"function"==typeof SharedArrayBuffer},Qi=(e,t)=>{var o;const{isSafari:n,isIOSMobile:r,isSupportMediaStreamTrackProcessor:i,isAndroidOrIOSBrowser:s,isArmChromeOS:a,isChromeOS:d,isArm:u,isSupportOffscreenCanvas:l,isIPad:c}=zi;if(!Ji()){const o=n||r,s="function"!=typeof window.SharedArrayBuffer&&(!!o||i&&l);return e&&s?t?25:navigator.hardwareConcurrency<4?2:4:1}return s?t?25:c?9:4:a||d&&!u?navigator.hardwareConcurrency>=4?9:2:(null===(o=navigator)||void 0===o?void 0:o.hardwareConcurrency)<4?2:25};function Zi(){var e;return"webkit"in window&&!("chrome"in window)&&!(null===(e=window.webkit.messageHandlers)||void 0===e||!e.jsOCHelper)}function Yi(){var e;const{isAndroidBrowser:t,isIOSMobile:o,osVersion:n,browserVersion:r,isChrome:i,isFirefox:s,isSafari:a}=zi;var d,u;if(o)return Number(null===(d=n.match(/^\d+/))||void 0===d?void 0:d[0])>=15;if(t)return Number(null===(u=n.match(/^\d+/))||void 0===u?void 0:u[0])>=10;const l=Number(null===(e=r.match(/^\d+/))||void 0===e?void 0:e[0]);return!!(i&&l>=69)||!!(a&&l>14)||!!(s&&l>=76)}let Xi=function(e){return e.VIDEO_ENCODE="0",e.VIDEO_DECODE="1",e.AUDIO_ENCODE="2",e.AUDIO_DECODE="3",e.SHARING_ENCODE="4",e.SHARING_DECODE="5",e}({}),es=function(e){return e[e.NONE=0]="NONE",e[e.AES_256=1]="AES_256",e[e.AES_GCM=2]="AES_GCM",e}({});const ts=Object.freeze({RWG_CHAT:{gcmType:1,sessionType:"RWG_CHAT"},XMPP_CHAT:{gcmType:1,sessionType:"XMPP_CHAT"},CC_MESSAGE:{gcmType:3,sessionType:"CC_MESSAGE"},BO_BROADCAST:{gcmType:1,sessionType:"BO_BROADCAST"},CHAT_FILE:{gcmType:2,sessionType:"CHAT_FILE"},CHAT_FILE_INFO:{gcmType:1,sessionType:"CHAT_FILE_INFO"}}),os=(window.crypto||window.msCrypto).subtle,ns=Ui.WebclientIVState,rs=Object.keys(ts).map((e=>ts[e].sessionType));class is{constructor(e,t,o){this.isGCMEnabled=void 0,this.gcmSessionKey=void 0,this.gcmMainSessionKey=void 0,this.zoomId=void 0,this.resetParameters(e,t,o),Vi.set(ns,{},Li.SessionStorage)}static init(e,t,o){this.instance?this.instance.resetParameters(e,t,o):this.instance=new is(e,t,o)}static destroy(){this.instance&&(this.instance=void 0)}resetParameters(e,t,o){this.isGCMEnabled=!(zi.isIE||!zi.isSupportEssentialAudioAndVideoAbility)&&o===es.AES_GCM,this.gcmSessionKey=pr(t),this.gcmMainSessionKey||(this.gcmMainSessionKey=this.gcmSessionKey),this.zoomId=String(e)}beginCrypto(e,t,o){const n=new Uint32Array(1);n[0]=9,n[0]+=Number(o);const r=new Uint8Array(n.buffer);let i=new Uint8Array(132);const s=pr(t);return i.set(s,0),i.set(r,s.length),i=i.subarray(0,s.length+4),os.importKey("raw",e,{name:"HMAC",hash:"SHA-256"},!0,["sign"]).then((e=>os.sign({name:"HMAC"},e,i))).then((e=>os.importKey("raw",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])))}getNextIV(e){const t=Vi.get(ns);return void 0===t[e]?(t[e]=0,Vi.set(ns,t,Li.SessionStorage)):Vi.set(ns,(t=>({...t,[e]:t[e]+1})),Li.SessionStorage)}resetIVState(){const e=Vi.get(ns);if(void 0===e);else{const t=Object.keys(e).filter((e=>rs.indexOf(e)>-1));t.length>0&&(t.forEach((t=>{e[t]+=1e6})),Vi.set(ns,e,Li.SessionStorage))}}static resetIV(){if(void 0===this.instance)throw new Error("reset before intialize");this.instance.resetIVState()}static beginEncrypt(e){let{text:t,type:o}=e;const n=new Uint8Array(0);if(this.instance&&this.instance.isGCMEnabled){const e=16,r=12,i=this.instance.getNextIV(o.sessionType),s=new ArrayBuffer(r),a=new Uint8Array(s);new DataView(s).setUint32(0,i,!0);let d=null;return d="BO_BROADCAST"===o.sessionType||"XMPP_CHAT"===o.sessionType?this.instance.gcmMainSessionKey:this.instance.gcmSessionKey,this.instance.beginCrypto(d,this.instance.zoomId,o.gcmType).then((o=>{const r=ArrayBuffer.isView(t)?t:(new TextEncoder).encode(t);return os.encrypt({name:"AES-GCM",iv:a,additionalData:n,tagLength:8*e},o,r)})).then((t=>{const r=1+a.byteLength+2+n.byteLength+4+t.byteLength,i=new ArrayBuffer(r);if(new Uint8Array(i)[0]=a.length,new Uint8Array(i,1,a.byteLength).set(a),new DataView(i).setUint16(1+a.byteLength,n.length,!0),new Uint8Array(i,3+a.byteLength).set(n),new DataView(i).setUint32(1+a.byteLength+2+n.byteLength,t.byteLength-e,!0),new Uint8Array(i,1+a.byteLength+2+n.byteLength+4).set(new Uint8Array(t)),o.sessionType===ts.CHAT_FILE.sessionType)return i;const s=new Uint8Array(i).reduce(((e,t)=>e+String.fromCharCode(t)),"");return window.btoa(s).replace(/_/g,"/").replace(/-/g,"+").replace(/\=/g,"")}))}return Promise.resolve(ArrayBuffer.isView(t)?t:dr(t))}static beginDecrypt(e){let{decryptedText:t,type:o,zoomId:n}=e;if(this.instance&&this.instance.isGCMEnabled){const e=ArrayBuffer.isView(t)||t instanceof ArrayBuffer?new Uint8Array(t):function(e){let t;const o=e.length,n=new Array(o);for(t=0;t{const t=function(e,t){e=new Uint8Array(e),t=new Uint8Array(t);const o=new Uint8Array(e.length+t.length);return o.set(e),o.set(t,e.length),o}(c,p);return os.decrypt({name:"AES-GCM",iv:i,additionalData:d,tagLength:8*p.length},e,t.buffer)})).then((e=>({message:o.sessionType===ts.CHAT_FILE.sessionType?e:(new TextDecoder).decode(e),iv:i,aad:d}))).catch((e=>({message:"[This is an encrypted message]",iv:i,aad:d})))}{const e=new TextDecoder("utf-8");return Promise.resolve({message:ArrayBuffer.isView(t)||t instanceof ArrayBuffer?t:e.decode(pr(t))})}}}is.instance=void 0;const ss=20225,as=20234,ds=7937,us=7938,ls=12039,cs=16138,ps=4098,hs=4305,ms=4343,vs=16428;let gs=function(e){return e[e.NoAttendee=0]="NoAttendee",e[e.All=1]="All",e[e.AllPanelist=2]="AllPanelist",e[e.Host=3]="Host",e[e.NoOne=4]="NoOne",e[e.EveryonePublicly=5]="EveryonePublicly",e}({}),fs=function(e){return e[e.AllPanelist=1]="AllPanelist",e[e.Everyone=2]="Everyone",e[e.Invalid=0]="Invalid",e}({}),ys=function(e){return e[e.All=0]="All",e[e.Panelist=1]="Panelist",e[e.IndividualCcPanelist=2]="IndividualCcPanelist",e[e.Individual=3]="Individual",e[e.SilentModeUsers=4]="SilentModeUsers",e}({}),Ss=function(e){return e[e.None=0]="None",e[e.Delete=1]="Delete",e[e.Modify=2]="Modify",e}({}),bs=function(e){return e[e.Success=0]="Success",e[e.Delete=1]="Delete",e[e.Block=3]="Block",e}({});const Es=[gs.All,gs.Host,gs.NoOne,gs.EveryonePublicly],Is=[gs.NoOne,gs.All,gs.AllPanelist],As={AllPanelist:11,Everyone:12},Cs={[As.AllPanelist]:fs.AllPanelist,[As.Everyone]:fs.Everyone},_s={userId:ys.All,displayName:"Everyone",isHost:!1,isCoHost:!1},Rs={userId:ys.Panelist,displayName:"All panelists"},ws={userId:ys.SilentModeUsers,displayName:"Everyone (in Waiting Room)",isHost:!1,isCoHost:!1};let Os=function(e){return e[e.Local=0]="Local",e[e.ThirdParty=1]="ThirdParty",e}({}),Ts=function(e){return e[e.ChunkSize=20971520]="ChunkSize",e[e.EncodeBlockSize=32768]="EncodeBlockSize",e[e.DecodeBlockSize=32803]="DecodeBlockSize",e[e.MaxSize=2147483648]="MaxSize",e[e.ReaderChunkSize=1073741824]="ReaderChunkSize",e}({}),Ds=function(e){return e[e.Init=0]="Init",e[e.InProgress=1]="InProgress",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e[e.Cancel=4]="Cancel",e[e.Complete=5]="Complete",e}({}),Ps=function(e){return e[e.InProgress=1]="InProgress",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e[e.Cancel=4]="Cancel",e}({});const ks={"7z":"application/x-7z-compressed",avi:"video/x-msvideo",bin:"application/octet-stream",bmp:"image/bmp",css:"text/css",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",gif:"image/gif",gz:"application/gzip",html:"text/html",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"text/javascript",json:"application/json",mid:"audio/midi",mov:"video/*",mp3:"audio/mpeg",mp4:"video/mp4",mpeg:"video/*",mpg:"video/*",pdf:"application/pdf",png:"image/png",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",rar:"application/vnd.rar",rtf:"application/rtf",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/wav",webp:"image/webp",wma:"audio/*",wmv:"video/*",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xml:"application/xml",zip:"application/zip"};let Ms=function(e){return e.Open="open",e.Message="message",e.Error="error",e.Close="close",e.Inactive="inactive",e}({});class Ls{constructor(){this.eventHandlers=void 0,this.websocket=void 0,this.seq=void 0,this.intervalsToBeCleardWhenSocketClose=[],this.isAlive=!1,this.eventHandlers=new Map,this.websocket=null,this.seq=1}on(e,t){let o=this.eventHandlers.get(e);o||(o=[]),o.push(t),this.eventHandlers.set(e,o)}off(e,t){const o=this.eventHandlers.get(e);if(o){const n=o.filter((e=>e!==t));this.eventHandlers.set(e,n)}}emit(e,t){const o=this.eventHandlers.get(e);o&&o instanceof Array&&o.slice(0).forEach((e=>{try{e(t)}catch(e){console.error(e)}}))}sendMessageToRwg(e){this.seq+=1;const t=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify(Object.assign(e,{seq:t}))),t}connect(e){this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.addWebSocketEventListeners()}close(){var e;null===(e=this.websocket)||void 0===e||e.close()}addHeartBeat(){const e=zi.isAndroidOrIOSBrowser?15e3:2e4,t=setInterval((()=>{this.isAlive||this.emit(Ms.Inactive,{}),this.sendMessageToRwg({evt:0}),this.isAlive=!1}),e);this.intervalsToBeCleardWhenSocketClose.push(t)}clearIntervals(){this.intervalsToBeCleardWhenSocketClose.forEach((e=>clearInterval(e))),this.isAlive=!1}addWebSocketEventListeners(){this.websocket&&(this.websocket.addEventListener("open",(e=>{this.addHeartBeat(),this.emit(Ms.Open,e)})),this.websocket.addEventListener("message",(e=>{this.isAlive=!0,this.emit(Ms.Message,e)})),this.websocket.addEventListener("close",(e=>{this.clearIntervals(),this.emit(Ms.Close,e)})),this.websocket.addEventListener("error",(e=>{this.clearIntervals(),this.emit(Ms.Error,e)})))}sendLaunchParams(e){return{seq:this.sendMessageToRwg({evt:4301,body:e})}}joinMeeting(e){return{seq:this.sendMessageToRwg({evt:4097,body:{meetingtoken:e}})}}lockMeeting(e){return{seq:this.sendMessageToRwg({evt:4099,body:{bLock:e}})}}endMeeting(){return{seq:this.sendMessageToRwg({evt:4101,body:{}})}}leaveMeeting(){const e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?4364:4103;return{seq:this.sendMessageToRwg({evt:e,body:{}})}}recordMeeting(e,t){return{seq:this.sendMessageToRwg({evt:4105,body:{bRecord:e,bPause:t}})}}localRecordingGrantPermission(e,t,o){return{seq:this.sendMessageToRwg({evt:ms,body:{cmdType:"permission_request_answer",userId:e,agreed:t,saveAgreed:o}})}}hostGrantPermission(e,t){return{seq:this.sendMessageToRwg({evt:ms,body:{cmdType:"grant_permission",userId:e,grant:t}})}}localRecordingRequestPermission(){return{seq:this.sendMessageToRwg({evt:ms,body:{cmdType:"request_permission"}})}}localRecordingMeeting(e){return{seq:this.sendMessageToRwg({evt:ms,body:{cmdType:"change_recording_status",status:e}})}}summaryMeeting(e){return{seq:this.sendMessageToRwg({evt:8009,body:{type:e?"start":"stop"}})}}startMeetingQuery(e){return{seq:this.sendMessageToRwg({evt:8017,body:{type:e?"start":"stop"}})}}allowSelfRecord(e){return{seq:this.sendMessageToRwg({evt:4325,body:{bAllowISORecord:e}})}}enableZoomIQRecord(e){return{seq:this.sendMessageToRwg({evt:4318,body:{check:e}})}}expel(e){return{seq:this.sendMessageToRwg({evt:4107,body:{id:e}})}}expelAttendee(e){return{seq:this.sendMessageToRwg({evt:4205,body:{jid:e}})}}rename(e,t,o){return{seq:this.sendMessageToRwg({evt:4109,body:{id:e,dn2:t,olddn2:o}})}}assignHost(e,t){return{seq:this.sendMessageToRwg({evt:4111,body:{id:e,bCoHost:t}})}}reclaimHost(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{seq:this.sendMessageToRwg({evt:4133,body:{id:e,bCoHost:t}})}}revokeCoHost(e){return{seq:this.sendMessageToRwg({evt:4195,body:{id:e}})}}putOnHold(e,t){return{seq:this.sendMessageToRwg({evt:4113,body:{id:e,bHold:t}})}}setMuteOnEntry(e){return{seq:this.sendMessageToRwg({evt:4115,body:{bOn:e}})}}setHoldOnEntry(e){return{seq:this.sendMessageToRwg({evt:4117,body:{bOn:e}})}}inviteCRCDevice(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return{seq:this.sendMessageToRwg({evt:4119,body:{ip:e,type:t,encrypt:o}})}}cancelInviteCRCDevice(e){return{seq:this.sendMessageToRwg({evt:4121,body:{transID:e}})}}sendCloseCaption(e){return{seq:this.sendMessageToRwg({evt:4125,body:{...e}})}}allowViewParticipantNumber(e){return{seq:this.sendMessageToRwg({evt:4127,body:{bOn:e}})}}lowerAllHands(){return{seq:this.sendMessageToRwg({evt:4129,body:{}})}}raiseLowerHand(e,t){return{seq:this.sendMessageToRwg({evt:4131,body:{id:e,bOn:t}})}}chat(e,t,o,n){const r={text:e,destNodeID:t};return o&&Object.assign(r,{sn:o}),n&&Object.assign(r,{attendeeNodeID:n}),{seq:this.sendMessageToRwg({evt:4135,body:r})}}assignCC(e,t){return{seq:this.sendMessageToRwg({evt:4137,body:{id:e,bCCEditor:t}})}}enableLT(e){return{seq:this.sendMessageToRwg({evt:4227,body:{op:e?2:4}})}}enableNewLLT(){return{seq:this.sendMessageToRwg({evt:4285})}}disableCaptions(e){return{seq:this.sendMessageToRwg({evt:hs,body:{type:4,disableNewLtt:e}})}}enableManualCaption(e){return{seq:this.sendMessageToRwg({evt:4291,body:{op:e?1:0}})}}setTranslationLanguage(e){return void 0!==e?{seq:this.sendMessageToRwg({evt:hs,body:{type:1,lang:e}})}:{seq:this.sendMessageToRwg({evt:hs,body:{type:3}})}}setSpokenLanguage(e){return{seq:this.sendMessageToRwg({evt:4287,body:{lang:e}})}}allowAskLT(e){return{seq:this.sendMessageToRwg({evt:4263,body:{bAnonymous:e}})}}approveLT(){return{seq:this.sendMessageToRwg({evt:4262,body:{bApproved:!0}})}}askLT(e){return{seq:this.sendMessageToRwg({evt:4261,body:{bAnonymous:e}})}}setChatPriviledge(e){return{seq:this.sendMessageToRwg({evt:4141,body:{chatPriviledge:e}})}}setPanelistChatPrivilege(e){if(!Object.values(As).includes(e))throw Error("Invalid panelist chat privilege req value");return{seq:this.sendMessageToRwg({evt:4141,body:{chatPriviledge:e}})}}sendFeedback(e){return{seq:this.sendMessageToRwg({evt:4143,body:{feedback:e}})}}clearFeedback(){return{seq:this.sendMessageToRwg({evt:4145,body:{}})}}allowUnmuteVideo(e){return{seq:this.sendMessageToRwg({evt:4147,body:{bOn:e}})}}allowUnmuteAudio(e){return{seq:this.sendMessageToRwg({evt:4149,body:{bOn:e}})}}allowRaiseHand(e){return{seq:this.sendMessageToRwg({evt:4151,body:{bOn:e}})}}boToken(e){return{seq:this.sendMessageToRwg({evt:4173,body:{topic:e}})}}startBO(e){return{seq:this.sendMessageToRwg({evt:4175,body:{proto:e}})}}stopBO(e){return{seq:this.sendMessageToRwg({evt:4177,body:{status:e}})}}assignToBO(e,t){return{seq:this.sendMessageToRwg({evt:4179,body:{targetID:e,targetBID:t}})}}switchBO(e,t){return{seq:this.sendMessageToRwg({evt:4181,body:{targetID:e,targetBID:t}})}}wantJoinBO(e,t){return{seq:this.sendMessageToRwg({evt:4183,body:{targetID:e,targetBID:t}})}}joinBO(e){return{seq:this.sendMessageToRwg({evt:4193,body:{targetBID:e}})}}leaveBO(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{seq:this.sendMessageToRwg({evt:4185,body:{reason:e}})}}broadcastBO(e){return{seq:this.sendMessageToRwg({evt:4187,body:{textContent:e}})}}askForHelpBO(e){return{seq:this.sendMessageToRwg({evt:4189,body:{targetID:e}})}}askForHelpResultBO(e,t){return{seq:this.sendMessageToRwg({evt:4191,body:{targetID:e,helpResult:t}})}}coHostStartBO(e,t){return{seq:this.sendMessageToRwg({evt:4241,body:{proto:e,targetID:t}})}}coHostStopBO(e,t){return{seq:this.sendMessageToRwg({evt:4243,body:{status:e,targetID:t}})}}coHostAssignToBO(e,t,o){return{seq:this.sendMessageToRwg({evt:4245,body:{userGUID:e,targetID:o,targetBID:t}})}}moveToMainSession(e){return{seq:this.sendMessageToRwg({evt:4247,body:{userGUID:e}})}}coHostMoveToMainSession(e,t){return{seq:this.sendMessageToRwg({evt:4249,body:{userGUID:e,targetID:t}})}}allowParticipantRename(e){return{seq:this.sendMessageToRwg({evt:4163,body:{bOn:e}})}}allowMessageFeedbackNotify(e,t){return{seq:this.sendMessageToRwg({evt:4171,body:{bOn:e,id:t}})}}setPlayChime(e,t){return{seq:this.sendMessageToRwg({evt:4197,body:{bOn:e,id:t}})}}admitAllSilentUsers(){return{seq:this.sendMessageToRwg({evt:4199,body:{}})}}bindTeleUser(e,t,o){return{seq:this.sendMessageToRwg({evt:4201,body:{teleUserID:e,targetUserID:t,bBind:o}})}}practiceSession(){return{seq:this.sendMessageToRwg({evt:4207,body:null})}}roleChangeWebinar(e,t,o,n){return{seq:this.sendMessageToRwg({evt:4209,body:{jid:t,userID:o,clientCap:n,bPromote:e}})}}sendPromoteConsent(e,t){return{seq:this.sendMessageToRwg({evt:4254,body:{agreed:e,req_id:t}})}}batchCreateBOToken(e){const t=e.map(((e,t)=>({topic:e,index:t})));return{seq:this.sendMessageToRwg({evt:4211,body:t})}}mute(e,t){return{seq:this.sendMessageToRwg({evt:8193,body:{bMute:t,id:e}})}}audioDrop(e){return{seq:this.sendMessageToRwg({evt:8195,body:{id:e}})}}audioDialout(e,t,o,n,r){return{seq:this.sendMessageToRwg({evt:8197,body:{pn:e,dn2:dr(t),bCallme:o,bPressOne:n,bGreeting:r}})}}audioCancelDialout(e,t){return{seq:this.sendMessageToRwg({evt:8199,body:{pn:e,bCallme:t}})}}audioMuteAll(e){return{seq:this.sendMessageToRwg({evt:8201,body:{bMute:e}})}}allowToTalk(e,t){return{seq:this.sendMessageToRwg({evt:8204,body:{id:e,bAllowTalk:t}})}}subscribeVideo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;return{seq:this.sendMessageToRwg({evt:12289,body:{id:e,size:t,bOn:o}})}}unsubscribeVideo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{seq:this.sendMessageToRwg({evt:12291,body:{id:e}})}}muteAttendeeVideo(e,t){return{seq:this.sendMessageToRwg({evt:12297,body:{id:e,bOn:t}})}}notifyRwgIsMuteVideo(e,t){return this.muteAttendeeVideo(e,t)}pauseSharing(){return{seq:this.sendMessageToRwg({evt:16385,body:{}})}}resumeSharing(){return{seq:this.sendMessageToRwg({evt:16387,body:{}})}}allowAnonymousQuestion(e,t){return{seq:this.sendMessageToRwg({evt:4155,body:{userId:e,bOn:t}})}}allowViewAll(e,t){return{seq:this.sendMessageToRwg({evt:4157,body:{userId:e,bOn:t}})}}allowVote(e,t){return{seq:this.sendMessageToRwg({evt:4159,body:{userId:e,bOn:t}})}}allowComment(e,t){return{seq:this.sendMessageToRwg({evt:4161,body:{userId:e,bOn:t}})}}sharingRequestRemoteControl(e,t){return{seq:this.sendMessageToRwg({evt:16389,body:{id:e,bOn:t}})}}subscribeGrabRemoteControl(e,t){return{seq:this.sendMessageToRwg({evt:16393,body:{id:e,bOn:t}})}}subscribeSharing(e,t,o,n){const r={id:e,size:t};return o&&Object.assign(r,{bShareToBO:!0}),void 0!==n&&Object.assign(r,{bVideoShare:n}),{seq:this.sendMessageToRwg({evt:16415,body:r})}}unsubscribeSharing(e,t){const o={id:e};return t&&Object.assign(o,{bShareToBO:!0}),{seq:this.sendMessageToRwg({evt:16417,body:o})}}sendRWGConnectionPerformance(e){return{seq:this.sendMessageToRwg({evt:4167,body:{data:e}})}}sendSdkKeyToMonitor(e,t,o){return{seq:this.sendMessageToRwg({evt:4167,body:{data:`ZoomConferenceClient,videoapp_HTML5_sdk_web_join,${o},2,${t},${e}`}})}}sendDatachannelOffer(e){return{seq:this.sendMessageToRwg({evt:24321,offer:e})}}joinOrLeaveVoip(e){return{seq:this.sendMessageToRwg({evt:8203,body:{bOn:e}})}}startSharing(e,t){return{seq:this.sendMessageToRwg({evt:16409,body:{id:e,boOn:!1,...null!=t?t:{}}})}}stopSharing(e){return{seq:this.sendMessageToRwg({evt:16409,body:{id:e,bOn:!0}})}}lockSharing(e){return{seq:this.sendMessageToRwg({evt:4169,body:{lockShare:e}})}}startShareToBreakoutRoom(e){return{seq:this.sendMessageToRwg({evt:16425,body:{id:e,bShareToBO:!0}})}}stopShareToBreakoutRoom(e){return{seq:this.sendMessageToRwg({evt:16425,body:{id:e,bShareToBO:!1}})}}preAssignBreakoutRoom(){return{seq:this.sendMessageToRwg({evt:4213,body:{}})}}claimHost(e){return{seq:this.sendMessageToRwg({evt:4215,body:{hostKey:e}})}}allowMultiplePin(e,t){return{seq:this.sendMessageToRwg({evt:4217,body:{userID:e,bOn:t}})}}spotlightVideo(e,t){return{seq:this.sendMessageToRwg({evt:4219,body:{id:e,...t}})}}connectCamera(e,t){const o={evt:12307,body:{id:e,bOn:t}};return{seq:this.sendMessageToRwg(o)}}followHostLayout(e){return{seq:this.sendMessageToRwg({evt:4223,body:{bFollowHostVideo:e}})}}setVideoDragLayout(e){return{seq:this.sendMessageToRwg({evt:4218,body:{drag_list:e}})}}chatCmdReq(e,t){return{seq:this.sendMessageToRwg({evt:4237,body:{msgID:e,cmd:t}})}}activeAppLinkReq(e){return{seq:this.sendMessageToRwg({evt:4257,body:{appId:e}})}}activeAppInfoReq(){return{seq:this.sendMessageToRwg({evt:4255,body:{}})}}muteShareAudio(e,t){const o={bOn:!0,bShareAudio:!e};return t&&Object.assign(o,{bShareAudioOnly:!0}),{seq:this.sendMessageToRwg({evt:16423,body:o})}}localMuteAudio(e,t){return{seq:this.sendMessageToRwg({evt:8209,body:{id:e,bMute:t}})}}changeSharePronoun(e,t){return{seq:this.sendMessageToRwg({evt:4264,body:{bPronoun:e,strPronoun:t}})}}sendReceivingSharingReady(e){return{seq:this.sendMessageToRwg({evt:16421,body:{ssrc:e}})}}sendManualCaption(e){return{seq:this.sendMessageToRwg({evt:4289,body:{...e}})}}sendPollingAction(e,t,o){return{seq:this.sendMessageToRwg({evt:4224,body:{action:e,PollingId:t,...o}})}}broadcastUserNetworkQuality(e){const t={type:e.isUplink,level:e.level,bwLevel:e.bwLevel};return{seq:this.sendMessageToRwg({evt:4331,body:t})}}sendFarEndCameraControl(e,t,o){return{seq:this.sendMessageToRwg({evt:4329,body:{cmd:e,userID:t,buttonID:o}})}}sendCameraAblity(e){return{seq:this.sendMessageToRwg({evt:4330,body:{...e,focus:!1}})}}sendReaction(e){return{seq:this.sendMessageToRwg({evt:4259,body:{...e}})}}remoteControlConsent(e,t,o,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0;const{deviceId:s,...a}=n,d=void 0!==i?{runAsAdmin:i}:{};return{seq:this.sendMessageToRwg({evt:16427,body:{DeviceID:s,op:e,SendUserID:o,AssignUserID:t,...a,bAutoDelete:r,...d}})}}takeBackRemoteControlPermission(e,t){return{seq:this.sendMessageToRwg({evt:16431,body:{SendUserID:e,ReceiverUserID:t}})}}syncSharedContentMetaWithRcApp(e){const{deviceId:t,...o}=e;return{seq:this.sendMessageToRwg({evt:16429,body:{DeviceID:t,...o}})}}startLiveStream(e,t,o){return{seq:this.sendMessageToRwg({evt:7977,body:{action:1,streamingURL:e,streamingKey:t,broadcastURL:o}})}}stopLiveStream(){return{seq:this.sendMessageToRwg({evt:7977,body:{action:0}})}}sendRemoteControlAuth(e){return{seq:this.sendMessageToRwg({evt:16433,body:{auth:e}})}}chatFileTransfer(e){return{seq:this.sendMessageToRwg({evt:4307,body:{...e,fileType:0,receiverType:0}})}}broadcastVoiceReq(e){return{seq:this.sendMessageToRwg({evt:4314,body:{broadcastVoice:e}})}}}class Ns extends Ls{static createAgent(){return this.rwgInstance||(this.rwgInstance=new Ns),this.rwgInstance}}Ns.rwgInstance=null;class Vs extends Ls{static getInstance(){return this.instance||(this.instance=new Vs),this.instance}}Vs.instance=null;const Us=[{name:"audio_simd.min.js",category:"audio",type:"worker",tag:"simd",alias:"audioSIMDWorkletPath"},{name:"audio.simd.wasm",category:"audio",type:"wasm",tag:"simd",alias:"audioSIMDWasm"},{name:"js_audio_process.min.js",category:"audio",type:"worker",tag:"",alias:"audioWorkerPath"},{name:"audio.encode.wasm",category:"audio",type:"wasm",tag:"",alias:"audioWasm"},{name:"js_audio_worklet.min.js",category:"audio",type:"worklet",tag:"",alias:"audioWorkletPath"},{name:"js_audio_worklet_simd.min.js",category:"audio",type:"worklet",tag:"simd",alias:"audioWorkletSIMDPath"},{name:"js_audio_worklet_process.min.js",category:"audio",type:"worklet",tag:"",alias:"audioWorkletProcessPath"},{name:"js_sharing_audio_worklet.min.js",category:"audio",type:"worklet",tag:"",alias:"sharingAudioWorkletPath"},{name:"js_audio_level_worklet_process.min.js",category:"audio",type:"worklet",tag:"",alias:"audioLevelWorkletPath"},{name:"video_mtsimd.min.js",category:"video",type:"worker",tag:"simd,thread",alias:"videoMSIMDWorkerPath"},{name:"video.mtsimd.wasm",category:"video",type:"wasm",tag:"simd,thread,videoShare",alias:"videoMSIMDWasm"},{name:"video_m.min.js",category:"video",type:"worker",tag:"thread",alias:"videoMtWorkerPath"},{name:"video.mt.wasm",category:"video",type:"wasm",tag:"thread",alias:"videoMtWasm"},{name:"video_simd.min.js",category:"video",type:"worker",tag:"simd",alias:"videoSIMDWorkerPath"},{name:"video.simd.wasm",category:"video",type:"wasm",tag:"simd",alias:"videoSIMDWasm"},{name:"video_s.min.js",category:"video",type:"worker",tag:"",alias:"videoWorkerPath"},{name:"video.decode.wasm",category:"video",type:"wasm",tag:"",alias:"videoWasm"},{name:"video_share_mtsimd.min.js",category:"video",type:"worker",tag:"videoShare",alias:"vsmiworkerpath"},{name:"sharing_mtsimd.min.js",category:"sharing",type:"worker",tag:"simd,thread",alias:"sharingMSIMDWorkerPath"},{name:"sharing_m.min.js",category:"sharing",type:"worker",tag:"thread",alias:"sharingMtWorkerPath"},{name:"sharing_simd.min.js",category:"sharing",type:"worker",tag:"simd",alias:"sharingSIMDWorkerPath"},{name:"sharing_s.min.js",category:"sharing",type:"worker",tag:"",alias:"sharingWorkerPath"}],js="1507",xs=(e,t)=>Us.reduce(((o,n)=>{const{name:r,alias:i}=n;return Object.assign(o,{[`${i}`]:`${e}/${t&&js?`${js}_`:""}${r}`}),o}),{});let Bs=function(e){return e.VideoEncode="0",e.VideoDecode="1",e.AudioEncode="2",e.AudioDecode="3",e.SharingEncode="4",e.SharingDecode="5",e}({});const Fs=Ui.WebclientIVState;class Hs{static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new Hs),this.agentInstance}constructor(){this.assetsPath=void 0,this.instance=void 0,this.callbackList=void 0,this.mediaWorkersPath=void 0,this.constraints=void 0,this.svcUrl=void 0,this.meetingNumber=void 0,this.confId=void 0,this.mediaSocketAddress=void 0,this.currentUserId=void 0,this.receivedSharingCanvas=void 0,this.sharingCanvas=void 0,this.mediaOptions=void 0,this.inProgress=void 0,this.callbackList=[]}init(e){if(!this.instance&&window.JsMediaSDK_Instance){const t={ivObj:{[Xi.AUDIO_ENCODE]:Vi.get(Fs)&&Vi.get(Fs)[Xi.AUDIO_ENCODE],[Xi.VIDEO_ENCODE]:Vi.get(Fs)&&Vi.get(Fs)[Xi.VIDEO_ENCODE],[Xi.SHARING_ENCODE]:Vi.get(Fs)&&Vi.get(Fs)[Xi.SHARING_ENCODE]},globalTracingLogger:e};this.instance=new window.JsMediaSDK_Instance(t),this.instance.setRWGAgent(Ns.createAgent())}}setAssetsAndConstraint(e,t,o,n){var r;this.assetsPath=e,this.constraints=t,this.mediaWorkersPath=xs(this.assetsPath,!!o),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=n,null===(r=this.instance)||void 0===r||r.JsMediaSDK_PreLoad(this.mediaWorkersPath,this.onMediaSDKCallback,n)}onMediaSDKCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach((o=>o(e,t)))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter((t=>t!==e))}static isSupportVideoEncodeHardwareAcceleration(){return window.JsMediaSDK_Instance.util.IsSupportVideoEncodeHardwareAcceleration()}static isSupportVideoDecodeHardwareAcceleration(){return window.JsMediaSDK_Instance.util.IsSupportVideoDecodeHardwareAcceleration()}static isCompatibleHardwareForEncode(){var e;return zi.isSupportOffscreenCanvas&&0==(null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.AdapterWhiteListCheckForEncoder())}static getPTZCapability(){var e,t,o,n,r,i,s,a,d;return{pan:!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||null===(o=t.isSupportCameraPan)||void 0===o||!o.call(t)),tilt:!(null===(n=window.JsMediaSDK_Instance)||void 0===n||null===(r=n.util)||void 0===r||null===(i=r.isSupportCameraTilt)||void 0===i||!i.call(r)),zoom:!(null===(s=window.JsMediaSDK_Instance)||void 0===s||null===(a=s.util)||void 0===a||null===(d=a.isSupportCameraZoom)||void 0===d||!d.call(a))}}static isSupportVideoShare(){var e,t,o;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||null===(o=t.isSupportVideoShareReceive)||void 0===o||!o.call(t))}static isSupportVideoShareSend(){var e,t,o;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||null===(o=t.isSupportVideoShareSend)||void 0===o||!o.call(t))}static isSupportSending720P(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||!t.get720pcapacity())}static isSupportSubscribing1080P(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||!t.getsub1080pcapacity())}static isSupportOpenMicWhenShareAudio(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportOpenMicWhenShareAudio())}static isSupportMediaPlaybackAsVideoInput(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util.videoToMediaStreamManager)||void 0===t||!t.isSupported())}static isSupportMediaPlaybackAsAudioInput(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util.audioToMediaStreamMananger)||void 0===t||!t.isSupported())}static isSupportAudioDenoise(e){var t;return!(null===(t=window.JsMediaSDK_Instance)||void 0===t||!t.util.isSupportAudioDenoise(e))}static isSupportAudioBridgeAVSync(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportAudioBridgeAvsync())}static getAudioFeatureFlag(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.getAudioFeatureFlags()}static isSupportShareMultiStream(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.isSupportShareMultiStream()}static isSupportVideoLTR(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.isSupportVideoLTR()}static isSupportStereoAudio(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isBrowserSupportStereo())}static isSupportFullHDVideo(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportSendVideoFullHD())}static isSupportFullHDVideoShare(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportSendVideoShareFullHD())}static isSupportShare2ndAudioDevice(e){var t;return!(null===(t=window.JsMediaSDK_Instance)||void 0===t||!t.util.isSupportShare2ndAudioDevice(e))}connect(e){var t,o,n,r,i,s;let{svcUrl:a,meetingNumber:d,conId:u,e2eEncrypt:l,isViewOnly:c,currentUserId:p,isWebinar:h,enableAudioQos:m,enableVideoQos:v=!1,enableWebtransport:g=!1,webtransportPort:f,rendererType:y,adaptedABOptionForMediaSDK:S}=e;const{isSupportEssentialAudioAndVideoAbility:b,isSupportAudioWorklet:E,isSupportSendScreenSharing:I}=zi;this.svcUrl=a,this.meetingNumber=d,this.confId=u;const A=((e,t,o)=>({videoSocketAddress:`wss://${e}/wc/media/${t}?type=v&cid=${o}`,audioSocketAddress:`wss://${e}/wc/media/${t}?type=a&cid=${o}`,sharingSocketAddress:`wss://${e}/wc/media/${t}?type=${qi()?"j":"s"}&cid=${o}`}))(a,d,u);this.mediaSocketAddress=A,this.currentUserId=p;const C=Qi(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB);var _,R,w,O,T,D,P,k,M,L;(null===(o=this.instance)||void 0===o||o.setPropsBeforeInit({callback:this.onMediaSDKCallback,audioWorkerPath:b?null===(n=this.mediaWorkersPath)||void 0===n?void 0:n.audioWorkletPath:void 0,e2eEncrypt:l,isEnableListenInitEvent:!0,enableWebtransport:g,webtransportPort:f,featureOptions:S,rendererType:y}),!0===(null===(r=this.constraints)||void 0===r?void 0:r.audio)&&b&&!Ki())&&((h||E)&&(null===(_=this.instance)||void 0===_||_.initAudioDecode(this.mediaWorkersPath,A.audioSocketAddress,p,Kt,u,d,C,m)),!E||h&&c||null===(R=this.instance)||void 0===R||R.initAudioEncode(this.mediaWorkersPath,A.audioSocketAddress,p,Kt,u,d,C,m));!0===(null===(i=this.constraints)||void 0===i?void 0:i.video)&&b&&(null===(w=this.instance)||void 0===w||w.initVideoDecode(this.mediaWorkersPath,A.videoSocketAddress,p,Kt,u,d,C,null===(O=null===(T=window.JsMediaSDK_Instance)||void 0===T||null===(D=T.util)||void 0===D?void 0:D.isGraphicShouldUseHardwareAccelerationDecode())||void 0===O||O,v),h&&c||null===(P=this.instance)||void 0===P||P.initVideoEncode(this.mediaWorkersPath,A.videoSocketAddress,p,Kt,u,d,C,!1,v,!0,!0)),!0===(null===(s=this.constraints)||void 0===s?void 0:s.screen)&&(b?(null===(k=this.instance)||void 0===k||k.initSharingDecode(this.mediaWorkersPath,A.sharingSocketAddress,p,Kt,u,d,C),!I||h&&c||null===(M=this.instance)||void 0===M||M.initSharingEncode(this.mediaWorkersPath,A.sharingSocketAddress,p,Kt,u,d,C)):null===(L=this.instance)||void 0===L||L.initSharingDecode(A.sharingSocketAddress)),this.inProgress=!0}async destroy(){var e;this.callbackList=[],[Bs.AudioDecode,Bs.AudioEncode,Bs.VideoDecode,Bs.VideoEncode].forEach((e=>{var t;null===(t=this.instance)||void 0===t||t.updateQosSubscription(!1,e)}));const t=null===(e=this.instance)||void 0===e?void 0:e.destroy.bind(this.instance);this.instance=null,this.inProgress=!1,await(null==t?void 0:t())}disconnect(){var e,t;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(17,{}),null===(t=this.instance)||void 0===t||t.JsMediaSDK_UnInit()}muteAudio(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(8,{ssrc:0})}unmuteAudio(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(7,{ssrc:0,AudioSelectValue:0})}joinComputerAudio(e,t,o,n,r,i,s){var a;const d=s?{...s,enableHID:!0}:{enableHID:!1};return null===(a=this.instance)||void 0===a?void 0:a.Notify_MeidaSDK(22,{CaptureAudio:n,CaptureAudioInfo:{ssrc:e,AudioSelectValue:"default"===t?null:t,...d,audioProfile:r},speakerInfo:{defaultDeviceId:o},...i?{useAudioBridge:!0,audioBridge:i}:{}})}leaveComputerAudio(){var e;return null===(e=this.instance)||void 0===e?void 0:e.Notify_MeidaSDK(21,null)}joinSharingAudio(e){var t;let{ssrc:o,microphoneDeviceId:n,speakerDeviceId:r,isCaptureAudio:i,audioBridge:s}=e;return null===(t=this.instance)||void 0===t?void 0:t.Notify_MeidaSDK(72,{CaptureAudio:i,CaptureAudioInfo:{ssrc:o,AudioSelectValue:"default"===n?null:n},speakerInfo:{defaultDeviceId:r},checkAutoplay:!1,...s?{useAudioBridge:!0,audioBridge:s}:{}})}leaveSharingAudio(e){var t;return null===(t=this.instance)||void 0===t?void 0:t.Notify_MeidaSDK(73,{isPause:e?1:0})}changeSpeaker(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(11,{ssrc:0,AudioSelectValue:e})}changeMicrophone(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(18,{ssrc:0,AudioSelectValue:"default"===e?null:e,microphoneLabel:null!=t?t:"default",defaultMuted:o})}restoreWebRTC(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(19,{ssrc:0,AudioSelectValue:"default"===e?null:e})}renderVideo(e,t,o,n,r,i,s,a,d,u,l){var c;const p={userId:t,width:n,height:r,x:i,y:s,quality:a,isMyself:d,canvas:e,enableWaterMark:l,waterMarkText:u,zone:o};e instanceof HTMLVideoElement&&Object.assign(p,{videodom:e}),null===(c=this.instance)||void 0===c||c.Notify_MeidaSDK(1,p)}stopRenderVideo(e,t,o,n){var r;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(2,{canvas:e,userId:t,RGBA:n,doNotClean:i,zone:o})}startCaptureVideo(e,t,o,n,r,i){var s;let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],d=arguments.length>8?arguments[8]:void 0;const u=(arguments.length>7?arguments[7]:void 0)?Hs.getPTZCapability():void 0;null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(3,{ssid:e,width:o,height:n,fps:d,video:r,usingFacingMode:i,VideoSelectValue:"default"===t?null:t,disableOriginalRatio:a,...u})}stopCaptureVideo(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(4,{ssrc:0})}changeCamera(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(12,{VideoSelectValue:"default"===e?null:e,usingFacingMode:!!t,...o||{}})}switchCanvasForVideoCapture(e){var t;let o=e;"string"==typeof e&&(o=[e]),null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(25,o)}renderSharing(e,t){var o;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.receivedSharingCanvas=t,null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(23,{width:0,height:0,ssrc:e,canvas:t,enableWaterMark:n,waterMarkText:r,isFromMainSession:i})}stopRenderSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(24,{})}switchSharingSource(e){var t;let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(36,{ssrc:e,isFromMainSession:Number(o)})}ajustmentReceivedSharingCanvas(e,t){if(this.receivedSharingCanvas&&e&&t)try{if(zi.isAndroidOrIOSBrowser){const[o,n]=[1280,720],r=Math.max(e/o,t/n,1);this.receivedSharingCanvas.width=Math.floor(e/r),this.receivedSharingCanvas.height=Math.floor(t/r)}else this.receivedSharingCanvas.width=e,this.receivedSharingCanvas.height=t}catch(e){}}startRemoteControl(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(26,{socketURL:`wss://${this.svcUrl}`,meetingID:this.meetingNumber,condID:this.confId,os:t,dom:e,...o})}stopRemoteControl(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(28)}resendRemoteControlPositionPDU(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(41)}updateRemoteControlProperties(e){var t;const{dimension:o,...n}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(27,{...o,...n})}startDesktopSharing(e,t,o,n){var r;let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0;this.sharingCanvas=t;const u={};n&&Object.assign(u,{share2ndCamera:!0,share2ndCameraParams:{VideoSelectValue:"default"===n.cameraId?null:n.cameraId,width:n.width,height:n.height}}),void 0!==s&&Object.assign(u,{videoParams:{displaySurface:s}}),void 0!==d&&Object.assign(u,{otherParams:{...d}}),null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(30,{ssid:e,canvas:t,video:o,...u,showShareAudioOption:i,sourceId:a})}stopDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(31,{})}pauseDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(32,{})}resumeDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(33,{})}selectLanguageChannelForNewLTT(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(57,{lang:e})}changeSharingSecondCamera(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(49,{VideoSelectValue:e})}ajustmentSharingCanvas(e,t){if(this.sharingCanvas)try{this.sharingCanvas.width=e,this.sharingCanvas.height=t}catch(e){}}checkChromeSharingExtension(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(34,{})}enableAudioEncode(){var e,t;null===(e=this.instance)||void 0===e||e.initAudioEncode(this.mediaWorkersPath,this.mediaSocketAddress.audioSocketAddress,this.currentUserId,Kt,this.confId,this.meetingNumber,Qi(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB))}sendUserNodeList(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(43,{userList:e,encryptKey:t})}updateRenderedSharingDimension(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(44,{width:e,height:t})}pauseOrResumeAudio(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(45,{bPause:e})}updateRenderedVideoCanvasDimension(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(46,{canvas:e,width:t,height:o})}clearVideoCanvas(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(47,{id:e,RGBA:t})}adjustRenderedVideoPosition(e,t,o,n,r,i,s,a){var d;null===(d=this.instance)||void 0===d||d.Notify_MeidaSDK(48,{userId:t,x:n,y:r,width:i,height:s,canvas:e,zone:o,RGBA:a})}mirrorVideo(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(75,{isMirrorMyVideo:e})}updateUserMediaSN(e){var t,o,n;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(80,{isFromMainSession:Number(e.isFromMainSession),mediaActionType:e.iVType,body:{add:null!==(o=e.added)&&void 0!==o?o:[],remove:null!==(n=e.removed)&&void 0!==n?n:[]}})}updateMediaParams(e){var t;const{iVType:o,isFromMainSession:n,updateParams:r}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(81,{mediaActionType:o,isFromMainSession:Number(n),updateParams:r})}createMainSessionChannel(e,t){var o,n;"sharing"===e?null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(84,t):null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(85,t)}addReceivedSharingChannelType(e){var t;const{isFromMainSession:o,...n}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(82,{isFromMainSession:Number(o),...n})}removeReceivedSharingChannelType(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(83,{isFromMainSession:Number(e.isFromMainSession),ssrc:e.ssrc})}enableHardwareAccelerationForVideoDecode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(70,{enable:e})}enableHardwareAccelerationForVideoEncode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(71,{enable:e})}setSharingAudioVolume(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(74,{userid:e>>10,shareVolume:t?0:100,isFromMainSession:o})}subscribeToQos(e,t){e.forEach((e=>{var o;null===(o=this.instance)||void 0===o||o.updateQosSubscription(!0,e,t)}))}unsubscribeFromQos(e){e.forEach((e=>{var t;null===(t=this.instance)||void 0===t||t.updateQosSubscription(!1,e)}))}passThroughRWGMessage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(40,e)}startVirtualBackgroundSetting(e,t,o,n,r,i){var s;let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(91,{canvas:e,bgdom:t,width:r,height:i,ssid:o,VideoSelectValue:"default"===n?null:n,disableOriginalRatio:a})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(93,{isSwitch:t})}startMaskSetting(e,t,o,n,r,i,s,a,d){var u;null===(u=this.instance)||void 0===u||u.Notify_MeidaSDK(62,{canvas:e,maskdom:o,bgdom:t,dx:0,dy:0,dWidth:i,dHeight:s,width:a,height:d,ssid:n,VideoSelectValue:"default"===r?null:r})}updateMaskBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(63,{bgdom:e})}updateMaskClip(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(64,{maskdom:e,dx:0,dy:0,dWidth:t,dHeight:o})}stopMaskSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(65,{isSwitch:t})}enableVideoObserver(e){var t;let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(99,{enable:e,fpsdisbale:o})}enableShareAudioToBreakoutRoom(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(86,{enable:e})}sendUserAudioStatus(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(51,e)}muteOrUnmuteOtherAudio(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(50,{userId:e,volume:t?0:100})}adjustOtherAudioVolume(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(50,{userId:e,volume:t})}notifySDKMeetingReady(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(113)}movePTZCamera(e){var t,o;return null===(t=window.JsMediaSDK_Instance)||void 0===t||null===(o=t.util)||void 0===o?void 0:o.queryPTZPermisson().then((t=>{var o;return t?(null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(53,e),Promise.resolve("")):Promise.reject("Cannot move camera without permission granted")}))}switchSharingMode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(101,{mode:e})}updateVideoHDValue(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK("update_videohd_value",{videohd:e})}updateVideoFullhdValue(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK("update_videofullhd_value",{videofullhd:e})}changeAudioProfile(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(126,e)}enableSyncButtonsOnHeadset(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(100,{enable:e,microphoneLabel:t,defaultMuted:o})}stopAllIncomingAudio(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(123,e)}isSharingEntireScreen(){var e,t;const o=null===(e=this.instance)||void 0===e||null===(t=e.getShareStreamInfo)||void 0===t?void 0:t.call(e);if(o){const{displaySurface:e}=o;return!e||"monitor"===e}return!1}getShareStreamInfo(){var e,t;const o=null===(e=this.instance)||void 0===e||null===(t=e.getShareStreamInfo)||void 0===t?void 0:t.call(e);if(o){const{deviceId:e,width:t,height:n}=o;return{deviceId:e,width:t,height:n}}return{}}preInitAudioBridge(e){var t;null===(t=this.instance)||void 0===t||t.previewInit({audioBridge:{...e}})}prefetchVideoSsrc(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(110,{ssrc:e})}cancelPrefetchVideoSsrc(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(112,{ssrc:e,haddata:!1})}setMobileRotateMode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(124,{isLandScape:e})}changeActiveVideoSsrc(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(13,{ssrc:e})}setAudioCodecMode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(122,{mode:e})}startRemoteControlQRCheck(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(54,{enable:e})}broadcastVoiceToBreakoutRoom(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(87,{enable:e})}share2ndAudio(e,t){var o;const n={audioOnly:!0,deviceId:"default"===e?null:e};t&&Object.assign(n,t),null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(129,n)}}Hs.agentInstance=void 0;const $s="ADD_CURRENT_USER_PARTICIPANT_ATTRIBUTE",Ws="UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",Gs="ADD_USER_PARTICIPANT_ATTRIBUTE",zs="UPDATE_USER_PARTICIPANT_ATTRIBUTE",Ks="REMOVE_USER_PARTICIPANT_ATTRIBUTE",qs="UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",Js="REMOVE_WEBINAR_ATTENDEE_ATTRIBUTE",Qs="JOIN_MEETING_SUCCESS",Zs="JOIN_MEETING_FAILED",Ys="RECONNECTING_MEETING",Xs="LEAVING_MEETING",ea="MEETING_IN_WAITING_ROOM",ta="UPDATE_MEETING_ATTRIBUTE",oa="SHARE_PRONOUN_TYPE_UPDATE";var na=function(e){return e.ConnectionChange="connection-change",e.OnHoldChange="on-hold-change",e.UserAdd="user-added",e.UserUpdate="user-updated",e.UserRemove="user-removed",e.AttendeeUpdate="attendee-updated",e.MeetingAttributeUpdate="meeting-attribute-updated",e.PromoteAttendeeConsent="promote-attendee-consent",e.ActiveAppsUpdate="active-apps-updated",e.SharePronounTypeUpdate="share-pronoun-type-update",e}(na||{});const ra={JoinMeeting:{success:$s,fail:[Zs]}},ia={[na.ConnectionChange]:[{event:Qs,payload:()=>({state:Ti.Connected})},{event:Zs,payload:e=>({state:Ti.Fail,...e})},{event:Ys,payload:e=>({state:Ti.Reconnecting,...e})},{event:Xs,payload:e=>({state:Ti.Closed,...e})}],[na.OnHoldChange]:[{event:ea,payload:e=>({isOnHold:e})}],[na.UserAdd]:[{event:$s,payload:e=>[e]},{event:Gs,payload:e=>e}],[na.UserUpdate]:[{event:Ws,payload:e=>[e]},{event:zs,payload:e=>e}],[na.UserRemove]:[{event:Ks,payload:e=>e}],[na.AttendeeUpdate]:[{event:qs,payload:e=>e},{event:Js,payload:e=>e}],[na.MeetingAttributeUpdate]:[{event:ta,payload:e=>"bNoHostTimeOut"in e?{isHostLost:e.bNoHostTimeOut}:null}],[na.PromoteAttendeeConsent]:[{event:"MEETING_WEBINAR_PROMOTE_CONSENT_REQ",payload:e=>{let{req_id:t,sender_id:o}=e;return{reqId:t,senderId:o}}}],[na.ActiveAppsUpdate]:[{event:"ACTIVE_APPS_UPDATE",payload:()=>{}}],[na.SharePronounTypeUpdate]:[{event:oa,payload:e=>e}]},sa="LIVE_TRANSCRIPTION_RECEIVE_MESSAGE",aa="LIVE_TRANSCRIPTION_CAPTION_STATUS_CHANGE_RESPONSE",da="LIVE_TRANSCRIPTION_STATUS_CHANGE",ua="LIVE_TRANSCRIPTION_HOST_DISABLE_CHANGE",la={"caption-message":[{event:sa,payload:e=>e}],"caption-status":[{event:aa,payload:e=>e}],"caption-enable":[{event:da,payload:e=>e}],"caption-host-disable":[{event:ua,payload:e=>e}]},ca="CHAT_RECEIVE_MESSAGE_EVENTS",pa="CHAT_PRIVILEGE_CHANGE",ha="CHAT_MESSAGE_RESPONSE",ma="CHAT_DELETE_MESSAGE_REPONSE",va="CHAT_FILE_CHAT_UPLOAD_PROGRESS",ga="CHAT_FILE_CHAT_DOWNLOAD_PROGRESS";let fa=function(e){return e.ChatOnMessage="chat-on-message",e.ChatPrivilegeChange="chat-privilege-change",e.ChatDeleteMessage="chat-delete-message",e.ChatFileUploadProgress="chat-file-upload-progress",e.ChatFileDownloadProgress="chat-file-download-progress",e}({});const ya={[fa.ChatOnMessage]:[{event:ca,payload:e=>e}],[fa.ChatPrivilegeChange]:[{event:pa,payload:e=>e}],[fa.ChatDeleteMessage]:[{event:ma,payload:e=>e}],[fa.ChatFileUploadProgress]:[{event:va,payload:e=>e}],[fa.ChatFileDownloadProgress]:[{event:ga,payload:e=>e}]},Sa="COMMAND_RECEIVE_MESSAGE_EVENTS",ba="COMMAND_STATUS_EVENTS";let Ea=function(e){return e.CommandChannelStatus="command-channel-status",e.CommandChannelMessage="command-channel-message",e}({});const Ia={[Ea.CommandChannelStatus]:[{event:ba,payload:e=>e}],[Ea.CommandChannelMessage]:[{event:Sa,payload:e=>e}]};let Aa=function(e){return e.Recording="Recording",e.Paused="Paused",e.Stopped="Stopped",e.Ask="Ask",e.Accept="Accept",e.Decline="Decline",e}({}),Ca=function(e){return e[e.None=0]="None",e[e.Init=1]="Init",e[e.Start=2]="Start",e[e.Pause=3]="Pause",e[e.Stop=4]="Stop",e}({}),_a=function(e){return e[e.Stop=0]="Stop",e[e.Start=1]="Start",e[e.Pause=2]="Pause",e}({}),Ra=function(e){return e[e.None=0]="None",e[e.Deny=1]="Deny",e[e.Allow=2]="Allow",e}({}),wa=function(e){return e[e.None=0]="None",e[e.DenyAllRequest=1]="DenyAllRequest",e[e.AllowAllRequest=2]="AllowAllRequest",e}({});const Oa="CLOUD_RECORDING_STATUS_CHANGE",Ta="CLOUD_RECORDING_ISO_STATUS_CHANGE",Da="LOCAL_RECORDING_CHANGE",Pa="LOCAL_RECORDING_PERMISSION_CHANGE",ka="RECORDING_FOR_IQ_STATUS_CHANGE",Ma="RECORDING_FOR_IQ_OPERATION_CHANGE";let La=function(e){return e.RecordingChange="recording-change",e.IndividualRecordingChange="individual-recording-change",e.LocalRecordingChange="local-recording-change",e.LocalRecordingPermissionChange="local-recording-permission-change",e.MediaCaptureStatusChange="media-capture-status-change",e.MediaCapturePermissionChange="media-capture-permission-change",e.RecordingIqChange="recording-iq-change",e}({});const Na={[La.RecordingChange]:[{event:Oa,payload:e=>{const{cmrServerStatus:t}=e;return t===Ca.Start?Aa.Recording:t===Ca.Pause?Aa.Paused:Aa.Stopped}}],[La.IndividualRecordingChange]:[{event:Ta,payload:e=>e}],[La.LocalRecordingChange]:[{event:Da,payload:e=>e}],[La.LocalRecordingPermissionChange]:[{event:Pa,payload:e=>e}],[La.MediaCaptureStatusChange]:[{event:Da,payload:e=>e}],[La.MediaCapturePermissionChange]:[{event:Pa,payload:e=>e}],[La.RecordingIqChange]:[{event:ka,payload:e=>e}]};let Va=function(e){return e[e.InitSuccess=1]="InitSuccess",e[e.InitSuccessVideo=1.1]="InitSuccessVideo",e[e.InitSuccessAudio=1.2]="InitSuccessAudio",e[e.InitSuccessSharing=1.3]="InitSuccessSharing",e[e.UserGrantCaptureAudio=2]="UserGrantCaptureAudio",e[e.CurrentVideoResolution=3]="CurrentVideoResolution",e[e.JpegDecThreadOk=4]="JpegDecThreadOk",e[e.JpegData=5]="JpegData",e[e.SharingPara=6]="SharingPara",e[e.VideoDecodeMaxSize=7]="VideoDecodeMaxSize",e[e.CurrentCaptureVideoWidthHeight=8]="CurrentCaptureVideoWidthHeight",e[e.StartVideoCaptureSuccess=9]="StartVideoCaptureSuccess",e[e.StopVideoCaptureSuccess=10]="StopVideoCaptureSuccess",e[e.StartRemoteControlSuccess=11]="StartRemoteControlSuccess",e[e.CancelRemoteControlSuccess=12]="CancelRemoteControlSuccess",e[e.RemoteControlCopiedTextNotify=13]="RemoteControlCopiedTextNotify",e[e.MonitorLog=14]="MonitorLog",e[e.CurrentDesktopSharingWidthHeight=15]="CurrentDesktopSharingWidthHeight",e[e.DesktopSharingCaptureSuccess=16]="DesktopSharingCaptureSuccess",e[e.CheckChromeSharingExtensionResponse=17]="CheckChromeSharingExtensionResponse",e[e.SharingDecodeMaxSize=18]="SharingDecodeMaxSize",e[e.DataChannelOffer=19]="DataChannelOffer",e[e.AesGcmIvResponse=21]="AesGcmIvResponse",e[e.SharingDesktopStreamHaveAudio=23]="SharingDesktopStreamHaveAudio",e[e.JoinComputerAudioComplete=24]="JoinComputerAudioComplete",e[e.JoinSharingAudioComplete=25]="JoinSharingAudioComplete",e[e.LeaveComputerAudioComplete=26]="LeaveComputerAudioComplete",e[e.LeaveSharingAudioComplete=27]="LeaveSharingAudioComplete",e[e.HidStatusMute=28]="HidStatusMute",e[e.AudioStreamFailed=31]="AudioStreamFailed",e[e.VideoStreamFailed=32]="VideoStreamFailed",e[e.AudioSpeakerSetSuccess=33]="AudioSpeakerSetSuccess",e[e.AudiobridgeSetCcLangSuccess=36]="AudiobridgeSetCcLangSuccess",e[e.AudioLevelIndicator=38]="AudioLevelIndicator",e[e.SyncRendererTypeResponse=39]="SyncRendererTypeResponse",e[e.SendRemoteControlQrCode=55]="SendRemoteControlQrCode",e[e.StartVideoStreamInMaskSettingSuccess=66]="StartVideoStreamInMaskSettingSuccess",e[e.CurrentDecodeVideoQuality=66.5]="CurrentDecodeVideoQuality",e[e.CurrentDecodeVideoFps=66.6]="CurrentDecodeVideoFps",e[e.SharingFirstDecodeFrameReceivedSsrc=70]="SharingFirstDecodeFrameReceivedSsrc",e[e.StartVideoStreamInVbSettingSuccess=94]="StartVideoStreamInVbSettingSuccess",e[e.VbModelPreloading_3S=96]="VbModelPreloading_3S",e[e.VbModelPreloading_10S=97]="VbModelPreloading_10S",e[e.VbModelPreloadingOk=98]="VbModelPreloadingOk",e[e.NewActiveSpeakerFirstFrameCallback=111]="NewActiveSpeakerFirstFrameCallback",e[e.AudioBridgeFirstRecvData=114]="AudioBridgeFirstRecvData",e[e.AudioBridgeCanSendData=115]="AudioBridgeCanSendData",e[e.InitFailed=-1]="InitFailed",e[e.InitFailedVideo=-1.1]="InitFailedVideo",e[e.InitFailedAudio=-1.2]="InitFailedAudio",e[e.InitFailedSharing=-1.3]="InitFailedSharing",e[e.UserForbiddedCaptureAudio=-2]="UserForbiddedCaptureAudio",e[e.AudioWebsocketBroken=-3]="AudioWebsocketBroken",e[e.VideoWebsocketBroken=-4]="VideoWebsocketBroken",e[e.SharingDecThreadFailed=-5]="SharingDecThreadFailed",e[e.AudioZeroData=-6]="AudioZeroData",e[e.AudioCtxSamplerate=-7]="AudioCtxSamplerate",e[e.UserForbiddedCaptureVideo=-8]="UserForbiddedCaptureVideo",e[e.UserCameraIsTakenByOtherPrograms=-9]="UserCameraIsTakenByOtherPrograms",e[e.StopVideoCaptureFailed=-10]="StopVideoCaptureFailed",e[e.StartRemoteControlFailed=-11]="StartRemoteControlFailed",e[e.CancelRemoteControlFailed=-12]="CancelRemoteControlFailed",e[e.RemoteControlPasteTextLengthOverflow=-14]="RemoteControlPasteTextLengthOverflow",e[e.UserStopDesktopSharing=-15]="UserStopDesktopSharing",e[e.UserCancelPermissionRequest=-16]="UserCancelPermissionRequest",e[e.DesktopSharingChromeExtensionUninstalled=-17]="DesktopSharingChromeExtensionUninstalled",e[e.DesktopSharingPermissionDenied=-18]="DesktopSharingPermissionDenied",e[e.DesktopSharingTimeOut=-19]="DesktopSharingTimeOut",e[e.DesktopSharingError=-20]="DesktopSharingError",e[e.AudioSpeakerSetError=-21]="AudioSpeakerSetError",e[e.DesktopSharingSystemError=-22]="DesktopSharingSystemError",e[e.SharingDesktopStreamHaveNoAudio=-27]="SharingDesktopStreamHaveNoAudio",e.AudioQosData="AUDIO_QOS_DATA",e.VideoQosData="VIDEO_QOS_DATA",e.ShareQosData="VIDEOSHARE_QOS_DATA",e.NetworkQualityChange="NETWORK_QUALITY_CHANGE",e[e.AudioBridgeReconnectStart=-29]="AudioBridgeReconnectStart",e[e.AudioBridgeReconnectEnd=-31]="AudioBridgeReconnectEnd",e[e.WebglLostInMultiView=-32]="WebglLostInMultiView",e[e.MaskSettingParaError=-33]="MaskSettingParaError",e[e.VbSettingParaError=-34]="VbSettingParaError",e[e.NotifyUIFailover=-35]="NotifyUIFailover",e[e.RecoverWebrtcAudio=-36]="RecoverWebrtcAudio",e[e.AudiobridgeSetCcLangFailure=-39]="AudiobridgeSetCcLangFailure",e[e.SharingHealthCheckFailed=-129]="SharingHealthCheckFailed",e[e.VideoHealthCheckFailed=-130]="VideoHealthCheckFailed",e[e.AudioHealthCheckFailed=-131]="AudioHealthCheckFailed",e}({}),Ua=function(e){return e[e.EncodeSuccess=1]="EncodeSuccess",e[e.DecodeSuccess=2]="DecodeSuccess",e[e.EncodeFailed=-1]="EncodeFailed",e[e.DecodeFailed=-2]="DecodeFailed",e}({}),ja=function(e){return e.Spotlight="Spotlight",e.Unmute="Unmute",e.AllowToTalk="Allow to talk",e}({}),xa=function(e){return e.Inherited="inherited",e.Active="active",e.PassiveByMuteOne="passive(mute one)",e.PassiveByMuteAll="passive(mute all)",e.SharingAudio="sharing audio",e}({}),Ba=function(e){return e.Inherited="inherited",e.Active="active",e.Passive="passive",e.SharingAudio="sharing audio",e}({}),Fa=function(e){return e.Active="active",e.Failover="failover",e.EndedBySystem="audio stream is ended by system",e.Pstn="pstn",e.MicrophoneError="microphone error",e}({}),Ha=function(e){return e.Join="join",e.Leave="leave",e.Muted="muted",e.Unmuted="unmuted",e}({}),$a=function(e){return e[e.Calling=1]="Calling",e[e.Ringing=2]="Ringing",e[e.Accepted=3]="Accepted",e[e.Busy=4]="Busy",e[e.NotAvailable=5]="NotAvailable",e[e.HangUp=6]="HangUp",e[e.Fail=7]="Fail",e[e.Success=8]="Success",e[e.Timeout=9]="Timeout",e[e.Canceling=10]="Canceling",e[e.Canceled=11]="Canceled",e[e.CancelFailed=12]="CancelFailed",e}({});const Wa=(()=>{const e=new ArrayBuffer(684),t=new Uint32Array(e);return t.set([1179011410,676,1163280727,544501094,16,65539,16e3,64e3,2097156,1635017060,640],0),new Blob([t],{type:"audio/wav"})})(),Ga=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]),za=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);let Ka=function(e){return e[e.HostGrab=0]="HostGrab",e[e.OnlyHost=1]="OnlyHost",e[e.AnyoneGrab=2]="AnyoneGrab",e[e.MultipleShare=3]="MultipleShare",e}({}),qa=function(e){return e.Sharing="sharing",e.Paused="paused",e.End="ended",e}({}),Ja=function(e){return e[e.Video_90P=0]="Video_90P",e[e.Video_180P=1]="Video_180P",e[e.Video_360P=2]="Video_360P",e[e.Video_720P=3]="Video_720P",e[e.Video_1080P=4]="Video_1080P",e}({}),Qa=function(e){return e.Active="Active",e.Inactive="Inactive",e}({}),Za=function(e){return e.Muted="Muted",e.Unmuted="Unmuted",e}({}),Ya=function(e){return e.Started="Started",e.Stopped="Stopped",e.Failed="Failed",e}({}),Xa=function(e){return e.Approved="Approved",e.Rejected="Rejected",e}({}),ed=function(e){return e.PrivilegeChange="PrivilegeChange",e.StopScreenCapture="StopScreenCapture",e.ShareFromMainSession="ShareFromMainSession",e}({}),td=function(e){return e[e.ImageNotMatch=2]="ImageNotMatch",e[e.CanvasNotMatch=3]="CanvasNotMatch",e[e.VBModelNotMatch=4]="VBModelNotMatch",e}({});const od="blur";let nd=function(e){return e.User="user",e.Environment="environment",e.Left="left",e.Right="right",e}({});const rd=Object.values(nd),id=1e3,sd="__ZOOM_SDK_SHARING_VIDEO__",ad="__ZOOM_SDK_VIDEO_ZONE__",dd="__ZOOM_SDK_VIRTUAL_BACKGROUND_CANVAS_@__",ud="__ZOOM_SDK_VIRTUAL_BACKGROUND_IMAGE_@__",ld="__ZOOM_SDK_MASK_CLIP_@__",cd="__ZOOM_SDK_MEDIA_PLAYBACK_SOURCE_VIDEO__",pd="__ZOOM_SDK_DYMMY_VIDEO_PLAYER_CANVAS_ID__",hd="__ZOOM_SDK_DUMMY_HIDDEN_SELF_VIEW_VIDEO_ID__",md={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,rate:0,bandwidth:0}},vd={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,rate:0,bandwidth:0}};let gd=function(e){return e[e.Request=11]="Request",e[e.Decline=12]="Decline",e[e.Approve=13]="Approve",e[e.GiveUp=14]="GiveUp",e[e.StartControl=15]="StartControl",e[e.ContinueControl=16]="ContinueControl",e[e.StopControl=17]="StopControl",e[e.SwitchCamera=20]="SwitchCamera",e}({}),fd=function(e){return e[e.Bk=0]="Bk",e[e.Center=1]="Center",e[e.ZoomIn=2]="ZoomIn",e[e.ZoomOut=3]="ZoomOut",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Up=6]="Up",e[e.Down=7]="Down",e[e.SwitchCamera=8]="SwitchCamera",e}({}),yd=function(e){return e[e.Pan=192]="Pan",e[e.Tilt=48]="Tilt",e[e.Zoom=12]="Zoom",e[e.Focus=3]="Focus",e}({}),Sd=function(e){return e[e.ZoomIn=2]="ZoomIn",e[e.ZoomOut=3]="ZoomOut",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Up=6]="Up",e[e.Down=7]="Down",e[e.SwitchCamera=8]="SwitchCamera",e}({}),bd=function(e){return e[e.None=0]="None",e[e.ApproveAnother=3]="ApproveAnother",e[e.Stop=5]="Stop",e}({}),Ed=function(e){return e[e.Null=0]="Null",e[e.Normal=1]="Normal",e[e.VideoMode=2]="VideoMode",e}({}),Id=function(e){return e[e.Null=0]="Null",e[e.VirtualBackground=1]="VirtualBackground",e[e.Mask=2]="Mask",e}({}),Ad=function(e){return e.Computer="computer",e.Phone="phone",e}({}),Cd=function(e){return e[e.Decline=0]="Decline",e[e.Approve=1]="Approve",e[e.CacheClean=2]="CacheClean",e}({}),_d=function(e){return e.Unknown="unknown",e.Uninstalled="uninstalled",e.Installed="installed",e}({}),Rd=function(e){return e.Unlaunched="unlaunched",e.Launched="launched",e}({}),wd=function(e){return e.Started="started",e.Ended="ended",e}({}),Od=function(e){return e[e.Max=30]="Max",e[e.Min=10]="Min",e[e.Default=24]="Default",e}({}),Td=function(e){return e[e.Loading=1]="Loading",e[e.Done=2]="Done",e}({}),Dd=function(e){return e.Browser="Browser",e.Zoom="Zoom",e}({}),Pd=function(e){return e.Denoise="backgroundNoiseSuppression",e.OriginalSound="originalSound",e}({}),kd=function(e){return e[e.Undefined=0]="Undefined",e[e.WebGL=1]="WebGL",e[e.WebGPU=2]="WebGPU",e[e.WebGL2=3]="WebGL2",e}({}),Md=function(e){return e[e.H323=1]="H323",e[e.SIP=2]="SIP",e}({}),Ld=function(e){return e[e.Success=0]="Success",e[e.Ringing=1]="Ringing",e[e.Timeout=2]="Timeout",e[e.Busy=101]="Busy",e[e.Fail=104]="Fail",e}({});const Nd="RECEIVE_VIDEO_ACTIVE_INDICATION",Vd="RECEIVE_VIDEO_MUTE_INDICATION",Ud="ASK_FOR_START_VIDEO_CONSENT",jd="RECEIVE_VIDEO_DIMENSION_CHANGE",xd="CAPTURED_VIDEO_DIMENSION_CHANGE",Bd="CAN_NOT_DETECT_CAMERA",Fd="CAN_NOT_FIND_CAMERA",Hd="VIDEO_USER_FORBIDDEN_CAPTURE",$d="VIDEO_CAMERA_IS_TAKEN",Wd="VIDEO_BACKGROUND_FAILED",Gd="VIDEO_ESTABLISH_STREAM_ERROR",zd="VIDEO_CAPTURE_START_SUCCESS",Kd="VIDEO_CAPTURE_STOP_RESULT",qd="VIDEO_SPOTLIGHT_CHANGE",Jd="VIDEO_FOLLOW_HOST_ORDER_CHANGE",Qd="VIDEO_HOST_DRAG_LAYOUT_CHANGE",Zd="VIDEO_NEW_USER_START",Yd="VIDEO_OLD_USER_STOP",Xd="VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",eu="VIDEO_VIRTUAL_BACKGROUND_SETTING_SUCCESS",tu="VIDEO_STATISTIC_DATA",ou="VIDEO_CELL_DETAILED_DATA",nu="VIDEO_NETWORK_QUALITY_CHANGE",ru="VIDEO_FAR_END_CAMERA_CONTROL_REQUEST",iu="VIDEO_FAR_END_CAMERA_CONTROL_RESPONSE",su="VIDEO_FAR_END_CAMERA_IN_CONTROL_CHANGE",au="VIDEO_FAR_END_CAMERA_CAPABILITY_CHANGE",du="VIDEO_MASK_SETTING_SUCCESS",uu="VIDEO_CAPTURE_SDK_SUCCESS",lu="VIDEO_PREFETCH_VIDEO_FRAME_CALLBACK",cu="VIDEO_CURRENT_USER_SSRC",pu="VIDEO_RENDER_ASPECT_RATIO_CHANGE",hu="VIDEO_LEADERSHIP_USER_CHANGE",mu={startCaptureVideo:{success:zd,fail:[Bd,Fd,Hd,Gd,$d,Wd]},switchCameraVideo:{success:uu,fail:[Bd,Fd,Hd,$d]},stopCaptureVideo:{success:Kd}};let vu=function(e){return e.VideoActiveChange="video-active-change",e.PeerVideoStateChange="peer-video-state-change",e.VideoSpotlightChange="video-spotlight-change",e.VideoMutedChange="video-muted-change",e.VideoCapturingChange="video-capturing-change",e.AskForStartVideoConsent="ask-for-start-video-consent",e.VideoDimensionChange="video-dimension-change",e.VideoFollowHostOrder="video-follow-host-order-change",e.VideoHostLayoutChange="video-host-layout-change",e.VideoVBPreloadChange="video-virtual-background-preload-change",e.VideoStatisticDataChange="video-statistic-data-change",e.VideoDetailedDataChange="video-detailed-data-change",e.VideoAspectRatioChange="video-aspect-ratio-change",e.NetworkQualityChange="network-quality-change",e.FarEndCameraRequestControl="far-end-camera-request-control",e.FarEndCameraResponseControl="far-end-camera-response-control",e.FarEndCameraInControlChange="far-end-camera-in-control-change",e.FarEndCameraCapabilityChange="far-end-camera-capability-change",e}({});const gu={[vu.VideoActiveChange]:[{event:Nd,payload:e=>({state:e.bVideoOn?Qa.Active:Qa.Inactive,userId:e.userId})}],[vu.VideoCapturingChange]:[{event:zd,payload:()=>({state:Ya.Started})},{event:Kd,payload:e=>({state:null!=e&&e.failed?Ya.Failed:Ya.Stopped})}],[vu.VideoMutedChange]:[{event:Vd,payload:e=>({state:e.isVideoMuted?Za.Muted:Za.Unmuted,userId:e.id})}],[vu.AskForStartVideoConsent]:[{event:Ud,payload:e=>({state:e.isVideoMuted?Za.Muted:Za.Unmuted,userId:e.id})}],[vu.VideoSpotlightChange]:[{event:qd,payload:e=>({spotlightList:e.spotlightList&&e.spotlightList.map((e=>({userId:e})))})},{event:hu,payload:e=>{var t;return{spotlightList:null===(t=e.spotlightList)||void 0===t?void 0:t.map((e=>({userId:e})))}}}],[vu.VideoDimensionChange]:[{event:jd,payload:e=>({type:"received",width:e.width,height:e.height})},{event:xd,payload:e=>({type:"captured",width:e.width,height:e.height})}],[vu.VideoFollowHostOrder]:[{event:Jd,payload:e=>({isFollowHostOrder:e.bOn})}],[vu.VideoHostLayoutChange]:[{event:Qd,payload:e=>Array.isArray(e.layout)?e.layout.map((e=>({userId:e}))):[]}],[vu.PeerVideoStateChange]:[{event:Zd,payload:e=>({action:"Start",...e})},{event:Yd,payload:e=>({action:"Stop",...e})}],[vu.VideoVBPreloadChange]:[{event:Xd,payload:e=>({isReady:e})}],[vu.VideoStatisticDataChange]:[{event:tu,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[vu.VideoDetailedDataChange]:[{event:ou,payload:e=>e}],[vu.VideoAspectRatioChange]:[{event:pu,payload:e=>e}],[vu.NetworkQualityChange]:[{event:nu,payload:e=>e}],[vu.FarEndCameraRequestControl]:[{event:ru,payload:e=>e}],[vu.FarEndCameraResponseControl]:[{event:iu,payload:e=>e}],[vu.FarEndCameraInControlChange]:[{event:su,payload:e=>e}],[vu.FarEndCameraCapabilityChange]:[{event:au,payload:e=>e}]},fu="AUDIO_ACTIVE_SPEAKER",yu="AUDIO_UNMUTE_CONSENT",Su="AUDIO_CURRENT_USER_JOIN_BY_VOIP",bu="AUDIO_CURRENT_USER_JOIN_BY_PHONE",Eu="AUDIO_CURRENT_USER_LEAVE_AUDIO",Iu="AUDIO_CURRENT_USER_MUTED",Au="AUDIO_CURRENT_USER_UNMUTED",Cu="AUDIO_PARTICIPANT_AUDIO_UPDATE",_u="AUDIO_DIALOUT_RESULT_CODE",Ru="AUDIO_DIALOUT_RESULT_SUCCESS",wu="AUDIO_DIALOUT_RESULT_FAIL",Ou="AUDIO_DIALOUT_CANCEL_SUCCESS",Tu="DIALOUT_CANCEL_FAIL",Du="AUDIO_MERGE_AUDIO_INDICATION",Pu="USER_FORBIDDEN_MICROPHONE",ku="ESTABLISH_AUDIO_STREAM_ERROR",Mu="AUDIO_AUTO_PLAY_FAILED",Lu="INVALID_DEVICE_ID",Nu="AUDIO_ALLOW_TALK_CHANGE",Vu="SHARE_AUDIO_STATE_CHANGE",Uu="AUDIO_STATISTIC_DATA",ju="AUDIO_CURRENT_USER_SSRC",xu="AUDIO_SET_SPEAKER_RESULT",Bu="AUDIO_SHARE_SECONDARY_AUDIO_SUCCESS",Fu="AUDIO_CRC_CALL_OUT_RESULT_CODE",Hu="AUDIO_CRC_CALL_OUT_RESULT_SUCCESS",$u="AUDIO_CRC_CALL_OUT_RESULT_FAIL",Wu="AUDIO_CURRENT_AUDIO_LEVEL_CHANGE";let Gu=function(e){return e.ActiveSpeaker="active-speaker",e.UnmuteAudioConsent="unmute-audio-consent",e.CurrentAudioChange="current-audio-change",e.CurrentAudioLevelChange="current-audio-level-change",e.DialoutStateChange="dialout-state-change",e.MergeAudio="merged-audio",e.AutoPlayFailed="auto-play-audio-failed",e.AllowTalkChange="allow-talk-change",e.ShareAudioChange="share-audio-change",e.AudioStatisticDataChange="audio-statistic-data-change",e.CrcCallOutStateChange="crc-call-out-state-change",e}({});const zu={JoinComputerAudio:{success:Su,fail:[Pu,ku]},LeaveComputerAudio:{success:Eu},JoinAudioByCallMe:{success:Ru,fail:[wu]},cancelDialOut:{success:Ou,fail:[Tu]},hangup:{success:Eu},crcCallOut:{success:Hu,fail:[$u]}},Ku={[Gu.ActiveSpeaker]:[{event:fu,payload:e=>e}],[Gu.UnmuteAudioConsent]:[{event:yu,payload:e=>({reason:e})}],[Gu.CurrentAudioChange]:[{event:bu,payload:()=>({action:Ha.Join,type:Ad.Phone})},{event:Su,payload:()=>({action:Ha.Join,type:Ad.Computer})},{event:Eu,payload:e=>{let{source:t}=e;return{action:Ha.Leave,source:t}}},{event:Iu,payload:e=>{let{source:t}=e;return{action:Ha.Muted,source:t}}},{event:Au,payload:e=>{let{source:t}=e;return{action:Ha.Unmuted,source:t}}}],[Gu.DialoutStateChange]:[{event:_u,payload:e=>e}],[Gu.MergeAudio]:[{event:Du,payload:e=>e}],[Gu.AutoPlayFailed]:[{event:Mu,payload:()=>{}}],[Gu.AllowTalkChange]:[{event:Nu,payload:e=>({enabled:e})}],[Gu.ShareAudioChange]:[{event:Vu,payload:e=>e}],[Gu.AudioStatisticDataChange]:[{event:Uu,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[Gu.CrcCallOutStateChange]:[{event:Fu,payload:e=>e}],[Gu.CurrentAudioLevelChange]:[{event:Wu,payload:e=>e}]},qu="SHARE_ACTIVE_INDICATION",Ju="SHARE_CHECK_CHROME_SHARING_EXTENSION",Qu="SHARE_START_DESKTOP_SHARE_FAILED",Zu="SHARE_DIMENSION_CHANGE",Yu="SHARE_RECEIVED_DIMENSION_CHANGE",Xu="SHARE_VIDEO_STREAMS_END",el="SHARE_PASSIVE_STOP_SHARE",tl="SHARE_PASSIVE_BO_STOP",ol="SHARE_NEW_USER_ADD",nl="SHARE_USER_REMOVE",rl="SHARE_USER_PAUSED",il="SHARE_USER_RESUMED",sl="SHARE_AUTO_CHANGE_SOURCE",al="SHARE_REMOTE_CONTROL_APPROVE",dl="SHARE_GRAB_REMOTE_CONTROL_CHANGE",ul="SHARE_REMOTE_CONTROL_CLIPBOARD_CHANGE",ll="SHARE_REMOTE_CONTROL_SUCCESS",cl="SHARE_REMOTE_CONTROL_FAILED",pl="SHARE_PRIVILEGE_CHANGE",hl="SHARE_READ_RECEIPT",ml="SHARE_STATISTIC_DATA",vl="SHARE_REMOTE_CONTROL_REQUEST",gl="SHARE_REMOTE_CONTROL_APP_STATUS",fl="SHARE_REMOTE_CONTROL_SESSION_STATUS",yl="SHARE_REMOTE_CONTROL_APP_SCHEME";let Sl=function(e){return e.ShareActiveChange="active-share-change",e.ShareDimensionChange="share-content-dimension-change",e.SharePassiveStop="passively-stop-share",e.SharePeerStateChange="peer-share-state-change",e.ShareContentChange="share-content-change",e.SharePrivilegeChange="share-privilege-change",e.ShareReadReceipt="share-can-see-screen",e.ShareStatisticDataChange="share-statistic-data-change",e.RemoteControlApprovedChange="remote-control-approved-change",e.RemoteControlInControlChange="remote-control-in-control-change",e.RemoteControlClipboardChange="remote-control-clipboard-change",e.RemoteControlRequestChange="remote-control-request-change",e.RemoteControlAppStatusChange="remote-control-app-status-change",e.RemoteControlControlledStatusChange="remote-control-controlled-status-change",e}({});const bl={[Sl.ShareActiveChange]:[{event:qu,payload:e=>{const{isActive:t,activeUserId:o,...n}=e;return{state:t?"Active":"Inactive",userId:o,...n}}}],[Sl.ShareDimensionChange]:[{event:Zu,payload:e=>({type:"sended",width:e.width,height:e.height})},{event:Yu,payload:e=>({type:"received",width:e.width,height:e.height})}],[Sl.SharePassiveStop]:[{event:Xu,payload:()=>({reason:ed.StopScreenCapture})},{event:el,payload:()=>({reason:ed.PrivilegeChange})},{event:tl,payload:()=>({reason:ed.ShareFromMainSession})}],[Sl.SharePeerStateChange]:[{event:ol,payload:e=>({userId:e.id,action:"Start"})},{event:nl,payload:e=>({userId:e.id,action:"Stop"})},{event:rl,payload:e=>({userId:e.id,action:"Pause"})},{event:il,payload:e=>({userId:e.id,action:"Resume"})}],[Sl.ShareContentChange]:[{event:sl,payload:e=>e}],[Sl.SharePrivilegeChange]:[{event:pl,payload:e=>({privilege:e})}],[Sl.ShareReadReceipt]:[{event:hl,payload:()=>{}}],[Sl.ShareStatisticDataChange]:[{event:ml,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[Sl.RemoteControlApprovedChange]:[{event:al,payload:e=>({state:e?Xa.Approved:Xa.Rejected})}],[Sl.RemoteControlInControlChange]:[{event:dl,payload:e=>({isControlling:e})}],[Sl.RemoteControlClipboardChange]:[{event:ul,payload:e=>e}],[Sl.RemoteControlRequestChange]:[{event:vl,payload:e=>e}],[Sl.RemoteControlAppStatusChange]:[{event:gl,payload:e=>e}],[Sl.RemoteControlControlledStatusChange]:[{event:fl,payload:e=>e}]};let El=function(e){return e.Question="question",e.UpdateQuestion="updateQuestion",e.Answer="answer",e.DeleteComment="deleteComment",e.DeleteQuestion="deleteQuestion",e.Dismiss="dismiss",e.Reopen="reopen",e.Upvote="upvote",e.AnswerLive="answerLive",e}({}),Il=function(e){return e.QaSettingChange="qa-setting-change",e.QaActionChange="qa-action-change",e}({});const Al={[Il.QaSettingChange]:[{event:"QA_SETTING_OPTION_CHANGE",payload:e=>e}],[Il.QaActionChange]:[{event:"QA_NEW_ASK_QUESTION",payload:e=>({action:El.Question,data:e})},{event:"QA_UPDATE_ANONYMOUS_QUESTION",payload:e=>({action:El.UpdateQuestion,data:e})},{event:"QA_ANSWER_QUESTION",payload:e=>({action:El.Answer,data:e})},{event:"QA_ANSWER_REMOVE_COMMENT",payload:e=>({action:El.DeleteComment,data:e})},{event:"QA_ANSWER_REMOVE_QUESTION",payload:e=>({action:El.DeleteQuestion,data:e})},{event:"QA_ANSWER_DISMISS_QUESTION",payload:e=>({action:El.Dismiss,data:e})},{event:"QA_ANSWER_REOPEN_QUESTION",payload:e=>({action:El.Reopen,data:e})},{event:"QA_ANSWER_VOTE_QUESTION",payload:e=>({action:El.Upvote,data:e})},{event:"QA_ANSWER_QUESTION_LIVE",payload:e=>({action:El.AnswerLive,data:e})}]},Cl="INVALID_OPERATION",_l="INTERNAL_ERROR",Rl="OPERATION_TIMEOUT",wl="INSUFFICIENT_PRIVILEGES",Ol="IMPROPER_MEETING_STATE",Tl="INVALID_PARAMETERS",Dl="AUDIO_ENCODE_SUCCESS",Pl="AUDIO_DECODE_SUCCESS",kl="VIDEO_ENCODE_SUCCESS",Ml="VIDEO_DECODE_SUCCESS",Ll="SHARING_ENCODE_SUCCESS",Nl="SHARING_DECODE_SUCCESS",Vl="AUDIO_ENCODE_FAIL",Ul="AUDIO_DECODE_FAIL",jl="VIDEO_ENCODE_FAIL",xl="VIDEO_DECODE_FAIL",Bl="SHARING_ENCODE_FAIL",Fl="SHARING_DECODE_FAIL",Hl="MEDIA_DEVICE_CHANGE",$l="MEDIS_SDK_PATHCH_LOADED",Wl="AUDIO_BRIDGE_PEER_CONNECTION_RECEIVE_READY",Gl="AUDIO_BRIDGE_PEER_CONNECTION_SEND_READY",zl="DEVICE_PERMISSION_CHANGE",Kl="MEDIA_HEALTH_CHECK_FAILED";let ql=function(e){return e.DeviceChange="device-change",e.MediaSDKChange="media-sdk-change",e.DevicePermissionChange="device-permission-change",e.MediaInternalError="media-internal-error",e}({});const Jl={[ql.DeviceChange]:[{event:Hl,payload:()=>({})}],[ql.MediaSDKChange]:[{event:Dl,payload:()=>({type:"audio",action:"encode",result:"success"})},{event:Vl,payload:()=>({type:"audio",action:"encode",result:"fail"})},{event:Pl,payload:()=>({type:"audio",action:"decode",result:"success"})},{event:Ul,payload:()=>({type:"audio",action:"decode",result:"fail"})},{event:kl,payload:()=>({type:"video",action:"encode",result:"success"})},{event:jl,payload:()=>({type:"video",action:"encode",result:"fail"})},{event:Ml,payload:()=>({type:"video",action:"decode",result:"success"})},{event:xl,payload:()=>({type:"video",action:"decode",result:"fail"})},{event:Ll,payload:()=>({type:"share",action:"encode",result:"success"})},{event:Bl,payload:()=>({type:"share",action:"encode",result:"fail"})},{event:Nl,payload:()=>({type:"share",action:"decode",result:"success"})},{event:Fl,payload:()=>({type:"share",action:"decode",result:"fail"})}],[ql.DevicePermissionChange]:[{event:zl,payload:e=>e}],[ql.MediaInternalError]:[{event:Kl,payload:e=>e}]},Ql="BREAKOUT_ROOM_ADD_TOKEN",Zl="BREAKOUT_ROOM_INVITE_TO_JOIN_NOTIFICATION",Yl="BREAKOUT_ROOM_ROOM_CLOSING_COUNTDOWN",Xl="BREAKOUT_ROOM_ROOM_COUTDOWN",ec="BREAKOUT_ROOM_BROADCAST_MESSAGE",tc="BREAKOUT_ROOM_ASK_HELP_REQUEST",oc="BREAKOUT_ROOM_ASK_HELP_RESPONSE",nc="BREAKOUT_ROOM_ATTRIBUTE_INDICATION",rc="BREAKOUT_ROOM_JOIN_BO_RESPONSE",ic="BREAKOUT_ROOM_ROOM_COUNTDOWN_TIME_UP",sc="BREAKOUT_ROOM_CURRENT_USER_PARTICIPANT_ROLE",ac="BREAKOUT_ROOM_LOAD_PRE_ASSIGNED_ROOMS",dc="BREAKOUT_ROOM_MAIN_SESSION_USER_UPDATE",uc="BREAKOUT_ROOM_INVITE_TO_BACK_NOTIFICATION",lc="BREAKOUT_ROOM_IN_ROOM_USER_STATUS_UPDATE",cc="BREAKOUT_ROOM_BROADCAST_VOICE";let pc=function(e){return e.InviteToJoin="invite-to-join",e.RoomCountdown="room-countdown",e.RoomTimeUp="room-time-up",e.ClosingRoomCountdown="closing-room-countdown",e.BroadcastMessage="broadcast-message",e.AskForHelp="ask-for-help",e.AskForHelpResponse="ask-for-help-response",e.RoomStateChange="room-state-change",e.MainSessionUserUpdate="main-session-user-updated",e.InviteToBack="invite-back-to-main-session",e.RoomUserUpdate="room-user-update",e.BroadcastVoice="broadcast-voice",e}({});const hc={[pc.InviteToJoin]:[{event:Zl,payload:e=>e}],[pc.RoomCountdown]:[{event:Xl,payload:e=>e}],[pc.RoomTimeUp]:[{event:ic,payload:e=>e}],[pc.ClosingRoomCountdown]:[{event:Yl,payload:e=>e}],[pc.BroadcastMessage]:[{event:ec,payload:e=>e}],[pc.AskForHelp]:[{event:tc,payload:e=>e}],[pc.AskForHelpResponse]:[{event:oc,payload:e=>e}],[pc.RoomStateChange]:[{event:nc,payload:e=>({status:e.controlStatus})}],[pc.MainSessionUserUpdate]:[{event:dc,payload:()=>({})}],[pc.InviteToBack]:[{event:uc,payload:e=>e}],[pc.RoomUserUpdate]:[{event:lc,payload:e=>e}],[pc.BroadcastVoice]:[{event:cc,payload:e=>e}]};var mc=function(e){return e.StatusUpdate="archiving-status-update",e.OptionsUpdate="archiving-options-update",e}(mc||{});const vc={[mc.StatusUpdate]:[{event:"ARCHIVING_STATUS_UPDATE",payload:e=>e}],[mc.OptionsUpdate]:[{event:"ARCHIVING_OPTIONS_UPDATE",payload:e=>e}]};let gc=function(e){return e.PollDataChange="poll-data-change",e.PollSizeUpdate="poll-size-update",e.PollStatusUpdate="poll-status-update",e}({});const fc={[gc.PollDataChange]:[{event:"POLL_DATA_CHANGE",payload:e=>e}],[gc.PollSizeUpdate]:[{event:"POLL_SIZE_UPDATE",payload:e=>e}],[gc.PollStatusUpdate]:[{event:"POLL_STATUS_UPDATE",payload:e=>e}]};let yc=function(e){return e.ReactionReceived="reaction-received",e.ReactionRemoved="reaction-removed",e}({});const Sc={[yc.ReactionReceived]:[{event:"REACTION_RECEIVED",payload:e=>e}],[yc.ReactionRemoved]:[{event:"REACTION_REMOVED",payload:e=>e}]},bc="SMART_SUMMARY_STATUS_CHANGE",Ec="MEETING_QUERY_STATUS_CHANGE";let Ic=function(e){return e.SummaryChange="summary-status-change",e.MeetingQueryChang="meeting-query-status-change",e}({});const Ac={[Ic.SummaryChange]:[{event:bc,payload:e=>e}],[Ic.MeetingQueryChang]:[{event:Ec,payload:e=>e}]},Cc="LIVE_STREAM_STATUS_CHANGE",_c={"live-stream-status":[{event:Cc,payload:e=>e}]},Rc={...ia,...la,...ya,...Ia,...Na,...Ku,...gu,...Al,...bl,...Jl,...hc,...vc,"closed-caption-message":[{event:"CC_RECEIVE_MESSAGE",payload:e=>e}],"closed-caption-lt-status":[{event:"LT_STATUS_CHANGE",payload:e=>e}],"closed-caption-lt-message":[{event:"LT_RECEIVE_MESSAGE",payload:e=>e}],"closed-caption-status":[{event:"CC_ASSIGN_CC_EDITOR_SUCCESS",payload:e=>e},{event:"CC_STATUS_CHANGE",payload:e=>e}],...fc,...Sc,...Ac,..._c},wc=function(e){return{all:e=e||new Map,on:function(t,o){var n=e.get(t);n?n.push(o):e.set(t,[o])},off:function(t,o){var n=e.get(t);n&&(o?n.splice(n.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var n=e.get(t);n&&n.slice().map((function(e){e(o)})),(n=e.get("*"))&&n.slice().map((function(e){e(t,o)}))}}}(),Oc=new Map,Tc=new Array,Dc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;wc.emit(e,t)},Pc=e=>new Promise(((t,o)=>{e.fail&&e.fail.length>0?vt(st(wc,e.success).pipe(ft(1)),ct(...e.fail.map((e=>st(wc,e).pipe(ft(1),Xe((t=>xe({type:e,payload:t})))))))).subscribe((e=>t(e)),(e=>{"object"==typeof e.payload?o({type:e.type,...e.payload}):void 0===e.payload?o({type:e.type}):o(e)})):st(wc,e.success).pipe(ft(1)).subscribe((e=>t(e)))})),kc=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return new Promise(((n,r)=>{let i=fe;"string"==typeof e?i=st(wc,e).pipe(ft(1)):(i=st(wc,e.event),e.operations&&(i=e.operations.reduce(((e,t)=>e.pipe(t)),i))),vt(i,ut(o).pipe(Et(xe("timeout")))).subscribe((e=>{if(t){const o=t(e);"boolean"==typeof o?o?n(""):r({type:_l}):0===o.ret?n(o.body):r({type:_l,reason:o.body})}else n(e)}),(()=>{r({type:Rl})}))}))},Mc=(e,t)=>void 0!==t?st(wc,e).pipe(ft(t)):st(wc,e),Lc=()=>{Tc.forEach((e=>{e.unsubscribe()})),Tc.length=0,Oc.clear()},{setAttendeesList:Nc,setAssistantList:Vc,setIsAdmitAllSilentUsers:Uc,resetParticipants:jc,addFailoverAttendees:xc,removeFailoverAttendees:Bc,setClearRaiseHand:Fc,setClearAttendeeFeedback:Hc,updateAttendeeDisplayName:$c,removeXmppAttendeeUser:Wc,updateXmppAttendeeList:Gc,setAttendeeExtraKey:zc}=wo({SET_ATTENDEES_LIST:e=>e,SET_ASSISTANT_LIST:e=>e,UPDATE_XMPP_ATTENDEE_LIST:e=>e,RESET_PARTICIPANTS:()=>({}),SET_IS_ADMIT_ALL_SILENT_USERS:e=>e,REMOVE_FAILOVER_ATTENDEES:e=>e,ADD_FAILOVER_ATTENDEES:e=>e,SET_CLEAR_RAISE_HAND:()=>({}),SET_CLEAR_ATTENDEE_FEEDBACK:()=>({}),UPDATE_ATTENDEE_DISPLAY_NAME:e=>e,REMOVE_XMPP_ATTENDEE_USER:e=>e,SET_ATTENDEE_EXTRA_KEY:e=>e});var Kc="NOT_FOUND",qc=function(e,t){return e===t};function Jc(e,t){var o,n,r="object"==typeof t?t:{equalityCheck:t},i=r.equalityCheck,s=void 0===i?qc:i,a=r.maxSize,d=void 0===a?1:a,u=r.resultEqualityCheck,l=function(e){return function(t,o){if(null===t||null===o||t.length!==o.length)return!1;for(var n=t.length,r=0;r-1){var r=o[n];return n>0&&(o.splice(n,1),o.unshift(r)),r.value}return Kc}return{get:n,put:function(t,r){n(t)===Kc&&(o.unshift({key:t,value:r}),o.length>e&&o.pop())},getEntries:function(){return o},clear:function(){o=[]}}}(d,l);function p(){var t=c.get(arguments);if(t===Kc){if(t=e.apply(null,arguments),u){var o=c.getEntries().find((function(e){return u(e.value,t)}));o&&(t=o.value)}c.put(arguments,t)}return t}return p.clearCache=function(){return c.clear()},p}function Qc(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n{let{participants:{attendeesList:t}}=e;return t},Xc=e=>{let{meeting:{userId:t}}=e;return t},ep=e=>{let{participants:{xmppAttendeeList:t}}=e;return t};let tp=function(e){return e[e.Attendee=0]="Attendee",e[e.Host=1]="Host",e[e.Owner=4]="Owner",e[e.ViewOnly=8]="ViewOnly",e[e.HostOwner=5]="HostOwner",e[e.ViewOnlyCanTalk=24]="ViewOnlyCanTalk",e}({}),op=function(e){return e[e.Host=10]="Host",e[e.Panelist=20]="Panelist",e[e.Attendee=30]="Attendee",e}({}),np=function(e){return e[e.Client=9]="Client",e[e.Phone=5]="Phone",e[e.H323=15]="H323",e[e.Assitant=51]="Assitant",e}({});const rp=e=>(e&tp.Host)===tp.Host,ip=e=>(e&np.Phone)===np.Phone,sp=e=>e===tp.ViewOnlyCanTalk,ap=e=>(e&tp.ViewOnly)===tp.ViewOnly;let dp=function(e){return e[e.Automatically=1]="Automatically",e[e.Manually=2]="Manually",e[e.SelfSelect=3]="SelfSelect",e}({}),up=function(e){return e[e.NotStarted=1]="NotStarted",e[e.InProgress=2]="InProgress",e[e.Closing=3]="Closing",e[e.Closed=4]="Closed",e}({}),lp=function(e){return e[e.NoToken=1]="NoToken",e[e.GotToken=2]="GotToken",e[e.Started=3]="Started",e[e.Closing=4]="Closing",e[e.Closed=5]="Closed",e}({}),cp=function(e){return e.Initial="initial",e.Invited="invited",e.Joining="joining",e.InRoom="in room",e.Leaving="leaving",e.TimeUp="time up",e.MainSession="main session",e}({}),pp=function(e){return e.Join="joinRequest",e.Switch="switchRequest",e.Leave="leaveRequest",e.Broadcast="messageText",e.HelpReq="helpRequest",e.HelpRes="helpResponse",e.CoHostWantJoinThisBo="wantJoinThisBO",e.BOActivity="BOActivity",e}({});const hp="Subsession";let mp=function(e){return e[e.Received=0]="Received",e[e.Busy=1]="Busy",e[e.Ignore=2]="Ignore",e[e.AlreadyInRoom=3]="AlreadyInRoom",e}({}),vp=function(e){return e[e.AskToLeave=0]="AskToLeave",e[e.ClosingRoom=1]="ClosingRoom",e}({}),gp=function(e){return e[e.Active=0]="Active",e[e.Ask=1]="Ask",e}({}),fp=function(e){return e[e.Connect=1]="Connect",e[e.Muted=2]="Muted",e[e.Voip=4]="Voip",e}({}),yp=function(e){return e[e.Connect=8]="Connect",e[e.On=16]="On",e}({}),Sp=function(e){return e[e.Share=32]="Share",e[e.ShareAudio=64]="ShareAudio",e}({});const bp=e=>{let{breakoutRoom:t}=e;return t&&t.controlStatus},Ep=e=>{let{breakoutRoom:t}=e;return t&&t.currentRoom.status},Ip=Zc([Xc,Yc],((e,t)=>t.find((t=>t.userId===e)))),Ap=Zc([Ip],(e=>(null==e?void 0:e.isHost)||(null==e?void 0:e.bCoHost))),Cp=Zc([Ip],(e=>null==e?void 0:e.isHost)),_p=Zc([ep],(e=>e.filter((e=>e.userRole===op.Attendee)))),Rp=Zc([Yc],(e=>e.filter((e=>e.bHold&&!e.bid)))),wp=Zc([Yc,bp,Ep],((e,t,o)=>t!==up.InProgress&&t!==up.Closing||o!==cp.InRoom?e.filter((e=>!e.bHold&&!e.bid)):e.filter((e=>!e.bHold)))),Op=Zc([e=>{let{participants:{assistantList:t}}=e;return t}],(e=>e)),Tp=Zc([wp],(e=>e.find((e=>e.isHost)))),Dp=Zc([wp],(e=>e.filter((e=>e.bCoHost)))),Pp=Zc([Ip,wp],((e,t)=>t.filter((t=>t.userId!==(null==e?void 0:e.userId)))));Zc([ep],(e=>e.reduce(((e,t)=>{const{jid:o}=t;return Object.assign(e,{[o]:t}),e}),{}))),Zc([ep,e=>{let{meeting:{jid:t}}=e;return t}],((e,t)=>{var o;return null===(o=e.find((e=>e.jid===t)))||void 0===o?void 0:o.userId}));const kp=Zc([Yc],(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>(null==e?void 0:e.bLocalRecord)===_a.Start))})),Mp=Zc([bp,e=>{let{meeting:t}=e;return t&&t.meetingOptions},Yc,Cp],((e,t,o,n)=>{const r=o.filter((e=>e.bCoHost)),{moveToWRIfHostLeave:i}=t,s=e===up.InProgress;return n&&!!i&&r.length<=0&&!s&&o.length>1}));Zc([Yc,Ep,e=>{let{breakoutRoom:t}=e;return t&&t.mainSessionAttendeeList}],((e,t,o)=>(t===cp.InRoom?o:e).filter((e=>{return!(e.bHold||e.isHost||e.audio===Ad.Phone||ip(null==e?void 0:e.userType)||(t=null==e?void 0:e.caps,o=null==e?void 0:e.bMultiStreamVideoUser,((e,t)=>(e=>!!(128&e))(e)&&void 0!==t)(t,o)&&o));var t,o}))));let Lp=function(e){return e.Closed="closed",e.Connecting="connecting",e.Connected="connected",e}({});function Np(e){return 1<e,SET_ARCHIVING_SESSION_READY:e=>e,SET_ARCHIVING_OPTIONS:e=>e,RESET_ARCHIVING:()=>{}}),{setIsLiveTranscriptionEnabled:Kg,setLiveTranscriptionMeetingOptions:qg,setIsLiveTranscriptionManualCaptionerEnabled:Jg,setLiveTranscriptionGatewayId:Qg,setLiveTranscriptionSupportedLanguage:Zg,setIsLiveTranscriptionSubscribed:Yg,setCurrentTranscriptionLang:Xg,setCurrentTranslationLang:ef,addLiveTranscriptionMessage:tf,updateLiveTranscriptionMessage:of,reduceLiveTranscriptionMessages:nf,setLiveTranscriptionEngineType:rf,removeLiveTranscriptionFailoverState:sf,setLiveTranscriptionLastCaptionMessage:af,resetLiveTranscription:df,setIsHostDisableCaptions:uf}=wo("SET_IS_LIVE_TRANSCRIPTION_ENABLED","SET_LIVE_TRANSCRIPTION_MEETING_OPTIONS","SET_IS_LIVE_TRANSCRIPTION_MANUAL_CAPTIONER_ENABLED","SET_LIVE_TRANSCRIPTION_GATEWAY_ID","SET_LIVE_TRANSCRIPTION_SUPPORTED_LANGUAGE","SET_IS_LIVE_TRANSCRIPTION_SUBSCRIBED","SET_CURRENT_TRANSCRIPTION_LANG","SET_CURRENT_TRANSLATION_LANG","ADD_LIVE_TRANSCRIPTION_MESSAGE","UPDATE_LIVE_TRANSCRIPTION_MESSAGE","REDUCE_LIVE_TRANSCRIPTION_MESSAGES","SET_LIVE_TRANSCRIPTION_ENGINE_TYPE","REMOVE_LIVE_TRANSCRIPTION_FAILOVER_STATE","SET_LIVE_TRANSCRIPTION_LAST_CAPTION_MESSAGE","RESET_LIVE_TRANSCRIPTION"," SET_IS_HOST_DISABLE_CAPTIONS"),{setPollData:lf,setPollingId:cf,setPollingWebLinks:pf,setPollingDocMaxSize:hf,setPollingDocSize:mf,setPollingDocLibraryMaxSize:vf,setPollingDocLibrarySize:gf,resetPoll:ff}=wo("SET_POLL_DATA","SET_POLLING_ID","SET_POLLING_WEB_LINKS","SET_POLLING_DOC_MAX_SIZE","SET_POLLING_DOC_SIZE","SET_POLLING_DOC_LIBRARY_MAX_SIZE","SET_POLLING_DOC_LIBRARY_SIZE","RESET_POLL"),{setLoggerInitOptions:yf,setIsLaplaceInitialized:Sf,resetLogger:bf}=wo("SET_LOGGER_INIT_OPTIONS","SET_IS_LAPLACE_INITIALIZED","RESET_LOGGER"),{setIsLiveStreamEnable:Ef,setLiveStreamStatus:If,resetLiveStream:Af}=wo("SET_IS_LIVE_STREAM_ENABLE","SET_LIVE_STREAM_STATUS","RESET_LIVE_STREAM");var Cf={exports:{}},_f={};!function(e,t){var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},o(e,t)};function n(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,o=1,n=arguments.length;o90||o||(e(t+=(100-t)/50),requestAnimationFrame(n))};return n(),{finish:function(){100===t||o||(t=100,e(100))},abort:function(){100===t||o||(o=!0)},get curProgress(){return t}}}function w(){}function O(){O.init.call(this)}function T(e){return void 0===e._maxListeners?O.defaultMaxListeners:e._maxListeners}function D(e,t,o,n){var r,i,s;if("function"!=typeof o)throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,o.listener?o.listener:o),i=e._events),s=i[t]):(i=e._events=new w,e._eventsCount=0),s){if("function"==typeof s?s=i[t]=n?[o,s]:[s,o]:n?s.unshift(o):s.push(o),!s.warned&&(r=T(e))&&r>0&&s.length>r){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(a)}}else s=i[t]=o,++e._eventsCount;return e}function P(e,t,o){var n=!1;function r(){e.removeListener(t,r),n||(n=!0,o.apply(e,arguments))}return r.listener=o,r}function k(e){var t=this._events;if(t){var o=t[e];if("function"==typeof o)return 1;if(o)return o.length}return 0}function M(e,t){for(var o=new Array(t);t--;)o[t]=e[t];return o}w.prototype=Object.create(null),O.EventEmitter=O,O.usingDomains=!1,O.prototype.domain=void 0,O.prototype._events=void 0,O.prototype._maxListeners=void 0,O.defaultMaxListeners=10,O.init=function(){this.domain=null,O.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new w,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},O.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},O.prototype.getMaxListeners=function(){return T(this)},O.prototype.emit=function(e){var t,o,n,r,i,s,a,d="error"===e;if(s=this._events)d=d&&null==s.error;else if(!d)return!1;if(a=this.domain,d){if(t=arguments[1],!a){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(o=s[e]))return!1;var l="function"==typeof o;switch(n=arguments.length){case 1:!function(e,t,o){if(t)e.call(o);else for(var n=e.length,r=M(e,n),i=0;i0;)if(o[i]===t||o[i].listener&&o[i].listener===t){s=o[i].listener,r=i;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0==--this._eventsCount)return this._events=new w,this;delete n[e]}else!function(e,t){for(var o=t,n=o+1,r=e.length;n0?Reflect.ownKeys(this._events):[]};var L=function(e){function t(t){var o=e.call(this)||this;return o.timeout=(null==t?void 0:t.timeout)||3e4,o}return n(t,e),t.prototype.clearTimeoutCheck=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},t.prototype.startTimeoutCheck=function(){var e=this;!this.timeoutTimer&&!this.finished&&this.timeout>0&&(this.timeoutTimer=setTimeout((function(){e.finished||(e.finished=!0,e.data=null,e.emit("timeout")),e.clearTimeoutCheck()}),this.timeout))},t}(O),N=function(e){function t(t){var o=e.call(this,t)||this;return o.uuid=l(),o.domParams=t||{},o}return n(t,e),t.prototype.jsonp=function(){var e=this;if(!this.finished){var t=this.domParams,o=t.url,n=t.jsonpCallbackName,r=void 0===n?"callback":n,i=t.body,s=t.integrity;this.script=document.createElement("script"),s&&(this.script.integrity=s,this.script.crossOrigin="anonymous");var a="";i&&Object.entries(i).forEach((function(e){var t=e[0],o=e[1];a+=(a?"&":"")+t+"="+o})),a+=(a?"&":"")+r+"="+this.uuid,this.script.src=o+(o.includes("?")?"":"?")+a,this.jsonpCallback(),this.progressMonitory=R((function(t){e.finished||e.emit("progressUpdated",t)})),document.body.appendChild(this.script)}},t.prototype.clearSideEffect=function(e){if(void 0===e&&(e=!1),document.body.removeChild(this.script),e){var t=this.uuid;window[this.uuid]=function(){window[t]&&delete window[t]}}else delete window[this.uuid];this.script=null,this.uuid=null,this.finished=!0,this.data=null,this.clearTimeoutCheck()},t.prototype.jsonpCallback=function(){var e=this;this.script.onerror=function(t){var o;e.finished||(e.clearSideEffect(),null===(o=e.progressMonitory)||void 0===o||o.abort(),e.emit("error",new Error("string"==typeof t?t:"load jsonp script failed")))},window[this.uuid]=function(t){var o;if(!e.finished){var n=e.domParams,r=n.encoding,i=n.blobType,s=n.unZipOptions,a=n.beforeTransformData,d=n.afterTransformData;null===(o=e.progressMonitory)||void 0===o||o.finish(),e.clearSideEffect(),(a?a(t||""):Promise.resolve(t||"")).then((function(t){return _(t,{encoding:r,blobType:i,unZipOptions:s}).then((function(t){return(d?d(t):Promise.resolve(t)).then((function(t){return e.emit("finished",t)}))}))})).catch((function(t){return e.emit("error",t)}))}}},t.prototype.abort=function(){this.clearSideEffect(!0)},t}(L),V=function(e){function t(t){var o=e.call(this,t)||this;return o.socketParams=t||{},o}return n(t,e),t.prototype.write=function(e,t){e&&!this.finished&&(e instanceof Error?this.handleError(e):(this.data?this.appendData(e):this.data=e,this.handlePerCentUpdate(t)))},t.prototype.handlePerCentUpdate=function(e){void 0===e||this.finished||this.emit("progressUpdated",e)},t.prototype.handleError=function(e){this.data=null,this.finished=!0,this.clearTimeoutCheck(),this.emit("error",e)},t.prototype.appendData=function(e){d(e)===d(this.data)?"string"==typeof e?this.data+=e:Blob&&e instanceof Blob?this.data=new Blob([this.data,e],{type:e.type}):ArrayBuffer&&e instanceof ArrayBuffer&&(this.data=s(this.data,e)):this.handleError(new Error("every piece of the data format must be the same"))},t.prototype.end=function(e){var t=this;if(!this.finished){this.handlePerCentUpdate(100),e&&this.write(e);var o=this.socketParams,n=o.encoding,r=o.blobType,i=o.unZipOptions,s=o.beforeTransformData,a=o.afterTransformData;(s?s(this.data):Promise.resolve(this.data)).then((function(e){return _(e,{encoding:n,blobType:r,unZipOptions:i}).then((function(e){return(a?a(e):Promise.resolve(e)).then((function(e){return t.emit("finished",e)}))}))})).catch((function(e){return t.emit("error",e)})),this.data=null,this.finished=!0,this.clearTimeoutCheck()}},t.prototype.abort=function(){this.data=null,this.finished=!0,this.clearTimeoutCheck()},t}(L),U=function(t){function o(e){var o=t.call(this,e)||this;return o.xhrParams=e||{},o.xhrParams.headers=r({},o.xhrParams.headers||{}),o}return n(o,t),o.prototype.supportFetch=function(){return!!window.fetch&&window.AbortController&&window.Request},o.prototype.ajax=function(){var t=this;if(!this.finished)if(this.xhrParams.url){var o=this.xhrParams,n=o.headers,i=void 0===n?{}:n,s=o.url,a=o.body,d=void 0===a?{}:a,u=o.method,l=void 0===u?"POST":u,c=o.encoding,p=o.integrity;this.controller=this.supportFetch()?new AbortController:new XMLHttpRequest;var h=this.supportFetch()?R((function(e){t.finished||t.emit("progressUpdated",e)})):null;(this.supportFetch()?fetch(new Request(s,r({method:l,headers:i,body:"GET"===l?void 0:JSON.stringify(d),signal:this.controller.signal},p?{integrity:p,mode:"cors"}:{}))).then((function(t){return t.ok?c===e.TransformDataFormat.STRING?t.text():c===e.TransformDataFormat.ARRAY_BUFFER?t.arrayBuffer():t.blob():Promise.reject(new Error("xhr download "+s+" failed!"))})):new Promise((function(o,n){var r=new XMLHttpRequest;t.controller=r,r.open(l,s),r.responseType=c===e.TransformDataFormat.STRING?"text":c===e.TransformDataFormat.ARRAY_BUFFER?"arraybuffer":"blob",Object.entries(i).forEach((function(e){var t=e[0],o=e[1];r.setRequestHeader(t,o)})),r.onload=function(){var e=r.status,t=r.response,i=r.statusText;e>=200&&e<300||304===e?o(t):n(new Error(e+": "+i))},r.onprogress=function(e){var o=e||{},n=o.total,r=o.loaded;void 0===r||t.finished||(n?t.emit("progressUpdated",r/n*100):r&&!h&&(h=R((function(e){t.finished||t.emit("progressUpdated",e)}))))},r.onerror=function(){n(new Error("xhr download "+s+" failed!"))},r.send(JSON.stringify(d))}))).then((function(e){if(!t.finished){var o=t.xhrParams,n=o.encoding,r=o.blobType,i=o.unZipOptions,s=o.beforeTransformData,a=o.afterTransformData;null==h||h.finish(),t.finished=!0,t.clearTimeoutCheck(),(s?s(e):Promise.resolve(e)).then((function(e){return _(e,{encoding:n,blobType:r,unZipOptions:i}).then((function(e){return(a?a(e):Promise.resolve(e)).then((function(e){return t.emit("finished",e)}))}))})).catch((function(e){return t.emit("error",e)}))}})).catch((function(e){t.finished||(t.finished=!0,t.clearTimeoutCheck(),null==h||h.abort(),t.emit("error",e))}))}else this.emit("error",new Error("xhrDownloader url params invalid!"))},o.prototype.abort=function(){this.data=null,this.finished=!0,this.clearTimeoutCheck(),this.controller.abort()},o}(L),j=0;O.defaultMaxListeners=500;var x,B=new O,F="ThreadPoolReady",H=function(){j-=1,B.emit(F)};(x=e.DownloaderType||(e.DownloaderType={})).XHR="xhr",x.DOM="dom",x.SOCKET="socket";var $=function(t){function o(o){var n=t.call(this)||this;return n.aborted=!1,n.downloadParmas=r({type:e.DownloaderType.XHR},o),n.id=l(),n}return n(o,t),o.prototype.start=function(){var t=this;j+=1,this.progress=0,this.emit("downloadStart"),this.onDownloadStartCallback&&this.onDownloadStartCallback();var o=this.downloadParmas,n=o.type,r=o.xhrParams,i=o.domParams,s=o.socketParams;switch(n){case e.DownloaderType.DOM:this.downloader=new N(i),this.downloader.jsonp();break;case e.DownloaderType.SOCKET:this.downloader=new V(s);break;default:this.downloader=new U(r),this.downloader.ajax()}return this.downloader.startTimeoutCheck(),this.downloader.on("error",(function(e){t.emit("error",e),t.onErrorCallback&&t.onErrorCallback(e),H()})).on("finished",(function(e){t.emit("complete",e),t.onCompleteCallback&&t.onCompleteCallback(e),H()})).on("progressUpdated",(function(e){t.progress=e,t.emit("progressUpdated",e),t.onProgressUpdatedCallback&&t.onProgressUpdatedCallback(e)})).on("timeout",(function(){t.emit("timeout"),t.onTimeoutCallback&&t.onTimeoutCallback(),H()})),this},o.prototype.abort=function(){if(this.aborted)return this;this.aborted=!0,this.downloader&&!this.downloader.finished&&this.downloader.abort();var e=new Error("file download has been aborted");return this.emit("abort",e),this.onAbortCallback&&this.onAbortCallback(e),H(),this},o.prototype.onDownloadStart=function(e){return this.onDownloadStartCallback=e,this},o.prototype.onProgressUpdated=function(e){return this.onProgressUpdatedCallback=e,this},o.prototype.onError=function(e){return this.onErrorCallback=e,this},o.prototype.onComplete=function(e){return this.onCompleteCallback=e,this},o.prototype.onAbort=function(e){return this.onAbortCallback=e,this},o.prototype.onTimeout=function(e){return this.onTimeoutCallback=e,this},o.prototype.isInProgress=function(){return void 0!==this.progress},o.prototype.isFinished=function(){return 100===this.progress},o}(O),W=function(){function e(e){this.taskList=[],this.options=e||{};var t=this.options.threadLimit;if((void 0===t?6:t)>6)throw new Error("threadLimit must be lower than 6");B.on(F,this.startNextTask.bind(this))}return e.prototype.download=function(e){var t=new $(e),o=this.removeTask.bind(this,t);return t.on("abort",o),this.taskList.push(t),this.checkTaskReady(t),t},e.prototype.startNextTask=function(){var e=this.taskList.find((function(e){return!e.isInProgress()}));e&&this.checkTaskReady(e)},e.prototype.checkTaskReady=function(e){var t=this.options.threadLimit,o=void 0===t?6:t;if(!(this.taskList.findIndex((function(e){return!e.isInProgress()}))>=o||j+1>6)){var n=this.removeTask.bind(this,e);e.on("complete",n),e.on("error",n),e.on("timeout",n),setTimeout((function(){return e.start()}),0)}},e.prototype.removeTask=function(e){var t=this;this.taskList.some((function(o,n){return o===e&&(setTimeout((function(){return e.removeAllListeners()}),0),t.taskList.splice(n,1),!0)}))},e}();e.DownloadTask=$,e.IDownloadManager=W,e.appendBuffer=s,e.arrayBufferToBlob=h,e.arrayBufferToString=m,e.blobToArrayBuffer=c,e.blobToText=p,e.genUuid=l,e.getDataFormat=d,e.getExtName=f,e.getFileName=S,e.getFullPathName=y,e.isImgFile=b,e.isJsonFile=E,e.isVersionFile=I,e.monitorProgress=R,e.sep=a,e.stringToArrayBuffer=g,e.stringToBlob=v,e.transformData=_,Object.defineProperty(e,"__esModule",{value:!0})}(_f,Qt(Object.freeze({__proto__:null,loadAsync:function(){},default:{}}))),Jt(_f),function(e,t){var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},o(e,t)};function n(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,o=1,n=arguments.length;o0&&d.length>r){d.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+d.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=d.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(u)}}else d=s[t]=o,++e._eventsCount;return e}function u(e,t,o){var n=!1;function r(){e.removeListener(t,r),n||(n=!0,o.apply(e,arguments))}return r.listener=o,r}function l(e){var t=this._events;if(t){var o=t[e];if("function"==typeof o)return 1;if(o)return o.length}return 0}function c(e,t){for(var o=new Array(t);t--;)o[t]=e[t];return o}i.prototype=Object.create(null),s.EventEmitter=s,s.usingDomains=!1,s.prototype.domain=void 0,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.init=function(){this.domain=null,s.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new i,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(e){var t,o,n,r,i,s,a,d="error"===e;if(s=this._events)d=d&&null==s.error;else if(!d)return!1;if(a=this.domain,d){if(t=arguments[1],!a){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(o=s[e]))return!1;var l="function"==typeof o;switch(n=arguments.length){case 1:!function(e,t,o){if(t)e.call(o);else for(var n=e.length,r=c(e,n),i=0;i0;)if(o[s]===t||o[s].listener&&o[s].listener===t){a=o[s].listener,r=s;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete n[e]}else!function(e,t){for(var o=t,n=o+1,r=e.length;n0?Reflect.ownKeys(this._events):[]};var p="ZipInfo:";function h(e){var t;return null===(t=null==e?void 0:e.path)||void 0===t?void 0:t.startsWith(p)}function m(e){return"string"==typeof e&&e.startsWith(p)}function v(e,t){return(Array.isArray(e)?e:[e]).some((function(e){if("number"!=typeof e.version)throw new Error("file version must be an int number");return e.version=0;r--){var i=o.memoryFiles[r];("string"==typeof e&&(i.path===e||i.path.startsWith(""+e+t.sep))||e.path===i.path)&&o.memoryFiles.splice(r,1)}n(!0)}))},o.prototype.clear=function(){var e=this;return new Promise((function(t){e.memoryFiles=[],t(!0)}))},o.prototype.findFileByPath=function(e){var t=this;return new Promise((function(o){o(t.memoryFiles.filter((function(t){return t.path===e}))[0])}))},o.prototype.findFileBySourceURL=function(e){var t=this;return new Promise((function(o){o(t.memoryFiles.filter((function(t){return t.sourceURL===e})))}))},o.prototype.isDirectory=function(e){var o=this;return new Promise((function(n){m(e)?n(!1):n(o.memoryFiles.some((function(o){return o.path.startsWith(""+e+t.sep)})))}))},o.prototype.ls=function(e){var o=this;return new Promise((function(n){var r=[];o.memoryFiles.forEach((function(o){if(!h(o))if(e){if(o.path.startsWith(""+e+t.sep)){var n=o.path.split(""+e+t.sep)[1]||"";if(n.includes(t.sep)){var i=""+e+t.sep+n.split(t.sep)[0];return void(i&&!r.includes(i)&&r.push(i))}r.push(o)}}else if(o.path.includes(t.sep)){var s=o.path.split(t.sep)[0]||"";s&&!r.includes(s)&&r.push(s)}else r.push(o)})),n(r)}))},o}(y),I=function(e){function o(t){var o=e.call(this)||this;if(o.isLocalAvaliable=void 0,o.isEnable()){var n=(t||{}).nameSpaceId;o.storageName=function(e){return"resource-manager"+(e?"-"+e:"")}(n)}return o}return n(o,e),o.prototype.isEnable=function(){if(void 0!==this.isLocalAvaliable)return this.isLocalAvaliable;try{this.isLocalAvaliable=!0,localStorage.setItem("privateTest","")}catch(e){this.isLocalAvaliable=!1}return this.isLocalAvaliable},o.prototype.saveFile=function(e){var t=this;return this.isEnable()?new Promise((function(o){var n=t.getLocalFile();n.some((function(t,o){return t.path===e.path&&(n.splice(o,1,e),!0)}))||n.push(e),localStorage.setItem(t.storageName,JSON.stringify(n)),o(!0)})):Promise.resolve(!1)},o.prototype.getLocalFile=function(){var e=localStorage.getItem(this.storageName),t=[];if(e)try{t=JSON.parse(e)||"[]"}catch(e){console.log(e)}return t},o.prototype.removeFile=function(e){var o=this;return this.isEnable()?new Promise((function(n){for(var r=o.getLocalFile(),i=r.length-1;i>=0;i--){var s=r[i];("string"==typeof e&&(s.path===e||s.path.startsWith(""+e+t.sep))||e.path===s.path)&&r.splice(i,1)}localStorage.setItem(o.storageName,JSON.stringify(r)),n(!0)})):Promise.resolve(!1)},o.prototype.clear=function(){var e=this;return this.isEnable()?new Promise((function(t){localStorage.removeItem(e.storageName),t(!0)})):Promise.resolve(!1)},o.prototype.findFileByPath=function(e){var t=this;return this.isEnable()?new Promise((function(o){o(t.getLocalFile().filter((function(t){return t.path===e}))[0])})):Promise.resolve(void 0)},o.prototype.findFileBySourceURL=function(e){var t=this;return this.isEnable()?new Promise((function(o){o(t.getLocalFile().filter((function(t){return t.sourceURL===e})))})):Promise.resolve([])},o.prototype.isDirectory=function(e){var o=this;return this.isEnable()?new Promise((function(n){m(e)?n(!1):n(o.getLocalFile().some((function(o){return o.path.startsWith(""+e+t.sep)})))})):Promise.resolve(!1)},o.prototype.ls=function(e){var o=this;return this.isEnable()?new Promise((function(n){var r=[];o.getLocalFile().forEach((function(o){if(!h(o))if(e){if(o.path.startsWith(""+e+t.sep)){var n=o.path.split(""+e+t.sep)[1]||"";if(n.includes(t.sep)){var i=""+e+t.sep+n.split(t.sep)[0];return void(i&&!r.includes(i)&&r.push(i))}r.push(o)}}else if(o.path.includes(t.sep)){var s=o.path.split(t.sep)[0]||"";s&&!r.includes(s)&&r.push(s)}else r.push(o)})),n(r)})):Promise.resolve([])},o}(y);(f=e.FileStoreEnum||(e.FileStoreEnum={})).MEMORY="memoryStore",f.INDEX_DB="indexedDBStore",f.STORAGE="storageStore";var A=function(o){function i(e){var t=o.call(this)||this;return t.indexedDBStore=new b(e),t.memoryStore=new E,t.storageStore=new I(e),t}return n(i,o),i.prototype.saveFile=function(t,o,n){var i=this;void 0===o&&(o=!0);var s=(n||{}).forceSpecifyStore;return(o?this.findFileByPath(t.path,n):Promise.resolve(void 0)).then((function(o){if((null==o?void 0:o.version)&&v(t,o.version))throw new Error("there is an higher version file existed already");var n=r(r({},t),{createTime:o&&o.createTime||Date.now(),updateTime:Date.now()});return s&&i[s]&&i[s].isEnable()&&(s!==e.FileStoreEnum.STORAGE||i.isLocalStorageAvaliable(n))?i[s].saveFile(n):i[i.saveToTargetStoreRule(n)].saveFile(n)}))},i.prototype.isLocalStorageAvaliable=function(e){var o=e.data;return"string"===t.getDataFormat(o)&&o.length<=102400&&this.storageStore.isEnable()},i.prototype.saveToTargetStoreRule=function(t){return this.indexedDBStore.isEnable()?e.FileStoreEnum.INDEX_DB:this.isLocalStorageAvaliable(t)?e.FileStoreEnum.STORAGE:e.FileStoreEnum.MEMORY},i.prototype.removeFile=function(e,t){var o=(t||{}).forceSpecifyStore;return o&&this[o]?this[o].removeFile(e):Promise.all([this.indexedDBStore.removeFile(e),this.storageStore.removeFile(e),this.memoryStore.removeFile(e)]).then((function(){return!0}))},i.prototype.clear=function(e){var t=(e||{}).forceSpecifyStore;return t&&this[t]?this[t].clear():Promise.all([this.indexedDBStore.clear(),this.storageStore.clear(),this.memoryStore.clear()]).then((function(){return!0}))},i.prototype.findFileByPath=function(e,t){var o=this,n=(t||{}).forceSpecifyStore;return n&&this[n]?this[n].findFileByPath(e):g(this.searchInTargetStoreRule(),(function(t,n){return t?Promise.resolve(t):o[n].findFileByPath(e)}))},i.prototype.findFileBySourceURL=function(e,t){var o=this,n=(t||{}).forceSpecifyStore;return n&&this[n]?this[n].findFileBySourceURL(e):g(this.searchInTargetStoreRule(),(function(t,n){return o[n].findFileBySourceURL(e).then((function(e){return t?t.filter((function(t){return!e.some((function(e){return e.path===t.path}))})).concat(e||[]):e||[]}))}))},i.prototype.searchInTargetStoreRule=function(){return[e.FileStoreEnum.INDEX_DB,e.FileStoreEnum.STORAGE,e.FileStoreEnum.MEMORY]},i.prototype.isDirectory=function(e){var t=this;return e?g(this.searchInTargetStoreRule(),(function(o,n){return o?Promise.resolve(!0):t[n].isDirectory(e)})):Promise.resolve(!0)},i.prototype.ls=function(e){var t=this;return this.isDirectory(e).then((function(o){if(!o)throw new Error("path: "+e+" is an invalid directory path");return g(t.searchInTargetStoreRule(),(function(o,n){return t[n].ls(e).then((function(e){return o?(e||[]).concat(o.filter((function(t){return!e.some((function(e){return"string"==typeof t?e===t:"string"!=typeof e&&e.path===t.path}))}))):e}))}))}))},i}(s),C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(s),_=function(e){function o(o){var n=e.call(this)||this,r=o||{},i=r.storeOptions,s=r.downloadManagerOptions;return n.downloadManager=new t.IDownloadManager(s),n.store=new A(i),n.store.indexedDBStore.on("ready",(function(){return n.emit("ready")})),n}return n(o,e),o.prototype.getFile=function(e,t,o){var n=this,r=new C,i=Promise.resolve(void 0),s=t||{},a=s.downloadOptions,d=s.forceDownload,u=s.saveRootPath;d?i=Promise.resolve(void 0):"string"==typeof e?i=this.store.findFileByPath(e,o):(null==e?void 0:e.sourceURL)?i=this.store.findFileBySourceURL(e.sourceURL):a&&(a.domParams||a.socketParams||a.xhrParams)&&(i=this.store.findFileBySourceURL(this.genSourceURL(a)));var l=null,c=new Promise((function(e){l=e}));return r.getDownloadTask=function(){return c},i=i.then((function(e){if(e&&(!Array.isArray(e)||e.length)){var t=e;if(Array.isArray(t)){var n=t.find((function(e){return h(e)}));if(!n)return;t=t.filter((function(e){return!h(e)}));var i=n.data;if("string"!=typeof i)return;if(!JSON.parse(i||"[]").every((function(e){return t.some((function(t){return t.path===e}))})))return}if(!(null==o?void 0:o.targetVersion)||!v(t,o.targetVersion))return r.emit("checkExpire",!1),t;r.emit("checkExpire",!0)}})).then((function(t){if(!t&&a){var i=n.downloadManager.download(a);return l(i),new Promise((function(t,s){i.on("complete",(function(i){setTimeout((function(){var s=Array.isArray(i)?i.map((function(e){var t=e.data,r=e.path,i=e.extName;return{path:n.genFilePath(u,r),sourceURL:n.genSourceURL(a),data:t,fileFormat:i||n.getFileFormat(a),version:(null==o?void 0:o.targetVersion)||1}})):{path:n.genFilePath(u,void 0),sourceURL:n.genSourceURL(a),data:i,fileFormat:n.getFileFormat(a),version:(null==o?void 0:o.targetVersion)||1};if(Array.isArray(s)&&"string"==typeof e&&e){var d=s.find((function(t){return t.path===e}));t(d||s)}else t(s);r.emit("beforeSet",s),n.beforeWrite(s,o).then((function(){r.emit("afterSet")})).catch((function(e){return r.emit("afterSet",e)}))}),0)})),i.on("abort",s),i.on("error",s),i.on("timeout",(function(){return s(new Error("download timeout"))}))}))}return l(void 0),t})).catch((function(e){return l(void 0),Promise.reject(e)})),r.getResult=function(){return i},r},o.prototype.genSourceURL=function(e){var o=e.domParams,n=e.type,r=e.xhrParams;if(n===t.DownloaderType.SOCKET)return null;var i=(n===t.DownloaderType.DOM?o:r)||{},s=i.url,a=void 0===s?"":s,d=i.body;return d&&Object.keys(d).length?a+(a.includes("?")?"&":"?")+"downloadBodyParams="+JSON.stringify(d):a},o.prototype.updateFile=function(e,t){return this.saveStore(e,!0,t)},o.prototype.beforeWrite=function(e,t){var o=this;return Array.isArray(e)?Promise.all(e.concat(function(e){var t=e[0].sourceURL||"";return{path:""+p+t,sourceURL:t,data:JSON.stringify(e.map((function(e){return e.path})))}}(e)).map((function(e){return o.saveStore(e,!1,t)}))).then((function(e){return e.filter((function(e){return!h(e)}))})):this.saveStore(e,!0,t)},o.prototype.getFileFormat=function(e){var o=e||{},n=o.xhrParams,r=o.domParams,i=o.socketParams,s=o.type;return s===t.DownloaderType.DOM&&(null==r?void 0:r.fileFormat)?r.fileFormat:s===t.DownloaderType.SOCKET&&(null==i?void 0:i.fileFormat)?i.fileFormat:(null==n?void 0:n.fileFormat)?n.fileFormat:"unknow"},o.prototype.genFilePath=function(e,o){return o?""+(e||"")+(e?t.sep:"")+o:e||""},o.prototype.saveStore=function(e,t,o){return void 0===t&&(t=!0),this.store.saveFile(e,t,o).then((function(t){if(t)return e;throw new Error("fail to save file in local store")}))},o.prototype.remove=function(e,t){return this.store.removeFile(e,t)},o.prototype.clear=function(e){return this.store.clear(e)},o.prototype.list=function(e){return this.store.ls(e)},o.prototype.updateVersion=function(e,t){var o=this;return this.store.findFileByPath(e).then((function(n){if(n)return o.saveStore(r(r({},n),{version:t})).then((function(){}));throw new Error("the target path: "+e+" isn't existed")}))},o.prototype.updateSourceURL=function(e,t){var o=this;return this.store.findFileByPath(e).then((function(n){if(n)return o.saveStore(r(r({},n),{sourceURL:t})).then((function(){}));throw new Error("the target path: "+e+" isn't existed")}))},o}(s);e.IResourceManager=_,Object.defineProperty(e,"__esModule",{value:!0})}(Cf.exports,_f),Jt(Cf.exports);class Rf{constructor(e){this._cancelError=new Error("request for lock canceled"),this._locked=void 0,this._queue=[],this._waiters=[],this._currentReleaser=void 0,e&&(this._cancelError=e),this._locked=!1}acquire(){const e=this.isLocked(),t=new Promise(((e,t)=>this._queue.push({resolve:e,reject:t})));return e||this._dispatch(),t}async runExclusive(e){const t=await this.acquire();try{return await e()}finally{t()}}async waitForUnlock(){return this.isLocked()?new Promise((e=>this._waiters.push({resolve:e}))):Promise.resolve()}isLocked(){return this._locked}release(){if(this._currentReleaser){const e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatch(){const e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._locked=!1,this._resolveWaiters(),this._dispatch())},this._locked=!0,e.resolve(this._currentReleaser)}_resolveWaiters(){this._waiters.forEach((e=>e.resolve())),this._waiters=[]}}function wf(e,t,o){const n=document.createElement("script");n.type="text/javascript",n.readyState?n.onreadystatechange=()=>{"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,t())}:(n.onload=()=>{t()},n.onerror=()=>{o()}),n.src=e,window.crossOriginIsolated&&(n.crossOrigin="anonymous"),"function"==typeof document.body.append?document.getElementsByTagName("head")[0].append(n):document.getElementsByTagName("head")[0].appendChild(n)}function Of(e,t){let o=e;/^https?:\/\//.test(o)||(o=`https://${e}`);try{const e=new URL(o);if(!t)return e.href;if(t.hostname)return e.hostname;if(t.path)return e.pathname}catch(e){return""}return""}function Tf(e){if(e){var t;const o=document.getElementById(e);null==o||null===(t=o.parentNode)||void 0===t||t.removeChild(o)}}let Df="zoom.us";const Pf="3.8.10",kf=`https://dmogdx0jrul3u.cloudfront.net/${Pf}/lib/av`,Mf=`https://source.zoom.us/${Pf}/lib/av`,Lf=`https://jssdk.zoomus.cn/${Pf}/lib/av`,Nf=()=>Df,Vf=(e,t,o)=>ot([t,o].map(((t,o)=>{if("initial"!==t)return Ue(["success"===t]);{const t=0===o?"ENCODE":"DECODE";return vt(Mc(`${e.toUpperCase()}_${t}_SUCCESS`,1).pipe(ze((()=>!0))),Mc(`${e.toUpperCase()}_${t}_FAIL`,1).pipe(ze((()=>!1))))}}))),Uf=e=>{const t=Ip(e.value);return t?je(t):Mc($s,1).pipe(Le(pe),Tt(e),ze((e=>{let[,t]=e;return Ip(t)})))};function jf(e,t){var o,n;const r="audio"===e?null===(o=t.audio)||void 0===o?void 0:o.audioSsrc:null===(n=t.video)||void 0===n?void 0:n.videoSsrc,i="audio"===e?ju:cu;return"audio"===e&&Ki()||r?Promise.resolve():kc(i)}const xf=()=>Ue(navigator.mediaDevices.enumerateDevices()).pipe(ze((e=>{const t=[],o=[],n=[];return e.forEach((e=>{const{kind:r,deviceId:i,label:s}=e,a=s.replace(/\([\w,\d]+:[\w,\d]+\)/i,"").trim();switch(r){case"audioinput":"communications"===i||/ZoomAudioDevice/i.test(a)||/Zoom-\S*/.test(a)||/CubebAggregateDevice\S*/.test(a)||/Microsoft Teams Audio/i.test(a)||t.push({deviceId:i,label:a});break;case"audiooutput":"communications"===i||/ZoomAudioDevice/i.test(a)||/Microsoft Teams Audio/i.test(a)||o.push({deviceId:i,label:a});break;case"videoinput":n.push({deviceId:i,label:a})}})),{microphones:t,speakers:o,cameras:n}})));function Bf(e){const{x:t,y:o,width:n,height:r}=e.getBoundingClientRect();return{scaleWidth:n,scaleHeight:r,srcOffsetX:t,srcOffsetY:o}}function Ff(e){if(e){let o=e;try{const t=e.width;e.width=t}catch(n){var t;o=e.cloneNode(!0),null===(t=e.parentNode)||void 0===t||t.replaceChild(o,e)}return o}return e}function Hf(){try{return"undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(Ga)}catch(e){return!1}}function $f(){var e;return null===(e=WebAssembly)||void 0===e?void 0:e.validate(za)}const Wf=(()=>{const e=new Rf;return{withAudioAction:t=>function(){for(var o=arguments.length,n=new Array(o),r=0;r{let i=!1;const s=setTimeout((()=>{i=!0,e.release()}),3e4);try{await e.acquire(),i||clearTimeout(s),o(t(...n))}catch(e){i||(clearTimeout(s),r(e))}}))},processAudioAction:t=>e.acquire().then((()=>t())),completeAudioAction:()=>{e.release()},cancelAllAudioAction:()=>{e.cancel()}}})();function Gf(e){const t=["joinComputerAudio","joinSharingAudio","leaveComputerAudio","leaveSharingAudio"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return Wf.withAudioAction(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}function zf(e){var t;const{browserVersion:o,isChrome:n,isFirefox:r,isSafari:i,isAndroidOrIOSBrowser:s,isSupportMediaStreamTrackProcessor:a,isSupportOffscreenCanvas:d}=zi,u=Number(null==o||null===(t=o.match(/^\d+/))||void 0===t?void 0:t[0]),l=n&&u>=91,c=r&&u>=89,p=i&&mr(o,"17.4")>=0,h=navigator.hardwareConcurrency>2;let m=Ji();return e&&!m&&(m=d&&a),!s&&m&&(l||c||p)&&h}const Kf=(e,t)=>{const o=document.createElement("link");return o.rel="preload",o.href=e,o.as=t,o.crossOrigin="anonymous",o},qf=(e,t,o)=>{const n=[],r=[],i=Array.isArray(e)?e:[e];return Us.filter((e=>{var o;return i.includes(e.category)&&(e.tag===t||(null===(o=e.tag)||void 0===o?void 0:o.split(",").includes(t)))})).forEach((e=>{"worker"===e.type?n.push(`${o}${e.name}`):"wasm"===e.type&&r.push(`${o}${e.name}`)})),{workers:n,wasms:r}};function Jf(e,t,o){const n={};if("function"!=typeof window.SharedArrayBuffer){const{isIOSMobile:e,isSafari:r,isSupportOffscreenCanvas:i,isSupportMediaStreamTrackProcessor:s}=zi,a=e||r||i&&s;Object.assign(n,{enableMultiDecodeVideoWithoutSAB:!!t&&a}),i&&s&&Object.assign(n,{enableVirtualBackgroundWithoutSAB:!!o})}return zf(o)&&Object.assign(n,{resourceManager:Cf.exports.IResourceManager,file:[{path:`${e}/vb-resource/dualModel.bin`,type:"bin"},{path:`${e}/vb-resource/tf.min.js`,type:"js"}]}),n}function Qf(e,t){const{media:{isAudioBridgeReceiveReady:o,isAudioBridgeSendReady:n},audio:{customizeAudioOption:r}}=e,i=void 0!==t?t:!(null==r||!r.speakerOnly);return ot([o?Ue([!0]):Mc(Wl,1).pipe(yt(!0)),n||i?Ue([!0]):Mc(Gl,1).pipe(yt(!0))])}function Zf(e,t,o){if(e.deviceId===t)return!0;if("default"===t){const n=o.find((e=>e.deviceId===t));if(n)return n.label.indexOf(e.label)>-1}return!1}function Yf(e){return e.find((e=>"default"===e.deviceId))}const Xf=(()=>{let e,t=!1;return{watch:function(o){t=!0,e=Promise.race([o,yr((()=>!0),1e4)]).then((()=>{e=void 0,t=!1})).finally((()=>{e=void 0,t=!1}))},acquire:function(){return t&&e?e:Promise.resolve()}}})(),ey=(e,t)=>kc({event:ta,operations:[mt((t=>void 0!==t[`${e}`])),ft(1)]},(o=>o[`${e}`]===t));class ty{constructor(){this.audioPlaybackUrl=void 0,this.videoPlaybackUrl=void 0,this._audioElement=void 0,this._videoElement=void 0,this.videoSrc=void 0,this.isUsingSameFile=void 0}static getInstance(){return void 0===this.instance&&(this.instance=new ty),this.instance}static destroyInstance(){if(this.instance){this.instance.stopAudioElement(),this.instance.stopVideoElement();const t=document.getElementById(cd);var e;t&&(null===(e=t.parentNode)||void 0===e||e.removeChild(t)),this.instance=void 0}}setAudioElement(e){return void 0===this._audioElement&&(this._audioElement=new Audio),new Promise(((t,o)=>{if(this.videoSrc===e.url)this._audioElement.pause(),this.isUsingSameFile=!0,this._videoElement.muted=!1,(r=this._videoElement).currentTime>0&&!r.paused&&!r.ended&&r.readyState>2?t(""):this._videoElement.play().then((()=>{t("")})).catch((()=>{o()}));else{var n;this.isUsingSameFile=!1;const r=zi.isFirefox?"canplay":"canplaythrough",i=()=>{this._audioElement.play().then((()=>{this._audioElement.removeEventListener(r,i),t("")}))},s=()=>{this._audioElement.removeEventListener(r,i),this._audioElement.removeEventListener("error",s),o()};this._audioElement.addEventListener(r,i),this._audioElement.addEventListener("error",s),this._audioElement.src=e.url,this._audioElement.loop=!!e.loop,br(e.url)&&this._audioElement.setAttribute("crossorigin",""),this._audioElement.currentTime=Math.max(null!==(n=e.currentTime)&&void 0!==n?n:0,1e-4)}var r}))}setVideoElement(e){return void 0===this._videoElement&&(this._videoElement=document.createElement("video")),new Promise(((t,o)=>{var n;this.videoSrc=e.url;const r=zi.isFirefox?"canplay":"canplaythrough",i=()=>{this._videoElement.play().then((()=>{this._videoElement.removeEventListener(r,i),t("")}))},s=()=>{this._videoElement.removeEventListener(r,i),this._videoElement.removeEventListener("error",s),o()};this._videoElement.addEventListener(r,i),this._videoElement.addEventListener("error",s),this._videoElement.src=e.url,this.isUsingSameFile||(this._videoElement.muted=!0),this._videoElement.loop=!!e.loop,this._videoElement.currentTime=null!==(n=e.currentTime)&&void 0!==n?n:0,br(e.url)&&this._videoElement.setAttribute("crossorigin",""),zi.isSafari&&!document.getElementById(cd)&&(this._videoElement.id=cd,this._videoElement.setAttribute("style","position:fixed;top:-10000px;left:-10000px"),document.body.appendChild(this._videoElement))}))}get audioElement(){return this.isUsingSameFile?this._videoElement:this._audioElement}get videoElement(){return this._videoElement}stopAudioElement(){this.isUsingSameFile||this._audioElement&&(this._audioElement.currentTime=0,this._audioElement.pause())}stopVideoElement(){this._videoElement&&this._videoElement.pause(),this.videoSrc=void 0}}ty.instance=void 0;const oy=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{socket:{zoomSocketStatus:o,xmppSocketStatus:n,mainSessionSocketStatus:r},meeting:{meetingStatus:i}}=e,s=[];if(i===Di.Joined){var a;const t=Hs.getInstance(),o=Ns.createAgent();if((null===(a=Ip(e))||void 0===a?void 0:a.audio)===Ad.Computer&&t.leaveComputerAudio(),t.disconnect(),Xf.watch(t.destroy()),e.video&&(e.video.subscribedVideoList.length>0&&e.video.subscribedVideoList.forEach((e=>{o.unsubscribeVideo(e)})),e.video.isCurrentUserStartedVideo&&Dc(Kd)),e.share&&e.share.isReceiveSharing){const t=e.share.activeNodeId;e.share.remoteControlledUserList.length>0&&e.share.remoteControlledUserList.forEach((e=>{o.sharingRequestRemoteControl(e,!1)})),o.unsubscribeSharing(t)}ty.destroyInstance()}if(t||(Vi.clearSession(),[Ui.WebclientTk,Ui.WebclientZsk,Ui.WebclientZtk,Ui.WebclientRecordingToken].forEach((e=>{sessionStorage.removeItem(e)})),is.destroy()),o!==Lp.Closed&&s.push(No()),n!==Lp.Closed&&s.push(Vo()),r!==Lp.Closed&&s.push(Fo()),t){const o=Ip(e);s.push(ti({audio:null==o?void 0:o.audio,muted:null==o?void 0:o.muted,video:null==o?void 0:o.bVideoOn,isFailover:t}))}else s.push(ti({audio:!1,muted:void 0,video:!1,isFailover:t}));return s.push(qo(),mn(),jc(),Yp(t),cm(),Am(t),Rv(),Dv(),jg(),og(),vg(),Hg(),zg(),df(t),ff(),bf(t),Af(t),ui(Di.Closed)),s},ny=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;nt.find((t=>t.userId===e.userId&&(!e.key||void 0!==t[`${e.key}`]))))),mt((e=>!!e)),ft(1)]},...o)},ry={[`${Pi.AudioBridgeEnable}`]:{mask:240,action:gi},[`${Pi.AudioDecodeInWorklet}`]:{mask:15,action:sn},[`${Pi.VideoFullHD}`]:{mask:15,action:iv},[`${Pi.VideoShareFullHD}`]:{mask:15,action:lm},[`${Pi.WebGL2Render}`]:{mask:15,action:dv},[`${Pi.WebGPURender}`]:{mask:15,action:uv},[`${Pi.ZMKFromRWG}`]:{mask:15,action:_i}};function iy(e){if(!e)return"";const t=e.match(/rid=(.*)/);return t?t[1]:""}function sy(e){return F(ze(((t,o)=>e(t,o))),mt((e=>null!=e)))}function ay(e){return F(Xe(((t,o)=>e(t,o)||fe)))}function dy(e){return F(Xe(((t,o)=>e(t,o))),Xe((e=>Array.isArray(e)?Ue(e):je(e))))}const uy={period:500,rules:[{peak:50,throttle:300},{peak:60,throttle:400}]},ly={[`${ds}`]:()=>({payloads:{add:[],update:[],remove:[]},onThrottle(e){e.add&&this.payloads.add.push(...e.add),e.update&&this.payloads.update.push(...e.update),e.remove&&this.payloads.remove.push(...e.remove)}})};function cy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uy;return t=>new $((o=>{const n=new Map;let r=0,i=null;const{period:s,rules:a}=e;let d=null;i||(i=((e,t)=>{const o=performance.now();let n=0,r=!1;return setTimeout((function i(){n+=t,e();const s=performance.now()-o-n,a=setTimeout(i,Math.max(t-s,0));r&&clearTimeout(a)}),t),()=>{r=!0}})((()=>{r=0}),s));const u=Object.keys(ly),l=t.subscribe({next(e){if(e&&e.evt&&null!==i){r+=1;const{evt:t,body:i}=e,s=String(t);if(u.indexOf(s)>=0)if(d){const e=n.get(s);if(e)e.onThrottle(i);else{const e=ly[s]();e.onThrottle(i),n.set(s,e)}}else{let t=0;if(a.forEach((e=>{r>e.peak&&(t=e.throttle)})),t>0){const e=ly[s]();e.onThrottle(i),n.set(s,e),d=setTimeout((()=>{n.forEach(((e,t)=>{const n={evt:Number(t),body:e.payloads};o.next(n)})),n.clear(),d=null}),t)}else o.next(e)}else o.next(e)}else o.next(e)},error(e){o.error(e)},complete(){o.complete()}});return()=>{l.unsubscribe(),i&&(i(),i=null),r=0}}))}let py=function(e){return e[e.Unknown=0]="Unknown",e[e.Windows=1]="Windows",e[e.Mac=2]="Mac",e[e.Pad=3]="Pad",e[e.Mobile=4]="Mobile",e[e.CallIn=5]="CallIn",e[e.Linux=6]="Linux",e[e.WebClient=7]="WebClient",e[e.ChromeOs=8]="ChromeOs",e}({});const hy=262144,my=1048576,vy=e=>!(4&~e),gy=e=>(e&my)===my,fy=e=>{let{share:{isReceiveSharing:t}}=e;return t},yy=e=>{let{share:{activeNodeId:t}}=e;return t},Sy=Zc([wp,fy,yy],(function(){let e=arguments.length>2?arguments[2]:void 0;if(arguments.length>1?arguments[1]:void 0){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((t=>t.userId===e&&!0===t.sharerOn));if(t){let{os:e}=t;const{pwaOS:o}=t;return"mac"===o?e=py.Mac:"win"===o&&(e=py.Windows),{...t,os:e}}}return null})),by=Zc([wp],(e=>e.filter((e=>e.sharerOn)))),Ey=Zc([by],(e=>e.some((e=>!!e.bVideoShare)))),Iy=Zc([e=>{let{share:{remoteControlledUserList:t}}=e;return t},fy,yy],((e,t,o)=>!!t&&e.some((e=>fr(e,o)))));var Ay,Cy=new Uint8Array(16);function _y(){if(!Ay&&!(Ay="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 Ay(Cy)}for(var Ry,wy,Oy,Ty,Dy=/^(?:[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,Py=[],ky=0;ky<256;++ky)Py.push((ky+256).toString(16).substr(1));function My(e,t,o){var n=(e=e||{}).random||(e.rng||_y)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){o=o||0;for(var r=0;r<16;++r)t[o+r]=n[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(Py[e[t+0]]+Py[e[t+1]]+Py[e[t+2]]+Py[e[t+3]]+"-"+Py[e[t+4]]+Py[e[t+5]]+"-"+Py[e[t+6]]+Py[e[t+7]]+"-"+Py[e[t+8]]+Py[e[t+9]]+"-"+Py[e[t+10]]+Py[e[t+11]]+Py[e[t+12]]+Py[e[t+13]]+Py[e[t+14]]+Py[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Dy.test(e)}(o))throw TypeError("Stringified UUID is invalid");return o}(n)}!function(e){e[e.PLAIN=0]="PLAIN",e[e.RSA=1]="RSA",e[e.AESGCM256=2]="AESGCM256"}(Ry||(Ry={})),function(e){e[e.info=0]="info",e[e.debug=1]="debug",e[e.log=2]="log",e[e.warn=3]="warn",e[e.error=4]="error"}(wy||(wy={})),function(e){e[e.PROTECT_LOCAL_KEY=0]="PROTECT_LOCAL_KEY"}(Oy||(Oy={})),function(e){e.beforeInit="beforeInit",e.afterInit="afterInit",e.beforeLog="beforeLog",e.hitSizeLimit="hitSizeLimit",e.afterLog="afterLog",e.beforeReport="beforeReport",e.afterReport="afterReport"}(Ty||(Ty={}));class Ly{constructor(){}}var Ny,Vy={exports:{}},Uy={exports:{}},jy=Qt(Object.freeze({__proto__:null,default:{}}));Uy.exports=(Ny=Ny||function(e,t){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==qt&&qt.crypto&&(o=qt.crypto),!o)try{o=jy}catch(e){}var n=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var o;return e.prototype=t,o=new e,e.prototype=null,o}}(),i={},s=i.lib={},a=s.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},d=s.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,o=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[n+i>>>2]|=s<<24-(n+i)%4*8}else for(var a=0;a>>2]=o[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,o=this.sigBytes;t[o>>>2]&=4294967295<<32-o%4*8,t.length=e.ceil(o/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],o=0;o>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,o=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new d.init(o,t/2)}},c=u.Latin1={stringify:function(e){for(var t=e.words,o=e.sigBytes,n=[],r=0;r>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,o=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new d.init(o,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},h=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var o,n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*u,i);if(u){for(var c=0;c>>6-s%4*2;r[i>>>2]|=a<<24-i%4*8,i++}return o.create(r,i)}t.enc.Base64={stringify:function(e){var t=e.words,o=e.sigBytes,n=this._map;e.clamp();for(var r=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var d=n.charAt(64);if(d)for(;r.length%4;)r.push(d);return r.join("")},parse:function(e){var t=e.length,o=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i{try{const t=xy.exports.parse(e);return Vy.exports.stringify(t)}catch(t){return e}},Hy=e=>{for(var t=e.length,o=e.length-1;o>=0;o--){var n=e.charCodeAt(o);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&o--}return t},$y=()=>By(void 0,void 0,void 0,(function*(){return yield self.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"])})),Wy=(e,t,o)=>By(void 0,void 0,void 0,(function*(){try{return yield self.crypto.subtle.encrypt({name:"AES-GCM",iv:o},t,e)}catch(e){throw e}})),Gy=(e,t)=>{const o="string"==typeof e?function(e){const t=new ArrayBuffer(e.length),o=new Uint8Array(t);for(let t=0,n=e.length;t{zy[t]=e},qy=zy,Jy=e=>{try{return JSON.stringify(e)}catch(e){return"json stringify failed"}},Qy=e=>{try{return JSON.parse(e)}catch(t){return e}};const Zy=e=>{let t=0;return t+=Hy(e.message),e.tags.forEach((e=>{t+=Hy(e)})),t};class Yy{constructor(e){this.uuid="randomUUID"in self.crypto?self.crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));const{databaseName:t,maxSize:o,publicKey:n,reportUrl:r,plugins:i,idbManager:s,logManager:a,currentSize:d,externalKeys:u,codecWorkerFilePath:l}=e;this.databaseName=t,this.maxSize=o,this.publicKey=null!=n?n:"",this.reportUrl=null!=r?r:"",this.plugins=null!=i?i:[],this.idbManager=s,this.logManager=a,this.currentSize=null!=d?d:0,this.externalKeys=u,this.commonMethods=Object.assign({},qy)}getLocalAESGCM256Key(){var e;return function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(this.localAESGCM256Key)return this.localAESGCM256Key;this.localAESGCM256Key=yield $y();const t=this.externalKeys?null===(e=this.externalKeys.filter((e=>e.usage===Oy.PROTECT_LOCAL_KEY))[0])||void 0===e?void 0:e.key:void 0;return yield this.idbManager.saveAESGCM256Key(this.uuid,this.localAESGCM256Key,t),this.localAESGCM256Key}))}updateCurrentSize(e){var t;let o=null!==(t=this.currentSize)&&void 0!==t?t:0;if(e instanceof Map)for(const[t,n]of e)o+=Zy(n);else o+=Zy(e);return this.currentSize=o,o>=this.maxSize}}const Xy=(...e)=>{const t={},o=[];for(const n of e)n.forEach((e=>{t[e.id]||(t[e.id]=!0,o.push(e))}));const n=new Map;return o.sort(((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id))).forEach((e=>{n.set(e.id,e)})),n},eS=(e,t)=>{const o=new Map;return t.forEach((t=>{e(t)&&o.set(t.id,t)})),o};class tS{constructor(){this.getStore=()=>({byTag:Object.assign({},this.store.byTag),byTime:new Map(this.store.byTime)}),this.pushByTime=e=>{for(const t of e)this.store.byTime.set(t.id,t)},this.pushByTag=e=>{e.forEach((e=>{const t=e.tags;Array.isArray(t)&&t.forEach((t=>{this.store.byTag[t]||(this.store.byTag[t]=new Map),this.store.byTag[t].set(e.id,e)}))}))},this.addLog=e=>{let t=e;Array.isArray(e)||(t=[e]),this.pushByTime(t),this.pushByTag(t)},this.syncFromIDB=e=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const t=yield e.getAllLogs();this.addLog(t)})),this.reset=()=>{this.store={byTag:{},byTime:new Map}},this.deleteLogs=e=>{for(const t of e){const e=this.store.byTime.get(t);if(!e)continue;const{tags:o}=e;for(const e of o)this.store.byTag[e].delete(t);this.store.byTime.delete(t)}},this.filterStore=e=>{const t=((e,t)=>{if(!t)return e.byTime;if("string"==typeof t)return e.byTag[t]||new Map;if(Array.isArray(t)){if(t.every((e=>"string"==typeof e)))return Xy(...t.map((t=>e.byTag[t])).filter((e=>Boolean(e))))}else{if("function"==typeof t)return eS(t,e.byTime);if("object"==typeof t)if(t.tags&&t.filter){if("string"==typeof t.tags)return eS(t.filter,e.byTag[t.tags]);if(Array.isArray(t.tags)&&t.tags.every((e=>"string"==typeof e)))return Xy(...t.tags.map((o=>{const n=e.byTag[o];return n?eS(t.filter,n):new Map})))}else{if(t.filter)return eS(t.filter,e.byTime);if(t.tags){if("string"==typeof t)return e.byTag[t]||new Map;if(Array.isArray(t)&&t.every((e=>"string"==typeof e)))return Xy(...t.map((t=>e.byTag[t])))}}else console.error("Wrong filter type")}return new Map})(this.store,e),o=new Map;for(const[e,n]of t){const t=Object.assign(Object.assign({},n),{message:Qy(Fy(n.message))});o.set(e,t)}return o},this.store={byTag:{},byTime:new Map}}}function oS(e,t,o){const n=e.plugins;if(!Array.isArray(n))return o;let r=o;return n.forEach((o=>{const n=o[t];if("function"==typeof n){const t=n(e,r);t&&(r=t)}})),r}const nS=(e,t,o,n,r,i={})=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){const{noCache:s,extraProperties:a={}}=i,d=((e,t,o,n,r,i)=>{const s=Array.isArray(t)?t:[t],a=Date.now();return Object.assign({message:e,logLevel:o,tags:s,encryptMode:n,timestamp:a,laplaceSessionId:r},i)})(`${t}`,o,n,r,e.uuid,a),u=oS(e,Ty.beforeLog,d);if(s)oS(e,Ty.afterLog,d);else{const{idbManager:t,logManager:o}=e,n=yield t.makeNextId();u.message=(e=>{try{const t=Vy.exports.parse(e);return xy.exports.stringify(t)}catch(t){return e}})(u.message);const r=Object.assign(Object.assign({},u),{id:n});e.updateCurrentSize(r)&&oS(e,Ty.hitSizeLimit,r),o.addLog(r),yield t.addLog(r),oS(e,Ty.afterLog,r)}}));Ky(nS,"commonLog");const rS=e=>new Promise((t=>{const o=new XMLHttpRequest;o.open(e.type||"GET",e.url,!0),o.withCredentials=e.withCredentials,o.onerror=o=>{t({error:o,report:e.reportItem})},o.onreadystatechange=function(){if(4===o.readyState){const n=o.status;t(n>=200&&n<300?{report:e.reportItem}:{error:`Request failed, status: ${n}, responseText: ${o.responseText}`,report:e.reportItem})}},Object.entries(e.headers).forEach((([e,t])=>{t&&e&&o.setRequestHeader(e,t)})),o.send(e.data)}));const iS=(e,t=2)=>{let o=`${e}`;for(;o.length{const t=new Date(e);return`${t.getUTCFullYear()}-${iS(t.getUTCMonth()+1)}-${iS(t.getUTCDate())} ${iS(t.getUTCHours())}:${iS(t.getUTCMinutes())}:${iS(t.getUTCSeconds())}.${iS(t.getUTCMilliseconds(),3)}`},aS={version:"000001",flag:"0"},dS=(e,t)=>Array.from(e.values()).reduce(((e,o)=>{const n=((e,t)=>{const{message:o,logLevel:n,tags:r,timestamp:i,encryptMode:s,id:a}=e,d=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r30720?e.push({messages:[n],ids:[o.id],currentSize:r}):(i.messages.push(n),i.ids.push(o.id),i.currentSize+=r),e}),[{messages:[],ids:[],currentSize:0}]).filter((e=>e.currentSize>0)).map((e=>({messages:e.messages.join("\n"),ids:e.ids,meta:aS}))),uS=(e,t,o)=>((e,t,o)=>Promise.all(e.map((e=>Object.assign({url:t||"",type:"POST",withCredentials:!1,headers:{},data:Jy({messages:e.messages,meta:e.meta}),reportItem:e},o))).map(rS)))(e,t.reportUrl,o).then((e=>{e.forEach((e=>{var o;oS(t,Ty.afterReport,{report:e.report,error:null!==(o=e.error)&&void 0!==o?o:null})}))})),lS=(e,t,o)=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){const n=e.logManager.filterStore(t);if(!n||0===(null==n?void 0:n.size)||!o)return;const{xhrOptions:r={},additionalContext:i}=o,s=oS(e,Ty.beforeReport,n),a=dS(s,i);uS(a,e,r)}));Ky(lS,"commonReport");var cS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))};const pS=(e,t,o)=>cS(void 0,void 0,void 0,(function*(){const{idbManager:n,logManager:r}=e;if(Array.isArray(o)&&(yield n.deleteLogs(o),r.deleteLogs(o),!t))return;const i=e.logManager.filterStore(t),s=[];for(const[e,t]of i)s.push(t.id);let a=s;Array.isArray(s)||(a=[s]),yield n.deleteLogs(a),r.deleteLogs(a)})),hS=e=>cS(void 0,void 0,void 0,(function*(){const{idbManager:t,logManager:o}=e;yield t.reset(),o.reset()}));function mS(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:yS())("readwrite",(function(t){return e.forEach((function(e){return t.delete(e)})),vS(t.transaction)}))}function bS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yS();return e("readonly",(function(t){if(t.getAll&&t.getAllKeys)return Promise.all([vS(t.getAllKeys()),vS(t.getAll())]).then((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,r,i=[],s=!0,a=!1;try{for(o=o.call(e);!(s=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mS(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?mS(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),o=t[0],n=t[1];return o.map((function(e,t){return[e,n[t]]}))}));var o=[];return e("readonly",(function(e){return function(e,t){return e.openCursor().onsuccess=function(){this.result&&(function(e){o.push([e.key,e.value])}(this.result),this.result.continue())},vS(e.transaction)}(e).then((function(){return o}))}))}))}Ky(pS,"commonDelete"),Ky(hS,"commonReset");var ES=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))};const IS={default:{queue:[],isRunning:!1,listeners:[]}},AS=e=>{let t=IS[e];return t||(t={queue:[],isRunning:!1,listeners:[]},IS[e]=t),t};function CS(e){return ES(this,void 0,void 0,(function*(){const t=AS(e),{queue:o,listeners:n}=t;for(;o.length>0&&!t.isRunning;){const n=o.shift();t.isRunning=!0;try{const e=yield n.task();n.resolution(e)}catch(e){n.rejection(e)}t.isRunning=!1,CS(e)}n.length&&n.forEach((e=>{e()}))}))}function _S(e,t){const o=AS(t);try{return new Promise(((n,r)=>{o.queue.push({task:e,resolution:n,rejection:r}),CS(t)}))}catch(e){return Promise.reject(e)}}const RS=(e,t)=>{AS(e).listeners.push(t)};var wS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))};const OS="change_meta",TS="change_log",DS=()=>Promise.resolve();class PS{constructor(e){this.waitingForReset=!1,this.resetting=!1,this.isChangingMeta=!1,this.isChangingLog=!1,this.dbFailCount={read:0,write:0},this.get=e=>function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:yS())("readonly",(function(t){return vS(t.get(e))}))}(e,this.store),this.set=(e,t)=>wS(this,void 0,void 0,(function*(){try{return!(this.dbFailCount.write>3)&&(yield function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:yS())("readwrite",(function(o){return o.put(t,e),vS(o.transaction)}))}(e,t,this.store))}catch(o){o instanceof DOMException&&(o&&"QuotaExceededError"===o.name?(yield this.deleteOldLogsForSetNewOne(),yield this.set(e,t)):this.dbFailCount.write+=1),console.error(o)}})),this.deleteOldLogsForSetNewOne=()=>wS(this,void 0,void 0,(function*(){var e;const t=yield this.getAllLogs(),o=[];for(let n=0;n<13;n++){const r=null===(e=t[n])||void 0===e?void 0:e.id;(r||0===r)&&o.push(`${r}`)}return SS(o,this.store)})),this.adjustMaxId=()=>wS(this,void 0,void 0,(function*(){return this.resetting?DS():(this.isChangingMeta=!0,yield _S((()=>wS(this,void 0,void 0,(function*(){var e;const t=yield this.getAllLogs(),o=t[t.length-1],n=null!==(e=null==o?void 0:o.id)&&void 0!==e?e:0;return yield this.set("maxId",n),n}))),OS))})),this.makeNextId=()=>wS(this,void 0,void 0,(function*(){return this.resetting?DS():(this.isChangingMeta=!0,yield _S((()=>wS(this,void 0,void 0,(function*(){const e=yield this.get("maxId");if(!e&&0!==e)return yield this.set("maxId",0),0;const t=e+1;return yield this.set("maxId",t),t}))),OS))})),this.addLog=e=>wS(this,void 0,void 0,(function*(){if(this.resetting)return DS();this.isChangingLog=!0,yield _S((()=>wS(this,void 0,void 0,(function*(){const{id:t}=e;return this.set(`${t}`,e)}))),TS)})),this.getAllLogs=()=>wS(this,void 0,void 0,(function*(){return(yield bS(this.store)).filter((([e])=>"maxId"!==e)).sort(((e,t)=>{var o,n;return(null===(o=e[1])||void 0===o?void 0:o.id)-(null===(n=t[1])||void 0===n?void 0:n.id)})).map((([,e])=>e))})),this.deleteLogs=e=>wS(this,void 0,void 0,(function*(){if(this.resetting)return DS();this.isChangingLog=!0,yield _S((()=>wS(this,void 0,void 0,(function*(){return SS(e.map((e=>`${e}`)),this.store)}))),TS),yield this.adjustMaxId()})),this.saveAESGCM256Key=(e,t,o)=>wS(this,void 0,void 0,(function*(){if(o){const n=yield self.crypto.subtle.exportKey("raw",t),r=yield((e,t,o)=>By(void 0,void 0,void 0,(function*(){return new Promise(((n,r)=>{requestAnimationFrame((()=>By(void 0,void 0,void 0,(function*(){var r;const i=null===(r=null==t?void 0:t.algorithm)||void 0===r?void 0:r.name;let s;if("RSA-OAEP"===i?s=Gy:"AES-GCM"===i&&(s=Wy),!s)throw new Error("Unsupported encrypt key type");if("string"==typeof e){const r=new TextEncoder,i=yield s(r.encode(e),t,o);n(i)}else{const r=yield s(e,t,o);n(r)}}))))}))})))(n,o,new Uint8Array(16));yield this.set(`aes-gcm-256-${e}`,r)}else yield this.set(`aes-gcm-256-${e}`,t)})),this.reset=()=>wS(this,void 0,void 0,(function*(){return this.resetting?DS():(this.waitingForReset=!0,this.isChangingLog||this.isChangingMeta?DS():(this.resetting=!0,yield function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:yS())("readwrite",(function(e){return e.clear(),vS(e.transaction)}))}(this.store),this.resetting=!1,void(this.waitingForReset=!1)))})),this.store=gS(e,e+"-store"),RS(OS,(()=>{if(this.isChangingMeta=!1,this.waitingForReset)return this.reset()})),RS(TS,(()=>{if(this.isChangingLog=!1,this.waitingForReset)return this.reset()}))}}var kS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))};const MS={databaseName:"laplace-default-db",maxSize:49283072};class LS{constructor(e){this.commonLogWithContext=(e,t,o,n,r)=>kS(this,void 0,void 0,(function*(){yield nS(this.runtimeMetaManager,e,t,o,n,r)})),this.commonReportWithContext=(e,t)=>kS(this,void 0,void 0,(function*(){yield lS(this.runtimeMetaManager,e,t)})),this.commonDeleteWithContext=e=>kS(this,void 0,void 0,(function*(){yield pS(this.runtimeMetaManager,e)})),this.resetWithContext=()=>kS(this,void 0,void 0,(function*(){yield hS(this.runtimeMetaManager)})),this.initLocalAESGCM256Key=()=>kS(this,void 0,void 0,(function*(){return yield $y()})),this.doNotUseDirtyGetStore=()=>this.runtimeMetaManager.logManager.getStore(),this.log=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.log,Ry.PLAIN,{extraProperties:o})})),this.info=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.info,Ry.PLAIN,{extraProperties:o})})),this.warn=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.warn,Ry.PLAIN,{extraProperties:o})})),this.debug=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.debug,Ry.PLAIN,{extraProperties:o})})),this.error=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.error,Ry.PLAIN,{extraProperties:o})})),this.logWithEncryption=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.log,Ry.AESGCM256,{extraProperties:o})})),this.infoWithEncryption=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.info,Ry.AESGCM256,{extraProperties:o})})),this.debugWithEncryption=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.debug,Ry.AESGCM256,{extraProperties:o})})),this.warnWithEncryption=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.warn,Ry.AESGCM256,{extraProperties:o})})),this.errorWithEncryption=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.error,Ry.AESGCM256,{extraProperties:o})})),this.logWithoutCache=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.log,Ry.PLAIN,{extraProperties:o,noCache:!0})})),this.infoWithoutCache=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.info,Ry.PLAIN,{extraProperties:o,noCache:!0})})),this.warnWithoutCache=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.warn,Ry.PLAIN,{extraProperties:o,noCache:!0})})),this.debugWithoutCache=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.debug,Ry.PLAIN,{extraProperties:o,noCache:!0})})),this.errorWithoutCache=(e,t,o)=>kS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,wy.error,Ry.PLAIN,{extraProperties:o,noCache:!0})})),this.getLogs=e=>{const t=this.runtimeMetaManager.logManager;return t?t.filterStore(e):new Map},this.report=(...e)=>((e,t,o={})=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var n,r;const i=null!==(n=o.sampleRate)&&void 0!==n?n:1;if(Math.random()>i)return;if(Hy(t)>30720)throw new Error("ERROR: Laplace .report(strMsg) size bigger than 30KB is NOT allowed.");const s=Object.assign({message:Object.assign({strMsg:t},o.extraMsg),time:sS(Date.now())},o.extraData);return(null===(r=null==o?void 0:o.tags)||void 0===r?void 0:r.length)&&(s.tags=null==o?void 0:o.tags),uS([{messages:JSON.stringify(s),meta:aS}],e,o.xhrOptions)})))(this.runtimeMetaManager,...e),this.reportByHttps=(e,t)=>kS(this,void 0,void 0,(function*(){yield this.commonReportWithContext(e,t)})),this.deleteLog=e=>kS(this,void 0,void 0,(function*(){yield this.commonDeleteWithContext(e)})),this.deleteAll=()=>kS(this,void 0,void 0,(function*(){yield this.resetWithContext()}));const{runtimeMetaManager:t}=e;this.runtimeMetaManager=t}}LS.init=e=>kS(void 0,void 0,void 0,(function*(){const{databaseName:t="laplace-default-db"}=e,o=new PS(t),n=new tS,r=new Yy(Object.assign(Object.assign(Object.assign({},MS),e),{idbManager:o,logManager:n}));oS(r,Ty.beforeInit),yield n.syncFromIDB(r.idbManager);const i=new LS({runtimeMetaManager:r});return oS(r,Ty.afterInit),i}));class NS extends Ly{constructor(e){super(),this.config={verbose:!1},this.beforeLog=(e,t)=>{const{verbose:o}=this.config;switch(o&&console.log("beforeLog, ","state: ",t,"meta: ",e),t.logLevel){case wy.error:console.error(t.message);break;case wy.warn:console.warn(t.message);break;case wy.log:console.log(t.message);break;case wy.debug:console.debug(t.message);break;case wy.info:console.info(t.message)}},this.afterLog=(e,t)=>{const{verbose:o}=this.config;o&&console.log("afterLog, ","state: ",t,"meta: ",e)},this.beforeReport=(e,t)=>{const{verbose:o}=this.config;o&&console.log("beforeReport, ","pluginParams: ",t,"meta: ",e)},this.afterReport=(e,t)=>{const{verbose:o}=this.config;o&&console.log("afterReport, ","pluginParams: ",t,"runtimeMetaManager: ",e)},e&&(this.config=e)}}const VS=e=>{const t=[];for(const[o,n]of e)t.push(n);return t};class US extends Ly{constructor(e){super(),this.config={debug:!1},this.debugLog=e=>{const{debug:t}=this.config;t&&console.log(`[AutoCleanLogPlugin]: ${e}`)},this.afterInit=e=>{const{expireBefore:t}=this.config;if(!t)return void this.debugLog("early return on beforeInit because expireBefore is falsy");const{logManager:o,commonMethods:{commonDelete:n}}=e,r=o.getStore().byTime,i=("function"==typeof t?VS(r).filter(t):VS(r).filter((e=>e.timestampe.id));n(e,void 0,i),this.debugLog(`afterInit, clean log id: ${i}`)},this.afterReport=(e,{report:t,error:o})=>{if(o)return this.debugLog("error"),void console.error(o);const{cleanAfterReport:n}=this.config;if(!n)return void this.debugLog("early return on afterReport because cleanAfterReport is falsy");const{commonMethods:{commonDelete:r}}=e;r(e,void 0,t.ids),this.debugLog(`afterReport, clean log id: ${t.ids}`)},e&&(this.config=e)}}var jS="Expected a function",xS=NaN,BS="[object Symbol]",FS=/^\s+|\s+$/g,HS=/^[-+]0x[0-9a-f]+$/i,$S=/^0b[01]+$/i,WS=/^0o[0-7]+$/i,GS=parseInt,zS="object"==typeof qt&&qt&&qt.Object===Object&&qt,KS="object"==typeof self&&self&&self.Object===Object&&self,qS=zS||KS||Function("return this")(),JS=Object.prototype.toString,QS=Math.max,ZS=Math.min,YS=function(){return qS.Date.now()};function XS(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eb(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&JS.call(e)==BS}(e))return xS;if(XS(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=XS(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(FS,"");var o=$S.test(e);return o||WS.test(e)?GS(e.slice(2),o?2:8):HS.test(e)?xS:+e}var tb=function(e,t,o){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError(jS);return XS(o)&&(n="leading"in o?!!o.leading:n,r="trailing"in o?!!o.trailing:r),function(e,t,o){var n,r,i,s,a,d,u=0,l=!1,c=!1,p=!0;if("function"!=typeof e)throw new TypeError(jS);function h(t){var o=n,i=r;return n=r=void 0,u=t,s=e.apply(i,o)}function m(e){var o=e-d;return void 0===d||o>=t||o<0||c&&e-u>=i}function v(){var e=YS();if(m(e))return g(e);a=setTimeout(v,function(e){var o=t-(e-d);return c?ZS(o,i-(e-u)):o}(e))}function g(e){return a=void 0,p&&n?h(e):(n=r=void 0,s)}function f(){var e=YS(),o=m(e);if(n=arguments,r=this,d=e,o){if(void 0===a)return function(e){return u=e,a=setTimeout(v,t),l?h(e):s}(d);if(c)return a=setTimeout(v,t),h(d)}return void 0===a&&(a=setTimeout(v,t)),s}return t=eb(t)||0,XS(o)&&(l=!!o.leading,i=(c="maxWait"in o)?QS(eb(o.maxWait)||0,t):i,p="trailing"in o?!!o.trailing:p),f.cancel=function(){void 0!==a&&clearTimeout(a),u=0,n=d=r=a=void 0},f.flush=function(){return void 0===a?s:g(YS())},f}(e,t,{leading:n,maxWait:t,trailing:r})};const ob=["RESOURCE_ERROR","JS_ERROR","UNHANDLED_PROMISE_REJECTION"];class nb extends Ly{constructor(e){super(),this.config={debug:!1,publicTags:[]},this.errorCount=0,this.hashErrors={},this.runtimeMetaManager=null,this.addPublicTags=e=>{var t;return null===(t=this.config.publicTags)||void 0===t?void 0:t.concat(e).filter((e=>e))},this.debugLog=e=>{const{debug:t}=this.config;t&&console.log("[AutoLogErrorPlugin]:",e)},this.ignore=e=>{var t,o,n,r,i;return void 0!==(null===(t=this.config)||void 0===t?void 0:t.maxErrorCount)&&this.errorCount>=(null===(o=this.config)||void 0===o?void 0:o.maxErrorCount)||!!(null===(n=this.config)||void 0===n?void 0:n.ignoredErrorMsgKeywords)&&e&&(null===(i=null===(r=this.config)||void 0===r?void 0:r.ignoredErrorMsgKeywords)||void 0===i?void 0:i.some((t=>null==e?void 0:e.includes(t))))},this.report=tb((()=>{if(null===this.runtimeMetaManager)return;const{autoReport:e}=this.config,{commonMethods:{commonReport:t}}=this.runtimeMetaManager;return t(this.runtimeMetaManager,ob,e)}),600,{trailing:!0,leading:!1}),this.afterInit=e=>{if(this.runtimeMetaManager=e,!self.addEventListener)return;const{commonMethods:{commonLog:t}}=e,o=(o,n,r)=>{this.debugLog(r),this.errorCount+=1;try{return function(e){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-1",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}(o).then((r=>this.hashErrors[r]?"dismissed":(this.hashErrors[r]=!0,t(e,o,this.addPublicTags([].concat(n)),wy.error,Ry.PLAIN,{extraProperties:{messageHash:r}}).then(this.report)))).catch(console.error)}catch(e){return console.error(e),Promise.resolve(e)}};try{self.addEventListener("error",(e=>{var t,n,r,i,s,a,d;if(!this.ignore(null==e?void 0:e.message)){if((null==e?void 0:e.target)&&((null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.src)||(null===(n=null==e?void 0:e.target)||void 0===n?void 0:n.href))){const t=`Load Resource Error in ${null===(r=null==e?void 0:e.target)||void 0===r?void 0:r.tagName} element: ${(null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.src)||(null===(s=null==e?void 0:e.target)||void 0===s?void 0:s.href)}`;return o(t,"RESOURCE_ERROR",e)}{const t=`Javascript Runtime Error in ${null==e?void 0:e.filename} (${null==e?void 0:e.lineno}:${null==e?void 0:e.colno}): ${null==e?void 0:e.message}\nStack: ${null!==(d=null===(a=null==e?void 0:e.error)||void 0===a?void 0:a.stack)&&void 0!==d?d:null==e?void 0:e.stack}`;return o(t,"JS_ERROR",e)}}})),self.addEventListener("unhandledrejection",(e=>{var t;if(this.ignore(null===(t=null==e?void 0:e.reason)||void 0===t?void 0:t.message))return;let n;const r=null==e?void 0:e.reason;return n="string"==typeof r?`Promise Error: ${r}`:r instanceof Error?`Promise Error: ${r.message} ${r.name} ${r.stack}`:"object"==typeof r?`Promise Error with reason: ${Jy(r)}`:`Promise Error with unrecognized reason: ${r}`,o(n,"UNHANDLED_PROMISE_REJECTION",e)}))}catch(e){console.error(e)}this.debugLog("afterInit, add listener")},e&&(this.config=e),this.config.publicTags=[].concat(null==e?void 0:e.publicTags)}}let rb=function(e){return e.DeviceAudioStreamCaptured="device audio stream captured",e.AudioJoinComplete="audio join complete",e.AudioLeaveComplete="audio leave complete",e.SharingAudioStartComplete="sharing audio start complete",e.SharingAudioStopComplete="sharing audio stop complete",e.AudioBridgeReconnectStart="audio bridge reconnect start",e.AudioBridgeReconnectEnd="audio bridge reconnect end",e}({}),ib=function(e){return e.VBSettingSuccess="video VB setting success",e.VBSettingFailed="init video VB failed",e.VBPreloadSuccess="preload video VB success",e.VBPreloading3S="preload video VB 3s",e.VBPreloading10S="preload video VB 10s",e.StartCaptureVideoSuccess="start capture video success",e.StopCaptureVideoSuccess="stop capture video success",e}({});function sb(e){return`{E}${e}{/E}`}const ab={enable:!1,enableReport:!1,gatewayEndPoint:"",newGatewayEndPoint:"",logLevel:{debug:!1,log:!1,info:!1,print:!1,warn:!1,error:!1},performanceReportRatio:.25,trackingCount:7},db=["debug","log","info","print","warn","error"],ub=(e,t)=>[...e,...t].filter((e=>!!e));class lb{static getInstance(){return this.agentInstance||(this.agentInstance=new lb),this.agentInstance}constructor(){var e=this;this.laplace=void 0,this.trackingId=void 0,this.logConfig=void 0,this.reportUrl=void 0,this.publicTags=void 0,this.accountId=void 0,this.disableAutoReport=void 0,this.initConfig=async e=>{let t,o=ab;try{e.logConfig&&(o=JSON.parse(e.logConfig),o.gatewayEndPoint&&(this.reportUrl=o.gatewayEndPoint),o.newGatewayEndPoint&&(this.reportUrl=o.newGatewayEndPoint));const{enable:n,enableReport:r,reportUrl:i,logLevel:s,encryptKeys:a,trackingId:d,accountId:u}=e;if(void 0!==n&&(o={...o,enable:!!n}),void 0!==r&&(o={...o,enableReport:!!r}),i&&(this.reportUrl=i),"string"==typeof s){const e=db.indexOf(s),t=db.reduce(((t,o,n)=>nfunction(e){return window.crypto.subtle.importKey("raw",(new TextEncoder).encode(e.slice(0,32)),"AES-GCM",!1,["encrypt","decrypt"])}(e).then((e=>({usage:Oy.PROTECT_LOCAL_KEY,key:e}))))))}void 0!==u&&(this.accountId=u)}catch(e){console.error("parse log config error",e)}const n=(new Date).getTime()-6048e5,r=o.enableReport&&this.reportUrl?{gzip:!1,encrypt:!1,additionalContext:{trackingId:this.trackingId}}:void 0;this.publicTags=["VideoSDK",this.trackingId];const i=[e.debugMode&&new NS({verbose:!1}),new US({debug:!1,cleanAfterReport:!0,expireBefore:n}),new nb({debug:!1,autoReport:r,ignoredErrorMsgKeywords:["table index is out of bounds"],maxErrorCount:223,publicTags:this.accountId?[...this.publicTags,sb(this.accountId)]:this.publicTags})].filter(Boolean);return{laplaceConfig:{databaseName:"ZM-VSDK-LOG-DATABASE",maxSize:49283072,publicKey:e.logEncryptionPubKey,reportUrl:this.reportUrl,externalKeys:t,plugins:i},logConfig:o}},this.handleInitLaplaceSuccess=(e,t)=>{var o;this.laplace=e;const n=Vi.get(ji.VSDKLogTrackingId);let r=[];try{r=JSON.parse(n?window.atob(n):"[]")}catch(e){}r.length>=(null!==(o=null==t?void 0:t.trackingCount)&&void 0!==o?o:7)&&r.shift();const i=r.reduce(((e,t)=>({...e,[`${t}`]:!0})),{});e.deleteLog((e=>{var t;return!(null!==(t=e.tags)&&void 0!==t&&t.some((e=>i[e])))})),r.push(this.trackingId),Vi.set(ji.VSDKLogTrackingId,window.btoa(JSON.stringify(r)),Li.LocalStorage)},this.init=async e=>{const{laplaceConfig:t,logConfig:o}=await this.initConfig(e);return o.enable?(this.logConfig=o,LS.init(t).then((e=>{this.handleInitLaplaceSuccess(e,o)})).catch((e=>{throw{type:_l,reason:"Logger init failed.",error:e}}))):Promise.reject({type:Cl,reason:"Logger feature is not enabled."})},this.check=e=>{var t,o;return!(!this.checkLaplace()||(null===(t=this.logConfig)||void 0===t||null===(o=t.logLevel)||void 0===o||!o[e])&&(console.warn(`Logger ${e} is not enabled.`),1))},this.log=(e,t,o)=>{if(this.check("log"))try{var n;return null===(n=this.laplace.logWithEncryption(e,ub(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.logWithExtraProperties=(e,t,o)=>{if(this.check("log"))try{var n;return null===(n=this.laplace.log(e,t,o))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.warn=(e,t,o)=>{if(this.check("warn"))try{var n;return null===(n=this.laplace.warnWithEncryption(e,ub(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.info=(e,t,o)=>{if(this.check("info"))try{var n;return null===(n=this.laplace.infoWithEncryption(e,ub(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.debug=(e,t,o)=>{if(this.check("debug"))try{var n;return null===(n=this.laplace.debugWithEncryption(e,ub(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.error=(e,t,o)=>{if(this.check("error"))try{var n;return null===(n=this.laplace.errorWithEncryption(e,ub(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.checkLaplace=()=>{var e;return!(null===(e=this.laplace)||void 0===e||!e.log)},this.makeLogger=e=>{var t;const o=ub(null!==(t=this.publicTags)&&void 0!==t?t:[],e);return{log:(e,t)=>this.log(e,o,null!=t?t:[]),logWithExtraProperties:(e,t)=>this.logWithExtraProperties(e,o,t),warn:(e,t)=>this.warn(e,o,null!=t?t:[]),info:(e,t)=>this.info(e,o,null!=t?t:[]),debug:(e,t)=>this.debug(e,o,null!=t?t:[]),error:(e,t)=>this.error(e,o,null!=t?t:[])}},this.reportToGlobalTracing=function(t){var o;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.checkLaplace()?null!==(o=e.logConfig)&&void 0!==o&&o.enableReport&&e.reportUrl?function(){try{return!!Vi.get(xi.DisableAutoReportLogs)}catch(e){return!1}}()&&!n?Promise.resolve():e.laplace.reportByHttps(t,{gzip:!1,encrypt:!1,xhrOptions:{url:e.reportUrl},additionalContext:{trackingId:e.trackingId}}):Promise.reject({type:Cl,reason:"Please use getLogs to obtain log data and report by yourself."}):Promise.reject({type:Cl,reason:"Logger has not been enabled or initialized."})},this.report=function(t,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn";if(e.checkLaplace()&&e.logConfig.enableReport&&e.reportUrl){var r,i,s;const a=Array.isArray(o)?o:[o],d=e.accountId?[...a,sb(e.accountId)]:a;null===(r=(i=e.makeLogger(d))[`${n}`])||void 0===r||null===(s=r.call(i,t))||void 0===s||s.then((()=>{e.reportToGlobalTracing(a)}))}},this.getLogs=(e,t)=>{if(!this.checkLaplace())return console.warn("Logger has not been enabled or initialized."),[];const o=e.getState(),{meeting:{meetingNumber:n,userId:r,userEmail:i,userName:s}}=o,a={meetingNumber:n,userId:r,userEmail:i,userName:s},d=this.laplace.getLogs(t),u=[];for(const[,e]of d)u.push({...e,...a});return u},this.doNotUseDirtyGetStore=()=>this.checkLaplace()?this.laplace.doNotUseDirtyGetStore():(console.warn("Logger has not been enabled or initialized."),{byTag:{},byTime:new Map}),this.trackingId=My()}}lb.agentInstance=void 0;const cb=lb.getInstance(),pb=[{type:"MediaMeta",methods:["sendUserNodeList","updateUserMediaSN","updateMediaParams","subscribeToQos","unsubscribeFromQos","sendUserAudioStatus","destroy","createMainSessionChannel","notifySDKMeetingReady"]},{type:"Audio",methods:["joinComputerAudio","leaveComputerAudio","joinSharingAudio","leaveSharingAudio","changeSpeaker","changeMicrophone","enableAudioEncode","pauseOrResumeAudio","setSharingAudioVolume","enableShareAudioToBreakoutRoom","enableAudioDenoise","enableSyncButtonsOnHeadset","stopAllIncomingAudio","preInitAudioBridge","setAudioCodecMode","muteOrUnmuteOtherAudio","adjustOtherAudioVolume","changeAudioProfile","unmuteAudio","muteAudio"]},{type:"Video",methods:["startCaptureVideo","stopCaptureVideo","renderVideo","stopRenderVideo","changeCamera","updateRenderedVideoCanvasDimension","adjustRenderedVideoPosition","mirrorVideo","enableHardwareAccelerationForVideoDecode","enableHardwareAccelerationForVideoEncode","startVirtualBackgroundSetting","updateVirtualBackgroundImage","stopVirtualBackgroundSetting","startMaskSetting","updateMaskBackgroundImage","updateMaskClip","stopMaskSetting","enableVideoObserver","prefetchVideoSsrc","cancelPrefetchVideoSsrc","setMobileRotateMode","changeActiveVideoSsrc","updateVideoHDValue","updateVideoFullhdValue","clearVideoCanvas"]},{type:"Sharing",methods:["stopDesktopSharing","startDesktopSharing","pauseDesktopSharing","resumeDesktopSharing","renderSharing","stopRenderSharing","switchSharingSource","ajustmentReceivedSharingCanvas","changeSharingSecondCamera","updateRenderedSharingDimension","addReceivedSharingChannelType","removeReceivedSharingChannelType","switchSharingMode","ajustmentSharingCanvas"]},{type:"RemoteControl",methods:["startRemoteControl","stopRemoteControl","resendRemoteControlPositionPDU","updateRemoteControlProperties","ajustmentReceivedSharingCanvas","startRemoteControlQRCheck"]},{type:"LiveTranscription",methods:["selectLanguageChannelForNewLTT"]},{type:"RemoteCamera",methods:["movePTZCamera"]}].reduce(((e,t)=>{const{type:o,methods:n}=t;return[...e,...n.map((e=>({name:e,type:o})))]}),[]),hb=pb.map((e=>e.name)),mb=function(e){const t=pb.find((t=>t.name===e));if(t){const{type:i}=t;for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;rRr(e)));cb.makeLogger([i,`${i} Media SDK`]).info(`${e},params:${JSON.stringify(s)}`)}};function vb(e){return new Proxy(e,{get:(e,t)=>"string"==typeof t&&hb.includes(t)?function(){for(var o=arguments.length,n=new Array(o),r=0;r!!e)))));const a=Sy(o);a&&(i?(r.resendRemoteControlPositionPDU(),r.updateRemoteControlProperties({os:a.os,isControllerNow:!0,dimension:t&&Bf(t)})):t&&r.startRemoteControl(t,a.os,Bf(t)))}function Rb(){gb.log("qr scanning stop"),fb.startRemoteControlQRCheck(!1)}const wb=Ns.createAgent(),Ob=vb(Hs.getInstance()),Tb=Ns.createAgent(),Db=vb(Hs.getInstance());function Pb(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:jb(e)?2:xb(e)?3:0}function Vb(e,t){return 2===Nb(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ub(e,t,o){var n=Nb(e);2===n?e.set(t,o):3===n?(e.delete(t),e.add(o)):e[t]=o}function jb(e){return cE&&e instanceof Map}function xb(e){return pE&&e instanceof Set}function Bb(e){return e.o||e.t}function Fb(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=SE(e);delete t[gE];for(var o=yE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=$b),Object.freeze(e),t&&Lb(e,(function(e,t){return Hb(t,!0)}),!0)),e}function $b(){Pb(2)}function Wb(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Gb(e){var t=bE[e];return t||Pb(18,e),t}function zb(){return uE}function Kb(e,t){t&&(Gb("Patches"),e.u=[],e.s=[],e.v=t)}function qb(e){Jb(e),e.p.forEach(Zb),e.p=null}function Jb(e){e===uE&&(uE=e.l)}function Qb(e){return uE={p:[],l:uE,h:e,m:!0,_:0}}function Zb(e){var t=e[gE];0===t.i||1===t.i?t.j():t.O=!0}function Yb(e,t){t._=t.p.length;var o=t.p[0],n=void 0!==e&&e!==o;return t.h.g||Gb("ES5").S(t,e,n),n?(o[gE].P&&(qb(t),Pb(4)),Mb(e)&&(e=Xb(t,e),t.l||tE(t,e)),t.u&&Gb("Patches").M(o[gE].t,e,t.u,t.s)):e=Xb(t,o,[]),qb(t),t.u&&t.v(t.u,t.s),e!==mE?e:void 0}function Xb(e,t,o){if(Wb(t))return t;var n=t[gE];if(!n)return Lb(t,(function(r,i){return eE(e,n,t,r,i,o)}),!0),t;if(n.A!==e)return t;if(!n.P)return tE(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=Fb(n.k):n.o;Lb(3===n.i?new Set(r):r,(function(t,i){return eE(e,n,r,t,i,o)})),tE(e,r,!1),o&&e.u&&Gb("Patches").R(n,o,e.u,e.s)}return n.o}function eE(e,t,o,n,r,i){if(kb(r)){var s=Xb(e,r,i&&t&&3!==t.i&&!Vb(t.D,n)?i.concat(n):void 0);if(Ub(o,n,s),!kb(s))return;e.m=!1}if(Mb(r)&&!Wb(r)){if(!e.h.F&&e._<1)return;Xb(e,r),t&&t.A.l||tE(e,r)}}function tE(e,t,o){void 0===o&&(o=!1),e.h.F&&e.m&&Hb(t,o)}function oE(e,t){var o=e[gE];return(o?Bb(o):e)[t]}function nE(e,t){if(t in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function rE(e){e.P||(e.P=!0,e.l&&rE(e.l))}function iE(e){e.o||(e.o=Fb(e.t))}function sE(e,t,o){var n=jb(t)?Gb("MapSet").N(t,o):xb(t)?Gb("MapSet").T(t,o):e.g?function(e,t){var o=Array.isArray(e),n={i:o?1:0,A:t?t.A:zb(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=n,i=EE;o&&(r=[n],i=IE);var s=Proxy.revocable(r,i),a=s.revoke,d=s.proxy;return n.k=d,n.j=a,d}(t,o):Gb("ES5").J(t,o);return(o?o.A:zb()).p.push(n),n}function aE(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Fb(e)}var dE,uE,lE="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),cE="undefined"!=typeof Map,pE="undefined"!=typeof Set,hE="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,mE=lE?Symbol.for("immer-nothing"):((dE={})["immer-nothing"]=!0,dE),vE=lE?Symbol.for("immer-draftable"):"__$immer_draftable",gE=lE?Symbol.for("immer-state"):"__$immer_state",fE=""+Object.prototype.constructor,yE="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,SE=Object.getOwnPropertyDescriptors||function(e){var t={};return yE(e).forEach((function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)})),t},bE={},EE={get:function(e,t){if(t===gE)return e;var o=Bb(e);if(!Vb(o,t))return function(e,t,o){var n,r=nE(t,o);return r?"value"in r?r.value:null===(n=r.get)||void 0===n?void 0:n.call(e.k):void 0}(e,o,t);var n=o[t];return e.I||!Mb(n)?n:n===oE(e.t,t)?(iE(e),e.o[t]=sE(e.A.h,n,e)):n},has:function(e,t){return t in Bb(e)},ownKeys:function(e){return Reflect.ownKeys(Bb(e))},set:function(e,t,o){var n=nE(Bb(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,o),!0;if(!e.P){var r=oE(Bb(e),t),i=null==r?void 0:r[gE];if(i&&i.t===o)return e.o[t]=o,e.D[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(o,r)&&(void 0!==o||Vb(e.t,t)))return!0;iE(e),rE(e)}return e.o[t]===o&&"number"!=typeof o&&(void 0!==o||t in e.o)||(e.o[t]=o,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==oE(e.t,t)||t in e.t?(e.D[t]=!1,iE(e),rE(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=Bb(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:o[t]}:n},defineProperty:function(){Pb(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Pb(12)}},IE={};Lb(EE,(function(e,t){IE[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),IE.deleteProperty=function(e,t){return IE.set.call(this,e,t,void 0)},IE.set=function(e,t,o){return EE.set.call(this,e[0],t,o,e[0])};var AE=function(){function e(e){var t=this;this.g=hE,this.F=!0,this.produce=function(e,o,n){if("function"==typeof e&&"function"!=typeof o){var r=o;o=e;var i=t;return function(e){var t=this;void 0===e&&(e=r);for(var n=arguments.length,s=Array(n>1?n-1:0),a=1;a1?n-1:0),i=1;i=0;o--){var n=t[o];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}o>-1&&(t=t.slice(o+1));var r=Gb("Patches").$;return kb(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),CE=new AE,_E=CE.produce;CE.produceWithPatches.bind(CE),CE.setAutoFreeze.bind(CE),CE.setUseProxies.bind(CE),CE.applyPatches.bind(CE),CE.createDraft.bind(CE),CE.finishDraft.bind(CE);const RE={ssrc:0,status:qa.End,shareDimension:{width:0,height:0},receivedShareDimension:{width:1920,height:1080,logicWidth:1920,logicHeight:1080},sharePrivilege:Ka.OnlyHost,activeNodeId:0,activeSsrc:0,shareQuality:1,isRemoteSharingActive:!1,isReceiveSharing:!1,isGrabRemoteControl:!1,isSDKGrabControl:!1,isChromeExtensionInstalled:!1,isScreenShareForbidden:!1,isReceiveSharingFromMainSession:!1,isSharingToBreakoutRoom:!1,isSharingWithSecondCamera:!1,secondCameraId:"default",isRequireReadReceipt:!1,capturedEnsuredCanvas:[],renderedEnsuredCanvas:[],remoteControllingSsrc:0,remoteControlApprovedSsrc:0,remoteControlAppDownloadUrl:"",remoteControlAppInstallStatus:_d.Unknown,isEnableAutoDeleteRcApp:!1,remoteControlledUserList:[],isRemoteControlEnabled:!1,isFullHDVideoShareEnabled:!1,userSsrcMapping:{},statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0}}},wE=ko({[`${Oh}`]:_E(((e,t)=>{let{payload:o}=t;e.sharePrivilege=o})),[`${Th}`]:_E(((e,t)=>{let{payload:o}=t;e.isRemoteSharingActive=1===o.bStatus,e.activeNodeId=o.activeNodeID,e.activeSsrc=o.ssrc})),[`${Dh}`]:_E(((e,t)=>{let{payload:o}=t;e.isReceiveSharing=o})),[`${Ph}`]:_E(((e,t)=>{let{payload:o}=t;e.isChromeExtensionInstalled=o})),[`${Mh}`]:_E(((e,t)=>{let{payload:o}=t;e.shareDimension={...o}})),[`${Lh}`]:_E(((e,t)=>{let{payload:o}=t;e.status=o})),[`${Nh}`]:_E(((e,t)=>{let{payload:o}=t;e.ssrc=o})),[`${Vh}`]:_E(((e,t)=>{let{payload:o}=t;e.shareQuality=o})),[`${Uh}`]:_E(((e,t)=>{let{payload:o}=t;e.receivedShareDimension={...o}})),[`${sm}`]:_E(((e,t)=>{let{payload:o}=t;e.remoteControlledUserList.includes(o)||e.remoteControlledUserList.push(o)})),[`${am}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.remoteControlledUserList.indexOf(o);n>=0&&e.remoteControlledUserList.splice(n,1)})),[`${jh}`]:_E(((e,t)=>{let{payload:o}=t;e.isGrabRemoteControl=o,!1===o&&(e.remoteControlViewportDomSelector=void 0)})),[`${xh}`]:_E(((e,t)=>{let{payload:o}=t;e.isSDKGrabControl=o})),[`${Bh}`]:_E(((e,t)=>{let{payload:o}=t;e.isReceiveSharingFromMainSession=o})),[`${Fh}`]:_E(((e,t)=>{let{payload:o}=t;e.isSharingToBreakoutRoom=o})),[`${Hh}`]:_E(((e,t)=>{let{payload:o}=t;e.isSharingWithSecondCamera=o})),[`${$h}`]:_E(((e,t)=>{let{payload:o}=t;e.secondCameraId=o})),[`${Wh}`]:_E(((e,t)=>{let{payload:o}=t;e.isRequireReadReceipt=o})),[`${Gh}`]:_E(((e,t)=>{let{payload:o}=t;e.isOptimizedForSharedVideo=o})),[`${zh}`]:_E(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${Kh}`]:_E(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${qh}`]:_E(((e,t)=>{let{payload:o}=t;e.capturedEnsuredCanvas.includes(o)||e.capturedEnsuredCanvas.push(o)})),[`${Jh}`]:_E(((e,t)=>{let{payload:o}=t;e.renderedEnsuredCanvas.includes(o)||e.renderedEnsuredCanvas.push(o)})),[`${Zh}`]:_E(((e,t)=>{let{payload:o}=t;e.remoteControllingSsrc=o})),[`${Yh}`]:_E(((e,t)=>{let{payload:o}=t;e.remoteControlApprovedSsrc=o})),[`${Xh}`]:_E(((e,t)=>{let{payload:o}=t;e.remoteControlAppDownloadUrl=o})),[`${em}`]:_E(((e,t)=>{let{payload:o}=t;(e.remoteControlAppInstallStatus!==_d.Installed||_d.Unknown)&&(e.remoteControlAppInstallStatus=o)})),[`${rm}`]:_E(((e,t)=>{let{payload:o}=t;e.remoteControlAppLaunchSheme=o})),[`${im}`]:_E(((e,t)=>{let{payload:o}=t;const{userId:n,ssrc:r}=o;Object.assign(e.userSsrcMapping,{[`${n}`]:r})})),[`${dm}`]:_E(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${um}`]:_E(((e,t)=>{let{payload:o}=t;e.remoteControlViewportDomSelector=o})),[`${lm}`]:_E(((e,t)=>{let{payload:o}=t;e.isFullHDVideoShareEnabled=o})),[`${cm}`]:()=>({...RE})},RE),OE={remoteControlEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{const{payload:{meetingOptions:t,rcAutoDelete:o,jwtRc:n,opRc:r}}=e,i=(null==t?void 0:t.isRemoteControlEnbaled)&&r&&1===n;return dm({isRemoteControlEnabled:i,isEnableAutoDeleteRcApp:1===o})}))),remoteControlEpics1:(e,t)=>yn(e,16391).pipe(Xe((e=>{const{payload:{body:{bOn:o,sendID:n,receiveID:r}}}=e,{meeting:{userId:i},share:{status:s,activeNodeId:a,isGrabRemoteControl:d}}=t.value,u=[];if(s===qa.End&&u.push(Zh(0)),s!==qa.End)if(fr(i,n))if(o){Ib(),Ab(),s===qa.Paused&&(Tb.resumeSharing(),Db.resumeDesktopSharing(),u.push(Lh(qa.Sharing))),u.push(Zh(r));const e=wp(t.value).find((e=>fr(e.userId,r)));e&&u.push(im({userId:e.userId,ssrc:r}))}else u.push(Zh(0));else{var l;const e=null===(l=wp(t.value))||void 0===l?void 0:l.find((e=>fr(e.userId,n)));e&&(u.push(im({userId:e.userId,ssrc:n})),Dc(vl,{userId:e.userId,displayName:e.displayName,isSharingEntireScreen:Db.isSharingEntireScreen()}))}else if(!r||fr(r,i)){const e=Ip(t.value);if(!ap(e.userRole)&&!zi.isAndroidOrIOSBrowser){const e=n&&fr(a,n);o?(u.push(sm(a)),e&&(d||Tb.subscribeGrabRemoteControl(a,!0))):(u.push(am(a)),e&&(d&&(Tb.subscribeGrabRemoteControl(a,!1),u.push(jh(!1)),Dc(dl,!1)),Db.updateRemoteControlProperties({isControllerNow:!1}))),Dc(al,o)}}return Ue(u)}))),remoteControlEpics2:(e,t)=>yn(e,16395).pipe(Tt(t),mt((e=>{let[t,o]=e;return t.payload.body.id===o.meeting.userId})),ze((e=>{let[t]=e;const{payload:{body:{bOn:o}}}=t;return Db.updateRemoteControlProperties({isControllerNow:o}),Dc(dl,o),jh(o)}))),remoteControlEpics3:e=>In(e,[Va.StartRemoteControlSuccess,Va.StartRemoteControlFailed,Va.CancelRemoteControlSuccess]).pipe(sy((e=>e.payload.type===Va.StartRemoteControlSuccess?(Dc(ll),xh(!0)):e.payload.type===Va.CancelRemoteControlSuccess?xh(!1):void(e.payload.type===Va.StartRemoteControlFailed&&Dc(cl))))),remoteControlEpics4:e=>In(e,[Va.RemoteControlCopiedTextNotify,Va.RemoteControlPasteTextLengthOverflow]).pipe(Ot((e=>{if(e.payload.type===Va.RemoteControlCopiedTextNotify){const{payload:{data:t}}=e;Dc(ul,{content:t.data,x:t.x,y:t.y})}else Dc(ul,{error:"length of pasted text is too long"})})),Et(fe)),remoteControlEpics5:(e,t)=>yn(e,4342).pipe(mt((e=>0===e.payload.body.result)),Xe((e=>{const{payload:{body:{downloadUrl:o,ssrc:n,urlScheme:r}}}=e,{share:{remoteControlApprovedSsrc:i,status:s}}=t.value,a=[],{isMacOS:d}=zi;if(s!==qa.End){if(!i||i===n){Ib();try{const e=JSON.parse(o||"{}"),t=d?e.macDownloadUrl:e.winDownloadUrl;a.push(Xh(t))}catch(e){console.warn("unsupported JSON string",e)}}const s={},u=wp(t.value).find((e=>fr(e.userId,n)));u&&Object.assign(s,{controllerName:dr(u.displayName)}),Object.assign(s,{ssrc:n});const{deviceId:l}=Db.getShareStreamInfo();l&&Object.assign(s,{DeviceID:l});const c=`${r}&${new URLSearchParams(s).toString()}`;a.push(rm(c),em(_d.Unknown)),Dc(yl,c)}return Ue(a)}))),remoteControlEpics6:e=>e.pipe($t(`${tm}`),Xe((()=>bb.startCheck(1e4).pipe(ze((()=>(Dc(gl,_d.Unknown),em(_d.Unknown)))))))),remoteControlEpics7:(e,t)=>e.pipe($t(`${om}`),mt((()=>{const{share:{remoteControlAppInstallStatus:e}}=t.value;return e===_d.Installed})),Xe((()=>Eb.startCheck(12e4).pipe(Xe((()=>{Dc(gl,Rd.Unlaunched);const{share:{remoteControlApprovedSsrc:e,isEnableAutoDeleteRcApp:o},meeting:{userId:n}}=t.value,r=[],{isMacOS:i}=zi;return e&&(Tb.remoteControlConsent(Cd.CacheClean,e,n,{...Db.getShareStreamInfo(),platform:i?"mac":"win"},o),r.push(rm(""),Yh(0))),Ue(r)})))))),remoteControlEpics8:(e,t)=>e.pipe($t(`${rm}`),mt((e=>!!e.payload)),Xe((e=>{const{payload:o}=e,n=[];let r;if(o){!function(e){if(!e.startsWith("zoomprc://"))return;const t=Sr("__ZOOM_SDK_RC_APP_SCHEME_@__");let o=document.getElementById(t);o||(o=document.createElement("iframe"),o.id=t,o.style.display="none",document.body.appendChild(o)),o.contentWindow.location.href=e}(o),n.push(om());const e=performance.now();document.hasFocus()?r=lt(25).pipe(wt((()=>{const o=performance.now()-e<500;return o||Dc(gl,_d.Uninstalled),o&&t.value.share.remoteControlAppInstallStatus===_d.Unknown})),_t((()=>{const t=performance.now()-e,o=[];return document.hasFocus()||(t>75?o.push(tm()):Ib(),Dc(gl,_d.Installed),o.push(em(_d.Installed),om())),Ue(o)})),function(){for(var e=[],t=0;tyn(e,vs).pipe(Xe((()=>(Dc(fl,wd.Ended),Cb(t.value,Tb),Ue([rm(""),Yh(0)]))))),remoteControlEpics10:(e,t)=>e.pipe($t(`${Lh}`),mt((e=>{const{share:{remoteControllingSsrc:o,remoteControlApprovedSsrc:n}}=t.value;return!(e.payload!==qa.End||!o&&!n)})),Ot((()=>{const{share:{remoteControllingSsrc:e,remoteControlApprovedSsrc:o,isEnableAutoDeleteRcApp:n},meeting:{userId:r}}=t.value,{isMacOS:i}=zi;e&&Cb(t.value,Tb),o!==e&&Tb.remoteControlConsent(Cd.Decline,o,r,{...Db.getShareStreamInfo(),platform:i?"mac":"win"},n)})),Et(fe)),remoteControlEpics11:(e,t)=>yn(e,16430).pipe(Xe((()=>(Ib(),Ab(),Dc(gl,Rd.Launched),t.value.share.status!==qa.End&&function(e,t){(async function(e){const{media:{assetsPath:t}}=e,o=`${t}/qrscanner.min.js`;return"WebQrscanner"in window?Promise.resolve(""):new Promise(((e,t)=>{gb.log(`load qr scanner script start. url:${o}`),wf(o,(()=>{gb.log("load qr scanner script done."),e("")}),t)}))})(e).then((()=>{gb.log("qr scanning start"),t.startRemoteControlQRCheck(!0)}))}(t.value,Db),Ue([rm(""),Yh(0)]))))),remoteControlEpics12:e=>In(e,Va.CurrentDesktopSharingWidthHeight).pipe(Ot((()=>{Tb.syncSharedContentMetaWithRcApp(Db.getShareStreamInfo())})),Et(fe)),remoteControlEpics13:(e,t)=>In(e,Va.SendRemoteControlQrCode).pipe(Ot((e=>{const{payload:{data:o}}=e,{share:{status:n}}=t.value;n!==qa.End&&Array.isArray(o)&&o.length>0&&o.forEach((e=>{null!=e&&e.startsWith("zrc_")&&Tb.sendRemoteControlAuth(e)}))})),Et(fe)),remoteControlEpics14:e=>yn(e,16434).pipe(Ot((e=>{const{payload:{body:{result:t}}}=e;0===t&&(Rb(),Dc(fl,wd.Started))})),Et(fe)),remoteControlEpics15:(e,t)=>yn(e,ds).pipe(mt((e=>{var o,n;const{meeting:{userId:r},share:{remoteControlledUserList:i}}=t.value,{payload:{body:s}}=e;return i.length>0&&((null===(o=s.update)||void 0===o?void 0:o.some((e=>e.id!==r&&!1===e.bShareOn)))||(null===(n=s.remove)||void 0===n?void 0:n.some((e=>e.id!==r))))})),Xe((e=>{var o,n,r,i;const{payload:{body:s}}=e,{share:{remoteControlledUserList:a,activeNodeId:d,isGrabRemoteControl:u},meeting:{userId:l}}=t.value,c=(null!==(o=null===(n=s.update)||void 0===n?void 0:n.filter((e=>e.id!==l&&!1===e.bShareOn)))&&void 0!==o?o:[]).concat(null!==(r=null===(i=s.remove)||void 0===i?void 0:i.filter((e=>e.id!==l)))&&void 0!==r?r:[]),p=[];return a.forEach((e=>{c.find((t=>t.id===e))&&(p.push(am(e)),e===d&&u&&(p.push(jh(!1)),Dc(dl,!1)))})),Ue(p)}))),remoteControlEpics16:(e,t)=>e.pipe($t(`${xr}`),Ot((()=>{const{share:{remoteControllingSsrc:e,status:o}}=t.value;o===qa.Sharing&&e&&Dc(fl,wd.Ended)})),Et(fe))},TE={epics0:(e,t)=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.lockShare)})),Tt(t),Ot((e=>{let[t,o]=e;const{share:{sharePrivilege:n}}=o,{payload:{body:{lockShare:r}}}=t;n!==r&&Dc(pl,r)})),ze((e=>{let[t]=e;return Oh(t.payload.body.lockShare)}))),epics1:e=>yn(e,20227).pipe(ze((e=>Nh(e.payload.body.ssrc)))),epics2:(e,t)=>yn(e,ss).pipe(Tt(t),mt((e=>{let[t,o]=e;const{payload:{body:n}}=t,{share:{isReceiveSharingFromMainSession:r}}=o;return!r||r&&n.fromMainSession})),ze((e=>{let[t,o]=e;const{share:{isReceiveSharing:n,activeNodeId:r,isReceiveSharingFromMainSession:i},breakoutRoom:s}=o,{payload:{body:a}}=t;if(n&&1===a.bStatus){let e=!1;(null==s?void 0:s.currentRoom.status)===cp.InRoom&&s.mainSessionAttendeeList.length>0&&(e=s.mainSessionAttendeeList.findIndex((e=>e.userId===r))>-1),wb.unsubscribeSharing(r,e),yb(wb,o,a.activeNodeID),Ob.switchSharingSource(a.ssrc,i),Dc(sl,{userId:a.activeNodeID})}else if(1===a.bStatus){const e={activeUserId:a.activeNodeID,isActive:!0};i&&Object.assign(e,{isFromMainSession:!0}),Dc(qu,e)}else if(n){const e={activeUserId:a.activeNodeID,isActive:!1};i&&Object.assign(e,{isFromMainSession:!0}),Dc(qu,e)}return Th(a)}))),epics3:e=>In(e,Va.CheckChromeSharingExtensionResponse).pipe(ze((e=>(Dc(Ju,e.payload.data),Ph(e.payload.data))))),epics4:(e,t)=>In(e,[Va.SharingDesktopStreamHaveAudio,Va.SharingDesktopStreamHaveNoAudio]).pipe(mt((e=>e.payload.type!==Va.SharingDesktopStreamHaveAudio||!t.value.audio.secondaryAudioMicrophoneId)),Tt(t),ze((e=>{let[t,o]=e;const{meeting:{userId:n},share:{isSharingToBreakoutRoom:r,isOptimizedForSharedVideo:i}}=o,{payload:{type:s}}=t,a=s===Va.SharingDesktopStreamHaveAudio;return wb.startSharing(n,{bShareToBO:r,bShareAudio:a,bShareVideo:!!i}),Ob.switchSharingMode(i?Ed.VideoMode:Ed.Normal),kh(!1)}))),epics5:e=>In(e,[Va.DesktopSharingError,Va.DesktopSharingChromeExtensionUninstalled,Va.DesktopSharingPermissionDenied,Va.DesktopSharingSystemError]).pipe(Xe((e=>{const t=[];let o="";return[Va.DesktopSharingPermissionDenied,Va.DesktopSharingSystemError].includes(e.payload.type)&&(t.push(kh(!0)),e.payload.type===Va.DesktopSharingSystemError?zi.isMacOS&&(o="To use screen share on Chrome, please allow screen recording access in system setting."):o="To use screen share, please allow the permission request."),Dc(Qu,{reason:o}),Ue(t)}))),epics6:e=>In(e,Va.CurrentDesktopSharingWidthHeight).pipe(mt((e=>!!e.payload.data)),ze((e=>{Dc(Zu,e.payload.data);const{payload:{data:{width:t,height:o}}}=e;return Ob.ajustmentSharingCanvas(t,o),Mh(e.payload.data)}))),epics7:(e,t)=>In(e,Va.SharingDecodeMaxSize).pipe(mt((e=>!!e.payload.data)),Tt(t),sy((e=>{let[t,o]=e;const{share:{shareQuality:n,activeNodeId:r}}=o,{payload:{data:{fps:i}}}=t,s=Number(i);if(n!==s)return yb(wb,o,r,s),Vh(s)}))),epics8:e=>yn(e,20226).pipe(Ot((e=>{var t,o;if(Dc(Yu,null===(t=e.payload)||void 0===t?void 0:t.body),null!==(o=e.payload)&&void 0!==o&&o.body){const{payload:{body:{width:t,height:o}}}=e;Ob.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>Uh(e.payload.body)))),epics9:e=>In(e,Va.SharingPara).pipe(Ot((e=>{var t,o;if(Dc(Yu,null===(t=e.payload.data)||void 0===t?void 0:t.body),null!==(o=e.payload.data)&&void 0!==o&&o.body){const{payload:{data:{body:{width:t,height:o}}}}=e;Ob.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>{var t;return Uh(null===(t=e.payload.data)||void 0===t?void 0:t.body)}))),epics10:(e,t)=>In(e,Va.UserStopDesktopSharing).pipe(Tt(t),ze((e=>{let[,t]=e;const{meeting:{userId:o},share:{status:n}}=t;return n!==qa.End&&(wb.stopSharing(o),Ob.stopDesktopSharing(),Dc(Xu)),Lh(qa.End)}))),epics11:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[t,o]=e;const{meeting:{userId:n}}=o,r=t.payload.body.update;return r&&r.length>0&&r.findIndex((e=>e.id===n&&void 0!==e.bShareOn))>-1})),Xe((e=>{let[t,o]=e;const{meeting:{userId:n},share:{status:r,isReceiveSharing:i,activeNodeId:s}}=o,{payload:{body:{update:a}}}=t,d=a.find((e=>e.id===n&&!1===e.bShareOn)),u=a.find((e=>e.id===n&&!0===e.bShareOn)),l=[];return d&&r!==qa.End&&(wb.stopSharing(n),Ob.stopDesktopSharing(),l.push(Lh(qa.End)),Dc(el)),u&&r===qa.End&&(i&&(Ob.stopRenderSharing(),wb.unsubscribeSharing(s),l.push(Dh(!1))),l.push(Lh(qa.Sharing))),Ue(l)}))),epics12:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[t,o]=e;const{meeting:{userId:n}}=o,r=t.payload.body.update;return r&&r.length>0&&r.findIndex((e=>e.id!==n&&void 0!==e.bShareOn))>-1})),Xe((o=>{let[n,r]=o;const{payload:{body:{update:i}}}=n,{share:{activeNodeId:s,isReceiveSharing:a}}=r,d=by(r),u=i.filter((e=>!0===e.bShareOn&&!1===e.bSharePause)),l=i.filter((e=>!0===e.bShareOn&&!0===e.bSharePause)),c=i.filter((e=>!1===e.bShareOn));return u.length>0&&u.forEach((e=>{-1===d.findIndex((t=>t.userId===e.id))?Dc(ol,e):Dc(il,e)})),l.length>0&&l.forEach((e=>{Dc(rl,e)})),c.length>0&&(c.forEach((e=>{Dc(nl,e)})),a&&c.some((e=>e.id===s)))?vt(yn(e,ss).pipe(ft(1),Et(fe)),ut(50).pipe(Et(xe("timeout")))).pipe(gt((()=>{const{share:{activeNodeId:e,isReceiveSharingFromMainSession:o},audio:n}=t.value,r=d.filter((t=>t.userId!==e));if(r.length>0){const i=r[0],{userId:s}=i;return wb.unsubscribeSharing(e,o),yb(wb,t.value,s),Ob.switchSharingSource(s,o),null==n||n.localShareAudioUserMutedList.forEach((e=>{Ob.setSharingAudioVolume(s,e.userId!==s||e.muted,e.isFromMainSession)})),Dc(sl,{userId:s}),je(Th({activeNodeID:s,bStatus:1,ssrc:s}))}return fe}))):fe}))),epics13:(e,t)=>yn(e,as).pipe(Tt(t),_t((e=>{let[o,n]=e;const{payload:{body:{encryptKey:r,additionalType:i}}}=o,{media:{sharingDecodeStatus:s,sharingEncodeStatus:a},meeting:{confId:d,userId:u,zoomId:l,meetingId:c,meetingNumber:p,isWebinar:h}}=n;return Uf(t).pipe(_t((e=>{let o=a;return(!zi.isSupportSendScreenSharing||h&&e&&ap(e.userRole))&&(o="failed"),Vf("sharing",o,s).pipe(Ot((e=>{let[o,n]=e;const s={userId:u,sn:pr(l),confId:d,encryptKey:pr(r),encryptType:i,meetingId:c,meetingNumber:p};if(o&&(null==Ob||Ob.updateMediaParams({iVType:Xi.SHARING_ENCODE,isFromMainSession:!1,updateParams:s})),n){Ob.updateMediaParams({iVType:Xi.SHARING_DECODE,isFromMainSession:!1,updateParams:s});const{participants:{attendeesList:e}}=t.value;if(e.length>0){const t=e.map((e=>({userid:e.userId,sn:e.zoomID&&pr(e.zoomID)})));Ob.updateUserMediaSN({added:t,isFromMainSession:!1,iVType:Xi.SHARING_DECODE})}}})),Et(fe))})))}))),epics14:(e,t)=>En(e,20235).pipe(Tt(t),Ot((e=>{let[t,o]=e;const{media:{sharingDecodeStatus:n}}=o,{type:r,payload:{body:i}}=t,s=r===`${Ho}`;Vf("sharing","success",n).subscribe((e=>{let[,t]=e;t&&Ob.addReceivedSharingChannelType({isFromMainSession:s,...i})}))})),Et(fe)),epics15:(e,t)=>En(e,20236).pipe(Tt(t),Ot((e=>{let[t,o]=e;const{media:{sharingDecodeStatus:n}}=o,{type:r,payload:{body:{ssrc:i}}}=t,s=r===`${Ho}`;Vf("sharing","success",n).subscribe((e=>{let[,t]=e;t&&Ob.removeReceivedSharingChannelType({isFromMainSession:s,ssrc:i})}))})),Et(fe)),epics16:e=>In(e,Va.SharingFirstDecodeFrameReceivedSsrc).pipe(mt((e=>!!e.payload.data)),Ot((e=>{const{payload:{data:{ssrc:t}}}=e;wb.sendReceivingSharingReady(t)})),Et(fe)),epics17:(e,t)=>yn(e,20233).pipe(mt((()=>!!t.value.share.isRequireReadReceipt)),Ot((e=>{const{payload:{body:{bReceiveOk:t}}}=e;t&&Dc(hl)})),Et(fe)),epics18:(e,t)=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.lockShare)})),Xe((e=>{const{payload:{body:{lockShare:o}}}=e,{share:{isOptimizedForSharedVideo:n,isSharingToBreakoutRoom:r},audio:{isSharingAudio:i},meeting:{userId:s}}=t.value,a=[];return o===Ka.MultipleShare&&n&&(wb.startSharing(s,{bShareAudio:i,bShareToBO:r,bShareVideo:!1}),Ob.switchSharingMode(Ed.Normal),a.push(Gh(!1))),Ue(a)}))),epics19:(e,t)=>In(e,Va.ShareQosData).pipe(Tt(t),ze((e=>{var t;let[o,n]=e;const{meeting:{isWebinar:r},media:{sharingEncodeStatus:i,sharingDecodeStatus:s},share:{status:a,isReceiveSharing:d},participants:{xmppAttendeeList:u}}=n;let l=Pp(n).length>0;r&&(l=l||Boolean(u.length));const c=a!==qa.End&&"success"===i&&l,p=d&&"success"===s;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?c?(Dc(ml,o.payload),zh(o.payload)):zh(vd):p?(Dc(ml,o.payload),Kh(o.payload)):Kh(vd)})))},DE=fn(TE,OE),PE=Ns.createAgent();let kE=function(e){return e.Add="add",e.List="list",e.Remove="memberremove",e.rename="rename",e.update="UPDATE",e}({}),ME=function(e){return e.Open="open",e.Message="message",e.Error="error",e.Close="close",e}({});class LE{constructor(){this.eventHandlers=void 0,this.websocket=void 0,this.seq=void 0,this.eventHandlers=new Map,this.websocket=null,this.seq=1}static getInstance(){return this.xmppInstance||(this.xmppInstance=new LE),this.xmppInstance}on(e,t){let o=this.eventHandlers.get(e);o||(o=[]),o.push(t),this.eventHandlers.set(e,o)}off(e,t){const o=this.eventHandlers.get(e);if(o){const n=o.filter((e=>e!==t));this.eventHandlers.set(e,n)}}emit(e,t){const o=this.eventHandlers.get(e);o&&o instanceof Array&&o.slice(0).forEach((e=>{try{e(t)}catch(e){console.error(e)}}))}sendMessageToRwg(e){this.seq+=1;const t=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify(Object.assign(e,{seq:t}))),t}connect(e){this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.addWebSocketEventListeners()}close(){var e;null===(e=this.websocket)||void 0===e||e.close()}addWebSocketEventListeners(){this.websocket&&(this.websocket.addEventListener("open",(e=>{this.emit(ME.Open,e)})),this.websocket.addEventListener("message",(e=>{const{data:t}=e;var o;if(t instanceof ArrayBuffer)0===new Uint8Array(t)[0]&&(null===(o=this.websocket)||void 0===o||o.send(t));else try{this.emit(ME.Message,JSON.parse(t))}catch(e){console.warn("Unsupported format",t)}})),this.websocket.addEventListener("close",(e=>{this.emit(ME.Close,e)})),this.websocket.addEventListener("error",(e=>{this.emit(ME.Error,e)})))}join(e){return{seq:this.sendMessageToRwg({evt:24576,body:{clientCap:e}})}}raiseHand(){return{seq:this.sendMessageToRwg({evt:24580,body:null})}}lowerHand(e){return{seq:this.sendMessageToRwg({evt:24578,jids:e||[]})}}sendWebinarMseeage(e,t,o){const n={msg:e,jid:t?[t]:[],type:o,bcm:arguments.length>3&&void 0!==arguments[3]&&arguments[3]};return{seq:this.sendMessageToRwg({evt:24582,body:n})}}sendAnswer(e,t,o){return{seq:this.sendMessageToRwg({evt:24584,body:{question_attendeejid:t.jid,question_attendeename:t.displayName,question_text:t.questionText,question_id:t.questionId,question_anonymous:t.isAnonymous,question_time:t.questionTime,text:e,isPrivate:o}})}}answerOnline(e,t){return{seq:this.sendMessageToRwg({evt:24586,body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,isLiveStart:t}})}}dismissQuestion(e){return{seq:this.sendMessageToRwg({evt:24590,body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,bOpen:!1}})}}deleteQuestion(e){return{seq:this.sendMessageToRwg({evt:24614,body:{question_id:e,bDelete:!0}})}}deleteComment(e){return{seq:this.sendMessageToRwg({body:{comment_id:e,bDelete:!0},evt:24616})}}reopenQuestion(e){return{seq:this.sendMessageToRwg({body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,bOpen:!0},evt:24590})}}askQuestion(e,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;const r=vr();return{seq:this.sendMessageToRwg({body:{id:r,text:e,isAnonymous:o,bAllowAttendeeViewAllQuestion:n,name:t},evt:24592}),questionId:r}}upOrDownVote(e,t){return{seq:this.sendMessageToRwg({body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,bUpVote:t},evt:24598})}}rename(e,t){return{seq:this.sendMessageToRwg({body:{jid:e,displayName:t},evt:24600})}}setSkinTome(e){return{seq:this.sendMessageToRwg({body:{skinTone:e},evt:24618})}}}LE.xmppInstance=null;const NE=lb.getInstance();let VE,UE;const jE=Ns.createAgent();let xE=null;function BE(e){switch(e.responseType){case"json":if("response"in e)return e.response;var t=e;return JSON.parse(t.responseText);case"document":return e.responseXML;default:return"response"in e?e.response:(t=e).responseText}}var FE=function(e,t,o,n){void 0===n&&(n="download_load"),this.originalEvent=e,this.xhr=t,this.request=o,this.type=n;var r=t.status,i=t.responseType;this.status=null!=r?r:0,this.responseType=null!=i?i:"";var s=t.getAllResponseHeaders();this.responseHeaders=s?s.split("\n").reduce((function(e,t){var o=t.indexOf(": ");return e[t.slice(0,o)]=t.slice(o+2),e}),{}):{},this.response=BE(t);var a=e.loaded,d=e.total;this.loaded=a,this.total=d},HE=S((function(e){return function(e,t,o){var n;this.message=e,this.name="AjaxError",this.xhr=t,this.request=o,this.status=t.status,this.responseType=t.responseType;try{n=BE(t)}catch(e){n=t.responseText}this.response=n}})),$E=function(){function e(e,t){return HE.call(this,"ajax timeout",e,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(HE.prototype),e}();var WE=ze((function(e){return e.response}));var GE,zE=(GE=function(e){var t;return t="string"==typeof e?{url:e}:e,new $((function(e){var o,n,r,i=c({async:!0,crossDomain:!1,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},t),s=i.queryParams,a=i.body,d=i.headers,u=i.url;if(!u)throw new TypeError("url is required");if(s)if(u.includes("?")){var l=u.split("?");if(2{const{meeting:{encryptedRWC:t,encryptedGEORWC:o,discardedRwcList:n,meetingOptions:r}}=e;let i=[];return(null==r?void 0:r.isEnableGeoFenceRWC)&&o&&(null==o?void 0:o.length)>0?i=o.filter((e=>!n.includes(e.rwc))).reduce(((e,t)=>{const{dl:o,rwc:n,rwcToken:r}=t,i=e.find((e=>e.dl===o));if(i)i.items.push({rwc:n,rwcToken:r});else{const t={dl:o,items:[]};t.items.push({rwc:n,rwcToken:r}),e.push(t)}return e}),[]):t&&(i=[{dl:0,items:Object.keys(t).map((e=>({rwc:e,rwcToken:t[e]})))}]),i},oI=e=>ct(...e.map((e=>0===e.dl?Ue(e.items):ut(e.dl).pipe(Xe((()=>Ue(e.items))))))),nI=()=>vt(Mc(Xs,1),Mc(Zs,1),Mc(Ys,1)),rI=(e,t)=>e.pipe($t(`${jr}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.encryptedRWC||void 0!==t.meeting.encryptedGEORWC&&t.meeting.encryptedGEORWC.length>0})),_t((e=>{let[,o]=e;const{meeting:{ts:n,auth:r,meetingNumber:i,meetingOptions:s,meetingId:a,userName:d},breakoutRoom:u}=o,l=null==s?void 0:s.isEnableGeoFenceRWC,c=tI(o);if(c.length>0){const e={serversLength:c.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0,retryCounts:0};let o;return l&&(o=new ee,oI(c).subscribe((e=>{var t;return null===(t=o)||void 0===t?void 0:t.next(e)}))),(l?o:oI(c)).pipe(Rt(nI()),wt((()=>{const{meeting:{meetingStatus:n,meetingId:r}}=t.value,i=n===Di.Initial&&!!r&&e.pingFailedServerList.length0;return!i&&o&&o.complete(),i})),Ot((()=>{if(e.pingRwcServerCounts=e.pingRwcServerCounts+1,l&&e.pingRwcServerCounts===e.serversLength){const n=1e3*Math.floor(5*Math.pow(2,e.retryCounts));e.retryCounts=e.retryCounts+1,eI.makeLogger(["Join Meeting Flow"]).info(`ping rwc retry,current rwc list:${JSON.stringify(tI(t.value))},retry counts:${e.retryCounts}, ${JSON.stringify({meetingId:a,meetingNumber:sb(i),userName:sb(d)})}`,["Ping RWC Retry"]),ut(n).pipe(ze((()=>{const o=tI(t.value);return Object.assign(e,{serversLength:o.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0}),o}))).subscribe((e=>{oI(e).subscribe((e=>{o.next(e)}))}))}})),Xe((s=>{const{rwc:c,rwcToken:p}=s,h=((e,t,o,n,r,i)=>{const s={ts:n,auth:r,rwcToken:o,dmz:1};return i&&Object.assign(s,{confID:i}),`https://${e}/wc/ping/${t}?${new URLSearchParams(s).toString()}`})(c,i,p,n,r,null==u?void 0:u.currentRoom.boConfId);return zE({url:h,crossDomain:br(h)}).pipe(Rt(nI()),Xe((e=>{let t={};return t=e.response?{...e.response,rwc:c,fromNginx:!1}:{rwc:c,rwg:c,rwcToken:p,fromNginx:!0},Ue([Wo(t),Mo()])})),gt((()=>{const{pingFailedServerList:n,serversLength:r}=e;return n.push(h),n.length===r?(l&&o&&o.complete(),eI.report(`ping rwc error, ${JSON.stringify({meetingId:a,meetingNumber:sb(i),userName:sb(d)})}`,["Join Meeting Flow","Ping RWC Error"],"error"),Dc(Zs,{reason:"connection error",errorCode:Dr.CommonError}),Ue([...oy(t.value)])):fe})))})),Ct(Yr(performance.now())))}return fe})));let iI=0;const sI=lb.getInstance(),aI={meetingStatus:Di.Initial,isWindowOpen:!1,apiKey:"",signature:"",signatureType:"",lang:"en-US",tk:"",customerKey:"",mtkGuid:"",pingRWCTimestamp:0,meetingInfoTimestamp:0,passWord:"",meetingNumber:0,userName:"",userEmail:"",sdkUrl:"",sdkOrigin:"",proxy:1,cv:"",meetingId:"",tid:"",ts:"",auth:"",sign:"",isSupportCallOut:!1,tollNumbers:void 0,recordingEnable:!1,callOutCountry:void 0,inviteEmail:"",xmppConfig:null,isSupportH323:!1,h323GatewayInfo:"",h323Password:"",trackAuth:"",isOriginHost:!1,isWebinar:!1,encryptedRWC:void 0,meetingOptions:{},meetingTopic:"",bLock:!1,bHoldUponEntry:!1,viewOnly:0,listenOnlyPhone:0,bAllowRaiseHand:!1,bAllowAttendeeRename:!1,bBroadcast:void 0,bAllowPlayChimeForEnterOrExit:!1,bIbDisableShare:!1,bIbDisableChat:!1,bAllowShowCount:!1,encryptKey:"",bNoHostTimeOut:!1,confId:"",conId:"",e2eEncrypt:!1,zoomId:"",jid:"",xtoken:"",groups:void 0,svcUrl:"",encType:NaN,userGUID:"",userId:NaN,isHost:!1,isCoHost:!1,participantID:0,isOnHold:!1,isMeetingReset:!1,bRecord:!1,audioVideoBeforeOnHold:void 0,region:void 0,network:void 0,joinMeetingTimeStamp:0,activeAppInfo:void 0,recordingDisclaimerForRecorder:{},recordingDisclaimer:{},ccUrl:"",sessionIdleTimeoutMins:40,reportDomain:"",isAudioBridgeEnabled:!0,discardedRwcList:[],sharePronounType:void 0,stayAwake:!1,wrInfo:{},meetingInfo:{},isNewJoinFlow:!1,gatewayUserList:[],logConfig:"",logEncryptionPubKey:"",failover:{count:0,isCurrentFailoverRecorded:!1,reason:-1,interval:0,joinMeetingSuccessTimestamp:0,sequence:""},enableLongPollingCheckStart:!1,rsPwd:"",chatModerationPolicy:{}},dI=ko({[`${Gr}`]:_E(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o),e.meetingStatus=Di.Initial})),[`${zr}`]:_E(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o)})),[`${Kr}`]:_E(((e,t)=>{let{payload:o}=t;e.isWindowOpen=o})),[`${qr}`]:_E(((e,t)=>{let{payload:o}=t;o.useSDK?e.signatureType="sdk":e.signatureType="api",e.apiKey=o.apiKey,e.signature=o.signature,e.lang=o.language})),[`${Jr}`]:_E(((e,t)=>{let{payload:o}=t;e.ztk=o})),[`${Qr}`]:_E(((e,t)=>{let{payload:o}=t;e.zsk=o})),[`${Zr}`]:_E(((e,t)=>{let{payload:o}=t;e.tk=o.tk,e.mtkGuid=o.mtkGuid})),[`${Yr}`]:_E(((e,t)=>{let{payload:o}=t;e.pingRWCTimestamp=o})),[`${Ci}`]:_E(((e,t)=>{let{payload:o}=t;e.meetingInfoTimestamp=o})),[`${Xr}`]:_E(((e,t)=>{let{payload:o}=t;e.confId=o.confID,e.conId=o.conID,e.e2eEncrypt=o.e2eEncrypt,e.meetingNumber=parseInt(o.mn,10),e.zoomId=o.zoomID,e.meetingStatus=Di.Joined,e.jid=o.jid,e.xtoken=o.xtoken,e.groups=o.groups,e.svcUrl=o.svcUrl,e.encType=o.encType,e.userGUID=o.userGUID,e.userId=o.userID,e.role=o.role,e.participantID=o.participantID,e.reportDomain=o.reportDomain,e.abToken=o.ABtoken,e.supportLocalAB=!!o.supportLocalAB,o.enableWebTransport&&(e.enableWebtransport=o.enableWebTransport,e.webtransportPort=o.WebTransportPort)})),[`${ei}`]:_E(((e,t)=>{let{payload:o}=t;if(o.gatewayUser){var n;const{userId:t,sn:i}=o.gatewayUser,s=null===(n=e.gatewayUserList)||void 0===n?void 0:n.find((e=>e.userId===t));var r;s?s.sn=i:null===(r=e.gatewayUserList)||void 0===r||r.push(o.gatewayUser)}else Object.assign(e,o)})),[`${oi}`]:_E(((e,t)=>{let{payload:o}=t;e.isHost=o})),[`${ni}`]:_E(((e,t)=>{let{payload:o}=t;e.isCoHost=o})),[`${ri}`]:_E(((e,t)=>{let{payload:o}=t;e.isOnHold=o})),[`${ii}`]:_E(((e,t)=>{let{payload:o}=t;e.isMeetingReset=o})),[`${si}`]:_E(((e,t)=>{let{payload:o}=t;e.audioVideoBeforeOnHold=o})),[`${ai}`]:_E(((e,t)=>{let{payload:o}=t;e.currentUserAudioBeforeReset=o})),[`${di}`]:_E(((e,t)=>{let{payload:o}=t;e.isCurrentUserMutedBeforeReset=o})),[`${ui}`]:_E(((e,t)=>{let{payload:o}=t;e.meetingStatus=o})),[`${li}`]:_E(((e,t)=>{let{payload:o}=t;e.region=o.region,e.network=o.network})),[`${ci}`]:_E(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartVideoBeforeReset=o})),[`${pi}`]:_E(((e,t)=>{let{payload:o}=t;e.joinMeetingTimeStamp=o})),[`${hi}`]:_E(((e,t)=>{let{payload:o}=t;e.activeAppInfo=o})),[`${mi}`]:_E(((e,t)=>{let{payload:o}=t;e.idleStartTime=o})),[`${vi}`]:_E(((e,t)=>{let{payload:o}=t;e.sessionIdleTimeoutMins=o})),[`${gi}`]:_E(((e,t)=>{let{payload:o}=t;e.isAudioBridgeEnabled=o})),[`${fi}`]:_E(((e,t)=>{var o,n;let{payload:r}=t;const i=null===(o=e.encryptedGEORWC)||void 0===o||null===(n=o.find((e=>e.rwc===r)))||void 0===n?void 0:n.dc;if(i){var s;const t=null===(s=e.encryptedGEORWC)||void 0===s?void 0:s.filter((e=>e.dc===i));t&&e.discardedRwcList.some((e=>(null==t?void 0:t.findIndex((t=>t.rwc===e)))>=0))&&e.discardedRwcList.push(...t.map((e=>e.rwc))),e.discardedRwcList.push(r)}})),[`${yi}`]:_E(((e,t)=>{let{payload:o}=t;e.sharePronounType=o})),[`${Si}`]:_E(((e,t)=>{let{payload:o}=t;e.stayAwake=o})),[`${bi}`]:_E(((e,t)=>{let{payload:o}=t;e.failover.joinMeetingSuccessTimestamp=o})),[`${Ei}`]:_E((e=>{Object.assign(e.failover,{...aI.failover,count:e.failover.count,joinMeetingSuccessTimestamp:e.failover.joinMeetingSuccessTimestamp})})),[`${Ii}`]:_E(((e,t)=>{let{payload:o}=t;const{count:n,reason:r,interval:i,sequence:s}=o;e.failover.count=n,e.failover.reason=r,e.failover.interval=i,e.failover.isCurrentFailoverRecorded=!0,e.failover.sequence=s})),[`${Ai}`]:_E(((e,t)=>{let{payload:o}=t;e.quicklyLeave=o})),[`${_i}`]:_E(((e,t)=>{let{payload:o}=t;e.isEnableZmkFromRWG=o})),[`${ti}`]:(e,t)=>{let{payload:o}=t;const{isFailover:n}=o,r={isMeetingReset:!0,apiKey:e.apiKey,signatureType:e.signatureType,signature:e.signature,lang:e.lang,proxy:1,stayAwake:e.stayAwake};return n&&Object.assign(r,{currentUserAudioBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.audio:o.audio,isCurrentUserMutedBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.muted:o.muted,isCurrentUserStartVideoBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.video:o.video,meetingNumber:e.meetingNumber,userName:e.userName,passWord:e.passWord,userEmail:e.userEmail,sdkUrl:e.sdkUrl,sdkOrigin:e.sdkOrigin,cv:e.cv,zsk:e.zsk,ztk:e.ztk,idleStartTime:e.idleStartTime,sessionIdleTimeoutMins:e.sessionIdleTimeoutMins,customerKey:e.customerKey,failover:e.failover,stayAwake:e.stayAwake,quicklyLeave:e.quicklyLeave}),{...aI,...r}}},aI),uI={meetingFailoverReportEpic0:(e,t)=>e.pipe($t(`${Gr}`),_t((()=>{const o=0===t.value.meeting.failover.joinMeetingSuccessTimestamp&&!!Vi.get(Ui.WebclientZoomId);return e.pipe($t(`${Xr}`),ft(1),Xe((()=>{const e=[],{count:n,sequence:r}=Vi.get(Ui.WebclientFailoverCount)||{};let{meeting:{failover:{count:i,reason:s,interval:a}}}=t.value;const{meeting:{pingRWCTimestamp:d}}=t.value;if(o){i=n+1,s=ki.RefreshPage,a=0;const t=r?`${r}-${s}`:`${s}`;Vi.set(Ui.WebclientFailoverCount,{count:i,sequence:t},Li.SessionStorage),e.push(Ii({count:i,reason:s,interval:a,sequence:t}))}const u=performance.now();let l=`WCL_M, JMCT(${u-d})`;return i>0&&s!==ki.NormalCase&&(l=`${l},FAILOVER(${i},${s},${(a/1e3).toFixed(1)})`),jE.sendRWGConnectionPerformance(l),e.push(Ei(),bi(u)),Ue(e)})))}))),meetingFailoverReportEpic1:(e,t)=>e.pipe($t(`${xr}`),Xe((e=>{const{payload:o}=e,{meeting:{failover:{joinMeetingSuccessTimestamp:n,isCurrentFailoverRecorded:r},userGUID:i,userId:s}}=t.value,a=[];if(!r){let{count:e,sequence:t}=Vi.get(Ui.WebclientFailoverCount)||{};t=t?`${t}-${o}`:`${o}`,o!==ki.NormalCase&&(e+=1,Vi.set(Ui.WebclientFailoverCount,{count:e,sequence:t},Li.SessionStorage));const r=performance.now()-n;a.push(Ii({reason:o,count:e,interval:r,sequence:t,userGUID:i,userId:s}))}return Ue(a)})))},lI={sessionIdleEpic0:(e,t)=>e.pipe($t(`${Xr}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.zlkJwtToken})),_t((()=>(VE&&VE.complete(),VE=new Q,UE=lt(6e4).pipe(ze((()=>performance.now()))).subscribe(VE),VE.pipe(ze((e=>$r(e)))))))),sessionIdleEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{VE&&(VE.complete(),UE.unsubscribe())})),Et(fe)),sessionIdleEpic2:(e,t)=>e.pipe($t(`${$r}`),Tt(t),Xe((e=>{var t;let[o,n]=e;const{meeting:{idleStartTime:r,sessionIdleTimeoutMins:i,isOriginHost:s,isWebinar:a},participants:{attendeesList:d,xmppAttendeeList:u},recording:l,breakoutRoom:c}=n,p=o.payload,h=[];if(1!==d.length||a&&0!==u.length||(null==c||null===(t=c.currentRoom)||void 0===t?void 0:t.status)===cp.InRoom||(null==l?void 0:l.cmrStatus)===Ca.Start)h.push(mi(void 0));else if(r){const e=s&&rp(d[0].userRole)?i:40;p-r>60*e*1e3&&(console.warn(`No active for ${e} minutes, will end the session.`),NE.report(`Session idle timeout(${e} minutes), end the session automatically!`,["Join Meeting Flow","Session idle"],"warn"),h.push(Hr()),ut(500).subscribe((()=>{Lc()})))}else h.push(mi(p));return Ue(h)}))),sessionIdleEpic3:(e,t)=>e.pipe($t(`${Uo}`),mt((e=>[ds,us].includes(e.payload.evt)&&void 0!==t.value.meeting.idleStartTime)),Le(he),Xe((()=>{var e;const{participants:{attendeesList:o,xmppAttendeeList:n},recording:r,breakoutRoom:i}=t.value,s=[];return(o.length>1||n.length>0||(null==r?void 0:r.cmrStatus)===Ca.Start||(null==i||null===(e=i.currentRoom)||void 0===e?void 0:e.status)===cp.InRoom)&&s.push(mi(void 0)),Ue(s)}))),sessionIdleEpic4:e=>e.pipe($t(`${Br}`,`${Hr}`),yt(mi(void 0)))},cI={meetingMainEpics0:(e,t)=>yn(e,0).pipe(Ot((e=>{var o;if("READY"===(null===(o=e.payload.body)||void 0===o?void 0:o.status)){const{meeting:{zlkJwtToken:e,signatureType:o,sign:n,passWord:r,isHost:i,isOriginHost:s,ztk:a,zsk:d,tk:u,userEmail:l},breakoutRoom:c}=t.value,p=e?{zlkJwtToken:e}:{signType:o,sign:n};if(r&&""!==r&&(e?Object.assign(p,{mpwd:dr(r)}):i&&s||Object.assign(p,{mpwd:r})),(null==c?void 0:c.currentRoom.status)===cp.Joining){const{currentRoom:{boId:e,boConfId:t,boToken:o}}=c;e&&t&&o&&Object.assign(p,{botk:o})}if(!e){a&&Object.assign(p,{zak:a}),(sessionStorage.getItem(Ui.WebclientZsk)||d)&&Object.assign(p,{zak:d}),u&&Object.assign(p,{tk:u});const e=Vi.get(Ui.WebclientWebinarToken);void 0!==e&&Object.assign(p,{tk:e});const t=sessionStorage.getItem(Ui.WebclientRecordingToken);t&&Object.assign(p,{localRecordToken:t}),l&&Object.assign(p,{email:l})}PE.sendLaunchParams(p);const h=Vi.get(Ui.WebclientMeetingToken);h&&PE.joinMeeting(h)}})),Et(fe)),meetingMainEpics1:(e,t)=>{return yn(e,ps).pipe(Tt(t),(o=e=>{let[t,o]=e;const{payload:{body:{res:n,userID:r,zoomID:i,mn:s,participantID:a,meetingtoken:d,role:u}}}=t,{meeting:{userEmail:l,userName:c,isMeetingReset:p,apiKey:h,zsk:m,signatureType:v}}=o;if(wr.Success===n){const{WebclientParticipantId:e,WebclientZoomId:o,WebclientUserEmail:n,WebclientUserName:g,WebclientMeetingToken:f}=Ui;Vi.set(o,i,Li.SessionStorage),Vi.set(e,a,Li.SessionStorage),l&&Vi.set(n,l,Li.SessionStorage),Vi.set(g,c,Li.SessionStorage),d&&Vi.set(f,d,Li.SessionStorage),m&&PE.sendSdkKeyToMonitor(v,h,r);const y=[Xr(t.payload.body),pi(performance.now())];return p&&y.push(ii(!1)),(u&tp.Owner)===tp.Owner&&(Dc(Zs,{reason:"dont support assisnt join through widget",errorCode:-1}),PE.leaveMeeting()),Dc(Qs,{meetingNumber:s}),Ue(y)}if(wr.MeetingLocked===n)Dc(Zs,Mr(n));else if(wr.UserFull===n)Dc(Zs,Object.assign({},Mr(n),{lmUrl:t.payload.body.lmURL}));else if(wr.MeetingIsOver===n)Dc(Zs,Mr(n));else if(wr.MMRIBReject===n)Dc(Zs,Mr(n));else if(wr.MMRConfParticipantExists===n)Dc(Zs,Mr(n));else if([wr.UserHasBeenRemoved,wr.WebinarBlockedEmail].includes(n))Dc(Zs,Mr(n));else if(wr.MeetingNotStarted===n){var g;const e=Mr(n),{meeting:{meetingNumber:t,passWord:r,userName:i,userEmail:s,inviteEmail:a,meetingTopic:d,region:u,network:l,userId:c,lang:p,meetingId:h,participantID:m,wrInfo:v,meetingInfo:f,isNewJoinFlow:y,enableLongPollingCheckStart:S,tid:b,signature:E,rsPwd:I}}=o;Object.assign(e,{meetingInfo:{meetingNumber:t,password:r,userName:i,userEmail:s,inviteEmail:a,meetingTopic:d,region:u,network:l,userId:c,lang:p,webEndpoint:Nf(),meetingId:h,participantId:m,wrInfo:Object.assign({},v,{isNew:y}),scheduleInfo:f,enableLongPollingCheckStart:S,rid:iy(b),role:Number(null===(g=Er(E))||void 0===g?void 0:g.role),rsPwd:I}}),Dc(Zs,e)}else Dc(Zs,Mr(n));return Ue(oy(o,!1))},F(_t(((e,t)=>o(e)||fe)))));var o},meetingMainEpics2:(e,t)=>yn(e,us).pipe(Tt(t),ze((e=>{let[t,o]=e;const{payload:{body:n}}=t,{meeting:{zoomId:r,encType:i,gcmSessinKey:s}}=o;if(void 0!==(null==n?void 0:n.encryptKey)&&is.init(r,n.encryptKey,i),void 0!==(null==n?void 0:n.gatewayKey)){const e=Hs.getInstance(),[,t,o]=n.gatewayKey.split(".");e.sendUserNodeList([{userid:Number(t),sn:o&&pr(o)}],s)}return Dc(ta,n),ei(n)}))),meetingMainEpics3:(e,t)=>yn(e,7939).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{payload:{body:n}}=t;if(void 0!==n.reason){if(Or.Reconnect===n.reason)return Tr.WaitingRoomFailover===n.subReason?Dc(Ys,{reason:Ri.OnHold}):Dc(Ys,{reason:Ri.Failover}),je(xr(ki.NormalCase));Or.KickedByHost===n.reason?Dc(Xs,{reason:"kicked by host"}):[Or.EndByHost,Or.EndByNone,Or.EndByAdmin,Or.EndByHostStartAnotherMeeting].includes(n.reason)?Dc(Xs,{reason:"ended by host"}):Or.FreeMeetingTimeout===n.reason?Dc(Xs,{reason:"free meeting ended"}):[Or.DuplicateSession,Or.MeetingTransfer].includes(n.reason)&&Dc(Xs,{reason:"duplicated session"})}return o.meeting.isMeetingReset?fe:Ue(oy(o,!1))}))),meetingMainEpics4:(e,t)=>e.pipe($t(`${xr}`),Tt(t),Xe((e=>{let[,t]=e;const o=oy(t,!0);let n;if(t.meeting.zlkJwtToken){const e=function(e){if(e){const{meeting:{topic:t,passWord:o,userName:n,zlkJwtToken:r,lang:i,cv:s,customerKey:a}}=e;return{topic:t,passWord:o,userName:n,zlkJwtToken:r,lang:i,cv:s,customerKey:a}}return null}(t),o={topic:null==e?void 0:e.topic,password:null!=e&&e.passWord?encodeURIComponent(null==e?void 0:e.passWord):"",userName:null==e?void 0:e.userName,zlk:null==e?void 0:e.zlkJwtToken,lang:null==e?void 0:e.lang,cv:null==e?void 0:e.cv,customerKey:null==e?void 0:e.customerKey};n=je(Ur(o)).pipe(bt(1e3))}else{const e=function(e){var t;const{meeting:{apiKey:o,signature:n,signatureType:r,meetingNumber:i,userName:s,lang:a,passWord:d,userEmail:u,sdkUrl:l,sdkOrigin:c,proxy:p,cv:h,ztk:m,zsk:v,tk:g}}=e;let f=m||sessionStorage.getItem(Ui.WebclientZtk),y=v||sessionStorage.getItem(Ui.WebclientZsk);const S=1===Number(null===(t=Er(n))||void 0===t?void 0:t.role);return S||(f=y,y=""),{apiKey:o,signature:n,signatureType:r,meetingNumber:i,userName:s,lang:a,passWord:d?encodeURIComponent(d):"",userEmail:u,sdkUrl:l,sdkOrigin:c,proxy:p,cv:h,ztk:f,zsk:y,tk:g||sessionStorage.getItem(Ui.WebclientTk),ulsm:S&&y?1:0}}(t);n=je(Vr(e)).pipe(bt(1e3))}return tt(Ue(o),n)}))),meetingMainEpics5:e=>En(e,7940).pipe(Ot((e=>{Dc("MEETING_HOST_CHANGE_INDICATION",e.payload.body.bHost)})),ze((e=>oi(e.payload.body)))),meetingMainEpics6:e=>En(e,7941).pipe(Ot((e=>{Dc("MEETING_COHOST_CHANGE_INDICATION",e.payload.body.bCoHost)})),ze((e=>ni(e.payload.body)))),meetingMainEpics7:e=>En(e,7945).pipe(Ot((e=>{const{payload:{body:{opt:t}}}=e;Vi.set(Ui.WebclientOpt,t,Li.SessionStorage)})),Et(fe)),meetingMainEpics8:(e,t)=>yn(e,7942).pipe(Ot((e=>{const{payload:{body:{bHold:t}}}=e;Vi.set(Ui.WebclientIsOnHold,t?1:0,Li.SessionStorage),Dc(ea,t)})),Tt(t),Xe((e=>{let[t,o]=e;const n=[ri(t.payload.body.bHold)];if(t.payload.body.bHold){const e=Ip(o);if(e){n.push(si({audio:e.audio,video:e.bVideoOn,muted:e.muted}));const t=vb(Hs.getInstance());if("computer"===e.audio&&(t.leaveComputerAudio(),PE.joinOrLeaveVoip(!1)),e.bVideoOn&&t.stopCaptureVideo(),e.sharerOn&&(PE.stopSharing(e.userId),t.stopDesktopSharing(),n.push(Lh(qa.End))),o.video&&o.video.subscribedVideoList.length>0&&o.video.subscribedVideoList.forEach((e=>{PE.unsubscribeVideo(e)})),o.share&&o.share.isReceiveSharing){const e=o.share.activeNodeId;o.share.remoteControlledUserList.length>0&&(o.share.remoteControlledUserList.forEach((e=>{PE.sharingRequestRemoteControl(e,!1)})),Iy(o)&&t.stopRemoteControl()),PE.unsubscribeSharing(e),t.stopRenderSharing()}}}return Ue(n)}))),meetingMainEpics9:e=>yn(e,7954).pipe(ze((e=>li(e.payload.body)))),meetingMainEpics10:e=>yn(e,4216).pipe(Ot((e=>{Dc("MEETING_CLAIM_HOST_KEY_RESPONSE",e.payload.body.bresult)})),Et(fe)),meetingMainEpics11:(e,t)=>e.pipe($t(`${Br}`,`${Hr}`),Tt(t),Xe((e=>{let[t,o]=e;const n=Mp(o),{socket:{zoomSocketStatus:r},meeting:{meetingId:i}}=o;return r===Lp.Connected&&(t.type===`${Br}`?PE.leaveMeeting(n):t.type===`${Hr}`&&PE.endMeeting()),i&&Dc(Xs,{}),Ue(oy(o,!1))}))),meetingMainEpics12:(e,t)=>e.pipe($t(`${Fr}`),Tt(t),Xe((e=>{let[t,o]=e;if(t.type===`${Fr}`&&o.meeting.meetingNumber&&!o.meeting.zlkJwtToken){const e={mn:o.meeting.meetingNumber.toString(),name:o.meeting.userName,customerKey:o.meeting.customerKey?dr(o.meeting.customerKey):""},{jbhLeave:t}={jbhLeave:`https://${Df}/wc/jbhLeave`},n=`${t}/?${new URLSearchParams(e).toString()}`;fetch(n,{method:"POST",headers:{"Content-type":"application/json; charset=UTF-8"}})}return fe}))),meetingMainEpics13:e=>yn(e,2).pipe(Ot((()=>{console.warn("Upgrade to latest version to optimize meeting experience")})),Et(fe)),meetingMainEpics14:e=>yn(e,1).pipe(Ot((e=>{const{payload:{body:{upgradeVersion:t}}}=e,o=Mr(1e4);if(o&&o.reason){const e=o.reason.replace(/{(\d+)}/g,(()=>t));o.reason=e}Dc(Zs,o)})),Et(fe)),meetingMainEpics15:e=>yn(e,4265).pipe(ze((e=>{const{payload:{body:t}}=e,{nShareType:o}=t;return Dc(oa,{userSharePronounType:o}),yi(o)}))),meetingMainEpics16:e=>yn(e,4128).pipe(Ot((e=>{const{payload:{body:{meetingtoken:t}}}=e,{WebclientMeetingToken:o}=Ui;t&&Vi.set(o,t,Li.SessionStorage)})),Et(fe)),meetingMainEpics17:(e,t)=>e.pipe($t(`${Xr}`),mt((()=>!!t.value.meeting.quicklyLeave)),_t((()=>st(window,"beforeunload").pipe(Ot((()=>{PE.leaveMeeting()})),Et(fe))))),meetingMainEpics18:(e,t)=>yn(e,8025).pipe(mt((e=>!!e.payload.body.Zmk&&!!t.value.meeting.isEnableZmkFromRWG)),ze((e=>{const{payload:{body:{Zmk:t}}}=e;return ei({zmk:t})})))},pI=fn(cI,{wakeLockEpic0:(e,t)=>e.pipe($t(`${Xr}`),Tt(t),mt((e=>{let[,t]=e;return!!t.meeting.stayAwake})),Ot((async()=>{try{const{isSafari:e,isIOSMobile:t}=zi;xE&&xE.release().then((()=>{xE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),xE=await navigator.wakeLock.request("screen"),xE.addEventListener("release",(()=>{})))}catch(e){}})),_t((()=>st(document,"visibilitychange").pipe(Xe((async()=>{if("visible"===document.visibilityState){const{isSafari:e,isIOSMobile:t}=zi;xE&&xE.release().then((()=>{xE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),xE=await navigator.wakeLock.request("screen"))}else xE&&xE.release().then((()=>{xE=null}))})),Et(fe))))),wakeLockEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{xE&&xE.release().then((()=>{xE=null}))})),Et(fe))},uI,lI,{meetingInfoEpic:(e,t)=>e.pipe($t(`${Ur}`),_t((o=>{const n=Object.assign({},o.payload,{password:dr(o.payload.password),topic:dr(o.payload.topic)}),{videoSDKUrl:r}={meetingSDKUrl:`https://${Df}/api/v1/wc/info`,videoSDKUrl:`https://${Df}/wc/lsdk`};return function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zoomsdkjsonpcallback";return new $((n=>{iI++;const r=`${o}${iI}`,i=document.createElement("script");Object.keys(t).forEach((e=>(void 0===t[e]||null===t[e])&&delete t[e])),i.src=`${e}?${new URLSearchParams(Object.assign(t,{callback:r})).toString()}`,i.async=!0,i.onerror=e=>n.error(e),document.getElementsByTagName("head")[0].appendChild(i),window[r]=e=>{i.parentNode&&i.parentNode.removeChild(i),delete window[r],n.next(e),n.complete()}}))}(r,n).pipe(Rt(e.pipe($t(`${Br}`),ft(1))),gt((e=>je({status:!1,result:e.toString(),errorCode:-3e3}))),Xe((e=>{const[n,r]=(i=je(e),[mt(s=e=>!0===e.status&&void 0!==e.result,a)(Pe(i)),mt(ht(s,a))(Pe(i))]);var i,s,a;return r.subscribe((e=>{sI.report(`get meeting info error, ${JSON.stringify(e)}`,["Join Meeting Flow","Get Meeting Info Error"],"error"),e.state||(3e3===e.errorCode&&"Meeting password is incorrect"===e.errorMessage?Dc(Zs,{errorCode:Dr.WrongPasscode,reason:"Incorrect passcode."}):3e3===e.errorCode&&"The role type error"===e.errorMessage?Dc(Zs,{errorCode:Dr.RoleTypeMissing,reason:"Role type error"}):-3e3===e.errorCode?Dc(Zs,{errorCode:Dr.CommonError,reason:"connection error"}):3e3===e.errorCode?Dc(Zs,{reason:e.errorMessage,errorCode:Dr.CommonError}):300===e.errorCode?Dc(Zs,{reason:"This account does not exist or does not belong to you",errorCode:Dr.CommonError}):124===e.errorCode&&"Parse lite sdk topic and pwd fail"===e.errorMessage?Dc(Zs,{reason:"Topic is invalid",errorCode:Dr.CommonError}):124===e.errorCode&&"The java web token is expired or more than 2 days or ineffective."===e.errorMessage?Dc(Zs,{reason:"The token has expired, is over 2 days old, or is ineffective.",errorCode:Dr.CommonError}):124===e.errorCode&&Dc(Zs,{reason:"Verify JWT failed",errorCode:Dr.CommonError}))})),n.pipe(ay((e=>{if(!0===e.status){const{result:{mid:r,websdkClientFeatureOptions:i,showRecommendVersion:s}}=e;Vi.init(r);const a=((e,t)=>{if(e.result){const{result:{mn:o,ts:n,auth:r,track_auth:i,mid:s,tid:a,encryptedRWC:d,encryptedGEORWC:u,user_identity:l,meetingOptions:c,can_recording:p,wcXMPPConfig:h,call_out_country_json:m,isOriginalHost:v,support_call_out:g,liveTranscription:f,logConfig:y,logEncryptionPubKey:S,toll_numbers_json:b,h323Password:E,liveStreamInfo:I,rc_auto_delete:A,jwt_rc:C,op_rc:_,mediaSDKVersion:R,mediaSDKPathPrefix:w,zmk:O,fileTransfer:T,fileServerDomain:D,accountId:P}}=e,{lang:k,password:M,topic:L,zlk:N,cv:V,userName:U}=t;return{meetingNumber:o,meetingId:s,tid:a,ts:n,auth:r,passWord:M,trackAuth:i,customerKey:l,encryptedRWC:JSON.parse(d||"{}"),encryptedGEORWC:JSON.parse(u||"{}"),meetingOptions:JSON.parse(c||"{}"),recordingEnable:"1"===p,topic:L,userName:Vi.get(Ui.WebclientUserName)||U,cv:V,zlkJwtToken:N,xmppConfig:JSON.parse(h||"{}"),callOutCountry:JSON.parse(m||"{}"),lang:k,isOriginHost:v,isSupportCallOut:"1"===g,liveTranscription:JSON.parse(f||"{}"),logConfig:y,logEncryptionPubKey:S,tollNumbers:void 0===b?void 0:JSON.parse(b),h323Password:E,liveStreamInfo:JSON.parse(I||"{}"),rcAutoDelete:A,jwtRc:C,opRc:_,mediaSDKPath:R&&w?`${Ir(w)}/${R}`:void 0,zmk:O,fileTransfer:JSON.parse(T||"{}"),fileServerDomain:D,accountId:P}}return e})(e,o.payload);var n;s&&(null==o||null===(n=o.payload)||void 0===n||n.lang,console.log("Update VideoSDK-Web to the latest version to optimize meeting experience","https://developers.zoom.us/docs/video-sdk/web/"));const d=[je(Gr(a)),vn(rI,t,jr())],u=((e,t)=>{const o=[];if(e){const t=e.split("").reverse();Object.keys(Pi).filter((e=>/M:\d+(,\d+)*;V:\d+(,\d+)*/.test(Pi[e]))).forEach((e=>{const n=Pi[e];let[r,i]=n.split(";");r.startsWith("V:")&&([r,i]=[i,r]);const s=i.slice(2).split(",").map((e=>t[Number(e)-1])).reverse().join(""),a=parseInt(s,16),d=ry[n];d&&(Array.isArray(d)?d:[d]).forEach((e=>{const t=e.mask?(a&e.mask)>0:a;o.push(je(e.action(t)))}))}))}return o})(i);u.length>0&&d.unshift(...u);const l=((e,t)=>{const o=[];if(e){const t=e.split("").reverse(),r=[];Mi.forEach((e=>{var o;const[n,i]=e.split("-"),s=Number(i)-1;r.length0&&d.unshift(...l),tt(...d)}})))})),Ct(Ci(performance.now())))}))),pingRWCEpic:rI});var hI={exports:{}};hI.exports=function(){function e(e){for(var t=1;tt){var I;const A=o[t],C={dn2:dr(n),auth:r,browser:`${zi.browser}${zi.browserVersion} ${null!==(I=window)&&void 0!==I&&I.crossOriginIsolated?"SAB":""}`,trackAuth:i,mid:s,tid:d,lang:u,ts:l,"ZM-CID":E,_ZM_MTG_TRACK_ID:b||"",customer_key:dr(a),cfs:0,islch:1};if(m)try{const{vendor:e}=Er(m);e&&Object.assign(C,{vendor:e})}catch(e){console.log(e)}A.rwcAuth?Object.assign(C,{rwcAuth:A.rwcAuth}):A.rwcToken&&Object.assign(C,{rwcToken:A.rwcToken});const _=qi()?1:zi.isIE||zi.isSupportEssentialAudioAndVideoAbility?2:0;Object.assign(C,{as_type:_}),[{key:gI,queryKey:"opt"},{key:fI,queryKey:"participantID"},{key:yI,queryKey:"zoomid"}].forEach((e=>{const t=Vi.get(e.key);void 0!==t&&(C[e.queryKey]=t)}));const R=c&&p&&h;R&&Object.assign(C,{bid:dr(c),confID:h}),Vi.get(SI)&&Object.assign(C,{isdj:1}),Ki()&&(Object.assign(C,{from:zi.isAndroidBrowser?"android":"ios"}),v&&Object.assign(C,{useABAudio:1})),Object.assign(C,{clientCaps:II({isAudioBridgeEnabled:v&&Ki(),isBO:R,isFullHDVideoEnabled:y,isFullHDVideoShareEnabled:S})});const w=g?f.length>0?1:0:1;return Object.assign(C,{isCamera:w}),Object.assign(C,{clientOS:zi.isAndroidOrIOSBrowser?zi.isIOSMobile?"ios":"android":zi.isMacOS?"mac":"win"}),Object.assign(C,{audioFeature:Hs.getAudioFeatureFlag()}),{queryObject:{...C},rwgServer:A}}return null}function II(e){const{isAudioBridgeEnabled:t,isBO:o,isFullHDVideoEnabled:n,isFullHDVideoShareEnabled:r}=e;let i=Vp.WebCameraIndication|Vp.SendMeetingTokenSeparately|Vp.SmartSummary|Vp.LocalRecording|Vp.LocalRecordingGrantPermission|Vp.UnifyErrorType;const s=Hs.getPTZCapability();return(s.pan||s.tilt||s.zoom)&&(i|=Vp.SupportFarEndCameraControl),Hs.isSupportVideoShare()&&(i|=Vp.SupportVideoShare),t&&Hs.isSupportAudioBridgeAVSync()&&(i|=Vp.WebrtcAudioRtcpTime),Hs.isSupportShareMultiStream()&&(i|=Vp.ShareMultiStream),Hs.isSupportVideoLTR()&&(i|=Vp.VideoLTR),o||(i|=Vp.RequestRemoteControl),n&&Hs.isSupportFullHDVideo()&&(i|=Vp.SupportSend1080PVideo),r&&Hs.isSupportFullHDVideoShare()&&(i|=Vp.SupportSend1080PVideoShare),i}function AI(e,t){return t?F(bt(t),mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==Lp.Closed&&o===Di.Joined&&!n}))):F(mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==Lp.Closed&&o===Di.Joined&&!n})))}const CI=Ns.createAgent();let _I;const RI=LE.getInstance();let wI;const OI=Vs.getInstance();let TI;const DI={zoomSocketStatus:Lp.Closed,xmppSocketStatus:Lp.Closed,mainSessionSocketStatus:Lp.Closed,retryCount:0,rwgServerList:[]},PI=ko({[`${$o}`]:_E(((e,t)=>{let{payload:o}=t;e.zoomSocketStatus=o.status})),[`${Wo}`]:_E(((e,t)=>{let{payload:o}=t;const{rwgServerList:n}=e;n.find((e=>e.rwg===o.rwg))||n.push(o)})),[`${Go}`]:_E(((e,t)=>{let{payload:o}=t;e.retryCount=o})),[`${zo}`]:_E(((e,t)=>{let{payload:o}=t;e.xmppSocketStatus=o})),[`${Ko}`]:_E(((e,t)=>{let{payload:o}=t;e.mainSessionSocketStatus=o})),[`${qo}`]:()=>DI},DI),kI={epics0:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Lp.Closed&&!!t.meeting.meetingId})),_t((e=>{let[,o]=e;const{media:{patchedMediaSDKStatus:n}}=o;return(n===Td.Loading?Mc($l,1):Ue([0])).pipe(_t((()=>{const{socket:{retryCount:e,rwgServerList:o},meeting:n,breakoutRoom:r,video:i,share:s}=t.value;let a;const d={...n,retryCount:e,rwgServerList:o};if(i){const{cameraDevicesList:e,isFullHDVideoEnabled:t}=i;Object.assign(d,{cameraDevicesList:e,isFullHDVideoEnabled:t})}if(s){const{isFullHDVideoShareEnabled:e}=s;Object.assign(d,{isFullHDVideoShareEnabled:e})}if(r&&r.currentRoom.status===cp.Joining){const{currentRoom:{boId:e,boConfId:t,boToken:o}}=r;Object.assign(d,{bid:e,botk:o,confID:t})}if(a=n.zlkJwtToken?function(e){const t=EI(e);if(t){const{queryObject:o,rwgServer:n}=t,{topic:r,cv:i,meetingNumber:s}=e;return Object.assign(o,{topic:dr(r),iccv:i}),`wss://${n.rwg}/instantsdk/${s}?${new URLSearchParams(o).toString()}`}return null}(d):function(e){const t=EI(e);if(t){const{queryObject:o,rwgServer:n}=t,{cv:r,meetingNumber:i}=e;return Object.assign(o,{jscv:r,browser:o.browser+" ComponentView"}),[{key:vI,queryKey:"cfs"}].forEach((e=>{const t=Vi.get(e.key);void 0!==t&&(o[e.queryKey]=t)})),`wss://${n.rwg}/wc/api/${i}?${new URLSearchParams(o).toString()}`}return null}(d),a){const e=(u=a,CI.connect(u),_I=new Q,dt((e=>CI.on(Ms.Message,e)),(e=>CI.off(Ms.Message,e)),(e=>e.data)).subscribe(_I),_I);return ct(e.pipe(mt((e=>"string"==typeof e)),ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),cy(),sy((e=>{if(0!==e.evt||!e.body||"invalid parameters!"!==e.body.test)return Uo(e);Dc(Zs,{errorCode:Dr.InvalidParameter,reason:"Invalid parameter"})})),Ct($o({status:Lp.Connecting,rwgUrl:a}))),e.pipe(mt((e=>e instanceof ArrayBuffer)),ze((e=>jo(e)))))}var u;return fe})))}))),epics1:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Lp.Closed&&!!t.meeting.meetingId})),_t((()=>{const[e,o,n,r]=[Ms.Open,Ms.Close,Ms.Error,Ms.Inactive].map((e=>dt((t=>CI.on(e,t)),(t=>CI.on(e,t)))));return ct(e.pipe(Xe((()=>ct(je($o({status:Lp.Connected})),ut(6e4).pipe(Tt(t),mt((e=>{let[,t]=e;return t.meeting.meetingStatus===Di.Initial&&!t.meeting.isMeetingReset})),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.NoHeartbeat))))))))),o.pipe(AI(t),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.Disconnect))))),r.pipe(AI(t),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.NoHeartbeat))))),n.pipe(Tt(t),Xe((e=>{let[,o]=e;const{meeting:{meetingStatus:n,isMeetingReset:r},socket:{rwgServerList:i,retryCount:s}}=o,a=[];if(n===Di.Initial&&null!=i&&i.length){const e=i[s];return ut(5e3).pipe(mt((()=>t.value.meeting.meetingStatus===Di.Initial)),Xe((()=>{const{socket:{rwgServerList:e,retryCount:o}}=t.value,n=[];return e.length>o+1?n.push(Go(o+1),No({retry:!0})):(Dc(Zs,{reason:"connection error",errorCode:Dr.CommonError}),n.push(...oy(t.value))),Ue(n)})),Ct(fi(null==e?void 0:e.rwc)))}return r||n!==Di.Joined||(Dc(Ys,{reason:Ri.Failover}),a.push(xr(ki.OnError))),Ue(a)}))))}))),epics2:(e,t)=>e.pipe($t(`${No}`),_t((e=>e.payload&&e.payload.retry?je(Mo()).pipe(bt(1e3),Ct($o({status:Lp.Closed}))):je($o({status:Lp.Closed})))),bt(100),Ot((()=>{var e;t.value.socket.zoomSocketStatus===Lp.Closed&&(CI.close(),null===(e=_I)||void 0===e||e.complete())})))},MI=fn(kI,{xmppEpics0:(e,t)=>e.pipe($t(`${Xr}`),Xe((()=>{const{meeting:{meetingOptions:e,zlkJwtToken:o,isWebinar:n}}=t.value,r=[];return(e.isPollingEnabled||o||n)&&r.push(Lo()),Ue(r)}))),xmppEpics1:(e,t)=>e.pipe($t(`${Lo}`),Tt(t),mt((e=>{let[,t]=e;return"closed"===t.socket.xmppSocketStatus})),_t((e=>{let[,t]=e;const{meeting:{svcUrl:o,meetingNumber:n,conId:r}}=t,i=function(e,t,o){return`wss://${e}/wc/media/${t}?type=x&cid=${o}`}(o,n,r);return(e=>(RI.connect(e),wI=new Q,dt((e=>RI.on(ME.Message,e)),(e=>RI.off(ME.Message,e))).subscribe(wI),wI))(i).pipe(mt((e=>void 0!==(null==e?void 0:e.evt))),ze((e=>xo(e))),Ct(zo(Lp.Connecting)))}))),xmppEpics2:(e,t)=>e.pipe($t(`${Lo}`),_t((()=>{const[e,o,n]=[ME.Open,ME.Close,ME.Error].map((e=>dt((t=>RI.on(e,t)),(t=>RI.on(e,t)))));return ct(e.pipe(Ot((()=>{const e=function(){const{isSupportEssentialAudioAndVideoAbility:e,isSupportAudioWorklet:t}=zi;return e&&t?11:10}();RI.join(e)})),yt(zo(Lp.Connected))),o.pipe(AI(t,500),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.DisconnectXmpp))))),n.pipe(AI(t,500),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.OnError))))))}))),xmppEpics3:e=>e.pipe($t(`${Vo}`),yt(zo(Lp.Closed)),bt(100),Ot((()=>{var e;RI.close(),null===(e=wI)||void 0===e||e.complete()})))},{mainSessionEpics0:(e,t)=>e.pipe($t(`${Bo}`),Tt(t),mt((e=>{let[,t]=e;return"closed"===t.socket.mainSessionSocketStatus})),_t((e=>{let[,t]=e;const{meeting:{svcUrl:o,meetingNumber:n,conId:r}}=t,i=function(e,t,o){return`wss://${e}/wc/media/${t}?type=m&cid=${o}&mode=2`}(o,n,r);return(e=>(OI.connect(e),TI=new Q,dt((e=>OI.on(Ms.Message,e)),(e=>OI.off(Ms.Message,e))).pipe(ze((e=>e.data))).subscribe(TI),TI))(i).pipe(ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),mt((e=>0!==e.evt)),cy(),ze((e=>Ho(e))),Ct(Ko(Lp.Connecting)))}))),mainSessionEpics1:(e,t)=>e.pipe($t(`${Bo}`),_t((()=>{const[e,o,n]=[Ms.Open,Ms.Close,Ms.Error].map((e=>dt((t=>OI.on(e,t)),(t=>OI.on(e,t)))));return ct(e.pipe(yt(Ko(Lp.Connected))),o.pipe(AI(t,500),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.DisconnectMChannel))))),n.pipe(AI(t,500),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.OnErrorMChannel))))))}))),mainSessionEpics2:e=>e.pipe($t(`${Fo}`),yt(Ko(Lp.Closed)),Ot((()=>{var e;OI.close(),null===(e=TI)||void 0===e||e.complete()})))}),LI={id:"userId",type:e=>ip(e)?{userType:e,avatarBackgroundType:Math.floor(8*Math.random())+1}:{userType:e},role:e=>({userRole:e,isHost:rp(e)}),dn2:e=>({displayName:ur(e)}),bShareOn:"sharerOn",bSharePause:"sharerPause",bLocalRecordStatus:e=>({bLocalRecord:e}),bGuest:"isGuest",bCapsRequestLT:"isRequestLT",customerKey:"userIdentity"},NI=e=>{const t={};return["add","remove","update"].forEach((o=>{const n=o,r=e[n];null!=r&&(t[n]=r.reduce(((e,t)=>{const o=Object.keys(t).reduce(((e,o)=>{const n=LI[o];return"function"==typeof n?Object.assign(e,n(t[o])):"string"==typeof n?Object.assign(e,{[`${n}`]:t[o]}):Object.assign(e,{[`${o}`]:t[o]}),e}),{}),n=e.find((e=>e.userId===o.userId));return void 0!==n?Object.assign(n,o):e.push(o),e}),[]))})),t},VI={name:"displayName",node:e=>({userId:Number(e)}),role:e=>({userRole:Number(e)})},UI=e=>Object.keys(e).reduce(((t,o)=>{const n=VI[o];return"function"==typeof n?Object.assign(t,n(e[o])):"string"==typeof n?Object.assign(t,{[`${n}`]:e[o]}):Object.assign(t,{[`${o}`]:e[o]}),t}),{}),jI={attendeesList:[],assistantList:[],xmppAttendeeList:[],allowTalkAttendeesList:[],failoverAttendeesList:[],isAdmitAllSilentUsers:!1},xI=ko({[`${Nc}`]:_E(((e,t)=>{let{payload:o}=t;void 0!==o.add&&o.add.length>0&&o.add.forEach((t=>{if(t.userType===np.Assitant){const o=e.assistantList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.assistantList.push(t)}else if(sp(t.userRole)){const o=e.allowTalkAttendeesList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.allowTalkAttendeesList.push(t)}else{const o=e.attendeesList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.attendeesList.push(t)}})),void 0!==o.update&&o.update.length>0&&o.update.forEach((t=>{const o=e.attendeesList.find((e=>e.userId===t.userId));if(void 0!==o)Object.assign(o,t);else{const o=e.allowTalkAttendeesList.find((e=>e.userId===t.userId));if(void 0!==o)Object.assign(o,t);else{const o=e.assistantList.find((e=>e.userId===t.userId));void 0!==o&&Object.assign(o,t)}}})),void 0!==o.remove&&o.remove.length>0&&o.remove.forEach((t=>{const o=e.attendeesList.findIndex((e=>e.userId===t.userId));if(-1!==o)e.attendeesList.splice(o,1);else{const o=e.allowTalkAttendeesList.findIndex((e=>e.userId===t.userId));if(-1!==o)e.allowTalkAttendeesList.splice(o,1);else{const o=e.assistantList.findIndex((e=>e.userId===t.userId));-1!==o&&e.assistantList.splice(o,1)}}}))})),[`${Gc}`]:_E(((e,t)=>{let{payload:o}=t;const{xmppAttendeeList:n}=e,r=n.map((e=>e.jid));o.forEach((e=>{const{jid:t}=e,o=r.indexOf(t);-1!==o?Object.assign(n[o],e):n.push(e)}))})),[`${Uc}`]:_E(((e,t)=>{let{payload:o}=t;e.isAdmitAllSilentUsers=o})),[`${Fc}`]:_E((e=>{e.attendeesList.forEach((e=>{e.bRaiseHand&&(e.bRaiseHand=!1)}))})),[`${Hc}`]:_E((e=>{e.attendeesList.forEach((e=>{e.feedback>0&&(e.feedback=0)}))})),[`${xc}`]:_E(((e,t)=>{let{payload:o}=t;e.failoverAttendeesList.push(o)})),[`${Bc}`]:_E(((e,t)=>{let{payload:o}=t;o.forEach((t=>{const o=e.failoverAttendeesList.findIndex((e=>e.zoomID===t.zoomID));-1!==o&&e.failoverAttendeesList.splice(o,1)}))})),[`${$c}`]:_E(((e,t)=>{let{payload:o}=t;const{jid:n,name:r}=o,i=e.xmppAttendeeList.find((e=>e.jid===n));i&&(i.displayName=r)})),[`${Wc}`]:_E(((e,t)=>{let{payload:o}=t;const{jid:n}=o,r=e.xmppAttendeeList.findIndex((e=>e.jid===n));-1!==n&&e.xmppAttendeeList.splice(r,1)})),[`${zc}`]:_E(((e,t)=>{let{payload:o}=t;const{userId:n,key:r,value:i}=o,s=e.attendeesList.find((e=>e.userId===n));s&&(s[`${r}`]=i)})),[`${jc}`]:()=>jI},jI),BI={epics0:(e,t)=>yn(e,ds).pipe(ze((e=>NI(e.payload.body))),Tt(t),Xe((e=>{let[t,o]=e,n=[Nc(t)];const{meeting:{userId:r,isWebinar:i,isOnHold:s},participants:{attendeesList:a,failoverAttendeesList:d,allowTalkAttendeesList:u}}=o,l=u.map((e=>e.userId));if(t.add){const e=t.add.filter((e=>e.userId===r));e.length>0&&e.forEach((e=>{void 0!==e.bHold&&n.push(ri(e.bHold)),Dc($s,e)}));const s=t.add.filter((e=>e.userId!==r));if(s.length>0){const e=s.filter((e=>!sp(e.userRole))).map((e=>{const t={...e};if(ip(e.userType)){var n;const r=null===(n=o.audio)||void 0===n?void 0:n.dialout.find((t=>t.phoneNodeId===e.userId));r&&Object.assign(t,{phoneNumber:r.phoneNumber})}const r=d.find((t=>t.zoomID===e.zoomID));return r&&Object.assign(t,{source:r.isOnHold?"on hold":"failover"}),t})),t=e.filter((e=>!!e.source)).map((e=>({zoomID:e.zoomID})));if(n.push(Bc(t)),Dc(Gs,e),i){const e=s.filter((e=>sp(e.userRole)));e.length>0&&Dc(qs,e.map((e=>({userId:e.userId,isAllowToTalk:!0}))))}}}if(t.update){const e=t.update.filter((e=>e.userId===r));e.length>0&&e.forEach((e=>{Dc(Ws,e),void 0!==e.bHold&&n.push(ri(e.bHold))}));const o=t.update.filter((e=>!(e.userId===r||l.includes(e.userId))));if(o.length>0&&Dc(zs,o),i){const e=t.update.filter((e=>e.userId!==r&&l.includes(e.userId)));e.length>0&&Dc(qs,e)}}if(t.remove){const e=t.remove.map((e=>{const t=a.find((t=>t.userId===e.userId));return t?2===e.action&&1===e.nUserStatus?t.bHold?(n.push(xc({zoomID:t.zoomID,isOnHold:!0})),{...e,...t,reason:"on hold"}):(n.push(xc({zoomID:t.zoomID,isOnHold:!1})),{...e,...t,reason:"failover"}):{...e,...t}:null})).filter((e=>!!e));if(Dc(Ks,e),i){const e=t.remove.filter((e=>l.includes(e.userId)));e.length>0&&Dc(qs,e.map((e=>({userId:e.userId,isAllowToTalk:!1}))))}}const c=n.filter((e=>e.type===`${ri}`));if(c.length>0){const e=c[c.length-1];n=n.filter((e=>e.type!==`${ri}`)),e.payload!==s&&(n.push(e),Dc(ea,!s))}return Ue(n)}))),epics1:(e,t)=>bn(e,24595).pipe(Xe((e=>{const{payload:{body:{action:o,data:n}}}=e,{meeting:{jid:r},participants:{xmppAttendeeList:i}}=t.value,s=[];if(o===kE.rename){n.forEach((e=>{s.push($c(e))}));const e=n.map((e=>UI(e)));Dc(qs,e)}if(o===kE.Remove){n.forEach((e=>{s.push(Wc(e))}));const e=n.map((e=>({...UI(e),removed:!0})));Dc(Js,e)}if([kE.Add,kE.List,kE.update].includes(o)){const e=n.map((e=>{const t=UI(e);return Object.keys(t).reduce(((e,o)=>(""!==t[o]&&Object.assign(e,{[o]:t[o]}),e)),{})}));if(Dc(qs,e),s.push(Gc(e)),o===kE.update){const e=n.find((e=>e.jid===r));if(e&&void 0!==e.bRaiseHand){const t=i.find((e=>e.jid===r));(null==t?void 0:t.bRaiseHand)!==e.bRaiseHand&&Dc("MEETING_WEBINAR_ATTENDEE_RAISE_HAND",{bRaiseHand:e.bRaiseHand})}}}return Ue(s)}))),epics2:e=>yn(e,7951).pipe(Ot((e=>{!1===e.payload.body.bStarted&&Dc("ADMIT_ALL_SILENT_USERS_END",e.payload.body.bStarted)})),ze((e=>Uc(e.payload.body.bStarted)))),epics3:e=>yn(e,7946).pipe(mt((e=>{var t;return["bRaiseHand","feedback"].includes(null===(t=e.payload.body)||void 0===t?void 0:t.key)&&0===e.payload.body.value})),ze((e=>(Dc(zs,{}),"bRaiseHand"===e.payload.body.key?Fc():Hc()))))},FI=fn(BI),HI={audioEncodeStatus:"initial",audioDecodeStatus:"initial",videoEncodeStatus:"initial",videoDecodeStatus:"initial",sharingEncodeStatus:"initial",sharingDecodeStatus:"initial",assetsPath:"",mediaConstraints:void 0,fileWithVersion:!1,enforceMultipleVideos:!1,enforceVirtualBackground:!1,enableAudioQos:!0,enableVideoQos:!0,isAudioBridgeReceiveReady:!1,isAudioBridgeSendReady:!1,isMediaAgentInitialized:!1,disableRenderLimits:!1,adaptedABOptionForMediaSDK:""},$I=ko({[`${Yo}`]:_E(((e,t)=>{let{payload:o}=t;e.audioDecodeStatus=o})),[`${Zo}`]:_E(((e,t)=>{let{payload:o}=t;e.audioEncodeStatus=o})),[`${on}`]:_E(((e,t)=>{let{payload:o}=t;e.sharingDecodeStatus=o})),[`${tn}`]:_E(((e,t)=>{let{payload:o}=t;e.sharingEncodeStatus=o})),[`${en}`]:_E(((e,t)=>{let{payload:o}=t;e.videoDecodeStatus=o})),[`${Xo}`]:_E(((e,t)=>{let{payload:o}=t;e.videoEncodeStatus=o})),[`${nn}`]:_E(((e,t)=>{let{payload:o}=t;e.mediaConstraints=o.mediaConstraints,e.assetsPath=o.assetsPath,e.fileWithVersion=o.fileWithVersion,e.enforceMultipleVideos=!!o.enforceMultipleVideos,e.enforceVirtualBackground=o.enforceVirtualBackground,e.skipJsMedia=o.skipJsMedia,e.patchJsMedia=o.patchJsMedia,e.alternativeNameForVideoPlayer=o.alternativeNameForVideoPlayer,o.enforceMultipleVideos&&"object"==typeof o.enforceMultipleVideos&&(e.disableRenderLimits=!!o.enforceMultipleVideos.disableRenderLimits)})),[`${rn}`]:_E(((e,t)=>{let{payload:o}=t;const{type:n,encryptKey:r,additionalType:i}=o,s={encryptKey:r,additionalType:i};"audio"===n?e.audioEncrypt=s:"video"===n?e.videoEncrypt=s:"sharing"===n&&(e.sharingEncrypt=s)})),[`${sn}`]:_E(((e,t)=>{let{payload:o}=t;e.isEnableDecoderInWorklet=o})),[`${an}`]:_E(((e,t)=>{let{payload:o}=t;e.patchedMediaSDKStatus=o})),[`${dn}`]:_E(((e,t)=>{let{payload:o}=t;e.assetsPath=o})),[`${un}`]:_E(((e,t)=>{let{payload:o}=t;e.enableAudioQos=o.audioQos,e.enableVideoQos=o.videoQos})),[`${ln}`]:_E(((e,t)=>{let{payload:o}=t;e.isAudioBridgeReceiveReady=o})),[`${cn}`]:_E(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSendReady=o})),[`${pn}`]:_E(((e,t)=>{let{payload:o}=t;e.isMediaAgentInitialized=o})),[`${hn}`]:_E(((e,t)=>{let{payload:o}=t;e.adaptedABOptionForMediaSDK=o})),[`${mn}`]:e=>({...HI,mediaConstraints:e.mediaConstraints,assetsPath:e.assetsPath,fileWithVersion:e.fileWithVersion,enforceMultipleVideos:e.enforceMultipleVideos,disableRenderLimits:e.disableRenderLimits,enforceVirtualBackground:e.enforceVirtualBackground,alternativeNameForVideoPlayer:e.alternativeNameForVideoPlayer})},HI),WI=new class{constructor(){this.state={mediaSDK:void 0,mediaSDKInstanceMap:new Map,tagName:"video-player",renderCountMap:new Map},this.onceMap=new WeakMap,this.subscribers=[]}get(e){return this.state[e]}dispatch(e,t,o){t&&Object.assign(this.state,t),e&&this.notifySubscribers(e,o)}subscribe(e){return this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);-1!==t&&this.subscribers.splice(t,1)}}once(e,t){this.onceMap.set(t,{event:e,unSubscribe:this.subscribe(t)})}notifySubscribers(e,t){const o=[];this.subscribers.forEach((n=>{n(e,this.state,t);const r=this.onceMap.get(n);if(r){const{event:t,unSubscribe:i}=r;t===e&&(o.push(i),this.onceMap.delete(n))}})),o.forEach((e=>e()))}};var GI,zI;!function(e){e[e.ADD_RENDER_VIDEO=1]="ADD_RENDER_VIDEO",e[e.STOP_RENDER_VIDEO=2]="STOP_RENDER_VIDEO",e[e.START_SHARING=23]="START_SHARING",e[e.STOP_SHARING=24]="STOP_SHARING",e[e.SWITCH_CANVAS_FOR_VIDEO_CAPTURE=25]="SWITCH_CANVAS_FOR_VIDEO_CAPTURE",e[e.UPDATE_SHARING_DECODE_PARAM=44]="UPDATE_SHARING_DECODE_PARAM",e[e.UPDATE_CANVAS_SIZE=46]="UPDATE_CANVAS_SIZE",e[e.ZOOM_RENDER=48]="ZOOM_RENDER",e[e.REMOVE_EXPIRED_CANVAS=76]="REMOVE_EXPIRED_CANVAS",e[e.WEBGL_LOST_REPLACE_CANVAS=77]="WEBGL_LOST_REPLACE_CANVAS",e[e.UPDATE_VIDEO_QUALITY=78]="UPDATE_VIDEO_QUALITY",e[e.SEND_RENDER_LOG=79]="SEND_RENDER_LOG"}(GI||(GI={})),function(e){e[e.WEBGL_LOST_IN_MULTI_VIEW=-32]="WEBGL_LOST_IN_MULTI_VIEW",e[e.MOBILE_CAPTURE_DEVICE_CHANGE=135]="MOBILE_CAPTURE_DEVICE_CHANGE"}(zI||(zI={}));const KI="default-sesssion-key";var qI,JI,QI,ZI;function YI(e,t,o,n,r){const i=document.createElement("canvas");i.id=n;const s=uA(i,e,t);return r(`VPISC:${window.devicePixelRatio},${s}`),i.style.pointerEvents="none",i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.width=e+"px",i.width=e*lA(i),i.style.height=t+"px",i.height=t*lA(i),i.ariaHidden="true",i.style.zIndex=o,i}function XI(e,t){const o=iA((()=>{if(e){uA(e,t.clientWidth,t.clientHeight),[GI.UPDATE_CANVAS_SIZE,GI.UPDATE_SHARING_DECODE_PARAM].forEach((o=>{var n,r;null===(r=nA(null===(n=null==t?void 0:t.getSessionId)||void 0===n?void 0:n.call(t)))||void 0===r||r.Notify_MeidaSDK(o,{width:t.clientWidth*lA(e),height:t.clientHeight*lA(e),canvas:e})})),e.style.width=t.clientWidth+"px",e.style.height=t.clientHeight+"px";try{e.width=t.clientWidth*lA(e),e.height=t.clientHeight*lA(e)}catch(e){}WI.dispatch("resize",void 0,e.id)}}),300),n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),r=new ResizeObserver(o);return n.addEventListener("change",o),r.observe(t),()=>{!function(e){dA.delete(e)}(e),null==r||r.disconnect(),n.removeEventListener("change",o)}}function eA(e,t){Object.defineProperties(e,t.reduce(((t,o)=>(t[o]={get:()=>e.getAttribute(o),set:t=>{t?e.setAttribute(o,t):e.removeAttribute(o)}},t)),{}))}function tA(e,t){Object.entries(t).forEach((([t,o])=>{e.getAttribute(t)||e.setAttribute(t,o)}))}function oA(e,t){const o=e.getAttribute(t);return!(!o||"true"!==o)}function nA(e=KI){var t;return null===(t=WI.get("mediaSDKInstanceMap").get(e))||void 0===t?void 0:t()}function rA(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(o=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===o?n:3&n|8).toString(16)}))}function iA(e,t){let o;return function(...n){clearTimeout(o),o=setTimeout((()=>{e(...n)}),t)}}function sA(e,t){const o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(const n of o){const o=e[n],r=t[n];if("object"==typeof o&&"object"==typeof r){if(!sA(o,r))return!1}else if(o!==r)return!1}return!0}function aA(e){return!e||"0"===e}!function(e){e.Video="video",e.Share="share"}(qI||(qI={})),function(e){e.DEFAULT="",e.MAIN="main"}(JI||(JI={})),function(e){e.Video_90P="0",e.Video_180P="1",e.Video_360P="2",e.Video_720P="3",e.Video_1080P="4"}(QI||(QI={})),function(e){e[e.Unknown=0]="Unknown",e[e.VideoTag=1]="VideoTag",e[e.WebGL=2]="WebGL",e[e.WebGL2=3]="WebGL2",e[e.WebGPU=4]="WebGPU"}(ZI||(ZI={}));const dA=new Map;function uA(e,t,o){const n=t>=2*window.screen.width||o>=2*window.screen.height?1:window.devicePixelRatio,r=dA.get(e);return dA.set(e,n),r&&r!==n&&WI.dispatch("scale",void 0,e.id),n}function lA(e){return dA.get(e)||window.devicePixelRatio}function cA(e,t){t&&(null==e||e.Notify_MeidaSDK(GI.SEND_RENDER_LOG,{message:t}))}function pA(e,t){const o=WI.get("renderCountMap"),n=o.get(e)||0;o.set(e,t?n+1:n-1)}function hA(e,t){const{left:o,top:n,bottom:r,right:i,width:s,height:a}=e.getBoundingClientRect(),d=t.getBoundingClientRect();return{left:o-d.left,top:n-d.top,bottom:d.bottom-r,right:d.right-i,width:s,height:a}}const mA=[];for(let e=0;e<=1;e+=.01)mA.push(e);class vA{constructor(e,t){if(this.getRenderParams=t,this.el=document.createElement("div"),this.position=null,this.id="",this.srcObject=null,this.removePositionObserve=null,this.viewId=`${WI.get("tagName")}-${rA()}`,this.getSDK=()=>{var e,t;return nA(null===(t=null===(e=this.container)||void 0===e?void 0:e.getSessionId)||void 0===t?void 0:t.call(e))},!e)throw new Error(`The ${WI.get("tagName")} must have a ${WI.get("tagName")}-container as its ancestor element.`);this.container=e,this.el.style.width="100%",this.el.style.height="100%",this.debounceUpdateVideoPosition=iA(this.updateVideoPosition.bind(this),300)}getElement(){return this.el}init(){this.removeSubscribe=WI.subscribe(((e,t,o)=>{o===this.getCanvas().id&&("resize"===e?(this.updateVideoPosition(),setTimeout((()=>{this.updateVideoPosition()}),300)):"scale"===e&&cA(this.getSDK(),`VPSC:${lA(this.getCanvas())}`))}))}getCanvas(){return this.container.getCanvas()}initObservePosition(){this.stopObservePosition(),this.removePositionObserve=function(e,t,o){const{wrapper:n=document.documentElement}=o,r=iA(t,300);let i,s;const a=(o=1,s=!1)=>{i&&(i.disconnect(),i=null);const{top:d,left:u,width:l,height:c,right:p,bottom:h}=hA(e,n);if(!l||!c)return void t({hide:!0,cross:!1,width:0,height:0,top:0,left:0,bottom:0,right:0});const m=((e,t,o,n)=>e<0||t<0||o<0||n<0)(d,h,u,p),v=((e,t,o,n,r,i)=>e<=0&&e+i<=0||t<=0&&t+i<=0||o<=0&&o+r<=0||n<=0&&n+r<=0)(d,h,u,p,l,c),g={root:n,threshold:m?mA:o};m||(g.rootMargin=`${-d}px ${-p}px ${-h}px ${-u}px`);let f=!0,y=!0;s&&(y=!1),t({hide:v,cross:m,top:d,left:u,width:l,height:c,bottom:h,right:p}),r({hide:v,cross:m,top:d,left:u,width:l,height:c,bottom:h,right:p},!0),i=new IntersectionObserver((([e])=>{if(0===e.intersectionRatio)return y?a(1,!0):void 0;if(o!==e.intersectionRatio){if(!f)return a();a(0===e.intersectionRatio?1e-7:e.intersectionRatio)}1===e.intersectionRatio&&m&&a(),f=!1}),g),i.observe(e)};return a(),s=new ResizeObserver((()=>a())),s.observe(e),()=>{null==i||i.disconnect(),i=null,null==s||s.disconnect(),s=null}}(this.el,((e,t)=>{t?setTimeout((()=>{this.updateVideoPosition()}),300):this.debounceUpdateVideoPosition(e)}),{wrapper:this.container})}stopObservePosition(){this.removePositionObserve&&(this.removePositionObserve(),this.removePositionObserve=null)}getCurrentPosition(e){return this.transformRectToPosition(hA(e,this.container))}transformRectToPosition(e){const{left:t,width:o,height:n,bottom:r,top:i}=e,s=lA(this.getCanvas());return{x:t*s,y:r*s,width:o*s,height:n*s,left:t*s,bottom:r*s,top:i*s}}playVideo(e){this.initObservePosition(),"string"==typeof e?this.id=e:this.srcObject=e;const t=this.getCurrentPosition(this.el);this.addRender(Object.assign(Object.assign(Object.assign(Object.assign({},t),{canvas:this.getCanvas(),zone:this.viewId,userId:Number(this.id),ssrc:Number(this.id)}),this.getRenderParams()),this.srcObject?{srcObject:this.srcObject}:{})),this.position=t}updateVideoPosition(e){if(!this.id&&!this.srcObject)return;const t=this.transformRectToPosition(e||hA(this.el,this.container));this.position&&sA(t,this.position)||(this.zoomRender(Object.assign(Object.assign(Object.assign(Object.assign({},t),{userId:Number(this.id),canvas:this.getCanvas(),RGBA:this.container.getRGBA(),zone:this.viewId}),this.getRenderParams()),this.srcObject?{srcObject:this.srcObject}:{})),this.position=t)}stopVideo(){this.stopObservePosition(),(this.id||this.srcObject)&&this.position&&((this.id||this.srcObject)&&this.stopRender(Object.assign(Object.assign(Object.assign(Object.assign({},this.position),{userId:Number(this.id),canvas:this.getCanvas(),RGBA:this.container.getRGBA(),zone:this.viewId}),this.getRenderParams()),this.srcObject?{srcObject:this.srcObject}:{})),this.position=null,this.id="",this.srcObject=null)}updateVideoQuality(e){var t;this.id&&(null===(t=this.getSDK())||void 0===t||t.Notify_MeidaSDK(GI.UPDATE_VIDEO_QUALITY,{userId:this.id,videoQuality:e}))}refresh(){this.debounceUpdateVideoPosition()}destroy(){var e;this.stopVideo(),null===(e=this.removeSubscribe)||void 0===e||e.call(this)}}class gA{constructor(e){this.container=e,this.id="",this.srcObject=null,this.getSDK=()=>{var e,t;return nA(null===(t=null===(e=this.container)||void 0===e?void 0:e.getSessionId)||void 0===t?void 0:t.call(e))},this.el=document.createElement("video"),this.el.style.width="100%",this.el.style.height="100%",this.el.setAttribute("autoplay","true"),this.el.setAttribute("muted","true"),this.el.setAttribute("playsinline","true")}getElement(){return this.el}init(){}playVideo(e){"string"==typeof e?this.id=e:this.srcObject=e,this.addRender(Object.assign({userId:Number(this.id),videodom:this.el},this.srcObject?{srcObject:this.srcObject}:{}))}stopVideo(){(this.id||this.srcObject)&&(this.stopRender(Object.assign({userId:Number(this.id),videodom:this.el},this.srcObject?{srcObject:this.srcObject}:{})),this.id="",this.srcObject=null)}updateVideoQuality(e){}destroy(){this.stopVideo()}}class fA extends vA{addRender({width:e,height:t,x:o,y:n,canvas:r,zone:i,userId:s,left:a,bottom:d,top:u,fillMode:l,videoQuality:c}){var p;this.getSDK()&&(pA(this.container,!0),function(e){var t,o;const n=WI.get("renderCountMap").get(e)||0,r=(null===(o=null===(t=null===JsMediaSDK_Instance||void 0===JsMediaSDK_Instance?void 0:JsMediaSDK_Instance.util)||void 0===t?void 0:t.getMaxCountRender)||void 0===o?void 0:o.call(t))||25,i=n>=0&&n<=r,s=WI.get("tagName");i||console.error(`In your environment, the maximum number of ${s} that can be accommodated in each ${s}-container is ${r}. The current number has exceeded this limit, which may cause video rendering issues.`)}(this.container)),null===(p=this.getSDK())||void 0===p||p.Notify_MeidaSDK(GI.ADD_RENDER_VIDEO,{width:e,height:t,x:o,y:n,canvas:r,zone:i,userId:s,left:a,bottom:d,top:u,fillMode:l,videoQuality:c})}zoomRender({width:e,height:t,x:o,y:n,userId:r,canvas:i,RGBA:s,zone:a,left:d,bottom:u,top:l}){var c;null===(c=this.getSDK())||void 0===c||c.Notify_MeidaSDK(GI.ZOOM_RENDER,{width:e,height:t,x:o,y:n,userId:r,canvas:i,RGBA:s,zone:a,left:d,bottom:u,top:l})}stopRender({width:e,height:t,x:o,y:n,userId:r,canvas:i,doNotClean:s,RGBA:a,zone:d,left:u,bottom:l,top:c,videoQuality:p}){var h;this.getSDK()&&pA(this.container,!1),null===(h=this.getSDK())||void 0===h||h.Notify_MeidaSDK(GI.STOP_RENDER_VIDEO,{width:e,height:t,x:o,y:n,userId:r,canvas:i,doNotClean:s,RGBA:a,zone:d,left:u,bottom:l,top:c,videoQuality:p})}}class yA extends gA{addRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(GI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(GI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}class SA extends vA{addRender({width:e,height:t,userId:o,canvas:n,isFromMainSession:r}){var i;null===(i=this.getSDK())||void 0===i||i.Notify_MeidaSDK(GI.START_SHARING,{width:e,height:t,canvas:n,ssrc:o,isFromMainSession:r})}zoomRender(){}stopRender({canvas:e}){var t;null===(t=this.getSDK())||void 0===t||t.Notify_MeidaSDK(GI.STOP_SHARING,{canvas:e})}}class bA extends gA{addRender({userId:e,videodom:t}){var o,n;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(GI.SWITCH_CANVAS_FOR_VIDEO_CAPTURE,[t]),null===(n=this.getSDK())||void 0===n||n.Notify_MeidaSDK(GI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(GI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}class EA{static VERTEX_SHADER="\n attribute vec2 position;\n varying vec2 texCoord;\n\n void main() {\n texCoord = (position + 1.0) * 0.5;\n // gl_Position = vec4(position, 0.0, 1.0);\n gl_Position = vec4(position.x, -position.y, 0.0, 1.0);\n }\n ";static FRAGMENT_SHADER="\n precision mediump float;\n varying vec2 texCoord;\n uniform sampler2D videoTexture;\n\n void main() {\n gl_FragColor = texture2D(videoTexture, texCoord);\n }\n ";constructor(){}preview(e,t,o){const n=t.getContext("webgl"),r=this.#e(n,EA.VERTEX_SHADER,EA.FRAGMENT_SHADER),i=n.getAttribLocation(r,"position"),s=n.getUniformLocation(r,"videoTexture");n.useProgram(r);const a=this.#t(n);n.bindBuffer(n.ARRAY_BUFFER,a),n.enableVertexAttribArray(i),n.vertexAttribPointer(i,2,n.FLOAT,!1,0,0),this.frame({glContext:n,program:r,positionAttributeLocation:i,textureLocation:s,positionBuffer:a,viewport:o,source:e})}frame(e){const t=e.glContext;e.glContext.clearColor(0,0,0,1),e.glContext.clear(e.glContext.COLOR_BUFFER_BIT),e.glContext.viewport(e.viewport.x,e.viewport.y,e.viewport.w,e.viewport.h),e.glContext.enable(e.glContext.DEPTH_TEST);const o=e.glContext.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.uniform1i(e.textureLocation,0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.source),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),e.glContext.drawArrays(e.glContext.TRIANGLE_STRIP,0,4),requestAnimationFrame((()=>this.frame(e)))}#e(e,t,o){const n=this.#o(e,e.VERTEX_SHADER,t),r=this.#o(e,e.FRAGMENT_SHADER,o);let i=e.createProgram();return e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),i}#o(e,t,o){const n=e.createShader(t);return e.shaderSource(n,o),e.compileShader(n),n}#t(e){const t=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),t}}class IA{static VERTEX_SHADER="#version 300 es\n in vec2 position;\n out vec2 texCoord;\n\n void main() {\n texCoord = (position + 1.0) * 0.5;\n gl_Position = vec4(position.x, -position.y, 0.0, 1.0);\n }\n ";static FRAGMENT_SHADER="#version 300 es\n precision mediump float;\n in vec2 texCoord;\n uniform sampler2D videoTexture;\n out vec4 fragColor;\n\n void main() {\n fragColor = texture(videoTexture, texCoord);\n }\n ";constructor(){}preview(e,t,o){const n=t.getContext("webgl2"),r=this.#e(n,IA.VERTEX_SHADER,IA.FRAGMENT_SHADER),i=n.getAttribLocation(r,"position"),s=n.getUniformLocation(r,"videoTexture");n.useProgram(r);const a=this.#t(n);n.bindBuffer(n.ARRAY_BUFFER,a),n.enableVertexAttribArray(i),n.vertexAttribPointer(i,2,n.FLOAT,!1,0,0),this.frame({glContext:n,program:r,positionAttributeLocation:i,textureLocation:s,positionBuffer:a,viewport:o,source:e})}frame(e){const t=e.glContext;e.glContext.clearColor(0,0,0,1),e.glContext.clear(e.glContext.COLOR_BUFFER_BIT),e.glContext.viewport(e.viewport.x,e.viewport.y,e.viewport.w,e.viewport.h),e.glContext.enable(e.glContext.DEPTH_TEST);const o=e.glContext.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.uniform1i(e.textureLocation,0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.source),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),e.glContext.drawArrays(e.glContext.TRIANGLE_STRIP,0,4),requestAnimationFrame((()=>this.frame(e)))}#e(e,t,o){const n=this.#o(e,e.VERTEX_SHADER,t),r=this.#o(e,e.FRAGMENT_SHADER,o);let i=e.createProgram();return e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),i}#o(e,t,o){const n=e.createShader(t);return e.shaderSource(n,o),e.compileShader(n),n}#t(e){const t=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),t}}class AA{static VERTEX_SHADER="\n struct VertexOutput {\n @builtin(position) Position: vec4,\n @location(0) uv: vec2,\n }\n\n @vertex\n fn vert_main(@builtin(vertex_index) VertexIndex: u32) -> VertexOutput {\n var pos = array, 6>(\n vec2( 1.0, 1.0),\n vec2( 1.0, -1.0),\n vec2(-1.0, -1.0),\n vec2( 1.0, 1.0),\n vec2(-1.0, -1.0),\n vec2(-1.0, 1.0)\n );\n\n var uv = array, 6>(\n vec2(1.0, 0.0),\n vec2(1.0, 1.0),\n vec2(0.0, 1.0),\n vec2(1.0, 0.0),\n vec2(0.0, 1.0),\n vec2(0.0, 0.0)\n );\n\n var output : VertexOutput;\n output.Position = vec4(pos[VertexIndex], 0.0, 1.0);\n output.uv = uv[VertexIndex];\n return output;\n }\n ";static FRAG_SHADER_VF="\n @group(0) @binding(0) var mySampler: sampler;\n @group(0) @binding(1) var vfTexture: texture_external;\n\n @fragment\n fn frag_main(@location(0) uv : vec2) -> @location(0) vec4 {\n var color0: vec4 = textureSampleBaseClampToEdge(vfTexture, mySampler, uv);\n return color0;\n }\n ";constructor(){}async preview(e,t,o){if(!e||!t||!o)throw new Error("Invalid arguments: source, target, or viewport is missing");const n=await navigator.gpu.requestAdapter(),r=await n.requestDevice(),i=navigator.gpu.getPreferredCanvasFormat(),s=t.getContext("webgpu");s.configure({device:r,format:i,alphaMode:"opaque"});const a=r.createSampler({}),d=r.createRenderPipeline({layout:"auto",vertex:{module:r.createShaderModule({code:AA.VERTEX_SHADER}),entryPoint:"vert_main"},fragment:{module:r.createShaderModule({code:AA.FRAG_SHADER_VF}),entryPoint:"frag_main",targets:[{format:i}]},primitive:{topology:"triangle-list"}}),u={device:r,context:s,pipeline:d,sampler:a,source:e,viewport:o};this.frame(u)}frame(e){const t=e.device.createCommandEncoder(),o={colorAttachments:[{view:e.context.getCurrentTexture().createView(),loadOp:"clear",storeOp:"store"}]},n=t.beginRenderPass(o);n.setPipeline(e.pipeline);const r=e.device.createBindGroup({layout:e.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:e.sampler},{binding:1,resource:e.device.importExternalTexture({source:e.source})}]});n.setBindGroup(0,r),n.setViewport(e.viewport.x,e.viewport.y,e.viewport.w,e.viewport.h,0,1),n.draw(6),n.end(),e.device.queue.submit([t.finish()]),requestAnimationFrame((()=>this.frame(e)))}}class CA{constructor(){}preview(e,t,o,n){let r=null;1==e?o.srcObject=t:2==e?(r=new EA,r.preview(t,o,n)):3==e?(r=new IA,r.preview(t,o,n)):4==e&&(r=new AA,r.preview(t,o,n))}static getInstance(){return CA.instance||(CA.instance=new CA),CA.instance}}class _A extends vA{constructor(){super(...arguments),this.rendersProxy=CA.getInstance(),this.videoSource=null}createSource(e,t,o){return function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const n=document.createElement("video");return n.width=t,n.height=o,n.loop=!0,n.autoplay=!0,n.muted=!0,n.srcObject=e,yield n.play(),n}))}addRender(e){e.renderType&&e.srcObject&&!this.videoSource&&(this.videoSource&&(this.videoSource=null),this.createSource(e.srcObject,e.width,e.height).then((t=>{this.videoSource=t,this.rendersProxy.preview(e.renderType,this.videoSource,e.canvas,{x:e.x,y:e.renderType===ZI.WebGPU?e.top:e.y,w:e.width,h:e.height})})))}zoomRender(e){e.renderType&&this.videoSource&&(this.videoSource.width!==e.width&&(this.videoSource.width=e.width),this.videoSource.height!==e.height&&(this.videoSource.height=e.height))}stopRender(e){e.renderType&&this.videoSource&&(this.videoSource.srcObject=null,this.videoSource=null)}}class RA extends gA{constructor(){super(...arguments),this.rendersProxy=CA.getInstance()}addRender(e){e.srcObject&&e.videodom&&this.rendersProxy.preview(ZI.VideoTag,e.srcObject,e.videodom)}stopRender(e){e.videodom.srcObject=null}}const wA="node-id",OA="media-type",TA="video-quality",DA="share-source",PA="fill-mode",kA="stop-no-clean",MA="refresh-key";class LA extends HTMLElement{static get observedAttributes(){return[wA,OA,TA,MA]}constructor(){super(),this.container=null,this._srcObject=null,eA(this,LA.customAttributes),this.getRenderParams=this.getParsedParams.bind(this),this.callback=(e,t)=>{e===zI.MOBILE_CAPTURE_DEVICE_CHANGE&&t===this.getAttribute(wA)&&this.initRender()}}initRender(){var e,t,o,n,r;if(this.render&&this.render.destroy(),null===(e=this.getContainer())||void 0===e?void 0:e.useInsideRender()){const e=null===(t=this.getContainer())||void 0===t?void 0:t.getInsideRenderType();if(e===ZI.VideoTag)this.render=new RA(this.getContainer());else{if(![ZI.WebGL,ZI.WebGL2,ZI.WebGPU].includes(e))return void console.error("Inside render type error.");this.render=new _A(this.getContainer(),this.getRenderParams)}return this.shadowRoot&&(this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(this.render.getElement())),this.render.init(),void(this.srcObject&&this.render.playVideo(this.srcObject))}const i=this.getAttribute(wA),s=i&&(null===(o=this.getCurrentMediaSDK())||void 0===o?void 0:o.isPreviewVideotag(i));let a=0;this.getAttribute(OA)===qI.Share?(this.render=new SA(this.getContainer(),this.getRenderParams),a=2):(null===(n=this.getCurrentMediaSDK())||void 0===n?void 0:n.getWebRTCFlag())?(this.render=new yA(this.getContainer()),a=4):s?(this.render=new bA(this.getContainer()),a=1):(this.render=new fA(this.getContainer(),this.getRenderParams),a=3),this.getCurrentMediaSDK()&&cA(this.getCurrentMediaSDK(),`VPREN:${a}`),this.innerHTML="",this.appendChild(this.render.getElement()),this.render.init();const d=this.getAttribute(wA);aA(d)||null===(r=this.render)||void 0===r||r.playVideo(d)}get srcObject(){return this._srcObject}set srcObject(e){var t,o,n,r;!this._srcObject&&e?null===(t=this.render)||void 0===t||t.playVideo(e):this._srcObject&&e?(null===(o=this.render)||void 0===o||o.stopVideo(),null===(n=this.render)||void 0===n||n.playVideo(e)):this._srcObject&&(null===(r=this.render)||void 0===r||r.stopVideo()),this._srcObject=e}getContainer(){return this.container||(this.container=this.closest(`${WI.get("tagName")}-container`)),this.container}getCurrentMediaSDK(){var e,t;return nA(null===(t=null===(e=this.getContainer())||void 0===e?void 0:e.getSessionId)||void 0===t?void 0:t.call(e))}getParsedParams(){var e,t;return{fillMode:oA(this,PA),doNotClean:oA(this,kA),isFromMainSession:"main"===this.getAttribute(DA),videoQuality:this.getAttribute(TA),renderType:null!==(t=null===(e=this.getContainer())||void 0===e?void 0:e.getInsideRenderType())&&void 0!==t?t:ZI.Unknown}}connectedCallback(){var e;this.style.display="block",tA(this,LA.defaultValues),this.initRender(),null===(e=this.getCurrentMediaSDK())||void 0===e||e.addCallback(this.callback),this.removeSubscribe=WI.subscribe(((e,t,o)=>{var n,r,i,s;"failover"===e&&o===((null===(r=null===(n=this.getContainer())||void 0===n?void 0:n.getSessionId)||void 0===r?void 0:r.call(n))||KI)&&(this.initRender(),aA(this.getAttribute(wA))||null===(i=this.render)||void 0===i||i.playVideo(this.getAttribute(wA)),this.srcObject&&(null===(s=this.render)||void 0===s||s.playVideo(this.srcObject)))}))}disconnectedCallback(){var e,t,o;null===(e=this.removeSubscribe)||void 0===e||e.call(this),null===(t=this.render)||void 0===t||t.destroy(),this.callback&&(null===(o=this.getCurrentMediaSDK())||void 0===o||o.removeCallback(this.callback))}attributeChangedCallback(e,t,o){var n,r,i,s,a;if(this.render)switch(e){case wA:(null===(n=this.getCurrentMediaSDK())||void 0===n?void 0:n.getWebRTCFlag())||Boolean(null===(r=this.getCurrentMediaSDK())||void 0===r?void 0:r.isPreviewVideotag(o))!==this.render instanceof bA&&this.initRender(),aA(t)&&!aA(o)?this.render.playVideo(o):aA(t)||aA(o)?aA(t)||this.render.stopVideo():(this.render.stopVideo(),this.render.playVideo(o));break;case OA:this.initRender();break;case TA:null===(i=this.render)||void 0===i||i.updateVideoQuality(o);break;case MA:aA(o)||null===(a=null===(s=this.render)||void 0===s?void 0:s.refresh)||void 0===a||a.call(s)}}}LA.customAttributes=[wA,OA,TA,DA,PA,kA,MA],LA.defaultValues={[wA]:"",[OA]:qI.Video};const NA="session-id",VA="z-index",UA="inside-render",jA="label";class xA extends HTMLElement{static get observedAttributes(){return[NA,VA,UA]}constructor(){super(),this.canvasId="video-player-canvas-"+(this.getAttribute(jA)?`${this.getAttribute(jA)}-`:"")+rA(),this.needInitCanvas=!1,this.callback=null,eA(this,xA.customAttributes);const e=this.attachShadow({mode:"open"}),t=document.createElement("slot");this.appendCanvas=o=>{e.insertBefore(o,t)},e.appendChild(t)}connectedCallback(){this.style.display="block",this.style.position||(this.style.position="relative"),tA(this,xA.defaultValues),this.needInitCanvas&&this.initCanvasEvents(),this.removeSubscribe=WI.subscribe(((e,t,o)=>{"failover"===e&&o===(this.getSessionId()||KI)&&(this.replaceCanvas(),this.initCanvasEvents())}))}disconnectedCallback(){var e,t,o,n;null===(e=this.removeListener)||void 0===e||e.call(this),null===(t=this.removeSubscribe)||void 0===t||t.call(this),this.canvas&&(null===(o=nA(this.getSessionId()))||void 0===o||o.Notify_MeidaSDK(GI.REMOVE_EXPIRED_CANVAS,{canvasId:this.canvasId}),this.canvas.remove(),this.canvas=void 0),this.callback&&(null===(n=nA(this.getSessionId()))||void 0===n||n.removeCallback(this.callback))}attributeChangedCallback(e,t,o){e===VA&&this.canvas&&o&&(this.canvas.style.zIndex=o)}adoptedCallback(){}createCanvas(){this.getCurrentMediaSDK()&&cA(this.getCurrentMediaSDK(),"VPCC"),this.canvas=YI(this.clientWidth,this.clientHeight,this.getAttribute(VA)||"",this.canvasId,(e=>cA(this.getCurrentMediaSDK(),e))),this.appendCanvas(this.canvas),this.isConnected?this.initCanvasEvents():this.needInitCanvas=!0}initCanvasEvents(){var e;this.removeListener=XI(this.canvas,this),this.callback=(e,t)=>{var o,n;e===zI.WEBGL_LOST_IN_MULTI_VIEW&&t.replaceCanvas&&t.canvasId===(null===(o=this.canvas)||void 0===o?void 0:o.id)&&(this.replaceCanvas(),null===(n=nA(this.getSessionId()))||void 0===n||n.Notify_MeidaSDK(GI.WEBGL_LOST_REPLACE_CANVAS,{canvasId:this.canvasId,canvas:this.canvas}))},null===(e=this.getCurrentMediaSDK())||void 0===e||e.addCallback(this.callback)}replaceCanvas(){var e;if(this.getCurrentMediaSDK()&&cA(this.getCurrentMediaSDK(),"VPRC"),this.canvas){null===(e=this.removeListener)||void 0===e||e.call(this);const t=YI(this.clientWidth,this.clientHeight,this.getAttribute(VA)||"",this.canvasId,(e=>cA(this.getCurrentMediaSDK(),e)));this.removeListener=XI(t,this),this.shadowRoot&&this.shadowRoot.replaceChild(t,this.canvas),this.canvas=t}}getCanvas(){return this.canvas||this.createCanvas(),this.canvas}useInsideRender(){return null!==this.getAttribute(UA)&&void 0!==this.getAttribute(UA)&&"false"!==this.getAttribute(UA)&&"0"!==this.getAttribute(UA)}getInsideRenderType(){return Number(this.getAttribute("inside-render-type"))}getSessionId(){return this.getAttribute(NA)||void 0}getCurrentMediaSDK(){return nA(this.getSessionId())}getRGBA(){return function(e){let t=0,o=0,n=0,r=0;if("r"===e[0])if("a"===e[3]){const i=e.slice(5,-1).split(",").map((e=>parseInt(e.trim(),10)));t=i[0],o=i[1],n=i[2],r=i[3]}else{const r=e.slice(4,-1).split(",").map((e=>parseInt(e.trim(),10)));t=r[0],o=r[1],n=r[2]}else if("#"===e[0]){let r=e.slice(1);3===r.length&&(r=r.split("").map((e=>e.repeat(2))).join(""));const i=parseInt(r,16);t=i>>16&255,o=i>>8&255,n=255&i}return{R:t/255,G:o/255,B:n/255,A:r}}(getComputedStyle(this).getPropertyValue("background-color"))}}function BA(e){const{audio:{isBackgroundNoiseSuppression:t,originalSound:o,highBitrate:n}}=e,r={currentSelect:Pd.Denoise},i={highfidelity:!1,stereo:!1};if(o){Object.assign(r,{currentSelect:Pd.OriginalSound});const e={};"boolean"==typeof o?Object.assign(e,i):Object.assign(e,{highfidelity:!!o.hifi,stereo:!!o.stereo}),Object.assign(r,{originalSound:e})}return Object.assign(r,{backgroundNoiseSuppression:t?Dd.Zoom:Dd.Browser,highBitrate:n}),r}function FA(e,t,o,n){const{meeting:{userId:r},audio:{localShareAudioUserMutedList:i},share:{isReceiveSharingFromMainSession:s}}=n;return i.filter((e=>e.userId!==t)).forEach((t=>{e.setSharingAudioVolume(t.userId,!0,t.isFromMainSession)})),e.setSharingAudioVolume(t,o,!!s),t===r?sh(o):nh({userId:t,muted:o})}async function HA(e,t,o){var n,r;const{audio:{audioSsrc:i,activeMicrophone:s,activeSpeaker:a,isAllowToTalk:d,customizeAudioOption:{speakerOnly:u,mute:l,microphoneId:c,speakerId:p},isUsingMediaPlayback:h,mediaPlaybackFile:m,isHIDEnabled:v,microphoneDevicesList:g,isVerifiedAudioPermissionOnIOSMobile:f,speakerDevicesList:y},meeting:{svcUrl:S,conId:b,reportDomain:E,isAudioBridgeEnabled:I,userId:A,supportLocalAB:C,abToken:_}}=t,R=Ip(t),w=!!u||ap(R.userRole)&&!d,O=null!=o?o:!w;Ki()&&(I||console.warn("Cannot start audio due to the service is not ready."),await Fe(Qf(t,!O)).then((e=>{let[t,o]=e;return t&&o?Promise.resolve():Promise.reject()})));let T=s,D=a;if(void 0!==c||void 0!==p){let e=g,t=y;if(0===g.length){const{microphones:o,speakers:n}=await Fe(xf());e=o,t=n}c&&e.findIndex((e=>e.deviceId===c))>-1&&(T=c),p&&t.findIndex((e=>e.deviceId===p))>-1&&(D=p)}if(h&&null!=m&&m.url){const e=ty.getInstance();await e.setAudioElement(m),T=e.audioElement}else ty.getInstance().stopAudioElement();return w&&!f&&zi.isIOSMobile&&await async function(){await navigator.mediaDevices.getUserMedia({audio:!0})}(),null===(n=e.joinComputerAudio(i,T,D,O,BA(t),Ki()?{rwgHost:S,cid:b,nginxHost:E,abToken:_,supportLocalAB:C,useWebRTCOnDesktop:!zi.isAndroidOrIOSBrowser}:void 0,v?{microphoneLabel:null===(r=g.find((e=>e.deviceId===s)))||void 0===r?void 0:r.label,defaultMuted:!(null==R||!R.muted)}:void 0))||void 0===n?void 0:n.then((()=>{l&&(Ns.createAgent().mute(A,!0),e.muteAudio()),null!=R&&R.muted?e.muteAudio():e.unmuteAudio()}))}async function $A(e,t,o){const n=[],{audio:{isJoinComputerAudioBeforeSharingAudio:r,mutedBeforeSharingAudio:i}}=o,s=Ip(o);return!0===r&&(await HA(e,o),n.push(rh(void 0)),!1===i&&(n.push(Ih(Ba.SharingAudio)),t.mute(s.userId,!1)),n.push(th(void 0))),n}async function WA(e,t,o){const{audio:{isSharingAudio:n},meeting:{userId:r}}=o,i=[];if(i.push(FA(e,r,!0,o)),n){await e.leaveSharingAudio(!1),i.push(ah(!1));const n=await $A(e,t,o);i.push(...n),setTimeout((()=>{Dc(Vu,{state:"off"})}),0)}return i.push(ih(!1)),i}async function GA(e,t,o){const{audio:{audioSsrc:n,activeMicrophone:r,activeSpeaker:i},meeting:{svcUrl:s,conId:a,reportDomain:d,supportLocalAB:u,abToken:l}}=o,c=Ip(o),p=[];if(!qA()){const t=await async function(e,t){const o=[],n=Ip(t),{audio:{isMicrophoneForbidden:r}}=t;return(null==n?void 0:n.audio)===Ad.Computer&&(o.push(rh(!0)),o.push(th(n.muted)),n.muted||e.muteAudio(),await e.leaveComputerAudio(),o.push(zp(0)),r&&o.push(Gp(!1))),o}(e,o);p.push(...t)}return await e.leaveSharingAudio(!0),await e.joinSharingAudio({ssrc:n,microphoneDeviceId:r,speakerDeviceId:i,isCaptureAudio:ap(c.userRole),audioBridge:Ki()?{rwgHost:s,cid:a,nginxHost:d,abToken:l,supportLocalAB:u,useWebRTCOnDesktop:!zi.isAndroidOrIOSBrowser}:void 0}),p.push(ih(!0)),p.push(ah(!0)),p.push(FA(e,c.userId,!1,o)),p.findIndex((e=>e.type===`${rh}`&&!0===e.payload))>-1&&(p.push(Eh(xa.SharingAudio)),t.mute(o.meeting.userId,!0)),setTimeout((()=>{Dc(Vu,{state:"on"})}),0),p}xA.customAttributes=[],xA.defaultValues={};const zA=()=>{if(Zi())return!0;{var e;let{browser:o}=zi;if(o=null===(e=o)||void 0===e?void 0:e.toLocaleLowerCase(),o.indexOf("safari")>-1&&-1===o.indexOf("ios-safari")){var t;const e=null===(t=navigator.userAgent.match(/version\/(\d+\.?\d+)/i))||void 0===t?void 0:t[1];return mr(e||"","15.2")>=0&&mr(e||"","17.1")<0}return!1}};function KA(e,t,o){for(let n=0;ne.userId===r));o&&(o.displayName=i,t.splice(t.indexOf(r),1))}}}function qA(){return Hs.isSupportOpenMicWhenShareAudio()}function JA(e){return Hs.isSupportAudioDenoise(e)}function QA(){return Hs.isSupportStereoAudio()}function ZA(){var e;return"function"==typeof(null===(e=window.navigator.hid)||void 0===e?void 0:e.requestDevice)}function YA(e,t,o){const{audio:{isAllowToTalk:n,customizeAudioOption:r},media:{audioDecodeStatus:i,audioEncodeStatus:s}}=e;return{encodeInitStatus:ap(t.userRole)&&!n||o||null!=r&&r.speakerOnly||Ki()?"success":s,decodeInitStatus:Ki()?"success":i}}function XA(e,t,o){Ki()?Qf(t,o).subscribe((t=>{let[o,n]=t;o&&n&&e.joinOrLeaveVoip(!0)})):e.joinOrLeaveVoip(!0)}const eC=Ns.createAgent(),tC=Gf(vb(Hs.getInstance())),oC=e=>!e.muted,nC=Ns.createAgent(),rC=Gf(vb(Hs.getInstance())),iC=Ns.createAgent(),sC=Gf(vb(Hs.getInstance())),aC={asnIds:{asn1:{userId:0,displayName:null},asn2:{userId:0,displayName:null},asn3:{userId:0,displayName:null}},microphoneDevicesList:[],speakerDevicesList:[],activeMicrophone:"default",activeSpeaker:"default",isMicrophoneForbidden:!1,audioSsrc:0,bCanUnmute:!1,bMutedUponEntry:!1,isAllowToTalk:void 0,dialout:[],crcDevice:[],canPlayAudio:!1,mutedSource:void 0,unmutedSource:void 0,isUserGrantCaptureAudio:!1,webrtcRestartCount:0,isComputerAudioLoading:!1,isUsingMediaPlayback:!1,customizeAudioOption:{},localShareAudioUserMutedList:[],locallyMutedAudioList:[],localUserAudioVolumeList:[],isStopAllImcomingAudio:!1,statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,bandwidth:0,bitrate:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,bandwidth:0,bitrate:0}}},dC=ko({[`${Up}`]:_E(((e,t)=>{let{payload:o}=t;e.asnIds={...o}})),[`${jp}`]:_E(((e,t)=>{let{payload:o}=t;e.bCanUnmute=o})),[`${xp}`]:_E(((e,t)=>{let{payload:o}=t;const{sequence:n,phoneNumber:r}=o;-1===e.dialout.findIndex((e=>e.sequence===n))&&e.dialout.push({sequence:n,phoneNumber:r,returnCode:-1,uuid:My()})})),[`${Bp}`]:_E(((e,t)=>{let{payload:o}=t;const{sequence:n,code:r,nodeId:i}=o,s=e.dialout.find((e=>e.sequence===n));s&&(s.returnCode=r,i&&(s.phoneNodeId=i))})),[`${Fp}`]:_E(((e,t)=>{let{payload:o}=t;e.isAllowToTalk=o,e.isAllowToTalkAttendeeConnected=!1})),[`${Eh}`]:_E(((e,t)=>{let{payload:o}=t;e.mutedSource=o})),[`${Ih}`]:_E(((e,t)=>{let{payload:o}=t;e.unmutedSource=o})),[`${Hp}`]:_E(((e,t)=>{let{payload:o}=t;e.audioSsrc=o})),[`${$p}`]:_E(((e,t)=>{let{payload:o}=t;e.bMutedUponEntry=o})),[`${Wp}`]:_E(((e,t)=>{let{payload:o}=t;e.isUserGrantCaptureAudio=o})),[`${Gp}`]:_E(((e,t)=>{let{payload:o}=t;e.isMicrophoneForbidden=o})),[`${zp}`]:_E(((e,t)=>{let{payload:o}=t;e.webrtcRestartCount=o})),[`${Kp}`]:_E(((e,t)=>{let{payload:o}=t;e.microphoneDevicesList=o})),[`${qp}`]:_E(((e,t)=>{let{payload:o}=t;e.speakerDevicesList=o})),[`${Jp}`]:_E(((e,t)=>{let{payload:o}=t;e.activeMicrophone=o})),[`${Qp}`]:_E(((e,t)=>{let{payload:o}=t;e.activeSpeaker=o})),[`${Zp}`]:_E(((e,t)=>{let{payload:o}=t;e.canPlayAudio=o})),[`${Xp}`]:_E(((e,t)=>{let{payload:o}=t;e.isComputerAudioLoading=o})),[`${mh}`]:_E(((e,t)=>{let{payload:o}=t;if(o){const{speakerOnly:t,mute:n,backgroundNoiseSuppression:r,originalSound:i,syncButtonsOnHeadset:s,mediaFile:a,microphoneId:d,speakerId:u,highBitrate:l}=o;e.customizeAudioOption.speakerOnly=t,e.customizeAudioOption.mute=n,e.customizeAudioOption.microphoneId=d,e.customizeAudioOption.speakerId=u,e.isBackgroundNoiseSuppression=!!r,e.isHIDEnabled=!!s,e.originalSound=i,e.highBitrate=!!l,gr(e.mediaPlaybackFile,a)||(e.mediaPlaybackFile=a,e.isUsingMediaPlayback=!(null==a||!a.url)),n&&(e.mutedSource=xa.Inherited)}})),[`${eh}`]:_E(((e,t)=>{let{payload:o}=t;e.isAllowToTalkAttendeeConnected=o})),[`${th}`]:_E(((e,t)=>{let{payload:o}=t;e.mutedBeforeSharingAudio=o})),[`${ah}`]:_E(((e,t)=>{let{payload:o}=t;e.isSharingAudio=o})),[`${sh}`]:_E(((e,t)=>{let{payload:o}=t;e.isShareAudioMuted=o})),[`${oh}`]:_E(((e,t)=>{let{payload:o}=t;const{userId:n,isFromMainSession:r}=o;-1===e.localShareAudioUserMutedList.findIndex((e=>e.userId===n))&&e.localShareAudioUserMutedList.push({userId:n,isFromMainSession:r,muted:!1})})),[`${nh}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.localShareAudioUserMutedList.find((e=>e.userId===o.userId));n&&(n.muted=o.muted)})),[`${rh}`]:_E(((e,t)=>{let{payload:o}=t;e.isJoinComputerAudioBeforeSharingAudio=o})),[`${ih}`]:_E(((e,t)=>{let{payload:o}=t;e.isShareAudioEnabled=o})),[`${dh}`]:_E(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${uh}`]:_E(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${lh}`]:_E(((e,t)=>{let{payload:o}=t;-1===e.locallyMutedAudioList.findIndex((e=>e===o))&&e.locallyMutedAudioList.push(o)})),[`${ch}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.locallyMutedAudioList.findIndex((e=>e===o));-1!==n&&e.locallyMutedAudioList.splice(n,1)})),[`${ph}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.localUserAudioVolumeList.find((e=>e.userId===o.userId));n?n.volume=o.volume:e.localUserAudioVolumeList.push(o)})),[`${hh}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.localUserAudioVolumeList.findIndex((e=>e.userId===o.userId));-1!==n&&e.localUserAudioVolumeList.splice(n,1)})),[`${vh}`]:_E(((e,t)=>{let{payload:o}=t;e.isBackgroundNoiseSuppression=o})),[`${gh}`]:_E(((e,t)=>{let{payload:o}=t;e.isHIDEnabled=o})),[`${fh}`]:_E(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${yh}`]:_E(((e,t)=>{let{payload:o}=t;e.isStopAllImcomingAudio=o})),[`${Sh}`]:_E(((e,t)=>{let{payload:o}=t;e.isVerifiedAudioPermissionOnIOSMobile=o})),[`${bh}`]:_E(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSignalReconnecting=o})),[`${Ah}`]:_E(((e,t)=>{let{payload:o}=t;e.originalSound=o})),[`${Ch}`]:_E(((e,t)=>{let{payload:o}=t;e.leaveAudioSource=o})),[`${_h}`]:_E(((e,t)=>{let{payload:o}=t;e.secondaryAudioMicrophoneId=o})),[`${Rh}`]:_E(((e,t)=>{let{payload:o}=t;const{sequence:n,ip:r,protocol:i}=o;-1===e.crcDevice.findIndex((e=>e.sequence===n))&&e.crcDevice.push({sequence:n,ip:r,protocol:i,transId:0,uuid:My()})})),[`${wh}`]:_E(((e,t)=>{let{payload:o}=t;const{sequence:n,transID:r,result:i}=o,s=e.crcDevice.find((e=>e.sequence===n));s&&Object.assign(s,{transId:r,returnCode:i})})),[`${Yp}`]:(e,t)=>{let{dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:s,originalSound:a,highBitrate:d,isHIDEnabled:u,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}=e,{payload:f}=t;return f?{...aC,dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:{...aC.customizeAudioOption,speakerOnly:s.speakerOnly},originalSound:a,highBitrate:d,isHIDEnabled:u,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}:{...aC}}},aC),uC={dialEpics0:(e,t)=>yn(e,8198).pipe(Tt(t),mt((e=>{let[t,o]=e;return o.audio.dialout.map((e=>e.sequence)).includes(t.payload.seq)})),Xe((e=>{let[t,o]=e;const{payload:{seq:n,body:{phoneNodeID:r,result:i}}}=t,s=[Bp({code:i,sequence:n,nodeId:r})],{audio:{dialout:a}}=o,d=a.find((e=>e.sequence===n)),u={code:i};if(d&&(Object.assign(u,{phoneNumber:d.phoneNumber,uuid:d.uuid}),r&&Object.assign(u,{userId:r})),Dc(_u,u),i===$a.Success){if(Dc(Ru),r&&wp(o).findIndex((e=>e.userId===r))>-1){var l;const e=null===(l=o.audio.dialout.find((e=>e.sequence===n)))||void 0===l?void 0:l.phoneNumber;e&&(s.push(zc({userId:r,key:"phoneNumber",value:e})),Dc(zs,[{userId:r,phoneNumber:e}]))}}else[$a.Canceling,$a.Canceled,$a.CancelFailed].includes(i)?i===$a.Canceled?Dc(Ou):i===$a.CancelFailed&&Dc(Tu):-1===[$a.Calling,$a.Ringing,$a.Accepted,$a.Success].indexOf(i)&&Dc(wu);return Ue(s)}))),dialEpics1:(e,t)=>yn(e,4120).pipe(Tt(t),mt((e=>{let[t,o]=e;return o.audio.crcDevice.map((e=>e.sequence)).includes(t.payload.seq)})),Xe((e=>{let[t,o]=e;const{payload:{seq:n,body:{result:r,transID:i}}}=t,{audio:{crcDevice:s}}=o,a=[],d=s.find((e=>e.sequence===n));return d&&(Dc(Fu,{code:r,ip:d.ip,protocol:d.protocol,uuid:d.uuid}),a.push(wh({sequence:n,transID:i,result:r}))),r===Ld.Success?Dc(Hu):[Ld.Success,Ld.Ringing].includes(r)||Dc($u),Ue(a)})))},lC={epics0:(e,t)=>yn(e,12033).pipe(Tt(t),ze((e=>{let[t,o]=e;const{participants:{allowTalkAttendeesList:n}}=o,r=t.payload.body;let i={};if(r){const e=wp(o),t=Object.keys(r).map((e=>({key:e,userId:r[e]}))),s=t.map((e=>e.userId));KA(t,s,e),n.length>0&&s.length>0&&KA(t,s,n),i=t.reduce(((e,t)=>({...e,[`${t.key}`]:{userId:t.userId,displayName:t.displayName}})),{}),Dc(fu,Object.values(i))}return Up(i)}))),epics1:(e,t)=>yn(e,16135).pipe(Tt(t),Ot((e=>{let[t,o]=e;const{payload:{body:{id:n,bLeadershipOn:r}}}=t,{audio:{bCanUnmute:i}}=o,s=Ip(o);if(s){const{isHost:e,bCoHost:t,userId:o,audio:a,muted:d}=s,u=e||t;r&&fr(o,n)&&(null!==a&&""!==a&&!0!==d||!u&&!i||Dc(yu,ja.Spotlight))}})),Et(fe)),epics2:(e,t)=>yn(e,12037).pipe(Tt(t),Ot((e=>{let[,t]=e;const o=Ip(t);null!==(null==o?void 0:o.audio)&&""!==(null==o?void 0:o.audio)&&1==(null==o?void 0:o.muted)&&Dc(yu,ja.Unmute)})),Et(fe)),epics3:(e,t)=>yn(e,us).pipe(mt((e=>e.payload.body&&["bCanUnmute","bMutedAll","bMutedUponEntry"].some((t=>void 0!==e.payload.body[t])))),Xe((e=>{const{payload:{body:{bCanUnmute:o,bMutedAll:n,bMutedUponEntry:r}}}=e,i=[];if(void 0!==o&&i.push(jp(e.payload.body.bCanUnmute)),void 0!==n){const o=Ip(t.value);(null==o?void 0:o.audio)!==Ad.Computer&&(null==o?void 0:o.audio)!==Ad.Phone||0!=o.muted||e.payload.body.bMutedAll&&i.push(Eh(xa.PassiveByMuteAll))}return void 0!==r&&i.push($p(e.payload.body.bMutedUponEntry)),Ue(i)}))),epics4:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Lp.Connected})),Xe((e=>{let[o,n]=e;const{payload:{body:{update:r}}}=o;if(null!=r&&r.some((e=>void 0!==e.audio||void 0!==e.muted))){const{meeting:{userId:e}}=n,o=r.filter((t=>t.id!==e)),i=r.filter((t=>t.id===e));if(o&&o.forEach((e=>{Dc(Cu,e)})),i.length>0)return Uf(t).pipe(Xe((e=>{const{audio:{mutedSource:o,unmutedSource:n,isAllowToTalk:r,isShareAudioEnabled:s,isSharingAudio:a,isAudioBridgeSignalReconnecting:d,leaveAudioSource:u,customizeAudioOption:{speakerOnly:l}}}=t.value,c=e;return Ue(i).pipe(dy((async e=>{const t=[];if(e.audio!==c.audio)if(""===e.audio)Dc(Eu,{source:u}),t.push(Ch(void 0));else if(e.audio===Ad.Computer){const e=ap(c.userRole)&&!r||!!l;a&&Dc(Su),e&&(Dc(Su),zi.isIOSMobile&&t.push(Sh(!0))),d&&(Dc(Su),t.push(bh(!1)))}else e.audio===Ad.Phone&&(c.audio===Ad.Computer&&(await tC.leaveComputerAudio(),t.push(Ch(Fa.Pstn)),eC.joinOrLeaveVoip(!1)),Dc(bu));if(""!==c.audio&&e.muted!==c.muted){if(e.muted!==c.muted)if(!0===e.muted){if(o!==xa.Inherited){const e=null!=o?o:xa.PassiveByMuteOne;Dc(Iu,{source:e})}c.audio!==Ad.Computer||s&&!qA()||tC.muteAudio()}else if(!1===e.muted){if(n!==Ba.Inherited){const e=null!=n?n:Ba.Passive;Dc(Au,{source:e})}c.audio===Ad.Computer&&tC.unmuteAudio()}void 0!==e.muted&&t.push(Eh(void 0),Ih(void 0))}return t})))})))}return fe}))),epics5:(e,t)=>yn(e,12036).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=Ip(o),{media:{audioEncodeStatus:r}}=o,{promoterID:i,bAllowTalk:s}=t.payload.body;if((null==n?void 0:n.userId)===i){if(Dc(Nu,s),s)return"success"!==r&&tC.enableAudioEncode(),Vf("audio",r,"success").pipe(Xe((e=>(e&&Dc(yu,ja.AllowToTalk),fe))),Ct(Fp(!0)));if(eC.mute(i,!0),(null==n?void 0:n.audio)===Ad.Computer)return tC.leaveComputerAudio(),ut(300).pipe(Ot((async()=>{(zA()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{HA(tC,o,!1)}))})),Et(fe),Ct(Fp(!1),Eh(xa.Inherited)))}return fe}))),epics6:e=>yn(e,8205).pipe(Ot((e=>{Dc("AUDIO_ALLOW_TO_TALK_RESPONSE",e.payload.body)})),Et(fe)),epics7:(e,t)=>bn(e,24597).pipe(Tt(t),Ot((e=>{let[t,o]=e;const n=Ip(o);(null==n?void 0:n.audio)===Ad.Phone?eC.audioDrop(n.userId):(null==n?void 0:n.audio)===Ad.Computer&&t.payload.body.bPromote})),Et(fe)),epics8:(e,t)=>yn(e,12035).pipe(Tt(t),_t((e=>{let[o,n]=e;const{meeting:{currentUserAudioBeforeReset:r}}=n,{payload:{body:{ssrc:i}}}=o,s=Uf(t).pipe(Xe((e=>{if(r===Ad.Computer&&(null==e||!e.audio)){const{encodeInitStatus:o,decodeInitStatus:n}=YA(t.value,e);return Vf("audio",o,n).pipe(mt((e=>{let[t,o]=e;return t&&o})),Ot((()=>{(zA()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{XA(eC,t.value),HA(tC,t.value)}));const{audio:{locallyMutedAudioList:e,localUserAudioVolumeList:o,isStopAllImcomingAudio:n}}=t.value;e.length>0&&e.forEach((e=>{tC.muteOrUnmuteOtherAudio(e,!0)})),o.length>0&&o.forEach((e=>{tC.adjustOtherAudioVolume(e.userId,e.volume)})),n&&tC.stopAllIncomingAudio(!0)})),yt(ai(void 0)))}return fe})));return Dc(ju,i),ct(je(Hp(i)),s)}))),epics9:(e,t)=>yn(e,7952).pipe(_t((e=>Mc(bu,1).pipe(Tt(t),Ot((t=>{let[,o]=t;const{BindStatus:n,nOperatorUserId:r}=e.payload.body,i=o.participants.attendeesList.find((e=>e.userId===r));!0===n&&Dc(Du,{operatorName:null==i?void 0:i.displayName,operatorUserId:r,operatorRole:null==i?void 0:i.userRole})})),Et(fe))))),epics10:(e,t)=>In(e,Va.UserGrantCaptureAudio).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=Ip(o);var r;(r=n,(null==r?void 0:r.audio)===Ad.Computer?Promise.resolve():kc({event:Ws,operations:[mt((e=>void 0!==e.audio&&""!==e.audio)),ft(1)]},(e=>{let{audio:t}=e;return t===Ad.Phone||t===Ad.Computer}))).then((()=>{Dc(Su)}));const{meeting:{isCurrentUserMutedBeforeReset:i},audio:{bMutedUponEntry:s,isUserGrantCaptureAudio:a,isAllowToTalk:d,activeMicrophone:u}}=o,{payload:{data:l}}=t,c=[Wp(!0)];if(n){!0===n.muted&&!1===d&&(c.push(Eh(xa.Inherited)),eC.mute(n.userId,!0));const e=a||n.isHost||d;(!0===i||!e&&s)&&(c.push(Eh(xa.Inherited)),eC.mute(n.userId,!0),i&&c.push(di(void 0))),l&&u!==l&&c.push(Jp(l))}return Ue(c)}))),epics11:e=>In(e,Va.UserForbiddedCaptureAudio).pipe(Ot((()=>{Dc(Pu)})),yt(Gp(!0))),epics12:e=>In(e,Va.AudioWebsocketBroken).pipe(Ot((()=>{Dc(ku)})),Et(fe)),epics13:(e,t)=>In(e,Va.AudioZeroData).pipe(Tt(t),sy((e=>{let[,t]=e;const{audio:{webrtcRestartCount:o,activeMicrophone:n}}=t;if(o<3)return tC.restoreWebRTC(n),zp(o+1)}))),epics14:(e,t)=>e.pipe($t(`${Zp}`),mt((e=>!1===e.payload)),Xe((()=>(Dc(Mu),vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1))).pipe(Ot((()=>{XA(eC,t.value),HA(tC,t.value)})),yt(Zp(!0))))))),epics15:e=>In(e,[Va.JoinComputerAudioComplete,Va.JoinSharingAudioComplete,Va.LeaveComputerAudioComplete,Va.LeaveSharingAudioComplete]).pipe(Ot((()=>{Wf.completeAudioAction()})),Et(fe)),epics16:(e,t)=>In(e,Va.AudioQosData).pipe(Tt(t),ze((e=>{var t;let[o,n]=e;const{meeting:{isWebinar:r},media:{audioEncodeStatus:i,audioDecodeStatus:s},participants:{xmppAttendeeList:a,allowTalkAttendeesList:d}}=n,u=Ip(n),l=Pp(n);let c=l.length>0,p=l.some(oC);const h=Ki();r&&(c=c||Boolean(a.length),p=p||d.some(oC));const m=((null==u?void 0:u.audio)===Ad.Computer||(null==u?void 0:u.audio)===Ad.Phone)&&("success"===i||h)&&!(null!=u&&u.muted)&&c,v=((null==u?void 0:u.audio)===Ad.Computer||(null==u?void 0:u.audio)===Ad.Phone)&&("success"===s||h)&&c&&p;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?m?(Dc(Uu,o.payload),dh(o.payload)):dh(md):v?(Dc(Uu,o.payload),uh(o.payload)):uh(md)}))),epics17:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[t,o]=e;const{payload:{body:n}}=t,{audio:{locallyMutedAudioList:r,localUserAudioVolumeList:i}}=o;return(r.length>0||i.length>0)&&(null==n?void 0:n.remove)&&n.remove.length>0})),Xe((e=>{let[t,o]=e;const{payload:{body:{remove:n}}}=t,{audio:{locallyMutedAudioList:r,localUserAudioVolumeList:i}}=o,s=r.concat(i.map((e=>e.userId))).filter((e=>-1!==n.indexOf((t=>t.id===e))));return s.length>0?(s.forEach((e=>{tC.muteOrUnmuteOtherAudio(e,!1)})),Ue(s.map((e=>[ch(e),hh({userId:e})])).flat())):fe}))),epics18:(e,t)=>In(e,Va.HidStatusMute).pipe(Xe((e=>{const{payload:{data:o}}=e,n=t.value,{meeting:{userId:r},audio:{isShareAudioEnabled:i,bCanUnmute:s}}=n,a=[];if(o)i&&!qA()&&a.push(th(!0)),a.push(Eh(xa.Active)),eC.mute(r,!0);else if(!i||qA()){i&&a.push(th(!1));const e=Ip(n);(s||null!=e&&e.isHost||null!=e&&e.bCoHost)&&(a.push(Ih(Ba.Active)),eC.mute(r,!1))}return Ue(a)}))),epics19:e=>yn(e,12040).pipe(Ot((e=>{const{payload:{body:{mode:t}}}=e;tC.setAudioCodecMode(t)})),Et(fe)),epics20:(e,t)=>In(e,[Va.AudioSpeakerSetSuccess,Va.JoinComputerAudioComplete,Va.AudioSpeakerSetError]).pipe(Xe((e=>{const{payload:{data:o,type:n}}=e,{audio:{activeSpeaker:r,activeMicrophone:i}}=t.value,s=[];return n===Va.AudioSpeakerSetSuccess&&r!==o?s.push(Qp(o)):n===Va.JoinComputerAudioComplete&&null!==o&&i!==o&&s.push(Jp(o)),n===Va.AudioSpeakerSetSuccess?Dc(xu,!0):n===Va.AudioSpeakerSetError&&Dc(xu,!1),Ue(s)}))),epics21:(e,t)=>In(e,Va.AudioLevelIndicator).pipe(mt((()=>{const e=Ip(t.value);return!!e&&e.audio===Ad.Computer&&!e.muted})),Ot((e=>{const{payload:{data:t}}=e;Dc(Wu,{level:t.value})})),Xe((()=>fe)))},cC=fn(lC,{shareAudioEpics0:(e,t)=>En(e,ds).pipe(mt((e=>{const t=e.payload.body.update;return t&&t.length>0&&t.findIndex((e=>void 0!==e.bShareOn))>-1})),Tt(t),Xe((e=>{let[t,o]=e;const{payload:{body:{update:n}}}=t,{audio:{localShareAudioUserMutedList:r}}=o,i=n.filter((e=>!0===e.bShareOn&&!0===e.bShareAudioOn)),s=[];return i.length>0&&i.forEach((e=>{-1===r.findIndex((t=>t.userId===e.id))&&s.push(oh({userId:e.id,isFromMainSession:!!e.bShareToBORooms}))})),Ue(s)}))),shareAudioEpics1:(e,t)=>In(e,Va.SharingDesktopStreamHaveAudio).pipe(mt((()=>!t.value.audio.secondaryAudioMicrophoneId)),_t((()=>yn(e,ds).pipe(mt((e=>{var o;const{payload:{body:n}}=e,{meeting:{userId:r}}=t.value;return(null==n||null===(o=n.update)||void 0===o?void 0:o.findIndex((e=>e.id===r&&!0===e.bShareOn)))>-1})),ft(1),dy((async()=>{const e=t.value;return await GA(rC,nC,e)})),Ct(ih(!0)))))),shareAudioEpics2:(e,t)=>In(e,Va.SharingDesktopStreamHaveNoAudio).pipe(Tt(t),mt((e=>{var t;let[,o]=e;return!0===(null===(t=o.audio)||void 0===t?void 0:t.isShareAudioEnabled)})),dy((async e=>{let[,t]=e;return await WA(rC,nC,t)}))),shareAudioEpics3:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Lp.Connected&&!0===t.audio.isSharingAudio})),Xe((e=>{var o;let[n,r]=e;if(null!==(o=n.payload.body.update)&&void 0!==o&&o.some((e=>void 0!==e.audio||void 0!==e.muted))){const{meeting:{userId:e}}=r,o=n.payload.body.update.filter((t=>t.id===e));return Uf(t).pipe(Xe((e=>{const t=[];return o.findIndex((e=>e.audio===Ad.Computer))>-1&&(null==e?void 0:e.audio)!==Ad.Computer&&!qA()&&(t.push(rh(!0)),t.push(th(!0))),Ue(t)})))}return fe}))),shareAudioEpics4:(e,t)=>e.pipe($t(`${Lh}`),Le(he),Tt(t),mt((e=>{var t;let[,o]=e;return!0===(null===(t=o.audio)||void 0===t?void 0:t.isShareAudioEnabled)})),dy((async e=>{let[t,o]=e;const{payload:n}=t,{audio:{isShareAudioMuted:r,isSharingAudio:i}}=o,s=[];if(n===qa.End){const e=await WA(rC,nC,o);s.push(...e)}else if(n===qa.Paused){if(!1===r&&!0===i){await rC.leaveSharingAudio(!0),s.push(ah(!1));const e=await $A(rC,nC,o);s.push(...e),setTimeout((()=>{Dc(Vu,{state:"off"})}),0)}}else if(n===qa.Sharing&&!1===r&&!1===i){const e=await GA(rC,nC,o);s.push(...e)}return s}))),shareAudioEpics5:(e,t)=>In(e,Va.SharingDesktopStreamHaveAudio).pipe(mt((()=>!!t.value.audio.secondaryAudioMicrophoneId)),Ot((()=>{const{audio:{audioSsrc:e,secondaryAudioMicrophoneId:o},meeting:{svcUrl:n,conId:r,reportDomain:i,supportLocalAB:s,abToken:a}}=t.value;rC.joinSharingAudio({ssrc:e,microphoneDeviceId:o,speakerDeviceId:null,isCaptureAudio:!0,audioBridge:Ki()?{rwgHost:n,cid:r,nginxHost:i,abToken:a,supportLocalAB:s,useWebRTCOnDesktop:!zi.isAndroidOrIOSBrowser}:void 0}),Dc(Bu)})),Xe((()=>fe)))},{audioBridgEpics0:e=>yn(e,4299).pipe(Ot((e=>{const{payload:t}=e;sC.passThroughRWGMessage(t)})),Et(fe)),audioBridgEpics1:e=>In(e,Va.AudioBridgeReconnectStart).pipe(Xe((()=>(iC.joinOrLeaveVoip(!1),Ue([bh(!0),Ch(Fa.Failover)]))))),audioBridgEpics2:(e,t)=>In(e,Va.AudioBridgeReconnectEnd).pipe(Ot((()=>{XA(iC,t.value)})),Et(fe)),audioBridgEpics3:e=>yn(e,ds).pipe(mt((e=>{var t,o;return Ki()&&((null===(t=e.payload.body.update)||void 0===t?void 0:t.some((e=>void 0!==e.muted)))||(null===(o=e.payload.body.remove)||void 0===o?void 0:o.length)>0)})),Ot((e=>{const{payload:{body:{update:t,remove:o}}}=e;sC.sendUserAudioStatus({update:(t||[]).filter((e=>void 0!==e.muted)).map((e=>({userId:e.id,muted:e.muted}))),remove:(o||[]).map((e=>({userId:e.id})))})})),Et(fe)),audioBridgEpics4:(e,t)=>In(e,Va.NotifyUIFailover).pipe(mt((()=>!t.value.meeting.isMeetingReset&&t.value.meeting.meetingStatus===Di.Joined)),ze((()=>(Dc(Ys,{reason:Ri.Failover}),xr(ki.NotifyUiFailover))))),audioBridgEpics5:(e,t)=>An(e,t).pipe(mt((()=>{const{meeting:{isAudioBridgeEnabled:e,abToken:o}}=t.value;return e&&Ki()&&!!o})),Ot((()=>{const{meeting:{abToken:e,svcUrl:o,reportDomain:n,conId:r,supportLocalAB:i}}=t.value;sC.preInitAudioBridge({abToken:e,rwgHost:o,cid:r,nginxHost:n,supportLocalAB:i,useWebRTCOnDesktop:!zi.isAndroidOrIOSBrowser})})),Et(fe)),audioBridgEpics6:(e,t)=>yn(e,16129).pipe(mt((e=>{const{payload:{body:{bVideoOn:o}}}=e,{meeting:{isAudioBridgeEnabled:n}}=t.value;return n&&Ki()&&!!o})),Ot((e=>{const{payload:{body:{id:t}}}=e;sC.changeActiveVideoSsrc(t)})),Et(fe)),audioBridgEpics7:(e,t)=>In(e,[Va.RecoverWebrtcAudio,Va.AudioStreamFailed]).pipe(Xe((()=>{const e=Ip(t.value),o=[];return(null==e?void 0:e.audio)===Ad.Computer&&(sC.leaveComputerAudio(),zA()?(iC.joinOrLeaveVoip(!1),o.push(Ch(Fa.EndedBySystem)),o.push(zp(0))):HA(sC,t.value)),Ue(o)}))),audioBridgEpics8:e=>In(e,[Va.AudioBridgeFirstRecvData,Va.AudioBridgeCanSendData]).pipe(ze((e=>{const{payload:{type:t}}=e;return t===Va.AudioBridgeFirstRecvData?(Dc(Wl),ln(!0)):(Dc(Gl),cn(!0))}))),audioBridgEpics9:(e,t)=>e.pipe($t(`${Gr}`),mt((()=>!!t.value.meeting.zlkJwtToken)),Ot((()=>{const{meeting:{zlkJwtToken:e}}=t.value;if(e){const{enforce_web_rtc_audio:t,audio_compatible_mode:o}=Er(e);void 0===t&&void 0===o||Vi.set(xi.EnforceWebRTCAudio,1===Number(t)||1===Number(o),Li.Memory)}})),Et(fe))},uC);var pC="object"==typeof global&&global&&global.Object===Object&&global,hC="object"==typeof self&&self&&self.Object===Object&&self,mC=pC||hC||Function("return this")(),vC=mC.Symbol,gC=Object.prototype,fC=gC.hasOwnProperty,yC=gC.toString,SC=vC?vC.toStringTag:void 0,bC=Object.prototype.toString,EC="[object Null]",IC="[object Undefined]",AC=vC?vC.toStringTag:void 0;function CC(e){return null==e?void 0===e?IC:EC:AC&&AC in Object(e)?function(e){var t=fC.call(e,SC),o=e[SC];try{e[SC]=void 0;var n=!0}catch(e){}var r=yC.call(e);return n&&(t?e[SC]=o:delete e[SC]),r}(e):function(e){return bC.call(e)}(e)}function _C(e){return null!=e&&"object"==typeof e}var RC=Array.isArray;function wC(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var OC="[object AsyncFunction]",TC="[object Function]",DC="[object GeneratorFunction]",PC="[object Proxy]";function kC(e){if(!wC(e))return!1;var t=CC(e);return t==TC||t==DC||t==OC||t==PC}var MC,LC=mC["__core-js_shared__"],NC=(MC=/[^.]+$/.exec(LC&&LC.keys&&LC.keys.IE_PROTO||""))?"Symbol(src)_1."+MC:"",VC=Function.prototype.toString;function UC(e){if(null!=e){try{return VC.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var jC=/^\[object .+?Constructor\]$/,xC=Function.prototype,BC=Object.prototype,FC=xC.toString,HC=BC.hasOwnProperty,$C=RegExp("^"+FC.call(HC).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function WC(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!wC(e)||(t=e,NC&&NC in t))&&(kC(e)?$C:jC).test(UC(e));var t}(o)?o:void 0}var GC=WC(mC,"WeakMap"),zC=9007199254740991,KC=/^(?:0|[1-9]\d*)$/;function qC(e,t){var o=typeof e;return!!(t=null==t?zC:t)&&("number"==o||"symbol"!=o&&KC.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=QC}function YC(e){return null!=e&&ZC(e.length)&&!kC(e)}var XC=Object.prototype;function e_(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||XC)}function t_(e){return _C(e)&&"[object Arguments]"==CC(e)}var o_=Object.prototype,n_=o_.hasOwnProperty,r_=o_.propertyIsEnumerable,i_=t_(function(){return arguments}())?t_:function(e){return _C(e)&&n_.call(e,"callee")&&!r_.call(e,"callee")},s_="object"==typeof exports&&exports&&!exports.nodeType&&exports,a_=s_&&"object"==typeof module&&module&&!module.nodeType&&module,d_=a_&&a_.exports===s_?mC.Buffer:void 0,u_=(d_?d_.isBuffer:void 0)||function(){return!1},l_={};l_["[object Float32Array]"]=l_["[object Float64Array]"]=l_["[object Int8Array]"]=l_["[object Int16Array]"]=l_["[object Int32Array]"]=l_["[object Uint8Array]"]=l_["[object Uint8ClampedArray]"]=l_["[object Uint16Array]"]=l_["[object Uint32Array]"]=!0,l_["[object Arguments]"]=l_["[object Array]"]=l_["[object ArrayBuffer]"]=l_["[object Boolean]"]=l_["[object DataView]"]=l_["[object Date]"]=l_["[object Error]"]=l_["[object Function]"]=l_["[object Map]"]=l_["[object Number]"]=l_["[object Object]"]=l_["[object RegExp]"]=l_["[object Set]"]=l_["[object String]"]=l_["[object WeakMap]"]=!1;var c_,p_="object"==typeof exports&&exports&&!exports.nodeType&&exports,h_=p_&&"object"==typeof module&&module&&!module.nodeType&&module,m_=h_&&h_.exports===p_&&pC.process,v_=function(){try{return h_&&h_.require&&h_.require("util").types||m_&&m_.binding&&m_.binding("util")}catch(e){}}(),g_=v_&&v_.isTypedArray,f_=g_?(c_=g_,function(e){return c_(e)}):function(e){return _C(e)&&ZC(e.length)&&!!l_[CC(e)]},y_=Object.prototype.hasOwnProperty;var S_=function(e,t){return function(o){return e(t(o))}}(Object.keys,Object),b_=Object.prototype.hasOwnProperty;function E_(e){if(!e_(e))return S_(e);var t=[];for(var o in Object(e))b_.call(e,o)&&"constructor"!=o&&t.push(o);return t}function I_(e){return YC(e)?function(e,t){var o=RC(e),n=!o&&i_(e),r=!o&&!n&&u_(e),i=!o&&!n&&!r&&f_(e),s=o||n||r||i,a=s?function(e,t){for(var o=-1,n=Array(e);++o-1},T_.prototype.set=function(e,t){var o=this.__data__,n=w_(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this};var D_=WC(mC,"Map");function P_(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function k_(e){var t=-1,o=null==e?0:e.length;for(this.clear();++ta))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var c=-1,p=!0,h=o&nR?new eR:void 0;for(i.set(e,t),i.set(t,e);++c4294966272&e,kR=e=>{let t={R:0,G:0,B:0,A:0};if("string"==typeof e&&e.startsWith("#")){const a=e.slice(1);try{if(3===a.length){const e=Array.from(a).map((e=>e.repeat(2))).map((e=>parseInt(e,16)));t={R:e[0]/255,G:e[1]/255,B:e[2]/255,A:1}}else if(6===a.length||8===a.length){var o,n,r,i,s;const e=null===(o=a.match(/\S{2}/g))||void 0===o?void 0:o.map((e=>parseInt(e,16)));t={R:(null!==(n=null==e?void 0:e[0])&&void 0!==n?n:0)/255,G:(null!==(r=null==e?void 0:e[1])&&void 0!==r?r:0)/255,B:(null!==(i=null==e?void 0:e[2])&&void 0!==i?i:0)/255,A:null!=e&&e[3]?(null!==(s=null==e?void 0:e[3])&&void 0!==s?s:0)/255:1}}}catch(t){console.warn("error color representation:",e)}}else"object"==typeof e&&(t={R:e.R/255,G:e.G/255,B:e.B/255,A:e.A||1});return t};function MR(e){let{captureWidth:t=0,captureHeight:o=0}=e||{};const{hd:n}=e||{};var r,i;return 0!==t&&0!==o||(n&&Hs.isSupportSending720P()?(t=1280,o=720):(t=640,o=360)),{captureWidth:t,captureHeight:o,isCustomizedResolution:!(null==e||!e.captureWidth||!e.captureHeight||(r=t,i=o,Math.abs(Math.floor(r/i*10)-Math.floor(16/9*10))<=1))}}function LR(e,t){return"default"===e||t.some((t=>t.deviceId===e))||[nd.Environment,nd.User,nd.Left,nd.Right].includes(e)}function NR(e,t){if("function"==typeof DOMMatrixReadOnly){const o=new DOMMatrixReadOnly(getComputedStyle(e).transform).scale(-1,1).toString();e.style.transform=o,e.dataset.mirrored=t?"1":"0"}}function VR(e,t,o){const n=[],{video:{videoSsrc:r,activeCamera:i}}=t,{cameraId:s=i,videoElement:a,originalRatio:d,ptz:u,hd:l,fullHd:c,mediaFile:p,fps:h,mirrored:m}=o||{};let v;if(void 0!==a){let e=a instanceof HTMLVideoElement?a:null;if("string"==typeof a){let[t,o]=[document.body,a];if(a.indexOf(">")>-1){const[e,n]=a.split(">");t=document.querySelector(e),o=n}t&&(e=t.querySelector(o))}if(!e)return[];v=e,e.id||(e.id=Sr("__ZOOM_SDK_SELF_VIDEO_@__")),m&&"1"!==e.dataset.mirrored&&NR(e,m)}let g=null!=h?h:Od.Default;g=Math.max(Od.Min,g),g=Math.min(Od.Max,g);const{captureWidth:f,captureHeight:y,isCustomizedResolution:S}=MR(o);if(S)e.updateVideoHDValue(!1);else{e.updateVideoHDValue(!!l||!!c);const t=!!c&&Hs.isSupportFullHDVideo();e.updateVideoFullhdValue(t)}let b=Promise.resolve(s);if(p&&p.url){const e=ty.getInstance();b=e.setVideoElement(p).then((()=>e.videoElement))}else ty.getInstance().stopVideoElement();return b.then((t=>{e.startCaptureVideo(r,t,f,y,v,zi.isAndroidOrIOSBrowser&&rd.includes(t),!d&&function(){var e,t;const{isAndroidOrIOSBrowser:o,isFirefox:n,isSafari:r}=zi;return o||!(null!==(e=navigator.mediaDevices)&&void 0!==e&&null!==(t=e.getSupportedConstraints)&&void 0!==t&&t.call(e).aspectRatio)||n||r||Zi()}(),u,g)})),n.push(Bm({cameraId:s,captureWidth:f,captureHeight:y,videoElement:"string"==typeof a?a:a instanceof HTMLVideoElement?_r(a):void 0,originalRatio:d,ptz:u,hd:l,fullHd:c,mediaFile:p,fps:g,mirrored:m})),n}function UR(e,t,o){const{max:n,min:r,step:i}=e;let s=o/100*(n-r);i&&(s=Math.min(Math.floor(s/i)*i,Math.floor(s)));let a=t+s;return a=Math.min(n,a),a=Math.max(r,a),a}function jR(e,t){let o="",n=t;switch(e){case fd.Down:n=-t,o="tilt";break;case fd.Up:o="tilt";break;case fd.Left:n=-t,o="pan";break;case fd.Right:o="pan";break;case fd.ZoomIn:o="zoom";break;case fd.ZoomOut:n=-t,o="zoom"}return{key:o,range:n}}function xR(e){const t=["pan","tilt","zoom"].reduce(((t,o)=>e[o]&&0!==e[o].value?{...t,[o]:e[o].value}:t),{});return function(e){if(null==e)return!0;if(YC(e)&&(RC(e)||"string"==typeof e||"function"==typeof e.splice||u_(e)||f_(e)||i_(e)))return!e.length;var t=Y_(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(e_(e))return!E_(e).length;for(var o in e)if(DR.call(e,o))return!1;return!0}(t)?null:t}function BR(e){return{pan:(e&yd.Pan)===yd.Pan,tilt:(e&yd.Tilt)===yd.Tilt,zoom:(e&yd.Zoom)===yd.Zoom}}function FR(e){const{isAndroidBrowser:t,isIOSMobile:o,isFirefox:n,isSupportImageCapture:r,isSupportMediaStreamTrackProcessor:i,isSupportOffscreenCanvas:s}=zi,a=t&&!n,d="function"!=typeof window.SharedArrayBuffer&&a;return o&&"function"==typeof VideoFrame||d||!Ji()&&!e&&!Hf()&&(r||i)&&s}function HR(){var e,t;return"orientation"in window.screen?null===(e=screen.orientation.type)||void 0===e?void 0:e.startsWith("landscape"):"orientation"in window?90===Math.abs(window.orientation):"matchMedia"in window?!(null===(t=window.matchMedia("(orientation: landscape)"))||void 0===t||!t.matches):screen.availWidth>screen.availHeight}function $R(e,t,o){const{meeting:{userId:n},video:{isSupportHDVideo:r,renderedVideoList:i,maximumNumbeOfHDSubscriptions:s,receivedVideoMaxQuality:a}}=o,d=e===n;let u=t;if(t>=Ja.Video_720P)if(r){const t=i.filter((e=>e.videoQuality===Ja.Video_720P)).map((e=>e.userId)),o=null!=s?s:1;t.length>=o&&(t.includes(e)||d||(console.warn(`Warning: Web Video SDK currently only supports subscribing to ${o} 720p video stream, so quality has been downgraded to 360p`),u=Ja.Video_360P))}else console.warn("Can not subscribe 720P video stream,will downgrade to 360P stream"),u=Ja.Video_360P;const l=Math.max(a,Ja.Video_360P);return[u,Math.min(u,l)]}const WR=Ns.createAgent(),GR=vb(Hs.getInstance());let zR,KR;async function qR(e,t,o){const n=Sr(e),r=document.createElement("img");return r.src=t,r.id=n,r.style.display="none",br(t)&&r.setAttribute("crossorigin",""),await new Promise(((e,n)=>{r.onload=()=>{o&&URL.revokeObjectURL(t),e("")},r.onerror=()=>{o&&URL.revokeObjectURL(t),n("Cannot load image.")}})),{imageId:n,imgElement:r}}async function JR(e,t,o){if(e===od)return od;{let n=e;if(t){const t=await function(e){return new Promise(((t,o)=>{try{zR&&KR||(zR=document.createElement("canvas"),KR=zR.getContext("2d"));const n=zR,r=KR;if(r){r.clearRect(0,0,zR.width,zR.height);const i=new Image;i.src=e,br(e)&&(i.crossOrigin="");const s=16/9,a=1280,d=Math.floor(a/s);n.width=a,n.height=d,i.onload=()=>{const{width:e,height:u}=i,l=u*s;if(l>e){const t=e,o=Math.floor(e/s),n=0,l=(u-o)/2;null==r||r.drawImage(i,n,l,t,o,0,0,a,d)}else{const t=l,o=u,n=(e-t)/2,s=0;r.drawImage(i,n,s,t,o,0,0,a,d)}try{n.toBlob((e=>{t(e)}))}catch(e){e instanceof DOMException&&e.code===DOMException.SECURITY_ERR&&console.error("Image is not from the same origin, add CORS header to solve this issue"),o(e)}},i.onerror=e=>{o("Cannot load image.")}}}catch(e){o(e)}}))}(e);n=URL.createObjectURL(t)}if(n){const{imageId:e,imgElement:r}=await qR(ud,n,!!t);return(null!=o?o:document.body).appendChild(r),e}}return null}async function QR(e,t,o){var n;const r=null!==(n=o&&o.parentNode)&&void 0!==n?n:document.body,{imageUrl:i,cropped:s,rootWidth:a,rootHeight:d}=e;let u=e;!t.video.customizedVideoOption||e.captureWidth&&e.captureHeight||(u=t.video.customizedVideoOption);const{captureWidth:l,captureHeight:c}=MR(u),p=document.createElement("div");let h;p.style.display="none",h=i?await JR(i,s,p):null;let m,v=Sr(dd);if(o){const t=Ff(o);t.id?v=t.id:t.id=v,m=t;try{a&&o.width!==a&&(o.width=a),d&&o.height!==d&&(o.height=d)}catch(e){console.warn("Cannot set the canvas width/height, and pay attention the canvas dimension is different from the setting")}}else{const e=document.createElement("canvas");e.width=null!=a?a:380,e.height=null!=d?d:214,e.id=v,m=e,p.appendChild(e)}return null==r||r.appendChild(p),{captureWidth:l,captureHeight:c,imageId:h,canvas:m,divElement:p}}async function ZR(e,t,o,n){const r=Array.isArray(e)?e:e&&[e];if((null==r?void 0:r.length)>0){zR&&KR||(zR=document.createElement("canvas"),KR=zR.getContext("2d"));const i=zR,s=KR;if(i.width=t,i.height=o,s)try{s.fillStyle="#fff",s.clearRect(0,0,t,o);for(let e=0;e{a.onload=()=>{e("")},a.onerror=()=>{t()}}));const{width:d,height:u}=a;s.drawImage(a,0,0,d,u,n,i,o,r)}}const e=await new Promise((e=>{null==i||i.toBlob((t=>{e(t)}))}));if(e){const t=URL.createObjectURL(e),{imageId:o,imgElement:r}=await qR(ld,t,!0);return(null!=n?n:document.body).appendChild(r),o}}catch(e){e instanceof DOMException&&e.code===DOMException.SECURITY_ERR&&console.error("Image is not from the same origin, add CORS header to solve this issue")}}return null}function YR(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;const o=Array.isArray(e)?[...e]:[e],n=Array.isArray(t)?[...t]:[t];if(o.length!==n.length)return!1;const r=(e,t)=>e.typee)))}(i)).then((i=>i?n||!s&&e.imageUrl!==od&&e.imageUrl?async function(e,t,o,n){const{canvas:r,imageId:i,captureHeight:s,captureWidth:a,divElement:d}=await QR(e,o,n),{cameraId:u}=e,{video:{videoSsrc:l,activeCamera:c}}=o;return t.startVirtualBackgroundSetting(r,i,l,null!=u?u:c,a,s),d}(e,t,o,n).then((e=>r?Nm(!0):Fe(Mc(eu,1)).then((o=>{var r;return n||t.stopVirtualBackgroundSetting(),o?(null==e||null===(r=e.parentNode)||void 0===r||r.removeChild(e),!0):Promise.reject("Cannot access the virtual background image.")})))):a===e.imageUrl&&d===Id.VirtualBackground&&!u||async function(e,t,o){const{imageUrl:n,cropped:r}=e;if(n){const e=await JR(n,r);e&&(o.video.backgroundMode===Id.Mask&&(t.stopMaskSetting(!0),await yr((()=>{t.stopVirtualBackgroundSetting()}),0)),t.updateVirtualBackgroundImage(e),e!==od&&setTimeout((()=>{Tf(e)}),0))}else t.updateVirtualBackgroundImage(null)}(e,t,o):Promise.reject("Cannot load virtual background model.")))}function ew(e,t,o,n){const{video:{mask:{isMaskConfigured:r,imageSrc:i,clip:s},backgroundMode:a,isCurrentUserStartedVideo:d},meeting:{isCurrentUserStartVideoBeforeReset:u}}=o;return n||!r&&e.imageUrl?async function(e,t,o,n){const{canvas:r,imageId:i,captureHeight:s,captureWidth:a,divElement:d}=await QR(e,o,n),{cameraId:u,clip:l,rootWidth:c=1280,rootHeight:p=720}=e,h=l?await ZR(l,c,p,d):null,{video:{videoSsrc:m,activeCamera:v}}=o;return h?(t.startMaskSetting(r,i,h,m,null!=u?u:v,c,p,a,s),d):Promise.reject("Clip is empty")}(e,t,o,n).then((e=>d?Zm(!0):Fe(Mc(du,1)).then((o=>{var r;return n||t.stopMaskSetting(),o?(null==e||null===(r=e.parentNode)||void 0===r||r.removeChild(e),!0):Promise.reject("Cannot set video mask")})))):a===Id.Mask&&e.imageUrl===i&&YR(e.clip,s)&&!u?Promise.resolve(!0):async function(e,t,o){const{imageUrl:n,cropped:r,clip:i,rootWidth:s,rootHeight:a}=e,{video:{mask:{imageSrc:d,cropped:u,clip:l},backgroundMode:c}}=o;if(n){if(c===Id.VirtualBackground&&(t.stopVirtualBackgroundSetting(!0),await yr((()=>{t.stopMaskSetting()}),0)),n!==d||r!==u){const e=await JR(n,r);e&&(t.updateMaskBackgroundImage(e),setTimeout((()=>{Tf(e)}),0))}if((!YR(i,l)||!d)&&i&&s&&a){const e=await ZR(i,s,a);e&&(t.updateMaskClip(e,s,a),setTimeout((()=>{Tf(e)}),0))}}else t.updateMaskBackgroundImage(null),t.updateMaskClip(null,s,a)}(e,t,o)}const tw=Ns.createAgent(),ow=vb(Hs.getInstance()),nw=Ns.createAgent(),rw=vb(Hs.getInstance()),iw={videoSsrc:0,cameraDevicesList:[],activeCamera:zi.isAndroidOrIOSBrowser?nd.User:"default",activeVideoId:0,isCurrentUserStartedVideo:!1,spotlightUserList:[],isCaptureForbidden:!1,isMirrored:!1,receivedVideoMaxQuality:navigator.hardwareConcurrency>=8?Ja.Video_1080P:Ja.Video_360P,subscribedVideoList:[],renderedVideoList:[],ensuredCanvas:[],isVideoMuted:!1,isCaptureCameraLoading:!1,isCameraTaken:!1,isUsingMediaPlayback:!1,receivedVideoDimension:{width:0,height:0},capturedVideoDimension:{width:0,height:0},isFollowHostVideoLayout:!1,hostDragLayout:[],isSupportHDVideo:!1,isFullHDVideoEnabled:!1,bCanUnmuteVideo:!1,virtualBackground:{isVBConfigured:!1,isVBPreloadReady:void 0,imageSrc:void 0,cropped:void 0},mask:{imageSrc:void 0,cropped:void 0,clip:void 0},backgroundMode:Id.Null,statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0}},hardwareAcceleration:{encode:!1,decode:!1},networkQuality:{},ptz:{},currentCameraControlStatus:{isRequested:!1,isInControl:!1,isCameraMoving:!1},farEndCameraControlStatus:{controlledUserList:[],isControlling:!1},subscriptionStatus:{encode:!1,decode:!1,detailed:!1},videoAttachments:{},rendererType:kd.WebGL,selfPreviewVideoList:[]},sw=ko({[`${pm}`]:_E(((e,t)=>{let{payload:o}=t;e.videoSsrc=o})),[`${mm}`]:_E(((e,t)=>{let{payload:o}=t;e.cameraDevicesList=o})),[`${vm}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.activeCamera;if(n in e.ptz){const t=e.ptz[n];["pan","tilt","zoom"].forEach((e=>{t[e]&&(t[e].value=0)}))}e.activeCamera=o})),[`${hm}`]:_E(((e,t)=>{let{payload:o}=t;e.activeVideoId=o.userId})),[`${gm}`]:_E(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartedVideo=o})),[`${fm}`]:_E(((e,t)=>{let{payload:o}=t;e.spotlightUserList=o})),[`${ym}`]:_E(((e,t)=>{let{payload:o}=t;e.isCaptureForbidden=o})),[`${Sm}`]:_E(((e,t)=>{let{payload:o}=t;e.receivedVideoMaxQuality=o})),[`${bm}`]:_E(((e,t)=>{let{payload:o}=t;e.isVideoMuted=o})),[`${Em}`]:_E(((e,t)=>{let{payload:o}=t;e.isCaptureCameraLoading=o})),[`${Im}`]:_E(((e,t)=>{let{payload:o}=t;e.isCameraTaken=o})),[`${Cm}`]:_E(((e,t)=>{let{payload:o}=t;e.receivedVideoDimension=o})),[`${_m}`]:_E(((e,t)=>{let{payload:o}=t;e.subscribedVideoList.includes(o)||e.subscribedVideoList.push(o)})),[`${Rm}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.subscribedVideoList.indexOf(o);n>=0&&e.subscribedVideoList.splice(n,1)})),[`${Tm}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.renderedVideoList.find((e=>e.userId===o.userId&&e.key===o.key&&e.canvasId===o.canvasId));n?(void 0!==o.videoQuality&&(n.videoQuality=o.videoQuality),void 0!==o.aspectRatio&&(n.aspectRatio=o.aspectRatio)):e.renderedVideoList.push({...o})})),[`${Dm}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.renderedVideoList.findIndex((e=>e.userId===o.userId&&e.key===o.key&&e.canvasId===o.canvasId));n>=0&&e.renderedVideoList.splice(n,1)})),[`${wm}`]:_E(((e,t)=>{let{payload:o}=t;e.isFollowHostVideoLayout=o})),[`${Om}`]:_E(((e,t)=>{let{payload:o}=t;e.hostDragLayout=o})),[`${Pm}`]:_E(((e,t)=>{let{payload:o}=t;e.isSupportHDVideo=o})),[`${km}`]:_E(((e,t)=>{let{payload:o}=t;e.maximumNumbeOfHDSubscriptions=o})),[`${Mm}`]:_E(((e,t)=>{let{payload:o}=t;e.bCanUnmuteVideo=o})),[`${Lm}`]:_E(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBPreloadReady=o})),[`${Nm}`]:_E(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBConfigured=o})),[`${Vm}`]:_E(((e,t)=>{let{payload:o}=t;e.virtualBackground.imageSrc=o.imageUrl,e.virtualBackground.cropped=o.cropped,e.backgroundMode=Id.VirtualBackground})),[`${xm}`]:_E(((e,t)=>{let{payload:o}=t;const{encode:n,decode:r}=o;void 0!==n&&(e.hardwareAcceleration.encode=n),void 0!==r&&(e.hardwareAcceleration.decode=r)})),[`${Um}`]:_E(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${jm}`]:_E(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${Bm}`]:_E(((e,t)=>{let{payload:o}=t;const{cameraId:n,captureWidth:r,captureHeight:i,videoElement:s,originalRatio:a,ptz:d,hd:u,fullHd:l,mediaFile:c,fps:p,mirrored:h}=o;e.activeCamera=n,e.customizedVideoOption={captureWidth:r,captureHeight:i,videoElement:s,originalRatio:a,ptz:d,hd:u,fullHd:l,fps:p},gr(e.mediaPlaybackFile,c)||(e.mediaPlaybackFile=c,e.isUsingMediaPlayback=!(null==c||!c.url)),void 0!==h&&(e.isMirrored=!!h)})),[`${Fm}`]:_E(((e,t)=>{let{payload:o}=t;const{userId:n,level:r,bwLevel:i,type:s}=o;if(Object.prototype.hasOwnProperty.call(e.networkQuality,`${n}`))e.networkQuality[`${n}`][`${s}`]={level:r,bwLevel:i};else{const t={[s]:{level:r,bwLevel:i}};Object.assign(e.networkQuality,{[`${n}`]:t})}})),[`${Hm}`]:_E(((e,t)=>{let{payload:o}=t;const{deviceId:n,ptzRange:r}=o;if(Object.prototype.hasOwnProperty.call(e.ptz,n)){const t=e.ptz[n];t&&["pan","tilt","zoom"].forEach((e=>{const o=r[e];if(o){var n;const r=null===(n=t[e])||void 0===n?void 0:n.capability;r?Object.assign(r,{...o}):t[e]={capability:{...o},value:0}}}))}else Object.assign(e.ptz,{[n]:{pan:r.pan?{capability:{...r.pan},value:0}:null,tilt:r.tilt?{capability:{...r.tilt},value:0}:null,zoom:r.zoom?{capability:{...r.zoom},value:0}:null}})})),[`${$m}`]:_E(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isRequested=o})),[`${Wm}`]:_E(((e,t)=>{let{payload:o}=t;const{isInControl:n,userId:r}=o;e.currentCameraControlStatus.isInControl=n,e.currentCameraControlStatus.controllingUserId=r})),[`${Gm}`]:_E(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.controlledUserList.includes(o)||e.farEndCameraControlStatus.controlledUserList.push(o)})),[`${zm}`]:_E(((e,t)=>{let{payload:o}=t;const n=e.farEndCameraControlStatus.controlledUserList.indexOf(o);-1!==n&&e.farEndCameraControlStatus.controlledUserList.splice(n,1)})),[`${Km}`]:_E(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isCameraMoving="start"===o.cmd})),[`${qm}`]:_E(((e,t)=>{let{payload:o}=t;const{constraints:n,deviceId:r}=o,i=e.ptz[r];["pan","tilt","zoom"].forEach((e=>{void 0!==n[e]&&(i[e].value=n[e])}))})),[`${Jm}`]:_E(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.isControlling=o})),[`${Qm}`]:_E(((e,t)=>{let{payload:o}=t;e.networkQualityBroadcastTime=o})),[`${Zm}`]:_E(((e,t)=>{let{payload:o}=t;e.mask.isMaskConfigured=o})),[`${Xm}`]:_E(((e,t)=>{let{payload:o}=t;const{imageUrl:n,cropped:r,rootHeight:i,rootWidth:s,clip:a}=o;e.mask.imageSrc=n,e.mask.cropped=r,e.mask.clip=a,e.mask.rootWidth=s,e.mask.rootHeight=i,e.backgroundMode=Id.Mask})),[`${Ym}`]:_E(((e,t)=>{let{payload:o}=t;e.backgroundMode=o})),[`${ev}`]:_E(((e,t)=>{let{payload:o}=t;e.capturedVideoDimension=o})),[`${tv}`]:_E(((e,t)=>{let{payload:o}=t;e.ensuredCanvas.includes(o)||e.ensuredCanvas.push(o)})),[`${ov}`]:_E(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${nv}`]:_E(((e,t)=>{let{payload:o}=t;if(o){const{lastCopy:t,...n}=o;e.prefetchedVideo=n}else e.prefetchedVideo=o})),[`${rv}`]:_E(((e,t)=>{let{payload:o}=t;Object.assign(e.subscriptionStatus,o)})),[`${iv}`]:_E(((e,t)=>{let{payload:o}=t;e.isFullHDVideoEnabled=o})),[`${sv}`]:_E(((e,t)=>{let{payload:o}=t;const{userId:n,element:r}=o,i=e.videoAttachments[`${n}`];if(i)-1===i.indexOf(r)&&i.push(r);else{const t=[];t.push(r),Object.assign(e.videoAttachments,{[`${n}`]:t})}})),[`${av}`]:_E(((e,t)=>{let{payload:o}=t;const{userId:n,element:r}=o,i=e.videoAttachments[`${n}`];let s=r;Array.isArray(r)||(s=[r]),s.forEach((e=>{if(i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}))})),[`${dv}`]:_E(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=kd.WebGL2)})),[`${uv}`]:_E(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=kd.WebGPU)})),[`${lv}`]:_E(((e,t)=>{let{payload:o}=t;e.rendererType=o})),[`${cv}`]:_E(((e,t)=>{let{payload:o}=t;e.isMirrored=o})),[`${pv}`]:_E(((e,t)=>{let{payload:o}=t;e.selfPreviewVideoList.includes(o)||e.selfPreviewVideoList.push(o)})),[`${hv}`]:_E(((e,t)=>{let{payload:o}=t;if(o){const t=e.selfPreviewVideoList.indexOf(o);t>=0&&e.selfPreviewVideoList.splice(t,1)}else e.selfPreviewVideoList=[]})),[`${mv}`]:_E(((e,t)=>{let{payload:o}=t;e.leadershipUserId=o})),[`${Am}`]:(e,t)=>{let{payload:o}=t;const n={cameraDevicesList:e.cameraDevicesList};return o&&Object.assign(n,{activeCamera:e.activeCamera,customizedVideoOption:e.customizedVideoOption,virtualBackground:{imageSrc:e.virtualBackground.imageSrc,cropped:e.virtualBackground.cropped},mask:{imageSrc:e.mask.imageSrc,cropped:e.mask.cropped,rootWidth:e.mask.rootWidth,rootHeight:e.mask.rootHeight,clip:e.mask.clip},backgroundMode:e.backgroundMode,ptz:e.ptz,subscriptionStatus:e.subscriptionStatus}),{...iw,...n}}},iw),aw={cameraPtzEpics0:(e,t)=>yn(e,8004).pipe(Xe((e=>{const{payload:{body:{nCmd:o,nUserID:n,nReason:r,nButtonID:i}}}=e,s=t.value,a=wp(s),{video:{currentCameraControlStatus:{isInControl:d,controllingUserId:u},cameraDevicesList:l,activeCamera:c}}=s,p=a.find((e=>fr(e.userId,n))),h=[];if(h.push($m(!0)),o===gd.Request){const e={userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName};if(d){const t=a.find((e=>e.userId===u));Object.assign(e,{currentControllingUserId:null==t?void 0:t.userId,currentControllingDisplayName:null==t?void 0:t.displayName})}Dc(ru,e)}else if(o===gd.Approve)h.push(Gm(null==p?void 0:p.userId)),Dc(iu,{isApproved:!0,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName});else if(o===gd.Decline)h.push(zm(null==p?void 0:p.userId)),Dc(iu,{isApproved:!1,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName,reason:r});else if(o===gd.GiveUp)h.push(Wm({isInControl:!1,userId:0})),Dc(su,{isControlled:!1});else if(o===gd.StartControl||o===gd.StopControl)h.push(Km({cmd:o===gd.StartControl?"start":"stop",type:i}));else if(o===gd.SwitchCamera){const e=l.findIndex((e=>e.deviceId===c)),t=e+1===l.length?0:e+1;if(t!==e){const e=l[t].deviceId;rw.changeCamera(e,rd.includes(e))}}return Ue(h)}))),cameraPtzEpics1:(e,t)=>yn(e,ds).pipe(mt((e=>{var t;const{payload:{body:o}}=e;return null==o||null===(t=o.update)||void 0===t?void 0:t.some((e=>void 0!==e.nFECC||void 0!==e.nFECCExecutive))})),Ot((e=>{const{payload:{body:{update:o}}}=e,n=o.find((e=>void 0!==e.nFECC||void 0!==e.nFECCExecutive));if(n){const{meeting:{userId:e}}=t.value;fr(n.nFECCExecutive,e)&&Dc(au,{userId:n.id,ptz:BR(n.nFECC)})}})),Et(fe)),cameraPtzEpics2:(e,t)=>yn(e,ds).pipe(mt((e=>{var o;const{payload:{body:n}}=e,{video:{farEndCameraControlStatus:{controlledUserList:r}}}=t.value;return null==n||null===(o=n.remove)||void 0===o?void 0:o.some((e=>r.includes(e.id)))})),Xe((e=>{var o;const{payload:{body:n}}=e,r=[],{video:{farEndCameraControlStatus:{controlledUserList:i}}}=t.value,s=null==n||null===(o=n.remove)||void 0===o?void 0:o.find((e=>i.includes(e.id)));return s&&r.push(zm(s.id)),Ue(r)}))),cameraPtzEpics3:(e,t)=>e.pipe($t(`${Km}`),_t((e=>{const{payload:{cmd:o,type:n}}=e;return"start"===o?ut(0,200).pipe(wt((()=>!!t.value.video.currentCameraControlStatus.isCameraMoving)),Xe((()=>{const{video:{ptz:e,activeCamera:o}}=t.value,r=e[o],i=xR(r)||{},{key:s,range:a}=jR(n,2);return r[s]?(Object.assign(i,{[s]:UR(r[s].capability,r[s].value,a)}),rw.movePTZCamera(i).then((()=>qm({deviceId:o,constraints:i})))):Promise.resolve(void 0)})),Xe((e=>"object"==typeof e&&void 0!==e.type?je(e):fe))):fe}))),cameraPtzEpics4:(e,t)=>e.pipe($t(`${vm}`),Xe((e=>{const{payload:o}=e,{video:{customizedVideoOption:n,ptz:r}}=t.value;if(null!=n&&n.ptz){const e=null==r?void 0:r[o];void 0!==e&&nw.sendCameraAblity({pan:!!e.pan,tilt:!!e.tilt,zoom:!!e.zoom})}return fe})))},dw={videoCaptureEpics0:(e,t)=>In(e,Va.StartVideoCaptureSuccess).pipe(Le(he),Xe((e=>{const{video:{cameraDevicesList:o,activeCamera:n,ptz:r,isCurrentUserStartedVideo:i,isUsingMediaPlayback:s},meeting:{userId:a}}=t.value,{payload:{data:{currentDeviceID:d,PTZRange:u}}}=e,l=[];if(o.length<1&&!s&&(Dc(Bd,{reason:"Cannot detect camera devices"}),ow.stopCaptureVideo()),LR(n,o)||s){if(i||tw.muteAttendeeVideo(a,!1),Dc(uu),s)l.push(vm("default"));else if(d&&u&&l.push(Hm({deviceId:d,ptzRange:u})),n!==d&&l.push(vm(d)),Object.prototype.hasOwnProperty.call(r,d)){const e=r[d];if(e){const t=xR(e);t&&ow.movePTZCamera(t)}}}else Dc(Fd,{reason:"cannot find target camera"}),ow.stopCaptureVideo();return Ue(l)}))),videoCaptureEpics1:(e,t)=>yn(e,ds).pipe(mt((e=>{const{payload:{body:{update:o}}}=e,{meeting:{userId:n}}=t.value;return null==o?void 0:o.some((e=>e.id===n&&void 0!==e.bVideoOn))})),ze((e=>{const{payload:{body:{update:o}}}=e,{meeting:{userId:n}}=t.value,r=o.find((e=>e.id===n));return!0===r.bVideoOn?Dc(zd):Dc(Kd),gm(!!r.bVideoOn)}))),videoCaptureEpics2:e=>In(e,[Va.UserForbiddedCaptureVideo,Va.UserCameraIsTakenByOtherPrograms,Va.VideoWebsocketBroken,Va.StopVideoCaptureFailed]).pipe(Xe((e=>{const{payload:{type:t}}=e,o=[];switch(t){case Va.UserForbiddedCaptureVideo:Dc(Hd),o.push(ym(!0));break;case Va.UserCameraIsTakenByOtherPrograms:Dc($d,{reason:"User camera is taken by other programs."}),o.push(Im(!0));break;case Va.VideoWebsocketBroken:Dc(Gd,{reason:"Video websocket broken."});break;case Va.StopVideoCaptureFailed:Dc(Kd,{failed:!0,reason:"Unknown."})}return Ue(o)}))),videoCaptureEpics3:(e,t)=>In(e,Va.StopVideoCaptureSuccess).pipe(Tt(t),sy((e=>{let[,t]=e;const{meeting:{userId:o},video:{isCurrentUserStartedVideo:n}}=t;n||Dc(Kd),tw.muteAttendeeVideo(o,!0)}))),videoCaptureEpics4:(e,t)=>yn(e,16133).pipe(Tt(t),mt((e=>{var t,o;let[n,r]=e;return(null==n||null===(t=n.payload)||void 0===t||null===(o=t.body)||void 0===o?void 0:o.id)===r.meeting.userId})),sy((e=>{let[t]=e;const{id:o,bVideoMute:n}=t.payload.body;return Dc(Vd,{id:o,isVideoMuted:n}),!0===n&&ow.stopCaptureVideo(),!1===n&&Dc(Ud,{id:o,isVideoMuted:n}),bm(n)}))),videoCaptureEpics5:(e,t)=>yn(e,16131).pipe(mt((e=>void 0!==e.payload.body.ssrc)),_t((e=>{const{payload:{body:{ssrc:o}}}=e;return Dc(cu,o),ct(je(pm(o)),Uf(t).pipe(Xe((e=>{const{meeting:{isCurrentUserStartVideoBeforeReset:o},media:{videoEncodeStatus:n}}=t.value;return!0!==(null==e?void 0:e.bVideoOn)&&!0===o?Vf("video",n,"success").pipe(mt((e=>{let[t,o]=e;return t&&o})),ze((()=>{const e=t.value,{video:{backgroundMode:o,mask:n,virtualBackground:r,activeCamera:i,customizedVideoOption:s}}=e;let a=Promise.resolve(!0);return o===Id.VirtualBackground&&r.imageSrc?a=XR({imageUrl:r.imageSrc,cropped:r.cropped},ow,e):o===Id.Mask&&n.imageSrc&&n.clip&&(a=ew({imageUrl:n.imageSrc,cropped:n.cropped,clip:n.clip,rootHeight:n.rootHeight,rootWidth:n.rootWidth},ow,e)),a.then((()=>{VR(ow,e,{cameraId:i,...s})})),ci(void 0)}))):fe}))))}))),videoCaptureEpics6:(e,t)=>e.pipe($t(`${mm}`),Ot((e=>{const{payload:o}=e,n=t.value,{meeting:{userId:r}}=n,i=Ip(n);0===o.length?i&&!i.bVideoConnect||tw.connectCamera(r,!1):null!=i&&i.bVideoConnect||tw.connectCamera(r,!0)})),Et(fe)),videoCaptureEpics7:e=>In(e,Va.InitSuccessVideo).pipe(mt((e=>!zi.isIPad&&zi.isAndroidOrIOSBrowser&&e.payload.data===Ua.EncodeSuccess)),_t((()=>"orientation"in window.screen?st(screen.orientation,"change").pipe(Xe((()=>(ow.setMobileRotateMode(HR()),fe)))):st(window,"orientationchange").pipe(Xe((e=>{var t,o,n;const r=null===(t=e.target)||void 0===t||null===(o=t.screen)||void 0===o||null===(n=o.orientation)||void 0===n?void 0:n.angle,i=90===Math.abs(r);return ow.setMobileRotateMode(i),fe})))))),videoCaptureEpics8:e=>In(e,Va.StartVideoCaptureSuccess).pipe(mt((()=>!zi.isIPad&&zi.isAndroidOrIOSBrowser)),Ot((()=>{ow.setMobileRotateMode(HR())})),Et(fe)),videoCaptureEpics9:(e,t)=>In(e,Va.VideoStreamFailed).pipe(mt((()=>!!t.value.video.isCurrentUserStartedVideo&&zi.isIOSMobile)),Ot((()=>{ow.stopCaptureVideo()})),Et(fe))},uw={videoRenderEpics0:e=>yn(e,16129).pipe(ze((e=>{const{payload:{body:{id:t,bVideoOn:o}}}=e,n=PR(t);return Dc(Nd,{bVideoOn:o,userId:n}),hm({bVideoOn:o,userId:n})}))),videoRenderEpics1:(e,t)=>In(e,Va.VideoDecodeMaxSize).pipe(mt((e=>{var t;return null==e||null===(t=e.payload)||void 0===t?void 0:t.data})),ze((e=>{const{size:o}=e.payload.data,{video:{renderedVideoList:n,receivedVideoMaxQuality:r},meeting:{userId:i}}=t.value,s=n.filter((e=>e.videoQuality>=Ja.Video_720P&&e.userId!==i));return r!==o&&s.length>0&&(o>=Ja.Video_720P||r>=Ja.Video_720P)&&s.forEach((e=>{WR.subscribeVideo(e.userId,e.videoQuality,!1)})),Sm(o)}))),videoRenderEpics2:e=>yn(e,16135).pipe(Xe((e=>{const{payload:{body:{bLeadershipOn:t,id:o}}}=e,n=[],r=[],i=t?PR(o):0;return t&&r.push(i),n.push(fm(r),mv(i)),vt(Mc(qd,1),ut(2e3).pipe(ze((()=>({leadershipEventOnly:!0}))))).subscribe((e=>{const{spotlightList:o,leadershipEventOnly:n}=e;t?1===(null==o?void 0:o.length)&&r[0]===(null==o?void 0:o[0])||Dc(hu,{spotlightList:o}):(n||0===(null==o?void 0:o.length))&&Dc(hu,{spotlightList:[]})})),Ue(n)}))),videoRenderEpics3:(e,t)=>yn(e,7958).pipe(Tt(t),ze((e=>{let[t,o]=e;const{payload:{body:n}}=t;let r=[];n&&n.group_list&&n.group_list[0]&&(r=n.group_list[0].map((e=>e.id)));const i=wp(o);return i.length>0&&(r=r.filter((e=>i.findIndex((t=>t.userId===e))>=0))),Dc(qd,{spotlightList:r}),fm(r)}))),videoRenderEpics4:e=>In(e,Va.CurrentVideoResolution).pipe(sy((e=>(Dc(jd,e.payload.data),Cm(e.payload.data))))),videoRenderEpics5:e=>In(e,[Va.CurrentVideoResolution,Va.CurrentCaptureVideoWidthHeight]).pipe(mt((e=>!!e.payload.data)),ze((e=>{const{payload:{data:t,type:o}}=e;return o===Va.CurrentVideoResolution?(Dc(jd,t),Cm(t)):(Dc(xd,t),ev(t))}))),videoRenderEpics6:e=>yn(e,us).pipe(mt((e=>{const{payload:{body:t}}=e;return["bFollowHostVideo","VideoHd","bCanUnmuteVideo"].some((e=>void 0!==t[e]))})),ze((e=>{const{payload:{body:{bFollowHostVideo:t,VideoHd:o,bCanUnmuteVideo:n}}}=e;if(void 0!==t)return Dc(Jd,{bOn:t}),wm(t);if(void 0!==n)return Mm(n);{const e=1===o;return GR.updateVideoHDValue(e),GR.enableHardwareAccelerationForVideoEncode(!1),Pm(e)}}))),videoRenderEpics7:(e,t)=>yn(e,7957).pipe(Tt(t),ze((e=>{let[t,o]=e;const{video:{isFollowHostVideoLayout:n}}=o,{payload:{body:r}}=t,i=r&&r.drag_list&&r.drag_list.map((e=>e.id));return n&&Dc(Qd,{layout:i}),Om(i)}))),videoRenderEpics8:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[t,o]=e;const{meeting:{userId:n},video:{subscribedVideoList:r}}=o,i=t.payload.body.update,s=t.payload.body.remove;return i&&i.length>0&&i.findIndex((e=>e.id!==n&&(void 0!==e.bVideoOn||e.bHold)))>-1||s&&s.some((e=>r.includes(e.id)))})),Ot((e=>{let[t,o]=e;const{payload:{body:{remove:n,update:r}}}=t,{video:{subscribedVideoList:i}}=o,s=Rp(o);if(n&&n.length>0&&n.filter((e=>i.includes(e.id))).forEach((e=>{Dc(Yd,{userId:e.id})})),r&&r.length>0){const e=r.filter((e=>void 0!==e.bVideoOn)).filter((e=>-1===s.findIndex((t=>t.userId===e.id)))),t=r.filter((e=>!0===e.bHold));t.length>0&&t.filter((e=>i.includes(e.id))).forEach((e=>{Dc(Yd,{userId:e.id})})),e.forEach((e=>{e.bVideoOn?Dc(Zd,{userId:e.id}):i.includes(e.id)&&Dc(Yd,{userId:e.id})}))}})),Et(fe)),videoRenderEpics9:(e,t)=>In(e,Va.VideoQosData).pipe(Tt(t),ze((e=>{var t;let[o,n]=e;const{video:{isCaptureForbidden:r,isCameraTaken:i},media:{videoEncodeStatus:s,videoDecodeStatus:a}}=n,d=Ip(n),u=Pp(n),l=u.length>0,c=(null==d?void 0:d.bVideoOn)&&!r&&!i,p=u.some((e=>e.bVideoOn)),h="success"===s&&c&&l,m="success"===a&&l&&p;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?h?(Dc(tu,o.payload),Um(o.payload)):Um(vd):m?(Dc(tu,o.payload),jm(o.payload)):jm(vd)}))),videoRenderEpics10:(e,t)=>In(e,[Va.CurrentDecodeVideoQuality,Va.CurrentDecodeVideoFps]).pipe(Ot((e=>{const{payload:{type:o,data:n}}=e,{video:{subscriptionStatus:r}}=t.value;if(r.detailed)if(o===Va.CurrentDecodeVideoQuality){const{ssrc:e,width:t,height:o,quality:r}=n;Dc(ou,{userId:e,width:t,height:o,quality:r})}else if(o===Va.CurrentDecodeVideoFps){const{ssrc:e,fps:t}=n;Dc(ou,{userId:e,fps:t})}})),Et(fe)),videoRenderEpics11:(e,t)=>An(e,t).pipe(Xe((async()=>zi.isAndroidOrIOSBrowser?1:await Hs.isSupportVideoDecodeHardwareAcceleration()?4:1)),ze((e=>km(e)))),videoRenderEpics12:(e,t)=>In(e,Va.NetworkQualityChange).pipe(mt((e=>!!e.payload.data)),Xe((e=>{var o;const{payload:{data:{bwLevel:n,isUplink:r,networkLevel:i}}}=e,s=[],{meeting:{userId:a},video:{networkQuality:d,subscribedVideoList:u,networkQualityBroadcastTime:l}}=t.value,c=r?"uplink":"downlink";s.push(Fm({userId:a,level:i,bwLevel:n,type:c}));const p=gr(null===(o=d[`${a}`])||void 0===o?void 0:o[c],{level:i,bwLevel:n});if(!p&&-1!==i){(!r&&u.filter((e=>e!==a)).length>0||r)&&Dc(nu,{userId:a,type:c,level:i})}if(r){const e=performance.now();(!p||e-(null!=l?l:0)>3e4)&&(WR.broadcastUserNetworkQuality({isUplink:r,level:i,bwLevel:n}),s.push(Qm(e)))}return Ue(s)}))),videoRenderEpics13:(e,t)=>En(e,8005).pipe(mt((e=>{var t;return!(null===(t=e.payload.body)||void 0===t||!t.nUserID)})),Xe((e=>{const{payload:{body:{nLevel:o,nUserID:n}}}=e,{video:{networkQuality:r}}=t.value,i=r[`${n}`],s=[];return i&&i.uplink.level===o||(Dc(nu,{userId:n,level:o,type:"uplink"}),s.push(Fm({userId:n,level:o,type:"uplink"}))),Ue(s)}))),videoRenderEpics14:(e,t)=>yn(e,ds).pipe(mt((e=>{const{payload:{body:o}}=e,{video:{prefetchedVideo:n}}=t.value;return(null==n?void 0:n.userId)&&(o.update||o.remove)})),Xe((e=>{const{payload:{body:o}}=e,n=[],{video:{prefetchedVideo:r}}=t.value;let i=!1;return o.remove&&(i=-1!==o.remove.findIndex((e=>e.id===(null==r?void 0:r.userId)))),o.update&&(i=-1!==o.update.findIndex((e=>e.id===(null==r?void 0:r.userId)&&!1===e.bVideoOn))),i&&r&&(r.loaded||GR.cancelPrefetchVideoSsrc(r.userId),WR.unsubscribeVideo(r.userId),n.push(nv(void 0))),Ue(n)}))),videoRenderEpics15:(e,t)=>e.pipe($t(`${nv}`),mt((e=>!!e.payload)),Ot((e=>{const{payload:{lastCopy:o}}=e,{video:{prefetchedVideo:n}}=t.value;!n||o&&o.userId===n.userId||(null!=o&&o.userId&&(o.loaded&&GR.cancelPrefetchVideoSsrc(o.userId),WR.unsubscribeVideo(o.userId)),WR.subscribeVideo(n.userId,Ja.Video_360P,!1),GR.prefetchVideoSsrc(n.userId))})),Et(fe)),videoRenderEpics16:(e,t)=>In(e,Va.NewActiveSpeakerFirstFrameCallback).pipe(mt((()=>!!t.value.video.prefetchedVideo)),Xe((e=>{const{payload:{data:{ssrc:o}}}=e,{video:{prefetchedVideo:n}}=t.value,r=[];return n&&(fr(n.userId,o)?(r.push(nv({userId:n.userId,loaded:!0,lastCopy:n})),Dc(lu,{userId:n.userId})):WR.unsubscribeVideo(n.userId)),Ue(r)}))),videoRenderEpics17:(e,t)=>yn(e,16131).pipe(mt((e=>void 0!==e.payload.body.ssrc)),Ot((()=>{const{media:{videoDecodeStatus:e,videoEncodeStatus:o}}=t.value;Vf("video",o,e).subscribe((e=>{let[o,n]=e;const{video:{subscriptionStatus:r}}=t.value;o&&r.encode&&GR.subscribeToQos([Bs.VideoEncode],id),n&&(r.decode&&GR.subscribeToQos([Bs.VideoDecode],id),r.detailed&&GR.enableVideoObserver(!0))}))})),Et(fe)),videoRenderEpics18:(e,t)=>e.pipe($t(`${Tm}`,`${Dm}`),mt((()=>{const e=t.value.video.renderedVideoList.length;return[0,1].includes(e)})),Ot((()=>{const e=t.value.video.renderedVideoList.length;1===e?GR.enableVideoObserver(!0,!0):0===e&&GR.enableVideoObserver(!1)})),Et(fe)),videoRenderEpics19:(e,t)=>In(e,Va.CurrentDecodeVideoQuality).pipe(Xe((e=>{const{payload:{data:o}}=e,{video:{renderedVideoList:n,videoAttachments:r}}=t.value,i=[],{ssrc:s,width:a,height:d}=o,u=d?a/d:0,l=n.filter((e=>fr(e.userId,s)));if(l.some((e=>e.aspectRatio&&Math.abs(e.aspectRatio-u)>.2))){const e=l.filter((e=>e.canvasId===pd));if(e.length>0){const e=r[`${s}`];e&&e.every((e=>{if(e){const{clientWidth:t,clientHeight:o}=e,n=o?t/o:0;return Math.abs(n-u)<=.2}return!0}))&&i.push(Tm({userId:s,key:ad,canvasId:pd,aspectRatio:u}))}e.length===l.length&&0!==i.length||Dc(pu,{userId:s,aspectRatio:u})}return Ue(i)}))),videoRenderEpics20:(e,t)=>In(e,Va.SyncRendererTypeResponse).pipe(Xe((e=>{const{payload:{data:{rendererType:o}}}=e,{video:{rendererType:n}}=t.value,r=[];return n!==o&&r.push(lv(o)),Ue(r)})))},lw=fn(uw,dw,{vbEpics0:e=>In(e,[Va.VbModelPreloadingOk,Va.VbModelPreloading_3S,Va.VbModelPreloading_10S,Va.VbSettingParaError]).pipe(Xe((e=>{const{payload:{type:t,data:o}}=e,n=[];return[Va.VbModelPreloadingOk,Va.VbModelPreloading_3S,Va.VbModelPreloading_10S].includes(t)?(n.push(Lm(!0)),Dc(Xd,!0),t===Va.VbModelPreloading_10S&&console.warn("Virtual Background is taking longer than expected to load.")):t===Va.VbSettingParaError&&(o===td.VBModelNotMatch?(Dc(Xd,!1),n.push(Lm(!1))):(Dc(eu,!1),n.push(Nm(!1)))),Ue(n)}))),vbEpics1:e=>In(e,Va.StartVideoStreamInVbSettingSuccess).pipe(ze((()=>(Dc(eu,!0),Nm(!0))))),vbEpics2:e=>In(e,Va.StartVideoStreamInMaskSettingSuccess).pipe(ze((()=>(Dc(du,!0),Zm(!0))))),vbEpics3:e=>In(e,Va.MaskSettingParaError).pipe(ze((()=>(Dc(du,!1),Zm(!1)))))},aw);class cw{constructor(){this.assetsPath=void 0,this.instance=void 0,this.callbackList=void 0,this.mediaWorkersPath=void 0,this.mediaOptions=void 0,this.inProgress=void 0,this.callbackList=[]}static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new cw),this.agentInstance}init(e,t){var o,n,r,i,s;if(!this.instance&&window.JsMediaSDK_Instance){const e={ivObj:{[Xi.AUDIO_ENCODE]:void 0,[Xi.VIDEO_ENCODE]:void 0,[Xi.SHARING_ENCODE]:void 0}};this.instance=new window.JsMediaSDK_Instance(e)}this.mediaWorkersPath=xs(e,!1),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=t,null===(o=this.instance)||void 0===o||o.JsMediaSDK_PreLoad(this.mediaWorkersPath,this.onMediaSDKCallback,t);const a=Qi(null===(n=this.mediaOptions)||void 0===n?void 0:n.enableMultiDecodeVideoWithoutSAB);null===(r=this.instance)||void 0===r||r.setPropsBeforeInit({callback:this.onMediaSDKCallback,audioWorkerPath:null===(i=this.mediaWorkersPath)||void 0===i?void 0:i.audioWorkletPath,isEnableListenInitEvent:!0}),null===(s=this.instance)||void 0===s||s.initVideoEncode(this.mediaWorkersPath,"",0,!1,"",0,a,!1,!1,!0,!0,!1,!0),this.inProgress=!0}onMediaSDKCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach((o=>o(e,t)))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter((t=>t!==e))}async destroy(){var e;this.callbackList=[],await(null===(e=this.instance)||void 0===e?void 0:e.destroy()),this.instance=null,this.inProgress=!1}disconnect(){var e,t;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(17,{}),null===(t=this.instance)||void 0===t||t.JsMediaSDK_UnInit()}startVirtualBackgroundSetting(e,t,o,n,r,i){var s;let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(91,{canvas:e,bgdom:t,width:r,height:i,ssid:0,VideoSelectValue:"default"===n?null:n,disableOriginalRatio:a,usingFacingMode:["user","environment"].includes(n)})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(93,{isSwitch:t})}startMaskSetting(e,t,o,n,r,i,s,a,d){var u;null===(u=this.instance)||void 0===u||u.Notify_MeidaSDK(62,{canvas:e,maskdom:null,bgdom:null,dx:0,dy:0,dWidth:170,dHeight:170,width:1280,height:720,ssid:0,originWidth:379,originHeight:213,VideoSelectValue:"default"===r?null:r,usingFacingMode:["user","environment"].includes(r)})}stopMaskSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(65,{isSwitch:t})}}cw.agentInstance=void 0;const pw="PREVIEW_VIDEO_ENCODE_SUCCESS",hw="PREVIEW_VIDEO_VB_MODEL_READY";async function mw(e,t,o,n){const{imageUrl:r,cropped:i,deviceId:s}=o,a=Sr("__ZOOM_SDK_PREVIEW_VIRTUAL_BACKGROUND_CANVAS_@__");t.id||(t.id=a);let[d,u]=[640,360];if(Hs.isSupportSending720P()&&(d=1280,u=720),r&&zf(n)){const o=await JR(r,i);return e.startVirtualBackgroundSetting(t,o,0,null!=s?s:"default",d,u),o&&o!==od&&setTimeout((()=>{Tf(o)}),0),"vb"}return e.startMaskSetting(t,null,null,0,null!=s?s:"default",0,0,0,0),"mask"}class vw{constructor(){this.previewMediaAgent=cw.getInstance(),this.isInit=void 0,this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.state=void 0,this.eventHandler=(e,t)=>{switch(e){case Va.InitSuccessVideo:t===Ua.EncodeSuccess&&(this.isVideoEncoded=!0,Dc(pw));break;case Va.VbModelPreloadingOk:case Va.VbModelPreloading_3S:case Va.VbModelPreloading_10S:this.isVBModelReady=!0,Dc(hw,!0);break;case Va.VbSettingParaError:t===td.VBModelNotMatch&&(this.isVBModelReady=!1,Dc(hw,!1))}}}static setMediaOption(e){vw.mediaOption=e}setup(){if(vw.mediaOption){if(Hs.getInstance().inProgress)return Promise.resolve("");if(!cw.getInstance().inProgress){this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.previewMediaAgent.unregisterCallback(this.eventHandler);const{assetsPath:e,enforceMultipleVideos:t,enforceVirtualBackground:o}=vw.mediaOption,n={...Jf(e,t,o)};this.previewMediaAgent.init(e,n),this.previewMediaAgent.registerCallback(this.eventHandler)}return Promise.resolve("")}return Promise.reject({type:Cl,reason:"Cannot preview video with virtual background before `client.init` method."})}async startPreview(e,t){var o;Hs.getInstance().inProgress?mw(Hs.getInstance(),e,t,null===(o=vw.mediaOption)||void 0===o?void 0:o.enforceVirtualBackground):(void 0!==this.isVBModelReady?Ue([this.isVBModelReady]):Mc(hw,1)).subscribe((o=>{o&&(this.isVideoEncoded?Ue([!0]):Mc(pw,1)).subscribe((()=>{var o;mw(cw.getInstance(),e,t,null===(o=vw.mediaOption)||void 0===o?void 0:o.enforceVirtualBackground).then((o=>{this.state={mode:o,canvas:e,vb:t}}))}))}))}async stopPreview(){var e;Hs.getInstance().inProgress?Hs.getInstance().stopVirtualBackgroundSetting():"vb"===(null===(e=this.state)||void 0===e?void 0:e.mode)?cw.getInstance().stopVirtualBackgroundSetting():cw.getInstance().stopMaskSetting()}async updatePreview(e,t){const o=Hs.getInstance().inProgress?Hs.getInstance():cw.getInstance();var n;if(e)if("mask"===(null===(n=this.state)||void 0===n?void 0:n.mode)){var r;zi.isChrome?(await this.stopPreview(),await this.startPreview(this.state.canvas,{imageUrl:e,cropped:t,deviceId:null===(r=this.state.vb)||void 0===r?void 0:r.deviceId})):console.warn('use the `start` method with the virtual background image parameter instead of using `updateVirtualBackground` to preview the video." ')}else{const n=await JR(e,t);n&&(o.updateVirtualBackgroundImage(n),n!==od&&setTimeout((()=>{Tf(n)}),0))}else o.updateVirtualBackgroundImage(null)}}vw.mediaOption=void 0;const{InitSuccessVideo:gw,InitSuccessAudio:fw,InitSuccessSharing:yw,InitFailedVideo:Sw,InitFailedAudio:bw,InitFailedSharing:Ew,SharingHealthCheckFailed:Iw,VideoHealthCheckFailed:Aw,AudioHealthCheckFailed:Cw}=Va,_w=vb(Hs.getInstance()),Rw=lb.getInstance(),ww=Rw.makeLogger(["Media Agent"]),Ow=[kf,Lf,Mf].map((e=>Of(e,{hostname:!0}))),Tw=[],Dw={epics0:(e,t)=>e.pipe($t(`${Gr}`),_t((()=>{const{meeting:{isMeetingReset:o}}=t.value;return e.pipe(Rt(e.pipe($t(`${No}`),ft(1))),$t(`${Xr}`),ft(1),dy((e=>{var n;const{logger:r,media:{mediaConstraints:i,assetsPath:s},meeting:{zlkJwtToken:a,cv:d}}=t.value,{payload:{disableAqos:u,disableVqos:l}}=e,c=null!=r&&null!==(n=r.options)&&void 0!==n&&n.enable?lb.getInstance().makeLogger(["MEDIA SDK"]):void 0;return function(e){const{media:{patchedMediaSDKStatus:t}}=e;return t===Td.Loading?Fe(Mc($l,1)):Promise.resolve()}(t.value).then((()=>{const e=[];let t=!l;const n=!u;return a&&mr(d,"1.3.0")<0&&(t=!1),e.push(un({audioQos:n,videoQos:t})),_w.init(function(e){return e?new Proxy(e,{get:(e,t)=>"string"==typeof t&&"error"===t?function(){try{var e;cb.report(arguments.length<=0?void 0:arguments[0],["MEDIA SDK",...null!==(e=arguments.length<=1?void 0:arguments[1])&&void 0!==e?e:[]],"error")}catch(e){}}:Reflect.get(e,t)}):e}(c)),e.push(pn(!0)),o&&void 0!==i&&void 0!==s&&e.push(Jo()),e}))})))}))),epics1:(e,t)=>e.pipe($t(`${Gr}`),mt((e=>{const{payload:{mediaSDKPath:o}}=e,{media:{skipJsMedia:n,patchJsMedia:r,assetsPath:i},meeting:{isMeetingReset:s}}=t.value;return!n&&Ow.some((e=>new RegExp(`^https://${e}`).test(null!=i?i:"")))&&!!r&&!!o&&!s})),_t((e=>{const{payload:{mediaSDKPath:t}}=e,o=Ir(t);return Ue(new Promise(((e,t)=>{const n=`${o}/${wi}`;"JsMediaSDK_Instance"in window&&(window.JsMediaSDK_Instance_backup=window.JsMediaSDK_Instance,delete window.JsMediaSDK_Instance),wf(n,(()=>{"JsMediaSDK_Instance_backup"in window&&delete window.JsMediaSDK_Instance_backup,ww.info(`patched media sdk url:${n}`),e("")}),(()=>{"JsMediaSDK_Instance_backup"in window&&(window.JsMediaSDK_Instance=window.JsMediaSDK_Instance_backup,delete window.JsMediaSDK_Instance_backup),ww.error(`cannot load patched media sdk :${n}`),t()}))}))).pipe(Xe((()=>(Dc($l),Ue([an(Td.Done),dn(o)])))),gt((()=>(Dc($l),Ue([an(Td.Done)])))),Ct(an(Td.Loading)))}))),epics2:(e,t)=>An(e,t).pipe(Ot((()=>{const{media:{assetsPath:e,mediaConstraints:o,fileWithVersion:n,enforceMultipleVideos:r,enforceVirtualBackground:i,isEnableDecoderInWorklet:s},meeting:{isAudioBridgeEnabled:a}}=t.value;if(_w.notifySDKMeetingReady(),e&&o){const t={enableDecoderInWorklet:s,enableAudioBridge:a&&Ki()};Object.assign(t,Jf(e,r,i)),_w.setAssetsAndConstraint(e,o,n,t)}Uf(t).pipe(_t((e=>Ue(Xf.acquire().then((()=>e)))))).subscribe((e=>{const{meeting:{svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,userId:s,isWebinar:a,enableWebtransport:d,webtransportPort:u},media:{enableAudioQos:l,enableVideoQos:c,alternativeNameForVideoPlayer:p,adaptedABOptionForMediaSDK:h},video:{rendererType:m}}=t.value;e&&(_w.connect({svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,isViewOnly:ap(e.userRole),currentUserId:s,isWebinar:a,enableAudioQos:l,enableVideoQos:c,enableWebtransport:d,webtransportPort:u,rendererType:m,adaptedABOptionForMediaSDK:h}),function(e){var t;let o="video-player";e.tagName&&(o=e.tagName,WI.dispatch("",{tagName:e.tagName}),cA(null===(t=e.mediaSDK)||void 0===t?void 0:t.call(e),`VPTN:${o}`));const n=`${o}-container`,r=e.sessionId||rA();WI.get("renderCountMap").clear(),e.mediaSDK&&(WI.get("mediaSDKInstanceMap").set(KI,e.mediaSDK),WI.get("mediaSDKInstanceMap").set(r,e.mediaSDK)),e.failover&&WI.dispatch("failover",void 0,e.sessionId||KI),customElements.get(n)||customElements.define(n,xA),customElements.get(o)||customElements.define(o,LA)}({mediaSDK:()=>_w.instance,tagName:p,failover:"1"}))}))})),_t((()=>dt((e=>_w.registerCallback(e)),(e=>_w.unregisterCallback(e)),((e,t)=>({type:e,data:t}))).pipe(ze((e=>Qo(e))))))),epics3:e=>In(e,[gw,fw,yw,Sw,bw,Ew]).pipe(ay((e=>{const{payload:{type:t,data:o}}=e;if(t===fw||t===bw){if(o===Ua.EncodeSuccess)return Dc(Dl),je(Zo("success"));if(o===Ua.DecodeSuccess)return Dc(Pl),je(Yo("success"));if(o===Ua.EncodeFailed)return Dc(Vl),je(Zo("failed"));if(o===Ua.DecodeFailed)return Dc(Ul),je(Yo("failed"))}else if(t===gw||t===Sw){if(o===Ua.EncodeSuccess)return Dc(kl),je(Xo("success"));if(o===Ua.DecodeSuccess)return Dc(Ml),je(en("success"));if(o===Ua.EncodeFailed)return Dc(jl),je(Xo("failed"));if(o===Ua.DecodeFailed)return Dc(xl),je(en("failed"))}else if(t===yw||t===Ew){if(o===Ua.EncodeSuccess)return Dc(Ll),je(tn("success"));if(o===Ua.DecodeSuccess)return Dc(Nl),je(on("success"));if(o===Ua.EncodeFailed)return Dc(Bl),je(tn("failed"));if(o===Ua.DecodeFailed)return Dc(Fl),je(on("failed"));if(t===yw&&void 0===o)return Dc(Nl),je(on("success"))}}))),epics4:(e,t)=>In(e,[gw,fw]).pipe(_t((()=>"object"==typeof navigator.mediaDevices?ct(xf(),ct(In(e,Va.StartVideoCaptureSuccess),st(navigator.mediaDevices,"devicechange"),In(e,Va.UserGrantCaptureAudio).pipe(mt((()=>!t.value.audio.isUserGrantCaptureAudio)))).pipe(Xe((()=>xf().pipe(Ot((()=>{setTimeout((()=>{Dc(Hl)}),50)}))))))).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=[Kp(t.microphones),qp(t.speakers),mm(t.cameras)];if(o.audio){const{audio:{activeMicrophone:e,activeSpeaker:s,microphoneDevicesList:a,speakerDevicesList:d},video:{cameraDevicesList:u,activeCamera:l,isUsingMediaPlayback:c}}=o,p=Ip(o),{microphones:h,speakers:m,cameras:v}=t,g=a.filter((e=>-1===h.findIndex((t=>t.deviceId===e.deviceId)))),f=d.filter((e=>-1===m.findIndex((t=>t.deviceId===e.deviceId)))),y=u.filter((e=>-1===v.findIndex((t=>t.deviceId===e.deviceId))));if(g.length>0){if(Zf(g[0],e,a)){const e=Yf(h);_w.changeMicrophone("default",null==e?void 0:e.label,!(null==p||!p.muted)),n.push(Jp("default"))}}else if("default"===e){const e=Yf(a),t=Yf(h);a.length>0&&(null==e?void 0:e.label)!==(null==t?void 0:t.label)&&_w.changeMicrophone("default",null==t?void 0:t.label,!(null==p||!p.muted))}var r,i;f.length>0?Zf(f[0],s,d)&&(_w.changeSpeaker("default"),n.push(Qp("default"))):"default"===s&&d.length>0&&(null===(r=Yf(d))||void 0===r?void 0:r.label)!==(null===(i=Yf(m))||void 0===i?void 0:i.label)&&_w.changeSpeaker("default"),y.length>0&&Zf(y[0],l,u)&&(_w.stopCaptureVideo(),n.push(vm(zi.isAndroidOrIOSBrowser?nd.User:"default")))}return Ue(n)}))):fe))),epics5:(e,t)=>En(e,ds).pipe(Ot((e=>{const{type:o,payload:{body:n}}=e,r=o===`${Ho}`;if(n.add){const e=n.add.map((e=>({userid:e.id,sn:e.zoomID&&pr(e.zoomID)})));if(!r){const{meeting:{gcmSessinKey:o}}=t.value;_w.sendUserNodeList(e,o)}_w.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Xi.SHARING_DECODE}),r&&_w.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Xi.AUDIO_DECODE})}if(n.remove&&n.remove.length>0){if(!r){const{meeting:{gcmSessinKey:e}}=t.value;_w.sendUserNodeList(n.remove.map((e=>({userid:e.id,bremove:!0}))),e)}_w.updateUserMediaSN({removed:n.remove.map((e=>e.id)),isFromMainSession:r,iVType:Xi.SHARING_DECODE}),r&&_w.updateUserMediaSN({removed:n.remove.map((e=>e.id)),isFromMainSession:r,iVType:Xi.AUDIO_DECODE})}})),Et(fe)),epics6:e=>In(e,Va.AesGcmIvResponse).pipe(Ot((e=>{const{payload:{data:{workerType:t,iv:o}}}=e,n=Vi.get(Ui.WebclientIVState);if(n){const e={...n,[t]:o};Vi.set(Ui.WebclientIVState,e,Li.SessionStorage)}})),Et(fe)),epics7:e=>e.pipe($t(`${Uo}`),mt((e=>[ls,cs,as].includes(e.payload.evt))),ze((e=>{const{payload:{evt:t,body:{encryptKey:o,additionalType:n}}}=e;return rn({type:t===ls?"audio":t===cs?"video":"sharing",encryptKey:o,additionalType:n})}))),epics8:e=>e.pipe($t(`${nn}`),Ot((e=>{const{payload:t}=e;vw.setMediaOption({assetsPath:t.assetsPath,enforceMultipleVideos:t.enforceMultipleVideos,enforceVirtualBackground:t.enforceVirtualBackground})})),Et(fe)),epics9:e=>e.pipe($t(`${Ur}`,`${Vr}`),Ot((()=>{cw.getInstance().inProgress&&(cw.getInstance().disconnect(),Xf.watch(cw.getInstance().destroy()))})),Et(fe)),epics10:e=>e.pipe($t(`${Ur}`,`${Vr}`),_t((()=>"permissions"in navigator?["microphone","camera"].map((e=>{navigator.permissions.query({name:e}).then((t=>{const o=()=>{Dc(zl,{name:e,state:t.state})};o(),t.addEventListener("change",o),Tw.push((()=>{t.removeEventListener("change",o)}))})).catch((()=>{}))})):fe)),Et(fe)),epics11:e=>e.pipe($t(`${ui}`),mt((e=>e.payload===Di.Closed)),Ot((()=>{Tw.length>0&&(Tw.forEach((e=>e())),Tw.length=0)})),Et(fe)),epics12:e=>In(e,[Iw,Aw,Cw,Sw,bw,Ew]).pipe(Ot((e=>{Rw.report(`Media health check failed,refresh or restart the browser may recover,reason:${e.payload.type}`,"Media exception flow"),Dc(Kl)})),Xe((()=>fe)))},Pw=fn(Dw),kw={meeting:dI,socket:PI,participants:xI,media:$I},Mw=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||xt;function Lw(e){return function(e){for(var t=Object.keys(e),o={},n=0;ne.userId===t));if(r.findIndex((e=>e===zw.Attendee))>-1&&(i=_p(n).find((e=>e.userId===t))),!i)return Promise.reject({type:Tl,reason:"no matching user"});{const{meeting:{userId:e}}=o.getState();for(let o=0;o1?n-1:0),s=1;st.includes(o+1)?sb(e):e)):r)||void 0===a?void 0:a.map((e=>Rr(e)));return o.info(`${n},params:${JSON.stringify(s)}`),i.apply(this,r).then((e=>(o.info(`${n} success`),e))).catch((t=>{let o=`${n},params:${JSON.stringify(s)},return failed,`;return"object"==typeof t&&(o=`${o},${t.type?`type:${t.type},`:""}${t.reason?`reason:${t.reason}`:""}`),qw.report(o,`${e} exception flow`,"error"),Promise.reject(t)}))}catch(e){}return i.apply(this,r)}}}function Qw(e,t,o){return function(n,r,i){const s=i.value;i.value=function(){for(var n,r,i=arguments.length,a=new Array(i),d=0;du instanceof e))||o&&!o.every((e=>!!u[e]))?Promise.reject({type:Tl,reason:`Expected to accept ${null===(n=l)||void 0===n?void 0:n.map((e=>e.name)).join(" or ")}, but actual it is ${"object"==typeof u&&null!==u?null===(r=Object.getPrototypeOf(u))||void 0===r?void 0:r.constructor.name:u}`}):s.apply(this,a)}}}class Zw{constructor(e){this[Vw]=void 0,this[jw]=void 0,this[Uw]=void 0,this[xw]=void 0,this[Vw]=e,this[jw]=e.dispatch,this[Uw]=e.getState}}const Yw=["userId","displayName","audio","isHost","avatar","bRaiseHand","bHold","bVideoOn","sharerOn","sharerPause","feedback","bLocalRecord","strPronoun","sdkKey","audioConnectionStatus","caps","bAllowISORecord","bVideoConnect","userIdentity","isSpeakerOnly","bVideoShare","bShareAudioOn","bShareToBORooms","bid",{from:"bInFailover",to:"isInFailover"},{from:"userGUID",to:"userGuid"},{from:"bGuest",to:"isGuest"},{from:"sharerPause",to:"sharePause"},{from:"bCoHost",to:e=>({isCoHost:!!e})},{from:"muted",to:(e,t)=>({muted:null!=t&&t.isSpeakerOnly||""===(null==t?void 0:t.audio)?void 0:e})},{from:"userType",to:(e,t)=>{const o=ip(e),n={isPhoneUser:o};return o&&null!=t&&t.phoneNumber&&Object.assign(n,{phoneNumber:t.phoneNumber}),n}}];function Xw(e){return Yw.reduce(((t,o)=>{const n="string"==typeof o?o:o.from,r=function(e,t,o){if("string"==typeof e)return{[`${e}`]:t};if("object"==typeof e&&void 0!==e.from){const{to:n}=e;return"string"==typeof n?{[`${n}`]:t}:n(t,o)}}(o,e[n],e);return{...t,...r}}),{})}function eO(){const{isSupportAudioWorklet:e,isSupportEssentialAudioAndVideoAbility:t,isAndroidOrIOSBrowser:o,isSupportSendScreenSharing:n}=zi;return{audio:t&&e||o,video:t&&void 0!==navigator.mediaDevices&&void 0!==navigator.mediaCapabilities,screen:t&&n}}const tO=e=>{let{breakoutRoom:{mainSessionAttendeeList:t}}=e;return t},oO=e=>{let{meeting:{zoomId:t}}=e;return t},nO=e=>{let{breakoutRoom:{isHugeBO:t}}=e;return t},rO=Zc([e=>{let{breakoutRoom:{controlStatus:t}}=e;return t},e=>{let{breakoutRoom:{currentRoom:{status:t}}}=e;return t},e=>{let{breakoutRoom:{currentRoom:{boId:t}}}=e;return t}],((e,t,o)=>!(e!==up.InProgress&&e!==up.Closing||t!==cp.InRoom&&t!==cp.TimeUp||!o))),iO=Zc([e=>{let{breakoutRoom:{rooms:t}}=e;return t},Yc,oO,tO,rO,nO],((e,t,o,n,r,i)=>{const s=e.reduce(((e,t)=>{const{attendeeGuidList:o}=t;return e.concat(o)}),[]);return(r?n:t).filter((e=>!e.bHold&&!e.isHost&&e.zoomID!==o&&!e.bid&&!s.includes(e.userGUID)&&(!i||vy(e.caps))))})),sO=Zc([rO,tO,Yc,oO,nO],((e,t,o,n,r)=>(e?t:o).filter((e=>!e.bHold&&!e.isHost&&e.zoomID!==n&&!e.bid&&(!r||vy(e.caps)))))),aO=Zc([rO,tO,wp],((e,t,o)=>e?t.find((e=>e.isHost)):o.find((e=>e.isHost))));var dO,uO,lO,cO;const pO=Ns.createAgent();let hO=(dO=Kw(zw.Other),uO=Kw(zw.Other),lO=Kw(zw.Other),cO=class extends Zw{constructor(e){super(e),this.modules=void 0,this.useSDK=void 0,this.useSDK=!1,this.modules=new Map}initWithSDK(e,t,o){return this.useSDK=!0,this.init(e,t,o)}init(e,t,o){const{audio:n,video:r}=eO();if(!n||!r)return console.error("https://developers.zoom.us/docs/video-sdk/web/browser-support"),Promise.reject({type:Cl,reason:"Please update to the latest Chrome, Edge, Safari, or Firefox, as your current browser doesn't support audio/video. Retry after the upgrade."});const{[jw]:i,[Vw]:s}=this;let a=Mf;const d=(null==o?void 0:o.fileWithVersion)||!1;let u="en-US",l=`${Mf}/${wi}`;if(o){const{dependentAssets:e,additionalFeatures:t,constraints:n,language:r,webEndpoint:i}=o;r&&(u=r),i&&function(e){Df=Of(e,{hostname:!0})}(i),e===Oi.CDN||e===kf?(a=kf,l=`${kf}/${wi}`):e===Oi.Global||e===Mf?(a=Mf,l=`${Mf}/${wi}`):e===Oi.CN||e===Lf?(a=Lf,l=`${Lf}/${wi}`):e&&/^https?:\/\//.test(e)&&(a=Ir(e),l=d?`${a}/1507_js_media.min.js`:`${a}/${wi}`),t&&Array.isArray(t)&&t.forEach((e=>{if(this[xw][e]&&void 0===s.getState()[e]){const{epic:t,reducer:o,Client:n}=this[xw][e];s.injectReducer(e,o),s.injectEpic(t);const r=new n(s);this.modules.set(e,r)}})),null!=n&&n.audio&&void 0===s.getState().audio&&(s.injectReducer("audio",dC),s.injectEpic(cC)),null!=n&&n.video&&void 0===s.getState().video&&(s.injectReducer("video",sw),s.injectEpic(lw)),null!=n&&n.screen&&void 0===s.getState().share&&(s.injectReducer("share",wE),s.injectEpic(DE))}return i(qr({apiKey:e,signature:t,language:u,useSDK:this.useSDK})),i(nn({mediaConstraints:o&&o.constraints||{},assetsPath:a,fileWithVersion:d,enforceMultipleVideos:null==o?void 0:o.enforceMultipleVideos,enforceVirtualBackground:null==o?void 0:o.enforceVirtualBackground,skipJsMedia:null==o?void 0:o.skipJsMedia,patchJsMedia:null==o?void 0:o.patchJsMedia,alternativeNameForVideoPlayer:null==o?void 0:o.alternativeNameForVideoPlayer})),void 0!==(null==o?void 0:o.stayAwake)&&i(Si(o.stayAwake)),void 0!==(null==o?void 0:o.quicklyLeaveMeeting)&&i(Ai(o.quicklyLeaveMeeting)),new Promise(((e,t)=>{null!=o&&o.skipJsMedia?e(""):wf(l,(()=>{e("")}),(()=>{t({type:Tl,reason:"dependent assets are not accessible"})}))}))}on(e,t){((e,t)=>{const o=Rc[e];if(o){const n=Oc.get(e);if(n)n.push(t),Oc.set(e,n);else{const n=[t];Oc.set(e,n);const r=ct(...o.map((e=>{const{event:t,payload:o}=e;return st(wc,t).pipe(ze((e=>o(e))),Le(pe))}))).subscribe((t=>{const o=Oc.get(e);o&&o.forEach((e=>{e(t)}))}));Tc.push(r)}}})(e,t)}off(e,t){((e,t)=>{if(Rc[e]){const o=Oc.get(e);if(Array.isArray(o)){const n=o.filter((e=>e!==t));Oc.set(e,n)}}})(e,t)}getFeatureModule(e){return this.modules.get(e)}leave(){const{[Uw]:e,[jw]:t}=this,{socket:{zoomSocketStatus:o}}=e();return o===Lp.Connected||o===Lp.Connecting?t(Br()):t(Fr()),Fe(ut(500).pipe(yt("")))}end(){const{[Uw]:e,[jw]:t}=this;return"connected"===e().socket.zoomSocketStatus?(t(Hr()),Fe(ut(500).pipe(Ot((()=>{Lc()})),yt("")))):Promise.resolve("")}changeName(e,t){const o=this[Vw].getState(),{meeting:{bAllowAttendeeRename:n}}=o,r=Ip(o),i=ap(r.userRole),s=Ap(o);if(i)return Promise.reject({type:wl});if(t&&t!==(null==r?void 0:r.userId)){if(s){const{participants:{attendeesList:n}}=o,r=n.find((e=>e.userId===t));if(r)return pO.rename(t,dr(e),dr(r.displayName)),ny({userId:t,key:"displayName"},(t=>t.displayName===e));{const n=_p(o).find((e=>e.userId===t));if(n){const t=LE.getInstance();return pO.rename(n.userId,dr(e),dr(n.displayName)),t.rename(n.jid,e),kc(qs,(t=>{const o=t.find((e=>e.jid===n.jid));return o&&o.displayName===e}))}return Promise.reject({type:Tl,reason:"no matching user"})}}return Promise.reject({type:wl})}return e===r.displayName?Promise.resolve():s||n?(pO.rename(r.userId,dr(e),dr(r.displayName)),kc(Ws,(t=>t.displayName===e))):Promise.reject({type:wl,reason:"host disallow rename themselves"})}makeHost(e){return pO.assignHost(e,!1),ny({userId:e,key:"isHost"},(e=>!0===e.isHost))}makeCoHost(e){const t=this[Vw].getState(),o=wp(t).find((t=>t.userId===e));return!0===(null==o?void 0:o.bCoHost)?Promise.reject({type:Tl,reason:`user:[${e}] is already co-host `}):(pO.assignHost(e,!0),ny({userId:e,key:"bCoHost"},(e=>!0===e.bCoHost)))}revokeCoHost(e){const t=this[Vw].getState(),o=wp(t).find((t=>t.userId===e));return!1===(null==o?void 0:o.bCoHost)?Promise.reject({type:Tl,reason:`user:[${e}] is not a co-host`}):(pO.revokeCoHost(e),ny({userId:e,key:"bCoHost"},(e=>!1===e.bCoHost)))}reclaimHost(){const e=this[Uw](),{meeting:{isOriginHost:t}}=e,o=Ip(e);return null!=o&&o.isHost?Promise.resolve(""):t?(pO.reclaimHost(o.userId,!1),kc(Ws,(e=>!0===e.isHost))):Promise.reject({type:wl,reason:"You are not the origin host"})}isHost(){const e=this[Vw].getState(),t=Ip(e);return!!t&&t.isHost}isCoHost(){const e=this[Vw].getState(),t=Ip(e);return!!t&&!!t.bCoHost}isOriginHost(){const{meeting:{isOriginHost:e}}=this[Uw]();return e}getCurrentUserInfo(){const e=this[Vw].getState(),t=Ip(e);if(t){const o=Xw(t);if(e.meeting.isWebinar&&ap(t.userRole)){const{audio:t}=e,n=null==t?void 0:t.isAllowToTalk;Object.assign(o,{isAllowToTalk:n})}if(e.breakoutRoom&&rO(e)){const{breakoutRoom:{currentRoom:{boId:t}}}=e;Object.assign(o,{bid:t})}return o}return null}getParticipantsList(){const e=this[Vw].getState(),{meeting:{meetingStatus:t}}=e,o=Ip(e);if(t===Di.Joined&&o&&!o.bHold){var n,r;const t=e.breakoutRoom&&rO(e)?null===(n=e.breakoutRoom)||void 0===n||null===(r=n.currentRoom)||void 0===r?void 0:r.boId:"";return wp(e).map((e=>{const o=Xw(e);return t&&Object.assign(o,{bid:t}),o}))}return[]}getAssistantsList(){const e=this[Vw].getState(),{meeting:{meetingStatus:t}}=e,o=Ip(e);return t===Di.Joined&&o?Op(e).map((e=>({userId:e.userId,displayName:e.displayName,isNewAst:!0}))):[]}getMeetingHost(){var e;const t=this[Uw]();let o=Tp(t);return o||(null===(e=t.breakoutRoom)||void 0===e?void 0:e.currentRoom.status)!==cp.InRoom||(o=t.breakoutRoom.mainSessionAttendeeList.find((e=>e.isHost))),void 0!==o?Xw(o):null}getMeetingInfo(){const{meeting:{meetingStatus:e,isOnHold:t,meetingNumber:o,passWord:n,userName:r,userEmail:i,meetingTopic:s,meetingOptions:a,encType:d,region:u,network:l,topic:c,zlkJwtToken:p,userId:h,lang:m,inviteEmail:v,meetingId:g,participantID:f,h323Password:y,recordingDisclaimer:S,recordingDisclaimerForRecorder:b,wrInfo:E,meetingInfo:I,isNewJoinFlow:A,chatModerationPolicy:C}}=this[Uw](),_=e===Di.Joined&&!t;if(p)return{topic:c,password:n,userName:r,isInMeeting:_,userId:h,meetingId:g};{let e="";return 0===d?e="None":1===d?e="AES ECB":2===d&&(e="AES GCM"),{meetingNumber:o,password:n,userName:r,userEmail:i,inviteEmail:v,meetingTopic:s,encryptionType:e,region:u,network:l,isInMeeting:_,userId:h,lang:m,webEndpoint:Nf(),meetingId:g,participantId:f,telPwd:y,recordingInfo:{recordingDisclaimer:S,recordingDisclaimerForRecorder:b,isUserEnableRecordingReminder:null==a?void 0:a.isUserEnableRecordingReminder},wrInfo:Object.assign({},E,{isNew:A}),scheduleInfo:I,chatModerationPolicy:C}}}},Nw(cO.prototype,"end",[$w,Fw],Object.getOwnPropertyDescriptor(cO.prototype,"end"),cO.prototype),Nw(cO.prototype,"changeName",[Fw],Object.getOwnPropertyDescriptor(cO.prototype,"changeName"),cO.prototype),Nw(cO.prototype,"makeHost",[dO,$w,Fw],Object.getOwnPropertyDescriptor(cO.prototype,"makeHost"),cO.prototype),Nw(cO.prototype,"makeCoHost",[uO,$w,Fw],Object.getOwnPropertyDescriptor(cO.prototype,"makeCoHost"),cO.prototype),Nw(cO.prototype,"revokeCoHost",[lO,$w,Fw],Object.getOwnPropertyDescriptor(cO.prototype,"revokeCoHost"),cO.prototype),Nw(cO.prototype,"reclaimHost",[Fw],Object.getOwnPropertyDescriptor(cO.prototype,"reclaimHost"),cO.prototype),cO);const mO=Ns.createAgent(),vO=LE.getInstance(),gO=(e,t,o)=>{const n=null==t?void 0:t.userId;if(null==e||!e.zoomID||null==t||!t.displayName||n===e.userId)return{type:Tl,reason:"invalid target user"};const{chat:{chatPrivilege:r,panelistChatPrivilege:i},meeting:{isWebinar:s}}=o,a=Ap(o),d=t.isHost||t.bCoHost;let u=!1;if(!a){if(s)if(ap(e.userRole))(r===gs.NoAttendee||r===gs.AllPanelist&&n!==ys.Panelist||r===gs.All&&n!==ys.All&&n!==ys.Panelist)&&(u=!0);else{const e=ap(null==t?void 0:t.userRole);(i===fs.Invalid||i===fs.AllPanelist&&(e||n===ys.All))&&(u=!0)}else(r===gs.NoAttendee||r===gs.Host&&!d||n===ys.SilentModeUsers||r===gs.EveryonePublicly&&n!==ys.All&&!d)&&(u=!0);if(u)return{type:wl,reason:"Insufficient chat privilege"}}return null};function fO(e,t){if(t===ys.All)return _s;if(t===ys.Panelist)return Rs;if(t===ys.SilentModeUsers)return ws;{const{meeting:{isWebinar:o},participants:{xmppAttendeeList:n,attendeesList:r}}=e;return o?r.find((e=>e.userId===t))||n.find((e=>e.userId===t)):r.find((e=>e.userId===t))}}function yO(e,t,o){if(null!=o&&o.host)return[Tp(e),...Dp(e)].filter((e=>(null==e?void 0:e.userId)!==t)).map((e=>({userId:null==e?void 0:e.userId,displayName:null==e?void 0:e.displayName,isHost:null==e?void 0:e.isHost,isCoHost:null==e?void 0:e.bCoHost})));{let n=[Tp(e),...Dp(e),...e.participants.attendeesList.filter((e=>!(e.bCoHost||e.isHost||e.bHold)))];if(null!=o&&o.includeAttendee){const t=_p(e).filter((e=>!ip(e.userType)));n=[...n,...t]}return n.filter((e=>void 0!==e&&e.userId!==t)).map((e=>({userId:null==e?void 0:e.userId,displayName:null==e?void 0:e.displayName,isHost:null==e?void 0:e.isHost,isCoHost:null==e?void 0:e.bCoHost})))}}function SO(e){const{text:t,destId:o,sn:n,attendeeId:r}=e;return is.beginEncrypt({text:t,type:ts.RWG_CHAT}).then((e=>{mO.chat(e,o,n,r)}))}function bO(e,t){const{chat:{chatHistory:o}}=t;return o.find((t=>{var o,n;return(null===(o=t.file)||void 0===o||null===(n=o.upload)||void 0===n?void 0:n.uniqueId)===e}))}function EO(e,t){const{meeting:{isWebinar:o},participants:{attendeesList:n}}=t,{destNodeID:r,senderName:i,attendeeNodeID:s}=e,a=n.find((e=>e.userId===r)),d=e.sn?e.sn:null==a?void 0:a.zoomID,u=i?ur(i):null==a?void 0:a.displayName;let l,c="";if(s===ys.SilentModeUsers)return{sender:{name:"Host",userId:r},receiver:{name:"Everyone (in Waiting Room)",userId:s},timestamp:(new Date).getTime()};if(s===ys.All)c=o?"All panelists and attendees":"Everyone";else if(s===ys.Panelist)c="All panelists";else{if(o){const e=_p(t).find((e=>e.userId===s));e&&(c=e.displayName)}if(!c){const e=n.find((e=>e.userId===s));e&&(c=e.displayName,l=e.userGUID)}}return{sn:d,sender:{name:u,userId:r,userGuid:null==a?void 0:a.userGUID,avatar:null==a?void 0:a.avatar},receiver:{name:c,userId:s,userGuid:l},timestamp:(new Date).getTime()}}function IO(e){var t;const[o]=e.split(".").reverse();return null!==(t=ks[o])&&void 0!==t?t:""}function AO(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];if(!r.file&&(!r.id&&r.sender.userId===t.userId&&[ys.All,ys.Panelist,ys.IndividualCcPanelist,t.destNodeID].includes(r.receiver.userId)&&o.unshift(r),r.id))break}return o.length>0?o[0]:null}const CO=lb.getInstance(),_O=CO.makeLogger(["File Transfer"]);function RO(e,t,o){const{name:n,size:r}=e,{meeting:{reportDomain:i,svcUrl:s,conId:a}}=o;return`https://${i}${t}?${new URLSearchParams({filename:n,filesize:r,rwg:s,cid:a}).toString()}`}function wO(e,t){return t.fileObj?`${e}/zoomfile/download?objkey=${t.fileObj}&business=meeting`:`${e}/file/${t.fileID}?business=meeting`}function OO(e,t){return{fileName:e.name,fileSize:e.size,receiverId:null==t?void 0:t.userId,receiverGuid:null==t?void 0:t.userGuid}}function TO(e,t,o){CO.report(`${e}. file name:${sb(t.name)},file size:${t.size}, ${"type"in t?`file type:${t.type}`:""}, error:${o.name};${o.message}`,["File Transfer"])}function DO(e){var t,o,n;return{id:e.id,fileName:null===(t=e.file)||void 0===t?void 0:t.name,fileSize:null===(o=e.file)||void 0===o?void 0:o.size,fileUrl:null===(n=e.file)||void 0===n?void 0:n.fileUrl,senderId:e.sender.userId,senderGuid:e.sender.userGuid}}function PO(e,t,o){return new Promise(((n,r)=>{const i=new FileReader;i.readAsArrayBuffer(e.slice(t,o)),i.onload=e=>{var t;return n(null===(t=e.target)||void 0===t?void 0:t.result)},i.onerror=e=>r(e)}))}async function kO(e,t){let[o,n]=[e.size,0];null!=t&&(o=Math.min(Ts.ChunkSize,e.size-t),n=t);const r=e.size-n<=Ts.ChunkSize,i=Math.ceil(o/Ts.EncodeBlockSize);try{return function(e){const t=e.reduce(((e,t)=>e+t.byteLength),0),o=new Uint8Array(t);let n=0;for(const t of e)o.set(new Uint8Array(t),n),n+=t.byteLength;return o}(await Promise.all(Array.from({length:r?Math.max(i-1,1):i},((e,t)=>({start:t*Ts.EncodeBlockSize+n,end:(r&&t===i-2?t+2:t+1)*Ts.EncodeBlockSize+n}))).map((async o=>{let{start:n,end:r}=o;try{const t=await PO(e,n,r);return t?await is.beginEncrypt({text:new Uint8Array(t),type:ts.CHAT_FILE}):Promise.reject(null)}catch(o){return TO(`encrypt file buffer error. offset:${t},`,e,o),Promise.reject(o)}}))))}catch(e){console.warn(e)}return null}function MO(e,t,o,n){return n.pipe($t(`${Uv}`,`${No}`),mt((n=>{if(n.type===`${No}`)return!0;const{payload:{uniqueId:r,fileName:i,userId:s}}=n;return t===r&&e.name===i&&o.userId===s})),ft(1),Ot((n=>{_O.info(`Cancel file upload. file name:${sb(e.name)},file size:${e.size},receiver id:${o.userId}`),Dc(va,{...OO(e,o),progress:0,status:Ds.Cancel,retryToken:n.type===`${Uv}`?t:void 0})})))}function LO(e,t){if(null!=e&&e.file){const{file:o,receiver:n}=e,{upload:{chunkIndex:r,totalChunks:i,uniqueId:s}}=o;return Dc(va,{...OO(t,n),progress:Math.floor((null!=r?r:0)/(null!=i?i:1)*100),status:Ds.Fail,retryToken:s}),Ue([Vv({upload:{status:Ds.Fail,progress:0,uniqueId:s}}),jv({uniqueId:s,file:t})])}return fe}function NO(e,t){return Dc(va,{...OO(e),progress:0,status:Ds.Fail}),je(Vv({upload:{status:Ds.Fail,progress:0,uniqueId:t}}))}async function VO(e,t,o,n){const r=RO(e,"/wc/fileupload",n.value),i=new FormData;try{const s=await kO(e),a=bO(t,n.value);if(s&&a){i.append("file",new File([s],e.name));const{meeting:{zmk:d}}=n.value,{receiver:u}=a;return zE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:d},crossDomain:br(r),body:i,includeUploadProgress:!0}).pipe(Rt(MO(e,t,u,o)),Xe((o=>{const{type:r,loaded:i,responseHeaders:s,total:a}=o;let d=0,l=Ds.InProgress;const c={upload:{uniqueId:t}},p=[];if("upload_loadstart"===r)d=0;else if("upload_progress"===r)d=Math.floor(i/a*100*.9);else if("upload_load"===r)d=90;else if("download_load"===r){var h,m;d=100,l=Ds.Success;const{chat:{fileServerDomain:e}}=n.value,t=null===(h=s["zoom-file-id"])||void 0===h?void 0:h.trim(),o=null===(m=s["zoom-file-obj"])||void 0===m?void 0:m.trim(),r=wO(e,{fileObj:o});Object.assign(c,{fileID:t,fileObj:o,fileUrl:r})}return Object.assign(c.upload,{progress:d,status:l}),(d>0||"upload_loadstart"===r)&&(Dc(va,{...OO(e,u),progress:d,status:l}),p.push(Vv(c))),Ue(p)})),gt((t=>(console.warn(t),TO("Upload small file error.",e,t),LO(a,e)))))}}catch(e){console.warn(e)}return NO(e,t)}const UO=(()=>{const e=new Rf;return t=>async function(){await e.acquire(),t(...arguments),setTimeout((()=>{e.release()}),3e3)}})(),jO=function(e){const t=["chatFileTransfer"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return UO(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}(Ns.createAgent()),xO={chatHistory:[],chatPrivilege:gs.All,panelistChatPrivilege:fs.AllPanelist,isAllowAttendeeChat:!0,isFileTransferEnable:!0,isEnableFileTransferEncrypted:!0,fileTransferFileType:[],fileDownloadPromptIgnoreList:[],fileTransferSizeLimit:0,fileServerDomain:"",failedFileTransfer:{}},BO=ko({[`${Tv}`]:_E(((e,t)=>{let{payload:o}=t;e.chatHistory.push(o)})),[`${wv}`]:_E(((e,t)=>{let{payload:o}=t;e.chatPrivilege=o})),[`${Ov}`]:_E(((e,t)=>{let{payload:o}=t;e.panelistChatPrivilege=o})),[`${Pv}`]:_E(((e,t)=>{let{payload:o}=t;e.isAllowAttendeeChat=o})),[`${kv}`]:_E(((e,t)=>{let{payload:o}=t;const{destNodeID:n,msgID:r,userId:i}=o,s=AO(e.chatHistory,{userId:i,destNodeID:n});s&&Object.assign(s,{id:r})})),[`${Mv}`]:_E(((e,t)=>{let{payload:o}=t;const{msgId:n}=o,r=e.chatHistory.findIndex((e=>e.id===n));r>=0&&e.chatHistory.splice(r,1)})),[`${Lv}`]:_E(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${Nv}`]:_E(((e,t)=>{let{payload:o}=t;const{originFile:n,...r}=o;e.chatHistory.push(r)})),[`${Vv}`]:_E(((e,t)=>{let{payload:o}=t;const{upload:n,download:r,originFile:i,...s}=o;if(n){var a;const{uniqueId:t,...o}=n,r=e.chatHistory.find((e=>{var o;return e.file&&(null===(o=e.file.upload)||void 0===o?void 0:o.uniqueId)===t}));null!=r&&null!==(a=r.file)&&void 0!==a&&a.upload&&(Object.assign(r.file.upload,{...o}),Object.assign(r.file,{...s}),r.file.upload.status===Ds.Success&&e.failedFileTransfer[r.file.upload.uniqueId]&&delete e.failedFileTransfer[r.file.upload.uniqueId])}else if(r){const{id:t,fileUrl:o}=s,n=e.chatHistory.find((e=>{var n;return e.id===t&&(null===(n=e.file)||void 0===n?void 0:n.fileUrl)===o}));null!=n&&n.file&&(n.file.download?Object.assign(n.file.download,{...r}):Object.assign(n.file,{download:r}))}})),[`${Uv}`]:_E(((e,t)=>{let{payload:o}=t;const{uniqueId:n,fileName:r,userId:i}=o,s=e.chatHistory.find((e=>e.file&&e.file.name==r&&e.file.upload.uniqueId===n&&e.file.upload.status===Ds.InProgress&&e.receiver.userId===i));var a;null!=s&&s.file&&Object.assign(null===(a=s.file)||void 0===a?void 0:a.upload,{status:Ds.Cancel,progress:0})})),[`${jv}`]:_E(((e,t)=>{let{payload:o}=t;const{uniqueId:n,file:r}=o;e.failedFileTransfer[`${n}`]||Object.assign(e.failedFileTransfer,{[`${n}`]:r})})),[`${xv}`]:_E(((e,t)=>{let{payload:o}=t;const{fileID:n,msgID:r,senderId:i}=o,s=e.chatHistory.find((e=>{var t;return(null===(t=e.file)||void 0===t?void 0:t.fileID)===n&&e.sender.userId===i}));s&&Object.assign(s,{id:r})})),[`${Bv}`]:_E(((e,t)=>{let{payload:o}=t;const{id:n,fileUrl:r}=o,i=e.chatHistory.find((e=>{var t,o;return e.id===n&&(null===(t=e.file)||void 0===t?void 0:t.fileUrl)===r&&(null===(o=e.file)||void 0===o?void 0:o.download.status)===Ps.InProgress}));var s;null!=i&&i.file&&Object.assign(null===(s=i.file)||void 0===s?void 0:s.download,{status:Ps.Cancel,progress:0})})),[`${Dv}`]:()=>({...xO})},xO);var FO;const HO=Ns.createAgent();let $O=(FO=class extends Zw{send(e,t){if(!e)return Promise.reject({type:Tl,reason:"Text is empty"});const{[Uw]:o,[jw]:n}=this,r=o(),i=Ip(r),s=fO(r,t),a=gO(i,s,r);if(a)return Promise.reject(a);const{meeting:{isWebinar:d,encType:u}}=r,l=u===es.AES_GCM;let c=Promise.resolve(),p=!1;const h=d&&ap(s.userRole);return t===ys.SilentModeUsers?HO.chat(dr(e),t):d?h?8&~s.clientCap?(c=SO({text:e,destId:ys.Panelist,sn:null==i?void 0:i.zoomID,attendeeId:t}).then((()=>function(e){const{text:t,jid:o,isGCMEnabled:n}=e;return is.beginEncrypt({text:t,type:ts.XMPP_CHAT}).then((e=>{vO.sendWebinarMseeage(e,o,ys.IndividualCcPanelist,n)}))}({text:e,jid:s.jid,isGCMEnabled:l}))),p=!0):c=SO({text:e,destId:ys.IndividualCcPanelist,sn:null==i?void 0:i.zoomID,attendeeId:t}):s&&(c=SO({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID})):c=SO({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID}),c.then((()=>{const o=function(e,t,o,n){const r=(new Date).getTime(),i=performance.now();return{message:e,sender:{name:t.displayName,userId:t.userId,userGuid:t.userGUID,avatar:t.avatar},receiver:{name:null==o?void 0:o.displayName,userId:n?ys.IndividualCcPanelist:null==o?void 0:o.userId,userGuid:null==o?void 0:o.userGUID},timestamp:r,highResTimeStampForIdentification:i}}(e,i,s,h);return n(Tv(o)),p?(Dc(ca,o),o):new Promise(((e,n)=>{Mc(ha).pipe(We(5e3),At((e=>o.highResTimeStampForIdentification!==e.identification||!([e.receiverId,ys.All,ys.Panelist].includes(t)||e.receiverId===ys.IndividualCcPanelist))),ft(1)).subscribe((t=>{const{msgId:n}=t,{highResTimeStampForIdentification:r,...i}=o,a={id:n,...i,...h&&{receiver:{name:null==s?void 0:s.displayName,userId:null==s?void 0:s.userId}}};Dc(ca,a),e(a)}),(()=>{n({type:Rl})}))}))}))}setPrivilege(e){const t=this[Uw](),{meeting:{isWebinar:o},chat:{chatPrivilege:n},breakoutRoom:r}=t;return n===e?Promise.resolve(""):(null==r?void 0:r.controlStatus)===up.InProgress&&rO(t)?Promise.reject({type:Cl,reason:"Cannot update chat privilege in a subsession"}):!o&&!Es.includes(e)||o&&!Is.includes(e)?Promise.reject({type:Tl,reason:"invalid privilege value of parameter"}):(HO.setChatPriviledge(e),kc(pa,(t=>t.chatPrivilege===e)))}setPanelistPrivilege(e){const t=this[Uw](),{chat:{panelistChatPrivilege:o}}=t,n=Cs[e];return o===n?Promise.resolve(""):Object.values(As).includes(e)?(HO.setPanelistChatPrivilege(e),kc(pa,(e=>e.panelistChatPrivilege===n))):Promise.reject({type:Tl,reason:"Panelist privilege value is invalid"})}deleteMessage(e){const t=this[Uw](),{chat:{chatHistory:o},meeting:{meetingOptions:n,userId:r}}=t;if(null!=n&&n.isEnableDeleteChatMsg){const n=Ap(t),i=o.find((t=>t.id===e));if(i){const{sender:t}=i;if(n)HO.chatCmdReq(e,Ss.Delete);else{if(t.userId!==r)return Promise.reject({type:wl,reason:"can not delete message"});HO.chatCmdReq(e,Ss.Delete)}return kc(ma,(t=>t.id===e)).then((()=>({id:e})))}return Promise.reject({type:Tl,reason:"msgId is wrong"})}return Promise.reject({type:Cl,reason:"can not delete messages"})}lockChat(e){const t=this[Uw](),{meeting:{meetingOptions:o}}=t,n=null!=o&&o.isPrivateChatEnabled?gs.All:gs.EveryonePublicly;return this.setPrivilege(e?gs.NoOne:n)}sendFile(e,t){if(!e)return Promise.reject({type:Tl,reason:"File is empty"});const{[Uw]:o,[jw]:n}=this,r=o(),{chat:{isFileTransferEnable:i,fileTransferFileType:s,fileTransferSizeLimit:a,failedFileTransfer:d}}=r;if(!i)return Promise.reject({type:Cl,reason:"Send files via in-session chat is not enabled"});if("string"==typeof e){const t=bO(e,r);if(null!=t&&t.file&&d[e]){const{file:{upload:o,...r}}=t,{file:{name:i,upload:{uniqueId:s}},receiver:{userId:a}}=t;return n(Vv({originFile:d[e],...r,upload:{...o,status:Ds.InProgress}})),Promise.resolve((()=>{n(Uv({uniqueId:s,fileName:i,userId:a}))}))}return Promise.reject({type:Tl,reason:"Retry token is not correct."})}{const{name:o}=e;if(s.length>0){const[e]=o.split(".").reverse();if(!s.some((t=>t===e)))return Promise.reject({type:Cl,reason:"File is not in the allow list"})}if(e.size>a)return Promise.reject({type:Cl,reason:"File size exceeds the maximum limit."});const i=Ip(r),d=fO(r,t),u=gO(i,d,r);if(u)return Promise.reject(u);const l=vr();return n(Nv(function(e,t,o,n,r){const i=(new Date).getTime();return{file:{name:e.name,size:e.size,type:e.type,upload:{progress:0,uniqueId:t,totalChunks:0,chunkIndex:0}},originFile:e,sender:{name:o.displayName,userId:o.userId,userGuid:o.userGUID,avatar:o.avatar},receiver:{name:null==n?void 0:n.displayName,userId:null==n?void 0:n.userId,attendeeId:void 0,userGuid:null==n?void 0:n.userGUID},timestamp:i}}(e,l,i,d))),Promise.resolve((()=>{n(jv({uniqueId:l,file:e})),n(Uv({uniqueId:l,fileName:o,userId:null==d?void 0:d.userId}))}))}}downloadFile(e,t,o){const{[Uw]:n,[jw]:r}=this,{chat:{chatHistory:i}}=n();if(!e||!t)return Promise.reject({type:Tl,reason:"Invalid message id or file url!"});const s=i.find((o=>{var n;return o.id===e&&(null===(n=o.file)||void 0===n?void 0:n.fileUrl)===t}));return s?(r(Vv({id:e,fileUrl:t,download:{status:Ps.InProgress,progress:0,blob:o}})),Promise.resolve((()=>r(Bv({id:e,fileUrl:t}))))):Promise.reject({type:Tl,reason:"Invalid message id or file url!"})}getPrivilege(){const{chat:{chatPrivilege:e,isAllowAttendeeChat:t}}=this[Uw]();return t?e:gs.NoAttendee}getReceivers(){const e=this[Uw](),{chat:{chatPrivilege:t,panelistChatPrivilege:o,isAllowAttendeeChat:n},meeting:{isWebinar:r}}=e;if(!r&&!n)return[];const i=Ip(e),s=Ap(e);if(i)if(r)if(ap(i.userRole)){if(!n)return[];if(t===gs.All)return[Rs,_s];if(t===gs.AllPanelist)return[Rs];if(t===gs.NoOne)return[]}else{if(s||o===fs.Everyone){const t=yO(e,i.userId,{includeAttendee:!0});return[Rs,_s,...t]}if(o===fs.AllPanelist){const t=yO(e,i.userId);return[Rs,...t]}}else{const o=Ap(e);if(t===gs.All||o){const t=yO(e,i.userId);return[_s,...t]}if(t===gs.Host)return yO(e,i.userId,{host:!0});if(t===gs.EveryonePublicly){const t=yO(e,i.userId,{host:!0});return[_s,...t]}if(t===gs.NoOne)return[]}return[]}getHistory(){return this[Uw]().chat.chatHistory.map((e=>{const{highResTimeStampForIdentification:t,...o}=e;if(o.file){const{name:e,size:t,type:n,fileUrl:r,upload:i,download:s}=o.file,a={name:e,size:t,type:n,fileUrl:r};return i&&Object.assign(a,{upload:{status:i.status,progress:i.progress}}),s&&Object.assign(a,{download:{status:s.status,progress:s.progress}}),{...o,file:a}}return o}))}isAllowToDeleteMessages(){const e=this[Uw](),{meeting:{meetingOptions:t}}=e;return null==t?void 0:t.isEnableDeleteChatMsg}isFileTransferEnabled(){return this[Uw]().chat.isFileTransferEnable}getFileTransferSetting(){const e=this[Uw](),{chat:{fileTransferFileType:t,fileTransferSizeLimit:o}}=e;return{typeLimit:(null!=t?t:[]).map((e=>`.${e}`)).join(","),sizeLimit:o}}},Nw(FO.prototype,"send",[Fw],Object.getOwnPropertyDescriptor(FO.prototype,"send"),FO.prototype),Nw(FO.prototype,"setPrivilege",[Hw,Fw],Object.getOwnPropertyDescriptor(FO.prototype,"setPrivilege"),FO.prototype),Nw(FO.prototype,"setPanelistPrivilege",[Hw,Fw,function(e,t,o){const n=o.value;o.value=function(){const e=this[Vw];if(e){const{meeting:{isWebinar:t}}=e.getState();if(!t)return Promise.reject({type:Ol,reason:"non-webinar"})}for(var t=arguments.length,o=new Array(t),r=0;rbn(e,24583).pipe(Tt(t),Xe((e=>{let[t,o]=e;if(o.meeting.zlkJwtToken)return fe;const{payload:{body:{sn:n,senderName:r,senderJid:i,receiver:s,text:a,type:d}}}=t,u=Ip(o),l=_p(o),{meeting:{jid:c,userId:p},participants:{xmppAttendeeList:h}}=o;return is.beginDecrypt({decryptedText:a,type:ts.XMPP_CHAT,zoomId:n}).then((e=>{var t;let{message:o}=e,n=null,a=0,m="";u&&ap(u.userRole)&&c===s?(n=h.find((e=>e.jid===i)),a=p,m=u.displayName):d===ys.Panelist&&(n=l.find((e=>e.jid===i)),a=ys.Panelist,m=Rs.displayName);const v={message:o,sender:{name:r,userId:(null===(t=n)||void 0===t?void 0:t.userId)||0,avatar:""},receiver:{name:m,userId:a},timestamp:(new Date).getTime()};return Dc(ca,v),Tv(v)}))}))),epics1:(e,t)=>yn(e,7944).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{meeting:{bIbDisableChat:n}}=o,{payload:{body:{attendeeNodeID:r,sn:i,destNodeID:s,text:a,senderName:d,msgID:u}}}=t,l=Ip(o);if(l){const e=ap(null==l?void 0:l.userRole)&&r===l.userId&&!u;if(!n&&!e){const{sn:e,...t}=EO({destNodeID:s,attendeeNodeID:r,senderName:d,sn:i},o);return(r===ys.SilentModeUsers?Promise.resolve({id:u,message:ur(a),...t}):is.beginDecrypt({decryptedText:a,zoomId:e,type:ts.RWG_CHAT}).then((e=>{let{message:o}=e;return{id:u,message:o,...t}}))).then((e=>(Dc(ca,e),Tv(e))))}}return fe}))),epics2:(e,t)=>yn(e,us).pipe(mt((e=>{var t,o;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.chatPriviledge)||void 0!==(null===(o=e.payload.body)||void 0===o?void 0:o.bAllowAttendeeChat)})),Tt(t),ze((e=>{let[t,o]=e;const{payload:{body:{chatPriviledge:n,bAllowAttendeeChat:r}}}=t,{chat:{chatPrivilege:i}}=o;return void 0!==r?(Dc(pa,!0===r?{chatPrivilege:i}:{chatPrivilege:gs.NoAttendee}),Pv(r)):(Dc(pa,{chatPrivilege:n}),wv(n))}))),epics3:e=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.panelistChatPriviledge)})),ze((e=>{const{payload:{body:{panelistChatPriviledge:t}}}=e;return Dc(pa,{panelistChatPrivilege:t}),Ov(t)}))),epics4:(e,t)=>yn(e,4136).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{payload:{body:{result:n,destNodeID:r,msgID:i,fileID:s}}}=t,{meeting:{userId:a},chat:{chatHistory:d}}=o,u=[];if(n===bs.Success)if(s){const e=d.find((e=>{var t;return(null===(t=e.file)||void 0===t?void 0:t.fileID)===s}));if(e){const{file:t,receiver:o,...n}=e,{name:r,size:d,type:l,fileUrl:c}=null!=t?t:{},{attendeeId:p,...h}=o;Dc(ca,{id:i,file:{name:r,size:d,type:l,fileUrl:c,upload:{status:Ds.Complete,progress:100}},receiver:{...h},...n}),u.push(xv({fileID:s,msgID:i,senderId:a}))}}else{const e=AO(d,{userId:a,destNodeID:r});var l;e&&(Dc(ha,{msgId:i,receiverId:r,identification:null!==(l=e.highResTimeStampForIdentification)&&void 0!==l?l:0}),u.push(kv({destNodeID:r,msgID:i,userId:a})))}else n!==bs.Delete&&n!==bs.Block||u.push(Mv({msgId:i}));return Ue(u)}))),epics5:e=>yn(e,4238).pipe(Xe((e=>{const{payload:{body:{bSuccess:t,cmd:o,msgID:n}}}=e,r=[];return t&&o===Ss.Delete&&(r.push(Mv({msgId:n})),Dc(ma,{id:n})),Ue(r)}))),epics6:e=>yn(e,7960).pipe(Xe((e=>{const{payload:{body:{cmd:t,msgID:o}}}=e,n=[];return t===Ss.Delete&&(n.push(Mv({msgId:o})),Dc(ma,{id:o})),Ue(n)})))},GO=fn(WO,{chatFileEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{var t,o,n;const{payload:{fileTransfer:r,fileServerDomain:i}}=e;return Lv({isFileTransferEnable:null==r?void 0:r.isEnable,isEnableFileTransferEncrypted:null==r?void 0:r.isEnableFileTransferEncrypted,fileTransferFileType:(null!==(t=null==r?void 0:r.fileType)&&void 0!==t?t:"").replace(/\./g,"").split(",").filter(Boolean),fileTransferSizeLimit:1024*(null!==(o=null==r?void 0:r.sizeLimit)&&void 0!==o?o:0)*1024||Ts.MaxSize,fileDownloadPromptIgnoreList:(null!==(n=null==r?void 0:r.fileDownloadPromptIgnoreList)&&void 0!==n?n:"").replace(/\./g,"").split(","),fileServerDomain:`https://${i}`})}))),chatFileEpics1:(e,t)=>e.pipe($t(`${Nv}`),Xe((async o=>{const{payload:{originFile:n,file:{upload:{uniqueId:r}}}}=o;return n.size>Ts.ChunkSize?await async function(e,t,o,n){const r=RO(e,"/wc/multiupload/init",n.value),i=await async function(e){const t=Math.ceil(e.size/Ts.ReaderChunkSize);return(await Promise.all(Array.from({length:t},((e,t)=>({start:t*Ts.ReaderChunkSize,end:(t+1)*Ts.ReaderChunkSize}))).map((async t=>{let{start:o,end:n}=t;try{const t=await PO(e,o,n);return Ar(await window.crypto.subtle.digest("SHA-256",t))}catch(t){return TO("calculate file hash error.",e,t),Promise.reject(t)}})))).join("")}(e),{meeting:{zmk:s,meetingId:a}}=n.value,d=bO(t,n.value);if(i&&d){const{receiver:n}=d,u={fileName:e.name,length:e.size,channelType:4,digest:i,shareJid:a};return zE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:s},crossDomain:br(r),body:u}).pipe(Rt(MO(e,t,n,o)),ze((o=>{var n;const{responseHeaders:r,response:i}=o,s=null===(n=r["x-zm-trackingid"])||void 0===n?void 0:n.trim(),{uploadid:a,path:d,metadata:u}=i,l=Math.ceil(e.size/Ts.ChunkSize);return Vv({originFile:e,upload:{uniqueId:t,status:Ds.InProgress,progress:0,chunkIndex:0,totalChunks:l,uploadid:a,trackingId:s,path:d,metadata:u}})})),gt((t=>(console.warn(t),TO("Upload file meta error.",e,t),LO(d,e)))),Ct(Vv({upload:{uniqueId:t,status:Ds.Init}})))}return NO(e,t)}(n,r,e,t):await VO(n,r,e,t)})),Xe((e=>e))),chatFileEpics2:(e,t)=>e.pipe($t(`${Vv}`),mt((e=>{var t;return(null===(t=e.payload.upload)||void 0===t?void 0:t.status)===Ds.Success})),dy((async e=>{const{payload:{upload:{uniqueId:o}}}=e,{chat:{isEnableFileTransferEncrypted:n,chatHistory:r}}=t.value,i=r.find((e=>{var t,n;return(null===(t=e.file)||void 0===t||null===(n=t.upload)||void 0===n?void 0:n.uniqueId)===o})),s=[];if(i&&i.file){const{file:{name:e,size:t,fileObj:r,fileID:a,type:d},receiver:{userId:u,attendeeId:l}}=i;let[c,p]=["",""];if(n){const[o,n]=await Promise.all([e,`${t}`].map((e=>is.beginEncrypt({text:e,type:ts.RWG_CHAT}))));[c,p]=[o,n]}else[c,p]=[e,`${t}`].map((e=>dr(e)));await jO.chatFileTransfer({fileID:a,fileSize:p,fileName:c,fileObj:r,type:d,destNodeID:u,attendeeNodeID:l}),s.push(Vv({upload:{uniqueId:o,status:Ds.Complete}}))}return s}))),chatFileEpics3:(e,t)=>e.pipe($t(`${Vv}`),mt((e=>{const{payload:{upload:t,originFile:o}}=e;return!!t&&!!t.uniqueId&&t.status===Ds.InProgress&&(null==o?void 0:o.size)<=Ts.ChunkSize&&0===t.totalChunks})),Xe((async o=>{const{payload:{originFile:n,upload:{uniqueId:r}}}=o;return await VO(n,r,e,t)})),Xe((e=>e))),chatFileEpics4:(e,t)=>e.pipe($t(`${Vv}`),mt((e=>{const{payload:{upload:t}}=e;return!!t&&!!t.uniqueId&&t.totalChunks>0&&t.chunkIndex!==t.totalChunks})),Xe((async o=>{const{payload:{originFile:n,upload:{uniqueId:r}}}=o;return await async function(e,t,o,n){const r=bO(t,n.value);if(null!=r&&r.file){const{file:{upload:{chunkIndex:i,totalChunks:s,uploadid:a,path:d,trackingId:u,etags:l},size:c},receiver:p}=r,h=i*Ts.ChunkSize,m=await kO(e,h);if(m){const{chat:{fileServerDomain:h},meeting:{zmk:v}}=n.value,g=`${h}/upload/parts?${new URLSearchParams({uploadid:a,partNumber:i+1}).toString()}`,f=new FormData,y=new File([m],e.name);return f.append("file",y),zE({url:g,method:"POST",headers:{"Zoom-File-Size":y.size,"Zoom-File-Path":d,"x-zm-trackingid":u,"Zoom-File-Origin":"redirect=support_auth",zmk:v},crossDomain:br(g),body:f,includeUploadProgress:!0}).pipe(Rt(MO(e,t,p,o)),Xe((o=>{var r;const{type:a,loaded:d,total:u,responseHeaders:h}=o;let m=0;const v={upload:{uniqueId:t,status:Ds.InProgress}},g=[],f=bO(t,n.value),y=null==f||null===(r=f.file)||void 0===r?void 0:r.upload.progress;if("upload_loadstart"===a)m=y||Math.floor(i/s*100);else if("upload_progress"===a)m=Math.floor((i*Ts.ChunkSize+.9*d)/c*100);else if("upload_load"===a)m=Math.floor((i*Ts.ChunkSize+.9*u)/c*100);else if("download_load"===a){m=y||Math.floor((i+1)/s*100);const t=h["x-zm-etag"].trim(),o=l?{...l,[`${i+1}`]:t}:{[`${i+1}`]:t};Object.assign(v.upload,{etags:o,chunkIndex:i+1,totalChunks:s}),Object.assign(v,{originFile:e})}return(m>0||"upload_loadstart"===a)&&(Object.assign(v.upload,{progress:m}),Dc(va,{...OO(e,p),progress:m,status:Ds.InProgress}),g.push(Vv(v))),Ue(g)})),gt((t=>(console.warn(t),TO(`Upload file chunk error. chunk:${i},total chunks:${s},uploadid:${a},trackingId:${u}`,e,t),LO(r,e)))))}}return NO(e,t)}(n,r,e,t)})),Xe((e=>e))),chatFileEpics5:(e,t)=>e.pipe($t(`${Vv}`),mt((e=>{const{payload:{upload:t}}=e;return!!t&&!!t.uniqueId&&t.totalChunks>0&&t.chunkIndex==t.totalChunks})),Xe((o=>{const{payload:{originFile:n,upload:{uniqueId:r}}}=o;return function(e,t,o,n){const{chat:{fileServerDomain:r},meeting:{zmk:i}}=n.value,s=bO(t,n.value);if(null!=s&&s.file){const{file:{upload:{uploadid:a,metadata:d,etags:u,trackingId:l}},receiver:c}=s,p=`${r}/upload/complete?uploadid=${a}`;return zE({url:p,method:"POST",headers:{"x-zm-trackingid":l,"Zoom-File-Origin":"redirect=support_auth",zmk:i},crossDomain:br(p),body:{metadata:d,etags:u}}).pipe(Rt(MO(e,t,c,o)),ze((o=>{var r,i;const{chat:{fileServerDomain:s}}=n.value,{responseHeaders:a}=o,d=null===(r=a["zoom-file-id"])||void 0===r?void 0:r.trim(),u=null===(i=a["zoom-file-obj"])||void 0===i?void 0:i.trim(),l=`${s}/zoomfile/download?objkey=${u}&business=meeting`;return Dc(va,{...OO(e,c),progress:100,status:Ds.Success}),Vv({fileID:d,fileObj:u,fileUrl:l,upload:{uniqueId:t,progress:100,status:Ds.Success}})})),gt((t=>(console.warn(t),TO(`Upload chunks checksum error.uploadid${a},trackingId${l}`,e,t),LO(s,e)))))}return NO(e,t)}(n,r,e,t)}))),chatFileEpics6:(e,t)=>yn(e,4308).pipe(dy((async e=>{const{payload:{body:{attendeeNodeID:o,destNodeID:n,fileID:r,fileName:i,fileObj:s,fileSize:a,fileType:d,msgID:u,senderName:l}}}=e,{meeting:{bIbDisableChat:c},chat:{fileServerDomain:p,isEnableFileTransferEncrypted:h}}=t.value,m=[];if(!c){const e=wO(p,{fileObj:s,fileID:r});if(d===Os.Local){const{sn:d,...c}=EO({destNodeID:n,attendeeNodeID:o,senderName:l},t.value);let[p,v]=["",0];if(h){const[e,t]=await Promise.all([i,a].map((e=>is.beginDecrypt({decryptedText:e,zoomId:d,type:ts.RWG_CHAT}))));p=e.message,v=Number(t.message)}else p=ur(i),v=Number(ur(a));const g={id:u,file:{name:p,size:v,fileUrl:e},...c};m.push(Tv({...g,file:{...g.file,fileID:r,fileObj:s}})),setTimeout((()=>{Dc(ca,g)}),0)}}return m}))),chatFileEpics7:(e,t)=>e.pipe($t(`${Vv}`),mt((e=>{var t,o;const{payload:n}=e;return n.id&&n.fileUrl&&(null===(t=n.download)||void 0===t?void 0:t.status)===Ps.InProgress&&0===(null===(o=n.download)||void 0===o?void 0:o.progress)})),Xe((o=>function(e,t,o){var n;const{chat:{chatHistory:r},meeting:{zmk:i},participants:{attendeesList:s}}=o.value,a=r.find((t=>t.id===e));if(null!=a&&null!==(n=a.file)&&void 0!==n&&n.fileUrl){const{file:{fileUrl:o}}=a;return zE({url:o,method:"GET",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:i},crossDomain:br(o),responseType:"arraybuffer",includeDownloadProgress:!0}).pipe(Rt(function(e,t){return t.pipe($t(`${Bv}`,`${No}`),mt((t=>{if(t.type===`${No}`)return!0;const{payload:{id:o}}=t;return e.id===o})),ft(1),Ot((()=>{var t,o,n;_O.info(`Cancel file download. file name:${sb(null===(t=e.file)||void 0===t?void 0:t.name)},file size:${null===(o=e.file)||void 0===o?void 0:o.size},sender id:${null===(n=e.sender)||void 0===n?void 0:n.userId}`),Dc(ga,{...DO(e),progress:0,status:Ps.Cancel})})))}(a,t)),dy((async t=>{const{type:o,loaded:n,total:r}=t,i=[],d={...DO(a),progress:0,status:Ps.InProgress};if("download_loadstart"===o&&Object.assign(d,{progress:0}),"download_progress"===o){var u;const t=Math.floor(n/r*100);i.push(Vv({id:e,fileUrl:null===(u=a.file)||void 0===u?void 0:u.fileUrl,download:{progress:t}})),Object.assign(d,{progress:t})}else if("download_load"===o){var l,c,p;const o=100,n=Ps.Success;Object.assign(d,{progress:o,status:n}),i.push(Vv({id:e,fileUrl:null===(l=a.file)||void 0===l?void 0:l.fileUrl,download:{progress:o,status:n}}));const r=null===(c=s.find((e=>e.userId===a.sender.userId)))||void 0===c?void 0:c.zoomID,u=await async function(e,t,o){const n=Math.ceil(e.byteLength/Ts.DecodeBlockSize);try{const r=await Promise.all(Array.from({length:Math.max(n-1,1)},((e,t)=>({start:t*Ts.DecodeBlockSize,end:(t===n-2?t+2:t+1)*Ts.DecodeBlockSize}))).map((async n=>{let{start:r,end:i}=n;try{const t=e.slice(r,i),{message:n}=await is.beginDecrypt({decryptedText:t,zoomId:o,type:ts.CHAT_FILE});return n}catch(o){return TO("decrypt file buffer error.",{name:t,size:e.byteLength},o),Promise.reject(o)}})));return new Blob(r,{type:IO(t)})}catch(e){return null}}(t.response,null===(p=a.file)||void 0===p?void 0:p.name,r);var h,m;u&&(null!==(h=a.file)&&void 0!==h&&h.download.blob?Object.assign(d,{fileBlob:u}):function(e,t){const o=document.createElement("a"),n=window.URL.createObjectURL(e);o.href=n,o.download=t,o.click(),window.URL.revokeObjectURL(n)}(u,null===(m=a.file)||void 0===m?void 0:m.name))}return(d.progress>0||"download_loadstart"===o)&&Dc(ga,d),i})),gt((t=>(console.warn(t),TO(`download file error. file url:${o}`,{name:void 0,size:void 0},t),Dc(ga,{...DO(a),progress:0,status:Ps.Fail}),je(Vv({id:e,fileUrl:o,download:{status:Ps.Fail,progress:0}}))))))}return fe}(o.payload.id,e,t))))});function zO(e,t){const{meeting:{isMeetingReset:o,meetingId:n,meetingNumber:r,userName:i,userEmail:s,tid:a,userId:d,userGUID:u},breakoutRoom:l}=e;let c="";var p;return c=o?null!=l&&null!==(p=l.currentRoom)&&void 0!==p&&p.boConfId?"join breakout room":"meeting failover":"join meeting",{label:c,payload:{meetingId:n,tid:a,userId:d||(null==t?void 0:t.userId),userGUID:u||(null==t?void 0:t.userGUID),meetingNumber:sb(r),userName:sb(i),userEmail:sb(s)}}}function KO(e,t,o){return F(_t((n=>{let r=!1;try{var i,s;const{logger:{options:e},meeting:{logConfig:o}}=t.value;r=null!==(i=null==e?void 0:e.enable)&&void 0!==i?i:null===(s=JSON.parse(o||"{}"))||void 0===s?void 0:s.enable}catch(e){}try{if(r){const{logger:{isLaplaceInitialized:r}}=t.value;if(!r)return e.pipe($t(`${Sf}`),ft(1),Xe((e=>(e.payload&&o(n),fe))));o(n)}}catch(e){console.warn(e)}return fe})))}function qO(e,t,o,n){return In(e,o).pipe(KO(e,t,n))}function JO(e,t,o,n){return yn(e,o).pipe(KO(e,t,n))}function QO(e){var t,o;const{audio:{activeMicrophone:n,activeSpeaker:r,microphoneDevicesList:i,speakerDevicesList:s}}=e;return`microphone: [${n} - ${null==i||null===(t=i.find((e=>e.deviceId===n)))||void 0===t?void 0:t.label}]; speaker: [${r} - ${null==s||null===(o=s.find((e=>e.deviceId===r)))||void 0===o?void 0:o.label}]`}function ZO(e){var t;const{video:{activeCamera:o,cameraDevicesList:n}}=e;return`camera: [${o} - ${null==n||null===(t=n.find((e=>e.deviceId===o)))||void 0===t?void 0:t.label}]`}function YO(e,t){return t?` ,${e}:${t}`:""}const{InitSuccessAudio:XO,InitFailedAudio:eT,InitSuccessVideo:tT,InitFailedVideo:oT,InitSuccessSharing:nT,InitFailedSharing:rT}=Va,{DecodeSuccess:iT,DecodeFailed:sT,EncodeSuccess:aT,EncodeFailed:dT}=Ua,uT={[`${XO}`]:{name:"Audio",isException:!1},[`${eT}`]:{name:"Audio",isException:!0},[`${tT}`]:{name:"Video",isException:!1},[`${oT}`]:{name:"Video",isException:!0},[`${nT}`]:{name:"Sharing",isException:!1},[`${rT}`]:{name:"Sharing",isException:!0}};function lT(e){const t=(null!=e?e:"").split("-");return[...new Set(t)].map((e=>({reason:e,count:t.filter((t=>e===t)).length})))}const cT=lb.getInstance(),pT=()=>{if("connection"in navigator){const{effectiveType:e,rtt:t,downlink:o}=navigator.connection;cT.makeLogger(["Network Connection Type"]).info(`Network connection. ect:${e},rtt:${t},downlink:${o}`)}},hT=lb.getInstance().makeLogger(["Remote Control"]),mT=vb(Hs.getInstance()),vT=[{event:Va.AudioBridgeReconnectStart,message:rb.AudioBridgeReconnectStart,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.AudioBridgeReconnectEnd,message:rb.AudioBridgeReconnectEnd,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.UserGrantCaptureAudio,message:e=>`${rb.DeviceAudioStreamCaptured},${QO(e)}`,logType:"info",additionalTags:["Audio Capture Flow"]},{event:Va.JoinComputerAudioComplete,message:rb.AudioJoinComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.LeaveComputerAudioComplete,message:rb.AudioLeaveComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.JoinSharingAudioComplete,message:rb.SharingAudioStartComplete,logType:"info",additionalTags:["Audio Sharing Flow"]},{event:Va.LeaveSharingAudioComplete,message:rb.SharingAudioStopComplete,logType:"info",additionalTags:["Audio Sharing Flow"]}],gT=[{event:Va.StartVideoCaptureSuccess,message:e=>`${ib.StartCaptureVideoSuccess}, ${ZO(e)}`,logType:"info",additionalTags:["Video Join Flow"]},{event:Va.StopVideoCaptureSuccess,message:ib.StopCaptureVideoSuccess,logType:"info",additionalTags:["Video Join Flow"]},{event:Va.StartVideoStreamInVbSettingSuccess,message:ib.VBSettingSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloadingOk,message:ib.VBPreloadSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloading_3S,message:ib.VBPreloading3S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloading_10S,message:ib.VBPreloading10S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Va.VbSettingParaError,message:ib.VBSettingFailed,logType:"error",additionalTags:["Video VB Flow"]}],fT=vT.map((e=>({...e,tag:"Audio"}))).concat(gT.map((e=>({...e,tag:"Video"})))),yT=lb.getInstance(),{InitSuccessVideo:ST,InitSuccessAudio:bT,InitSuccessSharing:ET,InitFailedVideo:IT,InitFailedAudio:AT,InitFailedSharing:CT,RecoverWebrtcAudio:_T,AudioBridgeFirstRecvData:RT,AudioBridgeCanSendData:wT,UserForbiddedCaptureAudio:OT,AudioWebsocketBroken:TT,AudioZeroData:DT,UserForbiddedCaptureVideo:PT,UserCameraIsTakenByOtherPrograms:kT,VideoWebsocketBroken:MT,StopVideoCaptureFailed:LT,DesktopSharingPermissionDenied:NT,DesktopSharingSystemError:VT,AudioSpeakerSetError:UT,VbSettingParaError:jT,MaskSettingParaError:xT,WebglLostInMultiView:BT,VideoStreamFailed:FT,AudioStreamFailed:HT,NotifyUIFailover:$T}=Va,WT=lb.getInstance(),GT={options:void 0,isLaplaceInitialized:!1},zT=ko({[`${yf}`]:_E(((e,t)=>{let{payload:o}=t;e.options=o})),[`${Sf}`]:_E(((e,t)=>{let{payload:o}=t;e.isLaplaceInitialized=o})),[`${bf}`]:(e,t)=>{let{options:o}=e,{payload:n}=t;return n?{...GT,options:o}:{...GT}}},GT),KT={mlEpics0:(e,t)=>In(e,[ST,bT,ET,IT,AT,CT]).pipe(KO(e,t,(e=>{const{payload:{type:o,data:n}}=e,{meeting:{userId:r}}=t.value,i=function(e,t){const o=uT[`${e}`];if(o){const{name:e,isException:n}=o,r=[e,`${e} Init Flow`];n&&r.push(`${e} exception flow`);let i="";return[iT,sT].includes(t)&&(i=`${i} decode`.trim()),[aT,dT].includes(t)&&(i=`${i} encode`.trim()),[aT,iT].includes(t)&&(i=`${i} success`.trim()),[sT,dT].includes(t)&&(i=`${i} failed`.trim()),{message:`init ${e.toLowerCase()} ${i}`,tags:r,isException:n}}return null}(o,n);if(i){const{message:e,tags:t,isException:o}=i;o?yT.report(`${e}. userId:${r}`,t):yT.makeLogger(t).info(e)}}))),mlEpics1:(e,t)=>qO(e,t,fT.map((e=>e.event)),(e=>{const{payload:{type:o}}=e,n=fT.find((e=>e.event===o));if(n){const{message:e,logType:o,additionalTags:r,tag:i}=n;let s=e;"function"==typeof e&&(s=e(t.value)),s&&yT.makeLogger([i])[o](s,r)}})),mlEpics2:(e,t)=>e.pipe($t(`${Zp}`),mt((e=>!e.payload)),KO(e,t,(()=>{yT.makeLogger(["Audio"]).warn(`Auto play audio failed,${QO(t.value)}`)}))),mlEpics3:(e,t)=>qO(e,t,_T,(()=>{yT.report("Audio bridge, recover audio failed, need to rejoin the audio",["Audio exception flow"])})),mlEpics4:(e,t)=>qO(e,t,[RT,wT],(e=>{const{payload:{type:t}}=e;yT.makeLogger(["Audio"]).log("Audio bridge connection: "+(t===RT?"first receive data":"can send data"))})),mlEpics5:(e,t)=>qO(e,t,$T,(e=>{yT.report(`Audio bridge, notify ui failover, subreason:${e.payload.data}`,["Audio exception flow"])})),mlEpics6:(e,t)=>qO(e,t,[OT,TT,DT,UT,HT],(e=>{const{payload:{type:o}}=e;let n=`Audio error case:${o}`;o===OT?n="Audio capture is forbidden by the user":o===DT?t.value.audio.webrtcRestartCount<3&&(n="audio capture zero data, auto failover"):o===UT?n="audio change speaker error":o===HT&&(n="audio stream ended or muted, stop capture audio"),yT.report(`${n},${QO(t.value)}`,["Audio exception flow"])})),mlEpics7:(e,t)=>qO(e,t,[PT,kT,MT,LT,FT],(e=>{const{payload:{type:o,data:n}}=e;let r=`Video error case:${o}`;if(o===PT)r="Video capture is forbidden by the user"+(n?` (error name:${null==n?void 0:n.name};error message:${null==n?void 0:n.message})`:"");else if(o===kT)r="Camera is taken by other programs"+(n?` (error name:${null==n?void 0:n.name};error message:${null==n?void 0:n.message})`:"");else if(o===jT){var i;r=`VB setting error, param:${JSON.stringify(null!==(i=t.value.video.virtualBackground)&&void 0!==i?i:{})}`}else if(o===xT){var s;r=`Mask setting error, param:${JSON.stringify(null!==(s=t.value.video.mask)&&void 0!==s?s:{})}`}else o===FT&&(r=`Video stream ended or muted, if it is on iOS platform, will stop capture video.platform:${zi.browser}`);yT.report(`${r},${ZO(t.value)}`,["Video exception flow"])})),mlEpics8:(e,t)=>qO(e,t,[NT,VT],(e=>{const{payload:{type:t}}=e;let o="";t===VT?zi.isMacOS&&(o="Need to allow screen recording access in system setting on MacOS"):o="Need to allow the permission request",yT.report(`${o}`,["Sharing exception flow"])})),mlEpics9:(e,t)=>qO(e,t,BT,(e=>{const{payload:{data:o}}=e,{video:{renderedVideoList:n}}=t.value;if(null!=o&&o.canvasId){const e=n.filter((e=>e.canvasId===o.canvasId));yT.report(`WebGl Context lost, canvas ID:${o.canvasId}, affected video node Ids:${e.map((e=>e.userId)).join(",")}`,["Video exception flow"])}})),mlEpics10:(e,t)=>st(document,"visibilitychange").pipe(KO(e,t,(()=>{yT.makeLogger(["Video"]).log(`Page visibility ${document.visibilityState} `),setTimeout((()=>{const e="visible"!==document.visibilityState,{video:{subscribedVideoList:o},meeting:{userId:n}}=t.value,r=o.filter((e=>e!==n)).length>0;e&&r&&(Ns.createAgent().sendRWGConnectionPerformance("VCSV"),yT.makeLogger(["Video"]).warn("Still subscribing videos after switching to background"))}),1e3)})))},qT={rmclEpics0:(e,t)=>e.pipe($t(`${dm}`),KO(e,t,(e=>{const{payload:{isRemoteControlEnabled:t,isEnableAutoDeleteRcApp:o}}=e;hT.log(`isRemoteControlEnabled:${t},auto delete:${o}`)}))),rmclEpics1:(e,t)=>e.pipe($t(`${rm}`),mt((e=>!!e.payload)),KO(e,t,(e=>{hT.log(`Launch Remote control app, scheme:${e.payload}`)}))),rmclEpics2:(e,t)=>e.pipe($t(`${Zh}`),mt((e=>!!e.payload)),KO(e,t,(e=>{hT.log(`Remote control session starts, controlling ssrc:${e.payload}`)}))),rmclEpics3:(e,t)=>JO(e,t,16430,(()=>{hT.log("Remote control app connected to rwg.")})),rmclEpics4:(e,t)=>JO(e,t,vs,(()=>{hT.log("Remote control app disconnected to rwg.")})),rmclEpics5:(e,t)=>JO(e,t,vs,(e=>{const{share:{status:o,isRemoteControlEnabled:n}}=t.value;n&&o!==qa.End&&e.payload.body.bOn&&hT.log(`Remote control sharing device info.${JSON.stringify(mT.getShareStreamInfo())}`)})),rmclEpics6:(e,t)=>qO(e,t,Va.CurrentDesktopSharingWidthHeight,(()=>{const{share:{isRemoteControlEnabled:e}}=t.value;e&&hT.log(`Remote control sharing device info changes.${JSON.stringify(mT.getShareStreamInfo())}`)})),rmclEpics7:(e,t)=>qO(e,t,Va.SendRemoteControlQrCode,(e=>{const{share:{status:o}}=t.value,{payload:{data:n}}=e;hT.log(`Remote control QR code result. sharing status:${o}, result${JSON.stringify(n)}`)}))},JT={epics0:(e,t)=>e.pipe($t(`${Gr}`),Xe((async e=>{const{meeting:{logConfig:o,logEncryptionPubKey:n,zlkJwtToken:r,accountId:i,enableAutoLog:s,collectionToggleEnable:a,zsk:d},logger:{options:u}}=t.value;let l=u||{};if(o)try{const{enable:e,enableReport:t}=JSON.parse(o);l={...l,enable:e,enableReport:t}}catch(e){}if(r){const{telemetry_tracking_id:t}=Er(r),{payload:{meetingId:o}}=e,n=null!=t?t:o;l={...l,enable:!0,enableReport:!0,trackingId:n}}else{let e=!1;e=d&&void 0!==a?!(s&&a):!s,Vi.set(xi.DisableAutoReportLogs,e,Li.Memory)}return cT.init({...l,logConfig:o,logEncryptionPubKey:n,accountId:i}).then((()=>[Sf(!0),yf(l)])).catch((()=>[Sf(!1)]))})),Xe((e=>Ue(e)))),epics1:(e,t)=>JO(e,t,ps,(e=>{var o,n,r,i;const{payload:{body:s}}=e;if(s&&s.res===wr.Success){cT.makeLogger(["A/V Performance Info"]).info(`CPU cores:${navigator.hardwareConcurrency}, SharedArrayBuffer:${!!window.crossOriginIsolated}, browser:${zi.browser} ${zi.browserVersion}, OS:${zi.os} ${zi.osVersion}${YO("wow64",zi.wow64)}${YO("GPU",zi.gpu)}${YO("architecture",zi.architecture)}${YO("bitness",zi.bitness)}${YO("model",zi.model)}${Vi.get(xi.EnforceWebRTCAudio)?"; Enforce WebTRC audio":""}`,["CPU_CORES"]);const{media:{enforceMultipleVideos:e,enforceVirtualBackground:o,assetsPath:n,disableRenderLimits:r},meeting:{stayAwake:i,quicklyLeave:s}}=t.value;cT.makeLogger(["Init Option"]).info(`Init option:${JSON.stringify({enforceMultipleVideos:e,disableRenderLimits:r,enforceVirtualBackground:o,assetsPath:n,stayAwake:i,leaveOnPageUnload:s})}`),"connection"in navigator&&(pT(),navigator.connection.addEventListener("change",pT))}else cT.report(`join meeting failed, error:${JSON.stringify(Mr(null==s?void 0:s.res))}, rwg error code:${null==s?void 0:s.res}, rwg conID:${null==s?void 0:s.conID}, error message:${null==s?void 0:s.error_desc}, rwg url:${null==s?void 0:s.svcUrl},mid:${t.value.meeting.meetingId}`,"JOIN_MEETING_FAILED","error");const{meeting:{meetingInfoTimestamp:a,pingRWCTimestamp:d,tid:u,meetingId:l,topic:c,accountId:p,cv:h},socket:{rwgServerList:m,retryCount:v},video:{rendererType:g},media:{patchJsMedia:f,assetsPath:y}}=t.value;let S=["conID","confID","mmrFeature","mmrFeatureEx","reportDomain","res","role","svcUrl","userID"].reduce(((e,t)=>void 0!==s[t]?{...e,[`${t}`]:s[t]}:e),{});S=["jid","mn","participantID","zoomID"].reduce(((e,t)=>void 0!==s[t]?{...e,[`${t}`]:sb(s[t])}:e),S),S.response=S.res,delete S.res;const b=["connection_info_map"];let E;if(s.res===wr.Success&&b.push("Command Socket Event","User Info Map"),u){const e=u.match(/clid=(\S+);/);e&&e.length>1&&(E=e[1])}const I=Math.floor(performance.now()-a),A=Math.floor(performance.now()-d);cT.report(JSON.stringify({...S,tid:u,mid:l,userRegion:E,rwgUrl:m.length>0?null===(o=m[v])||void 0===o?void 0:o.rwg:void 0,hardwareConcurrency:navigator.hardwareConcurrency,sharedArrayBuffer:!!window.crossOriginIsolated,browserVersion:`${zi.browser} ${zi.browserVersion}`,osVersion:`${zi.os} ${zi.osVersion}`,gpu:zi.gpu,architecture:zi.architecture,model:zi.model,bitness:zi.bitness,totalDurationOfJoining:I,durationOfRWG:A,rendererType:g,sdkVersion:h,mediaSdkVersion:null===(n=window.JsMediaSDK_Instance)||void 0===n?void 0:n.version,topic:c?sb(c):void 0,accountId:p?sb(p):void 0,patchJSMediaSDK:f,dependentAssets:y,webRtcAudio:Ki()}),b,"info"),Ns.createAgent().sendRWGConnectionPerformance(`WCL_M, conId: ${null==s?void 0:s.conID}, trackingId: ${null===(r=t.value.logger)||void 0===r||null===(i=r.options)||void 0===i?void 0:i.trackingId}, JOINFS(${I}), JOINFRWC(${A})`)})),epics2:(e,t)=>e.pipe($t(`${jr}`),Tt(t),mt((e=>{let[,t]=e;return void 0===t.meeting.encryptedRWC&&(void 0===t.meeting.encryptedGEORWC||0===t.meeting.encryptedGEORWC.length)})),KO(e,t,(()=>{const{label:e,payload:o}=zO(t.value);cT.report(`${e} ${JSON.stringify(o)}`,["Join Meeting Flow","Ping RWC Domain Empty"],"error")}))),epics3:(e,t)=>e.pipe($t(`${xr}`),mt((e=>e.payload===ki.OnError||e.payload===ki.Disconnect||e.payload===ki.NoHeartbeat)),KO(e,t,(e=>{const{payload:o}=e,{socket:{rwgServerList:n,retryCount:r}}=t.value,{payload:i}=zO(t.value);cT.report(`websocket unexpected disconnected,${JSON.stringify({code:o,rwgHost:n[r],...i})}`,["Join Meeting Flow","RWG Disconnect"])}))),epics4:(e,t)=>e.pipe($t(`${Ii}`),KO(e,t,(e=>{const{payload:{reason:o,count:n,interval:r,sequence:i,userId:s,userGUID:a}}=e,{payload:d}=zO(t.value,{userId:s,userGUID:a});cT.report(`meeting failover,${JSON.stringify({reason:o,count:n,interval:r,sequence:i,detailed:lT(i),...d})}`,["Join Meeting Flow","Failover"]),"connection"in navigator&&navigator.connection.removeEventListener("change",pT)}))),epics5:(e,t)=>e.pipe($t(`${$o}`),mt((e=>e.payload.status===Lp.Connecting)),KO(e,t,(e=>{const{payload:{rwgUrl:o}}=e;let n=o.replace(/(\d+)\?/,`${sb("$1")}?`);n=["email","zoomid","participantID","dn2","customer_key","mpwd","topic"].reduce(((e,t)=>e.indexOf(t)>-1?e.replace(new RegExp(`${t}=([^&]+)`,"g"),`${t}=${sb("$1")}`):e),n);const{payload:r}=zO(t.value);cT.makeLogger(["Join Meeting Flow"]).info(`RWG URL,${JSON.stringify({rwgUrl:n,...r})}`,["RWG Url"])}))),epics6:(e,t)=>e.pipe($t(`${No}`),mt((e=>{const{payload:o}=e;return o?o.retry:t.value.meeting.meetingStatus===Di.Initial})),KO(e,t,(()=>{const{meeting:{meetingStatus:e},socket:{rwgServerList:o,retryCount:n}}=t.value;if(e!==Di.Joined){const{payload:e}=zO(t.value),r=(null==o?void 0:o.length)>0?o[n]:void 0;cT.report(JSON.stringify({...e,rwc:null==r?void 0:r.rwc,rwg:null==r?void 0:r.rwg}),["UNAVAILABLE_RWG"])}}))),epics7:(e,t)=>JO(e,t,1,(e=>{const{payload:{body:o}}=e;cT.report(`join meeting failed, version blocked. Current version:${t.value.meeting.cv},upgrade version:${null==o?void 0:o.upgradeVersion}`,"JOIN_MEETING_FAILED","error")})),epics8:(e,t)=>JO(e,t,2,(()=>{cT.report(`join meeting with low version of SDK. Current version:${t.value.meeting.cv}.`,"Join Meeting Flow","warn")})),epics9:(e,t)=>e.pipe($t(`${Vr}`,`${Ur}`),_t((()=>Mc(Zs,1).pipe(Ot((e=>{try{const{payload:o}=zO(t.value);cT.report(`Connection change with join meeting failed. payload:${JSON.stringify(e)}. meeting info:${JSON.stringify(o)}`,"JOIN_MEETING_FAILED","error")}catch(e){}})),Xe((()=>fe))))))},QT=fn(JT,qT,KT),ZT=Ns.createAgent(),YT={cmrStatus:Ca.Stop,recordingEnable:!1,recordingIsoEnable:!1,allowStopAutoRecording:!1,automaticCloudRecordingEnable:!1,isZoomIQ:!1,zoomIQChanging:!1,localStatus:_a.Stop,supportLocalRecording:Ra.None,localGrantPermissionOption:wa.None,localPermissionUserList:[]},XT=ko({[`${wg}`]:_E(((e,t)=>{let{payload:o}=t;e.cmrStatus=o})),[`${Og}`]:_E(((e,t)=>{let{payload:o}=t;e.recordingEnable=o})),[`${Tg}`]:_E(((e,t)=>{let{payload:o}=t;e.recordingIsoEnable=o})),[`${Dg}`]:_E(((e,t)=>{let{payload:o}=t;e.allowStopAutoRecording=o})),[`${Pg}`]:_E(((e,t)=>{let{payload:o}=t;e.automaticCloudRecordingEnable=o})),[`${kg}`]:_E(((e,t)=>{let{payload:o}=t;e.isZoomIQ=o})),[`${Mg}`]:_E(((e,t)=>{let{payload:o}=t;e.zoomIQChanging=o})),[`${Lg}`]:_E(((e,t)=>{let{payload:o}=t;e.localStatus=o})),[`${Ng}`]:_E(((e,t)=>{let{payload:o}=t;e.supportLocalRecording=o})),[`${Vg}`]:_E(((e,t)=>{let{payload:o}=t;e.localGrantPermissionOption=o})),[`${Ug}`]:_E(((e,t)=>{let{payload:o}=t;e.localPermissionUserList=o})),[`${jg}`]:()=>({...YT})},YT);var eD,tD,oD,nD,rD,iD,sD,aD,dD;const uD=Ns.createAgent(),lD=Jw("Recording");let cD=(eD=Ww("recording"),tD=Ww("recording"),oD=Ww("recording"),nD=Ww("recording"),rD=Ww("recording"),iD=Ww("recording"),sD=Ww("recording"),aD=Ww("recording"),dD=class extends Zw{startRecording(){const e=this[Uw](),{meeting:{bIbDisableRecording:t,recordingEnable:o},recording:{cmrStatus:n}}=e;return t?Promise.reject({type:Cl,reason:"Rejected by Information Barrier"}):o?n===Ca.Start?Promise.resolve(""):(uD.recordMeeting(!0,!1),kc(Oa,(e=>e.cmrServerStatus===Ca.Start))):Promise.reject({type:Cl,reason:"The account of the meeting disabled the cloud recording"})}pauseRecording(){const e=this[Uw](),{recording:{cmrStatus:t,allowStopAutoRecording:o}}=e;return t===Ca.Pause?Promise.resolve(""):t!==Ca.Start?Promise.reject({type:Cl,reason:"Recording is not started"}):o?(uD.recordMeeting(!1,!0),kc(Oa,(e=>e.cmrServerStatus===Ca.Pause))):Promise.reject({type:Cl,reason:"Cannot pause cloud recording due to web setting config"})}stopRecording(){const e=this[Uw](),{recording:{cmrStatus:t,allowStopAutoRecording:o}}=e;return t===Ca.Stop?Promise.resolve(""):o?(uD.recordMeeting(!1,!1),kc(Oa,(e=>e.cmrServerStatus===Ca.Stop))):Promise.reject({type:Cl,reason:"Cannot stop cloud recording due to web setting config"})}accept(){const e=this[Uw](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=Ip(e);return o?t!==Ca.Start&&t!==Ca.Pause?Promise.reject({type:Cl,reason:"Recording is not started"}):null!=n&&n.bAllowISORecord?Promise.resolve("You accepted ISO recording"):(uD.allowSelfRecord(!0),kc(Ta,(e=>(null==e?void 0:e.userId)===(null==n?void 0:n.userId)&&(null==e?void 0:e.status)===Aa.Accept))):Promise.reject({type:Cl,reason:"ISO Recording is not enabled"})}decline(){const e=this[Uw](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=Ip(e);return o?t!==Ca.Start&&t!==Ca.Pause?Promise.reject({type:Cl,reason:"Recording is not started"}):!0===(null==n?void 0:n.bAllowISORecord)?Promise.reject({type:Cl,reason:"You had accept ISO recording, cant change it"}):(uD.allowSelfRecord(!1),Promise.resolve("")):Promise.reject({type:Cl,reason:"ISO Recording is not enabled"})}getRecordingStatus(){const e=this[Uw](),{recording:{cmrStatus:t}}=e,o=kp(e);return t===Ca.Start?Aa.Recording:t===Ca.Pause?Aa.Paused:o?Aa.Recording:Aa.Stopped}isRecordingEnabled(){const e=this[Uw](),{recording:{recordingEnable:t}}=e;return t}isAllowedToStopAutoRecording(){const e=this[Uw](),{recording:{allowStopAutoRecording:t}}=e;return t}isAutomaticCloudRecordingEnabled(){const e=this[Uw](),{recording:{automaticCloudRecordingEnable:t}}=e;return t}enableRecordingWithIQ(e){const{[Uw]:t,[jw]:o}=this,n=t(),{recording:{isZoomIQ:r,zoomIQChanging:i},meeting:{meetingOptions:s}}=t();return s.isEnableKiwiRecording?Ap(n)?i?Promise.reject({type:Cl,reason:"We are changing, please wait"}):e===r?Promise.reject({type:Cl,reason:`You have ${e?"enable":"disable"} Zoom IQ, don't need change`}):(o(Mg(!i)),o(kg(!r)),uD.enableZoomIQRecord(e),kc(Ma,(e=>null==e?void 0:e.success))):Promise.reject({type:Cl,reason:"Only Host or co-host can enable/disable Zoom IQ"}):Promise.reject({type:Cl,reason:"You not have zoom IQ license or not enable zoom IQ, please check and retry"})}isSupportLocalRecording(){const e=this[Uw](),{meeting:{meetingOptions:t,isWebinar:o},breakoutRoom:n}=e;if((null==n?void 0:n.currentRoom.status)===cp.InRoom)return!1;const r=Ip(e);return(!o||!ap(r.userRole))&&(null==t?void 0:t.isLocalRecordingEnabled)}isSupportLocalRecordingPermission(){const e=this[Uw](),{recording:{supportLocalRecording:t}}=e;if(!this.isSupportLocalRecording())return!1;const o=Ip(e);return!(null==o||!o.isHost)||t===Ra.Allow}askLocalRecordingPermission(){const{[Uw]:e}=this,{recording:{supportLocalRecording:t}}=e();return this.isSupportLocalRecording()?t===Ra.None?(uD.localRecordingRequestPermission(),Promise.resolve("")):t===Ra.Allow?Promise.resolve(""):Promise.reject("permission is denied"):Promise.reject("not support")}startLocalRecording(e){const{[Uw]:t,[jw]:o}=this,n=t(),{recording:{localStatus:r,supportLocalRecording:i},meeting:{userId:s}}=n;if(!(e in _a))return Promise.reject({type:Cl,reason:"not support you parameter, only support type are 0(stop)/1(start)/2(pause)."});if(!this.isSupportLocalRecording())return Promise.reject({type:Cl,reason:"not support local recording"});if(e===r)return Promise.resolve(`you currently status is ${r}, do nothing`);const a=Ip(n);return i===Ra.Allow||null!=a&&a.isHost?(uD.localRecordingMeeting(e),kc(Da,(t=>(null==t?void 0:t.userId)===s&&(o(Lg(t.bLocalRecord)),t.bLocalRecord===e)),1e3)):Promise.reject({type:Cl,reason:"you not have local recording permission, please use askLocalRecordingPermission request it first"})}isSupportLocalRecordingGrantPermission(){const e=this[Uw]();if(!this.isSupportLocalRecording())return!1;const t=Ip(e);return!(null==t||!t.isHost)&&!!gy(t.caps)}grantLocalRecordingPermission(e,t,o){const{[Uw]:n,[jw]:r}=this,i=n(),{recording:{localPermissionUserList:s}}=i;if(!this.isSupportLocalRecording())return Promise.resolve(!1);const a=Ip(i);if(!gy(a.caps))return Promise.reject({type:Cl,reason:"you can not grant permission"});let d=!1;if(o&&(d=!0),s.filter((t=>t===e)).length>0){if(t===Ra.Allow)uD.localRecordingGrantPermission(e,!0,d);else{if(t!==Ra.Deny)return Promise.reject({type:Cl,reason:"only support DENY(1)/ALLOW(2)"});uD.localRecordingGrantPermission(e,!1,d)}return r(Ug(s.filter((t=>t!==e)))),Dc(Pa,{type:"answer",value:t===Ra.Allow}),Promise.resolve(!1)}return t!==Ra.Deny?Promise.reject({type:Cl,reason:"Direct grant only support DENY(1)"}):(uD.hostGrantPermission(e,!1),kc(Pa,(o=>(null==o?void 0:o.value)===e&&(t===Ra.Allow?(r(Ug([...s,e])),!0===(null==o?void 0:o.canRecord)):(r(Ug(s.filter((t=>t!==e)))),!1===(null==o?void 0:o.canRecord)))),1e3))}getLocalRecordingPermissionUserList(){const e=this[Uw](),{recording:{localPermissionUserList:t}}=e;if(!this.isSupportLocalRecording())return[];const o=Ip(e);return gy(o.caps)?t:Promise.reject({type:Cl,reason:"you can not grant permission"})}getLocalRecordingPermissionOperation(){const e=this[Uw](),{recording:{localGrantPermissionOption:t}}=e;if(!this.isSupportLocalRecording())return null;const o=Ip(e);return gy(o.caps)?t:null}},Nw(dD.prototype,"startRecording",[Hw,Fw,eD,lD],Object.getOwnPropertyDescriptor(dD.prototype,"startRecording"),dD.prototype),Nw(dD.prototype,"pauseRecording",[Hw,Fw,tD,lD],Object.getOwnPropertyDescriptor(dD.prototype,"pauseRecording"),dD.prototype),Nw(dD.prototype,"stopRecording",[Hw,Fw,oD,lD],Object.getOwnPropertyDescriptor(dD.prototype,"stopRecording"),dD.prototype),Nw(dD.prototype,"accept",[Fw,nD,lD],Object.getOwnPropertyDescriptor(dD.prototype,"accept"),dD.prototype),Nw(dD.prototype,"decline",[Fw,rD,lD],Object.getOwnPropertyDescriptor(dD.prototype,"decline"),dD.prototype),Nw(dD.prototype,"askLocalRecordingPermission",[Fw,iD],Object.getOwnPropertyDescriptor(dD.prototype,"askLocalRecordingPermission"),dD.prototype),Nw(dD.prototype,"startLocalRecording",[Fw,sD],Object.getOwnPropertyDescriptor(dD.prototype,"startLocalRecording"),dD.prototype),Nw(dD.prototype,"grantLocalRecordingPermission",[Fw,$w,aD],Object.getOwnPropertyDescriptor(dD.prototype,"grantLocalRecordingPermission"),dD.prototype),dD);const pD={moduleEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{const{payload:{recordingEnable:t}}=e;return Og(t)}))),moduleEpics1:(e,t)=>yn(e,us).pipe(mt((e=>{var t,o,n;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.cmrServerStatus)||void 0!==(null===(o=e.payload.body)||void 0===o?void 0:o.disAllowClientStopAutoCmr)||void 0!==(null===(n=e.payload.body)||void 0===n?void 0:n.enableAutomicRecordingCloud)})),Tt(t),Xe((e=>{let[t,o]=e;const{cmrServerStatus:n,disAllowClientStopAutoCmr:r,enableAutomicRecordingCloud:i}=t.payload.body,s=[];return void 0!==n&&(n!==Ca.Init&&(Dc(Oa,{cmrServerStatus:n}),o.recording.recordingIsoEnable&&n===Ca.Start&&Dc(Ta,{status:Aa.Ask})),s.push(wg(n))),void 0!==r&&s.push(Dg(!r)),void 0!==i&&s.push(Pg(i)),Ue(s)}))),moduleEpics2:e=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.bCmrIsoEnble)})),ze((e=>{const{bCmrIsoEnble:t}=e.payload.body;return Tg(t)}))),moduleEpics3:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[t]=e;const{payload:{body:{update:o,add:n}}}=t;return(null==o?void 0:o.some((e=>void 0!==e.bLocalRecordStatus||void 0!==e.canRecord)))||(null==n?void 0:n.some((e=>void 0!==e.bLocalRecordStatus||void 0!==e.canRecord)))})),Xe((e=>{let[t,o]=e;const{payload:{body:{update:n,add:r}}}=t,{meeting:{userId:i,isHost:s},recording:{supportLocalRecording:a},participants:{attendeesList:d}}=o,u=[];return null==n||n.concat(r||[]).filter((e=>void 0!==e.bLocalRecordStatus||void 0!==e.canRecord)).forEach((e=>{if(void 0!==e.canRecord){const t=Boolean(e.canRecord);if(i===e.id||s){const o=d.find((e=>e.userId===i));!t&&null!=o&&o.bLocalRecord&&(Dc(Pa,{type:"revoke",value:e.id,canRecord:t}),ZT.localRecordingMeeting(_a.Stop)),!t||null!=o&&o.bLocalRecord||Dc(Pa,{type:"grant",value:e.id,canRecord:t})}i===e.id&&((a!==Ra.None||t)&&u.push(Ng(t?Ra.Allow:Ra.Deny)),t||u.push(Lg(_a.Stop)))}else Dc(Da,{userId:e.id,bLocalRecord:e.bLocalRecordStatus})})),Ue(u)}))),moduleEpics4:(e,t)=>yn(e,ds).pipe(ze((e=>NI(e.payload.body))),Tt(t),Xe((e=>{let[t,o]=e;const n=[],{recording:{localPermissionUserList:r}}=o;return t.remove&&t.remove.forEach((e=>{r.filter((t=>t===(null==e?void 0:e.userId)))&&(n.push(Ug(r.filter((t=>t!==(null==e?void 0:e.userId))))),Dc(Pa,{type:"remove",value:null==e?void 0:e.userId}))})),Ue(n)}))),moduleEpics5:e=>yn(e,ds).pipe(mt((e=>{const{payload:{body:{update:t}}}=e;return null==t?void 0:t.some((e=>void 0!==e.bAllowISORecord))})),Ot((e=>{const{payload:{body:{update:t}}}=e;t.filter((e=>void 0!==e.bAllowISORecord)).forEach((e=>{Dc(Ta,{userId:e.id,status:e.bAllowISORecord?Aa.Accept:Aa.Decline})}))})),Et(fe)),moduleEpics6:e=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.SalesRecordingAnalytics)})),ze((e=>{const{SalesRecordingAnalytics:t}=e.payload.body;return Dc(ka,{isZoomIQ:t}),kg(t)}))),moduleEpics7:(e,t)=>yn(e,4319).pipe(Tt(t),mt((e=>{var t;let[o]=e;return void 0!==(null===(t=o.payload.body)||void 0===t?void 0:t.success)})),Xe((e=>{let[t,o]=e;const n=[],{success:r}=t.payload.body,{recording:{zoomIQChanging:i}}=o;return Dc(Ma,{success:r}),r&&n.push(Mg(!i)),Ue(n)}))),moduleEpics8:(e,t)=>yn(e,4344).pipe(Tt(t),mt((e=>{var t;let[o]=e;return void 0!==(null===(t=o.payload.body)||void 0===t?void 0:t.cmdType)})),Xe((e=>{var t;let[o,n]=e;const r=[],{cmdType:i}=o.payload.body,{recording:{localPermissionUserList:s},meeting:{isHost:a}}=n;var d,u,l,c;("permission_req_option"===i&&(Dc(Pa,{type:"option",value:null===(d=o.payload.body)||void 0===d?void 0:d.option}),r.push(Vg(null===(u=o.payload.body)||void 0===u?void 0:u.option))),"request_permission"===i&&null!==(t=o.payload.body)&&void 0!==t&&t.userId)&&(a&&Dc(Pa,{type:"request",value:null===(c=o.payload.body)||void 0===c?void 0:c.userId}),r.push(Ug([...s,null===(l=o.payload.body)||void 0===l?void 0:l.userId])));return"permission_request_answer"===i&&(Dc(Pa,{type:"answer",value:o.payload.body.agreed}),r.push(Ng(o.payload.body.agreed?Ra.Allow:Ra.Deny))),Ue(r)})))},hD=fn(pD);let mD=function(e){return e[e.All=1]="All",e[e.Private=2]="Private",e}({}),vD=function(e){return e.SUCCESS="success",e}({}),gD=function(e){return e.CustomizedKey="__zoom_internal_message_customized_key__@@",e.SpeakerOnly="__zoom_internal_message_speaker_only__@@",e}({});const fD=LE.getInstance(),yD=(e,t,o)=>{const{meeting:{encType:n}}=o,r=t,i=lr(e),s=r?mD.Private:mD.All;return n===es.AES_GCM?is.beginEncrypt({text:i,type:ts.XMPP_CHAT}).then((e=>{fD.sendWebinarMseeage(e,r,s,!0)})):fD.sendWebinarMseeage(i,r,s,!1)};function SD(e,t){const{cmd:{jids:o}}=t;return Object.prototype.hasOwnProperty.call(o,e)?Promise.resolve():Fe(Mc(qs).pipe(At((t=>-1===t.findIndex((t=>Number(t.userId)===e)))),ft(1),Le(he)))}function bD(e){const{cmd:{connectionStatus:t}}=e;return t===vD.SUCCESS?Promise.resolve(!0):Fe(Mc(ba,1)).then((e=>e===Ti.Connected||Promise.reject({type:Cl,reason:"Cannot establish the command channel"})))}function ED(e,t){for(const[o,n]of Object.entries(e))if(n.jid===t)return o}const ID={connectionStatus:"initial",jids:{}},AD=ko({[`${Hg}`]:()=>({...ID}),[`${xg}`]:_E(((e,t)=>{let{payload:o}=t;const{data:n,attendees:r}=o;n.forEach((t=>{const{jid:o,node:n}=t;if(!e.jids[n]||e.jids[n].jid!==o){const t=r.find((e=>e.userId===Number(n)));e.jids[n]={jid:o,userGuid:null==t?void 0:t.userGUID}}}))})),[`${Bg}`]:_E(((e,t)=>{let{payload:o}=t;o.forEach((t=>{const{jid:o}=t,n=ED(e.jids,o);n&&delete e.jids[n]}))})),[`${Fg}`]:_E(((e,t)=>{let{payload:o}=t;e.connectionStatus=o}))},ID);var CD;let _D=(CD=class extends Zw{send(e,t){if(!e)return Promise.reject({type:Tl,reason:"Text is empty"});if("string"!=typeof e)return Promise.reject({type:Tl,reason:"Text is not a string"});if(e.length>512)return Promise.reject({type:Tl,reason:"Text exceeds the max length(512)."});const{[Uw]:o}=this,n=o(),{socket:{xmppSocketStatus:r},meeting:{userId:i}}=n;return r!==Lp.Connected?Promise.reject({type:Ol,reason:"Command channel is not ready"}):bD(n).then((()=>t?-1!==wp(o()).findIndex((e=>e.userId===t))?SD(t,n).then((()=>{const{cmd:{jids:n}}=o();return n[t]?(yD(e,n[t].jid,o()),{timestamp:(new Date).getTime(),text:e,receiverId:t,senderId:i}):Promise.reject({type:_l})})):Promise.reject({type:Tl,reason:"Cannot find the user"}):(yD(e,"",n),{timestamp:(new Date).getTime(),text:e,receiverId:0,senderId:i})))}getJids(){const{[Uw]:e}=this,t=e(),{cmd:{jids:o}}=t;return o}},Nw(CD.prototype,"send",[Fw],Object.getOwnPropertyDescriptor(CD.prototype,"send"),CD.prototype),CD);const RD={extraEpics0:(e,t)=>e.pipe($t(`${mh}`),_t((e=>{const{payload:{speakerOnly:o}}=e,n=Ip(t.value);return(void 0!==(null==n?void 0:n.audio)?Ue([n.audio]):Mc(Ws).pipe(mt((e=>void 0!==e.audio)),ft(1))).pipe(Ot((()=>{bD(t.value).then((()=>{yD(`${gD.SpeakerOnly}${o?1:0}`,"",t.value)}))})),Et(fe))}))),extraEpics1:(e,t)=>yn(e,ds).pipe(mt((e=>{var o,n;const{payload:{body:r}}=e;return!!r.add&&!(null===(o=t.value.audio)||void 0===o||null===(n=o.customizeAudioOption)||void 0===n||!n.speakerOnly)})),Le(he),Ot((async e=>{const{payload:{body:{add:o}}}=e,n=t.value,{meeting:{userId:r}}=n;for(let e=0;e{yD(`${gD.SpeakerOnly}1`,e[n].jid,t.value)}),Math.floor(Math.random()*Math.log10(o.length)*1e3))}}})),Et(fe))},wD={epics0:(e,t)=>bn(e,24577).pipe(Tt(t),ze((e=>{let[t]=e;const{payload:{body:{status:o}}}=t;return o===vD.SUCCESS&&Dc(ba,Ti.Connected),Fg(o)}))),epics1:(e,t)=>bn(e,24583).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{meeting:{userId:n,encType:r},cmd:{jids:i}}=o,{payload:{body:{senderName:s,senderJid:a,text:d,type:u,receiver:l,msgid:c,sn:p}}}=t,h=ED(i,l),m=r===es.AES_GCM,v=ED(i,a),g=(new Date).getTime();let f=Promise.resolve({message:d});return m&&(f=is.beginDecrypt({decryptedText:d,type:ts.XMPP_CHAT,zoomId:p})),f.then((e=>{let{message:t}=e;if(u===mD.Private&&Number(h)===n||u===mD.All){const e=ur(t);if(null!=e&&e.startsWith(gD.SpeakerOnly)){const t=e.substring(gD.SpeakerOnly.length),o=1===Number(t);return zc({userId:Number(v),key:"isSpeakerOnly",value:o})}{var o;const t=v&&(null===(o=i[v])||void 0===o?void 0:o.userGuid);Dc(Sa,{senderId:v,senderName:s,senderGuid:t,text:e,timestamp:g,msgid:c})}}return""}))})),mt((e=>"object"==typeof e&&null!==e&&void 0!==e.type)),Ot((e=>{const{payload:{userId:t,key:o,value:n}}=e;Dc(zs,[{userId:t,[`${o}`]:n}])}))),epics2:(e,t)=>bn(e,24595).pipe(Xe((e=>{const{payload:{body:{action:o,data:n}}}=e,r=[];if([kE.List,kE.Add,kE.update].includes(o)&&n){const{breakoutRoom:e,participants:{attendeesList:o}}=t.value,i=(null==e?void 0:e.currentRoom.status)===cp.InRoom?o.concat(e.mainSessionAttendeeList):o;r.push(xg({data:n,attendees:i}))}return o===kE.Remove&&n&&r.push(Bg(n)),Ue(r)})))},OD=fn(wD,RD),TD=(e,t,o,n)=>{const{getState:r,dispatch:i}=o,s=r(),{participants:{attendeesList:a},audio:{localShareAudioUserMutedList:d},share:{isReceiveSharingFromMainSession:u},breakoutRoom:l}=s,c=(u?null==l?void 0:l.mainSessionAttendeeList:a).find((t=>t.userId==e));if(c){if(c.bShareAudioOn){const o=d.find((t=>t.userId===e));return o&&o.muted===!t&&i(FA(n,e,t,s)),Promise.resolve("")}return Promise.reject({type:Cl,reason:`Cannot ${t?"mute":"unmute"} share audio when the user's share audio is not enable.`})}return Promise.reject({type:Tl,reason:"Cannot find the user"})},DD=(e,t)=>{const{store:{getState:o},rwgAgent:n}=e,{share:{sharePrivilege:r}}=o();return r===t?Promise.resolve(""):Object.values(Ka).includes(t)?(n.lockSharing(t),ey("lockShare",t)):Promise.reject({type:Tl})},PD=Zc([wp],(e=>e.filter((e=>e.bVideoOn)))),kD=Zc([PD],(e=>e.filter((e=>(e.caps&hy)===hy)))),MD=(e,t)=>{const o=e.store.getState(),n=by(o).find((e=>e.userId===t));if(n){const{caps:e}=n;return(e=>!(512&~e))(e)}return!1};var LD,ND,VD,UD,jD,xD,BD,FD,HD,$D,WD,GD,zD,KD,qD,JD,QD,ZD,YD,XD,eP,tP,oP,nP,rP,iP,sP,aP,dP,uP,lP,cP,pP,hP,mP,vP,gP,fP,yP,SP,bP,EP,IP,AP,CP,_P,RP,wP,OP,TP,DP,PP,kP,MP,LP,NP,VP,UP,jP,xP,BP,FP,HP,$P,WP,GP,zP,KP,qP,JP,QP,ZP,YP,XP,ek,tk,ok,nk,rk,ik,sk,ak;const dk=Jw("Audio"),uk=Jw("Video"),lk=Jw("Sharing"),ck=Jw("CameraControl"),pk=Jw("Remote Control"),hk=Qw(HTMLCanvasElement,0),mk=Qw([HTMLCanvasElement,HTMLVideoElement],0),vk=Qw(HTMLCanvasElement,0,["id"]),gk=Qw([HTMLCanvasElement,HTMLVideoElement],0,["id"]);let fk=(LD=Ww("audio"),ND=Ww("audio"),VD=Ww("audio"),UD=Ww("audio"),jD=Ww("audio"),xD=Jw("Audio",[1,2,3]),BD=Ww("audio"),FD=Jw("Audio",[1,2]),HD=Ww("audio"),$D=Ww("audio"),WD=Ww("audio"),GD=Ww("audio"),zD=Ww("share"),KD=Ww("audio"),qD=Ww("share"),JD=Ww("audio"),QD=Ww("audio"),ZD=Ww("audio"),YD=Ww("audio"),XD=Ww("audio"),eP=Ww("audio"),tP=Jw("Audio",[1,2]),oP=Ww("audio"),nP=Jw("Audio",[1,2]),rP=Ww("audio"),iP=Ww("audio"),sP=Ww("video"),aP=Ww("video"),dP=Ww("video"),uP=Ww("video"),lP=Ww("video"),cP=Ww("video"),pP=Ww("video"),hP=Ww("video"),mP=Ww("video"),vP=Ww("video"),gP=Ww("video"),fP=Ww("video"),yP=Ww("video"),SP=Ww("video"),bP=Ww("video"),EP=Ww("video"),IP=Ww("video"),AP=Ww("video"),CP=Ww("video"),_P=Ww("video"),RP=Ww("video"),wP=Ww("video"),OP=Ww("video"),TP=Ww("video"),DP=Ww("video"),PP=Ww("video"),kP=Ww("video"),MP=Ww("video"),LP=Ww("video"),NP=Ww("share"),VP=Ww("share"),UP=Ww("share"),jP=Ww("share"),xP=Ww("share"),BP=Ww("share"),FP=Ww("share"),HP=Ww("share"),$P=Gw("isShareOptionLocked"),WP=Gw("isShareOptionLocked"),GP=Ww("share"),zP=Ww("share"),KP=Ww("share"),qP=Ww("share"),JP=Ww("share"),QP=Ww("share"),ZP=Ww("share"),YP=Ww("share"),XP=Ww("share"),ek=Ww("share"),tk=Ww("share"),ok=Ww("share"),nk=Ww("share"),rk=Ww("share"),ik=Ww("share"),sk=Ww("share"),ak=class extends Zw{constructor(e){super(e),this[Bw]=void 0,this[Vw].dispatch(Jo()),this[Bw]={store:e,mediaAgent:Gf(vb(Hs.getInstance())),rwgAgent:Ns.createAgent()}}startAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=Ip(s);if((null==a?void 0:a.audio)===Ad.Computer)return Promise.resolve("");if((null==a?void 0:a.audio)===Ad.Phone)return Promise.reject({type:Cl,reason:"joined by phone"});{const{audio:{isAllowToTalk:e,isComputerAudioLoading:d,canPlayAudio:u,customizeAudioOption:{speakerOnly:l}},media:{audioDecodeStatus:c,audioEncodeStatus:p}}=s;if(d)return Promise.reject({type:Cl,reason:"Computer audio has been loading, please wait."});const h=function(e){const t=e?{...e}:void 0;if(JA(Ki())||!0!==(null==t?void 0:t.backgroundNoiseSuppression)||(console.warn("Background noise suppression requires SharedArrayBuffer and is only supported on desktop browser"),Object.assign(t,{backgroundNoiseSuppression:void 0})),void 0!==(null==t?void 0:t.originalSound)){t.backgroundNoiseSuppression&&t.originalSound&&(console.warn("Enabling original sound will disable background noise suppression."),Object.assign(t,{backgroundNoiseSuppression:!1}));const{originalSound:e}=t;"object"==typeof e&&e.stereo&&!QA()&&(console.warn("Cannot enable stereo audio on current platform due to the browser limitation"),Object.assign(e,{stereo:!1}))}return ZA()||!0!==(null==t?void 0:t.syncButtonsOnHeadset)||(console.warn("Sync buttons on headset is not supported on the current platform"),Object.assign(t,{syncButtonsOnHeadset:void 0})),null!=t&&t.mediaFile&&!Hs.isSupportMediaPlaybackAsVideoInput()&&(console.warn("Cannot use media file as audio input due to the browser limitation"),Object.assign(t,{mediaFile:void 0})),t}(t);n(mh(null!=h?h:{}));const{speakerOnly:m,autoStartAudioInSafari:v}=h||{};if(!!l!=!!m&&n(zc({userId:s.meeting.userId,key:"isSpeakerOnly",value:!!m})),!a)return Promise.reject({type:Cl,reason:"Please call `startAudio` method after the `join` has been resolved"});{const t=ap(a.userRole)&&!e||m,{encodeInitStatus:d,decodeInitStatus:l}=YA(s,a,m);if(zA()&&("success"!==l||"success"!==d))return Promise.reject({type:Cl,reason:"It is required to wait for the audio encoding and decoding to be ready before calling `startAudio` method"});n(Xp(!0)),Vf("audio",d,l).subscribe((s=>{let[d,l]=s;if(d&&l){let s=u||(zA()||zi.isIOSMobile)&&!v?Promise.resolve():function(){const e=URL.createObjectURL(Wa),t=new Audio(e);t.muted=!1;const o=yr((()=>Promise.reject()),3e3),n=zi.isIOSMobile?new Promise(((e,o)=>{var n;t.addEventListener("canplaythrough",(()=>{t.play().then((()=>{e(!0)})).catch((e=>{o(e)}))})),null===(n=t.load)||void 0===n||n.call(t)})):t.play();return Promise.race([n,o]).finally((()=>{URL.revokeObjectURL(e)}))}();void 0===s&&(s=Promise.resolve()),s.then((()=>jf("audio",o()))).then((()=>{const s=o(),{audio:{isSharingAudio:d}}=s;XA(r,s,t),d&&!qA()||HA(i,s,!t),ap(a.userRole)&&e&&n(eh(!0)),n(Zp(!0))})).catch((()=>{n(Zp(!1)),n(Xp(!1))}))}else n(Xp(!1))}))}return"failed"===p||"failed"===c?(n(Xp(!1)),Promise.reject({type:_l,reason:"audio encode or decode error"})):new Promise(((e,t)=>{vt(Mc(zu.JoinComputerAudio.success,1),ct(...zu.JoinComputerAudio.fail.map((e=>Mc(e,1).pipe(Xe((()=>xe({type:wl,reason:e}))))))),ut(45e3).pipe(Xe((()=>xe({type:Rl}))))).subscribe({next:()=>{n(Xp(!1)),e("")},error:e=>{Hs.getInstance().leaveComputerAudio();const i=Ip(o());(null==i?void 0:i.audio)!==Ad.Phone&&(n(Ch(Fa.MicrophoneError)),r.joinOrLeaveVoip(!1)),n(Xp(!1)),t(e)}})}))}})(this[Bw],e)}stopAudio(){return(async e=>{const{store:{getState:t,dispatch:o},mediaAgent:n,rwgAgent:r}=e,i=t(),{audio:{isComputerAudioLoading:s,isShareAudioEnabled:a,isSharingAudio:d,isUsingMediaPlayback:u,customizeAudioOption:{speakerOnly:l}}}=i,c=Ip(i);if(s)return Promise.reject({type:Cl,reason:"Computer audio has not finished joining, please wait."});if(a){if(d&&!qA())return Promise.reject({type:Cl,reason:"Cannot stop audio during sharing with audio"});o(rh(void 0)),o(th(void 0))}return(null==c?void 0:c.audio)===Ad.Computer?(o(Ch(Fa.Active)),await n.leaveComputerAudio(),r.joinOrLeaveVoip(!1),l&&o(zc({userId:i.meeting.userId,key:"isSpeakerOnly",value:void 0})),u&&ty.getInstance().stopAudioElement(),o(zp(0)),kc(Eu)):Promise.resolve("")})(this[Bw])}muteAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=Ip(s);if(null==t||t===(null==a?void 0:a.userId))return""===(null==a?void 0:a.audio)||null===(null==a?void 0:a.audio)?Promise.reject({type:Cl,reason:"no audio joined"}):!0===(null==a?void 0:a.muted)?Promise.resolve(""):(n(Eh(xa.Active)),r.mute(a.userId,!0),i.muteAudio(),s.audio.isShareAudioEnabled&&!qA()&&n(th(!0)),kc(Iu).then((()=>"")));if(Ap(s)){const{participants:{allowTalkAttendeesList:e,attendeesList:o}}=s,n=e.concat(o).find((e=>e.userId===t));return n?""===n.audio||null===n?Promise.reject({type:Cl,reason:"no audio joined"}):!1===n.muted?(r.mute(t,!0),kc(Cu,(e=>e.id===t&&1==e.muted))):Promise.resolve(""):Promise.reject({type:Tl,reason:"no matching user"})}return Promise.reject({type:wl})})(this[Bw],e)}unmuteAudio(e){return(async(e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=Ip(s);if(void 0===t||t===(null==a?void 0:a.userId)){if(""===(null==a?void 0:a.audio)||null===(null==a?void 0:a.audio))return Promise.reject({type:Cl,reason:"no audio joined"});if(!1===(null==a?void 0:a.muted))return Promise.resolve("");if(s.audio.isShareAudioEnabled&&!qA()){if(s.audio.isSharingAudio)return Promise.reject({type:Cl,reason:"Cannot unmute audio during sharing with audio"});n(th(!1))}if(s.audio.bCanUnmute||null!=a&&a.isHost||null!=a&&a.bCoHost){if(ap(a.userRole)){const{audio:{isAllowToTalk:e,isAllowToTalkAttendeeConnected:t}}=s;e?t||(await i.leaveComputerAudio(),await HA(i,s,!0),n(eh(!0))):Promise.reject({type:Cl,reason:"Webinar attendee cannot unmute self audio."})}return n(Ih(Ba.Active)),r.mute(a.userId,!1),i.unmuteAudio(),kc(Au).then((()=>""))}return Promise.reject({type:wl,reason:"host not allow unmute themselves"})}if(Ap(s)){const{participants:{allowTalkAttendeesList:e,attendeesList:o}}=s,n=e.concat(o).find((e=>e.userId===t));return n?""===n.audio||null===n?Promise.reject({type:Cl,reason:"no audio joined"}):(!0===n.muted&&r.mute(t,!1),Promise.resolve("")):Promise.reject({type:Tl,reason:"no matching user"})}return Promise.reject({type:wl})})(this[Bw],e)}dialOut(e,t,o,n){return((e,t,o,n,r)=>{const{store:{getState:i,dispatch:s},rwgAgent:a}=e,d=i(),{meeting:{callOutCountry:u,isSupportCallOut:l}}=d;if(l&&Array.isArray(u)&&u.findIndex((e=>e.code===t))>-1){const{seq:e}=a.audioDialout(t+o,n,!(null==r||!r.callMe),!(null==r||!r.pressingOne),!(null==r||!r.greeting));return s(xp({sequence:e,phoneNumber:t+o})),Pc(zu.JoinAudioByCallMe)}return Promise.reject({type:Tl,reason:"no matching country code"})})(this[Bw],e,t,o,n)}cancelDialOut(e,t,o){return((e,t,o,n)=>{const{rwgAgent:r}=e;return r.audioCancelDialout(t+o,!(null==n||!n.callMe)),Pc(zu.cancelDialOut)})(this[Bw],e,t,o)}hangup(){return(e=>{const{store:{getState:t},rwgAgent:o}=e,n=t(),r=Ip(n);return(null==r?void 0:r.audio)===Ad.Phone&&null!==r.userId?(o.audioDrop(r.userId),Pc(zu.hangup)):Promise.reject({type:Cl,reason:"not joined audio by phone"})})(this[Bw])}switchMicrophone(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{audio:{microphoneDevicesList:s,activeMicrophone:a,mediaPlaybackFile:d,isUsingMediaPlayback:u}}=i,l=s.find((e=>e.deviceId===t));if("default"===t||"string"!=typeof t||l){const e=Ip(i);if((null==e?void 0:e.audio)===Ad.Computer){let o=!1;if("string"==typeof t)t!==a&&(r.changeMicrophone(t,null==l?void 0:l.label,!(null==e||!e.muted)),n(fh(void 0)),ty.getInstance().stopAudioElement(),o=!0);else if(t&&(!u||(null==d?void 0:d.url)!==t.url)){const i=ty.getInstance();i.setAudioElement(t).then((()=>{r.changeMicrophone(i.audioElement,void 0,!(null==e||!e.muted)),n(fh(t))})),o=!0}if(o)return Pc(zu.JoinComputerAudio)}else"string"==typeof t&&n(Jp(t));return Promise.resolve("")}return Promise.reject({type:Lu})})(this[Bw],e)}switchSpeaker(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,{audio:{speakerDevicesList:i,activeSpeaker:s}}=o();if("default"!==t&&-1==i.findIndex((e=>e.deviceId===t)))return Promise.reject({type:Lu});var a;if((null===(a=Ip(o()))||void 0===a?void 0:a.audio)===Ad.Computer){if(t!==s)return r.changeSpeaker(t),kc(xu,(e=>e))}else n(Qp(t));return Promise.resolve("")})(this[Bw],e)}muteShareAudio(e){return((e,t)=>{const{mediaAgent:o,rwgAgent:n,store:{getState:r,dispatch:i}}=e,s=r(),{meeting:{userId:a}}=s;if(t&&t!==a)return TD(t,!0,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r}}=s;if(!t)return Promise.reject({type:Cl,reason:"Cannot mute sharing audio when sharing audio is not enable"});if(r)return Promise.resolve("");{n.muteShareAudio(!0);let t=Promise.resolve();var d;return e&&(t=null===(d=o.leaveSharingAudio(!0))||void 0===d?void 0:d.then((()=>$A(o,n,s).then((e=>{e.forEach((e=>i(e)))}))))),FA(o,a,!0,s),Promise.all([kc({event:Ws,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!1===e.bShareAudioOn)),t]).then((()=>(i(sh(!0)),e&&(i(ah(!1)),Dc(Vu,{state:"off"})),"")))}}})(this[Bw],e)}unmuteShareAudio(e){return((e,t)=>{const{mediaAgent:o,rwgAgent:n,store:{getState:r,dispatch:i}}=e,s=r(),{meeting:{userId:a}}=s;if(t&&t!==a)return TD(t,!1,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r},share:{status:d}}=s;if(!t)return Promise.reject({type:Cl,reason:"Cannot unmute sharing audio when sharing audio is not enable"});if(!1===r)return Promise.resolve("");{n.muteShareAudio(!1);let t=Promise.resolve();return!1===e&&d===qa.Sharing&&(t=GA(o,n,s).then((e=>{e.forEach((e=>i(e)))}))),FA(o,a,!1,s),Promise.all([kc({event:Ws,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!0===e.bShareAudioOn)),t]).then((()=>(i(sh(!1)),!1===e&&d===qa.Sharing&&(i(ah(!0)),Dc(Vu,{state:"on"})),"")))}}})(this[Bw],e)}subscribeAudioStatisticData(e){return(async(e,t)=>{const{mediaAgent:o,store:{getState:n}}=e,r=n(),i=Ip(r),s=!t||t.decode,a=!t||t.encode;if(!i)return Promise.reject({type:Cl,reason:"Call this function after the 'join' method resolved."});{var d;const{encodeInitStatus:e,decodeInitStatus:t}=YA(r,i);(Ki()?Qf(r,!(null!==(d=r.audio.customizeAudioOption)&&void 0!==d&&d.speakerOnly)):Vf("audio",e,t)).subscribe((e=>{let[t,n]=e;t&&n&&(s&&o.subscribeToQos([Bs.AudioDecode],id),a&&o.subscribeToQos([Bs.AudioEncode],id))}))}return""})(this[Bw],e)}unsubscribeAudioStatisticData(e){return(async(e,t)=>{const{mediaAgent:o,store:{dispatch:n}}=e,r=!t||t.decode,i=!t||t.encode;return r&&(o.unsubscribeFromQos([Bs.AudioDecode]),n(dh(md))),i&&(o.unsubscribeFromQos([Bs.AudioEncode]),n(uh(md))),null})(this[Bw],e)}enableBackgroundNoiseSuppression(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,{audio:{isBackgroundNoiseSuppression:i,originalSound:s}}=n();let a=t;return a===!!i||(a&&!JA(Ki())?(console.warn("Background noise suppression requires SharedArrayBuffer and is only supported on desktop browser"),a=!1):(a&&s&&(console.warn("Enabling noise suppression will disable original sound."),r(Ah(!1))),r(vh(a)),o.changeAudioProfile(BA(n())))),Promise.resolve("")})(this[Bw],e)}enableSyncButtonsOnHeadset(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,i=n(),{audio:{isHIDEnabled:s,microphoneDevicesList:a,activeMicrophone:d}}=i;if(t===!!s)return Promise.resolve("");{const e=Ip(i);var u;return e?(t&&!ZA()?console.warn("Sync buttons on headset is not supported on the current platform"):(o.enableSyncButtonsOnHeadset(t,null===(u=a.find((e=>e.deviceId===d)))||void 0===u?void 0:u.label,e.muted),r(gh(t))),Promise.resolve("")):Promise.reject({type:Cl,reason:"Please call `enableSyncButtonsOnHeadset` method after the `join` has been resolved"})}})(this[Bw],e)}enableOriginalSound(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,{audio:{isBackgroundNoiseSuppression:i,originalSound:s}}=n(),a=t;return a===s||"object"==typeof t&&gr(t,s)||("object"!=typeof a||!0!==(null==a?void 0:a.stereo)||QA()||(console.warn("Cannot enable stereo audio on current platform due to the browser limitation"),a.stereo=!1),i&&a&&(console.warn("Enabling original sound will disable background noise suppression."),r(vh(!1))),r(Ah(a)),o.changeAudioProfile(BA(n()))),Promise.resolve("")})(this[Bw],e)}callCRCDevice(e,t){return((e,t,o)=>{const{rwgAgent:n,store:{dispatch:r,getState:i}}=e,{seq:s}=n.inviteCRCDevice(t,o);return r(Rh({sequence:s,ip:t,protocol:o})),Pc(zu.crcCallOut).then((()=>{var e;const{audio:{crcDevice:n}}=i();return null===(e=n.find((e=>e.ip===t&&e.protocol===o&&e.sequence===s)))||void 0===e?void 0:e.uuid}))})(this[Bw],e,t)}cancelCallCRCDevice(e,t){return((e,t,o)=>{const{rwgAgent:n,store:{getState:r}}=e,{audio:{crcDevice:i}}=r(),s=i.find((e=>e.ip===t&&e.protocol===o));return s&&s.returnCode===Ld.Ringing?(n.cancelInviteCRCDevice(s.transId),Promise.resolve("")):Promise.reject({type:Cl,reason:"Cannot cancel call out "})})(this[Bw],e,t)}muteAllAudio(){return(e=>{const{rwgAgent:t}=e;return t.audioMuteAll(!0),ey("bMutedAll",!0)})(this[Bw])}unmuteAllAudio(){return(e=>{const{rwgAgent:t}=e;return t.audioMuteAll(!1),ey("bMutedAll",!1)})(this[Bw])}getMicList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.microphoneDevicesList]:[]})(this[Bw])}getSpeakerList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.speakerDevicesList]:[]})(this[Bw])}getAudioState(e){return((e,t)=>{let{store:{getState:o}}=e;const n=o(),{meeting:{isWebinar:r}}=n;let i=null;return null==t?i=Ip(n):(i=n.participants.attendeesList.find((e=>e.userId===t)),r&&!i&&(i=n.participants.xmppAttendeeList.find((e=>e.userId===t)))),i?i.audio:null})(this[Bw],e)}isAudioMuted(e){return((e,t)=>{let{store:{getState:o}}=e;const n=o(),{meeting:{isWebinar:r}}=n;let i=null;return void 0===t?i=Ip(n):(i=n.participants.attendeesList.find((e=>e.userId===t)),r&&!i&&(i=n.participants.xmppAttendeeList.find((e=>e.userId===t)))),!!i&&!!i.muted})(this[Bw],e)}getActiveMicrophone(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeMicrophone:null})(this[Bw])}getActiveSpeaker(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeSpeaker:null})(this[Bw])}isSupportCallOut(){return(e=>{let{store:{getState:t}}=e;const{meeting:{isSupportCallOut:o,callOutCountry:n}}=t();return o&&Array.isArray(n)&&(null==n?void 0:n.length)>0})(this[Bw])}getDialOutStatus(){return(e=>{let{store:{getState:t}}=e;const{audio:o}=t();return null==o?void 0:o.dialout[o.dialout.length-1].returnCode})(this[Bw])}getDialOutCountries(){return(e=>{let{store:{getState:t}}=e;const{meeting:{callOutCountry:o}}=t();return Array.isArray(o)?o:[]})(this[Bw])}getShareAudioStatus(){return(e=>{let{store:{getState:t}}=e;const{audio:{isShareAudioEnabled:o,isShareAudioMuted:n,isSharingAudio:r}}=t();return{isShareAudioEnabled:o,isShareAudioMuted:n,isSharingAudio:r}})(this[Bw])}isOthersShareAudioMutedLocally(e){return((e,t)=>{var o;let{store:{getState:n}}=e;const{audio:{localShareAudioUserMutedList:r}}=n();return null===(o=r.find((e=>e.userId===t)))||void 0===o?void 0:o.muted})(this[Bw],e)}getAudioStatisticData(){return(e=>{let{store:{getState:t}}=e;const{audio:{statistic:o}}=t();return{...o}})(this[Bw])}getDialInInfo(){return(e=>{let{store:{getState:t}}=e;const{meeting:{meetingNumber:o,tollNumbers:n,participantID:r,h323Password:i}}=t();return void 0===n?null:{meetingId:o,participantId:r,password:i||"",tollNumbers:n.map((e=>({...e})))}})(this[Bw])}isSupportMicrophoneAndShareAudioSimultaneously(){return qA()}startVideo(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{media:{videoDecodeStatus:s,videoEncodeStatus:a,enforceVirtualBackground:d},video:{isCaptureCameraLoading:u,isCurrentUserStartedVideo:l,isVideoMuted:c}}=i,p=t?{...t}:void 0;if(l)return Promise.reject({type:Cl,reason:"Video is started"});if(u)return Promise.reject({type:Cl,reason:"Camera is starting,please wait."});if(c&&!Ap(i))return Promise.reject({type:Cl,reason:"Video is muted by the host"});if(FR(d)&&!((null==p?void 0:p.videoElement)instanceof HTMLVideoElement)){console.warn('Rendering self-view on Chromium browser, Android browser without SharedArrayBuffer or iOS browser requires video tag, Please pass a video element instead of a canvas element in the "renderVideo" method');let e=document.body.querySelector(`#${hd}`);if(!e){e=document.createElement("video");const t=zi.isSafari||zi.isIOSMobile?"position:fixed;top:-10000px;left:-10000px":"display:none";e.setAttribute("style",t),e.muted=!0,e.playsInline=!0,e.autoplay=!0,e.id=hd,document.body.appendChild(e)}p&&Object.assign(p,{videoElement:e})}return!zf(d)&&null!=p&&p.virtualBackground?Promise.reject({type:Tl,reason:"Virtual background only compatible with Chrome and Edge with SharedArrayBuffer enabled."}):(n(Em(!0)),Vf("video",a,s).subscribe((e=>{let[t]=e;if(t){const e=o(),{video:{activeCamera:t,isSupportHDVideo:i,virtualBackground:{imageSrc:s},mask:{imageSrc:a}}}=e,{cameraId:d=t,captureWidth:u=0,captureHeight:l=0,mirrored:c,hd:h,fullHd:m,virtualBackground:v,mask:g}=p||{};c&&r.mirrorVideo(c),(h||m)&&(console.log("HD support is currently limited, and comes with a number of restrictions and limitations. Please visit https://developers.zoom.us/docs/video-sdk/web/video/#720p-video for more details"),i&&Hs.isCompatibleHardwareForEncode()&&Hs.isSupportVideoEncodeHardwareAcceleration().then((e=>{e&&(r.enableHardwareAccelerationForVideoEncode(!0),n(xm({encode:e})))})),i||console.warn("Cannot capture HD video due to either account restriction and/or hardware limitation"));const f=v||void 0===v&&!!s&&void 0===g,y=g||void 0===g&&!!a;let S=Promise.resolve({});if(f){const t=v||{imageUrl:void 0,cropped:void 0};S=XR({...t,captureWidth:u,captureHeight:l,cameraId:d,hd:h},r,e).then((()=>t))}else if(y){const t=g||{imageUrl:void 0,cropped:void 0,clip:void 0,rootWidth:void 0,rootHeight:void 0};t.rootWidth||Object.assign(t,{rootWidth:1280}),t.rootHeight||Object.assign(t,{rootHeight:720}),S=ew({...t,captureWidth:u,captureHeight:l,cameraId:d,hd:h},r,e).then((()=>t))}null!=p&&p.mediaFile&&!Hs.isSupportMediaPlaybackAsVideoInput()&&(console.warn("Cannot use media file as video input due to the browser limitation."),Object.assign(p,{mediaFile:void 0})),S.then((e=>jf("video",o()).then((()=>e)))).then((t=>{VR(r,e,p).forEach((e=>{n(e)})),f?n(Vm(t)):y&&n(Xm(t))})).catch((e=>{n(Em(!1)),Dc(Wd,{reason:e})}))}else n(Em(!1))})),Pc(mu.startCaptureVideo).then((()=>{n(Im(!1)),n(ym(!1))})).finally((()=>{n(Em(!1))})))})(this[Bw],e)}stopVideo(){return(e=>{const{store:{getState:t},mediaAgent:o}=e,{video:{isCaptureCameraLoading:n,isCurrentUserStartedVideo:r,isUsingMediaPlayback:i}}=t();return n?Promise.reject({type:Cl,reason:"Camera is starting,please wait."}):r?(o.stopCaptureVideo(),i&&ty.getInstance().stopVideoElement(),kc(Kd,(e=>!0!==(null==e?void 0:e.failed)))):Promise.reject({type:Cl,reason:"camera is closed"})})(this[Bw])}switchCamera(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{video:{cameraDevicesList:s,isCurrentUserStartedVideo:a,virtualBackground:d,mask:u,mediaPlaybackFile:l,isUsingMediaPlayback:c,customizedVideoOption:p}}=i;if("string"==typeof t&&!LR(t,s))return Promise.reject({type:Tl,reason:"Cannot find cameraDeviceId in camera devices list."});if(a||null!=d&&d.isVBConfigured||u.isMaskConfigured){if("string"==typeof t){const{captureWidth:e,captureHeight:o}=MR(p);r.changeCamera(t,rd.includes(t),{width:e,height:o}),n(ov(void 0)),ty.getInstance().stopVideoElement()}else if(t&&(!c||(null==l?void 0:l.url)!==t.url)){const e=ty.getInstance();e.setVideoElement(t).then((()=>{r.changeCamera(e.videoElement),n(ov(t))}))}return Pc(mu.switchCameraVideo).then((()=>{n(Im(!1)),n(ym(!1))}))}return Promise.resolve()})(this[Bw],e)}renderVideo(e,t,o,n,r,i,s,a,d){return((e,t,o,n,r,i,s,a,d,u)=>{const{store:{getState:l,dispatch:c},mediaAgent:p,rwgAgent:h}=e,m=l(),{meeting:{userId:v},media:{enforceMultipleVideos:g,enforceVirtualBackground:f,disableRenderLimits:y},video:{subscribedVideoList:S,renderedVideoList:b}}=m,E=Qi(!!g,y),I=FR(f)&&o===v;if(t instanceof HTMLCanvasElement&&!S.includes(o)&&S.length>=E&&new Set(b.map((e=>e.canvasId))).has(t.id))return Promise.reject({type:Cl,reason:`subscribe video counts greater than maximum size (${E})`});if(-1===PD(m).findIndex((e=>e.userId===o)))return Promise.reject({type:Tl,reason:"user is not send video"});if(t.id||(t.id=Sr("__ZOOM_SDK_VIDEO_CANVAS_@__")),I){if(t instanceof HTMLVideoElement){t.playsInline=!0,t.muted=!0,t.autoplay=!0,zi.isIOSMobile&&(p.switchCanvasForVideoCapture(t),c(hv())),p.renderVideo(t,o,d||ad,n,r,i,s,a,!0,u||"",!1),c(_m(o)),c(pv(t.id));const e=document.querySelector(`#${hd}`);return e&&e.remove(),Promise.resolve("")}return Promise.reject({type:Tl,reason:"You must use a