UNPKG

@tencentcloud/tuiroom-engine-uniapp-app

Version:
1 lines 785 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TUIRoomEngine={})}(this,(function(e){function t(e,t,n,o){var i,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var r=e.length-1;r>=0;r--)(i=e[r])&&(a=(s<3?i(a):s>3?i(t,n,a):i(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function n(e,t,n,o){return new(n||(n=Promise))((function(i,s){function a(e){try{c(o.next(e))}catch(t){s(t)}}function r(e){try{c(o.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}c((o=o.apply(e,t||[])).next())}))}var o,i,s,a,r,c,u,l,d,p,_,h,g,f,m,v,I,y,M,C,T,E,D,R,S,L,A,k;"function"==typeof SuppressedError&&SuppressedError,e.TUIErrorCode=void 0,(o=e.TUIErrorCode||(e.TUIErrorCode={}))[o.ERR_SUCC=0]="ERR_SUCC",o[o.ERR_FAILED=-1]="ERR_FAILED",o[o.ERR_FREQ_LIMIT=-2]="ERR_FREQ_LIMIT",o[o.ERR_REPEAT_OPERATION=-3]="ERR_REPEAT_OPERATION",o[o.ERR_SDKAPPID_NOT_FOUND=-1e3]="ERR_SDKAPPID_NOT_FOUND",o[o.ERR_INVALID_PARAMETER=-1001]="ERR_INVALID_PARAMETER",o[o.ERR_SDK_NOT_INITIALIZED=-1002]="ERR_SDK_NOT_INITIALIZED",o[o.ERR_PERMISSION_DENIED=-1003]="ERR_PERMISSION_DENIED",o[o.ERR_REQUIRE_PAYMENT=-1004]="ERR_REQUIRE_PAYMENT",o[o.ERR_CAMERA_START_FAILED=-1100]="ERR_CAMERA_START_FAILED",o[o.ERR_CAMERA_NOT_AUTHORIZED=-1101]="ERR_CAMERA_NOT_AUTHORIZED",o[o.ERR_CAMERA_OCCUPIED=-1102]="ERR_CAMERA_OCCUPIED",o[o.ERR_CAMERA_DEVICE_EMPTY=-1103]="ERR_CAMERA_DEVICE_EMPTY",o[o.ERR_MICROPHONE_START_FAILED=-1104]="ERR_MICROPHONE_START_FAILED",o[o.ERR_MICROPHONE_NOT_AUTHORIZED=-1105]="ERR_MICROPHONE_NOT_AUTHORIZED",o[o.ERR_MICROPHONE_OCCUPIED=-1106]="ERR_MICROPHONE_OCCUPIED",o[o.ERR_MICROPHONE_DEVICE_EMPTY=-1107]="ERR_MICROPHONE_DEVICE_EMPTY",o[o.ERR_GET_SCREEN_SHARING_TARGET_FAILED=-1108]="ERR_GET_SCREEN_SHARING_TARGET_FAILED",o[o.ERR_START_SCREEN_SHARING_FAILED=-1109]="ERR_START_SCREEN_SHARING_FAILED",o[o.ERR_ROOM_ID_NOT_EXIST=-2100]="ERR_ROOM_ID_NOT_EXIST",o[o.ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM=-2101]="ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM",o[o.ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER=-2102]="ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER",o[o.ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE=-2103]="ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE",o[o.ERR_ROOM_ID_INVALID=-2105]="ERR_ROOM_ID_INVALID",o[o.ERR_ROOM_ID_OCCUPIED=-2106]="ERR_ROOM_ID_OCCUPIED",o[o.ERR_ROOM_NAME_INVALID=-2107]="ERR_ROOM_NAME_INVALID",o[o.ERR_ALREADY_IN_OTHER_ROOM=-2108]="ERR_ALREADY_IN_OTHER_ROOM",o[o.ERR_NEED_PASSWORD=-2109]="ERR_NEED_PASSWORD",o[o.ERR_WRONG_PASSWORD=-2110]="ERR_WRONG_PASSWORD",o[o.ERR_ROOM_USER_FULL=-2111]="ERR_ROOM_USER_FULL",o[o.ERR_USER_NOT_EXIST=-2200]="ERR_USER_NOT_EXIST",o[o.ERR_USER_NOT_ENTERED=-2201]="ERR_USER_NOT_ENTERED",o[o.ERR_NEED_OWNER_PERMISSION=-2300]="ERR_NEED_OWNER_PERMISSION",o[o.ERR_NEED_ADMIN_PERMISSION=-2301]="ERR_NEED_ADMIN_PERMISSION",o[o.ERR_REQUEST_NO_PERMISSION=-2310]="ERR_REQUEST_NO_PERMISSION",o[o.ERR_REQUEST_ID_INVALID=-2311]="ERR_REQUEST_ID_INVALID",o[o.ERR_REQUEST_ID_REPEAT=-2312]="ERR_REQUEST_ID_REPEAT",o[o.ERR_REQUEST_ID_CONFLICT=-2313]="ERR_REQUEST_ID_CONFLICT",o[o.ERR_MAX_SEAT_COUNT_LIMIT=-2340]="ERR_MAX_SEAT_COUNT_LIMIT",o[o.ERR_ALREADY_IN_SEAT=-2341]="ERR_ALREADY_IN_SEAT",o[o.ERR_SEAT_OCCUPIED=-2342]="ERR_SEAT_OCCUPIED",o[o.ERR_SEAT_LOCKED=-2343]="ERR_SEAT_LOCKED",o[o.ERR_SEAT_INDEX_NOT_EXIST=-2344]="ERR_SEAT_INDEX_NOT_EXIST",o[o.ERR_USER_NOT_IN_SEAT=-2345]="ERR_USER_NOT_IN_SEAT",o[o.ERR_ALL_SEAT_OCCUPIED=-2346]="ERR_ALL_SEAT_OCCUPIED",o[o.ERR_SEAT_NOT_SUPPORT_LINK_MIC=-2347]="ERR_SEAT_NOT_SUPPORT_LINK_MIC",o[o.ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK=-2360]="ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK",o[o.ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN=-2361]="ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN",o[o.ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK=-2370]="ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK",o[o.ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN=-2371]="ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN",o[o.ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK=-2372]="ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK",o[o.ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN=-2373]="ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN",o[o.ERR_SEND_MESSAGE_DISABLED_FOR_ALL=-2380]="ERR_SEND_MESSAGE_DISABLED_FOR_ALL",o[o.ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT=-2381]="ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT",e.TUIRole=void 0,(i=e.TUIRole||(e.TUIRole={}))[i.kRoomOwner=0]="kRoomOwner",i[i.kAdministrator=1]="kAdministrator",i[i.kGeneralUser=2]="kGeneralUser",e.TUIVideoQuality=void 0,(s=e.TUIVideoQuality||(e.TUIVideoQuality={}))[s.kVideoQuality_360p=1]="kVideoQuality_360p",s[s.kVideoQuality_540p=2]="kVideoQuality_540p",s[s.kVideoQuality_720p=3]="kVideoQuality_720p",s[s.kVideoQuality_1080p=4]="kVideoQuality_1080p",e.TUIAudioQuality=void 0,(a=e.TUIAudioQuality||(e.TUIAudioQuality={}))[a.kAudioProfileSpeech=0]="kAudioProfileSpeech",a[a.kAudioProfileDefault=1]="kAudioProfileDefault",a[a.kAudioProfileMusic=2]="kAudioProfileMusic",e.TUIVideoStreamType=void 0,(r=e.TUIVideoStreamType||(e.TUIVideoStreamType={}))[r.kCameraStream=0]="kCameraStream",r[r.kScreenStream=1]="kScreenStream",r[r.kCameraStreamLow=2]="kCameraStreamLow",e.TUINetworkQuality=void 0,(c=e.TUINetworkQuality||(e.TUINetworkQuality={}))[c.kQualityUnknown=0]="kQualityUnknown",c[c.kQualityExcellent=1]="kQualityExcellent",c[c.kQualityGood=2]="kQualityGood",c[c.kQualityPoor=3]="kQualityPoor",c[c.kQualityBad=4]="kQualityBad",c[c.kQualityVeryBad=5]="kQualityVeryBad",c[c.kQualityDown=6]="kQualityDown",e.TUIRoomType=void 0,(u=e.TUIRoomType||(e.TUIRoomType={}))[u.kConference=1]="kConference",u[u.kLive=2]="kLive",e.TUISeatMode=void 0,(l=e.TUISeatMode||(e.TUISeatMode={}))[l.kFreeToTake=1]="kFreeToTake",l[l.kApplyToTake=2]="kApplyToTake",e.TUIMediaDevice=void 0,(d=e.TUIMediaDevice||(e.TUIMediaDevice={}))[d.kMicrophone=1]="kMicrophone",d[d.kCamera=2]="kCamera",d[d.kScreen=3]="kScreen",e.TUICaptureSourceType=void 0,(p=e.TUICaptureSourceType||(e.TUICaptureSourceType={}))[p.kWindow=0]="kWindow",p[p.kScreen=1]="kScreen",e.TUIChangeReason=void 0,(_=e.TUIChangeReason||(e.TUIChangeReason={}))[_.kChangedBySelf=0]="kChangedBySelf",_[_.kChangedByAdmin=1]="kChangedByAdmin",e.TUIKickedOutOfRoomReason=void 0,(h=e.TUIKickedOutOfRoomReason||(e.TUIKickedOutOfRoomReason={}))[h.kKickedByAdmin=0]="kKickedByAdmin",h[h.kKickedByLoggedOnOtherDevice=1]="kKickedByLoggedOnOtherDevice",h[h.kKickedByServer=2]="kKickedByServer",e.TUIRequestAction=void 0,(g=e.TUIRequestAction||(e.TUIRequestAction={}))[g.kInvalidAction=0]="kInvalidAction",g[g.kRequestToOpenRemoteCamera=1]="kRequestToOpenRemoteCamera",g[g.kRequestToOpenRemoteMicrophone=2]="kRequestToOpenRemoteMicrophone",g[g.kRequestToConnectOtherRoom=3]="kRequestToConnectOtherRoom",g[g.kRequestToTakeSeat=4]="kRequestToTakeSeat",g[g.kRequestRemoteUserOnSeat=5]="kRequestRemoteUserOnSeat",g[g.kApplyToAdminToOpenLocalCamera=6]="kApplyToAdminToOpenLocalCamera",g[g.kApplyToAdminToOpenLocalMicrophone=7]="kApplyToAdminToOpenLocalMicrophone",g[g.kApplyToAdminToOpenLocalScreenShare=8]="kApplyToAdminToOpenLocalScreenShare",e.TUIRequestCallbackType=void 0,(f=e.TUIRequestCallbackType||(e.TUIRequestCallbackType={}))[f.kRequestAccepted=0]="kRequestAccepted",f[f.kRequestRejected=1]="kRequestRejected",f[f.kRequestCancelled=2]="kRequestCancelled",f[f.kRequestTimeout=3]="kRequestTimeout",f[f.kRequestError=4]="kRequestError",f[f.kRequestId=5]="kRequestId",e.TRTCRole=void 0,(m=e.TRTCRole||(e.TRTCRole={}))[m.kAnchor=0]="kAnchor",m[m.kAudience=1]="kAudience",e.TUIResolutionMode=void 0,(v=e.TUIResolutionMode||(e.TUIResolutionMode={}))[v.kResolutionMode_Landscape=0]="kResolutionMode_Landscape",v[v.kResolutionMode_Portrait=1]="kResolutionMode_Portrait",e.TUIMediaDeviceType=void 0,(I=e.TUIMediaDeviceType||(e.TUIMediaDeviceType={}))[I.kMediaDeviceTypeUnknown=-1]="kMediaDeviceTypeUnknown",I[I.kMediaDeviceTypeAudioInput=0]="kMediaDeviceTypeAudioInput",I[I.kMediaDeviceTypeAudioOutput=1]="kMediaDeviceTypeAudioOutput",I[I.kMediaDeviceTypeVideoCamera=2]="kMediaDeviceTypeVideoCamera",e.TUIMediaDeviceState=void 0,(y=e.TUIMediaDeviceState||(e.TUIMediaDeviceState={}))[y.kMediaDeviceStateAdd=0]="kMediaDeviceStateAdd",y[y.kMediaDeviceStateRemove=1]="kMediaDeviceStateRemove",y[y.kMediaDeviceStateActive=2]="kMediaDeviceStateActive",e.TUIAudioRoute=void 0,(M=e.TUIAudioRoute||(e.TUIAudioRoute={}))[M.kAudioRouteSpeakerphone=0]="kAudioRouteSpeakerphone",M[M.kAudioRouteEarpiece=1]="kAudioRouteEarpiece",e.TUIConferenceStatus=void 0,(C=e.TUIConferenceStatus||(e.TUIConferenceStatus={}))[C.kConferenceStatusNone=0]="kConferenceStatusNone",C[C.kConferenceStatusNotStarted=1]="kConferenceStatusNotStarted",C[C.kConferenceStatusRunning=2]="kConferenceStatusRunning",e.TUIConferenceCancelReason=void 0,(T=e.TUIConferenceCancelReason||(e.TUIConferenceCancelReason={}))[T.kConferenceCancelReasonCancelledByAdmin=0]="kConferenceCancelReasonCancelledByAdmin",T[T.kConferenceCancelReasonRemovedFromAttendees=1]="kConferenceCancelReasonRemovedFromAttendees",e.TUIInvitationStatus=void 0,(E=e.TUIInvitationStatus||(e.TUIInvitationStatus={}))[E.kNone=0]="kNone",E[E.kPending=1]="kPending",E[E.kTimeout=2]="kTimeout",E[E.kAccepted=3]="kAccepted",E[E.kRejected=4]="kRejected",e.TUIInvitationCode=void 0,(D=e.TUIInvitationCode||(e.TUIInvitationCode={}))[D.kSuccess=0]="kSuccess",D[D.kAlreadyInInvitationList=1]="kAlreadyInInvitationList",D[D.kAlreadyInConference=2]="kAlreadyInConference",e.TUIInvitationRejectedReason=void 0,(R=e.TUIInvitationRejectedReason||(e.TUIInvitationRejectedReason={}))[R.kRejectToEnter=0]="kRejectToEnter",R[R.kInOtherConference=1]="kInOtherConference",e.TUIRoomEvents=void 0,(S=e.TUIRoomEvents||(e.TUIRoomEvents={})).onError="onError",S.onKickedOutOfRoom="onKickedOutOfRoom",S.onKickedOffLine="onKickedOffLine",S.onUserSigExpired="onUserSigExpired",S.onRoomDismissed="onRoomDismissed",S.onRoomNameChanged="onRoomNameChanged",S.onRoomSeatModeChanged="onRoomSeatModeChanged",S.onAllUserCameraDisableChanged="onAllUserCameraDisableChanged",S.onAllUserMicrophoneDisableChanged="onAllUserMicrophoneDisableChanged",S.onScreenShareForAllUserDisableChanged="onScreenShareForAllUserDisableChanged",S.onSendMessageForAllUserDisableChanged="onSendMessageForAllUserDisableChanged",S.onRoomMaxSeatCountChanged="onRoomMaxSeatCountChanged",S.onRemoteUserEnterRoom="onRemoteUserEnterRoom",S.onRemoteUserLeaveRoom="onRemoteUserLeaveRoom",S.onUserInfoChanged="onUserInfoChanged",S.onUserRoleChanged="onUserRoleChanged",S.onUserVideoStateChanged="onUserVideoStateChanged",S.onUserAudioStateChanged="onUserAudioStateChanged",S.onSendMessageForUserDisableChanged="onSendMessageForUserDisableChanged",S.onUserVoiceVolumeChanged="onUserVoiceVolumeChanged",S.onUserNetworkQualityChanged="onUserNetworkQualityChanged",S.onSeatListChanged="onSeatListChanged",S.onKickedOffSeat="onKickedOffSeat",S.onRequestReceived="onRequestReceived",S.onRequestCancelled="onRequestCancelled",S.onRequestProcessed="onRequestProcessed",S.onReceiveTextMessage="onReceiveTextMessage",S.onReceiveCustomMessage="onReceiveCustomMessage",S.onDeviceChange="onDeviceChange",S.onUserScreenCaptureStopped="onUserScreenCaptureStopped",S.onUserScreenCapturePaused="onUserScreenCapturePaused",S.onUserScreenCaptureResumed="onUserScreenCaptureResumed",e.TUIRoomDeviceMangerEvents=void 0,(L=e.TUIRoomDeviceMangerEvents||(e.TUIRoomDeviceMangerEvents={})).onDeviceChanged="onDeviceChanged",L.onTestMicVolume="onTestMicVolume",L.onTestSpeakerVolume="onTestSpeakerVolume",e.TUIConferenceListManagerEvents=void 0,(A=e.TUIConferenceListManagerEvents||(e.TUIConferenceListManagerEvents={})).onConferenceScheduled="onConferenceScheduled",A.onConferenceWillStart="onConferenceWillStart",A.onConferenceCancelled="onConferenceCancelled",A.onConferenceInfoChanged="onConferenceInfoChanged",A.onScheduleAttendeesChanged="onScheduleAttendeesChanged",A.onConferenceStatusChanged="onConferenceStatusChanged",e.TUIConferenceInvitationManagerEvents=void 0,(k=e.TUIConferenceInvitationManagerEvents||(e.TUIConferenceInvitationManagerEvents={})).onReceiveInvitation="onReceiveInvitation",k.onInvitationHandledByOtherDevice="onInvitationHandledByOtherDevice",k.onInvitationCancelled="onInvitationCancelled",k.onInvitationAccepted="onInvitationAccepted",k.onInvitationRejected="onInvitationRejected",k.onInvitationTimeout="onInvitationTimeout",k.onInvitationRevokedByAdmin="onInvitationRevokedByAdmin",k.onInvitationAdded="onInvitationAdded",k.onInvitationRemoved="onInvitationRemoved",k.onInvitationStatusChanged="onInvitationStatusChanged";const O=e=>"function"==typeof e,N=e=>void 0===e,P=e=>"string"==typeof e,G=e=>"number"==typeof e;function U(e){return Reflect.apply(Object.prototype.toString,e,[]).replace(/^\[object\s(\w+)\]$/,"$1").toLowerCase()}const b=function(e){if(!e||"object"!=typeof e||"[object Object]"!=Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Function.prototype.toString.call(n)===Function.prototype.toString.call(Object)};function w(e){if("string"!=typeof e)return e;let t;try{const n=JSON.parse(e);t="object"==typeof n&&n?n:e}catch(n){t=e}return t}class F extends Error{constructor(e){const{code:t,message:n,name:o}=e;super(n),this.code=t,this.message=n,this.name=o||""}}const q="INVALID_PARAMETER_REQUIRED",V="INVALID_PARAMETER_TYPE",x="INVALID_PARAMETER_EMPTY",B="INVALID_PARAMETER_INSTANCE",H="INVALID_PARAMETER_RANGE",K="CANNOT_LESS_THAN_ZERO",W={INVALID_PARAMETER_REQUIRED:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' is a required param when calling ${o}(), received: ${i}.`},INVALID_PARAMETER_TYPE:e=>{const{key:t,rule:n,fnName:o,value:i}=e,s=`${t||n.name}`;let a="";return a=Array.isArray(n.type)?n.type.join("|"):n.type,`'${s}' must be type of ${a} when calling ${o}(), received type: ${U(i)}.`},INVALID_PARAMETER_EMPTY:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' cannot be '${i}' when calling ${o}().`},INVALID_PARAMETER_INSTANCE:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${`${t||n.name}`}' must be instanceof ${`${n.instanceOf.name||n.instanceOf}`} when calling ${o}(), received type: ${U(i)}.`},INVALID_PARAMETER_RANGE:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' must be one of ${n.values.join("|")} when calling ${o}(), received: ${i}.`},CANNOT_LESS_THAN_ZERO:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' cannot be less than 0 when calling ${o}().`},xxx:"lajfl "};function Y(e){const{key:t,data:n}=e;return W[t]?O(W[t])?W[t](n):P(W[t])?W[t]:"":""}function j(...e){return function(t,n,o){const i=o.value;return o.value=function(...t){return z.call(this,e,t,n,this.className),i.apply(this,t)},o}}function J(...e){return function(t,o,i){const s=i.value;return i.value=function(...t){return n(this,void 0,void 0,(function*(){return z.call(this,e,t,o,this.className),s.apply(this,t)}))},i}}function z(e,t,n,o){try{for(let i=0;i<e.length;i++)X.call(this,{rule:e[i],value:t[i],key:e[i].name,fnName:n,className:o})}catch(i){throw console.error(i,i.code,i.message),i}}function X(t){const{rule:n,value:o,key:i,fnName:s,className:a}=t;if(N(o)){if(n.required)throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:q,data:{key:i,rule:n,fnName:s,value:o}})});return}if(Array.isArray(n.type)){if(!n.type.map((e=>e.toLowerCase())).includes(U(o)))throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:V,data:{key:i,rule:n,fnName:s,value:o}})})}else if(!N(n.type)&&U(o)!==n.type)throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:V,data:{key:i,rule:n,fnName:s,value:o}})});if(!1===n.allowEmpty){const t=G(o)&&(0===o||Number.isNaN(o)),a=P(o)&&""===o.trim();if(t||a)throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:x,data:{key:i,rule:n,fnName:s,value:o}})})}if(n.notLessThanZero&&G(o)&&o<0)throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:K,data:{key:i,rule:n,fnName:s,value:o}})});if(P(n.instanceOf)){if(!o||o.name_!==n.instanceOf)throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:B,data:{key:i,rule:n,fnName:s,value:o}})})}else if(O(n.instanceOf)&&!(o instanceof n.instanceOf))throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:B,data:{key:i,rule:n,fnName:s,value:o}})});if(n.values&&!n.values.includes(o))throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:H,data:{key:i,rule:n,fnName:s,value:o}})});const{properties:r}=n;b(r)&&"object"===U(o)&&Object.keys(r).forEach((e=>{X.call(this,{rule:r[e],value:o&&o[e],key:`${i}.${e}`,fnName:s,className:a})}));const{arrayItem:c}=n;b(c)&&(e=>"array"===U(e))(o)&&o.forEach(((e,t)=>{X.call(this,{rule:c,value:e,key:`${i}[${t}]`,fnName:s,className:a})})),O(n.validate)&&n.validate.call(this,o,i,s,a,this)}const Q=new WeakMap;function Z(){return function(e,t,n){const o=n.value,i=e=>{const{fn:t,args:n,context:o,resolve:s,reject:a}=e;t.apply(o,n).then(s,a).finally((()=>{const e=Q.get(o);e&&(e.shift(),e[0]&&i(Object.assign({},e[0])))}))};return n.value=function(...e){return new Promise(((n,s)=>{if(Q.has(this)){const a=Q.get(this),{length:r}=a;a.push({fn:o,args:e,context:this,resolve:n,reject:s,name:t}),0===r&&i({fn:o,args:e,context:this,resolve:n,reject:s})}else Q.set(this,[{fn:o,args:e,context:this,resolve:n,reject:s,name:t}]),i({fn:o,args:e,context:this,resolve:n,reject:s})}))},n}}const $="string",ee="number",te="boolean",ne="array",oe="object",ie="null",se="uniapp",ae=1,re={login:{name:"options",required:!0,type:oe,properties:{sdkAppId:{required:!0,type:ee,allowEmpty:!1},userId:{required:!0,type:$,allowEmpty:!1},userSig:{required:!0,type:$,allowEmpty:!1}}},setSelfInfo:{name:"options",required:!0,type:oe,properties:{userName:{required:!0,type:$},avatarUrl:{required:!0,type:$},customInfo:{required:!1,type:oe,allowEmpty:!1}}},createRoom:{name:"options",required:!0,type:oe,properties:{roomId:{required:!0,type:$,allowEmpty:!1},roomName:{type:$,allowEmpty:!1},roomType:{instanceof:e.TUIRoomType},isMicrophoneDisableForAllUser:{type:te},isScreenShareDisableForAllUser:{type:te},isCameraDisableForAllUser:{type:te},isMessageDisableForAllUser:{type:te},maxSeatCount:{type:ee},password:{type:$}}},enterRoom:{name:"options",required:!0,type:oe,properties:{roomId:{required:!0,type:$,allowEmpty:!1},roomType:{instanceof:e.TUIRoomType},options:{type:oe,properties:{password:{type:$}}}}},updateRoomNameByAdmin:{name:"options",require:!0,type:oe,properties:{roomName:{require:!0,type:$,allowEmpty:!1}}},setRoomMaxSeatCount:{name:"options",require:!0,type:oe,properties:{maxSeatCount:{require:!0,type:ee}}},getUserList:{name:"options",required:!1,type:oe,properties:{nextSequence:{type:$}}},getUserInfo:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1}}},setCustomInfoForUser:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},customInfo:{required:!0,type:oe,allowEmpty:!1}}},takeSeat:{name:"options",required:!0,type:oe,properties:{seatIndex:{required:!0,type:ee},timeout:{required:!0,type:ee},requestCallback:{instanceof:Function}}},getSeatList:{},openRemoteDeviceByAdmin:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},timeout:{required:!0,type:ee},device:{require:!0,instanceof:e.TUIMediaDevice}}},closeRemoteDeviceByAdmin:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},device:{required:!0,instanceof:e.TUIMediaDevice}}},takeUserOnSeatByAdmin:{name:"options",required:!0,type:oe,properties:{seatIndex:{required:!0,type:ee},userId:{required:!0,type:$,allowEmpty:!1},timeout:{required:!0,type:ee},requestCallback:{instanceof:Function}}},kickUserOffSeatByAdmin:{name:"options",required:!0,type:oe,properties:{seatIndex:{required:!0,type:ee},userId:{required:!0,type:$,allowEmpty:!1}}},cancelRequest:{name:"options",required:!0,type:oe,properties:{requestId:{required:!0,type:$,allowEmpty:!1}}},responseRemoteRequest:{name:"options",required:!0,type:oe,properties:{requestId:{required:!0,type:$,allowEmpty:!1},agree:{required:!0,type:te}}},setLocalVideoView:{name:"options",required:!1,type:oe,properties:{view:{required:!1,type:[$,ne,ie],allowEmpty:!1,validate:t=>{if(t instanceof Array){if(t.some((e=>null===e)))throw new F({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:"When calling the setLocalVideoView interface with the view parameter as an array, the array content cannot contain null."})}}}}},openLocalCamera:{name:"options",type:oe,properties:{isFrontCamera:{type:te,allowEmpty:!1}}},closeLocalCamera:{},openLocalMicrophone:{},closeLocalMicrophone:{},setVideoResolutionMode:{name:"options",required:!0,type:oe,properties:{streamType:{required:!0,instanceof:e.TUIVideoStreamType},resolutionMode:{required:!0,instanceof:e.TUIResolutionMode}}},updateVideoQuality:{name:"options",required:!0,type:oe,properties:{quality:{required:!0,instanceof:e.TUIVideoQuality}}},updateVideoQualityEx:{name:"options",required:!0,type:oe,properties:{streamType:{required:!0,instanceof:e.TUIVideoStreamType},encoderParams:{required:!0,properties:{quality:{instanceof:e.TUIVideoQuality},fps:{type:ee},bitrate:{type:ee},resolutionMode:{instanceof:e.TUIResolutionMode}}}}},updateAudioQuality:{name:"options",required:!0,type:oe,properties:{quality:{required:!0,instanceof:e.TUIAudioQuality}}},muteRemoteAudioStream:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},isMute:{required:!0,type:te}}},startPushLocalVideo:{},stopPushLocalVideo:{},startPushLocalAudio:{},stopPushLocalAudio:{},setRemoteVideoView:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},streamType:{required:!0,instanceof:e.TUIVideoStreamType},view:{required:!0,type:[$,ne],allowEmpty:!1}}},startPlayRemoteVideo:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},streamType:{required:!0,instanceof:e.TUIVideoStreamType}}},stopPlayRemoteVideo:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},streamType:{required:!0,instanceof:e.TUIVideoStreamType}}},changeUserRole:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},userRole:{required:!0,instanceof:e.TUIRole}}},changeUserNameCard:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},nameCard:{required:!0,type:$}}},kickRemoteUserOutOfRoom:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1}}},sendTextMessage:{name:"options",required:!0,type:oe,properties:{messageText:{require:!0,type:$,allowEmpty:!1}}},sendCustomMessage:{name:"options",required:!0,type:oe,properties:{messageText:{require:!0,type:$,allowEmpty:!1}}},startScreenSharing:{name:"options",type:oe,properties:{screenAudio:{type:te},view:{type:$}}},stopScreenSharing:{},startScreenSharingElectron:{name:"options",required:!0,type:[oe,"string"],properties:{targetId:{require:!0,type:$},view:{type:$}}},selectScreenSharingTarget:{name:"options",required:!0,type:[oe,"string"],properties:{targetId:{require:!0,type:$}}},setCurrentCameraDevice:{name:"options",required:!0,type:oe,properties:{deviceId:{require:!0,type:$}}},setCurrentMicDevice:{name:"options",required:!0,type:oe,properties:{deviceId:{require:!0,type:$}}},setCurrentSpeakerDevice:{name:"options",required:!0,type:oe,properties:{deviceId:{require:!0,type:$}}},disableDeviceForAllUserByAdmin:{name:"options",required:!0,type:oe,properties:{isDisable:{require:!0,type:te},device:{require:!0,instanceof:e.TUIMediaDevice}}},disableSendingMessageForAllUser:{name:"options",required:!0,type:oe,properties:{isDisable:{require:!0,type:te}}},disableSendingMessageByAdmin:{name:"options",required:!0,type:oe,properties:{userId:{require:!0,instanceof:$},isDisable:{require:!0,type:te}}},updateRoomSeatModeByAdmin:{name:"options",required:!0,type:oe,properties:{seatMode:{require:!0,instanceof:e.TUISeatMode}}},updateRoomPasswordByAdmin:{name:"options",required:!0,type:oe,properties:{password:{required:!0,type:$,allowEmpty:!1}}},applyToAdminToOpenLocalDevice:{name:"options",required:!0,type:oe,properties:{timeout:{required:!0,type:ee},device:{require:!0,instanceof:e.TUIMediaDevice}}},setMaxSeatCount:{name:"options",required:!0,type:oe,properties:{maxSeatCount:{require:!0,type:ee}}},lockSeatByAdmin:{name:"options",required:!0,type:oe,properties:{seatIndex:{required:!0,type:ee},lockParams:{require:!0,type:oe,properties:{lockSeat:{require:!0,type:te},lockVideo:{require:!0,type:te},lockAudio:{require:!0,type:te}}}}}},ce="iOS"===plus.os.name;var ue={judgeIosPermission:function(e){return"location"==e?function(){let e=!1;const t=plus.ios.import("CLLocationManager");return e=2!=t.authorizationStatus(),console.log(`定位权限开启:${e}`),plus.ios.deleteObject(t),e}():"camera"==e?function(){let e=!1;const t=plus.ios.import("AVCaptureDevice"),n=t.authorizationStatusForMediaType("vide");return console.log(`authStatus:${n}`),3==n?(e=!0,console.log("相机权限已经开启")):console.log("相机权限没有开启"),plus.ios.deleteObject(t),e}():"photoLibrary"==e?function(){let e=!1;const t=plus.ios.import("PHPhotoLibrary"),n=t.authorizationStatus();return console.log(`authStatus:${n}`),3==n?(e=!0,console.log("相册权限已经开启")):console.log("相册权限没有开启"),plus.ios.deleteObject(t),e}():"record"==e?function(){let e=!1;const t=plus.ios.import("AVAudioSession"),n=t.sharedInstance().recordPermission();return console.log(`permissionStatus:${n}`),1684369017==n||1970168948==n?console.log("麦克风权限没有开启"):(e=!0,console.log("麦克风权限已经开启")),plus.ios.deleteObject(t),e}():"push"==e?function(){let e=!1;const t=plus.ios.import("UIApplication"),n=t.sharedApplication();let o=0;if(n.currentUserNotificationSettings){const t=n.currentUserNotificationSettings();o=t.plusGetAttribute("types"),console.log(`enabledTypes1:${o}`),0==o?console.log("推送权限没有开启"):(e=!0,console.log("已经开启推送功能!")),plus.ios.deleteObject(t)}else o=n.enabledRemoteNotificationTypes(),0==o?console.log("推送权限没有开启!"):(e=!0,console.log("已经开启推送功能!")),console.log(`enabledTypes2:${o}`);return plus.ios.deleteObject(n),plus.ios.deleteObject(t),e}():"contact"==e?function(){let e=!1;const t=plus.ios.import("CNContactStore");return 3==t.authorizationStatusForEntityType(0)?(e=!0,console.log("通讯录权限已经开启")):console.log("通讯录权限没有开启"),plus.ios.deleteObject(t),e}():"calendar"==e?function(){let e=!1;const t=plus.ios.import("EKEventStore");return 3==t.authorizationStatusForEntityType(0)?(e=!0,console.log("日历权限已经开启")):console.log("日历权限没有开启"),plus.ios.deleteObject(t),e}():"memo"==e&&function(){let e=!1;const t=plus.ios.import("EKEventStore");return 3==t.authorizationStatusForEntityType(1)?(e=!0,console.log("备忘录权限已经开启")):console.log("备忘录权限没有开启"),plus.ios.deleteObject(t),e}()},requestAndroidPermission:function(e){return new Promise(((t,n)=>{plus.android.requestPermissions([e],(e=>{let n=0;for(let t=0;t<e.granted.length;t++){const o=e.granted[t];console.log(`已获取的权限:${o}`),n=1}for(let t=0;t<e.deniedPresent.length;t++){const o=e.deniedPresent[t];console.log(`拒绝本次申请的权限:${o}`),n=0}for(let t=0;t<e.deniedAlways.length;t++){const o=e.deniedAlways[t];console.log(`永久拒绝申请的权限:${o}`),n=-1}t(n)}),(e=>{console.log(`申请权限错误:${e.code} = ${e.message}`),t({code:e.code,message:e.message})}))}))},checkSystemEnableLocation:function(){if(ce){let e=!1;const t=plus.ios.import("CLLocationManager");return e=t.locationServicesEnabled(),console.log(`系统定位开启:${e}`),plus.ios.deleteObject(t),e}const e=plus.android.importClass("android.content.Context"),t=plus.android.importClass("android.location.LocationManager"),n=plus.android.runtimeMainActivity().getSystemService(e.LOCATION_SERVICE).isProviderEnabled(t.GPS_PROVIDER);return console.log(`系统定位开启:${n}`),n},gotoAppPermissionSetting:function(){if(ce){const e=plus.ios.import("UIApplication").sharedApplication(),t=plus.ios.import("NSURL"),n=t.URLWithString("app-settings:");e.openURL(n),plus.ios.deleteObject(n),plus.ios.deleteObject(t),plus.ios.deleteObject(e)}else{const e=plus.android.importClass("android.content.Intent"),t=plus.android.importClass("android.provider.Settings"),n=plus.android.importClass("android.net.Uri"),o=plus.android.runtimeMainActivity(),i=new e;i.setAction(t.ACTION_APPLICATION_DETAILS_SETTINGS);const s=n.fromParts("package",o.getPackageName(),null);i.setData(s),o.startActivity(i)}}},le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},de={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,o,s,a){if("function"!=typeof o)throw new TypeError("The listener must be a function");var r=new i(o,s||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],r]:e._events[c].push(r):(e._events[c]=r,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function r(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),r.prototype.eventNames=function(){var e,o,i=[];if(0===this._eventsCount)return i;for(o in e=this._events)t.call(e,o)&&i.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},r.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var i=0,s=o.length,a=new Array(s);i<s;i++)a[i]=o[i].fn;return a},r.prototype.listenerCount=function(e){var t=n?n+e:e,o=this._events[t];return o?o.fn?1:o.length:0},r.prototype.emit=function(e,t,o,i,s,a){var r=n?n+e:e;if(!this._events[r])return!1;var c,u,l=this._events[r],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,o),!0;case 4:return l.fn.call(l.context,t,o,i),!0;case 5:return l.fn.call(l.context,t,o,i,s),!0;case 6:return l.fn.call(l.context,t,o,i,s,a),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,_=l.length;for(u=0;u<_;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,o);break;case 4:l[u].fn.call(l[u].context,t,o,i);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},r.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},r.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},r.prototype.removeListener=function(e,t,o,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var r=this._events[s];if(r.fn)r.fn!==t||i&&!r.once||o&&r.context!==o||a(this,s);else{for(var c=0,u=[],l=r.length;c<l;c++)(r[c].fn!==t||i&&!r[c].once||o&&r[c].context!==o)&&u.push(r[c]);u.length?this._events[s]=1===u.length?u[0]:u:a(this,s)}return this},r.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new o,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=n,r.EventEmitter=r,e.exports=r}({get exports(){return de},set exports(e){de=e}});var pe=de;class _e{constructor(e){const{Module:t,logger:n}=e;this.deviceManager||(this.logger=n,this.deviceManager=t)}static getInstance(e){return _e.instance||(_e.instance=new _e(e)),_e.instance}JSCallNativeFunctionSync(e,t){return this.deviceManager[e](t)}switchCamera(e){return n(this,void 0,void 0,(function*(){this.logger.info("deviceManager.switchCamera with options: ",e);const{isFrontCamera:t}=e,n={frontCamera:t};yield this.JSCallNativeFunctionSync("switchCamera",n)}))}}class he{constructor(e){const{Module:t,logger:n}=e;this.trtcCloud||(this.logger=n,this.trtcCloud=t)}static getInstance(e){return he.instance||(he.instance=new he(e)),he.instance}JSCallNativeFunctionSync(e,t){return this.trtcCloud[e](t)}setLocalRenderParams(e){return n(this,void 0,void 0,(function*(){this.logger.info("deviceManager.setLocalRenderParams with options: ",e),yield this.JSCallNativeFunctionSync("setLocalRenderParams",e)}))}}var ge={};!function(e){e.exports=function(){function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)),o}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){a(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(s){return!1}}function d(e,t,n){return(d=l()?Reflect.construct:function(e,t,n){var o=[null];return o.push.apply(o,t),t=new(Function.bind.apply(e,o)),n&&u(t,n.prototype),t}).apply(null,arguments)}function p(e){var t="function"==typeof Map?new Map:void 0;return function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)}(e)}function _(e,t){if(null==e)return{};var n,o=function(e,t){if(null==e)return{};for(var n,o={},i=Object.keys(e),s=0;s<i.length;s++)n=i[s],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),s=0;s<i.length;s++)n=i[s],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){var t=l();return function(){var n,o=c(e);if(n=t?(n=c(this).constructor,Reflect.construct(o,arguments,n)):o.apply(this,arguments),o=this,n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return h(o)}}function f(e,t){return v(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,s=[],a=!0,r=!1;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(s.push(o.value),!t||s.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(r)throw i}}return s}}(e,t)||y(e,t)||C()}function m(e){return function(e){if(Array.isArray(e))return M(e)}(e)||I(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){if(Array.isArray(e))return e}function I(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function C(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){var n,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=y(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),n=0,{s:t=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==o.return||o.return()}finally{if(a)throw i}}}}var E={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",MY_FOLLOWERS_LIST_UPDATED:"onMyFollowersListUpdated",MY_FOLLOWING_LIST_UPDATED:"onMyFollowingListUpdated",MUTUAL_FOLLOWERS_LIST_UPDATED:"onMutualFollowersListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",ALL_RECEIVE_MESSAGE_OPT_UPDATED:"onAllReceiveMessageOptUpdated"},D={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_ROOM:"Room",GRP_LIVE:"Live",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_MSG_EXCEPT_AT:"NotReceiveMsgExceptAt",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3,IOS_OFFLINE_PUSH_NO_SOUND:"push.no_sound",IOS_OFFLINE_PUSH_DEFAULT_SOUND:"default"},R={NEW_INVITATION_RECEIVED:"newInvitationReceived",INVITEE_ACCEPTED:"ts_invitee_accepted",INVITEE_REJECTED:"ts_invitee_rejected",INVITATION_CANCELLED:"ts_invitation_cancelled",INVITATION_TIMEOUT:"ts_invitation_timeout",INVITATION_MODIFIED:"ts_invitation_modified",ACTION_TYPE_UNKNOWN:0,ACTION_TYPE_INVITE:1,ACTION_TYPE_CANCEL_INVITE:2,ACTION_TYPE_ACCEPT_INVITE:3,ACTION_TYPE_REJECT_INVITE:4,ACTION_TYPE_INVITE_TIMEOUT:5},S=(s(V,[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&0<this.middlewares.length)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),V),L=(s(q,[{key:"equal",value:function(e){return null!==e&&this.low===e.low&&this.high===e.high}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),q),A={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT0:"wss://*w4s.my-imcloud.com",DEFAULT:"wss://wsssgp.im.qcloud.com",IPV6:"wss://wsssgpv6.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT0:"wss://*w4k.my-imcloud.com",DEFAULT:"wss://wsskr.im.qcloud.com",IPV6:"wss://wsskrv6.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT0:"wss://*w4g.my-imcloud.com",DEFAULT:"wss://wssger.im.qcloud.com",IPV6:"wss://wssgerv6.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT0:"wss://*w4i.my-imcloud.com",DEFAULT:"wss://wssind.my-imcloud.com",IPV6:"wss://wssindv6.im.qcloud.com",BACKUP:"wss://wssind.im.qcloud.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.19.46"},JPN:{DEFAULT0:"wss://*w4j.my-imcloud.com",DEFAULT:"wss://wssjpn.im.qcloud.com",IPV6:"wss://wssjpnv6.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT0:"wss://*w4u.my-imcloud.com",DEFAULT:"wss://wssusa.im.qcloud.com",IPV6:"wss://wssusav6.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT0:"wss://*w4y.my-imcloud.com",DEFAULT:"wss://wssidn.im.qcloud.com",IPV6:"wss://wssidnv6.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},k={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},O="1.7.3",N=537048168,P="CHINA",G={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){this.CURRENT=A.PRODUCTION[0<arguments.length&&void 0!==arguments[0]?arguments[0]:P]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MSG:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",GRP_SEARCH:"group_search",GRP_MEMBER_SEARCH:"group_member_search",USER_SEARCH:"user_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},U={SEARCH_GRP_SNS:new L(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new L(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new L(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new L(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new L(0,Math.pow(2,6)).toString(),USER_STATUS:new L(0,Math.pow(2,7)).toString(),CONV_MARK:new L(0,Math.pow(2,9)).toString(),CONV_GROUP:new L(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new L(0,Math.pow(2,11)).toString(),MSG_EXT:new L(0,Math.pow(2,13)).toString(),GRP_COUNTER:new L(0,Math.pow(2,15)).toString(),PLUGIN_TRANSLATE:new L(Math.pow(2,6)).toString(),PLUGIN_VOICE_TO_TEXT:new L(Math.pow(2,7)).toString(),PLUGIN_CS:new L(Math.pow(2,8)).toString(),PLUGIN_PUSH:new L(Math.pow(2,9)).toString(),PLUGIN_BOT:new L(Math.pow(2,10)).toString(),MSG_REACTION:new L(Math.pow(2,16)).toString(),FOLLOW:new L(Math.pow(2,20)).toString()},b="group_profile",w=["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],F=["Role","JoinTime","MsgSeq","MsgFlag"];function q(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;o(this,q),this.high=e,this.low=t}function V(){o(this,V),this.cache=[],this.options=null}G.HOST.setCurrent(P);for(var x,B="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),H=B&&"function"==typeof wx.createGamePortal,K="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),W="undefined"!=typeof