From c504700009257f05afa9f371c0ac7094ca82288f Mon Sep 17 00:00:00 2001 From: mayk-zoom <78444092+mayk-zoom@users.noreply.github.com> Date: Wed, 22 May 2024 19:14:05 -0700 Subject: [PATCH] 1.11.5 update (#50) --- dist/index.esm.js | 2 +- dist/index.js | 2 +- dist/index.umd.js | 2 +- dist/lib/audio.encode.wasm | Bin 2875787 -> 2875898 bytes dist/lib/audio.simd.wasm | Bin 3013246 -> 3013357 bytes dist/lib/audio_simd.min.js | 4 ++-- .../lib/js_audio_level_worklet_process.min.js | 4 ++-- dist/lib/js_audio_process.min.js | 4 ++-- dist/lib/js_audio_worklet.min.js | 4 ++-- dist/lib/js_audio_worklet_process.min.js | 4 ++-- dist/lib/js_audio_worklet_simd.min.js | 4 ++-- dist/lib/js_media.min.js | 4 ++-- dist/lib/js_sharing_audio_worklet.min.js | 4 ++-- dist/lib/sharing_m.min.js | 8 ++++---- dist/lib/sharing_mtsimd.min.js | 8 ++++---- dist/lib/sharing_s.min.js | 6 +++--- dist/lib/sharing_simd.min.js | 6 +++--- dist/lib/vb.min.js | 4 ++-- dist/lib/video.decode.wasm | Bin 3778036 -> 3778038 bytes dist/lib/video.mt.wasm | Bin 3898913 -> 3898915 bytes dist/lib/video.mtsimd.wasm | Bin 4063336 -> 4063338 bytes dist/lib/video.simd.wasm | Bin 3942417 -> 3942419 bytes dist/lib/video_m.min.js | 6 +++--- dist/lib/video_mtsimd.min.js | 6 +++--- dist/lib/video_s.min.js | 4 ++-- dist/lib/video_share_mtsimd.min.js | 8 ++++---- dist/lib/video_simd.min.js | 4 ++-- dist/types/event-callback.d.ts | 13 ++++++++++++- dist/types/media.d.ts | 18 +++++++++++++----- dist/types/videoclient.d.ts | 10 ++++++++++ package.json | 2 +- 31 files changed, 85 insertions(+), 56 deletions(-) diff --git a/dist/index.esm.js b/dist/index.esm.js index a622a54..ea5cb8e 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 u(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 d=function(e,t){return d=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])},d(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}d(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=ue.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&&(ue.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))(de),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[B])}function _e(e){return Symbol.asyncIterator&&y(null==e?void 0:e[Symbol.asyncIterator])}function we(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 Re="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Oe(e){return y(null==e?void 0:e[Re])}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(u,d):l(i[0][2],e)}(r[e](t))}catch(e){l(i[0][3],e)}}function u(e){a("next",e)}function d(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[B]();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}))),!d&&c(null!=n?"number"==typeof n?n:+n-u.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 u=[],d=0,l=0,c=!1,p=function(){!c||u.length||d||t.complete()},h=function(e){return d=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(`${Bo}`),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,wn="function"==typeof atob,Rn="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},Bn=Rn?e=>btoa(e):On?e=>Buffer.from(e,"binary").toString("base64"):jn,xn=On?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let o=0,n=e.length;ot?Vn(xn(e)):xn(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=>xn(Dn.encode(e)):e=>Bn(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=wn?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:Bn,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 ur(e){return ar.encode(e,!0)}function dr(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}`:""}`}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 wr(e){return"object"==typeof e&&null!==e?e instanceof HTMLElement?_r(e):ArrayBuffer.isView(e)?Ar(e.buffer):Array.isArray(e)?e.map((e=>wr(e))):Object.keys(e).reduce(((t,o)=>({...t,[`${o}`]:wr(e[o])})),{}):e}const Rr=-3e3;let Or=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.MeetingHasClosed=103003]="MeetingHasClosed",e[e.UserHasBeenRemoved=103039]="UserHasBeenRemoved",e[e.MMRIBReject=103043]="MMRIBReject",e[e.MMRConfParticipantExists=103044]="MMRConfParticipantExists",e}({}),Tr=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}({}),Dr=function(e){return e[e.WaitingRoomFailover=1]="WaitingRoomFailover",e[e.WebEndAndRejoin=2]="WebEndAndRejoin",e}({}),Pr=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}({}),kr=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}({});kr.Success,kr.RegisterRequired,kr.LoginRequired,kr.SsoLoginWindow,kr.ZoomLoginWindow,kr.ZoomSpecificLoginWindow,kr.MissingEmail,kr.MeetingNotExist,kr.NotHost,kr.WrongPasscode,kr.RoleTypeMissing,kr.AnotherMeetingInProgress,kr.MeetingNotStarted,kr.InvalidParameter,kr.Reconnecting,kr.UserHasBeenRemoved,kr.WebinarEnforceLogin,kr.Disconnect,kr.DeniedRegisterWithPanelist,kr.RwcEmpty,kr.RwcError,kr.FrequentCall,kr.FrequentJoin,kr.WasmFail,kr.Upgrade;const Mr={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 Lr(e,t){let o={code:200,i18nKey:"apac.errorcodes_fail"};if(void 0!==Mr[e]){const t=Mr[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 Nr=["bLock","bHoldUponEntry","viewOnly","listenOnlyPhone","bAllowRaiseHand","bAllowAttendeeRename","bBroadcast","bAllowPlayChimeForEnterOrExit","bIbDisableShare","bIbDisableChat","encryptKey","bNoHostTimeOut","bAllowShowCount","bHasAST","bHasRMC","gatewayKey","encryptKey"],Vr={bChime:"bAllowPlayChimeForEnterOrExit",bHasAST:"hasAst",bHasRMC:"hasRmc",topic:e=>({meetingTopic:dr(e)}),gatewayKey:e=>{const[,t,o]=e.split(".");return t&&o?{gatewayUser:{userId:Number(t),sn:o}}:{}},encryptKey:e=>({gcmSessinKey:pr(e)})},Ur=so("GET_MEETING_INFO"),jr=so("GET_INSTANT_MEETING_INFO");so("LOGON_ZOOM_DOMAIN"),so("VERIFY_ZOOM_RECAPTCHA"),so("LOGON_THIRD_PARTY_DOMAIN");const Br=so("PING_RWC_SERVER"),xr=so("MEETING_FAILOVER"),Fr=so("LEAVE_MEETING"),Hr=so("LEAVE_WAITING_ROOM"),$r=so("END_MEETING");so("REGISTER_WEBINAR");const Wr=so("TRIGGER_IDLE_CHECK"),{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:ui,setMeetingStatus:di,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}=Ro({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(Nr.some((t=>e&&void 0!==e[t]))){let t=e;return Object.keys(Vr).some((t=>void 0!==e[t]))&&(t=Object.keys(e).reduce(((t,o)=>{const n=Vr[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 wi=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 Ri="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=ur("{}");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=ur(`zoom-storage-${e}`),this.localStorageKey=ur("zoom-local-storage"),this.memoryCache={};try{this.sessionCache=JSON.parse(dr(sessionStorage.getItem(this.sessionStorageKey)||Ni)),this.localCache=JSON.parse(dr(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,ur(JSON.stringify(this.sessionCache))):e===Li.LocalStorage&&localStorage.setItem(this.localStorageKey,ur(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}({}),Bi=function(e){return e.EnforceWebRTCAudio="ENFORCE_WEB_RTC_AUDIO",e}({});function xi(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)",xi(Hi,e)||xi(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/opr\/|opios/i],describe:e=>["Opera",xi(/(?:opr|opios)[\s/](\S+)/i,e)||xi(Hi,e)]},{test:[/SamsungBrowser/i],describe:e=>["Samsung Internet for Android",xi(Hi,e)||xi(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/micromessenger/i],describe:e=>["WeChat",xi(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||xi(Hi,e)]},{test:[/qqbrowser/i],describe:e=>[/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser",xi(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||xi(Hi,e)]},{test:[/msie|trident/i],describe:e=>["Internet Explorer",xi(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e)]},{test:[/\sedg\//i],describe:e=>["Microsoft Edge",xi(/\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",xi(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/electron/i],describe:e=>["Electron",xi(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/chromium/i],describe:e=>["Chromium",xi(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||xi(Hi,e)]},{test:[/chrome|crios|crmo/i],describe:e=>["Chrome",xi(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e)]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android Browser",xi(Hi,e)]},{test:[/safari|applewebkit/i],describe:e=>["Safari",xi(Hi,e)]}],Wi=[{test:[/windows /i],describe:e=>["Windows",xi(/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",xi(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,".")]},{test:[/(ipod|iphone|ipad)/i],describe:e=>["iOS",xi(/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",xi(/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(Bi.EnforceWebRTCAudio)}const qi=()=>zi.isIE,Ji=()=>{var e;return zi.isSupportOffscreenCanvas&&(null===(e=navigator)||void 0===e?void 0:e.hardwareConcurrency)>=4&&"function"==typeof requestAnimationFrame&&"function"==typeof SharedArrayBuffer},Qi=(e,t)=>{var o;const{isSafari:n,isIOSMobile:r,isSupportMediaStreamTrackProcessor:i,isAndroidOrIOSBrowser:s,isArmChromeOS:a,isChromeOS:u,isArm:d,isSupportOffscreenCanvas:l,isIPad:c}=zi;if(!Ji()){const o=n||r,s="function"!=typeof window.SharedArrayBuffer&&(!!o||i&&l);return e&&s?t?25:4:1}return s?t?25:c?9:4:a||u&&!d?navigator.hardwareConcurrency>=4?9:4:(null===(o=navigator)||void 0===o?void 0:o.hardwareConcurrency)<4?9: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 u,d;if(o)return Number(null===(u=n.match(/^\d+/))||void 0===u?void 0:u[0])>=15;if(t)return Number(null===(d=n.match(/^\d+/))||void 0===d?void 0:d[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 u=null;return u="BO_BROADCAST"===o.sessionType||"XMPP_CHAT"===o.sessionType?this.instance.gcmMainSessionKey:this.instance.gcmSessionKey,this.instance.beginCrypto(u,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:ur(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:u,tagLength:8*p.length},e,t.buffer)})).then((e=>({message:o.sessionType===ts.CHAT_FILE.sessionType?e:(new TextDecoder).decode(e),iv:i,aad:u}))).catch((e=>({message:"[This is an encrypted message]",iv:i,aad:u})))}{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,us=7937,ds=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},ws={userId:ys.Panelist,displayName:"All panelists"},Rs={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(){return{seq:this.sendMessageToRwg({evt:4103,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:ur(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];const{deviceId:i,...s}=n;return{seq:this.sendMessageToRwg({evt:16427,body:{DeviceID:i,op:e,SendUserID:o,AssignUserID:t,...s,bAutoDelete:r}})}}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="1505",Bs=(e,t)=>Us.reduce(((o,n)=>{const{name:r,alias:i}=n;return Object.assign(o,{[`${i}`]:`${e}/${t&&js?`${js}_`:""}${r}`}),o}),{});let xs=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=Bs(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,u;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===(u=a.isSupportCameraZoom)||void 0===u||!u.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:u,conId:d,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=u,this.confId=d;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,u,d);this.mediaSocketAddress=A,this.currentUserId=p;const C=Qi(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB);var _,w,R,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,d,u,C,m)),!E||h&&c||null===(w=this.instance)||void 0===w||w.initAudioEncode(this.mediaWorkersPath,A.audioSocketAddress,p,Kt,d,u,C,m));!0===(null===(i=this.constraints)||void 0===i?void 0:i.video)&&b&&(null===(R=this.instance)||void 0===R||R.initVideoDecode(this.mediaWorkersPath,A.videoSocketAddress,p,Kt,d,u,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,d,u,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,d,u,C),!I||h&&c||null===(M=this.instance)||void 0===M||M.initSharingEncode(this.mediaWorkersPath,A.sharingSocketAddress,p,Kt,d,u,C)):null===(L=this.instance)||void 0===L||L.initSharingDecode(A.sharingSocketAddress)),this.inProgress=!0}async destroy(){var e;this.callbackList=[],[xs.AudioDecode,xs.AudioEncode,xs.VideoDecode,xs.VideoEncode].forEach((e=>{var t;null===(t=this.instance)||void 0===t||t.updateQosSubscription(!1,e)})),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()}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 u=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,...u,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,u,d,l){var c;const p={userId:t,width:n,height:r,x:i,y:s,quality:a,isMyself:u,canvas:e,enableWaterMark:l,waterMarkText:d,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],u=arguments.length>8?arguments[8]:void 0;const d=(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:u,video:r,usingFacingMode:i,VideoSelectValue:"default"===t?null:t,disableOriginalRatio:a,...d})}stopCaptureVideo(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(4,{ssrc:0})}changeCamera(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(12,{VideoSelectValue:"default"===e?null:e,...t||{}})}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)try{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,u=arguments.length>7?arguments[7]:void 0;this.sharingCanvas=document.querySelector(`#${t}`);const d={};n&&Object.assign(d,{share2ndCamera:!0,share2ndCameraParams:{VideoSelectValue:"default"===n.cameraId?null:n.cameraId,width:n.width,height:n.height}}),void 0!==s&&Object.assign(d,{videoParams:{displaySurface:s}}),void 0!==u&&Object.assign(d,{otherParams:{...u}}),null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(30,{ssid:e,canvas:t,video:o,...d,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 u;null===(u=this.instance)||void 0===u||u.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,u){var d;null===(d=this.instance)||void 0===d||d.Notify_MeidaSDK(62,{canvas:e,maskdom:o,bgdom:t,dx:0,dy:0,dWidth:i,dHeight:s,width:a,height:u,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",ua="LIVE_TRANSCRIPTION_STATUS_CHANGE",da="LIVE_TRANSCRIPTION_HOST_DISABLE_CHANGE",la={"caption-message":[{event:sa,payload:e=>e}],"caption-status":[{event:aa,payload:e=>e}],"caption-enable":[{event:ua,payload:e=>e}],"caption-host-disable":[{event:da,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}({}),wa=function(e){return e[e.None=0]="None",e[e.Deny=1]="Deny",e[e.Allow=2]="Allow",e}({}),Ra=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.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}({}),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}({}),Ba=function(e){return e.Inherited="inherited",e.Active="active",e.PassiveByMuteOne="passive(mute one)",e.PassiveByMuteAll="passive(mute all)",e.SharingAudio="sharing audio",e}({}),xa=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}({}),eu=function(e){return e.PrivilegeChange="PrivilegeChange",e.StopScreenCapture="StopScreenCapture",e.ShareFromMainSession="ShareFromMainSession",e}({}),tu=function(e){return e[e.ImageNotMatch=2]="ImageNotMatch",e[e.CanvasNotMatch=3]="CanvasNotMatch",e[e.VBModelNotMatch=4]="VBModelNotMatch",e}({});const ou="blur";let nu=function(e){return e.User="user",e.Environment="environment",e.Left="left",e.Right="right",e}({});const ru=1e3,iu="__ZOOM_SDK_SHARING_VIDEO__",su="__ZOOM_SDK_VIDEO_ZONE__",au="__ZOOM_SDK_VIRTUAL_BACKGROUND_CANVAS_@__",uu="__ZOOM_SDK_VIRTUAL_BACKGROUND_IMAGE_@__",du="__ZOOM_SDK_MASK_CLIP_@__",lu="__ZOOM_SDK_MEDIA_PLAYBACK_SOURCE_VIDEO__",cu="__ZOOM_SDK_DYMMY_VIDEO_PLAYER_CANVAS_ID__",pu="__ZOOM_SDK_DUMMY_HIDDEN_SELF_VIEW_VIDEO_ID__",hu={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,rate:0,bandwidth:0}},mu={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 vu=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}({}),gu=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}({}),fu=function(e){return e[e.Pan=192]="Pan",e[e.Tilt=48]="Tilt",e[e.Zoom=12]="Zoom",e[e.Focus=3]="Focus",e}({}),yu=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}({}),Su=function(e){return e[e.None=0]="None",e[e.ApproveAnother=3]="ApproveAnother",e[e.Stop=5]="Stop",e}({}),bu=function(e){return e[e.Null=0]="Null",e[e.Normal=1]="Normal",e[e.VideoMode=2]="VideoMode",e}({}),Eu=function(e){return e[e.Null=0]="Null",e[e.VirtualBackground=1]="VirtualBackground",e[e.Mask=2]="Mask",e}({}),Iu=function(e){return e.Computer="computer",e.Phone="phone",e}({}),Au=function(e){return e[e.Decline=0]="Decline",e[e.Approve=1]="Approve",e[e.CacheClean=2]="CacheClean",e}({}),Cu=function(e){return e.Unknown="unknown",e.Uninstalled="uninstalled",e.Installed="installed",e}({}),_u=function(e){return e.Unlaunched="unlaunched",e.Launched="launched",e}({}),wu=function(e){return e.Started="started",e.Ended="ended",e}({}),Ru=function(e){return e[e.Max=30]="Max",e[e.Min=10]="Min",e[e.Default=24]="Default",e}({}),Ou=function(e){return e[e.Loading=1]="Loading",e[e.Done=2]="Done",e}({}),Tu=function(e){return e.Browser="Browser",e.Zoom="Zoom",e}({}),Du=function(e){return e.Denoise="backgroundNoiseSuppression",e.OriginalSound="originalSound",e}({}),Pu=function(e){return e[e.Undefined=0]="Undefined",e[e.WebGL=1]="WebGL",e[e.WebGPU=2]="WebGPU",e[e.WebGL2=3]="WebGL2",e}({}),ku=function(e){return e[e.H323=1]="H323",e[e.SIP=2]="SIP",e}({}),Mu=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 Lu="RECEIVE_VIDEO_ACTIVE_INDICATION",Nu="RECEIVE_VIDEO_MUTE_INDICATION",Vu="ASK_FOR_START_VIDEO_CONSENT",Uu="RECEIVE_VIDEO_DIMENSION_CHANGE",ju="CAPTURED_VIDEO_DIMENSION_CHANGE",Bu="CAN_NOT_DETECT_CAMERA",xu="CAN_NOT_FIND_CAMERA",Fu="VIDEO_USER_FORBIDDEN_CAPTURE",Hu="VIDEO_CAMERA_IS_TAKEN",$u="VIDEO_BACKGROUND_FAILED",Wu="VIDEO_ESTABLISH_STREAM_ERROR",Gu="VIDEO_CAPTURE_START_SUCCESS",zu="VIDEO_CAPTURE_STOP_RESULT",Ku="VIDEO_SPOTLIGHT_CHANGE",qu="VIDEO_FOLLOW_HOST_ORDER_CHANGE",Ju="VIDEO_HOST_DRAG_LAYOUT_CHANGE",Qu="VIDEO_NEW_USER_START",Zu="VIDEO_OLD_USER_STOP",Yu="VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",Xu="VIDEO_VIRTUAL_BACKGROUND_SETTING_SUCCESS",ed="VIDEO_STATISTIC_DATA",td="VIDEO_CELL_DETAILED_DATA",od="VIDEO_NETWORK_QUALITY_CHANGE",nd="VIDEO_FAR_END_CAMERA_CONTROL_REQUEST",rd="VIDEO_FAR_END_CAMERA_CONTROL_RESPONSE",id="VIDEO_FAR_END_CAMERA_IN_CONTROL_CHANGE",sd="VIDEO_FAR_END_CAMERA_CAPABILITY_CHANGE",ad="VIDEO_MASK_SETTING_SUCCESS",ud="VIDEO_CAPTURE_SDK_SUCCESS",dd="VIDEO_PREFETCH_VIDEO_FRAME_CALLBACK",ld="VIDEO_CURRENT_USER_SSRC",cd="VIDEO_RENDER_ASPECT_RATIO_CHANGE",pd={startCaptureVideo:{success:Gu,fail:[Bu,xu,Fu,Wu,Hu,$u]},switchCameraVideo:{success:ud,fail:[Bu,xu,Fu,Hu]},stopCaptureVideo:{success:zu}};let hd=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 md={[hd.VideoActiveChange]:[{event:Lu,payload:e=>({state:e.bVideoOn?Qa.Active:Qa.Inactive,userId:e.userId})}],[hd.VideoCapturingChange]:[{event:Gu,payload:()=>({state:Ya.Started})},{event:zu,payload:e=>({state:null!=e&&e.failed?Ya.Failed:Ya.Stopped})}],[hd.VideoMutedChange]:[{event:Nu,payload:e=>({state:e.isVideoMuted?Za.Muted:Za.Unmuted,userId:e.id})}],[hd.AskForStartVideoConsent]:[{event:Vu,payload:e=>({state:e.isVideoMuted?Za.Muted:Za.Unmuted,userId:e.id})}],[hd.VideoSpotlightChange]:[{event:Ku,payload:e=>({spotlightList:e.spotlightList&&e.spotlightList.map((e=>({userId:e})))})}],[hd.VideoDimensionChange]:[{event:Uu,payload:e=>({type:"received",width:e.width,height:e.height})},{event:ju,payload:e=>({type:"captured",width:e.width,height:e.height})}],[hd.VideoFollowHostOrder]:[{event:qu,payload:e=>({isFollowHostOrder:e.bOn})}],[hd.VideoHostLayoutChange]:[{event:Ju,payload:e=>Array.isArray(e.layout)?e.layout.map((e=>({userId:e}))):[]}],[hd.PeerVideoStateChange]:[{event:Qu,payload:e=>({action:"Start",...e})},{event:Zu,payload:e=>({action:"Stop",...e})}],[hd.VideoVBPreloadChange]:[{event:Yu,payload:e=>({isReady:e})}],[hd.VideoStatisticDataChange]:[{event:ed,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[hd.VideoDetailedDataChange]:[{event:td,payload:e=>e}],[hd.VideoAspectRatioChange]:[{event:cd,payload:e=>e}],[hd.NetworkQualityChange]:[{event:od,payload:e=>e}],[hd.FarEndCameraRequestControl]:[{event:nd,payload:e=>e}],[hd.FarEndCameraResponseControl]:[{event:rd,payload:e=>e}],[hd.FarEndCameraInControlChange]:[{event:id,payload:e=>e}],[hd.FarEndCameraCapabilityChange]:[{event:sd,payload:e=>e}]},vd="AUDIO_ACTIVE_SPEAKER",gd="AUDIO_UNMUTE_CONSENT",fd="AUDIO_CURRENT_USER_JOIN_BY_VOIP",yd="AUDIO_CURRENT_USER_JOIN_BY_PHONE",Sd="AUDIO_CURRENT_USER_LEAVE_AUDIO",bd="AUDIO_CURRENT_USER_MUTED",Ed="AUDIO_CURRENT_USER_UNMUTED",Id="AUDIO_PARTICIPANT_AUDIO_UPDATE",Ad="AUDIO_DIALOUT_RESULT_CODE",Cd="AUDIO_DIALOUT_RESULT_SUCCESS",_d="AUDIO_DIALOUT_RESULT_FAIL",wd="AUDIO_DIALOUT_CANCEL_SUCCESS",Rd="DIALOUT_CANCEL_FAIL",Od="AUDIO_MERGE_AUDIO_INDICATION",Td="USER_FORBIDDEN_MICROPHONE",Dd="ESTABLISH_AUDIO_STREAM_ERROR",Pd="AUDIO_AUTO_PLAY_FAILED",kd="INVALID_DEVICE_ID",Md="AUDIO_ALLOW_TALK_CHANGE",Ld="SHARE_AUDIO_STATE_CHANGE",Nd="AUDIO_STATISTIC_DATA",Vd="AUDIO_CURRENT_USER_SSRC",Ud="AUDIO_SET_SPEAKER_RESULT",jd="AUDIO_SHARE_SECONDARY_AUDIO_SUCCESS",Bd="AUDIO_CRC_CALL_OUT_RESULT_CODE",xd="AUDIO_CRC_CALL_OUT_RESULT_SUCCESS",Fd="AUDIO_CRC_CALL_OUT_RESULT_FAIL";let Hd=function(e){return e.ActiveSpeaker="active-speaker",e.UnmuteAudioConsent="unmute-audio-consent",e.CurrentAudioChange="current-audio-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 $d={JoinComputerAudio:{success:fd,fail:[Td,Dd]},LeaveComputerAudio:{success:Sd},JoinAudioByCallMe:{success:Cd,fail:[_d]},cancelDialOut:{success:wd,fail:[Rd]},hangup:{success:Sd},crcCallOut:{success:xd,fail:[Fd]}},Wd={[Hd.ActiveSpeaker]:[{event:vd,payload:e=>e}],[Hd.UnmuteAudioConsent]:[{event:gd,payload:e=>({reason:e})}],[Hd.CurrentAudioChange]:[{event:yd,payload:()=>({action:Ha.Join,type:Iu.Phone})},{event:fd,payload:()=>({action:Ha.Join,type:Iu.Computer})},{event:Sd,payload:e=>{let{source:t}=e;return{action:Ha.Leave,source:t}}},{event:bd,payload:e=>{let{source:t}=e;return{action:Ha.Muted,source:t}}},{event:Ed,payload:e=>{let{source:t}=e;return{action:Ha.Unmuted,source:t}}}],[Hd.DialoutStateChange]:[{event:Ad,payload:e=>e}],[Hd.MergeAudio]:[{event:Od,payload:e=>e}],[Hd.AutoPlayFailed]:[{event:Pd,payload:()=>{}}],[Hd.AllowTalkChange]:[{event:Md,payload:e=>({enabled:e})}],[Hd.ShareAudioChange]:[{event:Ld,payload:e=>e}],[Hd.AudioStatisticDataChange]:[{event:Nd,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[Hd.CrcCallOutStateChange]:[{event:Bd,payload:e=>e}]},Gd="SHARE_ACTIVE_INDICATION",zd="SHARE_CHECK_CHROME_SHARING_EXTENSION",Kd="SHARE_START_DESKTOP_SHARE_FAILED",qd="SHARE_DIMENSION_CHANGE",Jd="SHARE_RECEIVED_DIMENSION_CHANGE",Qd="SHARE_VIDEO_STREAMS_END",Zd="SHARE_PASSIVE_STOP_SHARE",Yd="SHARE_PASSIVE_BO_STOP",Xd="SHARE_NEW_USER_ADD",el="SHARE_USER_REMOVE",tl="SHARE_USER_PAUSED",ol="SHARE_USER_RESUMED",nl="SHARE_AUTO_CHANGE_SOURCE",rl="SHARE_REMOTE_CONTROL_APPROVE",il="SHARE_GRAB_REMOTE_CONTROL_CHANGE",sl="SHARE_REMOTE_CONTROL_CLIPBOARD_CHANGE",al="SHARE_REMOTE_CONTROL_SUCCESS",ul="SHARE_REMOTE_CONTROL_FAILED",dl="SHARE_PRIVILEGE_CHANGE",ll="SHARE_READ_RECEIPT",cl="SHARE_STATISTIC_DATA",pl="SHARE_REMOTE_CONTROL_REQUEST",hl="SHARE_REMOTE_CONTROL_APP_STATUS",ml="SHARE_REMOTE_CONTROL_SESSION_STATUS",vl="SHARE_REMOTE_CONTROL_APP_SCHEME";let gl=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 fl={[gl.ShareActiveChange]:[{event:Gd,payload:e=>{const{isActive:t,activeUserId:o,...n}=e;return{state:t?"Active":"Inactive",userId:o,...n}}}],[gl.ShareDimensionChange]:[{event:qd,payload:e=>({type:"sended",width:e.width,height:e.height})},{event:Jd,payload:e=>({type:"received",width:e.width,height:e.height})}],[gl.SharePassiveStop]:[{event:Qd,payload:()=>({reason:eu.StopScreenCapture})},{event:Zd,payload:()=>({reason:eu.PrivilegeChange})},{event:Yd,payload:()=>({reason:eu.ShareFromMainSession})}],[gl.SharePeerStateChange]:[{event:Xd,payload:e=>({userId:e.id,action:"Start"})},{event:el,payload:e=>({userId:e.id,action:"Stop"})},{event:tl,payload:e=>({userId:e.id,action:"Pause"})},{event:ol,payload:e=>({userId:e.id,action:"Resume"})}],[gl.ShareContentChange]:[{event:nl,payload:e=>e}],[gl.SharePrivilegeChange]:[{event:dl,payload:e=>({privilege:e})}],[gl.ShareReadReceipt]:[{event:ll,payload:()=>{}}],[gl.ShareStatisticDataChange]:[{event:cl,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[gl.RemoteControlApprovedChange]:[{event:rl,payload:e=>({state:e?Xa.Approved:Xa.Rejected})}],[gl.RemoteControlInControlChange]:[{event:il,payload:e=>({isControlling:e})}],[gl.RemoteControlClipboardChange]:[{event:sl,payload:e=>e}],[gl.RemoteControlRequestChange]:[{event:pl,payload:e=>e}],[gl.RemoteControlAppStatusChange]:[{event:hl,payload:e=>e}],[gl.RemoteControlControlledStatusChange]:[{event:ml,payload:e=>e}]};let yl=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}({}),Sl=function(e){return e.QaSettingChange="qa-setting-change",e.QaActionChange="qa-action-change",e}({});const bl={[Sl.QaSettingChange]:[{event:"QA_SETTING_OPTION_CHANGE",payload:e=>e}],[Sl.QaActionChange]:[{event:"QA_NEW_ASK_QUESTION",payload:e=>({action:yl.Question,data:e})},{event:"QA_UPDATE_ANONYMOUS_QUESTION",payload:e=>({action:yl.UpdateQuestion,data:e})},{event:"QA_ANSWER_QUESTION",payload:e=>({action:yl.Answer,data:e})},{event:"QA_ANSWER_REMOVE_COMMENT",payload:e=>({action:yl.DeleteComment,data:e})},{event:"QA_ANSWER_REMOVE_QUESTION",payload:e=>({action:yl.DeleteQuestion,data:e})},{event:"QA_ANSWER_DISMISS_QUESTION",payload:e=>({action:yl.Dismiss,data:e})},{event:"QA_ANSWER_REOPEN_QUESTION",payload:e=>({action:yl.Reopen,data:e})},{event:"QA_ANSWER_VOTE_QUESTION",payload:e=>({action:yl.Upvote,data:e})},{event:"QA_ANSWER_QUESTION_LIVE",payload:e=>({action:yl.AnswerLive,data:e})}]},El="INVALID_OPERATION",Il="INTERNAL_ERROR",Al="OPERATION_TIMEOUT",Cl="INSUFFICIENT_PRIVILEGES",_l="IMPROPER_MEETING_STATE",wl="INVALID_PARAMETERS",Rl="AUDIO_ENCODE_SUCCESS",Ol="AUDIO_DECODE_SUCCESS",Tl="VIDEO_ENCODE_SUCCESS",Dl="VIDEO_DECODE_SUCCESS",Pl="SHARING_ENCODE_SUCCESS",kl="SHARING_DECODE_SUCCESS",Ml="AUDIO_ENCODE_FAIL",Ll="AUDIO_DECODE_FAIL",Nl="VIDEO_ENCODE_FAIL",Vl="VIDEO_DECODE_FAIL",Ul="SHARING_ENCODE_FAIL",jl="SHARING_DECODE_FAIL",Bl="MEDIA_DEVICE_CHANGE",xl="MEDIS_SDK_PATHCH_LOADED",Fl="AUDIO_BRIDGE_PEER_CONNECTION_RECEIVE_READY",Hl="AUDIO_BRIDGE_PEER_CONNECTION_SEND_READY",$l="DEVICE_PERMISSION_CHANGE";let Wl=function(e){return e.DeviceChange="device-change",e.MediaSDKChange="media-sdk-change",e.DevicePermissionChange="device-permission-change",e}({});const Gl={[Wl.DeviceChange]:[{event:Bl,payload:()=>({})}],[Wl.MediaSDKChange]:[{event:Rl,payload:()=>({type:"audio",action:"encode",result:"success"})},{event:Ml,payload:()=>({type:"audio",action:"encode",result:"fail"})},{event:Ol,payload:()=>({type:"audio",action:"decode",result:"success"})},{event:Ll,payload:()=>({type:"audio",action:"decode",result:"fail"})},{event:Tl,payload:()=>({type:"video",action:"encode",result:"success"})},{event:Nl,payload:()=>({type:"video",action:"encode",result:"fail"})},{event:Dl,payload:()=>({type:"video",action:"decode",result:"success"})},{event:Vl,payload:()=>({type:"video",action:"decode",result:"fail"})},{event:Pl,payload:()=>({type:"share",action:"encode",result:"success"})},{event:Ul,payload:()=>({type:"share",action:"encode",result:"fail"})},{event:kl,payload:()=>({type:"share",action:"decode",result:"success"})},{event:jl,payload:()=>({type:"share",action:"decode",result:"fail"})}],[Wl.DevicePermissionChange]:[{event:$l,payload:e=>e}]},zl="BREAKOUT_ROOM_ADD_TOKEN",Kl="BREAKOUT_ROOM_INVITE_TO_JOIN_NOTIFICATION",ql="BREAKOUT_ROOM_ROOM_CLOSING_COUNTDOWN",Jl="BREAKOUT_ROOM_ROOM_COUTDOWN",Ql="BREAKOUT_ROOM_BROADCAST_MESSAGE",Zl="BREAKOUT_ROOM_ASK_HELP_REQUEST",Yl="BREAKOUT_ROOM_ASK_HELP_RESPONSE",Xl="BREAKOUT_ROOM_ATTRIBUTE_INDICATION",ec="BREAKOUT_ROOM_JOIN_BO_RESPONSE",tc="BREAKOUT_ROOM_ROOM_COUNTDOWN_TIME_UP",oc="BREAKOUT_ROOM_CURRENT_USER_PARTICIPANT_ROLE",nc="BREAKOUT_ROOM_LOAD_PRE_ASSIGNED_ROOMS",rc="BREAKOUT_ROOM_MAIN_SESSION_USER_UPDATE",ic="BREAKOUT_ROOM_INVITE_TO_BACK_NOTIFICATION",sc="BREAKOUT_ROOM_IN_ROOM_USER_STATUS_UPDATE",ac="BREAKOUT_ROOM_BROADCAST_VOICE";let uc=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 dc={[uc.InviteToJoin]:[{event:Kl,payload:e=>e}],[uc.RoomCountdown]:[{event:Jl,payload:e=>e}],[uc.RoomTimeUp]:[{event:tc,payload:e=>e}],[uc.ClosingRoomCountdown]:[{event:ql,payload:e=>e}],[uc.BroadcastMessage]:[{event:Ql,payload:e=>e}],[uc.AskForHelp]:[{event:Zl,payload:e=>e}],[uc.AskForHelpResponse]:[{event:Yl,payload:e=>e}],[uc.RoomStateChange]:[{event:Xl,payload:e=>({status:e.controlStatus})}],[uc.MainSessionUserUpdate]:[{event:rc,payload:()=>({})}],[uc.InviteToBack]:[{event:ic,payload:e=>e}],[uc.RoomUserUpdate]:[{event:sc,payload:e=>e}],[uc.BroadcastVoice]:[{event:ac,payload:e=>e}]};var lc=function(e){return e.StatusUpdate="archiving-status-update",e.OptionsUpdate="archiving-options-update",e}(lc||{});const cc={[lc.StatusUpdate]:[{event:"ARCHIVING_STATUS_UPDATE",payload:e=>e}],[lc.OptionsUpdate]:[{event:"ARCHIVING_OPTIONS_UPDATE",payload:e=>e}]};let pc=function(e){return e.PollDataChange="poll-data-change",e.PollSizeUpdate="poll-size-update",e.PollStatusUpdate="poll-status-update",e}({});const hc={[pc.PollDataChange]:[{event:"POLL_DATA_CHANGE",payload:e=>e}],[pc.PollSizeUpdate]:[{event:"POLL_SIZE_UPDATE",payload:e=>e}],[pc.PollStatusUpdate]:[{event:"POLL_STATUS_UPDATE",payload:e=>e}]};let mc=function(e){return e.ReactionReceived="reaction-received",e.ReactionRemoved="reaction-removed",e}({});const vc={[mc.ReactionReceived]:[{event:"REACTION_RECEIVED",payload:e=>e}],[mc.ReactionRemoved]:[{event:"REACTION_REMOVED",payload:e=>e}]},gc="SMART_SUMMARY_STATUS_CHANGE",fc="MEETING_QUERY_STATUS_CHANGE";let yc=function(e){return e.SummaryChange="summary-status-change",e.MeetingQueryChang="meeting-query-status-change",e}({});const Sc={[yc.SummaryChange]:[{event:gc,payload:e=>e}],[yc.MeetingQueryChang]:[{event:fc,payload:e=>e}]},bc="LIVE_STREAM_STATUS_CHANGE",Ec={"live-stream-status":[{event:bc,payload:e=>e}]},Ic={...ia,...la,...ya,...Ia,...Na,...Wd,...md,...bl,...fl,...Gl,...dc,...cc,"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}],...hc,...vc,...Sc,...Ec},Ac=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)}))}}}(),Cc=new Map,_c=new Array,wc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;Ac.emit(e,t)},Rc=e=>new Promise(((t,o)=>{e.fail&&e.fail.length>0?vt(st(Ac,e.success).pipe(ft(1)),ct(...e.fail.map((e=>st(Ac,e).pipe(ft(1),Xe((t=>Be({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(Ac,e.success).pipe(ft(1)).subscribe((e=>t(e)))})),Oc=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(Ac,e).pipe(ft(1)):(i=st(Ac,e.event),e.operations&&(i=e.operations.reduce(((e,t)=>e.pipe(t)),i))),vt(i,dt(o).pipe(Et(Be("timeout")))).subscribe((e=>{if(t){const o=t(e);"boolean"==typeof o?o?n(""):r({type:Il}):0===o.ret?n(o.body):r({type:Il,reason:o.body})}else n(e)}),(()=>{r({type:Al})}))}))},Tc=(e,t)=>void 0!==t?st(Ac,e).pipe(ft(t)):st(Ac,e),Dc=()=>{_c.forEach((e=>{e.unsubscribe()})),_c.length=0,Cc.clear()},{setAttendeesList:Pc,setAssistantList:kc,setIsAdmitAllSilentUsers:Mc,resetParticipants:Lc,addFailoverAttendees:Nc,removeFailoverAttendees:Vc,setClearRaiseHand:Uc,setClearAttendeeFeedback:jc,updateAttendeeDisplayName:Bc,removeXmppAttendeeUser:xc,updateXmppAttendeeList:Fc,setAttendeeExtraKey:Hc}=Ro({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 $c="NOT_FOUND",Wc=function(e,t){return e===t};function Gc(e,t){var o,n,r="object"==typeof t?t:{equalityCheck:t},i=r.equalityCheck,s=void 0===i?Wc:i,a=r.maxSize,u=void 0===a?1:a,d=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 $c}return{get:n,put:function(t,r){n(t)===$c&&(o.unshift({key:t,value:r}),o.length>e&&o.pop())},getEntries:function(){return o},clear:function(){o=[]}}}(u,l);function p(){var t=c.get(arguments);if(t===$c){if(t=e.apply(null,arguments),d){var o=c.getEntries().find((function(e){return d(e.value,t)}));o&&(t=o.value)}c.put(arguments,t)}return t}return p.clearCache=function(){return c.clear()},p}function zc(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n{let{participants:{attendeesList:t}}=e;return t},Jc=e=>{let{meeting:{userId:t}}=e;return t},Qc=e=>{let{participants:{xmppAttendeeList:t}}=e;return t};let Zc=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}({}),Yc=function(e){return e[e.Host=10]="Host",e[e.Panelist=20]="Panelist",e[e.Attendee=30]="Attendee",e}({}),Xc=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 ep=e=>(e&Zc.Host)===Zc.Host,tp=e=>(e&Xc.Phone)===Xc.Phone,op=e=>e===Zc.ViewOnlyCanTalk,np=e=>(e&Zc.ViewOnly)===Zc.ViewOnly;let rp=function(e){return e[e.Automatically=1]="Automatically",e[e.Manually=2]="Manually",e[e.SelfSelect=3]="SelfSelect",e}({}),ip=function(e){return e[e.NotStarted=1]="NotStarted",e[e.InProgress=2]="InProgress",e[e.Closing=3]="Closing",e[e.Closed=4]="Closed",e}({}),sp=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}({}),ap=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}({}),up=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}({}),dp=function(e){return e[e.Received=0]="Received",e[e.Busy=1]="Busy",e[e.Ignore=2]="Ignore",e[e.AlreadyInRoom=3]="AlreadyInRoom",e}({}),lp=function(e){return e[e.AskToLeave=0]="AskToLeave",e[e.ClosingRoom=1]="ClosingRoom",e}({}),cp=function(e){return e[e.Active=0]="Active",e[e.Ask=1]="Ask",e}({}),pp=function(e){return e[e.Connect=1]="Connect",e[e.Muted=2]="Muted",e[e.Voip=4]="Voip",e}({}),hp=function(e){return e[e.Connect=8]="Connect",e[e.On=16]="On",e}({}),mp=function(e){return e[e.Share=32]="Share",e[e.ShareAudio=64]="ShareAudio",e}({});const vp=Kc([Jc,qc],((e,t)=>t.find((t=>t.userId===e)))),gp=Kc([vp],(e=>(null==e?void 0:e.isHost)||(null==e?void 0:e.bCoHost))),fp=Kc([vp],(e=>null==e?void 0:e.isHost)),yp=Kc([Qc],(e=>e.filter((e=>e.userRole===Yc.Attendee)))),Sp=Kc([qc],(e=>e.filter((e=>e.bHold&&!e.bid)))),bp=Kc([qc,e=>{let{breakoutRoom:t}=e;return t&&t.controlStatus},e=>{let{breakoutRoom:t}=e;return t&&t.currentRoom.status}],((e,t,o)=>t!==ip.InProgress&&t!==ip.Closing||o!==ap.InRoom?e.filter((e=>!e.bHold&&!e.bid)):e.filter((e=>!e.bHold)))),Ep=Kc([e=>{let{participants:{assistantList:t}}=e;return t}],(e=>e)),Ip=Kc([bp],(e=>e.find((e=>e.isHost)))),Ap=Kc([bp],(e=>e.filter((e=>e.bCoHost)))),Cp=Kc([vp,bp],((e,t)=>t.filter((t=>t.userId!==(null==e?void 0:e.userId)))));Kc([Qc],(e=>e.reduce(((e,t)=>{const{jid:o}=t;return Object.assign(e,{[o]:t}),e}),{}))),Kc([Qc,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 _p=Kc([qc],(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>(null==e?void 0:e.bLocalRecord)===_a.Start))}));let wp=function(e){return e.Closed="closed",e.Connecting="connecting",e.Connected="connected",e}({});function Rp(e){return 1<e,SET_ARCHIVING_SESSION_READY:e=>e,SET_ARCHIVING_OPTIONS:e=>e,RESET_ARCHIVING:()=>{}}),{setIsLiveTranscriptionEnabled:Ng,setLiveTranscriptionMeetingOptions:Vg,setIsLiveTranscriptionManualCaptionerEnabled:Ug,setLiveTranscriptionGatewayId:jg,setLiveTranscriptionSupportedLanguage:Bg,setIsLiveTranscriptionSubscribed:xg,setCurrentTranscriptionLang:Fg,setCurrentTranslationLang:Hg,addLiveTranscriptionMessage:$g,updateLiveTranscriptionMessage:Wg,reduceLiveTranscriptionMessages:Gg,setLiveTranscriptionEngineType:zg,removeLiveTranscriptionFailoverState:Kg,setLiveTranscriptionLastCaptionMessage:qg,resetLiveTranscription:Jg,setIsHostDisableCaptions:Qg}=Ro("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:Zg,setPollingId:Yg,setPollingWebLinks:Xg,setPollingDocMaxSize:ef,setPollingDocSize:tf,setPollingDocLibraryMaxSize:of,setPollingDocLibrarySize:nf,resetPoll:rf}=Ro("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:sf,setIsLaplaceInitialized:af,resetLogger:uf}=Ro("SET_LOGGER_INIT_OPTIONS","SET_IS_LAPLACE_INITIALIZED","RESET_LOGGER"),{setIsLiveStreamEnable:df,setLiveStreamStatus:lf,resetLiveStream:cf}=Ro("SET_IS_LIVE_STREAM_ENABLE","SET_LIVE_STREAM_STATUS","RESET_LIVE_STREAM");var pf={exports:{}},hf={};!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 R(){}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 R,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}R.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 R,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,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}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 R,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=w((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,u=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(u?u(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){u(e)===u(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,u=void 0===a?{}:a,d=o.method,l=void 0===d?"POST":d,c=o.encoding,p=o.integrity;this.controller=this.supportFetch()?new AbortController:new XMLHttpRequest;var h=this.supportFetch()?w((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(u),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=w((function(e){t.finished||t.emit("progressUpdated",e)}))))},r.onerror=function(){n(new Error("xhr download "+s+" failed!"))},r.send(JSON.stringify(u))}))).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 B,x=new O,F="ThreadPoolReady",H=function(){j-=1,x.emit(F)};(B=e.DownloaderType||(e.DownloaderType={})).XHR="xhr",B.DOM="dom",B.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");x.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=u,e.getExtName=f,e.getFileName=S,e.getFullPathName=y,e.isImgFile=b,e.isJsonFile=E,e.isVersionFile=I,e.monitorProgress=w,e.sep=a,e.stringToArrayBuffer=g,e.stringToBlob=v,e.transformData=_,Object.defineProperty(e,"__esModule",{value:!0})}(hf,Qt(Object.freeze({__proto__:null,default:{}}))),Jt(hf),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&&u.length>r){u.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=u.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(d)}}else u=s[t]=o,++e._eventsCount;return e}function d(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,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}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,u=s.forceDownload,d=s.saveRootPath;u?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(d,r),sourceURL:n.genSourceURL(a),data:t,fileFormat:i||n.getFileFormat(a),version:(null==o?void 0:o.targetVersion)||1}})):{path:n.genFilePath(d,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 u=s.find((function(t){return t.path===e}));t(u||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,u=i.body;return u&&Object.keys(u).length?a+(a.includes("?")?"&":"?")+"downloadBodyParams="+JSON.stringify(u):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})}(pf.exports,hf),Jt(pf.exports);class mf{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 vf(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 gf(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 ff(e){if(e){var t;const o=document.getElementById(e);null==o||null===(t=o.parentNode)||void 0===t||t.removeChild(o)}}let yf="zoom.us";const Sf="3.6.0",bf=`https://dmogdx0jrul3u.cloudfront.net/${Sf}/lib/av`,Ef=`https://source.zoom.us/${Sf}/lib/av`,If=`https://jssdk.zoomus.cn/${Sf}/lib/av`,Af=(e,t,o)=>ot([t,o].map(((t,o)=>{if("initial"!==t)return Ue(["success"===t]);{const t=0===o?"ENCODE":"DECODE";return vt(Tc(`${e.toUpperCase()}_${t}_SUCCESS`,1).pipe(ze((()=>!0))),Tc(`${e.toUpperCase()}_${t}_FAIL`,1).pipe(ze((()=>!1))))}}))),Cf=e=>{const t=vp(e.value);return t?je(t):Tc($s,1).pipe(Le(pe),Tt(e),ze((e=>{let[,t]=e;return vp(t)})))};function _f(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?Vd:ld;return"audio"===e&&Ki()||r?Promise.resolve():Oc(i)}const wf=()=>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 Rf(e){const{x:t,y:o,width:n,height:r}=e.getBoundingClientRect();return{scaleWidth:n,scaleHeight:r,srcOffsetX:t,srcOffsetY:o}}function Of(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 Tf(){try{return"undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(Ga)}catch(e){return!1}}function Df(){var e;return null===(e=WebAssembly)||void 0===e?void 0:e.validate(za)}const Pf=(()=>{const e=new mf;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 kf(e){const t=["joinComputerAudio","joinSharingAudio","leaveComputerAudio","leaveSharingAudio"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return Pf.withAudioAction(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}function Mf(e){var t;const{browserVersion:o,isChrome:n,isFirefox:r,isAndroidBrowser:i,isSupportMediaStreamTrackProcessor:s,isSupportOffscreenCanvas:a}=zi,u=Number(null==o||null===(t=o.match(/^\d+/))||void 0===t?void 0:t[0]),d=n&&u>=91,l=r&&u>=89,c=navigator.hardwareConcurrency>2;let p=Ji();return e&&!p&&(p=a&&s),!i&&p&&(d||l)&&c}const Lf=(e,t)=>{const o=document.createElement("link");return o.rel="preload",o.href=e,o.as=t,o.crossOrigin="anonymous",o},Nf=(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 Vf(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 Mf(o)&&Object.assign(n,{resourceManager:pf.exports.IResourceManager,file:[{path:`${e}/vb-resource/dualModel.bin`,type:"bin"},{path:`${e}/vb-resource/tf.min.js`,type:"js"}]}),n}function Uf(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]):Tc(Fl,1).pipe(yt(!0)),n||i?Ue([!0]):Tc(Hl,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 Bf(e){return e.find((e=>"default"===e.deviceId))}const xf=(()=>{let e,t=!1;return{watch:function(o){t=!0,e=o,Promise.race([e,yr((()=>!0),1e4)]).then((()=>{e=void 0,t=!1})).finally((()=>{e=void 0,t=!1}))},acquire:function(){return t&&e?e:Promise.resolve()}}})(),Ff=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=vp(e))||void 0===a?void 0:a.audio)===Iu.Computer&&t.leaveComputerAudio(),t.disconnect(),xf.watch(t.destroy()),e.video&&(e.video.subscribedVideoList.length>0&&e.video.subscribedVideoList.forEach((e=>{o.unsubscribeVideo(e)})),e.video.isCurrentUserStartedVideo&&wc(zu)),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)}}if(t||(Vi.clearSession(),[Ui.WebclientTk,Ui.WebclientZsk,Ui.WebclientZtk,Ui.WebclientRecordingToken].forEach((e=>{sessionStorage.removeItem(e)})),is.destroy()),o!==wp.Closed&&s.push(No()),n!==wp.Closed&&s.push(Vo()),r!==wp.Closed&&s.push(Fo()),t){const o=vp(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(),Lc(),Wp(t),nm(),vm(t),mv(),yv(),wg(),Wv(),ng(),Dg(),Lg(),Jg(t),rf(),uf(t),cf(t),di(Di.Closed)),s},Hf=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;nt.find((t=>t.userId===e)))),mt((e=>!!e)),ft(1)]},...o)},$f={[`${Pi.AudioBridgeEnable}`]:{mask:240,action:gi},[`${Pi.AudioDecodeInWorklet}`]:{mask:15,action:sn},[`${Pi.VideoFullHD}`]:{mask:15,action:Zm},[`${Pi.VideoShareFullHD}`]:{mask:15,action:om},[`${Pi.WebGL2Render}`]:{mask:15,action:ev},[`${Pi.WebGPURender}`]:{mask:15,action:tv},[`${Pi.ZMKFromRWG}`]:{mask:15,action:_i}};function Wf(e){return F(ze(((t,o)=>e(t,o))),mt((e=>null!=e)))}function Gf(e){return F(Xe(((t,o)=>e(t,o)||fe)))}function zf(e){return F(Xe(((t,o)=>e(t,o))),Xe((e=>Array.isArray(e)?Ue(e):je(e))))}const Kf={period:500,rules:[{peak:50,throttle:300},{peak:60,throttle:400}]},qf={[`${us}`]:()=>({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 Jf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kf;return t=>new $((o=>{const n=new Map;let r=0,i=null;const{period:s,rules:a}=e;let u=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 d=Object.keys(qf),l=t.subscribe({next(e){if(e&&e.evt&&null!==i){r+=1;const{evt:t,body:i}=e,s=String(t);if(d.indexOf(s)>=0)if(u){const e=n.get(s);if(e)e.onThrottle(i);else{const e=qf[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=qf[s]();e.onThrottle(i),n.set(s,e),u=setTimeout((()=>{n.forEach(((e,t)=>{const n={evt:Number(t),body:e.payloads};o.next(n)})),n.clear(),u=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 Qf=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 Zf=262144,Yf=1048576,Xf=e=>(e&Yf)===Yf,ey=e=>{let{share:{isReceiveSharing:t}}=e;return t},ty=e=>{let{share:{activeNodeId:t}}=e;return t},oy=Kc([bp,ey,ty],(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=Qf.Mac:"win"===o&&(e=Qf.Windows),{...t,os:e}}}return null})),ny=Kc([bp],(e=>e.filter((e=>e.sharerOn)))),ry=Kc([ny],(e=>e.some((e=>!!e.bVideoShare)))),iy=Kc([e=>{let{share:{remoteControlledUserList:t}}=e;return t},ey,ty],((e,t,o)=>!!t&&e.some((e=>fr(e,o)))));var sy,ay=new Uint8Array(16);function uy(){if(!sy&&!(sy="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 sy(ay)}for(var dy,ly,cy,py,hy=/^(?:[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,my=[],vy=0;vy<256;++vy)my.push((vy+256).toString(16).substr(1));function gy(e,t,o){var n=(e=e||{}).random||(e.rng||uy)();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=(my[e[t+0]]+my[e[t+1]]+my[e[t+2]]+my[e[t+3]]+"-"+my[e[t+4]]+my[e[t+5]]+"-"+my[e[t+6]]+my[e[t+7]]+"-"+my[e[t+8]]+my[e[t+9]]+"-"+my[e[t+10]]+my[e[t+11]]+my[e[t+12]]+my[e[t+13]]+my[e[t+14]]+my[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&hy.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"}(dy||(dy={})),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"}(ly||(ly={})),function(e){e[e.PROTECT_LOCAL_KEY=0]="PROTECT_LOCAL_KEY"}(cy||(cy={})),function(e){e.beforeInit="beforeInit",e.afterInit="afterInit",e.beforeLog="beforeLog",e.hitSizeLimit="hitSizeLimit",e.afterLog="afterLog",e.beforeReport="beforeReport",e.afterReport="afterReport"}(py||(py={}));class fy{constructor(){}}var yy,Sy={exports:{}},by={exports:{}},Ey=Qt(Object.freeze({__proto__:null,default:{}}));by.exports=(yy=yy||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=Ey}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)}},u=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 u.init(o,t/2)}},c=d.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 u.init(o,t)}},p=d.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 u.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),d=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*d,i);if(d){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 u=n.charAt(64);if(u)for(;r.length%4;)r.push(u);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=Iy.exports.parse(e);return Sy.exports.stringify(t)}catch(t){return e}},_y=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},wy=()=>Ay(void 0,void 0,void 0,(function*(){return yield self.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"])})),Ry=(e,t,o)=>Ay(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}})),Oy=(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{Ty[t]=e},Py=Ty,ky=e=>{try{return JSON.stringify(e)}catch(e){return"json stringify failed"}},My=e=>{try{return JSON.parse(e)}catch(t){return e}};const Ly=e=>{let t=0;return t+=_y(e.message),e.tags.forEach((e=>{t+=_y(e)})),t};class Ny{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:u,externalKeys:d,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!=u?u:0,this.externalKeys=d,this.commonMethods=Object.assign({},Py)}getLocalAESGCM256Key(){var e;return function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(this.localAESGCM256Key)return this.localAESGCM256Key;this.localAESGCM256Key=yield wy();const t=this.externalKeys?null===(e=this.externalKeys.filter((e=>e.usage===cy.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+=Ly(n);else o+=Ly(e);return this.currentSize=o,o>=this.maxSize}}const Vy=(...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},Uy=(e,t)=>{const o=new Map;return t.forEach((t=>{e(t)&&o.set(t.id,t)})),o};class jy{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{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((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 Vy(...t.map((t=>e.byTag[t])).filter((e=>Boolean(e))))}else{if("function"==typeof t)return Uy(t,e.byTime);if("object"==typeof t)if(t.tags&&t.filter){if("string"==typeof t.tags)return Uy(t.filter,e.byTag[t.tags]);if(Array.isArray(t.tags)&&t.tags.every((e=>"string"==typeof e)))return Vy(...t.tags.map((o=>{const n=e.byTag[o];return n?Uy(t.filter,n):new Map})))}else{if(t.filter)return Uy(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 Vy(...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:My(Cy(n.message))});o.set(e,t)}return o},this.store={byTag:{},byTime:new Map}}}function By(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 xy=(e,t,o,n,r,i={})=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){const{noCache:s,extraProperties:a={}}=i,u=((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),d=By(e,py.beforeLog,u);if(s)By(e,py.afterLog,u);else{const{idbManager:t,logManager:o}=e,n=yield t.makeNextId();d.message=(e=>{try{const t=Sy.exports.parse(e);return Iy.exports.stringify(t)}catch(t){return e}})(d.message);const r=Object.assign(Object.assign({},d),{id:n});e.updateCurrentSize(r)&&By(e,py.hitSizeLimit,r),o.addLog(r),yield t.addLog(r),By(e,py.afterLog,r)}}));Dy(xy,"commonLog");const Fy=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 Hy=(e,t=2)=>{let o=`${e}`;for(;o.length{const t=new Date(e);return`${t.getUTCFullYear()}-${Hy(t.getUTCMonth()+1)}-${Hy(t.getUTCDate())} ${Hy(t.getUTCHours())}:${Hy(t.getUTCMinutes())}:${Hy(t.getUTCSeconds())}.${Hy(t.getUTCMilliseconds(),3)}`},Wy={version:"000001",flag:"0"},Gy=(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,u=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:Wy}))),zy=(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(Fy)))(e,t.reportUrl,o).then((e=>{e.forEach((e=>{var o;By(t,py.afterReport,{report:e.report,error:null!==(o=e.error)&&void 0!==o?o:null})}))})),Ky=(e,t,o)=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((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=By(e,py.beforeReport,n),a=Gy(s,i);zy(a,e,r)}));Dy(Ky,"commonReport");var qy=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const Jy=(e,t,o)=>qy(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)})),Qy=e=>qy(void 0,void 0,void 0,(function*(){const{idbManager:t,logManager:o}=e;yield t.reset(),o.reset()}));function Zy(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]:tS())("readwrite",(function(t){return e.forEach((function(e){return t.delete(e)})),Yy(t.transaction)}))}function nS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tS();return e("readonly",(function(t){if(t.getAll&&t.getAllKeys)return Promise.all([Yy(t.getAllKeys()),Yy(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 Zy(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)?Zy(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())},Yy(e.transaction)}(e).then((function(){return o}))}))}))}Dy(Jy,"commonDelete"),Dy(Qy,"commonReset");var rS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const iS={default:{queue:[],isRunning:!1,listeners:[]}},sS=e=>{let t=iS[e];return t||(t={queue:[],isRunning:!1,listeners:[]},iS[e]=t),t};function aS(e){return rS(this,void 0,void 0,(function*(){const t=sS(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,aS(e)}n.length&&n.forEach((e=>{e()}))}))}function uS(e,t){const o=sS(t);try{return new Promise(((n,r)=>{o.queue.push({task:e,resolution:n,rejection:r}),aS(t)}))}catch(e){return Promise.reject(e)}}const dS=(e,t)=>{sS(e).listeners.push(t)};var lS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const cS="change_meta",pS="change_log",hS=()=>Promise.resolve();class mS{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]:tS())("readonly",(function(t){return Yy(t.get(e))}))}(e,this.store),this.set=(e,t)=>lS(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]:tS())("readwrite",(function(o){return o.put(t,e),Yy(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=()=>lS(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 oS(o,this.store)})),this.adjustMaxId=()=>lS(this,void 0,void 0,(function*(){return this.resetting?hS():(this.isChangingMeta=!0,yield uS((()=>lS(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}))),cS))})),this.makeNextId=()=>lS(this,void 0,void 0,(function*(){return this.resetting?hS():(this.isChangingMeta=!0,yield uS((()=>lS(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}))),cS))})),this.addLog=e=>lS(this,void 0,void 0,(function*(){if(this.resetting)return hS();this.isChangingLog=!0,yield uS((()=>lS(this,void 0,void 0,(function*(){const{id:t}=e;return this.set(`${t}`,e)}))),pS)})),this.getAllLogs=()=>lS(this,void 0,void 0,(function*(){return(yield nS(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=>lS(this,void 0,void 0,(function*(){if(this.resetting)return hS();this.isChangingLog=!0,yield uS((()=>lS(this,void 0,void 0,(function*(){return oS(e.map((e=>`${e}`)),this.store)}))),pS),yield this.adjustMaxId()})),this.saveAESGCM256Key=(e,t,o)=>lS(this,void 0,void 0,(function*(){if(o){const n=yield self.crypto.subtle.exportKey("raw",t),r=yield((e,t,o)=>Ay(void 0,void 0,void 0,(function*(){return new Promise(((n,r)=>{requestAnimationFrame((()=>Ay(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=Oy:"AES-GCM"===i&&(s=Ry),!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=()=>lS(this,void 0,void 0,(function*(){return this.resetting?hS():(this.waitingForReset=!0,this.isChangingLog||this.isChangingMeta?hS():(this.resetting=!0,yield function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:tS())("readwrite",(function(e){return e.clear(),Yy(e.transaction)}))}(this.store),this.resetting=!1,void(this.waitingForReset=!1)))})),this.store=Xy(e,e+"-store"),dS(cS,(()=>{if(this.isChangingMeta=!1,this.waitingForReset)return this.reset()})),dS(pS,(()=>{if(this.isChangingLog=!1,this.waitingForReset)return this.reset()}))}}var vS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const gS={databaseName:"laplace-default-db",maxSize:49283072};class fS{constructor(e){this.commonLogWithContext=(e,t,o,n,r)=>vS(this,void 0,void 0,(function*(){yield xy(this.runtimeMetaManager,e,t,o,n,r)})),this.commonReportWithContext=(e,t)=>vS(this,void 0,void 0,(function*(){yield Ky(this.runtimeMetaManager,e,t)})),this.commonDeleteWithContext=e=>vS(this,void 0,void 0,(function*(){yield Jy(this.runtimeMetaManager,e)})),this.resetWithContext=()=>vS(this,void 0,void 0,(function*(){yield Qy(this.runtimeMetaManager)})),this.initLocalAESGCM256Key=()=>vS(this,void 0,void 0,(function*(){return yield wy()})),this.doNotUseDirtyGetStore=()=>this.runtimeMetaManager.logManager.getStore(),this.log=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.log,dy.PLAIN,{extraProperties:o})})),this.info=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.info,dy.PLAIN,{extraProperties:o})})),this.warn=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.warn,dy.PLAIN,{extraProperties:o})})),this.debug=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.debug,dy.PLAIN,{extraProperties:o})})),this.error=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.error,dy.PLAIN,{extraProperties:o})})),this.logWithEncryption=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.log,dy.AESGCM256,{extraProperties:o})})),this.infoWithEncryption=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.info,dy.AESGCM256,{extraProperties:o})})),this.debugWithEncryption=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.debug,dy.AESGCM256,{extraProperties:o})})),this.warnWithEncryption=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.warn,dy.AESGCM256,{extraProperties:o})})),this.errorWithEncryption=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.error,dy.AESGCM256,{extraProperties:o})})),this.logWithoutCache=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.log,dy.PLAIN,{extraProperties:o,noCache:!0})})),this.infoWithoutCache=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.info,dy.PLAIN,{extraProperties:o,noCache:!0})})),this.warnWithoutCache=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.warn,dy.PLAIN,{extraProperties:o,noCache:!0})})),this.debugWithoutCache=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.debug,dy.PLAIN,{extraProperties:o,noCache:!0})})),this.errorWithoutCache=(e,t,o)=>vS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,ly.error,dy.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{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((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(_y(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:$y(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),zy([{messages:JSON.stringify(s),meta:Wy}],e,o.xhrOptions)})))(this.runtimeMetaManager,...e),this.reportByHttps=(e,t)=>vS(this,void 0,void 0,(function*(){yield this.commonReportWithContext(e,t)})),this.deleteLog=e=>vS(this,void 0,void 0,(function*(){yield this.commonDeleteWithContext(e)})),this.deleteAll=()=>vS(this,void 0,void 0,(function*(){yield this.resetWithContext()}));const{runtimeMetaManager:t}=e;this.runtimeMetaManager=t}}fS.init=e=>vS(void 0,void 0,void 0,(function*(){const{databaseName:t="laplace-default-db"}=e,o=new mS(t),n=new jy,r=new Ny(Object.assign(Object.assign(Object.assign({},gS),e),{idbManager:o,logManager:n}));By(r,py.beforeInit),yield n.syncFromIDB(r.idbManager);const i=new fS({runtimeMetaManager:r});return By(r,py.afterInit),i}));class yS extends fy{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 ly.error:console.error(t.message);break;case ly.warn:console.warn(t.message);break;case ly.log:console.log(t.message);break;case ly.debug:console.debug(t.message);break;case ly.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 SS=e=>{const t=[];for(const[o,n]of e)t.push(n);return t};class bS extends fy{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?SS(r).filter(t):SS(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 ES="Expected a function",IS=NaN,AS="[object Symbol]",CS=/^\s+|\s+$/g,_S=/^[-+]0x[0-9a-f]+$/i,wS=/^0b[01]+$/i,RS=/^0o[0-7]+$/i,OS=parseInt,TS="object"==typeof qt&&qt&&qt.Object===Object&&qt,DS="object"==typeof self&&self&&self.Object===Object&&self,PS=TS||DS||Function("return this")(),kS=Object.prototype.toString,MS=Math.max,LS=Math.min,NS=function(){return PS.Date.now()};function VS(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function US(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)==AS}(e))return IS;if(VS(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=VS(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(CS,"");var o=wS.test(e);return o||RS.test(e)?OS(e.slice(2),o?2:8):_S.test(e)?IS:+e}var jS=function(e,t,o){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError(ES);return VS(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,u,d=0,l=!1,c=!1,p=!0;if("function"!=typeof e)throw new TypeError(ES);function h(t){var o=n,i=r;return n=r=void 0,d=t,s=e.apply(i,o)}function m(e){var o=e-u;return void 0===u||o>=t||o<0||c&&e-d>=i}function v(){var e=NS();if(m(e))return g(e);a=setTimeout(v,function(e){var o=t-(e-u);return c?LS(o,i-(e-d)):o}(e))}function g(e){return a=void 0,p&&n?h(e):(n=r=void 0,s)}function f(){var e=NS(),o=m(e);if(n=arguments,r=this,u=e,o){if(void 0===a)return function(e){return d=e,a=setTimeout(v,t),l?h(e):s}(u);if(c)return a=setTimeout(v,t),h(u)}return void 0===a&&(a=setTimeout(v,t)),s}return t=US(t)||0,VS(o)&&(l=!!o.leading,i=(c="maxWait"in o)?MS(US(o.maxWait)||0,t):i,p="trailing"in o?!!o.trailing:p),f.cancel=function(){void 0!==a&&clearTimeout(a),d=0,n=u=r=a=void 0},f.flush=function(){return void 0===a?s:g(NS())},f}(e,t,{leading:n,maxWait:t,trailing:r})};const BS=["RESOURCE_ERROR","JS_ERROR","UNHANDLED_PROMISE_REJECTION"];class xS extends fy{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=jS((()=>{if(null===this.runtimeMetaManager)return;const{autoReport:e}=this.config,{commonMethods:{commonReport:t}}=this.runtimeMetaManager;return t(this.runtimeMetaManager,BS,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)),ly.error,dy.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,u;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!==(u=null===(a=null==e?void 0:e.error)||void 0===a?void 0:a.stack)&&void 0!==u?u: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 FS=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}({}),HS=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 $S(e){return`{E}${e}{/E}`}const WS={enable:!1,enableReport:!1,gatewayEndPoint:"",logLevel:{debug:!1,log:!1,info:!1,print:!1,warn:!1,error:!1},performanceReportRatio:.25,trackingCount:7},GS=["debug","log","info","print","warn","error"],zS=(e,t)=>[...e,...t].filter((e=>!!e));class KS{static getInstance(){return this.agentInstance||(this.agentInstance=new KS),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.initConfig=async e=>{let t,o=WS;try{e.logConfig&&(o=JSON.parse(e.logConfig),o.gatewayEndPoint&&(this.reportUrl=o.gatewayEndPoint));const{enable:n,enableReport:r,reportUrl:i,logLevel:s,encryptKeys:a,trackingId:u,accountId:d}=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=GS.indexOf(s),t=GS.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:cy.PROTECT_LOCAL_KEY,key:e}))))))}void 0!==d&&(this.accountId=d)}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 yS({verbose:!1}),new bS({debug:!1,cleanAfterReport:!0,expireBefore:n}),new xS({debug:!1,autoReport:r,ignoredErrorMsgKeywords:["table index is out of bounds"],maxErrorCount:223,publicTags:this.accountId?[...this.publicTags,$S(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,fS.init(t).then((e=>{this.handleInitLaplaceSuccess(e,o)})).catch((e=>{throw{type:Il,reason:"Logger init failed.",error:e}}))):Promise.reject({type:El,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,zS(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,zS(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,zS(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,zS(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,zS(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=zS(null!==(t=this.publicTags)&&void 0!==t?t:[],e);return{log:(e,t)=>this.log(e,o,null!=t?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=e=>{var t;return this.checkLaplace()?null!==(t=this.logConfig)&&void 0!==t&&t.enableReport&&this.reportUrl?this.laplace.reportByHttps(e,{gzip:!1,encrypt:!1,xhrOptions:{url:this.reportUrl},additionalContext:{trackingId:this.trackingId}}):Promise.reject({type:El,reason:"Please use getLogs to obtain log data and report by yourself."}):Promise.reject({type:El,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,$S(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},u=this.laplace.getLogs(t),d=[];for(const[,e]of u)d.push({...e,...a});return d},this.doNotUseDirtyGetStore=()=>this.checkLaplace()?this.laplace.doNotUseDirtyGetStore():(console.warn("Logger has not been enabled or initialized."),{byTag:{},byTime:new Map}),this.trackingId=gy()}}KS.agentInstance=void 0;const qS=KS.getInstance(),JS=[{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})))]}),[]),QS=JS.map((e=>e.name)),ZS=function(e){const t=JS.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;rwr(e)));qS.makeLogger([i,`${i} Media SDK`]).info(`${e},params:${JSON.stringify(s)}`)}};function YS(e){return new Proxy(e,{get:(e,t)=>"string"==typeof t&&QS.includes(t)?function(){for(var o=arguments.length,n=new Array(o),r=0;r!!e)))));const a=oy(o);a&&(i?(r.resendRemoteControlPositionPDU(),r.updateRemoteControlProperties({os:a.os,isControllerNow:!0,dimension:t&&Rf(t)})):t&&r.startRemoteControl(t,a.os,Rf(t)))}function db(){XS.log("qr scanning stop"),eb.startRemoteControlQRCheck(!1)}const lb=Ns.createAgent(),cb=YS(Hs.getInstance()),pb=Ns.createAgent(),hb=YS(Hs.getInstance());function mb(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:Eb(e)?2:Ib(e)?3:0}function Sb(e,t){return 2===yb(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bb(e,t,o){var n=yb(e);2===n?e.set(t,o):3===n?(e.delete(t),e.add(o)):e[t]=o}function Eb(e){return qb&&e instanceof Map}function Ib(e){return Jb&&e instanceof Set}function Ab(e){return e.o||e.t}function Cb(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=oE(e);delete t[Xb];for(var o=tE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=wb),Object.freeze(e),t&&fb(e,(function(e,t){return _b(t,!0)}),!0)),e}function wb(){mb(2)}function Rb(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Ob(e){var t=nE[e];return t||mb(18,e),t}function Tb(){return zb}function Db(e,t){t&&(Ob("Patches"),e.u=[],e.s=[],e.v=t)}function Pb(e){kb(e),e.p.forEach(Lb),e.p=null}function kb(e){e===zb&&(zb=e.l)}function Mb(e){return zb={p:[],l:zb,h:e,m:!0,_:0}}function Lb(e){var t=e[Xb];0===t.i||1===t.i?t.j():t.O=!0}function Nb(e,t){t._=t.p.length;var o=t.p[0],n=void 0!==e&&e!==o;return t.h.g||Ob("ES5").S(t,e,n),n?(o[Xb].P&&(Pb(t),mb(4)),gb(e)&&(e=Vb(t,e),t.l||jb(t,e)),t.u&&Ob("Patches").M(o[Xb].t,e,t.u,t.s)):e=Vb(t,o,[]),Pb(t),t.u&&t.v(t.u,t.s),e!==Zb?e:void 0}function Vb(e,t,o){if(Rb(t))return t;var n=t[Xb];if(!n)return fb(t,(function(r,i){return Ub(e,n,t,r,i,o)}),!0),t;if(n.A!==e)return t;if(!n.P)return jb(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=Cb(n.k):n.o;fb(3===n.i?new Set(r):r,(function(t,i){return Ub(e,n,r,t,i,o)})),jb(e,r,!1),o&&e.u&&Ob("Patches").R(n,o,e.u,e.s)}return n.o}function Ub(e,t,o,n,r,i){if(vb(r)){var s=Vb(e,r,i&&t&&3!==t.i&&!Sb(t.D,n)?i.concat(n):void 0);if(bb(o,n,s),!vb(s))return;e.m=!1}if(gb(r)&&!Rb(r)){if(!e.h.F&&e._<1)return;Vb(e,r),t&&t.A.l||jb(e,r)}}function jb(e,t,o){void 0===o&&(o=!1),e.h.F&&e.m&&_b(t,o)}function Bb(e,t){var o=e[Xb];return(o?Ab(o):e)[t]}function xb(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 Fb(e){e.P||(e.P=!0,e.l&&Fb(e.l))}function Hb(e){e.o||(e.o=Cb(e.t))}function $b(e,t,o){var n=Eb(t)?Ob("MapSet").N(t,o):Ib(t)?Ob("MapSet").T(t,o):e.g?function(e,t){var o=Array.isArray(e),n={i:o?1:0,A:t?t.A:Tb(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=n,i=rE;o&&(r=[n],i=iE);var s=Proxy.revocable(r,i),a=s.revoke,u=s.proxy;return n.k=u,n.j=a,u}(t,o):Ob("ES5").J(t,o);return(o?o.A:Tb()).p.push(n),n}function Wb(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Cb(e)}var Gb,zb,Kb="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),qb="undefined"!=typeof Map,Jb="undefined"!=typeof Set,Qb="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Zb=Kb?Symbol.for("immer-nothing"):((Gb={})["immer-nothing"]=!0,Gb),Yb=Kb?Symbol.for("immer-draftable"):"__$immer_draftable",Xb=Kb?Symbol.for("immer-state"):"__$immer_state",eE=""+Object.prototype.constructor,tE="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,oE=Object.getOwnPropertyDescriptors||function(e){var t={};return tE(e).forEach((function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)})),t},nE={},rE={get:function(e,t){if(t===Xb)return e;var o=Ab(e);if(!Sb(o,t))return function(e,t,o){var n,r=xb(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||!gb(n)?n:n===Bb(e.t,t)?(Hb(e),e.o[t]=$b(e.A.h,n,e)):n},has:function(e,t){return t in Ab(e)},ownKeys:function(e){return Reflect.ownKeys(Ab(e))},set:function(e,t,o){var n=xb(Ab(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,o),!0;if(!e.P){var r=Bb(Ab(e),t),i=null==r?void 0:r[Xb];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||Sb(e.t,t)))return!0;Hb(e),Fb(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!==Bb(e.t,t)||t in e.t?(e.D[t]=!1,Hb(e),Fb(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=Ab(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(){mb(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){mb(12)}},iE={};fb(rE,(function(e,t){iE[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),iE.deleteProperty=function(e,t){return iE.set.call(this,e,t,void 0)},iE.set=function(e,t,o){return rE.set.call(this,e[0],t,o,e[0])};var sE=function(){function e(e){var t=this;this.g=Qb,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=Ob("Patches").$;return vb(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),aE=new sE,uE=aE.produce;aE.produceWithPatches.bind(aE),aE.setAutoFreeze.bind(aE),aE.setUseProxies.bind(aE),aE.applyPatches.bind(aE),aE.createDraft.bind(aE),aE.finishDraft.bind(aE);const dE={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:Cu.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}}},lE=ko({[`${bh}`]:uE(((e,t)=>{let{payload:o}=t;e.sharePrivilege=o})),[`${Eh}`]:uE(((e,t)=>{let{payload:o}=t;e.isRemoteSharingActive=1===o.bStatus,e.activeNodeId=o.activeNodeID,e.activeSsrc=o.ssrc})),[`${Ih}`]:uE(((e,t)=>{let{payload:o}=t;e.isReceiveSharing=o})),[`${Ah}`]:uE(((e,t)=>{let{payload:o}=t;e.isChromeExtensionInstalled=o})),[`${_h}`]:uE(((e,t)=>{let{payload:o}=t;e.shareDimension={...o}})),[`${wh}`]:uE(((e,t)=>{let{payload:o}=t;e.status=o})),[`${Rh}`]:uE(((e,t)=>{let{payload:o}=t;e.ssrc=o})),[`${Oh}`]:uE(((e,t)=>{let{payload:o}=t;e.shareQuality=o})),[`${Th}`]:uE(((e,t)=>{let{payload:o}=t;e.receivedShareDimension={...o}})),[`${Yh}`]:uE(((e,t)=>{let{payload:o}=t;e.remoteControlledUserList.includes(o)||e.remoteControlledUserList.push(o)})),[`${Xh}`]:uE(((e,t)=>{let{payload:o}=t;const n=e.remoteControlledUserList.indexOf(o);n>=0&&e.remoteControlledUserList.splice(n,1)})),[`${Dh}`]:uE(((e,t)=>{let{payload:o}=t;e.isGrabRemoteControl=o,!1===o&&(e.remoteControlViewportDomSelector=void 0)})),[`${Ph}`]:uE(((e,t)=>{let{payload:o}=t;e.isSDKGrabControl=o})),[`${kh}`]:uE(((e,t)=>{let{payload:o}=t;e.isReceiveSharingFromMainSession=o})),[`${Mh}`]:uE(((e,t)=>{let{payload:o}=t;e.isSharingToBreakoutRoom=o})),[`${Lh}`]:uE(((e,t)=>{let{payload:o}=t;e.isSharingWithSecondCamera=o})),[`${Nh}`]:uE(((e,t)=>{let{payload:o}=t;e.secondCameraId=o})),[`${Vh}`]:uE(((e,t)=>{let{payload:o}=t;e.isRequireReadReceipt=o})),[`${Uh}`]:uE(((e,t)=>{let{payload:o}=t;e.isOptimizedForSharedVideo=o})),[`${jh}`]:uE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${Bh}`]:uE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${xh}`]:uE(((e,t)=>{let{payload:o}=t;e.capturedEnsuredCanvas.includes(o)||e.capturedEnsuredCanvas.push(o)})),[`${Fh}`]:uE(((e,t)=>{let{payload:o}=t;e.renderedEnsuredCanvas.includes(o)||e.renderedEnsuredCanvas.push(o)})),[`${$h}`]:uE(((e,t)=>{let{payload:o}=t;e.remoteControllingSsrc=o})),[`${Wh}`]:uE(((e,t)=>{let{payload:o}=t;e.remoteControlApprovedSsrc=o})),[`${Gh}`]:uE(((e,t)=>{let{payload:o}=t;e.remoteControlAppDownloadUrl=o})),[`${zh}`]:uE(((e,t)=>{let{payload:o}=t;(e.remoteControlAppInstallStatus!==Cu.Installed||Cu.Unknown)&&(e.remoteControlAppInstallStatus=o)})),[`${Qh}`]:uE(((e,t)=>{let{payload:o}=t;e.remoteControlAppLaunchSheme=o})),[`${Zh}`]:uE(((e,t)=>{let{payload:o}=t;const{userId:n,ssrc:r}=o;Object.assign(e.userSsrcMapping,{[`${n}`]:r})})),[`${em}`]:uE(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${tm}`]:uE(((e,t)=>{let{payload:o}=t;e.remoteControlViewportDomSelector=o})),[`${om}`]:uE(((e,t)=>{let{payload:o}=t;e.isFullHDVideoShareEnabled=o})),[`${nm}`]:()=>({...dE})},dE),cE={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 em({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:u}}=t.value,d=[];if(s===qa.End&&d.push($h(0)),s!==qa.End)if(fr(i,n))if(o){ib(),sb(),s===qa.Paused&&(pb.resumeSharing(),hb.resumeDesktopSharing(),d.push(wh(qa.Sharing))),d.push($h(r));const e=bp(t.value).find((e=>fr(e.userId,r)));e&&d.push(Zh({userId:e.userId,ssrc:r}))}else d.push($h(0));else{var l;const e=null===(l=bp(t.value))||void 0===l?void 0:l.find((e=>fr(e.userId,n)));e&&(d.push(Zh({userId:e.userId,ssrc:n})),wc(pl,{userId:e.userId,displayName:e.displayName,isSharingEntireScreen:hb.isSharingEntireScreen()}))}else if(!r||fr(r,i)){const e=vp(t.value);if(!np(e.userRole)&&!zi.isAndroidOrIOSBrowser){const e=n&&fr(a,n);o?(d.push(Yh(a)),e&&(u||pb.subscribeGrabRemoteControl(a,!0))):(d.push(Xh(a)),e&&(u&&(pb.subscribeGrabRemoteControl(a,!1),d.push(Dh(!1)),wc(il,!1)),hb.updateRemoteControlProperties({isControllerNow:!1}))),wc(rl,o)}}return Ue(d)}))),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 hb.updateRemoteControlProperties({isControllerNow:o}),wc(il,o),Dh(o)}))),remoteControlEpics3:e=>In(e,[Va.StartRemoteControlSuccess,Va.StartRemoteControlFailed,Va.CancelRemoteControlSuccess]).pipe(Wf((e=>e.payload.type===Va.StartRemoteControlSuccess?(wc(al),Ph(!0)):e.payload.type===Va.CancelRemoteControlSuccess?Ph(!1):void(e.payload.type===Va.StartRemoteControlFailed&&wc(ul))))),remoteControlEpics4:e=>In(e,[Va.RemoteControlCopiedTextNotify,Va.RemoteControlPasteTextLengthOverflow]).pipe(Ot((e=>{if(e.payload.type===Va.RemoteControlCopiedTextNotify){const{payload:{data:t}}=e;wc(sl,{content:t.data,x:t.x,y:t.y})}else wc(sl,{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:u}=zi;if(s!==qa.End){if(!i||i===n){ib();try{const e=JSON.parse(o||"{}"),t=u?e.macDownloadUrl:e.winDownloadUrl;a.push(Gh(t))}catch(e){console.warn("unsupported JSON string",e)}}const s={};u||Object.assign(s,{runAsAdmin:1});const d=bp(t.value).find((e=>fr(e.userId,n)));d&&Object.assign(s,{controllerName:ur(d.displayName)}),Object.assign(s,{ssrc:n});const{deviceId:l}=hb.getShareStreamInfo();l&&Object.assign(s,{DeviceID:l});const c=`${r}&${new URLSearchParams(s).toString()}`;a.push(Qh(c),zh(Cu.Unknown)),wc(vl,c)}return Ue(a)}))),remoteControlEpics6:e=>e.pipe($t(`${Kh}`),Xe((()=>nb.startCheck(1e4).pipe(ze((()=>(wc(hl,Cu.Unknown),zh(Cu.Unknown)))))))),remoteControlEpics7:(e,t)=>e.pipe($t(`${qh}`),mt((()=>{const{share:{remoteControlAppInstallStatus:e}}=t.value;return e===Cu.Installed})),Xe((()=>rb.startCheck(6e4).pipe(Xe((()=>{wc(hl,_u.Unlaunched);const{share:{remoteControlApprovedSsrc:e,isEnableAutoDeleteRcApp:o},meeting:{userId:n}}=t.value,r=[],{isMacOS:i}=zi;return e&&(pb.remoteControlConsent(Au.CacheClean,e,n,{...hb.getShareStreamInfo(),platform:i?"mac":"win"},o),r.push(Qh(""),Wh(0))),Ue(r)})))))),remoteControlEpics8:(e,t)=>e.pipe($t(`${Qh}`),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(qh());const e=performance.now();document.hasFocus()?r=lt(25).pipe(Rt((()=>{const o=performance.now()-e<500;return o||wc(hl,Cu.Uninstalled),o&&t.value.share.remoteControlAppInstallStatus===Cu.Unknown})),_t((()=>{const t=performance.now()-e,o=[];return document.hasFocus()||(t>75?o.push(Kh()):ib(),wc(hl,Cu.Installed),o.push(zh(Cu.Installed),qh())),Ue(o)})),function(){for(var e=[],t=0;tyn(e,vs).pipe(Xe((()=>(wc(ml,wu.Ended),ab(t.value,pb),Ue([Qh(""),Wh(0)]))))),remoteControlEpics10:(e,t)=>e.pipe($t(`${wh}`),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&&ab(t.value,pb),o!==e&&pb.remoteControlConsent(Au.Decline,o,r,{...hb.getShareStreamInfo(),platform:i?"mac":"win"},n)})),Et(fe)),remoteControlEpics11:(e,t)=>yn(e,16430).pipe(Xe((()=>(ib(),sb(),wc(hl,_u.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)=>{XS.log(`load qr scanner script start. url:${o}`),vf(o,(()=>{XS.log("load qr scanner script done."),e("")}),t)}))})(e).then((()=>{XS.log("qr scanning start"),t.startRemoteControlQRCheck(!0)}))}(t.value,hb),Ue([Qh(""),Wh(0)]))))),remoteControlEpics12:e=>In(e,Va.CurrentDesktopSharingWidthHeight).pipe(Ot((()=>{pb.syncSharedContentMetaWithRcApp(hb.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_")&&pb.sendRemoteControlAuth(e)}))})),Et(fe)),remoteControlEpics14:e=>yn(e,16434).pipe(Ot((e=>{const{payload:{body:{result:t}}}=e;0===t&&(db(),wc(ml,wu.Started))})),Et(fe)),remoteControlEpics15:(e,t)=>yn(e,us).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:u,isGrabRemoteControl:d},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(Xh(e)),e===u&&d&&(p.push(Dh(!1)),wc(il,!1)))})),Ue(p)}))),remoteControlEpics16:(e,t)=>e.pipe($t(`${xr}`),Ot((()=>{const{share:{remoteControllingSsrc:e,status:o}}=t.value;o===qa.Sharing&&e&&wc(ml,wu.Ended)})),Et(fe))},pE={epics0:(e,t)=>yn(e,ds).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&&wc(dl,r)})),ze((e=>{let[t]=e;return bh(t.payload.body.lockShare)}))),epics1:e=>yn(e,20227).pipe(ze((e=>Rh(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)===ap.InRoom&&s.mainSessionAttendeeList.length>0&&(e=s.mainSessionAttendeeList.findIndex((e=>e.userId===r))>-1),lb.unsubscribeSharing(r,e),tb(lb,o,a.activeNodeID),cb.switchSharingSource(a.ssrc,i),wc(nl,{userId:a.activeNodeID})}else if(1===a.bStatus){const e={activeUserId:a.activeNodeID,isActive:!0};i&&Object.assign(e,{isFromMainSession:!0}),wc(Gd,e)}else if(n){const e={activeUserId:a.activeNodeID,isActive:!1};i&&Object.assign(e,{isFromMainSession:!0}),wc(Gd,e)}return Eh(a)}))),epics3:e=>In(e,Va.CheckChromeSharingExtensionResponse).pipe(ze((e=>(wc(zd,e.payload.data),Ah(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 lb.startSharing(n,{bShareToBO:r,bShareAudio:a,bShareVideo:!!i}),cb.switchSharingMode(i?bu.VideoMode:bu.Normal),Ch(!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(Ch(!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."),wc(Kd,{reason:o}),Ue(t)}))),epics6:e=>In(e,Va.CurrentDesktopSharingWidthHeight).pipe(mt((e=>!!e.payload.data)),ze((e=>{wc(qd,e.payload.data);const{payload:{data:{width:t,height:o}}}=e;return cb.ajustmentSharingCanvas(t,o),_h(e.payload.data)}))),epics7:(e,t)=>In(e,Va.SharingDecodeMaxSize).pipe(mt((e=>!!e.payload.data)),Tt(t),Wf((e=>{let[t,o]=e;const{share:{shareQuality:n,activeNodeId:r}}=o,{payload:{data:{fps:i}}}=t,s=Number(i);if(n!==s)return tb(lb,o,r,s),Oh(s)}))),epics8:e=>yn(e,20226).pipe(Ot((e=>{var t,o;if(wc(Jd,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;cb.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>Th(e.payload.body)))),epics9:e=>In(e,Va.SharingPara).pipe(Ot((e=>{var t,o;if(wc(Jd,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;cb.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>{var t;return Th(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&&(lb.stopSharing(o),cb.stopDesktopSharing(),wc(Qd)),wh(qa.End)}))),epics11:(e,t)=>yn(e,us).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,u=a.find((e=>e.id===n&&!1===e.bShareOn)),d=a.find((e=>e.id===n&&!0===e.bShareOn)),l=[];return u&&r!==qa.End&&(lb.stopSharing(n),cb.stopDesktopSharing(),l.push(wh(qa.End)),wc(Zd)),d&&r===qa.End&&(i&&(cb.stopRenderSharing(),lb.unsubscribeSharing(s),l.push(Ih(!1))),l.push(wh(qa.Sharing))),Ue(l)}))),epics12:(e,t)=>yn(e,us).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,u=ny(r),d=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 d.length>0&&d.forEach((e=>{-1===u.findIndex((t=>t.userId===e.id))?wc(Xd,e):wc(ol,e)})),l.length>0&&l.forEach((e=>{wc(tl,e)})),c.length>0&&(c.forEach((e=>{wc(el,e)})),a&&c.some((e=>e.id===s)))?vt(yn(e,ss).pipe(ft(1),Et(fe)),dt(50).pipe(Et(Be("timeout")))).pipe(gt((()=>{const{share:{activeNodeId:e,isReceiveSharingFromMainSession:o},audio:n}=t.value,r=u.filter((t=>t.userId!==e));if(r.length>0){const i=r[0],{userId:s}=i;return lb.unsubscribeSharing(e,o),tb(lb,t.value,s),cb.switchSharingSource(s,o),null==n||n.localShareAudioUserMutedList.forEach((e=>{cb.setSharingAudioVolume(s,e.userId!==s||e.muted,e.isFromMainSession)})),wc(nl,{userId:s}),je(Eh({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:u,userId:d,zoomId:l,meetingId:c,meetingNumber:p,isWebinar:h}}=n;return Cf(t).pipe(_t((e=>{let o=a;return(!zi.isSupportSendScreenSharing||h&&e&&np(e.userRole))&&(o="failed"),Af("sharing",o,s).pipe(Ot((e=>{let[o,n]=e;const s={userId:d,sn:pr(l),confId:u,encryptKey:pr(r),encryptType:i,meetingId:c,meetingNumber:p};if(o&&(null==cb||cb.updateMediaParams({iVType:Xi.SHARING_ENCODE,isFromMainSession:!1,updateParams:s})),n){cb.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)})));cb.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}`;Af("sharing","success",n).subscribe((e=>{let[,t]=e;t&&cb.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}`;Af("sharing","success",n).subscribe((e=>{let[,t]=e;t&&cb.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;lb.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&&wc(ll)})),Et(fe)),epics18:(e,t)=>yn(e,ds).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&&(lb.startSharing(s,{bShareAudio:i,bShareToBO:r,bShareVideo:!1}),cb.switchSharingMode(bu.Normal),a.push(Uh(!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:u},participants:{xmppAttendeeList:d}}=n;let l=Cp(n).length>0;r&&(l=l||Boolean(d.length));const c=a!==qa.End&&"success"===i&&l,p=u&&"success"===s;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?c?(wc(cl,o.payload),jh(o.payload)):jh(mu):p?(wc(cl,o.payload),Bh(o.payload)):Bh(mu)})))},hE=fn(pE,cE),mE=Ns.createAgent();let vE,gE,fE=function(e){return e.Add="add",e.List="list",e.Remove="memberremove",e.rename="rename",e.update="UPDATE",e}({}),yE=function(e){return e.Open="open",e.Message="message",e.Error="error",e.Close="close",e}({});class SE{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 SE),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(yE.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(yE.Message,JSON.parse(t))}catch(e){console.warn("Unsupported format",t)}})),this.websocket.addEventListener("close",(e=>{this.emit(yE.Close,e)})),this.websocket.addEventListener("error",(e=>{this.emit(yE.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})}}}SE.xmppInstance=null;const bE=Ns.createAgent();let EE=null;function IE(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 AE=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=IE(t);var a=e.loaded,u=e.total;this.loaded=a,this.total=u},CE=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=IE(t)}catch(e){n=t.responseText}this.response=n}})),_E=function(){function e(e,t){return CE.call(this,"ajax timeout",e,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(CE.prototype),e}();var wE=ze((function(e){return e.response}));var RE,OE=(RE=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,u=i.headers,d=i.url;if(!d)throw new TypeError("url is required");if(s)if(d.includes("?")){var l=d.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},jE=e=>ct(...e.map((e=>0===e.dl?Ue(e.items):dt(e.dl).pipe(Xe((()=>Ue(e.items))))))),BE=(e,t)=>e.pipe($t(`${Br}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.encryptedRWC||void 0!==t.meeting.encryptedGEORWC&&t.meeting.encryptedGEORWC.length>0})),_t((e=>{let[,o]=e;const{meeting:{ts:n,auth:r,meetingNumber:i,meetingOptions:s,meetingId:a,userName:u},breakoutRoom:d}=o,l=null==s?void 0:s.isEnableGeoFenceRWC,c=UE(o);if(c.length>0){const e={serversLength:c.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0,retryCounts:0};let o;return l&&(o=new ee,jE(c).subscribe((e=>{var t;return null===(t=o)||void 0===t?void 0:t.next(e)}))),(l?o:jE(c)).pipe(Rt((()=>{const{meeting:{meetingStatus:n}}=t.value,r=n===Di.Initial&&e.pingFailedServerList.length0;return!r&&o&&o.complete(),r})),Ot((()=>{if(e.pingRwcServerCounts=e.pingRwcServerCounts+1,l&&e.pingRwcServerCounts===e.serversLength){const n=1e3*Math.floor(5*Math.pow(2,e.retryCounts));e.retryCounts=e.retryCounts+1,VE.makeLogger(["Join Meeting Flow"]).info(`ping rwc retry,current rwc list:${JSON.stringify(UE(t.value))},retry counts:${e.retryCounts}, ${JSON.stringify({meetingId:a,meetingNumber:$S(i),userName:$S(u)})}`,["Ping RWC Retry"]),dt(n).pipe(ze((()=>{const o=UE(t.value);return Object.assign(e,{serversLength:o.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0}),o}))).subscribe((e=>{jE(e).subscribe((e=>{o.next(e)}))}))}})),Xe((t=>{const{rwc:s,rwcToken:c}=t,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()}`})(s,i,c,n,r,null==d?void 0:d.currentRoom.boConfId);return OE({url:p,crossDomain:br(p)}).pipe(Xe((e=>{let t={};return t=e.response?{...e.response,rwc:s,fromNginx:!1}:{rwc:s,rwg:s,rwcToken:c,fromNginx:!0},Ue([Wo(t),Mo()])})),gt((()=>{const{pingFailedServerList:t,serversLength:n}=e;return t.push(p),t.length===n&&(l&&o&&o.complete(),VE.report(`ping rwc error, ${JSON.stringify({meetingId:a,meetingNumber:$S(i),userName:$S(u)})}`,["Join Meeting Flow","Ping RWC Error"],"error"),wc(Zs,{reason:"connection error",errorCode:Rr})),fe})))})),Ct(Yr(performance.now())))}return fe})));let xE=0;const FE=KS.getInstance(),HE={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}},$E=ko({[`${Gr}`]:uE(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o),e.meetingStatus=Di.Initial})),[`${zr}`]:uE(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o)})),[`${Kr}`]:uE(((e,t)=>{let{payload:o}=t;e.isWindowOpen=o})),[`${qr}`]:uE(((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}`]:uE(((e,t)=>{let{payload:o}=t;e.ztk=o})),[`${Qr}`]:uE(((e,t)=>{let{payload:o}=t;e.zsk=o})),[`${Zr}`]:uE(((e,t)=>{let{payload:o}=t;e.tk=o.tk,e.mtkGuid=o.mtkGuid})),[`${Yr}`]:uE(((e,t)=>{let{payload:o}=t;e.pingRWCTimestamp=o})),[`${Ci}`]:uE(((e,t)=>{let{payload:o}=t;e.meetingInfoTimestamp=o})),[`${Xr}`]:uE(((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}`]:uE(((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}`]:uE(((e,t)=>{let{payload:o}=t;e.isHost=o})),[`${ni}`]:uE(((e,t)=>{let{payload:o}=t;e.isCoHost=o})),[`${ri}`]:uE(((e,t)=>{let{payload:o}=t;e.isOnHold=o})),[`${ii}`]:uE(((e,t)=>{let{payload:o}=t;e.isMeetingReset=o})),[`${si}`]:uE(((e,t)=>{let{payload:o}=t;e.audioVideoBeforeOnHold=o})),[`${ai}`]:uE(((e,t)=>{let{payload:o}=t;e.currentUserAudioBeforeReset=o})),[`${ui}`]:uE(((e,t)=>{let{payload:o}=t;e.isCurrentUserMutedBeforeReset=o})),[`${di}`]:uE(((e,t)=>{let{payload:o}=t;e.meetingStatus=o})),[`${li}`]:uE(((e,t)=>{let{payload:o}=t;e.region=o.region,e.network=o.network})),[`${ci}`]:uE(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartVideoBeforeReset=o})),[`${pi}`]:uE(((e,t)=>{let{payload:o}=t;e.joinMeetingTimeStamp=o})),[`${hi}`]:uE(((e,t)=>{let{payload:o}=t;e.activeAppInfo=o})),[`${mi}`]:uE(((e,t)=>{let{payload:o}=t;e.idleStartTime=o})),[`${vi}`]:uE(((e,t)=>{let{payload:o}=t;e.sessionIdleTimeoutMins=o})),[`${gi}`]:uE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeEnabled=o})),[`${fi}`]:uE(((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}`]:uE(((e,t)=>{let{payload:o}=t;e.sharePronounType=o})),[`${Si}`]:uE(((e,t)=>{let{payload:o}=t;e.stayAwake=o})),[`${bi}`]:uE(((e,t)=>{let{payload:o}=t;e.failover.joinMeetingSuccessTimestamp=o})),[`${Ei}`]:uE((e=>{Object.assign(e.failover,{...HE.failover,count:e.failover.count,joinMeetingSuccessTimestamp:e.failover.joinMeetingSuccessTimestamp})})),[`${Ii}`]:uE(((e,t)=>{let{payload:o}=t;const{count:n,reason:r,interval:i}=o;e.failover.count=n,e.failover.reason=r,e.failover.interval=i,e.failover.isCurrentFailoverRecorded=!0})),[`${Ai}`]:uE(((e,t)=>{let{payload:o}=t;e.quicklyLeave=o})),[`${_i}`]:uE(((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}),{...HE,...r}}},HE),WE={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=[],n=Vi.get(Ui.WebclientFailoverCount)||0;let{meeting:{failover:{count:r,reason:i,interval:s}}}=t.value;const{meeting:{pingRWCTimestamp:a}}=t.value;o&&(r=n+1,i=ki.RefreshPage,s=0,Vi.set(Ui.WebclientFailoverCount,r,Li.SessionStorage),e.push(Ii({count:r,reason:i,interval:s})));const u=performance.now();let d=`WCL_M, JMCT(${u-a})`;return r>0&&i!==ki.NormalCase&&(d=`${d},FAILOVER(${r},${i},${(s/1e3).toFixed(1)})`),bE.sendRWGConnectionPerformance(d),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}}}=t.value,i=[];if(!r){let e=Vi.get(Ui.WebclientFailoverCount)||0;o!==ki.NormalCase&&(e+=1,Vi.set(Ui.WebclientFailoverCount,e,Li.SessionStorage));const t=performance.now()-n;i.push(Ii({reason:o,count:e,interval:t}))}return Ue(i)})))},GE={sessionIdleEpic0:(e,t)=>e.pipe($t(`${Xr}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.zlkJwtToken})),_t((()=>(vE&&vE.complete(),vE=new Q,gE=lt(6e4).pipe(ze((()=>performance.now()))).subscribe(vE),vE.pipe(ze((e=>Wr(e)))))))),sessionIdleEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{vE&&(vE.complete(),gE.unsubscribe())})),Et(fe)),sessionIdleEpic2:(e,t)=>e.pipe($t(`${Wr}`),Tt(t),Xe((e=>{var t;let[o,n]=e;const{meeting:{idleStartTime:r,sessionIdleTimeoutMins:i,isOriginHost:s},participants:{attendeesList:a,xmppAttendeeList:u},recording:d,breakoutRoom:l}=n,c=o.payload,p=[];if(1===a.length&&0===u.length&&(null==l||null===(t=l.currentRoom)||void 0===t?void 0:t.status)!==ap.InRoom&&(null==d?void 0:d.cmrStatus)!==Ca.Start)if(r){const e=s&&ep(a[0].userRole)?i:40;c-r>60*e*1e3&&(console.warn(`No active for ${e} minutes, will end the session.`),p.push($r()),dt(500).subscribe((()=>{Dc()})))}else p.push(mi(c));else p.push(mi(void 0));return Ue(p)}))),sessionIdleEpic3:(e,t)=>e.pipe($t(`${Uo}`),mt((e=>[us,ds].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)===ap.InRoom)&&s.push(mi(void 0)),Ue(s)}))),sessionIdleEpic4:e=>e.pipe($t(`${Fr}`,`${$r}`),yt(mi(void 0)))},zE={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:u,tk:d,userEmail:l},breakoutRoom:c}=t.value,p=e?{zlkJwtToken:e}:{signType:o,sign:n};if(r&&""!==r&&(e?Object.assign(p,{mpwd:ur(r)}):i&&s||Object.assign(p,{mpwd:r})),(null==c?void 0:c.currentRoom.status)===ap.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)||u)&&Object.assign(p,{zak:u}),d&&Object.assign(p,{tk:d});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})}mE.sendLaunchParams(p);const h=Vi.get(Ui.WebclientMeetingToken);h&&mE.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:u,role:d}}}=t,{meeting:{userEmail:l,userName:c,isMeetingReset:p,apiKey:h,zsk:m,signatureType:v}}=o;if(Or.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),u&&Vi.set(f,u,Li.SessionStorage),m&&mE.sendSdkKeyToMonitor(v,h,r);const y=[Xr(t.payload.body),pi(performance.now())];return p&&y.push(ii(!1)),(d&Zc.Owner)===Zc.Owner&&(wc(Zs,{reason:"dont support assisnt join through widget",errorCode:-1}),mE.leaveMeeting()),wc(Qs,{meetingNumber:s}),Ue(y)}return Or.MeetingLocked===n?wc(Zs,Lr(n)):Or.UserFull===n?wc(Zs,Object.assign({},Lr(n),{lmUrl:t.payload.body.lmURL})):(Or.MeetingIsOver===n||Or.MMRIBReject===n||Or.MMRConfParticipantExists===n||[Or.UserHasBeenRemoved,Or.WebinarBlockedEmail].includes(n),wc(Zs,Lr(n))),Ue(Ff(o,!1))},F(_t(((e,t)=>o(e)||fe)))));var o},meetingMainEpics2:(e,t)=>yn(e,ds).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 wc(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(Tr.Reconnect===n.reason)return Dr.WaitingRoomFailover===n.subReason?wc(Ys,{reason:wi.OnHold}):wc(Ys,{reason:wi.Failover}),je(xr(ki.NormalCase));Tr.KickedByHost===n.reason?wc(Xs,{reason:"kicked by host"}):[Tr.EndByHost,Tr.EndByNone,Tr.EndByAdmin,Tr.EndByHostStartAnotherMeeting].includes(n.reason)?wc(Xs,{reason:"ended by host"}):Tr.FreeMeetingTimeout===n.reason?wc(Xs,{reason:"free meeting ended"}):[Tr.DuplicateSession,Tr.MeetingTransfer].includes(n.reason)&&wc(Xs,{reason:"duplicated session"})}return o.meeting.isMeetingReset?fe:Ue(Ff(o,!1))}))),meetingMainEpics4:(e,t)=>e.pipe($t(`${xr}`),Tt(t),Xe((e=>{let[,t]=e;const o=Ff(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?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(jr(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:u,userEmail:d,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:u,userEmail:d,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(Ur(e)).pipe(bt(1e3))}return tt(Ue(o),n)}))),meetingMainEpics5:e=>En(e,7940).pipe(Ot((e=>{wc("MEETING_HOST_CHANGE_INDICATION",e.payload.body.bHost)})),ze((e=>oi(e.payload.body)))),meetingMainEpics6:e=>En(e,7941).pipe(Ot((e=>{wc("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),wc(ea,t)})),Tt(t),Xe((e=>{let[t,o]=e;const n=[ri(t.payload.body.bHold)];if(t.payload.body.bHold){const e=vp(o);if(e){n.push(si({audio:e.audio,video:e.bVideoOn,muted:e.muted}));const t=YS(Hs.getInstance());if("computer"===e.audio&&(t.leaveComputerAudio(),mE.joinOrLeaveVoip(!1)),e.bVideoOn&&t.stopCaptureVideo(),e.sharerOn&&(mE.stopSharing(e.userId),t.stopDesktopSharing(),n.push(wh(qa.End))),o.video&&o.video.subscribedVideoList.length>0&&o.video.subscribedVideoList.forEach((e=>{mE.unsubscribeVideo(e)})),o.share&&o.share.isReceiveSharing){const e=o.share.activeNodeId;o.share.remoteControlledUserList.length>0&&(o.share.remoteControlledUserList.forEach((e=>{mE.sharingRequestRemoteControl(e,!1)})),iy(o)&&t.stopRemoteControl()),mE.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=>{wc("MEETING_CLAIM_HOST_KEY_RESPONSE",e.payload.body.bresult)})),Et(fe)),meetingMainEpics11:(e,t)=>e.pipe($t(`${Fr}`,`${$r}`),Tt(t),Xe((e=>{let[t,o]=e;return t.type===`${Fr}`?(mE.leaveMeeting(),wc(Xs,{})):t.type===`${$r}`&&(mE.endMeeting(),wc(Xs,{})),Ue(Ff(o,!1))}))),meetingMainEpics12:(e,t)=>e.pipe($t(`${Hr}`),Tt(t),Xe((e=>{let[t,o]=e;if(t.type===`${Hr}`&&o.meeting.meetingNumber&&!o.meeting.zlkJwtToken){const e={mn:o.meeting.meetingNumber.toString(),name:o.meeting.userName,customerKey:o.meeting.customerKey?ur(o.meeting.customerKey):""},{jbhLeave:t}={jbhLeave:`https://${yf}/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=Lr(1e4);if(o&&o.reason){const e=o.reason.replace(/{(\d+)}/g,(()=>t));o.reason=e}wc(Zs,o)})),Et(fe)),meetingMainEpics15:e=>yn(e,4265).pipe(ze((e=>{const{payload:{body:t}}=e,{nShareType:o}=t;return wc(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((()=>{mE.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})})))},KE=fn(zE,{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;EE&&EE.release().then((()=>{EE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),EE=await navigator.wakeLock.request("screen"),EE.addEventListener("release",(()=>{})))}catch(e){}})),_t((()=>st(document,"visibilitychange").pipe(Xe((async()=>{if("visible"===document.visibilityState){const{isSafari:e,isIOSMobile:t}=zi;EE&&EE.release().then((()=>{EE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),EE=await navigator.wakeLock.request("screen"))}else EE&&EE.release().then((()=>{EE=null}))})),Et(fe))))),wakeLockEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{EE&&EE.release().then((()=>{EE=null}))})),Et(fe))},WE,GE,{meetingInfoEpic:(e,t)=>e.pipe($t(`${jr}`),_t((e=>{const o=Object.assign({},e.payload,{password:ur(e.payload.password),topic:ur(e.payload.topic)}),{videoSDKUrl:n}={meetingSDKUrl:`https://${yf}/api/v1/wc/info`,videoSDKUrl:`https://${yf}/wc/lsdk`};return function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zoomsdkjsonpcallback";return new $((n=>{xE++;const r=`${o}${xE}`,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()}}))}(n,o).pipe(gt((e=>je({status:!1,result:e.toString(),errorCode:Rr}))),Xe((o=>{const[n,r]=(i=je(o),[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=>{FE.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?wc(Zs,{code:Pr.WrongPasscode,reason:"Incorrect passcode."}):3e3===e.errorCode&&"The role type error"===e.errorMessage?wc(Zs,{code:Pr.RoleTypeMissing,reason:"Role type error"}):e.errorCode===Rr?wc(Zs,{reason:"connection error"}):3e3===e.errorCode?wc(Zs,{reason:e.errorMessage,errorCode:Pr.CommonError}):300===e.errorCode?wc(Zs,{reason:"This account does not exist or does not belong to you",errorCode:Pr.CommonError}):124===e.errorCode&&"Parse lite sdk topic and pwd fail"===e.errorMessage?wc(Zs,{reason:"Topic is invalid",errorCode:Pr.CommonError}):124===e.errorCode&&"The java web token is expired or more than 2 days or ineffective."===e.errorMessage?wc(Zs,{reason:"The token has expired, is over 2 days old, or is ineffective.",errorCode:Pr.CommonError}):124===e.errorCode&&wc(Zs,{reason:"Verify JWT failed",errorCode:Pr.CommonError}))})),n.pipe(Gf((o=>{if(!0===o.status){const{result:{mid:r,websdkClientFeatureOptions:i,showRecommendVersion:s}}=o;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:u,encryptedGEORWC:d,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:w,mediaSDKPathPrefix:R,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(u||"{}"),encryptedGEORWC:JSON.parse(d||"{}"),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:w&&R?`${Ir(R)}/${w}`:void 0,zmk:O,fileTransfer:JSON.parse(T||"{}"),fileServerDomain:D,accountId:P}}return e})(o,e.payload);var n;s&&(null==e||null===(n=e.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 u=[je(Gr(a)),vn(BE,t,Br())],d=((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),u=$f[n];u&&(Array.isArray(u)?u:[u]).forEach((e=>{const t=e.mask?(a&e.mask)>0:a;o.push(je(e.action(t)))}))}))}return o})(i);d.length>0&&u.unshift(...d);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&&u.unshift(...l),tt(...u)}})))})),Ct(Ci(performance.now())))}))),pingRWCEpic:BE});var qE={exports:{}};qE.exports=function(){function e(e){for(var t=1;tt){var I;const A=o[t],C={dn2:ur(n),auth:r,browser:`${zi.browser}${zi.browserVersion} ${null!==(I=window)&&void 0!==I&&I.crossOriginIsolated?"SAB":""}`,trackAuth:i,mid:s,tid:u,lang:d,ts:l,"ZM-CID":E,_ZM_MTG_TRACK_ID:b||"",customer_key:ur(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:ZE,queryKey:"opt"},{key:YE,queryKey:"participantID"},{key:XE,queryKey:"zoomid"}].forEach((e=>{const t=Vi.get(e.key);void 0!==t&&(C[e.queryKey]=t)}));const w=c&&p&&h;w&&Object.assign(C,{bid:ur(c),confID:h}),Vi.get(eI)&&Object.assign(C,{isdj:1}),Ki()&&(Object.assign(C,{from:zi.isAndroidBrowser?"android":"ios"}),v&&Object.assign(C,{useABAudio:1})),Object.assign(C,{clientCaps:nI({isAudioBridgeEnabled:v&&Ki(),isBO:w,isFullHDVideoEnabled:y,isFullHDVideoShareEnabled:S})});const R=g?f.length>0?1:0:1;return Object.assign(C,{isCamera:R}),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 nI(e){const{isAudioBridgeEnabled:t,isBO:o,isFullHDVideoEnabled:n,isFullHDVideoShareEnabled:r}=e;let i=Op.WebCameraIndication|Op.SendMeetingTokenSeparately|Op.SmartSummary|Op.LocalRecording|Op.LocalRecordingGrantPermission|Op.UnifyErrorType;const s=Hs.getPTZCapability();return(s.pan||s.tilt||s.zoom)&&(i|=Op.SupportFarEndCameraControl),Hs.isSupportVideoShare()&&(i|=Op.SupportVideoShare),t&&Hs.isSupportAudioBridgeAVSync()&&(i|=Op.WebrtcAudioRtcpTime),Hs.isSupportShareMultiStream()&&(i|=Op.ShareMultiStream),Hs.isSupportVideoLTR()&&(i|=Op.VideoLTR),o||(i|=Op.RequestRemoteControl),n&&Hs.isSupportFullHDVideo()&&(i|=Op.SupportSend1080PVideo),r&&Hs.isSupportFullHDVideoShare()&&(i|=Op.SupportSend1080PVideoShare),i}function rI(e,t){return t?F(bt(t),mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==wp.Closed&&o===Di.Joined&&!n}))):F(mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==wp.Closed&&o===Di.Joined&&!n})))}const iI=Ns.createAgent();let sI;const aI=SE.getInstance();let uI;const dI=Vs.getInstance();let lI;const cI={zoomSocketStatus:wp.Closed,xmppSocketStatus:wp.Closed,mainSessionSocketStatus:wp.Closed,retryCount:0,rwgServerList:[]},pI=ko({[`${$o}`]:uE(((e,t)=>{let{payload:o}=t;e.zoomSocketStatus=o.status})),[`${Wo}`]:uE(((e,t)=>{let{payload:o}=t;const{rwgServerList:n}=e;n.find((e=>e.rwg===o.rwg))||n.push(o)})),[`${Go}`]:uE(((e,t)=>{let{payload:o}=t;e.retryCount=o})),[`${zo}`]:uE(((e,t)=>{let{payload:o}=t;e.xmppSocketStatus=o})),[`${Ko}`]:uE(((e,t)=>{let{payload:o}=t;e.mainSessionSocketStatus=o})),[`${qo}`]:()=>cI},cI),hI={epics0:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===wp.Closed})),_t((e=>{let[,o]=e;const{media:{patchedMediaSDKStatus:n}}=o;return(n===Ou.Loading?Tc(xl,1):Ue([0])).pipe(_t((()=>{const{socket:{retryCount:e,rwgServerList:o},meeting:n,breakoutRoom:r,video:i,share:s}=t.value;let a;const u={...n,retryCount:e,rwgServerList:o};if(i){const{cameraDevicesList:e,isFullHDVideoEnabled:t}=i;Object.assign(u,{cameraDevicesList:e,isFullHDVideoEnabled:t})}if(s){const{isFullHDVideoShareEnabled:e}=s;Object.assign(u,{isFullHDVideoShareEnabled:e})}if(r&&r.currentRoom.status===ap.Joining){const{currentRoom:{boId:e,boConfId:t,boToken:o}}=r;Object.assign(u,{bid:e,botk:o,confID:t})}if(a=n.zlkJwtToken?function(e){const t=oI(e);if(t){const{queryObject:o,rwgServer:n}=t,{topic:r,cv:i,meetingNumber:s}=e;return Object.assign(o,{topic:ur(r),iccv:i}),`wss://${n.rwg}/instantsdk/${s}?${new URLSearchParams(o).toString()}`}return null}(u):function(e){const t=oI(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:QE,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}(u),a){const e=(d=a,iI.connect(d),sI=new Q,ut((e=>iI.on(Ms.Message,e)),(e=>iI.off(Ms.Message,e)),(e=>e.data)).subscribe(sI),sI);return ct(e.pipe(mt((e=>"string"==typeof e)),ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),Jf(),Wf((e=>{if(0!==e.evt||!e.body||"invalid parameters!"!==e.body.test)return Uo(e);wc(Zs,{code:Pr.InvalidParameter,reason:"Invalid parameter"})})),Ct($o({status:wp.Connecting,rwgUrl:a}))),e.pipe(mt((e=>e instanceof ArrayBuffer)),ze((e=>jo(e)))))}var d;return fe})))}))),epics1:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===wp.Closed})),_t((()=>{const[e,o,n,r]=[Ms.Open,Ms.Close,Ms.Error,Ms.Inactive].map((e=>ut((t=>iI.on(e,t)),(t=>iI.on(e,t)))));return ct(e.pipe(Xe((()=>ct(je($o({status:wp.Connected})),dt(6e4).pipe(Tt(t),mt((e=>{let[,t]=e;return t.meeting.meetingStatus===Di.Initial&&!t.meeting.isMeetingReset})),ze((()=>(wc(Ys,{reason:wi.Failover}),xr(ki.NoHeartbeat))))))))),o.pipe(rI(t),ze((()=>(wc(Ys,{reason:wi.Failover}),xr(ki.Disconnect))))),r.pipe(rI(t),ze((()=>(wc(Ys,{reason:wi.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 dt(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})):(wc(Zs,{reason:"connection error",errorCode:Rr}),n.push(...Ff(t.value))),Ue(n)})),Ct(fi(null==e?void 0:e.rwc)))}return r||n!==Di.Joined||(wc(Ys,{reason:wi.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:wp.Closed}))):je($o({status:wp.Closed})))),bt(100),Ot((()=>{var e;t.value.socket.zoomSocketStatus===wp.Closed&&(iI.close(),null===(e=sI)||void 0===e||e.complete())})))},mI=fn(hI,{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),uI=new Q,ut((e=>aI.on(yE.Message,e)),(e=>aI.off(yE.Message,e))).subscribe(uI),uI))(i).pipe(mt((e=>void 0!==(null==e?void 0:e.evt))),ze((e=>Bo(e))),Ct(zo(wp.Connecting)))}))),xmppEpics2:(e,t)=>e.pipe($t(`${Lo}`),_t((()=>{const[e,o,n]=[yE.Open,yE.Close,yE.Error].map((e=>ut((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(wp.Connected))),o.pipe(rI(t,500),ze((()=>(wc(Ys,{reason:wi.Failover}),xr(ki.DisconnectXmpp))))),n.pipe(rI(t,500),ze((()=>(wc(Ys,{reason:wi.Failover}),xr(ki.OnError))))))}))),xmppEpics3:e=>e.pipe($t(`${Vo}`),yt(zo(wp.Closed)),bt(100),Ot((()=>{var e;aI.close(),null===(e=uI)||void 0===e||e.complete()})))},{mainSessionEpics0:(e,t)=>e.pipe($t(`${xo}`),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=>(dI.connect(e),lI=new Q,ut((e=>dI.on(Ms.Message,e)),(e=>dI.off(Ms.Message,e))).pipe(ze((e=>e.data))).subscribe(lI),lI))(i).pipe(ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),mt((e=>0!==e.evt)),Jf(),ze((e=>Ho(e))),Ct(Ko(wp.Connecting)))}))),mainSessionEpics1:(e,t)=>e.pipe($t(`${xo}`),_t((()=>{const[e,o,n]=[Ms.Open,Ms.Close,Ms.Error].map((e=>ut((t=>dI.on(e,t)),(t=>dI.on(e,t)))));return ct(e.pipe(yt(Ko(wp.Connected))),o.pipe(rI(t,500),ze((()=>(wc(Ys,{reason:wi.Failover}),xr(ki.DisconnectMChannel))))),n.pipe(rI(t,500),ze((()=>(wc(Ys,{reason:wi.Failover}),xr(ki.OnErrorMChannel))))))}))),mainSessionEpics2:e=>e.pipe($t(`${Fo}`),yt(Ko(wp.Closed)),Ot((()=>{var e;dI.close(),null===(e=lI)||void 0===e||e.complete()})))}),vI={id:"userId",type:e=>tp(e)?{userType:e,avatarBackgroundType:Math.floor(8*Math.random())+1}:{userType:e},role:e=>({userRole:e,isHost:ep(e)}),dn2:e=>({displayName:dr(e)}),bShareOn:"sharerOn",bSharePause:"sharerPause",bLocalRecordStatus:e=>({bLocalRecord:e}),bGuest:"isGuest",bCapsRequestLT:"isRequestLT",customerKey:"userIdentity"},gI=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=vI[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},fI={name:"displayName",node:e=>({userId:Number(e)}),role:e=>({userRole:Number(e)})},yI=e=>Object.keys(e).reduce(((t,o)=>{const n=fI[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}),{}),SI={attendeesList:[],assistantList:[],xmppAttendeeList:[],allowTalkAttendeesList:[],failoverAttendeesList:[],isAdmitAllSilentUsers:!1},bI=ko({[`${Pc}`]:uE(((e,t)=>{let{payload:o}=t;void 0!==o.add&&o.add.length>0&&o.add.forEach((t=>{if(t.userType===Xc.Assitant){const o=e.assistantList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.assistantList.push(t)}else if(op(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)}}}))})),[`${Fc}`]:uE(((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)}))})),[`${Mc}`]:uE(((e,t)=>{let{payload:o}=t;e.isAdmitAllSilentUsers=o})),[`${Uc}`]:uE((e=>{e.attendeesList.forEach((e=>{e.bRaiseHand&&(e.bRaiseHand=!1)}))})),[`${jc}`]:uE((e=>{e.attendeesList.forEach((e=>{e.feedback>0&&(e.feedback=0)}))})),[`${Nc}`]:uE(((e,t)=>{let{payload:o}=t;e.failoverAttendeesList.push(o)})),[`${Vc}`]:uE(((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)}))})),[`${Bc}`]:uE(((e,t)=>{let{payload:o}=t;const{jid:n,name:r}=o,i=e.xmppAttendeeList.find((e=>e.jid===n));i&&(i.displayName=r)})),[`${xc}`]:uE(((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)})),[`${Hc}`]:uE(((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)})),[`${Lc}`]:()=>SI},SI),EI={epics0:(e,t)=>yn(e,us).pipe(ze((e=>gI(e.payload.body))),Tt(t),Xe((e=>{let[t,o]=e,n=[Pc(t)];const{meeting:{userId:r,isWebinar:i,isOnHold:s},participants:{attendeesList:a,failoverAttendeesList:u,allowTalkAttendeesList:d}}=o,l=d.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)),wc($s,e)}));const s=t.add.filter((e=>e.userId!==r));if(s.length>0){const e=s.filter((e=>!op(e.userRole))).map((e=>{const t={...e};if(tp(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=u.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(Vc(t)),wc(Gs,e),i){const e=s.filter((e=>op(e.userRole)));e.length>0&&wc(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=>{wc(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&&wc(zs,o),i){const e=t.update.filter((e=>e.userId!==r&&l.includes(e.userId)));e.length>0&&wc(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(Nc({zoomID:t.zoomID,isOnHold:!0})),{...e,...t,reason:"on hold"}):(n.push(Nc({zoomID:t.zoomID,isOnHold:!1})),{...e,...t,reason:"failover"}):{...e,...t}:null})).filter((e=>!!e));if(wc(Ks,e),i){const e=t.remove.filter((e=>l.includes(e.userId)));e.length>0&&wc(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),wc(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===fE.rename){n.forEach((e=>{s.push(Bc(e))}));const e=n.map((e=>yI(e)));wc(qs,e)}if(o===fE.Remove){n.forEach((e=>{s.push(xc(e))}));const e=n.map((e=>({...yI(e),removed:!0})));wc(Js,e)}if([fE.Add,fE.List,fE.update].includes(o)){const e=n.map((e=>{const t=yI(e);return Object.keys(t).reduce(((e,o)=>(""!==t[o]&&Object.assign(e,{[o]:t[o]}),e)),{})}));if(wc(qs,e),s.push(Fc(e)),o===fE.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&&wc("MEETING_WEBINAR_ATTENDEE_RAISE_HAND",{bRaiseHand:e.bRaiseHand})}}}return Ue(s)}))),epics2:e=>yn(e,7951).pipe(Ot((e=>{!1===e.payload.body.bStarted&&wc("ADMIT_ALL_SILENT_USERS_END",e.payload.body.bStarted)})),ze((e=>Mc(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=>(wc(zs,{}),"bRaiseHand"===e.payload.body.key?Uc():jc()))))},II=fn(EI),AI={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:""},CI=ko({[`${Yo}`]:uE(((e,t)=>{let{payload:o}=t;e.audioDecodeStatus=o})),[`${Zo}`]:uE(((e,t)=>{let{payload:o}=t;e.audioEncodeStatus=o})),[`${on}`]:uE(((e,t)=>{let{payload:o}=t;e.sharingDecodeStatus=o})),[`${tn}`]:uE(((e,t)=>{let{payload:o}=t;e.sharingEncodeStatus=o})),[`${en}`]:uE(((e,t)=>{let{payload:o}=t;e.videoDecodeStatus=o})),[`${Xo}`]:uE(((e,t)=>{let{payload:o}=t;e.videoEncodeStatus=o})),[`${nn}`]:uE(((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}`]:uE(((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}`]:uE(((e,t)=>{let{payload:o}=t;e.isEnableDecoderInWorklet=o})),[`${an}`]:uE(((e,t)=>{let{payload:o}=t;e.patchedMediaSDKStatus=o})),[`${un}`]:uE(((e,t)=>{let{payload:o}=t;e.assetsPath=o})),[`${dn}`]:uE(((e,t)=>{let{payload:o}=t;e.enableAudioQos=o.audioQos,e.enableVideoQos=o.videoQos})),[`${ln}`]:uE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeReceiveReady=o})),[`${cn}`]:uE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSendReady=o})),[`${pn}`]:uE(((e,t)=>{let{payload:o}=t;e.isMediaAgentInitialized=o})),[`${hn}`]:uE(((e,t)=>{let{payload:o}=t;e.adaptedABOptionForMediaSDK=o})),[`${mn}`]:e=>({...AI,mediaConstraints:e.mediaConstraints,assetsPath:e.assetsPath,fileWithVersion:e.fileWithVersion,enforceMultipleVideos:e.enforceMultipleVideos,disableRenderLimits:e.disableRenderLimits,enforceVirtualBackground:e.enforceVirtualBackground,alternativeNameForVideoPlayer:e.alternativeNameForVideoPlayer})},AI),_I=new class{constructor(){this.state={mediaSDK:void 0,mediaSDKInstanceMap:new Map,tagName:"video-player"},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 wI,RI;!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.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"}(wI||(wI={})),function(e){e[e.WEBGL_LOST_IN_MULTI_VIEW=-32]="WEBGL_LOST_IN_MULTI_VIEW"}(RI||(RI={}));const OI="default-sesssion-key";var TI,DI,PI;function kI(e,t,o,n,r){const i=document.createElement("canvas");i.id=n;const s=WI(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*GI(i),i.style.height=t+"px",i.height=t*GI(i),i.ariaHidden="true",i.style.zIndex=o,i}function MI(e,t){const o=BI((()=>{WI(e,t.clientWidth,t.clientHeight),[wI.UPDATE_CANVAS_SIZE,wI.UPDATE_SHARING_DECODE_PARAM].forEach((o=>{var n;null===(n=UI(t.getSessionId()))||void 0===n||n.Notify_MeidaSDK(o,{width:t.clientWidth*GI(e),height:t.clientHeight*GI(e),canvas:e})})),e.style.width=t.clientWidth+"px",e.style.height=t.clientHeight+"px";try{e.width=t.clientWidth*GI(e),e.height=t.clientHeight*GI(e)}catch(e){}_I.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){$I.delete(e)}(e),null==r||r.disconnect(),n.removeEventListener("change",o)}}function LI(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 NI(e,t){Object.entries(t).forEach((([t,o])=>{e.getAttribute(t)||e.setAttribute(t,o)}))}function VI(e,t){const o=e.getAttribute(t);return!(!o||"true"!==o)}function UI(e=OI){var t;return null===(t=_I.get("mediaSDKInstanceMap").get(e))||void 0===t?void 0:t()}function jI(){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 BI(e,t){let o;return function(...n){clearTimeout(o),o=setTimeout((()=>{e(...n)}),t)}}function xI(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(!xI(o,r))return!1}else if(o!==r)return!1}return!0}function FI(e){return!e||"0"===e}function HI(e,t){null==e||e.Notify_MeidaSDK(wI.SEND_RENDER_LOG,{message:t})}!function(e){e.Video="video",e.Share="share"}(TI||(TI={})),function(e){e.DEFAULT="",e.MAIN="main"}(DI||(DI={})),function(e){e.Video_90P="0",e.Video_180P="1",e.Video_360P="2",e.Video_720P="3",e.Video_1080P="4"}(PI||(PI={}));const $I=new Map;function WI(e,t,o){const n=t>=2*window.screen.width||o>=2*window.screen.height?1:window.devicePixelRatio,r=$I.get(e);return $I.set(e,n),r&&r!==n&&_I.dispatch("scale",void 0,e.id),n}function GI(e){return $I.get(e)||window.devicePixelRatio}function zI(e,t){const{left:o,top:n,bottom:r,right:i,width:s,height:a}=e.getBoundingClientRect(),u=t.getBoundingClientRect();return{left:o-u.left,top:n-u.top,bottom:u.bottom-r,right:u.right-i,width:s,height:a}}const KI=[];for(let e=0;e<=1;e+=.01)KI.push(e);class qI{constructor(e,t){if(this.getRenderParams=t,this.el=document.createElement("div"),this.position=null,this.id="",this.removePositionObserve=null,this.viewId=`${_I.get("tagName")}-${jI()}`,this.getSDK=()=>UI(this.container.getSessionId()),!e)throw new Error(`The ${_I.get("tagName")} must have a ${_I.get("tagName")}-container as its ancestor element.`);this.container=e,this.el.style.width="100%",this.el.style.height="100%"}getElement(){return this.el}init(){this.removeSubscribe=_I.subscribe(((e,t,o)=>{o===this.getCanvas().id&&("resize"===e?(this.updateVideoPosition(),setTimeout((()=>{this.updateVideoPosition()}),300)):"scale"===e&&HI(this.getSDK(),`VPSC:${GI(this.getCanvas())}`))}))}getCanvas(){return this.container.getCanvas()}initObservePosition(){this.stopObservePosition(),this.removePositionObserve=function(e,t,o){const{wrapper:n=document.documentElement}=o,r=BI(t,300);let i,s;const a=(o=1,s=!1)=>{i&&(i.disconnect(),i=null);const{top:u,left:d,width:l,height:c,right:p,bottom:h}=zI(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)(u,h,d,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)(u,h,d,p,l,c),g={root:n,threshold:m?KI:o};m||(g.rootMargin=`${-u}px ${-p}px ${-h}px ${-d}px`);let f=!0,y=!0;s&&(y=!1),t({hide:v,cross:m,top:u,left:d,width:l,height:c,bottom:h,right:p}),r({hide:v,cross:m,top:u,left:d,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.updateVideoPosition(e)}),{wrapper:this.container})}stopObservePosition(){this.removePositionObserve&&(this.removePositionObserve(),this.removePositionObserve=null)}getCurrentPosition(e){return this.transformRectToPosition(zI(e,this.container))}transformRectToPosition(e){const{left:t,width:o,height:n,bottom:r,top:i}=e,s=GI(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(),this.id=e;const t=this.getCurrentPosition(this.el);this.addRender(Object.assign(Object.assign(Object.assign({},t),{canvas:this.getCanvas(),zone:this.viewId,userId:Number(e),ssrc:Number(e)}),this.getRenderParams())),this.position=t}updateVideoPosition(e){if(!this.id)return;const t=this.transformRectToPosition(e||zI(this.el,this.container));this.position&&xI(t,this.position)||(this.zoomRender(Object.assign(Object.assign(Object.assign({},t),{userId:Number(this.id),canvas:this.getCanvas(),RGBA:this.container.getRGBA(),zone:this.viewId}),this.getRenderParams())),this.position=t)}stopVideo(){this.stopObservePosition(),this.id&&this.position&&(this.id&&this.stopRender(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.position=null,this.id="")}updateVideoQuality(e){this.getSDK().Notify_MeidaSDK(wI.UPDATE_VIDEO_QUALITY,{userId:this.id,videoQuality:e})}destroy(){var e;this.stopVideo(),null===(e=this.removeSubscribe)||void 0===e||e.call(this)}}class JI{constructor(e){this.container=e,this.id="",this.getSDK=()=>{var e;return UI(null===(e=this.container)||void 0===e?void 0:e.getSessionId())},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){this.id=e,this.addRender({userId:Number(e),videodom:this.el})}stopVideo(){this.id&&(this.stopRender({userId:Number(this.id),videodom:this.el}),this.id="")}updateVideoQuality(e){}destroy(){this.stopVideo()}}class QI extends qI{addRender({width:e,height:t,x:o,y:n,canvas:r,zone:i,userId:s,left:a,bottom:u,top:d,fillMode:l,videoQuality:c}){this.getSDK().Notify_MeidaSDK(wI.ADD_RENDER_VIDEO,{width:e,height:t,x:o,y:n,canvas:r,zone:i,userId:s,left:a,bottom:u,top:d,fillMode:l,videoQuality:c})}zoomRender({width:e,height:t,x:o,y:n,userId:r,canvas:i,RGBA:s,zone:a,left:u,bottom:d,top:l}){this.getSDK().Notify_MeidaSDK(wI.ZOOM_RENDER,{width:e,height:t,x:o,y:n,userId:r,canvas:i,RGBA:s,zone:a,left:u,bottom:d,top:l})}stopRender({width:e,height:t,x:o,y:n,userId:r,canvas:i,doNotClean:s,RGBA:a,zone:u,left:d,bottom:l,top:c,videoQuality:p}){this.getSDK().Notify_MeidaSDK(wI.STOP_RENDER_VIDEO,{width:e,height:t,x:o,y:n,userId:r,canvas:i,doNotClean:s,RGBA:a,zone:u,left:d,bottom:l,top:c,videoQuality:p})}}class ZI extends JI{addRender({userId:e,videodom:t}){this.getSDK().Notify_MeidaSDK(wI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){this.getSDK().Notify_MeidaSDK(wI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}class YI extends qI{addRender({width:e,height:t,userId:o,canvas:n,isFromMainSession:r}){this.getSDK().Notify_MeidaSDK(wI.START_SHARING,{width:e,height:t,canvas:n,ssrc:o,isFromMainSession:r})}zoomRender(){}stopRender({canvas:e}){this.getSDK().Notify_MeidaSDK(wI.STOP_SHARING,{canvas:e})}}class XI extends JI{addRender({userId:e,videodom:t}){this.getSDK().Notify_MeidaSDK(wI.SWITCH_CANVAS_FOR_VIDEO_CAPTURE,[t]),this.getSDK().Notify_MeidaSDK(wI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){this.getSDK().Notify_MeidaSDK(wI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}const eA="node-id",tA="media-type",oA="video-quality",nA="share-source",rA="fill-mode",iA="stop-no-clean";class sA extends HTMLElement{static get observedAttributes(){return[eA,tA,oA]}constructor(){super(),this.container=null,LI(this,sA.customAttributes),this.getRenderParams=this.getParsedParams.bind(this),this.attachShadow({mode:"open"})}initRender(){var e,t,o;this.render&&this.render.destroy();const n=this.getAttribute(eA),r=n&&(null===(e=this.getCurrentMediaSDK())||void 0===e?void 0:e.isPreviewVideotag(n)),i=this.getAttribute(tA);let s=0;r?(this.render=new XI(this.getContainer()),s=1):i===TI.Share?(this.render=new YI(this.getContainer(),this.getRenderParams),s=2):(null===(t=this.getCurrentMediaSDK())||void 0===t?void 0:t.getWebRTCFlag())?(this.render=new ZI(this.getContainer()),s=4):(this.render=new QI(this.getContainer(),this.getRenderParams),s=3),this.getCurrentMediaSDK()&&HI(this.getCurrentMediaSDK(),`VPREN:${s}`),this.shadowRoot&&(this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(this.render.getElement())),this.render.init();const a=this.getAttribute(eA);FI(a)||null===(o=this.render)||void 0===o||o.playVideo(a)}getContainer(){return this.container||(this.container=this.closest(`${_I.get("tagName")}-container`)),this.container}getCurrentMediaSDK(){var e;return UI(null===(e=this.getContainer())||void 0===e?void 0:e.getSessionId())}getParsedParams(){return{fillMode:VI(this,rA),doNotClean:VI(this,iA),isFromMainSession:"main"===this.getAttribute(nA),videoQuality:this.getAttribute(oA)}}connectedCallback(){this.style.display="block",NI(this,sA.defaultValues),this.initRender(),this.removeSubscribe=_I.subscribe(((e,t,o)=>{var n,r;"failover"===e&&o===((null===(n=this.getContainer())||void 0===n?void 0:n.getSessionId())||OI)&&(this.initRender(),FI(this.getAttribute(eA))||null===(r=this.render)||void 0===r||r.playVideo(this.getAttribute(eA)))}))}disconnectedCallback(){var e,t;null===(e=this.removeSubscribe)||void 0===e||e.call(this),null===(t=this.render)||void 0===t||t.destroy()}attributeChangedCallback(e,t,o){var n,r;if(this.render)switch(e){case eA:Boolean(null===(n=this.getCurrentMediaSDK())||void 0===n?void 0:n.isPreviewVideotag(o))!==this.render instanceof XI&&this.initRender(),FI(t)&&!FI(o)?this.render.playVideo(o):FI(t)||FI(o)?FI(t)||this.render.stopVideo():(this.render.stopVideo(),this.render.playVideo(o));break;case tA:this.initRender();break;case oA:null===(r=this.render)||void 0===r||r.updateVideoQuality(o)}}}sA.customAttributes=[eA,tA,oA,nA,rA,iA],sA.defaultValues={[eA]:"",[tA]:TI.Video};const aA="session-id",uA="z-index";class dA extends HTMLElement{static get observedAttributes(){return[aA,uA]}constructor(){super(),this.canvasId="video-player-canvas-"+jI(),this.needInitCanvas=!1,this.callback=null,LI(this,dA.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"),NI(this,dA.defaultValues),this.needInitCanvas&&this.initCanvasEvents(),this.removeSubscribe=_I.subscribe(((e,t,o)=>{"failover"===e&&o===(this.getSessionId()||OI)&&(this.replaceCanvas(),this.initCanvasEvents())}))}disconnectedCallback(){var e,t,o;null===(e=this.removeListener)||void 0===e||e.call(this),null===(t=this.removeSubscribe)||void 0===t||t.call(this),this.callback&&(null===(o=UI(this.getSessionId()))||void 0===o||o.removeCallback(this.callback))}attributeChangedCallback(e,t,o){e===uA&&this.canvas&&o&&(this.canvas.style.zIndex=o)}createCanvas(){this.getCurrentMediaSDK()&&HI(this.getCurrentMediaSDK(),"VPCC"),this.canvas=kI(this.clientWidth,this.clientHeight,this.getAttribute(uA)||"",this.canvasId,(e=>HI(this.getCurrentMediaSDK(),e))),this.appendCanvas(this.canvas),this.isConnected?this.initCanvasEvents():this.needInitCanvas=!0}initCanvasEvents(){var e;this.removeListener=MI(this.canvas,this),this.callback=(e,t)=>{var o,n;e===RI.WEBGL_LOST_IN_MULTI_VIEW&&t.replaceCanvas&&t.canvasId===(null===(o=this.canvas)||void 0===o?void 0:o.id)&&(this.replaceCanvas(),null===(n=UI(this.getSessionId()))||void 0===n||n.Notify_MeidaSDK(wI.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()&&HI(this.getCurrentMediaSDK(),"VPRC"),this.canvas){null===(e=this.removeListener)||void 0===e||e.call(this);const t=kI(this.clientWidth,this.clientHeight,this.getAttribute(uA)||"",this.canvasId,(e=>HI(this.getCurrentMediaSDK(),e)));this.removeListener=MI(t,this),this.shadowRoot&&this.shadowRoot.replaceChild(t,this.canvas),this.canvas=t}}getCanvas(){return this.canvas||this.createCanvas(),this.canvas}getSessionId(){return this.getAttribute(aA)||void 0}getCurrentMediaSDK(){return UI(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"))}}dA.customAttributes=[],dA.defaultValues={};class lA{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 lA),this.instance}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(lu)&&(this._videoElement.id=lu,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}}function cA(e){const{audio:{isBackgroundNoiseSuppression:t,originalSound:o,highBitrate:n}}=e,r={currentSelect:Du.Denoise},i={highfidelity:!1,stereo:!1};if(o){Object.assign(r,{currentSelect:Du.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?Tu.Zoom:Tu.Browser,highBitrate:n}),r}function pA(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?Yp(o):Jp({userId:t,muted:o})}async function hA(e,t,o){var n,r;const{audio:{audioSsrc:i,activeMicrophone:s,activeSpeaker:a,isAllowToTalk:u,customizeAudioOption:{speakerOnly:d,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,w=vp(t),R=!!d||np(w.userRole)&&!u,O=null!=o?o:!R;Ki()&&(I||console.warn("Cannot start audio due to the service is not ready."),await Fe(Uf(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(wf());e=o,t=n}c&&e.findIndex((e=>e.deviceId===c))>-1&&(T=c),p&&t.findIndex((e=>e.deviceId===c))>-1&&(D=p)}if(h&&null!=m&&m.url){const e=lA.getInstance();await e.setAudioElement(m),T=e.audioElement}else lA.getInstance().stopAudioElement();return R&&!f&&zi.isIOSMobile&&await async function(){await navigator.mediaDevices.getUserMedia({audio:!0})}(),null===(n=e.joinComputerAudio(i,T,D,O,cA(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==w||!w.muted)}:void 0))||void 0===n?void 0:n.then((()=>{l&&(Ns.createAgent().mute(A,!0),e.muteAudio()),null!=w&&w.muted?e.muteAudio():e.unmuteAudio()}))}async function mA(e,t,o){const n=[],{audio:{isJoinComputerAudioBeforeSharingAudio:r,mutedBeforeSharingAudio:i}}=o,s=vp(o);return!0===r&&(await hA(e,o),n.push(Qp(void 0)),!1===i&&(n.push(mh(xa.SharingAudio)),t.mute(s.userId,!1)),n.push(Kp(void 0))),n}async function vA(e,t,o){const{audio:{isSharingAudio:n},meeting:{userId:r}}=o,i=[];if(i.push(pA(e,r,!0,o)),n){await e.leaveSharingAudio(!1),i.push(Xp(!1));const n=await mA(e,t,o);i.push(...n),setTimeout((()=>{wc(Ld,{state:"off"})}),0)}return i.push(Zp(!1)),i}async function gA(e,t,o){const{audio:{audioSsrc:n,activeMicrophone:r,activeSpeaker:i},meeting:{svcUrl:s,conId:a,reportDomain:u,supportLocalAB:d,abToken:l}}=o,c=vp(o),p=[];if(!SA()){const t=await async function(e,t){const o=[],n=vp(t),{audio:{isMicrophoneForbidden:r}}=t;return(null==n?void 0:n.audio)===Iu.Computer&&(o.push(Qp(!0)),o.push(Kp(n.muted)),n.muted||e.muteAudio(),await e.leaveComputerAudio(),o.push(jp(0)),r&&o.push(Up(!1))),o}(e,o);p.push(...t)}return await e.leaveSharingAudio(!0),await e.joinSharingAudio({ssrc:n,microphoneDeviceId:r,speakerDeviceId:i,isCaptureAudio:np(c.userRole),audioBridge:Ki()?{rwgHost:s,cid:a,nginxHost:u,abToken:l,supportLocalAB:d,useWebRTCOnDesktop:!zi.isAndroidOrIOSBrowser}:void 0}),p.push(Zp(!0)),p.push(Xp(!0)),p.push(pA(e,c.userId,!1,o)),p.findIndex((e=>e.type===`${Qp}`&&!0===e.payload))>-1&&(p.push(hh(Ba.SharingAudio)),t.mute(o.meeting.userId,!0)),setTimeout((()=>{wc(Ld,{state:"on"})}),0),p}lA.instance=void 0;const fA=()=>{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 yA(e,t,o){for(let n=0;ne.userId===r));o&&(o.displayName=i,t.splice(t.indexOf(r),1))}}}function SA(){return Hs.isSupportOpenMicWhenShareAudio()}function bA(e){return Hs.isSupportAudioDenoise(e)}function EA(){return Hs.isSupportStereoAudio()}function IA(){var e;return"function"==typeof(null===(e=window.navigator.hid)||void 0===e?void 0:e.requestDevice)}function AA(e,t,o){const{audio:{isAllowToTalk:n,customizeAudioOption:r},media:{audioDecodeStatus:i,audioEncodeStatus:s}}=e;return{encodeInitStatus:np(t.userRole)&&!n||o||null!=r&&r.speakerOnly||Ki()?"success":s,decodeInitStatus:Ki()?"success":i}}function CA(e,t,o){Ki()?Uf(t,o).subscribe((t=>{let[o,n]=t;o&&n&&e.joinOrLeaveVoip(!0)})):e.joinOrLeaveVoip(!0)}const _A=Ns.createAgent(),wA=kf(YS(Hs.getInstance())),RA=e=>!e.muted,OA=Ns.createAgent(),TA=kf(YS(Hs.getInstance())),DA=Ns.createAgent(),PA=kf(YS(Hs.getInstance())),kA={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}}},MA=ko({[`${Tp}`]:uE(((e,t)=>{let{payload:o}=t;e.asnIds={...o}})),[`${Dp}`]:uE(((e,t)=>{let{payload:o}=t;e.bCanUnmute=o})),[`${Pp}`]:uE(((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:gy()})})),[`${kp}`]:uE(((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))})),[`${Mp}`]:uE(((e,t)=>{let{payload:o}=t;e.isAllowToTalk=o,e.isAllowToTalkAttendeeConnected=!1})),[`${hh}`]:uE(((e,t)=>{let{payload:o}=t;e.mutedSource=o})),[`${mh}`]:uE(((e,t)=>{let{payload:o}=t;e.unmutedSource=o})),[`${Lp}`]:uE(((e,t)=>{let{payload:o}=t;e.audioSsrc=o})),[`${Np}`]:uE(((e,t)=>{let{payload:o}=t;e.bMutedUponEntry=o})),[`${Vp}`]:uE(((e,t)=>{let{payload:o}=t;e.isUserGrantCaptureAudio=o})),[`${Up}`]:uE(((e,t)=>{let{payload:o}=t;e.isMicrophoneForbidden=o})),[`${jp}`]:uE(((e,t)=>{let{payload:o}=t;e.webrtcRestartCount=o})),[`${Bp}`]:uE(((e,t)=>{let{payload:o}=t;e.microphoneDevicesList=o})),[`${xp}`]:uE(((e,t)=>{let{payload:o}=t;e.speakerDevicesList=o})),[`${Fp}`]:uE(((e,t)=>{let{payload:o}=t;e.activeMicrophone=o})),[`${Hp}`]:uE(((e,t)=>{let{payload:o}=t;e.activeSpeaker=o})),[`${$p}`]:uE(((e,t)=>{let{payload:o}=t;e.canPlayAudio=o})),[`${Gp}`]:uE(((e,t)=>{let{payload:o}=t;e.isComputerAudioLoading=o})),[`${sh}`]:uE(((e,t)=>{let{payload:o}=t;if(o){const{speakerOnly:t,mute:n,backgroundNoiseSuppression:r,originalSound:i,syncButtonsOnHeadset:s,mediaFile:a,microphoneId:u,speakerId:d,highBitrate:l}=o;e.customizeAudioOption.speakerOnly=t,e.customizeAudioOption.mute=n,e.customizeAudioOption.microphoneId=u,e.customizeAudioOption.speakerId=d,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=Ba.Inherited)}})),[`${zp}`]:uE(((e,t)=>{let{payload:o}=t;e.isAllowToTalkAttendeeConnected=o})),[`${Kp}`]:uE(((e,t)=>{let{payload:o}=t;e.mutedBeforeSharingAudio=o})),[`${Xp}`]:uE(((e,t)=>{let{payload:o}=t;e.isSharingAudio=o})),[`${Yp}`]:uE(((e,t)=>{let{payload:o}=t;e.isShareAudioMuted=o})),[`${qp}`]:uE(((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})})),[`${Jp}`]:uE(((e,t)=>{let{payload:o}=t;const n=e.localShareAudioUserMutedList.find((e=>e.userId===o.userId));n&&(n.muted=o.muted)})),[`${Qp}`]:uE(((e,t)=>{let{payload:o}=t;e.isJoinComputerAudioBeforeSharingAudio=o})),[`${Zp}`]:uE(((e,t)=>{let{payload:o}=t;e.isShareAudioEnabled=o})),[`${eh}`]:uE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${th}`]:uE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${oh}`]:uE(((e,t)=>{let{payload:o}=t;-1===e.locallyMutedAudioList.findIndex((e=>e===o))&&e.locallyMutedAudioList.push(o)})),[`${nh}`]:uE(((e,t)=>{let{payload:o}=t;const n=e.locallyMutedAudioList.findIndex((e=>e===o));-1!==n&&e.locallyMutedAudioList.splice(n,1)})),[`${rh}`]:uE(((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)})),[`${ih}`]:uE(((e,t)=>{let{payload:o}=t;const n=e.localUserAudioVolumeList.findIndex((e=>e.userId===o.userId));-1!==n&&e.localUserAudioVolumeList.splice(n,1)})),[`${ah}`]:uE(((e,t)=>{let{payload:o}=t;e.isBackgroundNoiseSuppression=o})),[`${uh}`]:uE(((e,t)=>{let{payload:o}=t;e.isHIDEnabled=o})),[`${dh}`]:uE(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${lh}`]:uE(((e,t)=>{let{payload:o}=t;e.isStopAllImcomingAudio=o})),[`${ch}`]:uE(((e,t)=>{let{payload:o}=t;e.isVerifiedAudioPermissionOnIOSMobile=o})),[`${ph}`]:uE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSignalReconnecting=o})),[`${vh}`]:uE(((e,t)=>{let{payload:o}=t;e.originalSound=o})),[`${gh}`]:uE(((e,t)=>{let{payload:o}=t;e.leaveAudioSource=o})),[`${fh}`]:uE(((e,t)=>{let{payload:o}=t;e.secondaryAudioMicrophoneId=o})),[`${yh}`]:uE(((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:gy()})})),[`${Sh}`]:uE(((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})})),[`${Wp}`]:(e,t)=>{let{dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:s,originalSound:a,highBitrate:u,isHIDEnabled:d,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}=e,{payload:f}=t;return f?{...kA,dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:{...kA.customizeAudioOption,speakerOnly:s.speakerOnly},originalSound:a,highBitrate:u,isHIDEnabled:d,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}:{...kA}}},kA),LA={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=[kp({code:i,sequence:n,nodeId:r})],{audio:{dialout:a}}=o,u=a.find((e=>e.sequence===n)),d={code:i};if(u&&(Object.assign(d,{phoneNumber:u.phoneNumber,uuid:u.uuid}),r&&Object.assign(d,{userId:r})),wc(Ad,d),i===$a.Success){if(wc(Cd),r&&bp(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(Hc({userId:r,key:"phoneNumber",value:e})),wc(zs,[{userId:r,phoneNumber:e}]))}}else[$a.Canceling,$a.Canceled,$a.CancelFailed].includes(i)?i===$a.Canceled?wc(wd):i===$a.CancelFailed&&wc(Rd):-1===[$a.Calling,$a.Ringing,$a.Accepted,$a.Success].indexOf(i)&&wc(_d);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=[],u=s.find((e=>e.sequence===n));return u&&(wc(Bd,{code:r,ip:u.ip,protocol:u.protocol,uuid:u.uuid}),a.push(Sh({sequence:n,transID:i,result:r}))),r===Mu.Success?wc(xd):[Mu.Success,Mu.Ringing].includes(r)||wc(Fd),Ue(a)})))},NA={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=bp(o),t=Object.keys(r).map((e=>({key:e,userId:r[e]}))),s=t.map((e=>e.userId));yA(t,s,e),n.length>0&&s.length>0&&yA(t,s,n),i=t.reduce(((e,t)=>({...e,[`${t.key}`]:{userId:t.userId,displayName:t.displayName}})),{}),wc(vd,Object.values(i))}return Tp(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=vp(o);if(s){const{isHost:e,bCoHost:t,userId:o,audio:a,muted:u}=s,d=e||t;r&&fr(o,n)&&(null!==a&&""!==a&&!0!==u||!d&&!i||wc(gd,ja.Spotlight))}})),Et(fe)),epics2:(e,t)=>yn(e,12037).pipe(Tt(t),Ot((e=>{let[,t]=e;const o=vp(t);null!==(null==o?void 0:o.audio)&&""!==(null==o?void 0:o.audio)&&1==(null==o?void 0:o.muted)&&wc(gd,ja.Unmute)})),Et(fe)),epics3:(e,t)=>yn(e,ds).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(Dp(e.payload.body.bCanUnmute)),void 0!==n){const o=vp(t.value);(null==o?void 0:o.audio)!==Iu.Computer&&(null==o?void 0:o.audio)!==Iu.Phone||0!=o.muted||e.payload.body.bMutedAll&&i.push(hh(Ba.PassiveByMuteAll))}return void 0!==r&&i.push(Np(e.payload.body.bMutedUponEntry)),Ue(i)}))),epics4:(e,t)=>yn(e,us).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===wp.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=>{wc(Id,e)})),i.length>0)return Cf(t).pipe(Xe((e=>{const{audio:{mutedSource:o,unmutedSource:n,isAllowToTalk:r,isShareAudioEnabled:s,isSharingAudio:a,isAudioBridgeSignalReconnecting:u,leaveAudioSource:d,customizeAudioOption:{speakerOnly:l}}}=t.value,c=e;return Ue(i).pipe(zf((async e=>{const t=[];if(e.audio!==c.audio)if(""===e.audio)wc(Sd,{source:d}),t.push(gh(void 0));else if(e.audio===Iu.Computer){const e=np(c.userRole)&&!r||!!l;a&&wc(fd),e&&(wc(fd),zi.isIOSMobile&&t.push(ch(!0))),u&&(wc(fd),t.push(ph(!1)))}else e.audio===Iu.Phone&&(c.audio===Iu.Computer&&(await wA.leaveComputerAudio(),t.push(gh(Fa.Pstn)),_A.joinOrLeaveVoip(!1)),wc(yd));if(""!==c.audio&&e.muted!==c.muted){if(e.muted!==c.muted)if(!0===e.muted){if(o!==Ba.Inherited){const e=null!=o?o:Ba.PassiveByMuteOne;wc(bd,{source:e})}c.audio!==Iu.Computer||s&&!SA()||wA.muteAudio()}else if(!1===e.muted){if(n!==xa.Inherited){const e=null!=n?n:xa.Passive;wc(Ed,{source:e})}c.audio===Iu.Computer&&wA.unmuteAudio()}void 0!==e.muted&&t.push(hh(void 0),mh(void 0))}return t})))})))}return fe}))),epics5:(e,t)=>yn(e,12036).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=vp(o),{media:{audioEncodeStatus:r}}=o,{promoterID:i,bAllowTalk:s}=t.payload.body;if((null==n?void 0:n.userId)===i){if(wc(Md,s),s)return"success"!==r&&wA.enableAudioEncode(),Af("audio",r,"success").pipe(Xe((e=>(e&&wc(gd,ja.AllowToTalk),fe))),Ct(Mp(!0)));if(_A.mute(i,!0),(null==n?void 0:n.audio)===Iu.Computer)return wA.leaveComputerAudio(),dt(300).pipe(Ot((async()=>{(fA()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{hA(wA,o,!1)}))})),Et(fe),Ct(Mp(!1),hh(Ba.Inherited)))}return fe}))),epics6:e=>yn(e,8205).pipe(Ot((e=>{wc("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=vp(o);(null==n?void 0:n.audio)===Iu.Phone?_A.audioDrop(n.userId):(null==n?void 0:n.audio)===Iu.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=Cf(t).pipe(Xe((e=>{if(r===Iu.Computer&&(null==e||!e.audio)){const{encodeInitStatus:o,decodeInitStatus:n}=AA(t.value,e);return Af("audio",o,n).pipe(mt((e=>{let[t,o]=e;return t&&o})),Ot((()=>{(fA()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{CA(_A,t.value),hA(wA,t.value)}));const{audio:{locallyMutedAudioList:e,localUserAudioVolumeList:o,isStopAllImcomingAudio:n}}=t.value;e.length>0&&e.forEach((e=>{wA.muteOrUnmuteOtherAudio(e,!0)})),o.length>0&&o.forEach((e=>{wA.adjustOtherAudioVolume(e.userId,e.volume)})),n&&wA.stopAllIncomingAudio(!0)})),yt(ai(void 0)))}return fe})));return wc(Vd,i),ct(je(Lp(i)),s)}))),epics9:(e,t)=>yn(e,7952).pipe(_t((e=>Tc(yd,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&&wc(Od,{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=vp(o);var r;(r=n,(null==r?void 0:r.audio)===Iu.Computer?Promise.resolve():Oc({event:Ws,operations:[mt((e=>void 0!==e.audio&&""!==e.audio)),ft(1)]},(e=>{let{audio:t}=e;return t===Iu.Phone||t===Iu.Computer}))).then((()=>{wc(fd)}));const{meeting:{isCurrentUserMutedBeforeReset:i},audio:{bMutedUponEntry:s,isUserGrantCaptureAudio:a,isAllowToTalk:u,activeMicrophone:d}}=o,{payload:{data:l}}=t,c=[Vp(!0)];if(n){!0===n.muted&&!1===u&&(c.push(hh(Ba.Inherited)),_A.mute(n.userId,!0));const e=a||n.isHost||u;(!0===i||!e&&s)&&(c.push(hh(Ba.Inherited)),_A.mute(n.userId,!0),i&&c.push(ui(void 0))),l&&d!==l&&c.push(Fp(l))}return Ue(c)}))),epics11:e=>In(e,Va.UserForbiddedCaptureAudio).pipe(Ot((()=>{wc(Td)})),yt(Up(!0))),epics12:e=>In(e,Va.AudioWebsocketBroken).pipe(Ot((()=>{wc(Dd)})),Et(fe)),epics13:(e,t)=>In(e,Va.AudioZeroData).pipe(Tt(t),Wf((e=>{let[,t]=e;const{audio:{webrtcRestartCount:o,activeMicrophone:n}}=t;if(o<3)return wA.restoreWebRTC(n),jp(o+1)}))),epics14:(e,t)=>e.pipe($t(`${$p}`),mt((e=>!1===e.payload)),Xe((()=>(wc(Pd),vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1))).pipe(Ot((()=>{CA(_A,t.value),hA(wA,t.value)})),yt($p(!0))))))),epics15:e=>In(e,[Va.JoinComputerAudioComplete,Va.JoinSharingAudioComplete,Va.LeaveComputerAudioComplete,Va.LeaveSharingAudioComplete]).pipe(Ot((()=>{Pf.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:u}}=n,d=vp(n),l=Cp(n);let c=l.length>0,p=l.some(RA);r&&(c=c||Boolean(a.length),p=p||u.some(RA));const h=((null==d?void 0:d.audio)===Iu.Computer||(null==d?void 0:d.audio)===Iu.Phone)&&"success"===i&&!(null!=d&&d.muted)&&c,m=((null==d?void 0:d.audio)===Iu.Computer||(null==d?void 0:d.audio)===Iu.Phone)&&"success"===s&&c&&p;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?h?(wc(Nd,o.payload),eh(o.payload)):eh(hu):m?(wc(Nd,o.payload),th(o.payload)):th(hu)}))),epics17:(e,t)=>yn(e,us).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=>{wA.muteOrUnmuteOtherAudio(e,!1)})),Ue(s.map((e=>[nh(e),ih({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&&!SA()&&a.push(Kp(!0)),a.push(hh(Ba.Active)),_A.mute(r,!0);else if(!i||SA()){i&&a.push(Kp(!1));const e=vp(n);(s||null!=e&&e.isHost||null!=e&&e.bCoHost)&&(a.push(mh(xa.Active)),_A.mute(r,!1))}return Ue(a)}))),epics19:e=>yn(e,12040).pipe(Ot((e=>{const{payload:{body:{mode:t}}}=e;wA.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(Hp(o)):n===Va.JoinComputerAudioComplete&&null!==o&&i!==o&&s.push(Fp(o)),n===Va.AudioSpeakerSetSuccess?wc(Ud,!0):n===Va.AudioSpeakerSetError&&wc(Ud,!1),Ue(s)})))},VA=fn(NA,{shareAudioEpics0:(e,t)=>En(e,us).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(qp({userId:e.id,isFromMainSession:!!e.bShareToBORooms}))})),Ue(s)}))),shareAudioEpics1:(e,t)=>In(e,Va.SharingDesktopStreamHaveAudio).pipe(mt((()=>!t.value.audio.secondaryAudioMicrophoneId)),_t((()=>yn(e,us).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),zf((async()=>{const e=t.value;return await gA(TA,OA,e)})),Ct(Zp(!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)})),zf((async e=>{let[,t]=e;return await vA(TA,OA,t)}))),shareAudioEpics3:(e,t)=>yn(e,us).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===wp.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 Cf(t).pipe(Xe((e=>{const t=[];return o.findIndex((e=>e.audio===Iu.Computer))>-1&&(null==e?void 0:e.audio)!==Iu.Computer&&!SA()&&(t.push(Qp(!0)),t.push(Kp(!0))),Ue(t)})))}return fe}))),shareAudioEpics4:(e,t)=>e.pipe($t(`${wh}`),Le(he),Tt(t),mt((e=>{var t;let[,o]=e;return!0===(null===(t=o.audio)||void 0===t?void 0:t.isShareAudioEnabled)})),zf((async e=>{let[t,o]=e;const{payload:n}=t,{audio:{isShareAudioMuted:r,isSharingAudio:i}}=o,s=[];if(n===qa.End){const e=await vA(TA,OA,o);s.push(...e)}else if(n===qa.Paused){if(!1===r&&!0===i){await TA.leaveSharingAudio(!0),s.push(Xp(!1));const e=await mA(TA,OA,o);s.push(...e),setTimeout((()=>{wc(Ld,{state:"off"})}),0)}}else if(n===qa.Sharing&&!1===r&&!1===i){const e=await gA(TA,OA,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;TA.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}),wc(jd)})),Xe((()=>fe)))},{audioBridgEpics0:e=>yn(e,4299).pipe(Ot((e=>{const{payload:t}=e;PA.passThroughRWGMessage(t)})),Et(fe)),audioBridgEpics1:e=>In(e,Va.AudioBridgeReconnectStart).pipe(Xe((()=>(DA.joinOrLeaveVoip(!1),Ue([ph(!0),gh(Fa.Failover)]))))),audioBridgEpics2:(e,t)=>In(e,Va.AudioBridgeReconnectEnd).pipe(Ot((()=>{CA(DA,t.value)})),Et(fe)),audioBridgEpics3:e=>yn(e,us).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;PA.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((()=>(wc(Ys,{reason:wi.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;PA.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;PA.changeActiveVideoSsrc(t)})),Et(fe)),audioBridgEpics7:(e,t)=>In(e,[Va.RecoverWebrtcAudio,Va.AudioStreamFailed]).pipe(Xe((()=>{const e=vp(t.value),o=[];return(null==e?void 0:e.audio)===Iu.Computer&&(PA.leaveComputerAudio(),fA()?(DA.joinOrLeaveVoip(!1),o.push(gh(Fa.EndedBySystem)),o.push(jp(0))):hA(PA,t.value)),Ue(o)}))),audioBridgEpics8:e=>In(e,[Va.AudioBridgeFirstRecvData,Va.AudioBridgeCanSendData]).pipe(ze((e=>{const{payload:{type:t}}=e;return t===Va.AudioBridgeFirstRecvData?(wc(Fl),ln(!0)):(wc(Hl),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(Bi.EnforceWebRTCAudio,1===Number(t)||1===Number(o),Li.Memory)}})),Et(fe))},LA);var UA="object"==typeof global&&global&&global.Object===Object&&global,jA="object"==typeof self&&self&&self.Object===Object&&self,BA=UA||jA||Function("return this")(),xA=BA.Symbol,FA=Object.prototype,HA=FA.hasOwnProperty,$A=FA.toString,WA=xA?xA.toStringTag:void 0,GA=Object.prototype.toString,zA="[object Null]",KA="[object Undefined]",qA=xA?xA.toStringTag:void 0;function JA(e){return null==e?void 0===e?KA:zA:qA&&qA in Object(e)?function(e){var t=HA.call(e,WA),o=e[WA];try{e[WA]=void 0;var n=!0}catch(e){}var r=$A.call(e);return n&&(t?e[WA]=o:delete e[WA]),r}(e):function(e){return GA.call(e)}(e)}function QA(e){return null!=e&&"object"==typeof e}var ZA=Array.isArray;function YA(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var XA="[object AsyncFunction]",eC="[object Function]",tC="[object GeneratorFunction]",oC="[object Proxy]";function nC(e){if(!YA(e))return!1;var t=JA(e);return t==eC||t==tC||t==XA||t==oC}var rC,iC=BA["__core-js_shared__"],sC=(rC=/[^.]+$/.exec(iC&&iC.keys&&iC.keys.IE_PROTO||""))?"Symbol(src)_1."+rC:"",aC=Function.prototype.toString;function uC(e){if(null!=e){try{return aC.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var dC=/^\[object .+?Constructor\]$/,lC=Function.prototype,cC=Object.prototype,pC=lC.toString,hC=cC.hasOwnProperty,mC=RegExp("^"+pC.call(hC).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vC(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!YA(e)||(t=e,sC&&sC in t))&&(nC(e)?mC:dC).test(uC(e));var t}(o)?o:void 0}var gC=vC(BA,"WeakMap"),fC=9007199254740991,yC=/^(?:0|[1-9]\d*)$/;function SC(e,t){var o=typeof e;return!!(t=null==t?fC:t)&&("number"==o||"symbol"!=o&&yC.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=EC}function AC(e){return null!=e&&IC(e.length)&&!nC(e)}var CC=Object.prototype;function _C(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||CC)}function wC(e){return QA(e)&&"[object Arguments]"==JA(e)}var RC=Object.prototype,OC=RC.hasOwnProperty,TC=RC.propertyIsEnumerable,DC=wC(function(){return arguments}())?wC:function(e){return QA(e)&&OC.call(e,"callee")&&!TC.call(e,"callee")},PC="object"==typeof exports&&exports&&!exports.nodeType&&exports,kC=PC&&"object"==typeof module&&module&&!module.nodeType&&module,MC=kC&&kC.exports===PC?BA.Buffer:void 0,LC=(MC?MC.isBuffer:void 0)||function(){return!1},NC={};NC["[object Float32Array]"]=NC["[object Float64Array]"]=NC["[object Int8Array]"]=NC["[object Int16Array]"]=NC["[object Int32Array]"]=NC["[object Uint8Array]"]=NC["[object Uint8ClampedArray]"]=NC["[object Uint16Array]"]=NC["[object Uint32Array]"]=!0,NC["[object Arguments]"]=NC["[object Array]"]=NC["[object ArrayBuffer]"]=NC["[object Boolean]"]=NC["[object DataView]"]=NC["[object Date]"]=NC["[object Error]"]=NC["[object Function]"]=NC["[object Map]"]=NC["[object Number]"]=NC["[object Object]"]=NC["[object RegExp]"]=NC["[object Set]"]=NC["[object String]"]=NC["[object WeakMap]"]=!1;var VC,UC="object"==typeof exports&&exports&&!exports.nodeType&&exports,jC=UC&&"object"==typeof module&&module&&!module.nodeType&&module,BC=jC&&jC.exports===UC&&UA.process,xC=function(){try{return jC&&jC.require&&jC.require("util").types||BC&&BC.binding&&BC.binding("util")}catch(e){}}(),FC=xC&&xC.isTypedArray,HC=FC?(VC=FC,function(e){return VC(e)}):function(e){return QA(e)&&IC(e.length)&&!!NC[JA(e)]},$C=Object.prototype.hasOwnProperty;var WC=function(e,t){return function(o){return e(t(o))}}(Object.keys,Object),GC=Object.prototype.hasOwnProperty;function zC(e){if(!_C(e))return WC(e);var t=[];for(var o in Object(e))GC.call(e,o)&&"constructor"!=o&&t.push(o);return t}function KC(e){return AC(e)?function(e,t){var o=ZA(e),n=!o&&DC(e),r=!o&&!n&&LC(e),i=!o&&!n&&!r&&HC(e),s=o||n||r||i,a=s?function(e,t){for(var o=-1,n=Array(e);++o-1},e_.prototype.set=function(e,t){var o=this.__data__,n=YC(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this};var t_=vC(BA,"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 n_(e){var t=-1,o=null==e?0:e.length;for(this.clear();++ta))return!1;var d=i.get(e),l=i.get(t);if(d&&l)return d==t&&l==e;var c=-1,p=!0,h=o&O_?new __:void 0;for(i.set(e,t),i.set(t,e);++c4294966272&e,nw=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 rw(e){let{captureWidth:t=0,captureHeight:o=0}=e||{};const{hd:n}=e||{};return 0!==t&&0!==o||(n&&Hs.isSupportSending720P()?(t=1280,o=720):(t=640,o=360)),{captureWidth:t,captureHeight:o}}function iw(e,t){return"default"===e||t.some((t=>t.deviceId===e))||[nu.Environment,nu.User,nu.Left,nu.Right].includes(e)}function sw(e,t,o){const n=[],{video:{videoSsrc:r,activeCamera:i}}=t,{cameraId:s=i,videoElement:a,originalRatio:u,ptz:d,hd:l,fullHd:c,mediaFile:p,fps:h}=o||{};let m;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[];e.id?m=e.id:(m=Sr("__ZOOM_SDK_SELF_VIDEO_@__"),e.id=m)}let v=null!=h?h:Ru.Default;v=Math.max(Ru.Min,v),v=Math.min(Ru.Max,v);const{captureWidth:g,captureHeight:f}=rw(o),y=!!c&&Hs.isSupportFullHDVideo();e.updateVideoFullhdValue(y);let S=Promise.resolve(s);if(p&&p.url){const e=lA.getInstance();S=e.setVideoElement(p).then((()=>e.videoElement))}else lA.getInstance().stopVideoElement();return S.then((t=>{e.startCaptureVideo(r,t,g,f,m,zi.isAndroidOrIOSBrowser,!u&&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()}(),d,v)})),n.push(km({cameraId:s,captureWidth:g,captureHeight:f,videoElement:"string"==typeof a?a:a instanceof HTMLVideoElement?_r(a):void 0,originalRatio:u,ptz:d,hd:l,fullHd:c,mediaFile:p,fps:v})),n}function aw(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 uw(e,t){let o="",n=t;switch(e){case gu.Down:n=-t,o="tilt";break;case gu.Up:o="tilt";break;case gu.Left:n=-t,o="pan";break;case gu.Right:o="pan";break;case gu.ZoomIn:o="zoom";break;case gu.ZoomOut:n=-t,o="zoom"}return{key:o,range:n}}function dw(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(AC(e)&&(ZA(e)||"string"==typeof e||"function"==typeof e.splice||LC(e)||HC(e)||DC(e)))return!e.length;var t=A_(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(_C(e))return!zC(e).length;for(var o in e)if(tw.call(e,o))return!1;return!0}(t)?null:t}function lw(e){return{pan:(e&fu.Pan)===fu.Pan,tilt:(e&fu.Tilt)===fu.Tilt,zoom:(e&fu.Zoom)===fu.Zoom}}function cw(e){const{isAndroidBrowser:t,isIOSMobile:o,isFirefox:n,isSupportImageCapture:r,isSupportMediaStreamTrackProcessor:i,isSupportOffscreenCanvas:s}=zi,a=t&&!n,u="function"!=typeof window.SharedArrayBuffer&&a;return o&&"function"==typeof VideoFrame||u||!Ji()&&!e&&!Tf()&&(r||i)&&s}function pw(){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 hw(e,t,o){const{meeting:{userId:n},video:{isSupportHDVideo:r,renderedVideoList:i,maximumNumbeOfHDSubscriptions:s,receivedVideoMaxQuality:a}}=o,u=e===n;let d=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)||u||(console.warn(`Warning: Web Video SDK currently only supports subscribing to ${o} 720p video stream, so quality has been downgraded to 360p`),d=Ja.Video_360P))}else console.warn("Can not subscribe 720P video stream,will downgrade to 360P stream"),d=Ja.Video_360P;const l=Math.max(a,Ja.Video_360P);return[d,Math.min(d,l)]}const mw=Ns.createAgent(),vw=YS(Hs.getInstance());let gw,fw;async function yw(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 Sw(e,t,o){if(e===ou)return ou;{let n=e;if(t){const t=await function(e){return new Promise(((t,o)=>{try{gw&&fw||(gw=document.createElement("canvas"),fw=gw.getContext("2d"));const n=gw,r=fw;if(r){r.clearRect(0,0,gw.width,gw.height);const i=new Image;i.src=e,br(e)&&(i.crossOrigin="");const s=16/9,a=1280,u=Math.floor(a/s);n.width=a,n.height=u,i.onload=()=>{const{width:e,height:d}=i,l=d*s;if(l>e){const t=e,o=Math.floor(e/s),n=0,l=(d-o)/2;null==r||r.drawImage(i,n,l,t,o,0,0,a,u)}else{const t=l,o=d,n=(e-t)/2,s=0;r.drawImage(i,n,s,t,o,0,0,a,u)}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 yw(uu,n,!!t);return(null!=o?o:document.body).appendChild(r),e}}return null}async function bw(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:u}=e;let d=e;!t.video.customizedVideoOption||e.captureWidth&&e.captureHeight||(d=t.video.customizedVideoOption);const{captureWidth:l,captureHeight:c}=rw(d),p=document.createElement("div");let h;p.style.display="none",h=i?await Sw(i,s,p):null;let m=Sr(au);if(o){const t=Of(o);t.id?m=t.id:t.id=m;try{a&&o.width!==a&&(o.width=a),u&&o.height!==u&&(o.height=u)}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!=u?u:214,e.id=m,p.appendChild(e)}return null==r||r.appendChild(p),{captureWidth:l,captureHeight:c,imageId:h,canvasId:m,divElement:p}}async function Ew(e,t,o,n){const r=Array.isArray(e)?e:e&&[e];if((null==r?void 0:r.length)>0){gw&&fw||(gw=document.createElement("canvas"),fw=gw.getContext("2d"));const i=gw,s=fw;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:u,height:d}=a;s.drawImage(a,0,0,u,d,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 yw(du,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 Iw(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!==ou&&e.imageUrl?async function(e,t,o,n){const{canvasId:r,imageId:i,captureHeight:s,captureWidth:a,divElement:u}=await bw(e,o,n),{cameraId:d}=e,{video:{videoSsrc:l,activeCamera:c}}=o;return t.startVirtualBackgroundSetting(r,i,l,null!=d?d:c,a,s),u}(e,t,o,n).then((e=>r?Rm(!0):Fe(Tc(Xu,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&&u===Eu.VirtualBackground&&!d||async function(e,t,o){const{imageUrl:n,cropped:r}=e;if(n){const e=await Sw(n,r);e&&(o.video.backgroundMode===Eu.Mask&&(t.stopMaskSetting(!0),await yr((()=>{t.stopVirtualBackgroundSetting()}),0)),t.updateVirtualBackgroundImage(e),e!==ou&&setTimeout((()=>{ff(e)}),0))}else t.updateVirtualBackgroundImage(null)}(e,t,o):Promise.reject("Cannot load virtual background model.")))}function Cw(e,t,o,n){const{video:{mask:{isMaskConfigured:r,imageSrc:i,clip:s},backgroundMode:a,isCurrentUserStartedVideo:u},meeting:{isCurrentUserStartVideoBeforeReset:d}}=o;return n||!r&&e.imageUrl?async function(e,t,o,n){const{canvasId:r,imageId:i,captureHeight:s,captureWidth:a,divElement:u}=await bw(e,o,n),{cameraId:d,clip:l,rootWidth:c=1280,rootHeight:p=720}=e,h=l?await Ew(l,c,p,u):null,{video:{videoSsrc:m,activeCamera:v}}=o;return h?(t.startMaskSetting(r,i,h,m,null!=d?d:v,c,p,a,s),u):Promise.reject("Clip is empty")}(e,t,o,n).then((e=>u?$m(!0):Fe(Tc(ad,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===Eu.Mask&&e.imageUrl===i&&Iw(e.clip,s)&&!d?Promise.resolve(!0):async function(e,t,o){const{imageUrl:n,cropped:r,clip:i,rootWidth:s,rootHeight:a}=e,{video:{mask:{imageSrc:u,cropped:d,clip:l},backgroundMode:c}}=o;if(n){if(c===Eu.VirtualBackground&&(t.stopVirtualBackgroundSetting(!0),await yr((()=>{t.stopMaskSetting()}),0)),n!==u||r!==d){const e=await Sw(n,r);e&&(t.updateMaskBackgroundImage(e),setTimeout((()=>{ff(e)}),0))}if((!Iw(i,l)||!u)&&i&&s&&a){const e=await Ew(i,s,a);e&&(t.updateMaskClip(e,s,a),setTimeout((()=>{ff(e)}),0))}}else t.updateMaskBackgroundImage(null),t.updateMaskClip(null,s,a)}(e,t,o)}const _w=Ns.createAgent(),ww=YS(Hs.getInstance()),Rw=Ns.createAgent(),Ow=YS(Hs.getInstance()),Tw={videoSsrc:0,cameraDevicesList:[],activeCamera:zi.isAndroidOrIOSBrowser?nu.User:"default",activeVideoId:0,isCurrentUserStartedVideo:!1,spotlightUserList:[],isCaptureForbidden:!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:Eu.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:Pu.WebGL},Dw=ko({[`${rm}`]:uE(((e,t)=>{let{payload:o}=t;e.videoSsrc=o})),[`${sm}`]:uE(((e,t)=>{let{payload:o}=t;e.cameraDevicesList=o})),[`${am}`]:uE(((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})),[`${im}`]:uE(((e,t)=>{let{payload:o}=t;e.activeVideoId=o.userId})),[`${um}`]:uE(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartedVideo=o})),[`${dm}`]:uE(((e,t)=>{let{payload:o}=t;e.spotlightUserList=o})),[`${lm}`]:uE(((e,t)=>{let{payload:o}=t;e.isCaptureForbidden=o})),[`${cm}`]:uE(((e,t)=>{let{payload:o}=t;e.receivedVideoMaxQuality=o})),[`${pm}`]:uE(((e,t)=>{let{payload:o}=t;e.isVideoMuted=o})),[`${hm}`]:uE(((e,t)=>{let{payload:o}=t;e.isCaptureCameraLoading=o})),[`${mm}`]:uE(((e,t)=>{let{payload:o}=t;e.isCameraTaken=o})),[`${gm}`]:uE(((e,t)=>{let{payload:o}=t;e.receivedVideoDimension=o})),[`${fm}`]:uE(((e,t)=>{let{payload:o}=t;e.subscribedVideoList.includes(o)||e.subscribedVideoList.push(o)})),[`${ym}`]:uE(((e,t)=>{let{payload:o}=t;const n=e.subscribedVideoList.indexOf(o);n>=0&&e.subscribedVideoList.splice(n,1)})),[`${Em}`]:uE(((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})})),[`${Im}`]:uE(((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)})),[`${Sm}`]:uE(((e,t)=>{let{payload:o}=t;e.isFollowHostVideoLayout=o})),[`${bm}`]:uE(((e,t)=>{let{payload:o}=t;e.hostDragLayout=o})),[`${Am}`]:uE(((e,t)=>{let{payload:o}=t;e.isSupportHDVideo=o})),[`${Cm}`]:uE(((e,t)=>{let{payload:o}=t;e.maximumNumbeOfHDSubscriptions=o})),[`${_m}`]:uE(((e,t)=>{let{payload:o}=t;e.bCanUnmuteVideo=o})),[`${wm}`]:uE(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBPreloadReady=o})),[`${Rm}`]:uE(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBConfigured=o})),[`${Om}`]:uE(((e,t)=>{let{payload:o}=t;e.virtualBackground.imageSrc=o.imageUrl,e.virtualBackground.cropped=o.cropped,e.backgroundMode=Eu.VirtualBackground})),[`${Pm}`]:uE(((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)})),[`${Tm}`]:uE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${Dm}`]:uE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${km}`]:uE(((e,t)=>{let{payload:o}=t;const{cameraId:n,captureWidth:r,captureHeight:i,videoElement:s,originalRatio:a,ptz:u,hd:d,fullHd:l,mediaFile:c,fps:p}=o;e.activeCamera=n,e.customizedVideoOption={captureWidth:r,captureHeight:i,videoElement:s,originalRatio:a,ptz:u,hd:d,fullHd:l,fps:p},gr(e.mediaPlaybackFile,c)||(e.mediaPlaybackFile=c,e.isUsingMediaPlayback=!(null==c||!c.url))})),[`${Mm}`]:uE(((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})}})),[`${Lm}`]:uE(((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}})})),[`${Nm}`]:uE(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isRequested=o})),[`${Vm}`]:uE(((e,t)=>{let{payload:o}=t;const{isInControl:n,userId:r}=o;e.currentCameraControlStatus.isInControl=n,e.currentCameraControlStatus.controllingUserId=r})),[`${Um}`]:uE(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.controlledUserList.includes(o)||e.farEndCameraControlStatus.controlledUserList.push(o)})),[`${jm}`]:uE(((e,t)=>{let{payload:o}=t;const n=e.farEndCameraControlStatus.controlledUserList.indexOf(o);-1!==n&&e.farEndCameraControlStatus.controlledUserList.splice(n,1)})),[`${Bm}`]:uE(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isCameraMoving="start"===o.cmd})),[`${xm}`]:uE(((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])}))})),[`${Fm}`]:uE(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.isControlling=o})),[`${Hm}`]:uE(((e,t)=>{let{payload:o}=t;e.networkQualityBroadcastTime=o})),[`${$m}`]:uE(((e,t)=>{let{payload:o}=t;e.mask.isMaskConfigured=o})),[`${Gm}`]:uE(((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=Eu.Mask})),[`${Wm}`]:uE(((e,t)=>{let{payload:o}=t;e.backgroundMode=o})),[`${zm}`]:uE(((e,t)=>{let{payload:o}=t;e.capturedVideoDimension=o})),[`${Km}`]:uE(((e,t)=>{let{payload:o}=t;e.ensuredCanvas.includes(o)||e.ensuredCanvas.push(o)})),[`${qm}`]:uE(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${Jm}`]:uE(((e,t)=>{let{payload:o}=t;if(o){const{lastCopy:t,...n}=o;e.prefetchedVideo=n}else e.prefetchedVideo=o})),[`${Qm}`]:uE(((e,t)=>{let{payload:o}=t;Object.assign(e.subscriptionStatus,o)})),[`${Zm}`]:uE(((e,t)=>{let{payload:o}=t;e.isFullHDVideoEnabled=o})),[`${Ym}`]:uE(((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})}})),[`${Xm}`]:uE(((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)}}))})),[`${ev}`]:uE(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=Pu.WebGL2)})),[`${tv}`]:uE(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=Pu.WebGPU)})),[`${ov}`]:uE(((e,t)=>{let{payload:o}=t;e.rendererType=o})),[`${vm}`]:(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}),{...Tw,...n}}},Tw),Pw={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=bp(s),{video:{currentCameraControlStatus:{isInControl:u,controllingUserId:d},cameraDevicesList:l,activeCamera:c}}=s,p=a.find((e=>fr(e.userId,n))),h=[];if(h.push(Nm(!0)),o===vu.Request){const e={userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName};if(u){const t=a.find((e=>e.userId===d));Object.assign(e,{currentControllingUserId:null==t?void 0:t.userId,currentControllingDisplayName:null==t?void 0:t.displayName})}wc(nd,e)}else if(o===vu.Approve)h.push(Um(null==p?void 0:p.userId)),wc(rd,{isApproved:!0,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName});else if(o===vu.Decline)h.push(jm(null==p?void 0:p.userId)),wc(rd,{isApproved:!1,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName,reason:r});else if(o===vu.GiveUp)h.push(Vm({isInControl:!1,userId:0})),wc(id,{isControlled:!1});else if(o===vu.StartControl||o===vu.StopControl)h.push(Bm({cmd:o===vu.StartControl?"start":"stop",type:i}));else if(o===vu.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;Ow.changeCamera(e)}}return Ue(h)}))),cameraPtzEpics1:(e,t)=>yn(e,us).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)&&wc(sd,{userId:n.id,ptz:lw(n.nFECC)})}})),Et(fe)),cameraPtzEpics2:(e,t)=>yn(e,us).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(jm(s.id)),Ue(r)}))),cameraPtzEpics3:(e,t)=>e.pipe($t(`${Bm}`),_t((e=>{const{payload:{cmd:o,type:n}}=e;return"start"===o?dt(0,200).pipe(Rt((()=>!!t.value.video.currentCameraControlStatus.isCameraMoving)),Xe((()=>{const{video:{ptz:e,activeCamera:o}}=t.value,r=e[o],i=dw(r)||{},{key:s,range:a}=uw(n,2);return r[s]?(Object.assign(i,{[s]:aw(r[s].capability,r[s].value,a)}),Ow.movePTZCamera(i).then((()=>xm({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(`${am}`),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&&Rw.sendCameraAblity({pan:!!e.pan,tilt:!!e.tilt,zoom:!!e.zoom})}return fe})))},kw={videoCaptureEpics0:(e,t)=>In(e,Va.StartVideoCaptureSuccess).pipe(Xe((e=>{const{video:{cameraDevicesList:o,activeCamera:n,ptz:r,isCurrentUserStartedVideo:i,isUsingMediaPlayback:s},meeting:{userId:a}}=t.value,{payload:{data:{currentDeviceID:u,PTZRange:d}}}=e,l=[];if(o.length<1&&!s&&(wc(Bu,{reason:"Cannot detect camera devices"}),ww.stopCaptureVideo()),iw(n,o)||s){if(i||_w.muteAttendeeVideo(a,!1),wc(ud),s)l.push(am("default"));else if(u&&d&&l.push(Lm({deviceId:u,ptzRange:d})),n!==u&&l.push(am(u)),Object.prototype.hasOwnProperty.call(r,u)){const e=r[u];if(e){const t=dw(e);t&&ww.movePTZCamera(t)}}}else wc(xu,{reason:"cannot find target camera"}),ww.stopCaptureVideo();return Ue(l)}))),videoCaptureEpics1:(e,t)=>yn(e,us).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?wc(Gu):wc(zu),um(!!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:wc(Fu),o.push(lm(!0));break;case Va.UserCameraIsTakenByOtherPrograms:wc(Hu,{reason:"User camera is taken by other programs."}),o.push(mm(!0));break;case Va.VideoWebsocketBroken:wc(Wu,{reason:"Video websocket broken."});break;case Va.StopVideoCaptureFailed:wc(zu,{failed:!0,reason:"Unknown."})}return Ue(o)}))),videoCaptureEpics3:(e,t)=>In(e,Va.StopVideoCaptureSuccess).pipe(Tt(t),Wf((e=>{let[,t]=e;const{meeting:{userId:o},video:{isCurrentUserStartedVideo:n}}=t;n||wc(zu),_w.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})),Wf((e=>{let[t]=e;const{id:o,bVideoMute:n}=t.payload.body;return wc(Nu,{id:o,isVideoMuted:n}),!0===n&&ww.stopCaptureVideo(),!1===n&&wc(Vu,{id:o,isVideoMuted:n}),pm(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 wc(ld,o),ct(je(rm(o)),Cf(t).pipe(Xe((e=>{const{meeting:{isCurrentUserStartVideoBeforeReset:o},media:{videoEncodeStatus:n}}=t.value;return!0!==(null==e?void 0:e.bVideoOn)&&!0===o?Af("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===Eu.VirtualBackground&&r.imageSrc?a=Aw({imageUrl:r.imageSrc,cropped:r.cropped},ww,e):o===Eu.Mask&&n.imageSrc&&n.clip&&(a=Cw({imageUrl:n.imageSrc,cropped:n.cropped,clip:n.clip,rootHeight:n.rootHeight,rootWidth:n.rootWidth},ww,e)),a.then((()=>{sw(ww,e,{cameraId:i,...s})})),ci(void 0)}))):fe}))))}))),videoCaptureEpics6:(e,t)=>e.pipe($t(`${sm}`),Ot((e=>{const{payload:o}=e,n=t.value,{meeting:{userId:r}}=n,i=vp(n);0===o.length?i&&!i.bVideoConnect||_w.connectCamera(r,!1):null!=i&&i.bVideoConnect||_w.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((()=>(ww.setMobileRotateMode(pw()),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 ww.setMobileRotateMode(i),fe})))))),videoCaptureEpics8:e=>In(e,Va.StartVideoCaptureSuccess).pipe(mt((()=>!zi.isIPad&&zi.isAndroidOrIOSBrowser)),Ot((()=>{ww.setMobileRotateMode(pw())})),Et(fe)),videoCaptureEpics9:(e,t)=>In(e,Va.VideoStreamFailed).pipe(mt((()=>!!t.value.video.isCurrentUserStartedVideo&&zi.isIOSMobile)),Ot((()=>{ww.stopCaptureVideo()})),Et(fe))},Mw={videoRenderEpics0:e=>yn(e,16129).pipe(ze((e=>{const{payload:{body:{id:t,bVideoOn:o}}}=e,n=ow(t);return wc(Lu,{bVideoOn:o,userId:n}),im({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}}=t.value,i=n.filter((e=>e.videoQuality>=Ja.Video_720P));return r!==o&&i.length>0&&(o>=Ja.Video_720P||r>=Ja.Video_720P)&&i.forEach((e=>{mw.subscribeVideo(e.userId,e.videoQuality,!1)})),cm(o)}))),videoRenderEpics2:e=>yn(e,16135).pipe(ze((e=>{const{payload:{body:{bLeadershipOn:t,id:o}}}=e,n=[];return t&&n.push(ow(o)),wc(Ku,{spotlightList:n}),dm(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=bp(o);return r=r.filter((e=>i.findIndex((t=>t.userId===e))>=0)),wc(Ku,{spotlightList:r}),dm(r)}))),videoRenderEpics4:e=>In(e,Va.CurrentVideoResolution).pipe(Wf((e=>(wc(Uu,e.payload.data),gm(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?(wc(Uu,t),gm(t)):(wc(ju,t),zm(t))}))),videoRenderEpics6:e=>yn(e,ds).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 wc(qu,{bOn:t}),Sm(t);if(void 0!==n)return _m(n);{const e=1===o;return vw.updateVideoHDValue(e),vw.enableHardwareAccelerationForVideoEncode(!1),Am(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&&wc(Ju,{layout:i}),bm(i)}))),videoRenderEpics8:(e,t)=>yn(e,us).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=Sp(o);if(n&&n.length>0&&n.filter((e=>i.includes(e.id))).forEach((e=>{wc(Zu,{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=>{wc(Zu,{userId:e.id})})),e.forEach((e=>{e.bVideoOn?wc(Qu,{userId:e.id}):i.includes(e.id)&&wc(Zu,{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,u=vp(n),d=Cp(n),l=d.length>0,c=(null==u?void 0:u.bVideoOn)&&!r&&!i,p=d.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?(wc(ed,o.payload),Tm(o.payload)):Tm(mu):m?(wc(ed,o.payload),Dm(o.payload)):Dm(mu)}))),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;wc(td,{userId:e,width:t,height:o,quality:r})}else if(o===Va.CurrentDecodeVideoFps){const{ssrc:e,fps:t}=n;wc(td,{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=>Cm(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:u,subscribedVideoList:d,networkQualityBroadcastTime:l}}=t.value,c=r?"uplink":"downlink";s.push(Mm({userId:a,level:i,bwLevel:n,type:c}));const p=gr(null===(o=u[`${a}`])||void 0===o?void 0:o[c],{level:i,bwLevel:n});if(!p&&-1!==i){(!r&&d.filter((e=>e!==a)).length>0||r)&&wc(od,{userId:a,type:c,level:i})}if(r){const e=performance.now();(!p||e-(null!=l?l:0)>3e4)&&(mw.broadcastUserNetworkQuality({isUplink:r,level:i,bwLevel:n}),s.push(Hm(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||(wc(od,{userId:n,level:o,type:"uplink"}),s.push(Mm({userId:n,level:o,type:"uplink"}))),Ue(s)}))),videoRenderEpics14:(e,t)=>yn(e,us).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||vw.cancelPrefetchVideoSsrc(r.userId),mw.unsubscribeVideo(r.userId),n.push(Jm(void 0))),Ue(n)}))),videoRenderEpics15:(e,t)=>e.pipe($t(`${Jm}`),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&&vw.cancelPrefetchVideoSsrc(o.userId),mw.unsubscribeVideo(o.userId)),mw.subscribeVideo(n.userId,Ja.Video_360P,!1),vw.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(Jm({userId:n.userId,loaded:!0,lastCopy:n})),wc(dd,{userId:n.userId})):mw.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;Af("video",o,e).subscribe((e=>{let[o,n]=e;const{video:{subscriptionStatus:r}}=t.value;o&&r.encode&&vw.subscribeToQos([xs.VideoEncode],ru),n&&(r.decode&&vw.subscribeToQos([xs.VideoDecode],ru),r.detailed&&vw.enableVideoObserver(!0))}))})),Et(fe)),videoRenderEpics18:(e,t)=>e.pipe($t(`${Em}`,`${Im}`),mt((()=>{const e=t.value.video.renderedVideoList.length;return[0,1].includes(e)})),Ot((()=>{const e=t.value.video.renderedVideoList.length;1===e?vw.enableVideoObserver(!0,!0):0===e&&vw.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:u}=o,d=u?a/u:0,l=n.filter((e=>fr(e.userId,s)));if(l.some((e=>e.aspectRatio&&Math.abs(e.aspectRatio-d)>.2))){const e=l.filter((e=>e.canvasId===cu));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-d)<=.2}return!0}))&&i.push(Em({userId:s,key:su,canvasId:cu,aspectRatio:d}))}e.length===l.length&&0!==i.length||wc(cd,{userId:s,aspectRatio:d})}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(ov(o)),Ue(r)})))},Lw=fn(Mw,kw,{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(wm(!0)),wc(Yu,!0),t===Va.VbModelPreloading_10S&&console.warn("Virtual Background is taking longer than expected to load.")):t===Va.VbSettingParaError&&(o===tu.VBModelNotMatch?(wc(Yu,!1),n.push(wm(!1))):(wc(Xu,!1),n.push(Rm(!1)))),Ue(n)}))),vbEpics1:e=>In(e,Va.StartVideoStreamInVbSettingSuccess).pipe(ze((()=>(wc(Xu,!0),Rm(!0))))),vbEpics2:e=>In(e,Va.StartVideoStreamInMaskSettingSuccess).pipe(ze((()=>(wc(ad,!0),$m(!0))))),vbEpics3:e=>In(e,Va.MaskSettingParaError).pipe(ze((()=>(wc(ad,!1),$m(!1)))))},Pw);class Nw{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 Nw),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=Bs(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})}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})}}Nw.agentInstance=void 0;const Vw="PREVIEW_VIDEO_ENCODE_SUCCESS",Uw="PREVIEW_VIDEO_VB_MODEL_READY";async function jw(e,t,o){const{imageUrl:n,cropped:r,deviceId:i}=o;if(n){const o=await Sw(n,r);if(o){let n=Sr("__ZOOM_SDK_PREVIEW_VIRTUAL_BACKGROUND_CANVAS_@__");t.id?n=t.id:t.id=n;let[r,s]=[640,360];Hs.isSupportSending720P()&&(r=1280,s=720),e.startVirtualBackgroundSetting(n,o,0,null!=i?i:"default",r,s),o!==ou&&setTimeout((()=>{ff(o)}),0)}}}class Bw{constructor(){this.previewMediaAgent=Nw.getInstance(),this.isInit=void 0,this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.eventHandler=(e,t)=>{switch(e){case Va.InitSuccessVideo:t===Ua.EncodeSuccess&&(this.isVideoEncoded=!0,wc(Vw));break;case Va.VbModelPreloadingOk:case Va.VbModelPreloading_3S:case Va.VbModelPreloading_10S:this.isVBModelReady=!0,wc(Uw,!0);break;case Va.VbSettingParaError:t===tu.VBModelNotMatch&&(this.isVBModelReady=!1,wc(Uw,!1))}}}static setMediaOption(e){Bw.mediaOption=e}setup(){if(Bw.mediaOption){if(Hs.getInstance().inProgress)return Promise.resolve("");if(!Nw.getInstance().inProgress){this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.previewMediaAgent.unregisterCallback(this.eventHandler);const{assetsPath:e,enforceMultipleVideos:t,enforceVirtualBackground:o}=Bw.mediaOption,n={...Vf(e,t,o)};this.previewMediaAgent.init(e,n),this.previewMediaAgent.registerCallback(this.eventHandler)}return Promise.resolve("")}return Promise.reject({type:El,reason:"Cannot preview video with virtual background before `client.init` method."})}async startPreview(e,t){Hs.getInstance().inProgress?jw(Hs.getInstance(),e,t):(void 0!==this.isVBModelReady?Ue([this.isVBModelReady]):Tc(Uw,1)).subscribe((o=>{o&&(this.isVideoEncoded?Ue([!0]):Tc(Vw,1)).subscribe((()=>{jw(Nw.getInstance(),e,t)}))}))}async stopPreview(){Hs.getInstance().inProgress?Hs.getInstance().stopVirtualBackgroundSetting():Nw.getInstance().stopVirtualBackgroundSetting()}async updatePreview(e,t){const o=Hs.getInstance().inProgress?Hs.getInstance():Nw.getInstance();if(e){const n=await Sw(e,t);n&&(o.updateVirtualBackgroundImage(n),n!==ou&&setTimeout((()=>{ff(n)}),0))}else o.updateVirtualBackgroundImage(null)}}Bw.mediaOption=void 0;const{InitSuccessVideo:xw,InitSuccessAudio:Fw,InitSuccessSharing:Hw,InitFailedVideo:$w,InitFailedAudio:Ww,InitFailedSharing:Gw}=Va,zw=YS(Hs.getInstance()),Kw=KS.getInstance().makeLogger(["Media Agent"]),qw=[bf,If,Ef].map((e=>gf(e,{hostname:!0}))),Jw=[],Qw={epics0:(e,t)=>e.pipe($t(`${Gr}`),_t((()=>{const{meeting:{isMeetingReset:o}}=t.value;return e.pipe($t(`${Xr}`),ft(1),zf((e=>{var n;const{logger:r,media:{mediaConstraints:i,assetsPath:s},meeting:{zlkJwtToken:a,cv:u}}=t.value,{payload:{disableAqos:d,disableVqos:l}}=e,c=null!=r&&null!==(n=r.options)&&void 0!==n&&n.enable?KS.getInstance().makeLogger(["MEDIA SDK"]):void 0;return function(e){const{media:{patchedMediaSDKStatus:t}}=e;return t===Ou.Loading?Fe(Tc(xl,1)):Promise.resolve()}(t.value).then((()=>{const e=[];let t=!l;const n=!d;return a&&mr(u,"1.3.0")<0&&(t=!1),e.push(dn({audioQos:n,videoQos:t})),zw.init(function(e){return e?new Proxy(e,{get:(e,t)=>"string"==typeof t&&"error"===t?function(){try{var e;qS.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&&qw.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}/${Ri}`;"JsMediaSDK_Instance"in window&&(window.JsMediaSDK_Instance_backup=window.JsMediaSDK_Instance,delete window.JsMediaSDK_Instance),vf(n,(()=>{"JsMediaSDK_Instance_backup"in window&&delete window.JsMediaSDK_Instance_backup,Kw.info(`patched media sdk url:${n}`),e("")}),(()=>{"JsMediaSDK_Instance_backup"in window&&(window.JsMediaSDK_Instance=window.JsMediaSDK_Instance_backup,delete window.JsMediaSDK_Instance_backup),Kw.error(`cannot load patched media sdk :${n}`),t()}))}))).pipe(Xe((()=>(wc(xl),Ue([an(Ou.Done),un(o)])))),gt((()=>(wc(xl),Ue([an(Ou.Done)])))),Ct(an(Ou.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(zw.notifySDKMeetingReady(),e&&o){const t={enableDecoderInWorklet:s,enableAudioBridge:a&&Ki()};Object.assign(t,Vf(e,r,i)),zw.setAssetsAndConstraint(e,o,n,t)}Cf(t).pipe(_t((e=>Ue(xf.acquire().then((()=>e)))))).subscribe((e=>{const{meeting:{svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,userId:s,isWebinar:a,enableWebtransport:u,webtransportPort:d},media:{enableAudioQos:l,enableVideoQos:c,alternativeNameForVideoPlayer:p,adaptedABOptionForMediaSDK:h},video:{rendererType:m}}=t.value;e&&(zw.connect({svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,isViewOnly:np(e.userRole),currentUserId:s,isWebinar:a,enableAudioQos:l,enableVideoQos:c,enableWebtransport:u,webtransportPort:d,rendererType:m,adaptedABOptionForMediaSDK:h}),function(e){var t;let o="video-player";e.tagName&&(o=e.tagName,_I.dispatch("",{tagName:e.tagName}),HI(null===(t=e.mediaSDK)||void 0===t?void 0:t.call(e),`VPTN:${o}`));const n=`${o}-container`,r=e.sessionId||jI();_I.get("mediaSDKInstanceMap").set(OI,e.mediaSDK),_I.get("mediaSDKInstanceMap").set(r,e.mediaSDK),e.failover&&_I.dispatch("failover",void 0,e.sessionId||OI),customElements.get(n)||customElements.define(n,dA),customElements.get(o)||customElements.define(o,sA)}({mediaSDK:()=>zw.instance,tagName:p,failover:"1"}))}))})),_t((()=>ut((e=>zw.registerCallback(e)),(e=>zw.unregisterCallback(e)),((e,t)=>({type:e,data:t}))).pipe(ze((e=>Qo(e))))))),epics3:e=>In(e,[xw,Fw,Hw,$w,Ww,Gw]).pipe(Gf((e=>{const{payload:{type:t,data:o}}=e;if(t===Fw||t===Ww){if(o===Ua.EncodeSuccess)return wc(Rl),je(Zo("success"));if(o===Ua.DecodeSuccess)return wc(Ol),je(Yo("success"));if(o===Ua.EncodeFailed)return wc(Ml),je(Zo("failed"));if(o===Ua.DecodeFailed)return wc(Ll),je(Yo("failed"))}else if(t===xw||t===$w){if(o===Ua.EncodeSuccess)return wc(Tl),je(Xo("success"));if(o===Ua.DecodeSuccess)return wc(Dl),je(en("success"));if(o===Ua.EncodeFailed)return wc(Nl),je(Xo("failed"));if(o===Ua.DecodeFailed)return wc(Vl),je(en("failed"))}else if(t===Hw||t===Gw){if(o===Ua.EncodeSuccess)return wc(Pl),je(tn("success"));if(o===Ua.DecodeSuccess)return wc(kl),je(on("success"));if(o===Ua.EncodeFailed)return wc(Ul),je(tn("failed"));if(o===Ua.DecodeFailed)return wc(jl),je(on("failed"));if(t===Hw&&void 0===o)return wc(kl),je(on("success"))}}))),epics4:(e,t)=>In(e,[xw,Fw]).pipe(_t((()=>"object"==typeof navigator.mediaDevices?ct(wf(),ct(In(e,Va.StartVideoCaptureSuccess),st(navigator.mediaDevices,"devicechange"),In(e,Va.UserGrantCaptureAudio).pipe(mt((()=>!t.value.audio.isUserGrantCaptureAudio)))).pipe(Xe((()=>wf().pipe(Ot((()=>{setTimeout((()=>{wc(Bl)}),50)}))))))).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=[Bp(t.microphones),xp(t.speakers),sm(t.cameras)];if(o.audio){const{audio:{activeMicrophone:e,activeSpeaker:s,microphoneDevicesList:a,speakerDevicesList:u}}=o,d=vp(o),{microphones:l,speakers:c}=t,p=a.filter((e=>-1===l.findIndex((t=>t.deviceId===e.deviceId)))),h=u.filter((e=>-1===c.findIndex((t=>t.deviceId===e.deviceId))));if(p.length>0){if(jf(p[0],e,a)){const e=Bf(l);zw.changeMicrophone("default",null==e?void 0:e.label,!(null==d||!d.muted)),n.push(Fp("default"))}}else if("default"===e){const e=Bf(a),t=Bf(l);a.length>0&&(null==e?void 0:e.label)!==(null==t?void 0:t.label)&&zw.changeMicrophone("default",null==t?void 0:t.label,!(null==d||!d.muted))}var r,i;h.length>0?jf(h[0],s,u)&&(zw.changeSpeaker("default"),n.push(Hp("default"))):"default"===s&&u.length>0&&(null===(r=Bf(u))||void 0===r?void 0:r.label)!==(null===(i=Bf(c))||void 0===i?void 0:i.label)&&zw.changeSpeaker("default")}return Ue(n)}))):fe))),epics5:(e,t)=>En(e,us).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;zw.sendUserNodeList(e,o)}zw.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Xi.SHARING_DECODE}),r&&zw.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Xi.AUDIO_DECODE})}if(n.remove&&n.remove.length>0){if(!r){const{meeting:{gcmSessinKey:e}}=t.value;zw.sendUserNodeList(n.remove.map((e=>({userid:e.id,bremove:!0}))),e)}zw.updateUserMediaSN({removed:n.remove.map((e=>e.id)),isFromMainSession:r,iVType:Xi.SHARING_DECODE}),r&&zw.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;Bw.setMediaOption({assetsPath:t.assetsPath,enforceMultipleVideos:t.enforceMultipleVideos,enforceVirtualBackground:t.enforceVirtualBackground})})),Et(fe)),epics9:e=>e.pipe($t(`${jr}`,`${Ur}`),Ot((()=>{Nw.getInstance().inProgress&&(Nw.getInstance().disconnect(),xf.watch(Nw.getInstance().destroy()))})),Et(fe)),epics10:e=>e.pipe($t(`${jr}`,`${Ur}`),_t((()=>"permissions"in navigator?["microphone","camera"].map((e=>{navigator.permissions.query({name:e}).then((t=>{const o=()=>{wc($l,{name:e,state:t.state})};o(),t.addEventListener("change",o),Jw.push((()=>{t.removeEventListener("change",o)}))})).catch((()=>{}))})):fe)),Et(fe)),epics11:e=>e.pipe($t(`${di}`),mt((e=>e.payload===Di.Closed)),Ot((()=>{Jw.length>0&&(Jw.forEach((e=>e())),Jw.length=0)})),Et(fe))},Zw=fn(Qw),Yw={meeting:$E,socket:pI,participants:bI,media:CI},Xw=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||Bt;function eR(e){return function(e){for(var t=Object.keys(e),o={},n=0;ne.userId===t));if(r.findIndex((e=>e===pR.Attendee))>-1&&(i=yp(n).find((e=>e.userId===t))),!i)return Promise.reject({type:wl,reason:"no matching user"});{const{meeting:{userId:e}}=o.getState();for(let o=0;o1?n-1:0),s=1;st.includes(o+1)?$S(e):e)):r)||void 0===a?void 0:a.map((e=>wr(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}`:""}`),mR.report(o,`${e} exception flow`,"error"),Promise.reject(t)}))}catch(e){}return i.apply(this,r)}}}function gR(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),u=0;ud instanceof e))||o&&!o.every((e=>!!d[e]))?Promise.reject({type:wl,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 d&&null!==d?null===(r=Object.getPrototypeOf(d))||void 0===r?void 0:r.constructor.name:d}`}):s.apply(this,a)}}}class fR{constructor(e){this[oR]=void 0,this[rR]=void 0,this[nR]=void 0,this[iR]=void 0,this[oR]=e,this[rR]=e.dispatch,this[nR]=e.getState}}const yR=["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=tp(e),n={isPhoneUser:o};return o&&null!=t&&t.phoneNumber&&Object.assign(n,{phoneNumber:t.phoneNumber}),n}}];function SR(e){return yR.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 bR(){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 ER=e=>{let{breakoutRoom:{mainSessionAttendeeList:t}}=e;return t},IR=Kc([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!==ip.InProgress&&e!==ip.Closing||t!==ap.InRoom&&t!==ap.TimeUp||!o))),AR=Kc([e=>{let{breakoutRoom:{rooms:t}}=e;return t},qc,e=>{let{meeting:{zoomId:t}}=e;return t},ER,IR,e=>{let{breakoutRoom:{isHugeBO:t}}=e;return t}],((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=>{return!(e.bHold||e.isHost||e.zoomID===o||e.bid||s.includes(e.userGUID)||i&&(t=e.caps,4!=(4&t)));var t}))})),CR=Kc([IR,ER,bp],((e,t,o)=>e?t.find((e=>e.isHost)):o.find((e=>e.isHost))));var _R,wR,RR,OR;const TR=Ns.createAgent();let DR=(_R=hR(pR.Other),wR=hR(pR.Other),RR=hR(pR.Other),OR=class extends fR{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}=bR();if(!n||!r)return console.error("https://developers.zoom.us/docs/video-sdk/web/browser-support"),Promise.reject({type:El,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{[rR]:i,[oR]:s}=this;let a=Ef;const u=(null==o?void 0:o.fileWithVersion)||!1;let d="en-US",l=`${Ef}/${Ri}`;if(o){const{dependentAssets:e,additionalFeatures:t,constraints:n,language:r,webEndpoint:i}=o;r&&(d=r),i&&function(e){yf=gf(e,{hostname:!0})}(i),e===Oi.CDN||e===bf?(a=bf,l=`${bf}/${Ri}`):e===Oi.Global||e===Ef?(a=Ef,l=`${Ef}/${Ri}`):e===Oi.CN||e===If?(a=If,l=`${If}/${Ri}`):e&&/^https?:\/\//.test(e)&&(a=Ir(e),l=u?`${a}/1505_js_media.min.js`:`${a}/${Ri}`),t&&Array.isArray(t)&&t.forEach((e=>{if(this[iR][e]&&void 0===s.getState()[e]){const{epic:t,reducer:o,Client:n}=this[iR][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",MA),s.injectEpic(VA)),null!=n&&n.video&&void 0===s.getState().video&&(s.injectReducer("video",Dw),s.injectEpic(Lw)),null!=n&&n.screen&&void 0===s.getState().share&&(s.injectReducer("share",lE),s.injectEpic(hE))}return i(qr({apiKey:e,signature:t,language:d,useSDK:this.useSDK})),i(nn({mediaConstraints:o&&o.constraints||{},assetsPath:a,fileWithVersion:u,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(""):vf(l,(()=>{e("")}),(()=>{t({type:wl,reason:"dependent assets are not accessible"})}))}))}on(e,t){((e,t)=>{const o=Ic[e];if(o){const n=Cc.get(e);if(n)n.push(t),Cc.set(e,n);else{const n=[t];Cc.set(e,n);const r=ct(...o.map((e=>{const{event:t,payload:o}=e;return st(Ac,t).pipe(ze((e=>o(e))),Le(pe))}))).subscribe((t=>{const o=Cc.get(e);o&&o.forEach((e=>{e(t)}))}));_c.push(r)}}})(e,t)}off(e,t){((e,t)=>{if(Ic[e]){const o=Cc.get(e);if(Array.isArray(o)){const n=o.filter((e=>e!==t));Cc.set(e,n)}}})(e,t)}getFeatureModule(e){return this.modules.get(e)}leave(){const{[nR]:e,[rR]:t}=this;return"connected"===e().socket.zoomSocketStatus?t(Fr()):t(Hr()),Fe(dt(500).pipe(yt("")))}end(){const{[nR]:e,[rR]:t}=this;return"connected"===e().socket.zoomSocketStatus?(t($r()),Fe(dt(500).pipe(Ot((()=>{Dc()})),yt("")))):Promise.resolve("")}changeName(e,t){const o=this[oR].getState(),{meeting:{bAllowAttendeeRename:n}}=o,r=vp(o),i=np(r.userRole),s=gp(o);if(i)return Promise.reject({type:Cl});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 TR.rename(t,ur(e),ur(r.displayName)),Hf(t,(t=>t.displayName===e));{const n=yp(o).find((e=>e.userId===t));if(n){const t=SE.getInstance();return TR.rename(n.userId,ur(e),ur(n.displayName)),t.rename(n.jid,e),Oc(qs,(t=>{const o=t.find((e=>e.jid===n.jid));return o&&o.displayName===e}))}return Promise.reject({type:wl,reason:"no matching user"})}}return Promise.reject({type:Cl})}return e===r.displayName?Promise.resolve():s||n?(TR.rename(r.userId,ur(e),ur(r.displayName)),Oc(Ws,(t=>t.displayName===e))):Promise.reject({type:Cl,reason:"host disallow rename themselves"})}makeHost(e){return TR.assignHost(e,!1),Hf(e,(e=>!0===e.isHost))}makeCoHost(e){const t=this[oR].getState(),o=bp(t).find((t=>t.userId===e));return!0===(null==o?void 0:o.bCoHost)?Promise.reject({type:wl,reason:`user:[${e}] is already co-host `}):(TR.assignHost(e,!0),Hf(e,(e=>!0===e.bCoHost)))}revokeCoHost(e){const t=this[oR].getState(),o=bp(t).find((t=>t.userId===e));return!1===(null==o?void 0:o.bCoHost)?Promise.reject({type:wl,reason:`user:[${e}] is not a co-host`}):(TR.revokeCoHost(e),Hf(e,(e=>!1===e.bCoHost)))}reclaimHost(){const e=this[nR](),{meeting:{isOriginHost:t}}=e,o=vp(e);return null!=o&&o.isHost?Promise.resolve(""):t?(TR.reclaimHost(o.userId,!1),Oc(Ws,(e=>!0===e.isHost))):Promise.reject({type:Cl,reason:"You are not the origin host"})}isHost(){const e=this[oR].getState(),t=vp(e);return!!t&&t.isHost}isCoHost(){const e=this[oR].getState(),t=vp(e);return!!t&&!!t.bCoHost}isOriginHost(){const{meeting:{isOriginHost:e}}=this[nR]();return e}getCurrentUserInfo(){const e=this[oR].getState(),t=vp(e);if(t){const o=SR(t);if(e.meeting.isWebinar&&np(t.userRole)){const{audio:t}=e,n=null==t?void 0:t.isAllowToTalk;Object.assign(o,{isAllowToTalk:n})}if(e.breakoutRoom&&IR(e)){const{breakoutRoom:{currentRoom:{boId:t}}}=e;Object.assign(o,{bid:t})}return o}return null}getParticipantsList(){const e=this[oR].getState(),{meeting:{meetingStatus:t}}=e,o=vp(e);if(t===Di.Joined&&o&&!o.bHold){var n,r;const t=e.breakoutRoom&&IR(e)?null===(n=e.breakoutRoom)||void 0===n||null===(r=n.currentRoom)||void 0===r?void 0:r.boId:"";return bp(e).map((e=>{const o=SR(e);return t&&Object.assign(o,{bid:t}),o}))}return[]}getAssistantsList(){const e=this[oR].getState(),{meeting:{meetingStatus:t}}=e,o=vp(e);return t===Di.Joined&&o?Ep(e).map((e=>({userId:e.userId,displayName:e.displayName,isNewAst:!0}))):[]}getMeetingHost(){var e;const t=this[nR]();let o=Ip(t);return o||(null===(e=t.breakoutRoom)||void 0===e?void 0:e.currentRoom.status)!==ap.InRoom||(o=t.breakoutRoom.mainSessionAttendeeList.find((e=>e.isHost))),void 0!==o?SR(o):null}getMeetingInfo(){const{meeting:{meetingStatus:e,isOnHold:t,meetingNumber:o,passWord:n,userName:r,userEmail:i,meetingTopic:s,meetingOptions:a,encType:u,region:d,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}}=this[nR](),C=e===Di.Joined&&!t;if(p)return{topic:c,password:n,userName:r,isInMeeting:C,userId:h,meetingId:g};{let e="";return 0===u?e="None":1===u?e="AES ECB":2===u&&(e="AES GCM"),{meetingNumber:o,password:n,userName:r,userEmail:i,inviteEmail:v,meetingTopic:s,encryptionType:e,region:d,network:l,isInMeeting:C,userId:h,lang:m,webEndpoint:yf,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}}}},tR(OR.prototype,"end",[dR,aR],Object.getOwnPropertyDescriptor(OR.prototype,"end"),OR.prototype),tR(OR.prototype,"changeName",[aR],Object.getOwnPropertyDescriptor(OR.prototype,"changeName"),OR.prototype),tR(OR.prototype,"makeHost",[_R,dR,aR],Object.getOwnPropertyDescriptor(OR.prototype,"makeHost"),OR.prototype),tR(OR.prototype,"makeCoHost",[wR,dR,aR],Object.getOwnPropertyDescriptor(OR.prototype,"makeCoHost"),OR.prototype),tR(OR.prototype,"revokeCoHost",[RR,dR,aR],Object.getOwnPropertyDescriptor(OR.prototype,"revokeCoHost"),OR.prototype),tR(OR.prototype,"reclaimHost",[aR],Object.getOwnPropertyDescriptor(OR.prototype,"reclaimHost"),OR.prototype),OR);const PR=Ns.createAgent(),kR=SE.getInstance(),MR=(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:wl,reason:"invalid target user"};const{chat:{chatPrivilege:r,panelistChatPrivilege:i},meeting:{isWebinar:s}}=o,a=gp(o),u=t.isHost||t.bCoHost;let d=!1;if(!a){if(s)if(np(e.userRole))(r===gs.NoAttendee||r===gs.AllPanelist&&n!==ys.Panelist||r===gs.All&&n!==ys.All&&n!==ys.Panelist)&&(d=!0);else{const e=np(null==t?void 0:t.userRole);(i===fs.Invalid||i===fs.AllPanelist&&(e||n===ys.All))&&(d=!0)}else(r===gs.NoAttendee||r===gs.Host&&!u||n===ys.SilentModeUsers||r===gs.EveryonePublicly&&n!==ys.All&&!u)&&(d=!0);if(d)return{type:Cl,reason:"Insufficient chat privilege"}}return null};function LR(e,t){if(t===ys.All)return _s;if(t===ys.Panelist)return ws;if(t===ys.SilentModeUsers)return Rs;{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 NR(e,t,o){if(null!=o&&o.host)return[Ip(e),...Ap(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=[Ip(e),...Ap(e),...e.participants.attendeesList.filter((e=>!(e.bCoHost||e.isHost||e.bHold)))];if(null!=o&&o.includeAttendee){const t=yp(e).filter((e=>!tp(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 VR(e){const{text:t,destId:o,sn:n,attendeeId:r}=e;return is.beginEncrypt({text:t,type:ts.RWG_CHAT}).then((e=>{PR.chat(e,o,n,r)}))}function UR(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 jR(e,t){const{meeting:{isWebinar:o},participants:{attendeesList:n}}=t,{destNodeID:r,senderName:i,attendeeNodeID:s}=e,a=n.find((e=>e.userId===r)),u=e.sn?e.sn:null==a?void 0:a.zoomID,d=i?dr(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=yp(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:u,sender:{name:d,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 BR(e){var t;const[o]=e.split(".").reverse();return null!==(t=ks[o])&&void 0!==t?t:""}function xR(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 FR=KS.getInstance(),HR=FR.makeLogger(["File Transfer"]);function $R(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 WR(e,t){return t.fileObj?`${e}/zoomfile/download?objkey=${t.fileObj}`:`${e}/file/${t.fileID}`}function GR(e,t){return{fileName:e.name,fileSize:e.size,receiverId:null==t?void 0:t.userId,receiverGuid:null==t?void 0:t.userGuid}}function zR(e,t,o){FR.report(`${e}. file name:${$S(t.name)},file size:${t.size}, ${"type"in t?`file type:${t.type}`:""}, error:${o.name};${o.message}`,["File Transfer"])}function KR(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 qR(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 JR(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 qR(e,n,r);return t?await is.beginEncrypt({text:new Uint8Array(t),type:ts.CHAT_FILE}):Promise.reject(null)}catch(o){return zR(`encrypt file buffer error. offset:${t},`,e,o),Promise.reject(o)}}))))}catch(e){console.warn(e)}return null}function QR(e,t,o,n){return n.pipe($t(`${_v}`,`${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=>{HR.info(`Cancel file upload. file name:${$S(e.name)},file size:${e.size},receiver id:${o.userId}`),wc(va,{...GR(e,o),progress:0,status:Ds.Cancel,retryToken:n.type===`${_v}`?t:void 0})})))}function ZR(e,t){if(null!=e&&e.file){const{file:o,receiver:n}=e,{upload:{chunkIndex:r,totalChunks:i,uniqueId:s}}=o;return wc(va,{...GR(t,n),progress:Math.floor((null!=r?r:0)/(null!=i?i:1)*100),status:Ds.Fail,retryToken:s}),Ue([Cv({upload:{status:Ds.Fail,progress:0,uniqueId:s}}),wv({uniqueId:s,file:t})])}return fe}function YR(e,t){return wc(va,{...GR(e),progress:0,status:Ds.Fail}),je(Cv({upload:{status:Ds.Fail,progress:0,uniqueId:t}}))}async function XR(e,t,o,n){const r=$R(e,"/wc/fileupload",n.value),i=new FormData;try{const s=await JR(e),a=UR(t,n.value);if(s&&a){i.append("file",new File([s],e.name));const{meeting:{zmk:u}}=n.value,{receiver:d}=a;return OE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:u},crossDomain:br(r),body:i,includeUploadProgress:!0}).pipe(wt(QR(e,t,d,o)),Xe((o=>{const{type:r,loaded:i,responseHeaders:s,total:a}=o;let u=0,l=Ds.InProgress;const c={upload:{uniqueId:t}},p=[];if("upload_loadstart"===r)u=0;else if("upload_progress"===r)u=Math.floor(i/a*100*.9);else if("upload_load"===r)u=90;else if("download_load"===r){var h,m;u=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=WR(e,{fileObj:o});Object.assign(c,{fileID:t,fileObj:o,fileUrl:r})}return Object.assign(c.upload,{progress:u,status:l}),(u>0||"upload_loadstart"===r)&&(wc(va,{...GR(e,d),progress:u,status:l}),p.push(Cv(c))),Ue(p)})),gt((t=>(console.warn(t),zR("Upload small file error.",e,t),ZR(a,e)))))}}catch(e){console.warn(e)}return YR(e,t)}const eO=(()=>{const e=new mf;return t=>async function(){await e.acquire(),t(...arguments),setTimeout((()=>{e.release()}),3e3)}})(),tO=function(e){const t=["chatFileTransfer"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return eO(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}(Ns.createAgent()),oO={chatHistory:[],chatPrivilege:gs.All,panelistChatPrivilege:fs.AllPanelist,isAllowAttendeeChat:!0,isFileTransferEnable:!0,isEnableFileTransferEncrypted:!0,fileTransferFileType:[],fileDownloadPromptIgnoreList:[],fileTransferSizeLimit:0,fileServerDomain:"",failedFileTransfer:{}},nO=ko({[`${fv}`]:uE(((e,t)=>{let{payload:o}=t;e.chatHistory.push(o)})),[`${vv}`]:uE(((e,t)=>{let{payload:o}=t;e.chatPrivilege=o})),[`${gv}`]:uE(((e,t)=>{let{payload:o}=t;e.panelistChatPrivilege=o})),[`${Sv}`]:uE(((e,t)=>{let{payload:o}=t;e.isAllowAttendeeChat=o})),[`${bv}`]:uE(((e,t)=>{let{payload:o}=t;const{destNodeID:n,msgID:r,userId:i}=o,s=xR(e.chatHistory,{userId:i,destNodeID:n});s&&Object.assign(s,{id:r})})),[`${Ev}`]:uE(((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)})),[`${Iv}`]:uE(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${Av}`]:uE(((e,t)=>{let{payload:o}=t;const{originFile:n,...r}=o;e.chatHistory.push(r)})),[`${Cv}`]:uE(((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}))}})),[`${_v}`]:uE(((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})})),[`${wv}`]:uE(((e,t)=>{let{payload:o}=t;const{uniqueId:n,file:r}=o;e.failedFileTransfer[`${n}`]||Object.assign(e.failedFileTransfer,{[`${n}`]:r})})),[`${Rv}`]:uE(((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})})),[`${Ov}`]:uE(((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})})),[`${yv}`]:()=>({...oO})},oO);var rO;const iO=Ns.createAgent();let sO=(rO=class extends fR{send(e,t){if(!e)return Promise.reject({type:wl,reason:"Text is empty"});const{[nR]:o,[rR]:n}=this,r=o(),i=vp(r),s=LR(r,t),a=MR(i,s,r);if(a)return Promise.reject(a);const{meeting:{isWebinar:u,encType:d}}=r,l=d===es.AES_GCM;let c=Promise.resolve(),p=!1;const h=u&&np(s.userRole);return t===ys.SilentModeUsers?iO.chat(ur(e),t):u?h?8==(8&s.clientCap)?c=VR({text:e,destId:ys.IndividualCcPanelist,sn:null==i?void 0:i.zoomID,attendeeId:t}):(c=VR({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=>{kR.sendWebinarMseeage(e,o,ys.IndividualCcPanelist,n)}))}({text:e,jid:s.jid,isGCMEnabled:l}))),p=!0):s&&(c=VR({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID})):c=VR({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(fv(o)),p?(wc(ca,o),o):new Promise(((e,n)=>{Tc(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}}};wc(ca,a),e(a)}),(()=>{n({type:Al})}))}))}))}setPrivilege(e){const t=this[nR](),{meeting:{isWebinar:o},chat:{chatPrivilege:n},breakoutRoom:r}=t;return n===e?Promise.resolve(""):(null==r?void 0:r.controlStatus)===ip.InProgress&&IR(t)?Promise.reject({type:El,reason:"Cannot update chat privilege in a subsession"}):!o&&!Es.includes(e)||o&&!Is.includes(e)?Promise.reject({type:wl,reason:"invalid privilege value of parameter"}):(iO.setChatPriviledge(e),Oc(pa,(t=>t.chatPrivilege===e)))}setPanelistPrivilege(e){const t=this[nR](),{chat:{panelistChatPrivilege:o}}=t,n=Cs[e];return o===n?Promise.resolve(""):Object.values(As).includes(e)?(iO.setPanelistChatPrivilege(e),Oc(pa,(e=>e.panelistChatPrivilege===n))):Promise.reject({type:wl,reason:"Panelist privilege value is invalid"})}deleteMessage(e){const t=this[nR](),{chat:{chatHistory:o},meeting:{meetingOptions:n,userId:r}}=t;if(null!=n&&n.isEnableDeleteChatMsg){const n=gp(t),i=o.find((t=>t.id===e));if(i){const{sender:t}=i;if(n)iO.chatCmdReq(e,Ss.Delete);else{if(t.userId!==r)return Promise.reject({type:Cl,reason:"can not delete message"});iO.chatCmdReq(e,Ss.Delete)}return Oc(ma,(t=>t.id===e)).then((()=>({id:e})))}return Promise.reject({type:wl,reason:"msgId is wrong"})}return Promise.reject({type:El,reason:"can not delete messages"})}lockChat(e){const t=this[nR](),{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:wl,reason:"File is empty"});const{[nR]:o,[rR]:n}=this,r=o(),{chat:{isFileTransferEnable:i,fileTransferFileType:s,fileTransferSizeLimit:a,failedFileTransfer:u}}=r;if(!i)return Promise.reject({type:El,reason:"Send files via in-session chat is not enabled"});if("string"==typeof e){const t=UR(e,r);if(null!=t&&t.file&&u[e]){const{file:{upload:o,...r}}=t,{file:{name:i,upload:{uniqueId:s}},receiver:{userId:a}}=t;return n(Cv({originFile:u[e],...r,upload:{...o,status:Ds.InProgress}})),Promise.resolve((()=>{n(_v({uniqueId:s,fileName:i,userId:a}))}))}return Promise.reject({type:wl,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:El,reason:"File is not in the allow list"})}if(e.size>a)return Promise.reject({type:El,reason:"File size exceeds the maximum limit."});const i=vp(r),u=LR(r,t),d=MR(i,u,r);if(d)return Promise.reject(d);const l=vr();return n(Av(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,u))),Promise.resolve((()=>{n(wv({uniqueId:l,file:e})),n(_v({uniqueId:l,fileName:o,userId:null==u?void 0:u.userId}))}))}}downloadFile(e,t,o){const{[nR]:n,[rR]:r}=this,{chat:{chatHistory:i}}=n();if(!e||!t)return Promise.reject({type:wl,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(Cv({id:e,fileUrl:t,download:{status:Ps.InProgress,progress:0,blob:o}})),Promise.resolve((()=>r(Ov({id:e,fileUrl:t}))))):Promise.reject({type:wl,reason:"Invalid message id or file url!"})}getPrivilege(){const{chat:{chatPrivilege:e,isAllowAttendeeChat:t}}=this[nR]();return t?e:gs.NoAttendee}getReceivers(){const e=this[nR](),{chat:{chatPrivilege:t,panelistChatPrivilege:o,isAllowAttendeeChat:n},meeting:{isWebinar:r}}=e;if(!r&&!n)return[];const i=vp(e),s=gp(e);if(i)if(r)if(np(i.userRole)){if(!n)return[];if(t===gs.All)return[ws,_s];if(t===gs.AllPanelist)return[ws];if(t===gs.NoOne)return[]}else{if(s||o===fs.Everyone){const t=NR(e,i.userId,{includeAttendee:!0});return[ws,_s,...t]}if(o===fs.AllPanelist){const t=NR(e,i.userId);return[ws,...t]}}else{const o=gp(e);if(t===gs.All||o){const t=NR(e,i.userId);return[_s,...t]}if(t===gs.Host)return NR(e,i.userId,{host:!0});if(t===gs.EveryonePublicly){const t=NR(e,i.userId,{host:!0});return[_s,...t]}if(t===gs.NoOne)return[]}return[]}getHistory(){return this[nR]().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[nR](),{meeting:{meetingOptions:t}}=e;return null==t?void 0:t.isEnableDeleteChatMsg}isFileTransferEnabled(){return this[nR]().chat.isFileTransferEnable}getFileTransferSetting(){const e=this[nR](),{chat:{fileTransferFileType:t,fileTransferSizeLimit:o}}=e;return{typeLimit:(null!=t?t:[]).map((e=>`.${e}`)).join(","),sizeLimit:o}}},tR(rO.prototype,"send",[aR],Object.getOwnPropertyDescriptor(rO.prototype,"send"),rO.prototype),tR(rO.prototype,"setPrivilege",[uR,aR],Object.getOwnPropertyDescriptor(rO.prototype,"setPrivilege"),rO.prototype),tR(rO.prototype,"setPanelistPrivilege",[uR,aR,function(e,t,o){const n=o.value;o.value=function(){const e=this[oR];if(e){const{meeting:{isWebinar:t}}=e.getState();if(!t)return Promise.reject({type:_l,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:u}}}=t,d=vp(o),l=yp(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="";d&&np(d.userRole)&&c===s?(n=h.find((e=>e.jid===i)),a=p,m=d.displayName):u===ys.Panelist&&(n=l.find((e=>e.jid===i)),a=ys.Panelist,m=ws.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 wc(ca,v),fv(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:u,msgID:d}}}=t,l=vp(o);if(l){const e=np(null==l?void 0:l.userRole)&&r===l.userId&&!d;if(!n&&!e){const{sn:e,...t}=jR({destNodeID:s,attendeeNodeID:r,senderName:u,sn:i},o);return(r===ys.SilentModeUsers?Promise.resolve({id:d,message:dr(a),...t}):is.beginDecrypt({decryptedText:a,zoomId:e,type:ts.RWG_CHAT}).then((e=>{let{message:o}=e;return{id:d,message:o,...t}}))).then((e=>(wc(ca,e),fv(e))))}}return fe}))),epics2:(e,t)=>yn(e,ds).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?(wc(pa,!0===r?{chatPrivilege:i}:{chatPrivilege:gs.NoAttendee}),Sv(r)):(wc(pa,{chatPrivilege:n}),vv(n))}))),epics3:e=>yn(e,ds).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 wc(pa,{panelistChatPrivilege:t}),gv(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:u}}=o,d=[];if(n===bs.Success)if(s){const e=u.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:u,type:l,fileUrl:c}=null!=t?t:{},{attendeeId:p,...h}=o;wc(ca,{id:i,file:{name:r,size:u,type:l,fileUrl:c,upload:{status:Ds.Complete,progress:100}},receiver:{...h},...n}),d.push(Rv({fileID:s,msgID:i,senderId:a}))}}else{const e=xR(u,{userId:a,destNodeID:r});var l;e&&(wc(ha,{msgId:i,receiverId:r,identification:null!==(l=e.highResTimeStampForIdentification)&&void 0!==l?l:0}),d.push(bv({destNodeID:r,msgID:i,userId:a})))}else n!==bs.Delete&&n!==bs.Block||d.push(Ev({msgId:i}));return Ue(d)}))),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(Ev({msgId:n})),wc(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(Ev({msgId:o})),wc(ma,{id:o})),Ue(n)})))},uO=fn(aO,{chatFileEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{var t,o,n;const{payload:{fileTransfer:r,fileServerDomain:i}}=e;return Iv({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(`${Av}`),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=$R(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 qR(e,o,n);return Ar(await window.crypto.subtle.digest("SHA-256",t))}catch(t){return zR("calculate file hash error.",e,t),Promise.reject(t)}})))).join("")}(e),{meeting:{zmk:s,meetingId:a}}=n.value,u=UR(t,n.value);if(i&&u){const{receiver:n}=u,d={fileName:e.name,length:e.size,channelType:4,digest:i,shareJid:a};return OE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:s},crossDomain:br(r),body:d}).pipe(wt(QR(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:u,metadata:d}=i,l=Math.ceil(e.size/Ts.ChunkSize);return Cv({originFile:e,upload:{uniqueId:t,status:Ds.InProgress,progress:0,chunkIndex:0,totalChunks:l,uploadid:a,trackingId:s,path:u,metadata:d}})})),gt((t=>(console.warn(t),zR("Upload file meta error.",e,t),ZR(u,e)))),Ct(Cv({upload:{uniqueId:t,status:Ds.Init}})))}return YR(e,t)}(n,r,e,t):await XR(n,r,e,t)})),Xe((e=>e))),chatFileEpics2:(e,t)=>e.pipe($t(`${Cv}`),mt((e=>{var t;return(null===(t=e.payload.upload)||void 0===t?void 0:t.status)===Ds.Success})),zf((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:u},receiver:{userId:d,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=>ur(e)));await tO.chatFileTransfer({fileID:a,fileSize:p,fileName:c,fileObj:r,type:u,destNodeID:d,attendeeNodeID:l}),s.push(Cv({upload:{uniqueId:o,status:Ds.Complete}}))}return s}))),chatFileEpics3:(e,t)=>e.pipe($t(`${Cv}`),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 XR(n,r,e,t)})),Xe((e=>e))),chatFileEpics4:(e,t)=>e.pipe($t(`${Cv}`),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=UR(t,n.value);if(null!=r&&r.file){const{file:{upload:{chunkIndex:i,totalChunks:s,uploadid:a,path:u,trackingId:d,etags:l},size:c},receiver:p}=r,h=i*Ts.ChunkSize,m=await JR(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),OE({url:g,method:"POST",headers:{"Zoom-File-Size":y.size,"Zoom-File-Path":u,"x-zm-trackingid":d,"Zoom-File-Origin":"redirect=support_auth",zmk:v},crossDomain:br(g),body:f,includeUploadProgress:!0}).pipe(wt(QR(e,t,p,o)),Xe((o=>{var r;const{type:a,loaded:u,total:d,responseHeaders:h}=o;let m=0;const v={upload:{uniqueId:t,status:Ds.InProgress}},g=[],f=UR(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*u)/c*100);else if("upload_load"===a)m=Math.floor((i*Ts.ChunkSize+.9*d)/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}),wc(va,{...GR(e,p),progress:m,status:Ds.InProgress}),g.push(Cv(v))),Ue(g)})),gt((t=>(console.warn(t),zR(`Upload file chunk error. chunk:${i},total chunks:${s},uploadid:${a},trackingId:${d}`,e,t),ZR(r,e)))))}}return YR(e,t)}(n,r,e,t)})),Xe((e=>e))),chatFileEpics5:(e,t)=>e.pipe($t(`${Cv}`),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=UR(t,n.value);if(null!=s&&s.file){const{file:{upload:{uploadid:a,metadata:u,etags:d,trackingId:l}},receiver:c}=s,p=`${r}/upload/complete?uploadid=${a}`;return OE({url:p,method:"POST",headers:{"x-zm-trackingid":l,"Zoom-File-Origin":"redirect=support_auth",zmk:i},crossDomain:br(p),body:{metadata:u,etags:d}}).pipe(wt(QR(e,t,c,o)),ze((o=>{var r,i;const{chat:{fileServerDomain:s}}=n.value,{responseHeaders:a}=o,u=null===(r=a["zoom-file-id"])||void 0===r?void 0:r.trim(),d=null===(i=a["zoom-file-obj"])||void 0===i?void 0:i.trim(),l=`${s}/zoomfile/download?objkey=${d}`;return wc(va,{...GR(e,c),progress:100,status:Ds.Success}),Cv({fileID:u,fileObj:d,fileUrl:l,upload:{uniqueId:t,progress:100,status:Ds.Success}})})),gt((t=>(console.warn(t),zR(`Upload chunks checksum error.uploadid${a},trackingId${l}`,e,t),ZR(s,e)))))}return YR(e,t)}(n,r,e,t)}))),chatFileEpics6:(e,t)=>yn(e,4308).pipe(zf((async e=>{const{payload:{body:{attendeeNodeID:o,destNodeID:n,fileID:r,fileName:i,fileObj:s,fileSize:a,fileType:u,msgID:d,senderName:l}}}=e,{meeting:{bIbDisableChat:c},chat:{fileServerDomain:p,isEnableFileTransferEncrypted:h}}=t.value,m=[];if(!c){const e=WR(p,{fileObj:s,fileID:r});if(u===Os.Local){const{sn:u,...c}=jR({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:u,type:ts.RWG_CHAT}))));p=e.message,v=Number(t.message)}else p=dr(i),v=Number(dr(a));const g={id:d,file:{name:p,size:v,fileUrl:e},...c};m.push(fv({...g,file:{...g.file,fileID:r,fileObj:s}})),setTimeout((()=>{wc(ca,g)}),0)}}return m}))),chatFileEpics7:(e,t)=>e.pipe($t(`${Cv}`),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 OE({url:o,method:"GET",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:i},crossDomain:br(o),responseType:"arraybuffer",includeDownloadProgress:!0}).pipe(wt(function(e,t){return t.pipe($t(`${Ov}`,`${No}`),mt((t=>{if(t.type===`${No}`)return!0;const{payload:{id:o}}=t;return e.id===o})),Ot((()=>{var t,o,n;HR.info(`Cancel file download. file name:${$S(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}`),wc(ga,{...KR(e),progress:0,status:Ps.Cancel})})))}(a,t)),zf((async t=>{const{type:o,loaded:n,total:r}=t,i=[],u={...KR(a),progress:0,status:Ps.InProgress};if("download_loadstart"===o&&Object.assign(u,{progress:0}),"download_progress"===o){var d;const t=Math.floor(n/r*100);i.push(Cv({id:e,fileUrl:null===(d=a.file)||void 0===d?void 0:d.fileUrl,download:{progress:t}})),Object.assign(u,{progress:t})}else if("download_load"===o){var l,c,p;const o=100,n=Ps.Success;Object.assign(u,{progress:o,status:n}),i.push(Cv({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,d=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 zR("decrypt file buffer error.",{name:t,size:e.byteLength},o),Promise.reject(o)}})));return new Blob(r,{type:BR(t)})}catch(e){return null}}(t.response,null===(p=a.file)||void 0===p?void 0:p.name,r);var h,m;d&&(null!==(h=a.file)&&void 0!==h&&h.download.blob?Object.assign(u,{fileBlob:d}):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)}(d,null===(m=a.file)||void 0===m?void 0:m.name))}return(u.progress>0||"download_loadstart"===o)&&wc(ga,u),i})),gt((t=>(console.warn(t),zR(`download file error. file url:${o}`,{name:void 0,size:void 0},t),wc(ga,{...KR(a),progress:0,status:Ps.Fail}),je(Cv({id:e,fileUrl:o,download:{status:Ps.Fail,progress:0}}))))))}return fe}(o.payload.id,e,t))))});function dO(e){const{meeting:{isMeetingReset:t,meetingId:o,meetingNumber:n,userName:r,userEmail:i,tid:s,userId:a},breakoutRoom:u}=e;let d="";var l;return d=t?null!=u&&null!==(l=u.currentRoom)&&void 0!==l&&l.boConfId?"join breakout room":"meeting failover":"join meeting",{label:d,payload:{meetingId:o,tid:s,userId:a,meetingNumber:$S(n),userName:$S(r),userEmail:$S(i)}}}function lO(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(`${af}`),ft(1),Xe((e=>(e.payload&&o(n),fe))));o(n)}}catch(e){console.warn(e)}return fe})))}function cO(e,t,o,n){return In(e,o).pipe(lO(e,t,n))}function pO(e,t,o,n){return yn(e,o).pipe(lO(e,t,n))}function hO(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 mO(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 vO(e,t){return t?` ,${e}:${t}`:""}const{InitSuccessAudio:gO,InitFailedAudio:fO,InitSuccessVideo:yO,InitFailedVideo:SO,InitSuccessSharing:bO,InitFailedSharing:EO}=Va,{DecodeSuccess:IO,DecodeFailed:AO,EncodeSuccess:CO,EncodeFailed:_O}=Ua,wO={[`${gO}`]:{name:"Audio",isException:!1},[`${fO}`]:{name:"Audio",isException:!0},[`${yO}`]:{name:"Video",isException:!1},[`${SO}`]:{name:"Video",isException:!0},[`${bO}`]:{name:"Sharing",isException:!1},[`${EO}`]:{name:"Sharing",isException:!0}},RO=KS.getInstance(),OO=()=>{if("connection"in navigator){const{effectiveType:e,rtt:t,downlink:o}=navigator.connection;RO.makeLogger(["Network Connection Type"]).info(`Network connection. ect:${e},rtt:${t},downlink:${o}`)}},TO=KS.getInstance().makeLogger(["Remote Control"]),DO=YS(Hs.getInstance()),PO=[{event:Va.AudioBridgeReconnectStart,message:FS.AudioBridgeReconnectStart,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.AudioBridgeReconnectEnd,message:FS.AudioBridgeReconnectEnd,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.UserGrantCaptureAudio,message:e=>`${FS.DeviceAudioStreamCaptured},${hO(e)}`,logType:"info",additionalTags:["Audio Capture Flow"]},{event:Va.JoinComputerAudioComplete,message:FS.AudioJoinComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.LeaveComputerAudioComplete,message:FS.AudioLeaveComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Va.JoinSharingAudioComplete,message:FS.SharingAudioStartComplete,logType:"info",additionalTags:["Audio Sharing Flow"]},{event:Va.LeaveSharingAudioComplete,message:FS.SharingAudioStopComplete,logType:"info",additionalTags:["Audio Sharing Flow"]}],kO=[{event:Va.StartVideoCaptureSuccess,message:e=>`${HS.StartCaptureVideoSuccess}, ${mO(e)}`,logType:"info",additionalTags:["Video Join Flow"]},{event:Va.StopVideoCaptureSuccess,message:HS.StopCaptureVideoSuccess,logType:"info",additionalTags:["Video Join Flow"]},{event:Va.StartVideoStreamInVbSettingSuccess,message:HS.VBSettingSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloadingOk,message:HS.VBPreloadSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloading_3S,message:HS.VBPreloading3S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Va.VbModelPreloading_10S,message:HS.VBPreloading10S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Va.VbSettingParaError,message:HS.VBSettingFailed,logType:"error",additionalTags:["Video VB Flow"]}],MO=PO.map((e=>({...e,tag:"Audio"}))).concat(kO.map((e=>({...e,tag:"Video"})))),LO=KS.getInstance(),{InitSuccessVideo:NO,InitSuccessAudio:VO,InitSuccessSharing:UO,InitFailedVideo:jO,InitFailedAudio:BO,InitFailedSharing:xO,RecoverWebrtcAudio:FO,AudioBridgeFirstRecvData:HO,AudioBridgeCanSendData:$O,UserForbiddedCaptureAudio:WO,AudioWebsocketBroken:GO,AudioZeroData:zO,UserForbiddedCaptureVideo:KO,UserCameraIsTakenByOtherPrograms:qO,VideoWebsocketBroken:JO,StopVideoCaptureFailed:QO,DesktopSharingPermissionDenied:ZO,DesktopSharingSystemError:YO,AudioSpeakerSetError:XO,VbSettingParaError:eT,MaskSettingParaError:tT,WebglLostInMultiView:oT,VideoStreamFailed:nT,AudioStreamFailed:rT}=Va,iT=KS.getInstance(),sT={options:void 0,isLaplaceInitialized:!1},aT=ko({[`${sf}`]:uE(((e,t)=>{let{payload:o}=t;e.options=o})),[`${af}`]:uE(((e,t)=>{let{payload:o}=t;e.isLaplaceInitialized=o})),[`${uf}`]:(e,t)=>{let{options:o}=e,{payload:n}=t;return n?{...sT,options:o}:{...sT}}},sT),uT={mlEpics0:(e,t)=>In(e,[NO,VO,UO,jO,BO,xO]).pipe(lO(e,t,(e=>{const{payload:{type:o,data:n}}=e,{meeting:{userId:r}}=t.value,i=function(e,t){const o=wO[`${e}`];if(o){const{name:e,isException:n}=o,r=[e,`${e} Init Flow`];n&&r.push(`${e} exception flow`);let i="";return[IO,AO].includes(t)&&(i=`${i} decode`.trim()),[CO,_O].includes(t)&&(i=`${i} encode`.trim()),[CO,IO].includes(t)&&(i=`${i} success`.trim()),[AO,_O].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?LO.report(`${e}. userId:${r}`,t):LO.makeLogger(t).info(e)}}))),mlEpics1:(e,t)=>cO(e,t,MO.map((e=>e.event)),(e=>{const{payload:{type:o}}=e,n=MO.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&&LO.makeLogger([i])[o](s,r)}})),mlEpics2:(e,t)=>e.pipe($t(`${$p}`),mt((e=>!e.payload)),lO(e,t,(()=>{LO.makeLogger(["Audio"]).warn(`Auto play audio failed,${hO(t.value)}`)}))),mlEpics3:(e,t)=>cO(e,t,FO,(()=>{LO.report("Audio bridge, recover audio failed, need to rejoin the audio",["Audio exception flow"])})),mlEpics4:(e,t)=>cO(e,t,[HO,$O],(e=>{const{payload:{type:t}}=e;LO.makeLogger(["Audio"]).log("Audio bridge connection: "+(t===HO?"first receive data":"can send data"))})),mlEpics5:(e,t)=>cO(e,t,[WO,GO,zO,XO,rT],(e=>{const{payload:{type:o}}=e;let n=`Audio error case:${o}`;o===WO?n="Audio capture is forbidden by the user":o===zO?t.value.audio.webrtcRestartCount<3&&(n="audio capture zero data, auto failover"):o===XO?n="audio change speaker error":o===rT&&(n="audio stream ended or muted, stop capture audio"),LO.report(`${n},${hO(t.value)}`,["Audio exception flow"])})),mlEpics6:(e,t)=>cO(e,t,[KO,qO,JO,QO,nT],(e=>{const{payload:{type:o}}=e;let n=`Video error case:${o}`;if(o===KO)n="Video capture is forbidden by the user";else if(o===qO)n="Camera is taken by other programs";else if(o===eT){var r;n=`VB setting error, param:${JSON.stringify(null!==(r=t.value.video.virtualBackground)&&void 0!==r?r:{})}`}else if(o===tT){var i;n=`Mask setting error, param:${JSON.stringify(null!==(i=t.value.video.mask)&&void 0!==i?i:{})}`}else o===nT&&(n=`Video stream ended or muted, if it is on iOS platform, will stop capture video.platform:${zi.browser}`);LO.report(`${n},${mO(t.value)}`,["Video exception flow"])})),mlEpics7:(e,t)=>cO(e,t,[ZO,YO],(e=>{const{payload:{type:t}}=e;let o="";t===YO?zi.isMacOS&&(o="Need to allow screen recording access in system setting on MacOS"):o="Need to allow the permission request",LO.report(`${o}`,["Sharing exception flow"])})),mlEpics8:(e,t)=>cO(e,t,oT,(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));LO.report(`WebGl Context lost, canvas ID:${o.canvasId}, affected video node Ids:${e.map((e=>e.userId)).join(",")}`,["Video exception flow"])}})),mlEpics9:(e,t)=>st(document,"visibilitychange").pipe(lO(e,t,(()=>{LO.makeLogger(["Video"]).log(`Page visibility ${document.visibilityState} `),setTimeout((()=>{const e="visible"!==document.visibilityState,{video:{subscribedVideoList:o},meeting:{userId:n}}=t.value,r=0===o.filter((e=>e!==n)).length;e&&r&&(Ns.createAgent().sendRWGConnectionPerformance("VCSV"),LO.makeLogger(["Video"]).warn("Still subscribing videos after switching to background"))}),1e3)})))},dT={rmclEpics0:(e,t)=>e.pipe($t(`${em}`),lO(e,t,(e=>{const{payload:{isRemoteControlEnabled:t,isEnableAutoDeleteRcApp:o}}=e;TO.log(`isRemoteControlEnabled:${t},auto delete:${o}`)}))),rmclEpics1:(e,t)=>e.pipe($t(`${Qh}`),mt((e=>!!e.payload)),lO(e,t,(e=>{TO.log(`Launch Remote control app, scheme:${e.payload}`)}))),rmclEpics2:(e,t)=>e.pipe($t(`${$h}`),mt((e=>!!e.payload)),lO(e,t,(e=>{TO.log(`Remote control session starts, controlling ssrc:${e.payload}`)}))),rmclEpics3:(e,t)=>pO(e,t,16430,(()=>{TO.log("Remote control app connected to rwg.")})),rmclEpics4:(e,t)=>pO(e,t,vs,(()=>{TO.log("Remote control app disconnected to rwg.")})),rmclEpics5:(e,t)=>pO(e,t,vs,(e=>{const{share:{status:o,isRemoteControlEnabled:n}}=t.value;n&&o!==qa.End&&e.payload.body.bOn&&TO.log(`Remote control sharing device info.${JSON.stringify(DO.getShareStreamInfo())}`)})),rmclEpics6:(e,t)=>cO(e,t,Va.CurrentDesktopSharingWidthHeight,(()=>{const{share:{isRemoteControlEnabled:e}}=t.value;e&&TO.log(`Remote control sharing device info changes.${JSON.stringify(DO.getShareStreamInfo())}`)})),rmclEpics7:(e,t)=>cO(e,t,Va.SendRemoteControlQrCode,(e=>{const{share:{status:o}}=t.value,{payload:{data:n}}=e;TO.log(`Remote control QR code result. sharing status:${o}, result${JSON.stringify(n)}`)}))},lT={epics0:(e,t)=>e.pipe($t(`${Gr}`),Xe((async e=>{const{meeting:{logConfig:o,logEncryptionPubKey:n,zlkJwtToken:r,accountId:i},logger:{options:s}}=t.value;let a=s||{};if(o)try{const{enable:e,enableReport:t}=JSON.parse(o);a={...a,enable:e,enableReport:t}}catch(e){}if(r){const{telemetry_tracking_id:t}=Er(r),{payload:{meetingId:o}}=e,n=null!=t?t:o;a={...a,enable:!0,enableReport:!0,trackingId:n}}return RO.init({...a,logConfig:o,logEncryptionPubKey:n,accountId:i}).then((()=>[af(!0),sf(a)])).catch((()=>[af(!1)]))})),Xe((e=>Ue(e)))),epics1:(e,t)=>pO(e,t,ps,(e=>{var o,n,r;const{payload:{body:i}}=e;if(i&&i.res===Or.Success){RO.makeLogger(["A/V Performance Info"]).info(`CPU cores:${navigator.hardwareConcurrency}, SharedArrayBuffer:${!!window.crossOriginIsolated}, browser:${zi.browser} ${zi.browserVersion}, OS:${zi.os} ${zi.osVersion}${vO("wow64",zi.wow64)}${vO("GPU",zi.gpu)}${vO("architecture",zi.architecture)}${vO("bitness",zi.bitness)}${vO("model",zi.model)}${Vi.get(Bi.EnforceWebRTCAudio)?"; Enforce WebTRC audio":""}`,["CPU_CORES"]);const{media:{enforceMultipleVideos:e,enforceVirtualBackground:o,assetsPath:n,disableRenderLimits:r},meeting:{stayAwake:i,quicklyLeave:s}}=t.value;RO.makeLogger(["Init Option"]).info(`Init option:${JSON.stringify({enforceMultipleVideos:e,disableRenderLimits:r,enforceVirtualBackground:o,assetsPath:n,stayAwake:i,leaveOnPageUnload:s})}`),"connection"in navigator&&(OO(),navigator.connection.addEventListener("change",OO))}else RO.report(`join meeting failed, error:${JSON.stringify(Lr(null==i?void 0:i.res))}, rwg error code:${null==i?void 0:i.res}, rwg conID:${null==i?void 0:i.conID}, error message:${null==i?void 0:i.error_desc}, rwg url:${null==i?void 0:i.svcUrl},mid:${t.value.meeting.meetingId}`,"JOIN_MEETING_FAILED","error");const{meeting:{meetingInfoTimestamp:s,pingRWCTimestamp:a,tid:u,meetingId:d},socket:{rwgServerList:l,retryCount:c},video:{rendererType:p}}=t.value;let h=["conID","confID","mmrFeature","mmrFeatureEx","reportDomain","res","role","svcUrl","userID"].reduce(((e,t)=>void 0!==i[t]?{...e,[`${t}`]:i[t]}:e),{});h=["jid","mn","participantID","zoomID"].reduce(((e,t)=>void 0!==i[t]?{...e,[`${t}`]:$S(i[t])}:e),h);const m=["connection_info_map"];let v;if(i.res===Or.Success&&m.push("Command Socket Event","User Info Map"),u){const e=u.match(/clid=(\S+);/);e&&e.length>1&&(v=e[1])}const g=Math.floor(performance.now()-s),f=Math.floor(performance.now()-a);RO.report(JSON.stringify({...h,tid:u,mid:d,userRegion:v,rwgUrl:l.length>0?null===(o=l[c])||void 0===o?void 0:o.rwg:void 0,hardwareConcurrency:navigator.hardwareConcurrency,sharedArrayBuffer:!!window.crossOriginIsolated,browser:`${zi.browser} ${zi.browserVersion}`,os:`${zi.os} ${zi.osVersion}`,gpu:zi.gpu,architecture:zi.architecture,model:zi.model,bitness:zi.bitness,totalDurationOfJoining:g,durationOfRWG:f,rendererType:p}),m,"info"),Ns.createAgent().sendRWGConnectionPerformance(`WCL_M, conId: ${null==i?void 0:i.conID}, trackingId: ${null===(n=t.value.logger)||void 0===n||null===(r=n.options)||void 0===r?void 0:r.trackingId}, JOINFS(${g}), JOINFRWC(${f})`)})),epics2:(e,t)=>e.pipe($t(`${Br}`),Tt(t),mt((e=>{let[,t]=e;return void 0===t.meeting.encryptedRWC&&(void 0===t.meeting.encryptedGEORWC||0===t.meeting.encryptedGEORWC.length)})),lO(e,t,(()=>{const{label:e,payload:o}=dO(t.value);RO.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)),lO(e,t,(e=>{const{payload:o}=e,{socket:{rwgServerList:n,retryCount:r}}=t.value,{payload:i}=dO(t.value);RO.report(`websocket unexpected disconnected,${JSON.stringify({code:o,rwgHost:n[r],...i})}`,["Join Meeting Flow","RWG Disconnect"])}))),epics4:(e,t)=>e.pipe($t(`${Ii}`),lO(e,t,(e=>{const{payload:{reason:o,count:n,interval:r}}=e,{payload:i}=dO(t.value);RO.report(`meeting failover,${JSON.stringify({reason:o,count:n,interval:r,...i})}`,["Join Meeting Flow","Failover"]),"connection"in navigator&&navigator.connection.removeEventListener("change",OO)}))),epics5:(e,t)=>e.pipe($t(`${$o}`),mt((e=>e.payload.status===wp.Connecting)),lO(e,t,(e=>{const{payload:{rwgUrl:o}}=e;let n=o.replace(/(\d+)\?/,`${$S("$1")}?`);n=["email","zoomid","participantID","dn2","customer_key","mpwd","topic"].reduce(((e,t)=>e.indexOf(t)>-1?e.replace(new RegExp(`${t}=([^&]+)`,"g"),`${t}=${$S("$1")}`):e),n);const{payload:r}=dO(t.value);RO.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})),lO(e,t,(()=>{const{meeting:{meetingStatus:e},socket:{rwgServerList:o,retryCount:n}}=t.value;if(e!==Di.Joined){const{payload:e}=dO(t.value),r=(null==o?void 0:o.length)>0?o[n]:void 0;RO.report(JSON.stringify({...e,rwc:null==r?void 0:r.rwc,rwg:null==r?void 0:r.rwg}),["meeting_connection_details"])}}))),epics7:(e,t)=>pO(e,t,1,(e=>{const{payload:{body:o}}=e;RO.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)=>pO(e,t,2,(()=>{RO.report(`join meeting with low version of SDK. Current version:${t.value.meeting.cv}.`,"Join Meeting Flow","warn")}))},cT=fn(lT,dT,uT),pT=Ns.createAgent(),hT={cmrStatus:Ca.Stop,recordingEnable:!1,recordingIsoEnable:!1,allowStopAutoRecording:!1,automaticCloudRecordingEnable:!1,isZoomIQ:!1,zoomIQChanging:!1,localStatus:_a.Stop,supportLocalRecording:wa.None,localGrantPermissionOption:Ra.None,localPermissionUserList:[]},mT=ko({[`${vg}`]:uE(((e,t)=>{let{payload:o}=t;e.cmrStatus=o})),[`${gg}`]:uE(((e,t)=>{let{payload:o}=t;e.recordingEnable=o})),[`${fg}`]:uE(((e,t)=>{let{payload:o}=t;e.recordingIsoEnable=o})),[`${yg}`]:uE(((e,t)=>{let{payload:o}=t;e.allowStopAutoRecording=o})),[`${Sg}`]:uE(((e,t)=>{let{payload:o}=t;e.automaticCloudRecordingEnable=o})),[`${bg}`]:uE(((e,t)=>{let{payload:o}=t;e.isZoomIQ=o})),[`${Eg}`]:uE(((e,t)=>{let{payload:o}=t;e.zoomIQChanging=o})),[`${Ig}`]:uE(((e,t)=>{let{payload:o}=t;e.localStatus=o})),[`${Ag}`]:uE(((e,t)=>{let{payload:o}=t;e.supportLocalRecording=o})),[`${Cg}`]:uE(((e,t)=>{let{payload:o}=t;e.localGrantPermissionOption=o})),[`${_g}`]:uE(((e,t)=>{let{payload:o}=t;e.localPermissionUserList=o})),[`${wg}`]:()=>({...hT})},hT);var vT,gT,fT,yT,ST,bT,ET,IT,AT,CT;const _T=Ns.createAgent(),wT=vR("Recording");let RT=(vT=lR("recording"),gT=lR("recording"),fT=lR("recording"),yT=lR("recording"),ST=lR("recording"),bT=lR("recording"),ET=lR("recording"),IT=lR("recording"),AT=lR("recording"),CT=class extends fR{startRecording(){const e=this[nR](),{meeting:{bIbDisableRecording:t,recordingEnable:o},recording:{cmrStatus:n}}=e;return t?Promise.reject({type:El,reason:"Rejected by Information Barrier"}):o?n===Ca.Start?Promise.resolve(""):(_T.recordMeeting(!0,!1),Oc(Oa,(e=>e.cmrServerStatus===Ca.Start))):Promise.reject({type:El,reason:"The account of the meeting disabled the cloud recording"})}pauseRecording(){const e=this[nR](),{recording:{cmrStatus:t}}=e;return t===Ca.Pause?Promise.resolve(""):t!==Ca.Start?Promise.reject({type:El,reason:"Recording is not started"}):(_T.recordMeeting(!1,!0),Oc(Oa,(e=>e.cmrServerStatus===Ca.Pause)))}stopRecording(){const e=this[nR](),{recording:{cmrStatus:t}}=e;return t===Ca.Stop?Promise.resolve(""):(_T.recordMeeting(!1,!1),Oc(Oa,(e=>e.cmrServerStatus===Ca.Stop)))}accept(){const e=this[nR](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=vp(e);return o?t!==Ca.Start&&t!==Ca.Pause?Promise.reject({type:El,reason:"Recording is not started"}):null!=n&&n.bAllowISORecord?Promise.resolve("You accepted ISO recording"):(_T.allowSelfRecord(!0),Oc(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:El,reason:"ISO Recording is not enabled"})}decline(){const e=this[nR](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=vp(e);return o?t!==Ca.Start&&t!==Ca.Pause?Promise.reject({type:El,reason:"Recording is not started"}):!0===(null==n?void 0:n.bAllowISORecord)?Promise.reject({type:El,reason:"You had accept ISO recording, cant change it"}):(_T.allowSelfRecord(!1),Promise.resolve("")):Promise.reject({type:El,reason:"ISO Recording is not enabled"})}getRecordingStatus(){const e=this[nR](),{recording:{cmrStatus:t}}=e,o=_p(e);return t===Ca.Start?Aa.Recording:t===Ca.Pause?Aa.Paused:o?Aa.Recording:Aa.Stopped}isRecordingEnabled(){const e=this[nR](),{recording:{recordingEnable:t}}=e;return t}isAllowedToStopAutoRecording(){const e=this[nR](),{recording:{allowStopAutoRecording:t}}=e;return t}isAutomaticCloudRecordingEnabled(){const e=this[nR](),{recording:{automaticCloudRecordingEnable:t}}=e;return t}enableRecordingWithIQ(e){const{[nR]:t,[rR]:o}=this,n=t(),{recording:{isZoomIQ:r,zoomIQChanging:i},meeting:{meetingOptions:s}}=t();return s.isEnableKiwiRecording?gp(n)?i?Promise.reject({type:El,reason:"We are changing, please wait"}):e===r?Promise.reject({type:El,reason:`You have ${e?"enable":"disable"} Zoom IQ, don't need change`}):(o(Eg(!i)),o(bg(!r)),_T.enableZoomIQRecord(e),Oc(Ma,(e=>null==e?void 0:e.success))):Promise.reject({type:El,reason:"Only Host or co-host can enable/disable Zoom IQ"}):Promise.reject({type:El,reason:"You not have zoom IQ license or not enable zoom IQ, please check and retry"})}isSupportLocalRecording(){const e=this[nR](),{meeting:{meetingOptions:t,isWebinar:o},breakoutRoom:n}=e;if((null==n?void 0:n.currentRoom.status)===ap.InRoom)return!1;const r=vp(e);return(!o||!np(r.userRole))&&(null==t?void 0:t.isLocalRecordingEnabled)}isSupportLocalRecordingPermission(){const e=this[nR](),{recording:{supportLocalRecording:t}}=e;if(!this.isSupportLocalRecording())return!1;const o=vp(e);return!(null==o||!o.isHost)||t===wa.Allow}askLocalRecordingPermission(){const{[nR]:e}=this,{recording:{supportLocalRecording:t}}=e();return this.isSupportLocalRecording()?t===wa.None?(_T.localRecordingRequestPermission(),Promise.resolve("")):t===wa.Allow?Promise.resolve(""):Promise.reject("permission is denied"):Promise.reject("not support")}startLocalRecording(e){const{[nR]:t,[rR]:o}=this,n=t(),{recording:{localStatus:r,supportLocalRecording:i},meeting:{userId:s}}=n;if(!(e in _a))return Promise.reject({type:El,reason:"not support you parameter, only support type are 0(stop)/1(start)/2(pause)."});if(!this.isSupportLocalRecording())return Promise.reject({type:El,reason:"not support local recording"});if(e===r)return Promise.resolve(`you currently status is ${r}, do nothing`);const a=vp(n);return i===wa.Allow||null!=a&&a.isHost?(_T.localRecordingMeeting(e),Oc(Da,(t=>(null==t?void 0:t.userId)===s&&(o(Ig(t.bLocalRecord)),t.bLocalRecord===e)),1e3)):Promise.reject({type:El,reason:"you not have local recording permission, please use askLocalRecordingPermission request it first"})}isSupportLocalRecordingGrantPermission(){const e=this[nR]();if(!this.isSupportLocalRecording())return!1;const t=vp(e);return!(null==t||!t.isHost)&&!!Xf(t.caps)}grantLocalRecordingPermission(e,t,o){const{[nR]:n,[rR]:r}=this,i=n(),{recording:{localPermissionUserList:s}}=i;if(!this.isSupportLocalRecording())return Promise.resolve(!1);const a=vp(i);if(!Xf(a.caps))return Promise.reject({type:El,reason:"you can not grant permission"});let u=!1;if(o&&(u=!0),s.filter((t=>t===e)).length>0){if(t===wa.Allow)_T.localRecordingGrantPermission(e,!0,u);else{if(t!==wa.Deny)return Promise.reject({type:El,reason:"only support DENY(1)/ALLOW(2)"});_T.localRecordingGrantPermission(e,!1,u)}return r(_g(s.filter((t=>t!==e)))),wc(Pa,{type:"answer",value:t===wa.Allow}),Promise.resolve(!1)}return t!==wa.Deny?Promise.reject({type:El,reason:"Direct grant only support DENY(1)"}):(_T.hostGrantPermission(e,!1),Oc(Pa,(o=>(null==o?void 0:o.value)===e&&(t===wa.Allow?(r(_g([...s,e])),!0===(null==o?void 0:o.canRecord)):(r(_g(s.filter((t=>t!==e)))),!1===(null==o?void 0:o.canRecord)))),1e3))}getLocalRecordingPermissionUserList(){const e=this[nR](),{recording:{localPermissionUserList:t}}=e;if(!this.isSupportLocalRecording())return Promise.resolve(!1);const o=vp(e);return Xf(o.caps)?t:Promise.reject({type:El,reason:"you can not grant permission"})}getLocalRecordingPermissionOperation(){const e=this[nR](),{recording:{localGrantPermissionOption:t}}=e;if(!this.isSupportLocalRecording())return null;const o=vp(e);return Xf(o.caps)?t:null}},tR(CT.prototype,"startRecording",[uR,aR,vT,wT],Object.getOwnPropertyDescriptor(CT.prototype,"startRecording"),CT.prototype),tR(CT.prototype,"pauseRecording",[uR,aR,gT,wT],Object.getOwnPropertyDescriptor(CT.prototype,"pauseRecording"),CT.prototype),tR(CT.prototype,"stopRecording",[uR,aR,fT,wT],Object.getOwnPropertyDescriptor(CT.prototype,"stopRecording"),CT.prototype),tR(CT.prototype,"accept",[aR,yT,wT],Object.getOwnPropertyDescriptor(CT.prototype,"accept"),CT.prototype),tR(CT.prototype,"decline",[aR,ST,wT],Object.getOwnPropertyDescriptor(CT.prototype,"decline"),CT.prototype),tR(CT.prototype,"askLocalRecordingPermission",[aR,bT],Object.getOwnPropertyDescriptor(CT.prototype,"askLocalRecordingPermission"),CT.prototype),tR(CT.prototype,"startLocalRecording",[aR,ET],Object.getOwnPropertyDescriptor(CT.prototype,"startLocalRecording"),CT.prototype),tR(CT.prototype,"grantLocalRecordingPermission",[aR,dR,IT],Object.getOwnPropertyDescriptor(CT.prototype,"grantLocalRecordingPermission"),CT.prototype),tR(CT.prototype,"getLocalRecordingPermissionUserList",[aR,dR,AT],Object.getOwnPropertyDescriptor(CT.prototype,"getLocalRecordingPermissionUserList"),CT.prototype),CT);const OT={moduleEpics0:e=>e.pipe($t(`${Gr}`),ze((e=>{const{payload:{recordingEnable:t}}=e;return gg(t)}))),moduleEpics1:(e,t)=>yn(e,ds).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&&(wc(Oa,{cmrServerStatus:n}),o.recording.recordingIsoEnable&&n===Ca.Start&&wc(Ta,{status:Aa.Ask})),s.push(vg(n))),void 0!==r&&s.push(yg(!r)),void 0!==i&&s.push(Sg(i)),Ue(s)}))),moduleEpics2:e=>yn(e,ds).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 fg(t)}))),moduleEpics3:(e,t)=>yn(e,us).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:u}}=o,d=[];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=u.find((e=>e.userId===i));!t&&null!=o&&o.bLocalRecord&&(wc(Pa,{type:"revoke",value:e.id,canRecord:t}),pT.localRecordingMeeting(_a.Stop)),!t||null!=o&&o.bLocalRecord||wc(Pa,{type:"grant",value:e.id,canRecord:t})}i===e.id&&((a!==wa.None||t)&&d.push(Ag(t?wa.Allow:wa.Deny)),t||d.push(Ig(_a.Stop)))}else wc(Da,{userId:e.id,bLocalRecord:e.bLocalRecordStatus})})),Ue(d)}))),moduleEpics4:(e,t)=>yn(e,us).pipe(ze((e=>gI(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(_g(r.filter((t=>t!==(null==e?void 0:e.userId))))),wc(Pa,{type:"remove",value:null==e?void 0:e.userId}))})),Ue(n)}))),moduleEpics5:e=>yn(e,us).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=>{wc(Ta,{userId:e.id,status:e.bAllowISORecord?Aa.Accept:Aa.Decline})}))})),Et(fe)),moduleEpics6:e=>yn(e,ds).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 wc(ka,{isZoomIQ:t}),bg(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 wc(Ma,{success:r}),r&&n.push(Eg(!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 u,d,l,c;("permission_req_option"===i&&(wc(Pa,{type:"option",value:null===(u=o.payload.body)||void 0===u?void 0:u.option}),r.push(Cg(null===(d=o.payload.body)||void 0===d?void 0:d.option))),"request_permission"===i&&null!==(t=o.payload.body)&&void 0!==t&&t.userId)&&(a&&wc(Pa,{type:"request",value:null===(c=o.payload.body)||void 0===c?void 0:c.userId}),r.push(_g([...s,null===(l=o.payload.body)||void 0===l?void 0:l.userId])));return"permission_request_answer"===i&&(wc(Pa,{type:"answer",value:o.payload.body.agreed}),r.push(Ag(o.payload.body.agreed?wa.Allow:wa.Deny))),Ue(r)})))},TT=fn(OT);let DT=function(e){return e[e.All=1]="All",e[e.Private=2]="Private",e}({}),PT=function(e){return e.SUCCESS="success",e}({}),kT=function(e){return e.CustomizedKey="__zoom_internal_message_customized_key__@@",e.SpeakerOnly="__zoom_internal_message_speaker_only__@@",e}({});const MT=SE.getInstance(),LT=(e,t,o)=>{const{meeting:{encType:n}}=o,r=t,i=lr(e),s=r?DT.Private:DT.All;return n===es.AES_GCM?is.beginEncrypt({text:i,type:ts.XMPP_CHAT}).then((e=>{MT.sendWebinarMseeage(e,r,s,!0)})):MT.sendWebinarMseeage(i,r,s,!1)};function NT(e,t){const{cmd:{jids:o}}=t;return Object.prototype.hasOwnProperty.call(o,e)?Promise.resolve():Fe(Tc(qs).pipe(At((t=>-1===t.findIndex((t=>Number(t.userId)===e)))),ft(1),Le(he)))}function VT(e){const{cmd:{connectionStatus:t}}=e;return t===PT.SUCCESS?Promise.resolve(!0):Fe(Tc(ba,1)).then((e=>e===Ti.Connected||Promise.reject({type:El,reason:"Cannot establish the command channel"})))}function UT(e,t){for(const[o,n]of Object.entries(e))if(n.jid===t)return o}const jT={connectionStatus:"initial",jids:{}},BT=ko({[`${Dg}`]:()=>({...jT}),[`${Rg}`]:uE(((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}}}))})),[`${Og}`]:uE(((e,t)=>{let{payload:o}=t;o.forEach((t=>{const{jid:o}=t,n=UT(e.jids,o);n&&delete e.jids[n]}))})),[`${Tg}`]:uE(((e,t)=>{let{payload:o}=t;e.connectionStatus=o}))},jT);var xT;let FT=(xT=class extends fR{send(e,t){if(!e)return Promise.reject({type:wl,reason:"Text is empty"});if("string"!=typeof e)return Promise.reject({type:wl,reason:"Text is not a string"});if(e.length>512)return Promise.reject({type:wl,reason:"Text exceeds the max length(512)."});const{[nR]:o}=this,n=o(),{socket:{xmppSocketStatus:r},meeting:{userId:i}}=n;return r!==wp.Connected?Promise.reject({type:_l,reason:"Command channel is not ready"}):VT(n).then((()=>t?-1!==bp(o()).findIndex((e=>e.userId===t))?NT(t,n).then((()=>{const{cmd:{jids:n}}=o();return n[t]?(LT(e,n[t].jid,o()),{timestamp:(new Date).getTime(),text:e,receiverId:t,senderId:i}):Promise.reject({type:Il})})):Promise.reject({type:wl,reason:"Cannot find the user"}):(LT(e,"",n),{timestamp:(new Date).getTime(),text:e,receiverId:0,senderId:i})))}getJids(){const{[nR]:e}=this,t=e(),{cmd:{jids:o}}=t;return o}},tR(xT.prototype,"send",[aR],Object.getOwnPropertyDescriptor(xT.prototype,"send"),xT.prototype),xT);const HT={extraEpics0:(e,t)=>e.pipe($t(`${sh}`),_t((e=>{const{payload:{speakerOnly:o}}=e,n=vp(t.value);return(void 0!==(null==n?void 0:n.audio)?Ue([n.audio]):Tc(Ws).pipe(mt((e=>void 0!==e.audio)),ft(1))).pipe(Ot((()=>{VT(t.value).then((()=>{LT(`${kT.SpeakerOnly}${o?1:0}`,"",t.value)}))})),Et(fe))}))),extraEpics1:(e,t)=>yn(e,us).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{LT(`${kT.SpeakerOnly}1`,e[n].jid,t.value)}),Math.floor(Math.random()*Math.log10(o.length)*1e3))}}})),Et(fe))},$T={epics0:(e,t)=>bn(e,24577).pipe(Tt(t),ze((e=>{let[t]=e;const{payload:{body:{status:o}}}=t;return o===PT.SUCCESS&&wc(ba,Ti.Connected),Tg(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:u,type:d,receiver:l,msgid:c,sn:p}}}=t,h=UT(i,l),m=r===es.AES_GCM,v=UT(i,a),g=(new Date).getTime();let f=Promise.resolve({message:u});return m&&(f=is.beginDecrypt({decryptedText:u,type:ts.XMPP_CHAT,zoomId:p})),f.then((e=>{let{message:t}=e;if(d===DT.Private&&Number(h)===n||d===DT.All){const e=dr(t);if(null!=e&&e.startsWith(kT.SpeakerOnly)){const t=e.substring(kT.SpeakerOnly.length),o=1===Number(t);return Hc({userId:Number(v),key:"isSpeakerOnly",value:o})}{var o;const t=v&&(null===(o=i[v])||void 0===o?void 0:o.userGuid);wc(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;wc(zs,[{userId:t,[`${o}`]:n}])}))),epics2:(e,t)=>bn(e,24595).pipe(Xe((e=>{const{payload:{body:{action:o,data:n}}}=e,r=[];if([fE.List,fE.Add,fE.update].includes(o)&&n){const{breakoutRoom:e,participants:{attendeesList:o}}=t.value,i=(null==e?void 0:e.currentRoom.status)===ap.InRoom?o.concat(e.mainSessionAttendeeList):o;r.push(Rg({data:n,attendees:i}))}return o===fE.Remove&&n&&r.push(Og(n)),Ue(r)})))},WT=fn($T,HT),GT=(e,t,o,n)=>{const{getState:r,dispatch:i}=o,s=r(),{participants:{attendeesList:a},audio:{localShareAudioUserMutedList:u},share:{isReceiveSharingFromMainSession:d},breakoutRoom:l}=s,c=(d?null==l?void 0:l.mainSessionAttendeeList:a).find((t=>t.userId==e));if(c){if(c.bShareAudioOn){const o=u.find((t=>t.userId===e));return o&&o.muted===!t&&i(pA(n,e,t,s)),Promise.resolve("")}return Promise.reject({type:El,reason:`Cannot ${t?"mute":"unmute"} share audio when the user's share audio is not enable.`})}return Promise.reject({type:wl,reason:"Cannot find the user"})},zT=(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),Oc(ta,(e=>e.lockShare===t))):Promise.reject({type:wl})},KT=Kc([bp],(e=>e.filter((e=>e.bVideoOn)))),qT=Kc([KT],(e=>e.filter((e=>(e.caps&Zf)===Zf)))),JT=(e,t)=>{const o=e.store.getState(),n=ny(o).find((e=>e.userId===t));if(n){const{caps:e}=n;return(e=>512==(512&e))(e)}return!1};var QT,ZT,YT,XT,eD,tD,oD,nD,rD,iD,sD,aD,uD,dD,lD,cD,pD,hD,mD,vD,gD,fD,yD,SD,bD,ED,ID,AD,CD,_D,wD,RD,OD,TD,DD,PD,kD,MD,LD,ND,VD,UD,jD,BD,xD,FD,HD,$D,WD,GD,zD,KD,qD,JD,QD,ZD,YD,XD,eP,tP,oP,nP,rP,iP,sP,aP,uP,dP,lP,cP,pP,hP,mP,vP,gP,fP,yP;const SP=vR("Audio"),bP=vR("Video"),EP=vR("Sharing"),IP=vR("CameraControl"),AP=vR("Remote Control"),CP=gR(HTMLCanvasElement,0),_P=gR([HTMLCanvasElement,HTMLVideoElement],0),wP=gR(HTMLCanvasElement,0,["id"]),RP=gR([HTMLCanvasElement,HTMLVideoElement],0,["id"]);let OP=(QT=lR("audio"),ZT=lR("audio"),YT=lR("audio"),XT=lR("audio"),eD=lR("audio"),tD=vR("Audio",[1,2,3]),oD=lR("audio"),nD=vR("Audio",[1,2]),rD=lR("audio"),iD=lR("audio"),sD=lR("audio"),aD=lR("audio"),uD=lR("share"),dD=lR("audio"),lD=lR("share"),cD=lR("audio"),pD=lR("audio"),hD=lR("audio"),mD=lR("audio"),vD=lR("audio"),gD=lR("audio"),fD=vR("Audio",[1,2]),yD=lR("audio"),SD=vR("Audio",[1,2]),bD=lR("video"),ED=lR("video"),ID=lR("video"),AD=lR("video"),CD=lR("video"),_D=lR("video"),wD=lR("video"),RD=lR("video"),OD=lR("video"),TD=lR("video"),DD=lR("video"),PD=lR("video"),kD=lR("video"),MD=lR("video"),LD=lR("video"),ND=lR("video"),VD=lR("video"),UD=lR("video"),jD=lR("video"),BD=lR("video"),xD=lR("video"),FD=lR("video"),HD=lR("video"),$D=lR("video"),WD=lR("video"),GD=lR("video"),zD=lR("share"),KD=lR("share"),qD=lR("share"),JD=lR("share"),QD=lR("share"),ZD=lR("share"),YD=lR("share"),XD=lR("share"),eP=cR("isShareOptionLocked"),tP=cR("isShareOptionLocked"),oP=lR("share"),nP=lR("share"),rP=lR("share"),iP=lR("share"),sP=lR("share"),aP=lR("share"),uP=lR("share"),dP=lR("share"),lP=lR("share"),cP=lR("share"),pP=lR("share"),hP=lR("share"),mP=lR("share"),vP=lR("share"),gP=lR("share"),fP=lR("share"),yP=class extends fR{constructor(e){super(e),this[oR].dispatch(Jo()),this[sR]={store:e,mediaAgent:kf(YS(Hs.getInstance())),rwgAgent:Ns.createAgent()}}startAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=vp(s);if((null==a?void 0:a.audio)===Iu.Computer)return Promise.resolve("");if((null==a?void 0:a.audio)===Iu.Phone)return Promise.reject({type:El,reason:"joined by phone"});{const{audio:{isAllowToTalk:e,isComputerAudioLoading:u,canPlayAudio:d,customizeAudioOption:{speakerOnly:l}},media:{audioDecodeStatus:c,audioEncodeStatus:p}}=s;if(u)return Promise.reject({type:El,reason:"Computer audio has been loading, please wait."});const h=function(e){const t=e?{...e}:void 0;if(bA(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&&!EA()&&(console.warn("Cannot enable stereo audio on current platform due to the browser limitation"),Object.assign(e,{stereo:!1}))}return IA()||!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(sh(null!=h?h:{}));const{speakerOnly:m,autoStartAudioInSafari:v}=h||{};if(!!l!=!!m&&n(Hc({userId:s.meeting.userId,key:"isSpeakerOnly",value:!!m})),!a)return Promise.reject({type:El,reason:"Please call `startAudio` method after the `join` has been resolved"});{const t=np(a.userRole)&&!e||m,{encodeInitStatus:u,decodeInitStatus:l}=AA(s,a,m);if(fA()&&("success"!==l||"success"!==u))return Promise.reject({type:El,reason:"It is required to wait for the audio encoding and decoding to be ready before calling `startAudio` method"});n(Gp(!0)),Af("audio",u,l).subscribe((s=>{let[u,l]=s;if(u&&l){let s=d||(fA()||zi.isIOSMobile)&&!v?Promise.resolve():function(){const e=URL.createObjectURL(Wa),t=new Audio(e);return t.muted=!1,zi.isIOSMobile?new Promise(((o,n)=>{var r;t.addEventListener("canplaythrough",(()=>{t.play().then((()=>{o(!0)})).catch((e=>{n(e)})).finally((()=>{URL.revokeObjectURL(e)}))})),null===(r=t.load)||void 0===r||r.call(t)})):Promise.race([t.play(),new Promise(((e,t)=>{window.setTimeout((()=>{t()}),3e3)}))]).finally((()=>{URL.revokeObjectURL(e)}))}();void 0===s&&(s=Promise.resolve()),s.then((()=>_f("audio",o()))).then((()=>{const s=o(),{audio:{isSharingAudio:u}}=s;CA(r,s,t),u&&!SA()||hA(i,s,!t),np(a.userRole)&&e&&n(zp(!0)),n($p(!0))})).catch((()=>{n($p(!1)),n(Gp(!1))}))}else n(Gp(!1))}))}return"failed"===p||"failed"===c?(n(Gp(!1)),Promise.reject({type:Il,reason:"audio encode or decode error"})):new Promise(((e,t)=>{vt(Tc($d.JoinComputerAudio.success,1),ct(...$d.JoinComputerAudio.fail.map((e=>Tc(e,1).pipe(Xe((()=>Be({type:Cl,reason:e}))))))),dt(45e3).pipe(Xe((()=>Be({type:Al}))))).subscribe({next:()=>{n(Gp(!1)),e("")},error:e=>{Hs.getInstance().leaveComputerAudio();const i=vp(o());(null==i?void 0:i.audio)!==Iu.Phone&&(n(gh(Fa.MicrophoneError)),r.joinOrLeaveVoip(!1)),n(Gp(!1)),t(e)}})}))}})(this[sR],e)}stopAudio(){return(async e=>{const{store:{getState:t,dispatch:o},mediaAgent:n,rwgAgent:r}=e,i=t(),{audio:{isComputerAudioLoading:s,isShareAudioEnabled:a,isSharingAudio:u,isUsingMediaPlayback:d,customizeAudioOption:{speakerOnly:l}}}=i,c=vp(i);if(s)return Promise.reject({type:El,reason:"Computer audio has not finished joining, please wait."});if(a){if(u&&!SA())return Promise.reject({type:El,reason:"Cannot stop audio during sharing with audio"});o(Qp(void 0)),o(Kp(void 0))}return(null==c?void 0:c.audio)===Iu.Computer?(o(gh(Fa.Active)),await n.leaveComputerAudio(),r.joinOrLeaveVoip(!1),l&&o(Hc({userId:i.meeting.userId,key:"isSpeakerOnly",value:void 0})),d&&lA.getInstance().stopAudioElement(),o(jp(0)),Oc(Sd)):Promise.resolve("")})(this[sR])}muteAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=vp(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:El,reason:"no audio joined"}):!0===(null==a?void 0:a.muted)?Promise.resolve(""):(n(hh(Ba.Active)),r.mute(a.userId,!0),i.muteAudio(),s.audio.isShareAudioEnabled&&!SA()&&n(Kp(!0)),Oc(bd).then((()=>"")));if(gp(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:El,reason:"no audio joined"}):!1===n.muted?(r.mute(t,!0),Oc(Id,(e=>e.id===t&&1==e.muted))):Promise.resolve(""):Promise.reject({type:wl,reason:"no matching user"})}return Promise.reject({type:Cl})})(this[sR],e)}unmuteAudio(e){return(async(e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=vp(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:El,reason:"no audio joined"});if(!1===(null==a?void 0:a.muted))return Promise.resolve("");if(s.audio.isShareAudioEnabled&&!SA()){if(s.audio.isSharingAudio)return Promise.reject({type:El,reason:"Cannot unmute audio during sharing with audio"});n(Kp(!1))}if(s.audio.bCanUnmute||null!=a&&a.isHost||null!=a&&a.bCoHost){if(np(a.userRole)){const{audio:{isAllowToTalk:e,isAllowToTalkAttendeeConnected:t}}=s;e?t||(await i.leaveComputerAudio(),await hA(i,s,!0),n(zp(!0))):Promise.reject({type:El,reason:"Webinar attendee cannot unmute self audio."})}return n(mh(xa.Active)),r.mute(a.userId,!1),i.unmuteAudio(),Oc(Ed).then((()=>""))}return Promise.reject({type:Cl,reason:"host not allow unmute themselves"})}if(gp(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:El,reason:"no audio joined"}):(!0===n.muted&&r.mute(t,!1),Promise.resolve("")):Promise.reject({type:wl,reason:"no matching user"})}return Promise.reject({type:Cl})})(this[sR],e)}dialOut(e,t,o,n){return((e,t,o,n,r)=>{const{store:{getState:i,dispatch:s},rwgAgent:a}=e,u=i(),{meeting:{callOutCountry:d,isSupportCallOut:l}}=u;if(l&&Array.isArray(d)&&d.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(Pp({sequence:e,phoneNumber:t+o})),Rc($d.JoinAudioByCallMe)}return Promise.reject({type:wl,reason:"no matching country code"})})(this[sR],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)),Rc($d.cancelDialOut)})(this[sR],e,t,o)}hangup(){return(e=>{const{store:{getState:t},rwgAgent:o}=e,n=t(),r=vp(n);return(null==r?void 0:r.audio)===Iu.Phone&&null!==r.userId?(o.audioDrop(r.userId),Rc($d.hangup)):Promise.reject({type:El,reason:"not joined audio by phone"})})(this[sR])}switchMicrophone(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{audio:{microphoneDevicesList:s,activeMicrophone:a,mediaPlaybackFile:u,isUsingMediaPlayback:d}}=i,l=s.find((e=>e.deviceId===t));if("default"===t||"string"!=typeof t||l){const e=vp(i);if((null==e?void 0:e.audio)===Iu.Computer){let o=!1;if("string"==typeof t)t!==a&&(r.changeMicrophone(t,null==l?void 0:l.label,!(null==e||!e.muted)),n(dh(void 0)),lA.getInstance().stopAudioElement(),o=!0);else if(t&&(!d||(null==u?void 0:u.url)!==t.url)){const i=lA.getInstance();i.setAudioElement(t).then((()=>{r.changeMicrophone(i.audioElement,void 0,!(null==e||!e.muted)),n(dh(t))})),o=!0}if(o)return Rc($d.JoinComputerAudio)}else"string"==typeof t&&n(Fp(t));return Promise.resolve("")}return Promise.reject({type:kd})})(this[sR],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:kd});var a;if((null===(a=vp(o()))||void 0===a?void 0:a.audio)===Iu.Computer){if(t!==s)return r.changeSpeaker(t),Oc(Ud,(e=>e))}else n(Hp(t));return Promise.resolve("")})(this[sR],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 GT(t,!0,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r}}=s;if(!t)return Promise.reject({type:El,reason:"Cannot mute sharing audio when sharing audio is not enable"});if(r)return Promise.resolve("");{n.muteShareAudio(!0);let t=Promise.resolve();var u;return e&&(t=null===(u=o.leaveSharingAudio(!0))||void 0===u?void 0:u.then((()=>mA(o,n,s).then((e=>{e.forEach((e=>i(e)))}))))),pA(o,a,!0,s),Promise.all([Oc({event:Ws,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!1===e.bShareAudioOn)),t]).then((()=>(i(Yp(!0)),e&&(i(Xp(!1)),wc(Ld,{state:"off"})),"")))}}})(this[sR],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 GT(t,!1,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r},share:{status:u}}=s;if(!t)return Promise.reject({type:El,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&&u===qa.Sharing&&(t=gA(o,n,s).then((e=>{e.forEach((e=>i(e)))}))),pA(o,a,!1,s),Promise.all([Oc({event:Ws,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!0===e.bShareAudioOn)),t]).then((()=>(i(Yp(!1)),!1===e&&u===qa.Sharing&&(i(Xp(!0)),wc(Ld,{state:"on"})),"")))}}})(this[sR],e)}subscribeAudioStatisticData(e){return(async(e,t)=>{const{mediaAgent:o,store:{getState:n}}=e,r=n(),i=vp(r),s=!t||t.decode,a=!t||t.encode;if(!i)return Promise.reject({type:El,reason:"Call this function after the 'join' method resolved."});{const{encodeInitStatus:e,decodeInitStatus:t}=AA(r,i);Af("audio",e,t).subscribe((e=>{let[t,n]=e;t&&n&&(s&&o.subscribeToQos([xs.AudioDecode],ru),a&&o.subscribeToQos([xs.AudioEncode],ru))}))}return""})(this[sR],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([xs.AudioDecode]),n(eh(hu))),i&&(o.unsubscribeFromQos([xs.AudioEncode]),n(th(hu))),null})(this[sR],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&&!bA(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(vh(!1))),r(ah(a)),o.changeAudioProfile(cA(n())))),Promise.resolve("")})(this[sR],e)}enableSyncButtonsOnHeadset(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,i=n(),{audio:{isHIDEnabled:s,microphoneDevicesList:a,activeMicrophone:u}}=i;if(t===!!s)return Promise.resolve("");{const e=vp(i);var d;return e?(t&&!IA()?console.warn("Sync buttons on headset is not supported on the current platform"):(o.enableSyncButtonsOnHeadset(t,null===(d=a.find((e=>e.deviceId===u)))||void 0===d?void 0:d.label,e.muted),r(uh(t))),Promise.resolve("")):Promise.reject({type:El,reason:"Please call `enableSyncButtonsOnHeadset` method after the `join` has been resolved"})}})(this[sR],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)||EA()||(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(ah(!1))),r(vh(a)),o.changeAudioProfile(cA(n()))),Promise.resolve("")})(this[sR],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(yh({sequence:s,ip:t,protocol:o})),Rc($d.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[sR],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===Mu.Ringing?(n.cancelInviteCRCDevice(s.transId),Promise.resolve("")):Promise.reject({type:El,reason:"Cannot cancel call out "})})(this[sR],e,t)}getMicList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.microphoneDevicesList]:[]})(this[sR])}getSpeakerList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.speakerDevicesList]:[]})(this[sR])}getAudioState(e){return((e,t)=>{let{store:{getState:o}}=e;const n=o(),{meeting:{isWebinar:r}}=n;let i=null;return null==t?i=vp(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[sR],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=vp(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[sR],e)}getActiveMicrophone(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeMicrophone:null})(this[sR])}getActiveSpeaker(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeSpeaker:null})(this[sR])}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[sR])}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[sR])}getDialOutCountries(){return(e=>{let{store:{getState:t}}=e;const{meeting:{callOutCountry:o}}=t();return Array.isArray(o)?o:[]})(this[sR])}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[sR])}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[sR],e)}getAudioStatisticData(){return(e=>{let{store:{getState:t}}=e;const{audio:{statistic:o}}=t();return{...o}})(this[sR])}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[sR])}isSupportMicrophoneAndShareAudioSimultaneously(){return SA()}startVideo(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{media:{videoDecodeStatus:s,videoEncodeStatus:a,enforceVirtualBackground:u},video:{isCaptureCameraLoading:d,isCurrentUserStartedVideo:l,isVideoMuted:c}}=i,p=t?{...t}:void 0;if(l)return Promise.reject({type:El,reason:"Video is started"});if(d)return Promise.reject({type:El,reason:"Camera is starting,please wait."});if(c&&!gp(i))return Promise.reject({type:El,reason:"Video is muted by the host"});if(cw(u)&&!((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(`#${pu}`);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=pu,document.body.appendChild(e)}p&&Object.assign(p,{videoElement:e})}return!Mf(u)&&null!=p&&p.virtualBackground?Promise.reject({type:wl,reason:"Virtual background only compatible with Chrome and Edge with SharedArrayBuffer enabled."}):(n(hm(!0)),Af("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:u=t,captureWidth:d=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(Pm({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=Aw({...t,captureWidth:d,captureHeight:l,cameraId:u,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=Cw({...t,captureWidth:d,captureHeight:l,cameraId:u,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=>_f("video",o()).then((()=>e)))).then((t=>{sw(r,e,p).forEach((e=>{n(e)})),f?n(Om(t)):y&&n(Gm(t))})).catch((e=>{n(hm(!1)),wc($u,{reason:e})}))}else n(hm(!1))})),Rc(pd.startCaptureVideo).then((()=>{n(mm(!1)),n(lm(!1))})).finally((()=>{n(hm(!1))})))})(this[sR],e)}stopVideo(){return(e=>{const{store:{getState:t},mediaAgent:o}=e,{video:{isCaptureCameraLoading:n,isCurrentUserStartedVideo:r,isUsingMediaPlayback:i}}=t();return n?Promise.reject({type:El,reason:"Camera is starting,please wait."}):r?(o.stopCaptureVideo(),i&&lA.getInstance().stopVideoElement(),Oc(zu,(e=>!0!==(null==e?void 0:e.failed)))):Promise.reject({type:El,reason:"camera is closed"})})(this[sR])}switchCamera(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{video:{cameraDevicesList:s,isCurrentUserStartedVideo:a,virtualBackground:u,mask:d,mediaPlaybackFile:l,isUsingMediaPlayback:c,customizedVideoOption:p}}=i;if("string"==typeof t&&!iw(t,s))return Promise.reject({type:wl,reason:"Cannot find cameraDeviceId in camera devices list."});if(a||null!=u&&u.isVBConfigured||d.isMaskConfigured){if("string"==typeof t){const{captureWidth:e,captureHeight:o}=rw(p);r.changeCamera(t,{width:e,height:o}),n(qm(void 0)),lA.getInstance().stopVideoElement()}else if(t&&(!c||(null==l?void 0:l.url)!==t.url)){const e=lA.getInstance();e.setVideoElement(t).then((()=>{r.changeCamera(e.videoElement),n(qm(t))}))}return Rc(pd.switchCameraVideo).then((()=>{n(mm(!1)),n(lm(!1))}))}return Promise.resolve()})(this[sR],e)}renderVideo(e,t,o,n,r,i,s,a,u){return((e,t,o,n,r,i,s,a,u,d)=>{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=cw(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:El,reason:`subscribe video counts greater than maximum size (${E})`});if(-1===KT(m).findIndex((e=>e.userId===o)))return Promise.reject({type:wl,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),p.renderVideo(t,o,u||su,n,r,i,s,a,!0,d||"",!1),c(fm(o));const e=document.querySelector(`#${pu}`);return e&&e.remove(),Promise.resolve("")}return Promise.reject({type:wl,reason:"You must use a