@ylink-sdk/meeting 1.0.5-beta.13 → 1.0.5-beta.14

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
- var YlinkSDKMeeting=function(t){"use strict";function e(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 s(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)}))}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};!function(t,e){var s="__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]",h="[object Object]",m="[object Promise]",p="[object RegExp]",g="[object Set]",f="[object String]",v="[object Symbol]",x="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",D="[object Int8Array]",E="[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]=_[I]=_[q]=_[D]=_[E]=_[$]=_[d]=_[l]=_[h]=_[p]=_[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 i&&i&&i.Object===Object&&i||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,W=Array.prototype,F=Function.prototype,J=Object.prototype,X=k["__core-js_shared__"],z=(K=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",Q=F.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Q.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=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),ht=Pt(k,"DataView"),mt=Pt(k,"Map"),pt=Pt(k,"Promise"),gt=Pt(k,"Set"),ft=Pt(k,"WeakMap"),vt=Pt(Object,"create"),xt=Ht(ht),bt=Ht(mt),yt=Ht(pt),It=Ht(gt),qt=Ht(ft),Dt=it?it.prototype:void 0,Et=Dt?Dt.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,m,x){var C;if(i&&(C=m?i(t,r,m,x):i(t)),void 0!==C)return C;if(!Ft(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==h||w==n||k&&!m){if(H(t))return m?t:{};if(C=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:(e=nt(t),Ft(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,Jt(e),t)}(C,t))}else{if(!_[w])return m?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 I:case q:case D:case E: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 p: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,Et?Object(Et.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,Jt,Mt)}(t):Jt(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!(!Ft(t)||(e=t,z&&z in e))&&(Wt(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 i=e[t];return i===s?void 0:i}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?s: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(mt||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(!mt||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||J)}function Ht(t){if(null!=t){try{return Q.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(ht&&Lt(new ht(new ArrayBuffer(1)))!=y||mt&&Lt(new mt)!=d||pt&&Lt(pt.resolve())!=m||gt&&Lt(new gt)!=g||ft&&Lt(new ft)!=x)&&(Lt=function(t){var e=tt.call(t),s=e==h?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 m;case It:return g;case qt: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)&&!Wt(t)}var Kt=dt||function(){return!1};function Wt(t){var e=Ft(t)?tt.call(t):"";return e==c||e==u}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(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)}}(r,r.exports);var n=r.exports;const o=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,o(t)):i},set(e,s,i,r){const o=e[s];i=m(i)&&i.__isProxy?n(i):i;const a=Reflect.set(e,s,i,r);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${y(s)}Change`,i),a}}),a=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]"),c=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 u{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(`${a(t)}=${a(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])})),p(t.data)&&(t.data=t.data.buffer),(g(t.data)||l(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:a,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:c(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(a).forEach((t=>{null===r&&"content-type"===t.toLowerCase()?delete a[t]:null==d||d.setRequestHeader(t,a[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 d{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 d((e=>{t=e}));return{cancel:t,token:e}}}const l=Array.isArray,h=t=>null==t,m=t=>"object"==typeof t&&null!==t,p=t=>{let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e},g=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},f=()=>{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("")},v=(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},x=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,i]=[t[0],t[1]];if(null!==i)return m(i)&&!l(i)?(e[s]||(e[s]={}),void(e[s]=x(i,e[s]))):void(e[s]=i)})),e):e,b=/-(\w)/g,y=t=>t.replace(b,((t,e)=>e?e.toUpperCase():"")),{hasOwnProperty:I}=Object.prototype,q=(t,e)=>I.call(t,e),D=(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]=D(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,$=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,C;t.EVENT=void 0,(O=t.EVENT||(t.EVENT={})).STATE="state",O.FAILED="failed",O.BO_FAILED="boFailed",O.REQUEST_ERROR="requestError",O.POLLING_ERROR="pollingError",O.KEEPALIVE_ERROR="keepaliveError",O.BREAKOUT_ROOMS_STATE="breakoutRoomsState",t.STATE=void 0,(S=t.STATE||(t.STATE={}))[S.CLOSE=0]="CLOSE",S[S.JOINED=1]="JOINED",S[S.READY=2]="READY",t.BREAKOUT_ROOMS_STATE=void 0,(R=t.BREAKOUT_ROOMS_STATE||(t.BREAKOUT_ROOMS_STATE={}))[R.CLOSE=0]="CLOSE",R[R.JOINED=1]="JOINED",R[R.READY=2]="READY",t.ENDPOINT_TYPE=void 0,(T=t.ENDPOINT_TYPE||(t.ENDPOINT_TYPE={})).WEBAPP="webApp",T.WEBCTRL="webCtrl",T.WECHATMP="weChatMP",T.SUPERVISION="supervision",T.BIGSCREEN="bigScreen",T.DESKTOP="desktop",T.MOBILE="mobile",T.VCS="vcs",T.SIP="sip",T.H323="h323",T.PSTN="pstn",T.MULTI_STREAM="multiStream",T.MEETING_TOUCH="meetingTouch",T.MEETING_ROOMS="meetingRooms",T.RTSP="rtsp",T.RTMP_PULLER="rtmpPuller",T.GB28181="gb28181",T.TELE_PRESENCE="telePresence",T.RTSP_Access="rtspAccess",t.ROLE=void 0,(A=t.ROLE||(t.ROLE={})).HOST="host",A.COHOST="coHost",A.ATTENDEE="attendee",A.AUDIENCE="audience",t.RECORD_STATUS=void 0,(C=t.RECORD_STATUS||(t.RECORD_STATUS={})).STARTED="started",C.PAUSED="paused",C.STARTING="starting",C.STOPPED="stopped";class U{constructor(t,e){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=e,this.ctx=t,this.emitter=s(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},o(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},o(this.emitter))}cleanData(){this.data=new Proxy({},o(this.emitter))}reactiveData(t){if(!m(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=`${y(r)}Change`;this.emitter.on(o,n),e.set(o,n),m(t[r])&&!l(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class _ extends U{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)&&x(s,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;x({participantCount:e},this.data)}))}subject(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/info/subject`,t)}))}practiceSession(){return e(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})}getAllUserAgentWhiteList(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetingNum/${t}/allUserAgentWhiteList`,{params:{meetingID:s}})}getAllUserAudioEnergyList(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetingNum/${t}/allUserAudioEnergyList`,{params:{meetingID:s}})}}function w(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 k(t,s,i,r){return e(this,void 0,void 0,(function*(){const e=r.config.request.flag?`?flag=${r.config.request.flag}`:"",n=yield r.request.post(`/ypush/api/v1/meeting-control/inbox${e}`,{basic:{tenantId:100,clientId:i,meetingId:s},inboxes:t}),o=[];return n.data&&Object.keys(n.data).forEach((t=>{o.push({name:t,seqId:n.data[t].maxSeqId,limit:200})})),o}))}function N(t,s){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i,clientID:r,flag:n}=s.config.request,o=n?`?flag=${n}`:"";(new Date).getTime();const a=yield s.request.post(`${e}meetings/${i}/subscribe${o}`,{endpointID:r,topics:t}),c=a&&a.data&&a.data.eventMsgs;c&&c.forEach((t=>{["liveStream","recording","audioRecording","liveStreaming","checkIn"].includes(t.event)&&(t.stime=new Date(a.headers.date).getTime()),s.emitter.emit(t.event,t)}))}))}function P(t,s,i){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r,boClientID:n}=i.config.request,o=yield i.request.post(`${e}meetings/${r}/breakoutRooms/${t}/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(t,s,i){return e(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c,query:u=""}=s;if(yield(()=>e(this,void 0,void 0,(function*(){let e;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},d={cancelToken:a};try{e=yield t.post(`/ypush/api/v1/meeting-control/polling${u}`,s,d)}catch(m){return c.attempts+=1,void(m&&"request abort"!==m.type&&console.error(m))}if(!e)return console.error("polling error: ","response is null"),void(c.attempts+=1);const{data:l={},bizCode:h,error:m}=e;if(h&&900408!==h)return console.error("polling error: ",JSON.stringify(m)),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","checkIn"].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?$(c.attempts):0;c.timer=setTimeout((()=>{c.running&&M(t,s,i)}),d)}))}function L(t,s,i){return e(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c}=s;if(yield(()=>e(this,void 0,void 0,(function*(){let e;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},u={cancelToken:a};try{e=yield t.post("/ypush/api/v1/meeting-control/polling?bo=1",s,u)}catch(h){return c.boAttempts+=1,void(h&&"request abort"!==h.type&&console.error(h))}if(!e)return console.error("[Meeting] boPolling error: ","response is null"),void(c.attempts+=1);const{data:d={},bizCode:l,error:h}=e;if(l&&900408!==l)return console.error("[Meeting] boPolling error: ",JSON.stringify(h)),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?$(c.boAttempts):0;c.boTimer=setTimeout((()=>{c.running&&L(t,s,i)}),u)}))}const j=(e,s)=>{const{meetingID:i,clientID:r,flag:n}=s.config.request,o=n?`?flag=${n}`:"";s.status.polling.running=!0,M(s.request,{inboxes:e,clientID:r,meetingID:i,cancelToken:s.config.request.cancelToken.token,status:s.status.polling,query:o,onError(e){s.emitter.emit(t.EVENT.POLLING_ERROR,e)}},(t=>new Promise((e=>{var i;s.emitter.emit(t.event,t),void 0!==(null===(i=t.body)||void 0===i?void 0:i.seq)&&s.emitter.emit("eventSeqChange",{event:t.event,seq:t.body.seq}),e()}))))},B=(e,s)=>{const{boMeetingID:i,boClientID:r}=s.config.request;L(s.request,{inboxes:e,clientID:r,meetingID:i,cancelToken:s.config.request.cancelToken.token,status:s.status.polling,onError(e){s.emitter.emit(t.EVENT.POLLING_ERROR,e)}},(t=>{s.emitter.emit(t.event,t)}))};function H(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=d.source()}function V(t,s){return e(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(()=>e(this,void 0,void 0,(function*(){let e;try{e=yield t.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(!e)return;const{data:s={},bizCode:a,error:d,headers:l}=e;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 h=s.interval||"";if(!h)return n.attempts+=1,void console.error("keepalive ",a,d);n.interval=h,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?$(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&V(t,s)}),d)}))}function G(e){const{meetingID:s,userID:i,flag:r}=e.config.request,n=r?`?flag=${r}`:"";e.status.keepalive.running=!0,V(e.request,{meetingID:s,userID:i,cancelToken:e.config.request.cancelToken.token,status:e.status.keepalive,query:n,onError(s){e.emitter.emit(t.EVENT.KEEPALIVE_ERROR,s)},onRegionChange(t){e.emitter.emit("regionChange",t)}})}const Y=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)},K=(t,s,i)=>e(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 e(void 0,void 0,void 0,(function*(){let e;try{e=yield t.post(`/meeting-ctrl/api/v1/meetings/${r}/eventsSeq`,{events:o})}catch(n){return void console.error(n)}if(!e)return;const{data:s={}}=e;s&&i(s)})),!n.running)return;n.timer=setTimeout((()=>{n.running&&K(t,s,i)}),1e3*n.interval)})),W=t=>{t.status.eventsSeq.running=!1,t.status.eventsSeq.timer&&(clearTimeout(t.status.eventsSeq.timer),t.status.eventsSeq.timer=null)};var F,J,X,z;t.MeEvent=void 0,(F=t.MeEvent||(t.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.MAINVENUE="mainVenue",F.LEAVE="leave";class Q extends U{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const s=s=>e(this,void 0,void 0,(function*(){if("role"in s&&s.role!==this.data.role&&s.role){const e=this.data.role;x({role:s.role},this.data),s.role!==t.ROLE.AUDIENCE&&e!==t.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(t.MeEvent.ROLECHANGE,s.role),this.ctx.emitter.emit(t.MeEvent.ROLECHANGE,s.role)}})),i=e=>{var s,i,r,n,o,a,c,u,d,l;if("audio"in e&&e.audio){const{deviceOn:m,sendOn:p,recvOn:g,opBy:f}=e.audio;if(!h(m)&&m!==(null===(s=this.data.audio)||void 0===s?void 0:s.deviceOn)||!h(p)&&p!==(null===(i=this.data.audio)||void 0===i?void 0:i.sendOn)||!h(g)&&g!==(null===(r=this.data.audio)||void 0===r?void 0:r.recvOn)||!h(f)&&f!==(null===(n=this.data.audio)||void 0===n?void 0:n.opBy)){const s={deviceOn:null===(o=this.data.audio)||void 0===o?void 0:o.deviceOn,sendOn:null===(a=this.data.audio)||void 0===a?void 0:a.sendOn,recvOn:null===(c=this.data.audio)||void 0===c?void 0:c.recvOn};x({audio:e.audio},this.data);const i={deviceOn:h(m)?null===(u=this.data.audio)||void 0===u?void 0:u.deviceOn:m,sendOn:!!(h(p)?null===(d=this.data.audio)||void 0===d?void 0:d.sendOn:p),recvOn:h(g)?null===(l=this.data.audio)||void 0===l?void 0:l.recvOn:g,opBy:f,changeData:Object.assign({},e.audio),oldData:s};this.emitter.emit(t.MeEvent.AUDIOCHANGE,i)}}},r=e=>{var s,i,r,n,o,a,c,u,d;if("video"in e&&e.video){const{deviceOn:l,sendOn:m,opBy:p,blocked:g}=e.video;if(!h(l)&&l!==(null===(s=this.data.video)||void 0===s?void 0:s.deviceOn)||!h(m)&&m!==(null===(i=this.data.video)||void 0===i?void 0:i.sendOn)||!h(g)&&g!==(null===(r=this.data.video)||void 0===r?void 0:r.blocked)){const s={deviceOn:null===(n=this.data.video)||void 0===n?void 0:n.deviceOn,sendOn:null===(o=this.data.video)||void 0===o?void 0:o.sendOn,blocked:null===(a=this.data.video)||void 0===a?void 0:a.blocked};x({video:e.video},this.data);const i={deviceOn:h(l)?null===(c=this.data.video)||void 0===c?void 0:c.deviceOn:l,sendOn:!!(h(m)?null===(u=this.data.video)||void 0===u?void 0:u.sendOn:m),blocked:h(g)?null===(d=this.data.video)||void 0===d?void 0:d.blocked:g,opBy:p,changeData:Object.assign({},e.video),oldData:s};this.emitter.emit(t.MeEvent.VIDEOCHANGE,i)}}},n=e=>{var s,i,r,n,o,a,c,u;if("share"in e&&e.share){const{deviceOn:o,sendOn:a,opBy:c}=e.share;if(!h(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.deviceOn)||!h(a)&&a!==(null===(i=this.data.share)||void 0===i?void 0:i.sendOn)){x({share:e.share},this.data);const s={deviceOn:h(o)?null===(r=this.data.share)||void 0===r?void 0:r.deviceOn:o,sendOn:!!(h(a)?null===(n=this.data.share)||void 0===n?void 0:n.sendOn:a),opBy:c};this.emitter.emit(t.MeEvent.SHARECHANGE,s)}}if("whiteboard"in e&&e.whiteboard){const{deviceOn:s,sendOn:i,opBy:r}=e.whiteboard;if(!h(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.deviceOn)||!h(i)&&i!==(null===(a=this.data.whiteboard)||void 0===a?void 0:a.sendOn)){x({whiteboard:e.whiteboard},this.data);const n={deviceOn:h(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.deviceOn:s,sendOn:!!(h(i)?null===(u=this.data.whiteboard)||void 0===u?void 0:u.sendOn:i),opBy:r};this.emitter.emit(t.MeEvent.WHITEBOARDCHANGE,n)}}},o=e=>{e.displayName&&e.displayName!==this.data.displayName&&(x({displayName:e.displayName},this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.emitter.emit(t.MeEvent.DISPLAYNAMECHANGE,e.displayName))},a=e=>{"isHandUp"in e&&e.isHandUp!==this.data.isHandUp&&(x({isHandUp:e.isHandUp},this.data),this.emitter.emit(t.MeEvent.HANDUPCHANGE,!!e.isHandUp))},c=e=>{"isSpotlightVideo"in e&&(x({isSpotlightVideo:e.isSpotlightVideo},this.data),this.emitter.emit(t.MeEvent.SPOTLIGHTVIDEOCHANGE,!!e.isSpotlightVideo))},u=s=>e(this,void 0,void 0,(function*(){if("isInLobby"in s&&s.isInLobby!==this.data.isInLobby){x({isInLobby:s.isInLobby},this.data);const e=!1===s.isInLobby?"inLobbyChange":void 0;yield this.rePolling(e),this.emitter.emit(t.MeEvent.LOBBYCHANGE,!!s.isInLobby),this.ctx.emitter.emit(t.MeEvent.LOBBYCHANGE,!!s.isInLobby)}})),d=e=>{const{event:s,state:i,body:r}=e;"personalLayout"===s&&(["update","full"].includes(i)?x({personalLayout:r},this.data):"delete"===i&&(this.data.personalLayout=void 0),this.emitter.emit(t.MeEvent.PERSONALLAYOUTCHANGE,this.data.personalLayout))},l=e=>{if(!e.barrage)return;let s=null;if(!e.barrage.wordsDisplayStatus)return s=null,delete e.barrage,this.data.barrage=s||void 0,void this.emitter.emit(t.MeEvent.BARRAGECHANGE,s);if(!e.barrage.receiver)return;const i={content:e.barrage.content,contentType:e.barrage.contentType,type:e.barrage.type,duration:e.barrage.duration,position:e.barrage.position,enableMultiLine:e.barrage.enableMultiLine,effect:e.barrage.effect};s=i;let{role:r}=this.data;if(this.data.endpointType===t.ENDPOINT_TYPE.SUPERVISION){const{info:e}=this.ctx.modules;r="webinar"===e.meetingType?t.ROLE.AUDIENCE:t.ROLE.ATTENDEE}if(r===t.ROLE.HOST||r===t.ROLE.COHOST?s=e.barrage.receiver.host?i:null:r===t.ROLE.ATTENDEE?s=e.barrage.receiver.attendee?i:null:r===t.ROLE.AUDIENCE&&(s=e.barrage.receiver.audience?i:null),!s&&e.barrage.receiver.designated){const{userID:t,subjectID:r}=this.data,{designatedUsers:n=[]}=e.barrage;s=-1!==n.findIndex((e=>e.userID===t||r&&e.subjectID===r))?i:null}delete e.barrage,this.data.barrage=s||void 0,this.emitter.emit(t.MeEvent.BARRAGECHANGE,s)},m=e=>{"perm"in e&&(x({perm:e.perm},this.data),this.emitter.emit(t.MeEvent.PERMCHANGE,e.perm))},p=e=>{"translationChannel"in e&&(x({translationChannel:e.translationChannel},this.data),this.emitter.emit(t.MeEvent.TRANSLATIONCHANNELCHANGE,e.translationChannel))},g=e=>{"mainVenue"in e&&(x({mainVenue:e.mainVenue},this.data),this.emitter.emit(t.MeEvent.MAINVENUE,e.mainVenue))},f=e=>{"leave"in e&&!0===e.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),H(this.ctx),Y(this.ctx),lt(this.ctx),this.emitter.emit(t.MeEvent.LEAVE,e.resultInfo),this.ctx.cleanup(e.resultInfo))},v=e=>{s(e),i(e),r(e),n(e),o(e),a(e),u(e),c(e),l(e),m(e),p(e),g(e),f(e),(this.data.isInLobby||this.data.role===t.ROLE.AUDIENCE)&&this.data.share&&this.data.share.sendOn&&n({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),(this.data.isInLobby||this.data.role===t.ROLE.AUDIENCE)&&this.data.whiteboard&&this.data.whiteboard.sendOn&&n({whiteboard:{sendOn:!1}})};this.ctx.emitter.on(t.MeEvent.INIT,(t=>{x(t,this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.bid&&(n({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),n({whiteboard:{sendOn:!1}})),this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(t.MeEvent.UPDATE,(t=>{v(t),x(t,this.data)})),this.ctx.emitter.on(t.EVENT.STATE,(({state:e})=>{e===t.STATE.READY&&this.data.endpointType!==t.ENDPOINT_TYPE.SUPERVISION&&this.emitter.emit(t.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 f(t)}let i=s.users.find((t=>t.userID===this.data.userID));i||s.users.length&&(i=s.users[0]),i?(v(i),x(i,this.data)):console.warn("me ",e,s)})),this.ctx.emitter.on("setUserVideo",(e=>{this.emitter.emit(t.MeEvent.SETVIDEO,e.body)})),this.ctx.emitter.on("setUserAudio",(e=>{this.emitter.emit(t.MeEvent.SETAUDIO,e.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){f({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{d(t)})),this.ctx.emitter.on("boSwitchNotify",(e=>{this.emitter.emit(t.MeEvent.BOSWITCHNOTIFY,e.body)})),this.ctx.emitter.on("boReturnMeetingNotify",(e=>{this.emitter.emit(t.MeEvent.BORETURNMEETINGNOTIFY,e.body)})),this.ctx.emitter.on("topMC",(e=>{const{body:s={}}=e;this.data.mediaContent&&this.data.mediaContent.topMCSeq!==s.seq&&(this.data.mediaContent.topMC=s.topMC,this.data.mediaContent.topMCSeq=s.seq,this.emitter.emit(t.MeEvent.TOPMCCHANGE,{topMC:this.data.mediaContent.topMC,topMCSeq:this.data.mediaContent.topMCSeq}))}))}notifyUpdateUserState(e){this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e})}updateUserState(e,s=!1){if(!s){const{role:s,initialMediaState:i}=this.data;e.audio.sendOn=e.audio.sendOn&&i.audio.sendOn,e.video.sendOn=e.video.sendOn&&i.video.sendOn,s===t.ROLE.AUDIENCE&&(e.audio.sendOn=!1,e.video.sendOn=!1)}const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,x(e,this.data),this.ctx.request.post(`${i}meetings/${r}/updateUserState`,e)}boUpdateUserState(s,i,r=!1){return e(this,void 0,void 0,(function*(){if(!r){const{role:e,initialMediaState:s}=this.data;i.audio.sendOn=i.audio.sendOn&&s.audio.sendOn,i.video.sendOn=i.video.sendOn&&s.video.sendOn,e===t.ROLE.AUDIENCE&&(i.audio.sendOn=!1,i.video.sendOn=!1)}this.data.isUpdatedUserState=!0;const{prefix:{ctrl:e},meetingID:n}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${n}/breakoutRooms/${s}/updateUserState`,i)}))}rePolling(s){return e(this,void 0,void 0,(function*(){const{ctx:e}=this;H(e);const i=w(e),r=yield k(i,e.config.request.meetingID,e.config.request.clientID,e);if("inLobbyChange"===s&&Object.keys(e.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(t)&&e.modules[t].cleanData(!0)})),s&&this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,{data:this.data,event:s}),yield N(i,e),"undefined"!=typeof Worker&&e.worker){const{meetingID:t,clientID:s,userID:n}=e.config.request;e.worker.postMessage({inboxes:r,topics:i,clientID:s,meetingID:t,userID:n,rePolling:!0})}else j(r,e)}))}}t.BoHelpOpReason=void 0,(J=t.BoHelpOpReason||(t.BoHelpOpReason={}))[J.Cancel=1]="Cancel",J[J.Accept=2]="Accept",J[J.Refuse=3]="Refuse",t.BreakoutRoomStatus=void 0,(X=t.BreakoutRoomStatus||(t.BreakoutRoomStatus={}))[X.NotStarted=0]="NotStarted",X[X.Opened=1]="Opened",X[X.Ending=2]="Ending",X[X.Ended=3]="Ended",t.BoHelpAction=void 0,(z=t.BoHelpAction||(t.BoHelpAction={})).Request="request",z.Cancel="cancel",z.Accept="accept",z.Refuse="refuse";const Z={status:0,subjectIndex:0,timerDuration:0,waitSeconds:0,allowChooseRoom:!1,allowReturnToMeeting:!1,autoJoinEnabled:!1,timerEnabled:!1,isTimerAutoEnd:!1,timerDurationEnabled:!1};class tt extends U{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=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=tt.setUserGroupIDs?tt.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?x(t,this.data.callRecordUsers[e]):"update"===s&&-1===e&&(t.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=tt.setUserGroupIDs?tt.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)}inviteAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/inviteAll`)}}class et extends U{constructor(t){super(t,"leaveUsers")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("leaveUsers",(t=>{const{state:e,body:s}=t;if(s){if("full"===e)return this.data.users=s.users.map((t=>(t.displayNamePinyin=et.setDisplayNamePinyinProp?et.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=et.setUserGroupIDs?et.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,t))),void this.emitter.emit("leaveUsersChange",this.data.users);this.data.users||(this.data.users=[]),s.users.forEach((t=>{const s=this.data.users.findIndex((e=>t.userID===e.userID));"update"===e&&-1!==s?x(t,this.data.users[s]):"update"===e&&-1===s&&(t.displayNamePinyin=et.setDisplayNamePinyinProp?et.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=et.setUserGroupIDs?et.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.users.push(t))})),this.emitter.emit("leaveUsersChange",this.data.users)}}))}cleanup(){this.emitter.all=new Map}}class st extends U{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[],boInteractiveUsers:[]}}_topic(){const{role:e,endpointType:s}=this.ctx.modules.me.data;return s===t.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:e===t.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const e=(e,{event:s,state:i})=>{if(e.userID!==this.ctx.modules.me.data.userID)return;if(this.ctx.breakoutRoomsState!==t.BREAKOUT_ROOMS_STATE.CLOSE&&"boInteractiveUsers"!==s)return;const{resultInfo:r={}}=e;if("delete"!==i||"delete"===i&&[901357,901358,901352,901351,901350,901349].includes((null==r?void 0:r.bizCode)||-1))return void this.ctx.emitter.emit(t.MeEvent.UPDATE,e);let n=!1;switch(s){case"interactiveUsers":case"boInteractiveUsers":e.isInLobby||(n=!0);break;case"broadcastUsers":e.isInLobby||e.role!==t.ROLE.AUDIENCE||(n=!0);break;case"lobbyUsers":e.isInLobby&&(n=!0)}const o={};n&&(o.leave=!0),this.ctx.emitter.emit(t.MeEvent.UPDATE,Object.assign(Object.assign({},e),o))},s=({updateUsers:t,state:s,sourceKey:i})=>{if("full"===s)return this.data[i]=t.map((t=>(t.displayNamePinyin=st.setDisplayNamePinyinProp?st.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=st.setUserGroupIDs?st.setUserGroupIDs(t.groupIDs||[],t.endpointType):t.groupIDs,e(t,{event:i,state:s}),t))),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 t.forEach((t=>{const o=r[i].findIndex((e=>t.userID===e.userID));if("delete"===s&&-1!==o){const[e]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:e,resultInfo:t.resultInfo})}else if("update"===s&&-1!==o){const e=this.data[i][o];this.updateUserProps(t,e),x(t,e),this.data[i][o]=D(e),this.emitter.emit(`${i}Update`,{user:this.data[i][o]})}else"update"===s&&-1===o&&(t.displayNamePinyin=st.setDisplayNamePinyinProp?st.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=st.setUserGroupIDs?st.setUserGroupIDs(t.groupIDs||[],t.endpointType):t.groupIDs,r[i].push(t),this.emitter.emit(`${i}Add`,{user:t,resultInfo:t.resultInfo}));e(t,{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:e,body:i,isBreakoutRooms:r=!1}=t;s(r?{updateUsers:i.users,state:e,sourceKey:"boInteractiveUsers"}:{updateUsers:i.users,state:e,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:e,body:i}=t;s({updateUsers:i.users,state:e,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:e,body:i}=t;s({updateUsers:i.users,state:e,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:e,body:i}=t;s({updateUsers:i.users,state:e,sourceKey:"advCtrlUsers"})})),this.ctx.emitter.on("userNotify",(t=>{const{body:e}=t;this.emitter.emit("userNotify",e)}))}reactiveData(t){if(!m(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=`${y(r)}Change`;this.emitter.on(o,n),e.set(o,n),m(t[r])&&!l(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=st.setDisplayNamePinyinProp?st.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`)}transferMeeting(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/transfer`,e)}transferMeetingBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transferBatch`,t)}getVideoPreview(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}/videoPreview`)}getSharePreview(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}/sharePreview`)}setMainVenue(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/setMainVenue`,e)}}function it(e){const i=function(e){const{baseURL:i,modules:r,worker:n,singleton:o,eventsSeq:a,filterTopics:c=[]}=e;r.findIndex((t=>t===Q))<0&&r.push(Q),r.findIndex((t=>t===_))<0&&r.push(_);const l=e.clientID||`${f()}_${v(new Date,"MMddHHmmss")}`,h={config:{baseURL:i,modules:r,singleton:o||!1,eventsSeq:a||!1,filterTopics:c,request:{cancelToken:d.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:l,boClientID:`${l}_${v(new Date,"MMddHHmmss")}`,location:"",meetingID:"",boMeetingID:"",ctrlID:"",boCtrlID:"",sessionID:"",userID:-1,voteTk:"",credential:"",multiActiveRegion:"",flag:""}},worker:n,emitter:s(),request:new u({baseURL:i,beforeRequest(t){t.headers["X-Y-Request-Id"]=f(),t.timeout=18e5},error(e){h.emitter.emit(t.EVENT.REQUEST_ERROR,e)}}),modules:{},state:t.STATE.CLOSE,breakoutRoomsState:t.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(e){h.state!==t.STATE.CLOSE&&(h.worker&&h.worker.terminate(),h.config.request.location="",h.config.request.meetingID="",h.config.request.boMeetingID="",h.config.request.ctrlID="",h.config.request.boCtrlID="",h.config.request.sessionID="",h.config.request.userID=-1,h.config.request.voteTk="",h.config.request.credential="",h.config.request.multiActiveRegion="",h.status.polling={running:!1,attempts:0,boAttempts:0,timer:null,boTimer:null},h.status.keepalive={running:!1,attempts:0,timer:null,interval:20},h.status.eventsSeq={running:!1,timer:null,interval:30},h.request.setDefaultHeader("X-Y-Location",""),h.request.setDefaultHeader("X-Y-Meeting-Region",""),h.request.setDefaultHeader("X-Y-Ctrl-Id",""),h.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(h.modules).forEach((t=>{h.modules[t].cleanup()})),h.state=t.STATE.CLOSE,h.emitter.emit(t.EVENT.STATE,{state:h.state,reason:e}))}};return h}(e);return i.worker&&("undefined"!=typeof Worker?i.worker.postMessage({baseURL:i.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!l(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}))}(i.config.modules,i),i.emitter.on(t.EVENT.POLLING_ERROR,(t=>{ot(i)({resultInfo:t})})),i.emitter.on(t.EVENT.KEEPALIVE_ERROR,(t=>{ot(i)({resultInfo:t})})),Object.assign({config:i.config,request:i.request,get state(){return i.state},get breakoutRoomsState(){return i.breakoutRoomsState},on:i.emitter.on,off:i.emitter.off,join:rt(i),boJoin:nt(i),boReturnMeeting:ct(i),leave:ot(i),end:at(i),endMeeting:ut(i)},i.modules)}function rt(s){return function(i){var r,n,o,a,c;return e(this,void 0,void 0,(function*(){const{clientID:u}=s.config.request,d=`${null===(r=i.endpointType)||void 0===r?void 0:r.toLocaleUpperCase()}${u}_${i.meetingNum}`;s.config.request.sessionID=d,s.request.setDefaultHeader("X-Y-Session-Id",d),s.request.setDefaultHeader("X-Y-Location","");const l=null!==(n=i.uccaRoute)&&void 0!==n?n:"",h=null!==(o=i.domain)&&void 0!==o?o:"";l&&s.request.setDefaultHeader("X-Y-Ucca-Route",l),h&&s.request.setDefaultHeader("X-Y-Domain",h),s.config.request.flag=null!==(a=i.flag)&&void 0!==a?a:"",i.flag&&delete i.flag;const m=s.config.request.flag?`&flag=${s.config.request.flag}`:"",p=s.config.request.flag?`?flag=${s.config.request.flag}`:"",g={meetingNum:i.meetingNum,pwd:i.pwd,url:i.url,mobileCode:i.mobileCode,mobile:i.mobile,regEmail:i.regEmail,accEmail:i.accEmail,tk:i.tk,displayName:i.displayName,userAgent:i.userAgent,verifyID:i.verifyID,tc:i.tc,t:i.t};i.tc&&(delete g.meetingNum,delete g.pwd),i.t&&delete g.pwd;const{prefix:f}=s.config.request,v={"X-Y-Endpoint-Type":i.endpointType};i.signId&&(v["X-Y-Sign-Id"]=i.signId);const x=yield s.request.get(`${f.ctrl}credential${p}`,{params:g,headers:v}),{credential:b="",location:y=""}=x&&x.data||{};if(s.config.request.location=y,s.request.setDefaultHeader("X-Y-Location",y),!b)return s.emitter.emit(t.EVENT.FAILED,{bizCode:x.bizCode,data:x.data}),x;delete i.pwd,delete i.url,s.config.request.credential=b;const I=x.data.multiActiveRegion;I&&(s.config.request.multiActiveRegion=I,s.request.setDefaultHeader("X-Y-Meeting-Region",I));const q={displayName:i.displayName,userAgent:i.userAgent,clientID:u,avatarURL:i.avatarURL};i.groupIDs&&i.account&&(q.groupIDs=i.groupIDs,q.account=i.account,q.groupName=i.groupName),i.mediaContentReq&&(q.mediaContentReq=i.mediaContentReq),i.taskID&&(q.taskID=i.taskID),q.avatarURL=i.avatarURL;const D=i.hostKey?`&hostKey=${i.hostKey}`:"",E={"X-Y-Endpoint-Type":i.endpointType,"X-Y-Endpoint-Id":u},$=yield s.request.post(`${f.ctrl}join?meetingNum=${i.meetingNum}&credential=${b}${D}${m}`,q,{headers:E});if(!$||$&&$.ret<=-1)return s.emitter.emit(t.EVENT.FAILED,{bizCode:$.bizCode,data:$.data}),$;const{meetingID:O="",ctrlID:S="",user:R={},mediaContent:T={},initialMediaState:A={},tk:C=""}=$.data;s.config.request.meetingID=O,s.config.request.ctrlID=S,s.config.request.userID=R.userID,s.config.request.voteTk=C,s.config.request.credential=b,s.config.request.multiActiveRegion=I,s.request.setDefaultHeader("X-Y-Ctrl-Id",S),s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},R),{mediaContent:T,initialMediaState:A})),s.state=t.STATE.JOINED,s.emitter.emit(t.EVENT.STATE,{state:s.state});const U=w(s);let _=[];try{_=yield k(U,O,u,s)}catch(H){return s.emitter.emit(t.EVENT.FAILED,{bizCode:401===(null==H?void 0:H.statusCode)?900403:900599,data:null!==(c=H.message)&&void 0!==c?c:"inbox error"}),$.data=Object.assign(Object.assign({},$.data),x.data),$}yield N(U,s);const P=()=>{s.state!==t.STATE.READY&&(s.state=t.STATE.READY,s.emitter.emit(t.EVENT.STATE,{state:s.state}))};s.status.eventMsgs=[];const M=t=>{const e=s.status.eventMsgs.find((e=>e.event===t.event));e&&(e.seq=t.seq)},L=t=>e(this,void 0,void 0,(function*(){const i=s.status.eventMsgs,r=[];if(t.eventMsgs.forEach((t=>{const{event:e,seq:n}=t,o=s.status.eventMsgs.find((t=>t.event===e));o?o.seq!==n&&r.push(e):i.push(t)})),r.length){const t=yield function(t,s,i){var r;return e(this,void 0,void 0,(function*(){let e=null,n=[];try{e=yield t.request.post(`/meeting-ctrl/api/v1/meetings/${s}/events`,{events:i})}catch(H){return console.error(H),n}if(!e)return n;const{data:o={}}=e;return o&&o.eventMsgs&&(n=null!==(r=o.eventMsgs)&&void 0!==r?r:[]),n}))}(s,O,r);t.forEach((t=>{var e;s.emitter.emit(t.event,t),void 0!==(null===(e=t.body)||void 0===e?void 0:e.seq)&&M({event:t.event,seq:t.body.seq})}))}}));s.emitter.on("eventSeqChange",M),s.emitter.on("eventsSeqChange",L);const[B]=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&&s.worker){s.status.polling.running=!0,s.status.keepalive.running=!0;const t={ctrlID:S,location:y,multiActiveRegion:I,sessionID:d,inboxes:_,topics:U,clientID:u,meetingID:O,userID:R.userID,status:!0,uccaRoute:l,domain:h};s.config.eventsSeq&&(t.events=B,t.eventsSeq=!0),s.worker.postMessage(t),s.worker.onmessage=t=>{var e;"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?L(t.data.eventsSeq):"object"==typeof t.data&&"region"in t.data||(s.emitter.emit(t.data.event,t.data),void 0!==(null===(e=t.data.body)||void 0===e?void 0:e.seq)&&M({event:t.data.event,seq:t.data.body.seq}))):ot(s)({resultInfo:{message:"keepalive Max Attempts"}}):ot(s)({resultInfo:{message:"polling Max Attempts"}}):s.status.eventsSeq.running=!1:s.status.keepalive.running=!1:s.status.polling.running=!1):P()}}else j(_,s),P(),G(s),s.config.eventsSeq&&((t,e)=>{const{meetingID:s}=t.config.request;t.status.eventsSeq.running=!0,K(t.request,{meetingID:s,status:t.status.eventsSeq,events:e},(e=>{t.emitter.emit("eventsSeqChange",e)}))})(s,B);return $.data=Object.assign(Object.assign({},$.data),x.data),$}))}}function nt(s){return function(i,r){return e(this,void 0,void 0,(function*(){if(s.state!==t.STATE.READY)return;const{prefix:{ctrl:e},clientID:n,meetingID:o}=s.config.request,a=`${n}_${v(new Date,"MMddHHmmss")}`;s.config.request.boClientID=a;const c=yield s.request.post(`${e}meetings/${o}/breakoutRooms/${i}/boJoin`,r,{headers:{"X-Y-Endpoint-Id":a}});if(!c||(null==c?void 0:c.ret)<=-1)return s.emitter.emit(t.EVENT.BO_FAILED,{bizCode:c.bizCode,data:{bid:i,resData:c.data,type:"boJoin"}}),c;H(s);const{boCtrlID:u="",meetingID:d="",user:l={},mediaContent:h={},initialMediaState:m={}}=c.data;s.config.request.boMeetingID=d,s.config.request.boCtrlID=u,Object.keys(s.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(t)&&s.modules[t].cleanData()})),s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},l),{boMediaContent:h,initialMediaState:m}));const p=["meeting","interactive","lobby"],g=["interactive","bo","hostAttendee"],[f,x]=yield Promise.all([k(p,o,n,s),k(g,d,a,s)]);return s.breakoutRoomsState=t.BREAKOUT_ROOMS_STATE.JOINED,s.emitter.emit(t.EVENT.BREAKOUT_ROOMS_STATE,t.BREAKOUT_ROOMS_STATE.JOINED),yield Promise.all([N(p,s),P(i,g,s)]),j(f,s),B(x,s),s.modules.me.notifyUpdateUserState(),s.breakoutRoomsState=t.BREAKOUT_ROOMS_STATE.READY,s.emitter.emit(t.EVENT.BREAKOUT_ROOMS_STATE,t.BREAKOUT_ROOMS_STATE.READY),c}))}}function ot(t){return function(s){return e(this,void 0,void 0,(function*(){const e=s&&s.resultInfo;s||(s={resultInfo:{bizCode:901359}});const{prefix:i,meetingID:r}=t.config.request,n=t.config.request.flag?`?flag=${t.config.request.flag}`:"";let o;try{o=yield t.request.post(`${i.ctrl}meetings/${r}/leave${n}`,s)}catch(a){console.error(a)}return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1,eventsSeq:!1}),H(t),Y(t),W(t),lt(t),t.cleanup(e),o}))}}function at(t){return function(){return e(this,void 0,void 0,(function*(){const{prefix:e,meetingID:s}=t.config.request,i=t.config.request.flag?`?flag=${t.config.request.flag}`:"",r=yield t.request.post(`${e.ctrl}meetings/${s}/end${i}`);return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1,eventsSeq:!1}),H(t),Y(t),W(t),lt(t),t.cleanup(),r}))}}function ct(s){return function(i){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=s.config.request;"undefined"!=typeof Worker&&s.worker&&s.worker.postMessage({status:!1,eventsSeq:!1});const n=yield s.request.post(`${e}meetings/${r}/breakoutRooms/${i}/boReturnMeeting`);if(!n||(null==n?void 0:n.ret)<=-1)return s.emitter.emit(t.EVENT.BO_FAILED,{bizCode:n.bizCode,data:{bid:i,resData:n.data,type:"boReturnMeeting"}}),n;H(s),Object.keys(s.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms","users"].includes(t)&&s.modules[t].cleanData()})),s.config.request.boCtrlID="",s.config.request.boMeetingID="",s.breakoutRoomsState=t.BREAKOUT_ROOMS_STATE.CLOSE,s.emitter.emit(t.EVENT.BREAKOUT_ROOMS_STATE,t.BREAKOUT_ROOMS_STATE.CLOSE);const{user:o={},mediaContent:a={},initialMediaState:c={}}=n.data;s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},o),{boMediaContent:{},mediaContent:a,initialMediaState:c}));const u=w(s),d=yield k(u,r,s.config.request.clientID,s);return yield N(u,s),j(d,s),s.modules.me.notifyUpdateUserState("bo"),n}))}}function ut(t){return function(s){return e(this,void 0,void 0,(function*(){const{prefix:e}=t.config.request;return yield t.request.post(`${e.ctrl}meetingNum/${s}/end`)}))}}class dt{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=it(t)}static getInstance(t){return this.instance?this.instance:this.instance=new dt(t)}}function lt(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=dt.getInstance(r);n&&(n.meeting=it(r))}}return Object.defineProperty(dt,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),t.Asr=class extends U{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),x(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)}},t.AudioRecording=class extends U{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 e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/audioRecording/status`,t)}))}},t.BreakoutRooms=class extends U{constructor(t){super(t,"breakoutRooms"),this.data={option:Z,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:Z,items:[]},this.cleanData()}cleanData(t=!1){t&&(this.data.option=Z,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})}},t.Chat=class extends U{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)}},t.CheckIn=class extends U{constructor(t){super(t,"checkIn")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("checkIn",(t=>{const{state:e,body:s,stime:i}=t;s&&(s.resultInfo&&(this.emitter.emit("resultInfoChange",s.resultInfo),delete s.resultInfo),s.status&&i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),["full","update"].includes(e)&&(this.data.checkIn=s))}))}cleanup(){this.emitter.all=new Map}start(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/checkIn/start`,t)}end(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/checkIn/end`,t)}records(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${e}/checkIn/records`)}details(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/checkIn/details`,{params:t})}getCheckInData(){var t;return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;let i=[],r=null;try{r=yield this.ctx.request.post(`${e}meetings/${s}/events`,{events:["checkIn"]})}catch(o){return console.error(o),i}if(!r)return i;const{data:n={}}=r;return n&&n.eventMsgs&&(i=null!==(t=n.eventMsgs)&&void 0!==t?t:[]),i.forEach((({event:t,body:e})=>{"checkIn"===t&&(this.data.checkIn=e,this.emitter.emit("checkInChange",this.data.checkIn))})),i}))}},t.ExclusiveLayout=class extends U{constructor(t){super(t,"exclusiveLayout")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("exclusiveLayout",(t=>{const{state:e,body:s}=t;s&&(["full","update"].includes(e)&&x(s,this.data),this.emitter.emit("exclusiveLayoutChange",this.data))}))}cleanup(){this.emitter.all=new Map}applyExclusiveLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/exclusiveLayout`,t)}))}},t.FocusUsers=class extends U{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)}},t.Info=_,t.Interpretation=class extends U{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`)}},t.Invite=tt,t.LeaveUsers=et,t.LiveStream=class extends U{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 x({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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/status`,t)}))}liveStreamDescription(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/description`,t)}))}liveStreamSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/setting`,t)}))}liveStreamDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/delete`,t)}))}liveStreamLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/layout`,t)}))}liveStreamAllow(){return e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/pushSetting`,t)}))}},t.LiveStreaming=class extends U{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 x({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&&x({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}))}setStatus(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/status`,t)}))}liveStreamingSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/setting`,t)}))}liveStreamingDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/delete`,t)}))}liveStreamingDetail(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/detail`,t)}))}},t.Me=Q,t.Qa=class extends U{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;m(e)&&!l(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)}},t.RTSP=class extends U{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)}},t.Recording=class extends U{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 e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/status`,t)}))}layout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/status`,t)}))}designatedUsers(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/designatedUsers`,t)}))}participantAdd(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/recording/participant/add`,t)}))}participantDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/recording/participant/delete`,t)}))}getTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getTemplates`,{params:t})}))}getByIds(t){return e(this,void 0,void 0,(function*(){const{prefix:{user:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/subject/getByIds`,t)}))}recordLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/layout`,t)}))}},t.RemoteDesktop=class extends U{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)}},t.RollCall=class extends U{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)}},t.Setting=class extends U{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)&&x(s,this.data)}))}reactiveData(t){if(!m(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=`${y(n)}Change`;this.emitter.on(i,s),e.set(i,s)}if(m(t[n])&&!l(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/setting`,t)}))}muteAll(){return e(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 e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/breakoutRooms/${t}/muteAll`)}))}boUnmuteAll(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/breakoutRooms/${t}/unmuteAll`)}))}},t.ShouldJoinUsers=class extends U{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`)}},t.SpotlightVideo=class extends U{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(e=>{var s;const{body:i}=e;if(!i||!i.userIDs)return;this.data.userIDs=i.userIDs,this.data.broadcast=null!==(s=i.broadcast)&&void 0!==s?s:null;i.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(t.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(t.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)}},t.Transcript=class extends U{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)}},t.Users=st,t.View=class extends U{constructor(t){super(t,"view")}_topic(){const{endpointType:e,role:s}=this.ctx.modules.me.data;return e===t.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:s===t.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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/hostLayout`,t)}))}attendeeLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/attendeeLayout`,t)}))}audienceLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/audienceLayout`,t)}))}personalLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/personalLayout`,t)}))}personalLayoutDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/personalLayout/delete`,t)}))}virtualClassLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/virtualClass/layout`,t)}))}closeVirtualClass(){return e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/layout/template/info`,{params:t})}))}addVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/layout/template/add`,t)}))}editVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/layout/template/edit`,t)}))}getTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getTemplates`,{params:t})}))}editTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/edit`,t)}))}addTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/add`,t)}))}deleteTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/delete`,t)}))}getDefaultTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getDefaultTemplates`,{params:t})}))}changeDefaultTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/changeDefaultTemplate`,t)}))}perspectiveBind(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/perspective/bind`,t)}))}setSavedBackground(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/recentBackgroundFile`,t)}))}getSavedBackground(){return e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.get(`${e}meetings/${s}/view/presetLayout`,{params:t})}))}setPresetLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout`,t)}))}presetLayoutApply(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout/apply`,t)}))}presetLayoutApplyUser(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout/applyUser`,t)}))}presetLayoutApplyUserBatch(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout/applyUserBatch`,t)}))}},t.Vote=class extends U{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(t.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)}meetingVoteAdd(t){const{prefix:{vote:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/vote/add`,t)}meetingVoteEdit(t){const{prefix:{vote:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/vote/edit`,t)}meetingVoteDelete(t){const{prefix:{vote:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/vote/delete`,t)}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}})}},t.Words=class extends U{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){const e=()=>{this.data.wordsDisplayStatus=!1,this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})};this.ctx.emitter.on("meetingBarrage",(s=>{this.data.timer&&clearTimeout(this.data.timer),this.data.timerMap||(this.data.timerMap={});const{state:i,body:r,pollingSeqId:n}=s;if("delete"===i)return r&&r.indexes&&(this.data.list=this.data.list.filter((t=>!r.indexes.includes(t.index)))),e(),void this.emitter.emit("barrageWordChange",this.data);if("full"===i){if(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&(this.data.barrageRecord.length=10),r.list){const t=[];r.list.forEach((e=>{var s,i,r,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:n,content:null!==(r=e.content)&&void 0!==r?r:"",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,h=e.index;if(this.data.timerMap){const t=this.data.timerMap[h];t&&clearTimeout(t),-1!==l&&(this.data.timerMap[h]=setTimeout((()=>{this.data.timerMap&&(this.data.timerMap[h]=null),this.data.list=this.data.list.filter((t=>t.index!==h)),this.emitter.emit("barrageWordChange",this.data)}),1e3*l))}}})),this.data.barrageRecord=[...t,...this.data.barrageRecord]}else if(n){const t=r.timestamp?Number.parseInt(r.timestamp):(new Date).getTime();this.data.barrageRecord=[{index:1,id:n,content:r.content,time:t,timestamp:t,durationType:r.durationType,duration:1e3*r.duration},...this.data.barrageRecord]}r.wordsDisplayStatus=!0,-1!==r.duration&&(this.data.timer=setTimeout((()=>{r.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=r.wordsDisplayStatus,this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})}),1e3*r.duration)),x(r,this.data),this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data}),this.emitter.emit("barrageWordChange",this.data)}})),this.ctx.emitter.on(t.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})))}barrage(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/barrage`,t)}))}deleteBarrage(t={indexes:[]}){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/deleteBarrage`,t)}))}},t.createMeeting=function(t){return t.singleton?dt.getInstance(t).meeting:it(t)},t.reset=lt,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
1
+ var YlinkSDKMeeting=function(t){"use strict";function e(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 s(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)}))}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};!function(t,e){var s="__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]",h="[object Object]",m="[object Promise]",p="[object RegExp]",g="[object Set]",f="[object String]",v="[object Symbol]",x="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",D="[object Int8Array]",E="[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]=_[I]=_[q]=_[D]=_[E]=_[$]=_[d]=_[l]=_[h]=_[p]=_[g]=_[f]=_[v]=_[O]=_[S]=_[R]=_[T]=!0,_["[object Error]"]=_[c]=_[x]=!1;var N="object"==typeof self&&self&&self.Object===Object&&self,w="object"==typeof i&&i&&i.Object===Object&&i||N||Function("return this")(),k=e&&!e.nodeType&&e,P=k&&t&&!t.nodeType&&t,M=P&&P.exports===k;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,W=Array.prototype,F=Function.prototype,J=Object.prototype,X=w["__core-js_shared__"],z=(K=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",Q=F.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Q.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=M?w.Buffer:void 0,it=w.Symbol,rt=w.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),ht=Pt(w,"DataView"),mt=Pt(w,"Map"),pt=Pt(w,"Promise"),gt=Pt(w,"Set"),ft=Pt(w,"WeakMap"),vt=Pt(Object,"create"),xt=Ht(ht),bt=Ht(mt),yt=Ht(pt),It=Ht(gt),qt=Ht(ft),Dt=it?it.prototype:void 0,Et=Dt?Dt.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,m,x){var C;if(i&&(C=m?i(t,r,m,x):i(t)),void 0!==C)return C;if(!Ft(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 N=Lt(t),w=N==c||N==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(N==h||N==n||w&&!m){if(H(t))return m?t:{};if(C=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:(e=nt(t),Ft(e)?ot(e):{});var e}(w?{}:t),!e)return function(t,e){return wt(t,Mt(t),e)}(t,function(t,e){return t&&wt(e,Jt(e),t)}(C,t))}else{if(!_[N])return m?t:{};C=function(t,e,s,i){var r=t.constructor;switch(e){case b:return Nt(t);case o:case a:return new r(+t);case y:return function(t,e){var s=e?Nt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}(t,i);case I:case q:case D:case E:case $:case O:case S:case R:case T:return function(t,e){var s=e?Nt(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 p: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,Et?Object(Et.call(n)):{}}var n}(t,N,Ut,e)}}x||(x=new Rt);var k=x.get(t);if(k)return k;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,Jt,Mt)}(t):Jt(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!(!Ft(t)||(e=t,z&&z in e))&&(Wt(t)||H(t)?et:C).test(Ht(t));var e}function Nt(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}function wt(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 kt(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 i=e[t];return i===s?void 0:i}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?s: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(mt||Ot),string:new $t}},St.prototype.delete=function(t){return kt(this,t).delete(t)},St.prototype.get=function(t){return kt(this,t).get(t)},St.prototype.has=function(t){return kt(this,t).has(t)},St.prototype.set=function(t,e){return kt(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(!mt||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||J)}function Ht(t){if(null!=t){try{return Q.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(ht&&Lt(new ht(new ArrayBuffer(1)))!=y||mt&&Lt(new mt)!=d||pt&&Lt(pt.resolve())!=m||gt&&Lt(new gt)!=g||ft&&Lt(new ft)!=x)&&(Lt=function(t){var e=tt.call(t),s=e==h?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 m;case It:return g;case qt: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)&&!Wt(t)}var Kt=dt||function(){return!1};function Wt(t){var e=Ft(t)?tt.call(t):"";return e==c||e==u}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(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)}}(r,r.exports);var n=r.exports;const o=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,o(t)):i},set(e,s,i,r){const o=e[s];i=m(i)&&i.__isProxy?n(i):i;const a=Reflect.set(e,s,i,r);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${y(s)}Change`,i),a}}),a=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]"),c=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 u{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(`${a(t)}=${a(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])})),p(t.data)&&(t.data=t.data.buffer),(g(t.data)||l(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:a,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:c(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(a).forEach((t=>{null===r&&"content-type"===t.toLowerCase()?delete a[t]:null==d||d.setRequestHeader(t,a[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 d{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 d((e=>{t=e}));return{cancel:t,token:e}}}const l=Array.isArray,h=t=>null==t,m=t=>"object"==typeof t&&null!==t,p=t=>{let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e},g=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},f=()=>{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("")},v=(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},x=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,i]=[t[0],t[1]];if(null!==i)return m(i)&&!l(i)?(e[s]||(e[s]={}),void(e[s]=x(i,e[s]))):void(e[s]=i)})),e):e,b=/-(\w)/g,y=t=>t.replace(b,((t,e)=>e?e.toUpperCase():"")),{hasOwnProperty:I}=Object.prototype,q=(t,e)=>I.call(t,e),D=(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]=D(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,$=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,C;t.EVENT=void 0,(O=t.EVENT||(t.EVENT={})).STATE="state",O.FAILED="failed",O.BO_FAILED="boFailed",O.REQUEST_ERROR="requestError",O.POLLING_ERROR="pollingError",O.KEEPALIVE_ERROR="keepaliveError",O.BREAKOUT_ROOMS_STATE="breakoutRoomsState",t.STATE=void 0,(S=t.STATE||(t.STATE={}))[S.CLOSE=0]="CLOSE",S[S.JOINED=1]="JOINED",S[S.READY=2]="READY",t.BREAKOUT_ROOMS_STATE=void 0,(R=t.BREAKOUT_ROOMS_STATE||(t.BREAKOUT_ROOMS_STATE={}))[R.CLOSE=0]="CLOSE",R[R.JOINED=1]="JOINED",R[R.READY=2]="READY",t.ENDPOINT_TYPE=void 0,(T=t.ENDPOINT_TYPE||(t.ENDPOINT_TYPE={})).WEBAPP="webApp",T.WEBCTRL="webCtrl",T.WECHATMP="weChatMP",T.SUPERVISION="supervision",T.BIGSCREEN="bigScreen",T.DESKTOP="desktop",T.MOBILE="mobile",T.VCS="vcs",T.SIP="sip",T.H323="h323",T.PSTN="pstn",T.MULTI_STREAM="multiStream",T.MEETING_TOUCH="meetingTouch",T.MEETING_ROOMS="meetingRooms",T.RTSP="rtsp",T.RTMP_PULLER="rtmpPuller",T.GB28181="gb28181",T.TELE_PRESENCE="telePresence",T.RTSP_Access="rtspAccess",t.ROLE=void 0,(A=t.ROLE||(t.ROLE={})).HOST="host",A.COHOST="coHost",A.ATTENDEE="attendee",A.AUDIENCE="audience",t.RECORD_STATUS=void 0,(C=t.RECORD_STATUS||(t.RECORD_STATUS={})).STARTED="started",C.PAUSED="paused",C.STARTING="starting",C.STOPPED="stopped";class U{constructor(t,e){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=e,this.ctx=t,this.emitter=s(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},o(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},o(this.emitter))}cleanData(){this.data=new Proxy({},o(this.emitter))}reactiveData(t){if(!m(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=`${y(r)}Change`;this.emitter.on(o,n),e.set(o,n),m(t[r])&&!l(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class _ extends U{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)&&x(s,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;x({participantCount:e},this.data)}))}subject(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/info/subject`,t)}))}practiceSession(){return e(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})}getAllUserAgentWhiteList(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetingNum/${t}/allUserAgentWhiteList`,{params:{meetingID:s}})}getAllUserAudioEnergyList(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetingNum/${t}/allUserAudioEnergyList`,{params:{meetingID:s}})}}function N(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(t,s,i,r){return e(this,void 0,void 0,(function*(){const e=r.config.request.flag?`?flag=${r.config.request.flag}`:"",n=yield r.request.post(`/ypush/api/v1/meeting-control/inbox${e}`,{basic:{tenantId:100,clientId:i,meetingId:s},inboxes:t}),o=[];return n.data&&Object.keys(n.data).forEach((t=>{o.push({name:t,seqId:n.data[t].maxSeqId,limit:200})})),o}))}function k(t,s){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i,clientID:r,flag:n}=s.config.request,o=n?`?flag=${n}`:"";(new Date).getTime();const a=yield s.request.post(`${e}meetings/${i}/subscribe${o}`,{endpointID:r,topics:t}),c=a&&a.data&&a.data.eventMsgs;c&&c.forEach((t=>{["liveStream","recording","audioRecording","liveStreaming","checkIn"].includes(t.event)&&(t.stime=new Date(a.headers.date).getTime()),s.emitter.emit(t.event,t)}))}))}function P(t,s,i){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r,boClientID:n}=i.config.request,o=yield i.request.post(`${e}meetings/${r}/breakoutRooms/${t}/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(t,s,i){return e(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c,query:u=""}=s;if(yield(()=>e(this,void 0,void 0,(function*(){let e;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},d={cancelToken:a};try{e=yield t.post(`/ypush/api/v1/meeting-control/polling${u}`,s,d)}catch(m){return c.attempts+=1,void(m&&"request abort"!==m.type&&console.error(m))}if(!e)return console.error("polling error: ","response is null"),void(c.attempts+=1);const{data:l={},bizCode:h,error:m}=e;if(h&&900408!==h)return console.error("polling error: ",JSON.stringify(m)),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","checkIn"].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?$(c.attempts):0;c.timer=setTimeout((()=>{c.running&&M(t,s,i)}),d)}))}function L(t,s,i){return e(this,void 0,void 0,(function*(){const{inboxes:r,clientID:n,meetingID:o,cancelToken:a,status:c}=s;if(yield(()=>e(this,void 0,void 0,(function*(){let e;const s={basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},u={cancelToken:a};try{e=yield t.post("/ypush/api/v1/meeting-control/polling?bo=1",s,u)}catch(h){return c.boAttempts+=1,void(h&&"request abort"!==h.type&&console.error(h))}if(!e)return console.error("[Meeting] boPolling error: ","response is null"),void(c.attempts+=1);const{data:d={},bizCode:l,error:h}=e;if(l&&900408!==l)return console.error("[Meeting] boPolling error: ",JSON.stringify(h)),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?$(c.boAttempts):0;c.boTimer=setTimeout((()=>{c.running&&L(t,s,i)}),u)}))}const j=(e,s)=>{const{meetingID:i,clientID:r,flag:n}=s.config.request,o=n?`?flag=${n}`:"";s.status.polling.running=!0,M(s.request,{inboxes:e,clientID:r,meetingID:i,cancelToken:s.config.request.cancelToken.token,status:s.status.polling,query:o,onError(e){s.emitter.emit(t.EVENT.POLLING_ERROR,e)}},(t=>new Promise((e=>{var i;s.emitter.emit(t.event,t),void 0!==(null===(i=t.body)||void 0===i?void 0:i.seq)&&s.emitter.emit("eventSeqChange",{event:t.event,seq:t.body.seq}),e()}))))},B=(e,s)=>{const{boMeetingID:i,boClientID:r}=s.config.request;L(s.request,{inboxes:e,clientID:r,meetingID:i,cancelToken:s.config.request.cancelToken.token,status:s.status.polling,onError(e){s.emitter.emit(t.EVENT.POLLING_ERROR,e)}},(t=>{s.emitter.emit(t.event,t)}))};function H(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=d.source()}function V(t,s){return e(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(()=>e(this,void 0,void 0,(function*(){let e;try{e=yield t.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(!e)return;const{data:s={},bizCode:a,error:d,headers:l}=e;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 h=s.interval||"";if(!h)return n.attempts+=1,void console.error("keepalive ",a,d);n.interval=h,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?$(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&V(t,s)}),d)}))}function G(e){const{meetingID:s,userID:i,flag:r}=e.config.request,n=r?`?flag=${r}`:"";e.status.keepalive.running=!0,V(e.request,{meetingID:s,userID:i,cancelToken:e.config.request.cancelToken.token,status:e.status.keepalive,query:n,onError(s){e.emitter.emit(t.EVENT.KEEPALIVE_ERROR,s)},onRegionChange(t){e.emitter.emit("regionChange",t)}})}const Y=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)},K=(t,s,i)=>e(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 e(void 0,void 0,void 0,(function*(){let e;try{e=yield t.post(`/meeting-ctrl/api/v1/meetings/${r}/eventsSeq`,{events:o})}catch(n){return void console.error(n)}if(!e)return;const{data:s={}}=e;s&&i(s)})),!n.running)return;n.timer=setTimeout((()=>{n.running&&K(t,s,i)}),1e3*n.interval)})),W=t=>{t.status.eventsSeq.running=!1,t.status.eventsSeq.timer&&(clearTimeout(t.status.eventsSeq.timer),t.status.eventsSeq.timer=null)};var F,J,X,z;t.MeEvent=void 0,(F=t.MeEvent||(t.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.MAINVENUE="mainVenue",F.LEAVE="leave";class Q extends U{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const s=s=>e(this,void 0,void 0,(function*(){if("role"in s&&s.role!==this.data.role&&s.role){const e=this.data.role;x({role:s.role},this.data),s.role!==t.ROLE.AUDIENCE&&e!==t.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(t.MeEvent.ROLECHANGE,s.role),this.ctx.emitter.emit(t.MeEvent.ROLECHANGE,s.role)}})),i=e=>{var s,i,r,n,o,a,c,u,d,l;if("audio"in e&&e.audio){const{deviceOn:m,sendOn:p,recvOn:g,opBy:f}=e.audio;if(!h(m)&&m!==(null===(s=this.data.audio)||void 0===s?void 0:s.deviceOn)||!h(p)&&p!==(null===(i=this.data.audio)||void 0===i?void 0:i.sendOn)||!h(g)&&g!==(null===(r=this.data.audio)||void 0===r?void 0:r.recvOn)||!h(f)&&f!==(null===(n=this.data.audio)||void 0===n?void 0:n.opBy)){const s={deviceOn:null===(o=this.data.audio)||void 0===o?void 0:o.deviceOn,sendOn:null===(a=this.data.audio)||void 0===a?void 0:a.sendOn,recvOn:null===(c=this.data.audio)||void 0===c?void 0:c.recvOn};x({audio:e.audio},this.data);const i={deviceOn:h(m)?null===(u=this.data.audio)||void 0===u?void 0:u.deviceOn:m,sendOn:!!(h(p)?null===(d=this.data.audio)||void 0===d?void 0:d.sendOn:p),recvOn:h(g)?null===(l=this.data.audio)||void 0===l?void 0:l.recvOn:g,opBy:f,changeData:Object.assign({},e.audio),oldData:s};this.emitter.emit(t.MeEvent.AUDIOCHANGE,i)}}},r=e=>{var s,i,r,n,o,a,c,u,d;if("video"in e&&e.video){const{deviceOn:l,sendOn:m,opBy:p,blocked:g}=e.video;if(!h(l)&&l!==(null===(s=this.data.video)||void 0===s?void 0:s.deviceOn)||!h(m)&&m!==(null===(i=this.data.video)||void 0===i?void 0:i.sendOn)||!h(g)&&g!==(null===(r=this.data.video)||void 0===r?void 0:r.blocked)){const s={deviceOn:null===(n=this.data.video)||void 0===n?void 0:n.deviceOn,sendOn:null===(o=this.data.video)||void 0===o?void 0:o.sendOn,blocked:null===(a=this.data.video)||void 0===a?void 0:a.blocked};x({video:e.video},this.data);const i={deviceOn:h(l)?null===(c=this.data.video)||void 0===c?void 0:c.deviceOn:l,sendOn:!!(h(m)?null===(u=this.data.video)||void 0===u?void 0:u.sendOn:m),blocked:h(g)?null===(d=this.data.video)||void 0===d?void 0:d.blocked:g,opBy:p,changeData:Object.assign({},e.video),oldData:s};this.emitter.emit(t.MeEvent.VIDEOCHANGE,i)}}},n=e=>{var s,i,r,n,o,a,c,u;if("share"in e&&e.share){const{deviceOn:o,sendOn:a,opBy:c}=e.share;if(!h(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.deviceOn)||!h(a)&&a!==(null===(i=this.data.share)||void 0===i?void 0:i.sendOn)){x({share:e.share},this.data);const s={deviceOn:h(o)?null===(r=this.data.share)||void 0===r?void 0:r.deviceOn:o,sendOn:!!(h(a)?null===(n=this.data.share)||void 0===n?void 0:n.sendOn:a),opBy:c};this.emitter.emit(t.MeEvent.SHARECHANGE,s)}}if("whiteboard"in e&&e.whiteboard){const{deviceOn:s,sendOn:i,opBy:r}=e.whiteboard;if(!h(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.deviceOn)||!h(i)&&i!==(null===(a=this.data.whiteboard)||void 0===a?void 0:a.sendOn)){x({whiteboard:e.whiteboard},this.data);const n={deviceOn:h(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.deviceOn:s,sendOn:!!(h(i)?null===(u=this.data.whiteboard)||void 0===u?void 0:u.sendOn:i),opBy:r};this.emitter.emit(t.MeEvent.WHITEBOARDCHANGE,n)}}},o=e=>{e.displayName&&e.displayName!==this.data.displayName&&(x({displayName:e.displayName},this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.emitter.emit(t.MeEvent.DISPLAYNAMECHANGE,e.displayName))},a=e=>{"isHandUp"in e&&e.isHandUp!==this.data.isHandUp&&(x({isHandUp:e.isHandUp},this.data),this.emitter.emit(t.MeEvent.HANDUPCHANGE,!!e.isHandUp))},c=e=>{"isSpotlightVideo"in e&&(x({isSpotlightVideo:e.isSpotlightVideo},this.data),this.emitter.emit(t.MeEvent.SPOTLIGHTVIDEOCHANGE,!!e.isSpotlightVideo))},u=s=>e(this,void 0,void 0,(function*(){if("isInLobby"in s&&s.isInLobby!==this.data.isInLobby){x({isInLobby:s.isInLobby},this.data);const e=!1===s.isInLobby?"inLobbyChange":void 0;yield this.rePolling(e),this.emitter.emit(t.MeEvent.LOBBYCHANGE,!!s.isInLobby),this.ctx.emitter.emit(t.MeEvent.LOBBYCHANGE,!!s.isInLobby)}})),d=e=>{const{event:s,state:i,body:r}=e;"personalLayout"===s&&(["update","full"].includes(i)?x({personalLayout:r},this.data):"delete"===i&&(this.data.personalLayout=void 0),this.emitter.emit(t.MeEvent.PERSONALLAYOUTCHANGE,this.data.personalLayout))},l=e=>{if(!e.barrage)return;let s=null;if(!e.barrage.wordsDisplayStatus)return s=null,delete e.barrage,this.data.barrage=s||void 0,void this.emitter.emit(t.MeEvent.BARRAGECHANGE,s);if(!e.barrage.receiver)return;const i={content:e.barrage.content,contentType:e.barrage.contentType,type:e.barrage.type,duration:e.barrage.duration,position:e.barrage.position,enableMultiLine:e.barrage.enableMultiLine,effect:e.barrage.effect};s=i;let{role:r}=this.data;if(this.data.endpointType===t.ENDPOINT_TYPE.SUPERVISION){const{info:e}=this.ctx.modules;r="webinar"===e.meetingType?t.ROLE.AUDIENCE:t.ROLE.ATTENDEE}if(r===t.ROLE.HOST||r===t.ROLE.COHOST?s=e.barrage.receiver.host?i:null:r===t.ROLE.ATTENDEE?s=e.barrage.receiver.attendee?i:null:r===t.ROLE.AUDIENCE&&(s=e.barrage.receiver.audience?i:null),!s&&e.barrage.receiver.designated){const{userID:t,subjectID:r}=this.data,{designatedUsers:n=[]}=e.barrage;s=-1!==n.findIndex((e=>e.userID===t||r&&e.subjectID===r))?i:null}delete e.barrage,this.data.barrage=s||void 0,this.emitter.emit(t.MeEvent.BARRAGECHANGE,s)},m=e=>{"perm"in e&&(x({perm:e.perm},this.data),this.emitter.emit(t.MeEvent.PERMCHANGE,e.perm))},p=e=>{"translationChannel"in e&&(x({translationChannel:e.translationChannel},this.data),this.emitter.emit(t.MeEvent.TRANSLATIONCHANNELCHANGE,e.translationChannel))},g=e=>{"mainVenue"in e&&(x({mainVenue:e.mainVenue},this.data),this.emitter.emit(t.MeEvent.MAINVENUE,e.mainVenue))},f=e=>{"leave"in e&&!0===e.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),H(this.ctx),Y(this.ctx),lt(this.ctx),this.emitter.emit(t.MeEvent.LEAVE,e.resultInfo),this.ctx.cleanup(e.resultInfo))},v=e=>{s(e),i(e),r(e),n(e),o(e),a(e),u(e),c(e),l(e),m(e),p(e),g(e),f(e),(this.data.isInLobby||this.data.role===t.ROLE.AUDIENCE)&&this.data.share&&this.data.share.sendOn&&n({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),(this.data.isInLobby||this.data.role===t.ROLE.AUDIENCE)&&this.data.whiteboard&&this.data.whiteboard.sendOn&&n({whiteboard:{sendOn:!1}})};this.ctx.emitter.on(t.MeEvent.INIT,(t=>{x(t,this.data),this.data.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.bid&&(n({share:{deviceOn:!0,sendOn:!1,recvOn:!1}}),n({whiteboard:{sendOn:!1}})),this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(t.MeEvent.UPDATE,(t=>{v(t),x(t,this.data)})),this.ctx.emitter.on(t.EVENT.STATE,(({state:e})=>{e===t.STATE.READY&&this.data.endpointType!==t.ENDPOINT_TYPE.SUPERVISION&&this.emitter.emit(t.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 f(t)}let i=s.users.find((t=>t.userID===this.data.userID));i||s.users.length&&(i=s.users[0]),i?(v(i),x(i,this.data)):console.warn("me ",e,s)})),this.ctx.emitter.on("setUserVideo",(e=>{this.emitter.emit(t.MeEvent.SETVIDEO,e.body)})),this.ctx.emitter.on("setUserAudio",(e=>{this.emitter.emit(t.MeEvent.SETAUDIO,e.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){f({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{d(t)})),this.ctx.emitter.on("boSwitchNotify",(e=>{this.emitter.emit(t.MeEvent.BOSWITCHNOTIFY,e.body)})),this.ctx.emitter.on("boReturnMeetingNotify",(e=>{this.emitter.emit(t.MeEvent.BORETURNMEETINGNOTIFY,e.body)})),this.ctx.emitter.on("topMC",(e=>{const{body:s={}}=e;this.data.mediaContent&&this.data.mediaContent.topMCSeq!==s.seq&&(this.data.mediaContent.topMC=s.topMC,this.data.mediaContent.topMCSeq=s.seq,this.emitter.emit(t.MeEvent.TOPMCCHANGE,{topMC:this.data.mediaContent.topMC,topMCSeq:this.data.mediaContent.topMCSeq}))}))}notifyUpdateUserState(e){this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e})}updateUserState(e,s=!1){if(!s){const{role:s,initialMediaState:i}=this.data;e.audio.sendOn=e.audio.sendOn&&i.audio.sendOn,e.video.sendOn=e.video.sendOn&&i.video.sendOn,s===t.ROLE.AUDIENCE&&(e.audio.sendOn=!1,e.video.sendOn=!1)}const{prefix:{ctrl:i},meetingID:r}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,x(e,this.data),this.ctx.request.post(`${i}meetings/${r}/updateUserState`,e)}boUpdateUserState(s,i,r=!1){return e(this,void 0,void 0,(function*(){if(!r){const{role:e,initialMediaState:s}=this.data;i.audio.sendOn=i.audio.sendOn&&s.audio.sendOn,i.video.sendOn=i.video.sendOn&&s.video.sendOn,e===t.ROLE.AUDIENCE&&(i.audio.sendOn=!1,i.video.sendOn=!1)}this.data.isUpdatedUserState=!0;const{prefix:{ctrl:e},meetingID:n}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${n}/breakoutRooms/${s}/updateUserState`,i)}))}rePolling(s){return e(this,void 0,void 0,(function*(){const{ctx:e}=this;H(e);const i=N(e),r=yield w(i,e.config.request.meetingID,e.config.request.clientID,e);if("inLobbyChange"===s&&Object.keys(e.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(t)&&e.modules[t].cleanData(!0)})),s&&this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,{data:this.data,event:s}),yield k(i,e),"undefined"!=typeof Worker&&e.worker){const{meetingID:t,clientID:s,userID:n}=e.config.request;e.worker.postMessage({inboxes:r,topics:i,clientID:s,meetingID:t,userID:n,rePolling:!0})}else j(r,e)}))}}t.BoHelpOpReason=void 0,(J=t.BoHelpOpReason||(t.BoHelpOpReason={}))[J.Cancel=1]="Cancel",J[J.Accept=2]="Accept",J[J.Refuse=3]="Refuse",t.BreakoutRoomStatus=void 0,(X=t.BreakoutRoomStatus||(t.BreakoutRoomStatus={}))[X.NotStarted=0]="NotStarted",X[X.Opened=1]="Opened",X[X.Ending=2]="Ending",X[X.Ended=3]="Ended",t.BoHelpAction=void 0,(z=t.BoHelpAction||(t.BoHelpAction={})).Request="request",z.Cancel="cancel",z.Accept="accept",z.Refuse="refuse";const Z={status:0,subjectIndex:0,timerDuration:0,waitSeconds:0,allowChooseRoom:!1,allowReturnToMeeting:!1,autoJoinEnabled:!1,timerEnabled:!1,isTimerAutoEnd:!1,timerDurationEnabled:!1};class tt extends U{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=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=tt.setUserGroupIDs?tt.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?x(t,this.data.callRecordUsers[e]):"update"===s&&-1===e&&(t.displayNamePinyin=tt.setDisplayNamePinyinProp?tt.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=tt.setUserGroupIDs?tt.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)}inviteAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/inviteAll`)}}class et extends U{constructor(t){super(t,"leaveUsers")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("leaveUsers",(t=>{const{state:e,body:s}=t;if(s){if("full"===e)return this.data.users=s.users.map((t=>(t.displayNamePinyin=et.setDisplayNamePinyinProp?et.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=et.setUserGroupIDs?et.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,t))),void this.emitter.emit("leaveUsersChange",this.data.users);this.data.users||(this.data.users=[]),s.users.forEach((t=>{const s=this.data.users.findIndex((e=>t.userID===e.userID));"update"===e&&-1!==s?x(t,this.data.users[s]):"update"===e&&-1===s&&(t.displayNamePinyin=et.setDisplayNamePinyinProp?et.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=et.setUserGroupIDs?et.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.users.push(t))})),this.emitter.emit("leaveUsersChange",this.data.users)}}))}cleanup(){this.emitter.all=new Map}}class st extends U{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[],boInteractiveUsers:[]}}_topic(){const{role:e,endpointType:s}=this.ctx.modules.me.data;return s===t.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:e===t.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const e=(e,{event:s,state:i})=>{if(e.userID!==this.ctx.modules.me.data.userID)return;if(this.ctx.breakoutRoomsState!==t.BREAKOUT_ROOMS_STATE.CLOSE&&"boInteractiveUsers"!==s)return;const{resultInfo:r={}}=e;if("delete"!==i||"delete"===i&&[901357,901358,901352,901351,901350,901349].includes((null==r?void 0:r.bizCode)||-1))return void this.ctx.emitter.emit(t.MeEvent.UPDATE,e);let n=!1;switch(s){case"interactiveUsers":case"boInteractiveUsers":e.isInLobby||(n=!0);break;case"broadcastUsers":e.isInLobby||e.role!==t.ROLE.AUDIENCE||(n=!0);break;case"lobbyUsers":e.isInLobby&&(n=!0)}const o={};n&&(o.leave=!0),this.ctx.emitter.emit(t.MeEvent.UPDATE,Object.assign(Object.assign({},e),o))},s=({updateUsers:t,state:s,sourceKey:i})=>{if("full"===s)return this.data[i]=t.map((t=>(t.displayNamePinyin=st.setDisplayNamePinyinProp?st.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=st.setUserGroupIDs?st.setUserGroupIDs(t.groupIDs||[],t.endpointType):t.groupIDs,e(t,{event:i,state:s}),t))),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 t.forEach((t=>{const o=r[i].findIndex((e=>t.userID===e.userID));if("delete"===s&&-1!==o){const[e]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:e,resultInfo:t.resultInfo})}else if("update"===s&&-1!==o){const e=this.data[i][o];this.updateUserProps(t,e),x(t,e),this.data[i][o]=D(e),this.emitter.emit(`${i}Update`,{user:this.data[i][o]})}else"update"===s&&-1===o&&(t.displayNamePinyin=st.setDisplayNamePinyinProp?st.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=st.setUserGroupIDs?st.setUserGroupIDs(t.groupIDs||[],t.endpointType):t.groupIDs,r[i].push(t),this.emitter.emit(`${i}Add`,{user:t,resultInfo:t.resultInfo}));e(t,{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:e,body:i,isBreakoutRooms:r=!1}=t;s(r?{updateUsers:i.users,state:e,sourceKey:"boInteractiveUsers"}:{updateUsers:i.users,state:e,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:e,body:i}=t;s({updateUsers:i.users,state:e,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:e,body:i}=t;s({updateUsers:i.users,state:e,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:e,body:i}=t;s({updateUsers:i.users,state:e,sourceKey:"advCtrlUsers"})})),this.ctx.emitter.on("userNotify",(t=>{const{body:e}=t;this.emitter.emit("userNotify",e)}))}reactiveData(t){if(!m(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=`${y(r)}Change`;this.emitter.on(o,n),e.set(o,n),m(t[r])&&!l(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=st.setDisplayNamePinyinProp?st.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`)}transferMeeting(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/transfer`,e)}transferMeetingBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transferBatch`,t)}getVideoPreview(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}/videoPreview`)}getSharePreview(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}/sharePreview`)}setMainVenue(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/setMainVenue`,e)}setSiteName(t,e){const{prefix:{ctrl:s},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${i}/users/${t}/siteName`,e)}}function it(e){const i=function(e){const{baseURL:i,modules:r,worker:n,singleton:o,eventsSeq:a,filterTopics:c=[]}=e;r.findIndex((t=>t===Q))<0&&r.push(Q),r.findIndex((t=>t===_))<0&&r.push(_);const l=e.clientID||`${f()}_${v(new Date,"MMddHHmmss")}`,h={config:{baseURL:i,modules:r,singleton:o||!1,eventsSeq:a||!1,filterTopics:c,request:{cancelToken:d.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:l,boClientID:`${l}_${v(new Date,"MMddHHmmss")}`,location:"",meetingID:"",boMeetingID:"",ctrlID:"",boCtrlID:"",sessionID:"",userID:-1,voteTk:"",credential:"",multiActiveRegion:"",flag:""}},worker:n,emitter:s(),request:new u({baseURL:i,beforeRequest(t){t.headers["X-Y-Request-Id"]=f(),t.timeout=18e5},error(e){h.emitter.emit(t.EVENT.REQUEST_ERROR,e)}}),modules:{},state:t.STATE.CLOSE,breakoutRoomsState:t.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(e){h.state!==t.STATE.CLOSE&&(h.worker&&h.worker.terminate(),h.config.request.location="",h.config.request.meetingID="",h.config.request.boMeetingID="",h.config.request.ctrlID="",h.config.request.boCtrlID="",h.config.request.sessionID="",h.config.request.userID=-1,h.config.request.voteTk="",h.config.request.credential="",h.config.request.multiActiveRegion="",h.status.polling={running:!1,attempts:0,boAttempts:0,timer:null,boTimer:null},h.status.keepalive={running:!1,attempts:0,timer:null,interval:20},h.status.eventsSeq={running:!1,timer:null,interval:30},h.request.setDefaultHeader("X-Y-Location",""),h.request.setDefaultHeader("X-Y-Meeting-Region",""),h.request.setDefaultHeader("X-Y-Ctrl-Id",""),h.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(h.modules).forEach((t=>{h.modules[t].cleanup()})),h.state=t.STATE.CLOSE,h.emitter.emit(t.EVENT.STATE,{state:h.state,reason:e}))}};return h}(e);return i.worker&&("undefined"!=typeof Worker?i.worker.postMessage({baseURL:i.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!l(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}))}(i.config.modules,i),i.emitter.on(t.EVENT.POLLING_ERROR,(t=>{ot(i)({resultInfo:t})})),i.emitter.on(t.EVENT.KEEPALIVE_ERROR,(t=>{ot(i)({resultInfo:t})})),Object.assign({config:i.config,request:i.request,get state(){return i.state},get breakoutRoomsState(){return i.breakoutRoomsState},on:i.emitter.on,off:i.emitter.off,join:rt(i),boJoin:nt(i),boReturnMeeting:ct(i),leave:ot(i),end:at(i),endMeeting:ut(i)},i.modules)}function rt(s){return function(i){var r,n,o,a,c;return e(this,void 0,void 0,(function*(){const{clientID:u}=s.config.request,d=`${null===(r=i.endpointType)||void 0===r?void 0:r.toLocaleUpperCase()}${u}_${i.meetingNum}`;s.config.request.sessionID=d,s.request.setDefaultHeader("X-Y-Session-Id",d),s.request.setDefaultHeader("X-Y-Location","");const l=null!==(n=i.uccaRoute)&&void 0!==n?n:"",h=null!==(o=i.domain)&&void 0!==o?o:"";l&&s.request.setDefaultHeader("X-Y-Ucca-Route",l),h&&s.request.setDefaultHeader("X-Y-Domain",h),s.config.request.flag=null!==(a=i.flag)&&void 0!==a?a:"",i.flag&&delete i.flag;const m=s.config.request.flag?`&flag=${s.config.request.flag}`:"",p=s.config.request.flag?`?flag=${s.config.request.flag}`:"",g={meetingNum:i.meetingNum,pwd:i.pwd,url:i.url,mobileCode:i.mobileCode,mobile:i.mobile,regEmail:i.regEmail,accEmail:i.accEmail,tk:i.tk,displayName:i.displayName,userAgent:i.userAgent,verifyID:i.verifyID,tc:i.tc,t:i.t};i.tc&&(delete g.meetingNum,delete g.pwd),i.t&&delete g.pwd;const{prefix:f}=s.config.request,v={"X-Y-Endpoint-Type":i.endpointType};i.signId&&(v["X-Y-Sign-Id"]=i.signId);const x=yield s.request.get(`${f.ctrl}credential${p}`,{params:g,headers:v}),{credential:b="",location:y=""}=x&&x.data||{};if(s.config.request.location=y,s.request.setDefaultHeader("X-Y-Location",y),!b)return s.emitter.emit(t.EVENT.FAILED,{bizCode:x.bizCode,data:x.data}),x;delete i.pwd,delete i.url,s.config.request.credential=b;const I=x.data.multiActiveRegion;I&&(s.config.request.multiActiveRegion=I,s.request.setDefaultHeader("X-Y-Meeting-Region",I));const q={displayName:i.displayName,userAgent:i.userAgent,clientID:u,avatarURL:i.avatarURL};i.groupIDs&&i.account&&(q.groupIDs=i.groupIDs,q.account=i.account,q.groupName=i.groupName),i.mediaContentReq&&(q.mediaContentReq=i.mediaContentReq),i.taskID&&(q.taskID=i.taskID),q.avatarURL=i.avatarURL;const D=i.hostKey?`&hostKey=${i.hostKey}`:"",E={"X-Y-Endpoint-Type":i.endpointType,"X-Y-Endpoint-Id":u},$=yield s.request.post(`${f.ctrl}join?meetingNum=${i.meetingNum}&credential=${b}${D}${m}`,q,{headers:E});if(!$||$&&$.ret<=-1)return s.emitter.emit(t.EVENT.FAILED,{bizCode:$.bizCode,data:$.data}),$;const{meetingID:O="",ctrlID:S="",user:R={},mediaContent:T={},initialMediaState:A={},tk:C=""}=$.data;s.config.request.meetingID=O,s.config.request.ctrlID=S,s.config.request.userID=R.userID,s.config.request.voteTk=C,s.config.request.credential=b,s.config.request.multiActiveRegion=I,s.request.setDefaultHeader("X-Y-Ctrl-Id",S),s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},R),{mediaContent:T,initialMediaState:A})),s.state=t.STATE.JOINED,s.emitter.emit(t.EVENT.STATE,{state:s.state});const U=N(s);let _=[];try{_=yield w(U,O,u,s)}catch(H){return s.emitter.emit(t.EVENT.FAILED,{bizCode:401===(null==H?void 0:H.statusCode)?900403:900599,data:null!==(c=H.message)&&void 0!==c?c:"inbox error"}),$.data=Object.assign(Object.assign({},$.data),x.data),$}yield k(U,s);const P=()=>{s.state!==t.STATE.READY&&(s.state=t.STATE.READY,s.emitter.emit(t.EVENT.STATE,{state:s.state}))};s.status.eventMsgs=[];const M=t=>{const e=s.status.eventMsgs.find((e=>e.event===t.event));e&&(e.seq=t.seq)},L=t=>e(this,void 0,void 0,(function*(){const i=s.status.eventMsgs,r=[];if(t.eventMsgs.forEach((t=>{const{event:e,seq:n}=t,o=s.status.eventMsgs.find((t=>t.event===e));o?o.seq!==n&&r.push(e):i.push(t)})),r.length){const t=yield function(t,s,i){var r;return e(this,void 0,void 0,(function*(){let e=null,n=[];try{e=yield t.request.post(`/meeting-ctrl/api/v1/meetings/${s}/events`,{events:i})}catch(H){return console.error(H),n}if(!e)return n;const{data:o={}}=e;return o&&o.eventMsgs&&(n=null!==(r=o.eventMsgs)&&void 0!==r?r:[]),n}))}(s,O,r);t.forEach((t=>{var e;s.emitter.emit(t.event,t),void 0!==(null===(e=t.body)||void 0===e?void 0:e.seq)&&M({event:t.event,seq:t.body.seq})}))}}));s.emitter.on("eventSeqChange",M),s.emitter.on("eventsSeqChange",L);const[B]=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&&s.worker){s.status.polling.running=!0,s.status.keepalive.running=!0;const t={ctrlID:S,location:y,multiActiveRegion:I,sessionID:d,inboxes:_,topics:U,clientID:u,meetingID:O,userID:R.userID,status:!0,uccaRoute:l,domain:h};s.config.eventsSeq&&(t.events=B,t.eventsSeq=!0),s.worker.postMessage(t),s.worker.onmessage=t=>{var e;"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?L(t.data.eventsSeq):"object"==typeof t.data&&"region"in t.data||(s.emitter.emit(t.data.event,t.data),void 0!==(null===(e=t.data.body)||void 0===e?void 0:e.seq)&&M({event:t.data.event,seq:t.data.body.seq}))):ot(s)({resultInfo:{message:"keepalive Max Attempts"}}):ot(s)({resultInfo:{message:"polling Max Attempts"}}):s.status.eventsSeq.running=!1:s.status.keepalive.running=!1:s.status.polling.running=!1):P()}}else j(_,s),P(),G(s),s.config.eventsSeq&&((t,e)=>{const{meetingID:s}=t.config.request;t.status.eventsSeq.running=!0,K(t.request,{meetingID:s,status:t.status.eventsSeq,events:e},(e=>{t.emitter.emit("eventsSeqChange",e)}))})(s,B);return $.data=Object.assign(Object.assign({},$.data),x.data),$}))}}function nt(s){return function(i,r){return e(this,void 0,void 0,(function*(){if(s.state!==t.STATE.READY)return;const{prefix:{ctrl:e},clientID:n,meetingID:o}=s.config.request,a=`${n}_${v(new Date,"MMddHHmmss")}`;s.config.request.boClientID=a;const c=yield s.request.post(`${e}meetings/${o}/breakoutRooms/${i}/boJoin`,r,{headers:{"X-Y-Endpoint-Id":a}});if(!c||(null==c?void 0:c.ret)<=-1)return s.emitter.emit(t.EVENT.BO_FAILED,{bizCode:c.bizCode,data:{bid:i,resData:c.data,type:"boJoin"}}),c;H(s);const{boCtrlID:u="",meetingID:d="",user:l={},mediaContent:h={},initialMediaState:m={}}=c.data;s.config.request.boMeetingID=d,s.config.request.boCtrlID=u,Object.keys(s.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms"].includes(t)&&s.modules[t].cleanData()})),s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},l),{boMediaContent:h,initialMediaState:m}));const p=["meeting","interactive","lobby"],g=["interactive","bo","hostAttendee"],[f,x]=yield Promise.all([w(p,o,n,s),w(g,d,a,s)]);return s.breakoutRoomsState=t.BREAKOUT_ROOMS_STATE.JOINED,s.emitter.emit(t.EVENT.BREAKOUT_ROOMS_STATE,t.BREAKOUT_ROOMS_STATE.JOINED),yield Promise.all([k(p,s),P(i,g,s)]),j(f,s),B(x,s),s.modules.me.notifyUpdateUserState(),s.breakoutRoomsState=t.BREAKOUT_ROOMS_STATE.READY,s.emitter.emit(t.EVENT.BREAKOUT_ROOMS_STATE,t.BREAKOUT_ROOMS_STATE.READY),c}))}}function ot(t){return function(s){return e(this,void 0,void 0,(function*(){const e=s&&s.resultInfo;s||(s={resultInfo:{bizCode:901359}});const{prefix:i,meetingID:r}=t.config.request,n=t.config.request.flag?`?flag=${t.config.request.flag}`:"";let o;try{o=yield t.request.post(`${i.ctrl}meetings/${r}/leave${n}`,s)}catch(a){console.error(a)}return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1,eventsSeq:!1}),H(t),Y(t),W(t),lt(t),t.cleanup(e),o}))}}function at(t){return function(){return e(this,void 0,void 0,(function*(){const{prefix:e,meetingID:s}=t.config.request,i=t.config.request.flag?`?flag=${t.config.request.flag}`:"",r=yield t.request.post(`${e.ctrl}meetings/${s}/end${i}`);return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1,eventsSeq:!1}),H(t),Y(t),W(t),lt(t),t.cleanup(),r}))}}function ct(s){return function(i){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=s.config.request;"undefined"!=typeof Worker&&s.worker&&s.worker.postMessage({status:!1,eventsSeq:!1});const n=yield s.request.post(`${e}meetings/${r}/breakoutRooms/${i}/boReturnMeeting`);if(!n||(null==n?void 0:n.ret)<=-1)return s.emitter.emit(t.EVENT.BO_FAILED,{bizCode:n.bizCode,data:{bid:i,resData:n.data,type:"boReturnMeeting"}}),n;H(s),Object.keys(s.modules).forEach((t=>{["chat","qa","transcript","view","vote","breakoutRooms","users"].includes(t)&&s.modules[t].cleanData()})),s.config.request.boCtrlID="",s.config.request.boMeetingID="",s.breakoutRoomsState=t.BREAKOUT_ROOMS_STATE.CLOSE,s.emitter.emit(t.EVENT.BREAKOUT_ROOMS_STATE,t.BREAKOUT_ROOMS_STATE.CLOSE);const{user:o={},mediaContent:a={},initialMediaState:c={}}=n.data;s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},o),{boMediaContent:{},mediaContent:a,initialMediaState:c}));const u=N(s),d=yield w(u,r,s.config.request.clientID,s);return yield k(u,s),j(d,s),s.modules.me.notifyUpdateUserState("bo"),n}))}}function ut(t){return function(s){return e(this,void 0,void 0,(function*(){const{prefix:e}=t.config.request;return yield t.request.post(`${e.ctrl}meetingNum/${s}/end`)}))}}class dt{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=it(t)}static getInstance(t){return this.instance?this.instance:this.instance=new dt(t)}}function lt(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=dt.getInstance(r);n&&(n.meeting=it(r))}}return Object.defineProperty(dt,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),t.Asr=class extends U{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),x(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)}},t.AudioRecording=class extends U{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 e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/audioRecording/status`,t)}))}},t.BreakoutRooms=class extends U{constructor(t){super(t,"breakoutRooms"),this.data={option:Z,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:Z,items:[]},this.cleanData()}cleanData(t=!1){t&&(this.data.option=Z,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})}},t.Chat=class extends U{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)}},t.CheckIn=class extends U{constructor(t){super(t,"checkIn")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("checkIn",(t=>{const{state:e,body:s,stime:i}=t;s&&(s.resultInfo&&(this.emitter.emit("resultInfoChange",s.resultInfo),delete s.resultInfo),s.status&&i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),["full","update"].includes(e)&&(this.data.checkIn=s))}))}cleanup(){this.emitter.all=new Map}start(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/checkIn/start`,t)}end(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/checkIn/end`,t)}records(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${e}/checkIn/records`)}details(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/checkIn/details`,{params:t})}getCheckInData(){var t;return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;let i=[],r=null;try{r=yield this.ctx.request.post(`${e}meetings/${s}/events`,{events:["checkIn"]})}catch(o){return console.error(o),i}if(!r)return i;const{data:n={}}=r;return n&&n.eventMsgs&&(i=null!==(t=n.eventMsgs)&&void 0!==t?t:[]),i.forEach((({event:t,body:e})=>{"checkIn"===t&&(this.data.checkIn=e,this.emitter.emit("checkInChange",this.data.checkIn))})),i}))}},t.ExclusiveLayout=class extends U{constructor(t){super(t,"exclusiveLayout")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("exclusiveLayout",(t=>{const{state:e,body:s}=t;s&&(["full","update"].includes(e)&&x(s,this.data),this.emitter.emit("exclusiveLayoutChange",this.data))}))}cleanup(){this.emitter.all=new Map}applyExclusiveLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/exclusiveLayout`,t)}))}},t.FocusUsers=class extends U{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)}},t.Info=_,t.Interpretation=class extends U{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`)}},t.Invite=tt,t.LeaveUsers=et,t.LiveStream=class extends U{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 x({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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/status`,t)}))}liveStreamDescription(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/description`,t)}))}liveStreamSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/setting`,t)}))}liveStreamDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/delete`,t)}))}liveStreamLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/layout`,t)}))}liveStreamAllow(){return e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStream/pushSetting`,t)}))}},t.LiveStreaming=class extends U{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 x({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&&x({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}))}setStatus(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/status`,t)}))}liveStreamingSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/setting`,t)}))}liveStreamingDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/delete`,t)}))}liveStreamingDetail(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/liveStreaming/detail`,t)}))}},t.Me=Q,t.Qa=class extends U{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;m(e)&&!l(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)}},t.RTSP=class extends U{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)}},t.Recording=class extends U{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 e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/status`,t)}))}layout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/status`,t)}))}designatedUsers(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/designatedUsers`,t)}))}participantAdd(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/recording/participant/add`,t)}))}participantDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/recording/participant/delete`,t)}))}getTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getTemplates`,{params:t})}))}getByIds(t){return e(this,void 0,void 0,(function*(){const{prefix:{user:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/subject/getByIds`,t)}))}recordLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/recording/layout`,t)}))}},t.RemoteDesktop=class extends U{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)}},t.RollCall=class extends U{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)}},t.Setting=class extends U{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)&&x(s,this.data)}))}reactiveData(t){if(!m(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=`${y(n)}Change`;this.emitter.on(i,s),e.set(i,s)}if(m(t[n])&&!l(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/setting`,t)}))}muteAll(){return e(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 e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/breakoutRooms/${t}/muteAll`)}))}boUnmuteAll(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/breakoutRooms/${t}/unmuteAll`)}))}},t.ShouldJoinUsers=class extends U{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`)}},t.SpotlightVideo=class extends U{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(e=>{var s;const{body:i}=e;if(!i||!i.userIDs)return;this.data.userIDs=i.userIDs,this.data.broadcast=null!==(s=i.broadcast)&&void 0!==s?s:null;i.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(t.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(t.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)}},t.Transcript=class extends U{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)}},t.Users=st,t.View=class extends U{constructor(t){super(t,"view")}_topic(){const{endpointType:e,role:s}=this.ctx.modules.me.data;return e===t.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:s===t.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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/hostLayout`,t)}))}attendeeLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/attendeeLayout`,t)}))}audienceLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/audienceLayout`,t)}))}personalLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/personalLayout`,t)}))}personalLayoutDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/personalLayout/delete`,t)}))}virtualClassLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/virtualClass/layout`,t)}))}closeVirtualClass(){return e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/layout/template/info`,{params:t})}))}addVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/layout/template/add`,t)}))}editVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/layout/template/edit`,t)}))}getTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getTemplates`,{params:t})}))}editTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/edit`,t)}))}addTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/add`,t)}))}deleteTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/delete`,t)}))}getDefaultTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getDefaultTemplates`,{params:t})}))}changeDefaultTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/changeDefaultTemplate`,t)}))}perspectiveBind(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/perspective/bind`,t)}))}setSavedBackground(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/recentBackgroundFile`,t)}))}getSavedBackground(){return e(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(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.get(`${e}meetings/${s}/view/presetLayout`,{params:t})}))}setPresetLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout`,t)}))}presetLayoutApply(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout/apply`,t)}))}presetLayoutApplyUser(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout/applyUser`,t)}))}presetLayoutApplyUserBatch(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/view/presetLayout/applyUserBatch`,t)}))}},t.Vote=class extends U{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(t.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)}meetingVoteAdd(t){const{prefix:{vote:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/vote/add`,t)}meetingVoteEdit(t){const{prefix:{vote:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/vote/edit`,t)}meetingVoteDelete(t){const{prefix:{vote:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/vote/delete`,t)}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}})}},t.Words=class extends U{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){const e=()=>{this.data.wordsDisplayStatus=!1,this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})};this.ctx.emitter.on("meetingBarrage",(s=>{this.data.timer&&clearTimeout(this.data.timer),this.data.timerMap||(this.data.timerMap={});const{state:i,body:r,pollingSeqId:n}=s;if("delete"===i)return r&&r.indexes&&(this.data.list=this.data.list.filter((t=>!r.indexes.includes(t.index)))),e(),void this.emitter.emit("barrageWordChange",this.data);if("full"===i){if(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&(this.data.barrageRecord.length=10),r.list){const t=[];r.list.forEach((e=>{var s,i,r,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:n,content:null!==(r=e.content)&&void 0!==r?r:"",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,h=e.index;if(this.data.timerMap){const t=this.data.timerMap[h];t&&clearTimeout(t),-1!==l&&(this.data.timerMap[h]=setTimeout((()=>{this.data.timerMap&&(this.data.timerMap[h]=null),this.data.list=this.data.list.filter((t=>t.index!==h)),this.emitter.emit("barrageWordChange",this.data)}),1e3*l))}}})),this.data.barrageRecord=[...t,...this.data.barrageRecord]}else if(n){const t=r.timestamp?Number.parseInt(r.timestamp):(new Date).getTime();this.data.barrageRecord=[{index:1,id:n,content:r.content,time:t,timestamp:t,durationType:r.durationType,duration:1e3*r.duration},...this.data.barrageRecord]}r.wordsDisplayStatus=!0,-1!==r.duration&&(this.data.timer=setTimeout((()=>{r.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=r.wordsDisplayStatus,this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})}),1e3*r.duration)),x(r,this.data),this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data}),this.emitter.emit("barrageWordChange",this.data)}})),this.ctx.emitter.on(t.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})))}barrage(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/barrage`,t)}))}deleteBarrage(t={indexes:[]}){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${s}/deleteBarrage`,t)}))}},t.createMeeting=function(t){return t.singleton?dt.getInstance(t).meeting:it(t)},t.reset=lt,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ylink-sdk/meeting",
3
- "version": "1.0.5-beta.13",
3
+ "version": "1.0.5-beta.14",
4
4
  "description": "Meeting control of yealink",
5
5
  "main": "index.js",
6
6
  "module": "dist/meeting.esm.prod.js",