@ylink-sdk/meeting 0.8.0-beta.2 → 0.8.0-beta.21
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.
- package/dist/meeting.cjs.prod.js +1 -1
- package/dist/meeting.d.ts +210 -29
- package/dist/meeting.esm.prod.js +1 -1
- package/dist/meeting.global.prod.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var YlinkSDKMeeting=function(t){"use strict";function e(t,e,r,i){return new(r||(r=Promise))((function(s,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?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function r(t){return{all:t=t||new Map,on:function(e,r){var i=t.get(e);i?i.push(r):t.set(e,[r])},off:function(e,r){var i=t.get(e);i&&(r?i.splice(i.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var i=t.get(e);i&&i.slice().map((function(t){t(r)})),(i=t.get("*"))&&i.slice().map((function(t){t(e,r)}))}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",s=9007199254740991,n="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",d="[object Map]",l="[object Number]",p="[object Object]",h="[object Promise]",f="[object RegExp]",m="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",D="[object Int8Array]",E="[object Int16Array]",$="[object Int32Array]",_="[object Uint8Array]",O="[object Uint8ClampedArray]",S="[object Uint16Array]",w="[object Uint32Array]",T=/\w*$/,A=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,j={};j[n]=j["[object Array]"]=j[x]=j[b]=j[o]=j[a]=j[I]=j[q]=j[D]=j[E]=j[$]=j[d]=j[l]=j[p]=j[f]=j[m]=j[g]=j[v]=j[_]=j[O]=j[S]=j[w]=!0,j["[object Error]"]=j[c]=j[y]=!1;var R="object"==typeof self&&self&&self.Object===Object&&self,P="object"==typeof i&&i&&i.Object===Object&&i||R||Function("return this")(),C=e&&!e.nodeType&&e,N=C&&t&&!t.nodeType&&t,k=N&&N.exports===C;function L(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function H(t,e,r,i){var s=-1,n=t?t.length:0;for(i&&n&&(r=t[++s]);++s<n;)r=e(r,t[s],s,t);return r}function B(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function G(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var F,W=Array.prototype,Q=Function.prototype,J=Object.prototype,z=P["__core-js_shared__"],K=(F=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=k?P.Buffer:void 0,it=P.Symbol,st=P.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=G(Object.keys,Object),pt=Nt(P,"DataView"),ht=Nt(P,"Map"),ft=Nt(P,"Promise"),mt=Nt(P,"Set"),gt=Nt(P,"WeakMap"),vt=Nt(Object,"create"),yt=Bt(pt),xt=Bt(ht),bt=Bt(ft),It=Bt(mt),qt=Bt(gt),Dt=it?it.prototype:void 0,Et=Dt?Dt.valueOf:void 0;function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function St(t){this.__data__=new _t(t)}function wt(t,e){var r=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 r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],i=r.length,s=!!i;for(var o in t)!e&&!Z.call(t,o)||s&&("length"==o||Mt(o,i))||r.push(o);return r}function Tt(t,e,r){var i=t[e];Z.call(t,e)&&Vt(i,r)&&(void 0!==r||e in t)||(t[e]=r)}function At(t,e){for(var r=t.length;r--;)if(Vt(t[r][0],e))return r;return-1}function Ut(t,e,r,i,s,h,y){var A;if(i&&(A=h?i(t,s,h,y):i(t)),void 0!==A)return A;if(!Qt(t))return t;var U=Gt(t);if(U){if(A=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,i=t.length;e||(e=Array(i));for(;++r<i;)e[r]=t[r];return e}(t,A)}else{var R=Lt(t),P=R==c||R==u;if(Ft(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(R==p||R==n||P&&!h){if(B(t))return h?t:{};if(A=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:(e=nt(t),Qt(e)?ot(e):{});var e}(P?{}:t),!e)return function(t,e){return Pt(t,kt(t),e)}(t,function(t,e){return t&&Pt(e,Jt(e),t)}(A,t))}else{if(!j[R])return h?t:{};A=function(t,e,r,i){var s=t.constructor;switch(e){case x:return Rt(t);case o:case a:return new s(+t);case b:return function(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,i);case I:case q:case D:case E:case $:case _:case O:case S:case w:return function(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,i);case d:return function(t,e,r){var i=e?r(V(t),!0):V(t);return H(i,L,new t.constructor)}(t,i,r);case l:case g:return new s(t);case f:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,r){var i=e?r(Y(t),!0):Y(t);return H(i,M,new t.constructor)}(t,i,r);case v:return n=t,Et?Object(Et.call(n)):{}}var n}(t,R,Ut,e)}}y||(y=new St);var C=y.get(t);if(C)return C;if(y.set(t,A),!U)var N=r?function(t){return function(t,e,r){var i=e(t);return Gt(t)?i:function(t,e){for(var r=-1,i=e.length,s=t.length;++r<i;)t[s+r]=e[r];return t}(i,r(t))}(t,Jt,kt)}(t):Jt(t);return function(t,e){for(var r=-1,i=t?t.length:0;++r<i&&!1!==e(t[r],r,t););}(N||t,(function(s,n){N&&(s=t[n=s]),Tt(A,n,Ut(s,e,r,i,n,t,y))})),A}function jt(t){return!(!Qt(t)||(e=t,K&&K in e))&&(Wt(t)||B(t)?et:A).test(Bt(t));var e}function Rt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Pt(t,e,r,i){r||(r={});for(var s=-1,n=e.length;++s<n;){var o=e[s],a=i?i(r[o],t[o],o,r,t):void 0;Tt(r,o,void 0===a?t[o]:a)}return r}function Ct(t,e){var r,i,s=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof e?"string":"hash"]:s.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return jt(r)?r: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===r?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?r:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=At(e,t);return!(r<0)&&(r==e.length-1?e.pop():ct.call(e,r,1),!0)},_t.prototype.get=function(t){var e=this.__data__,r=At(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return At(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,i=At(r,t);return i<0?r.push([t,e]):r[i][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||_t),string:new $t}},Ot.prototype.delete=function(t){return Ct(this,t).delete(t)},Ot.prototype.get=function(t){return Ct(this,t).get(t)},Ot.prototype.has=function(t){return Ct(this,t).has(t)},Ot.prototype.set=function(t,e){return Ct(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new _t},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var r=this.__data__;if(r instanceof _t){var i=r.__data__;if(!ht||i.length<199)return i.push([t,e]),this;r=this.__data__=new Ot(i)}return r.set(t,e),this};var kt=ut?G(ut,Object):function(){return[]},Lt=function(t){return tt.call(t)};function Mt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||U.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Bt(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(pt&&Lt(new pt(new ArrayBuffer(1)))!=b||ht&&Lt(new ht)!=d||ft&&Lt(ft.resolve())!=h||mt&&Lt(new mt)!=m||gt&&Lt(new gt)!=y)&&(Lt=function(t){var e=tt.call(t),r=e==p?t.constructor:void 0,i=r?Bt(r):void 0;if(i)switch(i){case yt:return b;case xt:return d;case bt:return h;case It:return m;case qt:return y}return e});var Gt=Array.isArray;function Yt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Wt(t)}var Ft=dt||function(){return!1};function Wt(t){var e=Qt(t)?tt.call(t):"";return e==c||e==u}function Qt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Yt(t)?wt(t):function(t){if(!Ht(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Ut(t,!0,!0)}}(s,s.exports);var n=s.exports;const o=t=>({get(e,r){if("__isProxy"===r)return!0;const i=Reflect.get(e,r);return Array.isArray(i)?i:"object"==typeof i&&null!==i?i.__isProxy?i:new Proxy(i,o(t)):i},set(e,r,i,s){const o=e[r];i=f(i)&&i.__isProxy?n(i):i;const a=Reflect.set(e,r,i,s);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${b(r)}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,"]");class c{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const e=t.timeout||18e5;let r=t.headers||{};return t.url=E(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const r=[];Object.keys(e).forEach((t=>{const i=e[t];if(null==i)return;let s;Array.isArray(i)?(s=i,t+="[]"):s=[i],s.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),r.push(`${a(t)}=${a(e)}`)}))}));const i=r.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),r=Object.assign(r,this._defaultHeaders),Object.keys(r).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(r["Content-Type"]=r[t],delete r[t])})),m(t.data)&&(t.data=t.data.buffer),(g(t.data)||p(t.data))&&(r&&!r["Content-Type"]&&(r["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=r,t.timeout=e,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx&&void 0!==wx.request?l(t):d(t)}setDefaultHeader(t,e){t in this._defaultHeaders&&(""===e||null===e)?delete this._defaultHeaders[t]:this._defaultHeaders[t]=e}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,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{url:t,method:"POST",data:e}))}put(t,e,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{url:t,method:"PUT",data:e}))}}class u{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new u((e=>{t=e}));return{cancel:t,token:e}}}const d=t=>new Promise(((e,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a}=t;let c=new XMLHttpRequest;c.open(n.toUpperCase(),s,!0),c.timeout=t.timeout;const u=()=>{if(c){if(c.status>=200&&c.status<300)try{const t=JSON.parse(c.responseText);e(t)}catch(t){r(new Error("E_JSON_PARSE"+c.responseText))}else r({url:s,statusCode:c.status});c=null}};"onloadend"in c?c.onloadend=u:c.onreadystatechange=()=>{c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=()=>{c&&(r({url:s,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{r(new Error("Network Error")),c=null},c.ontimeout=()=>{r(new Error("timeout of "+t.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(o).forEach((t=>{null===i&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{c&&(c.abort(),r(t),c=null)})),c.send(i)})),l=t=>new Promise(((e,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:s,data:i,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):r({url:s,statusCode:t.statusCode})},fail(t){r("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})),p=Array.isArray,h=t=>null==t,f=t=>"object"==typeof t&&null!==t,m=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},v=()=>{const t=[],e="0123456789abcdef";for(let r=0;r<36;r++)t[r]=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("")},y=(t,e)=>t?(Object.entries(t).forEach((t=>{const[r,i]=[t[0],t[1]];if(null!==i)return f(i)&&!p(i)?(e[r]||(e[r]={}),void(e[r]=y(i,e[r]))):void(e[r]=i)})),e):e,x=/-(\w)/g,b=t=>t.replace(x,((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 r;r=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,r);for(const i in t)q(t,i)&&(r[i]=D(t[i],e));return r},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()*Math.pow(2,t)+1);return e<2&&(e=2),e>30&&(e=30),1e3*e};var _,O,S,w,T;t.EVENT=void 0,(_=t.EVENT||(t.EVENT={})).STATE="state",_.FAILED="failed",_.REQUEST_ERROR="requestError",_.POLLING_ERROR="pollingError",_.KEEPALIVE_ERROR="keepaliveError",t.STATE=void 0,(O=t.STATE||(t.STATE={}))[O.CLOSE=0]="CLOSE",O[O.JOINED=1]="JOINED",O[O.READY=2]="READY",t.ENDPOINT_TYPE=void 0,(S=t.ENDPOINT_TYPE||(t.ENDPOINT_TYPE={})).WEBAPP="webApp",S.WEBCTRL="webCtrl",S.WECHATMP="weChatMP",S.SUPERVISION="supervision",S.BIGSCREEN="bigScreen",S.DESKTOP="desktop",S.MOBILE="mobile",S.VCS="vcs",S.SIP="sip",S.H323="h323",S.PSTN="pstn",S.MULTI_STREAM="multiStream",S.MEETING_TOUCH="meetingTouch",S.MEETING_ROOMS="meetingRooms",S.RTSP="rtsp",S.RTMP_PULLER="rtmpPuller",S.GB28181="gb28181",S.TELE_PRESENCE="telePresence",t.ROLE=void 0,(w=t.ROLE||(t.ROLE={})).HOST="host",w.COHOST="coHost",w.ATTENDEE="attendee",w.AUDIENCE="audience",t.RECORD_STATUS=void 0,(T=t.RECORD_STATUS||(t.RECORD_STATUS={})).STARTED="started",T.PAUSED="paused",T.STARTING="starting",T.STOPPED="stopped";class A{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=r(),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))}reactiveData(t){if(!f(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,i,s)=>{Object.keys(t).forEach((s=>{!1===i&&s in this.data&&(t[s]=this.data[s]);const n=e=>t[s]=e,o=`${b(s)}Change`;this.emitter.on(o,n),e.set(o,n),f(t[s])&&!p(t[s])&&r(t[s],!0)}))};return r(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class U extends A{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:r}=t;("full"===e||"update"===e)&&y(r,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;y({participantCount:e},this.data)}))}subject(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:r}=this.ctx.config.request;return t.credential=t.credential||r,this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:r},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/operationRecord`,t)}getImConfig(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:r}=this.ctx.config.request;return t.credential=t.credential||r,this.ctx.request.get(`${e}im/config`,{params:t})}sendMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/chat/send`,t)}))}getUserInfo(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}participantDetail?meetingID=${r}`,t)}))}}function j(t){const e=[],{isInLobby:r}=t.modules.me.data;return r?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((r=>{const i=t.modules[r]._topic();i&&(Array.isArray(i)?i.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(i)||e.push(i))})),e)}function R(t,r){return e(this,void 0,void 0,(function*(){const{meetingID:e,clientID:i}=r.config.request,s=yield r.request.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:i,meetingId:e},inboxes:t}),n=[];return s.data&&Object.keys(s.data).forEach((t=>{n.push({name:t,seqId:s.data[t].maxSeqId,limit:200})})),n}))}function P(t,r){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i,clientID:s}=r.config.request,n=yield r.request.post(`${e}meetings/${i}/subscribe`,{endpointID:s,topics:t}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{r.emitter.emit(t.event,t)}))}))}function C(t,r,i){return e(this,void 0,void 0,(function*(){const{inboxes:s,clientID:n,meetingID:o,cancelToken:a,status:c}=r;if(yield(()=>e(this,void 0,void 0,(function*(){let e;try{e=yield t.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:s},{cancelToken:a})}catch(d){return c.attempts++,void(d&&"request abort"!==d.type&&console.error(d))}if(!e)return console.error("polling error: ","response is null"),void c.attempts++;const{data:r={},bizCode:u,error:d}=e;if(u&&900408!==u)return console.error("polling error: ",JSON.stringify(d)),void c.attempts++;c.attempts=0,r&&Object.keys(r).forEach((t=>{const e=s.find((e=>e.name===t));e&&(e.seqId=r[t].maxSeqId,r[t].items&&r[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].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(r.onError&&r.onError({message:"polling Max Attempts"}));const u=c.attempts?$(c.attempts):0;c.timer=setTimeout((()=>{c.running&&C(t,r,i)}),u)}))}const N=(r,i)=>e(void 0,void 0,void 0,(function*(){const{meetingID:e,clientID:s}=i.config.request;i.status.polling.running=!0,C(i.request,{inboxes:r,clientID:s,meetingID:e,cancelToken:i.config.request.cancelToken.token,status:i.status.polling,onError:e=>{i.emitter.emit(t.EVENT.POLLING_ERROR,e)}},(t=>{i.emitter.emit(t.event,t)}))}));function k(t){t.status.polling.running=!1,t.status.polling.attempts=0,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=u.source()}function L(t,r){return e(this,void 0,void 0,(function*(){const{meetingID:i,userID:s,status:n,cancelToken:o,onError:a}=r;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/${s}/keepalive`,{},{cancelToken:o.token})}catch(c){return n.attempts++,void console.error(c)}if(!e)return;const{data:r={},bizCode:a,error:c}=e;if(900200!==a&&900408!==a&&901323!==a)return n.attempts++,void console.error("keepalive ",a,c);const u=r.interval||"";if(!u)return n.attempts++,void console.error("keepalive ",a,c);n.interval=u,n.attempts=0})))(),!n.running)return;if(n.attempts>10)return console.error("keepalive Max Attempts"),void(a&&a({message:"keepalive Max Attempts"}));const c=n.attempts?$(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&L(t,r)}),c)}))}function M(r){return e(this,void 0,void 0,(function*(){const{meetingID:e,userID:i}=r.config.request;r.status.keepalive.running=!0,L(r.request,{meetingID:e,userID:i,cancelToken:r.config.request.cancelToken.token,status:r.status.keepalive,onError:e=>{r.emitter.emit(t.EVENT.KEEPALIVE_ERROR,e)}})}))}const H=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)};var B;t.MeEvent=void 0,(B=t.MeEvent||(t.MeEvent={})).INIT="meInit",B.UPDATE="meUpdate",B.UPDATE_USER_STATE="updateUserState",B.ROLECHANGE="meRoleChange",B.AUDIOCHANGE="meAudioChange",B.HANDUPCHANGE="meHandupChange",B.SETAUDIO="setAudio",B.VIDEOCHANGE="meVideoChange",B.SETVIDEO="setVideo",B.SHARECHANGE="meShareChange",B.WHITEBOARDCHANGE="meWhiteBoardChange",B.DISPLAYNAMECHANGE="meDisplayNameChange",B.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",B.LOBBYCHANGE="meLobbyChange",B.BARRAGECHANGE="meBarrageChange",B.PERSONALLAYOUTCHANGE="personalLayoutChange",B.PERMCHANGE="permChange",B.LEAVE="leave";class V extends A{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const r=r=>e(this,void 0,void 0,(function*(){if("role"in r&&r.role!==this.data.role){const e=this.data.role;y({role:r.role},this.data),r.role!==t.ROLE.AUDIENCE&&e!==t.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(t.MeEvent.ROLECHANGE,r.role),this.ctx.emitter.emit(t.MeEvent.ROLECHANGE,r.role)}})),i=e=>{var r,i,s,n,o,a,c;if("audio"in e){const{deviceOn:u,sendOn:d,recvOn:l,opBy:p}=e.audio;(!h(u)&&u!==(null===(r=this.data.audio)||void 0===r?void 0:r.deviceOn)||!h(d)&&d!==(null===(i=this.data.audio)||void 0===i?void 0:i.sendOn)||!h(l)&&l!==(null===(s=this.data.audio)||void 0===s?void 0:s.recvOn)||!h(p)&&p!==(null===(n=this.data.audio)||void 0===n?void 0:n.opBy))&&(y({audio:e.audio},this.data),this.emitter.emit(t.MeEvent.AUDIOCHANGE,{deviceOn:h(u)?null===(o=this.data.audio)||void 0===o?void 0:o.deviceOn:u,sendOn:h(d)?null===(a=this.data.audio)||void 0===a?void 0:a.sendOn:d,recvOn:h(d)?null===(c=this.data.audio)||void 0===c?void 0:c.recvOn:l,opBy:p,changeData:Object.assign({},e.audio)}))}},s=e=>{var r,i,s,n,o,a;if("video"in e){const{deviceOn:c,sendOn:u,opBy:d,blocked:l}=e.video;(!h(c)&&c!==(null===(r=this.data.video)||void 0===r?void 0:r.deviceOn)||!h(u)&&u!==(null===(i=this.data.video)||void 0===i?void 0:i.sendOn)||!h(l)&&l!==(null===(s=this.data.video)||void 0===s?void 0:s.blocked))&&(y({video:e.video},this.data),this.emitter.emit(t.MeEvent.VIDEOCHANGE,{deviceOn:h(c)?null===(n=this.data.video)||void 0===n?void 0:n.deviceOn:c,sendOn:h(u)?null===(o=this.data.video)||void 0===o?void 0:o.sendOn:u,blocked:h(u)?null===(a=this.data.video)||void 0===a?void 0:a.blocked:l,opBy:d,changeData:Object.assign({},e.video)}))}},n=e=>{var r,i,s,n,o,a,c,u;if("share"in e){const{deviceOn:o,sendOn:a,opBy:c}=e.share;(!h(o)&&o!==(null===(r=this.data.share)||void 0===r?void 0:r.deviceOn)||!h(a)&&a!==(null===(i=this.data.share)||void 0===i?void 0:i.sendOn))&&(y({share:e.share},this.data),this.emitter.emit(t.MeEvent.SHARECHANGE,{deviceOn:h(o)?null===(s=this.data.share)||void 0===s?void 0:s.deviceOn:o,sendOn:h(a)?null===(n=this.data.share)||void 0===n?void 0:n.sendOn:a,opBy:c}))}if("whiteboard"in e){const{deviceOn:r,sendOn:i,opBy:s}=e.whiteboard;(!h(r)&&r!==(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))&&(y({whiteboard:e.whiteboard},this.data),this.emitter.emit(t.MeEvent.WHITEBOARDCHANGE,{deviceOn:h(r)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.deviceOn:r,sendOn:h(i)?null===(u=this.data.whiteboard)||void 0===u?void 0:u.sendOn:i,opBy:s}))}},o=e=>{e.displayName&&e.displayName!==this.data.displayName&&(y({displayName:e.displayName},this.data),this.data.displayNamePinyin=V.setDisplayNamePinyinProp?V.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&&(y({isHandUp:e.isHandUp},this.data),this.emitter.emit(t.MeEvent.HANDUPCHANGE,e.isHandUp))},c=e=>{"isSpotlightVideo"in e&&(y({isSpotlightVideo:e.isSpotlightVideo},this.data),this.emitter.emit(t.MeEvent.SPOTLIGHTVIDEOCHANGE,e.isSpotlightVideo))},u=r=>e(this,void 0,void 0,(function*(){if("isInLobby"in r&&r.isInLobby!==this.data.isInLobby){y({isInLobby:r.isInLobby},this.data);const e=!1===r.isInLobby?"inLobbyChange":void 0;yield this.rePolling(e),this.emitter.emit(t.MeEvent.LOBBYCHANGE,r.isInLobby),this.ctx.emitter.emit(t.MeEvent.LOBBYCHANGE,r.isInLobby)}})),d=r=>e(this,void 0,void 0,(function*(){const{event:e,state:i,body:s}=r;"personalLayout"===e&&("full"===i?y({personalLayout:s},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 r=null;if(!e.barrage.wordsDisplayStatus)return r=null,delete e.barrage,this.data.barrage=r||void 0,void this.emitter.emit(t.MeEvent.BARRAGECHANGE,r);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};r=i;let{role:s}=this.data;if(this.data.endpointType===t.ENDPOINT_TYPE.SUPERVISION){const{info:e}=this.ctx.modules;s="webinar"===e.meetingType?t.ROLE.AUDIENCE:t.ROLE.ATTENDEE}if(s===t.ROLE.HOST||s===t.ROLE.COHOST?r=e.barrage.receiver.host?i:null:s===t.ROLE.ATTENDEE?r=e.barrage.receiver.attendee?i:null:s===t.ROLE.AUDIENCE&&(r=e.barrage.receiver.audience?i:null),!r&&e.barrage.receiver.designated){const{userID:t,subjectID:s}=this.data,{designatedUsers:n}=e.barrage;r=-1!==n.findIndex((e=>e.userID===t||s&&e.subjectID===s))?i:null}delete e.barrage,this.data.barrage=r||void 0,this.emitter.emit(t.MeEvent.BARRAGECHANGE,r)},p=e=>{"perm"in e&&(y({perm:e.perm},this.data),this.emitter.emit(t.MeEvent.PERMCHANGE,e.perm))},f=e=>{"leave"in e&&!0===e.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),k(this.ctx),H(this.ctx),it(this.ctx),this.emitter.emit(t.MeEvent.LEAVE,e.resultInfo),this.ctx.cleanup(e.resultInfo))},m=e=>{r(e),i(e),s(e),n(e),o(e),a(e),u(e),c(e),l(e),p(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=>{y(t,this.data),this.data.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(t.MeEvent.UPDATE,(t=>{m(t),y(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=>e(this,void 0,void 0,(function*(){const{state:e,body:r={users:[]}}=t;if("delete"===e){const t=r.users[0];return t.leave=!0,void f(t)}let i=r.users.find((t=>t.userID===this.data.userID));i||r.users.length&&(i=r.users[0]),i?(m(i),y(i,this.data)):console.warn("me ",e,r)})))),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)}))}updateUserState(e,r=!1){if(!r){const{role:r,initialMediaState:i}=this.data;e.audio.sendOn=e.audio.sendOn&&i.audio.sendOn,e.video.sendOn=e.video.sendOn&&i.video.sendOn,r===t.ROLE.AUDIENCE&&(e.audio.sendOn=!1,e.video.sendOn=!1)}const{prefix:{ctrl:i},meetingID:s}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,y(e,this.data),this.ctx.request.post(`${i}meetings/${s}/updateUserState`,e)}rePolling(r){return e(this,void 0,void 0,(function*(){const{ctx:e}=this;k(e);const i=j(e),s=yield R(i,e);if(r&&this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,{data:this.data,event:r}),yield P(i,e),"undefined"!=typeof Worker&&e.worker){const{meetingID:t,clientID:r,userID:n}=e.config.request;e.worker.postMessage({inboxes:s,topics:i,clientID:r,meetingID:t,userID:n,rePolling:!0})}else yield N(s,e)}))}}class G extends A{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:r}=t;if(e&&e.users){if("full"===r)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=G.setUserGroupIDs?G.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"===r&&-1!==e?y(t,this.data.callRecordUsers[e]):"update"===r&&-1===e&&(t.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=G.setUserGroupIDs?G.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const r=((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1})(this.data.callRecordUsers,(e=>{let r=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":r=t.account===e.contact;break;case"subjectID":r=t.subjectID===e.contact}return r}));r>-1&&(this.data.callRecordUsers[r].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/cancelInvite`,t)}}var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},F={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",n="[object Boolean]",o="[object Date]",a="[object Function]",c="[object GeneratorFunction]",u="[object Map]",d="[object Number]",l="[object Object]",p="[object Promise]",h="[object RegExp]",f="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",b="[object Float32Array]",I="[object Float64Array]",q="[object Int8Array]",D="[object Int16Array]",E="[object Int32Array]",$="[object Uint8Array]",_="[object Uint8ClampedArray]",O="[object Uint16Array]",S="[object Uint32Array]",w=/\w*$/,T=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,U={};U[s]=U["[object Array]"]=U[y]=U[x]=U[n]=U[o]=U[b]=U[I]=U[q]=U[D]=U[E]=U[u]=U[d]=U[l]=U[h]=U[f]=U[m]=U[g]=U[$]=U[_]=U[O]=U[S]=!0,U["[object Error]"]=U[a]=U[v]=!1;var j="object"==typeof self&&self&&self.Object===Object&&self,R="object"==typeof Y&&Y&&Y.Object===Object&&Y||j||Function("return this")(),P=e&&!e.nodeType&&e,C=P&&t&&!t.nodeType&&t,N=C&&C.exports===P;function k(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function M(t,e,r,i){var s=-1,n=t?t.length:0;for(i&&n&&(r=t[++s]);++s<n;)r=e(r,t[s],s,t);return r}function H(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(e){}return r}function B(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function V(t,e){return function(r){return t(e(r))}}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var F,W=Array.prototype,Q=Function.prototype,J=Object.prototype,z=R["__core-js_shared__"],K=(F=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=N?R.Buffer:void 0,it=R.Symbol,st=R.Uint8Array,nt=V(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=V(Object.keys,Object),pt=Pt(R,"DataView"),ht=Pt(R,"Map"),ft=Pt(R,"Promise"),mt=Pt(R,"Set"),gt=Pt(R,"WeakMap"),vt=Pt(Object,"create"),yt=Mt(pt),xt=Mt(ht),bt=Mt(ft),It=Mt(mt),qt=Mt(gt),Dt=it?it.prototype:void 0,Et=Dt?Dt.valueOf:void 0;function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function St(t){this.__data__=new _t(t)}function wt(t,e,r){var i=t[e];Z.call(t,e)&&Ht(i,r)&&(void 0!==r||e in t)||(t[e]=r)}function Tt(t,e){for(var r=t.length;r--;)if(Ht(t[r][0],e))return r;return-1}function At(t,e,r,i,p,v,T){var A;if(i&&(A=v?i(t,p,v,T):i(t)),void 0!==A)return A;if(!Ft(t))return t;var j=Bt(t);if(j){if(A=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}(t,A)}else{var R=Nt(t),P=R==a||R==c;if(Gt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(R==l||R==s||P&&!v){if(H(t))return v?t:{};if(A=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:Ft(e=nt(t))?ot(e):{};var e}(P?{}:t),!e)return function(t,e){return jt(t,Ct(t),e)}(t,function(t,e){return t&&jt(e,Wt(e),t)}(A,t))}else{if(!U[R])return v?t:{};A=function(t,e,r,i){var s=t.constructor;switch(e){case y:return Ut(t);case n:case o:return new s(+t);case x:return function(t,e){var r=e?Ut(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,i);case b:case I:case q:case D:case E:case $:case _:case O:case S:return function(t,e){var r=e?Ut(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,i);case u:return function(t,e,r){return M(e?r(B(t),!0):B(t),k,new t.constructor)}(t,i,r);case d:case m:return new s(t);case h:return function(t){var e=new t.constructor(t.source,w.exec(t));return e.lastIndex=t.lastIndex,e}(t);case f:return function(t,e,r){return M(e?r(G(t),!0):G(t),L,new t.constructor)}(t,i,r);case g:return Et?Object(Et.call(t)):{}}}(t,R,At,e)}}T||(T=new St);var C=T.get(t);if(C)return C;if(T.set(t,A),!j)var N=r?function(t){return function(t,e,r){var i=e(t);return Bt(t)?i:function(t,e){for(var r=-1,i=e.length,s=t.length;++r<i;)t[s+r]=e[r];return t}(i,r(t))}(t,Wt,Ct)}(t):Wt(t);return function(t,e){for(var r=-1,i=t?t.length:0;++r<i&&!1!==e(t[r],r););}(N||t,(function(s,n){N&&(s=t[n=s]),wt(A,n,At(s,e,r,i,n,t,T))})),A}function Ut(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function jt(t,e,r,i){r||(r={});for(var s=-1,n=e.length;++s<n;){var o=e[s],a=i?i(r[o],t[o],o,r,t):void 0;wt(r,o,void 0===a?t[o]:a)}return r}function Rt(t,e){var r,i,s=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof e?"string":"hash"]:s.map}function Pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Ft(t)||(e=t,K&&K in e))&&(Yt(t)||H(t)?et:T).test(Mt(t));var e}(r)?r: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===r?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?r:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=Tt(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},_t.prototype.get=function(t){var e=this.__data__,r=Tt(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return Tt(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,i=Tt(r,t);return i<0?r.push([t,e]):r[i][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||_t),string:new $t}},Ot.prototype.delete=function(t){return Rt(this,t).delete(t)},Ot.prototype.get=function(t){return Rt(this,t).get(t)},Ot.prototype.has=function(t){return Rt(this,t).has(t)},Ot.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new _t},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var r=this.__data__;if(r instanceof _t){var i=r.__data__;if(!ht||i.length<199)return i.push([t,e]),this;r=this.__data__=new Ot(i)}return r.set(t,e),this};var Ct=ut?V(ut,Object):function(){return[]},Nt=function(t){return tt.call(t)};function kt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||A.test(t))&&t>-1&&t%1==0&&t<e}function Lt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Mt(t){if(null!=t){try{return X.call(t)}catch(Y){}try{return t+""}catch(Y){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(pt&&Nt(new pt(new ArrayBuffer(1)))!=x||ht&&Nt(new ht)!=u||ft&&Nt(ft.resolve())!=p||mt&&Nt(new mt)!=f||gt&&Nt(new gt)!=v)&&(Nt=function(t){var e=tt.call(t),r=e==l?t.constructor:void 0,i=r?Mt(r):void 0;if(i)switch(i){case yt:return x;case xt:return u;case bt:return p;case It:return f;case qt:return v}return e});var Bt=Array.isArray;function Vt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!Yt(t)}var Gt=dt||function(){return!1};function Yt(t){var e=Ft(t)?tt.call(t):"";return e==a||e==c}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wt(t){return Vt(t)?function(t,e){var r=Bt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Vt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==s)}(t)?function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],i=r.length,n=!!i;for(var o in t)!e&&!Z.call(t,o)||n&&("length"==o||kt(o,i))||r.push(o);return r}(t):function(t){if(!Lt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return At(t,!0,!0)}}(F,F.exports);const W=Array.isArray,Q=(t,e)=>t?(Object.entries(t).forEach((t=>{const[r,i]=[t[0],t[1]];if(null!==i)return(t=>"object"==typeof t&&null!==t)(i)&&!W(i)?(e[r]||(e[r]={}),void(e[r]=Q(i,e[r]))):void(e[r]=i)})),e):e;class J extends A{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}_topic(){const{role:e,endpointType:r}=this.ctx.modules.me.data;return r===t.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:e===t.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const e=(e,{event:r,state:i})=>{if(e.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:s={}}=e;if("delete"!==i||"delete"===i&&[901357,901358,901352,901351,901350,901349].includes(s.bizCode||-1))return void this.ctx.emitter.emit(t.MeEvent.UPDATE,e);let n=!1;switch(r){case"interactiveUsers":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))},r=({updateUsers:t,state:r,sourceKey:i})=>{if("full"===r)return this.data[i]=t.map((t=>(t.displayNamePinyin=J.setDisplayNamePinyinProp?J.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=J.setUserGroupIDs?J.setUserGroupIDs(t.groupIDs||[],t.endpointType):t.groupIDs,e(t,{event:i,state:r}),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:s,emitter:n}=this;return t.forEach((t=>{const o=s[i].findIndex((e=>t.userID===e.userID));if("delete"===r&&-1!==o){const[e]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:e,resultInfo:t.resultInfo})}else if("update"===r&&-1!==o){const e=this.data[i][o];this.updateUserProps(t,e),y(t,e),this.data[i][o]=D(e),this.emitter.emit(`${i}Update`,{user:this.data[i][o]})}else"update"===r&&-1===o&&(t.displayNamePinyin=J.setDisplayNamePinyinProp?J.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=J.setUserGroupIDs?J.setUserGroupIDs(t.groupIDs||[],t.endpointType):t.groupIDs,s[i].push(t),this.emitter.emit(`${i}Add`,{user:t,resultInfo:t.resultInfo}));e(t,{event:i,state:r})})),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}=t;r({updateUsers:i.users,state:e,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"advCtrlUsers"})}))}reactiveData(t){if(!f(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,i)=>{Object.keys(t).forEach((s=>{!1===i&&s in this.data&&(t[s]=this.data[s]);const n=e=>t[s]=e.users.map((t=>t)),o=`${b(s)}Change`;this.emitter.on(o,n),e.set(o,n),f(t[s])&&!p(t[s])&&r(t[s],!0)}))};return r(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:[]}}getUserByUserID(t){if(t)return this.data.interactiveUsers.concat(this.data.lobbyUsers).concat(this.data.broadcastUsers).concat(this.data.advCtrlUsers).find((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=J.setDisplayNamePinyinProp?J.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/whiteboard`,e)}annotate(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/annotate`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/claimHost`,t)}}function z(e){const{baseURL:i,modules:s,worker:n,singleton:o}=e;s.findIndex((t=>t===V))<0&&s.push(V),s.findIndex((t=>t===U))<0&&s.push(U);const a=e.clientID||`${v()}_${((t=new Date,e)=>{const r={"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 r)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?r[i]:("00"+r[i]).substr((""+r[i]).length)));return e})(new Date,"MMddHHmmss")}`,d={config:{baseURL:i,modules:s,singleton:o||!1,request:{cancelToken:u.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:a,location:"",meetingID:"",ctrlID:"",sessionID:"",userID:-1,voteTk:"",credential:""}},worker:n,emitter:r(),request:new c({baseURL:i,beforeRequest:t=>{t.headers["X-Y-Request-Id"]=v(),t.timeout=18e5},error:e=>{d.emitter.emit(t.EVENT.REQUEST_ERROR,e)}}),modules:{},state:t.STATE.CLOSE,status:{polling:{running:!1,attempts:0,timer:null},keepalive:{running:!1,attempts:0,timer:null,interval:20}},cleanup:e=>{d.state!==t.STATE.CLOSE&&(d.worker&&d.worker.terminate(),d.config.request.location="",d.config.request.meetingID="",d.config.request.ctrlID="",d.config.request.sessionID="",d.config.request.userID=-1,d.config.request.voteTk="",d.config.request.credential="",d.status.polling={running:!1,attempts:0,timer:null},d.status.keepalive={running:!1,attempts:0,timer:null,interval:20},d.request.setDefaultHeader("X-Y-Location",""),d.request.setDefaultHeader("X-Y-Ctrl-Id",""),d.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(d.modules).forEach((t=>{d.modules[t].cleanup()})),d.state=t.STATE.CLOSE,d.emitter.emit(t.EVENT.STATE,{state:d.state,reason:e}))}};return d}function K(e){const r=z(e);return r.worker&&("undefined"!=typeof Worker?r.worker.postMessage({baseURL:r.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!p(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const r=new t(e);e.modules[r.moduleName]=r}))}(r.config.modules,r),r.emitter.on(t.EVENT.POLLING_ERROR,(t=>{Z(r)({resultInfo:t})})),r.emitter.on(t.EVENT.KEEPALIVE_ERROR,(t=>{Z(r)({resultInfo:t})})),Object.assign({config:r.config,request:r.request,get state(){return r.state},on:r.emitter.on,off:r.emitter.off,join:X(r),leave:Z(r),end:tt(r),endMeeting:et(r)},r.modules)}function X(r){return function(i){var s;return e(this,void 0,void 0,(function*(){const{clientID:e}=r.config.request,n=`${null===(s=i.endpointType)||void 0===s?void 0:s.toLocaleUpperCase()}${e}_${i.meetingNum}`;r.config.request.sessionID=n,r.request.setDefaultHeader("X-Y-Session-Id",n),r.request.setDefaultHeader("X-Y-Location","");const{prefix:o}=r.config.request,a=yield r.request.get(`${o.ctrl}credential`,{params:{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},headers:{"X-Y-Endpoint-Type":i.endpointType}}),{credential:c="",location:u=""}=a&&a.data||{};if(r.config.request.location=u,r.request.setDefaultHeader("X-Y-Location",u),!c)return r.emitter.emit(t.EVENT.FAILED,{bizCode:a.bizCode,data:a.data}),a;delete i.pwd,delete i.url,r.config.request.credential=c;const d={displayName:i.displayName,userAgent:i.userAgent,clientID:e};i.groupIDs&&i.account&&(d.groupIDs=i.groupIDs,d.account=i.account,d.groupName=i.groupName),i.mediaContentReq&&(d.mediaContentReq=i.mediaContentReq);const l=i.hostKey?`&hostKey=${i.hostKey}`:"",p=yield r.request.post(`${o.ctrl}join?meetingNum=${i.meetingNum}&credential=${c}${l}`,d,{headers:{"X-Y-Endpoint-Type":i.endpointType,"X-Y-Endpoint-Id":e}});if(!p||p&&p.ret<=-1)return r.emitter.emit(t.EVENT.FAILED,{bizCode:p.bizCode,data:p.data}),p;const{meetingID:h="",ctrlID:f="",user:m={},mediaContent:g={},initialMediaState:v={},tk:y=""}=p.data;r.config.request.meetingID=h,r.config.request.ctrlID=f,r.config.request.userID=m.userID,r.config.request.voteTk=y,r.config.request.credential=c,r.request.setDefaultHeader("X-Y-Ctrl-Id",f),r.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},m),{mediaContent:g,initialMediaState:v})),r.state=t.STATE.JOINED,r.emitter.emit(t.EVENT.STATE,{state:r.state});const x=()=>{r.state!==t.STATE.READY&&(r.state=t.STATE.READY,r.emitter.emit(t.EVENT.STATE,{state:r.state}))},b=j(r),I=yield R(b,r);return yield P(b,r),"undefined"!=typeof Worker&&r.worker?(r.status.polling.running=!0,r.status.keepalive.running=!0,r.worker.postMessage({ctrlID:f,location:u,sessionID:n,inboxes:I,topics:b,clientID:e,meetingID:h,userID:m.userID,status:!0}),r.worker.onmessage=t=>{"pollingStarted"!==t.data?"keepaliveStarted"!==t.data&&("pollingStopped"!==t.data?"keepaliveStopped"!==t.data?"pollingError"!==t.data?"keepaliveError"!==t.data?r.emitter.emit(t.data.event,t.data):Z(r)({resultInfo:{message:"keepalive Max Attempts"}}):Z(r)({resultInfo:{message:"polling Max Attempts"}}):r.status.keepalive.running=!1:r.status.polling.running=!1):x()}):(N(I,r),x(),M(r)),p.data=Object.assign(Object.assign({},p.data),a.data),p}))}}function Z(t){return function(r){return e(this,void 0,void 0,(function*(){const e=r&&r.resultInfo;r||(r={resultInfo:{bizCode:901359}});const{prefix:i,meetingID:s}=t.config.request;let n;try{n=yield t.request.post(`${i.ctrl}meetings/${s}/leave`,r)}catch(o){console.error(o)}return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1}),k(t),H(t),it(t),t.cleanup(e),n}))}}function tt(t){return function(){return e(this,void 0,void 0,(function*(){const{prefix:e,meetingID:r}=t.config.request,i=yield t.request.post(`${e.ctrl}meetings/${r}/end`);return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1}),k(t),H(t),it(t),t.cleanup(),i}))}}function et(t){return function(r){return e(this,void 0,void 0,(function*(){const{prefix:e}=t.config.request;return yield t.request.post(`${e.ctrl}meetingNum/${r}/end`)}))}}class rt{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=K(t)}static getInstance(t){return this.instance?this.instance:this.instance=new rt(t)}}function it(t){if(t.config.singleton){const{baseURL:e,modules:r,singleton:i}=t.config,s={baseURL:e,modules:r,worker:t.worker,singleton:i},n=rt.getInstance(s);n&&(n.meeting=K(s))}}return Object.defineProperty(rt,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),t.Asr=class extends A{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"}),e.resultInfo&&(this.emitter.emit("resultInfoChange",e.resultInfo),delete e.resultInfo),y(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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/transcript/status`,t)}))}},t.AudioRecording=class extends A{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:r}=t;e&&(r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),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),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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/audioRecording/status`,t)}))}},t.Chat=class extends A{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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/chat/msg`,t)}))}historyMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/chat/historyMsg`,t)}))}sendMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/chat/send`,t)}))}},t.FocusUsers=class extends A{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:r}=t;if(r)return this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=r.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(r.focusUsers):"delete"===e&&(r.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),this.data}))}setFocusUsers(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/focusUser`,t)}},t.Info=U,t.Interpretation=class extends A{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:r}=t;"full"===r?(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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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=G,t.LiveStream=class extends A{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:r,stime:i}=t;if(!r)return;if(i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),"full"===e){const{liveStreams:t=[],defaultLayout:e}=r;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 Q({status:i},this.data),this.data}if("delete"===e){const{liveStreams:t=[]}=r;return t.forEach((t=>{const e=this.data.liveStreams.findIndex((e=>e.data&&e.data.index===t.data.index));-1!==e&&this.data.liveStreams.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreams)}const s=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));const r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?r.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):r.splice(e,1,{platform:r[e].platform||"",status:t.requesting?r[e].status||"stopped":t.status||""}),this.data.status=r};void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:n=[]}=r;return n.forEach((t=>{if("thirdParty"!==t.platform)return void s(t);t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>{var r,i;return(null===(r=e.data)||void 0===r?void 0:r.index)===(null===(i=t.data)||void 0===i?void 0:i.index)}));-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));const r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>{var r;return e.index===(null===(r=t.data)||void 0===r?void 0:r.index)})),-1===e?r.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||"",index:t.data&&t.data.index}):r.splice(e,1,{platform:r[e].platform||"",status:t.requesting?r[e].status||"stopped":t.status||"",index:t.data&&t.data.index}),this.data.status=r})),this.data}))}setStatus(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/status`,t)}))}liveStreamDescription(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/description`,t)}))}liveStreamSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/setting`,t)}))}liveStreamDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/delete`,t)}))}liveStreamLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/pushSetting`,t)}))}},t.LiveStreaming=class extends A{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:r,stime:i}=t;if(!r)return;if(i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=r;if(!t.length)return;const i=[],s=[];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)||""}),s.push(t))})),this.data.liveStreaming=s,y({status:i,defaultConfig:e},this.data),this.data}if("delete"===e){const{liveStreaming:t=[]}=r;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:s=[],defaultConfig:n}=r;return s.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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?r.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):r.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?r[e].status||"stopped":t.status}),this.data.status=r})),n&&y({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming),this.data}))}setStatus(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStreaming/status`,t)}))}liveStreamingSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStreaming/setting`,t)}))}liveStreamingDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStreaming/delete`,t)}))}liveStreamingDetail(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStreaming/detail`,t)}))}},t.Me=V,t.Qa=class extends A{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;f(e)&&!p(e)?this.qaUpdate(this.data.questions,e):e.forEach((t=>this.qaUpdate(this.data.questions,t)))}))}cleanup(){this.data={questions:new Map,topSort:0}}qaUpdate(t,e){let r=t.get(e.question.id);const{clientID:i}=this.ctx.config.request;switch(e.command){case"addQuestion":r=this.createQuestion(e.question),t.set(e.question.id,r),this.emitter.emit("questionAdd",{question:r,selfSent:r.sender.endpointID===i});break;case"dismissQuestion":if(!r)break;r.sender.endpointID!==i?r.status="close":r.isTop=!1,t.set(e.question.id,r),this.emitter.emit("questionUpdate",{question:r});break;case"reopenQuestion":r?(r.status="open",r.isTop=e.question.isTop,t.set(e.question.id,r)):(r=this.createQuestion(e.question),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"updateQuestion":r?(r=Object.assign(Object.assign(Object.assign({},r),e.question),{topSort:e.question.isTop?this.data.topSort++:0}),t.set(e.question.id,r)):(r=this.createQuestion(e.question),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"deleteQuestion":if(!r)break;r.sender.endpointID!==i?t.delete(e.question.id):(r.status="delete",r.isTop=!1,r.answers.clear(),t.set(e.question.id,r)),this.emitter.emit("questionDelete",{question:r});break;case"answerQuestion":r?r.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(r=this.createQuestion(e.question),r.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"deleteAnswer":r&&(r.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:r}))}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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/qa`,t)}))}},t.Recording=class extends A{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:r,stime:i}=t;if(r)return i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),this.data.isPracticeSession="started"===r.status&&this.data.status===r.status&&0===r.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),r),r.status&&(this.data.recording.requesting="starting"===r.status,this.data.status="starting"!==r.status?r.status:"started"===this.data.status?"stopped":this.data.status),(r.status&&"started"===r.status||void 0!==r.isReconnecting&&!r.isReconnecting)&&this.setMainRecordPromptCount(0),r.backupRecord?(r.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===r.backupRecord.status,this.data.backupRecordStatus="starting"!==r.backupRecord.status?r.backupRecord.status:this.data.backupRecordStatus),(r.backupRecord.status&&"started"===r.backupRecord.status||void 0!==r.backupRecord.isReconnecting&&!r.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",r.resultInfo&&this.emitter.emit("resultInfoChange",r.resultInfo),r.backupRecord&&r.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",r.backupRecord.resultInfo),["full","update"].includes(e)?(r.recordUsers&&(this.data.recording.recordUsers=r.recordUsers),this.data):void 0}))}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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/status`,t)}))}layout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/status`,t)}))}designatedUsers(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/layout`,t)}))}},t.RemoteDesktop=class extends A{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,r){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${i}/users/${t}/remoteDesktop`,r)}))}},t.RollCall=class extends A{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:r}=t;r&&("full"===e||"update"===e?(this.data.index=r.index,this.data.userID=r.userID,this.data.type=r.type,this.data.nextUserID=r.nextUserID):"delete"===e&&(this.data.type=r.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:r}=t;r&&("full"===e?(this.data.rollcallList=r.rollcallList,this.data.rollcallUserLayout=r.rollcallUserLayout,this.data.hostLayout=r.hostLayout,this.data.commonUserLayout=r.commonUserLayout):"update"===e&&(r.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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/rollcall/setting`,t)}},t.Setting=class extends A{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:r}=t;["full","update"].includes(e)&&y(r,this.data)}))}reactiveData(t){if(!f(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,i,s)=>{Object.keys(t).forEach((n=>{if(!1===i&&n in this.data&&(t[n]=this.data[n]),s<1){const r=e=>t[n]=e,i=`${b(n)}Change`;this.emitter.on(i,r),e.set(i,r)}if(f(t[n])&&!p(t[n])){r(t[n],!0,s+1)}}))};return r(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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/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`)}))}},t.ShouldJoinUsers=class extends A{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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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 A{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(e=>{const{body:r}=e;if(!r||!r.userIDs)return;this.data.userIDs=r.userIDs;r.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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/spotlight`,t)}},t.Transcript=class extends A{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}historyMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/transcript/historyMsg`,t)}))}},t.Users=J,t.View=class extends A{constructor(t){super(t,"view")}_topic(){const{endpointType:e,role:r}=this.ctx.modules.me.data;return e===t.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:r===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:r,body:i}=t;i&&("meetingView"===r?Object.keys(i).forEach((t=>{this.data[t]=i[t]})):this.data[e]=i)}updatePersonalLayouts(t){const{state:e,body:r}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((t=>{const{subscriber:r={userID:-1}}=t,i=r.userID||r.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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/hostLayout`,t)}))}attendeeLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/attendeeLayout`,t)}))}audienceLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/audienceLayout`,t)}))}personalLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/personalLayout`,t)}))}personalLayoutDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/personalLayout/delete`,t)}))}virtualClassLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.get(`${e}meetings/${r}/view/presetLayout`,{params:t})}))}setPresetLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/presetLayout`,t)}))}presetLayoutApply(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/presetLayout/apply`,t)}))}presetLayoutApplyUser(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/presetLayout/applyUser`,t)}))}},t.Vote=class extends A{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:r}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=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:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${r}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${r}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}meetings/${r}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.post(`${r}meetings/${i}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.post(`${r}meetings/${i}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/delete`,t)}voteInProgress(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/vote/inProgress`,{params:{tk:t&&t.tk||i}})}},t.Words=class extends A{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(e=>{this.data.timer&&clearTimeout(this.data.timer);const{state:r,body:i,pollingSeqId:s}=e;if(!i)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data});"full"===r&&(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&this.data.barrageRecord.pop(),s&&(this.data.barrageRecord=[{id:s,content:i.content,time:(new Date).getTime(),durationType:i.durationType,duration:1e3*i.duration},...this.data.barrageRecord]),i.wordsDisplayStatus=!0,-1!==i.duration&&(this.data.timer=setTimeout((()=>{i.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=i.wordsDisplayStatus,this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data})}),1e3*i.duration)),y(i,this.data),this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage: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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/barrage`,t)}))}deleteBarrage(){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}/deleteBarrage`)}))}},t.createMeeting=function(t){return t.singleton?rt.getInstance(t).meeting:K(t)},t.reset=it,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]",p="[object Promise]",m="[object RegExp]",f="[object Set]",g="[object String]",v="[object Symbol]",x="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",D="[object Int8Array]",E="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",S="[object Uint8ClampedArray]",T="[object Uint16Array]",A="[object Uint32Array]",R=/\w*$/,_=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,C={};C[n]=C["[object Array]"]=C[y]=C[b]=C[o]=C[a]=C[I]=C[q]=C[D]=C[E]=C[$]=C[d]=C[l]=C[h]=C[m]=C[f]=C[g]=C[v]=C[O]=C[S]=C[T]=C[A]=!0,C["[object Error]"]=C[c]=C[x]=!1;var w="object"==typeof self&&self&&self.Object===Object&&self,P="object"==typeof i&&i&&i.Object===Object&&i||w||Function("return this")(),N=e&&!e.nodeType&&e,L=N&&t&&!t.nodeType&&t,j=L&&L.exports===N;function k(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function H(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 V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(s){}return e}function B(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 W,F=Array.prototype,Q=Function.prototype,J=Object.prototype,K=P["__core-js_shared__"],X=(W=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",z=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+z.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=j?P.Buffer:void 0,it=P.Symbol,rt=P.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=F.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),ht=Lt(P,"DataView"),pt=Lt(P,"Map"),mt=Lt(P,"Promise"),ft=Lt(P,"Set"),gt=Lt(P,"WeakMap"),vt=Lt(Object,"create"),xt=Vt(ht),yt=Vt(pt),bt=Vt(mt),It=Vt(ft),qt=Vt(gt),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 Tt(t){this.__data__=new Ot(t)}function At(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||Mt(o,i))||s.push(o);return s}function Rt(t,e,s){var i=t[e];Z.call(t,e)&&Bt(i,s)&&(void 0!==s||e in t)||(t[e]=s)}function _t(t,e){for(var s=t.length;s--;)if(Bt(t[s][0],e))return s;return-1}function Ut(t,e,s,i,r,p,x){var _;if(i&&(_=p?i(t,r,p,x):i(t)),void 0!==_)return _;if(!Qt(t))return t;var U=Gt(t);if(U){if(_=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,_)}else{var w=kt(t),P=w==c||w==u;if(Wt(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||P&&!p){if(V(t))return p?t:{};if(_=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:(e=nt(t),Qt(e)?ot(e):{});var e}(P?{}:t),!e)return function(t,e){return Pt(t,jt(t),e)}(t,function(t,e){return t&&Pt(e,Jt(e),t)}(_,t))}else{if(!C[w])return p?t:{};_=function(t,e,s,i){var r=t.constructor;switch(e){case y:return wt(t);case o:case a:return new r(+t);case b: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 T:case A: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(B(t),!0):B(t);return H(i,k,new t.constructor)}(t,i,s);case l:case g:return new r(t);case m:return function(t){var e=new t.constructor(t.source,R.exec(t));return e.lastIndex=t.lastIndex,e}(t);case f:return function(t,e,s){var i=e?s(Y(t),!0):Y(t);return H(i,M,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 Tt);var N=x.get(t);if(N)return N;if(x.set(t,_),!U)var L=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,jt)}(t):Jt(t);return function(t,e){for(var s=-1,i=t?t.length:0;++s<i&&!1!==e(t[s],s,t););}(L||t,(function(r,n){L&&(r=t[n=r]),Rt(_,n,Ut(r,e,s,i,n,t,x))})),_}function Ct(t){return!(!Qt(t)||(e=t,X&&X in e))&&(Ft(t)||V(t)?et:_).test(Vt(t));var e}function wt(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}function Pt(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;Rt(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 Lt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return Ct(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=_t(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=_t(e,t);return s<0?void 0:e[s][1]},Ot.prototype.has=function(t){return _t(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var s=this.__data__,i=_t(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(pt||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},Tt.prototype.clear=function(){this.__data__=new Ot},Tt.prototype.delete=function(t){return this.__data__.delete(t)},Tt.prototype.get=function(t){return this.__data__.get(t)},Tt.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.set=function(t,e){var s=this.__data__;if(s instanceof Ot){var i=s.__data__;if(!pt||i.length<199)return i.push([t,e]),this;s=this.__data__=new St(i)}return s.set(t,e),this};var jt=ut?G(ut,Object):function(){return[]},kt=function(t){return tt.call(t)};function Mt(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||U.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Vt(t){if(null!=t){try{return z.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(ht&&kt(new ht(new ArrayBuffer(1)))!=b||pt&&kt(new pt)!=d||mt&&kt(mt.resolve())!=p||ft&&kt(new ft)!=f||gt&&kt(new gt)!=x)&&(kt=function(t){var e=tt.call(t),s=e==h?t.constructor:void 0,i=s?Vt(s):void 0;if(i)switch(i){case xt:return b;case yt:return d;case bt:return p;case It:return f;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)&&!Ft(t)}var Wt=dt||function(){return!1};function Ft(t){var e=Qt(t)?tt.call(t):"";return e==c||e==u}function Qt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Yt(t)?At(t):function(t){if(!Ht(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(`${b(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,"]");class c{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const e=t.timeout||18e5;let s=t.headers||{};return t.url=E(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const s=[];Object.keys(e).forEach((t=>{const i=e[t];if(null==i)return;let r;Array.isArray(i)?(r=i,t+="[]"):r=[i],r.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),s.push(`${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(s,this._defaultHeaders),Object.keys(s).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(s["Content-Type"]=s[t],delete s[t])})),f(t.data)&&(t.data=t.data.buffer),(g(t.data)||h(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?l(t):d(t)}setDefaultHeader(t,e){t in this._defaultHeaders&&(""===e||null===e)?delete this._defaultHeaders[t]:this._defaultHeaders[t]=e}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"POST",data:e}))}put(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"PUT",data:e}))}}class u{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new u((e=>{t=e}));return{cancel:t,token:e}}}const d=t=>new Promise(((e,s)=>{const{data:i=null,url:r,method:n="GET",headers:o,cancelToken:a}=t;let c=new XMLHttpRequest;c.open(n.toUpperCase(),r,!0),c.timeout=t.timeout;const u=()=>{if(c){if(c.status>=200&&c.status<300)try{const t=JSON.parse(c.responseText);e(t)}catch(t){s(new Error("E_JSON_PARSE"+c.responseText))}else s({url:r,statusCode:c.status});c=null}};"onloadend"in c?c.onloadend=u:c.onreadystatechange=()=>{c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=()=>{c&&(s({url:r,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{s(new Error("Network Error")),c=null},c.ontimeout=()=>{s(new Error("timeout of "+t.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(o).forEach((t=>{null===i&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{c&&(c.abort(),s(t),c=null)})),c.send(i)})),l=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(t.data):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()}))})),h=Array.isArray,p=t=>null==t,m=t=>"object"==typeof t&&null!==t,f=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},v=()=>{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("")},x=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,i]=[t[0],t[1]];if(null!==i)return m(i)&&!h(i)?(e[s]||(e[s]={}),void(e[s]=x(i,e[s]))):void(e[s]=i)})),e):e,y=/-(\w)/g,b=t=>t.replace(y,((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()*Math.pow(2,t)+1);return e<2&&(e=2),e>30&&(e=30),1e3*e};var O,S,T,A,R;t.EVENT=void 0,(O=t.EVENT||(t.EVENT={})).STATE="state",O.FAILED="failed",O.REQUEST_ERROR="requestError",O.POLLING_ERROR="pollingError",O.KEEPALIVE_ERROR="keepaliveError",t.STATE=void 0,(S=t.STATE||(t.STATE={}))[S.CLOSE=0]="CLOSE",S[S.JOINED=1]="JOINED",S[S.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,(R=t.RECORD_STATUS||(t.RECORD_STATUS={})).STARTED="started",R.PAUSED="paused",R.STARTING="starting",R.STOPPED="stopped";class _{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))}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=`${b(r)}Change`;this.emitter.on(o,n),e.set(o,n),m(t[r])&&!h(t[r])&&s(t[r],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class U extends _{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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/send`,t)}))}getUserInfo(t){return e(this,void 0,void 0,(function*(){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})})}}function C(t){const e=[],{isInLobby:s}=t.modules.me.data;return s?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((s=>{const i=t.modules[s]._topic();i&&(Array.isArray(i)?i.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(i)||e.push(i))})),e)}function w(t,s){return e(this,void 0,void 0,(function*(){const{meetingID:e,clientID:i}=s.config.request,r=yield s.request.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:i,meetingId:e},inboxes:t}),n=[];return r.data&&Object.keys(r.data).forEach((t=>{n.push({name:t,seqId:r.data[t].maxSeqId,limit:200})})),n}))}function P(t,s){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i,clientID:r}=s.config.request,n=yield s.request.post(`${e}meetings/${i}/subscribe`,{endpointID:r,topics:t}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{s.emitter.emit(t.event,t)}))}))}function N(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;try{e=yield t.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:r},{cancelToken:a})}catch(d){return c.attempts++,void(d&&"request abort"!==d.type&&console.error(d))}if(!e)return console.error("polling error: ","response is null"),void c.attempts++;const{data:s={},bizCode:u,error:d}=e;if(u&&900408!==u)return console.error("polling error: ",JSON.stringify(d)),void c.attempts++;c.attempts=0,s&&Object.keys(s).forEach((t=>{const e=r.find((e=>e.name===t));e&&(e.seqId=s[t].maxSeqId,s[t].items&&s[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].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 u=c.attempts?$(c.attempts):0;c.timer=setTimeout((()=>{c.running&&N(t,s,i)}),u)}))}const L=(s,i)=>e(void 0,void 0,void 0,(function*(){const{meetingID:e,clientID:r}=i.config.request;i.status.polling.running=!0,N(i.request,{inboxes:s,clientID:r,meetingID:e,cancelToken:i.config.request.cancelToken.token,status:i.status.polling,onError:e=>{i.emitter.emit(t.EVENT.POLLING_ERROR,e)}},(t=>{i.emitter.emit(t.event,t)}))}));function j(t){t.status.polling.running=!1,t.status.polling.attempts=0,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=u.source()}function k(t,s){return e(this,void 0,void 0,(function*(){const{meetingID:i,userID:r,status:n,cancelToken:o,onError:a}=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`,{},{cancelToken:o.token})}catch(c){return n.attempts++,void console.error(c)}if(!e)return;const{data:s={},bizCode:a,error:c}=e;if(900200!==a&&900408!==a&&901323!==a)return n.attempts++,void console.error("keepalive ",a,c);const u=s.interval||"";if(!u)return n.attempts++,void console.error("keepalive ",a,c);n.interval=u,n.attempts=0})))(),!n.running)return;if(n.attempts>10)return console.error("keepalive Max Attempts"),void(a&&a({message:"keepalive Max Attempts"}));const c=n.attempts?$(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&k(t,s)}),c)}))}function M(s){return e(this,void 0,void 0,(function*(){const{meetingID:e,userID:i}=s.config.request;s.status.keepalive.running=!0,k(s.request,{meetingID:e,userID:i,cancelToken:s.config.request.cancelToken.token,status:s.status.keepalive,onError:e=>{s.emitter.emit(t.EVENT.KEEPALIVE_ERROR,e)}})}))}const H=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)};var V;t.MeEvent=void 0,(V=t.MeEvent||(t.MeEvent={})).INIT="meInit",V.UPDATE="meUpdate",V.UPDATE_USER_STATE="updateUserState",V.ROLECHANGE="meRoleChange",V.AUDIOCHANGE="meAudioChange",V.HANDUPCHANGE="meHandupChange",V.SETAUDIO="setAudio",V.VIDEOCHANGE="meVideoChange",V.SETVIDEO="setVideo",V.SHARECHANGE="meShareChange",V.WHITEBOARDCHANGE="meWhiteBoardChange",V.DISPLAYNAMECHANGE="meDisplayNameChange",V.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",V.LOBBYCHANGE="meLobbyChange",V.BARRAGECHANGE="meBarrageChange",V.PERSONALLAYOUTCHANGE="personalLayoutChange",V.PERMCHANGE="permChange",V.TOPMCCHANGE="mediaTopMCChange",V.LEAVE="leave";class B extends _{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){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;if("audio"in e){const{deviceOn:u,sendOn:d,recvOn:l,opBy:h}=e.audio;(!p(u)&&u!==(null===(s=this.data.audio)||void 0===s?void 0:s.deviceOn)||!p(d)&&d!==(null===(i=this.data.audio)||void 0===i?void 0:i.sendOn)||!p(l)&&l!==(null===(r=this.data.audio)||void 0===r?void 0:r.recvOn)||!p(h)&&h!==(null===(n=this.data.audio)||void 0===n?void 0:n.opBy))&&(x({audio:e.audio},this.data),this.emitter.emit(t.MeEvent.AUDIOCHANGE,{deviceOn:p(u)?null===(o=this.data.audio)||void 0===o?void 0:o.deviceOn:u,sendOn:p(d)?null===(a=this.data.audio)||void 0===a?void 0:a.sendOn:d,recvOn:p(d)?null===(c=this.data.audio)||void 0===c?void 0:c.recvOn:l,opBy:h,changeData:Object.assign({},e.audio)}))}},r=e=>{var s,i,r,n,o,a;if("video"in e){const{deviceOn:c,sendOn:u,opBy:d,blocked:l}=e.video;(!p(c)&&c!==(null===(s=this.data.video)||void 0===s?void 0:s.deviceOn)||!p(u)&&u!==(null===(i=this.data.video)||void 0===i?void 0:i.sendOn)||!p(l)&&l!==(null===(r=this.data.video)||void 0===r?void 0:r.blocked))&&(x({video:e.video},this.data),this.emitter.emit(t.MeEvent.VIDEOCHANGE,{deviceOn:p(c)?null===(n=this.data.video)||void 0===n?void 0:n.deviceOn:c,sendOn:p(u)?null===(o=this.data.video)||void 0===o?void 0:o.sendOn:u,blocked:p(u)?null===(a=this.data.video)||void 0===a?void 0:a.blocked:l,opBy:d,changeData:Object.assign({},e.video)}))}},n=e=>{var s,i,r,n,o,a,c,u;if("share"in e){const{deviceOn:o,sendOn:a,opBy:c}=e.share;(!p(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.deviceOn)||!p(a)&&a!==(null===(i=this.data.share)||void 0===i?void 0:i.sendOn))&&(x({share:e.share},this.data),this.emitter.emit(t.MeEvent.SHARECHANGE,{deviceOn:p(o)?null===(r=this.data.share)||void 0===r?void 0:r.deviceOn:o,sendOn:p(a)?null===(n=this.data.share)||void 0===n?void 0:n.sendOn:a,opBy:c}))}if("whiteboard"in e){const{deviceOn:s,sendOn:i,opBy:r}=e.whiteboard;(!p(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.deviceOn)||!p(i)&&i!==(null===(a=this.data.whiteboard)||void 0===a?void 0:a.sendOn))&&(x({whiteboard:e.whiteboard},this.data),this.emitter.emit(t.MeEvent.WHITEBOARDCHANGE,{deviceOn:p(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.deviceOn:s,sendOn:p(i)?null===(u=this.data.whiteboard)||void 0===u?void 0:u.sendOn:i,opBy:r}))}},o=e=>{e.displayName&&e.displayName!==this.data.displayName&&(x({displayName:e.displayName},this.data),this.data.displayNamePinyin=B.setDisplayNamePinyinProp?B.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=s=>e(this,void 0,void 0,(function*(){const{event:e,state:i,body:r}=s;"personalLayout"===e&&("full"===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};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)},h=e=>{"perm"in e&&(x({perm:e.perm},this.data),this.emitter.emit(t.MeEvent.PERMCHANGE,e.perm))},m=e=>{"leave"in e&&!0===e.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),j(this.ctx),H(this.ctx),Z(this.ctx),this.emitter.emit(t.MeEvent.LEAVE,e.resultInfo),this.ctx.cleanup(e.resultInfo))},f=e=>{s(e),i(e),r(e),n(e),o(e),a(e),u(e),c(e),l(e),h(e),m(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=B.setDisplayNamePinyinProp?B.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(t.MeEvent.UPDATE,(t=>{f(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=>e(this,void 0,void 0,(function*(){const{state:e,body:s={users:[]}}=t;if("delete"===e){const t=s.users[0];return t.leave=!0,void m(t)}let i=s.users.find((t=>t.userID===this.data.userID));i||s.users.length&&(i=s.users[0]),i?(f(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){m({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{d(t)})),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}))}))}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)}rePolling(s){return e(this,void 0,void 0,(function*(){const{ctx:e}=this;j(e);const i=C(e),r=yield w(i,e);if(s&&this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,{data:this.data,event:s}),yield P(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 yield L(r,e)}))}}class G extends _{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=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=G.setUserGroupIDs?G.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=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=G.setUserGroupIDs?G.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const s=((t,e)=>{for(let s=t.length-1;s>=0;s--)if(e(t[s]))return s;return-1})(this.data.callRecordUsers,(e=>{let s=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":s=t.account===e.contact;break;case"subjectID":s=t.subjectID===e.contact}return s}));s>-1&&(this.data.callRecordUsers[s].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/cancelInvite`,t)}}class Y extends _{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}_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;const{resultInfo:r={}}=e;if("delete"!==i||"delete"===i&&[901357,901358,901352,901351,901350,901349].includes(r.bizCode||-1))return void this.ctx.emitter.emit(t.MeEvent.UPDATE,e);let n=!1;switch(s){case"interactiveUsers":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=Y.setDisplayNamePinyinProp?Y.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=Y.setUserGroupIDs?Y.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=Y.setDisplayNamePinyinProp?Y.setDisplayNamePinyinProp(t.displayName):t.displayName,t.groupIDs=Y.setUserGroupIDs?Y.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}=t;s({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"})}))}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=`${b(r)}Change`;this.emitter.on(o,n),e.set(o,n),m(t[r])&&!h(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:[]}}getUserByUserID(t){if(t)return this.data.interactiveUsers.concat(this.data.lobbyUsers).concat(this.data.broadcastUsers).concat(this.data.advCtrlUsers).find((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=Y.setDisplayNamePinyinProp?Y.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)}}function W(e){const{baseURL:i,modules:r,worker:n,singleton:o}=e;r.findIndex((t=>t===B))<0&&r.push(B),r.findIndex((t=>t===U))<0&&r.push(U);const a=e.clientID||`${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})(new Date,"MMddHHmmss")}`,d={config:{baseURL:i,modules:r,singleton:o||!1,request:{cancelToken:u.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:a,location:"",meetingID:"",ctrlID:"",sessionID:"",userID:-1,voteTk:"",credential:"",multiActiveRegion:""}},worker:n,emitter:s(),request:new c({baseURL:i,beforeRequest:t=>{t.headers["X-Y-Request-Id"]=v(),t.timeout=18e5},error:e=>{d.emitter.emit(t.EVENT.REQUEST_ERROR,e)}}),modules:{},state:t.STATE.CLOSE,status:{polling:{running:!1,attempts:0,timer:null},keepalive:{running:!1,attempts:0,timer:null,interval:20}},cleanup:e=>{d.state!==t.STATE.CLOSE&&(d.worker&&d.worker.terminate(),d.config.request.location="",d.config.request.meetingID="",d.config.request.ctrlID="",d.config.request.sessionID="",d.config.request.userID=-1,d.config.request.voteTk="",d.config.request.credential="",d.config.request.multiActiveRegion="",d.status.polling={running:!1,attempts:0,timer:null},d.status.keepalive={running:!1,attempts:0,timer:null,interval:20},d.request.setDefaultHeader("X-Y-Location",""),d.request.setDefaultHeader("X-Y-Ctrl-Id",""),d.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(d.modules).forEach((t=>{d.modules[t].cleanup()})),d.state=t.STATE.CLOSE,d.emitter.emit(t.EVENT.STATE,{state:d.state,reason:e}))}};return d}function F(e){const s=W(e);return s.worker&&("undefined"!=typeof Worker?s.worker.postMessage({baseURL:s.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!h(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const s=new t(e);e.modules[s.moduleName]=s}))}(s.config.modules,s),s.emitter.on(t.EVENT.POLLING_ERROR,(t=>{J(s)({resultInfo:t})})),s.emitter.on(t.EVENT.KEEPALIVE_ERROR,(t=>{J(s)({resultInfo:t})})),Object.assign({config:s.config,request:s.request,get state(){return s.state},on:s.emitter.on,off:s.emitter.off,join:Q(s),leave:J(s),end:K(s),endMeeting:X(s)},s.modules)}function Q(s){return function(i){var r;return e(this,void 0,void 0,(function*(){const{clientID:e}=s.config.request,n=`${null===(r=i.endpointType)||void 0===r?void 0:r.toLocaleUpperCase()}${e}_${i.meetingNum}`;s.config.request.sessionID=n,s.request.setDefaultHeader("X-Y-Session-Id",n),s.request.setDefaultHeader("X-Y-Location","");const{prefix:o}=s.config.request,a=yield s.request.get(`${o.ctrl}credential`,{params:{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},headers:{"X-Y-Endpoint-Type":i.endpointType}}),{credential:c="",location:u="",multiActiveRegion:d=""}=a&&a.data||{};if(s.config.request.location=u,s.request.setDefaultHeader("X-Y-Location",u),!c)return s.emitter.emit(t.EVENT.FAILED,{bizCode:a.bizCode,data:a.data}),a;delete i.pwd,delete i.url,s.config.request.credential=c,s.config.request.multiActiveRegion=d;const l={displayName:i.displayName,userAgent:i.userAgent,clientID:e};i.groupIDs&&i.account&&(l.groupIDs=i.groupIDs,l.account=i.account,l.groupName=i.groupName),i.mediaContentReq&&(l.mediaContentReq=i.mediaContentReq);const h=i.hostKey?`&hostKey=${i.hostKey}`:"",p={"X-Y-Endpoint-Type":i.endpointType,"X-Y-Endpoint-Id":e};d&&(p["X-Y-Meeting-Region"]=d);const m=yield s.request.post(`${o.ctrl}join?meetingNum=${i.meetingNum}&credential=${c}${h}`,l,{headers:p});if(!m||m&&m.ret<=-1)return s.emitter.emit(t.EVENT.FAILED,{bizCode:m.bizCode,data:m.data}),m;const{meetingID:f="",ctrlID:g="",user:v={},mediaContent:x={},initialMediaState:y={},tk:b=""}=m.data;s.config.request.meetingID=f,s.config.request.ctrlID=g,s.config.request.userID=v.userID,s.config.request.voteTk=b,s.config.request.credential=c,s.config.request.multiActiveRegion=d,s.request.setDefaultHeader("X-Y-Ctrl-Id",g),s.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},v),{mediaContent:x,initialMediaState:y})),s.state=t.STATE.JOINED,s.emitter.emit(t.EVENT.STATE,{state:s.state});const I=()=>{s.state!==t.STATE.READY&&(s.state=t.STATE.READY,s.emitter.emit(t.EVENT.STATE,{state:s.state}))},q=C(s),D=yield w(q,s);return yield P(q,s),"undefined"!=typeof Worker&&s.worker?(s.status.polling.running=!0,s.status.keepalive.running=!0,s.worker.postMessage({ctrlID:g,location:u,sessionID:n,inboxes:D,topics:q,clientID:e,meetingID:f,userID:v.userID,status:!0}),s.worker.onmessage=t=>{"pollingStarted"!==t.data?"keepaliveStarted"!==t.data&&("pollingStopped"!==t.data?"keepaliveStopped"!==t.data?"pollingError"!==t.data?"keepaliveError"!==t.data?s.emitter.emit(t.data.event,t.data):J(s)({resultInfo:{message:"keepalive Max Attempts"}}):J(s)({resultInfo:{message:"polling Max Attempts"}}):s.status.keepalive.running=!1:s.status.polling.running=!1):I()}):(L(D,s),I(),M(s)),m.data=Object.assign(Object.assign({},m.data),a.data),m}))}}function J(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;let n;try{n=yield t.request.post(`${i.ctrl}meetings/${r}/leave`,s)}catch(o){console.error(o)}return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1}),j(t),H(t),Z(t),t.cleanup(e),n}))}}function K(t){return function(){return e(this,void 0,void 0,(function*(){const{prefix:e,meetingID:s}=t.config.request,i=yield t.request.post(`${e.ctrl}meetings/${s}/end`);return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1}),j(t),H(t),Z(t),t.cleanup(),i}))}}function X(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 z{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=F(t)}static getInstance(t){return this.instance?this.instance:this.instance=new z(t)}}function Z(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=z.getInstance(r);n&&(n.meeting=F(r))}}return Object.defineProperty(z,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),t.Asr=class extends _{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"}),e.resultInfo&&(this.emitter.emit("resultInfoChange",e.resultInfo),delete e.resultInfo),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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transcript/status`,t)}))}},t.AudioRecording=class extends _{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:s}=t;e&&(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),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),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.Chat=class extends _{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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/msg`,t)}))}historyMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/historyMsg`,t)}))}sendMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/chat/send`,t)}))}},t.FocusUsers=class extends _{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:s}=t;if(s)return 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),this.data}))}setFocusUsers(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/focusUser`,t)}},t.Info=U,t.Interpretation=class extends _{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=G,t.LiveStream=class extends _{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),this.emitter.emit("liveStreamsUpdate",this.data.liveStreams),this.data}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};return 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),this.data}))}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 _{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,x({status:i,defaultConfig:e},this.data),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;return 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),this.data}))}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=B,t.Qa=class extends _{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)&&!h(e)?this.qaUpdate(this.data.questions,e):e.forEach((t=>this.qaUpdate(this.data.questions,t)))}))}cleanup(){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++: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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/qa`,t)}))}},t.RTSP=class extends _{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){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/create`,t)}))}setRTSPAccess(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/rtspAccess/setting`,t)}))}deleteRTSPAccess(t){return e(this,void 0,void 0,(function*(){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 _{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:s,stime:i}=t;if(s)return i&&(this.data.stime=i,this.data.timeOffset=i-(new Date).valueOf()),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),(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),this.data):void 0}))}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 _{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,s){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${i}/users/${t}/remoteDesktop`,s)}))}},t.RollCall=class extends _{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 _{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=`${b(n)}Change`;this.emitter.on(i,s),e.set(i,s)}if(m(t[n])&&!h(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`)}))}},t.ShouldJoinUsers=class extends _{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 _{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 _{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}historyMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/transcript/historyMsg`,t)}))}},t.Users=Y,t.View=class extends _{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)}))}},t.Vote=class extends _{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)}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 _{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?z.getInstance(t).meeting:F(t)},t.reset=Z,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|