UNPKG

@tencentcloud/tuiroom-engine-uniapp-app

Version:
1 lines 802 kB
function e(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 t(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 n,o,i,s,a,r,c,u,l,d,p,_,g,h,f,m,v,y,I,M,C,T,E,D,R,S,L,A,k;Object.defineProperty(exports,"__esModule",{value:!0}),"function"==typeof SuppressedError&&SuppressedError,exports.TUIErrorCode=void 0,(n=exports.TUIErrorCode||(exports.TUIErrorCode={}))[n.ERR_SUCC=0]="ERR_SUCC",n[n.ERR_FAILED=-1]="ERR_FAILED",n[n.ERR_FREQ_LIMIT=-2]="ERR_FREQ_LIMIT",n[n.ERR_REPEAT_OPERATION=-3]="ERR_REPEAT_OPERATION",n[n.ERR_SDKAPPID_NOT_FOUND=-1e3]="ERR_SDKAPPID_NOT_FOUND",n[n.ERR_INVALID_PARAMETER=-1001]="ERR_INVALID_PARAMETER",n[n.ERR_SDK_NOT_INITIALIZED=-1002]="ERR_SDK_NOT_INITIALIZED",n[n.ERR_PERMISSION_DENIED=-1003]="ERR_PERMISSION_DENIED",n[n.ERR_REQUIRE_PAYMENT=-1004]="ERR_REQUIRE_PAYMENT",n[n.ERR_CAMERA_START_FAILED=-1100]="ERR_CAMERA_START_FAILED",n[n.ERR_CAMERA_NOT_AUTHORIZED=-1101]="ERR_CAMERA_NOT_AUTHORIZED",n[n.ERR_CAMERA_OCCUPIED=-1102]="ERR_CAMERA_OCCUPIED",n[n.ERR_CAMERA_DEVICE_EMPTY=-1103]="ERR_CAMERA_DEVICE_EMPTY",n[n.ERR_MICROPHONE_START_FAILED=-1104]="ERR_MICROPHONE_START_FAILED",n[n.ERR_MICROPHONE_NOT_AUTHORIZED=-1105]="ERR_MICROPHONE_NOT_AUTHORIZED",n[n.ERR_MICROPHONE_OCCUPIED=-1106]="ERR_MICROPHONE_OCCUPIED",n[n.ERR_MICROPHONE_DEVICE_EMPTY=-1107]="ERR_MICROPHONE_DEVICE_EMPTY",n[n.ERR_GET_SCREEN_SHARING_TARGET_FAILED=-1108]="ERR_GET_SCREEN_SHARING_TARGET_FAILED",n[n.ERR_START_SCREEN_SHARING_FAILED=-1109]="ERR_START_SCREEN_SHARING_FAILED",n[n.ERR_ROOM_ID_NOT_EXIST=-2100]="ERR_ROOM_ID_NOT_EXIST",n[n.ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM=-2101]="ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM",n[n.ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER=-2102]="ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER",n[n.ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE=-2103]="ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE",n[n.ERR_ROOM_ID_INVALID=-2105]="ERR_ROOM_ID_INVALID",n[n.ERR_ROOM_ID_OCCUPIED=-2106]="ERR_ROOM_ID_OCCUPIED",n[n.ERR_ROOM_NAME_INVALID=-2107]="ERR_ROOM_NAME_INVALID",n[n.ERR_ALREADY_IN_OTHER_ROOM=-2108]="ERR_ALREADY_IN_OTHER_ROOM",n[n.ERR_NEED_PASSWORD=-2109]="ERR_NEED_PASSWORD",n[n.ERR_WRONG_PASSWORD=-2110]="ERR_WRONG_PASSWORD",n[n.ERR_ROOM_USER_FULL=-2111]="ERR_ROOM_USER_FULL",n[n.ERR_USER_NOT_EXIST=-2200]="ERR_USER_NOT_EXIST",n[n.ERR_USER_NOT_ENTERED=-2201]="ERR_USER_NOT_ENTERED",n[n.ERR_NEED_OWNER_PERMISSION=-2300]="ERR_NEED_OWNER_PERMISSION",n[n.ERR_NEED_ADMIN_PERMISSION=-2301]="ERR_NEED_ADMIN_PERMISSION",n[n.ERR_REQUEST_NO_PERMISSION=-2310]="ERR_REQUEST_NO_PERMISSION",n[n.ERR_REQUEST_ID_INVALID=-2311]="ERR_REQUEST_ID_INVALID",n[n.ERR_REQUEST_ID_REPEAT=-2312]="ERR_REQUEST_ID_REPEAT",n[n.ERR_REQUEST_ID_CONFLICT=-2313]="ERR_REQUEST_ID_CONFLICT",n[n.ERR_MAX_SEAT_COUNT_LIMIT=-2340]="ERR_MAX_SEAT_COUNT_LIMIT",n[n.ERR_ALREADY_IN_SEAT=-2341]="ERR_ALREADY_IN_SEAT",n[n.ERR_SEAT_OCCUPIED=-2342]="ERR_SEAT_OCCUPIED",n[n.ERR_SEAT_LOCKED=-2343]="ERR_SEAT_LOCKED",n[n.ERR_SEAT_INDEX_NOT_EXIST=-2344]="ERR_SEAT_INDEX_NOT_EXIST",n[n.ERR_USER_NOT_IN_SEAT=-2345]="ERR_USER_NOT_IN_SEAT",n[n.ERR_ALL_SEAT_OCCUPIED=-2346]="ERR_ALL_SEAT_OCCUPIED",n[n.ERR_SEAT_NOT_SUPPORT_LINK_MIC=-2347]="ERR_SEAT_NOT_SUPPORT_LINK_MIC",n[n.ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK=-2360]="ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK",n[n.ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN=-2361]="ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN",n[n.ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK=-2370]="ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK",n[n.ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN=-2371]="ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN",n[n.ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK=-2372]="ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK",n[n.ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN=-2373]="ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN",n[n.ERR_SEND_MESSAGE_DISABLED_FOR_ALL=-2380]="ERR_SEND_MESSAGE_DISABLED_FOR_ALL",n[n.ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT=-2381]="ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT",exports.TUIRole=void 0,(o=exports.TUIRole||(exports.TUIRole={}))[o.kRoomOwner=0]="kRoomOwner",o[o.kAdministrator=1]="kAdministrator",o[o.kGeneralUser=2]="kGeneralUser",exports.TUIVideoQuality=void 0,(i=exports.TUIVideoQuality||(exports.TUIVideoQuality={}))[i.kVideoQuality_360p=1]="kVideoQuality_360p",i[i.kVideoQuality_540p=2]="kVideoQuality_540p",i[i.kVideoQuality_720p=3]="kVideoQuality_720p",i[i.kVideoQuality_1080p=4]="kVideoQuality_1080p",exports.TUIAudioQuality=void 0,(s=exports.TUIAudioQuality||(exports.TUIAudioQuality={}))[s.kAudioProfileSpeech=0]="kAudioProfileSpeech",s[s.kAudioProfileDefault=1]="kAudioProfileDefault",s[s.kAudioProfileMusic=2]="kAudioProfileMusic",exports.TUIVideoStreamType=void 0,(a=exports.TUIVideoStreamType||(exports.TUIVideoStreamType={}))[a.kCameraStream=0]="kCameraStream",a[a.kScreenStream=1]="kScreenStream",a[a.kCameraStreamLow=2]="kCameraStreamLow",exports.TUINetworkQuality=void 0,(r=exports.TUINetworkQuality||(exports.TUINetworkQuality={}))[r.kQualityUnknown=0]="kQualityUnknown",r[r.kQualityExcellent=1]="kQualityExcellent",r[r.kQualityGood=2]="kQualityGood",r[r.kQualityPoor=3]="kQualityPoor",r[r.kQualityBad=4]="kQualityBad",r[r.kQualityVeryBad=5]="kQualityVeryBad",r[r.kQualityDown=6]="kQualityDown",exports.TUIRoomType=void 0,(c=exports.TUIRoomType||(exports.TUIRoomType={}))[c.kConference=1]="kConference",c[c.kLive=2]="kLive",exports.TUISeatMode=void 0,(u=exports.TUISeatMode||(exports.TUISeatMode={}))[u.kFreeToTake=1]="kFreeToTake",u[u.kApplyToTake=2]="kApplyToTake",exports.TUIMediaDevice=void 0,(l=exports.TUIMediaDevice||(exports.TUIMediaDevice={}))[l.kMicrophone=1]="kMicrophone",l[l.kCamera=2]="kCamera",l[l.kScreen=3]="kScreen",exports.TUICaptureSourceType=void 0,(d=exports.TUICaptureSourceType||(exports.TUICaptureSourceType={}))[d.kWindow=0]="kWindow",d[d.kScreen=1]="kScreen",exports.TUIChangeReason=void 0,(p=exports.TUIChangeReason||(exports.TUIChangeReason={}))[p.kChangedBySelf=0]="kChangedBySelf",p[p.kChangedByAdmin=1]="kChangedByAdmin",exports.TUIKickedOutOfRoomReason=void 0,(_=exports.TUIKickedOutOfRoomReason||(exports.TUIKickedOutOfRoomReason={}))[_.kKickedByAdmin=0]="kKickedByAdmin",_[_.kKickedByLoggedOnOtherDevice=1]="kKickedByLoggedOnOtherDevice",_[_.kKickedByServer=2]="kKickedByServer",exports.TUIRequestAction=void 0,(g=exports.TUIRequestAction||(exports.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",exports.TUIRequestCallbackType=void 0,(h=exports.TUIRequestCallbackType||(exports.TUIRequestCallbackType={}))[h.kRequestAccepted=0]="kRequestAccepted",h[h.kRequestRejected=1]="kRequestRejected",h[h.kRequestCancelled=2]="kRequestCancelled",h[h.kRequestTimeout=3]="kRequestTimeout",h[h.kRequestError=4]="kRequestError",h[h.kRequestId=5]="kRequestId",exports.TRTCRole=void 0,(f=exports.TRTCRole||(exports.TRTCRole={}))[f.kAnchor=0]="kAnchor",f[f.kAudience=1]="kAudience",exports.TUIResolutionMode=void 0,(m=exports.TUIResolutionMode||(exports.TUIResolutionMode={}))[m.kResolutionMode_Landscape=0]="kResolutionMode_Landscape",m[m.kResolutionMode_Portrait=1]="kResolutionMode_Portrait",exports.TUIMediaDeviceType=void 0,(v=exports.TUIMediaDeviceType||(exports.TUIMediaDeviceType={}))[v.kMediaDeviceTypeUnknown=-1]="kMediaDeviceTypeUnknown",v[v.kMediaDeviceTypeAudioInput=0]="kMediaDeviceTypeAudioInput",v[v.kMediaDeviceTypeAudioOutput=1]="kMediaDeviceTypeAudioOutput",v[v.kMediaDeviceTypeVideoCamera=2]="kMediaDeviceTypeVideoCamera",exports.TUIMediaDeviceState=void 0,(y=exports.TUIMediaDeviceState||(exports.TUIMediaDeviceState={}))[y.kMediaDeviceStateAdd=0]="kMediaDeviceStateAdd",y[y.kMediaDeviceStateRemove=1]="kMediaDeviceStateRemove",y[y.kMediaDeviceStateActive=2]="kMediaDeviceStateActive",exports.TUIAudioRoute=void 0,(I=exports.TUIAudioRoute||(exports.TUIAudioRoute={}))[I.kAudioRouteSpeakerphone=0]="kAudioRouteSpeakerphone",I[I.kAudioRouteEarpiece=1]="kAudioRouteEarpiece",exports.TUIConferenceStatus=void 0,(M=exports.TUIConferenceStatus||(exports.TUIConferenceStatus={}))[M.kConferenceStatusNone=0]="kConferenceStatusNone",M[M.kConferenceStatusNotStarted=1]="kConferenceStatusNotStarted",M[M.kConferenceStatusRunning=2]="kConferenceStatusRunning",exports.TUIConferenceCancelReason=void 0,(C=exports.TUIConferenceCancelReason||(exports.TUIConferenceCancelReason={}))[C.kConferenceCancelReasonCancelledByAdmin=0]="kConferenceCancelReasonCancelledByAdmin",C[C.kConferenceCancelReasonRemovedFromAttendees=1]="kConferenceCancelReasonRemovedFromAttendees",exports.TUIInvitationStatus=void 0,(T=exports.TUIInvitationStatus||(exports.TUIInvitationStatus={}))[T.kNone=0]="kNone",T[T.kPending=1]="kPending",T[T.kTimeout=2]="kTimeout",T[T.kAccepted=3]="kAccepted",T[T.kRejected=4]="kRejected",exports.TUIInvitationCode=void 0,(E=exports.TUIInvitationCode||(exports.TUIInvitationCode={}))[E.kSuccess=0]="kSuccess",E[E.kAlreadyInInvitationList=1]="kAlreadyInInvitationList",E[E.kAlreadyInConference=2]="kAlreadyInConference",exports.TUIInvitationRejectedReason=void 0,(D=exports.TUIInvitationRejectedReason||(exports.TUIInvitationRejectedReason={}))[D.kRejectToEnter=0]="kRejectToEnter",D[D.kInOtherConference=1]="kInOtherConference",exports.TUIRoomEvents=void 0,(R=exports.TUIRoomEvents||(exports.TUIRoomEvents={})).onError="onError",R.onKickedOutOfRoom="onKickedOutOfRoom",R.onKickedOffLine="onKickedOffLine",R.onUserSigExpired="onUserSigExpired",R.onRoomDismissed="onRoomDismissed",R.onRoomNameChanged="onRoomNameChanged",R.onRoomSeatModeChanged="onRoomSeatModeChanged",R.onAllUserCameraDisableChanged="onAllUserCameraDisableChanged",R.onAllUserMicrophoneDisableChanged="onAllUserMicrophoneDisableChanged",R.onScreenShareForAllUserDisableChanged="onScreenShareForAllUserDisableChanged",R.onSendMessageForAllUserDisableChanged="onSendMessageForAllUserDisableChanged",R.onRemoteUserEnterRoom="onRemoteUserEnterRoom",R.onRemoteUserLeaveRoom="onRemoteUserLeaveRoom",R.onUserInfoChanged="onUserInfoChanged",R.onUserRoleChanged="onUserRoleChanged",R.onUserVideoStateChanged="onUserVideoStateChanged",R.onUserAudioStateChanged="onUserAudioStateChanged",R.onSendMessageForUserDisableChanged="onSendMessageForUserDisableChanged",R.onUserVoiceVolumeChanged="onUserVoiceVolumeChanged",R.onUserNetworkQualityChanged="onUserNetworkQualityChanged",R.onSeatListChanged="onSeatListChanged",R.onKickedOffSeat="onKickedOffSeat",R.onRequestReceived="onRequestReceived",R.onRequestCancelled="onRequestCancelled",R.onRequestProcessed="onRequestProcessed",R.onReceiveTextMessage="onReceiveTextMessage",R.onReceiveCustomMessage="onReceiveCustomMessage",R.onDeviceChange="onDeviceChange",R.onUserScreenCaptureStopped="onUserScreenCaptureStopped",R.onUserScreenCapturePaused="onUserScreenCapturePaused",R.onUserScreenCaptureResumed="onUserScreenCaptureResumed",exports.TUIRoomDeviceMangerEvents=void 0,(S=exports.TUIRoomDeviceMangerEvents||(exports.TUIRoomDeviceMangerEvents={})).onDeviceChanged="onDeviceChanged",S.onTestMicVolume="onTestMicVolume",S.onTestSpeakerVolume="onTestSpeakerVolume",exports.TUIConferenceListManagerEvents=void 0,(L=exports.TUIConferenceListManagerEvents||(exports.TUIConferenceListManagerEvents={})).onConferenceScheduled="onConferenceScheduled",L.onConferenceWillStart="onConferenceWillStart",L.onConferenceCancelled="onConferenceCancelled",L.onConferenceInfoChanged="onConferenceInfoChanged",L.onScheduleAttendeesChanged="onScheduleAttendeesChanged",L.onConferenceStatusChanged="onConferenceStatusChanged",exports.TUIConferenceInvitationManagerEvents=void 0,(A=exports.TUIConferenceInvitationManagerEvents||(exports.TUIConferenceInvitationManagerEvents={})).onReceiveInvitation="onReceiveInvitation",A.onInvitationHandledByOtherDevice="onInvitationHandledByOtherDevice",A.onInvitationCancelled="onInvitationCancelled",A.onInvitationAccepted="onInvitationAccepted",A.onInvitationRejected="onInvitationRejected",A.onInvitationTimeout="onInvitationTimeout",A.onInvitationRevokedByAdmin="onInvitationRevokedByAdmin",A.onInvitationAdded="onInvitationAdded",A.onInvitationRemoved="onInvitationRemoved",A.onInvitationStatusChanged="onInvitationStatusChanged",exports.TXAudioEffectManagerEvents=void 0,(k=exports.TXAudioEffectManagerEvents||(exports.TXAudioEffectManagerEvents={})).onStart="onStart",k.onPlayProgress="onPlayProgress",k.onComplete="onComplete";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",x="INVALID_PARAMETER_TYPE",V="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(n,o,i){const s=i.value;return i.value=function(...n){return t(this,void 0,void 0,function*(){return z.call(this,e,n,o,this.className),s.apply(this,n)})},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(e){const{rule:t,value:n,key:o,fnName:i,className:s}=e;if(N(n)){if(t.required)throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:q,data:{key:o,rule:t,fnName:i,value:n}})});return}if(Array.isArray(t.type)){if(!t.type.map(e=>e.toLowerCase()).includes(U(n)))throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:x,data:{key:o,rule:t,fnName:i,value:n}})})}else if(!N(t.type)&&U(n)!==t.type)throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:x,data:{key:o,rule:t,fnName:i,value:n}})});if(!1===t.allowEmpty){const e=G(n)&&(0===n||Number.isNaN(n)),s=P(n)&&""===n.trim();if(e||s)throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:V,data:{key:o,rule:t,fnName:i,value:n}})})}if(t.notLessThanZero&&G(n)&&n<0)throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:K,data:{key:o,rule:t,fnName:i,value:n}})});if(P(t.instanceOf)){if(!n||n.name_!==t.instanceOf)throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:B,data:{key:o,rule:t,fnName:i,value:n}})})}else if(O(t.instanceOf)&&!(n instanceof t.instanceOf))throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:B,data:{key:o,rule:t,fnName:i,value:n}})});if(t.values&&!t.values.includes(n))throw new F({code:exports.TUIErrorCode.ERR_INVALID_PARAMETER,message:Y({key:H,data:{key:o,rule:t,fnName:i,value:n}})});const{properties:a}=t;b(a)&&"object"===U(n)&&Object.keys(a).forEach(e=>{X.call(this,{rule:a[e],value:n&&n[e],key:`${o}.${e}`,fnName:i,className:s})});const{arrayItem:r}=t;b(r)&&(e=>"array"===U(e))(n)&&n.forEach((e,t)=>{X.call(this,{rule:r,value:e,key:`${o}[${t}]`,fnName:i,className:s})}),O(t.validate)&&t.validate.call(this,n,o,i,s,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:exports.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:exports.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:exports.TUIMediaDevice}}},closeRemoteDeviceByAdmin:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},device:{required:!0,instanceof:exports.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:e=>{if(e instanceof Array){if(e.some(e=>null===e))throw new F({code:exports.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:exports.TUIVideoStreamType},resolutionMode:{required:!0,instanceof:exports.TUIResolutionMode}}},updateVideoQuality:{name:"options",required:!0,type:oe,properties:{quality:{required:!0,instanceof:exports.TUIVideoQuality}}},updateVideoQualityEx:{name:"options",required:!0,type:oe,properties:{streamType:{required:!0,instanceof:exports.TUIVideoStreamType},encoderParams:{required:!0,properties:{quality:{instanceof:exports.TUIVideoQuality},fps:{type:ee},bitrate:{type:ee},resolutionMode:{instanceof:exports.TUIResolutionMode}}}}},updateAudioQuality:{name:"options",required:!0,type:oe,properties:{quality:{required:!0,instanceof:exports.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:exports.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:exports.TUIVideoStreamType}}},stopPlayRemoteVideo:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},streamType:{required:!0,instanceof:exports.TUIVideoStreamType}}},changeUserRole:{name:"options",required:!0,type:oe,properties:{userId:{required:!0,type:$,allowEmpty:!1},userRole:{required:!0,instanceof:exports.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:$}}},enableSystemAudioSharing:{name:"options",required:!0,type:oe,properties:{enable:{required:!0,type:te}}},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:exports.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:exports.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:exports.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 t(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 ge{constructor(e){const{Module:t,logger:n}=e;this.trtcCloud||(this.logger=n,this.trtcCloud=t)}static getInstance(e){return ge.instance||(ge.instance=new ge(e)),ge.instance}JSCallNativeFunctionSync(e,t){return this.trtcCloud[e](t)}setLocalRenderParams(e){return t(this,void 0,void 0,function*(){this.logger.info("trtcCloud.setLocalRenderParams with options: ",e),yield this.JSCallNativeFunctionSync("setLocalRenderParams",e)})}}var he={};({get exports(){return he},set exports(e){he=e}}).exports=function(){function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function t(e){if(Array.isArray(e))return e}function n(e,t,n){t=c(t);var o=e;if(!(t=l()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=o))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}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,y(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){var n,o,i,s,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(o=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){i=!0,n=e},f:function(){try{o||null==a.return||a.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(a=M(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),s=0,{s:t=function(){},n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},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.")}function r(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(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&&f(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(){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 _(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){if(null==e)return{};var n,o=function(e,t){if(null==e)return{};var n,o={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(0<=t.indexOf(n))continue;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)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e,n){return t(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,r=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=s.call(n)).done)&&(r.push(o.value),r.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return r}}(e,n)||M(e,n)||p()}function v(t){return function(t){if(Array.isArray(t))return e(t)}(t)||d(t)||M(t)||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 y(e){return e=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);if("object"!=typeof(t=t.call(e,"string")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),"symbol"==typeof e?e:e+""}function I(e){return(I="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 M(t,n){var o;if(t)return"string"==typeof t?e(t,n):"Map"===(o="Object"===(o={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?e(t,n):void 0}function C(e){var t="function"==typeof Map?new Map:void 0;return function(e){if(null===e||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(e))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 function(e,t,n){var o;return l()?Reflect.construct.apply(null,arguments):((o=[null]).push.apply(o,t),t=new(e.bind.apply(e,o)),n&&f(t,n.prototype),t)}(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)}(e)}var T={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",SERVER_CONFIG_UPDATED:"onServerConfigUpdated",PINNED_GROUP_MESSAGE_UPDATED:"onPinnedGroupMessageUpdated"},E={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"},D={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},R=s(function e(){o(this,e),this.cache=[],this.options=null},[{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()}}]),S=s(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n},[{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}}]),L={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",BACKUP_WEB:"wss://*w4c.my-cpaas.com",BACKUP_CN:"wss://wss.im.tencent.cn",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",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",BACKUP_CN:"wss://wss.im.tencent.cn",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",BACKUP_WEB:"wss://*w4s.my-cpaas.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",BACKUP_WEB:"wss://*w4k.my-cpaas.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",BACKUP_WEB:"wss://*w4g.my-cpaas.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",BACKUP_WEB:"wss://*w4i.my-cpaas.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",BACKUP_WEB:"wss://*w4j.my-cpaas.com",STAT:"https://apijpn.my-imcloud.com",ANYCAST:"wss://162.14.13.254"},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",BACKUP_WEB:"wss://*w4u.my-cpaas.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",BACKUP_WEB:"wss://*w4y.my-cpaas.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},A={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},k="1.7.3",O=537048168,N="CHINA",P={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){this.CURRENT=L.PRODUCTION[0<arguments.length&&void 0!==arguments[0]?arguments[0]:N]}},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:"offl