@rongcloud/plugin-call-plus 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -26,9 +26,9 @@
26
26
  "license": "LGPL 2.1",
27
27
  "description": "@rongcloud/plugin-call-plus",
28
28
  "homepage": "https://www.rongcloud.cn",
29
- "version": "2.1.2",
29
+ "version": "2.1.4",
30
30
  "dependencies": {
31
31
  "@rongcloud/engine": "^5.8.2",
32
- "@rongcloud/plugin-rtc": "^5.6.16"
32
+ "@rongcloud/plugin-rtc": "^5.7.0"
33
33
  }
34
34
  }
@@ -1,5 +1,5 @@
1
- import { EventEmitter, ConversationType, RTCPluginContext, BasicLogger, LogL, IRuntime, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
2
- import { IMicphoneAudioProfile, RTCJoinType, ICameraVideoProfile, RCRTCCode, IRCRTCStateReport } from '@rongcloud/plugin-rtc';
1
+ import { EventEmitter, ConversationType, RTCPluginContext, BasicLogger, LogL, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
2
+ import { IMicphoneAudioProfile, RTCJoinType, ICameraVideoProfile, RCRTCCode, IRCRTCStateReport, RCRTCPingResult } from '@rongcloud/plugin-rtc';
3
3
  import { RCCallPlusClient, RCCallPlusMediaType, RCCallPlusPacketLossStats, IRCCallPlusPushConfig } from '@rongcloud/plugin-call-plus';
4
4
 
5
5
  declare enum RCCallUserState {
@@ -203,15 +203,15 @@ declare class RCCallSession extends EventEmitter {
203
203
  private _mediaType;
204
204
  private _context;
205
205
  private _logger;
206
- private _options?;
206
+ private _options;
207
207
  private _descendResolve;
208
208
  private _audioConfigBuilder;
209
209
  private _videoConfigBuilder;
210
210
  private _reportAppEventModule;
211
- constructor(_callId: string, _callPlusClient: RCCallPlusClient, _channelId: string, _targetId: string, _callType: ConversationType, _mediaType: RCCallPlusMediaType, _context: RTCPluginContext, _logger: BasicLogger, _options?: {
212
- callPushConfig?: IPushConfig | undefined;
213
- hangupPushConfig?: IPushConfig | undefined;
214
- } | undefined);
211
+ constructor(_callId: string, _callPlusClient: RCCallPlusClient, _channelId: string, _targetId: string, _callType: ConversationType, _mediaType: RCCallPlusMediaType, _context: RTCPluginContext, _logger: BasicLogger, _options: {
212
+ callPushConfig?: IPushConfig;
213
+ hangupPushConfig?: IPushConfig;
214
+ });
215
215
  /**
216
216
  * 用户调用的,注册session上的监听
217
217
  */
@@ -225,7 +225,7 @@ declare class RCCallSession extends EventEmitter {
225
225
  /**
226
226
  * 群呼叫中继续邀请
227
227
  * @param userIds 被邀请用户 ID 列表
228
- * @param options.extra 消息的扩展信息
228
+ * @param options 透传配置及移动端推送配置
229
229
  */
230
230
  invite(userIds: string[], options?: IInviteOptions): Promise<{
231
231
  code: RCCallErrorCode;
@@ -244,7 +244,6 @@ declare class RCCallSession extends EventEmitter {
244
244
  }>;
245
245
  /**
246
246
  * 通话降级,目前需求只做通话降级,音视频可以降级为音频,音频不能升到音视频, 发消息成功才算降级成功
247
- *
248
247
  */
249
248
  descendAbility(): Promise<{
250
249
  code: RCCallErrorCode;
@@ -313,6 +312,11 @@ declare class RCCallSession extends EventEmitter {
313
312
  * 获得mediaType
314
313
  */
315
314
  getMediaType(): RCCallMediaType;
315
+ /**
316
+ * @private
317
+ * @param mediaType
318
+ */
319
+ __innerEndTranction(mediaType: RCCallPlusMediaType, transactionId: string): void;
316
320
  }
317
321
 
318
322
  /**
@@ -522,42 +526,36 @@ interface IRCCallInitOptions {
522
526
  onSessionClose: (session: RCCallSession, summary?: IEndSummary) => void;
523
527
  /**
524
528
  * 离线期间收到的呼叫记录
525
- * @param record
526
529
  * @returns
527
530
  */
528
531
  onOfflineRecord?: (record: IOfflineRecord) => void;
529
532
  /**
530
- * 是否允许接听新呼叫,当前正在通话,如果收到新的邀请,是直接挂断,还是允许选择, 默认值false,直接挂断新的session
531
- *
532
- * 暂不对外暴露
533
- */
534
- /**
535
- * @deprecated
536
533
  * 是否允许订阅重试,默认为 true
534
+ * @deprecated
537
535
  */
538
536
  isAllowSubscribeRetry?: boolean;
539
537
  /**
540
- * @deprecated
541
538
  * 是否允许发布重试,默认为 true
539
+ * @deprecated
542
540
  */
543
541
  isAllowPublishRetry?: boolean;
544
542
  /**
545
- * @deprecated
546
543
  * 禁用视频时关摄像头, 默认为 true
544
+ * @deprecated
547
545
  */
548
546
  isOffCameraWhenVideoDisable?: boolean;
549
547
  /**
550
- * @deprecated
551
548
  * RTC 房间加入类型,默认为:踢前一个设备
549
+ * @deprecated
552
550
  */
553
551
  joinType?: RTCJoinType;
554
552
  /**
555
- * 允许降级获得流,获得音视频不成功 ,降级获得音频
553
+ * CallPlus Wrapper 中默认允许降级获取流,无需配置
554
+ * @deprecated
556
555
  */
557
556
  isAllowDemotionGetStream?: boolean;
558
557
  /**
559
558
  * 日志输出等级
560
- * @since version 5.2.2
561
559
  */
562
560
  logOutputLevel?: LogL.DEBUG | LogL.INFO | LogL.WARN | LogL.ERROR;
563
561
  /**
@@ -575,13 +573,17 @@ interface IInviteOptions {
575
573
  */
576
574
  extra?: string;
577
575
  /**
578
- * 对方显示通知的标题
576
+ * @deprecated 请使用 `pushConfig` 属性代替
579
577
  */
580
578
  pushTitle?: string;
581
579
  /**
582
- * 对方显示的通知内容
580
+ * @deprecated 请使用 `pushConfig` 属性代替
583
581
  */
584
582
  pushContent?: string;
583
+ /**
584
+ * 移动端推送配置
585
+ */
586
+ pushConfig?: IPushConfig;
585
587
  }
586
588
  interface IMediaStreamConstraints {
587
589
  video?: ICameraVideoProfile;
@@ -626,18 +628,21 @@ interface IUserData extends IUserProfile {
626
628
  deviceId?: string;
627
629
  }
628
630
  interface ISender {
631
+ /**
632
+ * 用户 id
633
+ */
629
634
  userId: string;
630
635
  /**
631
- * 用户名
632
- */
636
+ * @deprecated
637
+ */
633
638
  name?: string;
634
639
  /**
635
- * 用户头像地址
636
- */
640
+ * @deprecated
641
+ */
637
642
  portraitUri?: string;
638
643
  /**
639
- * user info 中附加信息
640
- */
644
+ * @deprecated
645
+ */
641
646
  extra?: string;
642
647
  }
643
648
  interface IMuteUser extends ISender {
@@ -649,6 +654,10 @@ interface IMuteUser extends ISender {
649
654
  * track类型
650
655
  */
651
656
  kind: string;
657
+ /**
658
+ * trackId
659
+ */
660
+ trackId: string;
652
661
  }
653
662
  /**
654
663
  * 通话发起者信息
@@ -698,6 +707,7 @@ interface ISessionListener {
698
707
  onVideoMuteChange: (muteUser: IMuteUser, session: RCCallSession) => void;
699
708
  /**
700
709
  * 资源订阅失败
710
+ * @deprecated
701
711
  */
702
712
  onTrackSubscribeFail?: (code: RCRTCCode, session: RCCallSession) => void;
703
713
  /**
@@ -706,34 +716,37 @@ interface ISessionListener {
706
716
  */
707
717
  onRTCStateReport?: (report: IRCRTCStateReport, session: RCCallSession) => void;
708
718
  /**
709
- * 发送丢包率信息回调,每秒回调一次
710
- * @param packetLostRate 丢包率,0-100
711
- * @param delay 发送端的网络延迟,单位毫秒
719
+ * 资源发布失败
720
+ * @deprecated
712
721
  */
713
- onSendPacketLoss?(packetLostRate: number, delay: number): void;
722
+ onTrackPublishFail?(code: RCRTCCode, session: RCCallSession): void;
714
723
  /**
715
- * 接收丢包率信息回调,每秒回调一次
716
- * @param data key: userId, value: 接收丢包统计数据
717
- * @param data[userId].packetLostRate 丢包率:取值范围是 0-100
718
- * @param data[userId].bitRate 码率大小,单位是 kbps
724
+ * RTC 每次 Ping 结果
725
+ * @deprecated
719
726
  */
720
- onReceivePacketLoss?(data: {
721
- [userId: string]: RCCallPacketLossStats;
722
- }): void;
727
+ onPing?(result: RCRTCPingResult, session: RCCallSession): void;
728
+ /**
729
+ * ~ICE 连接状态变更通知~
730
+ * @deprecated
731
+ */
732
+ onICEConnectionStateChange?(state: RTCIceConnectionState, session: RCCallSession): void;
723
733
  }
724
734
  /**
725
735
  * 呼叫、挂断推送信息
726
736
  */
727
737
  interface IPushConfig extends Partial<IRCCallPlusPushConfig> {
728
738
  /**
729
- * 推送标题
739
+ * @deprecated
740
+ */
741
+ pushContent?: string;
742
+ /**
743
+ * @deprecated
730
744
  */
731
- pushTitle?: string;
745
+ pushData?: string;
732
746
  /**
733
- * 推送内容
734
747
  * @deprecated
735
748
  */
736
- pushContent?: string;
749
+ forceShowDetailContent?: boolean;
737
750
  }
738
751
  interface IRCTrackBitrate {
739
752
  /**
@@ -777,8 +790,8 @@ interface IRCCallInGroupParams {
777
790
  */
778
791
  pushTitle?: string;
779
792
  /**
780
- * 对方显示的通知内容
781
- */
793
+ * 对方显示的通知内容
794
+ */
782
795
  pushContent?: string;
783
796
  /**
784
797
  * 设置码率
@@ -792,6 +805,9 @@ interface IRCCallInGroupParams {
792
805
  * RCCallClient call方法的传参
793
806
  */
794
807
  interface IRCCallParams {
808
+ /**
809
+ * 被叫 Id
810
+ */
795
811
  targetId: string;
796
812
  /**
797
813
  * 音频 or 音视频, 默认音频
@@ -817,8 +833,8 @@ interface IRCCallParams {
817
833
  */
818
834
  extra?: string;
819
835
  /**
820
- * 对方显示通知的标题
821
- */
836
+ * 对方显示通知的标题
837
+ */
822
838
  pushTitle?: string;
823
839
  /**
824
840
  * 对方显示的通知内容
@@ -855,7 +871,6 @@ interface IDeviceChangeParams {
855
871
 
856
872
  declare class RCCallClient {
857
873
  private _context;
858
- private readonly _runtime;
859
874
  private readonly _logger;
860
875
  private readonly _options;
861
876
  private _callPlusClient;
@@ -871,13 +886,10 @@ declare class RCCallClient {
871
886
  private _hangupPushConfig;
872
887
  private _isSelfHangup;
873
888
  private _reportAppEventModule;
874
- constructor(_context: RTCPluginContext, _runtime: IRuntime, _logger: BasicLogger, _options: IRCCallInitOptions);
889
+ constructor(_context: RTCPluginContext, _logger: BasicLogger, _options: IRCCallInitOptions);
875
890
  private _setCallPlusEventListener;
876
891
  /**
877
- * 注册用户信息。注册后,在发起邀请或挂断等操作时,会将该信息一并发送给对端
878
- * @param info.name 用户名称
879
- * @param info.portraitUri 用户头像信息
880
- * @param info.extra 预留拓展字段
892
+ * 接口已废弃,CallPlusWrapper 不再支持用户信息透传
881
893
  * @deprecated
882
894
  */
883
895
  registerUserInfo(info?: {
@@ -886,17 +898,10 @@ declare class RCCallClient {
886
898
  extra?: string;
887
899
  }): void;
888
900
  /**
889
- * 跨App单呼,发送invite消息,回调回来接收stateMachine, 建session
890
- * @param params.targetId 被呼叫一方的用户 id 必填
891
- * @param params.mediaType 音频呼叫 or 音视频呼叫 必填
892
- * @param params.listener (session上的监听) 必填
893
- * @param params.constraints 获取音频或音视频资源时的参数 可选
894
- * @param params.channelId 组织 Id 可选
895
- * @param params.extra 消息扩展信息
896
- * @param params.bitrate 需要设置的码率参数
901
+ * 接口已废弃,CallPlus Wrapper 不支持跨 appkey 呼叫
897
902
  * @deprecated
898
903
  */
899
- startCrossCall({ targetId, mediaType, listener, constraints, channelId, extra, bitrate, }: IRCCallParams): Promise<void>;
904
+ startCrossCall(_: IRCCallParams): Promise<void>;
900
905
  private __startCall;
901
906
  /**
902
907
  * 单呼,发送invite消息,回调回来接收stateMachine, 建session
@@ -1 +1 @@
1
- import{EventEmitter as e,ConversationType as t,ErrorCode as _,isUndefined as n,LogL as i}from"@rongcloud/engine";import{RCCallPlusSessionUserState as r,RCCallPlusCallState as o,RCCallPlusCode as a,RCCallPlusReason as l,RCCallPlusMediaType as E,RCCallPlusMediaTypeChangeResult as s,RCCallPlusType as u}from"@rongcloud/plugin-call-plus";var c,I,R,O,L,C,N=function(e,t){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var _ in t)Object.prototype.hasOwnProperty.call(t,_)&&(e[_]=t[_])},N(e,t)};function d(e,t,_,n){return new(_||(_=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof _?t:new _((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}function T(e,t){var _,n,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(l){return function(a){if(_)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(o=0)),o;)try{if(_=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{_=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.AUDIO=1]="AUDIO",e[e.AUDIO_VIDEO=2]="AUDIO_VIDEO"}(c||(c={})),function(e){e[e.SUCCESS=1e4]="SUCCESS",e[e.STATE_MACHINE_EXIT=53200]="STATE_MACHINE_EXIT",e[e.SEND_MSG_ERROR=53201]="SEND_MSG_ERROR",e[e.REJECTED_BY_BLACKLIST=53202]="REJECTED_BY_BLACKLIST",e[e.NOT_IN_GROUP=53203]="NOT_IN_GROUP",e[e.GET_LOCAL_AUDIO_TRACK_ERROR=53301]="GET_LOCAL_AUDIO_TRACK_ERROR",e[e.GET_LOCAL_VIDEO_TRACK_ERROR=53302]="GET_LOCAL_VIDEO_TRACK_ERROR",e[e.GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR=53303]="GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR",e[e.JOIN_ROOM_ERROR=53304]="JOIN_ROOM_ERROR",e[e.AUDIO_PUBLISH_ERROR=53305]="AUDIO_PUBLISH_ERROR",e[e.VIDEO_PUBLISH_ERROR=53306]="VIDEO_PUBLISH_ERROR",e[e.AUDIO_AND_VIDEO_PUBLISH_ERROR=53307]="AUDIO_AND_VIDEO_PUBLISH_ERROR",e[e.QUERY_JOINED_USER_INFO_ERROR=53308]="QUERY_JOINED_USER_INFO_ERROR",e[e.MISSING_VIDEO_TRACK_ERROR=53309]="MISSING_VIDEO_TRACK_ERROR",e[e.UNPUBLISH_VIDEO_ERROR=53310]="UNPUBLISH_VIDEO_ERROR",e[e.CONVERSATION_NOT_GROUP_ERROR=53311]="CONVERSATION_NOT_GROUP_ERROR",e[e.NOT_IN_ROOM_ERROR=53312]="NOT_IN_ROOM_ERROR",e[e.PARAM_ERROR=53313]="PARAM_ERROR",e[e.NOT_IN_CALL=53314]="NOT_IN_CALL",e[e.MEDIATYPE_INVALID=53315]="MEDIATYPE_INVALID",e[e.NOT_VIDEO_CALL=53316]="NOT_VIDEO_CALL",e[e.RTC_SERVICE_UNAVAILABLE=53317]="RTC_SERVICE_UNAVAILABLE",e[e.USER_LIST_INVAILD=53318]="USER_LIST_INVAILD",e[e.CALL_ID_INVALID=53319]="CALL_ID_INVALID",e[e.TRANSACTION_ID_INVALID=53320]="TRANSACTION_ID_INVALID",e[e.USER_ID_INVALID=53321]="USER_ID_INVALID",e[e.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON=53322]="SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON",e[e.MICROPHONE_CLOSED=53323]="MICROPHONE_CLOSED",e[e.MEDIA_RESOURCE_INVALIED=53324]="MEDIA_RESOURCE_INVALIED",e[e.NOT_INSTALL_RTC_PLUGIN=53325]="NOT_INSTALL_RTC_PLUGIN",e[e.PLAY_MEDIA_FAILED=53326]="PLAY_MEDIA_FAILED",e[e.VIDEO_VIEW_NOT_SET=53327]="VIDEO_VIEW_NOT_SET"}(I||(I={})),function(e){e[e.NONE=0]="NONE",e[e.WAITING=1]="WAITING",e[e.KEEPING=2]="KEEPING"}(R||(R={})),function(e){e[e.WAITING=0]="WAITING",e[e.KEEPING=1]="KEEPING",e[e.END=2]="END"}(O||(O={})),function(e){e[e.CANCEL=1]="CANCEL",e[e.REJECT=2]="REJECT",e[e.HANGUP=3]="HANGUP",e[e.BUSY_LINE=4]="BUSY_LINE",e[e.NO_RESPONSE=5]="NO_RESPONSE",e[e.ENGINE_UNSUPPORTED=6]="ENGINE_UNSUPPORTED",e[e.NETWORK_ERROR=7]="NETWORK_ERROR",e[e.GET_MEDIA_RESOURCES_ERROR=8]="GET_MEDIA_RESOURCES_ERROR",e[e.PUBLISH_ERROR=9]="PUBLISH_ERROR",e[e.SUBSCRIBE_ERROR=10]="SUBSCRIBE_ERROR",e[e.REMOTE_CANCEL=11]="REMOTE_CANCEL",e[e.REMOTE_REJECT=12]="REMOTE_REJECT",e[e.REMOTE_HANGUP=13]="REMOTE_HANGUP",e[e.REMOTE_BUSY_LINE=14]="REMOTE_BUSY_LINE",e[e.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",e[e.REMOTE_ENGINE_UNSUPPORTED=16]="REMOTE_ENGINE_UNSUPPORTED",e[e.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",e[e.REMOTE_GET_MEDIA_RESOURCE_ERROR=18]="REMOTE_GET_MEDIA_RESOURCE_ERROR",e[e.REMOTE_PUBLISH_ERROR=19]="REMOTE_PUBLISH_ERROR",e[e.REMOTE_SUBSCRIBE_ERROR=20]="REMOTE_SUBSCRIBE_ERROR",e[e.OTHER_CLIENT_JOINED_CALL=21]="OTHER_CLIENT_JOINED_CALL",e[e.OTHER_CLIENT_IN_CALL=22]="OTHER_CLIENT_IN_CALL",e[e.KICKED_BY_SERVER=23]="KICKED_BY_SERVER",e[e.ACCEPT_SYSTEM_CALL=24]="ACCEPT_SYSTEM_CALL",e[e.REMOTE_OTHER_CLIENT_JOINED_CALL=31]="REMOTE_OTHER_CLIENT_JOINED_CALL",e[e.REMOTE_OTHER_CLIENT_IN_CALL=32]="REMOTE_OTHER_CLIENT_IN_CALL",e[e.REMOTE_KICKED_BY_SERVER=33]="REMOTE_KICKED_BY_SERVER",e[e.REMOTE_ACCEPT_SYSTEM_CALL=34]="REMOTE_ACCEPT_SYSTEM_CALL",e[e.ACCEPT_BY_OTHER_CLIENT=101]="ACCEPT_BY_OTHER_CLIENT",e[e.HANGUP_BY_OTHER_CLIENT=102]="HANGUP_BY_OTHER_CLIENT",e[e.ADDED_TO_BLACKLIST=103]="ADDED_TO_BLACKLIST",e[e.SERVICE_NOT_OPENED=104]="SERVICE_NOT_OPENED"}(C||(C={})),(L={})[C.CANCEL]=C.REMOTE_CANCEL,L[C.REJECT]=C.REMOTE_REJECT,L[C.HANGUP]=C.REMOTE_HANGUP,L[C.BUSY_LINE]=C.REMOTE_BUSY_LINE,L[C.NO_RESPONSE]=C.REMOTE_NO_RESPONSE,L[C.ENGINE_UNSUPPORTED]=C.REMOTE_ENGINE_UNSUPPORTED,L[C.NETWORK_ERROR]=C.REMOTE_NETWORK_ERROR,L[C.GET_MEDIA_RESOURCES_ERROR]=C.REMOTE_GET_MEDIA_RESOURCE_ERROR,L[C.PUBLISH_ERROR]=C.REMOTE_PUBLISH_ERROR,L[C.SUBSCRIBE_ERROR]=C.REMOTE_SUBSCRIBE_ERROR,L[C.OTHER_CLIENT_JOINED_CALL]=C.REMOTE_OTHER_CLIENT_JOINED_CALL,L[C.OTHER_CLIENT_IN_CALL]=C.REMOTE_OTHER_CLIENT_IN_CALL,L[C.KICKED_BY_SERVER]=C.REMOTE_KICKED_BY_SERVER,L[C.REMOTE_NO_RESPONSE]=C.NO_RESPONSE,L[C.ACCEPT_SYSTEM_CALL]=C.REMOTE_ACCEPT_SYSTEM_CALL;var S,A=function(e){var t=null;switch(e){case r.IDLE:t=R.NONE;break;case r.CALLING:case r.INVITED:case r.RINGING:t=R.WAITING;break;case r.BUSYLINE_RINGING:case r.BUSYLINE_WAIT:t=R.NONE;break;case r.CONNECTING:t=R.WAITING;break;case r.ONCALL:t=R.KEEPING;break;case r.ONPHONE:t=R.WAITING;break;case r.ENDED:case r.NO_ANSWER:case r.MISSED:case r.CANCELLED:case r.DECLINED:case r.ERROR:default:t=R.NONE}return t},f=function(e){var t=null;switch(e){case a.SUCCESS:t=I.SUCCESS;break;case a.PARAM_ERROR:t=I.PARAM_ERROR;break;case a.SESSION_EXIST:t=I.STATE_MACHINE_EXIT;break;case a.NOT_IN_CALL:t=I.NOT_IN_CALL;break;case a.MEDIATYPE_INVALID:t=I.MEDIATYPE_INVALID;break;case a.NOT_VIDEO_CALL:t=I.NOT_VIDEO_CALL;break;case a.RTC_SERVICE_UNAVAILABLE:t=I.RTC_SERVICE_UNAVAILABLE;break;case a.USER_LIST_INVAILD:t=I.USER_LIST_INVAILD;break;case a.CALL_ID_INVALID:t=I.CALL_ID_INVALID;break;case a.TRANSACTION_ID_INVALID:t=I.TRANSACTION_ID_INVALID;break;case a.USER_ID_INVALID:t=I.USER_ID_INVALID;break;case a.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON:t=I.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON;break;case a.CAMERA_CLOSED:t=I.MISSING_VIDEO_TRACK_ERROR;break;case a.MICROPHONE_CLOSED:t=I.MICROPHONE_CLOSED;break;case a.MEDIA_RESOURCE_INVALIED:t=I.MEDIA_RESOURCE_INVALIED;break;case a.NOT_INSTALL_RTC_PLUGIN:t=I.NOT_INSTALL_RTC_PLUGIN;break;case a.PLAY_MEDIA_FAILED:t=I.PLAY_MEDIA_FAILED;break;case a.VIDEO_VIEW_NOT_SET:t=I.VIDEO_VIEW_NOT_SET;break;default:t=e}return t},g=function(e,t){var _=null;switch(e){case l.BUSYLINE_RINGING:_=t?C.BUSY_LINE:C.REMOTE_BUSY_LINE;break;case l.ON_DEVICE_DISABLE:_=C.REMOTE_GET_MEDIA_RESOURCE_ERROR;break;case l.ENDED:_=t?C.HANGUP:C.REMOTE_HANGUP;break;case l.NO_ANSWER:_=C.REMOTE_NO_RESPONSE;break;case l.MISSED:_=C.NO_RESPONSE;break;case l.CANCELLED:_=t?C.CANCEL:C.REMOTE_CANCEL;break;case l.DECLINED:_=t?C.REJECT:C.REMOTE_REJECT;break;case l.OTHER_CLIENT_ACCEPT:_=C.ACCEPT_BY_OTHER_CLIENT;break;case l.PUBLISH_ERR:_=C.PUBLISH_ERROR;break;case l.SUBSCRIBE_ERR:_=C.SUBSCRIBE_ERROR;break;case l.ACCEPT_CARRIER:_=t?C.ACCEPT_SYSTEM_CALL:C.REMOTE_ACCEPT_SYSTEM_CALL;break;case l.KICKED_BY_SERVER:_=C.KICKED_BY_SERVER;break;case l.CONNECTION_ERR:_=C.NETWORK_ERROR;break;case l.OTHER_CLIENT_JOINED:_=t?C.OTHER_CLIENT_JOINED_CALL:C.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case l.OTHER_CLIENT_IN_ROOM:_=C.OTHER_CLIENT_IN_CALL;break;case l.OTHER_CLIENT_HANGUP:_=C.HANGUP_BY_OTHER_CLIENT;break;case l.REMOTE_PUBLISH_ERROR:_=C.REMOTE_PUBLISH_ERROR;break;case l.REMOTE_SUBSCRIBE_ERROR:_=C.REMOTE_SUBSCRIBE_ERROR;break;case l.REMOTE_KICKED_BY_SERVER:_=C.REMOTE_KICKED_BY_SERVER;break;case l.REMOTE_CONNECTION_ERROR:_=C.REMOTE_NETWORK_ERROR;break;case l.ABNORMAL_END:_=t?C.NETWORK_ERROR:C.REMOTE_NETWORK_ERROR;break;case l.OTHER_CLIENT_CALLING:_=C.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case l.JOIN_ROOM_ERR:_=C.NETWORK_ERROR;break;case l.LOGOUT:_=C.HANGUP;break;case l.OTHER_CLIENT_LOGIN:_=C.NETWORK_ERROR;break;case l.REMOTE_JOIN_RTC_ERROR:_=C.REMOTE_NETWORK_ERROR;break;case l.REMOTE_LOGOUT:_=C.REMOTE_HANGUP;break;case l.REMOTE_OTHER_CLIENT_LOGIN:_=C.REMOTE_NETWORK_ERROR;break;case l.REMOTE_OTHER_JOINED_RTC:_=C.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case l.REMOTE_OTHER_CLIENT_IN_RTC:_=C.REMOTE_OTHER_CLIENT_IN_CALL;break;default:_=C.NETWORK_ERROR}return _};!function(e){e.L_CALL_PLUS_WRAPPER_INIT_O="L-call_plus_wrapper_init-O",e.L_CALL_CLIENT_REGISTER_USER_INFO_O="L-call_client_register_user_info-O",e.L_CALL_CLIENT_START_CROSS_CALL_O="L-call_client_start_cross_call-O",e.L_CALL_CLIENT_CALL_T="L-call_client_call-T",e.L_CALL_CLIENT_CALL_R="L-call_client_call-R",e.L_CALL_CLIENT_CALL_IN_GROUP_T="L-call_client_call_in_group-T",e.L_CALL_CLIENT_CALL_IN_GROUP_R="L-call_client_call_in_group-R",e.L_CALL_CLIENT_SET_PUSH_CONFIG_O="L-call_client_set_push_config-O",e.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O="L-call_session_register_session_listener-O",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T="L-call_session_change_audio_device-T",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R="L-call_session_change_audio_device-R",e.L_CALL_SESSION_INVITE_T="L-call_session_invite-T",e.L_CALL_SESSION_INVITE_R="L-call_session_invite-R",e.L_CALL_SESSION_ACCEPT_T="L-call_session_accept-T",e.L_CALL_SESSION_ACCEPT_R="L-call_session_accept-R",e.L_CALL_SESSION_HUNGUP_T="L-call_session_hungup-T",e.L_CALL_SESSION_HUNGUP_R="L-call_session_hungup-R",e.L_CALL_SESSION_DESCEND_ABILITY_T="L-call_session_descend_ability-T",e.L_CALL_SESSION_DESCEND_ABILITY_P="L-call_session_descend_ability-P",e.L_CALL_SESSION_DESCEND_ABILITY_R="L-call_session_descend_ability-R",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T="L-call_session_disable_video_track-T",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R="L-call_session_disable_video_track-R",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T="L-call_session_enable_video_track-T",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R="L-call_session_enable_video_track-R",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T="L-call_session_disable_audio_track-T",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R="L-call_session_disable_audio_track-R",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T="L-call_session_enable_audio_track-T",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R="L-call_session_enable_audio_track-R",e.L_CALL_EXECUTE_EVENT_LISTENER_O="L-call_execute_event_listener-O",e.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E="L-call_client_get_joined_room_info-E"}(S||(S={}));var p,b=function(){function e(e){Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"registerEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._listener=e}}),Object.defineProperty(e.prototype,"_callAppListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,_=[],n=1;n<arguments.length;n++)_[n-1]=arguments[n];return d(this,void 0,void 0,(function(){var n,i;return T(this,(function(r){switch(r.label){case 0:if(!(n=null===(t=this._listener)||void 0===t?void 0:t[e]))return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.apply(void 0,_)];case 2:return r.sent(),[3,4];case 3:return i=r.sent(),this._logger.error(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventName:e,name:i.name,message:i.message})),[3,4];case 4:return[2]}}))}))}}),Object.defineProperty(e.prototype,"onRinging",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onRinging",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onRinging",e,t)}}),Object.defineProperty(e.prototype,"onAccept",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAccept",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onAccept",e,t)}}),Object.defineProperty(e.prototype,"onHungup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,_){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onHungup",sender:e,reason:t,sessionId:_.getSessionId()})),this._callAppListener("onHungup",e,t,_)}}),Object.defineProperty(e.prototype,"onMemberModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,_){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMemberModify",sender:e,invitedUsers:t,sessionId:_.getSessionId()})),this._callAppListener("onMemberModify",e,t,_)}}),Object.defineProperty(e.prototype,"onMediaModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,_){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMediaModify",sender:e,mediaType:t,sessionId:_.getSessionId()})),this._callAppListener("onMediaModify",e,t,_)}}),Object.defineProperty(e.prototype,"onTrackReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,_){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackReady",userId:e,mediaType:t,sessionId:null==_?void 0:_.getSessionId()})),this._callAppListener("onTrackReady",e,t,_)}}),Object.defineProperty(e.prototype,"onAudioMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAudioMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onAudioMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onVideoMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onVideoMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onVideoMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onTrackSubscribeFail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackSubscribeFail",code:e,sessionId:t.getSessionId()})),this._callAppListener("onTrackSubscribeFail",e,t)}}),Object.defineProperty(e.prototype,"onSendPacketLoss",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.debug(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onSendPacketLoss",packetLostRate:e,delay:t})),this._callAppListener("onSendPacketLoss",e,t)}}),Object.defineProperty(e.prototype,"onReceivePacketLoss",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.info(S.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onReceivePacketLoss",data:e})),this._callAppListener("onReceivePacketLoss",e)}}),e}();!function(e){e.INNER_ON_RINGING="inner-on-ringing",e.INNER_ON_ACCEPT="inner-on-accept",e.INNER_ON_HANGUP="inner-on-hangup",e.INNER_ON_TRACK_READY="inner-on-track-ready",e.INNER_ON_MEMBER_MODIFY="inner-on-member-modify",e.INNER_ON_MEDIA_MODIFY="inner-on-media-modify",e.INNER_ON_AUDIO_MUTE_CHANGE="inner-on-audio-mute-change",e.INNER_ON_VIDEO_MUTE_CHANGE="inner-on-video-mute-change",e.INNER_ON_TRACK_SUBSCRIBE_FAIL="inner-on-track-subscribe-fail",e.INNER_ON_SELF_HANGUP="inner-on-self-hangup"}(p||(p={}));var h,v=function(e){function t(t,_,n,i,r,o,a,l,E){var s=e.call(this)||this;return Object.defineProperty(s,"_callId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(s,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:_}),Object.defineProperty(s,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(s,"_callType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"_context",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(s,"_options",{enumerable:!0,configurable:!0,writable:!0,value:E}),Object.defineProperty(s,"_descendResolve",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(s,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._audioConfigBuilder=s._callPlusClient.createAudioConfigBuilder(),s._videoConfigBuilder=s._callPlusClient.createVideoConfigBuilder(),s._reportAppEventModule=new b(l),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function _(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(_.prototype=t.prototype,new _)}(t,e),Object.defineProperty(t.prototype,"registerSessionListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.info(S.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O,Object.keys(e).join(",")),this._reportAppEventModule.registerEventListener(e),this.on(p.INNER_ON_RINGING,(function(e,_){t._reportAppEventModule.onRinging(e,_)})),this.on(p.INNER_ON_ACCEPT,(function(e,_){t._reportAppEventModule.onAccept(e,_)})),this.on(p.INNER_ON_HANGUP,(function(e,_,n){t._reportAppEventModule.onHungup(e,_,n)})),this.on(p.INNER_ON_TRACK_READY,(function(e,_,n){t._reportAppEventModule.onTrackReady(e,_,n)})),this.on(p.INNER_ON_MEMBER_MODIFY,(function(e,_,n){t._reportAppEventModule.onMemberModify(e,_,n)})),this.on(p.INNER_ON_MEDIA_MODIFY,(function(e,_,n,i){var r,o;t._descendResolve[i]?(t._logger.info(S.L_CALL_SESSION_DESCEND_ABILITY_R,"success, transactionId: ".concat(i)),null===(o=(r=t._descendResolve)[i])||void 0===o||o.call(r,{code:I.SUCCESS}),delete t._descendResolve[i]):t._reportAppEventModule.onMediaModify(e,_,n)})),this.on(p.INNER_ON_AUDIO_MUTE_CHANGE,(function(e,_){t._reportAppEventModule.onAudioMuteChange(e,_)})),this.on(p.INNER_ON_VIDEO_MUTE_CHANGE,(function(e,_){t._reportAppEventModule.onVideoMuteChange(e,_)})),this.on(p.INNER_ON_TRACK_SUBSCRIBE_FAIL,(function(e,_){var n,i;null===(i=(n=t._reportAppEventModule).onTrackSubscribeFail)||void 0===i||i.call(n,e,_)}))}}),Object.defineProperty(t.prototype,"changeAudioDevice",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return d(this,void 0,void 0,(function(){var t,_,n,i;return T(this,(function(r){switch(r.label){case 0:return t=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T,JSON.stringify(e),t),e?(_=e.micphoneId,n=e.sampleRate,this._callPlusClient.setAudioConfig({microphoneId:_,sampleRate:n}),[4,this._callPlusClient.switchMicrophone(_)]):(this._logger.error(S.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(I.PARAM_ERROR),t),[2,{code:I.PARAM_ERROR}]);case 1:return(i=r.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(f(i)),t),[2,{code:f(i)}]):(this._logger.info(S.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"success",t),[2,{code:f(i)}])}}))}))}}),Object.defineProperty(t.prototype,"invite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var _;return void 0===t&&(t={}),d(this,void 0,void 0,(function(){var n,i;return T(this,(function(r){switch(r.label){case 0:return n=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_INVITE_T,JSON.stringify({userIds:e,options:t}),n),[4,this._callPlusClient.invite(e,null===(_=this._options)||void 0===_?void 0:_.callPushConfig,t.extra)];case 1:return(i=r.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_INVITE_R,"errorCode: ".concat(f(i)),n),[2,{code:f(i)}]):(this._logger.info(S.L_CALL_SESSION_INVITE_R,"success",n),[2,{code:f(i)}])}}))}))}}),Object.defineProperty(t.prototype,"accept",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return d(this,void 0,void 0,(function(){var _,n,i,r,o,l;return T(this,(function(E){switch(E.label){case 0:return _=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_ACCEPT_T,JSON.stringify(e),_),e&&(n=e.audio,i=e.video,(null==n?void 0:n.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(n.micphoneId),(null==n?void 0:n.sampleRate)&&this._audioConfigBuilder.setSampleRate(n.sampleRate),(null==i?void 0:i.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(i.cameraId),(null==i?void 0:i.frameRate)&&this._videoConfigBuilder.setFrameRate(i.frameRate),(null==i?void 0:i.resolution)&&this._videoConfigBuilder.setVideoResolution(i.resolution)),r=this._audioConfigBuilder.build(),o=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(r),this._callPlusClient.setVideoConfig(o),[4,this._callPlusClient.accept(this._callId,null===(t=this._options)||void 0===t?void 0:t.callPushConfig)];case 1:return(l=E.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_ACCEPT_R,"errorCode: ".concat(f(l)),_),[2,{code:f(l)}]):(this._logger.info(S.L_CALL_SESSION_ACCEPT_R,"success",_),[2,{code:f(l)}])}}))}))}}),Object.defineProperty(t.prototype,"hungup",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return d(this,void 0,void 0,(function(){var t,_;return T(this,(function(n){switch(n.label){case 0:return t=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_HUNGUP_T,"",t),this.emit(p.INNER_ON_SELF_HANGUP),[4,this._callPlusClient.hangup(this._callId,null===(e=this._options)||void 0===e?void 0:e.hangupPushConfig)];case 1:return(_=n.sent().code)!==a.SUCCESS&&this._logger.error(S.L_CALL_SESSION_HUNGUP_R,"errorCode: ".concat(f(_)),t),this._logger.info(S.L_CALL_SESSION_HUNGUP_R,"success",t),[2,{code:f(_)}]}}))}))}}),Object.defineProperty(t.prototype,"descendAbility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return d(this,void 0,void 0,(function(){var e,t=this;return T(this,(function(_){return e=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_DESCEND_ABILITY_T,"",e),[2,new Promise((function(_){t._callPlusClient.requestChangeMediaType(E.AUDIO).then((function(n){var i=n.code,r=n.transactionId;if(i!==a.SUCCESS)return t._logger.error(S.L_CALL_SESSION_DESCEND_ABILITY_R,"errorCode: ".concat(f(i)),e),void _({code:f(i)});t._logger.info(S.L_CALL_SESSION_DESCEND_ABILITY_P,"transactionId: ".concat(r),e),t._descendResolve[r]=_}))}))]}))}))}}),Object.defineProperty(t.prototype,"disableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return d(this,void 0,void 0,(function(){var e,t;return T(this,(function(_){switch(_.label){case 0:return e=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.stopCamera()];case 1:return(t=_.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"errorCode: ".concat(f(t)),e),[2,{code:f(t)}]):(this._logger.info(S.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"success",e),[2,{code:f(t)}])}}))}))}}),Object.defineProperty(t.prototype,"enableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return d(this,void 0,void 0,(function(){var e,t;return T(this,(function(_){switch(_.label){case 0:return e=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.startCamera()];case 1:return(t=_.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"errorCode: ".concat(f(t)),e),[2,{code:f(t)}]):(this._logger.info(S.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"success",e),[2,{code:f(t)}])}}))}))}}),Object.defineProperty(t.prototype,"disableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return d(this,void 0,void 0,(function(){var e,t;return T(this,(function(_){switch(_.label){case 0:return e=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.stopMicrophone()];case 1:return(t=_.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"errorCode: ".concat(f(t)),e),[2,{code:f(t)}]):(this._logger.info(S.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"success",e),[2,{code:f(t)}])}}))}))}}),Object.defineProperty(t.prototype,"enableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return d(this,void 0,void 0,(function(){var e,t;return T(this,(function(_){switch(_.label){case 0:return e=this._logger.createTraceId(),this._logger.info(S.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.startMicrophone()];case 1:return(t=_.sent().code)!==a.SUCCESS?(this._logger.error(S.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"errorCode: ".concat(f(t)),e),[2,{code:f(t)}]):(this._logger.info(S.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"success",e),[2,{code:f(t)}])}}))}))}}),Object.defineProperty(t.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callId}}),Object.defineProperty(t.prototype,"getRTCSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?null:this._callPlusClient.getRTCSessionId()}}),Object.defineProperty(t.prototype,"getTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._targetId}}),Object.defineProperty(t.prototype,"getChannelId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._channelId}}),Object.defineProperty(t.prototype,"getConversationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callType}}),Object.defineProperty(t.prototype,"getRemoteUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return[];var _=(null==t?void 0:t.getUserList())||[];return null==_?void 0:_.map((function(t){var _=t.userId,n=t.state;return{userId:_,state:A(n),isCaller:_===e.getCallerId(),isRemote:_!==e._context.getCurrentId()}}))}}),Object.defineProperty(t.prototype,"getUserState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return R.NONE;var _=null==t?void 0:t.getUserList().filter((function(t){return t.userId===e}))[0].state;return A(_)}}),Object.defineProperty(t.prototype,"getState",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return function(e){var t=null;switch(e){case o.IDLE:t=O.END;break;case o.CALLING:case o.INVITED:case o.RINGING:case o.BUSYLINE_RINGING:case o.BUSYLINE_WAIT:t=O.WAITING;break;case o.CONNECTING:case o.ONCALL:t=O.KEEPING;break;case o.ENDED:case o.NOANSWER:case o.MISSED:case o.CANCELED:case o.DECLINED:case o.ERROR:default:t=O.END}return t}(this._callId===(null==e?void 0:e.getCallId())?null==e?void 0:e.getState():o.ENDED)}}),Object.defineProperty(t.prototype,"getCallerId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?"":e.getCreatorUserId()}}),Object.defineProperty(t.prototype,"getMediaType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mediaType===E.AUDIO?c.AUDIO:c.AUDIO_VIDEO}}),t}(e),P=function(){function e(e,t,_,n){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_runtime",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:_}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_session",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_sessionStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_hangupPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_isSelfHangup",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._callPlusClient=n.callPlusClient,this._reportAppEventModule=new b(_),this._setCallPlusEventListener(),this._audioConfigBuilder=this._callPlusClient.createAudioConfigBuilder(),this._videoConfigBuilder=this._callPlusClient.createVideoConfigBuilder()}return Object.defineProperty(e.prototype,"_setCallPlusEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,_=0,n={},i={};this._callPlusClient.setCallPlusEventListener({onReceivedCall:function(_,n){return void 0===n&&(n="{}"),d(this,void 0,void 0,(function(){var i,r,o;return T(this,(function(a){return i=_.getCallId(),e._session?(e._callPlusClient.hangup(i,e._hangupPushConfig),[2]):(e._targetId=JSON.parse(n).targetId||"",e._channelId=JSON.parse(n).channelId||"",e._mediaType=_.getMediaType()===E.AUDIO?c.AUDIO:c.AUDIO_VIDEO,r=_.getCallType(),o=r===u.MULTI?t.GROUP:t.PRIVATE,e._session=new v(i,e._callPlusClient,e._channelId,e._targetId,o,_.getMediaType(),e._context,e._logger),e._session.on(p.INNER_ON_SELF_HANGUP,(function(){e._isSelfHangup=!0})),e._options.onSession(e._session,JSON.parse(n).callLibExtra||""),[2])}))}))},onRemoteUserInvited:function(t,_,n){var i,r={userId:_},o=t.map((function(e){return{userId:e}}));e._listener?e._reportAppEventModule.onMemberModify(r,o,e._session):null===(i=e._session)||void 0===i||i.emit(p.INNER_ON_MEMBER_MODIFY,r,o,e._session)},onCallConnected:function(e){var t=e.getCallId();i[t]=!0},onCallTypeChanged:function(e,t){},onRemoteUserStateChanged:function(t,_,i,o){var a,E,s;return d(this,void 0,void 0,(function(){var c,I,R,O,L,C,N,d,S;return T(this,(function(T){return c={userId:_},I=[r.IDLE,r.DECLINED,r.MISSED,r.NO_ANSWER].includes(i),e._listener?(i===r.RINGING&&e._reportAppEventModule.onRinging(c,e._session),i===r.CONNECTING&&e._reportAppEventModule.onAccept(c,e._session),I&&e._reportAppEventModule.onHungup(c,g(o,e._isSelfHangup),e._session)):(i===r.RINGING&&(null===(a=e._session)||void 0===a||a.emit(p.INNER_ON_RINGING,c,e._session)),i===r.CONNECTING&&(null===(E=e._session)||void 0===E||E.emit(p.INNER_ON_ACCEPT,c,e._session)),I&&(null===(s=e._session)||void 0===s||s.emit(p.INNER_ON_HANGUP,c,g(o,e._isSelfHangup),e._session))),R=e._callPlusClient.getCurrentCallSession(),O=null==R?void 0:R.getCallType(),L=null==R?void 0:R.getUserList(),C=null==L?void 0:L.filter((function(t){return t.userId===e._context.getCurrentId()}))[0],N=null==L?void 0:L.filter((function(t){return t.userId!==e._context.getCurrentId()})),d=null==N?void 0:N.every((function(e){return e.state===r.IDLE})),S=(null==C?void 0:C.state)===r.ONCALL&&d,I&&O===u.MULTI&&S&&(e._callPlusClient.hangup(),n[t]=o===l.MISSED?l.NO_ANSWER:o,e._isSelfHangup=!1),[2]}))}))},onCallEnded:function(t,r){return d(this,void 0,void 0,(function(){var o,a,l;return T(this,(function(E){return o=+new Date-_,a=t.getCallId(),l={conversationType:e._session.getConversationType(),channelId:e._session.getChannelId(),targetId:e._session.getTargetId(),mediaType:e._session.getMediaType(),beginTimestamp:e._sessionStartTime,endTimestamp:o,duration:i[a]?Math.ceil((o-e._sessionStartTime)/1e3):0,endReason:n[a]?g(n[a],e._isSelfHangup):g(r,e._isSelfHangup)},e._options.onSessionClose(e._session,l),e._session=null,e._sessionStartTime=0,delete n[a],delete i[a],[2]}))}))},onUserMediaAvailable:function(t,_){var n;return d(this,void 0,void 0,(function(){var i;return T(this,(function(r){return i=_===E.AUDIO?c.AUDIO:c.AUDIO_VIDEO,e._listener?e._reportAppEventModule.onTrackReady(t,i,e._session):null===(n=e._session)||void 0===n||n.emit(p.INNER_ON_TRACK_READY,t,i,e._session),[2]}))}))},onFetchRemoteMediaError:function(t,_){var n,i,r;e._listener?null===(i=(n=e._reportAppEventModule).onTrackSubscribeFail)||void 0===i||i.call(n,_,e._session):null===(r=e._session)||void 0===r||r.emit(p.INNER_ON_TRACK_SUBSCRIBE_FAIL,_,e._session)},onRemoteCameraStateChanged:function(t,_,n){var i,r={userId:_,muted:n,kind:""};e._listener?e._reportAppEventModule.onVideoMuteChange(r,e._session):null===(i=e._session)||void 0===i||i.emit(p.INNER_ON_VIDEO_MUTE_CHANGE,r,e._session)},onRemoteMicrophoneStateChanged:function(t,_,n){var i,r={userId:_,muted:n,kind:""};e._listener?e._reportAppEventModule.onAudioMuteChange(r,e._session):null===(i=e._session)||void 0===i||i.emit(p.INNER_ON_AUDIO_MUTE_CHANGE,r,e._session)},onReceivedCallRecord:function(e){},onReceivedChangeMediaTypeRequest:function(t,_,n){e._callPlusClient.replyChangeMediaType(_,!0)},onReceivedChangeMediaTypeResult:function(t){var _;if(e._mediaType===c.AUDIO_VIDEO&&t.mediaType===E.AUDIO_VIDEO&&t.code===s.SERVER_ALLOW_MEDIA_TYPE){var n={userId:t.userId};e._mediaType=c.AUDIO,e._listener?e._reportAppEventModule.onMediaModify(n,e._mediaType,e._session):null===(_=e._session)||void 0===_||_.emit(p.INNER_ON_MEDIA_MODIFY,n,e._mediaType,e._session,t.transactionId)}},onReceivedCallStartTime:function(t){e._sessionStartTime=t.callStartTime,_=+new Date-t.callStartTime},onReceivedCallFirstFrameTime:function(e,t){},onUserAudioLevelChanged:function(e,t){}})}}),Object.defineProperty(e.prototype,"registerUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.warn(S.L_CALL_CLIENT_REGISTER_USER_INFO_O,"`RCCallClient.registerUserInfo` has been deprecated, use `https://doc.rongcloud.cn/imserver/server/v1/user/register` instead.")}}),Object.defineProperty(e.prototype,"startCrossCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.targetId;var t=e.mediaType;return void 0===t&&c.AUDIO,e.listener,e.constraints,e.channelId,e.extra,e.bitrate,d(this,void 0,void 0,(function(){return T(this,(function(e){return this._logger.warn(S.L_CALL_CLIENT_START_CROSS_CALL_O,"`RCCallClient.startCrossCall` has been deprecated"),[2]}))}))}}),Object.defineProperty(e.prototype,"__startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e,_){var n=_.targetId,i=_.userIds,r=_.mediaType,o=void 0===r?c.AUDIO:r,l=_.listener,s=_.constraints,R=_.channelId,O=void 0===R?"":R,L=_.extra,C=void 0===L?"":L,N=_.bitrate;return d(this,void 0,void 0,(function(){var _,r,R,L,d,A,g,b,h,P,D,U,y,M,m=this;return T(this,(function(T){switch(T.label){case 0:return _=this._logger.createTraceId(),this._logger.info(S.L_CALL_CLIENT_CALL_T,JSON.stringify({targetId:n,userIds:i,mediaType:o,listener:Object.keys(l),constraints:s,channelId:O,extra:C,bitrate:N}),_),s&&(r=s.audio,R=s.video,(null==r?void 0:r.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(r.micphoneId),(null==r?void 0:r.sampleRate)&&this._audioConfigBuilder.setSampleRate(r.sampleRate),(null==R?void 0:R.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(R.cameraId),(null==R?void 0:R.frameRate)&&this._videoConfigBuilder.setFrameRate(R.frameRate),(null==R?void 0:R.resolution)&&this._videoConfigBuilder.setVideoResolution(R.resolution)),N&&(r=N.audio,R=N.video,r&&this._audioConfigBuilder.setBitrate(r,r),R&&this._videoConfigBuilder.setBitrate(R.min,R.max)),L=this._audioConfigBuilder.build(),d=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(L),this._callPlusClient.setVideoConfig(d),this._targetId=n,this._listener=l,this._reportAppEventModule.registerEventListener(l),this._mediaType=o,A=o===c.AUDIO?E.AUDIO:E.AUDIO_VIDEO,g=e?u.SINGLE:u.MULTI,b=e?[n]:i,h=e?this._context.getCurrentId():n,P=JSON.stringify({callLibExtra:C,channelId:O,targetId:h}),[4,this._callPlusClient.startCall(b,g,A,this._callPushConfig,P)];case 1:return D=T.sent(),U=D.code,y=D.callId,U!==a.SUCCESS?(this._logger.error(S.L_CALL_CLIENT_CALL_R,"errorCode: ".concat(f(U)),_),[2,{code:f(U)}]):(this._logger.info(S.L_CALL_CLIENT_CALL_R,"success",_),M=e?t.PRIVATE:t.GROUP,this._session=new v(y,this._callPlusClient,this._channelId,this._targetId,M,A,this._context,this._logger,{callPushConfig:this._callPushConfig,hangupPushConfig:this._hangupPushConfig}),this._session.on(p.INNER_ON_SELF_HANGUP,(function(){m._isSelfHangup=!0})),[2,{code:I.SUCCESS,session:this._session}])}}))}))}}),Object.defineProperty(e.prototype,"call",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,_=e.mediaType,n=void 0===_?c.AUDIO:_,i=e.listener,r=e.constraints,o=e.channelId,a=void 0===o?"":o,l=e.extra,E=void 0===l?"":l,s=e.bitrate;return d(this,void 0,void 0,(function(){return T(this,(function(e){return[2,this.__startCall(!0,{targetId:t,userIds:[],mediaType:n,listener:i,constraints:r,channelId:a,extra:E,bitrate:s})]}))}))}}),Object.defineProperty(e.prototype,"callInGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,_=e.userIds,n=e.mediaType,i=void 0===n?c.AUDIO:n,r=e.listener,o=e.constraints,a=e.channelId,l=void 0===a?"":a,E=e.extra,s=void 0===E?"":E,u=e.bitrate;return d(this,void 0,void 0,(function(){return T(this,(function(e){return[2,this.__startCall(!1,{targetId:t,userIds:_,mediaType:i,listener:r,constraints:o,channelId:l,extra:s,bitrate:u})]}))}))}}),Object.defineProperty(e.prototype,"getJoinedRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return d(this,void 0,void 0,(function(){var e,t,n;return T(this,(function(i){switch(i.label){case 0:return[4,this._context.getRTCJoinedUserInfo(this._context.getCurrentId())];case 1:return e=i.sent(),t=e.code,n=e.data,t!==_.SUCCESS?(this._logger.error(S.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E,t),[2,{code:I.QUERY_JOINED_USER_INFO_ERROR}]):[2,{code:I.SUCCESS,data:n}]}}))}))}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this._logger.info(S.L_CALL_CLIENT_SET_PUSH_CONFIG_O,JSON.stringify({callPushConfig:e,hangupPushConfig:t})),this._callPushConfig=e,this._hangupPushConfig=t,delete this._callPushConfig.pushContent,delete this._hangupPushConfig.pushContent}}),e}();!function(e){e.ZH="zh",e.EN="en"}(h||(h={}));var D={tag:"CallPlusWrapper",verify:function(e){return"browser"===e.tag},setup:function(e,t,_){var r=e.createLogger("CallPlusWrapper","RTC"),o=n(_.logOutputLevel)?i.WARN:_.logOutputLevel;return r.setOutputLevel(o),r.warn(S.L_CALL_PLUS_WRAPPER_INIT_O,"CallPlus Version: ".concat("2.1.2",", Commit: ").concat("d95e6815e07ae1c83b40409e2738c123b376f493")),new P(e,t,r,_)}};export{P as RCCallClient,C as RCCallEndReason,I as RCCallErrorCode,h as RCCallLanguage,c as RCCallMediaType,v as RCCallSession,O as RCCallSessionState,R as RCCallUserState,D as installer};
1
+ import{EventEmitter as e,ConversationType as t,ErrorCode as n,VersionManage as _,isUndefined as i,LogL as r}from"@rongcloud/engine";import{RCCallPlusSessionUserState as o,RCCallPlusCallState as a,RCCallPlusCode as l,RCCallPlusReason as E,RCCallPlusMediaType as s,RCCallPlusMediaTypeChangeResult as u,RCCallPlusType as c}from"@rongcloud/plugin-call-plus";var I,R,O,C,L,d,N=function(e,t){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},N(e,t)};function T(e,t,n,_){return new(n||(n=Promise))((function(i,r){function o(e){try{l(_.next(e))}catch(e){r(e)}}function a(e){try{l(_.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((_=_.apply(e,t||[])).next())}))}function S(e,t){var n,_,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(o=0)),o;)try{if(n=1,_&&(i=2&a[0]?_.return:a[0]?_.throw||((i=_.return)&&i.call(_),0):_.next)&&!(i=i.call(_,a[1])).done)return i;switch(_=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,_=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],_=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function A(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var _,i,r=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(_=r.next()).done;)o.push(_.value)}catch(e){i={error:e}}finally{try{_&&!_.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o}function f(e,t,n){if(n||2===arguments.length)for(var _,i=0,r=t.length;i<r;i++)!_&&i in t||(_||(_=Array.prototype.slice.call(t,0,i)),_[i]=t[i]);return e.concat(_||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.AUDIO=1]="AUDIO",e[e.AUDIO_VIDEO=2]="AUDIO_VIDEO"}(I||(I={})),function(e){e[e.SUCCESS=1e4]="SUCCESS",e[e.STATE_MACHINE_EXIT=53200]="STATE_MACHINE_EXIT",e[e.SEND_MSG_ERROR=53201]="SEND_MSG_ERROR",e[e.REJECTED_BY_BLACKLIST=53202]="REJECTED_BY_BLACKLIST",e[e.NOT_IN_GROUP=53203]="NOT_IN_GROUP",e[e.GET_LOCAL_AUDIO_TRACK_ERROR=53301]="GET_LOCAL_AUDIO_TRACK_ERROR",e[e.GET_LOCAL_VIDEO_TRACK_ERROR=53302]="GET_LOCAL_VIDEO_TRACK_ERROR",e[e.GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR=53303]="GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR",e[e.JOIN_ROOM_ERROR=53304]="JOIN_ROOM_ERROR",e[e.AUDIO_PUBLISH_ERROR=53305]="AUDIO_PUBLISH_ERROR",e[e.VIDEO_PUBLISH_ERROR=53306]="VIDEO_PUBLISH_ERROR",e[e.AUDIO_AND_VIDEO_PUBLISH_ERROR=53307]="AUDIO_AND_VIDEO_PUBLISH_ERROR",e[e.QUERY_JOINED_USER_INFO_ERROR=53308]="QUERY_JOINED_USER_INFO_ERROR",e[e.MISSING_VIDEO_TRACK_ERROR=53309]="MISSING_VIDEO_TRACK_ERROR",e[e.UNPUBLISH_VIDEO_ERROR=53310]="UNPUBLISH_VIDEO_ERROR",e[e.CONVERSATION_NOT_GROUP_ERROR=53311]="CONVERSATION_NOT_GROUP_ERROR",e[e.NOT_IN_ROOM_ERROR=53312]="NOT_IN_ROOM_ERROR",e[e.PARAM_ERROR=53313]="PARAM_ERROR",e[e.NOT_IN_CALL=53314]="NOT_IN_CALL",e[e.MEDIATYPE_INVALID=53315]="MEDIATYPE_INVALID",e[e.NOT_VIDEO_CALL=53316]="NOT_VIDEO_CALL",e[e.RTC_SERVICE_UNAVAILABLE=53317]="RTC_SERVICE_UNAVAILABLE",e[e.USER_LIST_INVAILD=53318]="USER_LIST_INVAILD",e[e.CALL_ID_INVALID=53319]="CALL_ID_INVALID",e[e.TRANSACTION_ID_INVALID=53320]="TRANSACTION_ID_INVALID",e[e.USER_ID_INVALID=53321]="USER_ID_INVALID",e[e.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON=53322]="SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON",e[e.MICROPHONE_CLOSED=53323]="MICROPHONE_CLOSED",e[e.MEDIA_RESOURCE_INVALIED=53324]="MEDIA_RESOURCE_INVALIED",e[e.NOT_INSTALL_RTC_PLUGIN=53325]="NOT_INSTALL_RTC_PLUGIN",e[e.PLAY_MEDIA_FAILED=53326]="PLAY_MEDIA_FAILED",e[e.VIDEO_VIEW_NOT_SET=53327]="VIDEO_VIEW_NOT_SET"}(R||(R={})),function(e){e[e.NONE=0]="NONE",e[e.WAITING=1]="WAITING",e[e.KEEPING=2]="KEEPING"}(O||(O={})),function(e){e[e.WAITING=0]="WAITING",e[e.KEEPING=1]="KEEPING",e[e.END=2]="END"}(C||(C={})),function(e){e[e.CANCEL=1]="CANCEL",e[e.REJECT=2]="REJECT",e[e.HANGUP=3]="HANGUP",e[e.BUSY_LINE=4]="BUSY_LINE",e[e.NO_RESPONSE=5]="NO_RESPONSE",e[e.ENGINE_UNSUPPORTED=6]="ENGINE_UNSUPPORTED",e[e.NETWORK_ERROR=7]="NETWORK_ERROR",e[e.GET_MEDIA_RESOURCES_ERROR=8]="GET_MEDIA_RESOURCES_ERROR",e[e.PUBLISH_ERROR=9]="PUBLISH_ERROR",e[e.SUBSCRIBE_ERROR=10]="SUBSCRIBE_ERROR",e[e.REMOTE_CANCEL=11]="REMOTE_CANCEL",e[e.REMOTE_REJECT=12]="REMOTE_REJECT",e[e.REMOTE_HANGUP=13]="REMOTE_HANGUP",e[e.REMOTE_BUSY_LINE=14]="REMOTE_BUSY_LINE",e[e.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",e[e.REMOTE_ENGINE_UNSUPPORTED=16]="REMOTE_ENGINE_UNSUPPORTED",e[e.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",e[e.REMOTE_GET_MEDIA_RESOURCE_ERROR=18]="REMOTE_GET_MEDIA_RESOURCE_ERROR",e[e.REMOTE_PUBLISH_ERROR=19]="REMOTE_PUBLISH_ERROR",e[e.REMOTE_SUBSCRIBE_ERROR=20]="REMOTE_SUBSCRIBE_ERROR",e[e.OTHER_CLIENT_JOINED_CALL=21]="OTHER_CLIENT_JOINED_CALL",e[e.OTHER_CLIENT_IN_CALL=22]="OTHER_CLIENT_IN_CALL",e[e.KICKED_BY_SERVER=23]="KICKED_BY_SERVER",e[e.ACCEPT_SYSTEM_CALL=24]="ACCEPT_SYSTEM_CALL",e[e.REMOTE_OTHER_CLIENT_JOINED_CALL=31]="REMOTE_OTHER_CLIENT_JOINED_CALL",e[e.REMOTE_OTHER_CLIENT_IN_CALL=32]="REMOTE_OTHER_CLIENT_IN_CALL",e[e.REMOTE_KICKED_BY_SERVER=33]="REMOTE_KICKED_BY_SERVER",e[e.REMOTE_ACCEPT_SYSTEM_CALL=34]="REMOTE_ACCEPT_SYSTEM_CALL",e[e.ACCEPT_BY_OTHER_CLIENT=101]="ACCEPT_BY_OTHER_CLIENT",e[e.HANGUP_BY_OTHER_CLIENT=102]="HANGUP_BY_OTHER_CLIENT",e[e.ADDED_TO_BLACKLIST=103]="ADDED_TO_BLACKLIST",e[e.SERVICE_NOT_OPENED=104]="SERVICE_NOT_OPENED"}(d||(d={})),(L={})[d.CANCEL]=d.REMOTE_CANCEL,L[d.REJECT]=d.REMOTE_REJECT,L[d.HANGUP]=d.REMOTE_HANGUP,L[d.BUSY_LINE]=d.REMOTE_BUSY_LINE,L[d.NO_RESPONSE]=d.REMOTE_NO_RESPONSE,L[d.ENGINE_UNSUPPORTED]=d.REMOTE_ENGINE_UNSUPPORTED,L[d.NETWORK_ERROR]=d.REMOTE_NETWORK_ERROR,L[d.GET_MEDIA_RESOURCES_ERROR]=d.REMOTE_GET_MEDIA_RESOURCE_ERROR,L[d.PUBLISH_ERROR]=d.REMOTE_PUBLISH_ERROR,L[d.SUBSCRIBE_ERROR]=d.REMOTE_SUBSCRIBE_ERROR,L[d.OTHER_CLIENT_JOINED_CALL]=d.REMOTE_OTHER_CLIENT_JOINED_CALL,L[d.OTHER_CLIENT_IN_CALL]=d.REMOTE_OTHER_CLIENT_IN_CALL,L[d.KICKED_BY_SERVER]=d.REMOTE_KICKED_BY_SERVER,L[d.REMOTE_NO_RESPONSE]=d.NO_RESPONSE,L[d.ACCEPT_SYSTEM_CALL]=d.REMOTE_ACCEPT_SYSTEM_CALL;var g,p=function(e){var t=null;switch(e){case o.IDLE:t=O.NONE;break;case o.CALLING:case o.INVITED:case o.RINGING:t=O.WAITING;break;case o.BUSYLINE_RINGING:case o.BUSYLINE_WAIT:t=O.NONE;break;case o.CONNECTING:t=O.WAITING;break;case o.ONCALL:t=O.KEEPING;break;case o.ONPHONE:t=O.WAITING;break;case o.ENDED:case o.NO_ANSWER:case o.MISSED:case o.CANCELLED:case o.DECLINED:case o.ERROR:default:t=O.NONE}return t},b=function(e){var t=null;switch(e){case l.SUCCESS:t=R.SUCCESS;break;case l.PARAM_ERROR:t=R.PARAM_ERROR;break;case l.SESSION_EXIST:t=R.STATE_MACHINE_EXIT;break;case l.NOT_IN_CALL:t=R.NOT_IN_CALL;break;case l.MEDIATYPE_INVALID:t=R.MEDIATYPE_INVALID;break;case l.NOT_VIDEO_CALL:t=R.NOT_VIDEO_CALL;break;case l.RTC_SERVICE_UNAVAILABLE:t=R.RTC_SERVICE_UNAVAILABLE;break;case l.USER_LIST_INVAILD:t=R.USER_LIST_INVAILD;break;case l.CALL_ID_INVALID:t=R.CALL_ID_INVALID;break;case l.TRANSACTION_ID_INVALID:t=R.TRANSACTION_ID_INVALID;break;case l.USER_ID_INVALID:t=R.USER_ID_INVALID;break;case l.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON:t=R.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON;break;case l.CAMERA_CLOSED:t=R.MISSING_VIDEO_TRACK_ERROR;break;case l.MICROPHONE_CLOSED:t=R.MICROPHONE_CLOSED;break;case l.MEDIA_RESOURCE_INVALIED:t=R.MEDIA_RESOURCE_INVALIED;break;case l.NOT_INSTALL_RTC_PLUGIN:t=R.NOT_INSTALL_RTC_PLUGIN;break;case l.PLAY_MEDIA_FAILED:t=R.PLAY_MEDIA_FAILED;break;case l.VIDEO_VIEW_NOT_SET:t=R.VIDEO_VIEW_NOT_SET;break;default:t=e}return t},h=function(e,t){var n=null;switch(e){case E.BUSYLINE_RINGING:n=t?d.BUSY_LINE:d.REMOTE_BUSY_LINE;break;case E.ON_DEVICE_DISABLE:n=d.REMOTE_GET_MEDIA_RESOURCE_ERROR;break;case E.ENDED:n=t?d.HANGUP:d.REMOTE_HANGUP;break;case E.NO_ANSWER:n=d.REMOTE_NO_RESPONSE;break;case E.MISSED:n=d.NO_RESPONSE;break;case E.CANCELLED:n=t?d.CANCEL:d.REMOTE_CANCEL;break;case E.DECLINED:n=t?d.REJECT:d.REMOTE_REJECT;break;case E.OTHER_CLIENT_ACCEPT:n=d.ACCEPT_BY_OTHER_CLIENT;break;case E.PUBLISH_ERR:n=d.PUBLISH_ERROR;break;case E.SUBSCRIBE_ERR:n=d.SUBSCRIBE_ERROR;break;case E.ACCEPT_CARRIER:n=t?d.ACCEPT_SYSTEM_CALL:d.REMOTE_ACCEPT_SYSTEM_CALL;break;case E.KICKED_BY_SERVER:n=d.KICKED_BY_SERVER;break;case E.CONNECTION_ERR:n=d.NETWORK_ERROR;break;case E.OTHER_CLIENT_JOINED:n=t?d.OTHER_CLIENT_JOINED_CALL:d.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case E.OTHER_CLIENT_IN_ROOM:n=d.OTHER_CLIENT_IN_CALL;break;case E.OTHER_CLIENT_HANGUP:n=d.HANGUP_BY_OTHER_CLIENT;break;case E.REMOTE_PUBLISH_ERROR:n=d.REMOTE_PUBLISH_ERROR;break;case E.REMOTE_SUBSCRIBE_ERROR:n=d.REMOTE_SUBSCRIBE_ERROR;break;case E.REMOTE_KICKED_BY_SERVER:n=d.REMOTE_KICKED_BY_SERVER;break;case E.REMOTE_CONNECTION_ERROR:n=d.REMOTE_NETWORK_ERROR;break;case E.ABNORMAL_END:n=t?d.NETWORK_ERROR:d.REMOTE_NETWORK_ERROR;break;case E.OTHER_CLIENT_CALLING:n=d.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case E.JOIN_ROOM_ERR:n=d.NETWORK_ERROR;break;case E.LOGOUT:n=d.HANGUP;break;case E.OTHER_CLIENT_LOGIN:n=d.NETWORK_ERROR;break;case E.REMOTE_JOIN_RTC_ERROR:n=d.REMOTE_NETWORK_ERROR;break;case E.REMOTE_LOGOUT:n=d.REMOTE_HANGUP;break;case E.REMOTE_OTHER_CLIENT_LOGIN:n=d.REMOTE_NETWORK_ERROR;break;case E.REMOTE_OTHER_JOINED_RTC:n=d.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case E.REMOTE_OTHER_CLIENT_IN_RTC:n=d.REMOTE_OTHER_CLIENT_IN_CALL;break;default:n=d.NETWORK_ERROR}return n};!function(e){e.L_CALL_PLUS_WRAPPER_INIT_O="L-call_plus_wrapper_init-O",e.L_CALL_CLIENT_REGISTER_USER_INFO_O="L-call_client_register_user_info-O",e.L_CALL_CLIENT_START_CROSS_CALL_O="L-call_client_start_cross_call-O",e.L_CALL_CLIENT_CALL_T="L-call_client_call-T",e.L_CALL_CLIENT_CALL_R="L-call_client_call-R",e.L_CALL_CLIENT_CALL_IN_GROUP_T="L-call_client_call_in_group-T",e.L_CALL_CLIENT_CALL_IN_GROUP_R="L-call_client_call_in_group-R",e.L_CALL_CLIENT_SET_PUSH_CONFIG_O="L-call_client_set_push_config-O",e.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O="L-call_session_register_session_listener-O",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T="L-call_session_change_audio_device-T",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R="L-call_session_change_audio_device-R",e.L_CALL_SESSION_INVITE_T="L-call_session_invite-T",e.L_CALL_SESSION_INVITE_R="L-call_session_invite-R",e.L_CALL_SESSION_ACCEPT_T="L-call_session_accept-T",e.L_CALL_SESSION_ACCEPT_R="L-call_session_accept-R",e.L_CALL_SESSION_HUNGUP_T="L-call_session_hungup-T",e.L_CALL_SESSION_HUNGUP_R="L-call_session_hungup-R",e.L_CALL_SESSION_DESCEND_ABILITY_T="L-call_session_descend_ability-T",e.L_CALL_SESSION_DESCEND_ABILITY_R="L-call_session_descend_ability-R",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T="L-call_session_disable_video_track-T",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R="L-call_session_disable_video_track-R",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T="L-call_session_enable_video_track-T",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R="L-call_session_enable_video_track-R",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T="L-call_session_disable_audio_track-T",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R="L-call_session_disable_audio_track-R",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T="L-call_session_enable_audio_track-T",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R="L-call_session_enable_audio_track-R",e.L_CALL_EXECUTE_EVENT_LISTENER_O="L-call_execute_event_listener-O",e.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E="L-call_client_get_joined_room_info-E"}(g||(g={}));var v,D=function(){function e(e){Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"registerEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._listener=e}}),Object.defineProperty(e.prototype,"_callAppListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n=[],_=1;_<arguments.length;_++)n[_-1]=arguments[_];return T(this,void 0,void 0,(function(){var _,i;return S(this,(function(r){switch(r.label){case 0:if(!(_=null===(t=this._listener)||void 0===t?void 0:t[e]))return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,_.apply(void 0,f([],A(n),!1))];case 2:return r.sent(),[3,4];case 3:return i=r.sent(),this._logger.error(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventName:e,name:i.name,message:i.message})),[3,4];case 4:return[2]}}))}))}}),Object.defineProperty(e.prototype,"onRinging",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onRinging",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onRinging",e,t)}}),Object.defineProperty(e.prototype,"onAccept",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAccept",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onAccept",e,t)}}),Object.defineProperty(e.prototype,"onHungup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onHungup",sender:e,reason:t,sessionId:n.getSessionId()})),this._callAppListener("onHungup",e,t,n)}}),Object.defineProperty(e.prototype,"onMemberModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMemberModify",sender:e,invitedUsers:t,sessionId:n.getSessionId()})),this._callAppListener("onMemberModify",e,t,n)}}),Object.defineProperty(e.prototype,"onMediaModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMediaModify",sender:e,mediaType:t,sessionId:n.getSessionId()})),this._callAppListener("onMediaModify",e,t,n)}}),Object.defineProperty(e.prototype,"onTrackReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackReady",userId:e,mediaType:t,sessionId:null==n?void 0:n.getSessionId()})),this._callAppListener("onTrackReady",e,t,n)}}),Object.defineProperty(e.prototype,"onAudioMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAudioMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onAudioMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onVideoMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onVideoMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onVideoMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onTrackSubscribeFail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(g.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackSubscribeFail",code:e,sessionId:t.getSessionId()})),this._callAppListener("onTrackSubscribeFail",e,t)}}),e}();!function(e){e.INNER_ON_RINGING="inner-on-ringing",e.INNER_ON_ACCEPT="inner-on-accept",e.INNER_ON_HANGUP="inner-on-hangup",e.INNER_ON_TRACK_READY="inner-on-track-ready",e.INNER_ON_MEMBER_MODIFY="inner-on-member-modify",e.INNER_ON_MEDIA_MODIFY="inner-on-media-modify",e.INNER_ON_AUDIO_MUTE_CHANGE="inner-on-audio-mute-change",e.INNER_ON_VIDEO_MUTE_CHANGE="inner-on-video-mute-change",e.INNER_ON_TRACK_SUBSCRIBE_FAIL="inner-on-track-subscribe-fail",e.INNER_ON_SELF_HANGUP="inner-on-self-hangup"}(v||(v={}));var P,U=function(e){function n(t,n,_,i,r,o,a,l,E){var s=e.call(this)||this;return Object.defineProperty(s,"_callId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(s,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:_}),Object.defineProperty(s,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(s,"_callType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"_context",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(s,"_options",{enumerable:!0,configurable:!0,writable:!0,value:E}),Object.defineProperty(s,"_descendResolve",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(s,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._audioConfigBuilder=s._callPlusClient.createAudioConfigBuilder(),s._videoConfigBuilder=s._callPlusClient.createVideoConfigBuilder(),s._reportAppEventModule=new D(l),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n,e),Object.defineProperty(n.prototype,"registerSessionListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.info(g.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O,Object.keys(e).join(",")),this._reportAppEventModule.registerEventListener(e),this.on(v.INNER_ON_RINGING,(function(e,n){t._reportAppEventModule.onRinging(e,n)})),this.on(v.INNER_ON_ACCEPT,(function(e,n){t._reportAppEventModule.onAccept(e,n)})),this.on(v.INNER_ON_HANGUP,(function(e,n,_){t._reportAppEventModule.onHungup(e,n,_)})),this.on(v.INNER_ON_TRACK_READY,(function(e,n,_){t._reportAppEventModule.onTrackReady(e,n,_)})),this.on(v.INNER_ON_MEMBER_MODIFY,(function(e,n,_){t._reportAppEventModule.onMemberModify(e,n,_)})),this.on(v.INNER_ON_MEDIA_MODIFY,(function(e,n,_,i){t._reportAppEventModule.onMediaModify(e,n,_)})),this.on(v.INNER_ON_AUDIO_MUTE_CHANGE,(function(e,n){t._reportAppEventModule.onAudioMuteChange(e,n)})),this.on(v.INNER_ON_VIDEO_MUTE_CHANGE,(function(e,n){t._reportAppEventModule.onVideoMuteChange(e,n)})),this.on(v.INNER_ON_TRACK_SUBSCRIBE_FAIL,(function(e,n){var _,i;null===(i=(_=t._reportAppEventModule).onTrackSubscribeFail)||void 0===i||i.call(_,e,n)}))}}),Object.defineProperty(n.prototype,"changeAudioDevice",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return T(this,void 0,void 0,(function(){var t,n,_,i;return S(this,(function(r){switch(r.label){case 0:return t=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T,JSON.stringify(e),t),e?(n=e.micphoneId,_=e.sampleRate,this._callPlusClient.setAudioConfig({microphoneId:n,sampleRate:_}),[4,this._callPlusClient.switchMicrophone(n)]):(this._logger.error(g.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(R.PARAM_ERROR),t),[2,{code:R.PARAM_ERROR}]);case 1:return(i=r.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(b(i)),t),[2,{code:b(i)}]):(this._logger.info(g.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"success",t),[2,{code:b(i)}])}}))}))}}),Object.defineProperty(n.prototype,"invite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return void 0===n&&(n={}),T(this,void 0,void 0,(function(){var _,i,r,o,a;return S(this,(function(E){switch(E.label){case 0:return _=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_INVITE_T,JSON.stringify({userIds:e,options:n}),_),i=n.extra,r=JSON.stringify({callLibExtra:i,targetId:this._targetId,channelId:this._channelId,conversationType:t.GROUP}),o=this._options.callPushConfig||n.pushConfig,[4,this._callPlusClient.invite(e,o,r)];case 1:return(a=E.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_INVITE_R,"errorCode: ".concat(b(a)),_),[2,{code:b(a)}]):(this._logger.info(g.L_CALL_SESSION_INVITE_R,"success",_),[2,{code:b(a)}])}}))}))}}),Object.defineProperty(n.prototype,"accept",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return T(this,void 0,void 0,(function(){var t,n,_,i,r,o;return S(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_ACCEPT_T,JSON.stringify(e),t),e&&(n=e.audio,_=e.video,(null==n?void 0:n.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(n.micphoneId),(null==n?void 0:n.sampleRate)&&this._audioConfigBuilder.setSampleRate(n.sampleRate),(null==_?void 0:_.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(_.cameraId),(null==_?void 0:_.frameRate)&&this._videoConfigBuilder.setFrameRate(_.frameRate),(null==_?void 0:_.resolution)&&this._videoConfigBuilder.setVideoResolution(_.resolution)),i=this._audioConfigBuilder.build(),r=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(i),this._callPlusClient.setVideoConfig(r),[4,this._callPlusClient.accept(this._callId,this._options.callPushConfig)];case 1:return(o=a.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_ACCEPT_R,"errorCode: ".concat(b(o)),t),[2,{code:b(o)}]):(this._logger.info(g.L_CALL_SESSION_ACCEPT_R,"success",t),[2,{code:b(o)}])}}))}))}}),Object.defineProperty(n.prototype,"hungup",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t;return S(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_HUNGUP_T,"",e),this.emit(v.INNER_ON_SELF_HANGUP),[4,this._callPlusClient.hangup(this._callId,this._options.hangupPushConfig)];case 1:return(t=n.sent().code)!==l.SUCCESS?this._logger.error(g.L_CALL_SESSION_HUNGUP_R,"errorCode: ".concat(b(t)),e):this._logger.info(g.L_CALL_SESSION_HUNGUP_R,"success",e),[2,{code:b(t)}]}}))}))}}),Object.defineProperty(n.prototype,"descendAbility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t,n,_,i,r=this;return S(this,(function(o){switch(o.label){case 0:return e=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_DESCEND_ABILITY_T,"",e),[4,this._callPlusClient.requestChangeMediaType(s.AUDIO)];case 1:return t=o.sent(),n=t.code,_=t.transactionId,n!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_DESCEND_ABILITY_R,"errorCode: ".concat(b(n)),e),[2,{code:b(n)}]):[4,new Promise((function(e){r._descendResolve[_]=e}))];case 2:return i=o.sent(),this._logger.info(g.L_CALL_SESSION_DESCEND_ABILITY_R,"transactionId: ".concat(_),e),[2,{code:i.code}]}}))}))}}),Object.defineProperty(n.prototype,"disableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t;return S(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.stopCamera()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(g.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"success",e),[2,{code:b(t)}])}}))}))}}),Object.defineProperty(n.prototype,"enableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t;return S(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.startCamera()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(g.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"success",e),[2,{code:b(t)}])}}))}))}}),Object.defineProperty(n.prototype,"disableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t;return S(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.stopMicrophone()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(g.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"success",e),[2,{code:b(t)}])}}))}))}}),Object.defineProperty(n.prototype,"enableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t;return S(this,(function(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(g.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.startMicrophone()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(g.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(g.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"success",e),[2,{code:b(t)}])}}))}))}}),Object.defineProperty(n.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callId}}),Object.defineProperty(n.prototype,"getRTCSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?null:this._callPlusClient.getRTCSessionId()}}),Object.defineProperty(n.prototype,"getTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._targetId}}),Object.defineProperty(n.prototype,"getChannelId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._channelId}}),Object.defineProperty(n.prototype,"getConversationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callType}}),Object.defineProperty(n.prototype,"getRemoteUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return[];var n=(null==t?void 0:t.getUserList())||[];return null==n?void 0:n.map((function(t){var n=t.userId,_=t.state;return{userId:n,state:p(_),isCaller:n===e.getCallerId(),isRemote:n!==e._context.getCurrentId()}}))}}),Object.defineProperty(n.prototype,"getUserState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return O.NONE;var n=null==t?void 0:t.getUserList().filter((function(t){return t.userId===e}))[0].state;return p(n)}}),Object.defineProperty(n.prototype,"getState",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return function(e){var t=null;switch(e){case a.IDLE:t=C.END;break;case a.CALLING:case a.INVITED:case a.RINGING:case a.BUSYLINE_RINGING:case a.BUSYLINE_WAIT:t=C.WAITING;break;case a.CONNECTING:case a.ONCALL:t=C.KEEPING;break;case a.ENDED:case a.NOANSWER:case a.MISSED:case a.CANCELED:case a.DECLINED:case a.ERROR:default:t=C.END}return t}(this._callId===(null==e?void 0:e.getCallId())?null==e?void 0:e.getState():a.ENDED)}}),Object.defineProperty(n.prototype,"getCallerId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?"":e.getCreatorUserId()}}),Object.defineProperty(n.prototype,"getMediaType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mediaType===s.AUDIO?I.AUDIO:I.AUDIO_VIDEO}}),Object.defineProperty(n.prototype,"__innerEndTranction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._mediaType=e,this._descendResolve[t]&&(this._descendResolve[t]({code:R.SUCCESS}),delete this._descendResolve[t])}}),n}(e),y=function(){function e(e,t,n){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_session",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_sessionStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_hangupPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_isSelfHangup",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._callPlusClient=n.callPlusClient,this._reportAppEventModule=new D(t),this._setCallPlusEventListener(),this._audioConfigBuilder=this._callPlusClient.createAudioConfigBuilder(),this._videoConfigBuilder=this._callPlusClient.createVideoConfigBuilder()}return Object.defineProperty(e.prototype,"_setCallPlusEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,n=0,_={},i={};this._callPlusClient.setCallPlusEventListener({onReceivedCall:function(n,_){return void 0===_&&(_="{}"),T(this,void 0,void 0,(function(){var i,r,o;return S(this,(function(a){return i=n.getCallId(),e._session?(e._callPlusClient.hangup(i,e._hangupPushConfig),[2]):(e._targetId=JSON.parse(_).targetId||"",e._channelId=JSON.parse(_).channelId||"",e._mediaType=n.getMediaType()===s.AUDIO?I.AUDIO:I.AUDIO_VIDEO,r=n.getCallType(),o=r===c.MULTI?t.GROUP:t.PRIVATE,e._session=new U(i,e._callPlusClient,e._channelId,e._targetId,o,n.getMediaType(),e._context,e._logger,{callPushConfig:e._callPushConfig,hangupPushConfig:e._hangupPushConfig}),e._session.on(v.INNER_ON_SELF_HANGUP,(function(){e._isSelfHangup=!0})),e._options.onSession(e._session,JSON.parse(_).callLibExtra||""),[2])}))}))},onRemoteUserInvited:function(t,n,_){var i,r={userId:n},o=t.map((function(e){return{userId:e}}));e._listener?e._reportAppEventModule.onMemberModify(r,o,e._session):null===(i=e._session)||void 0===i||i.emit(v.INNER_ON_MEMBER_MODIFY,r,o,e._session)},onCallConnected:function(e){var t=e.getCallId();i[t]=!0},onCallTypeChanged:function(e,t){},onRemoteUserStateChanged:function(t,n,i,r){var a,l,s;return T(this,void 0,void 0,(function(){var u,I,R,O,C,L,d,N,T;return S(this,(function(S){return u={userId:n},I=[o.IDLE,o.DECLINED,o.MISSED,o.NO_ANSWER].includes(i),e._listener?(i===o.RINGING&&e._reportAppEventModule.onRinging(u,e._session),i===o.CONNECTING&&e._reportAppEventModule.onAccept(u,e._session),I&&e._reportAppEventModule.onHungup(u,h(r,e._isSelfHangup),e._session)):(i===o.RINGING&&(null===(a=e._session)||void 0===a||a.emit(v.INNER_ON_RINGING,u,e._session)),i===o.CONNECTING&&(null===(l=e._session)||void 0===l||l.emit(v.INNER_ON_ACCEPT,u,e._session)),I&&(null===(s=e._session)||void 0===s||s.emit(v.INNER_ON_HANGUP,u,h(r,e._isSelfHangup),e._session))),R=e._callPlusClient.getCurrentCallSession(),O=null==R?void 0:R.getCallType(),C=null==R?void 0:R.getUserList(),L=null==C?void 0:C.filter((function(t){return t.userId===e._context.getCurrentId()}))[0],d=null==C?void 0:C.filter((function(t){return t.userId!==e._context.getCurrentId()})),N=null==d?void 0:d.every((function(e){return e.state===o.IDLE})),T=(null==L?void 0:L.state)===o.ONCALL&&N,I&&O===c.MULTI&&T&&(e._callPlusClient.hangup(),_[t]=r===E.MISSED?E.NO_ANSWER:r,e._isSelfHangup=!1),[2]}))}))},onCallEnded:function(t,r){return T(this,void 0,void 0,(function(){var o,a,l;return S(this,(function(E){return o=+new Date-n,a=t.getCallId(),l={conversationType:e._session.getConversationType(),channelId:e._session.getChannelId(),targetId:e._session.getTargetId(),mediaType:e._session.getMediaType(),beginTimestamp:e._sessionStartTime,endTimestamp:o,duration:i[a]?Math.ceil((o-e._sessionStartTime)/1e3):0,endReason:_[a]?h(_[a],e._isSelfHangup):h(r,e._isSelfHangup)},e._options.onSessionClose(e._session,l),e._session=null,e._sessionStartTime=0,delete _[a],delete i[a],[2]}))}))},onUserMediaAvailable:function(t,n){var _;return T(this,void 0,void 0,(function(){var i;return S(this,(function(r){return i=n===s.AUDIO?I.AUDIO:I.AUDIO_VIDEO,e._listener?e._reportAppEventModule.onTrackReady(t,i,e._session):null===(_=e._session)||void 0===_||_.emit(v.INNER_ON_TRACK_READY,t,i,e._session),[2]}))}))},onFetchRemoteMediaError:function(t,n){var _,i,r;e._listener?null===(i=(_=e._reportAppEventModule).onTrackSubscribeFail)||void 0===i||i.call(_,n,e._session):null===(r=e._session)||void 0===r||r.emit(v.INNER_ON_TRACK_SUBSCRIBE_FAIL,n,e._session)},onRemoteCameraStateChanged:function(t,n,_){var i,r={userId:n,muted:_,kind:"video",trackId:"".concat(n,"_RongCloudRTC_1")};e._listener?e._reportAppEventModule.onVideoMuteChange(r,e._session):null===(i=e._session)||void 0===i||i.emit(v.INNER_ON_VIDEO_MUTE_CHANGE,r,e._session)},onRemoteMicrophoneStateChanged:function(t,n,_){var i,r={userId:n,muted:_,kind:"audio",trackId:"".concat(n,"_RongCloudRTC_0")};e._listener?e._reportAppEventModule.onAudioMuteChange(r,e._session):null===(i=e._session)||void 0===i||i.emit(v.INNER_ON_AUDIO_MUTE_CHANGE,r,e._session)},onReceivedCallRecord:function(e){},onReceivedChangeMediaTypeRequest:function(t,n,_){e._callPlusClient.replyChangeMediaType(n,!0)},onReceivedChangeMediaTypeResult:function(t){var n,_;if(e._mediaType===I.AUDIO_VIDEO&&t.mediaType===s.AUDIO&&t.code===u.SERVER_ALLOW_MEDIA_TYPE){var i={userId:t.userId};e._mediaType=I.AUDIO,null===(n=e._session)||void 0===n||n.__innerEndTranction(s.AUDIO,t.transactionId),e._listener?e._reportAppEventModule.onMediaModify(i,e._mediaType,e._session):null===(_=e._session)||void 0===_||_.emit(v.INNER_ON_MEDIA_MODIFY,i,e._mediaType,e._session,t.transactionId)}},onReceivedCallStartTime:function(t){e._sessionStartTime=t.callStartTime,n=+new Date-t.callStartTime},onReceivedCallFirstFrameTime:function(e,t){},onUserAudioLevelChanged:function(e,t){}})}}),Object.defineProperty(e.prototype,"registerUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.error(g.L_CALL_CLIENT_REGISTER_USER_INFO_O,"`RCCallClient.registerUserInfo` has been deprecated.")}}),Object.defineProperty(e.prototype,"startCrossCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return T(this,void 0,void 0,(function(){return S(this,(function(e){return this._logger.error(g.L_CALL_CLIENT_START_CROSS_CALL_O,"`RCCallClient.startCrossCall` has been deprecated"),[2]}))}))}}),Object.defineProperty(e.prototype,"__startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var _=n.targetId,i=n.userIds,r=n.mediaType,o=void 0===r?I.AUDIO:r,a=n.listener,E=n.constraints,u=n.channelId,O=void 0===u?"":u,C=n.extra,L=void 0===C?"":C,d=n.bitrate;return T(this,void 0,void 0,(function(){var n,r,u,C,N,T,A,f,p,h,D,P,y,M,m=this;return S(this,(function(S){switch(S.label){case 0:return n=this._logger.createTraceId(),this._logger.info(g.L_CALL_CLIENT_CALL_T,JSON.stringify({targetId:_,userIds:i,mediaType:o,listener:Object.keys(a),constraints:E,channelId:O,extra:L,bitrate:d}),n),E&&(r=E.audio,u=E.video,(null==r?void 0:r.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(r.micphoneId),(null==r?void 0:r.sampleRate)&&this._audioConfigBuilder.setSampleRate(r.sampleRate),(null==u?void 0:u.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(u.cameraId),(null==u?void 0:u.frameRate)&&this._videoConfigBuilder.setFrameRate(u.frameRate),(null==u?void 0:u.resolution)&&this._videoConfigBuilder.setVideoResolution(u.resolution)),d&&(r=d.audio,u=d.video,r&&this._audioConfigBuilder.setBitrate(r,r),u&&this._videoConfigBuilder.setBitrate(u.min,u.max)),C=this._audioConfigBuilder.build(),N=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(C),this._callPlusClient.setVideoConfig(N),this._targetId=_,this._listener=a,this._reportAppEventModule.registerEventListener(a),this._mediaType=o,T=o===I.AUDIO?s.AUDIO:s.AUDIO_VIDEO,A=e?c.SINGLE:c.MULTI,f=e?[_]:i,p=e?t.PRIVATE:t.GROUP,h=e?this._context.getCurrentId():_,D=JSON.stringify({callLibExtra:L,channelId:O,targetId:h,conversationType:p}),[4,this._callPlusClient.startCall(f,A,T,this._callPushConfig,D)];case 1:return P=S.sent(),y=P.code,M=P.callId,y!==l.SUCCESS?(this._logger.error(g.L_CALL_CLIENT_CALL_R,"errorCode: ".concat(b(y)),n),[2,{code:b(y)}]):(this._logger.info(g.L_CALL_CLIENT_CALL_R,"success",n),this._session=new U(M,this._callPlusClient,this._channelId,this._targetId,p,T,this._context,this._logger,{callPushConfig:this._callPushConfig,hangupPushConfig:this._hangupPushConfig}),this._session.on(v.INNER_ON_SELF_HANGUP,(function(){m._isSelfHangup=!0})),[2,{code:R.SUCCESS,session:this._session}])}}))}))}}),Object.defineProperty(e.prototype,"call",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,n=e.mediaType,_=void 0===n?I.AUDIO:n,i=e.listener,r=e.constraints,o=e.channelId,a=void 0===o?"":o,l=e.extra,E=void 0===l?"":l,s=e.bitrate;return T(this,void 0,void 0,(function(){return S(this,(function(e){return[2,this.__startCall(!0,{targetId:t,userIds:[],mediaType:_,listener:i,constraints:r,channelId:a,extra:E,bitrate:s})]}))}))}}),Object.defineProperty(e.prototype,"callInGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,n=e.userIds,_=e.mediaType,i=void 0===_?I.AUDIO:_,r=e.listener,o=e.constraints,a=e.channelId,l=void 0===a?"":a,E=e.extra,s=void 0===E?"":E,u=e.bitrate;return T(this,void 0,void 0,(function(){return S(this,(function(e){return[2,this.__startCall(!1,{targetId:t,userIds:n,mediaType:i,listener:r,constraints:o,channelId:l,extra:s,bitrate:u})]}))}))}}),Object.defineProperty(e.prototype,"getJoinedRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return T(this,void 0,void 0,(function(){var e,t,_;return S(this,(function(i){switch(i.label){case 0:return[4,this._context.getRTCJoinedUserInfo(this._context.getCurrentId())];case 1:return e=i.sent(),t=e.code,_=e.data,t!==n.SUCCESS?(this._logger.error(g.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E,t),[2,{code:R.QUERY_JOINED_USER_INFO_ERROR}]):[2,{code:R.SUCCESS,data:_}]}}))}))}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this._logger.info(g.L_CALL_CLIENT_SET_PUSH_CONFIG_O,JSON.stringify({callPushConfig:e,hangupPushConfig:t})),this._callPushConfig=e,this._hangupPushConfig=t,delete this._callPushConfig.pushContent,delete this._hangupPushConfig.pushContent}}),e}();!function(e){e.ZH="zh",e.EN="en"}(P||(P={})),_.add("callpluswrapper","2.1.4");var M={tag:"CallPlusWrapper",verify:function(e){return"browser"===e.tag},setup:function(e,t,n){var _=e.createLogger("CWrapper","RTC"),o=i(n.logOutputLevel)?r.WARN:n.logOutputLevel;return _.setOutputLevel(o),_.warn(g.L_CALL_PLUS_WRAPPER_INIT_O,"CallPlus Version: ".concat("2.1.4",", Commit: ").concat("c74dffcce2268e6dbf4f7ea8c4dfa7148c75398a")),new y(e,_,n)}};export{y as RCCallClient,d as RCCallEndReason,R as RCCallErrorCode,P as RCCallLanguage,I as RCCallMediaType,U as RCCallSession,C as RCCallSessionState,O as RCCallUserState,M as installer};
package/wrapper/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,l,n,r,o,a=require("@rongcloud/engine"),s=require("@rongcloud/plugin-call-plus"),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])},i(e,t)};function _(e,t,l,n){return new(l||(l=Promise))((function(r,o){function a(e){try{i(n.next(e))}catch(e){o(e)}}function s(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(a,s)}i((n=n.apply(e,t||[])).next())}))}function C(e,t){var l,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(i){return function(s){if(l)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(l=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{l=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}}"function"==typeof SuppressedError&&SuppressedError,exports.RCCallMediaType=void 0,(e=exports.RCCallMediaType||(exports.RCCallMediaType={}))[e.AUDIO=1]="AUDIO",e[e.AUDIO_VIDEO=2]="AUDIO_VIDEO",exports.RCCallErrorCode=void 0,(t=exports.RCCallErrorCode||(exports.RCCallErrorCode={}))[t.SUCCESS=1e4]="SUCCESS",t[t.STATE_MACHINE_EXIT=53200]="STATE_MACHINE_EXIT",t[t.SEND_MSG_ERROR=53201]="SEND_MSG_ERROR",t[t.REJECTED_BY_BLACKLIST=53202]="REJECTED_BY_BLACKLIST",t[t.NOT_IN_GROUP=53203]="NOT_IN_GROUP",t[t.GET_LOCAL_AUDIO_TRACK_ERROR=53301]="GET_LOCAL_AUDIO_TRACK_ERROR",t[t.GET_LOCAL_VIDEO_TRACK_ERROR=53302]="GET_LOCAL_VIDEO_TRACK_ERROR",t[t.GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR=53303]="GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR",t[t.JOIN_ROOM_ERROR=53304]="JOIN_ROOM_ERROR",t[t.AUDIO_PUBLISH_ERROR=53305]="AUDIO_PUBLISH_ERROR",t[t.VIDEO_PUBLISH_ERROR=53306]="VIDEO_PUBLISH_ERROR",t[t.AUDIO_AND_VIDEO_PUBLISH_ERROR=53307]="AUDIO_AND_VIDEO_PUBLISH_ERROR",t[t.QUERY_JOINED_USER_INFO_ERROR=53308]="QUERY_JOINED_USER_INFO_ERROR",t[t.MISSING_VIDEO_TRACK_ERROR=53309]="MISSING_VIDEO_TRACK_ERROR",t[t.UNPUBLISH_VIDEO_ERROR=53310]="UNPUBLISH_VIDEO_ERROR",t[t.CONVERSATION_NOT_GROUP_ERROR=53311]="CONVERSATION_NOT_GROUP_ERROR",t[t.NOT_IN_ROOM_ERROR=53312]="NOT_IN_ROOM_ERROR",t[t.PARAM_ERROR=53313]="PARAM_ERROR",t[t.NOT_IN_CALL=53314]="NOT_IN_CALL",t[t.MEDIATYPE_INVALID=53315]="MEDIATYPE_INVALID",t[t.NOT_VIDEO_CALL=53316]="NOT_VIDEO_CALL",t[t.RTC_SERVICE_UNAVAILABLE=53317]="RTC_SERVICE_UNAVAILABLE",t[t.USER_LIST_INVAILD=53318]="USER_LIST_INVAILD",t[t.CALL_ID_INVALID=53319]="CALL_ID_INVALID",t[t.TRANSACTION_ID_INVALID=53320]="TRANSACTION_ID_INVALID",t[t.USER_ID_INVALID=53321]="USER_ID_INVALID",t[t.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON=53322]="SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON",t[t.MICROPHONE_CLOSED=53323]="MICROPHONE_CLOSED",t[t.MEDIA_RESOURCE_INVALIED=53324]="MEDIA_RESOURCE_INVALIED",t[t.NOT_INSTALL_RTC_PLUGIN=53325]="NOT_INSTALL_RTC_PLUGIN",t[t.PLAY_MEDIA_FAILED=53326]="PLAY_MEDIA_FAILED",t[t.VIDEO_VIEW_NOT_SET=53327]="VIDEO_VIEW_NOT_SET",exports.RCCallUserState=void 0,(l=exports.RCCallUserState||(exports.RCCallUserState={}))[l.NONE=0]="NONE",l[l.WAITING=1]="WAITING",l[l.KEEPING=2]="KEEPING",exports.RCCallSessionState=void 0,(n=exports.RCCallSessionState||(exports.RCCallSessionState={}))[n.WAITING=0]="WAITING",n[n.KEEPING=1]="KEEPING",n[n.END=2]="END",exports.RCCallEndReason=void 0,(o=exports.RCCallEndReason||(exports.RCCallEndReason={}))[o.CANCEL=1]="CANCEL",o[o.REJECT=2]="REJECT",o[o.HANGUP=3]="HANGUP",o[o.BUSY_LINE=4]="BUSY_LINE",o[o.NO_RESPONSE=5]="NO_RESPONSE",o[o.ENGINE_UNSUPPORTED=6]="ENGINE_UNSUPPORTED",o[o.NETWORK_ERROR=7]="NETWORK_ERROR",o[o.GET_MEDIA_RESOURCES_ERROR=8]="GET_MEDIA_RESOURCES_ERROR",o[o.PUBLISH_ERROR=9]="PUBLISH_ERROR",o[o.SUBSCRIBE_ERROR=10]="SUBSCRIBE_ERROR",o[o.REMOTE_CANCEL=11]="REMOTE_CANCEL",o[o.REMOTE_REJECT=12]="REMOTE_REJECT",o[o.REMOTE_HANGUP=13]="REMOTE_HANGUP",o[o.REMOTE_BUSY_LINE=14]="REMOTE_BUSY_LINE",o[o.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",o[o.REMOTE_ENGINE_UNSUPPORTED=16]="REMOTE_ENGINE_UNSUPPORTED",o[o.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",o[o.REMOTE_GET_MEDIA_RESOURCE_ERROR=18]="REMOTE_GET_MEDIA_RESOURCE_ERROR",o[o.REMOTE_PUBLISH_ERROR=19]="REMOTE_PUBLISH_ERROR",o[o.REMOTE_SUBSCRIBE_ERROR=20]="REMOTE_SUBSCRIBE_ERROR",o[o.OTHER_CLIENT_JOINED_CALL=21]="OTHER_CLIENT_JOINED_CALL",o[o.OTHER_CLIENT_IN_CALL=22]="OTHER_CLIENT_IN_CALL",o[o.KICKED_BY_SERVER=23]="KICKED_BY_SERVER",o[o.ACCEPT_SYSTEM_CALL=24]="ACCEPT_SYSTEM_CALL",o[o.REMOTE_OTHER_CLIENT_JOINED_CALL=31]="REMOTE_OTHER_CLIENT_JOINED_CALL",o[o.REMOTE_OTHER_CLIENT_IN_CALL=32]="REMOTE_OTHER_CLIENT_IN_CALL",o[o.REMOTE_KICKED_BY_SERVER=33]="REMOTE_KICKED_BY_SERVER",o[o.REMOTE_ACCEPT_SYSTEM_CALL=34]="REMOTE_ACCEPT_SYSTEM_CALL",o[o.ACCEPT_BY_OTHER_CLIENT=101]="ACCEPT_BY_OTHER_CLIENT",o[o.HANGUP_BY_OTHER_CLIENT=102]="HANGUP_BY_OTHER_CLIENT",o[o.ADDED_TO_BLACKLIST=103]="ADDED_TO_BLACKLIST",o[o.SERVICE_NOT_OPENED=104]="SERVICE_NOT_OPENED",(r={})[exports.RCCallEndReason.CANCEL]=exports.RCCallEndReason.REMOTE_CANCEL,r[exports.RCCallEndReason.REJECT]=exports.RCCallEndReason.REMOTE_REJECT,r[exports.RCCallEndReason.HANGUP]=exports.RCCallEndReason.REMOTE_HANGUP,r[exports.RCCallEndReason.BUSY_LINE]=exports.RCCallEndReason.REMOTE_BUSY_LINE,r[exports.RCCallEndReason.NO_RESPONSE]=exports.RCCallEndReason.REMOTE_NO_RESPONSE,r[exports.RCCallEndReason.ENGINE_UNSUPPORTED]=exports.RCCallEndReason.REMOTE_ENGINE_UNSUPPORTED,r[exports.RCCallEndReason.NETWORK_ERROR]=exports.RCCallEndReason.REMOTE_NETWORK_ERROR,r[exports.RCCallEndReason.GET_MEDIA_RESOURCES_ERROR]=exports.RCCallEndReason.REMOTE_GET_MEDIA_RESOURCE_ERROR,r[exports.RCCallEndReason.PUBLISH_ERROR]=exports.RCCallEndReason.REMOTE_PUBLISH_ERROR,r[exports.RCCallEndReason.SUBSCRIBE_ERROR]=exports.RCCallEndReason.REMOTE_SUBSCRIBE_ERROR,r[exports.RCCallEndReason.OTHER_CLIENT_JOINED_CALL]=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL,r[exports.RCCallEndReason.OTHER_CLIENT_IN_CALL]=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_IN_CALL,r[exports.RCCallEndReason.KICKED_BY_SERVER]=exports.RCCallEndReason.REMOTE_KICKED_BY_SERVER,r[exports.RCCallEndReason.REMOTE_NO_RESPONSE]=exports.RCCallEndReason.NO_RESPONSE,r[exports.RCCallEndReason.ACCEPT_SYSTEM_CALL]=exports.RCCallEndReason.REMOTE_ACCEPT_SYSTEM_CALL;var E,R=function(e){var t=null;switch(e){case s.RCCallPlusSessionUserState.IDLE:t=exports.RCCallUserState.NONE;break;case s.RCCallPlusSessionUserState.CALLING:case s.RCCallPlusSessionUserState.INVITED:case s.RCCallPlusSessionUserState.RINGING:t=exports.RCCallUserState.WAITING;break;case s.RCCallPlusSessionUserState.BUSYLINE_RINGING:case s.RCCallPlusSessionUserState.BUSYLINE_WAIT:t=exports.RCCallUserState.NONE;break;case s.RCCallPlusSessionUserState.CONNECTING:t=exports.RCCallUserState.WAITING;break;case s.RCCallPlusSessionUserState.ONCALL:t=exports.RCCallUserState.KEEPING;break;case s.RCCallPlusSessionUserState.ONPHONE:t=exports.RCCallUserState.WAITING;break;case s.RCCallPlusSessionUserState.ENDED:case s.RCCallPlusSessionUserState.NO_ANSWER:case s.RCCallPlusSessionUserState.MISSED:case s.RCCallPlusSessionUserState.CANCELLED:case s.RCCallPlusSessionUserState.DECLINED:case s.RCCallPlusSessionUserState.ERROR:default:t=exports.RCCallUserState.NONE}return t},u=function(e){var t=null;switch(e){case s.RCCallPlusCode.SUCCESS:t=exports.RCCallErrorCode.SUCCESS;break;case s.RCCallPlusCode.PARAM_ERROR:t=exports.RCCallErrorCode.PARAM_ERROR;break;case s.RCCallPlusCode.SESSION_EXIST:t=exports.RCCallErrorCode.STATE_MACHINE_EXIT;break;case s.RCCallPlusCode.NOT_IN_CALL:t=exports.RCCallErrorCode.NOT_IN_CALL;break;case s.RCCallPlusCode.MEDIATYPE_INVALID:t=exports.RCCallErrorCode.MEDIATYPE_INVALID;break;case s.RCCallPlusCode.NOT_VIDEO_CALL:t=exports.RCCallErrorCode.NOT_VIDEO_CALL;break;case s.RCCallPlusCode.RTC_SERVICE_UNAVAILABLE:t=exports.RCCallErrorCode.RTC_SERVICE_UNAVAILABLE;break;case s.RCCallPlusCode.USER_LIST_INVAILD:t=exports.RCCallErrorCode.USER_LIST_INVAILD;break;case s.RCCallPlusCode.CALL_ID_INVALID:t=exports.RCCallErrorCode.CALL_ID_INVALID;break;case s.RCCallPlusCode.TRANSACTION_ID_INVALID:t=exports.RCCallErrorCode.TRANSACTION_ID_INVALID;break;case s.RCCallPlusCode.USER_ID_INVALID:t=exports.RCCallErrorCode.USER_ID_INVALID;break;case s.RCCallPlusCode.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON:t=exports.RCCallErrorCode.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON;break;case s.RCCallPlusCode.CAMERA_CLOSED:t=exports.RCCallErrorCode.MISSING_VIDEO_TRACK_ERROR;break;case s.RCCallPlusCode.MICROPHONE_CLOSED:t=exports.RCCallErrorCode.MICROPHONE_CLOSED;break;case s.RCCallPlusCode.MEDIA_RESOURCE_INVALIED:t=exports.RCCallErrorCode.MEDIA_RESOURCE_INVALIED;break;case s.RCCallPlusCode.NOT_INSTALL_RTC_PLUGIN:t=exports.RCCallErrorCode.NOT_INSTALL_RTC_PLUGIN;break;case s.RCCallPlusCode.PLAY_MEDIA_FAILED:t=exports.RCCallErrorCode.PLAY_MEDIA_FAILED;break;case s.RCCallPlusCode.VIDEO_VIEW_NOT_SET:t=exports.RCCallErrorCode.VIDEO_VIEW_NOT_SET;break;default:t=e}return t},c=function(e,t){var l=null;switch(e){case s.RCCallPlusReason.BUSYLINE_RINGING:l=t?exports.RCCallEndReason.BUSY_LINE:exports.RCCallEndReason.REMOTE_BUSY_LINE;break;case s.RCCallPlusReason.ON_DEVICE_DISABLE:l=exports.RCCallEndReason.REMOTE_GET_MEDIA_RESOURCE_ERROR;break;case s.RCCallPlusReason.ENDED:l=t?exports.RCCallEndReason.HANGUP:exports.RCCallEndReason.REMOTE_HANGUP;break;case s.RCCallPlusReason.NO_ANSWER:l=exports.RCCallEndReason.REMOTE_NO_RESPONSE;break;case s.RCCallPlusReason.MISSED:l=exports.RCCallEndReason.NO_RESPONSE;break;case s.RCCallPlusReason.CANCELLED:l=t?exports.RCCallEndReason.CANCEL:exports.RCCallEndReason.REMOTE_CANCEL;break;case s.RCCallPlusReason.DECLINED:l=t?exports.RCCallEndReason.REJECT:exports.RCCallEndReason.REMOTE_REJECT;break;case s.RCCallPlusReason.OTHER_CLIENT_ACCEPT:l=exports.RCCallEndReason.ACCEPT_BY_OTHER_CLIENT;break;case s.RCCallPlusReason.PUBLISH_ERR:l=exports.RCCallEndReason.PUBLISH_ERROR;break;case s.RCCallPlusReason.SUBSCRIBE_ERR:l=exports.RCCallEndReason.SUBSCRIBE_ERROR;break;case s.RCCallPlusReason.ACCEPT_CARRIER:l=t?exports.RCCallEndReason.ACCEPT_SYSTEM_CALL:exports.RCCallEndReason.REMOTE_ACCEPT_SYSTEM_CALL;break;case s.RCCallPlusReason.KICKED_BY_SERVER:l=exports.RCCallEndReason.KICKED_BY_SERVER;break;case s.RCCallPlusReason.CONNECTION_ERR:l=exports.RCCallEndReason.NETWORK_ERROR;break;case s.RCCallPlusReason.OTHER_CLIENT_JOINED:l=t?exports.RCCallEndReason.OTHER_CLIENT_JOINED_CALL:exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case s.RCCallPlusReason.OTHER_CLIENT_IN_ROOM:l=exports.RCCallEndReason.OTHER_CLIENT_IN_CALL;break;case s.RCCallPlusReason.OTHER_CLIENT_HANGUP:l=exports.RCCallEndReason.HANGUP_BY_OTHER_CLIENT;break;case s.RCCallPlusReason.REMOTE_PUBLISH_ERROR:l=exports.RCCallEndReason.REMOTE_PUBLISH_ERROR;break;case s.RCCallPlusReason.REMOTE_SUBSCRIBE_ERROR:l=exports.RCCallEndReason.REMOTE_SUBSCRIBE_ERROR;break;case s.RCCallPlusReason.REMOTE_KICKED_BY_SERVER:l=exports.RCCallEndReason.REMOTE_KICKED_BY_SERVER;break;case s.RCCallPlusReason.REMOTE_CONNECTION_ERROR:l=exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.ABNORMAL_END:l=t?exports.RCCallEndReason.NETWORK_ERROR:exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.OTHER_CLIENT_CALLING:l=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case s.RCCallPlusReason.JOIN_ROOM_ERR:l=exports.RCCallEndReason.NETWORK_ERROR;break;case s.RCCallPlusReason.LOGOUT:l=exports.RCCallEndReason.HANGUP;break;case s.RCCallPlusReason.OTHER_CLIENT_LOGIN:l=exports.RCCallEndReason.NETWORK_ERROR;break;case s.RCCallPlusReason.REMOTE_JOIN_RTC_ERROR:l=exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.REMOTE_LOGOUT:l=exports.RCCallEndReason.REMOTE_HANGUP;break;case s.RCCallPlusReason.REMOTE_OTHER_CLIENT_LOGIN:l=exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.REMOTE_OTHER_JOINED_RTC:l=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case s.RCCallPlusReason.REMOTE_OTHER_CLIENT_IN_RTC:l=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_IN_CALL;break;default:l=exports.RCCallEndReason.NETWORK_ERROR}return l};!function(e){e.L_CALL_PLUS_WRAPPER_INIT_O="L-call_plus_wrapper_init-O",e.L_CALL_CLIENT_REGISTER_USER_INFO_O="L-call_client_register_user_info-O",e.L_CALL_CLIENT_START_CROSS_CALL_O="L-call_client_start_cross_call-O",e.L_CALL_CLIENT_CALL_T="L-call_client_call-T",e.L_CALL_CLIENT_CALL_R="L-call_client_call-R",e.L_CALL_CLIENT_CALL_IN_GROUP_T="L-call_client_call_in_group-T",e.L_CALL_CLIENT_CALL_IN_GROUP_R="L-call_client_call_in_group-R",e.L_CALL_CLIENT_SET_PUSH_CONFIG_O="L-call_client_set_push_config-O",e.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O="L-call_session_register_session_listener-O",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T="L-call_session_change_audio_device-T",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R="L-call_session_change_audio_device-R",e.L_CALL_SESSION_INVITE_T="L-call_session_invite-T",e.L_CALL_SESSION_INVITE_R="L-call_session_invite-R",e.L_CALL_SESSION_ACCEPT_T="L-call_session_accept-T",e.L_CALL_SESSION_ACCEPT_R="L-call_session_accept-R",e.L_CALL_SESSION_HUNGUP_T="L-call_session_hungup-T",e.L_CALL_SESSION_HUNGUP_R="L-call_session_hungup-R",e.L_CALL_SESSION_DESCEND_ABILITY_T="L-call_session_descend_ability-T",e.L_CALL_SESSION_DESCEND_ABILITY_P="L-call_session_descend_ability-P",e.L_CALL_SESSION_DESCEND_ABILITY_R="L-call_session_descend_ability-R",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T="L-call_session_disable_video_track-T",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R="L-call_session_disable_video_track-R",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T="L-call_session_enable_video_track-T",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R="L-call_session_enable_video_track-R",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T="L-call_session_disable_audio_track-T",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R="L-call_session_disable_audio_track-R",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T="L-call_session_enable_audio_track-T",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R="L-call_session_enable_audio_track-R",e.L_CALL_EXECUTE_EVENT_LISTENER_O="L-call_execute_event_listener-O",e.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E="L-call_client_get_joined_room_info-E"}(E||(E={}));var d,I=function(){function e(e){Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"registerEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._listener=e}}),Object.defineProperty(e.prototype,"_callAppListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,l=[],n=1;n<arguments.length;n++)l[n-1]=arguments[n];return _(this,void 0,void 0,(function(){var n,r;return C(this,(function(o){switch(o.label){case 0:if(!(n=null===(t=this._listener)||void 0===t?void 0:t[e]))return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.apply(void 0,l)];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),this._logger.error(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventName:e,name:r.name,message:r.message})),[3,4];case 4:return[2]}}))}))}}),Object.defineProperty(e.prototype,"onRinging",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onRinging",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onRinging",e,t)}}),Object.defineProperty(e.prototype,"onAccept",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAccept",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onAccept",e,t)}}),Object.defineProperty(e.prototype,"onHungup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onHungup",sender:e,reason:t,sessionId:l.getSessionId()})),this._callAppListener("onHungup",e,t,l)}}),Object.defineProperty(e.prototype,"onMemberModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMemberModify",sender:e,invitedUsers:t,sessionId:l.getSessionId()})),this._callAppListener("onMemberModify",e,t,l)}}),Object.defineProperty(e.prototype,"onMediaModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMediaModify",sender:e,mediaType:t,sessionId:l.getSessionId()})),this._callAppListener("onMediaModify",e,t,l)}}),Object.defineProperty(e.prototype,"onTrackReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackReady",userId:e,mediaType:t,sessionId:null==l?void 0:l.getSessionId()})),this._callAppListener("onTrackReady",e,t,l)}}),Object.defineProperty(e.prototype,"onAudioMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAudioMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onAudioMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onVideoMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onVideoMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onVideoMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onTrackSubscribeFail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackSubscribeFail",code:e,sessionId:t.getSessionId()})),this._callAppListener("onTrackSubscribeFail",e,t)}}),Object.defineProperty(e.prototype,"onSendPacketLoss",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.debug(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onSendPacketLoss",packetLostRate:e,delay:t})),this._callAppListener("onSendPacketLoss",e,t)}}),Object.defineProperty(e.prototype,"onReceivePacketLoss",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.info(E.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onReceivePacketLoss",data:e})),this._callAppListener("onReceivePacketLoss",e)}}),e}();!function(e){e.INNER_ON_RINGING="inner-on-ringing",e.INNER_ON_ACCEPT="inner-on-accept",e.INNER_ON_HANGUP="inner-on-hangup",e.INNER_ON_TRACK_READY="inner-on-track-ready",e.INNER_ON_MEMBER_MODIFY="inner-on-member-modify",e.INNER_ON_MEDIA_MODIFY="inner-on-media-modify",e.INNER_ON_AUDIO_MUTE_CHANGE="inner-on-audio-mute-change",e.INNER_ON_VIDEO_MUTE_CHANGE="inner-on-video-mute-change",e.INNER_ON_TRACK_SUBSCRIBE_FAIL="inner-on-track-subscribe-fail",e.INNER_ON_SELF_HANGUP="inner-on-self-hangup"}(d||(d={}));var O,L=function(e){function t(t,l,n,r,o,a,s,i,_){var C=e.call(this)||this;return Object.defineProperty(C,"_callId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(C,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(C,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(C,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(C,"_callType",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(C,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(C,"_context",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(C,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(C,"_options",{enumerable:!0,configurable:!0,writable:!0,value:_}),Object.defineProperty(C,"_descendResolve",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(C,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(C,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(C,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),C._audioConfigBuilder=C._callPlusClient.createAudioConfigBuilder(),C._videoConfigBuilder=C._callPlusClient.createVideoConfigBuilder(),C._reportAppEventModule=new I(i),C}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function l(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(l.prototype=t.prototype,new l)}(t,e),Object.defineProperty(t.prototype,"registerSessionListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.info(E.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O,Object.keys(e).join(",")),this._reportAppEventModule.registerEventListener(e),this.on(d.INNER_ON_RINGING,(function(e,l){t._reportAppEventModule.onRinging(e,l)})),this.on(d.INNER_ON_ACCEPT,(function(e,l){t._reportAppEventModule.onAccept(e,l)})),this.on(d.INNER_ON_HANGUP,(function(e,l,n){t._reportAppEventModule.onHungup(e,l,n)})),this.on(d.INNER_ON_TRACK_READY,(function(e,l,n){t._reportAppEventModule.onTrackReady(e,l,n)})),this.on(d.INNER_ON_MEMBER_MODIFY,(function(e,l,n){t._reportAppEventModule.onMemberModify(e,l,n)})),this.on(d.INNER_ON_MEDIA_MODIFY,(function(e,l,n,r){var o,a;t._descendResolve[r]?(t._logger.info(E.L_CALL_SESSION_DESCEND_ABILITY_R,"success, transactionId: ".concat(r)),null===(a=(o=t._descendResolve)[r])||void 0===a||a.call(o,{code:exports.RCCallErrorCode.SUCCESS}),delete t._descendResolve[r]):t._reportAppEventModule.onMediaModify(e,l,n)})),this.on(d.INNER_ON_AUDIO_MUTE_CHANGE,(function(e,l){t._reportAppEventModule.onAudioMuteChange(e,l)})),this.on(d.INNER_ON_VIDEO_MUTE_CHANGE,(function(e,l){t._reportAppEventModule.onVideoMuteChange(e,l)})),this.on(d.INNER_ON_TRACK_SUBSCRIBE_FAIL,(function(e,l){var n,r;null===(r=(n=t._reportAppEventModule).onTrackSubscribeFail)||void 0===r||r.call(n,e,l)}))}}),Object.defineProperty(t.prototype,"changeAudioDevice",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return _(this,void 0,void 0,(function(){var t,l,n,r;return C(this,(function(o){switch(o.label){case 0:return t=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T,JSON.stringify(e),t),e?(l=e.micphoneId,n=e.sampleRate,this._callPlusClient.setAudioConfig({microphoneId:l,sampleRate:n}),[4,this._callPlusClient.switchMicrophone(l)]):(this._logger.error(E.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(exports.RCCallErrorCode.PARAM_ERROR),t),[2,{code:exports.RCCallErrorCode.PARAM_ERROR}]);case 1:return(r=o.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(u(r)),t),[2,{code:u(r)}]):(this._logger.info(E.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"success",t),[2,{code:u(r)}])}}))}))}}),Object.defineProperty(t.prototype,"invite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var l;return void 0===t&&(t={}),_(this,void 0,void 0,(function(){var n,r;return C(this,(function(o){switch(o.label){case 0:return n=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_INVITE_T,JSON.stringify({userIds:e,options:t}),n),[4,this._callPlusClient.invite(e,null===(l=this._options)||void 0===l?void 0:l.callPushConfig,t.extra)];case 1:return(r=o.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_INVITE_R,"errorCode: ".concat(u(r)),n),[2,{code:u(r)}]):(this._logger.info(E.L_CALL_SESSION_INVITE_R,"success",n),[2,{code:u(r)}])}}))}))}}),Object.defineProperty(t.prototype,"accept",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return _(this,void 0,void 0,(function(){var l,n,r,o,a,i;return C(this,(function(_){switch(_.label){case 0:return l=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_ACCEPT_T,JSON.stringify(e),l),e&&(n=e.audio,r=e.video,(null==n?void 0:n.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(n.micphoneId),(null==n?void 0:n.sampleRate)&&this._audioConfigBuilder.setSampleRate(n.sampleRate),(null==r?void 0:r.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(r.cameraId),(null==r?void 0:r.frameRate)&&this._videoConfigBuilder.setFrameRate(r.frameRate),(null==r?void 0:r.resolution)&&this._videoConfigBuilder.setVideoResolution(r.resolution)),o=this._audioConfigBuilder.build(),a=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(o),this._callPlusClient.setVideoConfig(a),[4,this._callPlusClient.accept(this._callId,null===(t=this._options)||void 0===t?void 0:t.callPushConfig)];case 1:return(i=_.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_ACCEPT_R,"errorCode: ".concat(u(i)),l),[2,{code:u(i)}]):(this._logger.info(E.L_CALL_SESSION_ACCEPT_R,"success",l),[2,{code:u(i)}])}}))}))}}),Object.defineProperty(t.prototype,"hungup",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return _(this,void 0,void 0,(function(){var t,l;return C(this,(function(n){switch(n.label){case 0:return t=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_HUNGUP_T,"",t),this.emit(d.INNER_ON_SELF_HANGUP),[4,this._callPlusClient.hangup(this._callId,null===(e=this._options)||void 0===e?void 0:e.hangupPushConfig)];case 1:return(l=n.sent().code)!==s.RCCallPlusCode.SUCCESS&&this._logger.error(E.L_CALL_SESSION_HUNGUP_R,"errorCode: ".concat(u(l)),t),this._logger.info(E.L_CALL_SESSION_HUNGUP_R,"success",t),[2,{code:u(l)}]}}))}))}}),Object.defineProperty(t.prototype,"descendAbility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t=this;return C(this,(function(l){return e=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_DESCEND_ABILITY_T,"",e),[2,new Promise((function(l){t._callPlusClient.requestChangeMediaType(s.RCCallPlusMediaType.AUDIO).then((function(n){var r=n.code,o=n.transactionId;if(r!==s.RCCallPlusCode.SUCCESS)return t._logger.error(E.L_CALL_SESSION_DESCEND_ABILITY_R,"errorCode: ".concat(u(r)),e),void l({code:u(r)});t._logger.info(E.L_CALL_SESSION_DESCEND_ABILITY_P,"transactionId: ".concat(o),e),t._descendResolve[o]=l}))}))]}))}))}}),Object.defineProperty(t.prototype,"disableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.stopCamera()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"errorCode: ".concat(u(t)),e),[2,{code:u(t)}]):(this._logger.info(E.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"success",e),[2,{code:u(t)}])}}))}))}}),Object.defineProperty(t.prototype,"enableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.startCamera()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"errorCode: ".concat(u(t)),e),[2,{code:u(t)}]):(this._logger.info(E.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"success",e),[2,{code:u(t)}])}}))}))}}),Object.defineProperty(t.prototype,"disableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.stopMicrophone()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"errorCode: ".concat(u(t)),e),[2,{code:u(t)}]):(this._logger.info(E.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"success",e),[2,{code:u(t)}])}}))}))}}),Object.defineProperty(t.prototype,"enableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(E.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.startMicrophone()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"errorCode: ".concat(u(t)),e),[2,{code:u(t)}]):(this._logger.info(E.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"success",e),[2,{code:u(t)}])}}))}))}}),Object.defineProperty(t.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callId}}),Object.defineProperty(t.prototype,"getRTCSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?null:this._callPlusClient.getRTCSessionId()}}),Object.defineProperty(t.prototype,"getTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._targetId}}),Object.defineProperty(t.prototype,"getChannelId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._channelId}}),Object.defineProperty(t.prototype,"getConversationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callType}}),Object.defineProperty(t.prototype,"getRemoteUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return[];var l=(null==t?void 0:t.getUserList())||[];return null==l?void 0:l.map((function(t){var l=t.userId,n=t.state;return{userId:l,state:R(n),isCaller:l===e.getCallerId(),isRemote:l!==e._context.getCurrentId()}}))}}),Object.defineProperty(t.prototype,"getUserState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return exports.RCCallUserState.NONE;var l=null==t?void 0:t.getUserList().filter((function(t){return t.userId===e}))[0].state;return R(l)}}),Object.defineProperty(t.prototype,"getState",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return function(e){var t=null;switch(e){case s.RCCallPlusCallState.IDLE:t=exports.RCCallSessionState.END;break;case s.RCCallPlusCallState.CALLING:case s.RCCallPlusCallState.INVITED:case s.RCCallPlusCallState.RINGING:case s.RCCallPlusCallState.BUSYLINE_RINGING:case s.RCCallPlusCallState.BUSYLINE_WAIT:t=exports.RCCallSessionState.WAITING;break;case s.RCCallPlusCallState.CONNECTING:case s.RCCallPlusCallState.ONCALL:t=exports.RCCallSessionState.KEEPING;break;case s.RCCallPlusCallState.ENDED:case s.RCCallPlusCallState.NOANSWER:case s.RCCallPlusCallState.MISSED:case s.RCCallPlusCallState.CANCELED:case s.RCCallPlusCallState.DECLINED:case s.RCCallPlusCallState.ERROR:default:t=exports.RCCallSessionState.END}return t}(this._callId===(null==e?void 0:e.getCallId())?null==e?void 0:e.getState():s.RCCallPlusCallState.ENDED)}}),Object.defineProperty(t.prototype,"getCallerId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?"":e.getCreatorUserId()}}),Object.defineProperty(t.prototype,"getMediaType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mediaType===s.RCCallPlusMediaType.AUDIO?exports.RCCallMediaType.AUDIO:exports.RCCallMediaType.AUDIO_VIDEO}}),t}(a.EventEmitter),S=function(){function e(e,t,l,n){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_runtime",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_session",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_sessionStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_hangupPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_isSelfHangup",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._callPlusClient=n.callPlusClient,this._reportAppEventModule=new I(l),this._setCallPlusEventListener(),this._audioConfigBuilder=this._callPlusClient.createAudioConfigBuilder(),this._videoConfigBuilder=this._callPlusClient.createVideoConfigBuilder()}return Object.defineProperty(e.prototype,"_setCallPlusEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=0,l={},n={};this._callPlusClient.setCallPlusEventListener({onReceivedCall:function(t,l){return void 0===l&&(l="{}"),_(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){return n=t.getCallId(),e._session?(e._callPlusClient.hangup(n,e._hangupPushConfig),[2]):(e._targetId=JSON.parse(l).targetId||"",e._channelId=JSON.parse(l).channelId||"",e._mediaType=t.getMediaType()===s.RCCallPlusMediaType.AUDIO?exports.RCCallMediaType.AUDIO:exports.RCCallMediaType.AUDIO_VIDEO,r=t.getCallType(),o=r===s.RCCallPlusType.MULTI?a.ConversationType.GROUP:a.ConversationType.PRIVATE,e._session=new L(n,e._callPlusClient,e._channelId,e._targetId,o,t.getMediaType(),e._context,e._logger),e._session.on(d.INNER_ON_SELF_HANGUP,(function(){e._isSelfHangup=!0})),e._options.onSession(e._session,JSON.parse(l).callLibExtra||""),[2])}))}))},onRemoteUserInvited:function(t,l,n){var r,o={userId:l},a=t.map((function(e){return{userId:e}}));e._listener?e._reportAppEventModule.onMemberModify(o,a,e._session):null===(r=e._session)||void 0===r||r.emit(d.INNER_ON_MEMBER_MODIFY,o,a,e._session)},onCallConnected:function(e){var t=e.getCallId();n[t]=!0},onCallTypeChanged:function(e,t){},onRemoteUserStateChanged:function(t,n,r,o){var a,i,E;return _(this,void 0,void 0,(function(){var _,R,u,I,O,L,S,N,p;return C(this,(function(C){return _={userId:n},R=[s.RCCallPlusSessionUserState.IDLE,s.RCCallPlusSessionUserState.DECLINED,s.RCCallPlusSessionUserState.MISSED,s.RCCallPlusSessionUserState.NO_ANSWER].includes(r),e._listener?(r===s.RCCallPlusSessionUserState.RINGING&&e._reportAppEventModule.onRinging(_,e._session),r===s.RCCallPlusSessionUserState.CONNECTING&&e._reportAppEventModule.onAccept(_,e._session),R&&e._reportAppEventModule.onHungup(_,c(o,e._isSelfHangup),e._session)):(r===s.RCCallPlusSessionUserState.RINGING&&(null===(a=e._session)||void 0===a||a.emit(d.INNER_ON_RINGING,_,e._session)),r===s.RCCallPlusSessionUserState.CONNECTING&&(null===(i=e._session)||void 0===i||i.emit(d.INNER_ON_ACCEPT,_,e._session)),R&&(null===(E=e._session)||void 0===E||E.emit(d.INNER_ON_HANGUP,_,c(o,e._isSelfHangup),e._session))),u=e._callPlusClient.getCurrentCallSession(),I=null==u?void 0:u.getCallType(),O=null==u?void 0:u.getUserList(),L=null==O?void 0:O.filter((function(t){return t.userId===e._context.getCurrentId()}))[0],S=null==O?void 0:O.filter((function(t){return t.userId!==e._context.getCurrentId()})),N=null==S?void 0:S.every((function(e){return e.state===s.RCCallPlusSessionUserState.IDLE})),p=(null==L?void 0:L.state)===s.RCCallPlusSessionUserState.ONCALL&&N,R&&I===s.RCCallPlusType.MULTI&&p&&(e._callPlusClient.hangup(),l[t]=o===s.RCCallPlusReason.MISSED?s.RCCallPlusReason.NO_ANSWER:o,e._isSelfHangup=!1),[2]}))}))},onCallEnded:function(r,o){return _(this,void 0,void 0,(function(){var a,s,i;return C(this,(function(_){return a=+new Date-t,s=r.getCallId(),i={conversationType:e._session.getConversationType(),channelId:e._session.getChannelId(),targetId:e._session.getTargetId(),mediaType:e._session.getMediaType(),beginTimestamp:e._sessionStartTime,endTimestamp:a,duration:n[s]?Math.ceil((a-e._sessionStartTime)/1e3):0,endReason:l[s]?c(l[s],e._isSelfHangup):c(o,e._isSelfHangup)},e._options.onSessionClose(e._session,i),e._session=null,e._sessionStartTime=0,delete l[s],delete n[s],[2]}))}))},onUserMediaAvailable:function(t,l){var n;return _(this,void 0,void 0,(function(){var r;return C(this,(function(o){return r=l===s.RCCallPlusMediaType.AUDIO?exports.RCCallMediaType.AUDIO:exports.RCCallMediaType.AUDIO_VIDEO,e._listener?e._reportAppEventModule.onTrackReady(t,r,e._session):null===(n=e._session)||void 0===n||n.emit(d.INNER_ON_TRACK_READY,t,r,e._session),[2]}))}))},onFetchRemoteMediaError:function(t,l){var n,r,o;e._listener?null===(r=(n=e._reportAppEventModule).onTrackSubscribeFail)||void 0===r||r.call(n,l,e._session):null===(o=e._session)||void 0===o||o.emit(d.INNER_ON_TRACK_SUBSCRIBE_FAIL,l,e._session)},onRemoteCameraStateChanged:function(t,l,n){var r,o={userId:l,muted:n,kind:""};e._listener?e._reportAppEventModule.onVideoMuteChange(o,e._session):null===(r=e._session)||void 0===r||r.emit(d.INNER_ON_VIDEO_MUTE_CHANGE,o,e._session)},onRemoteMicrophoneStateChanged:function(t,l,n){var r,o={userId:l,muted:n,kind:""};e._listener?e._reportAppEventModule.onAudioMuteChange(o,e._session):null===(r=e._session)||void 0===r||r.emit(d.INNER_ON_AUDIO_MUTE_CHANGE,o,e._session)},onReceivedCallRecord:function(e){},onReceivedChangeMediaTypeRequest:function(t,l,n){e._callPlusClient.replyChangeMediaType(l,!0)},onReceivedChangeMediaTypeResult:function(t){var l;if(e._mediaType===exports.RCCallMediaType.AUDIO_VIDEO&&t.mediaType===s.RCCallPlusMediaType.AUDIO_VIDEO&&t.code===s.RCCallPlusMediaTypeChangeResult.SERVER_ALLOW_MEDIA_TYPE){var n={userId:t.userId};e._mediaType=exports.RCCallMediaType.AUDIO,e._listener?e._reportAppEventModule.onMediaModify(n,e._mediaType,e._session):null===(l=e._session)||void 0===l||l.emit(d.INNER_ON_MEDIA_MODIFY,n,e._mediaType,e._session,t.transactionId)}},onReceivedCallStartTime:function(l){e._sessionStartTime=l.callStartTime,t=+new Date-l.callStartTime},onReceivedCallFirstFrameTime:function(e,t){},onUserAudioLevelChanged:function(e,t){}})}}),Object.defineProperty(e.prototype,"registerUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.warn(E.L_CALL_CLIENT_REGISTER_USER_INFO_O,"`RCCallClient.registerUserInfo` has been deprecated, use `https://doc.rongcloud.cn/imserver/server/v1/user/register` instead.")}}),Object.defineProperty(e.prototype,"startCrossCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.targetId;var t=e.mediaType;return void 0===t&&exports.RCCallMediaType.AUDIO,e.listener,e.constraints,e.channelId,e.extra,e.bitrate,_(this,void 0,void 0,(function(){return C(this,(function(e){return this._logger.warn(E.L_CALL_CLIENT_START_CROSS_CALL_O,"`RCCallClient.startCrossCall` has been deprecated"),[2]}))}))}}),Object.defineProperty(e.prototype,"__startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var l=t.targetId,n=t.userIds,r=t.mediaType,o=void 0===r?exports.RCCallMediaType.AUDIO:r,i=t.listener,R=t.constraints,c=t.channelId,I=void 0===c?"":c,O=t.extra,S=void 0===O?"":O,N=t.bitrate;return _(this,void 0,void 0,(function(){var t,r,_,c,O,p,T,A,f,g,b,P,h,v,D=this;return C(this,(function(C){switch(C.label){case 0:return t=this._logger.createTraceId(),this._logger.info(E.L_CALL_CLIENT_CALL_T,JSON.stringify({targetId:l,userIds:n,mediaType:o,listener:Object.keys(i),constraints:R,channelId:I,extra:S,bitrate:N}),t),R&&(r=R.audio,_=R.video,(null==r?void 0:r.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(r.micphoneId),(null==r?void 0:r.sampleRate)&&this._audioConfigBuilder.setSampleRate(r.sampleRate),(null==_?void 0:_.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(_.cameraId),(null==_?void 0:_.frameRate)&&this._videoConfigBuilder.setFrameRate(_.frameRate),(null==_?void 0:_.resolution)&&this._videoConfigBuilder.setVideoResolution(_.resolution)),N&&(r=N.audio,_=N.video,r&&this._audioConfigBuilder.setBitrate(r,r),_&&this._videoConfigBuilder.setBitrate(_.min,_.max)),c=this._audioConfigBuilder.build(),O=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(c),this._callPlusClient.setVideoConfig(O),this._targetId=l,this._listener=i,this._reportAppEventModule.registerEventListener(i),this._mediaType=o,p=o===exports.RCCallMediaType.AUDIO?s.RCCallPlusMediaType.AUDIO:s.RCCallPlusMediaType.AUDIO_VIDEO,T=e?s.RCCallPlusType.SINGLE:s.RCCallPlusType.MULTI,A=e?[l]:n,f=e?this._context.getCurrentId():l,g=JSON.stringify({callLibExtra:S,channelId:I,targetId:f}),[4,this._callPlusClient.startCall(A,T,p,this._callPushConfig,g)];case 1:return b=C.sent(),P=b.code,h=b.callId,P!==s.RCCallPlusCode.SUCCESS?(this._logger.error(E.L_CALL_CLIENT_CALL_R,"errorCode: ".concat(u(P)),t),[2,{code:u(P)}]):(this._logger.info(E.L_CALL_CLIENT_CALL_R,"success",t),v=e?a.ConversationType.PRIVATE:a.ConversationType.GROUP,this._session=new L(h,this._callPlusClient,this._channelId,this._targetId,v,p,this._context,this._logger,{callPushConfig:this._callPushConfig,hangupPushConfig:this._hangupPushConfig}),this._session.on(d.INNER_ON_SELF_HANGUP,(function(){D._isSelfHangup=!0})),[2,{code:exports.RCCallErrorCode.SUCCESS,session:this._session}])}}))}))}}),Object.defineProperty(e.prototype,"call",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,l=e.mediaType,n=void 0===l?exports.RCCallMediaType.AUDIO:l,r=e.listener,o=e.constraints,a=e.channelId,s=void 0===a?"":a,i=e.extra,E=void 0===i?"":i,R=e.bitrate;return _(this,void 0,void 0,(function(){return C(this,(function(e){return[2,this.__startCall(!0,{targetId:t,userIds:[],mediaType:n,listener:r,constraints:o,channelId:s,extra:E,bitrate:R})]}))}))}}),Object.defineProperty(e.prototype,"callInGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,l=e.userIds,n=e.mediaType,r=void 0===n?exports.RCCallMediaType.AUDIO:n,o=e.listener,a=e.constraints,s=e.channelId,i=void 0===s?"":s,E=e.extra,R=void 0===E?"":E,u=e.bitrate;return _(this,void 0,void 0,(function(){return C(this,(function(e){return[2,this.__startCall(!1,{targetId:t,userIds:l,mediaType:r,listener:o,constraints:a,channelId:i,extra:R,bitrate:u})]}))}))}}),Object.defineProperty(e.prototype,"getJoinedRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t,l;return C(this,(function(n){switch(n.label){case 0:return[4,this._context.getRTCJoinedUserInfo(this._context.getCurrentId())];case 1:return e=n.sent(),t=e.code,l=e.data,t!==a.ErrorCode.SUCCESS?(this._logger.error(E.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E,t),[2,{code:exports.RCCallErrorCode.QUERY_JOINED_USER_INFO_ERROR}]):[2,{code:exports.RCCallErrorCode.SUCCESS,data:l}]}}))}))}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this._logger.info(E.L_CALL_CLIENT_SET_PUSH_CONFIG_O,JSON.stringify({callPushConfig:e,hangupPushConfig:t})),this._callPushConfig=e,this._hangupPushConfig=t,delete this._callPushConfig.pushContent,delete this._hangupPushConfig.pushContent}}),e}();exports.RCCallLanguage=void 0,(O=exports.RCCallLanguage||(exports.RCCallLanguage={})).ZH="zh",O.EN="en";var N={tag:"CallPlusWrapper",verify:function(e){return"browser"===e.tag},setup:function(e,t,l){var n=e.createLogger("CallPlusWrapper","RTC"),r=a.isUndefined(l.logOutputLevel)?a.LogL.WARN:l.logOutputLevel;return n.setOutputLevel(r),n.warn(E.L_CALL_PLUS_WRAPPER_INIT_O,"CallPlus Version: ".concat("2.1.2",", Commit: ").concat("d95e6815e07ae1c83b40409e2738c123b376f493")),new S(e,t,n,l)}};exports.RCCallClient=S,exports.RCCallSession=L,exports.installer=N;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,l,n,r,o,a=require("@rongcloud/engine"),s=require("@rongcloud/plugin-call-plus"),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])},i(e,t)};function _(e,t,l,n){return new(l||(l=Promise))((function(r,o){function a(e){try{i(n.next(e))}catch(e){o(e)}}function s(e){try{i(n.throw(e))}catch(e){o(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(a,s)}i((n=n.apply(e,t||[])).next())}))}function C(e,t){var l,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(i){return function(s){if(l)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(l=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{l=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}}function E(e,t){var l="function"==typeof Symbol&&e[Symbol.iterator];if(!l)return e;var n,r,o=l.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(l=o.return)&&l.call(o)}finally{if(r)throw r.error}}return a}function R(e,t,l){if(l||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,exports.RCCallMediaType=void 0,(e=exports.RCCallMediaType||(exports.RCCallMediaType={}))[e.AUDIO=1]="AUDIO",e[e.AUDIO_VIDEO=2]="AUDIO_VIDEO",exports.RCCallErrorCode=void 0,(t=exports.RCCallErrorCode||(exports.RCCallErrorCode={}))[t.SUCCESS=1e4]="SUCCESS",t[t.STATE_MACHINE_EXIT=53200]="STATE_MACHINE_EXIT",t[t.SEND_MSG_ERROR=53201]="SEND_MSG_ERROR",t[t.REJECTED_BY_BLACKLIST=53202]="REJECTED_BY_BLACKLIST",t[t.NOT_IN_GROUP=53203]="NOT_IN_GROUP",t[t.GET_LOCAL_AUDIO_TRACK_ERROR=53301]="GET_LOCAL_AUDIO_TRACK_ERROR",t[t.GET_LOCAL_VIDEO_TRACK_ERROR=53302]="GET_LOCAL_VIDEO_TRACK_ERROR",t[t.GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR=53303]="GET_LOCAL_AUDIO_AND_VIDEO_TRACK_ERROR",t[t.JOIN_ROOM_ERROR=53304]="JOIN_ROOM_ERROR",t[t.AUDIO_PUBLISH_ERROR=53305]="AUDIO_PUBLISH_ERROR",t[t.VIDEO_PUBLISH_ERROR=53306]="VIDEO_PUBLISH_ERROR",t[t.AUDIO_AND_VIDEO_PUBLISH_ERROR=53307]="AUDIO_AND_VIDEO_PUBLISH_ERROR",t[t.QUERY_JOINED_USER_INFO_ERROR=53308]="QUERY_JOINED_USER_INFO_ERROR",t[t.MISSING_VIDEO_TRACK_ERROR=53309]="MISSING_VIDEO_TRACK_ERROR",t[t.UNPUBLISH_VIDEO_ERROR=53310]="UNPUBLISH_VIDEO_ERROR",t[t.CONVERSATION_NOT_GROUP_ERROR=53311]="CONVERSATION_NOT_GROUP_ERROR",t[t.NOT_IN_ROOM_ERROR=53312]="NOT_IN_ROOM_ERROR",t[t.PARAM_ERROR=53313]="PARAM_ERROR",t[t.NOT_IN_CALL=53314]="NOT_IN_CALL",t[t.MEDIATYPE_INVALID=53315]="MEDIATYPE_INVALID",t[t.NOT_VIDEO_CALL=53316]="NOT_VIDEO_CALL",t[t.RTC_SERVICE_UNAVAILABLE=53317]="RTC_SERVICE_UNAVAILABLE",t[t.USER_LIST_INVAILD=53318]="USER_LIST_INVAILD",t[t.CALL_ID_INVALID=53319]="CALL_ID_INVALID",t[t.TRANSACTION_ID_INVALID=53320]="TRANSACTION_ID_INVALID",t[t.USER_ID_INVALID=53321]="USER_ID_INVALID",t[t.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON=53322]="SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON",t[t.MICROPHONE_CLOSED=53323]="MICROPHONE_CLOSED",t[t.MEDIA_RESOURCE_INVALIED=53324]="MEDIA_RESOURCE_INVALIED",t[t.NOT_INSTALL_RTC_PLUGIN=53325]="NOT_INSTALL_RTC_PLUGIN",t[t.PLAY_MEDIA_FAILED=53326]="PLAY_MEDIA_FAILED",t[t.VIDEO_VIEW_NOT_SET=53327]="VIDEO_VIEW_NOT_SET",exports.RCCallUserState=void 0,(l=exports.RCCallUserState||(exports.RCCallUserState={}))[l.NONE=0]="NONE",l[l.WAITING=1]="WAITING",l[l.KEEPING=2]="KEEPING",exports.RCCallSessionState=void 0,(n=exports.RCCallSessionState||(exports.RCCallSessionState={}))[n.WAITING=0]="WAITING",n[n.KEEPING=1]="KEEPING",n[n.END=2]="END",exports.RCCallEndReason=void 0,(o=exports.RCCallEndReason||(exports.RCCallEndReason={}))[o.CANCEL=1]="CANCEL",o[o.REJECT=2]="REJECT",o[o.HANGUP=3]="HANGUP",o[o.BUSY_LINE=4]="BUSY_LINE",o[o.NO_RESPONSE=5]="NO_RESPONSE",o[o.ENGINE_UNSUPPORTED=6]="ENGINE_UNSUPPORTED",o[o.NETWORK_ERROR=7]="NETWORK_ERROR",o[o.GET_MEDIA_RESOURCES_ERROR=8]="GET_MEDIA_RESOURCES_ERROR",o[o.PUBLISH_ERROR=9]="PUBLISH_ERROR",o[o.SUBSCRIBE_ERROR=10]="SUBSCRIBE_ERROR",o[o.REMOTE_CANCEL=11]="REMOTE_CANCEL",o[o.REMOTE_REJECT=12]="REMOTE_REJECT",o[o.REMOTE_HANGUP=13]="REMOTE_HANGUP",o[o.REMOTE_BUSY_LINE=14]="REMOTE_BUSY_LINE",o[o.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",o[o.REMOTE_ENGINE_UNSUPPORTED=16]="REMOTE_ENGINE_UNSUPPORTED",o[o.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",o[o.REMOTE_GET_MEDIA_RESOURCE_ERROR=18]="REMOTE_GET_MEDIA_RESOURCE_ERROR",o[o.REMOTE_PUBLISH_ERROR=19]="REMOTE_PUBLISH_ERROR",o[o.REMOTE_SUBSCRIBE_ERROR=20]="REMOTE_SUBSCRIBE_ERROR",o[o.OTHER_CLIENT_JOINED_CALL=21]="OTHER_CLIENT_JOINED_CALL",o[o.OTHER_CLIENT_IN_CALL=22]="OTHER_CLIENT_IN_CALL",o[o.KICKED_BY_SERVER=23]="KICKED_BY_SERVER",o[o.ACCEPT_SYSTEM_CALL=24]="ACCEPT_SYSTEM_CALL",o[o.REMOTE_OTHER_CLIENT_JOINED_CALL=31]="REMOTE_OTHER_CLIENT_JOINED_CALL",o[o.REMOTE_OTHER_CLIENT_IN_CALL=32]="REMOTE_OTHER_CLIENT_IN_CALL",o[o.REMOTE_KICKED_BY_SERVER=33]="REMOTE_KICKED_BY_SERVER",o[o.REMOTE_ACCEPT_SYSTEM_CALL=34]="REMOTE_ACCEPT_SYSTEM_CALL",o[o.ACCEPT_BY_OTHER_CLIENT=101]="ACCEPT_BY_OTHER_CLIENT",o[o.HANGUP_BY_OTHER_CLIENT=102]="HANGUP_BY_OTHER_CLIENT",o[o.ADDED_TO_BLACKLIST=103]="ADDED_TO_BLACKLIST",o[o.SERVICE_NOT_OPENED=104]="SERVICE_NOT_OPENED",(r={})[exports.RCCallEndReason.CANCEL]=exports.RCCallEndReason.REMOTE_CANCEL,r[exports.RCCallEndReason.REJECT]=exports.RCCallEndReason.REMOTE_REJECT,r[exports.RCCallEndReason.HANGUP]=exports.RCCallEndReason.REMOTE_HANGUP,r[exports.RCCallEndReason.BUSY_LINE]=exports.RCCallEndReason.REMOTE_BUSY_LINE,r[exports.RCCallEndReason.NO_RESPONSE]=exports.RCCallEndReason.REMOTE_NO_RESPONSE,r[exports.RCCallEndReason.ENGINE_UNSUPPORTED]=exports.RCCallEndReason.REMOTE_ENGINE_UNSUPPORTED,r[exports.RCCallEndReason.NETWORK_ERROR]=exports.RCCallEndReason.REMOTE_NETWORK_ERROR,r[exports.RCCallEndReason.GET_MEDIA_RESOURCES_ERROR]=exports.RCCallEndReason.REMOTE_GET_MEDIA_RESOURCE_ERROR,r[exports.RCCallEndReason.PUBLISH_ERROR]=exports.RCCallEndReason.REMOTE_PUBLISH_ERROR,r[exports.RCCallEndReason.SUBSCRIBE_ERROR]=exports.RCCallEndReason.REMOTE_SUBSCRIBE_ERROR,r[exports.RCCallEndReason.OTHER_CLIENT_JOINED_CALL]=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL,r[exports.RCCallEndReason.OTHER_CLIENT_IN_CALL]=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_IN_CALL,r[exports.RCCallEndReason.KICKED_BY_SERVER]=exports.RCCallEndReason.REMOTE_KICKED_BY_SERVER,r[exports.RCCallEndReason.REMOTE_NO_RESPONSE]=exports.RCCallEndReason.NO_RESPONSE,r[exports.RCCallEndReason.ACCEPT_SYSTEM_CALL]=exports.RCCallEndReason.REMOTE_ACCEPT_SYSTEM_CALL;var u,c=function(e){var t=null;switch(e){case s.RCCallPlusSessionUserState.IDLE:t=exports.RCCallUserState.NONE;break;case s.RCCallPlusSessionUserState.CALLING:case s.RCCallPlusSessionUserState.INVITED:case s.RCCallPlusSessionUserState.RINGING:t=exports.RCCallUserState.WAITING;break;case s.RCCallPlusSessionUserState.BUSYLINE_RINGING:case s.RCCallPlusSessionUserState.BUSYLINE_WAIT:t=exports.RCCallUserState.NONE;break;case s.RCCallPlusSessionUserState.CONNECTING:t=exports.RCCallUserState.WAITING;break;case s.RCCallPlusSessionUserState.ONCALL:t=exports.RCCallUserState.KEEPING;break;case s.RCCallPlusSessionUserState.ONPHONE:t=exports.RCCallUserState.WAITING;break;case s.RCCallPlusSessionUserState.ENDED:case s.RCCallPlusSessionUserState.NO_ANSWER:case s.RCCallPlusSessionUserState.MISSED:case s.RCCallPlusSessionUserState.CANCELLED:case s.RCCallPlusSessionUserState.DECLINED:case s.RCCallPlusSessionUserState.ERROR:default:t=exports.RCCallUserState.NONE}return t},d=function(e){var t=null;switch(e){case s.RCCallPlusCode.SUCCESS:t=exports.RCCallErrorCode.SUCCESS;break;case s.RCCallPlusCode.PARAM_ERROR:t=exports.RCCallErrorCode.PARAM_ERROR;break;case s.RCCallPlusCode.SESSION_EXIST:t=exports.RCCallErrorCode.STATE_MACHINE_EXIT;break;case s.RCCallPlusCode.NOT_IN_CALL:t=exports.RCCallErrorCode.NOT_IN_CALL;break;case s.RCCallPlusCode.MEDIATYPE_INVALID:t=exports.RCCallErrorCode.MEDIATYPE_INVALID;break;case s.RCCallPlusCode.NOT_VIDEO_CALL:t=exports.RCCallErrorCode.NOT_VIDEO_CALL;break;case s.RCCallPlusCode.RTC_SERVICE_UNAVAILABLE:t=exports.RCCallErrorCode.RTC_SERVICE_UNAVAILABLE;break;case s.RCCallPlusCode.USER_LIST_INVAILD:t=exports.RCCallErrorCode.USER_LIST_INVAILD;break;case s.RCCallPlusCode.CALL_ID_INVALID:t=exports.RCCallErrorCode.CALL_ID_INVALID;break;case s.RCCallPlusCode.TRANSACTION_ID_INVALID:t=exports.RCCallErrorCode.TRANSACTION_ID_INVALID;break;case s.RCCallPlusCode.USER_ID_INVALID:t=exports.RCCallErrorCode.USER_ID_INVALID;break;case s.RCCallPlusCode.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON:t=exports.RCCallErrorCode.SINGLE_CALL_NOT_SUPPORT_MULTI_PERSON;break;case s.RCCallPlusCode.CAMERA_CLOSED:t=exports.RCCallErrorCode.MISSING_VIDEO_TRACK_ERROR;break;case s.RCCallPlusCode.MICROPHONE_CLOSED:t=exports.RCCallErrorCode.MICROPHONE_CLOSED;break;case s.RCCallPlusCode.MEDIA_RESOURCE_INVALIED:t=exports.RCCallErrorCode.MEDIA_RESOURCE_INVALIED;break;case s.RCCallPlusCode.NOT_INSTALL_RTC_PLUGIN:t=exports.RCCallErrorCode.NOT_INSTALL_RTC_PLUGIN;break;case s.RCCallPlusCode.PLAY_MEDIA_FAILED:t=exports.RCCallErrorCode.PLAY_MEDIA_FAILED;break;case s.RCCallPlusCode.VIDEO_VIEW_NOT_SET:t=exports.RCCallErrorCode.VIDEO_VIEW_NOT_SET;break;default:t=e}return t},I=function(e,t){var l=null;switch(e){case s.RCCallPlusReason.BUSYLINE_RINGING:l=t?exports.RCCallEndReason.BUSY_LINE:exports.RCCallEndReason.REMOTE_BUSY_LINE;break;case s.RCCallPlusReason.ON_DEVICE_DISABLE:l=exports.RCCallEndReason.REMOTE_GET_MEDIA_RESOURCE_ERROR;break;case s.RCCallPlusReason.ENDED:l=t?exports.RCCallEndReason.HANGUP:exports.RCCallEndReason.REMOTE_HANGUP;break;case s.RCCallPlusReason.NO_ANSWER:l=exports.RCCallEndReason.REMOTE_NO_RESPONSE;break;case s.RCCallPlusReason.MISSED:l=exports.RCCallEndReason.NO_RESPONSE;break;case s.RCCallPlusReason.CANCELLED:l=t?exports.RCCallEndReason.CANCEL:exports.RCCallEndReason.REMOTE_CANCEL;break;case s.RCCallPlusReason.DECLINED:l=t?exports.RCCallEndReason.REJECT:exports.RCCallEndReason.REMOTE_REJECT;break;case s.RCCallPlusReason.OTHER_CLIENT_ACCEPT:l=exports.RCCallEndReason.ACCEPT_BY_OTHER_CLIENT;break;case s.RCCallPlusReason.PUBLISH_ERR:l=exports.RCCallEndReason.PUBLISH_ERROR;break;case s.RCCallPlusReason.SUBSCRIBE_ERR:l=exports.RCCallEndReason.SUBSCRIBE_ERROR;break;case s.RCCallPlusReason.ACCEPT_CARRIER:l=t?exports.RCCallEndReason.ACCEPT_SYSTEM_CALL:exports.RCCallEndReason.REMOTE_ACCEPT_SYSTEM_CALL;break;case s.RCCallPlusReason.KICKED_BY_SERVER:l=exports.RCCallEndReason.KICKED_BY_SERVER;break;case s.RCCallPlusReason.CONNECTION_ERR:l=exports.RCCallEndReason.NETWORK_ERROR;break;case s.RCCallPlusReason.OTHER_CLIENT_JOINED:l=t?exports.RCCallEndReason.OTHER_CLIENT_JOINED_CALL:exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case s.RCCallPlusReason.OTHER_CLIENT_IN_ROOM:l=exports.RCCallEndReason.OTHER_CLIENT_IN_CALL;break;case s.RCCallPlusReason.OTHER_CLIENT_HANGUP:l=exports.RCCallEndReason.HANGUP_BY_OTHER_CLIENT;break;case s.RCCallPlusReason.REMOTE_PUBLISH_ERROR:l=exports.RCCallEndReason.REMOTE_PUBLISH_ERROR;break;case s.RCCallPlusReason.REMOTE_SUBSCRIBE_ERROR:l=exports.RCCallEndReason.REMOTE_SUBSCRIBE_ERROR;break;case s.RCCallPlusReason.REMOTE_KICKED_BY_SERVER:l=exports.RCCallEndReason.REMOTE_KICKED_BY_SERVER;break;case s.RCCallPlusReason.REMOTE_CONNECTION_ERROR:l=exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.ABNORMAL_END:l=t?exports.RCCallEndReason.NETWORK_ERROR:exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.OTHER_CLIENT_CALLING:l=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case s.RCCallPlusReason.JOIN_ROOM_ERR:l=exports.RCCallEndReason.NETWORK_ERROR;break;case s.RCCallPlusReason.LOGOUT:l=exports.RCCallEndReason.HANGUP;break;case s.RCCallPlusReason.OTHER_CLIENT_LOGIN:l=exports.RCCallEndReason.NETWORK_ERROR;break;case s.RCCallPlusReason.REMOTE_JOIN_RTC_ERROR:l=exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.REMOTE_LOGOUT:l=exports.RCCallEndReason.REMOTE_HANGUP;break;case s.RCCallPlusReason.REMOTE_OTHER_CLIENT_LOGIN:l=exports.RCCallEndReason.REMOTE_NETWORK_ERROR;break;case s.RCCallPlusReason.REMOTE_OTHER_JOINED_RTC:l=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case s.RCCallPlusReason.REMOTE_OTHER_CLIENT_IN_RTC:l=exports.RCCallEndReason.REMOTE_OTHER_CLIENT_IN_CALL;break;default:l=exports.RCCallEndReason.NETWORK_ERROR}return l};!function(e){e.L_CALL_PLUS_WRAPPER_INIT_O="L-call_plus_wrapper_init-O",e.L_CALL_CLIENT_REGISTER_USER_INFO_O="L-call_client_register_user_info-O",e.L_CALL_CLIENT_START_CROSS_CALL_O="L-call_client_start_cross_call-O",e.L_CALL_CLIENT_CALL_T="L-call_client_call-T",e.L_CALL_CLIENT_CALL_R="L-call_client_call-R",e.L_CALL_CLIENT_CALL_IN_GROUP_T="L-call_client_call_in_group-T",e.L_CALL_CLIENT_CALL_IN_GROUP_R="L-call_client_call_in_group-R",e.L_CALL_CLIENT_SET_PUSH_CONFIG_O="L-call_client_set_push_config-O",e.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O="L-call_session_register_session_listener-O",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T="L-call_session_change_audio_device-T",e.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R="L-call_session_change_audio_device-R",e.L_CALL_SESSION_INVITE_T="L-call_session_invite-T",e.L_CALL_SESSION_INVITE_R="L-call_session_invite-R",e.L_CALL_SESSION_ACCEPT_T="L-call_session_accept-T",e.L_CALL_SESSION_ACCEPT_R="L-call_session_accept-R",e.L_CALL_SESSION_HUNGUP_T="L-call_session_hungup-T",e.L_CALL_SESSION_HUNGUP_R="L-call_session_hungup-R",e.L_CALL_SESSION_DESCEND_ABILITY_T="L-call_session_descend_ability-T",e.L_CALL_SESSION_DESCEND_ABILITY_R="L-call_session_descend_ability-R",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T="L-call_session_disable_video_track-T",e.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R="L-call_session_disable_video_track-R",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T="L-call_session_enable_video_track-T",e.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R="L-call_session_enable_video_track-R",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T="L-call_session_disable_audio_track-T",e.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R="L-call_session_disable_audio_track-R",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T="L-call_session_enable_audio_track-T",e.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R="L-call_session_enable_audio_track-R",e.L_CALL_EXECUTE_EVENT_LISTENER_O="L-call_execute_event_listener-O",e.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E="L-call_client_get_joined_room_info-E"}(u||(u={}));var O,L=function(){function e(e){Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"registerEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._listener=e}}),Object.defineProperty(e.prototype,"_callAppListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,l=[],n=1;n<arguments.length;n++)l[n-1]=arguments[n];return _(this,void 0,void 0,(function(){var n,r;return C(this,(function(o){switch(o.label){case 0:if(!(n=null===(t=this._listener)||void 0===t?void 0:t[e]))return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.apply(void 0,R([],E(l),!1))];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),this._logger.error(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventName:e,name:r.name,message:r.message})),[3,4];case 4:return[2]}}))}))}}),Object.defineProperty(e.prototype,"onRinging",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onRinging",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onRinging",e,t)}}),Object.defineProperty(e.prototype,"onAccept",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAccept",sender:e,sessionId:t.getSessionId()})),this._callAppListener("onAccept",e,t)}}),Object.defineProperty(e.prototype,"onHungup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onHungup",sender:e,reason:t,sessionId:l.getSessionId()})),this._callAppListener("onHungup",e,t,l)}}),Object.defineProperty(e.prototype,"onMemberModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMemberModify",sender:e,invitedUsers:t,sessionId:l.getSessionId()})),this._callAppListener("onMemberModify",e,t,l)}}),Object.defineProperty(e.prototype,"onMediaModify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onMediaModify",sender:e,mediaType:t,sessionId:l.getSessionId()})),this._callAppListener("onMediaModify",e,t,l)}}),Object.defineProperty(e.prototype,"onTrackReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,l){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackReady",userId:e,mediaType:t,sessionId:null==l?void 0:l.getSessionId()})),this._callAppListener("onTrackReady",e,t,l)}}),Object.defineProperty(e.prototype,"onAudioMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onAudioMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onAudioMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onVideoMuteChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onVideoMuteChange",muteUser:e,sessionId:t.getSessionId()})),this._callAppListener("onVideoMuteChange",e,t)}}),Object.defineProperty(e.prototype,"onTrackSubscribeFail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._logger.info(u.L_CALL_EXECUTE_EVENT_LISTENER_O,JSON.stringify({eventType:"onTrackSubscribeFail",code:e,sessionId:t.getSessionId()})),this._callAppListener("onTrackSubscribeFail",e,t)}}),e}();!function(e){e.INNER_ON_RINGING="inner-on-ringing",e.INNER_ON_ACCEPT="inner-on-accept",e.INNER_ON_HANGUP="inner-on-hangup",e.INNER_ON_TRACK_READY="inner-on-track-ready",e.INNER_ON_MEMBER_MODIFY="inner-on-member-modify",e.INNER_ON_MEDIA_MODIFY="inner-on-media-modify",e.INNER_ON_AUDIO_MUTE_CHANGE="inner-on-audio-mute-change",e.INNER_ON_VIDEO_MUTE_CHANGE="inner-on-video-mute-change",e.INNER_ON_TRACK_SUBSCRIBE_FAIL="inner-on-track-subscribe-fail",e.INNER_ON_SELF_HANGUP="inner-on-self-hangup"}(O||(O={}));var S,N=function(e){function t(t,l,n,r,o,a,s,i,_){var C=e.call(this)||this;return Object.defineProperty(C,"_callId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(C,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(C,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(C,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(C,"_callType",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(C,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(C,"_context",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(C,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(C,"_options",{enumerable:!0,configurable:!0,writable:!0,value:_}),Object.defineProperty(C,"_descendResolve",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(C,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(C,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(C,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),C._audioConfigBuilder=C._callPlusClient.createAudioConfigBuilder(),C._videoConfigBuilder=C._callPlusClient.createVideoConfigBuilder(),C._reportAppEventModule=new L(i),C}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function l(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(l.prototype=t.prototype,new l)}(t,e),Object.defineProperty(t.prototype,"registerSessionListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.info(u.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O,Object.keys(e).join(",")),this._reportAppEventModule.registerEventListener(e),this.on(O.INNER_ON_RINGING,(function(e,l){t._reportAppEventModule.onRinging(e,l)})),this.on(O.INNER_ON_ACCEPT,(function(e,l){t._reportAppEventModule.onAccept(e,l)})),this.on(O.INNER_ON_HANGUP,(function(e,l,n){t._reportAppEventModule.onHungup(e,l,n)})),this.on(O.INNER_ON_TRACK_READY,(function(e,l,n){t._reportAppEventModule.onTrackReady(e,l,n)})),this.on(O.INNER_ON_MEMBER_MODIFY,(function(e,l,n){t._reportAppEventModule.onMemberModify(e,l,n)})),this.on(O.INNER_ON_MEDIA_MODIFY,(function(e,l,n,r){t._reportAppEventModule.onMediaModify(e,l,n)})),this.on(O.INNER_ON_AUDIO_MUTE_CHANGE,(function(e,l){t._reportAppEventModule.onAudioMuteChange(e,l)})),this.on(O.INNER_ON_VIDEO_MUTE_CHANGE,(function(e,l){t._reportAppEventModule.onVideoMuteChange(e,l)})),this.on(O.INNER_ON_TRACK_SUBSCRIBE_FAIL,(function(e,l){var n,r;null===(r=(n=t._reportAppEventModule).onTrackSubscribeFail)||void 0===r||r.call(n,e,l)}))}}),Object.defineProperty(t.prototype,"changeAudioDevice",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return _(this,void 0,void 0,(function(){var t,l,n,r;return C(this,(function(o){switch(o.label){case 0:return t=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_T,JSON.stringify(e),t),e?(l=e.micphoneId,n=e.sampleRate,this._callPlusClient.setAudioConfig({microphoneId:l,sampleRate:n}),[4,this._callPlusClient.switchMicrophone(l)]):(this._logger.error(u.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(exports.RCCallErrorCode.PARAM_ERROR),t),[2,{code:exports.RCCallErrorCode.PARAM_ERROR}]);case 1:return(r=o.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(d(r)),t),[2,{code:d(r)}]):(this._logger.info(u.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"success",t),[2,{code:d(r)}])}}))}))}}),Object.defineProperty(t.prototype,"invite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t={}),_(this,void 0,void 0,(function(){var l,n,r,o,i;return C(this,(function(_){switch(_.label){case 0:return l=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_INVITE_T,JSON.stringify({userIds:e,options:t}),l),n=t.extra,r=JSON.stringify({callLibExtra:n,targetId:this._targetId,channelId:this._channelId,conversationType:a.ConversationType.GROUP}),o=this._options.callPushConfig||t.pushConfig,[4,this._callPlusClient.invite(e,o,r)];case 1:return(i=_.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_INVITE_R,"errorCode: ".concat(d(i)),l),[2,{code:d(i)}]):(this._logger.info(u.L_CALL_SESSION_INVITE_R,"success",l),[2,{code:d(i)}])}}))}))}}),Object.defineProperty(t.prototype,"accept",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return _(this,void 0,void 0,(function(){var t,l,n,r,o,a;return C(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_ACCEPT_T,JSON.stringify(e),t),e&&(l=e.audio,n=e.video,(null==l?void 0:l.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(l.micphoneId),(null==l?void 0:l.sampleRate)&&this._audioConfigBuilder.setSampleRate(l.sampleRate),(null==n?void 0:n.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(n.cameraId),(null==n?void 0:n.frameRate)&&this._videoConfigBuilder.setFrameRate(n.frameRate),(null==n?void 0:n.resolution)&&this._videoConfigBuilder.setVideoResolution(n.resolution)),r=this._audioConfigBuilder.build(),o=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(r),this._callPlusClient.setVideoConfig(o),[4,this._callPlusClient.accept(this._callId,this._options.callPushConfig)];case 1:return(a=i.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_ACCEPT_R,"errorCode: ".concat(d(a)),t),[2,{code:d(a)}]):(this._logger.info(u.L_CALL_SESSION_ACCEPT_R,"success",t),[2,{code:d(a)}])}}))}))}}),Object.defineProperty(t.prototype,"hungup",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_HUNGUP_T,"",e),this.emit(O.INNER_ON_SELF_HANGUP),[4,this._callPlusClient.hangup(this._callId,this._options.hangupPushConfig)];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?this._logger.error(u.L_CALL_SESSION_HUNGUP_R,"errorCode: ".concat(d(t)),e):this._logger.info(u.L_CALL_SESSION_HUNGUP_R,"success",e),[2,{code:d(t)}]}}))}))}}),Object.defineProperty(t.prototype,"descendAbility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t,l,n,r,o=this;return C(this,(function(a){switch(a.label){case 0:return e=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_DESCEND_ABILITY_T,"",e),[4,this._callPlusClient.requestChangeMediaType(s.RCCallPlusMediaType.AUDIO)];case 1:return t=a.sent(),l=t.code,n=t.transactionId,l!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_DESCEND_ABILITY_R,"errorCode: ".concat(d(l)),e),[2,{code:d(l)}]):[4,new Promise((function(e){o._descendResolve[n]=e}))];case 2:return r=a.sent(),this._logger.info(u.L_CALL_SESSION_DESCEND_ABILITY_R,"transactionId: ".concat(n),e),[2,{code:r.code}]}}))}))}}),Object.defineProperty(t.prototype,"disableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.stopCamera()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"errorCode: ".concat(d(t)),e),[2,{code:d(t)}]):(this._logger.info(u.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"success",e),[2,{code:d(t)}])}}))}))}}),Object.defineProperty(t.prototype,"enableVideoTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.startCamera()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"errorCode: ".concat(d(t)),e),[2,{code:d(t)}]):(this._logger.info(u.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"success",e),[2,{code:d(t)}])}}))}))}}),Object.defineProperty(t.prototype,"disableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.stopMicrophone()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"errorCode: ".concat(d(t)),e),[2,{code:d(t)}]):(this._logger.info(u.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"success",e),[2,{code:d(t)}])}}))}))}}),Object.defineProperty(t.prototype,"enableAudioTrack",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t;return C(this,(function(l){switch(l.label){case 0:return e=this._logger.createTraceId(),this._logger.info(u.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.startMicrophone()];case 1:return(t=l.sent().code)!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"errorCode: ".concat(d(t)),e),[2,{code:d(t)}]):(this._logger.info(u.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"success",e),[2,{code:d(t)}])}}))}))}}),Object.defineProperty(t.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callId}}),Object.defineProperty(t.prototype,"getRTCSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?null:this._callPlusClient.getRTCSessionId()}}),Object.defineProperty(t.prototype,"getTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._targetId}}),Object.defineProperty(t.prototype,"getChannelId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._channelId}}),Object.defineProperty(t.prototype,"getConversationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._callType}}),Object.defineProperty(t.prototype,"getRemoteUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return[];var l=(null==t?void 0:t.getUserList())||[];return null==l?void 0:l.map((function(t){var l=t.userId,n=t.state;return{userId:l,state:c(n),isCaller:l===e.getCallerId(),isRemote:l!==e._context.getCurrentId()}}))}}),Object.defineProperty(t.prototype,"getUserState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._callPlusClient.getCurrentCallSession();if(this._callId!==(null==t?void 0:t.getCallId()))return exports.RCCallUserState.NONE;var l=null==t?void 0:t.getUserList().filter((function(t){return t.userId===e}))[0].state;return c(l)}}),Object.defineProperty(t.prototype,"getState",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return function(e){var t=null;switch(e){case s.RCCallPlusCallState.IDLE:t=exports.RCCallSessionState.END;break;case s.RCCallPlusCallState.CALLING:case s.RCCallPlusCallState.INVITED:case s.RCCallPlusCallState.RINGING:case s.RCCallPlusCallState.BUSYLINE_RINGING:case s.RCCallPlusCallState.BUSYLINE_WAIT:t=exports.RCCallSessionState.WAITING;break;case s.RCCallPlusCallState.CONNECTING:case s.RCCallPlusCallState.ONCALL:t=exports.RCCallSessionState.KEEPING;break;case s.RCCallPlusCallState.ENDED:case s.RCCallPlusCallState.NOANSWER:case s.RCCallPlusCallState.MISSED:case s.RCCallPlusCallState.CANCELED:case s.RCCallPlusCallState.DECLINED:case s.RCCallPlusCallState.ERROR:default:t=exports.RCCallSessionState.END}return t}(this._callId===(null==e?void 0:e.getCallId())?null==e?void 0:e.getState():s.RCCallPlusCallState.ENDED)}}),Object.defineProperty(t.prototype,"getCallerId",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callPlusClient.getCurrentCallSession();return this._callId!==(null==e?void 0:e.getCallId())?"":e.getCreatorUserId()}}),Object.defineProperty(t.prototype,"getMediaType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mediaType===s.RCCallPlusMediaType.AUDIO?exports.RCCallMediaType.AUDIO:exports.RCCallMediaType.AUDIO_VIDEO}}),Object.defineProperty(t.prototype,"__innerEndTranction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._mediaType=e,this._descendResolve[t]&&(this._descendResolve[t]({code:exports.RCCallErrorCode.SUCCESS}),delete this._descendResolve[t])}}),t}(a.EventEmitter),p=function(){function e(e,t,l){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"_callPlusClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_channelId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_session",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_sessionStartTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_mediaType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_audioConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_videoConfigBuilder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_hangupPushConfig",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_isSelfHangup",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_reportAppEventModule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._callPlusClient=l.callPlusClient,this._reportAppEventModule=new L(t),this._setCallPlusEventListener(),this._audioConfigBuilder=this._callPlusClient.createAudioConfigBuilder(),this._videoConfigBuilder=this._callPlusClient.createVideoConfigBuilder()}return Object.defineProperty(e.prototype,"_setCallPlusEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=0,l={},n={};this._callPlusClient.setCallPlusEventListener({onReceivedCall:function(t,l){return void 0===l&&(l="{}"),_(this,void 0,void 0,(function(){var n,r,o;return C(this,(function(i){return n=t.getCallId(),e._session?(e._callPlusClient.hangup(n,e._hangupPushConfig),[2]):(e._targetId=JSON.parse(l).targetId||"",e._channelId=JSON.parse(l).channelId||"",e._mediaType=t.getMediaType()===s.RCCallPlusMediaType.AUDIO?exports.RCCallMediaType.AUDIO:exports.RCCallMediaType.AUDIO_VIDEO,r=t.getCallType(),o=r===s.RCCallPlusType.MULTI?a.ConversationType.GROUP:a.ConversationType.PRIVATE,e._session=new N(n,e._callPlusClient,e._channelId,e._targetId,o,t.getMediaType(),e._context,e._logger,{callPushConfig:e._callPushConfig,hangupPushConfig:e._hangupPushConfig}),e._session.on(O.INNER_ON_SELF_HANGUP,(function(){e._isSelfHangup=!0})),e._options.onSession(e._session,JSON.parse(l).callLibExtra||""),[2])}))}))},onRemoteUserInvited:function(t,l,n){var r,o={userId:l},a=t.map((function(e){return{userId:e}}));e._listener?e._reportAppEventModule.onMemberModify(o,a,e._session):null===(r=e._session)||void 0===r||r.emit(O.INNER_ON_MEMBER_MODIFY,o,a,e._session)},onCallConnected:function(e){var t=e.getCallId();n[t]=!0},onCallTypeChanged:function(e,t){},onRemoteUserStateChanged:function(t,n,r,o){var a,i,E;return _(this,void 0,void 0,(function(){var _,R,u,c,d,L,S,N,p;return C(this,(function(C){return _={userId:n},R=[s.RCCallPlusSessionUserState.IDLE,s.RCCallPlusSessionUserState.DECLINED,s.RCCallPlusSessionUserState.MISSED,s.RCCallPlusSessionUserState.NO_ANSWER].includes(r),e._listener?(r===s.RCCallPlusSessionUserState.RINGING&&e._reportAppEventModule.onRinging(_,e._session),r===s.RCCallPlusSessionUserState.CONNECTING&&e._reportAppEventModule.onAccept(_,e._session),R&&e._reportAppEventModule.onHungup(_,I(o,e._isSelfHangup),e._session)):(r===s.RCCallPlusSessionUserState.RINGING&&(null===(a=e._session)||void 0===a||a.emit(O.INNER_ON_RINGING,_,e._session)),r===s.RCCallPlusSessionUserState.CONNECTING&&(null===(i=e._session)||void 0===i||i.emit(O.INNER_ON_ACCEPT,_,e._session)),R&&(null===(E=e._session)||void 0===E||E.emit(O.INNER_ON_HANGUP,_,I(o,e._isSelfHangup),e._session))),u=e._callPlusClient.getCurrentCallSession(),c=null==u?void 0:u.getCallType(),d=null==u?void 0:u.getUserList(),L=null==d?void 0:d.filter((function(t){return t.userId===e._context.getCurrentId()}))[0],S=null==d?void 0:d.filter((function(t){return t.userId!==e._context.getCurrentId()})),N=null==S?void 0:S.every((function(e){return e.state===s.RCCallPlusSessionUserState.IDLE})),p=(null==L?void 0:L.state)===s.RCCallPlusSessionUserState.ONCALL&&N,R&&c===s.RCCallPlusType.MULTI&&p&&(e._callPlusClient.hangup(),l[t]=o===s.RCCallPlusReason.MISSED?s.RCCallPlusReason.NO_ANSWER:o,e._isSelfHangup=!1),[2]}))}))},onCallEnded:function(r,o){return _(this,void 0,void 0,(function(){var a,s,i;return C(this,(function(_){return a=+new Date-t,s=r.getCallId(),i={conversationType:e._session.getConversationType(),channelId:e._session.getChannelId(),targetId:e._session.getTargetId(),mediaType:e._session.getMediaType(),beginTimestamp:e._sessionStartTime,endTimestamp:a,duration:n[s]?Math.ceil((a-e._sessionStartTime)/1e3):0,endReason:l[s]?I(l[s],e._isSelfHangup):I(o,e._isSelfHangup)},e._options.onSessionClose(e._session,i),e._session=null,e._sessionStartTime=0,delete l[s],delete n[s],[2]}))}))},onUserMediaAvailable:function(t,l){var n;return _(this,void 0,void 0,(function(){var r;return C(this,(function(o){return r=l===s.RCCallPlusMediaType.AUDIO?exports.RCCallMediaType.AUDIO:exports.RCCallMediaType.AUDIO_VIDEO,e._listener?e._reportAppEventModule.onTrackReady(t,r,e._session):null===(n=e._session)||void 0===n||n.emit(O.INNER_ON_TRACK_READY,t,r,e._session),[2]}))}))},onFetchRemoteMediaError:function(t,l){var n,r,o;e._listener?null===(r=(n=e._reportAppEventModule).onTrackSubscribeFail)||void 0===r||r.call(n,l,e._session):null===(o=e._session)||void 0===o||o.emit(O.INNER_ON_TRACK_SUBSCRIBE_FAIL,l,e._session)},onRemoteCameraStateChanged:function(t,l,n){var r,o={userId:l,muted:n,kind:"video",trackId:"".concat(l,"_RongCloudRTC_1")};e._listener?e._reportAppEventModule.onVideoMuteChange(o,e._session):null===(r=e._session)||void 0===r||r.emit(O.INNER_ON_VIDEO_MUTE_CHANGE,o,e._session)},onRemoteMicrophoneStateChanged:function(t,l,n){var r,o={userId:l,muted:n,kind:"audio",trackId:"".concat(l,"_RongCloudRTC_0")};e._listener?e._reportAppEventModule.onAudioMuteChange(o,e._session):null===(r=e._session)||void 0===r||r.emit(O.INNER_ON_AUDIO_MUTE_CHANGE,o,e._session)},onReceivedCallRecord:function(e){},onReceivedChangeMediaTypeRequest:function(t,l,n){e._callPlusClient.replyChangeMediaType(l,!0)},onReceivedChangeMediaTypeResult:function(t){var l,n;if(e._mediaType===exports.RCCallMediaType.AUDIO_VIDEO&&t.mediaType===s.RCCallPlusMediaType.AUDIO&&t.code===s.RCCallPlusMediaTypeChangeResult.SERVER_ALLOW_MEDIA_TYPE){var r={userId:t.userId};e._mediaType=exports.RCCallMediaType.AUDIO,null===(l=e._session)||void 0===l||l.__innerEndTranction(s.RCCallPlusMediaType.AUDIO,t.transactionId),e._listener?e._reportAppEventModule.onMediaModify(r,e._mediaType,e._session):null===(n=e._session)||void 0===n||n.emit(O.INNER_ON_MEDIA_MODIFY,r,e._mediaType,e._session,t.transactionId)}},onReceivedCallStartTime:function(l){e._sessionStartTime=l.callStartTime,t=+new Date-l.callStartTime},onReceivedCallFirstFrameTime:function(e,t){},onUserAudioLevelChanged:function(e,t){}})}}),Object.defineProperty(e.prototype,"registerUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._logger.error(u.L_CALL_CLIENT_REGISTER_USER_INFO_O,"`RCCallClient.registerUserInfo` has been deprecated.")}}),Object.defineProperty(e.prototype,"startCrossCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return _(this,void 0,void 0,(function(){return C(this,(function(e){return this._logger.error(u.L_CALL_CLIENT_START_CROSS_CALL_O,"`RCCallClient.startCrossCall` has been deprecated"),[2]}))}))}}),Object.defineProperty(e.prototype,"__startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var l=t.targetId,n=t.userIds,r=t.mediaType,o=void 0===r?exports.RCCallMediaType.AUDIO:r,i=t.listener,E=t.constraints,R=t.channelId,c=void 0===R?"":R,I=t.extra,L=void 0===I?"":I,S=t.bitrate;return _(this,void 0,void 0,(function(){var t,r,_,R,I,p,T,A,f,g,b,P,h,v,U=this;return C(this,(function(C){switch(C.label){case 0:return t=this._logger.createTraceId(),this._logger.info(u.L_CALL_CLIENT_CALL_T,JSON.stringify({targetId:l,userIds:n,mediaType:o,listener:Object.keys(i),constraints:E,channelId:c,extra:L,bitrate:S}),t),E&&(r=E.audio,_=E.video,(null==r?void 0:r.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(r.micphoneId),(null==r?void 0:r.sampleRate)&&this._audioConfigBuilder.setSampleRate(r.sampleRate),(null==_?void 0:_.cameraId)&&this._videoConfigBuilder.setDefaultCameraId(_.cameraId),(null==_?void 0:_.frameRate)&&this._videoConfigBuilder.setFrameRate(_.frameRate),(null==_?void 0:_.resolution)&&this._videoConfigBuilder.setVideoResolution(_.resolution)),S&&(r=S.audio,_=S.video,r&&this._audioConfigBuilder.setBitrate(r,r),_&&this._videoConfigBuilder.setBitrate(_.min,_.max)),R=this._audioConfigBuilder.build(),I=this._videoConfigBuilder.build(),this._callPlusClient.setAudioConfig(R),this._callPlusClient.setVideoConfig(I),this._targetId=l,this._listener=i,this._reportAppEventModule.registerEventListener(i),this._mediaType=o,p=o===exports.RCCallMediaType.AUDIO?s.RCCallPlusMediaType.AUDIO:s.RCCallPlusMediaType.AUDIO_VIDEO,T=e?s.RCCallPlusType.SINGLE:s.RCCallPlusType.MULTI,A=e?[l]:n,f=e?a.ConversationType.PRIVATE:a.ConversationType.GROUP,g=e?this._context.getCurrentId():l,b=JSON.stringify({callLibExtra:L,channelId:c,targetId:g,conversationType:f}),[4,this._callPlusClient.startCall(A,T,p,this._callPushConfig,b)];case 1:return P=C.sent(),h=P.code,v=P.callId,h!==s.RCCallPlusCode.SUCCESS?(this._logger.error(u.L_CALL_CLIENT_CALL_R,"errorCode: ".concat(d(h)),t),[2,{code:d(h)}]):(this._logger.info(u.L_CALL_CLIENT_CALL_R,"success",t),this._session=new N(v,this._callPlusClient,this._channelId,this._targetId,f,p,this._context,this._logger,{callPushConfig:this._callPushConfig,hangupPushConfig:this._hangupPushConfig}),this._session.on(O.INNER_ON_SELF_HANGUP,(function(){U._isSelfHangup=!0})),[2,{code:exports.RCCallErrorCode.SUCCESS,session:this._session}])}}))}))}}),Object.defineProperty(e.prototype,"call",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,l=e.mediaType,n=void 0===l?exports.RCCallMediaType.AUDIO:l,r=e.listener,o=e.constraints,a=e.channelId,s=void 0===a?"":a,i=e.extra,E=void 0===i?"":i,R=e.bitrate;return _(this,void 0,void 0,(function(){return C(this,(function(e){return[2,this.__startCall(!0,{targetId:t,userIds:[],mediaType:n,listener:r,constraints:o,channelId:s,extra:E,bitrate:R})]}))}))}}),Object.defineProperty(e.prototype,"callInGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,l=e.userIds,n=e.mediaType,r=void 0===n?exports.RCCallMediaType.AUDIO:n,o=e.listener,a=e.constraints,s=e.channelId,i=void 0===s?"":s,E=e.extra,R=void 0===E?"":E,u=e.bitrate;return _(this,void 0,void 0,(function(){return C(this,(function(e){return[2,this.__startCall(!1,{targetId:t,userIds:l,mediaType:r,listener:o,constraints:a,channelId:i,extra:R,bitrate:u})]}))}))}}),Object.defineProperty(e.prototype,"getJoinedRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return _(this,void 0,void 0,(function(){var e,t,l;return C(this,(function(n){switch(n.label){case 0:return[4,this._context.getRTCJoinedUserInfo(this._context.getCurrentId())];case 1:return e=n.sent(),t=e.code,l=e.data,t!==a.ErrorCode.SUCCESS?(this._logger.error(u.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E,t),[2,{code:exports.RCCallErrorCode.QUERY_JOINED_USER_INFO_ERROR}]):[2,{code:exports.RCCallErrorCode.SUCCESS,data:l}]}}))}))}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this._logger.info(u.L_CALL_CLIENT_SET_PUSH_CONFIG_O,JSON.stringify({callPushConfig:e,hangupPushConfig:t})),this._callPushConfig=e,this._hangupPushConfig=t,delete this._callPushConfig.pushContent,delete this._hangupPushConfig.pushContent}}),e}();exports.RCCallLanguage=void 0,(S=exports.RCCallLanguage||(exports.RCCallLanguage={})).ZH="zh",S.EN="en",a.VersionManage.add("callpluswrapper","2.1.4");var T={tag:"CallPlusWrapper",verify:function(e){return"browser"===e.tag},setup:function(e,t,l){var n=e.createLogger("CWrapper","RTC"),r=a.isUndefined(l.logOutputLevel)?a.LogL.WARN:l.logOutputLevel;return n.setOutputLevel(r),n.warn(u.L_CALL_PLUS_WRAPPER_INIT_O,"CallPlus Version: ".concat("2.1.4",", Commit: ").concat("c74dffcce2268e6dbf4f7ea8c4dfa7148c75398a")),new p(e,n,l)}};exports.RCCallClient=p,exports.RCCallSession=N,exports.installer=T;