@rongcloud/plugin-call-plus 2.1.3 → 2.1.5-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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 n,isUndefined as _,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 n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},N(e,t)};function d(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 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(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 S(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 A(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"}(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 f,p=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},g=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},b=function(e,t){var n=null;switch(e){case l.BUSYLINE_RINGING:n=t?C.BUSY_LINE:C.REMOTE_BUSY_LINE;break;case l.ON_DEVICE_DISABLE:n=C.REMOTE_GET_MEDIA_RESOURCE_ERROR;break;case l.ENDED:n=t?C.HANGUP:C.REMOTE_HANGUP;break;case l.NO_ANSWER:n=C.REMOTE_NO_RESPONSE;break;case l.MISSED:n=C.NO_RESPONSE;break;case l.CANCELLED:n=t?C.CANCEL:C.REMOTE_CANCEL;break;case l.DECLINED:n=t?C.REJECT:C.REMOTE_REJECT;break;case l.OTHER_CLIENT_ACCEPT:n=C.ACCEPT_BY_OTHER_CLIENT;break;case l.PUBLISH_ERR:n=C.PUBLISH_ERROR;break;case l.SUBSCRIBE_ERR:n=C.SUBSCRIBE_ERROR;break;case l.ACCEPT_CARRIER:n=t?C.ACCEPT_SYSTEM_CALL:C.REMOTE_ACCEPT_SYSTEM_CALL;break;case l.KICKED_BY_SERVER:n=C.KICKED_BY_SERVER;break;case l.CONNECTION_ERR:n=C.NETWORK_ERROR;break;case l.OTHER_CLIENT_JOINED:n=t?C.OTHER_CLIENT_JOINED_CALL:C.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case l.OTHER_CLIENT_IN_ROOM:n=C.OTHER_CLIENT_IN_CALL;break;case l.OTHER_CLIENT_HANGUP:n=C.HANGUP_BY_OTHER_CLIENT;break;case l.REMOTE_PUBLISH_ERROR:n=C.REMOTE_PUBLISH_ERROR;break;case l.REMOTE_SUBSCRIBE_ERROR:n=C.REMOTE_SUBSCRIBE_ERROR;break;case l.REMOTE_KICKED_BY_SERVER:n=C.REMOTE_KICKED_BY_SERVER;break;case l.REMOTE_CONNECTION_ERROR:n=C.REMOTE_NETWORK_ERROR;break;case l.ABNORMAL_END:n=t?C.NETWORK_ERROR:C.REMOTE_NETWORK_ERROR;break;case l.OTHER_CLIENT_CALLING:n=C.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case l.JOIN_ROOM_ERR:n=C.NETWORK_ERROR;break;case l.LOGOUT:n=C.HANGUP;break;case l.OTHER_CLIENT_LOGIN:n=C.NETWORK_ERROR;break;case l.REMOTE_JOIN_RTC_ERROR:n=C.REMOTE_NETWORK_ERROR;break;case l.REMOTE_LOGOUT:n=C.REMOTE_HANGUP;break;case l.REMOTE_OTHER_CLIENT_LOGIN:n=C.REMOTE_NETWORK_ERROR;break;case l.REMOTE_OTHER_JOINED_RTC:n=C.REMOTE_OTHER_CLIENT_JOINED_CALL;break;case l.REMOTE_OTHER_CLIENT_IN_RTC:n=C.REMOTE_OTHER_CLIENT_IN_CALL;break;default:n=C.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_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"}(f||(f={}));var h,v=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 d(this,void 0,void 0,(function(){var _,i;return T(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,A([],S(n),!1))];case 2:return r.sent(),[3,4];case 3:return i=r.sent(),this._logger.error(f.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(f.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(f.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(f.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(f.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(f.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(f.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(f.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(f.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(f.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(f.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(f.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"}(h||(h={}));var P,D=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: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 v(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)}(t,e),Object.defineProperty(t.prototype,"registerSessionListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.info(f.L_CALL_SESSION_REGISTER_SESSION_LISTENER_O,Object.keys(e).join(",")),this._reportAppEventModule.registerEventListener(e),this.on(h.INNER_ON_RINGING,(function(e,n){t._reportAppEventModule.onRinging(e,n)})),this.on(h.INNER_ON_ACCEPT,(function(e,n){t._reportAppEventModule.onAccept(e,n)})),this.on(h.INNER_ON_HANGUP,(function(e,n,_){t._reportAppEventModule.onHungup(e,n,_)})),this.on(h.INNER_ON_TRACK_READY,(function(e,n,_){t._reportAppEventModule.onTrackReady(e,n,_)})),this.on(h.INNER_ON_MEMBER_MODIFY,(function(e,n,_){t._reportAppEventModule.onMemberModify(e,n,_)})),this.on(h.INNER_ON_MEDIA_MODIFY,(function(e,n,_,i){var r,o;t._descendResolve[i]?(t._logger.info(f.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(h.INNER_ON_AUDIO_MUTE_CHANGE,(function(e,n){t._reportAppEventModule.onAudioMuteChange(e,n)})),this.on(h.INNER_ON_VIDEO_MUTE_CHANGE,(function(e,n){t._reportAppEventModule.onVideoMuteChange(e,n)})),this.on(h.INNER_ON_TRACK_SUBSCRIBE_FAIL,(function(e,n){var _,i;null===(i=(_=t._reportAppEventModule).onTrackSubscribeFail)||void 0===i||i.call(_,e,n)}))}}),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(f.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(f.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(f.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(g(i)),t),[2,{code:g(i)}]):(this._logger.info(f.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"success",t),[2,{code:g(i)}])}}))}))}}),Object.defineProperty(t.prototype,"invite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n;return void 0===t&&(t={}),d(this,void 0,void 0,(function(){var _,i;return T(this,(function(r){switch(r.label){case 0:return _=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_INVITE_T,JSON.stringify({userIds:e,options:t}),_),[4,this._callPlusClient.invite(e,null===(n=this._options)||void 0===n?void 0:n.callPushConfig,t.extra)];case 1:return(i=r.sent().code)!==a.SUCCESS?(this._logger.error(f.L_CALL_SESSION_INVITE_R,"errorCode: ".concat(g(i)),_),[2,{code:g(i)}]):(this._logger.info(f.L_CALL_SESSION_INVITE_R,"success",_),[2,{code:g(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 n=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_ACCEPT_T,JSON.stringify(e),n),e&&(_=e.audio,i=e.video,(null==_?void 0:_.micphoneId)&&this._audioConfigBuilder.setDefaultMicrophoneId(_.micphoneId),(null==_?void 0:_.sampleRate)&&this._audioConfigBuilder.setSampleRate(_.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(f.L_CALL_SESSION_ACCEPT_R,"errorCode: ".concat(g(l)),n),[2,{code:g(l)}]):(this._logger.info(f.L_CALL_SESSION_ACCEPT_R,"success",n),[2,{code:g(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,n;return T(this,(function(_){switch(_.label){case 0:return t=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_HUNGUP_T,"",t),this.emit(h.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(f.L_CALL_SESSION_HUNGUP_R,"errorCode: ".concat(g(n)),t),this._logger.info(f.L_CALL_SESSION_HUNGUP_R,"success",t),[2,{code:g(n)}]}}))}))}}),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(n){return e=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_DESCEND_ABILITY_T,"",e),[2,new Promise((function(n){t._callPlusClient.requestChangeMediaType(E.AUDIO).then((function(_){var i=_.code,r=_.transactionId;if(i!==a.SUCCESS)return t._logger.error(f.L_CALL_SESSION_DESCEND_ABILITY_R,"errorCode: ".concat(g(i)),e),void n({code:g(i)});t._logger.info(f.L_CALL_SESSION_DESCEND_ABILITY_P,"transactionId: ".concat(r),e),t._descendResolve[r]=n}))}))]}))}))}}),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(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.stopCamera()];case 1:return(t=n.sent().code)!==a.SUCCESS?(this._logger.error(f.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"errorCode: ".concat(g(t)),e),[2,{code:g(t)}]):(this._logger.info(f.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"success",e),[2,{code:g(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(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.startCamera()];case 1:return(t=n.sent().code)!==a.SUCCESS?(this._logger.error(f.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"errorCode: ".concat(g(t)),e),[2,{code:g(t)}]):(this._logger.info(f.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"success",e),[2,{code:g(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(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.stopMicrophone()];case 1:return(t=n.sent().code)!==a.SUCCESS?(this._logger.error(f.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"errorCode: ".concat(g(t)),e),[2,{code:g(t)}]):(this._logger.info(f.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"success",e),[2,{code:g(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(n){switch(n.label){case 0:return e=this._logger.createTraceId(),this._logger.info(f.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.startMicrophone()];case 1:return(t=n.sent().code)!==a.SUCCESS?(this._logger.error(f.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"errorCode: ".concat(g(t)),e),[2,{code:g(t)}]):(this._logger.info(f.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"success",e),[2,{code:g(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 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(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 n=null==t?void 0:t.getUserList().filter((function(t){return t.userId===e}))[0].state;return p(n)}}),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),U=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:n}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:_}),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=_.callPlusClient,this._reportAppEventModule=new v(n),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===_&&(_="{}"),d(this,void 0,void 0,(function(){var i,r,o;return T(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()===E.AUDIO?c.AUDIO:c.AUDIO_VIDEO,r=n.getCallType(),o=r===u.MULTI?t.GROUP:t.PRIVATE,e._session=new D(i,e._callPlusClient,e._channelId,e._targetId,o,n.getMediaType(),e._context,e._logger),e._session.on(h.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(h.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,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:n},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,b(o,e._isSelfHangup),e._session)):(i===r.RINGING&&(null===(a=e._session)||void 0===a||a.emit(h.INNER_ON_RINGING,c,e._session)),i===r.CONNECTING&&(null===(E=e._session)||void 0===E||E.emit(h.INNER_ON_ACCEPT,c,e._session)),I&&(null===(s=e._session)||void 0===s||s.emit(h.INNER_ON_HANGUP,c,b(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(),_[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-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]?b(_[a],e._isSelfHangup):b(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 d(this,void 0,void 0,(function(){var i;return T(this,(function(r){return i=n===E.AUDIO?c.AUDIO:c.AUDIO_VIDEO,e._listener?e._reportAppEventModule.onTrackReady(t,i,e._session):null===(_=e._session)||void 0===_||_.emit(h.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(h.INNER_ON_TRACK_SUBSCRIBE_FAIL,n,e._session)},onRemoteCameraStateChanged:function(t,n,_){var i,r={userId:n,muted:_,kind:""};e._listener?e._reportAppEventModule.onVideoMuteChange(r,e._session):null===(i=e._session)||void 0===i||i.emit(h.INNER_ON_VIDEO_MUTE_CHANGE,r,e._session)},onRemoteMicrophoneStateChanged:function(t,n,_){var i,r={userId:n,muted:_,kind:""};e._listener?e._reportAppEventModule.onAudioMuteChange(r,e._session):null===(i=e._session)||void 0===i||i.emit(h.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===c.AUDIO_VIDEO&&t.mediaType===E.AUDIO_VIDEO&&t.code===s.SERVER_ALLOW_MEDIA_TYPE){var _={userId:t.userId};e._mediaType=c.AUDIO,e._listener?e._reportAppEventModule.onMediaModify(_,e._mediaType,e._session):null===(n=e._session)||void 0===n||n.emit(h.INNER_ON_MEDIA_MODIFY,_,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.warn(f.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(f.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?c.AUDIO:r,l=n.listener,s=n.constraints,R=n.channelId,O=void 0===R?"":R,L=n.extra,C=void 0===L?"":L,N=n.bitrate;return d(this,void 0,void 0,(function(){var n,r,R,L,d,S,A,p,b,v,P,U,y,M,m=this;return T(this,(function(T){switch(T.label){case 0:return n=this._logger.createTraceId(),this._logger.info(f.L_CALL_CLIENT_CALL_T,JSON.stringify({targetId:_,userIds:i,mediaType:o,listener:Object.keys(l),constraints:s,channelId:O,extra:C,bitrate:N}),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=_,this._listener=l,this._reportAppEventModule.registerEventListener(l),this._mediaType=o,S=o===c.AUDIO?E.AUDIO:E.AUDIO_VIDEO,A=e?u.SINGLE:u.MULTI,p=e?[_]:i,b=e?this._context.getCurrentId():_,v=JSON.stringify({callLibExtra:C,channelId:O,targetId:b}),[4,this._callPlusClient.startCall(p,A,S,this._callPushConfig,v)];case 1:return P=T.sent(),U=P.code,y=P.callId,U!==a.SUCCESS?(this._logger.error(f.L_CALL_CLIENT_CALL_R,"errorCode: ".concat(g(U)),n),[2,{code:g(U)}]):(this._logger.info(f.L_CALL_CLIENT_CALL_R,"success",n),M=e?t.PRIVATE:t.GROUP,this._session=new D(y,this._callPlusClient,this._channelId,this._targetId,M,S,this._context,this._logger,{callPushConfig:this._callPushConfig,hangupPushConfig:this._hangupPushConfig}),this._session.on(h.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,n=e.mediaType,_=void 0===n?c.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 d(this,void 0,void 0,(function(){return T(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===_?c.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 d(this,void 0,void 0,(function(){return T(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 d(this,void 0,void 0,(function(){var e,t,_;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,_=e.data,t!==n.SUCCESS?(this._logger.error(f.L_CALL_CLIENT_GET_JOINED_ROOM_INFO_E,t),[2,{code:I.QUERY_JOINED_USER_INFO_ERROR}]):[2,{code:I.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(f.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={}));var y={tag:"CallPlusWrapper",verify:function(e){return"browser"===e.tag},setup:function(e,t,n){var r=e.createLogger("CallPlusWrapper","RTC"),o=_(n.logOutputLevel)?i.WARN:n.logOutputLevel;return r.setOutputLevel(o),r.warn(f.L_CALL_PLUS_WRAPPER_INIT_O,"CallPlus Version: ".concat("2.1.3",", Commit: ").concat("510a1938845462199b33310feeef72fe5c29f328")),new U(e,t,r,n)}};export{U as RCCallClient,C as RCCallEndReason,I as RCCallErrorCode,P as RCCallLanguage,c as RCCallMediaType,D as RCCallSession,O as RCCallSessionState,R as RCCallUserState,y 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 p,g=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"}(p||(p={}));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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.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(p.L_CALL_SESSION_CHANGE_AUDIO_DEVICE_R,"errorCode: ".concat(b(i)),t),[2,{code:b(i)}]):(this._logger.info(p.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(p.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(p.L_CALL_SESSION_INVITE_R,"errorCode: ".concat(b(a)),_),[2,{code:b(a)}]):(this._logger.info(p.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(p.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(p.L_CALL_SESSION_ACCEPT_R,"errorCode: ".concat(b(o)),t),[2,{code:b(o)}]):(this._logger.info(p.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(p.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(p.L_CALL_SESSION_HUNGUP_R,"errorCode: ".concat(b(t)),e):this._logger.info(p.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(p.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(p.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(p.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(p.L_CALL_SESSION_DISABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.stopCamera()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(p.L_CALL_SESSION_DISABLE_VIDEO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(p.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(p.L_CALL_SESSION_ENABLE_VIDEO_TRACK_T,"",e),[4,this._callPlusClient.startCamera()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(p.L_CALL_SESSION_ENABLE_VIDEO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(p.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(p.L_CALL_SESSION_DISABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.stopMicrophone()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(p.L_CALL_SESSION_DISABLE_AUDIO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(p.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(p.L_CALL_SESSION_ENABLE_AUDIO_TRACK_T,"",e),[4,this._callPlusClient.startMicrophone()];case 1:return(t=n.sent().code)!==l.SUCCESS?(this._logger.error(p.L_CALL_SESSION_ENABLE_AUDIO_TRACK_R,"errorCode: ".concat(b(t)),e),[2,{code:b(t)}]):(this._logger.info(p.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:g(_),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 g(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(p.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(p.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,g,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(p.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,g=e?t.PRIVATE:t.GROUP,h=e?this._context.getCurrentId():_,D=JSON.stringify({callLibExtra:L,channelId:O,targetId:h,conversationType:g}),[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(p.L_CALL_CLIENT_CALL_R,"errorCode: ".concat(b(y)),n),[2,{code:b(y)}]):(this._logger.info(p.L_CALL_CLIENT_CALL_R,"success",n),this._session=new U(M,this._callPlusClient,this._channelId,this._targetId,g,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(p.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(p.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.5-alpha.1");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(p.L_CALL_PLUS_WRAPPER_INIT_O,"CallPlus Version: ".concat("2.1.5-alpha.1",", Commit: ").concat("56d103bb664bf42606d69da406331b37e6e1a112")),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};