@ylink-sdk/meeting 1.0.1-beta.4 → 1.0.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";function t(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{c(i.next(t))}catch(e){n(e)}}function a(t){try{c(i.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,s){var i=t.get(e);i?i.push(s):t.set(e,[s])},off:function(e,s){var i=t.get(e);i&&(s?i.splice(i.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var i=t.get(e);i&&i.slice().map((function(t){t(s)})),(i=t.get("*"))&&i.slice().map((function(t){t(e,s)}))}}}Object.defineProperty(exports,"__esModule",{value:!0});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}};!function(t,e){var i="__lodash_hash_undefined__",r=9007199254740991,n="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",d="[object Map]",l="[object Number]",p="[object Object]",h="[object Promise]",m="[object RegExp]",g="[object Set]",f="[object String]",v="[object Symbol]",x="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",q="[object Float32Array]",I="[object Float64Array]",E="[object Int8Array]",D="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",S="[object Uint8ClampedArray]",R="[object Uint16Array]",T="[object Uint32Array]",A=/\w*$/,C=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,_={};_[n]=_["[object Array]"]=_[b]=_[y]=_[o]=_[a]=_[q]=_[I]=_[E]=_[D]=_[$]=_[d]=_[l]=_[p]=_[m]=_[g]=_[f]=_[v]=_[O]=_[S]=_[R]=_[T]=!0,_["[object Error]"]=_[c]=_[x]=!1;var w="object"==typeof self&&self&&self.Object===Object&&self,k="object"==typeof s&&s&&s.Object===Object&&s||w||Function("return this")(),N=e&&!e.nodeType&&e,M=N&&t&&!t.nodeType&&t,P=M&&M.exports===N;function L(t,e){return t.set(e[0],e[1]),t}function j(t,e){return t.add(e),t}function B(t,e,s,i){var r=-1,n=t?t.length:0;for(i&&n&&(s=t[++r]);++r<n;)s=e(s,t[r],r,t);return s}function H(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(s){}return e}function V(t){var e=-1,s=Array(t.size);return t.forEach((function(t,i){s[++e]=[i,t]})),s}function G(t,e){return function(s){return t(e(s))}}function Y(t){var e=-1,s=Array(t.size);return t.forEach((function(t){s[++e]=t})),s}var K,F=Array.prototype,J=Function.prototype,W=Object.prototype,z=k["__core-js_shared__"],Q=(K=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",X=J.toString,Z=W.hasOwnProperty,tt=W.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=P?k.Buffer:void 0,it=k.Symbol,rt=k.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=W.propertyIsEnumerable,ct=F.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),pt=Mt(k,"DataView"),ht=Mt(k,"Map"),mt=Mt(k,"Promise"),gt=Mt(k,"Set"),ft=Mt(k,"WeakMap"),vt=Mt(Object,"create"),xt=Ht(pt),bt=Ht(ht),yt=Ht(mt),qt=Ht(gt),It=Ht(ft),Et=it?it.prototype:void 0,Dt=Et?Et.valueOf:void 0;function $t(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function Ot(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function St(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function Rt(t){this.__data__=new Ot(t)}function Tt(t,e){var s=Gt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Yt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==n)}(t)?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],i=s.length,r=!!i;for(var o in t)!e&&!Z.call(t,o)||r&&("length"==o||jt(o,i))||s.push(o);return s}function At(t,e,s){var i=t[e];Z.call(t,e)&&Vt(i,s)&&(void 0!==s||e in t)||(t[e]=s)}function Ct(t,e){for(var s=t.length;s--;)if(Vt(t[s][0],e))return s;return-1}function Ut(t,e,s,i,r,h,x){var C;if(i&&(C=h?i(t,r,h,x):i(t)),void 0!==C)return C;if(!Jt(t))return t;var U=Gt(t);if(U){if(C=function(t){var e=t.length,s=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(s.index=t.index,s.input=t.input);return s}(t),!e)return function(t,e){var s=-1,i=t.length;e||(e=Array(i));for(;++s<i;)e[s]=t[s];return e}(t,C)}else{var w=Lt(t),k=w==c||w==u;if(Kt(t))return function(t,e){if(e)return t.slice();var s=new t.constructor(t.length);return t.copy(s),s}(t,e);if(w==p||w==n||k&&!h){if(H(t))return h?t:{};if(C=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:(e=nt(t),Jt(e)?ot(e):{});var e}(k?{}:t),!e)return function(t,e){return kt(t,Pt(t),e)}(t,function(t,e){return t&&kt(e,Wt(e),t)}(C,t))}else{if(!_[w])return h?t:{};C=function(t,e,s,i){var r=t.constructor;switch(e){case b:return wt(t);case o:case a:return new r(+t);case y:return function(t,e){var s=e?wt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}(t,i);case q:case I:case E:case D:case $:case O:case S:case R:case T:return function(t,e){var s=e?wt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}(t,i);case d:return function(t,e,s){var i=e?s(V(t),!0):V(t);return B(i,L,new t.constructor)}(t,i,s);case l:case f:return new r(t);case m:return function(t){var e=new t.constructor(t.source,A.exec(t));return e.lastIndex=t.lastIndex,e}(t);case g:return function(t,e,s){var i=e?s(Y(t),!0):Y(t);return B(i,j,new t.constructor)}(t,i,s);case v:return n=t,Dt?Object(Dt.call(n)):{}}var n}(t,w,Ut,e)}}x||(x=new Rt);var N=x.get(t);if(N)return N;if(x.set(t,C),!U)var M=s?function(t){return function(t,e,s){var i=e(t);return Gt(t)?i:function(t,e){for(var s=-1,i=e.length,r=t.length;++s<i;)t[r+s]=e[s];return t}(i,s(t))}(t,Wt,Pt)}(t):Wt(t);return function(t,e){for(var s=-1,i=t?t.length:0;++s<i&&!1!==e(t[s],s,t););}(M||t,(function(r,n){M&&(r=t[n=r]),At(C,n,Ut(r,e,s,i,n,t,x))})),C}function _t(t){return!(!Jt(t)||(e=t,Q&&Q in e))&&(Ft(t)||H(t)?et:C).test(Ht(t));var e}function wt(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}function kt(t,e,s,i){s||(s={});for(var r=-1,n=e.length;++r<n;){var o=e[r],a=i?i(s[o],t[o],o,s,t):void 0;At(s,o,void 0===a?t[o]:a)}return s}function Nt(t,e){var s,i,r=t.__data__;return("string"==(i=typeof(s=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==s:null===s)?r["string"==typeof e?"string":"hash"]:r.map}function Mt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return _t(s)?s:void 0}$t.prototype.clear=function(){this.__data__=vt?vt(null):{}},$t.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},$t.prototype.get=function(t){var e=this.__data__;if(vt){var s=e[t];return s===i?void 0:s}return Z.call(e,t)?e[t]:void 0},$t.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},$t.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?i:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,s=Ct(e,t);return!(s<0)&&(s==e.length-1?e.pop():ct.call(e,s,1),!0)},Ot.prototype.get=function(t){var e=this.__data__,s=Ct(e,t);return s<0?void 0:e[s][1]},Ot.prototype.has=function(t){return Ct(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var s=this.__data__,i=Ct(s,t);return i<0?s.push([t,e]):s[i][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||Ot),string:new $t}},St.prototype.delete=function(t){return Nt(this,t).delete(t)},St.prototype.get=function(t){return Nt(this,t).get(t)},St.prototype.has=function(t){return Nt(this,t).has(t)},St.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},Rt.prototype.clear=function(){this.__data__=new Ot},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var s=this.__data__;if(s instanceof Ot){var i=s.__data__;if(!ht||i.length<199)return i.push([t,e]),this;s=this.__data__=new St(i)}return s.set(t,e),this};var Pt=ut?G(ut,Object):function(){return[]},Lt=function(t){return tt.call(t)};function jt(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||U.test(t))&&t>-1&&t%1==0&&t<e}function Bt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||W)}function Ht(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(pt&&Lt(new pt(new ArrayBuffer(1)))!=y||ht&&Lt(new ht)!=d||mt&&Lt(mt.resolve())!=h||gt&&Lt(new gt)!=g||ft&&Lt(new ft)!=x)&&(Lt=function(t){var e=tt.call(t),s=e==p?t.constructor:void 0,i=s?Ht(s):void 0;if(i)switch(i){case xt:return y;case bt:return d;case yt:return h;case qt:return g;case It:return x}return e});var Gt=Array.isArray;function Yt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}(t.length)&&!Ft(t)}var Kt=dt||function(){return!1};function Ft(t){var e=Jt(t)?tt.call(t):"";return e==c||e==u}function Jt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wt(t){return Yt(t)?Tt(t):function(t){if(!Bt(t))return lt(t);var e=[];for(var s in Object(t))Z.call(t,s)&&"constructor"!=s&&e.push(s);return e}(t)}t.exports=function(t){return Ut(t,!0,!0)}}(i,i.exports);var r=i.exports;const n=t=>({get(e,s){if("__isProxy"===s)return!0;const i=Reflect.get(e,s);return Array.isArray(i)?i:"object"==typeof i&&null!==i?i.__isProxy?i:new Proxy(i,n(t)):i},set(e,s,i,n){const o=e[s];i=p(i)&&i.__isProxy?r(i):i;const a=Reflect.set(e,s,i,n);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${b(s)}Change`,i),a}}),o=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]"),a=t=>{const e=t.getAllResponseHeaders(),s={};return e.trim().split(/[\r\n]+/).forEach((t=>{var e;const i=t.split(": "),r=null!==(e=i.shift())&&void 0!==e?e:"",n=i.join(": ");s[r]=n})),s};class c{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const e=t.timeout||18e5;let s=t.headers||{};return t.url=E(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const s=[];Object.keys(e).forEach((t=>{const i=e[t];if(null==i)return;let r;Array.isArray(i)?(r=i,t+="[]"):r=[i],r.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),s.push(`${o(t)}=${o(e)}`)}))}));const i=s.join("&");if(i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t})(t.url,t.params),s=Object.assign({},this._defaultHeaders,s),Object.keys(s).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(s["Content-Type"]=s[t],delete s[t])})),h(t.data)&&(t.data=t.data.buffer),(m(t.data)||d(t.data))&&(s&&!s["Content-Type"]&&(s["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=s,t.timeout=e,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx&&void 0!==wx.request?(t=>new Promise(((e,s)=>{const{data:i=null,url:r,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:r,data:i,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(Object.assign(Object.assign({},t.data),{headers:t.header})):s({url:r,statusCode:t.statusCode})},fail(t){s("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})))(t):(t=>new Promise(((e,s)=>{var i;const{data:r=null,url:n="",method:o="GET",headers:c,cancelToken:u}=t;let d=new XMLHttpRequest;d.open(o.toUpperCase(),n,!0),d.timeout=null!==(i=t.timeout)&&void 0!==i?i:6e4;const l=()=>{if(d){if(d.status>=200&&d.status<300)try{const t=JSON.parse(d.responseText);e(Object.assign(Object.assign({},t),{headers:a(d)}))}catch(t){s(new Error(`E_JSON_PARSE${d.responseText}`))}else s({url:n,statusCode:d.status});d=null}};"onloadend"in d?d.onloadend=l:d.onreadystatechange=()=>{d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(l)},d.onabort=()=>{d&&(s({url:n,statusCode:d.status,type:"request abort"}),d=null)},d.onerror=()=>{s(new Error("Network Error")),d=null},d.ontimeout=()=>{s(new Error(`timeout of ${t.timeout}ms exceeded`)),d=null},"setRequestHeader"in d&&Object.keys(c).forEach((t=>{null===r&&"content-type"===t.toLowerCase()?delete c[t]:null==d||d.setRequestHeader(t,c[t])})),u&&u.promise.then((t=>{d&&(d.abort(),s(t),d=null)})),d.send(r)})))(t)}setDefaultHeader(t,e){t in this._defaultHeaders&&(""===e||null===e)?delete this._defaultHeaders[t]:this._defaultHeaders[t]=e}setBeforeRequest(t){this._beforeRequest=t}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"POST",data:e}))}put(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"PUT",data:e}))}}class u{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new u((e=>{t=e}));return{cancel:t,token:e}}}const d=Array.isArray,l=t=>null==t,p=t=>"object"==typeof t&&null!==t,h=t=>{let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e},m=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},g=()=>{const t=[],e="0123456789abcdef";for(let s=0;s<36;s++)t[s]=e.substr(Math.floor(16*Math.random()),1);t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-";return t.join("").split("-").join("")},f=(t=new Date,e="")=>{const s={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,`${t.getFullYear()}`.substr(4-RegExp.$1.length)));for(const i in s)new RegExp(`(${i})`).test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?s[i]:`00${s[i]}`.substr(`${s[i]}`.length)));return e},v=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,i]=[t[0],t[1]];if(null!==i)return p(i)&&!d(i)?(e[s]||(e[s]={}),void(e[s]=v(i,e[s]))):void(e[s]=i)})),e):e,x=/-(\w)/g,b=t=>t.replace(x,((t,e)=>e?e.toUpperCase():"")),{hasOwnProperty:y}=Object.prototype,q=(t,e)=>y.call(t,e),I=(t,e=new Map)=>{if(e.get(t))return e.get(t);if(!(t instanceof Object))return t;let s;s=t instanceof Array?[]:t instanceof Function?()=>t():t instanceof RegExp?new RegExp(t.source,t.flags):t instanceof Date?new Date(t):{},e.set(t,s);for(const i in t)q(t,i)&&(s[i]=I(t[i],e));return s},E=(t,e)=>t&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)?((t,e)=>e?`${t.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`:t)(t,e):e,D=t=>{console.log(`computeNextTimeout attempts: ${t}`);let e=Math.floor(Math.random()*2**t+1);return e<2&&(e=2),e>30&&(e=30),1e3*e};var $,O,S,R,T,A;exports.EVENT=void 0,($=exports.EVENT||(exports.EVENT={})).STATE="state",$.FAILED="failed",$.BO_FAILED="boFailed",$.REQUEST_ERROR="requestError",$.POLLING_ERROR="pollingError",$.KEEPALIVE_ERROR="keepaliveError",$.BREAKOUT_ROOMS_STATE="breakoutRoomsState",exports.STATE=void 0,(O=exports.STATE||(exports.STATE={}))[O.CLOSE=0]="CLOSE",O[O.JOINED=1]="JOINED",O[O.READY=2]="READY",exports.BREAKOUT_ROOMS_STATE=void 0,(S=exports.BREAKOUT_ROOMS_STATE||(exports.BREAKOUT_ROOMS_STATE={}))[S.CLOSE=0]="CLOSE",S[S.JOINED=1]="JOINED",S[S.READY=2]="READY",exports.ENDPOINT_TYPE=void 0,(R=exports.ENDPOINT_TYPE||(exports.ENDPOINT_TYPE={})).WEBAPP="webApp",R.WEBCTRL="webCtrl",R.WECHATMP="weChatMP",R.SUPERVISION="supervision",R.BIGSCREEN="bigScreen",R.DESKTOP="desktop",R.MOBILE="mobile",R.VCS="vcs",R.SIP="sip",R.H323="h323",R.PSTN="pstn",R.MULTI_STREAM="multiStream",R.MEETING_TOUCH="meetingTouch",R.MEETING_ROOMS="meetingRooms",R.RTSP="rtsp",R.RTMP_PULLER="rtmpPuller",R.GB28181="gb28181",R.TELE_PRESENCE="telePresence",R.RTSP_Access="rtspAccess",exports.ROLE=void 0,(T=exports.ROLE||(exports.ROLE={})).HOST="host",T.COHOST="coHost",T.ATTENDEE="attendee",T.AUDIENCE="audience",exports.RECORD_STATUS=void 0,(A=exports.RECORD_STATUS||(exports.RECORD_STATUS={})).STARTED="started",A.PAUSED="paused",A.STARTING="starting",A.STOPPED="stopped";class C{constructor(t,s){Object.defineProperty(this,"moduleName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"off",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.moduleName=s,this.ctx=t,this.emitter=e(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},n(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},n(this.emitter))}cleanData(){this.data=new Proxy({},n(this.emitter))}reactiveData(t){if(!p(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,i,r)=>{Object.keys(t).forEach((r=>{!1===i&&r in this.data&&(t[r]=this.data[r]);const n=e=>t[r]=e,o=`${b(r)}Change`;this.emitter.on(o,n),e.set(o,n),p(t[r])&&!d(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class U extends C{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:s}=t;("full"===e||"update"===e)&&v(s,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;v({participantCount:e},this.data)}))}subject(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/info/subject`,e)}))}practiceSession(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/info/practiceSession`)}))}shareInfo(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:s}=this.ctx.config.request;return t.credential=t.credential||s,this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:s},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/operationRecord`,t)}getImConfig(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:s}=this.ctx.config.request;return t.credential=t.credential||s,this.ctx.request.get(`${e}im/config`,{params:t})}sendMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/send`,t)}getUserInfo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}participantDetail?meetingID=${s}`,t)}sendInvitationMail(t){if(!t)return Promise.reject();const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/sendInvitationMail `,t)}getMailTemplate(t,e){if(!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.get(`${s}meetingNum/${t}/mailTemplate`,{params:Object.assign(Object.assign({},e),{meetingID:i})})}getPortUsage(t){const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.get(`${e}portUsage`,{params:t})}}function _(t){const e=[],{isInLobby:s}=t.modules.me.data;return s?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((s=>{var i;const r=t.modules[s]._topic();r&&(Array.isArray(r)?r.forEach((s=>{var i;e.includes(s)||(null===(i=t.config.filterTopics)||void 0===i?void 0:i.includes(s))||e.push(s)})):e.includes(r)||(null===(i=t.config.filterTopics)||void 0===i?void 0:i.includes(r))||e.push(r))})),e)}function w(e,s,i,r){return t(this,void 0,void 0,(function*(){const t=r.config.request.flag?`?flag=${r.config.request.flag}`:"",n=yield r.request.post(`/ypush/api/v1/meeting-control/inbox${t}`,{basic:{tenantId:100,clientId:i,meetingId:s},inboxes:e}),o=[];return n.data&&Object.keys(n.data).forEach((t=>{o.push({name:t,seqId:n.data[t].maxSeqId,limit:200})})),o}))}function k(e,s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:i,clientID:r,flag:n}=s.config.request,o=n?`?flag=${n}`:"",a=yield s.request.post(`${t}meetings/${i}/subscribe${o}`,{endpointID:r,topics:e}),c=a&&a.data&&a.data.eventMsgs;c&&c.forEach((t=>{s.emitter.emit(t.event,t)}))}))}function N(e,s,i){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r,boClientID:n}=i.config.request,o=yield i.request.post(`${t}meetings/${r}/breakoutRooms/${e}/subscribe`,{endpointID:n,topics:s}),a=o&&o.data&&o.data.eventMsgs;a&&a.forEach((t=>{t.isBreakoutRooms=!0,i.emitter.emit(t.event,t)}))}))}function M(e,s,i){return t(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c,query:u=""}=s;if(yield(()=>t(this,void 0,void 0,(function*(){let t;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},d={cancelToken:a};try{t=yield e.post(`/ypush/api/v1/meeting-control/polling${u}`,s,d)}catch(h){return c.attempts+=1,void(h&&"request abort"!==h.type&&console.error(h))}if(!t)return console.error("polling error: ","response is null"),void(c.attempts+=1);const{data:l={},bizCode:p,error:h}=t;if(p&&900408!==p)return console.error("polling error: ",JSON.stringify(h)),void(c.attempts+=1);c.attempts=0,l&&Object.keys(l).forEach((t=>{var e;const s=r.find((e=>e.name===t));s&&(s.seqId=l[t].maxSeqId,l[t].items&&(null===(e=l[t].items)||void 0===e||e.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording","audioRecording","liveStreaming"].includes(e.event)&&(e.stime=t.stime),e.pollingSeqId=t.seqId,i(e)}))))}))})))(),!c.running)return;if(c.attempts>6)return console.error("polling Max Attempts"),void(s.onError&&s.onError({message:"polling Max Attempts"}));const d=c.attempts?D(c.attempts):0;c.timer=setTimeout((()=>{c.running&&M(e,s,i)}),d)}))}function P(e,s,i){return t(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c}=s;if(yield(()=>t(this,void 0,void 0,(function*(){let t;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},u={cancelToken:a};try{t=yield e.post("/ypush/api/v1/meeting-control/polling?bo=1",s,u)}catch(p){return c.boAttempts+=1,void(p&&"request abort"!==p.type&&console.error(p))}if(!t)return console.error("[Meeting] boPolling error: ","response is null"),void(c.attempts+=1);const{data:d={},bizCode:l,error:p}=t;if(l&&900408!==l)return console.error("[Meeting] boPolling error: ",JSON.stringify(p)),void(c.boAttempts+=1);c.boAttempts=0,d&&Object.keys(d).forEach((t=>{var e;const s=r.find((e=>e.name===t));s&&(s.seqId=d[t].maxSeqId,null===(e=d[t].items)||void 0===e||e.forEach((t=>{const e=JSON.parse(t.content);e.isBreakoutRooms=!0,e.pollingSeqId=t.seqId,i(e)})))}))})))(),!c.running)return;if(c.boAttempts>6)return console.error("[Meeting] polling Max Attempts"),void(s.onError&&s.onError({message:"polling Max Attempts"}));const u=c.boAttempts?D(c.boAttempts):0;c.boTimer=setTimeout((()=>{c.running&&P(e,s,i)}),u)}))}const L=(t,e)=>{const{meetingID:s,clientID:i,flag:r}=e.config.request,n=r?`?flag=${r}`:"";e.status.polling.running=!0,M(e.request,{inboxes:t,clientID:i,meetingID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.polling,query:n,onError(t){e.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>new Promise((s=>{var i;e.emitter.emit(t.event,t),void 0!==(null===(i=t.body)||void 0===i?void 0:i.seq)&&e.emitter.emit("eventSeqChange",{event:t.event,seq:t.body.seq}),s()}))))},j=(t,e)=>{const{boMeetingID:s,boClientID:i}=e.config.request;P(e.request,{inboxes:t,clientID:i,meetingID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.polling,onError(t){e.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>{e.emitter.emit(t.event,t)}))};function B(t){t.status.polling.running=!1,t.status.polling.attempts=0,t.status.polling.boAttempts=0,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.status.polling.boTimer&&(clearTimeout(t.status.polling.boTimer),t.status.polling.boTimer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=u.source()}function H(e,s){return t(this,void 0,void 0,(function*(){const{meetingID:i,userID:r,status:n,cancelToken:o,onError:a,query:c="",onRegionChange:u}=s;if(n.timer&&(clearTimeout(n.timer),n.timer=null),yield(()=>t(this,void 0,void 0,(function*(){let t;try{t=yield e.post(`/meeting-ctrl/api/v1/meetings/${i}/users/${r}/keepalive${c}`,{},{cancelToken:o.token})}catch(d){return n.attempts+=1,void console.error(d)}if(!t)return;const{data:s={},bizCode:a,error:d,headers:l}=t;if(l&&(l["x-y-meeting-prefer"]||l["X-Y-Meeting-Prefer"])&&(null==u||u(l["x-y-meeting-prefer"]||l["X-Y-Meeting-Prefer"])),900200!==a&&900408!==a&&901323!==a)return n.attempts+=1,void console.error("keepalive ",a,d);const p=s.interval||"";if(!p)return n.attempts+=1,void console.error("keepalive ",a,d);n.interval=p,n.attempts=0})))(),!n.running)return;if(n.attempts>10)return console.error("keepalive Max Attempts"),void(a&&a({message:"keepalive Max Attempts"}));const d=n.attempts?D(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&H(e,s)}),d)}))}function V(t){const{meetingID:e,userID:s,flag:i}=t.config.request,r=i?`?flag=${i}`:"";t.status.keepalive.running=!0,H(t.request,{meetingID:e,userID:s,cancelToken:t.config.request.cancelToken.token,status:t.status.keepalive,query:r,onError(e){t.emitter.emit(exports.EVENT.KEEPALIVE_ERROR,e)},onRegionChange(e){t.emitter.emit("regionChange",e)}})}const G=t=>{t.status.keepalive.running=!1,t.status.keepalive.attempts=0,t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null)},Y=(e,s,i)=>t(void 0,void 0,void 0,(function*(){const{meetingID:r,status:n,events:o}=s;if(n.timer&&(clearTimeout(n.timer),n.timer=null),yield t(void 0,void 0,void 0,(function*(){let t;try{t=yield e.post(`/meeting-ctrl/api/v1/meetings/${r}/eventsSeq`,{events:o})}catch(n){return void console.error(n)}if(!t)return;const{data:s={}}=t;s&&i(s)})),!n.running)return;n.timer=setTimeout((()=>{n.running&&Y(e,s,i)}),1e3*n.interval)})),K=t=>{t.status.eventsSeq.running=!1,t.status.eventsSeq.timer&&(clearTimeout(t.status.eventsSeq.timer),t.status.eventsSeq.timer=null)};var F,J,W,z;exports.MeEvent=void 0,(F=exports.MeEvent||(exports.MeEvent={})).INIT="meInit",F.UPDATE="meUpdate",F.UPDATE_USER_STATE="updateUserState",F.ROLECHANGE="meRoleChange",F.AUDIOCHANGE="meAudioChange",F.HANDUPCHANGE="meHandupChange",F.SETAUDIO="setAudio",F.VIDEOCHANGE="meVideoChange",F.SETVIDEO="setVideo",F.SHARECHANGE="meShareChange",F.WHITEBOARDCHANGE="meWhiteBoardChange",F.DISPLAYNAMECHANGE="meDisplayNameChange",F.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",F.LOBBYCHANGE="meLobbyChange",F.BARRAGECHANGE="meBarrageChange",F.PERSONALLAYOUTCHANGE="personalLayoutChange",F.PERMCHANGE="permChange",F.BOSWITCHNOTIFY="boSwitchNotify",F.BORETURNMEETINGNOTIFY="boReturnMeetingNotify",F.TOPMCCHANGE="mediaTopMCChange",F.TRANSLATIONCHANNELCHANGE="translationChannelChange",F.LEAVE="leave";class Q extends C{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const e=e=>t(this,void 0,void 0,(function*(){if("role"in e&&e.role!==this.data.role&&e.role){const t=this.data.role;v({role:e.role},this.data),e.role!==exports.ROLE.AUDIENCE&&t!==exports.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(exports.MeEvent.ROLECHANGE,e.role),this.ctx.emitter.emit(exports.MeEvent.ROLECHANGE,e.role)}})),s=t=>{var e,s,i,r,n,o,a,c,u,d;if("audio"in t&&t.audio){const{deviceOn:p,sendOn:h,recvOn:m,opBy:g}=t.audio;if(!l(p)&&p!==(null===(e=this.data.audio)||void 0===e?void 0:e.deviceOn)||!l(h)&&h!==(null===(s=this.data.audio)||void 0===s?void 0:s.sendOn)||!l(m)&&m!==(null===(i=this.data.audio)||void 0===i?void 0:i.recvOn)||!l(g)&&g!==(null===(r=this.data.audio)||void 0===r?void 0:r.opBy)){const e={deviceOn:null===(n=this.data.audio)||void 0===n?void 0:n.deviceOn,sendOn:null===(o=this.data.audio)||void 0===o?void 0:o.sendOn,recvOn:null===(a=this.data.audio)||void 0===a?void 0:a.recvOn};v({audio:t.audio},this.data);const s={deviceOn:l(p)?null===(c=this.data.audio)||void 0===c?void 0:c.deviceOn:p,sendOn:!!(l(h)?null===(u=this.data.audio)||void 0===u?void 0:u.sendOn:h),recvOn:l(m)?null===(d=this.data.audio)||void 0===d?void 0:d.recvOn:m,opBy:g,changeData:Object.assign({},t.audio),oldData:e};this.emitter.emit(exports.MeEvent.AUDIOCHANGE,s)}}},i=t=>{var e,s,i,r,n,o,a,c,u;if("video"in t&&t.video){const{deviceOn:d,sendOn:p,opBy:h,blocked:m}=t.video;if(!l(d)&&d!==(null===(e=this.data.video)||void 0===e?void 0:e.deviceOn)||!l(p)&&p!==(null===(s=this.data.video)||void 0===s?void 0:s.sendOn)||!l(m)&&m!==(null===(i=this.data.video)||void 0===i?void 0:i.blocked)){const e={deviceOn:null===(r=this.data.video)||void 0===r?void 0:r.deviceOn,sendOn:null===(n=this.data.video)||void 0===n?void 0:n.sendOn,blocked:null===(o=this.data.video)||void 0===o?void 0:o.blocked};v({video:t.video},this.data);const s={deviceOn:l(d)?null===(a=this.data.video)||void 0===a?void 0:a.deviceOn:d,sendOn:!!(l(p)?null===(c=this.data.video)||void 0===c?void 0:c.sendOn:p),blocked:l(m)?null===(u=this.data.video)||void 0===u?void 0:u.blocked:m,opBy:h,changeData:Object.assign({},t.video),oldData:e};this.emitter.emit(exports.MeEvent.VIDEOCHANGE,s)}}},r=t=>{var e,s,i,r,n,o,a,c;if("share"in t&&t.share){const{deviceOn:n,sendOn:o,opBy:a}=t.share;if(!l(n)&&n!==(null===(e=this.data.share)||void 0===e?void 0:e.deviceOn)||!l(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.sendOn)){v({share:t.share},this.data);const e={deviceOn:l(n)?null===(i=this.data.share)||void 0===i?void 0:i.deviceOn:n,sendOn:!!(l(o)?null===(r=this.data.share)||void 0===r?void 0:r.sendOn:o),opBy:a};this.emitter.emit(exports.MeEvent.SHARECHANGE,e)}}if("whiteboard"in t&&t.whiteboard){const{deviceOn:e,sendOn:s,opBy:i}=t.whiteboard;if(!l(e)&&e!==(null===(n=this.data.whiteboard)||void 0===n?void 0:n.deviceOn)||!l(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.sendOn)){v({whiteboard:t.whiteboard},this.data);const r={deviceOn:l(e)?null===(a=this.data.whiteboard)||void 0===a?void 0:a.deviceOn:e,sendOn:!!(l(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.sendOn:s),opBy:i};this.emitter.emit(exports.MeEvent.WHITEBOARDCHANGE,r)}}},n=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.emitter.emit(exports.MeEvent.DISPLAYNAMECHANGE,t.displayName))},o=t=>{"isHandUp"in t&&t.isHandUp!==this.data.isHandUp&&(v({isHandUp:t.isHandUp},this.data),this.emitter.emit(exports.MeEvent.HANDUPCHANGE,!!t.isHandUp))},a=t=>{"isSpotlightVideo"in t&&(v({isSpotlightVideo:t.isSpotlightVideo},this.data),this.emitter.emit(exports.MeEvent.SPOTLIGHTVIDEOCHANGE,!!t.isSpotlightVideo))},c=e=>t(this,void 0,void 0,(function*(){if("isInLobby"in e&&e.isInLobby!==this.data.isInLobby){v({isInLobby:e.isInLobby},this.data);const t=!1===e.isInLobby?"inLobbyChange":void 0;yield this.rePolling(t),this.emitter.emit(exports.MeEvent.LOBBYCHANGE,!!e.isInLobby),this.ctx.emitter.emit(exports.MeEvent.LOBBYCHANGE,!!e.isInLobby)}})),u=t=>{const{event:e,state:s,body:i}=t;"personalLayout"===e&&(["update","full"].includes(s)?v({personalLayout:i},this.data):"delete"===s&&(this.data.personalLayout=void 0),this.emitter.emit(exports.MeEvent.PERSONALLAYOUTCHANGE,this.data.personalLayout))},d=t=>{if(!t.barrage)return;let e=null;if(!t.barrage.wordsDisplayStatus)return e=null,delete t.barrage,this.data.barrage=e||void 0,void this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e);if(!t.barrage.receiver)return;const s={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position,enableMultiLine:t.barrage.enableMultiLine,effect:t.barrage.effect};e=s;let{role:i}=this.data;if(this.data.endpointType===exports.ENDPOINT_TYPE.SUPERVISION){const{info:t}=this.ctx.modules;i="webinar"===t.meetingType?exports.ROLE.AUDIENCE:exports.ROLE.ATTENDEE}if(i===exports.ROLE.HOST||i===exports.ROLE.COHOST?e=t.barrage.receiver.host?s:null:i===exports.ROLE.ATTENDEE?e=t.barrage.receiver.attendee?s:null:i===exports.ROLE.AUDIENCE&&(e=t.barrage.receiver.audience?s:null),!e&&t.barrage.receiver.designated){const{userID:i,subjectID:r}=this.data,{designatedUsers:n=[]}=t.barrage;e=-1!==n.findIndex((t=>t.userID===i||r&&t.subjectID===r))?s:null}delete t.barrage,this.data.barrage=e||void 0,this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e)},p=t=>{"perm"in t&&(v({perm:t.perm},this.data),this.emitter.emit(exports.MeEvent.PERMCHANGE,t.perm))},h=t=>{"translationChannel"in t&&(v({translationChannel:t.translationChannel},this.data),this.emitter.emit(exports.MeEvent.TRANSLATIONCHANNELCHANGE,t.translationChannel))},m=t=>{"leave"in t&&!0===t.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),B(this.ctx),G(this.ctx),ut(this.ctx),this.emitter.emit(exports.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},g=t=>{e(t),s(t),i(t),r(t),n(t),o(t),c(t),a(t),d(t),p(t),h(t),m(t),(this.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.share&&this.data.share.sendOn&&r({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),(this.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.whiteboard&&this.data.whiteboard.sendOn&&r({whiteboard:{sendOn:!1}})};this.ctx.emitter.on(exports.MeEvent.INIT,(t=>{v(t,this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.bid&&(r({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),r({whiteboard:{sendOn:!1}})),this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(exports.MeEvent.UPDATE,(t=>{g(t),v(t,this.data)})),this.ctx.emitter.on(exports.EVENT.STATE,(({state:t})=>{t===exports.STATE.READY&&this.data.endpointType!==exports.ENDPOINT_TYPE.SUPERVISION&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data})})),this.ctx.emitter.on("me",(t=>{const{state:e,body:s={users:[]}}=t;if("delete"===e){const t=s.users[0];return t.leave=!0,void m(t)}let i=s.users.find((t=>t.userID===this.data.userID));i||s.users.length&&(i=s.users[0]),i?(g(i),v(i,this.data)):console.warn("me ",e,s)})),this.ctx.emitter.on("setUserVideo",(t=>{this.emitter.emit(exports.MeEvent.SETVIDEO,t.body)})),this.ctx.emitter.on("setUserAudio",(t=>{this.emitter.emit(exports.MeEvent.SETAUDIO,t.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){m({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{u(t)})),this.ctx.emitter.on("boSwitchNotify",(t=>{this.emitter.emit(exports.MeEvent.BOSWITCHNOTIFY,t.body)})),this.ctx.emitter.on("boReturnMeetingNotify",(t=>{this.emitter.emit(exports.MeEvent.BORETURNMEETINGNOTIFY,t.body)})),this.ctx.emitter.on("topMC",(t=>{const{body:e={}}=t;this.data.mediaContent&&this.data.mediaContent.topMCSeq!==e.seq&&(this.data.mediaContent.topMC=e.topMC,this.data.mediaContent.topMCSeq=e.seq,this.emitter.emit(exports.MeEvent.TOPMCCHANGE,{topMC:this.data.mediaContent.topMC,topMCSeq:this.data.mediaContent.topMCSeq}))}))}notifyUpdateUserState(t){this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:t})}updateUserState(t,e=!1){if(!e){const{role:e,initialMediaState:s}=this.data;t.audio.sendOn=t.audio.sendOn&&s.audio.sendOn,t.video.sendOn=t.video.sendOn&&s.video.sendOn,e===exports.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${s}meetings/${i}/updateUserState`,t)}boUpdateUserState(e,s,i=!1){return t(this,void 0,void 0,(function*(){if(!i){const{role:t,initialMediaState:e}=this.data;s.audio.sendOn=s.audio.sendOn&&e.audio.sendOn,s.video.sendOn=s.video.sendOn&&e.video.sendOn,t===exports.ROLE.AUDIENCE&&(s.audio.sendOn=!1,s.video.sendOn=!1)}this.data.isUpdatedUserState=!0;const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/breakoutRooms/${e}/updateUserState`,s)}))}rePolling(e){return t(this,void 0,void 0,(function*(){const{ctx:t}=this;B(t);const s=_(t),i=yield w(s,t.config.request.meetingID,t.config.request.clientID,t);if("inLobbyChange"===e&&Object.keys(t.modules).forEach((e=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(e)&&t.modules[e].cleanData(!0)})),e&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e}),yield k(s,t),"undefined"!=typeof Worker&&t.worker){const{meetingID:e,clientID:r,userID:n}=t.config.request;t.worker.postMessage({inboxes:i,topics:s,clientID:r,meetingID:e,userID:n,rePolling:!0})}else L(i,t)}))}}exports.BoHelpOpReason=void 0,(J=exports.BoHelpOpReason||(exports.BoHelpOpReason={}))[J.Cancel=1]="Cancel",J[J.Accept=2]="Accept",J[J.Refuse=3]="Refuse",exports.BreakoutRoomStatus=void 0,(W=exports.BreakoutRoomStatus||(exports.BreakoutRoomStatus={}))[W.NotStarted=0]="NotStarted",W[W.Opened=1]="Opened",W[W.Ending=2]="Ending",W[W.Ended=3]="Ended",exports.BoHelpAction=void 0,(z=exports.BoHelpAction||(exports.BoHelpAction={})).Request="request",z.Cancel="cancel",z.Accept="accept",z.Refuse="refuse";const X={status:0,subjectIndex:0,timerDuration:0,waitSeconds:0,allowChooseRoom:!1,allowReturnToMeeting:!1,autoJoinEnabled:!1,timerEnabled:!1,isTimerAutoEnd:!1,timerDurationEnabled:!1};class Z extends C{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:s}=t;if(e&&e.users){if("full"===s)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=Z.setDisplayNamePinyinProp?Z.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=Z.setUserGroupIDs?Z.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,t))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);this.data.callRecordUsers||(this.data.callRecordUsers=[]),e.users.forEach((t=>{const e=this.data.callRecordUsers.findIndex((e=>t.inviteTransID===e.inviteTransID));"update"===s&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===s&&-1===e&&(t.displayNamePinyin=Z.setDisplayNamePinyinProp?Z.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=Z.setUserGroupIDs?Z.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const s=((t,e)=>{for(let s=t.length-1;s>=0;s--)if(e(t[s]))return s;return-1})(this.data.callRecordUsers,(e=>{let s=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":s=t.account===e.contact;break;case"subjectID":s=t.subjectID===e.contact}return s}));s>-1&&(this.data.callRecordUsers[s].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/cancelInvite`,t)}}class tt extends C{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[],boInteractiveUsers:[]}}_topic(){const{role:t,endpointType:e}=this.ctx.modules.me.data;return e===exports.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:t===exports.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const t=(t,{event:e,state:s})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;if(this.ctx.breakoutRoomsState!==exports.BREAKOUT_ROOMS_STATE.CLOSE&&"boInteractiveUsers"!==e)return;const{resultInfo:i={}}=t;if("delete"!==s||"delete"===s&&[901357,901358,901352,901351,901350,901349].includes((null==i?void 0:i.bizCode)||-1))return void this.ctx.emitter.emit(exports.MeEvent.UPDATE,t);let r=!1;switch(e){case"interactiveUsers":case"boInteractiveUsers":t.isInLobby||(r=!0);break;case"broadcastUsers":t.isInLobby||t.role!==exports.ROLE.AUDIENCE||(r=!0);break;case"lobbyUsers":t.isInLobby&&(r=!0)}const n={};r&&(n.leave=!0),this.ctx.emitter.emit(exports.MeEvent.UPDATE,Object.assign(Object.assign({},t),n))},e=({updateUsers:e,state:s,sourceKey:i})=>{if("full"===s)return this.data[i]=e.map((e=>(e.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=tt.setUserGroupIDs?tt.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,t(e,{event:i,state:s}),e))),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!0}),this.data[i];void 0===this.data[i]&&(this.data[i]=[]);const{data:r,emitter:n}=this;return e.forEach((e=>{const o=r[i].findIndex((t=>e.userID===t.userID));if("delete"===s&&-1!==o){const[t]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:t,resultInfo:e.resultInfo})}else if("update"===s&&-1!==o){const t=this.data[i][o];this.updateUserProps(e,t),v(e,t),this.data[i][o]=I(t),this.emitter.emit(`${i}Update`,{user:this.data[i][o]})}else"update"===s&&-1===o&&(e.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=tt.setUserGroupIDs?tt.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,r[i].push(e),this.emitter.emit(`${i}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:i,state:s})})),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!1}),this.data[i]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:s,body:i,isBreakoutRooms:r=!1}=t;e(r?{updateUsers:i.users,state:s,sourceKey:"boInteractiveUsers"}:{updateUsers:i.users,state:s,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:s,body:i}=t;e({updateUsers:i.users,state:s,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:s,body:i}=t;e({updateUsers:i.users,state:s,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:s,body:i}=t;e({updateUsers:i.users,state:s,sourceKey:"advCtrlUsers"})})),this.ctx.emitter.on("userNotify",(t=>{const{body:e}=t;this.emitter.emit("userNotify",e)}))}reactiveData(t){if(!p(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,i)=>{Object.keys(t).forEach((r=>{!1===i&&r in this.data&&(t[r]=this.data[r]);const n=e=>t[r]=e.users.map((t=>t)),o=`${b(r)}Change`;this.emitter.on(o,n),e.set(o,n),p(t[r])&&!d(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}cleanup(){this.emitter.all=new Map,this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[],boInteractiveUsers:[]}}cleanData(){this.data.boInteractiveUsers=[]}getUserByUserID(t){if(t)return this.data.interactiveUsers.concat(this.data.lobbyUsers).concat(this.data.broadcastUsers).concat(this.data.advCtrlUsers).find((e=>e.userID===t))}updateUserProps(t,e){!e&&t.userID&&(e=this.getUserByUserID(t.userID)),e&&t.groupName&&(e.groupName=t.groupName),e&&t.displayName&&t.displayName!==e.displayName&&(t.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/whiteboard`,e)}annotate(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/annotate`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t.userID}/callStats/report`,t)}replyAllHandUp(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/refuseAll`)}getSendLayout(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/claimHost`,t)}userNotify(t,e){if(!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/notify`,e)}boUserNotify(t,e,s){if(!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/notify`,s)}setBoAudio(t,e,s){const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/audio`,s)}setBoVideo(t,e,s){const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/video`,s)}boRename(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/displayName`,s)}setBoShare(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/share`,s)}allowBoLocalRecord(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/allowLocalRecord`,s)}allowBoUserChatOn(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/allowChat`,s)}backupSwitch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/backupSwitch`)}setTranslation(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/translation`,e)}setMicVolume(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/micVolume`,e)}}function et(t){const s=function(t){const{baseURL:s,modules:i,worker:r,singleton:n,eventsSeq:o,filterTopics:a=[]}=t;i.findIndex((t=>t===Q))<0&&i.push(Q),i.findIndex((t=>t===U))<0&&i.push(U);const d=t.clientID||`${g()}_${f(new Date,"MMddHHmmss")}`,l={config:{baseURL:s,modules:i,singleton:n||!1,eventsSeq:o||!1,filterTopics:a,request:{cancelToken:u.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:d,boClientID:`${d}_${f(new Date,"MMddHHmmss")}`,location:"",meetingID:"",boMeetingID:"",ctrlID:"",boCtrlID:"",sessionID:"",userID:-1,voteTk:"",credential:"",multiActiveRegion:"",flag:""}},worker:r,emitter:e(),request:new c({baseURL:s,beforeRequest(t){t.headers["X-Y-Request-Id"]=g(),t.timeout=18e5},error(t){l.emitter.emit(exports.EVENT.REQUEST_ERROR,t)}}),modules:{},state:exports.STATE.CLOSE,breakoutRoomsState:exports.BREAKOUT_ROOMS_STATE.CLOSE,status:{polling:{running:!1,attempts:0,boAttempts:0,timer:null,boTimer:null},keepalive:{running:!1,attempts:0,timer:null,interval:20},eventsSeq:{running:!1,timer:null,interval:30},eventMsgs:[]},cleanup(t){l.state!==exports.STATE.CLOSE&&(l.worker&&l.worker.terminate(),l.config.request.location="",l.config.request.meetingID="",l.config.request.boMeetingID="",l.config.request.ctrlID="",l.config.request.boCtrlID="",l.config.request.sessionID="",l.config.request.userID=-1,l.config.request.voteTk="",l.config.request.credential="",l.config.request.multiActiveRegion="",l.status.polling={running:!1,attempts:0,boAttempts:0,timer:null,boTimer:null},l.status.keepalive={running:!1,attempts:0,timer:null,interval:20},l.status.eventsSeq={running:!1,timer:null,interval:30},l.request.setDefaultHeader("X-Y-Location",""),l.request.setDefaultHeader("X-Y-Meeting-Region",""),l.request.setDefaultHeader("X-Y-Ctrl-Id",""),l.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(l.modules).forEach((t=>{l.modules[t].cleanup()})),l.state=exports.STATE.CLOSE,l.emitter.emit(exports.EVENT.STATE,{state:l.state,reason:t}))}};return l}(t);return s.worker&&("undefined"!=typeof Worker?s.worker.postMessage({baseURL:s.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!d(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const s=new t(e);e.modules[s.moduleName]=s}))}(s.config.modules,s),s.emitter.on(exports.EVENT.POLLING_ERROR,(t=>{rt(s)({resultInfo:t})})),s.emitter.on(exports.EVENT.KEEPALIVE_ERROR,(t=>{rt(s)({resultInfo:t})})),Object.assign({config:s.config,request:s.request,get state(){return s.state},get breakoutRoomsState(){return s.breakoutRoomsState},on:s.emitter.on,off:s.emitter.off,join:st(s),boJoin:it(s),boReturnMeeting:ot(s),leave:rt(s),end:nt(s),endMeeting:at(s)},s.modules)}function st(e){return function(s){var i,r;return t(this,void 0,void 0,(function*(){const{clientID:n}=e.config.request,o=`${null===(i=s.endpointType)||void 0===i?void 0:i.toLocaleUpperCase()}${n}_${s.meetingNum}`;e.config.request.sessionID=o,e.request.setDefaultHeader("X-Y-Session-Id",o),e.request.setDefaultHeader("X-Y-Location",""),e.config.request.flag=null!==(r=s.flag)&&void 0!==r?r:"",s.flag&&delete s.flag;const a=e.config.request.flag?`&flag=${e.config.request.flag}`:"",c=e.config.request.flag?`?flag=${e.config.request.flag}`:"",u={meetingNum:s.meetingNum,pwd:s.pwd,url:s.url,mobileCode:s.mobileCode,mobile:s.mobile,regEmail:s.regEmail,accEmail:s.accEmail,tk:s.tk,displayName:s.displayName,userAgent:s.userAgent,verifyID:s.verifyID,tc:s.tc,t:s.t};s.tc&&(delete u.meetingNum,delete u.pwd),s.t&&delete u.pwd;const{prefix:d}=e.config.request,l=yield e.request.get(`${d.ctrl}credential${c}`,{params:u,headers:{"X-Y-Endpoint-Type":s.endpointType}}),{credential:p="",location:h=""}=l&&l.data||{};if(e.config.request.location=h,e.request.setDefaultHeader("X-Y-Location",h),!p)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:l.bizCode,data:l.data}),l;delete s.pwd,delete s.url,e.config.request.credential=p;const m=l.data.multiActiveRegion;m&&(e.config.request.multiActiveRegion=m,e.request.setDefaultHeader("X-Y-Meeting-Region",m));const g={displayName:s.displayName,userAgent:s.userAgent,clientID:n,avatarURL:s.avatarURL};s.groupIDs&&s.account&&(g.groupIDs=s.groupIDs,g.account=s.account,g.groupName=s.groupName),s.mediaContentReq&&(g.mediaContentReq=s.mediaContentReq),s.taskID&&(g.taskID=s.taskID),g.avatarURL=s.avatarURL;const f=s.hostKey?`&hostKey=${s.hostKey}`:"",v={"X-Y-Endpoint-Type":s.endpointType,"X-Y-Endpoint-Id":n},x=yield e.request.post(`${d.ctrl}join?meetingNum=${s.meetingNum}&credential=${p}${f}${a}`,g,{headers:v});if(!x||x&&x.ret<=-1)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:x.bizCode,data:x.data}),x;const{meetingID:b="",ctrlID:y="",user:q={},mediaContent:I={},initialMediaState:E={},tk:D=""}=x.data;e.config.request.meetingID=b,e.config.request.ctrlID=y,e.config.request.userID=q.userID,e.config.request.voteTk=D,e.config.request.credential=p,e.config.request.multiActiveRegion=m,e.request.setDefaultHeader("X-Y-Ctrl-Id",y),e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},q),{mediaContent:I,initialMediaState:E})),e.state=exports.STATE.JOINED,e.emitter.emit(exports.EVENT.STATE,{state:e.state});const $=()=>{e.state!==exports.STATE.READY&&(e.state=exports.STATE.READY,e.emitter.emit(exports.EVENT.STATE,{state:e.state}))},O=_(e),S=yield w(O,b,n,e);yield k(O,e),e.status.eventMsgs=[];const R=t=>{const s=e.status.eventMsgs.find((e=>e.event===t.event));s&&(s.seq=t.seq)},T=s=>t(this,void 0,void 0,(function*(){const i=e.status.eventMsgs,r=[];if(s.eventMsgs.forEach((t=>{const{event:s,seq:n}=t,o=e.status.eventMsgs.find((t=>t.event===s));o?o.seq!==n&&r.push(s):i.push(t)})),r.length){const s=yield function(e,s,i){var r;return t(this,void 0,void 0,(function*(){let t=null,n=[];try{t=yield e.request.post(`/meeting-ctrl/api/v1/meetings/${s}/events`,{events:i})}catch(a){return console.error(a),n}if(!t)return n;const{data:o={}}=t;return o&&o.eventMsgs&&(n=null!==(r=o.eventMsgs)&&void 0!==r?r:[]),n}))}(e,b,r);s.forEach((t=>{var s;e.emitter.emit(t.event,t),void 0!==(null===(s=t.body)||void 0===s?void 0:s.seq)&&R({event:t.event,seq:t.body.seq})}))}}));e.emitter.on("eventSeqChange",R),e.emitter.on("eventsSeqChange",T);const[A]=function(t){const e=["meetingInfo","meetingSetting","spotlightVideo","hostLayout","attendeeLayout","audienceLayout","interactiveUsers","broadcastUsers","lobbyUsers","recording","liveStream"],s={};return e.forEach((t=>{s[t]=0})),[e,s]}();if("undefined"!=typeof Worker&&e.worker){e.status.polling.running=!0,e.status.keepalive.running=!0;const t={ctrlID:y,location:h,multiActiveRegion:m,sessionID:o,inboxes:S,topics:O,clientID:n,meetingID:b,userID:q.userID,status:!0};e.config.eventsSeq&&(t.events=A,t.eventsSeq=!0),e.worker.postMessage(t),e.worker.onmessage=t=>{var s;"pollingStarted"!==t.data?"keepaliveStarted"!==t.data&&("pollingStopped"!==t.data?"keepaliveStopped"!==t.data?"eventsSeqStopped"!==t.data?"pollingError"!==t.data?"keepaliveError"!==t.data?"eventsSeqStarted"!==t.data&&("object"==typeof t.data&&"eventsSeq"in t.data?T(t.data.eventsSeq):"object"==typeof t.data&&"region"in t.data||(e.emitter.emit(t.data.event,t.data),void 0!==(null===(s=t.data.body)||void 0===s?void 0:s.seq)&&R({event:t.data.event,seq:t.data.body.seq}))):rt(e)({resultInfo:{message:"keepalive Max Attempts"}}):rt(e)({resultInfo:{message:"polling Max Attempts"}}):e.status.eventsSeq.running=!1:e.status.keepalive.running=!1:e.status.polling.running=!1):$()}}else L(S,e),$(),V(e),e.config.eventsSeq&&((t,e)=>{const{meetingID:s}=t.config.request;t.status.eventsSeq.running=!0,Y(t.request,{meetingID:s,status:t.status.eventsSeq,events:e},(e=>{t.emitter.emit("eventsSeqChange",e)}))})(e,A);return x.data=Object.assign(Object.assign({},x.data),l.data),x}))}}function it(e){return function(s,i){return t(this,void 0,void 0,(function*(){if(e.state!==exports.STATE.READY)return;const{prefix:{ctrl:t},clientID:r,meetingID:n}=e.config.request,o=`${r}_${f(new Date,"MMddHHmmss")}`;e.config.request.boClientID=o;const a=yield e.request.post(`${t}meetings/${n}/breakoutRooms/${s}/boJoin`,i,{headers:{"X-Y-Endpoint-Id":o}});if(!a||(null==a?void 0:a.ret)<=-1)return e.emitter.emit(exports.EVENT.BO_FAILED,{bizCode:a.bizCode,data:{bid:s,resData:a.data,type:"boJoin"}}),a;B(e);const{boCtrlID:c="",meetingID:u="",user:d={},mediaContent:l={},initialMediaState:p={}}=a.data;e.config.request.boMeetingID=u,e.config.request.boCtrlID=c,Object.keys(e.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(t)&&e.modules[t].cleanData()})),e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},d),{boMediaContent:l,initialMediaState:p}));const h=["meeting","interactive","lobby"],m=["interactive","bo","hostAttendee"],[g,v]=yield Promise.all([w(h,n,r,e),w(m,u,o,e)]);return e.breakoutRoomsState=exports.BREAKOUT_ROOMS_STATE.JOINED,e.emitter.emit(exports.EVENT.BREAKOUT_ROOMS_STATE,exports.BREAKOUT_ROOMS_STATE.JOINED),yield Promise.all([k(h,e),N(s,m,e)]),L(g,e),j(v,e),e.modules.me.notifyUpdateUserState(),e.breakoutRoomsState=exports.BREAKOUT_ROOMS_STATE.READY,e.emitter.emit(exports.EVENT.BREAKOUT_ROOMS_STATE,exports.BREAKOUT_ROOMS_STATE.READY),a}))}}function rt(e){return function(s){return t(this,void 0,void 0,(function*(){const t=s&&s.resultInfo;s||(s={resultInfo:{bizCode:901359}});const{prefix:i,meetingID:r}=e.config.request,n=e.config.request.flag?`?flag=${e.config.request.flag}`:"";let o;try{o=yield e.request.post(`${i.ctrl}meetings/${r}/leave${n}`,s)}catch(a){console.error(a)}return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1,eventsSeq:!1}),B(e),G(e),K(e),ut(e),e.cleanup(t),o}))}}function nt(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:s}=e.config.request,i=e.config.request.flag?`?flag=${e.config.request.flag}`:"",r=yield e.request.post(`${t.ctrl}meetings/${s}/end${i}`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1,eventsSeq:!1}),B(e),G(e),K(e),ut(e),e.cleanup(),r}))}}function ot(e){return function(s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:i}=e.config.request;"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1,eventsSeq:!1});const r=yield e.request.post(`${t}meetings/${i}/breakoutRooms/${s}/boReturnMeeting`);if(!r||(null==r?void 0:r.ret)<=-1)return e.emitter.emit(exports.EVENT.BO_FAILED,{bizCode:r.bizCode,data:{bid:s,resData:r.data,type:"boReturnMeeting"}}),r;B(e),Object.keys(e.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms","users"].includes(t)&&e.modules[t].cleanData()})),e.config.request.boCtrlID="",e.config.request.boMeetingID="",e.breakoutRoomsState=exports.BREAKOUT_ROOMS_STATE.CLOSE,e.emitter.emit(exports.EVENT.BREAKOUT_ROOMS_STATE,exports.BREAKOUT_ROOMS_STATE.CLOSE);const{user:n={},mediaContent:o={},initialMediaState:a={}}=r.data;e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},n),{boMediaContent:{},mediaContent:o,initialMediaState:a}));const c=_(e),u=yield w(c,i,e.config.request.clientID,e);return yield k(c,e),L(u,e),e.modules.me.notifyUpdateUserState("bo"),r}))}}function at(e){return function(s){return t(this,void 0,void 0,(function*(){const{prefix:t}=e.config.request;return yield e.request.post(`${t.ctrl}meetingNum/${s}/end`)}))}}class ct{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=et(t)}static getInstance(t){return this.instance?this.instance:this.instance=new ct(t)}}function ut(t){if(t.config.singleton){const{baseURL:e,modules:s,singleton:i}=t.config,r={baseURL:e,modules:s,worker:t.worker,singleton:i},n=ct.getInstance(r);n&&(n.meeting=et(r))}}Object.defineProperty(ct,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),exports.Asr=class extends C{constructor(t){super(t,"asr")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("asr",(t=>{const{body:e}=t;void 0===this.data.asr&&(this.data.asr={status:"stopped",translations:[],sourceChannel:"auto"}),e.resultInfo&&(this.emitter.emit("resultInfoChange",e.resultInfo),delete e.resultInfo),e.translations&&(this.emitter.emit("translationsChange",e.translations),delete e.translations),v(e,this.data.asr),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo),this.emitter.emit("asrChange",{asr:this.data.asr,changeData:e})}))}cleanup(){this.emitter.all=new Map}transcriptStatus(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transcript/status`,t)}transcriptSetting(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/translation/setting`,t)}},exports.AudioRecording=class extends C{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:s}=t;e&&(this.data.audioRecording=Object.assign(Object.assign({},this.data.audioRecording||{}),e),e.status&&(this.data.audioRecording.requesting="starting"===e.status,this.data.status="starting"!==e.status?e.status:this.data.status,s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf())),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo))}))}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/audioRecording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/audioRecording/status`,e)}))}},exports.BreakoutRooms=class extends C{constructor(t){super(t,"breakoutRooms"),this.data={option:X,items:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("breakoutRooms",(t=>{var e,s;const{state:i,body:r}=t;if(r)switch(i){case"full":this.data.option=r.option,this.data.items=null!==(e=r.items)&&void 0!==e?e:[],this.emitter.emit("breakoutRoomsOptionChange",this.data.option),this.emitter.emit("breakoutRoomsItemsChange",this.data.items);break;case"update":r.option&&(this.data.option=r.option,this.emitter.emit("breakoutRoomsOptionChange",this.data.option)),r.items&&(this.data.items=null!==(s=r.items)&&void 0!==s?s:[],this.emitter.emit("breakoutRoomsItemsChange",this.data.items))}})),this.ctx.emitter.on("preAssignBoList",(t=>{const{state:e,body:s}=t;if(s&&"full"===e)this.data.preAssignBoList=s,this.emitter.emit("preAssignBoListChange",this.data.preAssignBoList)})),this.ctx.emitter.on("boHelp",(t=>{const{state:e,body:s}=t;if(s)switch(e){case"full":case"update":this.data.boHelp=s,this.emitter.emit("boHelpChange",this.data.boHelp);break;case"delete":{const t=Object.assign(Object.assign({},this.data.boHelp),s);this.data.boHelp=void 0,this.emitter.emit("boHelpDelete",t)}}})),this.ctx.emitter.on("boBroadcastVoice",(t=>{const{state:e,body:s}=t;if(s)switch(e){case"update":case"full":this.data.boBroadcastVoice=s,this.emitter.emit("boBroadcastVoiceChange",this.data.boBroadcastVoice)}})),this.ctx.emitter.on("boBroadcastMsg",(t=>{const{state:e,body:s}=t;if(s&&"update"===e)this.data.boBroadcastMsg=s,this.emitter.emit("boBroadcastMsgChange",this.data.boBroadcastMsg)})),this.ctx.emitter.on("boInfo",(t=>{const{state:e,body:s}=t;if(s&&"full"===e)this.data.boInfo=s,this.emitter.emit("boInfoChange",this.data.boInfo)})),this.ctx.emitter.on("boSetting",(t=>{const{state:e,body:s}=t;if(s&&"full"===e)this.data.boSetting=s,this.emitter.emit("boSettingChange",this.data.boSetting)}))}cleanup(){this.emitter.all=new Map,this.data={option:X,items:[]},this.cleanData()}cleanData(t=!1){t&&(this.data.option=X,this.data.items=[],this.emitter.emit("breakoutRoomsOptionChange",this.data.option)),this.data.preAssignBoList=void 0,this.data.boHelp=void 0,this.data.boBroadcastVoice=void 0,this.data.boBroadcastMsg=void 0,this.data.boInfo=void 0,this.data.boSetting=void 0,this.emitter.emit("preAssignBoListChange",this.data.preAssignBoList),this.emitter.emit("boHelpChange",this.data.boHelp),this.emitter.emit("boBroadcastVoiceChange",this.data.boBroadcastVoice),this.emitter.emit("boBroadcastMsgChange",this.data.boBroadcastMsg),this.emitter.emit("boInfoChange",this.data.boInfo),this.emitter.emit("boSettingChange",this.data.boSetting)}start(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/breakoutRooms/start`,t)}boSwitchNotify(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/breakoutRooms/${t}/users/${e}/boSwitchNotify`)}boReturnMeetingNotify(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/breakoutRooms/${t}/users/${e}/boReturnMeetingNotify`)}end(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/breakoutRooms/end`)}boHelp(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/boHelp`,{action:t})}boBroadcastVoice(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/boBroadcastVoice`,{on:t})}boBroadcastMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/boBroadcastMsg`,{msg:t})}},exports.Chat=class extends C{constructor(t){super(t,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(t=>{const{body:e}=t;this.emitter.emit("chatMsg",e)}))}msg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/msg`,t)}historyMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/historyMsg`,t)}sendMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/send`,t)}},exports.FocusUsers=class extends C{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:s}=t;s&&(this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=s.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(s.focusUsers):"delete"===e&&(s.focusUsers.forEach((t=>{let e=-1;t.subjectID?e=this.data.focusUsers.findIndex((e=>e.subjectID===t.subjectID)):t.userID&&(e=this.data.focusUsers.findIndex((e=>e.userID===t.userID))),-1!==e&&this.data.focusUsers.splice(e,1)})),this.data.focusUsers=this.data.focusUsers.map((t=>t))),this.emitter.emit("focusUsersChange",this.data.focusUsers))}))}setFocusUsers(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/focusUser`,t)}},exports.Info=U,exports.Interpretation=class extends C{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:s}=t;"full"===s?(this.data.interpreters=e.interpreters,this.data.status=e.status):this.data.status=e.status,this.emitter.emit("interpretationChange",this.data)}))}interpretationStart(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/interpretation/start`,t)}interpretationEnd(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/interpretation/stop`)}},exports.Invite=Z,exports.LiveStream=class extends C{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:s,stime:i}=t;if(!s)return;if(i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),"full"===e){const{liveStreams:t=[],defaultLayout:e}=s;if(!t.length)return;const i=[];this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo}),i.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||"",index:t.data&&t.data.index}),t))),this.data.defaultLayout=e;return v({status:i},this.data),this.emitter.emit("liveStreamsChange",this.data.liveStreams),void this.emitter.emit("liveStreamsUpdate",this.data.liveStreams)}if("delete"===e){const{liveStreams:t=[]}=s,e=[];return t.forEach((t=>{const s=this.data.liveStreams.findIndex((e=>e.data&&e.data.index===t.data.index));if(-1===s)return;const[i]=this.data.liveStreams.splice(s,1);e.push(i)})),this.emitter.emit("liveStreamsDelete",e),void this.emitter.emit("liveStreamsChange",this.data.liveStreams)}void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:r=[]}=s,n=[],o=[],a=t=>{t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>e.platform===t.platform));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t)),n.push(t);const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?s.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):s.splice(e,1,{platform:s[e].platform||"",status:t.requesting?s[e].status||"stopped":t.status||""}),this.data.status=s};r.forEach((t=>{if("thirdParty"!==t.platform)return void a(t);t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>{var s,i;return(null===(s=e.data)||void 0===s?void 0:s.index)===(null===(i=t.data)||void 0===i?void 0:i.index)}));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t),o.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t),n.push(t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>{var s;return e.index===(null===(s=t.data)||void 0===s?void 0:s.index)})),-1===e?s.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||"",index:t.data&&t.data.index}):s.splice(e,1,{platform:s[e].platform||"",status:t.requesting?s[e].status||"stopped":t.status||"",index:t.data&&t.data.index}),this.data.status=s})),n.length&&this.emitter.emit("liveStreamsUpdate",n),o.length&&this.emitter.emit("liveStreamsAdd",o),this.emitter.emit("liveStreamsChange",this.data.liveStreams)}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/status`,e)}))}liveStreamDescription(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/description`,e)}))}liveStreamSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/setting`,e)}))}liveStreamDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/delete`,e)}))}liveStreamLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/layout`,e)}))}liveStreamAllow(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/liveStream/allow`)}))}pushSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/pushSetting`,e)}))}},exports.LiveStreaming=class extends C{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:s,stime:i}=t;if(!s)return;if(i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=s;if(!t.length)return;const i=[],r=[];return t.forEach((t=>{t.audioDesignate||(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo}),i.push({index:t.index,protocol:t.protocol,status:(t.requesting?"stopped":t.status)||""}),r.push(t))})),this.data.liveStreaming=r,void v({status:i,defaultConfig:e},this.data)}if("delete"===e){const{liveStreaming:t=[]}=s;return t.forEach((t=>{const e=this.data.liveStreaming.findIndex((e=>e.protocol===t.protocol&&e.index===t.index));-1!==e&&this.data.liveStreaming.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}void 0===this.data.liveStreaming&&(this.data.liveStreaming=[]);const{liveStreaming:r=[],defaultConfig:n}=s;r.forEach((t=>{if(t.audioDesignate)return;t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo});let e=this.data.liveStreaming.findIndex((e=>e.index===t.index));-1===e?(t.requesting="starting"===t.status,this.data.liveStreaming.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreaming[e]),t),this.data.liveStreaming.splice(e,1,t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?s.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):s.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?s[e].status||"stopped":t.status}),this.data.status=s})),n&&v({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/status`,e)}))}liveStreamingSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/setting`,e)}))}liveStreamingDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/delete`,e)}))}liveStreamingDetail(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/detail`,e)}))}},exports.Me=Q,exports.Qa=class extends C{constructor(t){super(t,"qa"),this.data={questions:new Map,topSort:0}}_topic(){return"qa"}_bindOn(){this.ctx.emitter.on("qa",(t=>{const{body:e}=t;p(e)&&!d(e)?this.qaUpdate(this.data.questions,e):e.forEach((t=>this.qaUpdate(this.data.questions,t)))}))}cleanup(){this.emitter.all=new Map,this.cleanData()}cleanData(){this.data={questions:new Map,topSort:0}}qaUpdate(t,e){let s=t.get(e.question.id);const{clientID:i}=this.ctx.config.request;switch(e.command){case"addQuestion":s=this.createQuestion(e.question),t.set(e.question.id,s),this.emitter.emit("questionAdd",{question:s,selfSent:s.sender.endpointID===i});break;case"dismissQuestion":if(!s)break;s.sender.endpointID!==i?s.status="close":s.isTop=!1,t.set(e.question.id,s),this.emitter.emit("questionUpdate",{question:s});break;case"reopenQuestion":s?(s.status="open",s.isTop=e.question.isTop,t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"updateQuestion":s?(s=Object.assign(Object.assign(Object.assign({},s),e.question),{topSort:e.question.isTop?this.data.topSort+=1:0}),t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteQuestion":if(!s)break;s.sender.endpointID!==i?t.delete(e.question.id):(s.status="delete",s.isTop=!1,s.answers.clear(),t.set(e.question.id,s)),this.emitter.emit("questionDelete",{question:s});break;case"answerQuestion":s?s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(s=this.createQuestion(e.question),s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteAnswer":s&&(s.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:s}))}this.emitter.emit("questionChange",{questions:this.data.questions})}createQuestion(t){return{isAnonymous:t.isAnonymous,isTop:t.isTop,id:t.id,content:t.content,sender:t.sender,timestamp:t.timestamp||-1,status:t.status||"open",answers:new Map,topSort:0}}createQuestionAnswer(t){return{isPrivate:t.isPrivate,content:t.content,id:t.id,sender:t.sender,timestamp:t.timestamp||-1}}qa(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/qa`,t)}},exports.RTSP=class extends C{constructor(t){super(t,"rtsp")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("rtspAccess",(t=>{var e;const{body:s,state:i}=t;if(void 0===(null===(e=this.data)||void 0===e?void 0:e.accessList)&&(this.data.accessList=[]),"full"===i)this.data=s;else if("update"===i){const{index:t,layout:e,resolution:i,urls:r}=s,n=this.data.accessList.findIndex((e=>e.index===t));-1===n?this.data.accessList.push({index:t,layout:e,resolution:i,urls:r}):this.data.accessList.splice(n,1,{index:t,layout:e,resolution:i,urls:r})}else if("delete"===i){const{index:t}=s;this.data.accessList=this.data.accessList.filter((e=>t!==e.index))}this.emitter.emit("rtspAccessChange",this.data)}))}cleanup(){this.emitter.all=new Map}createRTSPAccess(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/create`,t)}setRTSPAccess(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/setting`,t)}deleteRTSPAccess(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/delete`,t)}},exports.Recording=class extends C{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:s,stime:i}=t;s&&(this.data.isPracticeSession="started"===s.status&&this.data.status===s.status&&0===s.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),s),s.status&&(this.data.recording.requesting="starting"===s.status,this.data.status="starting"!==s.status?s.status:"started"===this.data.status?"stopped":this.data.status,i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf())),(s.status&&"started"===s.status||void 0!==s.isReconnecting&&!s.isReconnecting)&&this.setMainRecordPromptCount(0),s.backupRecord?(s.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===s.backupRecord.status,this.data.backupRecordStatus="starting"!==s.backupRecord.status?s.backupRecord.status:this.data.backupRecordStatus),(s.backupRecord.status&&"started"===s.backupRecord.status||void 0!==s.backupRecord.isReconnecting&&!s.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",s.resultInfo&&this.emitter.emit("resultInfoChange",s.resultInfo),s.backupRecord&&s.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",s.backupRecord.resultInfo),["full","update"].includes(e)&&s.recordUsers&&(this.data.recording.recordUsers=s.recordUsers))}))}setMainRecordPromptCount(t){this.data.mainRecordPromptCount=t}setBackupRecordPromptCount(t){this.data.backupRecordPromptCount=t}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/recording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/designatedUsers`,e)}))}participantAdd(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/add`,e)}))}participantDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/delete`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}getByIds(e){return t(this,void 0,void 0,(function*(){const{prefix:{user:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/subject/getByIds`,e)}))}recordLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/layout`,e)}))}},exports.RemoteDesktop=class extends C{constructor(t){super(t,"remoteDesktop")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("remoteDesktop",(t=>{const{body:e}=t;this.data=e,this.emitter.emit("remoteDesktopChange",e)}))}setRemoteDesktop(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/remoteDesktop`,e)}},exports.RollCall=class extends C{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:s}=t;s&&("full"===e||"update"===e?(this.data.index=s.index,this.data.userID=s.userID,this.data.type=s.type,this.data.nextUserID=s.nextUserID):"delete"===e&&(this.data.type=s.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:s}=t;s&&("full"===e?(this.data.rollcallList=s.rollcallList,this.data.rollcallUserLayout=s.rollcallUserLayout,this.data.hostLayout=s.hostLayout,this.data.commonUserLayout=s.commonUserLayout):"update"===e&&(s.rollcallList||[]).forEach((t=>{this.data.rollcallList.forEach((e=>{e.index===t.index&&(e.state=t.state)}))})),this.emitter.emit("rollCallChange",this.data))}))}setRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall/setting`,t)}},exports.Setting=class extends C{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:s}=t;["full","update"].includes(e)&&v(s,this.data)}))}reactiveData(t){if(!p(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,i,r)=>{Object.keys(t).forEach((n=>{if(!1===i&&n in this.data&&(t[n]=this.data[n]),r<1){const s=e=>t[n]=e,i=`${b(n)}Change`;this.emitter.on(i,s),e.set(i,s)}if(p(t[n])&&!d(t[n])){s(t[n],!0,r+1)}}))};return s(t,!1,0),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}setting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/setting`,e)}))}muteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/muteAll`)}))}unmuteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/unmuteAll`)}))}boMuteAll(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/breakoutRooms/${e}/muteAll`)}))}boUnmuteAll(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/breakoutRooms/${e}/unmuteAll`)}))}},exports.ShouldJoinUsers=class extends C{constructor(t){super(t,"shouldJoinUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("shouldJoinUsers",(t=>{const{state:e}=t;"update"===e&&this.emitter.emit("shouldJoinUsersChange")}))}modifyUser(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/attendance/shouldJoin`,t)}getUser(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/attendance/getShouldJoin`)}},exports.SpotlightVideo=class extends C{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(t=>{var e;const{body:s}=t;if(!s||!s.userIDs)return;this.data.userIDs=s.userIDs,this.data.broadcast=null!==(e=s.broadcast)&&void 0!==e?e:null;s.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!1})}))}spotlight(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/spotlight`,t)}},exports.Transcript=class extends C{constructor(t){super(t,"transcript"),this.data={asr:{status:"stopped"}}}_topic(){return["transcript"]}_bindOn(){this.ctx.emitter.on("transcriptMsg",(t=>{const{body:e}=t;this.emitter.emit("transcriptMsg",e)}))}cleanup(){this.emitter.all=new Map,this.cleanData()}cleanData(){this.data={asr:{status:"stopped"}}}historyMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transcript/historyMsg`,t)}},exports.Users=tt,exports.View=class extends C{constructor(t){super(t,"view")}_topic(){const{endpointType:t,role:e}=this.ctx.modules.me.data;return t===exports.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:e===exports.ROLE.AUDIENCE?["audience"]:["hostAttendee","audience"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((t=>{this.ctx.emitter.on(t,(e=>{"personalView"!==t?this.updateLayout(e,t):this.updatePersonalLayouts(e)}))})),this.ctx.emitter.on("videoSourcesUpdated",(()=>{this.emitter.emit("videoSourcesUpdated")})),this.ctx.emitter.on("presetLayout",(t=>{const{body:e}=t;this.emitter.emit("presetLayoutUpdated",e)}))}updateLayout(t,e){const{event:s,body:i}=t;i&&("meetingView"===s?Object.keys(i).forEach((t=>{this.data[t]=i[t]})):this.data[e]=i)}updatePersonalLayouts(t){const{state:e,body:s}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),s.personalLayouts.forEach((t=>{const{subscriber:s={userID:-1}}=t,i=s.userID||s.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[i]=t:delete this.data.personalLayouts[i]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/hostLayout`,e)}))}attendeeLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/attendeeLayout`,e)}))}audienceLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/audienceLayout`,e)}))}personalLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout`,e)}))}personalLayoutDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout/delete`,e)}))}virtualClassLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/virtualClass/layout`,e)}))}closeVirtualClass(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/view/virtualClass/close`)}))}getVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/layout/template/info`,{params:e})}))}addVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/add`,e)}))}editVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/edit`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}editTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/edit`,e)}))}addTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/add`,e)}))}deleteTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/delete`,e)}))}getDefaultTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getDefaultTemplates`,{params:e})}))}changeDefaultTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/changeDefaultTemplate`,e)}))}perspectiveBind(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/perspective/bind`,e)}))}setSavedBackground(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/recentBackgroundFile`,e)}))}getSavedBackground(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/view/recentBackgroundFile`)}))}getPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${s}/view/presetLayout`,{params:e})}))}setPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout`,e)}))}presetLayoutApply(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/apply`,e)}))}presetLayoutApplyUser(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/applyUser`,e)}))}presetLayoutApplyUserBatch(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/applyUserBatch`,e)}))}},exports.Vote=class extends C{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:s}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[s]=e,this.emitter.emit("voteChange",{vote:this.data.vote,changeData:e})})),this.ctx.emitter.on(exports.MeEvent.LOBBYCHANGE,(t=>{t&&(this.data.vote={})}))}getVotes(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${s}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${s}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${s}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:s},meetingID:i,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.post(`${s}meetings/${i}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:s},meetingID:i,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.post(`${s}meetings/${i}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/delete`,t)}voteInProgress(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/vote/inProgress`,{params:{tk:t&&t.tk||i}})}},exports.Words=class extends C{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){const t=()=>{this.data.wordsDisplayStatus=!1,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})};this.ctx.emitter.on("meetingBarrage",(e=>{this.data.timer&&clearTimeout(this.data.timer),this.data.timerMap||(this.data.timerMap={});const{state:s,body:i,pollingSeqId:r}=e;if("delete"===s)return i&&i.indexes&&(this.data.list=this.data.list.filter((t=>!i.indexes.includes(t.index)))),t(),void this.emitter.emit("barrageWordChange",this.data);if("full"===s){if(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&(this.data.barrageRecord.length=10),i.list){const t=[];i.list.forEach((e=>{var s,i,n,o,a,c;if(this.data.barrageRecord.find((t=>!!e.timestamp&&Number(e.timestamp)===t.timestamp)));else{const u=null!==(i=Number.parseInt(null!==(s=e.timestamp)&&void 0!==s?s:""))&&void 0!==i?i:(new Date).getTime(),d={index:e.index,id:r,content:null!==(n=e.content)&&void 0!==n?n:"",time:u,timestamp:u,durationType:null!==(o=e.durationType)&&void 0!==o?o:"",duration:1e3*(null!==(a=e.duration)&&void 0!==a?a:0)};d.content&&t.push(d);const l=null!==(c=e.duration)&&void 0!==c?c:-1,p=e.index;if(this.data.timerMap){const t=this.data.timerMap[p];t&&clearTimeout(t),-1!==l&&(this.data.timerMap[p]=setTimeout((()=>{this.data.timerMap&&(this.data.timerMap[p]=null),this.data.list=this.data.list.filter((t=>t.index!==p)),this.emitter.emit("barrageWordChange",this.data)}),1e3*l))}}})),this.data.barrageRecord=[...t,...this.data.barrageRecord]}else if(r){const t=i.timestamp?Number.parseInt(i.timestamp):(new Date).getTime();this.data.barrageRecord=[{index:1,id:r,content:i.content,time:t,timestamp:t,durationType:i.durationType,duration:1e3*i.duration},...this.data.barrageRecord]}i.wordsDisplayStatus=!0,-1!==i.duration&&(this.data.timer=setTimeout((()=>{i.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=i.wordsDisplayStatus,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})}),1e3*i.duration)),v(i,this.data),this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data}),this.emitter.emit("barrageWordChange",this.data)}})),this.ctx.emitter.on(exports.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})))}barrage(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/barrage`,e)}))}deleteBarrage(e={indexes:[]}){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/deleteBarrage`,e)}))}},exports.createMeeting=function(t){return t.singleton?ct.getInstance(t).meeting:et(t)},exports.reset=ut;
1
+ "use strict";function t(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{c(i.next(t))}catch(e){n(e)}}function a(t){try{c(i.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,s){var i=t.get(e);i?i.push(s):t.set(e,[s])},off:function(e,s){var i=t.get(e);i&&(s?i.splice(i.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var i=t.get(e);i&&i.slice().map((function(t){t(s)})),(i=t.get("*"))&&i.slice().map((function(t){t(e,s)}))}}}Object.defineProperty(exports,"__esModule",{value:!0});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}};!function(t,e){var i="__lodash_hash_undefined__",r=9007199254740991,n="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",d="[object Map]",l="[object Number]",p="[object Object]",h="[object Promise]",m="[object RegExp]",g="[object Set]",f="[object String]",v="[object Symbol]",x="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",q="[object Float32Array]",I="[object Float64Array]",E="[object Int8Array]",D="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",S="[object Uint8ClampedArray]",R="[object Uint16Array]",T="[object Uint32Array]",A=/\w*$/,C=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,_={};_[n]=_["[object Array]"]=_[b]=_[y]=_[o]=_[a]=_[q]=_[I]=_[E]=_[D]=_[$]=_[d]=_[l]=_[p]=_[m]=_[g]=_[f]=_[v]=_[O]=_[S]=_[R]=_[T]=!0,_["[object Error]"]=_[c]=_[x]=!1;var w="object"==typeof self&&self&&self.Object===Object&&self,k="object"==typeof s&&s&&s.Object===Object&&s||w||Function("return this")(),N=e&&!e.nodeType&&e,P=N&&t&&!t.nodeType&&t,M=P&&P.exports===N;function L(t,e){return t.set(e[0],e[1]),t}function j(t,e){return t.add(e),t}function B(t,e,s,i){var r=-1,n=t?t.length:0;for(i&&n&&(s=t[++r]);++r<n;)s=e(s,t[r],r,t);return s}function H(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(s){}return e}function V(t){var e=-1,s=Array(t.size);return t.forEach((function(t,i){s[++e]=[i,t]})),s}function G(t,e){return function(s){return t(e(s))}}function Y(t){var e=-1,s=Array(t.size);return t.forEach((function(t){s[++e]=t})),s}var K,F=Array.prototype,J=Function.prototype,W=Object.prototype,z=k["__core-js_shared__"],Q=(K=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",X=J.toString,Z=W.hasOwnProperty,tt=W.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=M?k.Buffer:void 0,it=k.Symbol,rt=k.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=W.propertyIsEnumerable,ct=F.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),pt=Pt(k,"DataView"),ht=Pt(k,"Map"),mt=Pt(k,"Promise"),gt=Pt(k,"Set"),ft=Pt(k,"WeakMap"),vt=Pt(Object,"create"),xt=Ht(pt),bt=Ht(ht),yt=Ht(mt),qt=Ht(gt),It=Ht(ft),Et=it?it.prototype:void 0,Dt=Et?Et.valueOf:void 0;function $t(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function Ot(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function St(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function Rt(t){this.__data__=new Ot(t)}function Tt(t,e){var s=Gt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Yt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==n)}(t)?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],i=s.length,r=!!i;for(var o in t)!e&&!Z.call(t,o)||r&&("length"==o||jt(o,i))||s.push(o);return s}function At(t,e,s){var i=t[e];Z.call(t,e)&&Vt(i,s)&&(void 0!==s||e in t)||(t[e]=s)}function Ct(t,e){for(var s=t.length;s--;)if(Vt(t[s][0],e))return s;return-1}function Ut(t,e,s,i,r,h,x){var C;if(i&&(C=h?i(t,r,h,x):i(t)),void 0!==C)return C;if(!Jt(t))return t;var U=Gt(t);if(U){if(C=function(t){var e=t.length,s=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(s.index=t.index,s.input=t.input);return s}(t),!e)return function(t,e){var s=-1,i=t.length;e||(e=Array(i));for(;++s<i;)e[s]=t[s];return e}(t,C)}else{var w=Lt(t),k=w==c||w==u;if(Kt(t))return function(t,e){if(e)return t.slice();var s=new t.constructor(t.length);return t.copy(s),s}(t,e);if(w==p||w==n||k&&!h){if(H(t))return h?t:{};if(C=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:(e=nt(t),Jt(e)?ot(e):{});var e}(k?{}:t),!e)return function(t,e){return kt(t,Mt(t),e)}(t,function(t,e){return t&&kt(e,Wt(e),t)}(C,t))}else{if(!_[w])return h?t:{};C=function(t,e,s,i){var r=t.constructor;switch(e){case b:return wt(t);case o:case a:return new r(+t);case y:return function(t,e){var s=e?wt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}(t,i);case q:case I:case E:case D:case $:case O:case S:case R:case T:return function(t,e){var s=e?wt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}(t,i);case d:return function(t,e,s){var i=e?s(V(t),!0):V(t);return B(i,L,new t.constructor)}(t,i,s);case l:case f:return new r(t);case m:return function(t){var e=new t.constructor(t.source,A.exec(t));return e.lastIndex=t.lastIndex,e}(t);case g:return function(t,e,s){var i=e?s(Y(t),!0):Y(t);return B(i,j,new t.constructor)}(t,i,s);case v:return n=t,Dt?Object(Dt.call(n)):{}}var n}(t,w,Ut,e)}}x||(x=new Rt);var N=x.get(t);if(N)return N;if(x.set(t,C),!U)var P=s?function(t){return function(t,e,s){var i=e(t);return Gt(t)?i:function(t,e){for(var s=-1,i=e.length,r=t.length;++s<i;)t[r+s]=e[s];return t}(i,s(t))}(t,Wt,Mt)}(t):Wt(t);return function(t,e){for(var s=-1,i=t?t.length:0;++s<i&&!1!==e(t[s],s,t););}(P||t,(function(r,n){P&&(r=t[n=r]),At(C,n,Ut(r,e,s,i,n,t,x))})),C}function _t(t){return!(!Jt(t)||(e=t,Q&&Q in e))&&(Ft(t)||H(t)?et:C).test(Ht(t));var e}function wt(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}function kt(t,e,s,i){s||(s={});for(var r=-1,n=e.length;++r<n;){var o=e[r],a=i?i(s[o],t[o],o,s,t):void 0;At(s,o,void 0===a?t[o]:a)}return s}function Nt(t,e){var s,i,r=t.__data__;return("string"==(i=typeof(s=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==s:null===s)?r["string"==typeof e?"string":"hash"]:r.map}function Pt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return _t(s)?s:void 0}$t.prototype.clear=function(){this.__data__=vt?vt(null):{}},$t.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},$t.prototype.get=function(t){var e=this.__data__;if(vt){var s=e[t];return s===i?void 0:s}return Z.call(e,t)?e[t]:void 0},$t.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},$t.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?i:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,s=Ct(e,t);return!(s<0)&&(s==e.length-1?e.pop():ct.call(e,s,1),!0)},Ot.prototype.get=function(t){var e=this.__data__,s=Ct(e,t);return s<0?void 0:e[s][1]},Ot.prototype.has=function(t){return Ct(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var s=this.__data__,i=Ct(s,t);return i<0?s.push([t,e]):s[i][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||Ot),string:new $t}},St.prototype.delete=function(t){return Nt(this,t).delete(t)},St.prototype.get=function(t){return Nt(this,t).get(t)},St.prototype.has=function(t){return Nt(this,t).has(t)},St.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},Rt.prototype.clear=function(){this.__data__=new Ot},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var s=this.__data__;if(s instanceof Ot){var i=s.__data__;if(!ht||i.length<199)return i.push([t,e]),this;s=this.__data__=new St(i)}return s.set(t,e),this};var Mt=ut?G(ut,Object):function(){return[]},Lt=function(t){return tt.call(t)};function jt(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||U.test(t))&&t>-1&&t%1==0&&t<e}function Bt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||W)}function Ht(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(pt&&Lt(new pt(new ArrayBuffer(1)))!=y||ht&&Lt(new ht)!=d||mt&&Lt(mt.resolve())!=h||gt&&Lt(new gt)!=g||ft&&Lt(new ft)!=x)&&(Lt=function(t){var e=tt.call(t),s=e==p?t.constructor:void 0,i=s?Ht(s):void 0;if(i)switch(i){case xt:return y;case bt:return d;case yt:return h;case qt:return g;case It:return x}return e});var Gt=Array.isArray;function Yt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}(t.length)&&!Ft(t)}var Kt=dt||function(){return!1};function Ft(t){var e=Jt(t)?tt.call(t):"";return e==c||e==u}function Jt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wt(t){return Yt(t)?Tt(t):function(t){if(!Bt(t))return lt(t);var e=[];for(var s in Object(t))Z.call(t,s)&&"constructor"!=s&&e.push(s);return e}(t)}t.exports=function(t){return Ut(t,!0,!0)}}(i,i.exports);var r=i.exports;const n=t=>({get(e,s){if("__isProxy"===s)return!0;const i=Reflect.get(e,s);return Array.isArray(i)?i:"object"==typeof i&&null!==i?i.__isProxy?i:new Proxy(i,n(t)):i},set(e,s,i,n){const o=e[s];i=p(i)&&i.__isProxy?r(i):i;const a=Reflect.set(e,s,i,n);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${b(s)}Change`,i),a}}),o=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]"),a=t=>{const e=t.getAllResponseHeaders(),s={};return e.trim().split(/[\r\n]+/).forEach((t=>{var e;const i=t.split(": "),r=null!==(e=i.shift())&&void 0!==e?e:"",n=i.join(": ");s[r]=n})),s};class c{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const e=t.timeout||18e5;let s=t.headers||{};return t.url=E(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const s=[];Object.keys(e).forEach((t=>{const i=e[t];if(null==i)return;let r;Array.isArray(i)?(r=i,t+="[]"):r=[i],r.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),s.push(`${o(t)}=${o(e)}`)}))}));const i=s.join("&");if(i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t})(t.url,t.params),s=Object.assign({},this._defaultHeaders,s),Object.keys(s).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(s["Content-Type"]=s[t],delete s[t])})),h(t.data)&&(t.data=t.data.buffer),(m(t.data)||d(t.data))&&(s&&!s["Content-Type"]&&(s["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=s,t.timeout=e,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx&&void 0!==wx.request?(t=>new Promise(((e,s)=>{const{data:i=null,url:r,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:r,data:i,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(Object.assign(Object.assign({},t.data),{headers:t.header})):s({url:r,statusCode:t.statusCode})},fail(t){s("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})))(t):(t=>new Promise(((e,s)=>{var i;const{data:r=null,url:n="",method:o="GET",headers:c,cancelToken:u}=t;let d=new XMLHttpRequest;d.open(o.toUpperCase(),n,!0),d.timeout=null!==(i=t.timeout)&&void 0!==i?i:6e4;const l=()=>{if(d){if(d.status>=200&&d.status<300)try{const t=JSON.parse(d.responseText);e(Object.assign(Object.assign({},t),{headers:a(d)}))}catch(t){s(new Error(`E_JSON_PARSE${d.responseText}`))}else s({url:n,statusCode:d.status});d=null}};"onloadend"in d?d.onloadend=l:d.onreadystatechange=()=>{d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(l)},d.onabort=()=>{d&&(s({url:n,statusCode:d.status,type:"request abort"}),d=null)},d.onerror=()=>{s(new Error("Network Error")),d=null},d.ontimeout=()=>{s(new Error(`timeout of ${t.timeout}ms exceeded`)),d=null},"setRequestHeader"in d&&Object.keys(c).forEach((t=>{null===r&&"content-type"===t.toLowerCase()?delete c[t]:null==d||d.setRequestHeader(t,c[t])})),u&&u.promise.then((t=>{d&&(d.abort(),s(t),d=null)})),d.send(r)})))(t)}setDefaultHeader(t,e){t in this._defaultHeaders&&(""===e||null===e)?delete this._defaultHeaders[t]:this._defaultHeaders[t]=e}setBeforeRequest(t){this._beforeRequest=t}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"POST",data:e}))}put(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"PUT",data:e}))}}class u{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new u((e=>{t=e}));return{cancel:t,token:e}}}const d=Array.isArray,l=t=>null==t,p=t=>"object"==typeof t&&null!==t,h=t=>{let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e},m=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},g=()=>{const t=[],e="0123456789abcdef";for(let s=0;s<36;s++)t[s]=e.substr(Math.floor(16*Math.random()),1);t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-";return t.join("").split("-").join("")},f=(t=new Date,e="")=>{const s={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,`${t.getFullYear()}`.substr(4-RegExp.$1.length)));for(const i in s)new RegExp(`(${i})`).test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?s[i]:`00${s[i]}`.substr(`${s[i]}`.length)));return e},v=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,i]=[t[0],t[1]];if(null!==i)return p(i)&&!d(i)?(e[s]||(e[s]={}),void(e[s]=v(i,e[s]))):void(e[s]=i)})),e):e,x=/-(\w)/g,b=t=>t.replace(x,((t,e)=>e?e.toUpperCase():"")),{hasOwnProperty:y}=Object.prototype,q=(t,e)=>y.call(t,e),I=(t,e=new Map)=>{if(e.get(t))return e.get(t);if(!(t instanceof Object))return t;let s;s=t instanceof Array?[]:t instanceof Function?()=>t():t instanceof RegExp?new RegExp(t.source,t.flags):t instanceof Date?new Date(t):{},e.set(t,s);for(const i in t)q(t,i)&&(s[i]=I(t[i],e));return s},E=(t,e)=>t&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)?((t,e)=>e?`${t.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`:t)(t,e):e,D=t=>{console.log(`computeNextTimeout attempts: ${t}`);let e=Math.floor(Math.random()*2**t+1);return e<2&&(e=2),e>30&&(e=30),1e3*e};var $,O,S,R,T,A;exports.EVENT=void 0,($=exports.EVENT||(exports.EVENT={})).STATE="state",$.FAILED="failed",$.BO_FAILED="boFailed",$.REQUEST_ERROR="requestError",$.POLLING_ERROR="pollingError",$.KEEPALIVE_ERROR="keepaliveError",$.BREAKOUT_ROOMS_STATE="breakoutRoomsState",exports.STATE=void 0,(O=exports.STATE||(exports.STATE={}))[O.CLOSE=0]="CLOSE",O[O.JOINED=1]="JOINED",O[O.READY=2]="READY",exports.BREAKOUT_ROOMS_STATE=void 0,(S=exports.BREAKOUT_ROOMS_STATE||(exports.BREAKOUT_ROOMS_STATE={}))[S.CLOSE=0]="CLOSE",S[S.JOINED=1]="JOINED",S[S.READY=2]="READY",exports.ENDPOINT_TYPE=void 0,(R=exports.ENDPOINT_TYPE||(exports.ENDPOINT_TYPE={})).WEBAPP="webApp",R.WEBCTRL="webCtrl",R.WECHATMP="weChatMP",R.SUPERVISION="supervision",R.BIGSCREEN="bigScreen",R.DESKTOP="desktop",R.MOBILE="mobile",R.VCS="vcs",R.SIP="sip",R.H323="h323",R.PSTN="pstn",R.MULTI_STREAM="multiStream",R.MEETING_TOUCH="meetingTouch",R.MEETING_ROOMS="meetingRooms",R.RTSP="rtsp",R.RTMP_PULLER="rtmpPuller",R.GB28181="gb28181",R.TELE_PRESENCE="telePresence",R.RTSP_Access="rtspAccess",exports.ROLE=void 0,(T=exports.ROLE||(exports.ROLE={})).HOST="host",T.COHOST="coHost",T.ATTENDEE="attendee",T.AUDIENCE="audience",exports.RECORD_STATUS=void 0,(A=exports.RECORD_STATUS||(exports.RECORD_STATUS={})).STARTED="started",A.PAUSED="paused",A.STARTING="starting",A.STOPPED="stopped";class C{constructor(t,s){Object.defineProperty(this,"moduleName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"off",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.moduleName=s,this.ctx=t,this.emitter=e(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},n(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},n(this.emitter))}cleanData(){this.data=new Proxy({},n(this.emitter))}reactiveData(t){if(!p(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,i,r)=>{Object.keys(t).forEach((r=>{!1===i&&r in this.data&&(t[r]=this.data[r]);const n=e=>t[r]=e,o=`${b(r)}Change`;this.emitter.on(o,n),e.set(o,n),p(t[r])&&!d(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class U extends C{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:s}=t;("full"===e||"update"===e)&&v(s,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;v({participantCount:e},this.data)}))}subject(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/info/subject`,e)}))}practiceSession(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/info/practiceSession`)}))}shareInfo(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:s}=this.ctx.config.request;return t.credential=t.credential||s,this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:s},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/operationRecord`,t)}getImConfig(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:s}=this.ctx.config.request;return t.credential=t.credential||s,this.ctx.request.get(`${e}im/config`,{params:t})}sendMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/send`,t)}getUserInfo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}participantDetail?meetingID=${s}`,t)}sendInvitationMail(t){if(!t)return Promise.reject();const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/sendInvitationMail `,t)}getMailTemplate(t,e){if(!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.get(`${s}meetingNum/${t}/mailTemplate`,{params:Object.assign(Object.assign({},e),{meetingID:i})})}getPortUsage(t){const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.get(`${e}portUsage`,{params:t})}}function _(t){const e=[],{isInLobby:s}=t.modules.me.data;return s?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((s=>{var i;const r=t.modules[s]._topic();r&&(Array.isArray(r)?r.forEach((s=>{var i;e.includes(s)||(null===(i=t.config.filterTopics)||void 0===i?void 0:i.includes(s))||e.push(s)})):e.includes(r)||(null===(i=t.config.filterTopics)||void 0===i?void 0:i.includes(r))||e.push(r))})),e)}function w(e,s,i,r){return t(this,void 0,void 0,(function*(){const t=r.config.request.flag?`?flag=${r.config.request.flag}`:"",n=yield r.request.post(`/ypush/api/v1/meeting-control/inbox${t}`,{basic:{tenantId:100,clientId:i,meetingId:s},inboxes:e}),o=[];return n.data&&Object.keys(n.data).forEach((t=>{o.push({name:t,seqId:n.data[t].maxSeqId,limit:200})})),o}))}function k(e,s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:i,clientID:r,flag:n}=s.config.request,o=n?`?flag=${n}`:"",a=yield s.request.post(`${t}meetings/${i}/subscribe${o}`,{endpointID:r,topics:e}),c=a&&a.data&&a.data.eventMsgs;c&&c.forEach((t=>{s.emitter.emit(t.event,t)}))}))}function N(e,s,i){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r,boClientID:n}=i.config.request,o=yield i.request.post(`${t}meetings/${r}/breakoutRooms/${e}/subscribe`,{endpointID:n,topics:s}),a=o&&o.data&&o.data.eventMsgs;a&&a.forEach((t=>{t.isBreakoutRooms=!0,i.emitter.emit(t.event,t)}))}))}function P(e,s,i){return t(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c,query:u=""}=s;if(yield(()=>t(this,void 0,void 0,(function*(){let t;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},d={cancelToken:a};try{t=yield e.post(`/ypush/api/v1/meeting-control/polling${u}`,s,d)}catch(h){return c.attempts+=1,void(h&&"request abort"!==h.type&&console.error(h))}if(!t)return console.error("polling error: ","response is null"),void(c.attempts+=1);const{data:l={},bizCode:p,error:h}=t;if(p&&900408!==p)return console.error("polling error: ",JSON.stringify(h)),void(c.attempts+=1);c.attempts=0,l&&Object.keys(l).forEach((t=>{var e;const s=r.find((e=>e.name===t));s&&(s.seqId=l[t].maxSeqId,l[t].items&&(null===(e=l[t].items)||void 0===e||e.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording","audioRecording","liveStreaming"].includes(e.event)&&(e.stime=t.stime),e.pollingSeqId=t.seqId,i(e)}))))}))})))(),!c.running)return;if(c.attempts>6)return console.error("polling Max Attempts"),void(s.onError&&s.onError({message:"polling Max Attempts"}));const d=c.attempts?D(c.attempts):0;c.timer=setTimeout((()=>{c.running&&P(e,s,i)}),d)}))}function M(e,s,i){return t(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c}=s;if(yield(()=>t(this,void 0,void 0,(function*(){let t;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},u={cancelToken:a};try{t=yield e.post("/ypush/api/v1/meeting-control/polling?bo=1",s,u)}catch(p){return c.boAttempts+=1,void(p&&"request abort"!==p.type&&console.error(p))}if(!t)return console.error("[Meeting] boPolling error: ","response is null"),void(c.attempts+=1);const{data:d={},bizCode:l,error:p}=t;if(l&&900408!==l)return console.error("[Meeting] boPolling error: ",JSON.stringify(p)),void(c.boAttempts+=1);c.boAttempts=0,d&&Object.keys(d).forEach((t=>{var e;const s=r.find((e=>e.name===t));s&&(s.seqId=d[t].maxSeqId,null===(e=d[t].items)||void 0===e||e.forEach((t=>{const e=JSON.parse(t.content);e.isBreakoutRooms=!0,e.pollingSeqId=t.seqId,i(e)})))}))})))(),!c.running)return;if(c.boAttempts>6)return console.error("[Meeting] polling Max Attempts"),void(s.onError&&s.onError({message:"polling Max Attempts"}));const u=c.boAttempts?D(c.boAttempts):0;c.boTimer=setTimeout((()=>{c.running&&M(e,s,i)}),u)}))}const L=(t,e)=>{const{meetingID:s,clientID:i,flag:r}=e.config.request,n=r?`?flag=${r}`:"";e.status.polling.running=!0,P(e.request,{inboxes:t,clientID:i,meetingID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.polling,query:n,onError(t){e.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>new Promise((s=>{var i;e.emitter.emit(t.event,t),void 0!==(null===(i=t.body)||void 0===i?void 0:i.seq)&&e.emitter.emit("eventSeqChange",{event:t.event,seq:t.body.seq}),s()}))))},j=(t,e)=>{const{boMeetingID:s,boClientID:i}=e.config.request;M(e.request,{inboxes:t,clientID:i,meetingID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.polling,onError(t){e.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>{e.emitter.emit(t.event,t)}))};function B(t){t.status.polling.running=!1,t.status.polling.attempts=0,t.status.polling.boAttempts=0,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.status.polling.boTimer&&(clearTimeout(t.status.polling.boTimer),t.status.polling.boTimer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=u.source()}function H(e,s){return t(this,void 0,void 0,(function*(){const{meetingID:i,userID:r,status:n,cancelToken:o,onError:a,query:c="",onRegionChange:u}=s;if(n.timer&&(clearTimeout(n.timer),n.timer=null),yield(()=>t(this,void 0,void 0,(function*(){let t;try{t=yield e.post(`/meeting-ctrl/api/v1/meetings/${i}/users/${r}/keepalive${c}`,{},{cancelToken:o.token})}catch(d){return n.attempts+=1,void console.error(d)}if(!t)return;const{data:s={},bizCode:a,error:d,headers:l}=t;if(l&&(l["x-y-meeting-prefer"]||l["X-Y-Meeting-Prefer"])&&(null==u||u(l["x-y-meeting-prefer"]||l["X-Y-Meeting-Prefer"])),900200!==a&&900408!==a&&901323!==a)return n.attempts+=1,void console.error("keepalive ",a,d);const p=s.interval||"";if(!p)return n.attempts+=1,void console.error("keepalive ",a,d);n.interval=p,n.attempts=0})))(),!n.running)return;if(n.attempts>10)return console.error("keepalive Max Attempts"),void(a&&a({message:"keepalive Max Attempts"}));const d=n.attempts?D(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&H(e,s)}),d)}))}function V(t){const{meetingID:e,userID:s,flag:i}=t.config.request,r=i?`?flag=${i}`:"";t.status.keepalive.running=!0,H(t.request,{meetingID:e,userID:s,cancelToken:t.config.request.cancelToken.token,status:t.status.keepalive,query:r,onError(e){t.emitter.emit(exports.EVENT.KEEPALIVE_ERROR,e)},onRegionChange(e){t.emitter.emit("regionChange",e)}})}const G=t=>{t.status.keepalive.running=!1,t.status.keepalive.attempts=0,t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null)},Y=(e,s,i)=>t(void 0,void 0,void 0,(function*(){const{meetingID:r,status:n,events:o}=s;if(n.timer&&(clearTimeout(n.timer),n.timer=null),yield t(void 0,void 0,void 0,(function*(){let t;try{t=yield e.post(`/meeting-ctrl/api/v1/meetings/${r}/eventsSeq`,{events:o})}catch(n){return void console.error(n)}if(!t)return;const{data:s={}}=t;s&&i(s)})),!n.running)return;n.timer=setTimeout((()=>{n.running&&Y(e,s,i)}),1e3*n.interval)})),K=t=>{t.status.eventsSeq.running=!1,t.status.eventsSeq.timer&&(clearTimeout(t.status.eventsSeq.timer),t.status.eventsSeq.timer=null)};var F,J,W,z;exports.MeEvent=void 0,(F=exports.MeEvent||(exports.MeEvent={})).INIT="meInit",F.UPDATE="meUpdate",F.UPDATE_USER_STATE="updateUserState",F.ROLECHANGE="meRoleChange",F.AUDIOCHANGE="meAudioChange",F.HANDUPCHANGE="meHandupChange",F.SETAUDIO="setAudio",F.VIDEOCHANGE="meVideoChange",F.SETVIDEO="setVideo",F.SHARECHANGE="meShareChange",F.WHITEBOARDCHANGE="meWhiteBoardChange",F.DISPLAYNAMECHANGE="meDisplayNameChange",F.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",F.LOBBYCHANGE="meLobbyChange",F.BARRAGECHANGE="meBarrageChange",F.PERSONALLAYOUTCHANGE="personalLayoutChange",F.PERMCHANGE="permChange",F.BOSWITCHNOTIFY="boSwitchNotify",F.BORETURNMEETINGNOTIFY="boReturnMeetingNotify",F.TOPMCCHANGE="mediaTopMCChange",F.TRANSLATIONCHANNELCHANGE="translationChannelChange",F.LEAVE="leave";class Q extends C{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const e=e=>t(this,void 0,void 0,(function*(){if("role"in e&&e.role!==this.data.role&&e.role){const t=this.data.role;v({role:e.role},this.data),e.role!==exports.ROLE.AUDIENCE&&t!==exports.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(exports.MeEvent.ROLECHANGE,e.role),this.ctx.emitter.emit(exports.MeEvent.ROLECHANGE,e.role)}})),s=t=>{var e,s,i,r,n,o,a,c,u,d;if("audio"in t&&t.audio){const{deviceOn:p,sendOn:h,recvOn:m,opBy:g}=t.audio;if(!l(p)&&p!==(null===(e=this.data.audio)||void 0===e?void 0:e.deviceOn)||!l(h)&&h!==(null===(s=this.data.audio)||void 0===s?void 0:s.sendOn)||!l(m)&&m!==(null===(i=this.data.audio)||void 0===i?void 0:i.recvOn)||!l(g)&&g!==(null===(r=this.data.audio)||void 0===r?void 0:r.opBy)){const e={deviceOn:null===(n=this.data.audio)||void 0===n?void 0:n.deviceOn,sendOn:null===(o=this.data.audio)||void 0===o?void 0:o.sendOn,recvOn:null===(a=this.data.audio)||void 0===a?void 0:a.recvOn};v({audio:t.audio},this.data);const s={deviceOn:l(p)?null===(c=this.data.audio)||void 0===c?void 0:c.deviceOn:p,sendOn:!!(l(h)?null===(u=this.data.audio)||void 0===u?void 0:u.sendOn:h),recvOn:l(m)?null===(d=this.data.audio)||void 0===d?void 0:d.recvOn:m,opBy:g,changeData:Object.assign({},t.audio),oldData:e};this.emitter.emit(exports.MeEvent.AUDIOCHANGE,s)}}},i=t=>{var e,s,i,r,n,o,a,c,u;if("video"in t&&t.video){const{deviceOn:d,sendOn:p,opBy:h,blocked:m}=t.video;if(!l(d)&&d!==(null===(e=this.data.video)||void 0===e?void 0:e.deviceOn)||!l(p)&&p!==(null===(s=this.data.video)||void 0===s?void 0:s.sendOn)||!l(m)&&m!==(null===(i=this.data.video)||void 0===i?void 0:i.blocked)){const e={deviceOn:null===(r=this.data.video)||void 0===r?void 0:r.deviceOn,sendOn:null===(n=this.data.video)||void 0===n?void 0:n.sendOn,blocked:null===(o=this.data.video)||void 0===o?void 0:o.blocked};v({video:t.video},this.data);const s={deviceOn:l(d)?null===(a=this.data.video)||void 0===a?void 0:a.deviceOn:d,sendOn:!!(l(p)?null===(c=this.data.video)||void 0===c?void 0:c.sendOn:p),blocked:l(m)?null===(u=this.data.video)||void 0===u?void 0:u.blocked:m,opBy:h,changeData:Object.assign({},t.video),oldData:e};this.emitter.emit(exports.MeEvent.VIDEOCHANGE,s)}}},r=t=>{var e,s,i,r,n,o,a,c;if("share"in t&&t.share){const{deviceOn:n,sendOn:o,opBy:a}=t.share;if(!l(n)&&n!==(null===(e=this.data.share)||void 0===e?void 0:e.deviceOn)||!l(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.sendOn)){v({share:t.share},this.data);const e={deviceOn:l(n)?null===(i=this.data.share)||void 0===i?void 0:i.deviceOn:n,sendOn:!!(l(o)?null===(r=this.data.share)||void 0===r?void 0:r.sendOn:o),opBy:a};this.emitter.emit(exports.MeEvent.SHARECHANGE,e)}}if("whiteboard"in t&&t.whiteboard){const{deviceOn:e,sendOn:s,opBy:i}=t.whiteboard;if(!l(e)&&e!==(null===(n=this.data.whiteboard)||void 0===n?void 0:n.deviceOn)||!l(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.sendOn)){v({whiteboard:t.whiteboard},this.data);const r={deviceOn:l(e)?null===(a=this.data.whiteboard)||void 0===a?void 0:a.deviceOn:e,sendOn:!!(l(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.sendOn:s),opBy:i};this.emitter.emit(exports.MeEvent.WHITEBOARDCHANGE,r)}}},n=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.emitter.emit(exports.MeEvent.DISPLAYNAMECHANGE,t.displayName))},o=t=>{"isHandUp"in t&&t.isHandUp!==this.data.isHandUp&&(v({isHandUp:t.isHandUp},this.data),this.emitter.emit(exports.MeEvent.HANDUPCHANGE,!!t.isHandUp))},a=t=>{"isSpotlightVideo"in t&&(v({isSpotlightVideo:t.isSpotlightVideo},this.data),this.emitter.emit(exports.MeEvent.SPOTLIGHTVIDEOCHANGE,!!t.isSpotlightVideo))},c=e=>t(this,void 0,void 0,(function*(){if("isInLobby"in e&&e.isInLobby!==this.data.isInLobby){v({isInLobby:e.isInLobby},this.data);const t=!1===e.isInLobby?"inLobbyChange":void 0;yield this.rePolling(t),this.emitter.emit(exports.MeEvent.LOBBYCHANGE,!!e.isInLobby),this.ctx.emitter.emit(exports.MeEvent.LOBBYCHANGE,!!e.isInLobby)}})),u=t=>{const{event:e,state:s,body:i}=t;"personalLayout"===e&&(["update","full"].includes(s)?v({personalLayout:i},this.data):"delete"===s&&(this.data.personalLayout=void 0),this.emitter.emit(exports.MeEvent.PERSONALLAYOUTCHANGE,this.data.personalLayout))},d=t=>{if(!t.barrage)return;let e=null;if(!t.barrage.wordsDisplayStatus)return e=null,delete t.barrage,this.data.barrage=e||void 0,void this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e);if(!t.barrage.receiver)return;const s={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position,enableMultiLine:t.barrage.enableMultiLine,effect:t.barrage.effect};e=s;let{role:i}=this.data;if(this.data.endpointType===exports.ENDPOINT_TYPE.SUPERVISION){const{info:t}=this.ctx.modules;i="webinar"===t.meetingType?exports.ROLE.AUDIENCE:exports.ROLE.ATTENDEE}if(i===exports.ROLE.HOST||i===exports.ROLE.COHOST?e=t.barrage.receiver.host?s:null:i===exports.ROLE.ATTENDEE?e=t.barrage.receiver.attendee?s:null:i===exports.ROLE.AUDIENCE&&(e=t.barrage.receiver.audience?s:null),!e&&t.barrage.receiver.designated){const{userID:i,subjectID:r}=this.data,{designatedUsers:n=[]}=t.barrage;e=-1!==n.findIndex((t=>t.userID===i||r&&t.subjectID===r))?s:null}delete t.barrage,this.data.barrage=e||void 0,this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e)},p=t=>{"perm"in t&&(v({perm:t.perm},this.data),this.emitter.emit(exports.MeEvent.PERMCHANGE,t.perm))},h=t=>{"translationChannel"in t&&(v({translationChannel:t.translationChannel},this.data),this.emitter.emit(exports.MeEvent.TRANSLATIONCHANNELCHANGE,t.translationChannel))},m=t=>{"leave"in t&&!0===t.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),B(this.ctx),G(this.ctx),ut(this.ctx),this.emitter.emit(exports.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},g=t=>{e(t),s(t),i(t),r(t),n(t),o(t),c(t),a(t),d(t),p(t),h(t),m(t),(this.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.share&&this.data.share.sendOn&&r({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),(this.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.whiteboard&&this.data.whiteboard.sendOn&&r({whiteboard:{sendOn:!1}})};this.ctx.emitter.on(exports.MeEvent.INIT,(t=>{v(t,this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.bid&&(r({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),r({whiteboard:{sendOn:!1}})),this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(exports.MeEvent.UPDATE,(t=>{g(t),v(t,this.data)})),this.ctx.emitter.on(exports.EVENT.STATE,(({state:t})=>{t===exports.STATE.READY&&this.data.endpointType!==exports.ENDPOINT_TYPE.SUPERVISION&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data})})),this.ctx.emitter.on("me",(t=>{const{state:e,body:s={users:[]}}=t;if("delete"===e){const t=s.users[0];return t.leave=!0,void m(t)}let i=s.users.find((t=>t.userID===this.data.userID));i||s.users.length&&(i=s.users[0]),i?(g(i),v(i,this.data)):console.warn("me ",e,s)})),this.ctx.emitter.on("setUserVideo",(t=>{this.emitter.emit(exports.MeEvent.SETVIDEO,t.body)})),this.ctx.emitter.on("setUserAudio",(t=>{this.emitter.emit(exports.MeEvent.SETAUDIO,t.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){m({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{u(t)})),this.ctx.emitter.on("boSwitchNotify",(t=>{this.emitter.emit(exports.MeEvent.BOSWITCHNOTIFY,t.body)})),this.ctx.emitter.on("boReturnMeetingNotify",(t=>{this.emitter.emit(exports.MeEvent.BORETURNMEETINGNOTIFY,t.body)})),this.ctx.emitter.on("topMC",(t=>{const{body:e={}}=t;this.data.mediaContent&&this.data.mediaContent.topMCSeq!==e.seq&&(this.data.mediaContent.topMC=e.topMC,this.data.mediaContent.topMCSeq=e.seq,this.emitter.emit(exports.MeEvent.TOPMCCHANGE,{topMC:this.data.mediaContent.topMC,topMCSeq:this.data.mediaContent.topMCSeq}))}))}notifyUpdateUserState(t){this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:t})}updateUserState(t,e=!1){if(!e){const{role:e,initialMediaState:s}=this.data;t.audio.sendOn=t.audio.sendOn&&s.audio.sendOn,t.video.sendOn=t.video.sendOn&&s.video.sendOn,e===exports.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${s}meetings/${i}/updateUserState`,t)}boUpdateUserState(e,s,i=!1){return t(this,void 0,void 0,(function*(){if(!i){const{role:t,initialMediaState:e}=this.data;s.audio.sendOn=s.audio.sendOn&&e.audio.sendOn,s.video.sendOn=s.video.sendOn&&e.video.sendOn,t===exports.ROLE.AUDIENCE&&(s.audio.sendOn=!1,s.video.sendOn=!1)}this.data.isUpdatedUserState=!0;const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/breakoutRooms/${e}/updateUserState`,s)}))}rePolling(e){return t(this,void 0,void 0,(function*(){const{ctx:t}=this;B(t);const s=_(t),i=yield w(s,t.config.request.meetingID,t.config.request.clientID,t);if("inLobbyChange"===e&&Object.keys(t.modules).forEach((e=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(e)&&t.modules[e].cleanData(!0)})),e&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e}),yield k(s,t),"undefined"!=typeof Worker&&t.worker){const{meetingID:e,clientID:r,userID:n}=t.config.request;t.worker.postMessage({inboxes:i,topics:s,clientID:r,meetingID:e,userID:n,rePolling:!0})}else L(i,t)}))}}exports.BoHelpOpReason=void 0,(J=exports.BoHelpOpReason||(exports.BoHelpOpReason={}))[J.Cancel=1]="Cancel",J[J.Accept=2]="Accept",J[J.Refuse=3]="Refuse",exports.BreakoutRoomStatus=void 0,(W=exports.BreakoutRoomStatus||(exports.BreakoutRoomStatus={}))[W.NotStarted=0]="NotStarted",W[W.Opened=1]="Opened",W[W.Ending=2]="Ending",W[W.Ended=3]="Ended",exports.BoHelpAction=void 0,(z=exports.BoHelpAction||(exports.BoHelpAction={})).Request="request",z.Cancel="cancel",z.Accept="accept",z.Refuse="refuse";const X={status:0,subjectIndex:0,timerDuration:0,waitSeconds:0,allowChooseRoom:!1,allowReturnToMeeting:!1,autoJoinEnabled:!1,timerEnabled:!1,isTimerAutoEnd:!1,timerDurationEnabled:!1};class Z extends C{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:s}=t;if(e&&e.users){if("full"===s)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=Z.setDisplayNamePinyinProp?Z.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=Z.setUserGroupIDs?Z.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,t))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);this.data.callRecordUsers||(this.data.callRecordUsers=[]),e.users.forEach((t=>{const e=this.data.callRecordUsers.findIndex((e=>t.inviteTransID===e.inviteTransID));"update"===s&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===s&&-1===e&&(t.displayNamePinyin=Z.setDisplayNamePinyinProp?Z.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=Z.setUserGroupIDs?Z.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const s=((t,e)=>{for(let s=t.length-1;s>=0;s--)if(e(t[s]))return s;return-1})(this.data.callRecordUsers,(e=>{let s=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":s=t.account===e.contact;break;case"subjectID":s=t.subjectID===e.contact}return s}));s>-1&&(this.data.callRecordUsers[s].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/cancelInvite`,t)}}class tt extends C{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[],boInteractiveUsers:[]}}_topic(){const{role:t,endpointType:e}=this.ctx.modules.me.data;return e===exports.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:t===exports.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const t=(t,{event:e,state:s})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;if(this.ctx.breakoutRoomsState!==exports.BREAKOUT_ROOMS_STATE.CLOSE&&"boInteractiveUsers"!==e)return;const{resultInfo:i={}}=t;if("delete"!==s||"delete"===s&&[901357,901358,901352,901351,901350,901349].includes((null==i?void 0:i.bizCode)||-1))return void this.ctx.emitter.emit(exports.MeEvent.UPDATE,t);let r=!1;switch(e){case"interactiveUsers":case"boInteractiveUsers":t.isInLobby||(r=!0);break;case"broadcastUsers":t.isInLobby||t.role!==exports.ROLE.AUDIENCE||(r=!0);break;case"lobbyUsers":t.isInLobby&&(r=!0)}const n={};r&&(n.leave=!0),this.ctx.emitter.emit(exports.MeEvent.UPDATE,Object.assign(Object.assign({},t),n))},e=({updateUsers:e,state:s,sourceKey:i})=>{if("full"===s)return this.data[i]=e.map((e=>(e.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=tt.setUserGroupIDs?tt.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,t(e,{event:i,state:s}),e))),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!0}),this.data[i];void 0===this.data[i]&&(this.data[i]=[]);const{data:r,emitter:n}=this;return e.forEach((e=>{const o=r[i].findIndex((t=>e.userID===t.userID));if("delete"===s&&-1!==o){const[t]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:t,resultInfo:e.resultInfo})}else if("update"===s&&-1!==o){const t=this.data[i][o];this.updateUserProps(e,t),v(e,t),this.data[i][o]=I(t),this.emitter.emit(`${i}Update`,{user:this.data[i][o]})}else"update"===s&&-1===o&&(e.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=tt.setUserGroupIDs?tt.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,r[i].push(e),this.emitter.emit(`${i}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:i,state:s})})),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!1}),this.data[i]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:s,body:i,isBreakoutRooms:r=!1}=t;e(r?{updateUsers:i.users,state:s,sourceKey:"boInteractiveUsers"}:{updateUsers:i.users,state:s,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:s,body:i}=t;e({updateUsers:i.users,state:s,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:s,body:i}=t;e({updateUsers:i.users,state:s,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:s,body:i}=t;e({updateUsers:i.users,state:s,sourceKey:"advCtrlUsers"})})),this.ctx.emitter.on("userNotify",(t=>{const{body:e}=t;this.emitter.emit("userNotify",e)}))}reactiveData(t){if(!p(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,i)=>{Object.keys(t).forEach((r=>{!1===i&&r in this.data&&(t[r]=this.data[r]);const n=e=>t[r]=e.users.map((t=>t)),o=`${b(r)}Change`;this.emitter.on(o,n),e.set(o,n),p(t[r])&&!d(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}cleanup(){this.emitter.all=new Map,this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[],boInteractiveUsers:[]}}cleanData(){this.data.boInteractiveUsers=[]}getUserByUserID(t){if(t)return this.data.interactiveUsers.concat(this.data.lobbyUsers).concat(this.data.broadcastUsers).concat(this.data.advCtrlUsers).find((e=>e.userID===t))}updateUserProps(t,e){!e&&t.userID&&(e=this.getUserByUserID(t.userID)),e&&t.groupName&&(e.groupName=t.groupName),e&&t.displayName&&t.displayName!==e.displayName&&(t.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/whiteboard`,e)}annotate(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/annotate`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t.userID}/callStats/report`,t)}replyAllHandUp(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/refuseAll`)}getSendLayout(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/claimHost`,t)}userNotify(t,e){if(!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/notify`,e)}boUserNotify(t,e,s){if(!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/notify`,s)}setBoAudio(t,e,s){const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/audio`,s)}setBoVideo(t,e,s){const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/video`,s)}boRename(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/displayName`,s)}setBoShare(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/share`,s)}allowBoLocalRecord(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/allowLocalRecord`,s)}allowBoUserChatOn(t,e,s){if(!e||!s)return Promise.reject();const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${i}meetings/${r}/breakoutRooms/${t}/users/${e}/allowChat`,s)}backupSwitch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/backupSwitch`)}setTranslation(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/translation`,e)}setMicVolume(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/micVolume`,e)}remoteShare(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/remoteShare`,e)}getShareSources(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/shareSources`)}}function et(t){const s=function(t){const{baseURL:s,modules:i,worker:r,singleton:n,eventsSeq:o,filterTopics:a=[]}=t;i.findIndex((t=>t===Q))<0&&i.push(Q),i.findIndex((t=>t===U))<0&&i.push(U);const d=t.clientID||`${g()}_${f(new Date,"MMddHHmmss")}`,l={config:{baseURL:s,modules:i,singleton:n||!1,eventsSeq:o||!1,filterTopics:a,request:{cancelToken:u.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:d,boClientID:`${d}_${f(new Date,"MMddHHmmss")}`,location:"",meetingID:"",boMeetingID:"",ctrlID:"",boCtrlID:"",sessionID:"",userID:-1,voteTk:"",credential:"",multiActiveRegion:"",flag:""}},worker:r,emitter:e(),request:new c({baseURL:s,beforeRequest(t){t.headers["X-Y-Request-Id"]=g(),t.timeout=18e5},error(t){l.emitter.emit(exports.EVENT.REQUEST_ERROR,t)}}),modules:{},state:exports.STATE.CLOSE,breakoutRoomsState:exports.BREAKOUT_ROOMS_STATE.CLOSE,status:{polling:{running:!1,attempts:0,boAttempts:0,timer:null,boTimer:null},keepalive:{running:!1,attempts:0,timer:null,interval:20},eventsSeq:{running:!1,timer:null,interval:30},eventMsgs:[]},cleanup(t){l.state!==exports.STATE.CLOSE&&(l.worker&&l.worker.terminate(),l.config.request.location="",l.config.request.meetingID="",l.config.request.boMeetingID="",l.config.request.ctrlID="",l.config.request.boCtrlID="",l.config.request.sessionID="",l.config.request.userID=-1,l.config.request.voteTk="",l.config.request.credential="",l.config.request.multiActiveRegion="",l.status.polling={running:!1,attempts:0,boAttempts:0,timer:null,boTimer:null},l.status.keepalive={running:!1,attempts:0,timer:null,interval:20},l.status.eventsSeq={running:!1,timer:null,interval:30},l.request.setDefaultHeader("X-Y-Location",""),l.request.setDefaultHeader("X-Y-Meeting-Region",""),l.request.setDefaultHeader("X-Y-Ctrl-Id",""),l.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(l.modules).forEach((t=>{l.modules[t].cleanup()})),l.state=exports.STATE.CLOSE,l.emitter.emit(exports.EVENT.STATE,{state:l.state,reason:t}))}};return l}(t);return s.worker&&("undefined"!=typeof Worker?s.worker.postMessage({baseURL:s.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!d(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const s=new t(e);e.modules[s.moduleName]=s}))}(s.config.modules,s),s.emitter.on(exports.EVENT.POLLING_ERROR,(t=>{rt(s)({resultInfo:t})})),s.emitter.on(exports.EVENT.KEEPALIVE_ERROR,(t=>{rt(s)({resultInfo:t})})),Object.assign({config:s.config,request:s.request,get state(){return s.state},get breakoutRoomsState(){return s.breakoutRoomsState},on:s.emitter.on,off:s.emitter.off,join:st(s),boJoin:it(s),boReturnMeeting:ot(s),leave:rt(s),end:nt(s),endMeeting:at(s)},s.modules)}function st(e){return function(s){var i,r;return t(this,void 0,void 0,(function*(){const{clientID:n}=e.config.request,o=`${null===(i=s.endpointType)||void 0===i?void 0:i.toLocaleUpperCase()}${n}_${s.meetingNum}`;e.config.request.sessionID=o,e.request.setDefaultHeader("X-Y-Session-Id",o),e.request.setDefaultHeader("X-Y-Location",""),e.config.request.flag=null!==(r=s.flag)&&void 0!==r?r:"",s.flag&&delete s.flag;const a=e.config.request.flag?`&flag=${e.config.request.flag}`:"",c=e.config.request.flag?`?flag=${e.config.request.flag}`:"",u={meetingNum:s.meetingNum,pwd:s.pwd,url:s.url,mobileCode:s.mobileCode,mobile:s.mobile,regEmail:s.regEmail,accEmail:s.accEmail,tk:s.tk,displayName:s.displayName,userAgent:s.userAgent,verifyID:s.verifyID,tc:s.tc,t:s.t};s.tc&&(delete u.meetingNum,delete u.pwd),s.t&&delete u.pwd;const{prefix:d}=e.config.request,l=yield e.request.get(`${d.ctrl}credential${c}`,{params:u,headers:{"X-Y-Endpoint-Type":s.endpointType}}),{credential:p="",location:h=""}=l&&l.data||{};if(e.config.request.location=h,e.request.setDefaultHeader("X-Y-Location",h),!p)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:l.bizCode,data:l.data}),l;delete s.pwd,delete s.url,e.config.request.credential=p;const m=l.data.multiActiveRegion;m&&(e.config.request.multiActiveRegion=m,e.request.setDefaultHeader("X-Y-Meeting-Region",m));const g={displayName:s.displayName,userAgent:s.userAgent,clientID:n,avatarURL:s.avatarURL};s.groupIDs&&s.account&&(g.groupIDs=s.groupIDs,g.account=s.account,g.groupName=s.groupName),s.mediaContentReq&&(g.mediaContentReq=s.mediaContentReq),s.taskID&&(g.taskID=s.taskID),g.avatarURL=s.avatarURL;const f=s.hostKey?`&hostKey=${s.hostKey}`:"",v={"X-Y-Endpoint-Type":s.endpointType,"X-Y-Endpoint-Id":n},x=yield e.request.post(`${d.ctrl}join?meetingNum=${s.meetingNum}&credential=${p}${f}${a}`,g,{headers:v});if(!x||x&&x.ret<=-1)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:x.bizCode,data:x.data}),x;const{meetingID:b="",ctrlID:y="",user:q={},mediaContent:I={},initialMediaState:E={},tk:D=""}=x.data;e.config.request.meetingID=b,e.config.request.ctrlID=y,e.config.request.userID=q.userID,e.config.request.voteTk=D,e.config.request.credential=p,e.config.request.multiActiveRegion=m,e.request.setDefaultHeader("X-Y-Ctrl-Id",y),e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},q),{mediaContent:I,initialMediaState:E})),e.state=exports.STATE.JOINED,e.emitter.emit(exports.EVENT.STATE,{state:e.state});const $=()=>{e.state!==exports.STATE.READY&&(e.state=exports.STATE.READY,e.emitter.emit(exports.EVENT.STATE,{state:e.state}))},O=_(e),S=yield w(O,b,n,e);yield k(O,e),e.status.eventMsgs=[];const R=t=>{const s=e.status.eventMsgs.find((e=>e.event===t.event));s&&(s.seq=t.seq)},T=s=>t(this,void 0,void 0,(function*(){const i=e.status.eventMsgs,r=[];if(s.eventMsgs.forEach((t=>{const{event:s,seq:n}=t,o=e.status.eventMsgs.find((t=>t.event===s));o?o.seq!==n&&r.push(s):i.push(t)})),r.length){const s=yield function(e,s,i){var r;return t(this,void 0,void 0,(function*(){let t=null,n=[];try{t=yield e.request.post(`/meeting-ctrl/api/v1/meetings/${s}/events`,{events:i})}catch(a){return console.error(a),n}if(!t)return n;const{data:o={}}=t;return o&&o.eventMsgs&&(n=null!==(r=o.eventMsgs)&&void 0!==r?r:[]),n}))}(e,b,r);s.forEach((t=>{var s;e.emitter.emit(t.event,t),void 0!==(null===(s=t.body)||void 0===s?void 0:s.seq)&&R({event:t.event,seq:t.body.seq})}))}}));e.emitter.on("eventSeqChange",R),e.emitter.on("eventsSeqChange",T);const[A]=function(t){const e=["meetingInfo","meetingSetting","spotlightVideo","hostLayout","attendeeLayout","audienceLayout","interactiveUsers","broadcastUsers","lobbyUsers","recording","liveStream"],s={};return e.forEach((t=>{s[t]=0})),[e,s]}();if("undefined"!=typeof Worker&&e.worker){e.status.polling.running=!0,e.status.keepalive.running=!0;const t={ctrlID:y,location:h,multiActiveRegion:m,sessionID:o,inboxes:S,topics:O,clientID:n,meetingID:b,userID:q.userID,status:!0};e.config.eventsSeq&&(t.events=A,t.eventsSeq=!0),e.worker.postMessage(t),e.worker.onmessage=t=>{var s;"pollingStarted"!==t.data?"keepaliveStarted"!==t.data&&("pollingStopped"!==t.data?"keepaliveStopped"!==t.data?"eventsSeqStopped"!==t.data?"pollingError"!==t.data?"keepaliveError"!==t.data?"eventsSeqStarted"!==t.data&&("object"==typeof t.data&&"eventsSeq"in t.data?T(t.data.eventsSeq):"object"==typeof t.data&&"region"in t.data||(e.emitter.emit(t.data.event,t.data),void 0!==(null===(s=t.data.body)||void 0===s?void 0:s.seq)&&R({event:t.data.event,seq:t.data.body.seq}))):rt(e)({resultInfo:{message:"keepalive Max Attempts"}}):rt(e)({resultInfo:{message:"polling Max Attempts"}}):e.status.eventsSeq.running=!1:e.status.keepalive.running=!1:e.status.polling.running=!1):$()}}else L(S,e),$(),V(e),e.config.eventsSeq&&((t,e)=>{const{meetingID:s}=t.config.request;t.status.eventsSeq.running=!0,Y(t.request,{meetingID:s,status:t.status.eventsSeq,events:e},(e=>{t.emitter.emit("eventsSeqChange",e)}))})(e,A);return x.data=Object.assign(Object.assign({},x.data),l.data),x}))}}function it(e){return function(s,i){return t(this,void 0,void 0,(function*(){if(e.state!==exports.STATE.READY)return;const{prefix:{ctrl:t},clientID:r,meetingID:n}=e.config.request,o=`${r}_${f(new Date,"MMddHHmmss")}`;e.config.request.boClientID=o;const a=yield e.request.post(`${t}meetings/${n}/breakoutRooms/${s}/boJoin`,i,{headers:{"X-Y-Endpoint-Id":o}});if(!a||(null==a?void 0:a.ret)<=-1)return e.emitter.emit(exports.EVENT.BO_FAILED,{bizCode:a.bizCode,data:{bid:s,resData:a.data,type:"boJoin"}}),a;B(e);const{boCtrlID:c="",meetingID:u="",user:d={},mediaContent:l={},initialMediaState:p={}}=a.data;e.config.request.boMeetingID=u,e.config.request.boCtrlID=c,Object.keys(e.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(t)&&e.modules[t].cleanData()})),e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},d),{boMediaContent:l,initialMediaState:p}));const h=["meeting","interactive","lobby"],m=["interactive","bo","hostAttendee"],[g,v]=yield Promise.all([w(h,n,r,e),w(m,u,o,e)]);return e.breakoutRoomsState=exports.BREAKOUT_ROOMS_STATE.JOINED,e.emitter.emit(exports.EVENT.BREAKOUT_ROOMS_STATE,exports.BREAKOUT_ROOMS_STATE.JOINED),yield Promise.all([k(h,e),N(s,m,e)]),L(g,e),j(v,e),e.modules.me.notifyUpdateUserState(),e.breakoutRoomsState=exports.BREAKOUT_ROOMS_STATE.READY,e.emitter.emit(exports.EVENT.BREAKOUT_ROOMS_STATE,exports.BREAKOUT_ROOMS_STATE.READY),a}))}}function rt(e){return function(s){return t(this,void 0,void 0,(function*(){const t=s&&s.resultInfo;s||(s={resultInfo:{bizCode:901359}});const{prefix:i,meetingID:r}=e.config.request,n=e.config.request.flag?`?flag=${e.config.request.flag}`:"";let o;try{o=yield e.request.post(`${i.ctrl}meetings/${r}/leave${n}`,s)}catch(a){console.error(a)}return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1,eventsSeq:!1}),B(e),G(e),K(e),ut(e),e.cleanup(t),o}))}}function nt(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:s}=e.config.request,i=e.config.request.flag?`?flag=${e.config.request.flag}`:"",r=yield e.request.post(`${t.ctrl}meetings/${s}/end${i}`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1,eventsSeq:!1}),B(e),G(e),K(e),ut(e),e.cleanup(),r}))}}function ot(e){return function(s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:i}=e.config.request;"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1,eventsSeq:!1});const r=yield e.request.post(`${t}meetings/${i}/breakoutRooms/${s}/boReturnMeeting`);if(!r||(null==r?void 0:r.ret)<=-1)return e.emitter.emit(exports.EVENT.BO_FAILED,{bizCode:r.bizCode,data:{bid:s,resData:r.data,type:"boReturnMeeting"}}),r;B(e),Object.keys(e.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms","users"].includes(t)&&e.modules[t].cleanData()})),e.config.request.boCtrlID="",e.config.request.boMeetingID="",e.breakoutRoomsState=exports.BREAKOUT_ROOMS_STATE.CLOSE,e.emitter.emit(exports.EVENT.BREAKOUT_ROOMS_STATE,exports.BREAKOUT_ROOMS_STATE.CLOSE);const{user:n={},mediaContent:o={},initialMediaState:a={}}=r.data;e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},n),{boMediaContent:{},mediaContent:o,initialMediaState:a}));const c=_(e),u=yield w(c,i,e.config.request.clientID,e);return yield k(c,e),L(u,e),e.modules.me.notifyUpdateUserState("bo"),r}))}}function at(e){return function(s){return t(this,void 0,void 0,(function*(){const{prefix:t}=e.config.request;return yield e.request.post(`${t.ctrl}meetingNum/${s}/end`)}))}}class ct{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=et(t)}static getInstance(t){return this.instance?this.instance:this.instance=new ct(t)}}function ut(t){if(t.config.singleton){const{baseURL:e,modules:s,singleton:i}=t.config,r={baseURL:e,modules:s,worker:t.worker,singleton:i},n=ct.getInstance(r);n&&(n.meeting=et(r))}}Object.defineProperty(ct,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),exports.Asr=class extends C{constructor(t){super(t,"asr")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("asr",(t=>{const{body:e}=t;void 0===this.data.asr&&(this.data.asr={status:"stopped",translations:[],sourceChannel:"auto"}),e.resultInfo&&(this.emitter.emit("resultInfoChange",e.resultInfo),delete e.resultInfo),e.translations&&(this.emitter.emit("translationsChange",e.translations),delete e.translations),v(e,this.data.asr),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo),this.emitter.emit("asrChange",{asr:this.data.asr,changeData:e})}))}cleanup(){this.emitter.all=new Map}transcriptStatus(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transcript/status`,t)}transcriptSetting(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/translation/setting`,t)}},exports.AudioRecording=class extends C{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:s}=t;e&&(this.data.audioRecording=Object.assign(Object.assign({},this.data.audioRecording||{}),e),e.status&&(this.data.audioRecording.requesting="starting"===e.status,this.data.status="starting"!==e.status?e.status:this.data.status,s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf())),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo))}))}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/audioRecording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/audioRecording/status`,e)}))}},exports.BreakoutRooms=class extends C{constructor(t){super(t,"breakoutRooms"),this.data={option:X,items:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("breakoutRooms",(t=>{var e,s;const{state:i,body:r}=t;if(r)switch(i){case"full":this.data.option=r.option,this.data.items=null!==(e=r.items)&&void 0!==e?e:[],this.emitter.emit("breakoutRoomsOptionChange",this.data.option),this.emitter.emit("breakoutRoomsItemsChange",this.data.items);break;case"update":r.option&&(this.data.option=r.option,this.emitter.emit("breakoutRoomsOptionChange",this.data.option)),r.items&&(this.data.items=null!==(s=r.items)&&void 0!==s?s:[],this.emitter.emit("breakoutRoomsItemsChange",this.data.items))}})),this.ctx.emitter.on("preAssignBoList",(t=>{const{state:e,body:s}=t;if(s&&"full"===e)this.data.preAssignBoList=s,this.emitter.emit("preAssignBoListChange",this.data.preAssignBoList)})),this.ctx.emitter.on("boHelp",(t=>{const{state:e,body:s}=t;if(s)switch(e){case"full":case"update":this.data.boHelp=s,this.emitter.emit("boHelpChange",this.data.boHelp);break;case"delete":{const t=Object.assign(Object.assign({},this.data.boHelp),s);this.data.boHelp=void 0,this.emitter.emit("boHelpDelete",t)}}})),this.ctx.emitter.on("boBroadcastVoice",(t=>{const{state:e,body:s}=t;if(s)switch(e){case"update":case"full":this.data.boBroadcastVoice=s,this.emitter.emit("boBroadcastVoiceChange",this.data.boBroadcastVoice)}})),this.ctx.emitter.on("boBroadcastMsg",(t=>{const{state:e,body:s}=t;if(s&&"update"===e)this.data.boBroadcastMsg=s,this.emitter.emit("boBroadcastMsgChange",this.data.boBroadcastMsg)})),this.ctx.emitter.on("boInfo",(t=>{const{state:e,body:s}=t;if(s&&"full"===e)this.data.boInfo=s,this.emitter.emit("boInfoChange",this.data.boInfo)})),this.ctx.emitter.on("boSetting",(t=>{const{state:e,body:s}=t;if(s&&"full"===e)this.data.boSetting=s,this.emitter.emit("boSettingChange",this.data.boSetting)}))}cleanup(){this.emitter.all=new Map,this.data={option:X,items:[]},this.cleanData()}cleanData(t=!1){t&&(this.data.option=X,this.data.items=[],this.emitter.emit("breakoutRoomsOptionChange",this.data.option)),this.data.preAssignBoList=void 0,this.data.boHelp=void 0,this.data.boBroadcastVoice=void 0,this.data.boBroadcastMsg=void 0,this.data.boInfo=void 0,this.data.boSetting=void 0,this.emitter.emit("preAssignBoListChange",this.data.preAssignBoList),this.emitter.emit("boHelpChange",this.data.boHelp),this.emitter.emit("boBroadcastVoiceChange",this.data.boBroadcastVoice),this.emitter.emit("boBroadcastMsgChange",this.data.boBroadcastMsg),this.emitter.emit("boInfoChange",this.data.boInfo),this.emitter.emit("boSettingChange",this.data.boSetting)}start(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/breakoutRooms/start`,t)}boSwitchNotify(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/breakoutRooms/${t}/users/${e}/boSwitchNotify`)}boReturnMeetingNotify(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/breakoutRooms/${t}/users/${e}/boReturnMeetingNotify`)}end(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/breakoutRooms/end`)}boHelp(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/boHelp`,{action:t})}boBroadcastVoice(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/boBroadcastVoice`,{on:t})}boBroadcastMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/boBroadcastMsg`,{msg:t})}},exports.Chat=class extends C{constructor(t){super(t,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(t=>{const{body:e}=t;this.emitter.emit("chatMsg",e)}))}msg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/msg`,t)}historyMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/historyMsg`,t)}sendMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/send`,t)}},exports.FocusUsers=class extends C{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:s}=t;s&&(this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=s.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(s.focusUsers):"delete"===e&&(s.focusUsers.forEach((t=>{let e=-1;t.subjectID?e=this.data.focusUsers.findIndex((e=>e.subjectID===t.subjectID)):t.userID&&(e=this.data.focusUsers.findIndex((e=>e.userID===t.userID))),-1!==e&&this.data.focusUsers.splice(e,1)})),this.data.focusUsers=this.data.focusUsers.map((t=>t))),this.emitter.emit("focusUsersChange",this.data.focusUsers))}))}setFocusUsers(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/focusUser`,t)}},exports.Info=U,exports.Interpretation=class extends C{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:s}=t;"full"===s?(this.data.interpreters=e.interpreters,this.data.status=e.status):this.data.status=e.status,this.emitter.emit("interpretationChange",this.data)}))}interpretationStart(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/interpretation/start`,t)}interpretationEnd(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/interpretation/stop`)}},exports.Invite=Z,exports.LiveStream=class extends C{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:s,stime:i}=t;if(!s)return;if(i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),"full"===e){const{liveStreams:t=[],defaultLayout:e}=s;if(!t.length)return;const i=[];this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo}),i.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||"",index:t.data&&t.data.index}),t))),this.data.defaultLayout=e;return v({status:i},this.data),this.emitter.emit("liveStreamsChange",this.data.liveStreams),void this.emitter.emit("liveStreamsUpdate",this.data.liveStreams)}if("delete"===e){const{liveStreams:t=[]}=s,e=[];return t.forEach((t=>{const s=this.data.liveStreams.findIndex((e=>e.data&&e.data.index===t.data.index));if(-1===s)return;const[i]=this.data.liveStreams.splice(s,1);e.push(i)})),this.emitter.emit("liveStreamsDelete",e),void this.emitter.emit("liveStreamsChange",this.data.liveStreams)}void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:r=[]}=s,n=[],o=[],a=t=>{t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>e.platform===t.platform));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t)),n.push(t);const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?s.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):s.splice(e,1,{platform:s[e].platform||"",status:t.requesting?s[e].status||"stopped":t.status||""}),this.data.status=s};r.forEach((t=>{if("thirdParty"!==t.platform)return void a(t);t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>{var s,i;return(null===(s=e.data)||void 0===s?void 0:s.index)===(null===(i=t.data)||void 0===i?void 0:i.index)}));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t),o.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t),n.push(t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>{var s;return e.index===(null===(s=t.data)||void 0===s?void 0:s.index)})),-1===e?s.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||"",index:t.data&&t.data.index}):s.splice(e,1,{platform:s[e].platform||"",status:t.requesting?s[e].status||"stopped":t.status||"",index:t.data&&t.data.index}),this.data.status=s})),n.length&&this.emitter.emit("liveStreamsUpdate",n),o.length&&this.emitter.emit("liveStreamsAdd",o),this.emitter.emit("liveStreamsChange",this.data.liveStreams)}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/status`,e)}))}liveStreamDescription(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/description`,e)}))}liveStreamSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/setting`,e)}))}liveStreamDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/delete`,e)}))}liveStreamLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/layout`,e)}))}liveStreamAllow(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/liveStream/allow`)}))}pushSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/pushSetting`,e)}))}},exports.LiveStreaming=class extends C{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:s,stime:i}=t;if(!s)return;if(i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=s;if(!t.length)return;const i=[],r=[];return t.forEach((t=>{t.audioDesignate||(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo}),i.push({index:t.index,protocol:t.protocol,status:(t.requesting?"stopped":t.status)||""}),r.push(t))})),this.data.liveStreaming=r,void v({status:i,defaultConfig:e},this.data)}if("delete"===e){const{liveStreaming:t=[]}=s;return t.forEach((t=>{const e=this.data.liveStreaming.findIndex((e=>e.protocol===t.protocol&&e.index===t.index));-1!==e&&this.data.liveStreaming.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}void 0===this.data.liveStreaming&&(this.data.liveStreaming=[]);const{liveStreaming:r=[],defaultConfig:n}=s;r.forEach((t=>{if(t.audioDesignate)return;t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo});let e=this.data.liveStreaming.findIndex((e=>e.index===t.index));-1===e?(t.requesting="starting"===t.status,this.data.liveStreaming.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreaming[e]),t),this.data.liveStreaming.splice(e,1,t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?s.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):s.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?s[e].status||"stopped":t.status}),this.data.status=s})),n&&v({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/status`,e)}))}liveStreamingSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/setting`,e)}))}liveStreamingDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/delete`,e)}))}liveStreamingDetail(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/detail`,e)}))}},exports.Me=Q,exports.Qa=class extends C{constructor(t){super(t,"qa"),this.data={questions:new Map,topSort:0}}_topic(){return"qa"}_bindOn(){this.ctx.emitter.on("qa",(t=>{const{body:e}=t;p(e)&&!d(e)?this.qaUpdate(this.data.questions,e):e.forEach((t=>this.qaUpdate(this.data.questions,t)))}))}cleanup(){this.emitter.all=new Map,this.cleanData()}cleanData(){this.data={questions:new Map,topSort:0}}qaUpdate(t,e){let s=t.get(e.question.id);const{clientID:i}=this.ctx.config.request;switch(e.command){case"addQuestion":s=this.createQuestion(e.question),t.set(e.question.id,s),this.emitter.emit("questionAdd",{question:s,selfSent:s.sender.endpointID===i});break;case"dismissQuestion":if(!s)break;s.sender.endpointID!==i?s.status="close":s.isTop=!1,t.set(e.question.id,s),this.emitter.emit("questionUpdate",{question:s});break;case"reopenQuestion":s?(s.status="open",s.isTop=e.question.isTop,t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"updateQuestion":s?(s=Object.assign(Object.assign(Object.assign({},s),e.question),{topSort:e.question.isTop?this.data.topSort+=1:0}),t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteQuestion":if(!s)break;s.sender.endpointID!==i?t.delete(e.question.id):(s.status="delete",s.isTop=!1,s.answers.clear(),t.set(e.question.id,s)),this.emitter.emit("questionDelete",{question:s});break;case"answerQuestion":s?s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(s=this.createQuestion(e.question),s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteAnswer":s&&(s.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:s}))}this.emitter.emit("questionChange",{questions:this.data.questions})}createQuestion(t){return{isAnonymous:t.isAnonymous,isTop:t.isTop,id:t.id,content:t.content,sender:t.sender,timestamp:t.timestamp||-1,status:t.status||"open",answers:new Map,topSort:0}}createQuestionAnswer(t){return{isPrivate:t.isPrivate,content:t.content,id:t.id,sender:t.sender,timestamp:t.timestamp||-1}}qa(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/qa`,t)}},exports.RTSP=class extends C{constructor(t){super(t,"rtsp")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("rtspAccess",(t=>{var e;const{body:s,state:i}=t;if(void 0===(null===(e=this.data)||void 0===e?void 0:e.accessList)&&(this.data.accessList=[]),"full"===i)this.data=s;else if("update"===i){const{index:t,layout:e,resolution:i,urls:r}=s,n=this.data.accessList.findIndex((e=>e.index===t));-1===n?this.data.accessList.push({index:t,layout:e,resolution:i,urls:r}):this.data.accessList.splice(n,1,{index:t,layout:e,resolution:i,urls:r})}else if("delete"===i){const{index:t}=s;this.data.accessList=this.data.accessList.filter((e=>t!==e.index))}this.emitter.emit("rtspAccessChange",this.data)}))}cleanup(){this.emitter.all=new Map}createRTSPAccess(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/create`,t)}setRTSPAccess(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/setting`,t)}deleteRTSPAccess(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/delete`,t)}},exports.Recording=class extends C{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:s,stime:i}=t;s&&(this.data.isPracticeSession="started"===s.status&&this.data.status===s.status&&0===s.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),s),s.status&&(this.data.recording.requesting="starting"===s.status,this.data.status="starting"!==s.status?s.status:"started"===this.data.status?"stopped":this.data.status,i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf())),(s.status&&"started"===s.status||void 0!==s.isReconnecting&&!s.isReconnecting)&&this.setMainRecordPromptCount(0),s.backupRecord?(s.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===s.backupRecord.status,this.data.backupRecordStatus="starting"!==s.backupRecord.status?s.backupRecord.status:this.data.backupRecordStatus),(s.backupRecord.status&&"started"===s.backupRecord.status||void 0!==s.backupRecord.isReconnecting&&!s.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",s.resultInfo&&this.emitter.emit("resultInfoChange",s.resultInfo),s.backupRecord&&s.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",s.backupRecord.resultInfo),["full","update"].includes(e)&&s.recordUsers&&(this.data.recording.recordUsers=s.recordUsers))}))}setMainRecordPromptCount(t){this.data.mainRecordPromptCount=t}setBackupRecordPromptCount(t){this.data.backupRecordPromptCount=t}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/recording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/designatedUsers`,e)}))}participantAdd(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/add`,e)}))}participantDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/delete`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}getByIds(e){return t(this,void 0,void 0,(function*(){const{prefix:{user:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/subject/getByIds`,e)}))}recordLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/layout`,e)}))}},exports.RemoteDesktop=class extends C{constructor(t){super(t,"remoteDesktop")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("remoteDesktop",(t=>{const{body:e}=t;this.data=e,this.emitter.emit("remoteDesktopChange",e)}))}setRemoteDesktop(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/remoteDesktop`,e)}},exports.RollCall=class extends C{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:s}=t;s&&("full"===e||"update"===e?(this.data.index=s.index,this.data.userID=s.userID,this.data.type=s.type,this.data.nextUserID=s.nextUserID):"delete"===e&&(this.data.type=s.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:s}=t;s&&("full"===e?(this.data.rollcallList=s.rollcallList,this.data.rollcallUserLayout=s.rollcallUserLayout,this.data.hostLayout=s.hostLayout,this.data.commonUserLayout=s.commonUserLayout):"update"===e&&(s.rollcallList||[]).forEach((t=>{this.data.rollcallList.forEach((e=>{e.index===t.index&&(e.state=t.state)}))})),this.emitter.emit("rollCallChange",this.data))}))}setRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall/setting`,t)}},exports.Setting=class extends C{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:s}=t;["full","update"].includes(e)&&v(s,this.data)}))}reactiveData(t){if(!p(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,i,r)=>{Object.keys(t).forEach((n=>{if(!1===i&&n in this.data&&(t[n]=this.data[n]),r<1){const s=e=>t[n]=e,i=`${b(n)}Change`;this.emitter.on(i,s),e.set(i,s)}if(p(t[n])&&!d(t[n])){s(t[n],!0,r+1)}}))};return s(t,!1,0),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}setting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/setting`,e)}))}muteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/muteAll`)}))}unmuteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/unmuteAll`)}))}boMuteAll(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/breakoutRooms/${e}/muteAll`)}))}boUnmuteAll(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/breakoutRooms/${e}/unmuteAll`)}))}},exports.ShouldJoinUsers=class extends C{constructor(t){super(t,"shouldJoinUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("shouldJoinUsers",(t=>{const{state:e}=t;"update"===e&&this.emitter.emit("shouldJoinUsersChange")}))}modifyUser(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/attendance/shouldJoin`,t)}getUser(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/attendance/getShouldJoin`)}},exports.SpotlightVideo=class extends C{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(t=>{var e;const{body:s}=t;if(!s||!s.userIDs)return;this.data.userIDs=s.userIDs,this.data.broadcast=null!==(e=s.broadcast)&&void 0!==e?e:null;s.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!1})}))}spotlight(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/spotlight`,t)}},exports.Transcript=class extends C{constructor(t){super(t,"transcript"),this.data={asr:{status:"stopped"}}}_topic(){return["transcript"]}_bindOn(){this.ctx.emitter.on("transcriptMsg",(t=>{const{body:e}=t;this.emitter.emit("transcriptMsg",e)}))}cleanup(){this.emitter.all=new Map,this.cleanData()}cleanData(){this.data={asr:{status:"stopped"}}}historyMsg(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transcript/historyMsg`,t)}},exports.Users=tt,exports.View=class extends C{constructor(t){super(t,"view")}_topic(){const{endpointType:t,role:e}=this.ctx.modules.me.data;return t===exports.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:e===exports.ROLE.AUDIENCE?["audience"]:["hostAttendee","audience"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((t=>{this.ctx.emitter.on(t,(e=>{"personalView"!==t?this.updateLayout(e,t):this.updatePersonalLayouts(e)}))})),this.ctx.emitter.on("videoSourcesUpdated",(()=>{this.emitter.emit("videoSourcesUpdated")})),this.ctx.emitter.on("presetLayout",(t=>{const{body:e}=t;this.emitter.emit("presetLayoutUpdated",e)}))}updateLayout(t,e){const{event:s,body:i}=t;i&&("meetingView"===s?Object.keys(i).forEach((t=>{this.data[t]=i[t]})):this.data[e]=i)}updatePersonalLayouts(t){const{state:e,body:s}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),s.personalLayouts.forEach((t=>{const{subscriber:s={userID:-1}}=t,i=s.userID||s.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[i]=t:delete this.data.personalLayouts[i]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/hostLayout`,e)}))}attendeeLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/attendeeLayout`,e)}))}audienceLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/audienceLayout`,e)}))}personalLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout`,e)}))}personalLayoutDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout/delete`,e)}))}virtualClassLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/virtualClass/layout`,e)}))}closeVirtualClass(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/view/virtualClass/close`)}))}getVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/layout/template/info`,{params:e})}))}addVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/add`,e)}))}editVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/edit`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}editTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/edit`,e)}))}addTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/add`,e)}))}deleteTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/delete`,e)}))}getDefaultTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getDefaultTemplates`,{params:e})}))}changeDefaultTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/changeDefaultTemplate`,e)}))}perspectiveBind(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/perspective/bind`,e)}))}setSavedBackground(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/recentBackgroundFile`,e)}))}getSavedBackground(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/view/recentBackgroundFile`)}))}getPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${s}/view/presetLayout`,{params:e})}))}setPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout`,e)}))}presetLayoutApply(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/apply`,e)}))}presetLayoutApplyUser(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/applyUser`,e)}))}presetLayoutApplyUserBatch(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/applyUserBatch`,e)}))}},exports.Vote=class extends C{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:s}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[s]=e,this.emitter.emit("voteChange",{vote:this.data.vote,changeData:e})})),this.ctx.emitter.on(exports.MeEvent.LOBBYCHANGE,(t=>{t&&(this.data.vote={})}))}getVotes(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${s}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${s}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${s}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:s},meetingID:i,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.post(`${s}meetings/${i}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:s},meetingID:i,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.post(`${s}meetings/${i}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/delete`,t)}voteInProgress(t){const{prefix:{vote:e},meetingID:s,voteTk:i}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/vote/inProgress`,{params:{tk:t&&t.tk||i}})}},exports.Words=class extends C{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){const t=()=>{this.data.wordsDisplayStatus=!1,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})};this.ctx.emitter.on("meetingBarrage",(e=>{this.data.timer&&clearTimeout(this.data.timer),this.data.timerMap||(this.data.timerMap={});const{state:s,body:i,pollingSeqId:r}=e;if("delete"===s)return i&&i.indexes&&(this.data.list=this.data.list.filter((t=>!i.indexes.includes(t.index)))),t(),void this.emitter.emit("barrageWordChange",this.data);if("full"===s){if(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&(this.data.barrageRecord.length=10),i.list){const t=[];i.list.forEach((e=>{var s,i,n,o,a,c;if(this.data.barrageRecord.find((t=>!!e.timestamp&&Number(e.timestamp)===t.timestamp)));else{const u=null!==(i=Number.parseInt(null!==(s=e.timestamp)&&void 0!==s?s:""))&&void 0!==i?i:(new Date).getTime(),d={index:e.index,id:r,content:null!==(n=e.content)&&void 0!==n?n:"",time:u,timestamp:u,durationType:null!==(o=e.durationType)&&void 0!==o?o:"",duration:1e3*(null!==(a=e.duration)&&void 0!==a?a:0)};d.content&&t.push(d);const l=null!==(c=e.duration)&&void 0!==c?c:-1,p=e.index;if(this.data.timerMap){const t=this.data.timerMap[p];t&&clearTimeout(t),-1!==l&&(this.data.timerMap[p]=setTimeout((()=>{this.data.timerMap&&(this.data.timerMap[p]=null),this.data.list=this.data.list.filter((t=>t.index!==p)),this.emitter.emit("barrageWordChange",this.data)}),1e3*l))}}})),this.data.barrageRecord=[...t,...this.data.barrageRecord]}else if(r){const t=i.timestamp?Number.parseInt(i.timestamp):(new Date).getTime();this.data.barrageRecord=[{index:1,id:r,content:i.content,time:t,timestamp:t,durationType:i.durationType,duration:1e3*i.duration},...this.data.barrageRecord]}i.wordsDisplayStatus=!0,-1!==i.duration&&(this.data.timer=setTimeout((()=>{i.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=i.wordsDisplayStatus,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})}),1e3*i.duration)),v(i,this.data),this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data}),this.emitter.emit("barrageWordChange",this.data)}})),this.ctx.emitter.on(exports.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})))}barrage(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/barrage`,e)}))}deleteBarrage(e={indexes:[]}){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/deleteBarrage`,e)}))}},exports.createMeeting=function(t){return t.singleton?ct.getInstance(t).meeting:et(t)},exports.reset=ut;
package/dist/meeting.d.ts CHANGED
@@ -1801,6 +1801,7 @@ export declare interface Live {
1801
1801
  platform?: string;
1802
1802
  status?: string;
1803
1803
  watchURL?: string;
1804
+ intranetWatchURL?: string;
1804
1805
  requesting?: boolean;
1805
1806
  resultInfo?: ResultInfo;
1806
1807
  bizCode?: string;
@@ -2988,7 +2989,7 @@ export declare interface SettingData {
2988
2989
  };
2989
2990
  share: {
2990
2991
  annotationPermission: 'all' | 'sharerHost';
2991
- sharePermission: 'allGrab' | 'hostGrab' | 'hostStart' | 'multi';
2992
+ sharePermission: 'allGrab' | 'hostGrab' | 'hostStart' | 'multi' | 'noGrab';
2992
2993
  watermark: boolean;
2993
2994
  showAnnotatorName?: boolean;
2994
2995
  designatedOn?: boolean;
@@ -3906,6 +3907,20 @@ export declare class Users extends Module<UsersData, Events_5> {
3906
3907
  setMicVolume(userID: number, params: {
3907
3908
  micVolume: number;
3908
3909
  }): Promise<any>;
3910
+ /**
3911
+ * 开启指定终端辅流
3912
+ * @param userID
3913
+ * @returns
3914
+ */
3915
+ remoteShare(userID: number, params: {
3916
+ shareSourceID: number;
3917
+ }): Promise<any>;
3918
+ /**
3919
+ * 获取终端的辅流源
3920
+ * @param userID
3921
+ * @returns
3922
+ */
3923
+ getShareSources(userID: number): Promise<any>;
3909
3924
  }
3910
3925
 
3911
3926
  /**