From 766216b9b730514472447405d0fabbc1709fa176 Mon Sep 17 00:00:00 2001 From: Enda Zhang Date: Tue, 13 Aug 2024 10:54:05 -0700 Subject: [PATCH] 1.12.1 update --- README.md | 14 ++++++++++++++ dist/index.esm.js | 2 +- dist/index.js | 2 +- dist/index.umd.js | 2 +- dist/lib/js_media.min.js | 4 ++-- dist/lib/wmsc-vendors.min.js | 2 +- package.json | 2 +- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dabcec6..34a88b9 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,20 @@ For the full list of features and event listeners, as well as additional guides, - [Video SDK Auth Endpoint](https://github.com/zoom/videosdk-auth-endpoint-sample) - [Webhook Sample](https://github.com/zoom/webhook-sample) +## Use ZFG(Zoom For Government). You need apply new sdk key for [ZFG](https://marketplace.zoomgov.com/). +### option1 change package.json and use zfg specific version +``` +"@zoom/videosdk": "1.11.0-zfg", +zmClient.init('en-US', 'Global'); +``` + +### option2 change dev.conf and use ZFG [init](https://marketplacefront.zoom.us/sdk/custom/web/modules/VideoClient.html#init) option [webEndpoint](https://marketplacefront.zoom.us/sdk/custom/web/interfaces/InitOptions.html) +``` +zmClient.init('en-US', `https://source.zoomgov.com/videosdk/1.11.0/lib`, { + webEndpoint: "www.zoomgov.com", +}); +``` + ## Need help? If you're looking for help, try [Developer Support](https://devsupport.zoom.us) or our [Developer Forum](https://devforum.zoom.us). Priority support is also available with [Premier Developer Support](https://zoom.us/docs/en-us/developer-support-plans.html) plans. diff --git a/dist/index.esm.js b/dist/index.esm.js index 56dd19c..3d0a24e 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=(e=>{let t={};return Pn.forEach(((e,o)=>t[e]=o)),t})(),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="1506",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={startCaptureVideo:{success:zd,fail:[Bd,Fd,Hd,Gd,$d,Wd]},switchCameraVideo:{success:uu,fail:[Bd,Fd,Hd,$d]},stopCaptureVideo:{success:Kd}};let mu=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 vu={[mu.VideoActiveChange]:[{event:Nd,payload:e=>({state:e.bVideoOn?Qa.Active:Qa.Inactive,userId:e.userId})}],[mu.VideoCapturingChange]:[{event:zd,payload:()=>({state:Ya.Started})},{event:Kd,payload:e=>({state:null!=e&&e.failed?Ya.Failed:Ya.Stopped})}],[mu.VideoMutedChange]:[{event:Vd,payload:e=>({state:e.isVideoMuted?Za.Muted:Za.Unmuted,userId:e.id})}],[mu.AskForStartVideoConsent]:[{event:Ud,payload:e=>({state:e.isVideoMuted?Za.Muted:Za.Unmuted,userId:e.id})}],[mu.VideoSpotlightChange]:[{event:qd,payload:e=>({spotlightList:e.spotlightList&&e.spotlightList.map((e=>({userId:e})))})}],[mu.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})}],[mu.VideoFollowHostOrder]:[{event:Jd,payload:e=>({isFollowHostOrder:e.bOn})}],[mu.VideoHostLayoutChange]:[{event:Qd,payload:e=>Array.isArray(e.layout)?e.layout.map((e=>({userId:e}))):[]}],[mu.PeerVideoStateChange]:[{event:Zd,payload:e=>({action:"Start",...e})},{event:Yd,payload:e=>({action:"Stop",...e})}],[mu.VideoVBPreloadChange]:[{event:Xd,payload:e=>({isReady:e})}],[mu.VideoStatisticDataChange]:[{event:tu,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[mu.VideoDetailedDataChange]:[{event:ou,payload:e=>e}],[mu.VideoAspectRatioChange]:[{event:pu,payload:e=>e}],[mu.NetworkQualityChange]:[{event:nu,payload:e=>e}],[mu.FarEndCameraRequestControl]:[{event:ru,payload:e=>e}],[mu.FarEndCameraResponseControl]:[{event:iu,payload:e=>e}],[mu.FarEndCameraInControlChange]:[{event:su,payload:e=>e}],[mu.FarEndCameraCapabilityChange]:[{event:au,payload:e=>e}]},gu="AUDIO_ACTIVE_SPEAKER",fu="AUDIO_UNMUTE_CONSENT",yu="AUDIO_CURRENT_USER_JOIN_BY_VOIP",Su="AUDIO_CURRENT_USER_JOIN_BY_PHONE",bu="AUDIO_CURRENT_USER_LEAVE_AUDIO",Eu="AUDIO_CURRENT_USER_MUTED",Iu="AUDIO_CURRENT_USER_UNMUTED",Au="AUDIO_PARTICIPANT_AUDIO_UPDATE",Cu="AUDIO_DIALOUT_RESULT_CODE",_u="AUDIO_DIALOUT_RESULT_SUCCESS",Ru="AUDIO_DIALOUT_RESULT_FAIL",wu="AUDIO_DIALOUT_CANCEL_SUCCESS",Ou="DIALOUT_CANCEL_FAIL",Tu="AUDIO_MERGE_AUDIO_INDICATION",Du="USER_FORBIDDEN_MICROPHONE",Pu="ESTABLISH_AUDIO_STREAM_ERROR",ku="AUDIO_AUTO_PLAY_FAILED",Mu="INVALID_DEVICE_ID",Lu="AUDIO_ALLOW_TALK_CHANGE",Nu="SHARE_AUDIO_STATE_CHANGE",Vu="AUDIO_STATISTIC_DATA",Uu="AUDIO_CURRENT_USER_SSRC",ju="AUDIO_SET_SPEAKER_RESULT",xu="AUDIO_SHARE_SECONDARY_AUDIO_SUCCESS",Bu="AUDIO_CRC_CALL_OUT_RESULT_CODE",Fu="AUDIO_CRC_CALL_OUT_RESULT_SUCCESS",Hu="AUDIO_CRC_CALL_OUT_RESULT_FAIL",$u="AUDIO_CURRENT_AUDIO_LEVEL_CHANGE";let Wu=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 Gu={JoinComputerAudio:{success:yu,fail:[Du,Pu]},LeaveComputerAudio:{success:bu},JoinAudioByCallMe:{success:_u,fail:[Ru]},cancelDialOut:{success:wu,fail:[Ou]},hangup:{success:bu},crcCallOut:{success:Fu,fail:[Hu]}},zu={[Wu.ActiveSpeaker]:[{event:gu,payload:e=>e}],[Wu.UnmuteAudioConsent]:[{event:fu,payload:e=>({reason:e})}],[Wu.CurrentAudioChange]:[{event:Su,payload:()=>({action:Ha.Join,type:Ad.Phone})},{event:yu,payload:()=>({action:Ha.Join,type:Ad.Computer})},{event:bu,payload:e=>{let{source:t}=e;return{action:Ha.Leave,source:t}}},{event:Eu,payload:e=>{let{source:t}=e;return{action:Ha.Muted,source:t}}},{event:Iu,payload:e=>{let{source:t}=e;return{action:Ha.Unmuted,source:t}}}],[Wu.DialoutStateChange]:[{event:Cu,payload:e=>e}],[Wu.MergeAudio]:[{event:Tu,payload:e=>e}],[Wu.AutoPlayFailed]:[{event:ku,payload:()=>{}}],[Wu.AllowTalkChange]:[{event:Lu,payload:e=>({enabled:e})}],[Wu.ShareAudioChange]:[{event:Nu,payload:e=>e}],[Wu.AudioStatisticDataChange]:[{event:Vu,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[Wu.CrcCallOutStateChange]:[{event:Bu,payload:e=>e}],[Wu.CurrentAudioLevelChange]:[{event:$u,payload:e=>e}]},Ku="SHARE_ACTIVE_INDICATION",qu="SHARE_CHECK_CHROME_SHARING_EXTENSION",Ju="SHARE_START_DESKTOP_SHARE_FAILED",Qu="SHARE_DIMENSION_CHANGE",Zu="SHARE_RECEIVED_DIMENSION_CHANGE",Yu="SHARE_VIDEO_STREAMS_END",Xu="SHARE_PASSIVE_STOP_SHARE",el="SHARE_PASSIVE_BO_STOP",tl="SHARE_NEW_USER_ADD",ol="SHARE_USER_REMOVE",nl="SHARE_USER_PAUSED",rl="SHARE_USER_RESUMED",il="SHARE_AUTO_CHANGE_SOURCE",sl="SHARE_REMOTE_CONTROL_APPROVE",al="SHARE_GRAB_REMOTE_CONTROL_CHANGE",dl="SHARE_REMOTE_CONTROL_CLIPBOARD_CHANGE",ul="SHARE_REMOTE_CONTROL_SUCCESS",ll="SHARE_REMOTE_CONTROL_FAILED",cl="SHARE_PRIVILEGE_CHANGE",pl="SHARE_READ_RECEIPT",hl="SHARE_STATISTIC_DATA",ml="SHARE_REMOTE_CONTROL_REQUEST",vl="SHARE_REMOTE_CONTROL_APP_STATUS",gl="SHARE_REMOTE_CONTROL_SESSION_STATUS",fl="SHARE_REMOTE_CONTROL_APP_SCHEME";let yl=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 Sl={[yl.ShareActiveChange]:[{event:Ku,payload:e=>{const{isActive:t,activeUserId:o,...n}=e;return{state:t?"Active":"Inactive",userId:o,...n}}}],[yl.ShareDimensionChange]:[{event:Qu,payload:e=>({type:"sended",width:e.width,height:e.height})},{event:Zu,payload:e=>({type:"received",width:e.width,height:e.height})}],[yl.SharePassiveStop]:[{event:Yu,payload:()=>({reason:ed.StopScreenCapture})},{event:Xu,payload:()=>({reason:ed.PrivilegeChange})},{event:el,payload:()=>({reason:ed.ShareFromMainSession})}],[yl.SharePeerStateChange]:[{event:tl,payload:e=>({userId:e.id,action:"Start"})},{event:ol,payload:e=>({userId:e.id,action:"Stop"})},{event:nl,payload:e=>({userId:e.id,action:"Pause"})},{event:rl,payload:e=>({userId:e.id,action:"Resume"})}],[yl.ShareContentChange]:[{event:il,payload:e=>e}],[yl.SharePrivilegeChange]:[{event:cl,payload:e=>({privilege:e})}],[yl.ShareReadReceipt]:[{event:pl,payload:()=>{}}],[yl.ShareStatisticDataChange]:[{event:hl,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[yl.RemoteControlApprovedChange]:[{event:sl,payload:e=>({state:e?Xa.Approved:Xa.Rejected})}],[yl.RemoteControlInControlChange]:[{event:al,payload:e=>({isControlling:e})}],[yl.RemoteControlClipboardChange]:[{event:dl,payload:e=>e}],[yl.RemoteControlRequestChange]:[{event:ml,payload:e=>e}],[yl.RemoteControlAppStatusChange]:[{event:vl,payload:e=>e}],[yl.RemoteControlControlledStatusChange]:[{event:gl,payload:e=>e}]};let bl=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}({}),El=function(e){return e.QaSettingChange="qa-setting-change",e.QaActionChange="qa-action-change",e}({});const Il={[El.QaSettingChange]:[{event:"QA_SETTING_OPTION_CHANGE",payload:e=>e}],[El.QaActionChange]:[{event:"QA_NEW_ASK_QUESTION",payload:e=>({action:bl.Question,data:e})},{event:"QA_UPDATE_ANONYMOUS_QUESTION",payload:e=>({action:bl.UpdateQuestion,data:e})},{event:"QA_ANSWER_QUESTION",payload:e=>({action:bl.Answer,data:e})},{event:"QA_ANSWER_REMOVE_COMMENT",payload:e=>({action:bl.DeleteComment,data:e})},{event:"QA_ANSWER_REMOVE_QUESTION",payload:e=>({action:bl.DeleteQuestion,data:e})},{event:"QA_ANSWER_DISMISS_QUESTION",payload:e=>({action:bl.Dismiss,data:e})},{event:"QA_ANSWER_REOPEN_QUESTION",payload:e=>({action:bl.Reopen,data:e})},{event:"QA_ANSWER_VOTE_QUESTION",payload:e=>({action:bl.Upvote,data:e})},{event:"QA_ANSWER_QUESTION_LIVE",payload:e=>({action:bl.AnswerLive,data:e})}]},Al="INVALID_OPERATION",Cl="INTERNAL_ERROR",_l="OPERATION_TIMEOUT",Rl="INSUFFICIENT_PRIVILEGES",wl="IMPROPER_MEETING_STATE",Ol="INVALID_PARAMETERS",Tl="AUDIO_ENCODE_SUCCESS",Dl="AUDIO_DECODE_SUCCESS",Pl="VIDEO_ENCODE_SUCCESS",kl="VIDEO_DECODE_SUCCESS",Ml="SHARING_ENCODE_SUCCESS",Ll="SHARING_DECODE_SUCCESS",Nl="AUDIO_ENCODE_FAIL",Vl="AUDIO_DECODE_FAIL",Ul="VIDEO_ENCODE_FAIL",jl="VIDEO_DECODE_FAIL",xl="SHARING_ENCODE_FAIL",Bl="SHARING_DECODE_FAIL",Fl="MEDIA_DEVICE_CHANGE",Hl="MEDIS_SDK_PATHCH_LOADED",$l="AUDIO_BRIDGE_PEER_CONNECTION_RECEIVE_READY",Wl="AUDIO_BRIDGE_PEER_CONNECTION_SEND_READY",Gl="DEVICE_PERMISSION_CHANGE",zl="MEDIA_HEALTH_CHECK_FAILED";let Kl=function(e){return e.DeviceChange="device-change",e.MediaSDKChange="media-sdk-change",e.DevicePermissionChange="device-permission-change",e.MediaInternalError="media-internal-error",e}({});const ql={[Kl.DeviceChange]:[{event:Fl,payload:()=>({})}],[Kl.MediaSDKChange]:[{event:Tl,payload:()=>({type:"audio",action:"encode",result:"success"})},{event:Nl,payload:()=>({type:"audio",action:"encode",result:"fail"})},{event:Dl,payload:()=>({type:"audio",action:"decode",result:"success"})},{event:Vl,payload:()=>({type:"audio",action:"decode",result:"fail"})},{event:Pl,payload:()=>({type:"video",action:"encode",result:"success"})},{event:Ul,payload:()=>({type:"video",action:"encode",result:"fail"})},{event:kl,payload:()=>({type:"video",action:"decode",result:"success"})},{event:jl,payload:()=>({type:"video",action:"decode",result:"fail"})},{event:Ml,payload:()=>({type:"share",action:"encode",result:"success"})},{event:xl,payload:()=>({type:"share",action:"encode",result:"fail"})},{event:Ll,payload:()=>({type:"share",action:"decode",result:"success"})},{event:Bl,payload:()=>({type:"share",action:"decode",result:"fail"})}],[Kl.DevicePermissionChange]:[{event:Gl,payload:e=>e}],[Kl.MediaInternalError]:[{event:zl,payload:e=>e}]},Jl="BREAKOUT_ROOM_ADD_TOKEN",Ql="BREAKOUT_ROOM_INVITE_TO_JOIN_NOTIFICATION",Zl="BREAKOUT_ROOM_ROOM_CLOSING_COUNTDOWN",Yl="BREAKOUT_ROOM_ROOM_COUTDOWN",Xl="BREAKOUT_ROOM_BROADCAST_MESSAGE",ec="BREAKOUT_ROOM_ASK_HELP_REQUEST",tc="BREAKOUT_ROOM_ASK_HELP_RESPONSE",oc="BREAKOUT_ROOM_ATTRIBUTE_INDICATION",nc="BREAKOUT_ROOM_JOIN_BO_RESPONSE",rc="BREAKOUT_ROOM_ROOM_COUNTDOWN_TIME_UP",ic="BREAKOUT_ROOM_CURRENT_USER_PARTICIPANT_ROLE",sc="BREAKOUT_ROOM_LOAD_PRE_ASSIGNED_ROOMS",ac="BREAKOUT_ROOM_MAIN_SESSION_USER_UPDATE",dc="BREAKOUT_ROOM_INVITE_TO_BACK_NOTIFICATION",uc="BREAKOUT_ROOM_IN_ROOM_USER_STATUS_UPDATE",lc="BREAKOUT_ROOM_BROADCAST_VOICE";let cc=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 pc={[cc.InviteToJoin]:[{event:Ql,payload:e=>e}],[cc.RoomCountdown]:[{event:Yl,payload:e=>e}],[cc.RoomTimeUp]:[{event:rc,payload:e=>e}],[cc.ClosingRoomCountdown]:[{event:Zl,payload:e=>e}],[cc.BroadcastMessage]:[{event:Xl,payload:e=>e}],[cc.AskForHelp]:[{event:ec,payload:e=>e}],[cc.AskForHelpResponse]:[{event:tc,payload:e=>e}],[cc.RoomStateChange]:[{event:oc,payload:e=>({status:e.controlStatus})}],[cc.MainSessionUserUpdate]:[{event:ac,payload:()=>({})}],[cc.InviteToBack]:[{event:dc,payload:e=>e}],[cc.RoomUserUpdate]:[{event:uc,payload:e=>e}],[cc.BroadcastVoice]:[{event:lc,payload:e=>e}]};var hc=function(e){return e.StatusUpdate="archiving-status-update",e.OptionsUpdate="archiving-options-update",e}(hc||{});const mc={[hc.StatusUpdate]:[{event:"ARCHIVING_STATUS_UPDATE",payload:e=>e}],[hc.OptionsUpdate]:[{event:"ARCHIVING_OPTIONS_UPDATE",payload:e=>e}]};let vc=function(e){return e.PollDataChange="poll-data-change",e.PollSizeUpdate="poll-size-update",e.PollStatusUpdate="poll-status-update",e}({});const gc={[vc.PollDataChange]:[{event:"POLL_DATA_CHANGE",payload:e=>e}],[vc.PollSizeUpdate]:[{event:"POLL_SIZE_UPDATE",payload:e=>e}],[vc.PollStatusUpdate]:[{event:"POLL_STATUS_UPDATE",payload:e=>e}]};let fc=function(e){return e.ReactionReceived="reaction-received",e.ReactionRemoved="reaction-removed",e}({});const yc={[fc.ReactionReceived]:[{event:"REACTION_RECEIVED",payload:e=>e}],[fc.ReactionRemoved]:[{event:"REACTION_REMOVED",payload:e=>e}]},Sc="SMART_SUMMARY_STATUS_CHANGE",bc="MEETING_QUERY_STATUS_CHANGE";let Ec=function(e){return e.SummaryChange="summary-status-change",e.MeetingQueryChang="meeting-query-status-change",e}({});const Ic={[Ec.SummaryChange]:[{event:Sc,payload:e=>e}],[Ec.MeetingQueryChang]:[{event:bc,payload:e=>e}]},Ac="LIVE_STREAM_STATUS_CHANGE",Cc={"live-stream-status":[{event:Ac,payload:e=>e}]},_c={...ia,...la,...ya,...Ia,...Na,...zu,...vu,...Il,...Sl,...ql,...pc,...mc,"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}],...gc,...yc,...Ic,...Cc},Rc=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)}))}}}(),wc=new Map,Oc=new Array,Tc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;Rc.emit(e,t)},Dc=e=>new Promise(((t,o)=>{e.fail&&e.fail.length>0?vt(st(Rc,e.success).pipe(ft(1)),ct(...e.fail.map((e=>st(Rc,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(Rc,e.success).pipe(ft(1)).subscribe((e=>t(e)))})),Pc=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(Rc,e).pipe(ft(1)):(i=st(Rc,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:Cl}):0===o.ret?n(o.body):r({type:Cl,reason:o.body})}else n(e)}),(()=>{r({type:_l})}))}))},kc=(e,t)=>void 0!==t?st(Rc,e).pipe(ft(t)):st(Rc,e),Mc=()=>{Oc.forEach((e=>{e.unsubscribe()})),Oc.length=0,wc.clear()},{setAttendeesList:Lc,setAssistantList:Nc,setIsAdmitAllSilentUsers:Vc,resetParticipants:Uc,addFailoverAttendees:jc,removeFailoverAttendees:xc,setClearRaiseHand:Bc,setClearAttendeeFeedback:Fc,updateAttendeeDisplayName:Hc,removeXmppAttendeeUser:$c,updateXmppAttendeeList:Wc,setAttendeeExtraKey:Gc}=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 zc="NOT_FOUND",Kc=function(e,t){return e===t};function qc(e,t){var o,n,r="object"==typeof t?t:{equalityCheck:t},i=r.equalityCheck,s=void 0===i?Kc: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 zc}return{get:n,put:function(t,r){n(t)===zc&&(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===zc){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 Jc(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n{let{participants:{attendeesList:t}}=e;return t},Yc=e=>{let{meeting:{userId:t}}=e;return t},Xc=e=>{let{participants:{xmppAttendeeList:t}}=e;return t};let ep=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}({}),tp=function(e){return e[e.Host=10]="Host",e[e.Panelist=20]="Panelist",e[e.Attendee=30]="Attendee",e}({}),op=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 np=e=>(e&ep.Host)===ep.Host,rp=e=>(e&op.Phone)===op.Phone,ip=e=>e===ep.ViewOnlyCanTalk,sp=e=>(e&ep.ViewOnly)===ep.ViewOnly;let ap=function(e){return e[e.Automatically=1]="Automatically",e[e.Manually=2]="Manually",e[e.SelfSelect=3]="SelfSelect",e}({}),dp=function(e){return e[e.NotStarted=1]="NotStarted",e[e.InProgress=2]="InProgress",e[e.Closing=3]="Closing",e[e.Closed=4]="Closed",e}({}),up=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}({}),lp=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}({}),cp=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 pp="Subsession";let hp=function(e){return e[e.Received=0]="Received",e[e.Busy=1]="Busy",e[e.Ignore=2]="Ignore",e[e.AlreadyInRoom=3]="AlreadyInRoom",e}({}),mp=function(e){return e[e.AskToLeave=0]="AskToLeave",e[e.ClosingRoom=1]="ClosingRoom",e}({}),vp=function(e){return e[e.Active=0]="Active",e[e.Ask=1]="Ask",e}({}),gp=function(e){return e[e.Connect=1]="Connect",e[e.Muted=2]="Muted",e[e.Voip=4]="Voip",e}({}),fp=function(e){return e[e.Connect=8]="Connect",e[e.On=16]="On",e}({}),yp=function(e){return e[e.Share=32]="Share",e[e.ShareAudio=64]="ShareAudio",e}({});const Sp=e=>{let{breakoutRoom:t}=e;return t&&t.controlStatus},bp=e=>{let{breakoutRoom:t}=e;return t&&t.currentRoom.status},Ep=Qc([Yc,Zc],((e,t)=>t.find((t=>t.userId===e)))),Ip=Qc([Ep],(e=>(null==e?void 0:e.isHost)||(null==e?void 0:e.bCoHost))),Ap=Qc([Ep],(e=>null==e?void 0:e.isHost)),Cp=Qc([Xc],(e=>e.filter((e=>e.userRole===tp.Attendee)))),_p=Qc([Zc],(e=>e.filter((e=>e.bHold&&!e.bid)))),Rp=Qc([Zc,Sp,bp],((e,t,o)=>t!==dp.InProgress&&t!==dp.Closing||o!==lp.InRoom?e.filter((e=>!e.bHold&&!e.bid)):e.filter((e=>!e.bHold)))),wp=Qc([e=>{let{participants:{assistantList:t}}=e;return t}],(e=>e)),Op=Qc([Rp],(e=>e.find((e=>e.isHost)))),Tp=Qc([Rp],(e=>e.filter((e=>e.bCoHost)))),Dp=Qc([Ep,Rp],((e,t)=>t.filter((t=>t.userId!==(null==e?void 0:e.userId)))));Qc([Xc],(e=>e.reduce(((e,t)=>{const{jid:o}=t;return Object.assign(e,{[o]:t}),e}),{}))),Qc([Xc,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 Pp=Qc([Zc],(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>(null==e?void 0:e.bLocalRecord)===_a.Start))})),kp=Qc([Sp,e=>{let{meeting:t}=e;return t&&t.meetingOptions},Zc,Ap],((e,t,o,n)=>{const r=o.filter((e=>e.bCoHost)),{moveToWRIfHostLeave:i}=t,s=e===dp.InProgress;return n&&!!i&&r.length<=0&&!s&&o.length>1}));Qc([Zc,bp,e=>{let{breakoutRoom:t}=e;return t&&t.mainSessionAttendeeList}],((e,t,o)=>(t===lp.InRoom?o:e).filter((e=>{return!(e.bHold||e.isHost||e.audio===Ad.Phone||rp(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 Mp=function(e){return e.Closed="closed",e.Connecting="connecting",e.Connected="connected",e}({});function Lp(e){return 1<e,SET_ARCHIVING_SESSION_READY:e=>e,SET_ARCHIVING_OPTIONS:e=>e,RESET_ARCHIVING:()=>{}}),{setIsLiveTranscriptionEnabled:Gg,setLiveTranscriptionMeetingOptions:zg,setIsLiveTranscriptionManualCaptionerEnabled:Kg,setLiveTranscriptionGatewayId:qg,setLiveTranscriptionSupportedLanguage:Jg,setIsLiveTranscriptionSubscribed:Qg,setCurrentTranscriptionLang:Zg,setCurrentTranslationLang:Yg,addLiveTranscriptionMessage:Xg,updateLiveTranscriptionMessage:ef,reduceLiveTranscriptionMessages:tf,setLiveTranscriptionEngineType:of,removeLiveTranscriptionFailoverState:nf,setLiveTranscriptionLastCaptionMessage:rf,resetLiveTranscription:sf,setIsHostDisableCaptions:af}=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:df,setPollingId:uf,setPollingWebLinks:lf,setPollingDocMaxSize:cf,setPollingDocSize:pf,setPollingDocLibraryMaxSize:hf,setPollingDocLibrarySize:mf,resetPoll:vf}=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:gf,setIsLaplaceInitialized:ff,resetLogger:yf}=wo("SET_LOGGER_INIT_OPTIONS","SET_IS_LAPLACE_INITIALIZED","RESET_LOGGER"),{setIsLiveStreamEnable:Sf,setLiveStreamStatus:bf,resetLiveStream:Ef}=wo("SET_IS_LIVE_STREAM_ENABLE","SET_LIVE_STREAM_STATUS","RESET_LIVE_STREAM");var If={exports:{}},Af={};!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})}(Af,Qt(Object.freeze({__proto__:null,default:{}}))),Jt(Af),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})}(If.exports,Af),Jt(If.exports);class Cf{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 _f(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 Rf(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 wf(e){if(e){var t;const o=document.getElementById(e);null==o||null===(t=o.parentNode)||void 0===t||t.removeChild(o)}}let Of="zoom.us";const Tf="3.8.5",Df=`https://dmogdx0jrul3u.cloudfront.net/${Tf}/lib/av`,Pf=`https://source.zoom.us/${Tf}/lib/av`,kf=`https://jssdk.zoomus.cn/${Tf}/lib/av`,Mf=()=>Of,Lf=(e,t,o)=>ot([t,o].map(((t,o)=>{if("initial"!==t)return Ue(["success"===t]);{const t=0===o?"ENCODE":"DECODE";return vt(kc(`${e.toUpperCase()}_${t}_SUCCESS`,1).pipe(ze((()=>!0))),kc(`${e.toUpperCase()}_${t}_FAIL`,1).pipe(ze((()=>!1))))}}))),Nf=e=>{const t=Ep(e.value);return t?je(t):kc($s,1).pipe(Le(pe),Tt(e),ze((e=>{let[,t]=e;return Ep(t)})))};function Vf(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?Uu:cu;return"audio"===e&&Ki()||r?Promise.resolve():Pc(i)}const Uf=()=>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 jf(e){const{x:t,y:o,width:n,height:r}=e.getBoundingClientRect();return{scaleWidth:n,scaleHeight:r,srcOffsetX:t,srcOffsetY:o}}function xf(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 Bf(){try{return"undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(Ga)}catch(e){return!1}}function Ff(){var e;return null===(e=WebAssembly)||void 0===e?void 0:e.validate(za)}const Hf=(()=>{const e=new Cf;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 $f(e){const t=["joinComputerAudio","joinSharingAudio","leaveComputerAudio","leaveSharingAudio"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return Hf.withAudioAction(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}function Wf(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 Gf=(e,t)=>{const o=document.createElement("link");return o.rel="preload",o.href=e,o.as=t,o.crossOrigin="anonymous",o},zf=(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 Kf(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 Wf(o)&&Object.assign(n,{resourceManager:If.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]):kc($l,1).pipe(yt(!0)),n||i?Ue([!0]):kc(Wl,1).pipe(yt(!0))])}function Jf(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 Qf(e){return e.find((e=>"default"===e.deviceId))}const Zf=(()=>{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()}}})(),Yf=(e,t)=>Pc({event:ta,operations:[mt((t=>void 0!==t[`${e}`])),ft(1)]},(o=>o[`${e}`]===t));class Xf{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 Xf),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}}Xf.instance=void 0;const ey=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=Ep(e))||void 0===a?void 0:a.audio)===Ad.Computer&&t.leaveComputerAudio(),t.disconnect(),Zf.watch(t.destroy()),e.video&&(e.video.subscribedVideoList.length>0&&e.video.subscribedVideoList.forEach((e=>{o.unsubscribeVideo(e)})),e.video.isCurrentUserStartedVideo&&Tc(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)}Xf.destroyInstance()}if(t||(Vi.clearSession(),[Ui.WebclientTk,Ui.WebclientZsk,Ui.WebclientZtk,Ui.WebclientRecordingToken].forEach((e=>{sessionStorage.removeItem(e)})),is.destroy()),o!==Mp.Closed&&s.push(No()),n!==Mp.Closed&&s.push(Vo()),r!==Mp.Closed&&s.push(Fo()),t){const o=Ep(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(),Uc(),Zp(t),lm(),Im(t),Cv(),Ov(),Vg(),eg(),hg(),Bg(),Wg(),sf(t),vf(),yf(t),Ef(t),ui(Di.Closed)),s},ty=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)},oy={[`${Pi.AudioBridgeEnable}`]:{mask:240,action:gi},[`${Pi.AudioDecodeInWorklet}`]:{mask:15,action:sn},[`${Pi.VideoFullHD}`]:{mask:15,action:rv},[`${Pi.VideoShareFullHD}`]:{mask:15,action:um},[`${Pi.WebGL2Render}`]:{mask:15,action:av},[`${Pi.WebGPURender}`]:{mask:15,action:dv},[`${Pi.ZMKFromRWG}`]:{mask:15,action:_i}};function ny(e){if(!e)return"";const t=e.match(/rid=(.*)/);return t?t[1]:""}function ry(e){return F(ze(((t,o)=>e(t,o))),mt((e=>null!=e)))}function iy(e){return F(Xe(((t,o)=>e(t,o)||fe)))}function sy(e){return F(Xe(((t,o)=>e(t,o))),Xe((e=>Array.isArray(e)?Ue(e):je(e))))}const ay={period:500,rules:[{peak:50,throttle:300},{peak:60,throttle:400}]},dy={[`${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 uy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ay;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(dy),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=dy[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=dy[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 ly=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 cy=262144,py=1048576,hy=e=>4==(4&e),my=e=>(e&py)===py,vy=e=>{let{share:{isReceiveSharing:t}}=e;return t},gy=e=>{let{share:{activeNodeId:t}}=e;return t},fy=Qc([Rp,vy,gy],(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=ly.Mac:"win"===o&&(e=ly.Windows),{...t,os:e}}}return null})),yy=Qc([Rp],(e=>e.filter((e=>e.sharerOn)))),Sy=Qc([yy],(e=>e.some((e=>!!e.bVideoShare)))),by=Qc([e=>{let{share:{remoteControlledUserList:t}}=e;return t},vy,gy],((e,t,o)=>!!t&&e.some((e=>fr(e,o)))));var Ey,Iy=new Uint8Array(16);function Ay(){if(!Ey&&!(Ey="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 Ey(Iy)}for(var Cy,_y,Ry,wy,Oy=/^(?:[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,Ty=[],Dy=0;Dy<256;++Dy)Ty.push((Dy+256).toString(16).substr(1));function Py(e,t,o){var n=(e=e||{}).random||(e.rng||Ay)();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=(Ty[e[t+0]]+Ty[e[t+1]]+Ty[e[t+2]]+Ty[e[t+3]]+"-"+Ty[e[t+4]]+Ty[e[t+5]]+"-"+Ty[e[t+6]]+Ty[e[t+7]]+"-"+Ty[e[t+8]]+Ty[e[t+9]]+"-"+Ty[e[t+10]]+Ty[e[t+11]]+Ty[e[t+12]]+Ty[e[t+13]]+Ty[e[t+14]]+Ty[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Oy.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"}(Cy||(Cy={})),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"}(_y||(_y={})),function(e){e[e.PROTECT_LOCAL_KEY=0]="PROTECT_LOCAL_KEY"}(Ry||(Ry={})),function(e){e.beforeInit="beforeInit",e.afterInit="afterInit",e.beforeLog="beforeLog",e.hitSizeLimit="hitSizeLimit",e.afterLog="afterLog",e.beforeReport="beforeReport",e.afterReport="afterReport"}(wy||(wy={}));class ky{constructor(){}}var My,Ly={exports:{}},Ny={exports:{}},Vy=Qt(Object.freeze({__proto__:null,default:{}}));Ny.exports=(My=My||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=Vy}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=Uy.exports.parse(e);return Ly.exports.stringify(t)}catch(t){return e}},By=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},Fy=()=>jy(void 0,void 0,void 0,(function*(){return yield self.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"])})),Hy=(e,t,o)=>jy(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}})),$y=(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{Wy[t]=e},zy=Wy,Ky=e=>{try{return JSON.stringify(e)}catch(e){return"json stringify failed"}},qy=e=>{try{return JSON.parse(e)}catch(t){return e}};const Jy=e=>{let t=0;return t+=By(e.message),e.tags.forEach((e=>{t+=By(e)})),t};class Qy{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({},zy)}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 Fy();const t=this.externalKeys?null===(e=this.externalKeys.filter((e=>e.usage===Ry.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+=Jy(n);else o+=Jy(e);return this.currentSize=o,o>=this.maxSize}}const Zy=(...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},Yy=(e,t)=>{const o=new Map;return t.forEach((t=>{e(t)&&o.set(t.id,t)})),o};class Xy{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 Zy(...t.map((t=>e.byTag[t])).filter((e=>Boolean(e))))}else{if("function"==typeof t)return Yy(t,e.byTime);if("object"==typeof t)if(t.tags&&t.filter){if("string"==typeof t.tags)return Yy(t.filter,e.byTag[t.tags]);if(Array.isArray(t.tags)&&t.tags.every((e=>"string"==typeof e)))return Zy(...t.tags.map((o=>{const n=e.byTag[o];return n?Yy(t.filter,n):new Map})))}else{if(t.filter)return Yy(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 Zy(...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(xy(n.message))});o.set(e,t)}return o},this.store={byTag:{},byTime:new Map}}}function eS(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 tS=(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=eS(e,wy.beforeLog,d);if(s)eS(e,wy.afterLog,d);else{const{idbManager:t,logManager:o}=e,n=yield t.makeNextId();u.message=(e=>{try{const t=Ly.exports.parse(e);return Uy.exports.stringify(t)}catch(t){return e}})(u.message);const r=Object.assign(Object.assign({},u),{id:n});e.updateCurrentSize(r)&&eS(e,wy.hitSizeLimit,r),o.addLog(r),yield t.addLog(r),eS(e,wy.afterLog,r)}}));Gy(tS,"commonLog");const oS=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 nS=(e,t=2)=>{let o=`${e}`;for(;o.length{const t=new Date(e);return`${t.getUTCFullYear()}-${nS(t.getUTCMonth()+1)}-${nS(t.getUTCDate())} ${nS(t.getUTCHours())}:${nS(t.getUTCMinutes())}:${nS(t.getUTCSeconds())}.${nS(t.getUTCMilliseconds(),3)}`},iS={version:"000001",flag:"0"},sS=(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:iS}))),aS=(e,t,o)=>((e,t,o)=>Promise.all(e.map((e=>Object.assign({url:t||"",type:"POST",withCredentials:!1,headers:{},data:Ky({messages:e.messages,meta:e.meta}),reportItem:e},o))).map(oS)))(e,t.reportUrl,o).then((e=>{e.forEach((e=>{var o;eS(t,wy.afterReport,{report:e.report,error:null!==(o=e.error)&&void 0!==o?o:null})}))})),dS=(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=eS(e,wy.beforeReport,n),a=sS(s,i);aS(a,e,r)}));Gy(dS,"commonReport");var uS=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 lS=(e,t,o)=>uS(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)})),cS=e=>uS(void 0,void 0,void 0,(function*(){const{idbManager:t,logManager:o}=e;yield t.reset(),o.reset()}));function pS(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]:gS())("readwrite",(function(t){return e.forEach((function(e){return t.delete(e)})),hS(t.transaction)}))}function yS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gS();return e("readonly",(function(t){if(t.getAll&&t.getAllKeys)return Promise.all([hS(t.getAllKeys()),hS(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 pS(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)?pS(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())},hS(e.transaction)}(e).then((function(){return o}))}))}))}Gy(lS,"commonDelete"),Gy(cS,"commonReset");var SS=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 bS={default:{queue:[],isRunning:!1,listeners:[]}},ES=e=>{let t=bS[e];return t||(t={queue:[],isRunning:!1,listeners:[]},bS[e]=t),t};function IS(e){return SS(this,void 0,void 0,(function*(){const t=ES(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,IS(e)}n.length&&n.forEach((e=>{e()}))}))}function AS(e,t){const o=ES(t);try{return new Promise(((n,r)=>{o.queue.push({task:e,resolution:n,rejection:r}),IS(t)}))}catch(e){return Promise.reject(e)}}const CS=(e,t)=>{ES(e).listeners.push(t)};var _S=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 RS="change_meta",wS="change_log",OS=()=>Promise.resolve();class TS{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]:gS())("readonly",(function(t){return hS(t.get(e))}))}(e,this.store),this.set=(e,t)=>_S(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]:gS())("readwrite",(function(o){return o.put(t,e),hS(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=()=>_S(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 fS(o,this.store)})),this.adjustMaxId=()=>_S(this,void 0,void 0,(function*(){return this.resetting?OS():(this.isChangingMeta=!0,yield AS((()=>_S(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}))),RS))})),this.makeNextId=()=>_S(this,void 0,void 0,(function*(){return this.resetting?OS():(this.isChangingMeta=!0,yield AS((()=>_S(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}))),RS))})),this.addLog=e=>_S(this,void 0,void 0,(function*(){if(this.resetting)return OS();this.isChangingLog=!0,yield AS((()=>_S(this,void 0,void 0,(function*(){const{id:t}=e;return this.set(`${t}`,e)}))),wS)})),this.getAllLogs=()=>_S(this,void 0,void 0,(function*(){return(yield yS(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=>_S(this,void 0,void 0,(function*(){if(this.resetting)return OS();this.isChangingLog=!0,yield AS((()=>_S(this,void 0,void 0,(function*(){return fS(e.map((e=>`${e}`)),this.store)}))),wS),yield this.adjustMaxId()})),this.saveAESGCM256Key=(e,t,o)=>_S(this,void 0,void 0,(function*(){if(o){const n=yield self.crypto.subtle.exportKey("raw",t),r=yield((e,t,o)=>jy(void 0,void 0,void 0,(function*(){return new Promise(((n,r)=>{requestAnimationFrame((()=>jy(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=$y:"AES-GCM"===i&&(s=Hy),!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=()=>_S(this,void 0,void 0,(function*(){return this.resetting?OS():(this.waitingForReset=!0,this.isChangingLog||this.isChangingMeta?OS():(this.resetting=!0,yield function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:gS())("readwrite",(function(e){return e.clear(),hS(e.transaction)}))}(this.store),this.resetting=!1,void(this.waitingForReset=!1)))})),this.store=mS(e,e+"-store"),CS(RS,(()=>{if(this.isChangingMeta=!1,this.waitingForReset)return this.reset()})),CS(wS,(()=>{if(this.isChangingLog=!1,this.waitingForReset)return this.reset()}))}}var DS=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={databaseName:"laplace-default-db",maxSize:49283072};class kS{constructor(e){this.commonLogWithContext=(e,t,o,n,r)=>DS(this,void 0,void 0,(function*(){yield tS(this.runtimeMetaManager,e,t,o,n,r)})),this.commonReportWithContext=(e,t)=>DS(this,void 0,void 0,(function*(){yield dS(this.runtimeMetaManager,e,t)})),this.commonDeleteWithContext=e=>DS(this,void 0,void 0,(function*(){yield lS(this.runtimeMetaManager,e)})),this.resetWithContext=()=>DS(this,void 0,void 0,(function*(){yield cS(this.runtimeMetaManager)})),this.initLocalAESGCM256Key=()=>DS(this,void 0,void 0,(function*(){return yield Fy()})),this.doNotUseDirtyGetStore=()=>this.runtimeMetaManager.logManager.getStore(),this.log=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.log,Cy.PLAIN,{extraProperties:o})})),this.info=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.info,Cy.PLAIN,{extraProperties:o})})),this.warn=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.warn,Cy.PLAIN,{extraProperties:o})})),this.debug=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.debug,Cy.PLAIN,{extraProperties:o})})),this.error=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.error,Cy.PLAIN,{extraProperties:o})})),this.logWithEncryption=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.log,Cy.AESGCM256,{extraProperties:o})})),this.infoWithEncryption=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.info,Cy.AESGCM256,{extraProperties:o})})),this.debugWithEncryption=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.debug,Cy.AESGCM256,{extraProperties:o})})),this.warnWithEncryption=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.warn,Cy.AESGCM256,{extraProperties:o})})),this.errorWithEncryption=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.error,Cy.AESGCM256,{extraProperties:o})})),this.logWithoutCache=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.log,Cy.PLAIN,{extraProperties:o,noCache:!0})})),this.infoWithoutCache=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.info,Cy.PLAIN,{extraProperties:o,noCache:!0})})),this.warnWithoutCache=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.warn,Cy.PLAIN,{extraProperties:o,noCache:!0})})),this.debugWithoutCache=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.debug,Cy.PLAIN,{extraProperties:o,noCache:!0})})),this.errorWithoutCache=(e,t,o)=>DS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,_y.error,Cy.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(By(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:rS(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),aS([{messages:JSON.stringify(s),meta:iS}],e,o.xhrOptions)})))(this.runtimeMetaManager,...e),this.reportByHttps=(e,t)=>DS(this,void 0,void 0,(function*(){yield this.commonReportWithContext(e,t)})),this.deleteLog=e=>DS(this,void 0,void 0,(function*(){yield this.commonDeleteWithContext(e)})),this.deleteAll=()=>DS(this,void 0,void 0,(function*(){yield this.resetWithContext()}));const{runtimeMetaManager:t}=e;this.runtimeMetaManager=t}}kS.init=e=>DS(void 0,void 0,void 0,(function*(){const{databaseName:t="laplace-default-db"}=e,o=new TS(t),n=new Xy,r=new Qy(Object.assign(Object.assign(Object.assign({},PS),e),{idbManager:o,logManager:n}));eS(r,wy.beforeInit),yield n.syncFromIDB(r.idbManager);const i=new kS({runtimeMetaManager:r});return eS(r,wy.afterInit),i}));class MS extends ky{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 _y.error:console.error(t.message);break;case _y.warn:console.warn(t.message);break;case _y.log:console.log(t.message);break;case _y.debug:console.debug(t.message);break;case _y.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 LS=e=>{const t=[];for(const[o,n]of e)t.push(n);return t};class NS extends ky{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?LS(r).filter(t):LS(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 VS="Expected a function",US=NaN,jS="[object Symbol]",xS=/^\s+|\s+$/g,BS=/^[-+]0x[0-9a-f]+$/i,FS=/^0b[01]+$/i,HS=/^0o[0-7]+$/i,$S=parseInt,WS="object"==typeof qt&&qt&&qt.Object===Object&&qt,GS="object"==typeof self&&self&&self.Object===Object&&self,zS=WS||GS||Function("return this")(),KS=Object.prototype.toString,qS=Math.max,JS=Math.min,QS=function(){return zS.Date.now()};function ZS(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function YS(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&KS.call(e)==jS}(e))return US;if(ZS(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ZS(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(xS,"");var o=FS.test(e);return o||HS.test(e)?$S(e.slice(2),o?2:8):BS.test(e)?US:+e}var XS=function(e,t,o){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError(VS);return ZS(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(VS);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=QS();if(m(e))return g(e);a=setTimeout(v,function(e){var o=t-(e-d);return c?JS(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=QS(),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=YS(t)||0,ZS(o)&&(l=!!o.leading,i=(c="maxWait"in o)?qS(YS(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(QS())},f}(e,t,{leading:n,maxWait:t,trailing:r})};const eb=["RESOURCE_ERROR","JS_ERROR","UNHANDLED_PROMISE_REJECTION"];class tb extends ky{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=XS((()=>{if(null===this.runtimeMetaManager)return;const{autoReport:e}=this.config,{commonMethods:{commonReport:t}}=this.runtimeMetaManager;return t(this.runtimeMetaManager,eb,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)),_y.error,Cy.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: ${Ky(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 ob=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}({}),nb=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 rb(e){return`{E}${e}{/E}`}const ib={enable:!1,enableReport:!1,gatewayEndPoint:"",newGatewayEndPoint:"",logLevel:{debug:!1,log:!1,info:!1,print:!1,warn:!1,error:!1},performanceReportRatio:.25,trackingCount:7},sb=["debug","log","info","print","warn","error"],ab=(e,t)=>[...e,...t].filter((e=>!!e));class db{static getInstance(){return this.agentInstance||(this.agentInstance=new db),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=ib;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=sb.indexOf(s),t=sb.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:Ry.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 MS({verbose:!1}),new NS({debug:!1,cleanAfterReport:!0,expireBefore:n}),new tb({debug:!1,autoReport:r,ignoredErrorMsgKeywords:["table index is out of bounds"],maxErrorCount:223,publicTags:this.accountId?[...this.publicTags,rb(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){}(null===(o=r.length>=(null==t?void 0:t.trackingCount))||void 0===o||o)&&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,kS.init(t).then((e=>{this.handleInitLaplaceSuccess(e,o)})).catch((e=>{throw{type:Cl,reason:"Logger init failed.",error:e}}))):Promise.reject({type:Al,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,ab(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,ab(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,ab(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,ab(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,ab(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=ab(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:Al,reason:"Please use getLogs to obtain log data and report by yourself."}):Promise.reject({type:Al,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;const s=Array.isArray(o)?o:[o],a=e.accountId?[...s,rb(e.accountId)]:s;null===(r=(i=e.makeLogger(a))[`${n}`])||void 0===r||r.call(i,t).then((()=>{e.reportToGlobalTracing(s)}))}},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=Py()}}db.agentInstance=void 0;const ub=db.getInstance(),lb=[{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})))]}),[]),cb=lb.map((e=>e.name)),pb=function(e){const t=lb.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)));ub.makeLogger([i,`${i} Media SDK`]).info(`${e},params:${JSON.stringify(s)}`)}};function hb(e){return new Proxy(e,{get:(e,t)=>"string"==typeof t&&cb.includes(t)?function(){for(var o=arguments.length,n=new Array(o),r=0;r!!e)))));const a=fy(o);a&&(i?(r.resendRemoteControlPositionPDU(),r.updateRemoteControlProperties({os:a.os,isControllerNow:!0,dimension:t&&jf(t)})):t&&r.startRemoteControl(t,a.os,jf(t)))}function Cb(){mb.log("qr scanning stop"),vb.startRemoteControlQRCheck(!1)}const _b=Ns.createAgent(),Rb=hb(Hs.getInstance()),wb=Ns.createAgent(),Ob=hb(Hs.getInstance());function Tb(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:Vb(e)?2:Ub(e)?3:0}function Lb(e,t){return 2===Mb(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nb(e,t,o){var n=Mb(e);2===n?e.set(t,o):3===n?(e.delete(t),e.add(o)):e[t]=o}function Vb(e){return uE&&e instanceof Map}function Ub(e){return lE&&e instanceof Set}function jb(e){return e.o||e.t}function xb(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=fE(e);delete t[mE];for(var o=gE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=Fb),Object.freeze(e),t&&kb(e,(function(e,t){return Bb(t,!0)}),!0)),e}function Fb(){Tb(2)}function Hb(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function $b(e){var t=yE[e];return t||Tb(18,e),t}function Wb(){return aE}function Gb(e,t){t&&($b("Patches"),e.u=[],e.s=[],e.v=t)}function zb(e){Kb(e),e.p.forEach(Jb),e.p=null}function Kb(e){e===aE&&(aE=e.l)}function qb(e){return aE={p:[],l:aE,h:e,m:!0,_:0}}function Jb(e){var t=e[mE];0===t.i||1===t.i?t.j():t.O=!0}function Qb(e,t){t._=t.p.length;var o=t.p[0],n=void 0!==e&&e!==o;return t.h.g||$b("ES5").S(t,e,n),n?(o[mE].P&&(zb(t),Tb(4)),Pb(e)&&(e=Zb(t,e),t.l||Xb(t,e)),t.u&&$b("Patches").M(o[mE].t,e,t.u,t.s)):e=Zb(t,o,[]),zb(t),t.u&&t.v(t.u,t.s),e!==pE?e:void 0}function Zb(e,t,o){if(Hb(t))return t;var n=t[mE];if(!n)return kb(t,(function(r,i){return Yb(e,n,t,r,i,o)}),!0),t;if(n.A!==e)return t;if(!n.P)return Xb(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=xb(n.k):n.o;kb(3===n.i?new Set(r):r,(function(t,i){return Yb(e,n,r,t,i,o)})),Xb(e,r,!1),o&&e.u&&$b("Patches").R(n,o,e.u,e.s)}return n.o}function Yb(e,t,o,n,r,i){if(Db(r)){var s=Zb(e,r,i&&t&&3!==t.i&&!Lb(t.D,n)?i.concat(n):void 0);if(Nb(o,n,s),!Db(s))return;e.m=!1}if(Pb(r)&&!Hb(r)){if(!e.h.F&&e._<1)return;Zb(e,r),t&&t.A.l||Xb(e,r)}}function Xb(e,t,o){void 0===o&&(o=!1),e.h.F&&e.m&&Bb(t,o)}function eE(e,t){var o=e[mE];return(o?jb(o):e)[t]}function tE(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 oE(e){e.P||(e.P=!0,e.l&&oE(e.l))}function nE(e){e.o||(e.o=xb(e.t))}function rE(e,t,o){var n=Vb(t)?$b("MapSet").N(t,o):Ub(t)?$b("MapSet").T(t,o):e.g?function(e,t){var o=Array.isArray(e),n={i:o?1:0,A:t?t.A:Wb(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=n,i=SE;o&&(r=[n],i=bE);var s=Proxy.revocable(r,i),a=s.revoke,d=s.proxy;return n.k=d,n.j=a,d}(t,o):$b("ES5").J(t,o);return(o?o.A:Wb()).p.push(n),n}function iE(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return xb(e)}var sE,aE,dE="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),uE="undefined"!=typeof Map,lE="undefined"!=typeof Set,cE="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,pE=dE?Symbol.for("immer-nothing"):((sE={})["immer-nothing"]=!0,sE),hE=dE?Symbol.for("immer-draftable"):"__$immer_draftable",mE=dE?Symbol.for("immer-state"):"__$immer_state",vE=""+Object.prototype.constructor,gE="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,fE=Object.getOwnPropertyDescriptors||function(e){var t={};return gE(e).forEach((function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)})),t},yE={},SE={get:function(e,t){if(t===mE)return e;var o=jb(e);if(!Lb(o,t))return function(e,t,o){var n,r=tE(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||!Pb(n)?n:n===eE(e.t,t)?(nE(e),e.o[t]=rE(e.A.h,n,e)):n},has:function(e,t){return t in jb(e)},ownKeys:function(e){return Reflect.ownKeys(jb(e))},set:function(e,t,o){var n=tE(jb(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,o),!0;if(!e.P){var r=eE(jb(e),t),i=null==r?void 0:r[mE];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||Lb(e.t,t)))return!0;nE(e),oE(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!==eE(e.t,t)||t in e.t?(e.D[t]=!1,nE(e),oE(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=jb(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(){Tb(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Tb(12)}},bE={};kb(SE,(function(e,t){bE[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),bE.deleteProperty=function(e,t){return bE.set.call(this,e,t,void 0)},bE.set=function(e,t,o){return SE.set.call(this,e[0],t,o,e[0])};var EE=function(){function e(e){var t=this;this.g=cE,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=$b("Patches").$;return Db(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),IE=new EE,AE=IE.produce;IE.produceWithPatches.bind(IE),IE.setAutoFreeze.bind(IE),IE.setUseProxies.bind(IE),IE.applyPatches.bind(IE),IE.createDraft.bind(IE),IE.finishDraft.bind(IE);const CE={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}}},_E=ko({[`${wh}`]:AE(((e,t)=>{let{payload:o}=t;e.sharePrivilege=o})),[`${Oh}`]:AE(((e,t)=>{let{payload:o}=t;e.isRemoteSharingActive=1===o.bStatus,e.activeNodeId=o.activeNodeID,e.activeSsrc=o.ssrc})),[`${Th}`]:AE(((e,t)=>{let{payload:o}=t;e.isReceiveSharing=o})),[`${Dh}`]:AE(((e,t)=>{let{payload:o}=t;e.isChromeExtensionInstalled=o})),[`${kh}`]:AE(((e,t)=>{let{payload:o}=t;e.shareDimension={...o}})),[`${Mh}`]:AE(((e,t)=>{let{payload:o}=t;e.status=o})),[`${Lh}`]:AE(((e,t)=>{let{payload:o}=t;e.ssrc=o})),[`${Nh}`]:AE(((e,t)=>{let{payload:o}=t;e.shareQuality=o})),[`${Vh}`]:AE(((e,t)=>{let{payload:o}=t;e.receivedShareDimension={...o}})),[`${im}`]:AE(((e,t)=>{let{payload:o}=t;e.remoteControlledUserList.includes(o)||e.remoteControlledUserList.push(o)})),[`${sm}`]:AE(((e,t)=>{let{payload:o}=t;const n=e.remoteControlledUserList.indexOf(o);n>=0&&e.remoteControlledUserList.splice(n,1)})),[`${Uh}`]:AE(((e,t)=>{let{payload:o}=t;e.isGrabRemoteControl=o,!1===o&&(e.remoteControlViewportDomSelector=void 0)})),[`${jh}`]:AE(((e,t)=>{let{payload:o}=t;e.isSDKGrabControl=o})),[`${xh}`]:AE(((e,t)=>{let{payload:o}=t;e.isReceiveSharingFromMainSession=o})),[`${Bh}`]:AE(((e,t)=>{let{payload:o}=t;e.isSharingToBreakoutRoom=o})),[`${Fh}`]:AE(((e,t)=>{let{payload:o}=t;e.isSharingWithSecondCamera=o})),[`${Hh}`]:AE(((e,t)=>{let{payload:o}=t;e.secondCameraId=o})),[`${$h}`]:AE(((e,t)=>{let{payload:o}=t;e.isRequireReadReceipt=o})),[`${Wh}`]:AE(((e,t)=>{let{payload:o}=t;e.isOptimizedForSharedVideo=o})),[`${Gh}`]:AE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${zh}`]:AE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${Kh}`]:AE(((e,t)=>{let{payload:o}=t;e.capturedEnsuredCanvas.includes(o)||e.capturedEnsuredCanvas.push(o)})),[`${qh}`]:AE(((e,t)=>{let{payload:o}=t;e.renderedEnsuredCanvas.includes(o)||e.renderedEnsuredCanvas.push(o)})),[`${Qh}`]:AE(((e,t)=>{let{payload:o}=t;e.remoteControllingSsrc=o})),[`${Zh}`]:AE(((e,t)=>{let{payload:o}=t;e.remoteControlApprovedSsrc=o})),[`${Yh}`]:AE(((e,t)=>{let{payload:o}=t;e.remoteControlAppDownloadUrl=o})),[`${Xh}`]:AE(((e,t)=>{let{payload:o}=t;(e.remoteControlAppInstallStatus!==_d.Installed||_d.Unknown)&&(e.remoteControlAppInstallStatus=o)})),[`${nm}`]:AE(((e,t)=>{let{payload:o}=t;e.remoteControlAppLaunchSheme=o})),[`${rm}`]:AE(((e,t)=>{let{payload:o}=t;const{userId:n,ssrc:r}=o;Object.assign(e.userSsrcMapping,{[`${n}`]:r})})),[`${am}`]:AE(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${dm}`]:AE(((e,t)=>{let{payload:o}=t;e.remoteControlViewportDomSelector=o})),[`${um}`]:AE(((e,t)=>{let{payload:o}=t;e.isFullHDVideoShareEnabled=o})),[`${lm}`]:()=>({...CE})},CE),RE={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 am({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(Qh(0)),s!==qa.End)if(fr(i,n))if(o){bb(),Eb(),s===qa.Paused&&(wb.resumeSharing(),Ob.resumeDesktopSharing(),u.push(Mh(qa.Sharing))),u.push(Qh(r));const e=Rp(t.value).find((e=>fr(e.userId,r)));e&&u.push(rm({userId:e.userId,ssrc:r}))}else u.push(Qh(0));else{var l;const e=null===(l=Rp(t.value))||void 0===l?void 0:l.find((e=>fr(e.userId,n)));e&&(u.push(rm({userId:e.userId,ssrc:n})),Tc(ml,{userId:e.userId,displayName:e.displayName,isSharingEntireScreen:Ob.isSharingEntireScreen()}))}else if(!r||fr(r,i)){const e=Ep(t.value);if(!sp(e.userRole)&&!zi.isAndroidOrIOSBrowser){const e=n&&fr(a,n);o?(u.push(im(a)),e&&(d||wb.subscribeGrabRemoteControl(a,!0))):(u.push(sm(a)),e&&(d&&(wb.subscribeGrabRemoteControl(a,!1),u.push(Uh(!1)),Tc(al,!1)),Ob.updateRemoteControlProperties({isControllerNow:!1}))),Tc(sl,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 Ob.updateRemoteControlProperties({isControllerNow:o}),Tc(al,o),Uh(o)}))),remoteControlEpics3:e=>In(e,[Va.StartRemoteControlSuccess,Va.StartRemoteControlFailed,Va.CancelRemoteControlSuccess]).pipe(ry((e=>e.payload.type===Va.StartRemoteControlSuccess?(Tc(ul),jh(!0)):e.payload.type===Va.CancelRemoteControlSuccess?jh(!1):void(e.payload.type===Va.StartRemoteControlFailed&&Tc(ll))))),remoteControlEpics4:e=>In(e,[Va.RemoteControlCopiedTextNotify,Va.RemoteControlPasteTextLengthOverflow]).pipe(Ot((e=>{if(e.payload.type===Va.RemoteControlCopiedTextNotify){const{payload:{data:t}}=e;Tc(dl,{content:t.data,x:t.x,y:t.y})}else Tc(dl,{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){bb();try{const e=JSON.parse(o||"{}"),t=d?e.macDownloadUrl:e.winDownloadUrl;a.push(Yh(t))}catch(e){console.warn("unsupported JSON string",e)}}const s={},u=Rp(t.value).find((e=>fr(e.userId,n)));u&&Object.assign(s,{controllerName:dr(u.displayName)}),Object.assign(s,{ssrc:n});const{deviceId:l}=Ob.getShareStreamInfo();l&&Object.assign(s,{DeviceID:l});const c=`${r}&${new URLSearchParams(s).toString()}`;a.push(nm(c),Xh(_d.Unknown)),Tc(fl,c)}return Ue(a)}))),remoteControlEpics6:e=>e.pipe($t(`${em}`),Xe((()=>yb.startCheck(1e4).pipe(ze((()=>(Tc(vl,_d.Unknown),Xh(_d.Unknown)))))))),remoteControlEpics7:(e,t)=>e.pipe($t(`${tm}`),mt((()=>{const{share:{remoteControlAppInstallStatus:e}}=t.value;return e===_d.Installed})),Xe((()=>Sb.startCheck(12e4).pipe(Xe((()=>{Tc(vl,Rd.Unlaunched);const{share:{remoteControlApprovedSsrc:e,isEnableAutoDeleteRcApp:o},meeting:{userId:n}}=t.value,r=[],{isMacOS:i}=zi;return e&&(wb.remoteControlConsent(Cd.CacheClean,e,n,{...Ob.getShareStreamInfo(),platform:i?"mac":"win"},o),r.push(nm(""),Zh(0))),Ue(r)})))))),remoteControlEpics8:(e,t)=>e.pipe($t(`${nm}`),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(tm());const e=performance.now();document.hasFocus()?r=lt(25).pipe(wt((()=>{const o=performance.now()-e<500;return o||Tc(vl,_d.Uninstalled),o&&t.value.share.remoteControlAppInstallStatus===_d.Unknown})),_t((()=>{const t=performance.now()-e,o=[];return document.hasFocus()||(t>75?o.push(em()):bb(),Tc(vl,_d.Installed),o.push(Xh(_d.Installed),tm())),Ue(o)})),function(){for(var e=[],t=0;tyn(e,vs).pipe(Xe((()=>(Tc(gl,wd.Ended),Ib(t.value,wb),Ue([nm(""),Zh(0)]))))),remoteControlEpics10:(e,t)=>e.pipe($t(`${Mh}`),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&&Ib(t.value,wb),o!==e&&wb.remoteControlConsent(Cd.Decline,o,r,{...Ob.getShareStreamInfo(),platform:i?"mac":"win"},n)})),Et(fe)),remoteControlEpics11:(e,t)=>yn(e,16430).pipe(Xe((()=>(bb(),Eb(),Tc(vl,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)=>{mb.log(`load qr scanner script start. url:${o}`),_f(o,(()=>{mb.log("load qr scanner script done."),e("")}),t)}))})(e).then((()=>{mb.log("qr scanning start"),t.startRemoteControlQRCheck(!0)}))}(t.value,Ob),Ue([nm(""),Zh(0)]))))),remoteControlEpics12:e=>In(e,Va.CurrentDesktopSharingWidthHeight).pipe(Ot((()=>{wb.syncSharedContentMetaWithRcApp(Ob.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_")&&wb.sendRemoteControlAuth(e)}))})),Et(fe)),remoteControlEpics14:e=>yn(e,16434).pipe(Ot((e=>{const{payload:{body:{result:t}}}=e;0===t&&(Cb(),Tc(gl,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(sm(e)),e===d&&u&&(p.push(Uh(!1)),Tc(al,!1)))})),Ue(p)}))),remoteControlEpics16:(e,t)=>e.pipe($t(`${xr}`),Ot((()=>{const{share:{remoteControllingSsrc:e,status:o}}=t.value;o===qa.Sharing&&e&&Tc(gl,wd.Ended)})),Et(fe))},wE={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&&Tc(cl,r)})),ze((e=>{let[t]=e;return wh(t.payload.body.lockShare)}))),epics1:e=>yn(e,20227).pipe(ze((e=>Lh(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)===lp.InRoom&&s.mainSessionAttendeeList.length>0&&(e=s.mainSessionAttendeeList.findIndex((e=>e.userId===r))>-1),_b.unsubscribeSharing(r,e),gb(_b,o,a.activeNodeID),Rb.switchSharingSource(a.ssrc,i),Tc(il,{userId:a.activeNodeID})}else if(1===a.bStatus){const e={activeUserId:a.activeNodeID,isActive:!0};i&&Object.assign(e,{isFromMainSession:!0}),Tc(Ku,e)}else if(n){const e={activeUserId:a.activeNodeID,isActive:!1};i&&Object.assign(e,{isFromMainSession:!0}),Tc(Ku,e)}return Oh(a)}))),epics3:e=>In(e,Va.CheckChromeSharingExtensionResponse).pipe(ze((e=>(Tc(qu,e.payload.data),Dh(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 _b.startSharing(n,{bShareToBO:r,bShareAudio:a,bShareVideo:!!i}),Rb.switchSharingMode(i?Ed.VideoMode:Ed.Normal),Ph(!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(Ph(!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."),Tc(Ju,{reason:o}),Ue(t)}))),epics6:e=>In(e,Va.CurrentDesktopSharingWidthHeight).pipe(mt((e=>!!e.payload.data)),ze((e=>{Tc(Qu,e.payload.data);const{payload:{data:{width:t,height:o}}}=e;return Rb.ajustmentSharingCanvas(t,o),kh(e.payload.data)}))),epics7:(e,t)=>In(e,Va.SharingDecodeMaxSize).pipe(mt((e=>!!e.payload.data)),Tt(t),ry((e=>{let[t,o]=e;const{share:{shareQuality:n,activeNodeId:r}}=o,{payload:{data:{fps:i}}}=t,s=Number(i);if(n!==s)return gb(_b,o,r,s),Nh(s)}))),epics8:e=>yn(e,20226).pipe(Ot((e=>{var t,o;if(Tc(Zu,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;Rb.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>Vh(e.payload.body)))),epics9:e=>In(e,Va.SharingPara).pipe(Ot((e=>{var t,o;if(Tc(Zu,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;Rb.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>{var t;return Vh(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&&(_b.stopSharing(o),Rb.stopDesktopSharing(),Tc(Yu)),Mh(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&&(_b.stopSharing(n),Rb.stopDesktopSharing(),l.push(Mh(qa.End)),Tc(Xu)),u&&r===qa.End&&(i&&(Rb.stopRenderSharing(),_b.unsubscribeSharing(s),l.push(Th(!1))),l.push(Mh(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=yy(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))?Tc(tl,e):Tc(rl,e)})),l.length>0&&l.forEach((e=>{Tc(nl,e)})),c.length>0&&(c.forEach((e=>{Tc(ol,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 _b.unsubscribeSharing(e,o),gb(_b,t.value,s),Rb.switchSharingSource(s,o),null==n||n.localShareAudioUserMutedList.forEach((e=>{Rb.setSharingAudioVolume(s,e.userId!==s||e.muted,e.isFromMainSession)})),Tc(il,{userId:s}),je(Oh({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 Nf(t).pipe(_t((e=>{let o=a;return(!zi.isSupportSendScreenSharing||h&&e&&sp(e.userRole))&&(o="failed"),Lf("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==Rb||Rb.updateMediaParams({iVType:Xi.SHARING_ENCODE,isFromMainSession:!1,updateParams:s})),n){Rb.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)})));Rb.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}`;Lf("sharing","success",n).subscribe((e=>{let[,t]=e;t&&Rb.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}`;Lf("sharing","success",n).subscribe((e=>{let[,t]=e;t&&Rb.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;_b.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&&Tc(pl)})),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&&(_b.startSharing(s,{bShareAudio:i,bShareToBO:r,bShareVideo:!1}),Rb.switchSharingMode(Ed.Normal),a.push(Wh(!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=Dp(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?(Tc(hl,o.payload),Gh(o.payload)):Gh(vd):p?(Tc(hl,o.payload),zh(o.payload)):zh(vd)})))},OE=fn(wE,RE),TE=Ns.createAgent();let DE=function(e){return e.Add="add",e.List="list",e.Remove="memberremove",e.rename="rename",e.update="UPDATE",e}({}),PE=function(e){return e.Open="open",e.Message="message",e.Error="error",e.Close="close",e}({});class kE{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 kE),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(PE.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(PE.Message,JSON.parse(t))}catch(e){console.warn("Unsupported format",t)}})),this.websocket.addEventListener("close",(e=>{this.emit(PE.Close,e)})),this.websocket.addEventListener("error",(e=>{this.emit(PE.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})}}}kE.xmppInstance=null;const ME=db.getInstance();let LE,NE;const VE=Ns.createAgent();let UE=null;function jE(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 xE=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=jE(t);var a=e.loaded,d=e.total;this.loaded=a,this.total=d},BE=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=jE(t)}catch(e){n=t.responseText}this.response=n}})),FE=function(){function e(e,t){return BE.call(this,"ajax timeout",e,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(BE.prototype),e}();var HE=ze((function(e){return e.response}));var $E,WE=($E=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},eI=e=>ct(...e.map((e=>0===e.dl?Ue(e.items):ut(e.dl).pipe(Xe((()=>Ue(e.items))))))),tI=(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((o=>{let[,n]=o;const{meeting:{ts:r,auth:i,meetingNumber:s,meetingOptions:a,meetingId:d,userName:u},breakoutRoom:l}=n,c=null==a?void 0:a.isEnableGeoFenceRWC,p=XE(n);if(p.length>0){const o={serversLength:p.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0,retryCounts:0};let n;return c&&(n=new ee,eI(p).subscribe((e=>{var t;return null===(t=n)||void 0===t?void 0:t.next(e)}))),(c?n:eI(p)).pipe(Rt(e.pipe($t(`${Br}`))),wt((()=>{const{meeting:{meetingStatus:e,meetingId:r}}=t.value,i=e===Di.Initial&&!!r&&o.pingFailedServerList.length0;return!i&&n&&n.complete(),i})),Ot((()=>{if(o.pingRwcServerCounts=o.pingRwcServerCounts+1,c&&o.pingRwcServerCounts===o.serversLength){const e=1e3*Math.floor(5*Math.pow(2,o.retryCounts));o.retryCounts=o.retryCounts+1,YE.makeLogger(["Join Meeting Flow"]).info(`ping rwc retry,current rwc list:${JSON.stringify(XE(t.value))},retry counts:${o.retryCounts}, ${JSON.stringify({meetingId:d,meetingNumber:rb(s),userName:rb(u)})}`,["Ping RWC Retry"]),ut(e).pipe(ze((()=>{const e=XE(t.value);return Object.assign(o,{serversLength:e.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0}),e}))).subscribe((e=>{eI(e).subscribe((e=>{n.next(e)}))}))}})),Xe((e=>{const{rwc:t,rwcToken:a}=e,p=((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()}`})(t,s,a,r,i,null==l?void 0:l.currentRoom.boConfId);return WE({url:p,crossDomain:br(p)}).pipe(Xe((e=>{let o={};return o=e.response?{...e.response,rwc:t,fromNginx:!1}:{rwc:t,rwg:t,rwcToken:a,fromNginx:!0},Ue([Wo(o),Mo()])})),gt((()=>{const{pingFailedServerList:e,serversLength:t}=o;return e.push(p),e.length===t&&(c&&n&&n.complete(),YE.report(`ping rwc error, ${JSON.stringify({meetingId:d,meetingNumber:rb(s),userName:rb(u)})}`,["Join Meeting Flow","Ping RWC Error"],"error"),Tc(Zs,{reason:"connection error",errorCode:Dr.CommonError})),fe})))})),Ct(Yr(performance.now())))}return fe})));let oI=0;const nI=db.getInstance(),rI={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:{}},iI=ko({[`${Gr}`]:AE(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o),e.meetingStatus=Di.Initial})),[`${zr}`]:AE(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o)})),[`${Kr}`]:AE(((e,t)=>{let{payload:o}=t;e.isWindowOpen=o})),[`${qr}`]:AE(((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}`]:AE(((e,t)=>{let{payload:o}=t;e.ztk=o})),[`${Qr}`]:AE(((e,t)=>{let{payload:o}=t;e.zsk=o})),[`${Zr}`]:AE(((e,t)=>{let{payload:o}=t;e.tk=o.tk,e.mtkGuid=o.mtkGuid})),[`${Yr}`]:AE(((e,t)=>{let{payload:o}=t;e.pingRWCTimestamp=o})),[`${Ci}`]:AE(((e,t)=>{let{payload:o}=t;e.meetingInfoTimestamp=o})),[`${Xr}`]:AE(((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}`]:AE(((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}`]:AE(((e,t)=>{let{payload:o}=t;e.isHost=o})),[`${ni}`]:AE(((e,t)=>{let{payload:o}=t;e.isCoHost=o})),[`${ri}`]:AE(((e,t)=>{let{payload:o}=t;e.isOnHold=o})),[`${ii}`]:AE(((e,t)=>{let{payload:o}=t;e.isMeetingReset=o})),[`${si}`]:AE(((e,t)=>{let{payload:o}=t;e.audioVideoBeforeOnHold=o})),[`${ai}`]:AE(((e,t)=>{let{payload:o}=t;e.currentUserAudioBeforeReset=o})),[`${di}`]:AE(((e,t)=>{let{payload:o}=t;e.isCurrentUserMutedBeforeReset=o})),[`${ui}`]:AE(((e,t)=>{let{payload:o}=t;e.meetingStatus=o})),[`${li}`]:AE(((e,t)=>{let{payload:o}=t;e.region=o.region,e.network=o.network})),[`${ci}`]:AE(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartVideoBeforeReset=o})),[`${pi}`]:AE(((e,t)=>{let{payload:o}=t;e.joinMeetingTimeStamp=o})),[`${hi}`]:AE(((e,t)=>{let{payload:o}=t;e.activeAppInfo=o})),[`${mi}`]:AE(((e,t)=>{let{payload:o}=t;e.idleStartTime=o})),[`${vi}`]:AE(((e,t)=>{let{payload:o}=t;e.sessionIdleTimeoutMins=o})),[`${gi}`]:AE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeEnabled=o})),[`${fi}`]:AE(((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}`]:AE(((e,t)=>{let{payload:o}=t;e.sharePronounType=o})),[`${Si}`]:AE(((e,t)=>{let{payload:o}=t;e.stayAwake=o})),[`${bi}`]:AE(((e,t)=>{let{payload:o}=t;e.failover.joinMeetingSuccessTimestamp=o})),[`${Ei}`]:AE((e=>{Object.assign(e.failover,{...rI.failover,count:e.failover.count,joinMeetingSuccessTimestamp:e.failover.joinMeetingSuccessTimestamp})})),[`${Ii}`]:AE(((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}`]:AE(((e,t)=>{let{payload:o}=t;e.quicklyLeave=o})),[`${_i}`]:AE(((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}),{...rI,...r}}},rI),sI={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)})`),VE.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)})))},aI={sessionIdleEpic0:(e,t)=>e.pipe($t(`${Xr}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.zlkJwtToken})),_t((()=>(LE&&LE.complete(),LE=new Q,NE=lt(6e4).pipe(ze((()=>performance.now()))).subscribe(LE),LE.pipe(ze((e=>$r(e)))))))),sessionIdleEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{LE&&(LE.complete(),NE.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)===lp.InRoom||(null==l?void 0:l.cmrStatus)===Ca.Start)h.push(mi(void 0));else if(r){const e=s&&np(d[0].userRole)?i:40;p-r>60*e*1e3&&(console.warn(`No active for ${e} minutes, will end the session.`),ME.report(`Session idle timeout(${e} minutes), end the session automatically!`,["Join Meeting Flow","Session idle"],"warn"),h.push(Hr()),ut(500).subscribe((()=>{Mc()})))}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)===lp.InRoom)&&s.push(mi(void 0)),Ue(s)}))),sessionIdleEpic4:e=>e.pipe($t(`${Br}`,`${Hr}`),yt(mi(void 0)))},dI={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)===lp.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})}TE.sendLaunchParams(p);const h=Vi.get(Ui.WebclientMeetingToken);h&&TE.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&&TE.sendSdkKeyToMonitor(v,h,r);const y=[Xr(t.payload.body),pi(performance.now())];return p&&y.push(ii(!1)),(u&ep.Owner)===ep.Owner&&(Tc(Zs,{reason:"dont support assisnt join through widget",errorCode:-1}),TE.leaveMeeting()),Tc(Qs,{meetingNumber:s}),Ue(y)}if(wr.MeetingLocked===n)Tc(Zs,Mr(n));else if(wr.UserFull===n)Tc(Zs,Object.assign({},Mr(n),{lmUrl:t.payload.body.lmURL}));else if(wr.MeetingIsOver===n)Tc(Zs,Mr(n));else if(wr.MMRIBReject===n)Tc(Zs,Mr(n));else if(wr.MMRConfParticipantExists===n)Tc(Zs,Mr(n));else if([wr.UserHasBeenRemoved,wr.WebinarBlockedEmail].includes(n))Tc(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:Mf(),meetingId:h,participantId:m,wrInfo:Object.assign({},v,{isNew:y}),scheduleInfo:f,enableLongPollingCheckStart:S,rid:ny(b),role:Number(null===(g=Er(E))||void 0===g?void 0:g.role),rsPwd:I}}),Tc(Zs,e)}else Tc(Zs,Mr(n));return Ue(ey(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 Tc(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?Tc(Ys,{reason:Ri.OnHold}):Tc(Ys,{reason:Ri.Failover}),je(xr(ki.NormalCase));Or.KickedByHost===n.reason?Tc(Xs,{reason:"kicked by host"}):[Or.EndByHost,Or.EndByNone,Or.EndByAdmin,Or.EndByHostStartAnotherMeeting].includes(n.reason)?Tc(Xs,{reason:"ended by host"}):Or.FreeMeetingTimeout===n.reason?Tc(Xs,{reason:"free meeting ended"}):[Or.DuplicateSession,Or.MeetingTransfer].includes(n.reason)&&Tc(Xs,{reason:"duplicated session"})}return o.meeting.isMeetingReset?fe:Ue(ey(o,!1))}))),meetingMainEpics4:(e,t)=>e.pipe($t(`${xr}`),Tt(t),Xe((e=>{let[,t]=e;const o=ey(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=>{Tc("MEETING_HOST_CHANGE_INDICATION",e.payload.body.bHost)})),ze((e=>oi(e.payload.body)))),meetingMainEpics6:e=>En(e,7941).pipe(Ot((e=>{Tc("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),Tc(ea,t)})),Tt(t),Xe((e=>{let[t,o]=e;const n=[ri(t.payload.body.bHold)];if(t.payload.body.bHold){const e=Ep(o);if(e){n.push(si({audio:e.audio,video:e.bVideoOn,muted:e.muted}));const t=hb(Hs.getInstance());if("computer"===e.audio&&(t.leaveComputerAudio(),TE.joinOrLeaveVoip(!1)),e.bVideoOn&&t.stopCaptureVideo(),e.sharerOn&&(TE.stopSharing(e.userId),t.stopDesktopSharing(),n.push(Mh(qa.End))),o.video&&o.video.subscribedVideoList.length>0&&o.video.subscribedVideoList.forEach((e=>{TE.unsubscribeVideo(e)})),o.share&&o.share.isReceiveSharing){const e=o.share.activeNodeId;o.share.remoteControlledUserList.length>0&&(o.share.remoteControlledUserList.forEach((e=>{TE.sharingRequestRemoteControl(e,!1)})),by(o)&&t.stopRemoteControl()),TE.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=>{Tc("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=kp(o);return t.type===`${Br}`?(TE.leaveMeeting(n),Tc(Xs,{})):t.type===`${Hr}`&&(TE.endMeeting(),Tc(Xs,{})),Ue(ey(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://${Of}/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}Tc(Zs,o)})),Et(fe)),meetingMainEpics15:e=>yn(e,4265).pipe(ze((e=>{const{payload:{body:t}}=e,{nShareType:o}=t;return Tc(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((()=>{TE.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})})))},uI=fn(dI,{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;UE&&UE.release().then((()=>{UE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),UE=await navigator.wakeLock.request("screen"),UE.addEventListener("release",(()=>{})))}catch(e){}})),_t((()=>st(document,"visibilitychange").pipe(Xe((async()=>{if("visible"===document.visibilityState){const{isSafari:e,isIOSMobile:t}=zi;UE&&UE.release().then((()=>{UE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),UE=await navigator.wakeLock.request("screen"))}else UE&&UE.release().then((()=>{UE=null}))})),Et(fe))))),wakeLockEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{UE&&UE.release().then((()=>{UE=null}))})),Et(fe))},sI,aI,{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://${Of}/api/v1/wc/info`,videoSDKUrl:`https://${Of}/wc/lsdk`};return function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zoomsdkjsonpcallback";return new $((n=>{oI++;const r=`${o}${oI}`,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}`))),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=>{nI.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?Tc(Zs,{errorCode:Dr.WrongPasscode,reason:"Incorrect passcode."}):3e3===e.errorCode&&"The role type error"===e.errorMessage?Tc(Zs,{errorCode:Dr.RoleTypeMissing,reason:"Role type error"}):-3e3===e.errorCode?Tc(Zs,{errorCode:Dr.CommonError,reason:"connection error"}):3e3===e.errorCode?Tc(Zs,{reason:e.errorMessage,errorCode:Dr.CommonError}):300===e.errorCode?Tc(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?Tc(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?Tc(Zs,{reason:"The token has expired, is over 2 days old, or is ineffective.",errorCode:Dr.CommonError}):124===e.errorCode&&Tc(Zs,{reason:"Verify JWT failed",errorCode:Dr.CommonError}))})),n.pipe(iy((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(tI,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=oy[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:tI});var lI={exports:{}};lI.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:hI,queryKey:"opt"},{key:mI,queryKey:"participantID"},{key:vI,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(gI)&&Object.assign(C,{isdj:1}),Ki()&&(Object.assign(C,{from:zi.isAndroidBrowser?"android":"ios"}),v&&Object.assign(C,{useABAudio:1})),Object.assign(C,{clientCaps:SI({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 SI(e){const{isAudioBridgeEnabled:t,isBO:o,isFullHDVideoEnabled:n,isFullHDVideoShareEnabled:r}=e;let i=Np.WebCameraIndication|Np.SendMeetingTokenSeparately|Np.SmartSummary|Np.LocalRecording|Np.LocalRecordingGrantPermission|Np.UnifyErrorType;const s=Hs.getPTZCapability();return(s.pan||s.tilt||s.zoom)&&(i|=Np.SupportFarEndCameraControl),Hs.isSupportVideoShare()&&(i|=Np.SupportVideoShare),t&&Hs.isSupportAudioBridgeAVSync()&&(i|=Np.WebrtcAudioRtcpTime),Hs.isSupportShareMultiStream()&&(i|=Np.ShareMultiStream),Hs.isSupportVideoLTR()&&(i|=Np.VideoLTR),o||(i|=Np.RequestRemoteControl),n&&Hs.isSupportFullHDVideo()&&(i|=Np.SupportSend1080PVideo),r&&Hs.isSupportFullHDVideoShare()&&(i|=Np.SupportSend1080PVideoShare),i}function bI(e,t){return t?F(bt(t),mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==Mp.Closed&&o===Di.Joined&&!n}))):F(mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==Mp.Closed&&o===Di.Joined&&!n})))}const EI=Ns.createAgent();let II;const AI=kE.getInstance();let CI;const _I=Vs.getInstance();let RI;const wI={zoomSocketStatus:Mp.Closed,xmppSocketStatus:Mp.Closed,mainSessionSocketStatus:Mp.Closed,retryCount:0,rwgServerList:[]},OI=ko({[`${$o}`]:AE(((e,t)=>{let{payload:o}=t;e.zoomSocketStatus=o.status})),[`${Wo}`]:AE(((e,t)=>{let{payload:o}=t;const{rwgServerList:n}=e;n.find((e=>e.rwg===o.rwg))||n.push(o)})),[`${Go}`]:AE(((e,t)=>{let{payload:o}=t;e.retryCount=o})),[`${zo}`]:AE(((e,t)=>{let{payload:o}=t;e.xmppSocketStatus=o})),[`${Ko}`]:AE(((e,t)=>{let{payload:o}=t;e.mainSessionSocketStatus=o})),[`${qo}`]:()=>wI},wI),TI={epics0:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Mp.Closed&&!!t.meeting.meetingId})),_t((e=>{let[,o]=e;const{media:{patchedMediaSDKStatus:n}}=o;return(n===Td.Loading?kc(Hl,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===lp.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=yI(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=yI(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:pI,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,EI.connect(u),II=new Q,dt((e=>EI.on(Ms.Message,e)),(e=>EI.off(Ms.Message,e)),(e=>e.data)).subscribe(II),II);return ct(e.pipe(mt((e=>"string"==typeof e)),ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),uy(),ry((e=>{if(0!==e.evt||!e.body||"invalid parameters!"!==e.body.test)return Uo(e);Tc(Zs,{errorCode:Dr.InvalidParameter,reason:"Invalid parameter"})})),Ct($o({status:Mp.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===Mp.Closed&&!!t.meeting.meetingId})),_t((()=>{const[e,o,n,r]=[Ms.Open,Ms.Close,Ms.Error,Ms.Inactive].map((e=>dt((t=>EI.on(e,t)),(t=>EI.on(e,t)))));return ct(e.pipe(Xe((()=>ct(je($o({status:Mp.Connected})),ut(6e4).pipe(Tt(t),mt((e=>{let[,t]=e;return t.meeting.meetingStatus===Di.Initial&&!t.meeting.isMeetingReset})),ze((()=>(Tc(Ys,{reason:Ri.Failover}),xr(ki.NoHeartbeat))))))))),o.pipe(bI(t),ze((()=>(Tc(Ys,{reason:Ri.Failover}),xr(ki.Disconnect))))),r.pipe(bI(t),ze((()=>(Tc(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})):(Tc(Zs,{reason:"connection error",errorCode:Dr.CommonError}),n.push(...ey(t.value))),Ue(n)})),Ct(fi(null==e?void 0:e.rwc)))}return r||n!==Di.Joined||(Tc(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:Mp.Closed}))):je($o({status:Mp.Closed})))),bt(100),Ot((()=>{var e;t.value.socket.zoomSocketStatus===Mp.Closed&&(EI.close(),null===(e=II)||void 0===e||e.complete())})))},DI=fn(TI,{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=>(AI.connect(e),CI=new Q,dt((e=>AI.on(PE.Message,e)),(e=>AI.off(PE.Message,e))).subscribe(CI),CI))(i).pipe(mt((e=>void 0!==(null==e?void 0:e.evt))),ze((e=>xo(e))),Ct(zo(Mp.Connecting)))}))),xmppEpics2:(e,t)=>e.pipe($t(`${Lo}`),_t((()=>{const[e,o,n]=[PE.Open,PE.Close,PE.Error].map((e=>dt((t=>AI.on(e,t)),(t=>AI.on(e,t)))));return ct(e.pipe(Ot((()=>{const e=function(){const{isSupportEssentialAudioAndVideoAbility:e,isSupportAudioWorklet:t}=zi;return e&&t?11:10}();AI.join(e)})),yt(zo(Mp.Connected))),o.pipe(bI(t,500),ze((()=>(Tc(Ys,{reason:Ri.Failover}),xr(ki.DisconnectXmpp))))),n.pipe(bI(t,500),ze((()=>(Tc(Ys,{reason:Ri.Failover}),xr(ki.OnError))))))}))),xmppEpics3:e=>e.pipe($t(`${Vo}`),yt(zo(Mp.Closed)),bt(100),Ot((()=>{var e;AI.close(),null===(e=CI)||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=>(_I.connect(e),RI=new Q,dt((e=>_I.on(Ms.Message,e)),(e=>_I.off(Ms.Message,e))).pipe(ze((e=>e.data))).subscribe(RI),RI))(i).pipe(ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),mt((e=>0!==e.evt)),uy(),ze((e=>Ho(e))),Ct(Ko(Mp.Connecting)))}))),mainSessionEpics1:(e,t)=>e.pipe($t(`${Bo}`),_t((()=>{const[e,o,n]=[Ms.Open,Ms.Close,Ms.Error].map((e=>dt((t=>_I.on(e,t)),(t=>_I.on(e,t)))));return ct(e.pipe(yt(Ko(Mp.Connected))),o.pipe(bI(t,500),ze((()=>(Tc(Ys,{reason:Ri.Failover}),xr(ki.DisconnectMChannel))))),n.pipe(bI(t,500),ze((()=>(Tc(Ys,{reason:Ri.Failover}),xr(ki.OnErrorMChannel))))))}))),mainSessionEpics2:e=>e.pipe($t(`${Fo}`),yt(Ko(Mp.Closed)),Ot((()=>{var e;_I.close(),null===(e=RI)||void 0===e||e.complete()})))}),PI={id:"userId",type:e=>rp(e)?{userType:e,avatarBackgroundType:Math.floor(8*Math.random())+1}:{userType:e},role:e=>({userRole:e,isHost:np(e)}),dn2:e=>({displayName:ur(e)}),bShareOn:"sharerOn",bSharePause:"sharerPause",bLocalRecordStatus:e=>({bLocalRecord:e}),bGuest:"isGuest",bCapsRequestLT:"isRequestLT",customerKey:"userIdentity"},kI=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=PI[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},MI={name:"displayName",node:e=>({userId:Number(e)}),role:e=>({userRole:Number(e)})},LI=e=>Object.keys(e).reduce(((t,o)=>{const n=MI[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}),{}),NI={attendeesList:[],assistantList:[],xmppAttendeeList:[],allowTalkAttendeesList:[],failoverAttendeesList:[],isAdmitAllSilentUsers:!1},VI=ko({[`${Lc}`]:AE(((e,t)=>{let{payload:o}=t;void 0!==o.add&&o.add.length>0&&o.add.forEach((t=>{if(t.userType===op.Assitant){const o=e.assistantList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.assistantList.push(t)}else if(ip(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)}}}))})),[`${Wc}`]:AE(((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)}))})),[`${Vc}`]:AE(((e,t)=>{let{payload:o}=t;e.isAdmitAllSilentUsers=o})),[`${Bc}`]:AE((e=>{e.attendeesList.forEach((e=>{e.bRaiseHand&&(e.bRaiseHand=!1)}))})),[`${Fc}`]:AE((e=>{e.attendeesList.forEach((e=>{e.feedback>0&&(e.feedback=0)}))})),[`${jc}`]:AE(((e,t)=>{let{payload:o}=t;e.failoverAttendeesList.push(o)})),[`${xc}`]:AE(((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)}))})),[`${Hc}`]:AE(((e,t)=>{let{payload:o}=t;const{jid:n,name:r}=o,i=e.xmppAttendeeList.find((e=>e.jid===n));i&&(i.displayName=r)})),[`${$c}`]:AE(((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)})),[`${Gc}`]:AE(((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)})),[`${Uc}`]:()=>NI},NI),UI={epics0:(e,t)=>yn(e,ds).pipe(ze((e=>kI(e.payload.body))),Tt(t),Xe((e=>{let[t,o]=e,n=[Lc(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)),Tc($s,e)}));const s=t.add.filter((e=>e.userId!==r));if(s.length>0){const e=s.filter((e=>!ip(e.userRole))).map((e=>{const t={...e};if(rp(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(xc(t)),Tc(Gs,e),i){const e=s.filter((e=>ip(e.userRole)));e.length>0&&Tc(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=>{Tc(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&&Tc(zs,o),i){const e=t.update.filter((e=>e.userId!==r&&l.includes(e.userId)));e.length>0&&Tc(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(jc({zoomID:t.zoomID,isOnHold:!0})),{...e,...t,reason:"on hold"}):(n.push(jc({zoomID:t.zoomID,isOnHold:!1})),{...e,...t,reason:"failover"}):{...e,...t}:null})).filter((e=>!!e));if(Tc(Ks,e),i){const e=t.remove.filter((e=>l.includes(e.userId)));e.length>0&&Tc(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),Tc(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===DE.rename){n.forEach((e=>{s.push(Hc(e))}));const e=n.map((e=>LI(e)));Tc(qs,e)}if(o===DE.Remove){n.forEach((e=>{s.push($c(e))}));const e=n.map((e=>({...LI(e),removed:!0})));Tc(Js,e)}if([DE.Add,DE.List,DE.update].includes(o)){const e=n.map((e=>{const t=LI(e);return Object.keys(t).reduce(((e,o)=>(""!==t[o]&&Object.assign(e,{[o]:t[o]}),e)),{})}));if(Tc(qs,e),s.push(Wc(e)),o===DE.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&&Tc("MEETING_WEBINAR_ATTENDEE_RAISE_HAND",{bRaiseHand:e.bRaiseHand})}}}return Ue(s)}))),epics2:e=>yn(e,7951).pipe(Ot((e=>{!1===e.payload.body.bStarted&&Tc("ADMIT_ALL_SILENT_USERS_END",e.payload.body.bStarted)})),ze((e=>Vc(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=>(Tc(zs,{}),"bRaiseHand"===e.payload.body.key?Bc():Fc()))))},jI=fn(UI),xI={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:""},BI=ko({[`${Yo}`]:AE(((e,t)=>{let{payload:o}=t;e.audioDecodeStatus=o})),[`${Zo}`]:AE(((e,t)=>{let{payload:o}=t;e.audioEncodeStatus=o})),[`${on}`]:AE(((e,t)=>{let{payload:o}=t;e.sharingDecodeStatus=o})),[`${tn}`]:AE(((e,t)=>{let{payload:o}=t;e.sharingEncodeStatus=o})),[`${en}`]:AE(((e,t)=>{let{payload:o}=t;e.videoDecodeStatus=o})),[`${Xo}`]:AE(((e,t)=>{let{payload:o}=t;e.videoEncodeStatus=o})),[`${nn}`]:AE(((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}`]:AE(((e,t)=>{let{payload:o}=t;const{type:n,encrypeKey:r,additionalType:i}=o,s={encrypeKey:r,additionalType:i};"audio"===n?e.audioEncrypt=s:"video"===n?e.videoEncrypt=s:"sharing"===n&&(e.sharingEncrypt=s)})),[`${sn}`]:AE(((e,t)=>{let{payload:o}=t;e.isEnableDecoderInWorklet=o})),[`${an}`]:AE(((e,t)=>{let{payload:o}=t;e.patchedMediaSDKStatus=o})),[`${dn}`]:AE(((e,t)=>{let{payload:o}=t;e.assetsPath=o})),[`${un}`]:AE(((e,t)=>{let{payload:o}=t;e.enableAudioQos=o.audioQos,e.enableVideoQos=o.videoQos})),[`${ln}`]:AE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeReceiveReady=o})),[`${cn}`]:AE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSendReady=o})),[`${pn}`]:AE(((e,t)=>{let{payload:o}=t;e.isMediaAgentInitialized=o})),[`${hn}`]:AE(((e,t)=>{let{payload:o}=t;e.adaptedABOptionForMediaSDK=o})),[`${mn}`]:e=>({...xI,mediaConstraints:e.mediaConstraints,assetsPath:e.assetsPath,fileWithVersion:e.fileWithVersion,enforceMultipleVideos:e.enforceMultipleVideos,disableRenderLimits:e.disableRenderLimits,enforceVirtualBackground:e.enforceVirtualBackground,alternativeNameForVideoPlayer:e.alternativeNameForVideoPlayer})},xI),FI=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 HI,$I;!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"}(HI||(HI={})),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"}($I||($I={}));const WI="default-sesssion-key";var GI,zI,KI,qI;function JI(e,t,o,n,r){const i=document.createElement("canvas");i.id=n;const s=sA(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*aA(i),i.style.height=t+"px",i.height=t*aA(i),i.ariaHidden="true",i.style.zIndex=o,i}function QI(e,t){const o=oA((()=>{if(e){sA(e,t.clientWidth,t.clientHeight),[HI.UPDATE_CANVAS_SIZE,HI.UPDATE_SHARING_DECODE_PARAM].forEach((o=>{var n,r;null===(r=eA(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*aA(e),height:t.clientHeight*aA(e),canvas:e})})),e.style.width=t.clientWidth+"px",e.style.height=t.clientHeight+"px";try{e.width=t.clientWidth*aA(e),e.height=t.clientHeight*aA(e)}catch(e){}FI.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){iA.delete(e)}(e),null==r||r.disconnect(),n.removeEventListener("change",o)}}function ZI(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 YI(e,t){Object.entries(t).forEach((([t,o])=>{e.getAttribute(t)||e.setAttribute(t,o)}))}function XI(e,t){const o=e.getAttribute(t);return!(!o||"true"!==o)}function eA(e=WI){var t;return null===(t=FI.get("mediaSDKInstanceMap").get(e))||void 0===t?void 0:t()}function tA(){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 oA(e,t){let o;return function(...n){clearTimeout(o),o=setTimeout((()=>{e(...n)}),t)}}function nA(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(!nA(o,r))return!1}else if(o!==r)return!1}return!0}function rA(e){return!e||"0"===e}!function(e){e.Video="video",e.Share="share"}(GI||(GI={})),function(e){e.DEFAULT="",e.MAIN="main"}(zI||(zI={})),function(e){e.Video_90P="0",e.Video_180P="1",e.Video_360P="2",e.Video_720P="3",e.Video_1080P="4"}(KI||(KI={})),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"}(qI||(qI={}));const iA=new Map;function sA(e,t,o){const n=t>=2*window.screen.width||o>=2*window.screen.height?1:window.devicePixelRatio,r=iA.get(e);return iA.set(e,n),r&&r!==n&&FI.dispatch("scale",void 0,e.id),n}function aA(e){return iA.get(e)||window.devicePixelRatio}function dA(e,t){t&&(null==e||e.Notify_MeidaSDK(HI.SEND_RENDER_LOG,{message:t}))}function uA(e,t){const o=FI.get("renderCountMap"),n=o.get(e)||0;o.set(e,t?n+1:n-1)}function lA(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 cA=[];for(let e=0;e<=1;e+=.01)cA.push(e);class pA{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=`${FI.get("tagName")}-${tA()}`,this.getSDK=()=>{var e,t;return eA(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 ${FI.get("tagName")} must have a ${FI.get("tagName")}-container as its ancestor element.`);this.container=e,this.el.style.width="100%",this.el.style.height="100%",this.debounceUpdateVideoPosition=oA(this.updateVideoPosition.bind(this),300)}getElement(){return this.el}init(){this.removeSubscribe=FI.subscribe(((e,t,o)=>{o===this.getCanvas().id&&("resize"===e?(this.updateVideoPosition(),setTimeout((()=>{this.updateVideoPosition()}),300)):"scale"===e&&dA(this.getSDK(),`VPSC:${aA(this.getCanvas())}`))}))}getCanvas(){return this.container.getCanvas()}initObservePosition(){this.stopObservePosition(),this.removePositionObserve=function(e,t,o){const{wrapper:n=document.documentElement}=o,r=oA(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}=lA(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?cA: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(lA(e,this.container))}transformRectToPosition(e){const{left:t,width:o,height:n,bottom:r,top:i}=e,s=aA(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||lA(this.el,this.container));this.position&&nA(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(HI.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 hA{constructor(e){this.container=e,this.id="",this.srcObject=null,this.getSDK=()=>{var e,t;return eA(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 mA extends pA{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()&&(uA(this.container,!0),function(e){var t,o;const n=FI.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=FI.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(HI.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(HI.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()&&uA(this.container,!1),null===(h=this.getSDK())||void 0===h||h.Notify_MeidaSDK(HI.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 vA extends hA{addRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(HI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(HI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}class gA extends pA{addRender({width:e,height:t,userId:o,canvas:n,isFromMainSession:r}){var i;null===(i=this.getSDK())||void 0===i||i.Notify_MeidaSDK(HI.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(HI.STOP_SHARING,{canvas:e})}}class fA extends hA{addRender({userId:e,videodom:t}){var o,n;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(HI.SWITCH_CANVAS_FOR_VIDEO_CAPTURE,[t]),null===(n=this.getSDK())||void 0===n||n.Notify_MeidaSDK(HI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(HI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}class yA{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,yA.VERTEX_SHADER,yA.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 SA{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,SA.VERTEX_SHADER,SA.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 bA{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:bA.VERTEX_SHADER}),entryPoint:"vert_main"},fragment:{module:r.createShaderModule({code:bA.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 EA{constructor(){}preview(e,t,o,n){let r=null;1==e?o.srcObject=t:2==e?(r=new yA,r.preview(t,o,n)):3==e?(r=new SA,r.preview(t,o,n)):4==e&&(r=new bA,r.preview(t,o,n))}static getInstance(){return EA.instance||(EA.instance=new EA),EA.instance}}class IA extends pA{constructor(){super(...arguments),this.rendersProxy=EA.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===qI.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 AA extends hA{constructor(){super(...arguments),this.rendersProxy=EA.getInstance()}addRender(e){e.srcObject&&e.videodom&&this.rendersProxy.preview(qI.VideoTag,e.srcObject,e.videodom)}stopRender(e){e.videodom.srcObject=null}}const CA="node-id",_A="media-type",RA="video-quality",wA="share-source",OA="fill-mode",TA="stop-no-clean",DA="refresh-key";class PA extends HTMLElement{static get observedAttributes(){return[CA,_A,RA,DA]}constructor(){super(),this.container=null,this._srcObject=null,ZI(this,PA.customAttributes),this.getRenderParams=this.getParsedParams.bind(this),this.callback=(e,t)=>{e===$I.MOBILE_CAPTURE_DEVICE_CHANGE&&t===this.getAttribute(CA)&&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===qI.VideoTag)this.render=new AA(this.getContainer());else{if(![qI.WebGL,qI.WebGL2,qI.WebGPU].includes(e))return void console.error("Inside render type error.");this.render=new IA(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(CA),s=i&&(null===(o=this.getCurrentMediaSDK())||void 0===o?void 0:o.isPreviewVideotag(i));let a=0;this.getAttribute(_A)===GI.Share?(this.render=new gA(this.getContainer(),this.getRenderParams),a=2):(null===(n=this.getCurrentMediaSDK())||void 0===n?void 0:n.getWebRTCFlag())?(this.render=new vA(this.getContainer()),a=4):s?(this.render=new fA(this.getContainer()),a=1):(this.render=new mA(this.getContainer(),this.getRenderParams),a=3),this.getCurrentMediaSDK()&&dA(this.getCurrentMediaSDK(),`VPREN:${a}`),this.innerHTML="",this.appendChild(this.render.getElement()),this.render.init();const d=this.getAttribute(CA);rA(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(`${FI.get("tagName")}-container`)),this.container}getCurrentMediaSDK(){var e,t;return eA(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:XI(this,OA),doNotClean:XI(this,TA),isFromMainSession:"main"===this.getAttribute(wA),videoQuality:this.getAttribute(RA),renderType:null!==(t=null===(e=this.getContainer())||void 0===e?void 0:e.getInsideRenderType())&&void 0!==t?t:qI.Unknown}}connectedCallback(){var e;this.style.display="block",YI(this,PA.defaultValues),this.initRender(),null===(e=this.getCurrentMediaSDK())||void 0===e||e.addCallback(this.callback),this.removeSubscribe=FI.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))||WI)&&(this.initRender(),rA(this.getAttribute(CA))||null===(i=this.render)||void 0===i||i.playVideo(this.getAttribute(CA)),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 CA:(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 fA&&this.initRender(),rA(t)&&!rA(o)?this.render.playVideo(o):rA(t)||rA(o)?rA(t)||this.render.stopVideo():(this.render.stopVideo(),this.render.playVideo(o));break;case _A:this.initRender();break;case RA:null===(i=this.render)||void 0===i||i.updateVideoQuality(o);break;case DA:rA(o)||null===(a=null===(s=this.render)||void 0===s?void 0:s.refresh)||void 0===a||a.call(s)}}}PA.customAttributes=[CA,_A,RA,wA,OA,TA,DA],PA.defaultValues={[CA]:"",[_A]:GI.Video};const kA="session-id",MA="z-index",LA="inside-render",NA="label";class VA extends HTMLElement{static get observedAttributes(){return[kA,MA,LA]}constructor(){super(),this.canvasId="video-player-canvas-"+(this.getAttribute(NA)?`${this.getAttribute(NA)}-`:"")+tA(),this.needInitCanvas=!1,this.callback=null,ZI(this,VA.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"),YI(this,VA.defaultValues),this.needInitCanvas&&this.initCanvasEvents(),this.removeSubscribe=FI.subscribe(((e,t,o)=>{"failover"===e&&o===(this.getSessionId()||WI)&&(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=eA(this.getSessionId()))||void 0===o||o.Notify_MeidaSDK(HI.REMOVE_EXPIRED_CANVAS,{canvasId:this.canvasId}),this.canvas.remove(),this.canvas=void 0),this.callback&&(null===(n=eA(this.getSessionId()))||void 0===n||n.removeCallback(this.callback))}attributeChangedCallback(e,t,o){e===MA&&this.canvas&&o&&(this.canvas.style.zIndex=o)}adoptedCallback(){}createCanvas(){this.getCurrentMediaSDK()&&dA(this.getCurrentMediaSDK(),"VPCC"),this.canvas=JI(this.clientWidth,this.clientHeight,this.getAttribute(MA)||"",this.canvasId,(e=>dA(this.getCurrentMediaSDK(),e))),this.appendCanvas(this.canvas),this.isConnected?this.initCanvasEvents():this.needInitCanvas=!0}initCanvasEvents(){var e;this.removeListener=QI(this.canvas,this),this.callback=(e,t)=>{var o,n;e===$I.WEBGL_LOST_IN_MULTI_VIEW&&t.replaceCanvas&&t.canvasId===(null===(o=this.canvas)||void 0===o?void 0:o.id)&&(this.replaceCanvas(),null===(n=eA(this.getSessionId()))||void 0===n||n.Notify_MeidaSDK(HI.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()&&dA(this.getCurrentMediaSDK(),"VPRC"),this.canvas){null===(e=this.removeListener)||void 0===e||e.call(this);const t=JI(this.clientWidth,this.clientHeight,this.getAttribute(MA)||"",this.canvasId,(e=>dA(this.getCurrentMediaSDK(),e)));this.removeListener=QI(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(LA)&&void 0!==this.getAttribute(LA)&&"false"!==this.getAttribute(LA)&&"0"!==this.getAttribute(LA)}getInsideRenderType(){return Number(this.getAttribute("inside-render-type"))}getSessionId(){return this.getAttribute(kA)||void 0}getCurrentMediaSDK(){return eA(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 UA(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 jA(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?ih(o):oh({userId:t,muted:o})}async function xA(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=Ep(t),w=!!u||sp(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(Uf());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=Xf.getInstance();await e.setAudioElement(m),T=e.audioElement}else Xf.getInstance().stopAudioElement();return w&&!f&&zi.isIOSMobile&&await async function(){await navigator.mediaDevices.getUserMedia({audio:!0})}(),null===(n=e.joinComputerAudio(i,T,D,O,UA(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 BA(e,t,o){const n=[],{audio:{isJoinComputerAudioBeforeSharingAudio:r,mutedBeforeSharingAudio:i}}=o,s=Ep(o);return!0===r&&(await xA(e,o),n.push(nh(void 0)),!1===i&&(n.push(Eh(Ba.SharingAudio)),t.mute(s.userId,!1)),n.push(eh(void 0))),n}async function FA(e,t,o){const{audio:{isSharingAudio:n},meeting:{userId:r}}=o,i=[];if(i.push(jA(e,r,!0,o)),n){await e.leaveSharingAudio(!1),i.push(sh(!1));const n=await BA(e,t,o);i.push(...n),setTimeout((()=>{Tc(Nu,{state:"off"})}),0)}return i.push(rh(!1)),i}async function HA(e,t,o){const{audio:{audioSsrc:n,activeMicrophone:r,activeSpeaker:i},meeting:{svcUrl:s,conId:a,reportDomain:d,supportLocalAB:u,abToken:l}}=o,c=Ep(o),p=[];if(!GA()){const t=await async function(e,t){const o=[],n=Ep(t),{audio:{isMicrophoneForbidden:r}}=t;return(null==n?void 0:n.audio)===Ad.Computer&&(o.push(nh(!0)),o.push(eh(n.muted)),n.muted||e.muteAudio(),await e.leaveComputerAudio(),o.push(Gp(0)),r&&o.push(Wp(!1))),o}(e,o);p.push(...t)}return await e.leaveSharingAudio(!0),await e.joinSharingAudio({ssrc:n,microphoneDeviceId:r,speakerDeviceId:i,isCaptureAudio:sp(c.userRole),audioBridge:Ki()?{rwgHost:s,cid:a,nginxHost:d,abToken:l,supportLocalAB:u,useWebRTCOnDesktop:!zi.isAndroidOrIOSBrowser}:void 0}),p.push(rh(!0)),p.push(sh(!0)),p.push(jA(e,c.userId,!1,o)),p.findIndex((e=>e.type===`${nh}`&&!0===e.payload))>-1&&(p.push(bh(xa.SharingAudio)),t.mute(o.meeting.userId,!0)),setTimeout((()=>{Tc(Nu,{state:"on"})}),0),p}VA.customAttributes=[],VA.defaultValues={};const $A=()=>{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 WA(e,t,o){for(let n=0;ne.userId===r));o&&(o.displayName=i,t.splice(t.indexOf(r),1))}}}function GA(){return Hs.isSupportOpenMicWhenShareAudio()}function zA(e){return Hs.isSupportAudioDenoise(e)}function KA(){return Hs.isSupportStereoAudio()}function qA(){var e;return"function"==typeof(null===(e=window.navigator.hid)||void 0===e?void 0:e.requestDevice)}function JA(e,t,o){const{audio:{isAllowToTalk:n,customizeAudioOption:r},media:{audioDecodeStatus:i,audioEncodeStatus:s}}=e;return{encodeInitStatus:sp(t.userRole)&&!n||o||null!=r&&r.speakerOnly||Ki()?"success":s,decodeInitStatus:Ki()?"success":i}}function QA(e,t,o){Ki()?qf(t,o).subscribe((t=>{let[o,n]=t;o&&n&&e.joinOrLeaveVoip(!0)})):e.joinOrLeaveVoip(!0)}const ZA=Ns.createAgent(),YA=$f(hb(Hs.getInstance())),XA=e=>!e.muted,eC=Ns.createAgent(),tC=$f(hb(Hs.getInstance())),oC=Ns.createAgent(),nC=$f(hb(Hs.getInstance())),rC={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}}},iC=ko({[`${Vp}`]:AE(((e,t)=>{let{payload:o}=t;e.asnIds={...o}})),[`${Up}`]:AE(((e,t)=>{let{payload:o}=t;e.bCanUnmute=o})),[`${jp}`]:AE(((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:Py()})})),[`${xp}`]:AE(((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))})),[`${Bp}`]:AE(((e,t)=>{let{payload:o}=t;e.isAllowToTalk=o,e.isAllowToTalkAttendeeConnected=!1})),[`${bh}`]:AE(((e,t)=>{let{payload:o}=t;e.mutedSource=o})),[`${Eh}`]:AE(((e,t)=>{let{payload:o}=t;e.unmutedSource=o})),[`${Fp}`]:AE(((e,t)=>{let{payload:o}=t;e.audioSsrc=o})),[`${Hp}`]:AE(((e,t)=>{let{payload:o}=t;e.bMutedUponEntry=o})),[`${$p}`]:AE(((e,t)=>{let{payload:o}=t;e.isUserGrantCaptureAudio=o})),[`${Wp}`]:AE(((e,t)=>{let{payload:o}=t;e.isMicrophoneForbidden=o})),[`${Gp}`]:AE(((e,t)=>{let{payload:o}=t;e.webrtcRestartCount=o})),[`${zp}`]:AE(((e,t)=>{let{payload:o}=t;e.microphoneDevicesList=o})),[`${Kp}`]:AE(((e,t)=>{let{payload:o}=t;e.speakerDevicesList=o})),[`${qp}`]:AE(((e,t)=>{let{payload:o}=t;e.activeMicrophone=o})),[`${Jp}`]:AE(((e,t)=>{let{payload:o}=t;e.activeSpeaker=o})),[`${Qp}`]:AE(((e,t)=>{let{payload:o}=t;e.canPlayAudio=o})),[`${Yp}`]:AE(((e,t)=>{let{payload:o}=t;e.isComputerAudioLoading=o})),[`${hh}`]:AE(((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)}})),[`${Xp}`]:AE(((e,t)=>{let{payload:o}=t;e.isAllowToTalkAttendeeConnected=o})),[`${eh}`]:AE(((e,t)=>{let{payload:o}=t;e.mutedBeforeSharingAudio=o})),[`${sh}`]:AE(((e,t)=>{let{payload:o}=t;e.isSharingAudio=o})),[`${ih}`]:AE(((e,t)=>{let{payload:o}=t;e.isShareAudioMuted=o})),[`${th}`]:AE(((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})})),[`${oh}`]:AE(((e,t)=>{let{payload:o}=t;const n=e.localShareAudioUserMutedList.find((e=>e.userId===o.userId));n&&(n.muted=o.muted)})),[`${nh}`]:AE(((e,t)=>{let{payload:o}=t;e.isJoinComputerAudioBeforeSharingAudio=o})),[`${rh}`]:AE(((e,t)=>{let{payload:o}=t;e.isShareAudioEnabled=o})),[`${ah}`]:AE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${dh}`]:AE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${uh}`]:AE(((e,t)=>{let{payload:o}=t;-1===e.locallyMutedAudioList.findIndex((e=>e===o))&&e.locallyMutedAudioList.push(o)})),[`${lh}`]:AE(((e,t)=>{let{payload:o}=t;const n=e.locallyMutedAudioList.findIndex((e=>e===o));-1!==n&&e.locallyMutedAudioList.splice(n,1)})),[`${ch}`]:AE(((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)})),[`${ph}`]:AE(((e,t)=>{let{payload:o}=t;const n=e.localUserAudioVolumeList.findIndex((e=>e.userId===o.userId));-1!==n&&e.localUserAudioVolumeList.splice(n,1)})),[`${mh}`]:AE(((e,t)=>{let{payload:o}=t;e.isBackgroundNoiseSuppression=o})),[`${vh}`]:AE(((e,t)=>{let{payload:o}=t;e.isHIDEnabled=o})),[`${gh}`]:AE(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${fh}`]:AE(((e,t)=>{let{payload:o}=t;e.isStopAllImcomingAudio=o})),[`${yh}`]:AE(((e,t)=>{let{payload:o}=t;e.isVerifiedAudioPermissionOnIOSMobile=o})),[`${Sh}`]:AE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSignalReconnecting=o})),[`${Ih}`]:AE(((e,t)=>{let{payload:o}=t;e.originalSound=o})),[`${Ah}`]:AE(((e,t)=>{let{payload:o}=t;e.leaveAudioSource=o})),[`${Ch}`]:AE(((e,t)=>{let{payload:o}=t;e.secondaryAudioMicrophoneId=o})),[`${_h}`]:AE(((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:Py()})})),[`${Rh}`]:AE(((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})})),[`${Zp}`]:(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?{...rC,dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:{...rC.customizeAudioOption,speakerOnly:s.speakerOnly},originalSound:a,highBitrate:d,isHIDEnabled:u,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}:{...rC}}},rC),sC={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=[xp({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})),Tc(Cu,u),i===$a.Success){if(Tc(_u),r&&Rp(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(Gc({userId:r,key:"phoneNumber",value:e})),Tc(zs,[{userId:r,phoneNumber:e}]))}}else[$a.Canceling,$a.Canceled,$a.CancelFailed].includes(i)?i===$a.Canceled?Tc(wu):i===$a.CancelFailed&&Tc(Ou):-1===[$a.Calling,$a.Ringing,$a.Accepted,$a.Success].indexOf(i)&&Tc(Ru);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&&(Tc(Bu,{code:r,ip:d.ip,protocol:d.protocol,uuid:d.uuid}),a.push(Rh({sequence:n,transID:i,result:r}))),r===Ld.Success?Tc(Fu):[Ld.Success,Ld.Ringing].includes(r)||Tc(Hu),Ue(a)})))},aC={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=Rp(o),t=Object.keys(r).map((e=>({key:e,userId:r[e]}))),s=t.map((e=>e.userId));WA(t,s,e),n.length>0&&s.length>0&&WA(t,s,n),i=t.reduce(((e,t)=>({...e,[`${t.key}`]:{userId:t.userId,displayName:t.displayName}})),{}),Tc(gu,Object.values(i))}return Vp(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=Ep(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||Tc(fu,ja.Spotlight))}})),Et(fe)),epics2:(e,t)=>yn(e,12037).pipe(Tt(t),Ot((e=>{let[,t]=e;const o=Ep(t);null!==(null==o?void 0:o.audio)&&""!==(null==o?void 0:o.audio)&&1==(null==o?void 0:o.muted)&&Tc(fu,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(Up(e.payload.body.bCanUnmute)),void 0!==n){const o=Ep(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(bh(xa.PassiveByMuteAll))}return void 0!==r&&i.push(Hp(e.payload.body.bMutedUponEntry)),Ue(i)}))),epics4:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Mp.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=>{Tc(Au,e)})),i.length>0)return Nf(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(sy((async e=>{const t=[];if(e.audio!==c.audio)if(""===e.audio)Tc(bu,{source:u}),t.push(Ah(void 0));else if(e.audio===Ad.Computer){const e=sp(c.userRole)&&!r||!!l;a&&Tc(yu),e&&(Tc(yu),zi.isIOSMobile&&t.push(yh(!0))),d&&(Tc(yu),t.push(Sh(!1)))}else e.audio===Ad.Phone&&(c.audio===Ad.Computer&&(await YA.leaveComputerAudio(),t.push(Ah(Fa.Pstn)),ZA.joinOrLeaveVoip(!1)),Tc(Su));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;Tc(Eu,{source:e})}c.audio!==Ad.Computer||s&&!GA()||YA.muteAudio()}else if(!1===e.muted){if(n!==Ba.Inherited){const e=null!=n?n:Ba.Passive;Tc(Iu,{source:e})}c.audio===Ad.Computer&&YA.unmuteAudio()}void 0!==e.muted&&t.push(bh(void 0),Eh(void 0))}return t})))})))}return fe}))),epics5:(e,t)=>yn(e,12036).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=Ep(o),{media:{audioEncodeStatus:r}}=o,{promoterID:i,bAllowTalk:s}=t.payload.body;if((null==n?void 0:n.userId)===i){if(Tc(Lu,s),s)return"success"!==r&&YA.enableAudioEncode(),Lf("audio",r,"success").pipe(Xe((e=>(e&&Tc(fu,ja.AllowToTalk),fe))),Ct(Bp(!0)));if(ZA.mute(i,!0),(null==n?void 0:n.audio)===Ad.Computer)return YA.leaveComputerAudio(),ut(300).pipe(Ot((async()=>{($A()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{xA(YA,o,!1)}))})),Et(fe),Ct(Bp(!1),bh(xa.Inherited)))}return fe}))),epics6:e=>yn(e,8205).pipe(Ot((e=>{Tc("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=Ep(o);(null==n?void 0:n.audio)===Ad.Phone?ZA.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=Nf(t).pipe(Xe((e=>{if(r===Ad.Computer&&(null==e||!e.audio)){const{encodeInitStatus:o,decodeInitStatus:n}=JA(t.value,e);return Lf("audio",o,n).pipe(mt((e=>{let[t,o]=e;return t&&o})),Ot((()=>{($A()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{QA(ZA,t.value),xA(YA,t.value)}));const{audio:{locallyMutedAudioList:e,localUserAudioVolumeList:o,isStopAllImcomingAudio:n}}=t.value;e.length>0&&e.forEach((e=>{YA.muteOrUnmuteOtherAudio(e,!0)})),o.length>0&&o.forEach((e=>{YA.adjustOtherAudioVolume(e.userId,e.volume)})),n&&YA.stopAllIncomingAudio(!0)})),yt(ai(void 0)))}return fe})));return Tc(Uu,i),ct(je(Fp(i)),s)}))),epics9:(e,t)=>yn(e,7952).pipe(_t((e=>kc(Su,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&&Tc(Tu,{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=Ep(o);var r;(r=n,(null==r?void 0:r.audio)===Ad.Computer?Promise.resolve():Pc({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((()=>{Tc(yu)}));const{meeting:{isCurrentUserMutedBeforeReset:i},audio:{bMutedUponEntry:s,isUserGrantCaptureAudio:a,isAllowToTalk:d,activeMicrophone:u}}=o,{payload:{data:l}}=t,c=[$p(!0)];if(n){!0===n.muted&&!1===d&&(c.push(bh(xa.Inherited)),ZA.mute(n.userId,!0));const e=a||n.isHost||d;(!0===i||!e&&s)&&(c.push(bh(xa.Inherited)),ZA.mute(n.userId,!0),i&&c.push(di(void 0))),l&&u!==l&&c.push(qp(l))}return Ue(c)}))),epics11:e=>In(e,Va.UserForbiddedCaptureAudio).pipe(Ot((()=>{Tc(Du)})),yt(Wp(!0))),epics12:e=>In(e,Va.AudioWebsocketBroken).pipe(Ot((()=>{Tc(Pu)})),Et(fe)),epics13:(e,t)=>In(e,Va.AudioZeroData).pipe(Tt(t),ry((e=>{let[,t]=e;const{audio:{webrtcRestartCount:o,activeMicrophone:n}}=t;if(o<3)return YA.restoreWebRTC(n),Gp(o+1)}))),epics14:(e,t)=>e.pipe($t(`${Qp}`),mt((e=>!1===e.payload)),Xe((()=>(Tc(ku),vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1))).pipe(Ot((()=>{QA(ZA,t.value),xA(YA,t.value)})),yt(Qp(!0))))))),epics15:e=>In(e,[Va.JoinComputerAudioComplete,Va.JoinSharingAudioComplete,Va.LeaveComputerAudioComplete,Va.LeaveSharingAudioComplete]).pipe(Ot((()=>{Hf.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=Ep(n),l=Dp(n);let c=l.length>0,p=l.some(XA);const h=Ki();r&&(c=c||Boolean(a.length),p=p||d.some(XA));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?(Tc(Vu,o.payload),ah(o.payload)):ah(md):v?(Tc(Vu,o.payload),dh(o.payload)):dh(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=>{YA.muteOrUnmuteOtherAudio(e,!1)})),Ue(s.map((e=>[lh(e),ph({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&&!GA()&&a.push(eh(!0)),a.push(bh(xa.Active)),ZA.mute(r,!0);else if(!i||GA()){i&&a.push(eh(!1));const e=Ep(n);(s||null!=e&&e.isHost||null!=e&&e.bCoHost)&&(a.push(Eh(Ba.Active)),ZA.mute(r,!1))}return Ue(a)}))),epics19:e=>yn(e,12040).pipe(Ot((e=>{const{payload:{body:{mode:t}}}=e;YA.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(Jp(o)):n===Va.JoinComputerAudioComplete&&null!==o&&i!==o&&s.push(qp(o)),n===Va.AudioSpeakerSetSuccess?Tc(ju,!0):n===Va.AudioSpeakerSetError&&Tc(ju,!1),Ue(s)}))),epics21:(e,t)=>In(e,Va.AudioLevelIndicator).pipe(mt((()=>{const e=Ep(t.value);return!!e&&e.audio===Ad.Computer&&!e.muted})),Ot((e=>{const{payload:{data:t}}=e;Tc($u,{level:t.value})})),Xe((()=>fe)))},dC=fn(aC,{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(th({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),sy((async()=>{const e=t.value;return await HA(tC,eC,e)})),Ct(rh(!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)})),sy((async e=>{let[,t]=e;return await FA(tC,eC,t)}))),shareAudioEpics3:(e,t)=>yn(e,ds).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Mp.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 Nf(t).pipe(Xe((e=>{const t=[];return o.findIndex((e=>e.audio===Ad.Computer))>-1&&(null==e?void 0:e.audio)!==Ad.Computer&&!GA()&&(t.push(nh(!0)),t.push(eh(!0))),Ue(t)})))}return fe}))),shareAudioEpics4:(e,t)=>e.pipe($t(`${Mh}`),Le(he),Tt(t),mt((e=>{var t;let[,o]=e;return!0===(null===(t=o.audio)||void 0===t?void 0:t.isShareAudioEnabled)})),sy((async e=>{let[t,o]=e;const{payload:n}=t,{audio:{isShareAudioMuted:r,isSharingAudio:i}}=o,s=[];if(n===qa.End){const e=await FA(tC,eC,o);s.push(...e)}else if(n===qa.Paused){if(!1===r&&!0===i){await tC.leaveSharingAudio(!0),s.push(sh(!1));const e=await BA(tC,eC,o);s.push(...e),setTimeout((()=>{Tc(Nu,{state:"off"})}),0)}}else if(n===qa.Sharing&&!1===r&&!1===i){const e=await HA(tC,eC,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;tC.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}),Tc(xu)})),Xe((()=>fe)))},{audioBridgEpics0:e=>yn(e,4299).pipe(Ot((e=>{const{payload:t}=e;nC.passThroughRWGMessage(t)})),Et(fe)),audioBridgEpics1:e=>In(e,Va.AudioBridgeReconnectStart).pipe(Xe((()=>(oC.joinOrLeaveVoip(!1),Ue([Sh(!0),Ah(Fa.Failover)]))))),audioBridgEpics2:(e,t)=>In(e,Va.AudioBridgeReconnectEnd).pipe(Ot((()=>{QA(oC,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;nC.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((()=>(Tc(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;nC.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;nC.changeActiveVideoSsrc(t)})),Et(fe)),audioBridgEpics7:(e,t)=>In(e,[Va.RecoverWebrtcAudio,Va.AudioStreamFailed]).pipe(Xe((()=>{const e=Ep(t.value),o=[];return(null==e?void 0:e.audio)===Ad.Computer&&(nC.leaveComputerAudio(),$A()?(oC.joinOrLeaveVoip(!1),o.push(Ah(Fa.EndedBySystem)),o.push(Gp(0))):xA(nC,t.value)),Ue(o)}))),audioBridgEpics8:e=>In(e,[Va.AudioBridgeFirstRecvData,Va.AudioBridgeCanSendData]).pipe(ze((e=>{const{payload:{type:t}}=e;return t===Va.AudioBridgeFirstRecvData?(Tc($l),ln(!0)):(Tc(Wl),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))},sC);var uC="object"==typeof global&&global&&global.Object===Object&&global,lC="object"==typeof self&&self&&self.Object===Object&&self,cC=uC||lC||Function("return this")(),pC=cC.Symbol,hC=Object.prototype,mC=hC.hasOwnProperty,vC=hC.toString,gC=pC?pC.toStringTag:void 0,fC=Object.prototype.toString,yC="[object Null]",SC="[object Undefined]",bC=pC?pC.toStringTag:void 0;function EC(e){return null==e?void 0===e?SC:yC:bC&&bC in Object(e)?function(e){var t=mC.call(e,gC),o=e[gC];try{e[gC]=void 0;var n=!0}catch(e){}var r=vC.call(e);return n&&(t?e[gC]=o:delete e[gC]),r}(e):function(e){return fC.call(e)}(e)}function IC(e){return null!=e&&"object"==typeof e}var AC=Array.isArray;function CC(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var _C="[object AsyncFunction]",RC="[object Function]",wC="[object GeneratorFunction]",OC="[object Proxy]";function TC(e){if(!CC(e))return!1;var t=EC(e);return t==RC||t==wC||t==_C||t==OC}var DC,PC=cC["__core-js_shared__"],kC=(DC=/[^.]+$/.exec(PC&&PC.keys&&PC.keys.IE_PROTO||""))?"Symbol(src)_1."+DC:"",MC=Function.prototype.toString;function LC(e){if(null!=e){try{return MC.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var NC=/^\[object .+?Constructor\]$/,VC=Function.prototype,UC=Object.prototype,jC=VC.toString,xC=UC.hasOwnProperty,BC=RegExp("^"+jC.call(xC).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function FC(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!CC(e)||(t=e,kC&&kC in t))&&(TC(e)?BC:NC).test(LC(e));var t}(o)?o:void 0}var HC=FC(cC,"WeakMap"),$C=9007199254740991,WC=/^(?:0|[1-9]\d*)$/;function GC(e,t){var o=typeof e;return!!(t=null==t?$C:t)&&("number"==o||"symbol"!=o&&WC.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=KC}function JC(e){return null!=e&&qC(e.length)&&!TC(e)}var QC=Object.prototype;function ZC(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||QC)}function YC(e){return IC(e)&&"[object Arguments]"==EC(e)}var XC=Object.prototype,e_=XC.hasOwnProperty,t_=XC.propertyIsEnumerable,o_=YC(function(){return arguments}())?YC:function(e){return IC(e)&&e_.call(e,"callee")&&!t_.call(e,"callee")},n_="object"==typeof exports&&exports&&!exports.nodeType&&exports,r_=n_&&"object"==typeof module&&module&&!module.nodeType&&module,i_=r_&&r_.exports===n_?cC.Buffer:void 0,s_=(i_?i_.isBuffer:void 0)||function(){return!1},a_={};a_["[object Float32Array]"]=a_["[object Float64Array]"]=a_["[object Int8Array]"]=a_["[object Int16Array]"]=a_["[object Int32Array]"]=a_["[object Uint8Array]"]=a_["[object Uint8ClampedArray]"]=a_["[object Uint16Array]"]=a_["[object Uint32Array]"]=!0,a_["[object Arguments]"]=a_["[object Array]"]=a_["[object ArrayBuffer]"]=a_["[object Boolean]"]=a_["[object DataView]"]=a_["[object Date]"]=a_["[object Error]"]=a_["[object Function]"]=a_["[object Map]"]=a_["[object Number]"]=a_["[object Object]"]=a_["[object RegExp]"]=a_["[object Set]"]=a_["[object String]"]=a_["[object WeakMap]"]=!1;var d_,u_="object"==typeof exports&&exports&&!exports.nodeType&&exports,l_=u_&&"object"==typeof module&&module&&!module.nodeType&&module,c_=l_&&l_.exports===u_&&uC.process,p_=function(){try{return l_&&l_.require&&l_.require("util").types||c_&&c_.binding&&c_.binding("util")}catch(e){}}(),h_=p_&&p_.isTypedArray,m_=h_?(d_=h_,function(e){return d_(e)}):function(e){return IC(e)&&qC(e.length)&&!!a_[EC(e)]},v_=Object.prototype.hasOwnProperty;var g_=function(e,t){return function(o){return e(t(o))}}(Object.keys,Object),f_=Object.prototype.hasOwnProperty;function y_(e){if(!ZC(e))return g_(e);var t=[];for(var o in Object(e))f_.call(e,o)&&"constructor"!=o&&t.push(o);return t}function S_(e){return JC(e)?function(e,t){var o=AC(e),n=!o&&o_(e),r=!o&&!n&&s_(e),i=!o&&!n&&!r&&m_(e),s=o||n||r||i,a=s?function(e,t){for(var o=-1,n=Array(e);++o-1},R_.prototype.set=function(e,t){var o=this.__data__,n=C_(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this};var w_=FC(cC,"Map");function O_(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 T_(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&eR?new Z_:void 0;for(i.set(e,t),i.set(t,e);++c4294966272&e,TR=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 DR(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 PR(e,t){return"default"===e||t.some((t=>t.deviceId===e))||[nd.Environment,nd.User,nd.Left,nd.Right].includes(e)}function kR(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 MR(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&&kR(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}=DR(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=Xf.getInstance();b=e.setVideoElement(p).then((()=>e.videoElement))}else Xf.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(xm({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 LR(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 NR(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 VR(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(JC(e)&&(AC(e)||"string"==typeof e||"function"==typeof e.splice||s_(e)||m_(e)||o_(e)))return!e.length;var t=J_(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ZC(e))return!y_(e).length;for(var o in e)if(wR.call(e,o))return!1;return!0}(t)?null:t}function UR(e){return{pan:(e&yd.Pan)===yd.Pan,tilt:(e&yd.Tilt)===yd.Tilt,zoom:(e&yd.Zoom)===yd.Zoom}}function jR(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&&!Bf()&&(r||i)&&s}function xR(){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 BR(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 FR=Ns.createAgent(),HR=hb(Hs.getInstance());let $R,WR;async function GR(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 zR(e,t,o){if(e===od)return od;{let n=e;if(t){const t=await function(e){return new Promise(((t,o)=>{try{$R&&WR||($R=document.createElement("canvas"),WR=$R.getContext("2d"));const n=$R,r=WR;if(r){r.clearRect(0,0,$R.width,$R.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 GR(ud,n,!!t);return(null!=o?o:document.body).appendChild(r),e}}return null}async function KR(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}=DR(u),p=document.createElement("div");let h;p.style.display="none",h=i?await zR(i,s,p):null;let m,v=Sr(dd);if(o){const t=xf(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 qR(e,t,o,n){const r=Array.isArray(e)?e:e&&[e];if((null==r?void 0:r.length)>0){$R&&WR||($R=document.createElement("canvas"),WR=$R.getContext("2d"));const i=$R,s=WR;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 GR(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 JR(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 KR(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?Lm(!0):Fe(kc(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 zR(n,r);e&&(o.video.backgroundMode===Id.Mask&&(t.stopMaskSetting(!0),await yr((()=>{t.stopVirtualBackgroundSetting()}),0)),t.updateVirtualBackgroundImage(e),e!==od&&setTimeout((()=>{wf(e)}),0))}else t.updateVirtualBackgroundImage(null)}(e,t,o):Promise.reject("Cannot load virtual background model.")))}function ZR(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 KR(e,o,n),{cameraId:u,clip:l,rootWidth:c=1280,rootHeight:p=720}=e,h=l?await qR(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?Qm(!0):Fe(kc(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&&JR(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 zR(n,r);e&&(t.updateMaskBackgroundImage(e),setTimeout((()=>{wf(e)}),0))}if((!JR(i,l)||!d)&&i&&s&&a){const e=await qR(i,s,a);e&&(t.updateMaskClip(e,s,a),setTimeout((()=>{wf(e)}),0))}}else t.updateMaskBackgroundImage(null),t.updateMaskClip(null,s,a)}(e,t,o)}const YR=Ns.createAgent(),XR=hb(Hs.getInstance()),ew=Ns.createAgent(),tw=hb(Hs.getInstance()),ow={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:[]},nw=ko({[`${cm}`]:AE(((e,t)=>{let{payload:o}=t;e.videoSsrc=o})),[`${hm}`]:AE(((e,t)=>{let{payload:o}=t;e.cameraDevicesList=o})),[`${mm}`]:AE(((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})),[`${pm}`]:AE(((e,t)=>{let{payload:o}=t;e.activeVideoId=o.userId})),[`${vm}`]:AE(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartedVideo=o})),[`${gm}`]:AE(((e,t)=>{let{payload:o}=t;e.spotlightUserList=o})),[`${fm}`]:AE(((e,t)=>{let{payload:o}=t;e.isCaptureForbidden=o})),[`${ym}`]:AE(((e,t)=>{let{payload:o}=t;e.receivedVideoMaxQuality=o})),[`${Sm}`]:AE(((e,t)=>{let{payload:o}=t;e.isVideoMuted=o})),[`${bm}`]:AE(((e,t)=>{let{payload:o}=t;e.isCaptureCameraLoading=o})),[`${Em}`]:AE(((e,t)=>{let{payload:o}=t;e.isCameraTaken=o})),[`${Am}`]:AE(((e,t)=>{let{payload:o}=t;e.receivedVideoDimension=o})),[`${Cm}`]:AE(((e,t)=>{let{payload:o}=t;e.subscribedVideoList.includes(o)||e.subscribedVideoList.push(o)})),[`${_m}`]:AE(((e,t)=>{let{payload:o}=t;const n=e.subscribedVideoList.indexOf(o);n>=0&&e.subscribedVideoList.splice(n,1)})),[`${Om}`]:AE(((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})})),[`${Tm}`]:AE(((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)})),[`${Rm}`]:AE(((e,t)=>{let{payload:o}=t;e.isFollowHostVideoLayout=o})),[`${wm}`]:AE(((e,t)=>{let{payload:o}=t;e.hostDragLayout=o})),[`${Dm}`]:AE(((e,t)=>{let{payload:o}=t;e.isSupportHDVideo=o})),[`${Pm}`]:AE(((e,t)=>{let{payload:o}=t;e.maximumNumbeOfHDSubscriptions=o})),[`${km}`]:AE(((e,t)=>{let{payload:o}=t;e.bCanUnmuteVideo=o})),[`${Mm}`]:AE(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBPreloadReady=o})),[`${Lm}`]:AE(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBConfigured=o})),[`${Nm}`]:AE(((e,t)=>{let{payload:o}=t;e.virtualBackground.imageSrc=o.imageUrl,e.virtualBackground.cropped=o.cropped,e.backgroundMode=Id.VirtualBackground})),[`${jm}`]:AE(((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)})),[`${Vm}`]:AE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${Um}`]:AE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${xm}`]:AE(((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)})),[`${Bm}`]:AE(((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})}})),[`${Fm}`]:AE(((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}})})),[`${Hm}`]:AE(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isRequested=o})),[`${$m}`]:AE(((e,t)=>{let{payload:o}=t;const{isInControl:n,userId:r}=o;e.currentCameraControlStatus.isInControl=n,e.currentCameraControlStatus.controllingUserId=r})),[`${Wm}`]:AE(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.controlledUserList.includes(o)||e.farEndCameraControlStatus.controlledUserList.push(o)})),[`${Gm}`]:AE(((e,t)=>{let{payload:o}=t;const n=e.farEndCameraControlStatus.controlledUserList.indexOf(o);-1!==n&&e.farEndCameraControlStatus.controlledUserList.splice(n,1)})),[`${zm}`]:AE(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isCameraMoving="start"===o.cmd})),[`${Km}`]:AE(((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])}))})),[`${qm}`]:AE(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.isControlling=o})),[`${Jm}`]:AE(((e,t)=>{let{payload:o}=t;e.networkQualityBroadcastTime=o})),[`${Qm}`]:AE(((e,t)=>{let{payload:o}=t;e.mask.isMaskConfigured=o})),[`${Ym}`]:AE(((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})),[`${Zm}`]:AE(((e,t)=>{let{payload:o}=t;e.backgroundMode=o})),[`${Xm}`]:AE(((e,t)=>{let{payload:o}=t;e.capturedVideoDimension=o})),[`${ev}`]:AE(((e,t)=>{let{payload:o}=t;e.ensuredCanvas.includes(o)||e.ensuredCanvas.push(o)})),[`${tv}`]:AE(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${ov}`]:AE(((e,t)=>{let{payload:o}=t;if(o){const{lastCopy:t,...n}=o;e.prefetchedVideo=n}else e.prefetchedVideo=o})),[`${nv}`]:AE(((e,t)=>{let{payload:o}=t;Object.assign(e.subscriptionStatus,o)})),[`${rv}`]:AE(((e,t)=>{let{payload:o}=t;e.isFullHDVideoEnabled=o})),[`${iv}`]:AE(((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})}})),[`${sv}`]:AE(((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)}}))})),[`${av}`]:AE(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=kd.WebGL2)})),[`${dv}`]:AE(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=kd.WebGPU)})),[`${uv}`]:AE(((e,t)=>{let{payload:o}=t;e.rendererType=o})),[`${lv}`]:AE(((e,t)=>{let{payload:o}=t;e.isMirrored=o})),[`${cv}`]:AE(((e,t)=>{let{payload:o}=t;e.selfPreviewVideoList.includes(o)||e.selfPreviewVideoList.push(o)})),[`${pv}`]:AE(((e,t)=>{let{payload:o}=t;if(o){const t=e.selfPreviewVideoList.indexOf(o);t>=0&&e.selfPreviewVideoList.splice(t,1)}else e.selfPreviewVideoList=[]})),[`${Im}`]:(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}),{...ow,...n}}},ow),rw={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=Rp(s),{video:{currentCameraControlStatus:{isInControl:d,controllingUserId:u},cameraDevicesList:l,activeCamera:c}}=s,p=a.find((e=>fr(e.userId,n))),h=[];if(h.push(Hm(!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})}Tc(ru,e)}else if(o===gd.Approve)h.push(Wm(null==p?void 0:p.userId)),Tc(iu,{isApproved:!0,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName});else if(o===gd.Decline)h.push(Gm(null==p?void 0:p.userId)),Tc(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($m({isInControl:!1,userId:0})),Tc(su,{isControlled:!1});else if(o===gd.StartControl||o===gd.StopControl)h.push(zm({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;tw.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)&&Tc(au,{userId:n.id,ptz:UR(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(Gm(s.id)),Ue(r)}))),cameraPtzEpics3:(e,t)=>e.pipe($t(`${zm}`),_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=VR(r)||{},{key:s,range:a}=NR(n,2);return r[s]?(Object.assign(i,{[s]:LR(r[s].capability,r[s].value,a)}),tw.movePTZCamera(i).then((()=>Km({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(`${mm}`),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&&ew.sendCameraAblity({pan:!!e.pan,tilt:!!e.tilt,zoom:!!e.zoom})}return fe})))},iw={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&&(Tc(Bd,{reason:"Cannot detect camera devices"}),XR.stopCaptureVideo()),PR(n,o)||s){if(i||YR.muteAttendeeVideo(a,!1),Tc(uu),s)l.push(mm("default"));else if(d&&u&&l.push(Fm({deviceId:d,ptzRange:u})),n!==d&&l.push(mm(d)),Object.prototype.hasOwnProperty.call(r,d)){const e=r[d];if(e){const t=VR(e);t&&XR.movePTZCamera(t)}}}else Tc(Fd,{reason:"cannot find target camera"}),XR.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?Tc(zd):Tc(Kd),vm(!!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:Tc(Hd),o.push(fm(!0));break;case Va.UserCameraIsTakenByOtherPrograms:Tc($d,{reason:"User camera is taken by other programs."}),o.push(Em(!0));break;case Va.VideoWebsocketBroken:Tc(Gd,{reason:"Video websocket broken."});break;case Va.StopVideoCaptureFailed:Tc(Kd,{failed:!0,reason:"Unknown."})}return Ue(o)}))),videoCaptureEpics3:(e,t)=>In(e,Va.StopVideoCaptureSuccess).pipe(Tt(t),ry((e=>{let[,t]=e;const{meeting:{userId:o},video:{isCurrentUserStartedVideo:n}}=t;n||Tc(Kd),YR.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})),ry((e=>{let[t]=e;const{id:o,bVideoMute:n}=t.payload.body;return Tc(Vd,{id:o,isVideoMuted:n}),!0===n&&XR.stopCaptureVideo(),!1===n&&Tc(Ud,{id:o,isVideoMuted:n}),Sm(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 Tc(cu,o),ct(je(cm(o)),Nf(t).pipe(Xe((e=>{const{meeting:{isCurrentUserStartVideoBeforeReset:o},media:{videoEncodeStatus:n}}=t.value;return!0!==(null==e?void 0:e.bVideoOn)&&!0===o?Lf("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=QR({imageUrl:r.imageSrc,cropped:r.cropped},XR,e):o===Id.Mask&&n.imageSrc&&n.clip&&(a=ZR({imageUrl:n.imageSrc,cropped:n.cropped,clip:n.clip,rootHeight:n.rootHeight,rootWidth:n.rootWidth},XR,e)),a.then((()=>{MR(XR,e,{cameraId:i,...s})})),ci(void 0)}))):fe}))))}))),videoCaptureEpics6:(e,t)=>e.pipe($t(`${hm}`),Ot((e=>{const{payload:o}=e,n=t.value,{meeting:{userId:r}}=n,i=Ep(n);0===o.length?i&&!i.bVideoConnect||YR.connectCamera(r,!1):null!=i&&i.bVideoConnect||YR.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((()=>(XR.setMobileRotateMode(xR()),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 XR.setMobileRotateMode(i),fe})))))),videoCaptureEpics8:e=>In(e,Va.StartVideoCaptureSuccess).pipe(mt((()=>!zi.isIPad&&zi.isAndroidOrIOSBrowser)),Ot((()=>{XR.setMobileRotateMode(xR())})),Et(fe)),videoCaptureEpics9:(e,t)=>In(e,Va.VideoStreamFailed).pipe(mt((()=>!!t.value.video.isCurrentUserStartedVideo&&zi.isIOSMobile)),Ot((()=>{XR.stopCaptureVideo()})),Et(fe))},sw={videoRenderEpics0:e=>yn(e,16129).pipe(ze((e=>{const{payload:{body:{id:t,bVideoOn:o}}}=e,n=OR(t);return Tc(Nd,{bVideoOn:o,userId:n}),pm({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=>{FR.subscribeVideo(e.userId,e.videoQuality,!1)})),ym(o)}))),videoRenderEpics2:e=>yn(e,16135).pipe(ze((e=>{const{payload:{body:{bLeadershipOn:t,id:o}}}=e,n=[];return t&&n.push(OR(o)),Tc(qd,{spotlightList:n}),gm(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=Rp(o);return r=r.filter((e=>i.findIndex((t=>t.userId===e))>=0)),Tc(qd,{spotlightList:r}),gm(r)}))),videoRenderEpics4:e=>In(e,Va.CurrentVideoResolution).pipe(ry((e=>(Tc(jd,e.payload.data),Am(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?(Tc(jd,t),Am(t)):(Tc(xd,t),Xm(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 Tc(Jd,{bOn:t}),Rm(t);if(void 0!==n)return km(n);{const e=1===o;return HR.updateVideoHDValue(e),HR.enableHardwareAccelerationForVideoEncode(!1),Dm(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&&Tc(Qd,{layout:i}),wm(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=_p(o);if(n&&n.length>0&&n.filter((e=>i.includes(e.id))).forEach((e=>{Tc(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=>{Tc(Yd,{userId:e.id})})),e.forEach((e=>{e.bVideoOn?Tc(Zd,{userId:e.id}):i.includes(e.id)&&Tc(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=Ep(n),u=Dp(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?(Tc(tu,o.payload),Vm(o.payload)):Vm(vd):m?(Tc(tu,o.payload),Um(o.payload)):Um(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;Tc(ou,{userId:e,width:t,height:o,quality:r})}else if(o===Va.CurrentDecodeVideoFps){const{ssrc:e,fps:t}=n;Tc(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=>Pm(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(Bm({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)&&Tc(nu,{userId:a,type:c,level:i})}if(r){const e=performance.now();(!p||e-(null!=l?l:0)>3e4)&&(FR.broadcastUserNetworkQuality({isUplink:r,level:i,bwLevel:n}),s.push(Jm(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||(Tc(nu,{userId:n,level:o,type:"uplink"}),s.push(Bm({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||HR.cancelPrefetchVideoSsrc(r.userId),FR.unsubscribeVideo(r.userId),n.push(ov(void 0))),Ue(n)}))),videoRenderEpics15:(e,t)=>e.pipe($t(`${ov}`),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&&HR.cancelPrefetchVideoSsrc(o.userId),FR.unsubscribeVideo(o.userId)),FR.subscribeVideo(n.userId,Ja.Video_360P,!1),HR.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(ov({userId:n.userId,loaded:!0,lastCopy:n})),Tc(lu,{userId:n.userId})):FR.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;Lf("video",o,e).subscribe((e=>{let[o,n]=e;const{video:{subscriptionStatus:r}}=t.value;o&&r.encode&&HR.subscribeToQos([Bs.VideoEncode],id),n&&(r.decode&&HR.subscribeToQos([Bs.VideoDecode],id),r.detailed&&HR.enableVideoObserver(!0))}))})),Et(fe)),videoRenderEpics18:(e,t)=>e.pipe($t(`${Om}`,`${Tm}`),mt((()=>{const e=t.value.video.renderedVideoList.length;return[0,1].includes(e)})),Ot((()=>{const e=t.value.video.renderedVideoList.length;1===e?HR.enableVideoObserver(!0,!0):0===e&&HR.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(Om({userId:s,key:ad,canvasId:pd,aspectRatio:u}))}e.length===l.length&&0!==i.length||Tc(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(uv(o)),Ue(r)})))},aw=fn(sw,iw,{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(Mm(!0)),Tc(Xd,!0),t===Va.VbModelPreloading_10S&&console.warn("Virtual Background is taking longer than expected to load.")):t===Va.VbSettingParaError&&(o===td.VBModelNotMatch?(Tc(Xd,!1),n.push(Mm(!1))):(Tc(eu,!1),n.push(Lm(!1)))),Ue(n)}))),vbEpics1:e=>In(e,Va.StartVideoStreamInVbSettingSuccess).pipe(ze((()=>(Tc(eu,!0),Lm(!0))))),vbEpics2:e=>In(e,Va.StartVideoStreamInMaskSettingSuccess).pipe(ze((()=>(Tc(du,!0),Qm(!0))))),vbEpics3:e=>In(e,Va.MaskSettingParaError).pipe(ze((()=>(Tc(du,!1),Qm(!1)))))},rw);class dw{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 dw),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})}}dw.agentInstance=void 0;const uw="PREVIEW_VIDEO_ENCODE_SUCCESS",lw="PREVIEW_VIDEO_VB_MODEL_READY";async function cw(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&&Wf(n)){const o=await zR(r,i);return e.startVirtualBackgroundSetting(t,o,0,null!=s?s:"default",d,u),o&&o!==od&&setTimeout((()=>{wf(o)}),0),"vb"}return e.startMaskSetting(t,null,null,0,null!=s?s:"default",0,0,0,0),"mask"}class pw{constructor(){this.previewMediaAgent=dw.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,Tc(uw));break;case Va.VbModelPreloadingOk:case Va.VbModelPreloading_3S:case Va.VbModelPreloading_10S:this.isVBModelReady=!0,Tc(lw,!0);break;case Va.VbSettingParaError:t===td.VBModelNotMatch&&(this.isVBModelReady=!1,Tc(lw,!1))}}}static setMediaOption(e){pw.mediaOption=e}setup(){if(pw.mediaOption){if(Hs.getInstance().inProgress)return Promise.resolve("");if(!dw.getInstance().inProgress){this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.previewMediaAgent.unregisterCallback(this.eventHandler);const{assetsPath:e,enforceMultipleVideos:t,enforceVirtualBackground:o}=pw.mediaOption,n={...Kf(e,t,o)};this.previewMediaAgent.init(e,n),this.previewMediaAgent.registerCallback(this.eventHandler)}return Promise.resolve("")}return Promise.reject({type:Al,reason:"Cannot preview video with virtual background before `client.init` method."})}async startPreview(e,t){var o;Hs.getInstance().inProgress?cw(Hs.getInstance(),e,t,null===(o=pw.mediaOption)||void 0===o?void 0:o.enforceVirtualBackground):(void 0!==this.isVBModelReady?Ue([this.isVBModelReady]):kc(lw,1)).subscribe((o=>{o&&(this.isVideoEncoded?Ue([!0]):kc(uw,1)).subscribe((()=>{var o;cw(dw.getInstance(),e,t,null===(o=pw.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)?dw.getInstance().stopVirtualBackgroundSetting():dw.getInstance().stopMaskSetting()}async updatePreview(e,t){const o=Hs.getInstance().inProgress?Hs.getInstance():dw.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 zR(e,t);n&&(o.updateVirtualBackgroundImage(n),n!==od&&setTimeout((()=>{wf(n)}),0))}else o.updateVirtualBackgroundImage(null)}}pw.mediaOption=void 0;const{InitSuccessVideo:hw,InitSuccessAudio:mw,InitSuccessSharing:vw,InitFailedVideo:gw,InitFailedAudio:fw,InitFailedSharing:yw,SharingHealthCheckFailed:Sw,VideoHealthCheckFailed:bw,AudioHealthCheckFailed:Ew}=Va,Iw=hb(Hs.getInstance()),Aw=db.getInstance(),Cw=Aw.makeLogger(["Media Agent"]),_w=[Df,kf,Pf].map((e=>Rf(e,{hostname:!0}))),Rw=[],ww={epics0:(e,t)=>e.pipe($t(`${Gr}`),_t((()=>{const{meeting:{isMeetingReset:o}}=t.value;return e.pipe(Rt(e.pipe($t(`${No}`))),$t(`${Xr}`),ft(1),sy((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?db.getInstance().makeLogger(["MEDIA SDK"]):void 0;return function(e){const{media:{patchedMediaSDKStatus:t}}=e;return t===Td.Loading?Fe(kc(Hl,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})),Iw.init(function(e){return e?new Proxy(e,{get:(e,t)=>"string"==typeof t&&"error"===t?function(){try{var e;ub.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&&_w.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),_f(n,(()=>{"JsMediaSDK_Instance_backup"in window&&delete window.JsMediaSDK_Instance_backup,Cw.info(`patched media sdk url:${n}`),e("")}),(()=>{"JsMediaSDK_Instance_backup"in window&&(window.JsMediaSDK_Instance=window.JsMediaSDK_Instance_backup,delete window.JsMediaSDK_Instance_backup),Cw.error(`cannot load patched media sdk :${n}`),t()}))}))).pipe(Xe((()=>(Tc(Hl),Ue([an(Td.Done),dn(o)])))),gt((()=>(Tc(Hl),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(Iw.notifySDKMeetingReady(),e&&o){const t={enableDecoderInWorklet:s,enableAudioBridge:a&&Ki()};Object.assign(t,Kf(e,r,i)),Iw.setAssetsAndConstraint(e,o,n,t)}Nf(t).pipe(_t((e=>Ue(Zf.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&&(Iw.connect({svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,isViewOnly:sp(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,FI.dispatch("",{tagName:e.tagName}),dA(null===(t=e.mediaSDK)||void 0===t?void 0:t.call(e),`VPTN:${o}`));const n=`${o}-container`,r=e.sessionId||tA();FI.get("renderCountMap").clear(),e.mediaSDK&&(FI.get("mediaSDKInstanceMap").set(WI,e.mediaSDK),FI.get("mediaSDKInstanceMap").set(r,e.mediaSDK)),e.failover&&FI.dispatch("failover",void 0,e.sessionId||WI),customElements.get(n)||customElements.define(n,VA),customElements.get(o)||customElements.define(o,PA)}({mediaSDK:()=>Iw.instance,tagName:p,failover:"1"}))}))})),_t((()=>dt((e=>Iw.registerCallback(e)),(e=>Iw.unregisterCallback(e)),((e,t)=>({type:e,data:t}))).pipe(ze((e=>Qo(e))))))),epics3:e=>In(e,[hw,mw,vw,gw,fw,yw]).pipe(iy((e=>{const{payload:{type:t,data:o}}=e;if(t===mw||t===fw){if(o===Ua.EncodeSuccess)return Tc(Tl),je(Zo("success"));if(o===Ua.DecodeSuccess)return Tc(Dl),je(Yo("success"));if(o===Ua.EncodeFailed)return Tc(Nl),je(Zo("failed"));if(o===Ua.DecodeFailed)return Tc(Vl),je(Yo("failed"))}else if(t===hw||t===gw){if(o===Ua.EncodeSuccess)return Tc(Pl),je(Xo("success"));if(o===Ua.DecodeSuccess)return Tc(kl),je(en("success"));if(o===Ua.EncodeFailed)return Tc(Ul),je(Xo("failed"));if(o===Ua.DecodeFailed)return Tc(jl),je(en("failed"))}else if(t===vw||t===yw){if(o===Ua.EncodeSuccess)return Tc(Ml),je(tn("success"));if(o===Ua.DecodeSuccess)return Tc(Ll),je(on("success"));if(o===Ua.EncodeFailed)return Tc(xl),je(tn("failed"));if(o===Ua.DecodeFailed)return Tc(Bl),je(on("failed"));if(t===vw&&void 0===o)return Tc(Ll),je(on("success"))}}))),epics4:(e,t)=>In(e,[hw,mw]).pipe(_t((()=>"object"==typeof navigator.mediaDevices?ct(Uf(),ct(In(e,Va.StartVideoCaptureSuccess),st(navigator.mediaDevices,"devicechange"),In(e,Va.UserGrantCaptureAudio).pipe(mt((()=>!t.value.audio.isUserGrantCaptureAudio)))).pipe(Xe((()=>Uf().pipe(Ot((()=>{setTimeout((()=>{Tc(Fl)}),50)}))))))).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=[zp(t.microphones),Kp(t.speakers),hm(t.cameras)];if(o.audio){const{audio:{activeMicrophone:e,activeSpeaker:s,microphoneDevicesList:a,speakerDevicesList:d}}=o,u=Ep(o),{microphones:l,speakers:c}=t,p=a.filter((e=>-1===l.findIndex((t=>t.deviceId===e.deviceId)))),h=d.filter((e=>-1===c.findIndex((t=>t.deviceId===e.deviceId))));if(p.length>0){if(Jf(p[0],e,a)){const e=Qf(l);Iw.changeMicrophone("default",null==e?void 0:e.label,!(null==u||!u.muted)),n.push(qp("default"))}}else if("default"===e){const e=Qf(a),t=Qf(l);a.length>0&&(null==e?void 0:e.label)!==(null==t?void 0:t.label)&&Iw.changeMicrophone("default",null==t?void 0:t.label,!(null==u||!u.muted))}var r,i;h.length>0?Jf(h[0],s,d)&&(Iw.changeSpeaker("default"),n.push(Jp("default"))):"default"===s&&d.length>0&&(null===(r=Qf(d))||void 0===r?void 0:r.label)!==(null===(i=Qf(c))||void 0===i?void 0:i.label)&&Iw.changeSpeaker("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;Iw.sendUserNodeList(e,o)}Iw.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Xi.SHARING_DECODE}),r&&Iw.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Xi.AUDIO_DECODE})}if(n.remove&&n.remove.length>0){if(!r){const{meeting:{gcmSessinKey:e}}=t.value;Iw.sendUserNodeList(n.remove.map((e=>({userid:e.id,bremove:!0}))),e)}Iw.updateUserMediaSN({removed:n.remove.map((e=>e.id)),isFromMainSession:r,iVType:Xi.SHARING_DECODE}),r&&Iw.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;pw.setMediaOption({assetsPath:t.assetsPath,enforceMultipleVideos:t.enforceMultipleVideos,enforceVirtualBackground:t.enforceVirtualBackground})})),Et(fe)),epics9:e=>e.pipe($t(`${Ur}`,`${Vr}`),Ot((()=>{dw.getInstance().inProgress&&(dw.getInstance().disconnect(),Zf.watch(dw.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=()=>{Tc(Gl,{name:e,state:t.state})};o(),t.addEventListener("change",o),Rw.push((()=>{t.removeEventListener("change",o)}))})).catch((()=>{}))})):fe)),Et(fe)),epics11:e=>e.pipe($t(`${ui}`),mt((e=>e.payload===Di.Closed)),Ot((()=>{Rw.length>0&&(Rw.forEach((e=>e())),Rw.length=0)})),Et(fe)),epics12:e=>In(e,[Sw,bw,Ew,gw,fw,yw]).pipe(Ot((e=>{Aw.report(`Media health check failed,refresh or restart the browser may recover,reason:${e.payload.type}`,"Media exception flow"),Tc(zl)})),Xe((()=>fe)))},Ow=fn(ww),Tw={meeting:iI,socket:OI,participants:VI,media:BI},Dw=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||xt;function Pw(e){return function(e){for(var t=Object.keys(e),o={},n=0;ne.userId===t));if(r.findIndex((e=>e===$w.Attendee))>-1&&(i=Cp(n).find((e=>e.userId===t))),!i)return Promise.reject({type:Ol,reason:"no matching user"});{const{meeting:{userId:e}}=o.getState();for(let o=0;o1?n-1:0),s=1;st.includes(o+1)?rb(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}`:""}`),Gw.report(o,`${e} exception flow`,"error"),Promise.reject(t)}))}catch(e){}return i.apply(this,r)}}}function Kw(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:Ol,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 qw{constructor(e){this[Mw]=void 0,this[Nw]=void 0,this[Lw]=void 0,this[Vw]=void 0,this[Mw]=e,this[Nw]=e.dispatch,this[Lw]=e.getState}}const Jw=["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=rp(e),n={isPhoneUser:o};return o&&null!=t&&t.phoneNumber&&Object.assign(n,{phoneNumber:t.phoneNumber}),n}}];function Qw(e){return Jw.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 Zw(){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 Yw=e=>{let{breakoutRoom:{mainSessionAttendeeList:t}}=e;return t},Xw=e=>{let{meeting:{zoomId:t}}=e;return t},eO=e=>{let{breakoutRoom:{isHugeBO:t}}=e;return t},tO=Qc([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!==dp.InProgress&&e!==dp.Closing||t!==lp.InRoom&&t!==lp.TimeUp||!o))),oO=Qc([e=>{let{breakoutRoom:{rooms:t}}=e;return t},Zc,Xw,Yw,tO,eO],((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||hy(e.caps))))})),nO=Qc([tO,Yw,Zc,Xw,eO],((e,t,o,n,r)=>(e?t:o).filter((e=>!e.bHold&&!e.isHost&&e.zoomID!==n&&!e.bid&&(!r||hy(e.caps)))))),rO=Qc([tO,Yw,Rp],((e,t,o)=>e?t.find((e=>e.isHost)):o.find((e=>e.isHost))));var iO,sO,aO,dO;const uO=Ns.createAgent();let lO=(iO=Ww($w.Other),sO=Ww($w.Other),aO=Ww($w.Other),dO=class extends qw{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}=Zw();if(!n||!r)return console.error("https://developers.zoom.us/docs/video-sdk/web/browser-support"),Promise.reject({type:Al,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{[Nw]:i,[Mw]:s}=this;let a=Pf;const d=(null==o?void 0:o.fileWithVersion)||!1;let u="en-US",l=`${Pf}/${wi}`;if(o){const{dependentAssets:e,additionalFeatures:t,constraints:n,language:r,webEndpoint:i}=o;r&&(u=r),i&&function(e){Of=Rf(e,{hostname:!0})}(i),e===Oi.CDN||e===Df?(a=Df,l=`${Df}/${wi}`):e===Oi.Global||e===Pf?(a=Pf,l=`${Pf}/${wi}`):e===Oi.CN||e===kf?(a=kf,l=`${kf}/${wi}`):e&&/^https?:\/\//.test(e)&&(a=Ir(e),l=d?`${a}/1506_js_media.min.js`:`${a}/${wi}`),t&&Array.isArray(t)&&t.forEach((e=>{if(this[Vw][e]&&void 0===s.getState()[e]){const{epic:t,reducer:o,Client:n}=this[Vw][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",iC),s.injectEpic(dC)),null!=n&&n.video&&void 0===s.getState().video&&(s.injectReducer("video",nw),s.injectEpic(aw)),null!=n&&n.screen&&void 0===s.getState().share&&(s.injectReducer("share",_E),s.injectEpic(OE))}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(""):_f(l,(()=>{e("")}),(()=>{t({type:Ol,reason:"dependent assets are not accessible"})}))}))}on(e,t){((e,t)=>{const o=_c[e];if(o){const n=wc.get(e);if(n)n.push(t),wc.set(e,n);else{const n=[t];wc.set(e,n);const r=ct(...o.map((e=>{const{event:t,payload:o}=e;return st(Rc,t).pipe(ze((e=>o(e))),Le(pe))}))).subscribe((t=>{const o=wc.get(e);o&&o.forEach((e=>{e(t)}))}));Oc.push(r)}}})(e,t)}off(e,t){((e,t)=>{if(_c[e]){const o=wc.get(e);if(Array.isArray(o)){const n=o.filter((e=>e!==t));wc.set(e,n)}}})(e,t)}getFeatureModule(e){return this.modules.get(e)}leave(){const{[Lw]:e,[Nw]:t}=this,{socket:{zoomSocketStatus:o}}=e();return o===Mp.Connected||o===Mp.Connecting?t(Br()):t(Fr()),Fe(ut(500).pipe(yt("")))}end(){const{[Lw]:e,[Nw]:t}=this;return"connected"===e().socket.zoomSocketStatus?(t(Hr()),Fe(ut(500).pipe(Ot((()=>{Mc()})),yt("")))):Promise.resolve("")}changeName(e,t){const o=this[Mw].getState(),{meeting:{bAllowAttendeeRename:n}}=o,r=Ep(o),i=sp(r.userRole),s=Ip(o);if(i)return Promise.reject({type:Rl});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 uO.rename(t,dr(e),dr(r.displayName)),ty({userId:t,key:"displayName"},(t=>t.displayName===e));{const n=Cp(o).find((e=>e.userId===t));if(n){const t=kE.getInstance();return uO.rename(n.userId,dr(e),dr(n.displayName)),t.rename(n.jid,e),Pc(qs,(t=>{const o=t.find((e=>e.jid===n.jid));return o&&o.displayName===e}))}return Promise.reject({type:Ol,reason:"no matching user"})}}return Promise.reject({type:Rl})}return e===r.displayName?Promise.resolve():s||n?(uO.rename(r.userId,dr(e),dr(r.displayName)),Pc(Ws,(t=>t.displayName===e))):Promise.reject({type:Rl,reason:"host disallow rename themselves"})}makeHost(e){return uO.assignHost(e,!1),ty({userId:e,key:"isHost"},(e=>!0===e.isHost))}makeCoHost(e){const t=this[Mw].getState(),o=Rp(t).find((t=>t.userId===e));return!0===(null==o?void 0:o.bCoHost)?Promise.reject({type:Ol,reason:`user:[${e}] is already co-host `}):(uO.assignHost(e,!0),ty({userId:e,key:"bCoHost"},(e=>!0===e.bCoHost)))}revokeCoHost(e){const t=this[Mw].getState(),o=Rp(t).find((t=>t.userId===e));return!1===(null==o?void 0:o.bCoHost)?Promise.reject({type:Ol,reason:`user:[${e}] is not a co-host`}):(uO.revokeCoHost(e),ty({userId:e,key:"bCoHost"},(e=>!1===e.bCoHost)))}reclaimHost(){const e=this[Lw](),{meeting:{isOriginHost:t}}=e,o=Ep(e);return null!=o&&o.isHost?Promise.resolve(""):t?(uO.reclaimHost(o.userId,!1),Pc(Ws,(e=>!0===e.isHost))):Promise.reject({type:Rl,reason:"You are not the origin host"})}isHost(){const e=this[Mw].getState(),t=Ep(e);return!!t&&t.isHost}isCoHost(){const e=this[Mw].getState(),t=Ep(e);return!!t&&!!t.bCoHost}isOriginHost(){const{meeting:{isOriginHost:e}}=this[Lw]();return e}getCurrentUserInfo(){const e=this[Mw].getState(),t=Ep(e);if(t){const o=Qw(t);if(e.meeting.isWebinar&&sp(t.userRole)){const{audio:t}=e,n=null==t?void 0:t.isAllowToTalk;Object.assign(o,{isAllowToTalk:n})}if(e.breakoutRoom&&tO(e)){const{breakoutRoom:{currentRoom:{boId:t}}}=e;Object.assign(o,{bid:t})}return o}return null}getParticipantsList(){const e=this[Mw].getState(),{meeting:{meetingStatus:t}}=e,o=Ep(e);if(t===Di.Joined&&o&&!o.bHold){var n,r;const t=e.breakoutRoom&&tO(e)?null===(n=e.breakoutRoom)||void 0===n||null===(r=n.currentRoom)||void 0===r?void 0:r.boId:"";return Rp(e).map((e=>{const o=Qw(e);return t&&Object.assign(o,{bid:t}),o}))}return[]}getAssistantsList(){const e=this[Mw].getState(),{meeting:{meetingStatus:t}}=e,o=Ep(e);return t===Di.Joined&&o?wp(e).map((e=>({userId:e.userId,displayName:e.displayName,isNewAst:!0}))):[]}getMeetingHost(){var e;const t=this[Lw]();let o=Op(t);return o||(null===(e=t.breakoutRoom)||void 0===e?void 0:e.currentRoom.status)!==lp.InRoom||(o=t.breakoutRoom.mainSessionAttendeeList.find((e=>e.isHost))),void 0!==o?Qw(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[Lw](),_=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:Mf(),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}}}},kw(dO.prototype,"end",[Bw,jw],Object.getOwnPropertyDescriptor(dO.prototype,"end"),dO.prototype),kw(dO.prototype,"changeName",[jw],Object.getOwnPropertyDescriptor(dO.prototype,"changeName"),dO.prototype),kw(dO.prototype,"makeHost",[iO,Bw,jw],Object.getOwnPropertyDescriptor(dO.prototype,"makeHost"),dO.prototype),kw(dO.prototype,"makeCoHost",[sO,Bw,jw],Object.getOwnPropertyDescriptor(dO.prototype,"makeCoHost"),dO.prototype),kw(dO.prototype,"revokeCoHost",[aO,Bw,jw],Object.getOwnPropertyDescriptor(dO.prototype,"revokeCoHost"),dO.prototype),kw(dO.prototype,"reclaimHost",[jw],Object.getOwnPropertyDescriptor(dO.prototype,"reclaimHost"),dO.prototype),dO);const cO=Ns.createAgent(),pO=kE.getInstance(),hO=(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:Ol,reason:"invalid target user"};const{chat:{chatPrivilege:r,panelistChatPrivilege:i},meeting:{isWebinar:s}}=o,a=Ip(o),d=t.isHost||t.bCoHost;let u=!1;if(!a){if(s)if(sp(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=sp(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:Rl,reason:"Insufficient chat privilege"}}return null};function mO(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 vO(e,t,o){if(null!=o&&o.host)return[Op(e),...Tp(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=[Op(e),...Tp(e),...e.participants.attendeesList.filter((e=>!(e.bCoHost||e.isHost||e.bHold)))];if(null!=o&&o.includeAttendee){const t=Cp(e).filter((e=>!rp(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 gO(e){const{text:t,destId:o,sn:n,attendeeId:r}=e;return is.beginEncrypt({text:t,type:ts.RWG_CHAT}).then((e=>{cO.chat(e,o,n,r)}))}function fO(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 yO(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=Cp(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 SO(e){var t;const[o]=e.split(".").reverse();return null!==(t=ks[o])&&void 0!==t?t:""}function bO(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 EO=db.getInstance(),IO=EO.makeLogger(["File Transfer"]);function AO(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 CO(e,t){return t.fileObj?`${e}/zoomfile/download?objkey=${t.fileObj}`:`${e}/file/${t.fileID}`}function _O(e,t){return{fileName:e.name,fileSize:e.size,receiverId:null==t?void 0:t.userId,receiverGuid:null==t?void 0:t.userGuid}}function RO(e,t,o){EO.report(`${e}. file name:${rb(t.name)},file size:${t.size}, ${"type"in t?`file type:${t.type}`:""}, error:${o.name};${o.message}`,["File Transfer"])}function wO(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 OO(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 TO(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 OO(e,n,r);return t?await is.beginEncrypt({text:new Uint8Array(t),type:ts.CHAT_FILE}):Promise.reject(null)}catch(o){return RO(`encrypt file buffer error. offset:${t},`,e,o),Promise.reject(o)}}))))}catch(e){console.warn(e)}return null}function DO(e,t,o,n){return n.pipe($t(`${Nv}`,`${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})),Ot((n=>{IO.info(`Cancel file upload. file name:${rb(e.name)},file size:${e.size},receiver id:${o.userId}`),Tc(va,{..._O(e,o),progress:0,status:Ds.Cancel,retryToken:n.type===`${Nv}`?t:void 0})})))}function PO(e,t){if(null!=e&&e.file){const{file:o,receiver:n}=e,{upload:{chunkIndex:r,totalChunks:i,uniqueId:s}}=o;return Tc(va,{..._O(t,n),progress:Math.floor((null!=r?r:0)/(null!=i?i:1)*100),status:Ds.Fail,retryToken:s}),Ue([Lv({upload:{status:Ds.Fail,progress:0,uniqueId:s}}),Vv({uniqueId:s,file:t})])}return fe}function kO(e,t){return Tc(va,{..._O(e),progress:0,status:Ds.Fail}),je(Lv({upload:{status:Ds.Fail,progress:0,uniqueId:t}}))}async function MO(e,t,o,n){const r=AO(e,"/wc/fileupload",n.value),i=new FormData;try{const s=await TO(e),a=fO(t,n.value);if(s&&a){i.append("file",new File([s],e.name));const{meeting:{zmk:d}}=n.value,{receiver:u}=a;return WE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:d},crossDomain:br(r),body:i,includeUploadProgress:!0}).pipe(Rt(DO(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=CO(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)&&(Tc(va,{..._O(e,u),progress:d,status:l}),p.push(Lv(c))),Ue(p)})),gt((t=>(console.warn(t),RO("Upload small file error.",e,t),PO(a,e)))))}}catch(e){console.warn(e)}return kO(e,t)}const LO=(()=>{const e=new Cf;return t=>async function(){await e.acquire(),t(...arguments),setTimeout((()=>{e.release()}),3e3)}})(),NO=function(e){const t=["chatFileTransfer"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return LO(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}(Ns.createAgent()),VO={chatHistory:[],chatPrivilege:gs.All,panelistChatPrivilege:fs.AllPanelist,isAllowAttendeeChat:!0,isFileTransferEnable:!0,isEnableFileTransferEncrypted:!0,fileTransferFileType:[],fileDownloadPromptIgnoreList:[],fileTransferSizeLimit:0,fileServerDomain:"",failedFileTransfer:{}},UO=ko({[`${wv}`]:AE(((e,t)=>{let{payload:o}=t;e.chatHistory.push(o)})),[`${_v}`]:AE(((e,t)=>{let{payload:o}=t;e.chatPrivilege=o})),[`${Rv}`]:AE(((e,t)=>{let{payload:o}=t;e.panelistChatPrivilege=o})),[`${Tv}`]:AE(((e,t)=>{let{payload:o}=t;e.isAllowAttendeeChat=o})),[`${Dv}`]:AE(((e,t)=>{let{payload:o}=t;const{destNodeID:n,msgID:r,userId:i}=o,s=bO(e.chatHistory,{userId:i,destNodeID:n});s&&Object.assign(s,{id:r})})),[`${Pv}`]:AE(((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)})),[`${kv}`]:AE(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${Mv}`]:AE(((e,t)=>{let{payload:o}=t;const{originFile:n,...r}=o;e.chatHistory.push(r)})),[`${Lv}`]:AE(((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}))}})),[`${Nv}`]:AE(((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})})),[`${Vv}`]:AE(((e,t)=>{let{payload:o}=t;const{uniqueId:n,file:r}=o;e.failedFileTransfer[`${n}`]||Object.assign(e.failedFileTransfer,{[`${n}`]:r})})),[`${Uv}`]:AE(((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})})),[`${jv}`]:AE(((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})})),[`${Ov}`]:()=>({...VO})},VO);var jO;const xO=Ns.createAgent();let BO=(jO=class extends qw{send(e,t){if(!e)return Promise.reject({type:Ol,reason:"Text is empty"});const{[Lw]:o,[Nw]:n}=this,r=o(),i=Ep(r),s=mO(r,t),a=hO(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&&sp(s.userRole);return t===ys.SilentModeUsers?xO.chat(dr(e),t):d?h?8==(8&s.clientCap)?c=gO({text:e,destId:ys.IndividualCcPanelist,sn:null==i?void 0:i.zoomID,attendeeId:t}):(c=gO({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=>{pO.sendWebinarMseeage(e,o,ys.IndividualCcPanelist,n)}))}({text:e,jid:s.jid,isGCMEnabled:l}))),p=!0):s&&(c=gO({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID})):c=gO({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(wv(o)),p?(Tc(ca,o),o):new Promise(((e,n)=>{kc(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}}};Tc(ca,a),e(a)}),(()=>{n({type:_l})}))}))}))}setPrivilege(e){const t=this[Lw](),{meeting:{isWebinar:o},chat:{chatPrivilege:n},breakoutRoom:r}=t;return n===e?Promise.resolve(""):(null==r?void 0:r.controlStatus)===dp.InProgress&&tO(t)?Promise.reject({type:Al,reason:"Cannot update chat privilege in a subsession"}):!o&&!Es.includes(e)||o&&!Is.includes(e)?Promise.reject({type:Ol,reason:"invalid privilege value of parameter"}):(xO.setChatPriviledge(e),Pc(pa,(t=>t.chatPrivilege===e)))}setPanelistPrivilege(e){const t=this[Lw](),{chat:{panelistChatPrivilege:o}}=t,n=Cs[e];return o===n?Promise.resolve(""):Object.values(As).includes(e)?(xO.setPanelistChatPrivilege(e),Pc(pa,(e=>e.panelistChatPrivilege===n))):Promise.reject({type:Ol,reason:"Panelist privilege value is invalid"})}deleteMessage(e){const t=this[Lw](),{chat:{chatHistory:o},meeting:{meetingOptions:n,userId:r}}=t;if(null!=n&&n.isEnableDeleteChatMsg){const n=Ip(t),i=o.find((t=>t.id===e));if(i){const{sender:t}=i;if(n)xO.chatCmdReq(e,Ss.Delete);else{if(t.userId!==r)return Promise.reject({type:Rl,reason:"can not delete message"});xO.chatCmdReq(e,Ss.Delete)}return Pc(ma,(t=>t.id===e)).then((()=>({id:e})))}return Promise.reject({type:Ol,reason:"msgId is wrong"})}return Promise.reject({type:Al,reason:"can not delete messages"})}lockChat(e){const t=this[Lw](),{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:Ol,reason:"File is empty"});const{[Lw]:o,[Nw]:n}=this,r=o(),{chat:{isFileTransferEnable:i,fileTransferFileType:s,fileTransferSizeLimit:a,failedFileTransfer:d}}=r;if(!i)return Promise.reject({type:Al,reason:"Send files via in-session chat is not enabled"});if("string"==typeof e){const t=fO(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(Lv({originFile:d[e],...r,upload:{...o,status:Ds.InProgress}})),Promise.resolve((()=>{n(Nv({uniqueId:s,fileName:i,userId:a}))}))}return Promise.reject({type:Ol,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:Al,reason:"File is not in the allow list"})}if(e.size>a)return Promise.reject({type:Al,reason:"File size exceeds the maximum limit."});const i=Ep(r),d=mO(r,t),u=hO(i,d,r);if(u)return Promise.reject(u);const l=vr();return n(Mv(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(Vv({uniqueId:l,file:e})),n(Nv({uniqueId:l,fileName:o,userId:null==d?void 0:d.userId}))}))}}downloadFile(e,t,o){const{[Lw]:n,[Nw]:r}=this,{chat:{chatHistory:i}}=n();if(!e||!t)return Promise.reject({type:Ol,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(Lv({id:e,fileUrl:t,download:{status:Ps.InProgress,progress:0,blob:o}})),Promise.resolve((()=>r(jv({id:e,fileUrl:t}))))):Promise.reject({type:Ol,reason:"Invalid message id or file url!"})}getPrivilege(){const{chat:{chatPrivilege:e,isAllowAttendeeChat:t}}=this[Lw]();return t?e:gs.NoAttendee}getReceivers(){const e=this[Lw](),{chat:{chatPrivilege:t,panelistChatPrivilege:o,isAllowAttendeeChat:n},meeting:{isWebinar:r}}=e;if(!r&&!n)return[];const i=Ep(e),s=Ip(e);if(i)if(r)if(sp(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=vO(e,i.userId,{includeAttendee:!0});return[Rs,_s,...t]}if(o===fs.AllPanelist){const t=vO(e,i.userId);return[Rs,...t]}}else{const o=Ip(e);if(t===gs.All||o){const t=vO(e,i.userId);return[_s,...t]}if(t===gs.Host)return vO(e,i.userId,{host:!0});if(t===gs.EveryonePublicly){const t=vO(e,i.userId,{host:!0});return[_s,...t]}if(t===gs.NoOne)return[]}return[]}getHistory(){return this[Lw]().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[Lw](),{meeting:{meetingOptions:t}}=e;return null==t?void 0:t.isEnableDeleteChatMsg}isFileTransferEnabled(){return this[Lw]().chat.isFileTransferEnable}getFileTransferSetting(){const e=this[Lw](),{chat:{fileTransferFileType:t,fileTransferSizeLimit:o}}=e;return{typeLimit:(null!=t?t:[]).map((e=>`.${e}`)).join(","),sizeLimit:o}}},kw(jO.prototype,"send",[jw],Object.getOwnPropertyDescriptor(jO.prototype,"send"),jO.prototype),kw(jO.prototype,"setPrivilege",[xw,jw],Object.getOwnPropertyDescriptor(jO.prototype,"setPrivilege"),jO.prototype),kw(jO.prototype,"setPanelistPrivilege",[xw,jw,function(e,t,o){const n=o.value;o.value=function(){const e=this[Mw];if(e){const{meeting:{isWebinar:t}}=e.getState();if(!t)return Promise.reject({type:wl,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=Ep(o),l=Cp(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&&sp(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 Tc(ca,v),wv(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=Ep(o);if(l){const e=sp(null==l?void 0:l.userRole)&&r===l.userId&&!u;if(!n&&!e){const{sn:e,...t}=yO({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=>(Tc(ca,e),wv(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?(Tc(pa,!0===r?{chatPrivilege:i}:{chatPrivilege:gs.NoAttendee}),Tv(r)):(Tc(pa,{chatPrivilege:n}),_v(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 Tc(pa,{panelistChatPrivilege:t}),Rv(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;Tc(ca,{id:i,file:{name:r,size:d,type:l,fileUrl:c,upload:{status:Ds.Complete,progress:100}},receiver:{...h},...n}),u.push(Uv({fileID:s,msgID:i,senderId:a}))}}else{const e=bO(d,{userId:a,destNodeID:r});var l;e&&(Tc(ha,{msgId:i,receiverId:r,identification:null!==(l=e.highResTimeStampForIdentification)&&void 0!==l?l:0}),u.push(Dv({destNodeID:r,msgID:i,userId:a})))}else n!==bs.Delete&&n!==bs.Block||u.push(Pv({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(Pv({msgId:n})),Tc(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(Pv({msgId:o})),Tc(ma,{id:o})),Ue(n)})))},HO=fn(FO,{chatFileEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{var t,o,n;const{payload:{fileTransfer:r,fileServerDomain:i}}=e;return kv({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(`${Mv}`),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=AO(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 OO(e,o,n);return Ar(await window.crypto.subtle.digest("SHA-256",t))}catch(t){return RO("calculate file hash error.",e,t),Promise.reject(t)}})))).join("")}(e),{meeting:{zmk:s,meetingId:a}}=n.value,d=fO(t,n.value);if(i&&d){const{receiver:n}=d,u={fileName:e.name,length:e.size,channelType:4,digest:i,shareJid:a};return WE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:s},crossDomain:br(r),body:u}).pipe(Rt(DO(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 Lv({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),RO("Upload file meta error.",e,t),PO(d,e)))),Ct(Lv({upload:{uniqueId:t,status:Ds.Init}})))}return kO(e,t)}(n,r,e,t):await MO(n,r,e,t)})),Xe((e=>e))),chatFileEpics2:(e,t)=>e.pipe($t(`${Lv}`),mt((e=>{var t;return(null===(t=e.payload.upload)||void 0===t?void 0:t.status)===Ds.Success})),sy((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 NO.chatFileTransfer({fileID:a,fileSize:p,fileName:c,fileObj:r,type:d,destNodeID:u,attendeeNodeID:l}),s.push(Lv({upload:{uniqueId:o,status:Ds.Complete}}))}return s}))),chatFileEpics3:(e,t)=>e.pipe($t(`${Lv}`),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 MO(n,r,e,t)})),Xe((e=>e))),chatFileEpics4:(e,t)=>e.pipe($t(`${Lv}`),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=fO(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 TO(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),WE({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(DO(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=fO(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}),Tc(va,{..._O(e,p),progress:m,status:Ds.InProgress}),g.push(Lv(v))),Ue(g)})),gt((t=>(console.warn(t),RO(`Upload file chunk error. chunk:${i},total chunks:${s},uploadid:${a},trackingId:${u}`,e,t),PO(r,e)))))}}return kO(e,t)}(n,r,e,t)})),Xe((e=>e))),chatFileEpics5:(e,t)=>e.pipe($t(`${Lv}`),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=fO(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 WE({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(DO(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}`;return Tc(va,{..._O(e,c),progress:100,status:Ds.Success}),Lv({fileID:d,fileObj:u,fileUrl:l,upload:{uniqueId:t,progress:100,status:Ds.Success}})})),gt((t=>(console.warn(t),RO(`Upload chunks checksum error.uploadid${a},trackingId${l}`,e,t),PO(s,e)))))}return kO(e,t)}(n,r,e,t)}))),chatFileEpics6:(e,t)=>yn(e,4308).pipe(sy((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=CO(p,{fileObj:s,fileID:r});if(d===Os.Local){const{sn:d,...c}=yO({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(wv({...g,file:{...g.file,fileID:r,fileObj:s}})),setTimeout((()=>{Tc(ca,g)}),0)}}return m}))),chatFileEpics7:(e,t)=>e.pipe($t(`${Lv}`),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 WE({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(`${jv}`,`${No}`),mt((t=>{if(t.type===`${No}`)return!0;const{payload:{id:o}}=t;return e.id===o})),Ot((()=>{var t,o,n;IO.info(`Cancel file download. file name:${rb(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}`),Tc(ga,{...wO(e),progress:0,status:Ps.Cancel})})))}(a,t)),sy((async t=>{const{type:o,loaded:n,total:r}=t,i=[],d={...wO(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(Lv({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(Lv({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 RO("decrypt file buffer error.",{name:t,size:e.byteLength},o),Promise.reject(o)}})));return new Blob(r,{type:SO(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)&&Tc(ga,d),i})),gt((t=>(console.warn(t),RO(`download file error. file url:${o}`,{name:void 0,size:void 0},t),Tc(ga,{...wO(a),progress:0,status:Ps.Fail}),je(Lv({id:e,fileUrl:o,download:{status:Ps.Fail,progress:0}}))))))}return fe}(o.payload.id,e,t))))});function $O(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:rb(r),userName:rb(i),userEmail:rb(s)}}}function WO(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(`${ff}`),ft(1),Xe((e=>(e.payload&&o(n),fe))));o(n)}}catch(e){console.warn(e)}return fe})))}function GO(e,t,o,n){return In(e,o).pipe(WO(e,t,n))}function zO(e,t,o,n){return yn(e,o).pipe(WO(e,t,n))}function KO(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 qO(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 JO(e,t){return t?` ,${e}:${t}`:""}const{InitSuccessAudio:QO,InitFailedAudio:ZO,InitSuccessVideo:YO,InitFailedVideo:XO,InitSuccessSharing:eT,InitFailedSharing:tT}=Va,{DecodeSuccess:oT,DecodeFailed:nT,EncodeSuccess:rT,EncodeFailed:iT}=Ua,sT={[`${QO}`]:{name:"Audio",isException:!1},[`${ZO}`]:{name:"Audio",isException:!0},[`${YO}`]:{name:"Video",isException:!1},[`${XO}`]:{name:"Video",isException:!0},[`${eT}`]:{name:"Sharing",isException:!1},[`${tT}`]:{name:"Sharing",isException:!0}};function aT(e){const t=(null!=e?e:"").split("-");return[...new Set(t)].map((e=>({reason:e,count:t.filter((t=>e===t)).length})))}const dT=db.getInstance(),uT=()=>{if("connection"in navigator){const{effectiveType:e,rtt:t,downlink:o}=navigator.connection;dT.makeLogger(["Network Connection Type"]).info(`Network connection. ect:${e},rtt:${t},downlink:${o}`)}},lT=db.getInstance().makeLogger(["Remote Control"]),cT=hb(Hs.getInstance()),pT=[{event:Va.AudioBridgeReconnectStart,message:ob.AudioBridgeReconnectStart,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.AudioBridgeReconnectEnd,message:ob.AudioBridgeReconnectEnd,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.UserGrantCaptureAudio,message:e=>`${ob.DeviceAudioStreamCaptured},${KO(e)}`,logType:"info",additionalTags:["Audio Capture Flow"]},{event:Va.JoinComputerAudioComplete,message:ob.AudioJoinComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.LeaveComputerAudioComplete,message:ob.AudioLeaveComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.JoinSharingAudioComplete,message:ob.SharingAudioStartComplete,logType:"info",additionalTags:["Audio Sharing Flow"]},{event:Va.LeaveSharingAudioComplete,message:ob.SharingAudioStopComplete,logType:"info",additionalTags:["Audio Sharing Flow"]}],hT=[{event:Va.StartVideoCaptureSuccess,message:e=>`${nb.StartCaptureVideoSuccess}, ${qO(e)}`,logType:"info",additionalTags:["Video Join Flow"]},{event:Va.StopVideoCaptureSuccess,message:nb.StopCaptureVideoSuccess,logType:"info",additionalTags:["Video Join Flow"]},{event:Va.StartVideoStreamInVbSettingSuccess,message:nb.VBSettingSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloadingOk,message:nb.VBPreloadSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloading_3S,message:nb.VBPreloading3S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloading_10S,message:nb.VBPreloading10S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Va.VbSettingParaError,message:nb.VBSettingFailed,logType:"error",additionalTags:["Video VB Flow"]}],mT=pT.map((e=>({...e,tag:"Audio"}))).concat(hT.map((e=>({...e,tag:"Video"})))),vT=db.getInstance(),{InitSuccessVideo:gT,InitSuccessAudio:fT,InitSuccessSharing:yT,InitFailedVideo:ST,InitFailedAudio:bT,InitFailedSharing:ET,RecoverWebrtcAudio:IT,AudioBridgeFirstRecvData:AT,AudioBridgeCanSendData:CT,UserForbiddedCaptureAudio:_T,AudioWebsocketBroken:RT,AudioZeroData:wT,UserForbiddedCaptureVideo:OT,UserCameraIsTakenByOtherPrograms:TT,VideoWebsocketBroken:DT,StopVideoCaptureFailed:PT,DesktopSharingPermissionDenied:kT,DesktopSharingSystemError:MT,AudioSpeakerSetError:LT,VbSettingParaError:NT,MaskSettingParaError:VT,WebglLostInMultiView:UT,VideoStreamFailed:jT,AudioStreamFailed:xT,NotifyUIFailover:BT}=Va,FT=db.getInstance(),HT={options:void 0,isLaplaceInitialized:!1},$T=ko({[`${gf}`]:AE(((e,t)=>{let{payload:o}=t;e.options=o})),[`${ff}`]:AE(((e,t)=>{let{payload:o}=t;e.isLaplaceInitialized=o})),[`${yf}`]:(e,t)=>{let{options:o}=e,{payload:n}=t;return n?{...HT,options:o}:{...HT}}},HT),WT={mlEpics0:(e,t)=>In(e,[gT,fT,yT,ST,bT,ET]).pipe(WO(e,t,(e=>{const{payload:{type:o,data:n}}=e,{meeting:{userId:r}}=t.value,i=function(e,t){const o=sT[`${e}`];if(o){const{name:e,isException:n}=o,r=[e,`${e} Init Flow`];n&&r.push(`${e} exception flow`);let i="";return[oT,nT].includes(t)&&(i=`${i} decode`.trim()),[rT,iT].includes(t)&&(i=`${i} encode`.trim()),[rT,oT].includes(t)&&(i=`${i} success`.trim()),[nT,iT].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?vT.report(`${e}. userId:${r}`,t):vT.makeLogger(t).info(e)}}))),mlEpics1:(e,t)=>GO(e,t,mT.map((e=>e.event)),(e=>{const{payload:{type:o}}=e,n=mT.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&&vT.makeLogger([i])[o](s,r)}})),mlEpics2:(e,t)=>e.pipe($t(`${Qp}`),mt((e=>!e.payload)),WO(e,t,(()=>{vT.makeLogger(["Audio"]).warn(`Auto play audio failed,${KO(t.value)}`)}))),mlEpics3:(e,t)=>GO(e,t,IT,(()=>{vT.report("Audio bridge, recover audio failed, need to rejoin the audio",["Audio exception flow"])})),mlEpics4:(e,t)=>GO(e,t,[AT,CT],(e=>{const{payload:{type:t}}=e;vT.makeLogger(["Audio"]).log("Audio bridge connection: "+(t===AT?"first receive data":"can send data"))})),mlEpics5:(e,t)=>GO(e,t,BT,(e=>{vT.report(`Audio bridge, notify ui failover, subreason:${e.payload.data}`,["Audio exception flow"])})),mlEpics6:(e,t)=>GO(e,t,[_T,RT,wT,LT,xT],(e=>{const{payload:{type:o}}=e;let n=`Audio error case:${o}`;o===_T?n="Audio capture is forbidden by the user":o===wT?t.value.audio.webrtcRestartCount<3&&(n="audio capture zero data, auto failover"):o===LT?n="audio change speaker error":o===xT&&(n="audio stream ended or muted, stop capture audio"),vT.report(`${n},${KO(t.value)}`,["Audio exception flow"])})),mlEpics7:(e,t)=>GO(e,t,[OT,TT,DT,PT,jT],(e=>{const{payload:{type:o,data:n}}=e;let r=`Video error case:${o}`;if(o===OT)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===TT)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===NT){var i;r=`VB setting error, param:${JSON.stringify(null!==(i=t.value.video.virtualBackground)&&void 0!==i?i:{})}`}else if(o===VT){var s;r=`Mask setting error, param:${JSON.stringify(null!==(s=t.value.video.mask)&&void 0!==s?s:{})}`}else o===jT&&(r=`Video stream ended or muted, if it is on iOS platform, will stop capture video.platform:${zi.browser}`);vT.report(`${r},${qO(t.value)}`,["Video exception flow"])})),mlEpics8:(e,t)=>GO(e,t,[kT,MT],(e=>{const{payload:{type:t}}=e;let o="";t===MT?zi.isMacOS&&(o="Need to allow screen recording access in system setting on MacOS"):o="Need to allow the permission request",vT.report(`${o}`,["Sharing exception flow"])})),mlEpics9:(e,t)=>GO(e,t,UT,(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));vT.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(WO(e,t,(()=>{vT.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"),vT.makeLogger(["Video"]).warn("Still subscribing videos after switching to background"))}),1e3)})))},GT={rmclEpics0:(e,t)=>e.pipe($t(`${am}`),WO(e,t,(e=>{const{payload:{isRemoteControlEnabled:t,isEnableAutoDeleteRcApp:o}}=e;lT.log(`isRemoteControlEnabled:${t},auto delete:${o}`)}))),rmclEpics1:(e,t)=>e.pipe($t(`${nm}`),mt((e=>!!e.payload)),WO(e,t,(e=>{lT.log(`Launch Remote control app, scheme:${e.payload}`)}))),rmclEpics2:(e,t)=>e.pipe($t(`${Qh}`),mt((e=>!!e.payload)),WO(e,t,(e=>{lT.log(`Remote control session starts, controlling ssrc:${e.payload}`)}))),rmclEpics3:(e,t)=>zO(e,t,16430,(()=>{lT.log("Remote control app connected to rwg.")})),rmclEpics4:(e,t)=>zO(e,t,vs,(()=>{lT.log("Remote control app disconnected to rwg.")})),rmclEpics5:(e,t)=>zO(e,t,vs,(e=>{const{share:{status:o,isRemoteControlEnabled:n}}=t.value;n&&o!==qa.End&&e.payload.body.bOn&&lT.log(`Remote control sharing device info.${JSON.stringify(cT.getShareStreamInfo())}`)})),rmclEpics6:(e,t)=>GO(e,t,Va.CurrentDesktopSharingWidthHeight,(()=>{const{share:{isRemoteControlEnabled:e}}=t.value;e&&lT.log(`Remote control sharing device info changes.${JSON.stringify(cT.getShareStreamInfo())}`)})),rmclEpics7:(e,t)=>GO(e,t,Va.SendRemoteControlQrCode,(e=>{const{share:{status:o}}=t.value,{payload:{data:n}}=e;lT.log(`Remote control QR code result. sharing status:${o}, result${JSON.stringify(n)}`)}))},zT={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 dT.init({...l,logConfig:o,logEncryptionPubKey:n,accountId:i}).then((()=>[ff(!0),gf(l)])).catch((()=>[ff(!1)]))})),Xe((e=>Ue(e)))),epics1:(e,t)=>zO(e,t,ps,(e=>{var o,n,r,i;const{payload:{body:s}}=e;if(s&&s.res===wr.Success){dT.makeLogger(["A/V Performance Info"]).info(`CPU cores:${navigator.hardwareConcurrency}, SharedArrayBuffer:${!!window.crossOriginIsolated}, browser:${zi.browser} ${zi.browserVersion}, OS:${zi.os} ${zi.osVersion}${JO("wow64",zi.wow64)}${JO("GPU",zi.gpu)}${JO("architecture",zi.architecture)}${JO("bitness",zi.bitness)}${JO("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;dT.makeLogger(["Init Option"]).info(`Init option:${JSON.stringify({enforceMultipleVideos:e,disableRenderLimits:r,enforceVirtualBackground:o,assetsPath:n,stayAwake:i,leaveOnPageUnload:s})}`),"connection"in navigator&&(uT(),navigator.connection.addEventListener("change",uT))}else dT.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}`]:rb(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);dT.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?rb(c):void 0,accountId:p?rb(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)})),WO(e,t,(()=>{const{label:e,payload:o}=$O(t.value);dT.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)),WO(e,t,(e=>{const{payload:o}=e,{socket:{rwgServerList:n,retryCount:r}}=t.value,{payload:i}=$O(t.value);dT.report(`websocket unexpected disconnected,${JSON.stringify({code:o,rwgHost:n[r],...i})}`,["Join Meeting Flow","RWG Disconnect"])}))),epics4:(e,t)=>e.pipe($t(`${Ii}`),WO(e,t,(e=>{const{payload:{reason:o,count:n,interval:r,sequence:i,userId:s,userGUID:a}}=e,{payload:d}=$O(t.value,{userId:s,userGUID:a});dT.report(`meeting failover,${JSON.stringify({reason:o,count:n,interval:r,sequence:i,detailed:aT(i),...d})}`,["Join Meeting Flow","Failover"]),"connection"in navigator&&navigator.connection.removeEventListener("change",uT)}))),epics5:(e,t)=>e.pipe($t(`${$o}`),mt((e=>e.payload.status===Mp.Connecting)),WO(e,t,(e=>{const{payload:{rwgUrl:o}}=e;let n=o.replace(/(\d+)\?/,`${rb("$1")}?`);n=["email","zoomid","participantID","dn2","customer_key","mpwd","topic"].reduce(((e,t)=>e.indexOf(t)>-1?e.replace(new RegExp(`${t}=([^&]+)`,"g"),`${t}=${rb("$1")}`):e),n);const{payload:r}=$O(t.value);dT.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})),WO(e,t,(()=>{const{meeting:{meetingStatus:e},socket:{rwgServerList:o,retryCount:n}}=t.value;if(e!==Di.Joined){const{payload:e}=$O(t.value),r=(null==o?void 0:o.length)>0?o[n]:void 0;dT.report(JSON.stringify({...e,rwc:null==r?void 0:r.rwc,rwg:null==r?void 0:r.rwg}),["UNAVAILABLE_RWG"])}}))),epics7:(e,t)=>zO(e,t,1,(e=>{const{payload:{body:o}}=e;dT.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)=>zO(e,t,2,(()=>{dT.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((()=>kc(Zs,1).pipe(Ot((e=>{try{const{payload:o}=$O(t.value);dT.report(`Connection change with join meeting failed. payload:${JSON.stringify(e)}. meeting info:${JSON.stringify(o)}`,"JOIN_MEETING_FAILED","error")}catch(e){}})),Xe((()=>fe))))))},KT=fn(zT,GT,WT),qT=Ns.createAgent(),JT={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:[]},QT=ko({[`${_g}`]:AE(((e,t)=>{let{payload:o}=t;e.cmrStatus=o})),[`${Rg}`]:AE(((e,t)=>{let{payload:o}=t;e.recordingEnable=o})),[`${wg}`]:AE(((e,t)=>{let{payload:o}=t;e.recordingIsoEnable=o})),[`${Og}`]:AE(((e,t)=>{let{payload:o}=t;e.allowStopAutoRecording=o})),[`${Tg}`]:AE(((e,t)=>{let{payload:o}=t;e.automaticCloudRecordingEnable=o})),[`${Dg}`]:AE(((e,t)=>{let{payload:o}=t;e.isZoomIQ=o})),[`${Pg}`]:AE(((e,t)=>{let{payload:o}=t;e.zoomIQChanging=o})),[`${kg}`]:AE(((e,t)=>{let{payload:o}=t;e.localStatus=o})),[`${Mg}`]:AE(((e,t)=>{let{payload:o}=t;e.supportLocalRecording=o})),[`${Lg}`]:AE(((e,t)=>{let{payload:o}=t;e.localGrantPermissionOption=o})),[`${Ng}`]:AE(((e,t)=>{let{payload:o}=t;e.localPermissionUserList=o})),[`${Vg}`]:()=>({...JT})},JT);var ZT,YT,XT,eD,tD,oD,nD,rD,iD;const sD=Ns.createAgent(),aD=zw("Recording");let dD=(ZT=Fw("recording"),YT=Fw("recording"),XT=Fw("recording"),eD=Fw("recording"),tD=Fw("recording"),oD=Fw("recording"),nD=Fw("recording"),rD=Fw("recording"),iD=class extends qw{startRecording(){const e=this[Lw](),{meeting:{bIbDisableRecording:t,recordingEnable:o},recording:{cmrStatus:n}}=e;return t?Promise.reject({type:Al,reason:"Rejected by Information Barrier"}):o?n===Ca.Start?Promise.resolve(""):(sD.recordMeeting(!0,!1),Pc(Oa,(e=>e.cmrServerStatus===Ca.Start))):Promise.reject({type:Al,reason:"The account of the meeting disabled the cloud recording"})}pauseRecording(){const e=this[Lw](),{recording:{cmrStatus:t,allowStopAutoRecording:o}}=e;return t===Ca.Pause?Promise.resolve(""):t!==Ca.Start?Promise.reject({type:Al,reason:"Recording is not started"}):o?(sD.recordMeeting(!1,!0),Pc(Oa,(e=>e.cmrServerStatus===Ca.Pause))):Promise.reject({type:Al,reason:"Cannot pause cloud recording due to web setting config"})}stopRecording(){const e=this[Lw](),{recording:{cmrStatus:t,allowStopAutoRecording:o}}=e;return t===Ca.Stop?Promise.resolve(""):o?(sD.recordMeeting(!1,!1),Pc(Oa,(e=>e.cmrServerStatus===Ca.Stop))):Promise.reject({type:Al,reason:"Cannot stop cloud recording due to web setting config"})}accept(){const e=this[Lw](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=Ep(e);return o?t!==Ca.Start&&t!==Ca.Pause?Promise.reject({type:Al,reason:"Recording is not started"}):null!=n&&n.bAllowISORecord?Promise.resolve("You accepted ISO recording"):(sD.allowSelfRecord(!0),Pc(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:Al,reason:"ISO Recording is not enabled"})}decline(){const e=this[Lw](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=Ep(e);return o?t!==Ca.Start&&t!==Ca.Pause?Promise.reject({type:Al,reason:"Recording is not started"}):!0===(null==n?void 0:n.bAllowISORecord)?Promise.reject({type:Al,reason:"You had accept ISO recording, cant change it"}):(sD.allowSelfRecord(!1),Promise.resolve("")):Promise.reject({type:Al,reason:"ISO Recording is not enabled"})}getRecordingStatus(){const e=this[Lw](),{recording:{cmrStatus:t}}=e,o=Pp(e);return t===Ca.Start?Aa.Recording:t===Ca.Pause?Aa.Paused:o?Aa.Recording:Aa.Stopped}isRecordingEnabled(){const e=this[Lw](),{recording:{recordingEnable:t}}=e;return t}isAllowedToStopAutoRecording(){const e=this[Lw](),{recording:{allowStopAutoRecording:t}}=e;return t}isAutomaticCloudRecordingEnabled(){const e=this[Lw](),{recording:{automaticCloudRecordingEnable:t}}=e;return t}enableRecordingWithIQ(e){const{[Lw]:t,[Nw]:o}=this,n=t(),{recording:{isZoomIQ:r,zoomIQChanging:i},meeting:{meetingOptions:s}}=t();return s.isEnableKiwiRecording?Ip(n)?i?Promise.reject({type:Al,reason:"We are changing, please wait"}):e===r?Promise.reject({type:Al,reason:`You have ${e?"enable":"disable"} Zoom IQ, don't need change`}):(o(Pg(!i)),o(Dg(!r)),sD.enableZoomIQRecord(e),Pc(Ma,(e=>null==e?void 0:e.success))):Promise.reject({type:Al,reason:"Only Host or co-host can enable/disable Zoom IQ"}):Promise.reject({type:Al,reason:"You not have zoom IQ license or not enable zoom IQ, please check and retry"})}isSupportLocalRecording(){const e=this[Lw](),{meeting:{meetingOptions:t,isWebinar:o},breakoutRoom:n}=e;if((null==n?void 0:n.currentRoom.status)===lp.InRoom)return!1;const r=Ep(e);return(!o||!sp(r.userRole))&&(null==t?void 0:t.isLocalRecordingEnabled)}isSupportLocalRecordingPermission(){const e=this[Lw](),{recording:{supportLocalRecording:t}}=e;if(!this.isSupportLocalRecording())return!1;const o=Ep(e);return!(null==o||!o.isHost)||t===Ra.Allow}askLocalRecordingPermission(){const{[Lw]:e}=this,{recording:{supportLocalRecording:t}}=e();return this.isSupportLocalRecording()?t===Ra.None?(sD.localRecordingRequestPermission(),Promise.resolve("")):t===Ra.Allow?Promise.resolve(""):Promise.reject("permission is denied"):Promise.reject("not support")}startLocalRecording(e){const{[Lw]:t,[Nw]:o}=this,n=t(),{recording:{localStatus:r,supportLocalRecording:i},meeting:{userId:s}}=n;if(!(e in _a))return Promise.reject({type:Al,reason:"not support you parameter, only support type are 0(stop)/1(start)/2(pause)."});if(!this.isSupportLocalRecording())return Promise.reject({type:Al,reason:"not support local recording"});if(e===r)return Promise.resolve(`you currently status is ${r}, do nothing`);const a=Ep(n);return i===Ra.Allow||null!=a&&a.isHost?(sD.localRecordingMeeting(e),Pc(Da,(t=>(null==t?void 0:t.userId)===s&&(o(kg(t.bLocalRecord)),t.bLocalRecord===e)),1e3)):Promise.reject({type:Al,reason:"you not have local recording permission, please use askLocalRecordingPermission request it first"})}isSupportLocalRecordingGrantPermission(){const e=this[Lw]();if(!this.isSupportLocalRecording())return!1;const t=Ep(e);return!(null==t||!t.isHost)&&!!my(t.caps)}grantLocalRecordingPermission(e,t,o){const{[Lw]:n,[Nw]:r}=this,i=n(),{recording:{localPermissionUserList:s}}=i;if(!this.isSupportLocalRecording())return Promise.resolve(!1);const a=Ep(i);if(!my(a.caps))return Promise.reject({type:Al,reason:"you can not grant permission"});let d=!1;if(o&&(d=!0),s.filter((t=>t===e)).length>0){if(t===Ra.Allow)sD.localRecordingGrantPermission(e,!0,d);else{if(t!==Ra.Deny)return Promise.reject({type:Al,reason:"only support DENY(1)/ALLOW(2)"});sD.localRecordingGrantPermission(e,!1,d)}return r(Ng(s.filter((t=>t!==e)))),Tc(Pa,{type:"answer",value:t===Ra.Allow}),Promise.resolve(!1)}return t!==Ra.Deny?Promise.reject({type:Al,reason:"Direct grant only support DENY(1)"}):(sD.hostGrantPermission(e,!1),Pc(Pa,(o=>(null==o?void 0:o.value)===e&&(t===Ra.Allow?(r(Ng([...s,e])),!0===(null==o?void 0:o.canRecord)):(r(Ng(s.filter((t=>t!==e)))),!1===(null==o?void 0:o.canRecord)))),1e3))}getLocalRecordingPermissionUserList(){const e=this[Lw](),{recording:{localPermissionUserList:t}}=e;if(!this.isSupportLocalRecording())return[];const o=Ep(e);return my(o.caps)?t:Promise.reject({type:Al,reason:"you can not grant permission"})}getLocalRecordingPermissionOperation(){const e=this[Lw](),{recording:{localGrantPermissionOption:t}}=e;if(!this.isSupportLocalRecording())return null;const o=Ep(e);return my(o.caps)?t:null}},kw(iD.prototype,"startRecording",[xw,jw,ZT,aD],Object.getOwnPropertyDescriptor(iD.prototype,"startRecording"),iD.prototype),kw(iD.prototype,"pauseRecording",[xw,jw,YT,aD],Object.getOwnPropertyDescriptor(iD.prototype,"pauseRecording"),iD.prototype),kw(iD.prototype,"stopRecording",[xw,jw,XT,aD],Object.getOwnPropertyDescriptor(iD.prototype,"stopRecording"),iD.prototype),kw(iD.prototype,"accept",[jw,eD,aD],Object.getOwnPropertyDescriptor(iD.prototype,"accept"),iD.prototype),kw(iD.prototype,"decline",[jw,tD,aD],Object.getOwnPropertyDescriptor(iD.prototype,"decline"),iD.prototype),kw(iD.prototype,"askLocalRecordingPermission",[jw,oD],Object.getOwnPropertyDescriptor(iD.prototype,"askLocalRecordingPermission"),iD.prototype),kw(iD.prototype,"startLocalRecording",[jw,nD],Object.getOwnPropertyDescriptor(iD.prototype,"startLocalRecording"),iD.prototype),kw(iD.prototype,"grantLocalRecordingPermission",[jw,Bw,rD],Object.getOwnPropertyDescriptor(iD.prototype,"grantLocalRecordingPermission"),iD.prototype),iD);const uD={moduleEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{const{payload:{recordingEnable:t}}=e;return Rg(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&&(Tc(Oa,{cmrServerStatus:n}),o.recording.recordingIsoEnable&&n===Ca.Start&&Tc(Ta,{status:Aa.Ask})),s.push(_g(n))),void 0!==r&&s.push(Og(!r)),void 0!==i&&s.push(Tg(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 wg(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&&(Tc(Pa,{type:"revoke",value:e.id,canRecord:t}),qT.localRecordingMeeting(_a.Stop)),!t||null!=o&&o.bLocalRecord||Tc(Pa,{type:"grant",value:e.id,canRecord:t})}i===e.id&&((a!==Ra.None||t)&&u.push(Mg(t?Ra.Allow:Ra.Deny)),t||u.push(kg(_a.Stop)))}else Tc(Da,{userId:e.id,bLocalRecord:e.bLocalRecordStatus})})),Ue(u)}))),moduleEpics4:(e,t)=>yn(e,ds).pipe(ze((e=>kI(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(Ng(r.filter((t=>t!==(null==e?void 0:e.userId))))),Tc(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=>{Tc(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 Tc(ka,{isZoomIQ:t}),Dg(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 Tc(Ma,{success:r}),r&&n.push(Pg(!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&&(Tc(Pa,{type:"option",value:null===(d=o.payload.body)||void 0===d?void 0:d.option}),r.push(Lg(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&&Tc(Pa,{type:"request",value:null===(c=o.payload.body)||void 0===c?void 0:c.userId}),r.push(Ng([...s,null===(l=o.payload.body)||void 0===l?void 0:l.userId])));return"permission_request_answer"===i&&(Tc(Pa,{type:"answer",value:o.payload.body.agreed}),r.push(Mg(o.payload.body.agreed?Ra.Allow:Ra.Deny))),Ue(r)})))},lD=fn(uD);let cD=function(e){return e[e.All=1]="All",e[e.Private=2]="Private",e}({}),pD=function(e){return e.SUCCESS="success",e}({}),hD=function(e){return e.CustomizedKey="__zoom_internal_message_customized_key__@@",e.SpeakerOnly="__zoom_internal_message_speaker_only__@@",e}({});const mD=kE.getInstance(),vD=(e,t,o)=>{const{meeting:{encType:n}}=o,r=t,i=lr(e),s=r?cD.Private:cD.All;return n===es.AES_GCM?is.beginEncrypt({text:i,type:ts.XMPP_CHAT}).then((e=>{mD.sendWebinarMseeage(e,r,s,!0)})):mD.sendWebinarMseeage(i,r,s,!1)};function gD(e,t){const{cmd:{jids:o}}=t;return Object.prototype.hasOwnProperty.call(o,e)?Promise.resolve():Fe(kc(qs).pipe(At((t=>-1===t.findIndex((t=>Number(t.userId)===e)))),ft(1),Le(he)))}function fD(e){const{cmd:{connectionStatus:t}}=e;return t===pD.SUCCESS?Promise.resolve(!0):Fe(kc(ba,1)).then((e=>e===Ti.Connected||Promise.reject({type:Al,reason:"Cannot establish the command channel"})))}function yD(e,t){for(const[o,n]of Object.entries(e))if(n.jid===t)return o}const SD={connectionStatus:"initial",jids:{}},bD=ko({[`${Bg}`]:()=>({...SD}),[`${Ug}`]:AE(((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}}}))})),[`${jg}`]:AE(((e,t)=>{let{payload:o}=t;o.forEach((t=>{const{jid:o}=t,n=yD(e.jids,o);n&&delete e.jids[n]}))})),[`${xg}`]:AE(((e,t)=>{let{payload:o}=t;e.connectionStatus=o}))},SD);var ED;let ID=(ED=class extends qw{send(e,t){if(!e)return Promise.reject({type:Ol,reason:"Text is empty"});if("string"!=typeof e)return Promise.reject({type:Ol,reason:"Text is not a string"});if(e.length>512)return Promise.reject({type:Ol,reason:"Text exceeds the max length(512)."});const{[Lw]:o}=this,n=o(),{socket:{xmppSocketStatus:r},meeting:{userId:i}}=n;return r!==Mp.Connected?Promise.reject({type:wl,reason:"Command channel is not ready"}):fD(n).then((()=>t?-1!==Rp(o()).findIndex((e=>e.userId===t))?gD(t,n).then((()=>{const{cmd:{jids:n}}=o();return n[t]?(vD(e,n[t].jid,o()),{timestamp:(new Date).getTime(),text:e,receiverId:t,senderId:i}):Promise.reject({type:Cl})})):Promise.reject({type:Ol,reason:"Cannot find the user"}):(vD(e,"",n),{timestamp:(new Date).getTime(),text:e,receiverId:0,senderId:i})))}getJids(){const{[Lw]:e}=this,t=e(),{cmd:{jids:o}}=t;return o}},kw(ED.prototype,"send",[jw],Object.getOwnPropertyDescriptor(ED.prototype,"send"),ED.prototype),ED);const AD={extraEpics0:(e,t)=>e.pipe($t(`${hh}`),_t((e=>{const{payload:{speakerOnly:o}}=e,n=Ep(t.value);return(void 0!==(null==n?void 0:n.audio)?Ue([n.audio]):kc(Ws).pipe(mt((e=>void 0!==e.audio)),ft(1))).pipe(Ot((()=>{fD(t.value).then((()=>{vD(`${hD.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{vD(`${hD.SpeakerOnly}1`,e[n].jid,t.value)}),Math.floor(Math.random()*Math.log10(o.length)*1e3))}}})),Et(fe))},CD={epics0:(e,t)=>bn(e,24577).pipe(Tt(t),ze((e=>{let[t]=e;const{payload:{body:{status:o}}}=t;return o===pD.SUCCESS&&Tc(ba,Ti.Connected),xg(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=yD(i,l),m=r===es.AES_GCM,v=yD(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===cD.Private&&Number(h)===n||u===cD.All){const e=ur(t);if(null!=e&&e.startsWith(hD.SpeakerOnly)){const t=e.substring(hD.SpeakerOnly.length),o=1===Number(t);return Gc({userId:Number(v),key:"isSpeakerOnly",value:o})}{var o;const t=v&&(null===(o=i[v])||void 0===o?void 0:o.userGuid);Tc(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;Tc(zs,[{userId:t,[`${o}`]:n}])}))),epics2:(e,t)=>bn(e,24595).pipe(Xe((e=>{const{payload:{body:{action:o,data:n}}}=e,r=[];if([DE.List,DE.Add,DE.update].includes(o)&&n){const{breakoutRoom:e,participants:{attendeesList:o}}=t.value,i=(null==e?void 0:e.currentRoom.status)===lp.InRoom?o.concat(e.mainSessionAttendeeList):o;r.push(Ug({data:n,attendees:i}))}return o===DE.Remove&&n&&r.push(jg(n)),Ue(r)})))},_D=fn(CD,AD),RD=(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(jA(n,e,t,s)),Promise.resolve("")}return Promise.reject({type:Al,reason:`Cannot ${t?"mute":"unmute"} share audio when the user's share audio is not enable.`})}return Promise.reject({type:Ol,reason:"Cannot find the user"})},wD=(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),Yf("lockShare",t)):Promise.reject({type:Ol})},OD=Qc([Rp],(e=>e.filter((e=>e.bVideoOn)))),TD=Qc([OD],(e=>e.filter((e=>(e.caps&cy)===cy)))),DD=(e,t)=>{const o=e.store.getState(),n=yy(o).find((e=>e.userId===t));if(n){const{caps:e}=n;return(e=>512==(512&e))(e)}return!1};var PD,kD,MD,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;const ok=zw("Audio"),nk=zw("Video"),rk=zw("Sharing"),ik=zw("CameraControl"),sk=zw("Remote Control"),ak=Kw(HTMLCanvasElement,0),dk=Kw([HTMLCanvasElement,HTMLVideoElement],0),uk=Kw(HTMLCanvasElement,0,["id"]),lk=Kw([HTMLCanvasElement,HTMLVideoElement],0,["id"]);let ck=(PD=Fw("audio"),kD=Fw("audio"),MD=Fw("audio"),LD=Fw("audio"),ND=Fw("audio"),VD=zw("Audio",[1,2,3]),UD=Fw("audio"),jD=zw("Audio",[1,2]),xD=Fw("audio"),BD=Fw("audio"),FD=Fw("audio"),HD=Fw("audio"),$D=Fw("share"),WD=Fw("audio"),GD=Fw("share"),zD=Fw("audio"),KD=Fw("audio"),qD=Fw("audio"),JD=Fw("audio"),QD=Fw("audio"),ZD=Fw("audio"),YD=zw("Audio",[1,2]),XD=Fw("audio"),eP=zw("Audio",[1,2]),tP=Fw("audio"),oP=Fw("audio"),nP=Fw("video"),rP=Fw("video"),iP=Fw("video"),sP=Fw("video"),aP=Fw("video"),dP=Fw("video"),uP=Fw("video"),lP=Fw("video"),cP=Fw("video"),pP=Fw("video"),hP=Fw("video"),mP=Fw("video"),vP=Fw("video"),gP=Fw("video"),fP=Fw("video"),yP=Fw("video"),SP=Fw("video"),bP=Fw("video"),EP=Fw("video"),IP=Fw("video"),AP=Fw("video"),CP=Fw("video"),_P=Fw("video"),RP=Fw("video"),wP=Fw("video"),OP=Fw("video"),TP=Fw("share"),DP=Fw("share"),PP=Fw("share"),kP=Fw("share"),MP=Fw("share"),LP=Fw("share"),NP=Fw("share"),VP=Fw("share"),UP=Hw("isShareOptionLocked"),jP=Hw("isShareOptionLocked"),xP=Fw("share"),BP=Fw("share"),FP=Fw("share"),HP=Fw("share"),$P=Fw("share"),WP=Fw("share"),GP=Fw("share"),zP=Fw("share"),KP=Fw("share"),qP=Fw("share"),JP=Fw("share"),QP=Fw("share"),ZP=Fw("share"),YP=Fw("share"),XP=Fw("share"),ek=Fw("share"),tk=class extends qw{constructor(e){super(e),this[Mw].dispatch(Jo()),this[Uw]={store:e,mediaAgent:$f(hb(Hs.getInstance())),rwgAgent:Ns.createAgent()}}startAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=Ep(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:Al,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:Al,reason:"Computer audio has been loading, please wait."});const h=function(e){const t=e?{...e}:void 0;if(zA(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&&!KA()&&(console.warn("Cannot enable stereo audio on current platform due to the browser limitation"),Object.assign(e,{stereo:!1}))}return qA()||!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(hh(null!=h?h:{}));const{speakerOnly:m,autoStartAudioInSafari:v}=h||{};if(!!l!=!!m&&n(Gc({userId:s.meeting.userId,key:"isSpeakerOnly",value:!!m})),!a)return Promise.reject({type:Al,reason:"Please call `startAudio` method after the `join` has been resolved"});{const t=sp(a.userRole)&&!e||m,{encodeInitStatus:d,decodeInitStatus:l}=JA(s,a,m);if($A()&&("success"!==l||"success"!==d))return Promise.reject({type:Al,reason:"It is required to wait for the audio encoding and decoding to be ready before calling `startAudio` method"});n(Yp(!0)),Lf("audio",d,l).subscribe((s=>{let[d,l]=s;if(d&&l){let s=u||($A()||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((()=>Vf("audio",o()))).then((()=>{const s=o(),{audio:{isSharingAudio:d}}=s;QA(r,s,t),d&&!GA()||xA(i,s,!t),sp(a.userRole)&&e&&n(Xp(!0)),n(Qp(!0))})).catch((()=>{n(Qp(!1)),n(Yp(!1))}))}else n(Yp(!1))}))}return"failed"===p||"failed"===c?(n(Yp(!1)),Promise.reject({type:Cl,reason:"audio encode or decode error"})):new Promise(((e,t)=>{vt(kc(Gu.JoinComputerAudio.success,1),ct(...Gu.JoinComputerAudio.fail.map((e=>kc(e,1).pipe(Xe((()=>xe({type:Rl,reason:e}))))))),ut(45e3).pipe(Xe((()=>xe({type:_l}))))).subscribe({next:()=>{n(Yp(!1)),e("")},error:e=>{Hs.getInstance().leaveComputerAudio();const i=Ep(o());(null==i?void 0:i.audio)!==Ad.Phone&&(n(Ah(Fa.MicrophoneError)),r.joinOrLeaveVoip(!1)),n(Yp(!1)),t(e)}})}))}})(this[Uw],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=Ep(i);if(s)return Promise.reject({type:Al,reason:"Computer audio has not finished joining, please wait."});if(a){if(d&&!GA())return Promise.reject({type:Al,reason:"Cannot stop audio during sharing with audio"});o(nh(void 0)),o(eh(void 0))}return(null==c?void 0:c.audio)===Ad.Computer?(o(Ah(Fa.Active)),await n.leaveComputerAudio(),r.joinOrLeaveVoip(!1),l&&o(Gc({userId:i.meeting.userId,key:"isSpeakerOnly",value:void 0})),u&&Xf.getInstance().stopAudioElement(),o(Gp(0)),Pc(bu)):Promise.resolve("")})(this[Uw])}muteAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=Ep(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:Al,reason:"no audio joined"}):!0===(null==a?void 0:a.muted)?Promise.resolve(""):(n(bh(xa.Active)),r.mute(a.userId,!0),i.muteAudio(),s.audio.isShareAudioEnabled&&!GA()&&n(eh(!0)),Pc(Eu).then((()=>"")));if(Ip(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:Al,reason:"no audio joined"}):!1===n.muted?(r.mute(t,!0),Pc(Au,(e=>e.id===t&&1==e.muted))):Promise.resolve(""):Promise.reject({type:Ol,reason:"no matching user"})}return Promise.reject({type:Rl})})(this[Uw],e)}unmuteAudio(e){return(async(e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=Ep(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:Al,reason:"no audio joined"});if(!1===(null==a?void 0:a.muted))return Promise.resolve("");if(s.audio.isShareAudioEnabled&&!GA()){if(s.audio.isSharingAudio)return Promise.reject({type:Al,reason:"Cannot unmute audio during sharing with audio"});n(eh(!1))}if(s.audio.bCanUnmute||null!=a&&a.isHost||null!=a&&a.bCoHost){if(sp(a.userRole)){const{audio:{isAllowToTalk:e,isAllowToTalkAttendeeConnected:t}}=s;e?t||(await i.leaveComputerAudio(),await xA(i,s,!0),n(Xp(!0))):Promise.reject({type:Al,reason:"Webinar attendee cannot unmute self audio."})}return n(Eh(Ba.Active)),r.mute(a.userId,!1),i.unmuteAudio(),Pc(Iu).then((()=>""))}return Promise.reject({type:Rl,reason:"host not allow unmute themselves"})}if(Ip(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:Al,reason:"no audio joined"}):(!0===n.muted&&r.mute(t,!1),Promise.resolve("")):Promise.reject({type:Ol,reason:"no matching user"})}return Promise.reject({type:Rl})})(this[Uw],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(jp({sequence:e,phoneNumber:t+o})),Dc(Gu.JoinAudioByCallMe)}return Promise.reject({type:Ol,reason:"no matching country code"})})(this[Uw],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)),Dc(Gu.cancelDialOut)})(this[Uw],e,t,o)}hangup(){return(e=>{const{store:{getState:t},rwgAgent:o}=e,n=t(),r=Ep(n);return(null==r?void 0:r.audio)===Ad.Phone&&null!==r.userId?(o.audioDrop(r.userId),Dc(Gu.hangup)):Promise.reject({type:Al,reason:"not joined audio by phone"})})(this[Uw])}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=Ep(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(gh(void 0)),Xf.getInstance().stopAudioElement(),o=!0);else if(t&&(!u||(null==d?void 0:d.url)!==t.url)){const i=Xf.getInstance();i.setAudioElement(t).then((()=>{r.changeMicrophone(i.audioElement,void 0,!(null==e||!e.muted)),n(gh(t))})),o=!0}if(o)return Dc(Gu.JoinComputerAudio)}else"string"==typeof t&&n(qp(t));return Promise.resolve("")}return Promise.reject({type:Mu})})(this[Uw],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:Mu});var a;if((null===(a=Ep(o()))||void 0===a?void 0:a.audio)===Ad.Computer){if(t!==s)return r.changeSpeaker(t),Pc(ju,(e=>e))}else n(Jp(t));return Promise.resolve("")})(this[Uw],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 RD(t,!0,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r}}=s;if(!t)return Promise.reject({type:Al,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((()=>BA(o,n,s).then((e=>{e.forEach((e=>i(e)))}))))),jA(o,a,!0,s),Promise.all([Pc({event:Ws,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!1===e.bShareAudioOn)),t]).then((()=>(i(ih(!0)),e&&(i(sh(!1)),Tc(Nu,{state:"off"})),"")))}}})(this[Uw],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 RD(t,!1,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r},share:{status:d}}=s;if(!t)return Promise.reject({type:Al,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=HA(o,n,s).then((e=>{e.forEach((e=>i(e)))}))),jA(o,a,!1,s),Promise.all([Pc({event:Ws,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!0===e.bShareAudioOn)),t]).then((()=>(i(ih(!1)),!1===e&&d===qa.Sharing&&(i(sh(!0)),Tc(Nu,{state:"on"})),"")))}}})(this[Uw],e)}subscribeAudioStatisticData(e){return(async(e,t)=>{const{mediaAgent:o,store:{getState:n}}=e,r=n(),i=Ep(r),s=!t||t.decode,a=!t||t.encode;if(!i)return Promise.reject({type:Al,reason:"Call this function after the 'join' method resolved."});{var d;const{encodeInitStatus:e,decodeInitStatus:t}=JA(r,i);(Ki()?qf(r,!(null!==(d=r.audio.customizeAudioOption)&&void 0!==d&&d.speakerOnly)):Lf("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[Uw],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(ah(md))),i&&(o.unsubscribeFromQos([Bs.AudioEncode]),n(dh(md))),null})(this[Uw],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&&!zA(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(Ih(!1))),r(mh(a)),o.changeAudioProfile(UA(n())))),Promise.resolve("")})(this[Uw],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=Ep(i);var u;return e?(t&&!qA()?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(vh(t))),Promise.resolve("")):Promise.reject({type:Al,reason:"Please call `enableSyncButtonsOnHeadset` method after the `join` has been resolved"})}})(this[Uw],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)||KA()||(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(mh(!1))),r(Ih(a)),o.changeAudioProfile(UA(n()))),Promise.resolve("")})(this[Uw],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(_h({sequence:s,ip:t,protocol:o})),Dc(Gu.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[Uw],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:Al,reason:"Cannot cancel call out "})})(this[Uw],e,t)}muteAllAudio(){return(e=>{const{rwgAgent:t}=e;return t.audioMuteAll(!0),Yf("bMutedAll",!0)})(this[Uw])}unmuteAllAudio(){return(e=>{const{rwgAgent:t}=e;return t.audioMuteAll(!1),Yf("bMutedAll",!1)})(this[Uw])}getMicList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.microphoneDevicesList]:[]})(this[Uw])}getSpeakerList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.speakerDevicesList]:[]})(this[Uw])}getAudioState(e){return((e,t)=>{let{store:{getState:o}}=e;const n=o(),{meeting:{isWebinar:r}}=n;let i=null;return null==t?i=Ep(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[Uw],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=Ep(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[Uw],e)}getActiveMicrophone(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeMicrophone:null})(this[Uw])}getActiveSpeaker(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeSpeaker:null})(this[Uw])}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[Uw])}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[Uw])}getDialOutCountries(){return(e=>{let{store:{getState:t}}=e;const{meeting:{callOutCountry:o}}=t();return Array.isArray(o)?o:[]})(this[Uw])}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[Uw])}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[Uw],e)}getAudioStatisticData(){return(e=>{let{store:{getState:t}}=e;const{audio:{statistic:o}}=t();return{...o}})(this[Uw])}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[Uw])}isSupportMicrophoneAndShareAudioSimultaneously(){return GA()}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:Al,reason:"Video is started"});if(u)return Promise.reject({type:Al,reason:"Camera is starting,please wait."});if(c&&!Ip(i))return Promise.reject({type:Al,reason:"Video is muted by the host"});if(jR(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!Wf(d)&&null!=p&&p.virtualBackground?Promise.reject({type:Ol,reason:"Virtual background only compatible with Chrome and Edge with SharedArrayBuffer enabled."}):(n(bm(!0)),Lf("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(jm({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=QR({...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=ZR({...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=>Vf("video",o()).then((()=>e)))).then((t=>{MR(r,e,p).forEach((e=>{n(e)})),f?n(Nm(t)):y&&n(Ym(t))})).catch((e=>{n(bm(!1)),Tc(Wd,{reason:e})}))}else n(bm(!1))})),Dc(hu.startCaptureVideo).then((()=>{n(Em(!1)),n(fm(!1))})).finally((()=>{n(bm(!1))})))})(this[Uw],e)}stopVideo(){return(e=>{const{store:{getState:t},mediaAgent:o}=e,{video:{isCaptureCameraLoading:n,isCurrentUserStartedVideo:r,isUsingMediaPlayback:i}}=t();return n?Promise.reject({type:Al,reason:"Camera is starting,please wait."}):r?(o.stopCaptureVideo(),i&&Xf.getInstance().stopVideoElement(),Pc(Kd,(e=>!0!==(null==e?void 0:e.failed)))):Promise.reject({type:Al,reason:"camera is closed"})})(this[Uw])}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&&!PR(t,s))return Promise.reject({type:Ol,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}=DR(p);r.changeCamera(t,rd.includes(t),{width:e,height:o}),n(tv(void 0)),Xf.getInstance().stopVideoElement()}else if(t&&(!c||(null==l?void 0:l.url)!==t.url)){const e=Xf.getInstance();e.setVideoElement(t).then((()=>{r.changeCamera(e.videoElement),n(tv(t))}))}return Dc(hu.switchCameraVideo).then((()=>{n(Em(!1)),n(fm(!1))}))}return Promise.resolve()})(this[Uw],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=jR(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:Al,reason:`subscribe video counts greater than maximum size (${E})`});if(-1===OD(m).findIndex((e=>e.userId===o)))return Promise.reject({type:Ol,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(pv())),p.renderVideo(t,o,d||ad,n,r,i,s,a,!0,u||"",!1),c(Cm(o)),c(cv(t.id));const e=document.querySelector(`#${hd}`);return e&&e.remove(),Promise.resolve("")}return Promise.reject({type:Ol,reason:"You must use a