From 360c1bb977f5eb77046e72f0a1b5b67a90b935ae Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Fri, 12 Jan 2024 09:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pages/yishi/chat/index.js | 8 + TUICallKit/README.md | 53 + TUICallKit/TUICallKit/TUICallKit.js | 199 ++ TUICallKit/TUICallKit/TUICallKit.json | 9 + TUICallKit/TUICallKit/TUICallKit.wxml | 29 + TUICallKit/TUICallKit/TUICallKit.wxss | 10 + .../component/GroupCall/GroupCall.js | 116 + .../component/GroupCall/GroupCall.json | 4 + .../component/GroupCall/GroupCall.wxml | 285 ++ .../component/GroupCall/GroupCall.wxss | 754 +++++ .../component/SingleCall/SingleCall.js | 110 + .../component/SingleCall/SingleCall.json | 4 + .../component/SingleCall/SingleCall.wxml | 247 ++ .../component/SingleCall/SingleCall.wxss | 511 +++ .../CallService/bellContext.d.ts | 15 + .../TUICallService/CallService/bellContext.js | 106 + .../TUICallService/CallService/index.d.ts | 97 + .../TUICallService/CallService/index.js | 1147 +++++++ .../CallService/miniProgram.d.ts | 6 + .../TUICallService/CallService/miniProgram.js | 76 + .../TUICallService/CallService/utils.d.ts | 9 + .../TUICallService/CallService/utils.js | 167 + .../TUICallService/TUIGlobal/tuiGlobal.d.ts | 21 + .../TUICallService/TUIGlobal/tuiGlobal.js | 40 + .../TUICallService/TUIStore/callStore.d.ts | 8 + .../TUICallService/TUIStore/callStore.js | 62 + .../TUICallService/TUIStore/tuiStore.d.ts | 50 + .../TUICallService/TUIStore/tuiStore.js | 155 + TUICallKit/TUICallService/const/call.d.ts | 93 + TUICallKit/TUICallService/const/call.js | 104 + TUICallKit/TUICallService/const/error.d.ts | 2 + TUICallKit/TUICallService/const/error.js | 22 + TUICallKit/TUICallService/const/index.d.ts | 12 + TUICallKit/TUICallService/const/index.js | 60 + TUICallKit/TUICallService/const/log.d.ts | 7 + TUICallKit/TUICallService/const/log.js | 13 + TUICallKit/TUICallService/index.d.ts | 5 + TUICallKit/TUICallService/index.js | 44 + .../interface/ICallService.d.ts | 93 + .../TUICallService/interface/ICallService.js | 2 + .../TUICallService/interface/ICallStore.d.ts | 33 + .../TUICallService/interface/ICallStore.js | 2 + .../TUICallService/interface/ITUIGlobal.d.ts | 36 + .../TUICallService/interface/ITUIGlobal.js | 2 + .../TUICallService/interface/ITUIStore.d.ts | 75 + .../TUICallService/interface/ITUIStore.js | 2 + .../TUICallService/interface/index.d.ts | 4 + TUICallKit/TUICallService/interface/index.js | 20 + TUICallKit/TUICallService/locales/en.d.ts | 90 + TUICallKit/TUICallService/locales/en.js | 93 + TUICallKit/TUICallService/locales/index.d.ts | 10 + TUICallKit/TUICallService/locales/index.js | 51 + TUICallKit/TUICallService/locales/ja_JP.d.ts | 85 + TUICallKit/TUICallService/locales/ja_JP.js | 88 + TUICallKit/TUICallService/locales/zh-cn.d.ts | 89 + TUICallKit/TUICallService/locales/zh-cn.js | 92 + .../TUICallService/serve/callManager.d.ts | 11 + .../TUICallService/serve/callManager.js | 133 + .../TUICallService/utils/common-utils.d.ts | 53 + .../TUICallService/utils/common-utils.js | 249 ++ TUICallKit/TUICallService/utils/env.d.ts | 10 + TUICallKit/TUICallService/utils/env.js | 39 + TUICallKit/TUICallService/utils/index.d.ts | 1 + TUICallKit/TUICallService/utils/index.js | 33 + TUICallKit/TUICallService/utils/is-empty.d.ts | 2 + TUICallKit/TUICallService/utils/is-empty.js | 38 + TUICallKit/TUICallService/utils/timer.d.ts | 64 + TUICallKit/TUICallService/utils/timer.js | 154 + .../utils/validate/avoidRepeatedCall.d.ts | 10 + .../utils/validate/avoidRepeatedCall.js | 49 + .../TUICallService/utils/validate/index.d.ts | 4 + .../TUICallService/utils/validate/index.js | 9 + .../utils/validate/validateConfig.d.ts | 173 + .../utils/validate/validateConfig.js | 190 ++ .../utils/validate/validateParams.d.ts | 1 + .../utils/validate/validateParams.js | 86 + TUICallKit/adapter-vue.d.ts | 2 + TUICallKit/adapter-vue.js | 23 + TUICallKit/debug/GenerateTestUserSig-es.js | 63 + .../debug/lib-generate-test-usersig-es.min.js | 2 + TUICallKit/index.d.ts | 3 + TUICallKit/index.js | 17 + TUICallKit/package.json | 40 + TUICallKit/pages/globalCall/globalCall.js | 4 + TUICallKit/pages/globalCall/globalCall.json | 7 + TUICallKit/pages/globalCall/globalCall.wxml | 3 + .../pages/globalCall/globalCall.wxss | 0 .../static/audio-false.png | Bin .../static/audio-true.png | Bin .../static/camera-false.png | Bin .../static/camera-true.png | Bin .../static/default_avatar.png | Bin .../static/dialing.png | Bin .../static/hangup.png | Bin .../static/loading.png | Bin TUICallKit/static/phone_dialing.mp3 | Bin 0 -> 9178 bytes TUICallKit/static/phone_ringing.mp3 | Bin 0 -> 8752 bytes .../static/speaker-false.png | Bin .../static/speaker-true.png | Bin .../static/switch_camera.png | Bin .../static/swtich-camera.png | Bin .../static/trans.png | Bin .../MessageElements/CustomMessage/index.wxml | 2 +- .../TUIChat/components/MessageInput/index.js | 35 + .../components/MessageInput/index.wxml | 1 + .../TUIChat/components/MessageList/index.js | 59 + TUIKit/components/TUIChat/index.wxml | 1 + app.js | 19 +- app.json | 10 + .../@tencentcloud/chat-uikit-wechat/index.js | 13 + .../chat-uikit-wechat/index.js.map | 1 + miniprogram_npm/@tencentcloud/chat/index.js | 14 + .../@tencentcloud/chat/index.js.map | 1 + .../@tencentcloud/tui-core/index.js | 14 + .../@tencentcloud/tui-core/index.js.map | 1 + .../tim-profanity-filter-plugin/index.js | 28 + .../tim-profanity-filter-plugin/index.js.map | 1 + miniprogram_npm/tim-upload-plugin/index.js | 14 + .../tim-upload-plugin/index.js.map | 1 + miniprogram_npm/tim-wx-sdk/index.js | 14 + miniprogram_npm/tim-wx-sdk/index.js.map | 1 + miniprogram_npm/trtc-wx-sdk/index.js | 15 + miniprogram_npm/trtc-wx-sdk/index.js.map | 1 + miniprogram_npm/tsignaling-wx/index.js | 22 + miniprogram_npm/tsignaling-wx/index.js.map | 1 + miniprogram_npm/tuicall-engine-wx/index.js | 22 + .../tuicall-engine-wx/index.js.map | 1 + node_modules/.package-lock.json | 102 + .../@tencentcloud/call-uikit-wechat/README.md | 31 +- .../TUICallKit/TUICallKit.js | 815 +---- .../TUICallKit/TUICallKit.json | 6 +- .../TUICallKit/TUICallKit.wxml | 71 +- .../TUICallKit/TUICallKit.wxss | 23 +- .../component/GroupCall/GroupCall.js | 116 + .../component/GroupCall/GroupCall.json | 4 + .../component/GroupCall/GroupCall.wxml | 285 ++ .../component/GroupCall/GroupCall.wxss | 754 +++++ .../component/SingleCall/SingleCall.js | 107 + .../component/SingleCall/SingleCall.json | 4 + .../component/SingleCall/SingleCall.wxml | 172 + .../component/SingleCall/SingleCall.wxss | 508 +++ .../CallService/bellContext.d.ts | 15 + .../TUICallService/CallService/bellContext.js | 106 + .../TUICallService/CallService/index.d.ts | 97 + .../TUICallService/CallService/index.js | 1147 +++++++ .../CallService/miniProgram.d.ts | 6 + .../TUICallService/CallService/miniProgram.js | 76 + .../TUICallService/CallService/utils.d.ts | 9 + .../TUICallService/CallService/utils.js | 167 + .../TUICallService/TUIGlobal/tuiGlobal.d.ts | 21 + .../TUICallService/TUIGlobal/tuiGlobal.js | 40 + .../TUICallService/TUIStore/callStore.d.ts | 8 + .../TUICallService/TUIStore/callStore.js | 62 + .../TUICallService/TUIStore/tuiStore.d.ts | 50 + .../TUICallService/TUIStore/tuiStore.js | 155 + .../TUICallService/const/call.d.ts | 93 + .../TUICallService/const/call.js | 104 + .../TUICallService/const/error.d.ts | 2 + .../TUICallService/const/error.js | 22 + .../TUICallService/const/index.d.ts | 12 + .../TUICallService/const/index.js | 60 + .../TUICallService/const/log.d.ts | 7 + .../TUICallService/const/log.js | 13 + .../TUICallService/index.d.ts | 5 + .../call-uikit-wechat/TUICallService/index.js | 44 + .../interface/ICallService.d.ts | 93 + .../TUICallService/interface/ICallService.js | 2 + .../TUICallService/interface/ICallStore.d.ts | 33 + .../TUICallService/interface/ICallStore.js | 2 + .../TUICallService/interface/ITUIGlobal.d.ts | 36 + .../TUICallService/interface/ITUIGlobal.js | 2 + .../TUICallService/interface/ITUIStore.d.ts | 75 + .../TUICallService/interface/ITUIStore.js | 2 + .../TUICallService/interface/index.d.ts | 4 + .../TUICallService/interface/index.js | 20 + .../TUICallService/locales/en.d.ts | 90 + .../TUICallService/locales/en.js | 93 + .../TUICallService/locales/index.d.ts | 10 + .../TUICallService/locales/index.js | 51 + .../TUICallService/locales/ja_JP.d.ts | 85 + .../TUICallService/locales/ja_JP.js | 88 + .../TUICallService/locales/zh-cn.d.ts | 89 + .../TUICallService/locales/zh-cn.js | 92 + .../TUICallService/serve/callManager.d.ts | 11 + .../TUICallService/serve/callManager.js | 133 + .../TUICallService/utils/common-utils.d.ts | 53 + .../TUICallService/utils/common-utils.js | 249 ++ .../TUICallService/utils/env.d.ts | 10 + .../TUICallService/utils/env.js | 39 + .../TUICallService/utils/index.d.ts | 1 + .../TUICallService/utils/index.js | 33 + .../TUICallService/utils/is-empty.d.ts | 2 + .../TUICallService/utils/is-empty.js | 38 + .../TUICallService/utils/timer.d.ts | 64 + .../TUICallService/utils/timer.js | 154 + .../utils/validate/avoidRepeatedCall.d.ts | 10 + .../utils/validate/avoidRepeatedCall.js | 49 + .../TUICallService/utils/validate/index.d.ts | 4 + .../TUICallService/utils/validate/index.js | 9 + .../utils/validate/validateConfig.d.ts | 173 + .../utils/validate/validateConfig.js | 190 ++ .../utils/validate/validateParams.d.ts | 1 + .../utils/validate/validateParams.js | 86 + .../call-uikit-wechat/adapter-vue.d.ts | 2 + .../call-uikit-wechat/adapter-vue.js | 23 + .../debug/GenerateTestUserSig-es.js | 63 + .../debug/lib-generate-test-usersig-es.min.js | 2 + .../call-uikit-wechat/index.d.ts | 3 + .../@tencentcloud/call-uikit-wechat/index.js | 17 + .../call-uikit-wechat/package.json | 77 +- .../pages/globalCall/globalCall.js | 4 + .../pages/globalCall/globalCall.json | 7 + .../pages/globalCall/globalCall.wxml | 3 + .../pages/globalCall/globalCall.wxss | 0 .../call-uikit-wechat/static/audio-false.png | Bin 0 -> 1285 bytes .../call-uikit-wechat/static/audio-true.png | Bin 0 -> 1176 bytes .../call-uikit-wechat/static/camera-false.png | Bin 0 -> 1017 bytes .../call-uikit-wechat/static/camera-true.png | Bin 0 -> 974 bytes .../static/default_avatar.png | Bin 0 -> 1727 bytes .../call-uikit-wechat/static/dialing.png | Bin 0 -> 2197 bytes .../call-uikit-wechat/static/hangup.png | Bin 0 -> 1262 bytes .../call-uikit-wechat/static/loading.png | Bin 0 -> 1367 bytes .../static/phone_dialing.mp3 | Bin 0 -> 9178 bytes .../static/phone_ringing.mp3 | Bin 0 -> 8752 bytes .../static/speaker-false.png | Bin 0 -> 821 bytes .../call-uikit-wechat/static/speaker-true.png | Bin 0 -> 1073 bytes .../static/switch_camera.png | Bin 0 -> 799 bytes .../static/swtich-camera.png | Bin 0 -> 1218 bytes .../call-uikit-wechat/static/trans.png | Bin 0 -> 714 bytes .../@tencentcloud/chat-uikit-wechat/index.js | 4 +- .../@tencentcloud/call-uikit-wechat/README.md | 50 + .../TUICallKit/TUICallKit.js | 927 ++++++ .../TUICallKit/TUICallKit.json | 11 + .../TUICallKit/TUICallKit.wxml | 52 + .../TUICallKit/TUICallKit.wxss | 25 + .../TUICallKit/component/calling/calling.js | 58 +- .../TUICallKit/component/calling/calling.json | 0 .../TUICallKit/component/calling/calling.wxml | 11 +- .../TUICallKit/component/calling/calling.wxss | 16 + .../component/connected/connected.js | 8 + .../component/connected/connected.json | 0 .../component/connected/connected.wxml | 0 .../component/connected/connected.wxss | 0 .../component/groupCalling/groupCalling.js | 57 +- .../component/groupCalling/groupCalling.json | 0 .../component/groupCalling/groupCalling.wxml | 14 +- .../component/groupCalling/groupCalling.wxss | 14 + .../groupConnected/groupConnected.js | 8 + .../groupConnected/groupConnected.json | 0 .../groupConnected/groupConnected.wxml | 0 .../groupConnected/groupConnected.wxss | 0 .../TUICallKit/pages/globalCall/globalCall.js | 5 + .../pages/globalCall/globalCall.json | 0 .../pages/globalCall/globalCall.wxml | 0 .../pages/globalCall/globalCall.wxss | 0 .../pages/globalCall/globalCall_uni.vue | 5 + .../TUICallKit/serve/bellContext.js | 49 + .../TUICallKit/serve/callManager.js | 54 +- .../TUICallKit/static/audio-false.png | Bin 0 -> 1285 bytes .../TUICallKit/static/audio-true.png | Bin 0 -> 1176 bytes .../TUICallKit/static/camera-false.png | Bin 0 -> 1017 bytes .../TUICallKit/static/camera-true.png | Bin 0 -> 974 bytes .../TUICallKit/static/default_avatar.png | Bin 0 -> 1727 bytes .../TUICallKit/static/dialing.png | Bin 0 -> 2197 bytes .../TUICallKit/static/hangup.png | Bin 0 -> 1262 bytes .../TUICallKit/static/loading.png | Bin 0 -> 1367 bytes .../TUICallKit/static/phone_dialing.mp3 | Bin 0 -> 9178 bytes .../TUICallKit/static/phone_ringing.mp3 | Bin 0 -> 8752 bytes .../TUICallKit/static/speaker-false.png | Bin 0 -> 821 bytes .../TUICallKit/static/speaker-true.png | Bin 0 -> 1073 bytes .../TUICallKit/static/switch_camera.png | Bin 0 -> 799 bytes .../TUICallKit/static/swtich-camera.png | Bin 0 -> 1218 bytes .../TUICallKit/static/trans.png | Bin 0 -> 714 bytes .../TUICallKit/utils/commom.js | 35 + .../TUICallKit/utils/constants.js | 6 + .../@tencentcloud/call-uikit-wechat/index.js | 0 .../call-uikit-wechat/package.json | 21 + node_modules/@tencentcloud/chat/README.md | 206 ++ node_modules/@tencentcloud/chat/index.d.ts | 2959 +++++++++++++++++ node_modules/@tencentcloud/chat/index.es.js | 1 + node_modules/@tencentcloud/chat/index.js | 1 + .../chat/modules/follow-module.js | 1 + .../chat/modules/group-module.js | 1 + .../chat/modules/relationship-module.js | 1 + .../chat/modules/signaling-module.js | 1 + node_modules/@tencentcloud/chat/package.json | 13 + .../@tencentcloud/tui-core/index.d.ts | 188 ++ node_modules/@tencentcloud/tui-core/index.js | 1 + .../@tencentcloud/tui-core/package.json | 26 + .../tim-profanity-filter-plugin/README.md | 37 + .../tim-profanity-filter-plugin/index.js | 15 + .../tim-profanity-filter-plugin/package.json | 12 + node_modules/tim-upload-plugin/README.md | 80 + node_modules/tim-upload-plugin/index.d.ts | 5 + node_modules/tim-upload-plugin/index.js | 1 + node_modules/tim-upload-plugin/package.json | 13 + node_modules/tuicall-engine-wx/package.json | 47 +- .../tuicall-engine-wx/tuicall-engine-wx.js | 10 +- package-lock.json | 166 +- package.json | 1 + project.private.config.json | 3 +- 301 files changed, 19221 insertions(+), 986 deletions(-) create mode 100644 TUICallKit/README.md create mode 100644 TUICallKit/TUICallKit/TUICallKit.js create mode 100644 TUICallKit/TUICallKit/TUICallKit.json create mode 100644 TUICallKit/TUICallKit/TUICallKit.wxml create mode 100644 TUICallKit/TUICallKit/TUICallKit.wxss create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.js create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.json create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.js create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.json create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss create mode 100644 TUICallKit/TUICallService/CallService/bellContext.d.ts create mode 100644 TUICallKit/TUICallService/CallService/bellContext.js create mode 100644 TUICallKit/TUICallService/CallService/index.d.ts create mode 100644 TUICallKit/TUICallService/CallService/index.js create mode 100644 TUICallKit/TUICallService/CallService/miniProgram.d.ts create mode 100644 TUICallKit/TUICallService/CallService/miniProgram.js create mode 100644 TUICallKit/TUICallService/CallService/utils.d.ts create mode 100644 TUICallKit/TUICallService/CallService/utils.js create mode 100644 TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts create mode 100644 TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js create mode 100644 TUICallKit/TUICallService/TUIStore/callStore.d.ts create mode 100644 TUICallKit/TUICallService/TUIStore/callStore.js create mode 100644 TUICallKit/TUICallService/TUIStore/tuiStore.d.ts create mode 100644 TUICallKit/TUICallService/TUIStore/tuiStore.js create mode 100644 TUICallKit/TUICallService/const/call.d.ts create mode 100644 TUICallKit/TUICallService/const/call.js create mode 100644 TUICallKit/TUICallService/const/error.d.ts create mode 100644 TUICallKit/TUICallService/const/error.js create mode 100644 TUICallKit/TUICallService/const/index.d.ts create mode 100644 TUICallKit/TUICallService/const/index.js create mode 100644 TUICallKit/TUICallService/const/log.d.ts create mode 100644 TUICallKit/TUICallService/const/log.js create mode 100644 TUICallKit/TUICallService/index.d.ts create mode 100644 TUICallKit/TUICallService/index.js create mode 100644 TUICallKit/TUICallService/interface/ICallService.d.ts create mode 100644 TUICallKit/TUICallService/interface/ICallService.js create mode 100644 TUICallKit/TUICallService/interface/ICallStore.d.ts create mode 100644 TUICallKit/TUICallService/interface/ICallStore.js create mode 100644 TUICallKit/TUICallService/interface/ITUIGlobal.d.ts create mode 100644 TUICallKit/TUICallService/interface/ITUIGlobal.js create mode 100644 TUICallKit/TUICallService/interface/ITUIStore.d.ts create mode 100644 TUICallKit/TUICallService/interface/ITUIStore.js create mode 100644 TUICallKit/TUICallService/interface/index.d.ts create mode 100644 TUICallKit/TUICallService/interface/index.js create mode 100644 TUICallKit/TUICallService/locales/en.d.ts create mode 100644 TUICallKit/TUICallService/locales/en.js create mode 100644 TUICallKit/TUICallService/locales/index.d.ts create mode 100644 TUICallKit/TUICallService/locales/index.js create mode 100644 TUICallKit/TUICallService/locales/ja_JP.d.ts create mode 100644 TUICallKit/TUICallService/locales/ja_JP.js create mode 100644 TUICallKit/TUICallService/locales/zh-cn.d.ts create mode 100644 TUICallKit/TUICallService/locales/zh-cn.js create mode 100644 TUICallKit/TUICallService/serve/callManager.d.ts create mode 100644 TUICallKit/TUICallService/serve/callManager.js create mode 100644 TUICallKit/TUICallService/utils/common-utils.d.ts create mode 100644 TUICallKit/TUICallService/utils/common-utils.js create mode 100644 TUICallKit/TUICallService/utils/env.d.ts create mode 100644 TUICallKit/TUICallService/utils/env.js create mode 100644 TUICallKit/TUICallService/utils/index.d.ts create mode 100644 TUICallKit/TUICallService/utils/index.js create mode 100644 TUICallKit/TUICallService/utils/is-empty.d.ts create mode 100644 TUICallKit/TUICallService/utils/is-empty.js create mode 100644 TUICallKit/TUICallService/utils/timer.d.ts create mode 100644 TUICallKit/TUICallService/utils/timer.js create mode 100644 TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js create mode 100644 TUICallKit/TUICallService/utils/validate/index.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/index.js create mode 100644 TUICallKit/TUICallService/utils/validate/validateConfig.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/validateConfig.js create mode 100644 TUICallKit/TUICallService/utils/validate/validateParams.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/validateParams.js create mode 100644 TUICallKit/adapter-vue.d.ts create mode 100644 TUICallKit/adapter-vue.js create mode 100644 TUICallKit/debug/GenerateTestUserSig-es.js create mode 100644 TUICallKit/debug/lib-generate-test-usersig-es.min.js create mode 100644 TUICallKit/index.d.ts create mode 100644 TUICallKit/index.js create mode 100644 TUICallKit/package.json create mode 100644 TUICallKit/pages/globalCall/globalCall.js create mode 100644 TUICallKit/pages/globalCall/globalCall.json create mode 100644 TUICallKit/pages/globalCall/globalCall.wxml rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/pages/globalCall/globalCall.wxss (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/audio-false.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/audio-true.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/camera-false.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/camera-true.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/default_avatar.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/dialing.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/hangup.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/loading.png (100%) create mode 100644 TUICallKit/static/phone_dialing.mp3 create mode 100644 TUICallKit/static/phone_ringing.mp3 rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/speaker-false.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/speaker-true.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/switch_camera.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/swtich-camera.png (100%) rename {node_modules/@tencentcloud/call-uikit-wechat/TUICallKit => TUICallKit}/static/trans.png (100%) create mode 100644 miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js create mode 100644 miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js.map create mode 100644 miniprogram_npm/@tencentcloud/chat/index.js create mode 100644 miniprogram_npm/@tencentcloud/chat/index.js.map create mode 100644 miniprogram_npm/@tencentcloud/tui-core/index.js create mode 100644 miniprogram_npm/@tencentcloud/tui-core/index.js.map create mode 100644 miniprogram_npm/tim-profanity-filter-plugin/index.js create mode 100644 miniprogram_npm/tim-profanity-filter-plugin/index.js.map create mode 100644 miniprogram_npm/tim-upload-plugin/index.js create mode 100644 miniprogram_npm/tim-upload-plugin/index.js.map create mode 100644 miniprogram_npm/tim-wx-sdk/index.js create mode 100644 miniprogram_npm/tim-wx-sdk/index.js.map create mode 100644 miniprogram_npm/trtc-wx-sdk/index.js create mode 100644 miniprogram_npm/trtc-wx-sdk/index.js.map create mode 100644 miniprogram_npm/tsignaling-wx/index.js create mode 100644 miniprogram_npm/tsignaling-wx/index.js.map create mode 100644 miniprogram_npm/tuicall-engine-wx/index.js create mode 100644 miniprogram_npm/tuicall-engine-wx/index.js.map create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.json create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.wxml create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.wxss create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.json create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxml create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxss create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/debug/GenerateTestUserSig-es.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/debug/lib-generate-test-usersig-es.min.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/index.d.ts create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/index.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.js create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.json create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxml create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxss create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/audio-false.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/audio-true.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/camera-false.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/camera-true.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/default_avatar.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/dialing.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/hangup.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/loading.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/phone_dialing.mp3 create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/phone_ringing.mp3 create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/speaker-false.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/speaker-true.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/switch_camera.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/swtich-camera.png create mode 100644 node_modules/@tencentcloud/call-uikit-wechat/static/trans.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/README.md create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.js create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.json create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxml create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxss rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/calling/calling.js (52%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/calling/calling.json (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/calling/calling.wxml (90%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/calling/calling.wxss (94%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/connected/connected.js (93%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/connected/connected.json (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/connected/connected.wxml (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/connected/connected.wxss (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.js (52%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.json (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxml (94%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss (96%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js (94%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.json (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxml (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxss (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js (73%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.json (100%) rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxml (100%) create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxss rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue (66%) create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/serve/bellContext.js rename node_modules/@tencentcloud/{ => chat-uikit-wechat/node_modules/@tencentcloud}/call-uikit-wechat/TUICallKit/serve/callManager.js (73%) create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/audio-false.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/audio-true.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/camera-false.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/camera-true.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/default_avatar.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/dialing.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/hangup.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/loading.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/phone_dialing.mp3 create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/phone_ringing.mp3 create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/speaker-false.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/speaker-true.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/switch_camera.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/swtich-camera.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/trans.png create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/utils/commom.js create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/utils/constants.js create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/index.js create mode 100644 node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/package.json create mode 100644 node_modules/@tencentcloud/chat/README.md create mode 100644 node_modules/@tencentcloud/chat/index.d.ts create mode 100644 node_modules/@tencentcloud/chat/index.es.js create mode 100644 node_modules/@tencentcloud/chat/index.js create mode 100644 node_modules/@tencentcloud/chat/modules/follow-module.js create mode 100644 node_modules/@tencentcloud/chat/modules/group-module.js create mode 100644 node_modules/@tencentcloud/chat/modules/relationship-module.js create mode 100644 node_modules/@tencentcloud/chat/modules/signaling-module.js create mode 100644 node_modules/@tencentcloud/chat/package.json create mode 100644 node_modules/@tencentcloud/tui-core/index.d.ts create mode 100644 node_modules/@tencentcloud/tui-core/index.js create mode 100644 node_modules/@tencentcloud/tui-core/package.json create mode 100644 node_modules/tim-profanity-filter-plugin/README.md create mode 100644 node_modules/tim-profanity-filter-plugin/index.js create mode 100644 node_modules/tim-profanity-filter-plugin/package.json create mode 100644 node_modules/tim-upload-plugin/README.md create mode 100644 node_modules/tim-upload-plugin/index.d.ts create mode 100644 node_modules/tim-upload-plugin/index.js create mode 100644 node_modules/tim-upload-plugin/package.json diff --git a/Pages/yishi/chat/index.js b/Pages/yishi/chat/index.js index fa2efc9..dbf00fb 100644 --- a/Pages/yishi/chat/index.js +++ b/Pages/yishi/chat/index.js @@ -57,6 +57,14 @@ Page({ this.setData({ baseInfo: response.data }) + let promise=wx.$TUIKit.getUserProfile({ + userIDList: [response.data.patient_user_id] + }); + promise.then(function(imResponse) { + wx.setStorageSync('patient_avatar',imResponse.data[0].avatar); + }).catch(function(imError) { + console.warn('getUserProfile error:', imError); // 获取其他用户资料失败的相关信息 + }); }).then(res => { this.initChat(); }).catch(errors => {console.error(errors);}) diff --git a/TUICallKit/README.md b/TUICallKit/README.md new file mode 100644 index 0000000..f3ec28e --- /dev/null +++ b/TUICallKit/README.md @@ -0,0 +1,53 @@ +# TUICallkit 组件接入说明 +TUICallkit 是小程序音视频通话 UI 组件,通过编写几行代码,就可以为您的小程序应用添加音视频通话功能。 + +**低于 v3.0.4 版本,参考的 [readme](https://www.npmjs.com/package/@tencentcloud/call-uikit-wechat/v/1.4.4)。** + +## 环境准备 + +- 微信 App iOS 最低版本要求:8.0.40 +- 微信 App Android 最低版本要求:8.0.40 +- 小程序基础库最低版本要求:2.10.0 +- 由于小程序测试号不具备 live-pusher 和 live-player 的使用权限,请使用企业小程序账号申请相关权限进行开发 +- 由于微信开发者工具不支持原生组件(即 live-pusher 和 live-player 标签),需要在真机上进行运行体验 + +## 特性 +- ⚡️ 功能全面 —— 支持单人/多人/音频/视频通话、支持视频转音频通话、支持自由选择通话设备 +- 🎨 灵活样式 —— 组件开源,可复用逻辑,自定义 UI 样式 +- 🛠 优秀生态 —— 与 [TUIKit](https://cloud.tencent.com/document/product/269/79737) 协同使用,可以在 [TIM](https://cloud.tencent.com/document/product/269) 会话中直接发起音视频通话 +- 🌍 跨平台 —— 支持 Android、iOS、Web、小程序、Flutter、UniApp 等 [多个开发平台](https://cloud.tencent.com/document/product/647/78742) +- ☁️ 低延迟 —— 腾讯云全球链路资源储备,保证国际链路端到端平均时延 < 300ms +- 🤙🏻 低卡顿 —— 抗丢包率超过 80%、抗网络抖动超过 1000ms,弱网环境仍顺畅稳定 +- 🌈 高品质 —— 支持 720P、1080P 高清画质,70% 丢包率仍可正常视频 + + +## 目录结构 + +``` +TUICallkit +├─ debug // 用来本地测试时生成 userSig +├─ src // UI 组件源码 + ├─ Components // 呼叫中 UI 组件 + └─ TUICallService // UI 组件的逻辑 + └─ adapter-vue.ts // 用来适配 vue2、vue3 的适配层 + └─ index.ts // UI 组件逻辑的入口 +├─ types +├─ package.json +├─ README.md +├─ tuicall-uikit-vue.es.js +├─ tuicall-uikit-vue.umd.js +``` + + +## 使用指引 +为方便您的使用,本组件配套多篇使用指引: +- 如果您想要了解 TUICallKit,请阅读 [组件介绍 TUICallKit](https://cloud.tencent.com/document/product/647/78742)。 +- 如果您想把我们的功能直接嵌入到您的项目中,请阅读 [快速接入 TUICallKit](https://cloud.tencent.com/document/product/647/78912)。 +- 如果您想要了解详细 API,请阅读 [API 概览](https://cloud.tencent.com/document/product/647/78759)。 + +## 附录 + +- 如果你遇到了困难,可以先参阅 [常见问题](https://cloud.tencent.com/document/product/647/78733)。 +- 如果发现了示例代码的 bug,欢迎提交 issue。 +- 欢迎加入 QQ 群:**646165204**,进行技术交流和反馈~ +- \ No newline at end of file diff --git a/TUICallKit/TUICallKit/TUICallKit.js b/TUICallKit/TUICallKit/TUICallKit.js new file mode 100644 index 0000000..0772631 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.js @@ -0,0 +1,199 @@ +import { TUIStore, StoreName, NAME } from "../index"; + +const { + CALL_STATUS, + CALL_ROLE, + CALL_MEDIA_TYPE, + LOCAL_USER_INFO, + REMOTE_USER_INFO_LIST, + CALLER_USER_INFO, + IS_GROUP, + CALL_DURATION, + PUSHER, + PLAYER, + BIG_SCREEN_USER_ID, + IS_EAR_PHONE, + LOCAL_VIDEO, + MYSELF, + TOAST_INFO, +} = NAME; + +Component({ + properties: {}, + data: { + callStatus: TUIStore.getData(StoreName.CALL, CALL_STATUS), // 通话状态 + isGroupCall: TUIStore.getData(StoreName.CALL, IS_GROUP), // 是否群通话 + callMediaType: TUIStore.getData(StoreName.CALL, CALL_MEDIA_TYPE), // 通话类型 + callDuration: TUIStore.getData(StoreName.CALL, CALL_DURATION), // 通话时长 + callRole: TUIStore.getData(StoreName.CALL, CALL_ROLE), // 通话角色 + isEarPhone: TUIStore.getData(StoreName.CALL, IS_EAR_PHONE), // 声音模式 听筒/扬声器 + bigScreenUserId: TUIStore.getData(StoreName.CALL, BIG_SCREEN_USER_ID), // 大屏显示的用户 + localUserInfo: TUIStore.getData(StoreName.CALL, LOCAL_USER_INFO), // 本地用户信息 + callerUserInfo: TUIStore.getData(StoreName.CALL, CALLER_USER_INFO),// 邀请者用户信息 + remoteUserInfoList: TUIStore.getData(StoreName.CALL, REMOTE_USER_INFO_LIST), // 远端用户信息 + pusher: TUIStore.getData(StoreName.CALL, PUSHER), // TRTC 本地流 + playerList: TUIStore.getData(StoreName.CALL, PLAYER), // TRTC 远端流 + playerProcess: {}, // 经过处理的的远端流(多人通话) + }, + methods: { + // 监听通话状态变更回调 + handleCallStatusChange(value) { + this.setData({ + callStatus: value, + }); + console.log("通话状态该笔"); + console.log(this.data.callerUserInfo); + console.log(this.data.localUserInfo); + }, + // 监听是否群组通话变更回调 + handleIsGroupChange(value) { + this.setData({ + isGroupCall: value, + }); + }, + // 监听通话类型变更回调 + handleCallMediaTypeChange(value) { + this.setData({ + callMediaType: value, + }); + }, + // 监听通话角色变更回调 + handleCallRoleChange(value) { + this.setData({ + callRole: value, + }); + }, + // 监听通话时长变更回调 + handleCallDurationChange(value) { + this.setData({ + callDuration: value, + }); + }, + // 监听声音模式变更回调 + handleEarPhoneChange(value) { + this.setData({ + isEarPhone: value, + }); + }, + // 监听大屏显示的用户变更回调 + handleScreenChange(value) { + if (value === LOCAL_VIDEO) { + this.setData({ + bigScreenUserId: true, + }); + } else { + this.setData({ + bigScreenUserId: false, + }); + } + }, + // 监听本地用户信息变更回调 + handleLocalUserInfoChange(value) { + this.setData({ + localUserInfo: value, + }); + }, + // 监听到邀请者信息变更回调 + handleCallerUserInfoChange(value) { + this.setData({ + callerUserInfo: value, + }); + }, + // 监听远端用户信息变更回调 + handleRemoteUserInfoListChange(value) { + this.setData({ + remoteUserInfoList: value, + }); + }, + // 监听 TRTC 本地流变更回调 + handlePusherChange(value) { + this.setData({ + pusher: value, + }); + }, + // 监听 TRTC 远端流变更回调 + handlePlayerListChange(value) { + if (this.data.isGroupCall) { + const convertToPlayer = this.convertToObj(value); + this.setData({ + playerProcess: convertToPlayer, + }); + } else { + this.setData({ + playerList: value, + }); + } + }, + // 监听到弹窗信息变更回调 + handleToastInfoChange(value) { + if (value.text) { + this.showToast(value.text, value.type || "info"); + } + }, + showToast(value, type) { + switch (type) { + case "info": + wx.showToast({ + title: value, + icon: "none", + }); + break; + default: + break; + } + }, + convertToObj(arr = []) { + const tempObject = {}; + for (let i = 0; i < arr.length; i++) { + tempObject[arr[i].userID] = arr[i]; + } + return tempObject; + }, + }, + + // 生命周期方法 + lifetimes: { + attached() { + let that = this; + TUIStore.watch( + StoreName.CALL, + { + [CALL_STATUS]: this.handleCallStatusChange.bind(that), + [IS_GROUP]: this.handleIsGroupChange.bind(that), + [CALL_MEDIA_TYPE]: this.handleCallMediaTypeChange.bind(that), + [CALL_DURATION]: this.handleCallDurationChange.bind(that), + [CALL_ROLE]: this.handleCallRoleChange.bind(that), + [IS_EAR_PHONE]: this.handleEarPhoneChange.bind(that), + [BIG_SCREEN_USER_ID]: this.handleScreenChange.bind(that), + [LOCAL_USER_INFO]: this.handleLocalUserInfoChange.bind(that), + [CALLER_USER_INFO]: this.handleCallerUserInfoChange.bind(that), + [REMOTE_USER_INFO_LIST]: this.handleRemoteUserInfoListChange.bind(that), + [TOAST_INFO]: this.handleToastInfoChange.bind(that), + [PUSHER]: this.handlePusherChange.bind(that), + [PLAYER]: this.handlePlayerListChange.bind(that), + }, + { + notifyRangeWhenWatch: MYSELF, + } + ); + }, + async detached() { + let that = this; + TUIStore.unwatch(StoreName.CALL, { + [CALL_STATUS]: this.handleCallStatusChange.bind(that), + [IS_GROUP]: this.handleIsGroupChange.bind(that), + [CALL_MEDIA_TYPE]: this.handleCallMediaTypeChange.bind(that), + [CALL_DURATION]: this.handleCallDurationChange.bind(that), + [CALL_ROLE]: this.handleCallRoleChange.bind(that), + [IS_EAR_PHONE]: this.handleEarPhoneChange.bind(that), + [BIG_SCREEN_USER_ID]: this.handleScreenChange.bind(that), + [LOCAL_USER_INFO]: this.handleLocalUserInfoChange.bind(that), + [CALLER_USER_INFO]: this.handleCallerUserInfoChange.bind(that), + [REMOTE_USER_INFO_LIST]: this.handleRemoteUserInfoListChange.bind(that), + [TOAST_INFO]: this.handleToastInfoChange.bind(that), + [PUSHER]: this.handlePusherChange.bind(that), + [PLAYER]: this.handlePlayerListChange.bind(that), + }); + }, + }, +}); diff --git a/TUICallKit/TUICallKit/TUICallKit.json b/TUICallKit/TUICallKit/TUICallKit.json new file mode 100644 index 0000000..43e3f72 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "SingleCall":"./component/SingleCall/SingleCall", + "GroupCall":"./component/GroupCall/GroupCall" + }, + "navigationStyle": "custom", + "disableScroll": true +} \ No newline at end of file diff --git a/TUICallKit/TUICallKit/TUICallKit.wxml b/TUICallKit/TUICallKit/TUICallKit.wxml new file mode 100644 index 0000000..05896d5 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.wxml @@ -0,0 +1,29 @@ + + + + diff --git a/TUICallKit/TUICallKit/TUICallKit.wxss b/TUICallKit/TUICallKit/TUICallKit.wxss new file mode 100644 index 0000000..135c364 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.wxss @@ -0,0 +1,10 @@ +.TUICall-container { + width: 100vw; + height: 100vh; + overflow: hidden; + position: absolute; + top: 0; + left: 0; + z-index: 10; + margin: 0; +} \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js new file mode 100644 index 0000000..d1c5f1e --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js @@ -0,0 +1,116 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type: Object, + }, + callerUserInfo: { + type: Object + }, + remoteUserInfoList: { + type: Array, + }, + playerProcess: { + type: Object, + }, + isEarPhone: { + type: Boolean, + }, + }, + data: { + renderStreamList: [], + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_LOADING:`${PATH}/loading.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + }, + observers: { + "localUserInfo, remoteUserInfoList": function ( + localUserInfo, + remoteUserInfoList + ) { + this.setData({ + renderStreamList: [localUserInfo, ...remoteUserInfoList], + }); + }, + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + }, + async reject() { + await TUICallKitServer.reject(); + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml new file mode 100644 index 0000000..a94d708 --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml @@ -0,0 +1,285 @@ + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{callerUserInfo.nick || callerUserInfo.userId}} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{ callerUserInfo.nick || callerUserInfo.userId }} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{ item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss new file mode 100644 index 0000000..6f2a097 --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss @@ -0,0 +1,754 @@ +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + + to { + transform: translateY(0); + } +} + +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100%; + height: 187px; +} + +.invite-call .local-video { + width: 100px; + height: 187px; +} + +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} + +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: 0; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.invite-calling-header-right { + display: flex; + align-items: center; +} + +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} + +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} + +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} + +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} + +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 120px auto 15px; +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.avatar { + background-color: black; +} + +/* 被叫者 */ +.invite-txt { + width: 126px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 16px auto 60px auto; +} + +.invite-other-txt { + width: 112px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 0 auto 24px auto; +} + +.invite-other-list { + position: absolute; + left: 14vw; + margin-top: 0 auto; + display: flex; + flex-wrap: wrap; + width: 272px; + justify-content: center; + flex-wrap: wrap; +} + +.invite-other-item { + flex: 0.25; + text-align: center; + max-width: 64px; + margin: 2px; +} + +.invite-other-item image { + border-radius: 10%; + max-width: 64px; + height: 64px; +} + +.invite-other-item-name { + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #666666; + letter-spacing: 0; + line-height: 18px; +} + +/* 全屏设置 */ +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.TUICalling-connected-video { + width: 100%; + height: 180%; +} + +/* 本地音频 */ +.stream-box { + float: left; + width: 187px; + height: 187px; + position: absolute; + top: 13vh; +} + +/* 远端音频列表 */ +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +/* 本地视频 */ +.play-item { + width: 100%; + height: 187px; + position: relative; + background-color: #000000; +} + +.pusher-ownvideo { + width: 100%; + height: 100%; +} + +/* 远端视频列表 */ +.swiper-list { + min-height: 189px; +} + +.player-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.player-item { + flex: 0.5; + min-width: 50%; + min-height: 187px; +} + +/* 音量图标 */ +.player-control { + background-color: rgba(0, 0, 0, 0.4); + border-radius: 0 6px 6px 0; + color: #fff; + z-index: 999; + position: absolute; + bottom: 0px; + left: 0px; + display: flex; + align-items: center; + height: 32px; + max-width: 50%; + z-index: 99; +} + +.player-control image { + width: 32px; + height: 32px; +} + +.player-control .name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-left: 10px; + margin-right: 10px; + flex: 1; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.control-buttons { + display: flex; +} + +.icon-button { + margin-right: 10px; +} + +/* 菜单 */ +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + font-weight: 400; + font-size: 14px; + color: #666666; + padding: 5px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + margin-top: 100px; + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.TRTCCalling-calling-list { + flex: 0.5; + /*设置最小宽度,才会让元素排不下,导致换行排列*/ + min-width: 50%; + min-height: 187px; + position: relative; +} + +.TRTCCalling-calling-list image { + width: 100%; + height: 100%; +} + +.TRTCCalling-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: -88px; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #666666; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js new file mode 100644 index 0000000..273dbc4 --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js @@ -0,0 +1,110 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type:Object + }, + remoteUserInfoList: { + type: Array, + }, + isEarPhone: { + type: Boolean, + }, + bigScreenUserId: { + type: Boolean + } + }, + data:{ + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + patient_avatar:wx.getStorageSync('patient_avatar') + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + console.log(this.data.remoteUserInfoList) + }, + async reject() { + await TUICallKitServer.reject(); + console.log(this.data.remoteUserInfoList) + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async switchCallMediaType() { + await TUICallKitServer.switchCallMediaType(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + toggleViewSize() { + TUICallKitServer.switchScreen(this.data.bigScreenUserId ? 'player':'localVideo') + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml new file mode 100644 index 0000000..e3f1a3e --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + {{remoteUserInfoList[0].displayUserInfo}} + 等待对方接受 + + + + + + {{callDuration}} + + + + + XXXX + + 邀请你视频通话 + + + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + + + + + + + + + + 切换 + + + + + + 切换至语音 + + + + + + 麦克风 + + + + + + + + + + + + + 挂断 + + + + + + + + + 接听 + + + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + {{callDuration}} + + + + + + + + 语音 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss new file mode 100644 index 0000000..f95fe4b --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss @@ -0,0 +1,511 @@ +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + +} +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; + z-index: 9999; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.40); */ + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.30); */ + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100vw; + height: 100vh; + background-color: black; +} + +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + to { + transform: translateY(0); + } +} + +.invite-call .local-video { + width: 100vw; + height: 100vh; +} +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} +.invite-calling-header { + margin-top: 87px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} +.btn-container { + display: flex; + align-items: center; + position: relative; +} +.invite-calling-header-left { + position: absolute; + right: 0; +} +.invite-calling-header-left image { + width: 32px; + height: 32px; +} +.invite-calling-header-right { + display: flex; + align-items: center; +} +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: row; +} +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 140px auto 15px; + /* margin: 20vw 30vw; */ +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.invite-calling-list { + justify-content: flex-start; +} + +.invite-calling-item { + position: relative; + margin: 0 12px; +} +.invite-calling-item image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling-item-message { + position: absolute; + background: rgba(0, 0, 0, 0.5); + width: 100px; + height: 100px; + top: 0; + left: 0; + z-index: 2; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.avatar { + background: #dddddd; +} + +.player { + position: absolute; + right: 16px; + top: 107px; + width: 100px; + height: 178px; + padding: 16px; + z-index: 999; +} + +.pusher-video { + position: absolute; + width: 100%; + height: 100%; + z-index: 1; +} + +.stream-box { + position: relative; + float: left; + width: 50vw; + height: 260px; + /* background-color: #f75c45; */ + z-index: 3; +} + +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.live { + width: 100%; + height: 100%; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + color: #f0e9e9; + padding: 5px; + font-size: 14px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.mutil-img { + justify-content: flex-start !important; +} + +.TRTCCalling-call-audio-img { + display: flex; + flex-direction: column; + align-items: center; +} + +.TRTCCalling-call-audio-img > image { + width: 25vw; + height: 25vw; + margin: 0 4vw; + border-radius: 4vw; + position: relative; +} + +.TRTCCalling-call-audio-img text { + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-connected { + position: absolute; + right: -88px; +} + +.invite-calling-connected image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #ffffff; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} diff --git a/TUICallKit/TUICallService/CallService/bellContext.d.ts b/TUICallKit/TUICallService/CallService/bellContext.d.ts new file mode 100644 index 0000000..b3dd8e2 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/bellContext.d.ts @@ -0,0 +1,15 @@ +import { IBellParams } from '../interface/index'; +export declare class BellContext { + private _bellContext; + private _isMuteBell; + private _calleeBellFilePath; + private _callRole; + private _callStatus; + constructor(); + setBellSrc(): void; + setBellProperties(bellParams: IBellParams): void; + play(): Promise; + stop(): Promise; + setBellMute(enable: boolean): Promise; + destroy(): void; +} diff --git a/TUICallKit/TUICallService/CallService/bellContext.js b/TUICallKit/TUICallService/CallService/bellContext.js new file mode 100644 index 0000000..3afb593 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/bellContext.js @@ -0,0 +1,106 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BellContext = void 0; +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +const DEFAULT_CALLER_BELL_FILEPATH = '/TUICallKit/static/phone_dialing.mp3'; +const DEFAULT_CALLEE_BELL_FILEPATH = '/TUICallKit/static/phone_ringing.mp3'; +class BellContext { + constructor() { + this._bellContext = null; + this._isMuteBell = false; + this._calleeBellFilePath = DEFAULT_CALLEE_BELL_FILEPATH; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + // @ts-ignore + this._bellContext = wx.createInnerAudioContext(); + this._bellContext.loop = true; + } + setBellSrc() { + // @ts-ignore + const fs = wx.getFileSystemManager(); + try { + let playBellFilePath = DEFAULT_CALLER_BELL_FILEPATH; + if (this._callRole === index_1.CallRole.CALLEE) { + playBellFilePath = this._calleeBellFilePath || DEFAULT_CALLEE_BELL_FILEPATH; + } + fs.readFileSync(playBellFilePath, 'utf8', 0); + this._bellContext.src = playBellFilePath; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to setBellSrc, ${error}`); + } + } + setBellProperties(bellParams) { + this._callRole = bellParams.callRole || this._callRole; + this._callStatus = bellParams.callStatus || this._callStatus; + this._calleeBellFilePath = bellParams.calleeBellFilePath || this._calleeBellFilePath; + // undefined/false || isMuteBell => isMuteBell (不符合预期) + this._isMuteBell = (0, common_utils_1.isUndefined)(bellParams.isMuteBell) ? this._isMuteBell : bellParams.isMuteBell; + } + play() { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._callStatus !== index_1.CallStatus.CALLING) { + return; + } + this.setBellSrc(); + if (this._callRole === index_1.CallRole.CALLEE && !this._isMuteBell) { + yield this._bellContext.play(); + } + if (this._callRole === index_1.CallRole.CALLER) { + yield this._bellContext.play(); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to play audio file, ${error}`); + } + }); + } + stop() { + return __awaiter(this, void 0, void 0, function* () { + try { + this._bellContext.stop(); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to stop audio file, ${error}`); + } + }); + } + setBellMute(enable) { + return __awaiter(this, void 0, void 0, function* () { + if (this._callStatus !== index_1.CallStatus.CALLING && this._callRole !== index_1.CallRole.CALLEE) { + return; + } + if (enable) { + yield this.stop(); + } + else { + yield this.play(); + } + }); + } + destroy() { + try { + this._isMuteBell = false; + this._calleeBellFilePath = ''; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + this._bellContext.destroy(); + this._bellContext = null; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to destroy, ${error}`); + } + } +} +exports.BellContext = BellContext; diff --git a/TUICallKit/TUICallService/CallService/index.d.ts b/TUICallKit/TUICallService/CallService/index.d.ts new file mode 100644 index 0000000..c5872c6 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/index.d.ts @@ -0,0 +1,97 @@ +import { ITUICallService, ICallParams, IGroupCallParams, ICallbackParam, ISelfInfoParams, IInviteUserParams, IJoinInGroupCallParams, IInitParams } from '../interface/ICallService'; +import { LanguageType, LOG_LEVEL, VideoDisplayMode, VideoResolution } from '../const/index'; +import { ITUIGlobal } from '../interface/ITUIGlobal'; +import { ITUIStore } from '../interface/ITUIStore'; +declare const TUIGlobal: ITUIGlobal; +declare const TUIStore: ITUIStore; +export { TUIGlobal, TUIStore }; +export default class TUICallService implements ITUICallService { + static instance: TUICallService; + _tuiCallEngine: any; + private _tim; + private _TUICore; + private _timerId; + private _bellContext; + constructor(); + static getInstance(): TUICallService; + init(params: IInitParams): Promise; + destroyed(): Promise; + call(callParams: ICallParams): Promise; + groupCall(groupCallParams: IGroupCallParams): Promise; + inviteUser(params: IInviteUserParams): Promise; + joinInGroupCall(params: IJoinInGroupCallParams): Promise; + getTUICallEngineInstance(): any; + setLogLevel(level: LOG_LEVEL): void; + setLanguage(language: LanguageType): void; + enableFloatWindow(enable: boolean): void; + setSelfInfo(params: ISelfInfoParams): Promise; + setCallingBell(filePath?: string): Promise; + enableMuteMode(enable: boolean): Promise; + accept(): Promise; + hangup(): Promise; + reject(): Promise; + openCamera(videoViewDomID: string): Promise; + closeCamera(): Promise; + openMicrophone(): Promise; + closeMicrophone(): Promise; + switchScreen(userId: string): void; + switchCallMediaType(): Promise; + switchCamera(): Promise; + setSoundMode(type?: string): void; + getTim(): any; + private _addListenTuiCallEngineEvent; + private _removeListenTuiCallEngineEvent; + private _handleError; + private _handleNewInvitationReceived; + private _handleUserAccept; + private _handleUserEnter; + private _callerChangeToConnected; + private _handleUserLeave; + private _unNormalEventsManager; + private _handleInviteeReject; + private _handleNoResponse; + private _handleLineBusy; + private _handleCallingCancel; + private _handleCallingEnd; + private _handleSDKReady; + private _handleKickedOut; + private _handleCallTypeChange; + private _messageSentByMe; + private _handleUserUpdate; + private _handleCallError; + beforeCalling: ((...args: any[]) => void) | undefined; + afterCalling: ((...args: any[]) => void) | undefined; + onMinimized: ((...args: any[]) => void) | undefined; + onMessageSentByMe: ((...args: any[]) => void) | undefined; + kickedOut: ((...args: any[]) => void) | undefined; + statusChanged: ((...args: any[]) => void) | undefined; + setCallback(params: ICallbackParam): void; + toggleMinimize(): void; + private _executeExternalBeforeCalling; + private _executeExternalAfterCalling; + setVideoDisplayMode(displayMode: VideoDisplayMode): void; + setVideoResolution(resolution: VideoResolution): Promise; + private _handleExceptionExit; + private _setLocalUserInfoAudioVideoAvailable; + private _updateCallStoreBeforeCall; + private _updateCallStoreAfterCall; + private _resetCurrentDevice; + private _resetCallStore; + private _noDevicePermissionToast; + private _startTimer; + private _updateCallDuration; + private _stopTimer; + private _deleteRemoteUser; + private _analyzeEventData; + getGroupMemberList(count: number, offset: number): Promise; + getGroupProfile(): Promise; + private _handleCallStatusChange; + private _watchTUIStore; + private _unwatchTUIStore; + bindTUICore(TUICore: any): void; + private _callTUIService; + onNotifyEvent(eventName: string, subKey: string): Promise; + onCall(method: String, params: any): Promise; + private _handleTUICoreOnClick; + onGetExtension(extensionID: string, params: any): any[]; +} diff --git a/TUICallKit/TUICallService/CallService/index.js b/TUICallKit/TUICallService/CallService/index.js new file mode 100644 index 0000000..02072c9 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/index.js @@ -0,0 +1,1147 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TUIStore = exports.TUIGlobal = void 0; +const tui_core_1 = require("@tencentcloud/tui-core"); +const index_1 = require("../const/index"); +// @ts-ignore +const tuicall_engine_wx_1 = require("tuicall-engine-wx"); +const index_2 = require("../locales/index"); +const miniProgram_1 = require("./miniProgram"); +const bellContext_1 = require("./bellContext"); +const index_3 = require("../utils/validate/index"); +const common_utils_1 = require("../utils/common-utils"); +const utils_1 = require("./utils"); +const timer_1 = __importDefault(require("../utils/timer")); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const tuiStore_1 = __importDefault(require("../TUIStore/tuiStore")); +const TUIGlobal = tuiGlobal_1.default.getInstance(); +exports.TUIGlobal = TUIGlobal; +const TUIStore = tuiStore_1.default.getInstance(); +exports.TUIStore = TUIStore; +const version = '2.1.1'; +class TUICallService { + constructor() { + this._tim = null; + this._TUICore = null; + this._timerId = -1; + this._bellContext = null; + // =========================【监听 TUIStore 中的状态】========================= + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + const bellParams = { + callRole: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE), + callStatus: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS), + }; + this._bellContext.setBellProperties(bellParams); + if (value === index_1.CallStatus.CALLING) { + yield ((_a = this === null || this === void 0 ? void 0 : this._bellContext) === null || _a === void 0 ? void 0 : _a.play()); + } + else { + // 状态变更通知 + if (value === index_1.CallStatus.CONNECTED) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const oldStatus = isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + this.statusChanged && this.statusChanged({ oldStatus, newStatus: (0, utils_1.generateStatusChangeText)(TUIStore) }); + if (!isGroup && callMediaType === index_1.CallMediaType.VIDEO) { + this.switchScreen(remoteUserInfoList[0].domId); + } + } + yield ((_b = this === null || this === void 0 ? void 0 : this._bellContext) === null || _b === void 0 ? void 0 : _b.stop()); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}handleCallStatusChange, ${error}.`); + } + }); + console.log(`${index_1.NAME.PREFIX}version: ${version}`); + this._watchTUIStore(); + this._bellContext = new bellContext_1.BellContext(); + // 下面:TUICore注册事件,注册组件服务,注册界面拓展 + tui_core_1.TUICore.registerEvent(tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED, tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this); + tui_core_1.TUICore.registerService(tui_core_1.TUIConstants.TUICalling.SERVICE.NAME, this); + tui_core_1.TUICore.registerExtension(tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID, this); + } + static getInstance() { + if (!TUICallService.instance) { + TUICallService.instance = new TUICallService(); + } + return TUICallService.instance; + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._tuiCallEngine) + return; + // @ts-ignore + let { userID, tim, userSig, sdkAppID, SDKAppID, isFromChat } = params; + if (this._TUICore) { + sdkAppID = this._TUICore.SDKAppID; + tim = this._TUICore.tim; + } + this._tim = tim; + console.log(`${index_1.NAME.PREFIX}init sdkAppId: ${sdkAppID || SDKAppID}, userId: ${userID}`); + this._tuiCallEngine = tuicall_engine_wx_1.TUICallEngine.createInstance({ + tim, + // @ts-ignore + sdkAppID: sdkAppID || SDKAppID, + callkitVersion: version, + chat: isFromChat || false, + }); + this._addListenTuiCallEngineEvent(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, { userId: userID }); + yield this._tuiCallEngine.login({ userID, userSig, assetsPath: '' }); // web && mini + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}init failed, error: ${error}.`); + throw error; + } + }); + } + // component destroy + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + try { + const currentCallStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (currentCallStatus !== index_1.CallStatus.IDLE) { + throw new Error(`please destroyed when status is idle, current status: ${currentCallStatus}`); + } + if (this._tuiCallEngine) { + this._removeListenTuiCallEngineEvent(); + yield this._tuiCallEngine.destroyInstance(); + this._tuiCallEngine = null; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}destroyed failed, error: ${error}.`); + throw error; + } + }); + } + // ===============================【通话操作】=============================== + call(callParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { type, userID } = callParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + yield this._updateCallStoreBeforeCall(type, [{ userId: userID }]); + this._executeExternalBeforeCalling(); // 执行外部传入的 beforeCall 方法 + const response = yield this._tuiCallEngine.call(callParams); + yield this._updateCallStoreAfterCall([userID], response); + } + catch (error) { + this._handleCallError(error, 'call'); + } + }); + } + ; + groupCall(groupCallParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList, type, groupID } = groupCallParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + const remoteUserInfoList = userIDList.map(userId => ({ userId })); + yield this._updateCallStoreBeforeCall(type, remoteUserInfoList, groupID); + this._executeExternalBeforeCalling(); + const response = yield this._tuiCallEngine.groupCall(groupCallParams); + yield this._updateCallStoreAfterCall(userIDList, response); + } + catch (error) { + this._handleCallError(error, 'groupCall'); + } + }); + } + inviteUser(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList } = params; + let inviteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(userIDList, this.getTim(), TUIStore); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, [...remoteUserInfoList, ...inviteUserInfoList]); + this._tuiCallEngine && (yield this._tuiCallEngine.inviteUser(params)); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}inviteUser failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + joinInGroupCall(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: true, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CONNECTED, + [index_1.NAME.CALL_MEDIA_TYPE]: params.type, + [index_1.NAME.GROUP_ID]: params.groupID, + [index_1.NAME.ROOM_ID]: params.roomID, + }; + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const response = yield this._tuiCallEngine.joinInGroupCall(params); + (params.type === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response); + this.setSoundMode(params.type === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}joinInGroupCall failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + // ===============================【其它对外接口】=============================== + getTUICallEngineInstance() { + return (this === null || this === void 0 ? void 0 : this._tuiCallEngine) || null; + } + setLogLevel(level) { + var _a; + (_a = this === null || this === void 0 ? void 0 : this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.setLogLevel(level); + } + setLanguage(language) { + if (language && Object.values(index_1.LanguageType).includes(language)) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LANGUAGE, language); + } + } + enableFloatWindow(enable) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ENABLE_FLOAT_WINDOW, enable); + } + setSelfInfo(params) { + return __awaiter(this, void 0, void 0, function* () { + const { nickName, avatar } = params; + try { + yield this._tuiCallEngine.setSelfInfo(nickName, avatar); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSelfInfo failed, error: ${error}.`); + } + }); + } + // 修改默认铃声:只支持本地铃声文件,不支持在线铃声文件;修改铃声修改的是被叫的铃声 + setCallingBell(filePath) { + return __awaiter(this, void 0, void 0, function* () { + let isCheckFileExist = true; + if (!isCheckFileExist) { + console.warn(`${index_1.NAME.PREFIX}setCallingBell failed, filePath: ${filePath}.`); + return; + } + const bellParams = { calleeBellFilePath: filePath }; + this._bellContext.setBellProperties(bellParams); + }); + } + enableMuteMode(enable) { + return __awaiter(this, void 0, void 0, function* () { + try { + const bellParams = { isMuteBell: enable }; + this._bellContext.setBellProperties(bellParams); + yield this._bellContext.setBellMute(enable); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}enableMuteMode failed, error: ${error}.`); + } + }); + } + // =============================【内部按钮操作方法】============================= + accept() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.accept(); + if (response) { + // 小程序接通时会进行授权弹框, 状态需要放在 accept 后, 否则先接通后再拉起权限设置 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini default open audio + } + } + catch (error) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + this._resetCallStore(); + } + }); + } + hangup() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.hangup(); + response === null || response === void 0 ? void 0 : response.forEach((item) => { + var _a; + if ((item === null || item === void 0 ? void 0 : item.code) === 0) { + this._callTUIService({ message: (_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.message }); + } + }); + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + reject() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.reject(); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + openCamera(videoViewDomID) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openCamera(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.VIDEO); + } + catch (error) { + this._noDevicePermissionToast(error, index_1.CallMediaType.VIDEO); + console.error(`${index_1.NAME.PREFIX}openCamera error: ${error}.`); + } + }); + } + closeCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeCamera(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.VIDEO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeCamera error: ${error}.`); + } + }); + } + openMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}openMicrophone failed, error: ${error}.`); + } + }); + } + closeMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeMicrophone failed, error: ${error}.`); + } + }); + } + switchScreen(userId) { + if (!userId) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.BIG_SCREEN_USER_ID, userId); + } + // support video to audio; not support audio to video + switchCallMediaType() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (callMediaType === index_1.CallMediaType.AUDIO) { + console.warn(`${index_1.NAME.PREFIX}switchCallMediaType failed, ${callMediaType} not support.`); + return; + } + const response = yield this._tuiCallEngine.switchCallMediaType(index_1.CallMediaType.AUDIO); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, index_1.CallMediaType.AUDIO); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const oldStatus = isGroup ? index_1.StatusChange.CALLING_GROUP_VIDEO : index_1.StatusChange.CALLING_C2C_VIDEO; + const newStatus = (0, utils_1.generateStatusChangeText)(TUIStore); + this.statusChanged && this.statusChanged({ oldStatus, newStatus }); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}switchCallMediaType failed, error: ${error}.`); + } + }); + } + switchCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.switchCamera(); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}_switchCamera failed, error: ${error}.`); + } + }); + } + setSoundMode(type) { + var _a; + try { + let isEarPhone = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE); + const soundMode = type || (isEarPhone ? index_1.AudioPlayBackDevice.SPEAKER : index_1.AudioPlayBackDevice.EAR); // UI 层切换时传参数 + (_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.selectAudioPlaybackDevice(soundMode); + if (type) { + isEarPhone = type === index_1.AudioPlayBackDevice.EAR; + } + else { + isEarPhone = !isEarPhone; + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE, isEarPhone); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSoundMode failed, error: ${error}.`); + } + } + // 切前后置 miniProgram, 切扬声器 + getTim() { + var _a, _b; + if (this._tim) + return this._tim; + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}getTim warning: _tuiCallEngine Instance is not available.`); + return null; + } + return ((_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.tim) || ((_b = this._tuiCallEngine) === null || _b === void 0 ? void 0 : _b.getTim()); // mini support getTim interface + } + // ==========================【TUICallEngine 事件处理】========================== + _addListenTuiCallEngineEvent() { + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}add engine event listener failed, engine is empty.`); + return; + } + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.ERROR, this._handleError, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived, this); // 收到邀请事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept, this); // 主叫收到被叫接通事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter, this); // 有用户进房事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave, this); // 有用户离开通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject, this); // 主叫收到被叫的拒绝通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse, this); // 主叫收到被叫的无应答事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy, this); // 主叫收到被叫的忙线事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel, this); // 主被叫在通话未建立时, 收到的取消事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady, this); // SDK Ready 回调 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut, this); // 未开启多端登录时, 多端登录收到的被踢事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd, this); // 主被叫在通话结束时, 收到的通话结束事件 + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange, this); + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate, this); // mini: user data update + } + _removeListenTuiCallEngineEvent() { + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.ERROR, this._handleError); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd); + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange); // 切换通话事件 miniProgram CALL_MODE + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate); // mini: user data update + } + _handleError(event) { + const { code, message } = event || {}; + const index = Object.values(index_1.ErrorCode).indexOf(code); + let callTips = ''; + if (index !== -1) { + const key = Object.keys(index_1.ErrorCode)[index]; + callTips = (0, index_2.t)(index_1.ErrorMessage[key]); + callTips && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text: callTips, type: index_1.NAME.ERROR }); + } + this._executeExternalAfterCalling(); + console.error(`${index_1.NAME.PREFIX}_handleError, errorCode: ${code}; errorMessage: ${callTips || message}.`); + } + _handleNewInvitationReceived(event) { + return __awaiter(this, void 0, void 0, function* () { + console.log(`${index_1.NAME.PREFIX}onCallReceived event data: ${JSON.stringify(event)}.`); + const { sponsor = '', isFromGroup, callMediaType, inviteData = {}, calleeIdList = [], groupID = '' } = this._analyzeEventData(event); + const currentUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + const remoteUserIdList = [sponsor, ...calleeIdList.filter((userId) => userId !== currentUserInfo.userId)]; + const type = callMediaType || inviteData.callType; + const callTipsKey = type === index_1.CallMediaType.AUDIO ? index_2.CallTips.CALLEE_CALLING_AUDIO_MSG : index_2.CallTips.CALLEE_CALLING_VIDEO_MSG; + let updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: isFromGroup, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CALLING, + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(callTipsKey), + [index_1.NAME.CALLER_USER_INFO]: { userId: sponsor }, + [index_1.NAME.GROUP_ID]: groupID, + }; + (0, miniProgram_1.initAndCheckRunEnv)(); + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + this._executeExternalBeforeCalling(); + this.statusChanged && this.statusChanged({ oldStatus: index_1.StatusChange.IDLE, newStatus: index_1.StatusChange.BE_INVITED }); + const remoteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(remoteUserIdList, this.getTim(), TUIStore); + const [userInfo] = remoteUserInfoList.filter((userInfo) => userInfo.userId === sponsor); + remoteUserInfoList.length > 0 && TUIStore.updateStore({ + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.CALLER_USER_INFO]: { + userId: sponsor, + nick: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.nick) || '', + avatar: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) || '', + }, + }, index_1.StoreName.CALL); + }); + } + _handleUserAccept(event) { + this._callerChangeToConnected(); + console.log(`${index_1.NAME.PREFIX}accept event data: ${JSON.stringify(event)}.`); + } + _handleUserEnter(event) { + return __awaiter(this, void 0, void 0, function* () { + this._callerChangeToConnected(); + const { userID: userId, data } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const isInRemoteUserList = remoteUserInfoList.find(item => (item === null || item === void 0 ? void 0 : item.userId) === userId); + if (!isInRemoteUserList) { + remoteUserInfoList.push({ userId }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + const [userInfo] = yield (0, utils_1.getRemoteUserProfile)([userId], this.getTim(), TUIStore); + remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + remoteUserInfoList.forEach((obj) => { + if ((obj === null || obj === void 0 ? void 0 : obj.userId) === userId) { + obj = Object.assign(obj, userInfo); + } + }); + } + remoteUserInfoList = remoteUserInfoList.map((obj) => { + if (obj.userId === userId) + obj.isEnter = true; + return obj; + }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + console.log(`${index_1.NAME.PREFIX}userEnter event data: ${JSON.stringify(event)}.`); + }); + } + _callerChangeToConnected() { + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.CALLING && callRole === index_1.CallRole.CALLER) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._startTimer(); + } + } + _handleUserLeave(event) { + console.log(`${index_1.NAME.PREFIX}userLeave event data: ${JSON.stringify(event)}.`); + const { data, userID: userId } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP)) { + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + const text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.END_CALL, prefix); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + } + userId && this._deleteRemoteUser([userId]); + } + _unNormalEventsManager(event, eventName) { + console.log(`${index_1.NAME.PREFIX}${eventName} event data: ${JSON.stringify(event)}.`); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + switch (eventName) { + case tuicall_engine_wx_1.EVENT.REJECT: + case tuicall_engine_wx_1.EVENT.LINE_BUSY: { + const { userID: userId } = this._analyzeEventData(event); + let callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.OTHER_SIDE_REJECT_CALL : index_2.CallTips.OTHER_SIDE_LINE_BUSY; + let text = (0, utils_1.generateText)(TUIStore, callTipsKey); + if (isGroup) { + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.REJECT_CALL : index_2.CallTips.IN_BUSY; + text = (0, utils_1.generateText)(TUIStore, callTipsKey, prefix); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userId && this._deleteRemoteUser([userId]); + break; + } + case tuicall_engine_wx_1.EVENT.NO_RESP: { + const { userIDList = [] } = this._analyzeEventData(event); + const callTipsKey = isGroup ? index_2.CallTips.TIMEOUT : index_2.CallTips.CALL_TIMEOUT; + const userInfoList = userIDList.map(userId => { + const userInfo = remoteUserInfoList.find(obj => obj.userId === userId) || {}; + return userInfo.displayUserInfo || userId; + }); + const text = isGroup ? (0, utils_1.generateText)(TUIStore, callTipsKey, userInfoList.join()) : (0, utils_1.generateText)(TUIStore, callTipsKey); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userIDList.length > 0 && this._deleteRemoteUser(userIDList); + break; + } + case tuicall_engine_wx_1.EVENT.CALLING_CANCEL: { + // TUIStore.update(StoreName.CALL, NAME.TOAST_INFO, { text: generateText(TUIStore, CallTips.CANCEL) }); + this._resetCallStore(); + break; + } + } + } + _handleInviteeReject(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.REJECT); + } + _handleNoResponse(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.NO_RESP); + } + _handleLineBusy(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.LINE_BUSY); + } + _handleCallingCancel(event) { + this._executeExternalAfterCalling(); + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.CALLING_CANCEL); + } + _handleCallingEnd(event) { + console.log(`${index_1.NAME.PREFIX}callEnd event data: ${JSON.stringify(event)}.`); + this._executeExternalAfterCalling(); + this._resetCallStore(); + } + // SDK_READY 后才能调用 tim 接口, 否则登录后立刻获取导致调用接口失败. v2.27.4+、v3 接口 login 后会抛出 SDK_READY + _handleSDKReady(event) { + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + localUserInfo = yield (0, utils_1.getMyProfile)(localUserInfo.userId, this.getTim(), TUIStore); // 方法里已经 try...catch 了 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + }); + } + _handleKickedOut(event) { + console.log(`${index_1.NAME.PREFIX}kickOut event data: ${JSON.stringify(event)}.`); + this.kickedOut && this.kickedOut(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_TIPS, (0, utils_1.generateText)(TUIStore, index_2.CallTips.KICK_OUT)); + this._resetCallStore(); + } + _handleCallTypeChange(event) { + const { newCallType, type } = this._analyzeEventData(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, newCallType || type); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + _messageSentByMe(event) { + const message = event === null || event === void 0 ? void 0 : event.data; + this.onMessageSentByMe && this.onMessageSentByMe(message); + } + // ==========================【 miniProgram 私有事件】========================== + _handleUserUpdate(event) { + const data = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.pusher) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, data.pusher); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + } + // 处理 “呼叫” 抛出的异常 + _handleCallError(error, methodName) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + (0, miniProgram_1.handlePackageError)(error); // 无套餐提示, 小程序 engine 不抛出 onError + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + console.error(`${index_1.NAME.PREFIX}${methodName} failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + setCallback(params) { + const { beforeCalling, afterCalling, onMinimized, onMessageSentByMe, kickedOut, statusChanged } = params; + beforeCalling && (this.beforeCalling = beforeCalling); + afterCalling && (this.afterCalling = afterCalling); + onMinimized && (this.onMinimized = onMinimized); + onMessageSentByMe && (this.onMessageSentByMe = onMessageSentByMe); + kickedOut && (this.kickedOut = kickedOut); + statusChanged && (this.statusChanged = statusChanged); + } + toggleMinimize() { + const isMinimized = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED, !isMinimized); + console.log(`${index_1.NAME.PREFIX}toggleMinimize: ${isMinimized} -> ${!isMinimized}.`); + this.onMinimized && this.onMinimized(isMinimized, !isMinimized); + } + _executeExternalBeforeCalling() { + this.beforeCalling && this.beforeCalling(); + } + _executeExternalAfterCalling() { + this.afterCalling && this.afterCalling(); + } + // ========================【TUICallKit 组件属性设置方法】======================== + setVideoDisplayMode(displayMode) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DISPLAY_MODE, displayMode); + } + setVideoResolution(resolution) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (!resolution) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.VIDEO_RESOLUTION, resolution); + yield this._tuiCallEngine.setVideoQuality(resolution); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}setVideoResolution failed, error: ${error}.`); + } + }); + } + // =========================【 miniProgram 私有公共方法】========================= + // 处理用户异常退出的情况,处理了右滑退出,以及返回退出的情况。 + _handleExceptionExit() { + return __awaiter(this, void 0, void 0, function* () { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + // 在呼叫状态下, 被叫调用 reject,主叫调用 hangup + if (callStatus === index_1.CallStatus.CALLING) { + callRole === index_1.CallRole.CALLER && (yield this.hangup()); + callRole === index_1.CallRole.CALLEE && (yield this.reject()); + } + // 在通话状态下, 统一调用 hangup 接口 + callStatus === index_1.CallStatus.CONNECTED && (yield this.hangup()); + }); + } + _setLocalUserInfoAudioVideoAvailable(isAvailable, type) { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + if (type === index_1.NAME.AUDIO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isAudioAvailable: isAvailable }); + } + if (type === index_1.NAME.VIDEO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isVideoAvailable: isAvailable }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + } + _updateCallStoreBeforeCall(type, remoteUserInfoList, groupID) { + return __awaiter(this, void 0, void 0, function* () { + let updateStoreParams = { + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLER, + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.IS_GROUP]: !!groupID, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(index_2.CallTips.CALLER_CALLING_MSG), + [index_1.NAME.GROUP_ID]: groupID + }; + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const callStatus = yield (0, miniProgram_1.beforeCall)(type, this); // 如果没有权限, 此时为 false. 因此需要在 call 后设置为 calling. 和 web 存在差异 + console.log(`${index_1.NAME.PREFIX}mini beforeCall return callStatus: ${callStatus}.`); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, callStatus); + const remoteUserInfoLists = yield (0, utils_1.getRemoteUserProfile)(remoteUserInfoList.map(obj => obj.userId), this.getTim(), TUIStore); + remoteUserInfoLists.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoLists); + }); + } + _updateCallStoreAfterCall(userIdList, response) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + if (response) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ROOM_ID, response.roomID); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CALLING); // 小程序未授权时, 此时状态为 idle; web 直接设置为 calling + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini, default open audio + } + else { + this._resetCallStore(); + } + }); + } + _resetCurrentDevice() { + // 挂断后,重置当前摄像头和麦克风为默认设备 + const { cameraList, microphoneList } = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST, { microphoneList, cameraList, currentCamera: (cameraList === null || cameraList === void 0 ? void 0 : cameraList[0]) || {}, currentMicrophone: (microphoneList === null || microphoneList === void 0 ? void 0 : microphoneList[0]) || {} }); + } + _resetCallStore() { + const oldStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + this._stopTimer(); + // localUserInfo, language 在通话结束后不需要清除 + // callStatus 清除需要通知; isMinimized 也需要通知(basic-vue3 中切小窗关闭后, 再呼叫还是小窗, 因此需要通知到组件侧) + // isGroup 也不清除(engine 先抛 cancel 事件, 再抛 reject 事件) + // displayMode、videoResolution 也不能清除, 组件不卸载, 这些属性也需保留, 否则采用默认值. + // enableFloatWindow 不清除:开启/关闭悬浮窗功能。 + let notResetOrNotifyKeys = Object.keys(index_1.CALL_DATA_KEY).filter((key) => { + switch (index_1.CALL_DATA_KEY[key]) { + case index_1.NAME.CALL_STATUS: + case index_1.NAME.LANGUAGE: + case index_1.NAME.IS_GROUP: + case index_1.NAME.DISPLAY_MODE: + case index_1.NAME.VIDEO_RESOLUTION: + case index_1.NAME.ENABLE_FLOAT_WINDOW: + case index_1.NAME.LOCAL_USER_INFO: { + return false; + } + default: { + return true; + } + } + }); + notResetOrNotifyKeys = notResetOrNotifyKeys.map(key => index_1.CALL_DATA_KEY[key]); + TUIStore.reset(index_1.StoreName.CALL, notResetOrNotifyKeys); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + callStatus !== index_1.CallStatus.IDLE && TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.CALL_STATUS], true); // callStatus reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_MINIMIZED], true); // isMinimized reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_EAR_PHONE], true); // isEarPhone reset need notify + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO)), { isVideoAvailable: false, isAudioAvailable: false })); + this._resetCurrentDevice(); + const newStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + if (oldStatusStr !== newStatusStr) { + this.statusChanged && this.statusChanged({ oldStatus: oldStatusStr, newStatus: newStatusStr }); + } + } + _noDevicePermissionToast(error, type) { + if ((0, common_utils_1.handleNoDevicePermissionError)(error)) { + let text = ''; + if (type === index_1.CallMediaType.AUDIO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_MICROPHONE_DEVICE_PERMISSION); + } + if (type === index_1.CallMediaType.VIDEO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_CAMERA_DEVICE_PERMISSION); + } + text && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text, type: index_1.NAME.ERROR }); + console.error(`${index_1.NAME.PREFIX}call failed, error: ${error.message}.`); + } + } + // 通话时长更新 + _startTimer() { + if (this._timerId === -1) { + this._timerId = timer_1.default.run(index_1.NAME.TIMEOUT, this._updateCallDuration.bind(this), { delay: 1000 }); + } + } + _updateCallDuration() { + let callDurationStr = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION); + const callDurationNum = (0, common_utils_1.formatTimeInverse)(callDurationStr); + callDurationStr = (0, common_utils_1.formatTime)(callDurationNum + 1); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION, callDurationStr); + } + _stopTimer() { + if (this._timerId !== -1) { + timer_1.default.clearTask(this._timerId); + this._timerId = -1; + } + } + _deleteRemoteUser(userIdList) { + if (userIdList.length === 0) + return; + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + userIdList.forEach((userId) => { + remoteUserInfoList = remoteUserInfoList.filter((obj) => obj.userId !== userId); + }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + } + _analyzeEventData(event) { + return (event === null || event === void 0 ? void 0 : event.data) || {}; // mini INVITED + } + // =========================【调用 chat api】========================= + // 获取群成员 + getGroupMemberList(count, offset) { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + let groupMemberList = yield (0, utils_1.getGroupMemberList)(groupID, this.getTim(), count, offset); + return groupMemberList; + }); + } + // 获取群信息 + getGroupProfile() { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + return yield (0, utils_1.getGroupProfile)(groupID, this.getTim()); + }); + } + _watchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _unwatchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + // =========================【web 融合 chat 提供的方法】========================= + bindTUICore(TUICore) { + this._TUICore = TUICore; + } + // 下面方法用于接入 TUICore + _callTUIService(params) { + const { message } = params || {}; + tui_core_1.TUICore.callService({ + serviceName: tui_core_1.TUIConstants.TUIChat.SERVICE.NAME, + method: tui_core_1.TUIConstants.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST, + params: { message }, + }); + } + onNotifyEvent(eventName, subKey) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (eventName === tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED) { + if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) { + // TUICallkit 收到登录成功时执行自己的业务逻辑处理 + // @ts-ignore + const { chat, userID, userSig, SDKAppID } = tui_core_1.TUILogin.getContext(); + yield this.init({ tim: chat, userID, userSig, sdkAppID: SDKAppID, isFromChat: true }); + } + else if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS) { + yield this.destroyed(); + } + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}TUICore onNotifyEvent failed, error: ${error}.`); + } + }); + } + onCall(method, params) { + return __awaiter(this, void 0, void 0, function* () { + if (method === tui_core_1.TUIConstants.TUICalling.SERVICE.METHOD.START_CALL) { + yield this._handleTUICoreOnClick(params, params.type); + } + }); + } + _handleTUICoreOnClick(options, type) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { groupID, userIDList = [] } = options, rest = __rest(options, ["groupID", "userIDList"]); + if (groupID) { + yield this.groupCall(Object.assign({ groupID, userIDList, type }, rest)); + } + else if (userIDList.length === 1) { + yield this.call(Object.assign({ userID: userIDList[0], type }, rest)); + } + } + catch (error) { + console.debug(error); + } + }); + } + onGetExtension(extensionID, params) { + if (extensionID === tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID) { + const list = []; + const audioCallExtension = { + weight: 1000, + text: '语音通话', + icon: index_1.AudioCallIcon, + data: { + name: 'voiceCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.AUDIO); }), // 点击时发起通话 + }, + }; + const videoCallExtension = { + weight: 900, + text: '视频通话', + icon: index_1.VideoCallIcon, + data: { + name: 'videoCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.VIDEO); }), // 点击时发起通话 + }, + }; + if (!(params === null || params === void 0 ? void 0 : params.filterVoice)) { + list.push(audioCallExtension); + } + if (!(params === null || params === void 0 ? void 0 : params.filterVideo)) { + list.push(videoCallExtension); + } + return list; + } + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.init), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "init", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.call), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "call", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.groupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "groupCall", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.inviteUser), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "inviteUser", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.joinInGroupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "joinInGroupCall", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setLanguage), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setLanguage", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableFloatWindow), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "enableFloatWindow", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setSelfInfo), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setSelfInfo", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setCallingBell), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setCallingBell", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableMuteMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "enableMuteMode", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "accept", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "hangup", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "reject", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "switchScreen", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCallMediaType", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setSoundMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoDisplayMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setVideoDisplayMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoResolution), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setVideoResolution", null); +exports.default = TUICallService; diff --git a/TUICallKit/TUICallService/CallService/miniProgram.d.ts b/TUICallKit/TUICallService/CallService/miniProgram.d.ts new file mode 100644 index 0000000..bd5ede2 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/miniProgram.d.ts @@ -0,0 +1,6 @@ +import { CallMediaType, CallStatus } from '../const/index'; +export declare function initialUI(): void; +export declare function checkRunPlatform(): void; +export declare function initAndCheckRunEnv(): void; +export declare function beforeCall(type: CallMediaType, that: any): Promise; +export declare function handlePackageError(error: any): void; diff --git a/TUICallKit/TUICallService/CallService/miniProgram.js b/TUICallKit/TUICallService/CallService/miniProgram.js new file mode 100644 index 0000000..c279d08 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/miniProgram.js @@ -0,0 +1,76 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handlePackageError = exports.beforeCall = exports.initAndCheckRunEnv = exports.checkRunPlatform = exports.initialUI = void 0; +const index_1 = require("../const/index"); +function initialUI() { + // 收起键盘 + // @ts-ignore + wx.hideKeyboard({ + complete: () => { }, + }); +} +exports.initialUI = initialUI; +; +// 检测运行时环境, 当是微信开发者工具时, 提示用户需要手机调试 +function checkRunPlatform() { + // @ts-ignore + const systemInfo = wx.getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + // 当前运行在微信开发者工具里 + // @ts-ignore + wx.showModal({ + icon: 'none', + title: '运行环境提醒', + content: '微信开发者工具不支持原生推拉流组件(即 标签),请使用真机调试或者扫码预览。', + showCancel: false, + }); + } +} +exports.checkRunPlatform = checkRunPlatform; +; +function initAndCheckRunEnv() { + initialUI(); // miniProgram 收起键盘, 隐藏 tabBar + checkRunPlatform(); // miniProgram 检测运行时环境 +} +exports.initAndCheckRunEnv = initAndCheckRunEnv; +function beforeCall(type, that) { + return __awaiter(this, void 0, void 0, function* () { + try { + initAndCheckRunEnv(); + // 检查设备权限 + const deviceMap = { + microphone: true, + camera: type === index_1.CallMediaType.VIDEO, + }; + const hasDevicePermission = yield that._tuiCallEngine.deviceCheck(deviceMap); // miniProgram 检查设备权限 + return hasDevicePermission ? index_1.CallStatus.CALLING : index_1.CallStatus.IDLE; + } + catch (error) { + console.debug(error); + return index_1.CallStatus.IDLE; + } + }); +} +exports.beforeCall = beforeCall; +// 套餐问题提示, 小程序最低需要群组通话版, 1v1 通话版本使用 TRTC 就会报错 +function handlePackageError(error) { + if ((error === null || error === void 0 ? void 0 : error.code) === -1002) { + // @ts-ignore + wx.showModal({ + icon: 'none', + title: 'error', + content: (error === null || error === void 0 ? void 0 : error.message) || '', + showCancel: false, + }); + } +} +exports.handlePackageError = handlePackageError; diff --git a/TUICallKit/TUICallService/CallService/utils.d.ts b/TUICallKit/TUICallService/CallService/utils.d.ts new file mode 100644 index 0000000..ee19134 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/utils.d.ts @@ -0,0 +1,9 @@ +import { IUserInfo } from '../interface/ICallService'; +import { ITUIStore } from '../interface/ITUIStore'; +export declare function setDefaultUserInfo(userId: string, domId?: string): IUserInfo; +export declare function getMyProfile(myselfUserId: string, tim: any, TUIStore: any): Promise; +export declare function getRemoteUserProfile(userIdList: Array, tim: any, TUIStore: any): Promise; +export declare function generateText(TUIStore: ITUIStore, key: string, prefix?: string, suffix?: string): string; +export declare function generateStatusChangeText(TUIStore: ITUIStore): string; +export declare function getGroupMemberList(groupID: string, tim: any, count: any, offset: any): Promise; +export declare function getGroupProfile(groupID: string, tim: any): Promise; diff --git a/TUICallKit/TUICallService/CallService/utils.js b/TUICallKit/TUICallService/CallService/utils.js new file mode 100644 index 0000000..0eaed04 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/utils.js @@ -0,0 +1,167 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGroupProfile = exports.getGroupMemberList = exports.generateStatusChangeText = exports.generateText = exports.getRemoteUserProfile = exports.getMyProfile = exports.setDefaultUserInfo = void 0; +const index_1 = require("../const/index"); +const index_2 = require("../locales/index"); +// 设置默认的 UserInfo 信息 +function setDefaultUserInfo(userId, domId) { + const userInfo = { + userId, + nick: '', + avatar: '', + remark: '', + displayUserInfo: '', + isAudioAvailable: false, + isVideoAvailable: false, + isEnter: false, + domId: domId || userId, + }; + return domId ? userInfo : Object.assign(Object.assign({}, userInfo), { isEnter: false }); // localUserInfo 没有 isEnter, remoteUserInfoList 有 isEnter +} +exports.setDefaultUserInfo = setDefaultUserInfo; +// 获取个人用户信息 +function getMyProfile(myselfUserId, tim, TUIStore) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = setDefaultUserInfo(myselfUserId, index_1.NAME.LOCAL_VIDEO); + try { + if (!tim) + return localUserInfo; + const res = yield tim.getMyProfile(); + const currentLocalUserInfo = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); // localUserInfo may have been updated + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + localUserInfo = Object.assign(Object.assign(Object.assign({}, localUserInfo), currentLocalUserInfo), { userId: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.userID, nick: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.nick, avatar: (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.avatar }); + } + return localUserInfo; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getMyProfile failed, error: ${error}.`); + return localUserInfo; + } + }); +} +exports.getMyProfile = getMyProfile; +// 获取远端用户列表信息 +function getRemoteUserProfile(userIdList, tim, TUIStore) { + return __awaiter(this, void 0, void 0, function* () { + let remoteUserInfoList = userIdList.map((userId) => setDefaultUserInfo(userId)); + try { + if (!tim) + return remoteUserInfoList; + const res = yield tim.getFriendProfile({ userIDList: userIdList }); + if (res.code === 0) { + const { friendList = [], failureUserIDList = [] } = res.data; + let unFriendList = failureUserIDList.map((obj) => obj.userID); + if (failureUserIDList.length > 0) { + const res = yield tim.getUserProfile({ userIDList: failureUserIDList.map((obj) => obj.userID) }); + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + unFriendList = (res === null || res === void 0 ? void 0 : res.data) || []; + } + } + const currentRemoteUserInfoList = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); // remoteUserInfoList may have been updated + const tempFriendIdList = friendList.map((obj) => obj.userID); + const tempUnFriendIdList = unFriendList.map((obj) => obj.userID); + remoteUserInfoList = userIdList.map((userId) => { + var _a, _b, _c, _d, _e, _f, _g; + const defaultUserInfo = setDefaultUserInfo(userId); + const friendListIndex = tempFriendIdList.indexOf(userId); + const unFriendListIndex = tempUnFriendIdList.indexOf(userId); + let remark = ''; + let nick = ''; + let displayUserInfo = ''; + let avatar = ''; + if (friendListIndex !== -1) { + remark = ((_a = friendList[friendListIndex]) === null || _a === void 0 ? void 0 : _a.remark) || ''; + nick = ((_c = (_b = friendList[friendListIndex]) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.nick) || ''; + displayUserInfo = remark || nick || defaultUserInfo.userId || ''; + avatar = ((_e = (_d = friendList[friendListIndex]) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.avatar) || ''; + } + if (unFriendListIndex !== -1) { + nick = ((_f = unFriendList[unFriendListIndex]) === null || _f === void 0 ? void 0 : _f.nick) || ''; + displayUserInfo = nick || defaultUserInfo.userId || ''; + avatar = ((_g = unFriendList[unFriendListIndex]) === null || _g === void 0 ? void 0 : _g.avatar) || ''; + } + const userInfo = currentRemoteUserInfoList.find(subObj => subObj.userId === userId) || {}; + return Object.assign(Object.assign(Object.assign({}, defaultUserInfo), userInfo), { remark, nick, displayUserInfo, avatar }); + }); + } + return remoteUserInfoList; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getRemoteUserProfile failed, error: ${error}.`); + return remoteUserInfoList; + } + }); +} +exports.getRemoteUserProfile = getRemoteUserProfile; +// 生成弹框提示文案 +function generateText(TUIStore, key, prefix, suffix) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + let callTips = `${(0, index_2.t)(key)}`; + if (isGroup) { + callTips = prefix ? `${prefix} ${callTips}` : callTips; + callTips = suffix ? `${callTips} ${suffix}` : callTips; + } + return callTips; +} +exports.generateText = generateText; +// 生成 statusChange 抛出的字符串 +function generateStatusChangeText(TUIStore) { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.IDLE) { + return index_1.StatusChange.IDLE; + } + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + if (callStatus === index_1.CallStatus.CALLING) { + return isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + } + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (isGroup) { + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_GROUP_AUDIO : index_1.StatusChange.CALLING_GROUP_VIDEO; + } + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_C2C_AUDIO : index_1.StatusChange.CALLING_C2C_VIDEO; +} +exports.generateStatusChangeText = generateStatusChangeText; +// 获取群组[offset, count + offset]区间成员 +function getGroupMemberList(groupID, tim, count, offset) { + return __awaiter(this, void 0, void 0, function* () { + let groupMemberList = []; + try { + const res = yield tim.getGroupMemberList({ groupID, count, offset }); + if (res.code === 0) { + return res.data.memberList || groupMemberList; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupMember failed, error: ${error}.`); + return groupMemberList; + } + }); +} +exports.getGroupMemberList = getGroupMemberList; +// 获取 IM 群信息 +function getGroupProfile(groupID, tim) { + return __awaiter(this, void 0, void 0, function* () { + let groupProfile = {}; + try { + const res = yield tim.getGroupProfile({ groupID }); + if (res.code === 0) { + return res.data.group || groupProfile; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupProfile failed, error: ${error}.`); + return groupProfile; + } + }); +} +exports.getGroupProfile = getGroupProfile; diff --git a/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts new file mode 100644 index 0000000..81b787d --- /dev/null +++ b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts @@ -0,0 +1,21 @@ +import { ITUIGlobal } from '../interface/ITUIGlobal'; +export default class TUIGlobal implements ITUIGlobal { + static instance: TUIGlobal; + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + constructor(); + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance(): TUIGlobal; + initEnv(): void; + initOfficial(SDKAppID: number): void; +} diff --git a/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js new file mode 100644 index 0000000..049ac74 --- /dev/null +++ b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const env_1 = require("../utils/env"); +class TUIGlobal { + constructor() { + this.global = env_1.APP_NAMESPACE; + this.isPC = false; + this.isH5 = false; + this.isWeChat = false; + this.isApp = false; + this.isUniPlatform = false; + this.isOfficial = false; + this.isWIN = false; + this.isMAC = false; + this.initEnv(); + } + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance() { + if (!TUIGlobal.instance) { + TUIGlobal.instance = new TUIGlobal(); + } + return TUIGlobal.instance; + } + initEnv() { + this.isPC = env_1.IS_PC; + this.isH5 = env_1.IS_H5; + this.isWeChat = env_1.IN_WX_MINI_APP; + this.isApp = env_1.IN_UNI_NATIVE_APP && !env_1.IN_WX_MINI_APP; // uniApp 打包小程序时 IN_UNI_NATIVE_APP 为 true,所以此处需要增加条件 + this.isUniPlatform = env_1.IN_UNI_APP; + this.isWIN = env_1.IS_WIN; + this.isMAC = env_1.IS_MAC; + } + initOfficial(SDKAppID) { + this.isOfficial = (SDKAppID === 1400187352 || SDKAppID === 1400188366); + } +} +exports.default = TUIGlobal; diff --git a/TUICallKit/TUICallService/TUIStore/callStore.d.ts b/TUICallKit/TUICallService/TUIStore/callStore.d.ts new file mode 100644 index 0000000..b9ada5a --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/callStore.d.ts @@ -0,0 +1,8 @@ +import { ICallStore } from '../interface/ICallStore'; +export default class CallStore { + defaultStore: ICallStore; + store: ICallStore; + update(key: keyof ICallStore, data: any): void; + getData(key: string | undefined): any; + reset(keyList?: Array): void; +} diff --git a/TUICallKit/TUICallService/TUIStore/callStore.js b/TUICallKit/TUICallService/TUIStore/callStore.js new file mode 100644 index 0000000..8ac66ef --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/callStore.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +class CallStore { + constructor() { + this.defaultStore = { + callStatus: index_1.CallStatus.IDLE, + callRole: index_1.CallRole.UNKNOWN, + callMediaType: index_1.CallMediaType.UNKNOWN, + localUserInfo: { userId: '' }, + remoteUserInfoList: [], + callerUserInfo: { userId: '' }, + isGroup: false, + callDuration: '00:00:00', + callTips: '', + toastInfo: { text: '' }, + isMinimized: false, + enableFloatWindow: false, + bigScreenUserId: '', + language: (0, common_utils_1.getLanguage)(), + isClickable: false, + deviceList: { cameraList: [], microphoneList: [], currentCamera: {}, currentMicrophone: {} }, + showPermissionTip: false, + groupID: '', + roomID: 0, + // TUICallKit 组件上的属性 + displayMode: index_1.VideoDisplayMode.COVER, + videoResolution: index_1.VideoResolution.RESOLUTION_480P, + showSelectUser: false, + // 小程序相关属性 + pusher: {}, + player: [], + isEarPhone: false, // 是否是听筒, 默认: false + }; + this.store = Object.assign({}, this.defaultStore); + } + ; + update(key, data) { + switch (key) { + // case 'callTips': + // break; + default: + // resolve "Type 'any' is not assignable to type 'never'.ts", ref: https://github.com/microsoft/TypeScript/issues/31663 + this.store[key] = data; + } + } + getData(key) { + if (!key) + return this.store; + return this.store[key]; + } + // reset call store + reset(keyList = []) { + if (keyList.length === 0) { + keyList = Object.keys(this.store); + } + const resetToDefault = keyList.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: this.defaultStore[key] })), {}); + this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), resetToDefault); + } +} +exports.default = CallStore; diff --git a/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts b/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts new file mode 100644 index 0000000..964ae33 --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts @@ -0,0 +1,50 @@ +import { ITUIStore, IOptions, Task } from '../interface/ITUIStore'; +import { StoreName } from '../const/index'; +export default class TUIStore implements ITUIStore { + static instance: TUIStore; + task: Task; + private storeMap; + private timerId; + constructor(); + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance(): TUIStore; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName: StoreName, options: IOptions): void; + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName: StoreName, key: string): any; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + private notify; + reset(storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean): void; + updateStore(params: any, name?: StoreName): void; +} diff --git a/TUICallKit/TUICallService/TUIStore/tuiStore.js b/TUICallKit/TUICallService/TUIStore/tuiStore.js new file mode 100644 index 0000000..7acaa59 --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/tuiStore.js @@ -0,0 +1,155 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const callStore_1 = __importDefault(require("./callStore")); +const common_utils_1 = require("../utils/common-utils"); +class TUIStore { + constructor() { + this.timerId = -1; + this.storeMap = { + [index_1.StoreName.CALL]: new callStore_1.default(), + }; + // todo 此处后续优化结构后调整 + this.task = {}; // 保存监听回调列表 + } + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance() { + if (!TUIStore.instance) { + TUIStore.instance = new TUIStore(); + } + return TUIStore.instance; + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName, options, params) { + if (!this.task[storeName]) { + this.task[storeName] = {}; + } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + const callback = options[key]; + if (!watcher[key]) { + watcher[key] = new Map(); + } + watcher[key].set(callback, 1); + const { notifyRangeWhenWatch } = params || {}; + // 注册监听后, 通知所有注册该 key 的监听,使用 'all' 时要特别注意是否对其他地方的监听产生影响 + if (notifyRangeWhenWatch === index_1.NAME.ALL) { + this.notify(storeName, key); + } + // 注册监听后, 仅通知自己本次监听该 key 的数据 + if (notifyRangeWhenWatch === index_1.NAME.MYSELF) { + const data = this.getData(storeName, key); + callback.call(this, data); + } + }); + } + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName, options) { + // todo 该接口暂未支持,unwatch掉同一类,如仅传入store注销掉该store下的所有callback,同样options仅传入key注销掉该key下的所有callback + // options的callback function为必填参数,后续修改 + if (!this.task[storeName]) { + return; + } + ; + // if (isString(options)) { + // // 移除所有的监听 + // if (options === '*') { + // const watcher = this.task[storeName]; + // Object.keys(watcher).forEach(key => { + // watcher[key].clear(); + // }); + // } else { + // console.warn(`${NAME.PREFIX}unwatch warning: options is ${options}`); + // } + // return; + // } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + watcher[key].delete(options[key]); + }); + } + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName, key, data) { + var _a; + // 基本数据类型时, 如果相等, 就不进行更新, 减少不必要的 notify + if ((0, common_utils_1.isString)(data) || (0, common_utils_1.isNumber)(data) || (0, common_utils_1.isBoolean)(data)) { + const currentData = this.storeMap[storeName]['store'][key]; // eslint-disable-line + if (currentData === data) + return; + } + (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.update(key, data); + this.notify(storeName, key); + } + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName, key) { + var _a; + return (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.getData(key); + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + notify(storeName, key) { + if (!this.task[storeName]) { + return; + } + const watcher = this.task[storeName]; + if (watcher[key]) { + const callbackMap = watcher[key]; + const data = this.getData(storeName, key); + for (const [callback] of callbackMap.entries()) { + callback.call(this, data); + } + } + } + reset(storeName, keyList = [], isNotificationNeeded = false) { + if (storeName in this.storeMap) { + const store = this.storeMap[storeName]; + // reset all + if (keyList.length === 0) { + keyList = Object.keys(store === null || store === void 0 ? void 0 : store.store); + } + store.reset(keyList); + if (isNotificationNeeded) { + keyList.forEach((key) => { + this.notify(storeName, key); + }); + } + } + } + // 批量修改多个 key-value + updateStore(params, name) { + const storeName = name ? name : index_1.StoreName.CALL; + Object.keys(params).forEach((key) => { + this.update(storeName, key, params[key]); + }); + } +} +exports.default = TUIStore; diff --git a/TUICallKit/TUICallService/const/call.d.ts b/TUICallKit/TUICallService/const/call.d.ts new file mode 100644 index 0000000..8af20c4 --- /dev/null +++ b/TUICallKit/TUICallService/const/call.d.ts @@ -0,0 +1,93 @@ +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +export declare enum StoreName { + CALL = "call", + CUSTOM = "custom" +} +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallMediaType { + UNKNOWN = 0, + AUDIO = 1, + VIDEO = 2 +} +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +export declare enum CallRole { + UNKNOWN = "unknown", + CALLEE = "callee", + CALLER = "caller" +} +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallStatus { + IDLE = "idle", + CALLING = "calling", + CONNECTED = "connected" +} +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +export declare enum VideoDisplayMode { + CONTAIN = "contain", + COVER = "cover", + FILL = "fill" +} +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +export declare enum VideoResolution { + RESOLUTION_480P = "480p", + RESOLUTION_720P = "720p", + RESOLUTION_1080P = "1080p" +} +export declare enum LanguageType { + EN = "en", + 'ZH-CN' = "zh-cn", + JA_JP = "ja_JP" +} +export type TDeviceList = { + cameraList: any[]; + microphoneList: any[]; + currentCamera: any; + currentMicrophone: any; +}; +export declare const StatusChange: { + readonly IDLE: "idle"; + readonly BE_INVITED: "be-invited"; + readonly DIALING_C2C: "dialing-c2c"; + readonly DIALING_GROUP: "dialing-group"; + readonly CALLING_C2C_AUDIO: "calling-c2c-audio"; + readonly CALLING_C2C_VIDEO: "calling-c2c-video"; + readonly CALLING_GROUP_AUDIO: "calling-group-audio"; + readonly CALLING_GROUP_VIDEO: "calling-group-video"; +}; +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +export declare enum AudioPlayBackDevice { + EAR = "ear", + SPEAKER = "speaker" +} +export declare enum DeviceType { + MICROPHONE = "microphone", + CAMERA = "camera" +} diff --git a/TUICallKit/TUICallService/const/call.js b/TUICallKit/TUICallService/const/call.js new file mode 100644 index 0000000..e6a9f63 --- /dev/null +++ b/TUICallKit/TUICallService/const/call.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeviceType = exports.AudioPlayBackDevice = exports.StatusChange = exports.LanguageType = exports.VideoResolution = exports.VideoDisplayMode = exports.CallStatus = exports.CallRole = exports.CallMediaType = exports.StoreName = void 0; +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +var StoreName; +(function (StoreName) { + StoreName["CALL"] = "call"; + StoreName["CUSTOM"] = "custom"; +})(StoreName = exports.StoreName || (exports.StoreName = {})); +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallMediaType; +(function (CallMediaType) { + CallMediaType[CallMediaType["UNKNOWN"] = 0] = "UNKNOWN"; + CallMediaType[CallMediaType["AUDIO"] = 1] = "AUDIO"; + CallMediaType[CallMediaType["VIDEO"] = 2] = "VIDEO"; +})(CallMediaType = exports.CallMediaType || (exports.CallMediaType = {})); +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +var CallRole; +(function (CallRole) { + CallRole["UNKNOWN"] = "unknown"; + CallRole["CALLEE"] = "callee"; + CallRole["CALLER"] = "caller"; +})(CallRole = exports.CallRole || (exports.CallRole = {})); +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallStatus; +(function (CallStatus) { + CallStatus["IDLE"] = "idle"; + CallStatus["CALLING"] = "calling"; + CallStatus["CONNECTED"] = "connected"; +})(CallStatus = exports.CallStatus || (exports.CallStatus = {})); +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +var VideoDisplayMode; +(function (VideoDisplayMode) { + VideoDisplayMode["CONTAIN"] = "contain"; + VideoDisplayMode["COVER"] = "cover"; + VideoDisplayMode["FILL"] = "fill"; +})(VideoDisplayMode = exports.VideoDisplayMode || (exports.VideoDisplayMode = {})); +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +var VideoResolution; +(function (VideoResolution) { + VideoResolution["RESOLUTION_480P"] = "480p"; + VideoResolution["RESOLUTION_720P"] = "720p"; + VideoResolution["RESOLUTION_1080P"] = "1080p"; +})(VideoResolution = exports.VideoResolution || (exports.VideoResolution = {})); +// 支持的语言 +var LanguageType; +(function (LanguageType) { + LanguageType["EN"] = "en"; + LanguageType["ZH-CN"] = "zh-cn"; + LanguageType["JA_JP"] = "ja_JP"; +})(LanguageType = exports.LanguageType || (exports.LanguageType = {})); +/* === 【原来 TUICallKit 对外暴露】=== */ +// 原来 web callKit 定义通知外部状态变更的变量, 对外暴露 +exports.StatusChange = { + IDLE: "idle", + BE_INVITED: "be-invited", + DIALING_C2C: "dialing-c2c", + DIALING_GROUP: "dialing-group", + CALLING_C2C_AUDIO: "calling-c2c-audio", + CALLING_C2C_VIDEO: "calling-c2c-video", + CALLING_GROUP_AUDIO: "calling-group-audio", + CALLING_GROUP_VIDEO: "calling-group-video", +}; +/* === 【小程序使用】=== */ +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +var AudioPlayBackDevice; +(function (AudioPlayBackDevice) { + AudioPlayBackDevice["EAR"] = "ear"; + AudioPlayBackDevice["SPEAKER"] = "speaker"; +})(AudioPlayBackDevice = exports.AudioPlayBackDevice || (exports.AudioPlayBackDevice = {})); +; +var DeviceType; +(function (DeviceType) { + DeviceType["MICROPHONE"] = "microphone"; + DeviceType["CAMERA"] = "camera"; +})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); diff --git a/TUICallKit/TUICallService/const/error.d.ts b/TUICallKit/TUICallService/const/error.d.ts new file mode 100644 index 0000000..000d4a0 --- /dev/null +++ b/TUICallKit/TUICallService/const/error.d.ts @@ -0,0 +1,2 @@ +export declare const ErrorCode: any; +export declare const ErrorMessage: any; diff --git a/TUICallKit/TUICallService/const/error.js b/TUICallKit/TUICallService/const/error.js new file mode 100644 index 0000000..1449c3c --- /dev/null +++ b/TUICallKit/TUICallService/const/error.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorMessage = exports.ErrorCode = void 0; +// 错误码 +exports.ErrorCode = { + SWITCH_TO_AUDIO_CALL_FAILED: 60001, + SWITCH_TO_VIDEO_CALL_FAILED: 60002, + MICROPHONE_UNAVAILABLE: 60003, + CAMERA_UNAVAILABLE: 60004, + BAN_DEVICE: 60005, + NOT_SUPPORTED_WEBRTC: 60006, + ERROR_BLACKLIST: 20007, +}; +exports.ErrorMessage = { + SWITCH_TO_AUDIO_CALL_FAILED: 'switchToAudioCall-call-failed', + SWITCH_TO_VIDEO_CALL_FAILED: 'switchToVideoCall-call-failed', + MICROPHONE_UNAVAILABLE: 'microphone-unavailable', + CAMERA_UNAVAILABLE: 'camera-unavailable', + BAN_DEVICE: 'ban-device', + NOT_SUPPORTED_WEBRTC: 'not-supported-webrtc', + ERROR_BLACKLIST: 'blacklist-user-tips' +}; diff --git a/TUICallKit/TUICallService/const/index.d.ts b/TUICallKit/TUICallService/const/index.d.ts new file mode 100644 index 0000000..a81bc31 --- /dev/null +++ b/TUICallKit/TUICallService/const/index.d.ts @@ -0,0 +1,12 @@ +export * from './call'; +export * from './error'; +export * from './log'; +export declare const CALL_DATA_KEY: any; +export declare const NAME: any; +export declare const AudioCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call.png"; +export declare const VideoCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg"; +export declare const MAX_NUMBER_ROOM_ID = 2147483647; +export declare enum PLATFORM { + MAC = "mac", + WIN = "win" +} diff --git a/TUICallKit/TUICallService/const/index.js b/TUICallKit/TUICallService/const/index.js new file mode 100644 index 0000000..3ca1e32 --- /dev/null +++ b/TUICallKit/TUICallService/const/index.js @@ -0,0 +1,60 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PLATFORM = exports.MAX_NUMBER_ROOM_ID = exports.VideoCallIcon = exports.AudioCallIcon = exports.NAME = exports.CALL_DATA_KEY = void 0; +__exportStar(require("./call"), exports); +__exportStar(require("./error"), exports); +__exportStar(require("./log"), exports); +// import { keys } from 'ts-transformer-keys'; +// import { ICallStore } from '../interface/store'; +// console.warn('--> ', keys()) +exports.CALL_DATA_KEY = { + CALL_STATUS: 'callStatus', + CALL_ROLE: 'callRole', + CALL_MEDIA_TYPE: 'callMediaType', + LOCAL_USER_INFO: 'localUserInfo', + REMOTE_USER_INFO_LIST: 'remoteUserInfoList', + CALLER_USER_INFO: 'callerUserInfo', + IS_GROUP: 'isGroup', + CALL_DURATION: 'callDuration', + CALL_TIPS: 'callTips', + TOAST_INFO: 'toastInfo', + IS_MINIMIZED: 'isMinimized', + ENABLE_FLOAT_WINDOW: 'enableFloatWindow', + BIG_SCREEN_USER_ID: 'bigScreenUserId', + LANGUAGE: 'language', + IS_CLICKABLE: 'isClickable', + DISPLAY_MODE: 'displayMode', + VIDEO_RESOLUTION: 'videoResolution', + PUSHER: 'pusher', + PLAYER: 'player', + IS_EAR_PHONE: 'isEarPhone', + SHOW_PERMISSION_TIP: 'SHOW_PERMISSION_TIP', + GROUP_ID: 'groupID', + ROOM_ID: 'roomID', + SHOW_SELECT_USER: 'showSelectUser', +}; +exports.NAME = Object.assign({ PREFIX: '【CallService】', AUDIO: 'audio', VIDEO: 'video', LOCAL_VIDEO: 'localVideo', ERROR: 'error', TIMEOUT: 'timeout', RAF: 'raf', INTERVAL: 'interval', DEFAULT: 'default', BOOLEAN: 'boolean', STRING: 'string', NUMBER: 'number', OBJECT: 'object', ARRAY: 'array', FUNCTION: 'function', UNDEFINED: "undefined", ALL: 'all', MYSELF: 'myself', DEVICE_LIST: 'deviceList' }, exports.CALL_DATA_KEY); +exports.AudioCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call.png'; +exports.VideoCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg'; +exports.MAX_NUMBER_ROOM_ID = 2147483647; +var PLATFORM; +(function (PLATFORM) { + // eslint-disable-next-line no-unused-vars + PLATFORM["MAC"] = "mac"; + // eslint-disable-next-line no-unused-vars + PLATFORM["WIN"] = "win"; +})(PLATFORM = exports.PLATFORM || (exports.PLATFORM = {})); diff --git a/TUICallKit/TUICallService/const/log.d.ts b/TUICallKit/TUICallService/const/log.d.ts new file mode 100644 index 0000000..d265832 --- /dev/null +++ b/TUICallKit/TUICallService/const/log.d.ts @@ -0,0 +1,7 @@ +export declare enum LOG_LEVEL { + NORMAL = 0, + RELEASE = 1, + WARNING = 2, + ERROR = 3, + NONE = 4 +} diff --git a/TUICallKit/TUICallService/const/log.js b/TUICallKit/TUICallService/const/log.js new file mode 100644 index 0000000..44c05fc --- /dev/null +++ b/TUICallKit/TUICallService/const/log.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LOG_LEVEL = void 0; +/* eslint-disable */ +// 唯一一个变量格式有问题的, 但是为了和原来 TUICallKit 对外暴露的保持一致 +var LOG_LEVEL; +(function (LOG_LEVEL) { + LOG_LEVEL[LOG_LEVEL["NORMAL"] = 0] = "NORMAL"; + LOG_LEVEL[LOG_LEVEL["RELEASE"] = 1] = "RELEASE"; + LOG_LEVEL[LOG_LEVEL["WARNING"] = 2] = "WARNING"; + LOG_LEVEL[LOG_LEVEL["ERROR"] = 3] = "ERROR"; + LOG_LEVEL[LOG_LEVEL["NONE"] = 4] = "NONE"; +})(LOG_LEVEL = exports.LOG_LEVEL || (exports.LOG_LEVEL = {})); diff --git a/TUICallKit/TUICallService/index.d.ts b/TUICallKit/TUICallService/index.d.ts new file mode 100644 index 0000000..fc8bcff --- /dev/null +++ b/TUICallKit/TUICallService/index.d.ts @@ -0,0 +1,5 @@ +import TUICallService, { TUIGlobal, TUIStore } from './CallService/index'; +import { StoreName, NAME, CallRole, CallMediaType, CallStatus, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice } from './const/index'; +import { t } from './locales/index'; +declare const TUICallKitServer: TUICallService; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, CallStatus, CallRole, CallMediaType, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice, t, }; diff --git a/TUICallKit/TUICallService/index.js b/TUICallKit/TUICallService/index.js new file mode 100644 index 0000000..4c86f2e --- /dev/null +++ b/TUICallKit/TUICallService/index.js @@ -0,0 +1,44 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.AudioPlayBackDevice = exports.VideoDisplayMode = exports.VideoResolution = exports.StatusChange = exports.CallMediaType = exports.CallRole = exports.CallStatus = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = __importStar(require("./CallService/index")); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +const index_2 = require("./const/index"); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_2.StoreName; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_2.NAME; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_2.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_2.CallMediaType; } }); +Object.defineProperty(exports, "CallStatus", { enumerable: true, get: function () { return index_2.CallStatus; } }); +Object.defineProperty(exports, "StatusChange", { enumerable: true, get: function () { return index_2.StatusChange; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_2.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_2.VideoDisplayMode; } }); +Object.defineProperty(exports, "AudioPlayBackDevice", { enumerable: true, get: function () { return index_2.AudioPlayBackDevice; } }); +const index_3 = require("./locales/index"); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_3.t; } }); +// 实例化 +const TUICallKitServer = index_1.default.getInstance(); +exports.TUICallKitServer = TUICallKitServer; diff --git a/TUICallKit/TUICallService/interface/ICallService.d.ts b/TUICallKit/TUICallService/interface/ICallService.d.ts new file mode 100644 index 0000000..2e6eff1 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallService.d.ts @@ -0,0 +1,93 @@ +import { CallStatus, CallRole } from '../const/index'; +/** + * @interface ITUICallService +*/ +export interface ITUICallService { + /** + * 初始化 Service + * @function + * @private + */ + init(params: any): void; + /** + * 1v1 通话 + * @function + * @param {SwitchUserStatusParams} options 用户状态控制参数 + */ + call(callParams: ICallParams): void; +} +type SDKAppID = { + SDKAppID: number; +} | { + sdkAppID: number; +}; +export interface IInitParamsBase { + userID: string; + userSig: string; + tim?: any; + isFromChat?: boolean; +} +export type IInitParams = IInitParamsBase & SDKAppID; +export interface ICallParams { + userID: string; + type: number; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IGroupCallParams { + userIDList: Array; + type: number; + groupID: string; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IUserInfo { + userId: string; + nick?: string; + avatar?: string; + remark?: string; + displayUserInfo?: string; + isAudioAvailable?: boolean; + isVideoAvailable?: boolean; + volume?: number; + isEnter?: boolean; + domId?: string; +} +export interface IOfflinePushInfo { + title?: string; + description?: string; + androidOPPOChannelID?: string; + extension: String; +} +export interface ICallbackParam { + beforeCalling?: (...args: any[]) => void; + afterCalling?: (...args: any[]) => void; + onMinimized?: (...args: any[]) => void; + onMessageSentByMe?: (...args: any[]) => void; + kickedOut?: (...args: any[]) => void; + statusChanged?: (...args: any[]) => void; +} +export interface ISelfInfoParams { + nickName: string; + avatar: string; +} +export interface IBellParams { + callRole?: CallRole; + callStatus?: CallStatus; + isMuteBell?: boolean; + calleeBellFilePath?: string; +} +export interface IInviteUserParams { + userIDList: string[]; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IJoinInGroupCallParams { + type: number; + groupID: string; + roomID: number; +} +export {}; diff --git a/TUICallKit/TUICallService/interface/ICallService.js b/TUICallKit/TUICallService/interface/ICallService.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallService.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/ICallStore.d.ts b/TUICallKit/TUICallService/interface/ICallStore.d.ts new file mode 100644 index 0000000..9dcd2e2 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallStore.d.ts @@ -0,0 +1,33 @@ +import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList } from '../const/index'; +import { IUserInfo } from './index'; +export interface IToastInfo { + text: string; + type?: string; +} +export interface ICallStore { + callStatus: CallStatus; + callRole: CallRole; + callMediaType: CallMediaType; + localUserInfo: IUserInfo; + remoteUserInfoList: Array; + callerUserInfo: IUserInfo; + isGroup: boolean; + callDuration: string; + callTips: string; + toastInfo: IToastInfo; + isMinimized: boolean; + enableFloatWindow: boolean; + bigScreenUserId: string; + language: string; + isClickable: boolean; + showPermissionTip: boolean; + deviceList: TDeviceList; + groupID: string; + roomID: number; + displayMode: VideoDisplayMode; + videoResolution: VideoResolution; + pusher: any; + player: any[]; + isEarPhone: boolean; + showSelectUser: boolean; +} diff --git a/TUICallKit/TUICallService/interface/ICallStore.js b/TUICallKit/TUICallService/interface/ICallStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts b/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts new file mode 100644 index 0000000..91b86ce --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts @@ -0,0 +1,36 @@ +/** + * @interface TUIGlobal + * @property {Object} global 根据运行环境代理 wx、uni、window + * @property {Boolean} isPC true 标识是 pc 网页 + * @property {Boolean} isH5 true 标识是 手机 H5 + * @property {Boolean} isWeChat true 标识是 微信小程序 + * @property {Boolean} isApp true 标识是 uniapp 打包的 native app + * @property {Boolean} isUniPlatform true 标识当前应用是通过 uniapp 平台打包的产物 + * @property {Boolean} isOfficial true 标识是腾讯云官网 Demo 应用 + * @property {Boolean} isWIN true 标识是window系统pc + * @property {Boolean} isMAC true 标识是mac os系统pc +*/ +export interface ITUIGlobal { + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + /** + * 初始化 TUIGlobal 环境变量 + * @function + * @private + */ + initEnv(): void; + /** + * 初始化 isOfficial + * @function + * @param {number} SDKAppID 当前实例的应用 SDKAppID + * @private + */ + initOfficial(SDKAppID: number): void; +} diff --git a/TUICallKit/TUICallService/interface/ITUIGlobal.js b/TUICallKit/TUICallService/interface/ITUIGlobal.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIGlobal.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/ITUIStore.d.ts b/TUICallKit/TUICallService/interface/ITUIStore.d.ts new file mode 100644 index 0000000..5784ffa --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIStore.d.ts @@ -0,0 +1,75 @@ +import { StoreName } from '../const/index'; +export type Task = Record void, 1>>>; +export interface IOptions { + [key: string]: (newData?: any) => void; +} +/** + * @class TUIStore + * @property {ICustomStore} customStore 自定义 store,可根据业务需要通过以下 API 进行数据操作。 +*/ +export interface ITUIStore { + task: Task; + /** + * UI 组件注册监听 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options UI 组件注册的监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围 + * @example + * // UI 层监听会话列表更新通知 + * let onConversationListUpdated = function(conversationList) { + * console.warn(conversationList); + * } + * TUIStore.watch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 组件取消监听回调 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回调等 + * @example + * // UI 层取消监听会话列表更新通知 + * TUIStore.unwatch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + unwatch(storeName: StoreName, options: IOptions | string): void; + /** + * 获取 store 中的数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要获取的 key + * @private + */ + getData(storeName: StoreName, key: string): any; + /** + * 更新 store + * - 需要使用自定义 store 时可以用此 API 更新自定义数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要更新的 key + * @example + * // UI 层更新自定义 Store 数据 + * TUIStore.update(StoreName.CUSTOM, 'customKey', 'customData') + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 重置 store 内数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {Array} keyList 需要 reset 的 keyList + * @param {boolean} isNotificationNeeded 是否需要触发更新 + * @private + */ + reset: (storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean) => void; + /** + * 修改多个 key-value + * @param {Object} params 多个 key-value 组成的 object + * @param {StoreName} storeName store 名称 + */ + updateStore: (params: any, name?: StoreName) => void; +} diff --git a/TUICallKit/TUICallService/interface/ITUIStore.js b/TUICallKit/TUICallService/interface/ITUIStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/index.d.ts b/TUICallKit/TUICallService/interface/index.d.ts new file mode 100644 index 0000000..5f8f48c --- /dev/null +++ b/TUICallKit/TUICallService/interface/index.d.ts @@ -0,0 +1,4 @@ +export * from './ICallService'; +export * from './ICallStore'; +export * from './ITUIGlobal'; +export * from './ITUIStore'; diff --git a/TUICallKit/TUICallService/interface/index.js b/TUICallKit/TUICallService/interface/index.js new file mode 100644 index 0000000..ed699ff --- /dev/null +++ b/TUICallKit/TUICallService/interface/index.js @@ -0,0 +1,20 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./ICallService"), exports); +__exportStar(require("./ICallStore"), exports); +__exportStar(require("./ITUIGlobal"), exports); +__exportStar(require("./ITUIStore"), exports); diff --git a/TUICallKit/TUICallService/locales/en.d.ts b/TUICallKit/TUICallService/locales/en.d.ts new file mode 100644 index 0000000..c7efd74 --- /dev/null +++ b/TUICallKit/TUICallService/locales/en.d.ts @@ -0,0 +1,90 @@ +export declare const en: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'no response from the other side': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'no-user': string; + 'member-not-added': string; + 'input-phone-userID': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'Use-phone-and-computer': string; + 'Wechat scan right QR code': string; + 'Scan the QR code above': string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUICallKit/TUICallService/locales/en.js b/TUICallKit/TUICallService/locales/en.js new file mode 100644 index 0000000..9188607 --- /dev/null +++ b/TUICallKit/TUICallService/locales/en.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.en = void 0; +exports.en = { + 'hangup': 'Hang up', + 'reject': 'Decline', + 'other side reject call': 'other side reject call', + 'reject call': 'Reject Call', + 'accept': 'Accept', + 'cancel': 'Cancel Call', + 'other side line busy': 'other side line busy', + 'in busy': 'in busy', + 'call timeout': 'call timeout', + 'no response from the other side': 'no response from the other side', + 'end call': 'end call', + 'timeout': 'timeout', + 'kick out': 'kick out', + 'caller calling message': 'Waiting for the callee to accept the invitation...', + 'callee calling video message': 'You are invited to a video call...', + 'callee calling audio message': 'You are invited to a audio call...', + 'no microphone access': 'no microphone access', + 'no camera access': 'no camera access', + 'invite member': 'Invite Member', + 'speaker': 'speaker', + 'Invited group call': 'Invited you to a group call', + 'Those involved': 'Those involved in the call are', + 'call': 'call', + 'video-call': 'video call', + 'audio-call': 'audio call', + 'search': 'search', + 'search-result': 'search result', + 'no-user': 'user not found', + 'member-not-added': 'member not added', + 'input-phone-userID': 'phone number or userID', + 'not-login': 'not logged in', + 'login-status-expire': 'login status is invalid, please refresh the page and try again', + 'experience-multi-call': 'experience multi-person calls, please download the full-featured demo: ', + 'not-support-multi-call': 'multi-person call interface is not open', + 'userID': 'userID', + 'already-enter': 'entered the call', + 'waiting': 'Calling...', + 'camera-opened': 'Camera on', + 'camera-closed': 'Camera off', + 'microphone-opened': 'Mic on', + 'microphone-closed': 'Mic off', + 'camera': 'Camera', + 'microphone': 'Microphone', + 'image-resolution': 'Resolution', + 'default-image-resolution': 'Default', + 'invited-person': 'Invite', + 'video-to-audio': 'Switch to audio', + 'me': '(me)', + 'be-rejected': 'Call declined, ', + 'be-no-response': 'No response, ', + 'be-line-busy': 'Line busy, ', + 'be-canceled': 'The call is canceled, ', + 'voice-call-end': 'Voice call ended', + 'video-call-end': 'Video call ended', + 'method-call-failed': 'Failed to sync the operation', + 'failed-to-obtain-permission': 'Failed to obtain permissions', + 'environment-detection-failed': 'Failed to check the environment', + 'switchToAudioCall-call-failed': 'switch to audio call method failed', + 'switchToVideoCall-call-failed': 'switch to video call method failed', + 'microphone-unavailable': 'No mic found', + 'camera-unavailable': 'No camera found', + 'ban-device': 'Device access denied', + 'not-supported-webrtc': 'Your current environment does not support WebRTC', + 'blacklist-user-tips': 'The identifier is in blacklist. Failed to send this message!', + 'is-already-calling': 'TUICallKit is already on a call', + 'need-init': 'Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ', + "can't call yourself": "Can't call yourself", + 'Use-phone-and-computer': 'Use your mobile phone and computer to experience video calls', + 'Wechat scan right QR code': 'Wechat scan right QR code', + 'Scan the QR code above': 'Scan the QR code above', + 'accept-error': 'Accept failed', + 'accept-device-error': 'Accept failed, unable to auth calling device', + 'call-error': 'Start call failed', + 'browser-authorization': 'Browser authorization', + 'mac-privacy': 'System Preferences -> Security and Privacy -> Privacy', + 'win-privacy': 'Setting -> Privacy and Security -> App permissions', + 'mac-preferences': 'Open System Preferences', + 'win-preferences': 'Open Setting', + 'open camera': 'Open Camera', + 'close camera': 'Close Camera', + 'open microphone': 'Open Microphone', + 'close microphone': 'Close Microphone', + 'Please enter userID': 'Please enter userID', + 'View more': 'View more', + 'people selected': 'people selected', + 'Select all': 'Select all', + 'Cancel': 'Cancel', + 'Done': 'Done', +}; diff --git a/TUICallKit/TUICallService/locales/index.d.ts b/TUICallKit/TUICallService/locales/index.d.ts new file mode 100644 index 0000000..afbb43d --- /dev/null +++ b/TUICallKit/TUICallService/locales/index.d.ts @@ -0,0 +1,10 @@ +export declare const CallTips: any; +export declare const languageData: languageDataType; +export declare function t(key: any): string; +interface languageItemType { + [key: string]: string; +} +interface languageDataType { + [key: string]: languageItemType; +} +export {}; diff --git a/TUICallKit/TUICallService/locales/index.js b/TUICallKit/TUICallService/locales/index.js new file mode 100644 index 0000000..12a5316 --- /dev/null +++ b/TUICallKit/TUICallService/locales/index.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.languageData = exports.CallTips = void 0; +const index_1 = require("../CallService/index"); +const index_2 = require("../const/index"); +const en_1 = require("./en"); +const zh_cn_1 = require("./zh-cn"); +const ja_JP_1 = require("./ja_JP"); +exports.CallTips = { + OTHER_SIDE: 'other side', + CANCEL: 'cancel', + OTHER_SIDE_REJECT_CALL: 'other side reject call', + REJECT_CALL: 'reject call', + OTHER_SIDE_LINE_BUSY: 'other side line busy', + IN_BUSY: 'in busy', + CALL_TIMEOUT: 'call timeout', + END_CALL: 'end call', + TIMEOUT: 'timeout', + KICK_OUT: 'kick out', + CALLER_CALLING_MSG: 'caller calling message', + CALLEE_CALLING_VIDEO_MSG: 'callee calling video message', + CALLEE_CALLING_AUDIO_MSG: 'callee calling audio message', + NO_MICROPHONE_DEVICE_PERMISSION: 'no microphone access', + NO_CAMERA_DEVICE_PERMISSION: 'no camera access', +}; +exports.languageData = { + en: en_1.en, + 'zh-cn': zh_cn_1.zh, + ja_JP: ja_JP_1.ja_JP, +}; +// language translate +function t(key) { + var _a; + const language = index_1.TUIStore.getData(index_2.StoreName.CALL, index_2.NAME.LANGUAGE); + // eslint-disable-next-line + for (const langKey in exports.languageData) { + if (langKey === language) { + const currentLanguage = exports.languageData[langKey]; + // eslint-disable-next-line + for (const sentenceKey in currentLanguage) { + if (sentenceKey === key) { + return currentLanguage[sentenceKey]; + } + } + } + } + const enString = (_a = key['en']) === null || _a === void 0 ? void 0 : _a.key; // eslint-disable-line + console.error(`${index_2.NAME.PREFIX}translation is not found: ${key}.`); + return enString; +} +exports.t = t; diff --git a/TUICallKit/TUICallService/locales/ja_JP.d.ts b/TUICallKit/TUICallService/locales/ja_JP.d.ts new file mode 100644 index 0000000..d03dfc7 --- /dev/null +++ b/TUICallKit/TUICallService/locales/ja_JP.d.ts @@ -0,0 +1,85 @@ +export declare const ja_JP: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUICallKit/TUICallService/locales/ja_JP.js b/TUICallKit/TUICallService/locales/ja_JP.js new file mode 100644 index 0000000..ca52108 --- /dev/null +++ b/TUICallKit/TUICallService/locales/ja_JP.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ja_JP = void 0; +exports.ja_JP = { + 'hangup': '通話終了', + 'reject': '拒否', + 'other side reject call': '通話が拒否されました', + 'reject call': '通話拒否', + 'accept': '応答', + 'cancel': '通話をキャンセル', + 'other side line busy': '相手が通話中です', + 'in busy': '通話中', + 'call timeout': '呼び出しタイムアウト', + 'end call': '通話終了', + 'timeout': 'タイムアウト', + 'kick out': 'キックアウトされました', + 'caller calling message': '相手が招待を承諾するのを待っています。', + 'callee calling video message': 'ビデオ通話に招待されました。', + 'callee calling audio message': '音声通話に招待されました。', + 'no microphone access': 'マイクにアクセスできません', + 'no camera access': 'カメラにアクセスできません', + 'invite member': 'メンバーを招待する', + 'speaker': 'スピーカー', + 'Invited group call': 'グループ通話に招待されました。', + 'Those involved': '参加者:', + 'call': '通話', + 'video-call': 'ビデオ通話', + 'audio-call': '音声通話', + 'search': '検索', + 'search-result': '検索結果', + 'Wechat scan right QR code': 'WeChatで右側にあるQRコードを読み取ります。', + 'Use-phone-and-computer': '携帯電話とコンピュータを使用してビデオ通話を体験してください', + 'Scan the QR code above': '上のQRコードを読み取ります。', + 'no-user': 'ユーザーが見つかりませんでした', + 'member-not-added': 'メンバーが追加されていません', + 'not-login': 'ログインしていません', + 'login-status-expire': 'ログインの有効期限が過ぎています。ページを更新してもう一度お試しください', + 'experience-multi-call': '複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください', + 'not-support-multi-call': 'グループ通話インターフェイスが開いていません', + 'input-phone-userID': '携帯電話番号/ユーザーIDを入力してください', + 'userID': 'ユーザーID', + 'already-enter': 'すでに通話に参加しています', + 'waiting': '応答を待っています...', + 'camera-opened': 'カメラがオンになっています', + 'camera-closed': 'カメラがオフになっています', + 'microphone-opened': 'マイクがオンになっています', + 'microphone-closed': 'マイクがオフになっています', + 'camera': 'カメラ', + 'microphone': 'マイク', + 'image-resolution': '解像度', + 'default-image-resolution': 'デフォルト解像度', + 'invited-person': 'メンバーを招待', + 'video-to-audio': '音声通話に切り替えます', + 'me': '(自分)', + 'be-rejected': '通話が拒否されました, ', + 'be-no-response': '応答なし, ', + 'be-line-busy': '相手が通話中です, ', + 'be-canceled': '相手が通話をキャンセルしました', + 'voice-call-end': '音声通話が終了しました', + 'video-call-end': 'ビデオ通話が終了しました', + 'method-call-failed': '操作の同期に失敗しました', + 'failed-to-obtain-permission': '権限の取得に失敗しました', + 'environment-detection-failed': '環境の検出に失敗しました', + 'switchToAudioCall-call-failed': '音声通話に切り替えることはできません', + 'switchToVideoCall-call-failed': 'ビデオ通話に切り替えることはできません', + 'microphone-unavailable': '使用できるマイクがありません', + 'camera-unavailable': '使用できるカメラがありません', + 'ban-device': 'デバイスへのアクセスが拒否されました', + 'not-supported-webrtc': '現在の環境はWebRTCをサポートしていません', + 'blacklist-user-tips': 'ユーザーはブラックリストに登録され、通話が開始できませんでした', + 'is-already-calling': 'TUICallKit はすでに通話中です', + 'need-init': 'TUICallKitで通話を開始する前に、TUICallKitServer.init() メソッドが正常に実行されたことを確認してください。', + "can't call yourself": '自分に電話をかけることができません', + 'accept-error': '接続できませんでした', + 'accept-device-error': '接続できませんでした。発信側デバイスを認証できません', + 'call-error': '通話が開始できませんでした', + 'browser-authorization': 'ブラウザ認証', + 'mac-privacy': 'システム環境設定 -> セキュリティとプライバシー ->プライバシー', + 'win-privacy': '設定 -> セキュリティとプライバシー ->アプリのアクセス許可', + 'mac-preferences': 'システム環境設定を開く', + 'win-preferences': 'システム設定を開く', + 'Please enter userID': 'ユーザーIDを入力してください', + 'View more': 'もっと見る', + 'people selected': '人が選択されました', + 'Select all': 'すべて選択', + 'Cancel': 'キャンセル', + 'Done': '完了', +}; diff --git a/TUICallKit/TUICallService/locales/zh-cn.d.ts b/TUICallKit/TUICallService/locales/zh-cn.d.ts new file mode 100644 index 0000000..369b1c7 --- /dev/null +++ b/TUICallKit/TUICallService/locales/zh-cn.d.ts @@ -0,0 +1,89 @@ +export declare const zh: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUICallKit/TUICallService/locales/zh-cn.js b/TUICallKit/TUICallService/locales/zh-cn.js new file mode 100644 index 0000000..ac854ae --- /dev/null +++ b/TUICallKit/TUICallService/locales/zh-cn.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.zh = void 0; +exports.zh = { + 'hangup': '挂断', + 'reject': '拒绝', + 'other side reject call': '对方已拒绝', + 'reject call': '拒绝通话', + 'accept': '接受', + 'cancel': '取消通话', + 'other side line busy': '对方忙线', + 'in busy': '正在忙', + 'call timeout': '呼叫超时', + 'end call': '结束通话', + 'timeout': '超时', + 'kick out': '被踢', + 'caller calling message': '正在等待对方接受邀请…', + 'callee calling video message': '邀请您进行视频通话…', + 'callee calling audio message': '邀请您进行语音通话…', + 'no microphone access': '没有麦克风权限', + 'no camera access': '没有摄像头权限', + 'invite member': '邀请成员', + 'speaker': '扬声器', + 'Invited group call': '邀请你参加多人通话', + 'Those involved': '参与通话的有:', + 'call': '通话', + 'video-call': '视频通话', + 'audio-call': '音频通话', + 'search': '搜索', + 'search-result': '搜索结果', + 'Wechat scan right QR code': '微信扫右二维码', + 'Use-phone-and-computer': '用手机与电脑互打体验视频通话', + 'Scan the QR code above': '扫描上方二维码', + 'no-user': '未搜索到用户', + 'member-not-added': '未添加成员', + 'not-login': '未登录', + 'login-status-expire': '登录状态已失效,请刷新网页重试', + 'experience-multi-call': '体验多人通话请下载全功能demo:', + 'not-support-multi-call': '多人通话接口未开放', + 'input-phone-userID': '请输入手机号/用户ID', + 'userID': '用户ID', + 'already-enter': '已经进入当前通话', + 'waiting': '等待接听...', + 'camera-opened': '摄像头已开', + 'camera-closed': '摄像头已关', + 'microphone-opened': '麦克风已开', + 'microphone-closed': '麦克风已关', + 'camera': '摄像头', + 'microphone': '麦克风', + 'image-resolution': '分辨率', + 'default-image-resolution': '默认分辨率', + 'invited-person': '添加成员', + 'video-to-audio': '切到语音通话', + 'me': '(我)', + 'be-rejected': '对方已拒绝,', + 'be-no-response': '对方无应答,', + 'be-line-busy': '对方忙线中,', + 'be-canceled': '对方已取消', + 'voice-call-end': '语音通话结束', + 'video-call-end': '视频通话结束', + 'method-call-failed': '同步操作失败', + 'failed-to-obtain-permission': '权限获取失败', + 'environment-detection-failed': '环境检测失败', + 'switchToAudioCall-call-failed': '切语音调用失败', + 'switchToVideoCall-call-failed': '切视频调用失败', + 'microphone-unavailable': '没有可用的麦克风设备', + 'camera-unavailable': '没有可用的摄像头设备', + 'ban-device': '用户禁止使用设备', + 'not-supported-webrtc': '当前环境不支持 WebRTC', + 'blacklist-user-tips': '发起通话失败,被对方拉入黑名单,禁止发起!', + 'is-already-calling': 'TUICallKit 已在通话状态', + 'need-init': 'TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功', + "can't call yourself": '不能呼叫自己', + 'accept-error': '接通失败', + 'accept-device-error': '接通失败,通话设备获取失败', + 'call-error': '发起通话失败', + 'browser-authorization': '浏览器授权', + 'mac-privacy': '系统偏好设置 -> 安全与隐私 -> 隐私', + 'win-privacy': '设置 -> 隐私和安全性 -> 应用权限', + 'mac-preferences': '打开系统偏好设置', + 'win-preferences': '打开系统设置', + 'open camera': '打开摄像头', + 'close camera': '关闭摄像头', + 'open microphone': '打开麦克风', + 'close microphone': '关闭麦克风', + 'Please enter userID': '请输入 userID', + 'View more': '查看更多', + 'people selected': '人已选中', + 'Select all': '全选', + 'Cancel': '取消', + 'Done': '完成', +}; diff --git a/TUICallKit/TUICallService/serve/callManager.d.ts b/TUICallKit/TUICallService/serve/callManager.d.ts new file mode 100644 index 0000000..3474175 --- /dev/null +++ b/TUICallKit/TUICallService/serve/callManager.d.ts @@ -0,0 +1,11 @@ +export declare class CallManager { + private _globalCallPagePath; + private _isPageRedirected; + init(params: any): Promise; + private _watchTUIStore; + private _unwatchTUIStore; + private _handleCallStatusChange; + private _handleCallStatusToCalling; + private _handleCallStatusToIdle; + destroyed(): Promise; +} diff --git a/TUICallKit/TUICallService/serve/callManager.js b/TUICallKit/TUICallService/serve/callManager.js new file mode 100644 index 0000000..7f4fbe5 --- /dev/null +++ b/TUICallKit/TUICallService/serve/callManager.js @@ -0,0 +1,133 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallManager = void 0; +const index_1 = require("../../index"); +const index_2 = require("../const/index"); +const index_3 = require("../utils/validate/index"); +/** + * @param {Number} sdkAppID 用户的sdkAppID 必传 + * @param {String} userID 用户的userID 必传 + * @param {String} userSig 用户的userSig 必传 + * @param {String} globalCallPagePath 跳转的路径 必传 + * @param {ChatSDK} tim tim实例 非必传 + */ +const PREFIX = 'callManager'; +class CallManager { + constructor() { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + switch (value) { + case index_2.CallStatus.CALLING: + case index_2.CallStatus.CONNECTED: + this._handleCallStatusToCalling(); + break; + case index_2.CallStatus.IDLE: + this._handleCallStatusToIdle(); + break; + } + }); + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + const { sdkAppID, userID, userSig, globalCallPagePath, tim } = params; + if (!globalCallPagePath) { + console.error(`${PREFIX} globalCallPagePath Can not be empty!`); + return; + } + ; + this._globalCallPagePath = globalCallPagePath; + try { + yield index_1.TUICallKitServer.init({ + sdkAppID, + userID, + userSig, + tim, + }); + this._watchTUIStore(); + // 全局监听下,关闭悬浮窗 + index_1.TUICallKitServer.enableFloatWindow(false); + console.log(`${PREFIX} init Ready!`); + } + catch (error) { + console.error(`${PREFIX} init fail!`); + } + }); + } + // =========================【监听 TUIStore 中的状态】========================= + _watchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }, { + notifyRangeWhenWatch: index_1.NAME.MYSELF, + }); + } + _unwatchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _handleCallStatusToCalling() { + if (this._isPageRedirected) + return; + // @ts-ignore + wx.navigateTo({ + url: `/${this._globalCallPagePath}`, + success: () => { + this._isPageRedirected = true; + }, + fail: () => { + console.error(`${PREFIX} navigateTo fail!`); + }, + complete: () => { }, + }); + } + _handleCallStatusToIdle() { + if (!this._isPageRedirected) + return; + // @ts-ignore + wx.navigateBack({ + success: () => { + this._isPageRedirected = false; + }, + fail: () => { + console.error(`${PREFIX} navigateBack fail!`); + }, + complete: () => { }, + }); + } + // 卸载 callManger + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._unwatchTUIStore(); + yield index_1.TUICallKitServer.destroyed(); + }); + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], CallManager.prototype, "init", null); +exports.CallManager = CallManager; diff --git a/TUICallKit/TUICallService/utils/common-utils.d.ts b/TUICallKit/TUICallService/utils/common-utils.d.ts new file mode 100644 index 0000000..d9bfeaf --- /dev/null +++ b/TUICallKit/TUICallService/utils/common-utils.d.ts @@ -0,0 +1,53 @@ +export declare const isUndefined: (input: any) => boolean; +export declare const isPlainObject: (input: any) => boolean; +export declare const isArray: (input: any) => boolean; +export declare const isPrivateKey: (key: string) => boolean; +export declare const isUrl: (url: string) => boolean; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +export declare const isString: (input: any) => boolean; +export declare const isBoolean: (input: any) => boolean; +export declare const isNumber: (input: any) => boolean; +export declare function formatTime(secondTime: number): string; +export declare function formatTimeInverse(stringTime: string): number; +export declare function isJSON(str: string): boolean; +export declare const JSONToObject: (str: string) => any; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +export declare const retryPromise: (promise: Promise, num?: number, time?: number) => Promise; +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleRepeatedCallError(error: any): boolean; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleNoDevicePermissionError(error: any): boolean; +export declare function performanceNow(): number; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +export declare const isFunction: (input: any) => boolean; +export declare const getLanguage: () => string; +export declare function noop(e: any): void; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +export declare const getType: (input: any) => any; +export declare function modifyObjectKey(obj: any, oldKey: any, newKey: any): any; diff --git a/TUICallKit/TUICallService/utils/common-utils.js b/TUICallKit/TUICallService/utils/common-utils.js new file mode 100644 index 0000000..53237d0 --- /dev/null +++ b/TUICallKit/TUICallService/utils/common-utils.js @@ -0,0 +1,249 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modifyObjectKey = exports.getType = exports.noop = exports.getLanguage = exports.isFunction = exports.performanceNow = exports.handleNoDevicePermissionError = exports.handleRepeatedCallError = exports.retryPromise = exports.JSONToObject = exports.isJSON = exports.formatTimeInverse = exports.formatTime = exports.isNumber = exports.isBoolean = exports.isString = exports.isUrl = exports.isPrivateKey = exports.isArray = exports.isPlainObject = exports.isUndefined = void 0; +const index_1 = require("../const/index"); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const isUndefined = function (input) { + return typeof input === index_1.NAME.UNDEFINED; +}; +exports.isUndefined = isUndefined; +const isPlainObject = function (input) { + // 注意不能使用以下方式判断,因为IE9/IE10下,对象的__proto__是 undefined + // return isObject(input) && input.__proto__ === Object.prototype; + if (typeof input !== index_1.NAME.OBJECT || input === null) { + return false; + } + const proto = Object.getPrototypeOf(input); + if (proto === null) { // edge case Object.create(null) + return true; + } + let baseProto = proto; + while (Object.getPrototypeOf(baseProto) !== null) { + baseProto = Object.getPrototypeOf(baseProto); + } + // 原型链第一个和最后一个比较 + return proto === baseProto; +}; +exports.isPlainObject = isPlainObject; +const isArray = function (input) { + if (typeof Array.isArray === index_1.NAME.FUNCTION) { + return Array.isArray(input); + } + return Object.prototype.toString.call(input).match(/^\[object (.*)\]$/)[1].toLowerCase() === index_1.NAME.ARRAY; +}; +exports.isArray = isArray; +const isPrivateKey = function (key) { + return key.startsWith('_'); +}; +exports.isPrivateKey = isPrivateKey; +const isUrl = function (url) { + return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(url); +}; +exports.isUrl = isUrl; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +const isString = function (input) { + return typeof input === index_1.NAME.STRING; +}; +exports.isString = isString; +const isBoolean = function (input) { + return typeof input === index_1.NAME.BOOLEAN; +}; +exports.isBoolean = isBoolean; +const isNumber = function (input) { + return ( + // eslint-disable-next-line + input !== null && + ((typeof input === index_1.NAME.NUMBER && !isNaN(input - 0)) || (typeof input === index_1.NAME.OBJECT && input.constructor === Number))); +}; +exports.isNumber = isNumber; +function formatTime(secondTime) { + const hours = Math.floor(secondTime / 3600); + const minutes = Math.floor((secondTime % 3600) / 60); + const seconds = Math.floor(secondTime % 60); + let callDurationStr = hours > 9 ? `${hours}` : `0${hours}`; + callDurationStr += minutes > 9 ? `:${minutes}` : `:0${minutes}`; + callDurationStr += seconds > 9 ? `:${seconds}` : `:0${seconds}`; + return callDurationStr; +} +exports.formatTime = formatTime; +function formatTimeInverse(stringTime) { + const list = stringTime.split(':'); + return parseInt(list[0]) * 3600 + parseInt(list[1]) * 60 + parseInt(list[2]); // eslint-disable-line +} +exports.formatTimeInverse = formatTimeInverse; +// Determine if it is a JSON string +function isJSON(str) { + if (typeof str === index_1.NAME.STRING) { + try { + const data = JSON.parse(str); + if (data) { + return true; + } + return false; + } + catch (error) { + console.debug(error); + return false; + } + } + return false; +} +exports.isJSON = isJSON; +// Determine if it is a JSON string +const JSONToObject = function (str) { + if (!str || !isJSON(str)) { + return str; + } + return JSON.parse(str); +}; +exports.JSONToObject = JSONToObject; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +const retryPromise = (promise, num = 6, time = 0.5) => { + let n = num; + const func = () => promise; + return func() + .catch((error) => { + if (n === 0) { + throw error; + } + const timer = setTimeout(() => { + func(); + clearTimeout(timer); + n = n - 1; + }, time * 1000); + }); +}; +exports.retryPromise = retryPromise; +// /** +// * 节流函数(目前 TUICallKit 增加防重调用装饰器,该方法可删除) +// * @param {Function} func 传入的函数 +// * @param {wait} time 间隔时间(ms) +// */ +// export const throttle = (func: Function, wait: number) => { +// let previousTime = 0; +// return function () { +// const now = Date.now(); +// const args = [...arguments]; +// if (now - previousTime > wait) { +// func.apply(this, args); +// previousTime = now; +// } +// }; +// } +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleRepeatedCallError(error) { + if ((error === null || error === void 0 ? void 0 : error.message.indexOf('is ongoing, please avoid repeated calls')) !== -1) { + return true; + } + return false; +} +exports.handleRepeatedCallError = handleRepeatedCallError; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleNoDevicePermissionError(error) { + const { message } = error; + if (message.indexOf('NotAllowedError: Permission denied') !== -1) { + return true; + } + return false; +} +exports.handleNoDevicePermissionError = handleNoDevicePermissionError; +/* + * 获取向下取整的 performance.now() 值 + * @export + * @return {Number} + */ +function performanceNow() { + // 在不支持 performance.now 的浏览器中,使用 Date.now() + // 例如 ie 9,ie 10,避免加载 sdk 时报错 + if (!performance || !performance.now) { + return Date.now(); + } + return Math.floor(performance.now()); +} +exports.performanceNow = performanceNow; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +const isFunction = function (input) { + return typeof input === index_1.NAME.FUNCTION; +}; +exports.isFunction = isFunction; +/* + * 获取浏览器语言 + * @export + * @return {zh-cn | en} + */ +const getLanguage = () => { + if (tuiGlobal_1.default.getInstance().isWeChat) { + return 'zh-cn'; + } + // @ts-ignore + const lang = ((navigator === null || navigator === void 0 ? void 0 : navigator.language) || (navigator === null || navigator === void 0 ? void 0 : navigator.userLanguage) || '').substr(0, 2); + let language = 'en'; + switch (lang) { + case 'zh': + language = 'zh-cn'; + break; + case 'ja': + language = 'ja_JP'; + break; + default: + language = 'en'; + } + return language; +}; +exports.getLanguage = getLanguage; +function noop(e) { } +exports.noop = noop; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +const getType = function (input) { + return Object.prototype.toString + .call(input) + .match(/^\[object (.*)\]$/)[1] + .toLowerCase(); +}; +exports.getType = getType; +// 修改对象键名 +function modifyObjectKey(obj, oldKey, newKey) { + if (!obj.hasOwnProperty(oldKey)) { + return obj; + } + const newObj = {}; + Object.keys(obj).forEach(key => { + if (key === oldKey) { + newObj[newKey] = obj[key]; + } + else { + newObj[key] = obj[key]; + } + }); + return newObj; +} +exports.modifyObjectKey = modifyObjectKey; diff --git a/TUICallKit/TUICallService/utils/env.d.ts b/TUICallKit/TUICallService/utils/env.d.ts new file mode 100644 index 0000000..59cdbb7 --- /dev/null +++ b/TUICallKit/TUICallService/utils/env.d.ts @@ -0,0 +1,10 @@ +export declare const IN_WX_MINI_APP: boolean; +export declare const IN_UNI_NATIVE_APP: boolean; +export declare const IN_MINI_APP: boolean; +export declare const IN_UNI_APP: boolean; +export declare const IN_BROWSER: boolean; +export declare const APP_NAMESPACE: any; +export declare const IS_H5: boolean; +export declare const IS_PC: boolean; +export declare const IS_WIN: any; +export declare const IS_MAC: any; diff --git a/TUICallKit/TUICallService/utils/env.js b/TUICallKit/TUICallService/utils/env.js new file mode 100644 index 0000000..90200e0 --- /dev/null +++ b/TUICallKit/TUICallService/utils/env.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_MAC = exports.IS_WIN = exports.IS_PC = exports.IS_H5 = exports.APP_NAMESPACE = exports.IN_BROWSER = exports.IN_UNI_APP = exports.IN_MINI_APP = exports.IN_UNI_NATIVE_APP = exports.IN_WX_MINI_APP = void 0; +// 在 uniApp 框架下,打包 H5、ios app、android app 时存在 wx/qq/tt/swan/my 等变量会导致引入 web sdk 环境判断失效 +// 小程序 getSystemInfoSync 返回的 fontSizeSetting 在 H5 和 app 中为 undefined,所以通过 fontSizeSetting 增强小程序环境判断 +// wx 小程序 +exports.IN_WX_MINI_APP = (typeof wx !== 'undefined' && typeof wx.getSystemInfoSync === 'function' && Boolean(wx.getSystemInfoSync().fontSizeSetting)); +// 用 uni-app 打包 native app,此时运行于 js core,无 window 等对象,此时调用 api 都得 uni.xxx,由于风格跟小程序类似,就归为 IN_MINI_APP 的一种 +exports.IN_UNI_NATIVE_APP = (typeof uni !== 'undefined' && typeof uni === 'undefined'); +exports.IN_MINI_APP = exports.IN_WX_MINI_APP || exports.IN_UNI_NATIVE_APP; +exports.IN_UNI_APP = (typeof uni !== 'undefined'); +// 在 uniApp 框架下,由于客户打包 ios app、android app 时 window 不一定存在,所以通过 !IN_MINI_APP 进行判断 +// 非 uniApp 框架下,仍然通过 window 结合 IN_MINI_APP 进行判断,可兼容 Taro3.0+ 暴露 window 对象引起的 IN_BROWSER 判断失效问题 +exports.IN_BROWSER = (function () { + if (typeof uni !== 'undefined') { + return !exports.IN_MINI_APP; + } + return (typeof window !== 'undefined') && !exports.IN_MINI_APP; +}()); +// 命名空间 +exports.APP_NAMESPACE = (function () { + if (exports.IN_WX_MINI_APP) { + return wx; + } + if (exports.IN_UNI_APP) { + return uni; + } + return window; +}()); +// eslint-disable-next-line no-mixed-operators +const USER_AGENT = exports.IN_BROWSER && window && window.navigator && window.navigator.userAgent || ''; +const IS_ANDROID = /Android/i.test(USER_AGENT); +const IS_WIN_PHONE = /(?:Windows Phone)/.test(USER_AGENT); +const IS_SYMBIAN = /(?:SymbianOS)/.test(USER_AGENT); +const IS_IOS = /iPad/i.test(USER_AGENT) || /iPhone/i.test(USER_AGENT) || /iPod/i.test(USER_AGENT); +exports.IS_H5 = IS_ANDROID || IS_WIN_PHONE || IS_SYMBIAN || IS_IOS; +exports.IS_PC = exports.IN_BROWSER && !exports.IS_H5; +exports.IS_WIN = exports.IS_PC && USER_AGENT.includes('Windows NT'); +exports.IS_MAC = exports.IS_PC && USER_AGENT.includes('Mac'); diff --git a/TUICallKit/TUICallService/utils/index.d.ts b/TUICallKit/TUICallService/utils/index.d.ts new file mode 100644 index 0000000..e54866b --- /dev/null +++ b/TUICallKit/TUICallService/utils/index.d.ts @@ -0,0 +1 @@ +export declare function checkLocalMP3FileExists(src: string): Promise; diff --git a/TUICallKit/TUICallService/utils/index.js b/TUICallKit/TUICallService/utils/index.js new file mode 100644 index 0000000..2b54e87 --- /dev/null +++ b/TUICallKit/TUICallService/utils/index.js @@ -0,0 +1,33 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkLocalMP3FileExists = void 0; +function checkLocalMP3FileExists(src) { + return __awaiter(this, void 0, void 0, function* () { + if (!src) + return false; + try { + const response = yield new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.open('HEAD', src, true); + xhr.onload = () => resolve(xhr); + xhr.onerror = () => reject(xhr); + xhr.send(); + }); + return response.status === 200 && response.getResponseHeader('Content-Type') === 'audio/mpeg'; + } + catch (error) { + console.warn(error); + return false; + } + }); +} +exports.checkLocalMP3FileExists = checkLocalMP3FileExists; diff --git a/TUICallKit/TUICallService/utils/is-empty.d.ts b/TUICallKit/TUICallService/utils/is-empty.d.ts new file mode 100644 index 0000000..0ddd31f --- /dev/null +++ b/TUICallKit/TUICallService/utils/is-empty.d.ts @@ -0,0 +1,2 @@ +declare const isEmpty: (input: any) => boolean; +export default isEmpty; diff --git a/TUICallKit/TUICallService/utils/is-empty.js b/TUICallKit/TUICallService/utils/is-empty.js new file mode 100644 index 0000000..aee8359 --- /dev/null +++ b/TUICallKit/TUICallService/utils/is-empty.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common_utils_1 = require("./common-utils"); +const isEmpty = function (input) { + // Null and Undefined... + if (input === null || typeof (input) === 'undefined') + return true; + // Booleans... + if (typeof input === 'boolean') + return false; + // Numbers... + if (typeof input === 'number') + return input === 0; + // Strings... + if (typeof input === 'string') + return input.length === 0; + // Functions... + if (typeof input === 'function') + return input.length === 0; + // Arrays... + if (Array.isArray(input)) + return input.length === 0; + // Errors... + if (input instanceof Error) + return input.message === ''; + // plain object + if ((0, common_utils_1.isPlainObject)(input)) { + // eslint-disable-next-line + for (const key in input) { + if (Object.prototype.hasOwnProperty.call(input, key)) { + return false; + } + } + return true; + } + return false; +}; +exports.default = isEmpty; diff --git a/TUICallKit/TUICallService/utils/timer.d.ts b/TUICallKit/TUICallService/utils/timer.d.ts new file mode 100644 index 0000000..d88f832 --- /dev/null +++ b/TUICallKit/TUICallService/utils/timer.d.ts @@ -0,0 +1,64 @@ +/// +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +declare class Timer { + static taskMap: Map; + static currentTaskID: number; + static generateTaskID(): number; + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName: any, callback: any, options: any): any; + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem: any): NodeJS.Timer; + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem: any): NodeJS.Timeout; + static hasTask(taskID: any): boolean; + static clearTask(taskID: any): boolean; + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem: any): boolean; +} +export default Timer; diff --git a/TUICallKit/TUICallService/utils/timer.js b/TUICallKit/TUICallService/utils/timer.js new file mode 100644 index 0000000..55682e3 --- /dev/null +++ b/TUICallKit/TUICallService/utils/timer.js @@ -0,0 +1,154 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/* eslint-disable */ +const common_utils_1 = require("./common-utils"); +const index_1 = require("../const/index"); +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +class Timer { + static generateTaskID() { + return this.currentTaskID++; + } + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName = index_1.NAME.TIMEOUT, callback, options) { + // default options + if (taskName === index_1.NAME.INTERVAL) { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + else { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + // call run(function, {...}) + if ((0, common_utils_1.isPlainObject)(callback)) { + options = Object.assign(Object.assign({}, options), callback); + } + if ((0, common_utils_1.isFunction)(taskName)) { + callback = taskName; + taskName = index_1.NAME.TIMEOUT; + } + // 1. 创建 taskID,作为 timer task 的唯一标识,在本函数执行完后返回,用于在调用的地方实现互斥逻辑 + // 2. 根据 taskName 执行相应的函数 + const taskItem = Object.assign({ taskID: this.generateTaskID(), loopCount: 0, intervalID: null, timeoutID: null, taskName, + callback }, options); + this.taskMap.set(taskItem.taskID, taskItem); + // console.log(`timer run task:${taskItem.taskName}, task queue size: ${this.taskMap.size}`); + if (taskName === index_1.NAME.INTERNAL) { + this.interval(taskItem); + } + else { + this.timeout(taskItem); + } + return taskItem.taskID; + } + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem) { + // setInterval 缺点,浏览器退后台会降频,循环执行间隔时间不可靠 + // 创建进入定时器循环的任务函数,函数内:1. 判断是否满足执行条件,2.执行 callback + // 通过 setInterval 执行任务函数 + // 将 intervalID 记录到 taskMap 对应的 item + const task = () => { + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + }; + return taskItem.intervalID = setInterval(task, taskItem.delay); + } + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem) { + // setTimeout 浏览器退后台,延迟变为至少1s + const task = () => { + // 执行回调 + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + // 不修正延迟,每次callback间隔平均 + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + }; + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + } + static hasTask(taskID) { + return this.taskMap.has(taskID); + } + static clearTask(taskID) { + // console.log('timer clearTask start', `| taskID:${taskID} | size:${this.taskMap.size}`); + if (!this.taskMap.has(taskID)) { + return true; + } + const { intervalID, timeoutID, onVisibilitychange } = this.taskMap.get(taskID); + if (intervalID) { + clearInterval(intervalID); + } + if (timeoutID) { + clearTimeout(timeoutID); + } + if (onVisibilitychange) { + document.removeEventListener('visibilitychange', onVisibilitychange); + } + this.taskMap.delete(taskID); + // console.log('timer clearTask end ', `| size:${this.taskMap.size}`); + return true; + } + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem) { + if (!this.taskMap.has(taskItem.taskID)) { + return true; + } + if (taskItem.count !== 0 && taskItem.loopCount >= taskItem.count) { + this.clearTask(taskItem.taskID); + return true; + } + return false; + } +} +Timer.taskMap = new Map(); +Timer.currentTaskID = 1; +exports.default = Timer; diff --git a/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts new file mode 100644 index 0000000..85fdf03 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts @@ -0,0 +1,10 @@ +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +export declare function avoidRepeatedCall(): (target: any, name: string, descriptor: any) => any; diff --git a/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js new file mode 100644 index 0000000..c7675b9 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js @@ -0,0 +1,49 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = void 0; +const index_1 = require("../../const/index"); +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +function avoidRepeatedCall() { + return function (target, name, descriptor) { + const oldFn = descriptor.value; + const isCallingSet = new Set(); + descriptor.value = function (...args) { + return __awaiter(this, void 0, void 0, function* () { + if (isCallingSet.has(this)) { + console.warn((`${index_1.NAME.PREFIX}previous ${name}() is ongoing, please avoid repeated calls`)); + // throw new Error(`previous ${name}() is ongoing, please avoid repeated calls`); + return; + } + try { + isCallingSet.add(this); + const result = yield oldFn.apply(this, args); + isCallingSet.delete(this); + return result; + } + catch (error) { + isCallingSet.delete(this); + throw error; + } + }); + }; + return descriptor; + }; +} +exports.avoidRepeatedCall = avoidRepeatedCall; diff --git a/TUICallKit/TUICallService/utils/validate/index.d.ts b/TUICallKit/TUICallService/utils/validate/index.d.ts new file mode 100644 index 0000000..665c654 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/index.d.ts @@ -0,0 +1,4 @@ +import { avoidRepeatedCall } from './avoidRepeatedCall'; +import { paramValidate } from './validateParams'; +import { VALIDATE_PARAMS } from './validateConfig'; +export { VALIDATE_PARAMS, paramValidate, avoidRepeatedCall, }; diff --git a/TUICallKit/TUICallService/utils/validate/index.js b/TUICallKit/TUICallService/utils/validate/index.js new file mode 100644 index 0000000..7632874 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = exports.paramValidate = exports.VALIDATE_PARAMS = void 0; +const avoidRepeatedCall_1 = require("./avoidRepeatedCall"); +Object.defineProperty(exports, "avoidRepeatedCall", { enumerable: true, get: function () { return avoidRepeatedCall_1.avoidRepeatedCall; } }); +const validateParams_1 = require("./validateParams"); +Object.defineProperty(exports, "paramValidate", { enumerable: true, get: function () { return validateParams_1.paramValidate; } }); +const validateConfig_1 = require("./validateConfig"); +Object.defineProperty(exports, "VALIDATE_PARAMS", { enumerable: true, get: function () { return validateConfig_1.VALIDATE_PARAMS; } }); diff --git a/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts b/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts new file mode 100644 index 0000000..190b624 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts @@ -0,0 +1,173 @@ +import { VideoResolution, VideoDisplayMode } from "../../const/index"; +export declare const VALIDATE_PARAMS: { + init: { + SDKAppID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userSig: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + tim: { + required: boolean; + rules: any[]; + }; + }; + call: { + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + groupCall: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + offlinePushInfo: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + joinInGroupCall: { + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + inviteUser: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + setSelfInfo: { + nickName: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + avatar: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + enableFloatWindow: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableAIVoice: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableMuteMode: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setCallingBell: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setLanguage: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setVideoDisplayMode: { + key: string; + required: boolean; + rules: any[]; + range: VideoDisplayMode[]; + allowEmpty: boolean; + }[]; + setVideoResolution: { + key: string; + required: boolean; + rules: any[]; + range: VideoResolution[]; + allowEmpty: boolean; + }[]; +}; diff --git a/TUICallKit/TUICallService/utils/validate/validateConfig.js b/TUICallKit/TUICallService/utils/validate/validateConfig.js new file mode 100644 index 0000000..303d99b --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateConfig.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VALIDATE_PARAMS = void 0; +const index_1 = require("../../const/index"); +exports.VALIDATE_PARAMS = { + init: { + SDKAppID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + userSig: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + tim: { + required: false, + rules: [index_1.NAME.OBJECT], + }, + }, + call: { + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false, + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + } + }, + groupCall: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + offlinePushInfo: { + required: false, + rules: [index_1.NAME.OBJECT], + allowEmpty: false, + }, + }, + joinInGroupCall: { + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + }, + inviteUser: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + }, + setSelfInfo: { + nickName: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + avatar: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + } + }, + enableFloatWindow: [ + { + key: "enable", + required: false, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableAIVoice: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableMuteMode: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + setCallingBell: [ + { + key: "filePath", + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: true, + } + ], + setLanguage: [ + { + key: "language", + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + } + ], + setVideoDisplayMode: [ + { + key: "displayMode", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoDisplayMode.CONTAIN, index_1.VideoDisplayMode.COVER, index_1.VideoDisplayMode.FILL], + allowEmpty: false + } + ], + setVideoResolution: [ + { + key: "resolution", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoResolution.RESOLUTION_1080P, index_1.VideoResolution.RESOLUTION_480P, index_1.VideoResolution.RESOLUTION_720P], + allowEmpty: false + } + ] +}; diff --git a/TUICallKit/TUICallService/utils/validate/validateParams.d.ts b/TUICallKit/TUICallService/utils/validate/validateParams.d.ts new file mode 100644 index 0000000..4a37885 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateParams.d.ts @@ -0,0 +1 @@ +export declare function paramValidate(config: any): (target: any, propertyName: string, descriptor: PropertyDescriptor) => PropertyDescriptor; diff --git a/TUICallKit/TUICallService/utils/validate/validateParams.js b/TUICallKit/TUICallService/utils/validate/validateParams.js new file mode 100644 index 0000000..5073419 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateParams.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paramValidate = void 0; +const common_utils_1 = require("../common-utils"); +const index_1 = require("../../const/index"); +const PREFIX = index_1.NAME.PREFIX + "API"; +function paramValidate(config) { + return function (target, propertyName, descriptor) { + let method = descriptor.value; + descriptor.value = function (...args) { + doValidate.call(this, config, args, propertyName); + return method.apply(this, args); + }; + return descriptor; + }; +} +exports.paramValidate = paramValidate; +function doValidate(config, args, name) { + try { + // 兼容 init 方法中: SDKAppID sdkAppID 两种写法的参数校验判断 + if (!args[0].SDKAppID) { + config = (0, common_utils_1.modifyObjectKey)(config, "SDKAppID", "sdkAppID"); + } + if ((0, common_utils_1.isArray)(config)) { + for (let i = 0; i < config.length; i++) { + check.call(this, Object.assign(Object.assign({}, config[i]), { value: args[i], name })); + } + } + else { + for (const key in config) { + if (config.hasOwnProperty(key)) { + check.call(this, Object.assign(Object.assign({}, config[key]), { value: args[0][key], name, + key })); + } + } + } + } + catch (error) { + console.error(error); + throw error; + } +} +function check({ required, rules, range, value, allowEmpty, name, key }) { + // 用户没传指定参数 + if ((0, common_utils_1.isUndefined)(value)) { + // 检查必填参数, 若配置是必填则报错 + if (required) { + throw new Error(`${PREFIX}<${name}>: ${key} is required.`); + } + else { + return; + } + } + // 判断参数类型是否正确 + const result = rules.some((item) => item === (0, common_utils_1.getType)(value)); + let type = ''; + if (!result) { + for (let i = 0; i < rules.length; i++) { + let str = rules[i]; + str = str.replace(str[0], str[0].toUpperCase()); + type += `${str}/`; + } + type = type.substring(0, type.length - 1); + throw new Error(`${PREFIX}<${name}>: ${key} must be ${type}, current ${key} is ${typeof value}.`); + } + // 不允许传空值, 例如: '', ' ' + if (allowEmpty === false) { + const isEmptyString = (0, common_utils_1.isString)(value) && value.trim() === ''; + if (isEmptyString) { + throw new Error(`${PREFIX}<${name}>: ${key} is blank.`); + } + } + // 判断是否符合限制条件 + if ((0, common_utils_1.isArray)(range)) { + if (range && range.indexOf(value) === -1) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } + // 取值范围, 前闭后闭 + if ((0, common_utils_1.isString)(range) && range.indexOf('~') !== -1) { + const valueList = range.split('~'); + if (value < +valueList[0] || value > +valueList[1] || ((0, common_utils_1.isNumber)(value) && Number.isNaN(value))) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } +} diff --git a/TUICallKit/adapter-vue.d.ts b/TUICallKit/adapter-vue.d.ts new file mode 100644 index 0000000..1d797f4 --- /dev/null +++ b/TUICallKit/adapter-vue.d.ts @@ -0,0 +1,2 @@ +export * from '@vue/composition-api'; +export * from 'vue'; diff --git a/TUICallKit/adapter-vue.js b/TUICallKit/adapter-vue.js new file mode 100644 index 0000000..38b9bfe --- /dev/null +++ b/TUICallKit/adapter-vue.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// #ifndef VUE3 +// @ts-ignore +__exportStar(require("@vue/composition-api"), exports); +// #endif +// #ifdef VUE3 +__exportStar(require("vue"), exports); +// #endif diff --git a/TUICallKit/debug/GenerateTestUserSig-es.js b/TUICallKit/debug/GenerateTestUserSig-es.js new file mode 100644 index 0000000..f61fb98 --- /dev/null +++ b/TUICallKit/debug/GenerateTestUserSig-es.js @@ -0,0 +1,63 @@ +import LibGenerateTestUserSig from './lib-generate-test-usersig-es.min.js'; + +/** + * 腾讯云 SDKAppId,需要替换为您自己账号下的 SDKAppId。 + * + * 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ) 创建应用,即可看到 SDKAppId, + * 它是腾讯云用于区分客户的唯一标识。 + */ +let SDKAPPID = 0; + + +/** + * 签名过期时间,建议不要设置的过短 + *

+ * 时间单位:秒 + * 默认时间:7 x 24 x 60 x 60 = 604800 = 7 天 + */ +const EXPIRETIME = 604800; + + +/** + * 计算签名用的加密密钥,获取步骤如下: + * + * step1. 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ),如果还没有应用就创建一个, + * step2. 单击“应用配置”进入基础配置页面,并进一步找到“帐号体系集成”部分。 + * step3. 点击“查看密钥”按钮,就可以看到计算 UserSig 使用的加密的密钥了,请将其拷贝并复制到如下的变量中 + * + * 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。 + * 文档:https://cloud.tencent.com/document/product/647/17275#Server + */ +let SECRETKEY = ''; + +/* + * Module: GenerateTestUserSig + * + * Function: 用于生成测试用的 UserSig,UserSig 是腾讯云为其云服务设计的一种安全保护签名。 + * 其计算方法是对 SDKAppID、UserID 和 EXPIRETIME 进行加密,加密算法为 HMAC-SHA256。 + * + * Attention: 请不要将如下代码发布到您的线上正式版本的 App 中,原因如下: + * + * 本文件中的代码虽然能够正确计算出 UserSig,但仅适合快速调通 SDK 的基本功能,不适合线上产品, + * 这是因为客户端代码中的 SECRETKEY 很容易被反编译逆向破解,尤其是 Web 端的代码被破解的难度几乎为零。 + * 一旦您的密钥泄露,攻击者就可以计算出正确的 UserSig 来盗用您的腾讯云流量。 + * + * 正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,然后由 App 按需向您的服务器获取实时算出的 UserSig。 + * 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。 + * + * Reference:https://cloud.tencent.com/document/product/647/17275#Server + */ + +export function genTestUserSig({ userID, SDKAppID, SecretKey }) { + if (SDKAppID) SDKAPPID = SDKAppID; + if (SecretKey) SECRETKEY = SecretKey; + const generator = new LibGenerateTestUserSig(SDKAPPID, SECRETKEY, EXPIRETIME); + const userSig = generator.genTestUserSig(userID); + + return { + SDKAppID: SDKAPPID, + userSig, + }; +} + +export default genTestUserSig; \ No newline at end of file diff --git a/TUICallKit/debug/lib-generate-test-usersig-es.min.js b/TUICallKit/debug/lib-generate-test-usersig-es.min.js new file mode 100644 index 0000000..b01b70b --- /dev/null +++ b/TUICallKit/debug/lib-generate-test-usersig-es.min.js @@ -0,0 +1,2 @@ +/*eslint-disable*/ +var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=e.length;n>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return a.join("")}function s(e){var r;i||o();for(var n=e.length,s=n%3,h="",l=[],f=0,c=n-s;fc?c:f+16383));return 1===s?(r=e[n-1],h+=t[r>>2],h+=t[r<<4&63],h+="=="):2===s&&(r=(e[n-2]<<8)+e[n-1],h+=t[r>>10],h+=t[r>>4&63],h+=t[r<<2&63],h+="="),l.push(h),l.join("")}function h(e,t,r,n,i){var o,a,s=8*i-n-1,h=(1<>1,f=-7,c=r?i-1:0,u=r?-1:1,d=e[t+c];for(c+=u,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=u,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=u,f-=8);if(0===o)o=1-l;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)}function l(e,t,r,n,i,o){var a,s,h,l=8*o-i-1,f=(1<>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-a))<1&&(a--,h*=2),(t+=a+c>=1?u/h:u*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*h-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*_}var f={}.toString,c=Array.isArray||function(e){return"[object Array]"==f.call(e)};function u(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(u()=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function y(e){return!(null==e||!e._isBuffer)}function m(e,t){if(y(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return q(e).length;t=(""+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),y(t))return 0===t.length?-1:x(e,t,r,n,i);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):x(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,n,i){var o,a=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,h/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-h),o=r;o>=0;o--){for(var c=!0,u=0;ui&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?s(e):s(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(h=(31&l)<<6|63&o)>127&&(f=h);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(h=(15&l)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,n,i){if(!y(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),h=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return B(this,e,t,r);case"latin1":case"binary":return z(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,o){if(!y(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,i){return i||j(e,0,r,4),l(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||j(e,0,r,8),l(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},p.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),h(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),h(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),h(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),h(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return function(e){var t,a,s,h,l,f;i||o();var c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");l="="===e[c-2]?2:"="===e[c-1]?1:0,f=new n(3*c/4-l),s=l>0?c-4:c;var u=0;for(t=0,a=0;t>16&255,f[u++]=h>>8&255,f[u++]=255&h;return 2===l?(h=r[e.charCodeAt(t)]<<2|r[e.charCodeAt(t+1)]>>4,f[u++]=255&h):1===l&&(h=r[e.charCodeAt(t)]<<10|r[e.charCodeAt(t+1)]<<4|r[e.charCodeAt(t+2)]>>2,f[u++]=h>>8&255,f[u++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e){return null!=e&&(!!e._isBuffer||J(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&J(e.slice(0,0))}(e))}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Q(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=Q(function(e,t){var r;e.exports=(r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,h=i/s,l=(h=t?e.ceil(h):e.max((0|h)-this._minBufferSize,0))*o,f=e.min(4*l,i);if(l){for(var c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)}),Q(function(e,t){var r,n,i;e.exports=(i=(n=r=ee).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|h)<<24-o%4*8,o++}return i.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],_=e[t+4],g=e[t+5],v=e[t+6],w=e[t+7],b=e[t+8],y=e[t+9],m=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],x=e[t+14],R=e[t+15],A=o[0],B=o[1],z=o[2],L=o[3];A=l(A,B,z,L,a,7,s[0]),L=l(L,A,B,z,h,12,s[1]),z=l(z,L,A,B,d,17,s[2]),B=l(B,z,L,A,p,22,s[3]),A=l(A,B,z,L,_,7,s[4]),L=l(L,A,B,z,g,12,s[5]),z=l(z,L,A,B,v,17,s[6]),B=l(B,z,L,A,w,22,s[7]),A=l(A,B,z,L,b,7,s[8]),L=l(L,A,B,z,y,12,s[9]),z=l(z,L,A,B,m,17,s[10]),B=l(B,z,L,A,k,22,s[11]),A=l(A,B,z,L,E,7,s[12]),L=l(L,A,B,z,S,12,s[13]),z=l(z,L,A,B,x,17,s[14]),A=f(A,B=l(B,z,L,A,R,22,s[15]),z,L,h,5,s[16]),L=f(L,A,B,z,v,9,s[17]),z=f(z,L,A,B,k,14,s[18]),B=f(B,z,L,A,a,20,s[19]),A=f(A,B,z,L,g,5,s[20]),L=f(L,A,B,z,m,9,s[21]),z=f(z,L,A,B,R,14,s[22]),B=f(B,z,L,A,_,20,s[23]),A=f(A,B,z,L,y,5,s[24]),L=f(L,A,B,z,x,9,s[25]),z=f(z,L,A,B,p,14,s[26]),B=f(B,z,L,A,b,20,s[27]),A=f(A,B,z,L,S,5,s[28]),L=f(L,A,B,z,d,9,s[29]),z=f(z,L,A,B,w,14,s[30]),A=c(A,B=f(B,z,L,A,E,20,s[31]),z,L,g,4,s[32]),L=c(L,A,B,z,b,11,s[33]),z=c(z,L,A,B,k,16,s[34]),B=c(B,z,L,A,x,23,s[35]),A=c(A,B,z,L,h,4,s[36]),L=c(L,A,B,z,_,11,s[37]),z=c(z,L,A,B,w,16,s[38]),B=c(B,z,L,A,m,23,s[39]),A=c(A,B,z,L,S,4,s[40]),L=c(L,A,B,z,a,11,s[41]),z=c(z,L,A,B,p,16,s[42]),B=c(B,z,L,A,v,23,s[43]),A=c(A,B,z,L,y,4,s[44]),L=c(L,A,B,z,E,11,s[45]),z=c(z,L,A,B,R,16,s[46]),A=u(A,B=c(B,z,L,A,d,23,s[47]),z,L,a,6,s[48]),L=u(L,A,B,z,w,10,s[49]),z=u(z,L,A,B,x,15,s[50]),B=u(B,z,L,A,g,21,s[51]),A=u(A,B,z,L,E,6,s[52]),L=u(L,A,B,z,p,10,s[53]),z=u(z,L,A,B,m,15,s[54]),B=u(B,z,L,A,h,21,s[55]),A=u(A,B,z,L,b,6,s[56]),L=u(L,A,B,z,R,10,s[57]),z=u(z,L,A,B,v,15,s[58]),B=u(B,z,L,A,S,21,s[59]),A=u(A,B,z,L,_,6,s[60]),L=u(L,A,B,z,k,10,s[61]),z=u(z,L,A,B,d,15,s[62]),B=u(B,z,L,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+B|0,o[2]=o[2]+z|0,o[3]=o[3]+L|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,h=s.words,l=0;l<4;l++){var f=h[l];h[l]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function c(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(h),t.HmacMD5=o._createHmacHelper(h)}(Math),r.MD5)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).lib,o=i.WordArray,a=i.Hasher,s=n.algo,h=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=0;l<80;l++){if(l<16)h[l]=0|e[t+l];else{var f=h[l-3]^h[l-8]^h[l-14]^h[l-16];h[l]=f<<1|f>>>31}var c=(n<<5|n>>>27)+s+h[l];c+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=a._createHelper(l),n.HmacSHA1=a._createHmacHelper(l),r.SHA1)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],h=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),h[i]=r(e.pow(n,1/3)),i++),n++}();var l=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=0;d<64;d++){if(d<16)l[d]=0|e[t+d];else{var p=l[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[d]=_+l[d-7]+v+l[d-16]}var w=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),y=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&c)+h[d]+l[d];u=c,c=f,f=s,s=a+y|0,a=o,o=i,i=n,n=y+(b+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+c|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),r.SHA256)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(i=(n=r=ee).lib.WordArray,o=n.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=a._createHelper(s),n.HmacSHA224=a._createHmacHelper(s),r.SHA224)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var h=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var f=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=n.high,p=n.low,_=i.high,g=i.low,v=o.high,w=o.low,b=a.high,y=a.low,m=s.high,k=s.low,E=f.high,S=f.low,x=c.high,R=c.low,A=u.high,B=u.low,z=d,L=p,T=_,M=g,C=v,D=w,I=b,P=y,O=m,U=k,H=E,F=S,N=x,Z=R,j=A,W=B,Y=0;Y<80;Y++){var K=l[Y];if(Y<16)var X=K.high=0|e[t+2*Y],q=K.low=0|e[t+2*Y+1];else{var V=l[Y-15],G=V.high,$=V.low,J=(G>>>1|$<<31)^(G>>>8|$<<24)^G>>>7,Q=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),ee=l[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[Y-7],ae=oe.high,se=oe.low,he=l[Y-16],le=he.high,fe=he.low;X=(X=(X=J+ae+((q=Q+se)>>>0>>0?1:0))+ne+((q+=ie)>>>0>>0?1:0))+le+((q+=fe)>>>0>>0?1:0),K.high=X,K.low=q}var ce,ue=O&H^~O&N,de=U&F^~U&Z,pe=z&T^z&C^T&C,_e=L&M^L&D^M&D,ge=(z>>>28|L<<4)^(z<<30|L>>>2)^(z<<25|L>>>7),ve=(L>>>28|z<<4)^(L<<30|z>>>2)^(L<<25|z>>>7),we=(O>>>14|U<<18)^(O>>>18|U<<14)^(O<<23|U>>>9),be=(U>>>14|O<<18)^(U>>>18|O<<14)^(U<<23|O>>>9),ye=h[Y],me=ye.high,ke=ye.low,Ee=j+we+((ce=W+be)>>>0>>0?1:0),Se=ve+_e;j=N,W=Z,N=H,Z=F,H=O,F=U,O=I+(Ee=(Ee=(Ee=Ee+ue+((ce+=de)>>>0>>0?1:0))+me+((ce+=ke)>>>0>>0?1:0))+X+((ce+=q)>>>0>>0?1:0))+((U=P+ce|0)>>>0

>>0?1:0)|0,I=C,P=D,C=T,D=M,T=z,M=L,z=Ee+(ge+pe+(Se>>>0>>0?1:0))+((L=ce+Se|0)>>>0>>0?1:0)|0}p=n.low=p+L,n.high=d+z+(p>>>0>>0?1:0),g=i.low=g+M,i.high=_+T+(g>>>0>>0?1:0),w=o.low=w+D,o.high=v+C+(w>>>0>>0?1:0),y=a.low=y+P,a.high=b+I+(y>>>0

>>0?1:0),k=s.low=k+U,s.high=m+O+(k>>>0>>0?1:0),S=f.low=S+F,f.high=E+H+(S>>>0>>0?1:0),R=c.low=R+Z,c.high=x+N+(R>>>0>>0?1:0),B=u.low=B+W,u.high=A+j+(B>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),r.SHA512)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).x64,o=i.Word,a=i.WordArray,s=n.algo,h=s.SHA512,l=s.SHA384=h.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=h._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=h._createHelper(l),n.HmacSHA384=h._createHmacHelper(l),r.SHA384)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,h=[],l=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){h[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,c=0,u=0;u<7;u++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=r[i]).high^=a,B.low^=o}for(var s=0;s<24;s++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(B=r[u+5*_]).high,p^=B.low;var g=c[u];g.high=d,g.low=p}for(u=0;u<5;u++){var v=c[(u+4)%5],w=c[(u+1)%5],b=w.high,y=w.low;for(d=v.high^(b<<1|y>>>31),p=v.low^(y<<1|b>>>31),_=0;_<5;_++)(B=r[u+5*_]).high^=d,B.low^=p}for(var m=1;m<25;m++){var k=(B=r[m]).high,E=B.low,S=h[m];S<32?(d=k<>>32-S,p=E<>>32-S):(d=E<>>64-S,p=k<>>64-S);var x=c[l[m]];x.high=d,x.low=p}var R=c[0],A=r[0];for(R.high=A.high,R.low=A.low,u=0;u<5;u++)for(_=0;_<5;_++){var B=r[m=u+5*_],z=c[m],L=c[(u+1)%5+5*_],T=c[(u+2)%5+5*_];B.high=z.high^~L.high&T.high,B.low=z.low^~L.low&T.low}B=r[0];var M=f[s];B.high^=M.high,B.low^=M.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,h=s/8,l=[],f=0;f>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(u)}return new i.init(l,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(u),t.HmacSHA3=o._createHmacHelper(u)}(Math),r.SHA3)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,y,m,k,E,S,x,R,A,B=this._hash.words,z=c.words,L=u.words,T=s.words,M=h.words,C=l.words,D=f.words;for(k=o=B[0],E=a=B[1],S=d=B[2],x=y=B[3],R=m=B[4],r=0;r<80;r+=1)A=o+e[t+T[r]]|0,A+=r<16?p(a,d,y)+z[0]:r<32?_(a,d,y)+z[1]:r<48?g(a,d,y)+z[2]:r<64?v(a,d,y)+z[3]:w(a,d,y)+z[4],A=(A=b(A|=0,C[r]))+m|0,o=m,m=y,y=b(d,10),d=a,a=A,A=k+e[t+M[r]]|0,A+=r<16?w(E,S,x)+L[0]:r<32?v(E,S,x)+L[1]:r<48?g(E,S,x)+L[2]:r<64?_(E,S,x)+L[3]:p(E,S,x)+L[4],A=(A=b(A|=0,D[r]))+R|0,k=R,R=x,x=b(S,10),S=E,E=A;A=B[1]+d+x|0,B[1]=B[2]+y+R|0,B[2]=B[3]+m+k|0,B[3]=B[4]+o+E|0,B[4]=B[0]+a+S|0,B[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function _(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function w(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=ee).lib,i=n.Base,o=r.enc,a=o.Utf8,s=r.algo,void(s.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,h=o.words,l=0;l>>2];e.sigBytes-=t}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:g,padding:w}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),b=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=i.format={},m=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=s.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=s.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:n})}},k=o.SerializableCipher=a.extend({cfg:a.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),E=i.kdf={},S=E.OpenSSL={execute:function(e,t,r,n){n||(n=s.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=s.create(i.words.slice(t),4*r);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:n})}},x=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=k.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=k.decrypt.call(this,e,t,i.key,n);return o}})))}),Q(function(e,t){var r;e.exports=((r=ee).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var h=0;h>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)}),Q(function(e,t){var r;e.exports=((r=ee).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},r.pad.ZeroPadding)}),Q(function(e,t){var r;e.exports=((r=ee).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)}),Q(function(e,t){var r,n,i,o;e.exports=(i=(n=r=ee).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},r.format.Hex)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],o=[],a=[],s=[],h=[],l=[],f=[],c=[],u=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var _=e[r],g=e[_],v=e[g],w=257*e[p]^16843008*p;a[r]=w<<24|w>>>8,s[r]=w<<16|w>>>16,h[r]=w<<8|w>>>24,l[r]=w,w=16843009*v^65537*g^257*_^16843008*r,f[p]=w<<24|w>>>8,c[p]=w<<16|w>>>16,u[p]=w<<8|w>>>24,d[p]=w,r?(r=_^e[e[e[v^_]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var h=this._invKeySchedule=[],l=0;l>>24]]^c[i[s>>>16&255]]^u[i[s>>>8&255]]^d[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,h,l,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,c,u,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var h=this._nRounds,l=e[t]^r[0],f=e[t+1]^r[1],c=e[t+2]^r[2],u=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&u]^r[d++],g=n[f>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&l]^r[d++],v=n[c>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++],w=n[u>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&c]^r[d++];l=_,f=g,c=v,u=w}_=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^r[d++],g=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],w=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[d++],e[t]=_,e[t+1]=g,e[t+2]=v,e[t+3]=w},keySize:8});e.AES=t._createHelper(_)}(),r.AES)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],f=h[o];for(r=0;r<24;r++)l[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,l[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(l[0]=l[0]<<1|l[0]>>>31,r=1;r<7;r++)l[r]=l[r]>>>4*(r-1)+3;l[7]=l[7]<<5|l[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,h=0;h<8;h++)s|=l[h][((a^i[h])&f[h])>>>0];this._lBlock=a,this._rBlock=o^s}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var h=n[i];n[i]=n[o],n[o]=h}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(i[0]^=l,i[1]^=c,i[2]^=f,i[3]^=u,i[4]^=l,i[5]^=c,i[6]^=f,i[7]^=u,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)h.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(n[0]^=l,n[1]^=c,n[2]^=f,n[3]^=u,n[4]^=l,n[5]^=c,n[6]^=f,n[7]^=u,i=0;i<4;i++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)}),Q(function(e,t){e.exports=ee}));function re(){throw new Error("setTimeout has not been defined")}function ne(){throw new Error("clearTimeout has not been defined")}var ie=re,oe=ne;function ae(e){if(ie===setTimeout)return setTimeout(e,0);if((ie===re||!ie)&&setTimeout)return ie=setTimeout,setTimeout(e,0);try{return ie(e,0)}catch(t){try{return ie.call(null,e,0)}catch(t){return ie.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ie=setTimeout),"function"==typeof e.clearTimeout&&(oe=clearTimeout);var se,he=[],le=!1,fe=-1;function ce(){le&&se&&(le=!1,se.length?he=se.concat(he):fe=-1,he.length&&ue())}function ue(){if(!le){var e=ae(ce);le=!0;for(var t=he.length;t;){for(se=he,he=[];++fe1)for(var r=1;r0&&a.length>i){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function xe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Re(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Ae(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}ge.prototype=Object.create(null),ve.EventEmitter=ve,ve.usingDomains=!1,ve.prototype.domain=void 0,ve.prototype._events=void 0,ve.prototype._maxListeners=void 0,ve.defaultMaxListeners=10,ve.init=function(){this.domain=null,ve.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ge,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ve.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ve.prototype.getMaxListeners=function(){return we(this)},ve.prototype.emit=function(e){var t,r,n,i,o,a,s,h="error"===e;if(a=this._events)h=h&&null==a.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:be(r,f,this);break;case 2:ye(r,f,this,arguments[1]);break;case 3:me(r,f,this,arguments[1],arguments[2]);break;case 4:ke(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new ge,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var Be="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},ze=/%[sdj%]/g;function Le(e){if(!Ze(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Fe(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ye(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),je(r.showHidden)&&(r.showHidden=!1),je(r.depth)&&(r.depth=2),je(r.colors)&&(r.colors=!1),je(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ie),Oe(r,e,r.depth)}function Ie(e,t){var r=De.styles[t];return r?"["+De.colors[r][0]+"m"+e+"["+De.colors[r][1]+"m":e}function Pe(e,t){return e}function Oe(e,t,r){if(e.customInspect&&t&&qe(t.inspect)&&t.inspect!==De&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Ze(n)||(n=Oe(e,n,r)),n}var i=function(e,t){if(je(t))return e.stylize("undefined","undefined");if(Ze(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Fe(t))return e.stylize(""+t,"boolean");if(Ne(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Xe(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ue(t);if(0===o.length){if(qe(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(We(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ke(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Xe(t))return Ue(t)}var h,l,f="",c=!1,u=["{","}"];(h=t,Array.isArray(h)&&(c=!0,u=["[","]"]),qe(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return We(t)&&(f=" "+RegExp.prototype.toString.call(t)),Ke(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Xe(t)&&(f=" "+Ue(t)),0!==o.length||c&&0!=t.length?r<0?We(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=c?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,f,u)):u[0]+f+u[1]}function Ue(e){return"["+Error.prototype.toString.call(e)+"]"}function He(e,t,r,n,i,o){var a,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),Ge(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=Ne(r)?Oe(e,h.value,null):Oe(e,h.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),je(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Fe(e){return"boolean"==typeof e}function Ne(e){return null===e}function Ze(e){return"string"==typeof e}function je(e){return void 0===e}function We(e){return Ye(e)&&"[object RegExp]"===Ve(e)}function Ye(e){return"object"==typeof e&&null!==e}function Ke(e){return Ye(e)&&"[object Date]"===Ve(e)}function Xe(e){return Ye(e)&&("[object Error]"===Ve(e)||e instanceof Error)}function qe(e){return"function"==typeof e}function Ve(e){return Object.prototype.toString.call(e)}function Ge(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $e(){this.head=null,this.tail=null,this.length=0}De.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},De.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},$e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},$e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},$e.prototype.clear=function(){this.head=this.tail=null,this.length=0},$e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},$e.prototype.concat=function(e){if(0===this.length)return p.alloc(0);if(1===this.length)return this.head.data;for(var t=p.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Je=p.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Qe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Je(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=tt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=rt;break;default:return void(this.write=et)}this.charBuffer=new p(6),this.charReceived=0,this.charLength=0}function et(e){return e.toString(this.encoding)}function tt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function rt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Qe.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},Qe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},Qe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},ot.ReadableState=it;var nt=function(e){je(Me)&&(Me=""),e=e.toUpperCase(),Ce[e]||(new RegExp("\\b"+e+"\\b","i").test(Me)?Ce[e]=function(){var t=Le.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Ce[e]=function(){});return Ce[e]}("stream");function it(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ct&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new $e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Qe(e.encoding),this.encoding=e.encoding)}function ot(e){if(!(this instanceof ot))return new ot(e);this._readableState=new it(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ve.call(this)}function at(e,t,r,n,i){var o=function(e,t){var r=null;$(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,lt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&<(e))),function(e,t){t.readingMore||(t.readingMore=!0,de(ct,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?de(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function ct(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=p.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,de(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):lt(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?_t(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},ot.prototype._read=function(e){this.emit("error",new Error("not implemented"))},ot.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){nt("onunpipe"),e===r&&l()}function a(){nt("onend"),e.end()}n.endEmitted?de(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function l(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",u),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",c),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function c(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==wt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function u(t){var r;nt("onerror",t),_(),e.removeListener("error",u),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),_()}function p(){nt("onfinish"),e.removeListener("close",d),_()}function _(){nt("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",u),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},ot.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},kt.prototype._write=function(e,t,r){r(new Error("not implemented"))},kt.prototype._writev=null,kt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Bt(e,t),r&&(t.finished?de(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Be(Ct,ot);for(var Lt=Object.keys(kt.prototype),Tt=0;Tt=0;)e[t]=0}var Jt=0,Qt=1,er=2,tr=29,rr=256,nr=rr+1+tr,ir=30,or=19,ar=2*nr+1,sr=15,hr=16,lr=7,fr=256,cr=16,ur=17,dr=18,pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],vr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wr=new Array(2*(nr+2));$t(wr);var br=new Array(2*ir);$t(br);var yr=new Array(512);$t(yr);var mr=new Array(256);$t(mr);var kr=new Array(tr);$t(kr);var Er,Sr,xr,Rr=new Array(ir);function Ar(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Br(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function zr(e){return e<256?yr[e]:yr[256+(e>>>7)]}function Lr(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Tr(e,t,r){e.bi_valid>hr-r?(e.bi_buf|=t<>hr-e.bi_valid,e.bi_valid+=r-hr):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function Dr(e,t,r){var n,i,o=new Array(sr+1),a=0;for(n=1;n<=sr;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=Cr(o[s]++,s))}}function Ir(e){var t;for(t=0;t8?Lr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Or(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)Ur(e,o,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ur(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Ur(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,h=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,c=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=sr;o++)e.bl_count[o]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(o=p,_++),h[2*n+1]=o,n>l||(e.bl_count[o]++,a=0,n>=d&&(a=u[n-d]),s=h[2*n],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>l||(h[2*i+1]!==o&&(e.opt_len+=(o-h[2*i+1])*h[2*i],h[2*i+1]=o),n--)}}(e,t),Dr(o,l,e.bl_count)}function Nr(e,t,r){var n,i,o=-1,a=t[1],s=0,h=7,l=4;for(0===a&&(h=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function Xr(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Gt&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return qt;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Vt;for(t=32;t=3&&0===e.bl_tree[2*vr[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Yr(e,t,r,n):e.strategy===Xt||o===i?(Tr(e,(Qt<<1)+(n?1:0),3),Hr(e,wr,br)):(Tr(e,(er<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Tr(e,t-257,5),Tr(e,r-1,5),Tr(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(mr[r]+rr+1)]++,e.dyn_dtree[2*zr(t)]++),e.last_lit===e.lit_bufsize-1}function Vr(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Gr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function $r(e,t,r,n){var i=Gr,o=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}var Jr,Qr=0,en=1,tn=3,rn=4,nn=5,on=0,an=1,sn=-2,hn=-3,ln=-5,fn=-1,cn=1,un=2,dn=3,pn=4,_n=2,gn=8,vn=9,wn=286,bn=30,yn=19,mn=2*wn+1,kn=15,En=3,Sn=258,xn=Sn+En+1,Rn=32,An=42,Bn=69,zn=73,Ln=91,Tn=103,Mn=113,Cn=666,Dn=1,In=2,Pn=3,On=4,Un=3;function Hn(e,t){return e.msg=Nt[t],t}function Fn(e){return(e<<1)-(e>4?9:0)}function Nn(e){for(var t=e.length;--t>=0;)e[t]=0}function Zn(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(jt(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function jn(e,t){Xr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zn(e.strm)}function Wn(e,t){e.pending_buf[e.pending++]=t}function Yn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Kn(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-xn?e.strstart-(e.w_size-xn):0,l=e.window,f=e.w_mask,c=e.prev,u=e.strstart+Sn,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}}while((t=c[t&f])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Xn(e){var t,r,n,i,o,a,s,h,l,f,c=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-xn)){jt(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=c?n-c:0}while(--r);t=r=c;do{n=e.prev[--t],e.prev[t]=n>=c?n-c:0}while(--r);i+=c}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,h=e.strstart+e.lookahead,l=i,f=void 0,(f=a.avail_in)>l&&(f=l),r=0===f?0:(a.avail_in-=f,jt(s,a.input,a.next_in,f,h),1===a.state.wrap?a.adler=Vr(a.adler,s,f,h):2===a.state.wrap&&(a.adler=$r(a.adler,s,f,h)),a.next_in+=f,a.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=En)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<=En)if(n=qr(e,e.strstart-e.match_start,e.match_length-En),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=En){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=En-1)),e.prev_length>=En&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-En,n=qr(e,e.strstart-1-e.prev_match,e.prev_length-En),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<nn||t<0)return e?Hn(e,sn):sn;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Cn&&t!==rn)return Hn(e,0===e.avail_out?ln:sn);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===An)if(2===n.wrap)e.adler=0,Wn(n,31),Wn(n,139),Wn(n,8),n.gzhead?(Wn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Wn(n,255&n.gzhead.time),Wn(n,n.gzhead.time>>8&255),Wn(n,n.gzhead.time>>16&255),Wn(n,n.gzhead.time>>24&255),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Wn(n,255&n.gzhead.extra.length),Wn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=$r(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Bn):(Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,Un),n.status=Mn);else{var a=gn+(n.w_bits-8<<4)<<8;a|=(n.strategy>=un||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=Rn),a+=31-a%31,n.status=Mn,Yn(n,a),0!==n.strstart&&(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),e.adler=1}if(n.status===Bn)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending!==n.pending_buf_size));)Wn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zn)}else n.status=zn;if(n.status===zn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=Ln)}else n.status=Ln;if(n.status===Ln)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=Tn)}else n.status=Tn;if(n.status===Tn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Zn(e),n.pending+2<=n.pending_buf_size&&(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),e.adler=0,n.status=Mn)):n.status=Mn),0!==n.pending){if(Zn(e),0===e.avail_out)return n.last_flush=-1,on}else if(0===e.avail_in&&Fn(t)<=Fn(r)&&t!==rn)return Hn(e,ln);if(n.status===Cn&&0!==e.avail_in)return Hn(e,ln);if(0!==e.avail_in||0!==n.lookahead||t!==Qr&&n.status!==Cn){var s=n.strategy===un?function(e,t){for(var r;;){if(0===e.lookahead&&(Xn(e),0===e.lookahead)){if(t===Qr)return Dn;break}if(e.match_length=0,r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):n.strategy===dn?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Sn){if(Xn(e),e.lookahead<=Sn&&t===Qr)return Dn;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=En&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+Sn;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=En?(r=qr(e,1,e.match_length-En),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):Jr[n.level].func(n,t);if(s!==Pn&&s!==On||(n.status=Cn),s===Dn||s===Pn)return 0===e.avail_out&&(n.last_flush=-1),on;if(s===In&&(t===en?Kr(n):t!==nn&&(Yr(n,0,0,!1),t===tn&&(Nn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Zn(e),0===e.avail_out))return n.last_flush=-1,on}return t!==rn?on:n.wrap<=0?an:(2===n.wrap?(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),Wn(n,e.adler>>16&255),Wn(n,e.adler>>24&255),Wn(n,255&e.total_in),Wn(n,e.total_in>>8&255),Wn(n,e.total_in>>16&255),Wn(n,e.total_in>>24&255)):(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),Zn(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?on:an)}Jr=[new Gn(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xn(e),0===e.lookahead&&t===Qr)return Dn;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,jn(e,!1),0===e.strm.avail_out))return Dn;if(e.strstart-e.block_start>=e.w_size-xn&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):(e.strstart>e.block_start&&(jn(e,!1),e.strm.avail_out),Dn)}),new Gn(4,4,8,4,qn),new Gn(4,5,16,8,qn),new Gn(4,6,32,32,qn),new Gn(4,4,16,16,Vn),new Gn(8,16,32,32,Vn),new Gn(8,16,128,128,Vn),new Gn(8,32,128,256,Vn),new Gn(32,128,258,1024,Vn),new Gn(32,258,258,4096,Vn)];var ei=30,ti=12;function ri(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R;r=e.state,n=e.next_in,x=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),h=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,u=r.window,d=r.hold,p=r.bits,_=r.lencode,g=r.distcode,v=(1<>>=y=b>>>24,p-=y,0===(y=b>>>16&255))R[o++]=65535&b;else{if(!(16&y)){if(0==(64&y)){b=_[(65535&b)+(d&(1<>>=y,p-=y),p<15&&(d+=x[n++]<>>=y=b>>>24,p-=y,!(16&(y=b>>>16&255))){if(0==(64&y)){b=g[(65535&b)+(d&(1<h){e.msg="invalid distance too far back",r.mode=ei;break e}if(d>>>=y,p-=y,k>(y=o-a)){if((y=k-y)>f&&r.sane){e.msg="invalid distance too far back",r.mode=ei;break e}if(E=0,S=u,0===c){if(E+=l-y,y2;)R[o++]=S[E++],R[o++]=S[E++],R[o++]=S[E++],m-=3;m&&(R[o++]=S[E++],m>1&&(R[o++]=S[E++]))}else{E=o-k;do{R[o++]=R[E++],R[o++]=R[E++],R[o++]=R[E++],m-=3}while(m>2);m&&(R[o++]=R[E++],m>1&&(R[o++]=R[E++]))}break}}break}}while(n>3,d&=(1<<(p-=m<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[m];m--);if(k>m&&(k=m),0===m)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y0&&(e===ai||1!==m))return-1;for(T[1]=0,w=1;wii||e===hi&&R>oi)return 1;for(;;){p=w-S,a[b]d?(_=M[C+a[b]],g=B[z+a[b]]):(_=96,g=0),h=1<>S)+(l-=h)]=p<<24|_<<16|g|0}while(0!==l);for(h=1<>=1;if(0!==h?(A&=h-1,A+=h):A=0,b++,0==--L[w]){if(w===m)break;w=t[r+a[b]]}if(w>k&&(A&c)!==f){for(0===S&&(S=k),u+=y,x=1<<(E=w-S);E+Sii||e===hi&&R>oi)return 1;i[f=A&c]=k<<24|E<<16|u-o|0}}return 0!==A&&(i[u+A]=w-S<<24|64<<16|0),s.bits=k,0}var pi=0,_i=1,gi=2,vi=4,wi=5,bi=6,yi=0,mi=1,ki=2,Ei=-2,Si=-3,xi=-4,Ri=-5,Ai=8,Bi=1,zi=2,Li=3,Ti=4,Mi=5,Ci=6,Di=7,Ii=8,Pi=9,Oi=10,Ui=11,Hi=12,Fi=13,Ni=14,Zi=15,ji=16,Wi=17,Yi=18,Ki=19,Xi=20,qi=21,Vi=22,Gi=23,$i=24,Ji=25,Qi=26,eo=27,to=28,ro=29,no=30,io=31,oo=32,ao=852,so=592;function ho(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Yt(320),this.work=new Yt(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fo(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Bi,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Kt(ao),t.distcode=t.distdyn=new Kt(so),t.sane=1,t.back=-1,yi):Ei}(e)):Ei}function co(e,t){var r,n;return e?(n=new lo,e.state=n,n.window=null,(r=function(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ei:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,fo(e))):Ei}(e,t))!==yi&&(e.state=null),r):Ei}var uo,po,_o=!0;function go(e){if(_o){var t;for(uo=new Kt(512),po=new Kt(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(di(_i,e.lens,0,288,uo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;di(gi,e.lens,0,32,po,0,e.work,{bits:5}),_o=!1}e.lencode=uo,e.lenbits=9,e.distcode=po,e.distbits=5}function vo(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R=0,A=new Wt(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ei;(r=e.state).mode===Hi&&(r.mode=Fi),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,c=s,u=h,E=yi;e:for(;;)switch(r.mode){case Bi:if(0===r.wrap){r.mode=Fi;break}for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0),l=0,f=0,r.mode=zi;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=no;break}if((15&l)!==Ai){e.msg="unknown compression method",r.mode=no;break}if(f-=4,k=8+(15&(l>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=no;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Li;case Li:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=$r(r.check,A,4,0)),l=0,f=0,r.mode=Ti;case Ti:for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>8),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Mi;case Mi:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0}else r.head&&(r.head.extra=null);r.mode=Ci;case Ci:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),jt(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=$r(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Di;case Di:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Hi;break;case Oi:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>=7&f,f-=7&f,r.mode=eo;break}for(;f<3;){if(0===s)break e;s--,l+=n[o++]<>>=1)){case 0:r.mode=Ni;break;case 1:if(go(r),r.mode=Xi,t===bi){l>>>=2,f-=2;break e}break;case 2:r.mode=Wi;break;case 3:e.msg="invalid block type",r.mode=no}l>>>=2,f-=2;break;case Ni:for(l>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,l+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=no;break}if(r.length=65535&l,l=0,f=0,r.mode=Zi,t===bi)break e;case Zi:r.mode=ji;case ji:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;jt(i,n,o,d,a),s-=d,o+=d,h-=d,a+=d,r.length-=d;break}r.mode=Hi;break;case Wi:for(;f<14;){if(0===s)break e;s--,l+=n[o++]<>>=5,f-=5,r.ndist=1+(31&l),l>>>=5,f-=5,r.ncode=4+(15&l),l>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=no;break}r.have=0,r.mode=Yi;case Yi:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},E=di(pi,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid code lengths set",r.mode=no;break}r.have=0,r.mode=Ki;case Ki:for(;r.have>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(x=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=no;break}k=r.lens[r.have-1],d=3+(3&l),l>>>=2,f-=2}else if(17===w){for(x=g+3;f>>=g)),l>>>=3,f-=3}else{for(x=g+7;f>>=g)),l>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=no;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===no)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=no;break}if(r.lenbits=9,S={bits:r.lenbits},E=di(_i,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid literal/lengths set",r.mode=no;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},E=di(gi,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,E){e.msg="invalid distances set",r.mode=no;break}if(r.mode=Xi,t===bi)break e;case Xi:r.mode=qi;case qi:if(s>=6&&h>=258){e.next_out=a,e.avail_out=h,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=f,ri(e,u),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,r.mode===Hi&&(r.back=-1);break}for(r.back=0;v=(R=r.lencode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,r.length=w,0===v){r.mode=Qi;break}if(32&v){r.back=-1,r.mode=Hi;break}if(64&v){e.msg="invalid literal/length code",r.mode=no;break}r.extra=15&v,r.mode=Vi;case Vi:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Gi;case Gi:for(;v=(R=r.distcode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=no;break}r.offset=w,r.extra=15&v,r.mode=$i;case $i:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=no;break}r.mode=Ji;case Ji:if(0===h)break e;if(d=u-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=no;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),_=r.window}else _=i,p=a-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[a++]=_[p++]}while(--d);0===r.length&&(r.mode=qi);break;case Qi:if(0===h)break e;i[a++]=r.length,h--,r.mode=qi;break;case eo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,l|=n[o++]<=o.wsize?(jt(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),jt(o.window,t,r-n,i,o.wnext),(n-=i)?(jt(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveyo)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function ko(e,t){for(var r=0;r15&&(a=2,n-=16),i<1||i>vn||r!==gn||n<8||n>15||t<0||t>9||o<0||o>pn)return Hn(e,sn);8===n&&(n=9);var s=new $n;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<So.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsSo.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelSo.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelSo.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=So.Z_FILTERED&&e.strategy!=So.Z_HUFFMAN_ONLY&&e.strategy!=So.Z_RLE&&e.strategy!=So.Z_FIXED&&e.strategy!=So.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!$(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new So.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=So.codes[t],r.emit("error",n)};var n=So.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=So.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||So.Z_DEFAULT_WINDOWBITS,n,e.memLevel||So.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new p(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(xo).forEach(function(e){xo[xo[e]]=e}),Be(Io,Ot),Io.prototype.params=function(e,t,r){if(eSo.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=So.Z_FILTERED&&t!=So.Z_HUFFMAN_ONLY&&t!=So.Z_RLE&&t!=So.Z_FIXED&&t!=So.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(So.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else de(r)},Io.prototype.reset=function(){return this._binding.reset()},Io.prototype._flush=function(e){this._transform(new p(0),"",e)},Io.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=So.Z_FULL_FLUSH),r.ended)t&&de(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new p(0),"",t)},Io.prototype.close=function(e){if(e&&de(e),!this._closed){this._closed=!0,this._binding.close();var t=this;de(function(){t.emit("close")})}},Io.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!$(e))return r(new Error("invalid input"));o?n=So.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||So.Z_NO_FLUSH)),this._processChunk(e,n,r)},Io.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof r;if(!s){var h,l=[],f=0;this.on("error",function(e){h=e});do{var c=this._binding.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&_(c[0],c[1]));if(this._hadError)throw h;var u=p.concat(l,f);return this.close(),u}var d=this._binding.write(t,e,o,n,this._buffer,this._offset,i);function _(h,c){if(!a._hadError){var u=i-c;if(function(e,t){if(!e)throw new Error(t)}(u>=0,"have should not go down"),u>0){var d=a._buffer.slice(a._offset,a._offset+u);a._offset+=u,s?a.push(d):(l.push(d),f+=d.length)}if((0===c||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new p(a._chunkSize)),0===c){if(o+=n-h,n=h,!s)return!0;var g=a._binding.write(t,e,o,n,a._buffer,a._offset,a._chunkSize);return g.callback=_,void(g.buffer=e)}if(!s)return!1;r()}}d.buffer=e,d.callback=_},Be(Bo,Io),Be(zo,Io),Be(Lo,Io),Be(To,Io),Be(Mo,Io),Be(Co,Io),Be(Do,Io);var Po={codes:xo,createDeflate:function(e){return new Bo(e)},createInflate:function(e){return new zo(e)},createDeflateRaw:function(e){return new Mo(e)},createInflateRaw:function(e){return new Co(e)},createGzip:function(e){return new Lo(e)},createGunzip:function(e){return new To(e)},createUnzip:function(e){return new Do(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Bo(t),e,r)},deflateSync:function(e,t){return Ao(new Bo(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Lo(t),e,r)},gzipSync:function(e,t){return Ao(new Lo(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Mo(t),e,r)},deflateRawSync:function(e,t){return Ao(new Mo(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Do(t),e,r)},unzipSync:function(e,t){return Ao(new Do(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new zo(t),e,r)},inflateSync:function(e,t){return Ao(new zo(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new To(t),e,r)},gunzipSync:function(e,t){return Ao(new To(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Co(t),e,r)},inflateRawSync:function(e,t){return Ao(new Co(t),e)},Deflate:Bo,Inflate:zo,Gzip:Lo,Gunzip:To,DeflateRaw:Mo,InflateRaw:Co,Unzip:Do,Zlib:Io};export default class{constructor(e,t,r){this.SDKAPPID=e,this.EXPIRETIME=r,this.PRIVATEKEY=t}genTestUserSig(e){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(e)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+e+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(e,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(e,t){return p.from?p.from(e,t):new p(e,t)}unescape(e){return e.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(e){return e.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(e){return this.escape(this.newBuffer(e).toString("base64"))}decode(e){return this.newBuffer(this.unescape(e),"base64")}base64encode(e){return this.newBuffer(e).toString("base64")}base64decode(e){return this.newBuffer(e,"base64").toString()}_hmacsha256(e,t,r,n){let i="TLS.identifier:"+e+"\n";i+="TLS.sdkappid:"+this.SDKAPPID+"\n",i+="TLS.time:"+t+"\n",i+="TLS.expire:"+r+"\n",null!=n&&(i+="TLS.userbuf:"+n+"\n");let o=te.HmacSHA256(i,this.PRIVATEKEY);return te.enc.Base64.stringify(o)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}_isString(e){return"string"==typeof e}genSigWithUserbuf(e,t,r){let n=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":n,"TLS.expire":t},o="";if(null!=r){let a=this.base64encode(r);i["TLS.userbuf"]=a,o=this._hmacsha256(e,n,t,a)}else o=this._hmacsha256(e,n,t,null);i["TLS.sig"]=o;let a=JSON.stringify(i),s=Po.deflateSync(this.newBuffer(a)).toString("base64"),h=this.escape(s);return console.log("ret="+h),h}validate(e){let t=this.decode(e),r=Po.inflateSync(t);console.log("validate ret="+r)}} diff --git a/TUICallKit/index.d.ts b/TUICallKit/index.d.ts new file mode 100644 index 0000000..df052ed --- /dev/null +++ b/TUICallKit/index.d.ts @@ -0,0 +1,3 @@ +import { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, StatusChange as STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, t } from './TUICallService/index'; +declare const Version = "2.1.1"; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, Version, t, }; diff --git a/TUICallKit/index.js b/TUICallKit/index.js new file mode 100644 index 0000000..fc3be4a --- /dev/null +++ b/TUICallKit/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.Version = exports.VideoDisplayMode = exports.VideoResolution = exports.CallMediaType = exports.CallRole = exports.STATUS = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = require("./TUICallService/index"); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_1.StoreName; } }); +Object.defineProperty(exports, "TUICallKitServer", { enumerable: true, get: function () { return index_1.TUICallKitServer; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_1.NAME; } }); +Object.defineProperty(exports, "STATUS", { enumerable: true, get: function () { return index_1.StatusChange; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_1.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_1.CallMediaType; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_1.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_1.VideoDisplayMode; } }); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_1.t; } }); +const Version = '2.1.1'; // basic-demo 原来上报使用 +exports.Version = Version; diff --git a/TUICallKit/package.json b/TUICallKit/package.json new file mode 100644 index 0000000..d2c79f6 --- /dev/null +++ b/TUICallKit/package.json @@ -0,0 +1,40 @@ +{ + "name": "@tencentcloud/call-uikit-wechat", + "version": "2.1.1", + "main": "./tuicall-uikit-vue.umd.js", + "module": "./tuicall-uikit-vue.es.js", + "types": "./types/index.d.ts", + "description": "An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.", + "homepage": "https://cloud.tencent.com/document/product/647/78912", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/tencentyun/TUICallKit/tree/main/uni-app/TUICallKit-Miniprogram", + "directory": "Web" + }, + "dependencies": { + "@tencentcloud/tui-core": "latest", + "tim-upload-plugin": "^1.3.0", + "tuicall-engine-wx": "latest" +}, + "bugs": { + "url": "https://github.com/tencentyun/TUICallKit/issues" + }, + "keywords": [ + "uikit", + "call", + "vue3", + "tencent", + "chat", + "vue", + "vue2", + "video", + "audio", + "voice", + "callkit", + "语音", + "视频", + "电话", + "通话" + ] +} diff --git a/TUICallKit/pages/globalCall/globalCall.js b/TUICallKit/pages/globalCall/globalCall.js new file mode 100644 index 0000000..6bcdc3f --- /dev/null +++ b/TUICallKit/pages/globalCall/globalCall.js @@ -0,0 +1,4 @@ +Page({ + data: {}, + onShow() {}, +}); diff --git a/TUICallKit/pages/globalCall/globalCall.json b/TUICallKit/pages/globalCall/globalCall.json new file mode 100644 index 0000000..4b341a7 --- /dev/null +++ b/TUICallKit/pages/globalCall/globalCall.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "TUICallKit": "../../TUICallKit/TUICallKit" + }, + "navigationStyle": "custom", + "disableScroll": true +} diff --git a/TUICallKit/pages/globalCall/globalCall.wxml b/TUICallKit/pages/globalCall/globalCall.wxml new file mode 100644 index 0000000..8c49932 --- /dev/null +++ b/TUICallKit/pages/globalCall/globalCall.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxss b/TUICallKit/pages/globalCall/globalCall.wxss similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxss rename to TUICallKit/pages/globalCall/globalCall.wxss diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/audio-false.png b/TUICallKit/static/audio-false.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/audio-false.png rename to TUICallKit/static/audio-false.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/audio-true.png b/TUICallKit/static/audio-true.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/audio-true.png rename to TUICallKit/static/audio-true.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/camera-false.png b/TUICallKit/static/camera-false.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/camera-false.png rename to TUICallKit/static/camera-false.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/camera-true.png b/TUICallKit/static/camera-true.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/camera-true.png rename to TUICallKit/static/camera-true.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/default_avatar.png b/TUICallKit/static/default_avatar.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/default_avatar.png rename to TUICallKit/static/default_avatar.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/dialing.png b/TUICallKit/static/dialing.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/dialing.png rename to TUICallKit/static/dialing.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/hangup.png b/TUICallKit/static/hangup.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/hangup.png rename to TUICallKit/static/hangup.png diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/loading.png b/TUICallKit/static/loading.png similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/static/loading.png rename to TUICallKit/static/loading.png diff --git a/TUICallKit/static/phone_dialing.mp3 b/TUICallKit/static/phone_dialing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f392528b74f642871a5114f38577b39b8547db9d GIT binary patch literal 9178 zcmai)c{o&m^v6Fl_s*EH)L`t}*oOu~O!$&rh?`ob&mNqwQJ|8$4-XIY_bT*f z<& zF(WX!THtBS%r{xEuYbbezRoWxx%qL}0^?BN**9XKyB-ic@6mC|6!2;@;?iq_e97e@ z^RDOhE}plT@%t7i-fB!XgV&cXze12XWVrxA29*#*ioZ`o+%6sC5TW013_({SfGrJt za7h#paIN6l?2N~&^+U*ipP!3MHLdUTekwlEERPYK%w75iyZ*Paxr$}VC^Cs(W?&o= ze5IWZrb!^CP{SGb5P+f{vNe$Gi4QowbcIP;_X&hH-@8*oQQf;}0hq7z0ut2)yYw|89I9d9h@H?AX_m zYZ;Wf?vQk1wE;&#@PXUje1eM~3R>pRP$~xcXRNju_cpB9gYUji2TZ&#)T?a<$kA{( zg*Ck6!=L)axm{6tUkt)7WLpX|?%B1X4=>HL<1R^%1#3$ci4RJn-U~d5>rq9oV;m|J zt4as!NO)*g+ZKr9;rTC4W04Ys4V-R4?w8B793FP#XkvB`JKdkPTO*W9I58%NUCY0> z06SzW(O7Fxj;$O%QAq>nzoWoy20kPqnAnHs@4#;J$WFXHlS)#zztyc)J*Lto-ilsa z&T8VgZnu`qu$T1A_aVk%HyXT7T$K5Soov>z4m+DF&DpoJ@#I@5MNFWsJ|0~+H}nTo(MYx zeT5&ry?e#sOE(*sG%<0U=ewnuTh(lM=!1wHyYBJ8qy61s9B*suiGP=eE@Vrt_=knB z>@+0FLw+%{8V-Qu43PQd+iOWexYXq6-Lvf;UA=+%ei*^(Scya*YYh$LOwVYFk1QNm zJLmTcz5eoLGiHwsl&GKqc1EN2XjlT#RN%HWN-!Q>61e-7vy(1#nQ_U}~5zmTo2E z@Yiy6y0U5AP0J)Boh6L39|AWlAFJU*p&D&hjAQ=tUFq^eUDvjZgEqb<8)P}%Y3yoy zO-U0kiQy|*>lAR&NcDO3&*k&${A4pnmVZpWDaSa+U{aShY=#ep*eq879>53n|A{?u zHdeD^L^)1SVB_3?RGQYzy3IDXW0enOa*>9b7tGkrV=(Pnu$vaVjLbEs>w9l z87~HPTeHD2XJsu5^ghJ;X7s(ub#8GV=o`h8jb3-@M{h@v=g4HWo#l*UdV9?tX^$`b zUT^HyPhKk==yAI?><{gWuF+)!xeiwW_p!vf> z%GhaBBNs&faShO1^Yi(?4v39VL)bue(| z3!9d@HEx|LByC2}?3Iy3h=4sD)n^8<>w2;_18X4SmgjMz!8J zlXHp;KQ|1}olG!vX3DuSJplK9^!2bT)62Tya$xG{&DKtKmQhIWvy(VVfB2U zc+RrU+xE{!B4!>>k!i2irIgcFFWz9BO4wLk&Di`M4VuRMgX$_sca-kGB~uvr*1UOt z?M;h2T0)tZ%%0<>w0e~0k^VUU3n$10?^3=9U7fK{Muvx@R4`5z;mUnkV5aI5(~H(+ z&;bLXm{sz#@-ZDZrmObq5WRC{Vs>{~y?=ba6LryiP8jOOdkUt!D#ibd8M6-#Q$2#Jfn?jgKlViv9 z!0n66>1P^|lXOpkJms4DH+$8?ZRG2qv)U=os_kEEn+t5gIDrB=&92}>4j_-}jSQ96FeM=m+7&(L>_cviDpNV_Bj z<2Vo)|Lh+l#Hd2k_!$q9?WWHcOoH;nC@MDyyx4D6(oVUz<1@S?j!vAAml9JuSIoz? zLEYR#AO)EllwZ4UMnNQE5aU=A9=iuHB;Ke%y~(#ZxL7N+8`@X;`VZCm6KlNiB4e#W znU79Z3jYZDL1!VMIJDoT<=o`xamTi4mZ5u zMTom!?|8xWMem?q=a3&5hXv*7aXN(XG^ov>&I4=$6Vh7;K-9VSFZ%ob4ZMAE;bh+- zDhXUHT+WfaK0W^+lB^}2vTyJq?SK!i%`Jbc-D%es7{?rHlS^TcPXHL{_kn2Z!T(p1cBjaiAIg+R=c1D%=X7F55? zKLRh<{Qyh|6XvgD_H2go*2FNVL{a=Kegx&Iv1$?V-b)@z4+vjh8Kcst!z0weH}U zVI#R?Vda8N70-~lkX_>QB7CV6OyD}Z(;}iYL!eQP4u1i$IOBPO8V@#Pp!OS6GdU z=a0201da^TpI8>RL`uJYbVn)^vxkeui_;C7{_nl0tFt>pR(q8W&>3qc2V9-;C8Fmo zw?T286Lv5ARa;Kg+70BS_&3@#Nw?Y(&7Zg4+KM`A z+UJsG@0IZD`Txqw>wWbtF7CFL7CwC?*b)lU?mJ_STF;t*c}U<;ap{k%lCnop@M%oWXUl$>MfJkg1DVr=3vBm&YDxm2}(N=^`dQNJ!F zySq?Csv0^xyfMyULXO@M2HcIqcjIR)fjxeY4F8;*b=LUnMMY|4lgw&~USmO}le&VH z$lvXI_f~N#C_o78YtuC<3b*)ZtWC=Z|}1x|kod~NE%>aTTFuVcQYGoPN#N1!`K;QPdXtxv zwH1^a7QK&PoM8Bnj&Fw&x=z`wL;z-Cjco-IobZMCCgVphpKiK+g({((;!s<>?Aq^2 zQePb+VOB3J_&SAsrsgTKfJ|ycyxLWPaYEsAJ>PC6A`J?{zrp;x+59~}jeS2rL15;I z747_=u;wG{jyRq_<8t)W`?3UW+28qvOUKA?Yu~zkU-llqcI8o5_J5pN&jbbzPllPS z^crvpHok?Q6BgQ*Q8MoGO0Bb&N|6oQ8RecH+^tSb&Nx-sEV18gGMi4g-M{lJkmfnF zT5BjM$2JgR>v?db@HFCY-%79wRy+6lU~s75^E7H!uf)ih;I2D!?t=@pphtVh8PbSw zZ9x(tN9F#S;NC&?wD4heWS;J8EzF)>aIah#1L#5cKbtC>jNz8hG(`8`)}>c-0}jdo z&7VUHXf+z{2LyW8mt07bJ*`r@+A+6-lOD83O17=e@4GJ524Svn2!{Im7!s4JP$4VT z5`8aoLtrZqdo_9fmwZ-*yohSGp+c0@DUnJ-$BmR0Q?s}&zFAJo0SWt%W}lSn$ijxT zhFHJh??aH+i#dViGv)Lb4hc>^h6h3kAJ+zHm9-u{Oca;T4;XoxWnBFJO*%tpc;d8OW;d8 zy0fr2>XYYJPu`v<&bNXyh2*RKa%q9Rj#T!caAFi%j?ky8?8dlU+;s3{B>+Pg!l4($)K{2YUu(8MsN+zB+ zb+7%Zs7S!zE!vupSCbsqy0}40|CW)g&E7S;g651~NlCbV*h3+6+Ca;y|NQK;2F)L5 z2nsS7#NI1JXGp1+zWKhJa(wggfM%}l81r{dut7R3NZB!Etr4Tv(GYU~Rf;u#nsUCO zjH0Kb$i+C`u%$cd=X(NZ9UKKDIEm4);hs1$$3ud1lmZ4H()+BV8|$yQj}WJLtnT?J>~?Ns0?+p66xS2tO&jhc~Y9fmzv^h(gFtU z-&YWI@6yvVs3Gmt2nh}C_Mq}>;&;4?vQKW$RJ;+>w%>on&pvRQ36DV%5{0;mUpRn| z&k-a-0QYmtuPNll(j#hq)kxEOrv?~1;4R`SgL zF0T#I#)o9CBxM)nPPn(+#r)#|PwD-ahuu!2nEnu4>)pcK_e#ct7yhcm zw;R>@)6W5gm}t1|;*Z~-9v&4v|Hy{iwWqJ}hbb30)3VhIbN!IYwaXRKLTU}faglR8 zMUrER(}|@|VVFHm1hcC=hP=wrm>^bB8JdUkk!Hh>9=S`e-gap&>dO4JVwKj+{%VY4N1*6OFmQnc$ipBN;CyMKsRGo!k+rns zp$J^hW_n^^=Xaa?Ax>uvJlujb%M_o^Bb_|t0P>(h;YUXq3DODybeuFE z$}vc!flEZ==NX^hg%K7f=9Ap$Uo-JY^-B>mm%qyo0*Bu0;eDj_r^*-7IJSLfO3^Vd ziAu`NIE!)23DWv;3}8=)>18EaqIsBU>{2r2Ip#A`#C@2zhA|pv>mb|n{hj+P&6Czt zH(Vq|>FU`AwuCPu_j28GJSFa=1YjIvxI=Cq16+ro^uzf8AFDR_P_tiswUB!|T}6Lp zo~_w=tv~9c+GEq2GFQQ9=_0R(v2x?}e4_A)GZ$LtZpTrDsC5{J1^-6%hkjob&o#&g zsE!#Q1JM%0cTp7tVA$ zM3yT)nd7)2{e626AT-Z2^QTH)^-;AI2W#0f8QTvJc9IsQ`E5tjqVs&=VN-S_#?gms z+z-+Ty9j99SM;#;tD%D4{)JJxx@=Kb)KuH?SKLY!WtA^VNer{JjKCzh&!=kLSn166 zXqr6X%i(I*8*Lbe33K&h&~-t8_$u!>=$v9T1A_$jL{E7I*W)Q`R61VdKHhcCXlQ_8 z;9BVBRDJD?xqtD^+OL-$r&>aMAg$!=H~F7EQ)~C763{t!LiaAJ^B@gN{v8yO6}m-^ zQx-PTQf53l79Mh4O(cGwacl7MYrfUJCjmdUrU!Ni)?8slqM^Y!Is|zoZw44f`&EPX zCRCsC@2({wZx8VhWWh~FA#^#3{>E#6^0-dXlJty~%AHB;9!a(^tuf_<=j9Z~edR?{ z(PWIHNf7=AtzXfoj_KxbK@P2`&?}m>(NcQ;`lf%cFD!4N68jep=6UV(17fn)nom=& zJIob~eU8(md=KBK=<;B51nV`%QH3kr1L)*8*!(_-=?{H}N-u!;G{NaZYmkTg5#$4f zG*)LnbjXXt(vA&Y7;teEDbPF4`y>-s@t)pnGw063ILh#lei#GiK!_PK$WKS}XJE}q z!AcSnwCQ)OQ|S8#d4cY#;VXg!U1~q%3Q{lghe+L|@{$Dk2!pC4e&^*bWizop%3py% zbKglP+KHjMahn7FrAg2TjUS{OWWej%X^5!)&N`~nx^&^f8-syELUP#=GHL+@5C1q1 zov${|~63iw2=Fa7h!y?vl(fO;mNfi>|@a%uE7HvNG1Q4!1@Q8*o4Us&Hl z(kfq?{^39TW>p8{_^62dg%8V4T(P(3;&VefR_(eJ@+Q{}V>xy=YRX$BkgY zzKwNiTbG}NJ?+?T%m#o%C}z8xAlJ~qsbyuN;cu82h97*L!Z<>3JzC%4M>we0pz}An zzoBpHyZr93m(cLm7mYijh@nXvZuEPGakZV?9Z-dgs?795^>QKovQfW;QWaX@=^;@V zhYY97q5C9s2x?O4!}RAd1s`21z#mnsXZolx@3=Q;`|ox;U0=?;aQ7K!S5!QJHYFT9 zJ-x*HZp2LC9CFTI$9VJbN<6x>rP{rV*&N+Wab zZ;&IziT_F?04}r8&a30{a_d6t@=Xc3fS2797>5WO>YrTcqa0Z2B=C}W@Z*7avW$z} zon)P-*Tm{nLo8JAgz`^UI~|@|8HJio=((>$mUzgV4sCM1xX<9_vD^DFjv$<=@6!R{ zVKnZks4L;%veP?^GOd&b*b+21#YU+s-pOYZV{KOpcsk{iEp1f`o}(MNynK9CcvemR z)scs^^p*NWf^+naGYGqtA+8j9j2w#>{v8wtZS$E>6;0iGk)|TG=7Wc$^`{C>-LANs zg~~m6)RoPvD_i~EE6+&_$=9*o$*#m5^^ZQSg>;Tg)rZ=z6bUym`B|?W&)Gyyd4z6-oGEhUNK{^)3K=sQb~;eR+uX-`w;? ze>qU_Q6gjE#&au9Tu5rq@EdY@g9l~n_0&5-078y$)?3PKjK1nNe0{iBen-6RrImhO z5VloFF@sA8P?_#658#A{-{=cC8xkASlmV6!W#z| zgh^UVFY!wxnunzkT1ys78ZPUvKXW?p*(GFadB1Z)(q3s<^jiQloL%J}WTB%Kt^H)= zwp0_Yd`p%U3F8RChUk8RoGK0C7+~`|5%1S96SeKY(CrrM;+^efjizQwvg!vMwro!b zjf&7XzD!X^=Cp;$;%5!>6h<%cO%La-oL{Vh`3eUZAQXaV257zTg>OQdDiQ-DfupXM z?^D*)o^t)DEux<&O*E%)T-97Qjl7CnI3)b$w(U^=I|*M|n%TLrGRz(dJhcT~U%OPH zCRP>)t%K>Gice}?&b|?otQWK+N?+{Oq>EzD@{2sGGQY64T1h+d7kd2s@k6@))v2vX zaZk$VJ6CjGgupiE03k9B?Gv70x?v-(nd?BYgQOKtK(kEqMWiypd+G100t?!)@%2{H ztN5Kk6i@Uk5I>M5btz%wui3Xs%pM}lHb2yj)1adJb+xm=9#*I1$=dC*@~6IZIOiyN zZc}28$}#y6r2dBOj$-9Rm}D|;br(ybZ*5zW1=%XXq_7jS(VPJgXm9eD5^4s=}j;^PJsVSYC*2(^z9&Wyuq#=p3ZfaxRVy^AjkIWGG6#tRTF%K5zA2M8T!eS6;vJfrU2Y^&9?R{i@ z8Jr0#i`jx2@ScS>gHmQp-58Imp)ozb)TZoogg(fbGMSj`Fts?;$Z zgEhpUbSDRZ`dL?Al6@{96dzlE_kod8@W7IML6uuR`%j?BuJWD4rB?KemYJ%PbmaWD z%W7v2#Id#1HvX4C6ixJd1@G`sH+pVPYJ+vIUTJ+cz6@37h!u`*f?e}EQyKkX7v9HM zuj3(`pY14*vu&!gETVI?nKD~;k60jxE5;FrgvDt84{{#L<@4Wy3 literal 0 HcmV?d00001 diff --git a/TUICallKit/static/phone_ringing.mp3 b/TUICallKit/static/phone_ringing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..c3838f3323254eb5543dfe05e57a2c2a4a241ade GIT binary patch literal 8752 zcmXY12|SeR+kW1eF*6v(GPWY4DA^jJD4DSo+NcO^$Wl?3R63n%UIqz;a$22Cq#QZX za!wsBGiZ|*r)d3mY<4Mp4Mj{XMVq_4^Gk&0KTM{a*KVU-wh~K2CIm{}2m;mU}P4 z7c~5E4Dt?Giodh*!*k2}O)&}Ef@lQJVF@7m(4EY0ADq-dA#xweq(9H@dJqoIy9I@Yy6P(V3sc6Cs1i#_e~r5uwnW zdF>*Jgz4RqNdi=H-=du^FaAmN*T4IRNyycnanh|v{ACk=5-#u9tI|}v1G{TYj8A*@ zu4eZuuAaZM5MobND-DQ#sRxBm<2G*~npgtF(P|Hid`}WIQ~jwNhDhW}#4rXjQ0}4L zB_%_aA2g(T8~-s})i+1h|M}ImAcIQD#UMX-UexMcb|1fg5qq)!4W(_n_VmQvMX4dM zYGU;Lz=ur~KAo#br!`7wY{Wrs5dsS$ZBX5kVH|-R2}}7`gjg<*`MINOe)&9#PDW1* zegi|UHH~q!Y{M%V|4Uv>%MITnyd!LJ;F(CWXYDNB@i=Ozb@H|w9>vT^R7l}7@|%+w z3+YT_q{VkzCh$gSx7F>~93+^L7J~+|8C#0c?;H8FW4BGF5i72?o-22jlvbP#)1gnQ z6+isFI7huK@Q7*f$~GhMhM`LBMWed+E>76;m$~iWzURv^z7H#35lQ!#&~=cO)J+s2 zLd0#&sT@lYazx!}X$%IRzwDtXX3mtW@fDVKu1@P4PwD^lT3D9)+&(0f@#_t06757| zmf!LVP}XBjcv1Lz2b$N?n`nfNv8H_bA-*?31hMSw7$Uxa?7kntW;6UTG;*kvUfB?@x%sm0RAN*+mi+H-*n` zFNu`SOmZ;WbQ6>wIa5CEdTwtH#fy-I;3#Zp@%x9W|0J$r32IF1G)9{I=}GRB2_jU> znvo$ASQA!cT{bhf)*DT79(fOMrgnMx&sR5H_}2W7yFdCO5K*vn?Sv3z&{1tQVfssW;Cj7NvC}j;3^aq;Uj6_^3HF;QH96#fT!=43maW zB7kNO5kYVNg{xk@M0j=5Wl>m->w%r22EO0+fHDT5D1p8hT0fhfIY6J1$3K^lpY>_2 zF``lU0xd-(v8W)@n5_}vznx9hUtQpn9l^K3`21|I&@0%2<*x_!7T;iotM z%5_hyKlN7l>3vlnCuFI`JDykLcOiv8??Az7+G5=<#Ma`QY_+r?2s@U;R3zeClK+NA zkc^v6{X1!OD`c>Cy77y0DWX}(AL?#}{yEm~ijCc0@uRm-yHj8BO$S82tF|AHeb#0g zCOhMVe%sUb?KOqJKuZurEMa@IIUJF?fa8S-lImYRe=7P-hs&+@h=I?E2tJUeYTdckQ6IY%uEAg-RmUy|9p zm00ZGh3hY$9>M1mX;O7-RvsVOqFBGc3`R#xFT>iM$!J*ZAcm!f$xuzTBc}d~dp~{r zSmq^lYfWF53PUYTYSsoT&+5>2I!4o5_ulw(-H{p97uXd33eAF4qN%Wh&F09%MDCFU z5zVqYmw^OMWcf>6AAN+FCk@YupEf=Yh^r^qNIlbW8o*X~YOj%&LY zRFi<%!Cs!NQEc6rG|r5;uNE^Y{1DCNETXBVj?LB}0bwN&iRz?%zDFHIoy;pMmdhB*}np9%p*h-U$YGmYLd~ zyXCj9TXMqOK=va6;-nfpy+{dn`{OqSGX`4?xE6~|X}VY6!e5P+h_-mRnX13fX0Boj z(WE;W*FR$VR_7>!s4%i*qG)8DW+fV6qrtx3W`ikl8L>JIKKmACwxzyu{PQ-CFlGhM z5q{mU>68tJr_XVHm%}{x;w_BI`NWCnO_>)xl>Ey?5XCEWlMF3`QIGC_`jR8LmO2hvg+rsl(Rtfj$*lfuhcePsm2&>Z16TS5CYw88)H>3p!`a<%q4$|QJi;No(k)dwK$P)=>lHH6# z23q#*VtA{n!&+WYy&_wa5cX^pO1Z8Ea@IGQNdhA$SR+=%WJqJIJ7bTxzG%3QOoAK? z?fwSkTwmt6|K}2c3A9BQC6s>Lvh1)wZ)DjqvPA+HvfC#Op(1@l9hZCN<&D15(ccR)(U`B@7C8x;){PZ+7|=Josgc%jW==IZ@YIa0erG9no$YAx^8FP5e6Avf zwvbN8^OwZ@as7)mt#Ll&&mdw%0~w6q{QR)lB+bNX&`X&o*nRwzXJ%BFd5Rm|Pd1V> zJP>FzWy15eJ0+{nz4>lE^ESm}aN_<8)jMV#7_nKfV9SEdjf?Il-5+Ghk;WyL zBh7PDRYM7d+>KrWRqY1HWI` z*BzE`;;8@lIE7!lU$K&C!v4e2kedYBO(xQC{m^tCgc2=d$)bcn> zzTvH@sXQIi$*Iy~JN?{oKBi1XBs?~lu7ZNZzz^=H|I_IjavblJ#jHLu(WGWP(? z&N2y0Yz=nNlPBkalEd0B0}B5LB6KWQGWik6{7g<}9UJ+C9@uD{fsjNmp01sQ9?kaA zoqYJ86bokZuHbbqf2cL)%pWQ5+^$_NdR+I_bzg7o$(H%S1G<^M67lRi(Y_J8V)x8$ z`F7xV?xmk7{A5Dcd{XFpdl79?SM9^DVni?6ezcQZnY8?1WmWT}`?sd`MB1$6axFKx z8aP?)+L=8oc0)WuPA`wGVQD;A^jBlZqvp2ypKCXrgu6HN$J`~Sk-2isv)JcL5TC*i zMue%^JEf(FV{+SuEVoA9V+Z1lx02|m!t)aCBqBo`oH+Ump`CC`c6n6o*NTM(PR_}K zFL`tGeHIwe6DK=H*~i9ixz=(^24n0jg@7jTlw=8`r6tR|B@EHC^e^njK z$(FU3oIBe#$o2>psxG&ePnSW(LGJ)idhVp~4H4=xYwu=@IC_%WnzO~od$5q=&t9qX z!CNDcSby)LDtVB1)T=$x?pv3&&owb!*Hf1A@%&`w7z&)+ttYAmcCq9(3kI8atbwBi zZJg19bptmc;czB}PovlDFnhJnS&BI1#GrOILF4%*kc?7tM!s!Cv*G;{?rkcmH2~BX zaEEn>Whpz43qQa+ISlOJEnfNu(oi}>wh;KnVkO~OD^s1^BU#1cu=?Bhn&bLmAhcWe zwLK5xcRf&)W+U3h6-ma+N#sKRNa+*E+abO^r83AysQ@g1F&(A(l3jBa(0<-lX&G^0 z*i2Y`^Q-&?WF$RE?JNDQPe3WgQBgD_0-r{^l-%wF#^ZAV((*L6CJ5aB*Q8KDlH znFlN7(n zHh`wI5fa5?d>?g$HkrLrv&Q)RiPxlTlzx9)KkP`|-|37b!oVP{B?Qe^X&Oh60KM>P)(;Q5gu~%Wx z5GPSZ0Q4kTRKwT{Tsxb!Ff@gTP6S1+cxWEQpNY2{-7qz4Dbkv9o?ljsXymeJ<5ChW zFRW@{B%yE+X#-U30~zQC=J%hMoXsgKqe1^bR)b^Uy}|D*OO$IIzJu+jz_Vs2qIT^X zDH9(WiLQh%CX1Bg`oW#VTbsqe_>%ME{3}vpO;?i0`QUj;P9RzkUm<4V6M#x*7?F01 zRlnX6_Cx-8UuZE0Rh^SV8NkaK(z4-Lli39i3{x0Z?VwS6=repkNWpG*^4k}VG1K_KbXk-%%XsN?#~ zR|K1drHSkdG|Ot`&a6vBM(Rf16cP!vKhQ9KfYop~yqtLz#;%Fmqy81DPK!aYDga>M zsThoLKh&4tYl{cH%EEejMw-*6djm`B-xoC;{rIAX!q-6P)s)p)ymq9Q5ih96`Y%XL zFkOa_i}nZagM5^7ykY8u1S=Sva%Q^hS>H7!1cWbd%QbPG26vG?s3ZpfM%2V(?co4{ z)d0iE^IYIZ#$|viUkaZ=uUT#ODotu%pk<-?52C9RQet!}+BUV+z35F1can(SlHdxgf8tatBrPuTNt958fGpC`u*1m#yc-Df|rkCvf3M;<)tqju41{_D?(&YpecDEx5o7k_1#R>-}%4#dqm1q zY1N?eoBJj0<2mTTs$=_u;#(U?=VD0AoKN05F}kg8NyuPVvU6aM34dSGb5Qb9Z?{qS zng~6%#Qdc+U52KB>fd7X9mV7IsiNcidpjd%5!`P-2j}|puR?gfLNupQs<|@>NfRmEjf1Sj^3DI^y9wh0n}agqXdg>d%?-pxIRIKmAbtnQxnp z@zwEX_E_D)Z|H>)c_NI_co-=j#uoG2unFKB60!7;5jQ;}-DKAHJu{D0S%n@=_nlq+ zEjZxFxPRh9qi0iAVg1nbeKZlJAF2P=8*nB6oy0n|!fPTDS66Uk8b;7R&OcYNQEv@jI#;S$_CRh* zyF~2vjpc1eNRWNL{$LV=a3~4m`(XZ+yj4u>|E7$e`SlgZvu9b7G3Gxz$Dx51hz?t~ z%VfsUOW#F2t??+h<#==V^PVMN0uITAWA^KyH?PHU{Z6M@yHxq$_F3uNVz8m^){R@g z8^D+*{O51^ip_Ywu-ozcs%`Hq#`*TASSGnr3F|#84|V)xJf64ZjOv;2S6bm|_axoc9qrQ4 z7(XAzof@yZ&Wa&IoU+<+e;z!rneyi-ohmAyB-zJJXxRJe_~qSoKTZu-cobj!taLOY zEZUz8{IyN5E;;-~^u#{vM-5#89t%|<5R`yI7n5jS1U+<$Kbu<+YqpwYiswsIrJ@V_ z^S0Dzs{Yfp`&*If{iuL+6B>+k=mXq=dsts3c)Z*b1DL@V z=`tC-!_u8`19VaaUFPcFaBOG(kUyT6@e@KSipSEf>SRXER`wJ7Cz^2cubdL|14~_zZ5r zCbKsbe@?{2_;&0MYf`a({uJ39JWt|$BE<7Ahs0Bv&uyZIzY~s_L(R@a7``o3Tx#hyX{yNw8xhot3s!QX1O014QAYo*EC(HH8(CE}z+(D3F zlllclNX!i5)AAKDX8&X1`NEMjp$=1gK8f{%zKLdP_sN@W?vI>S$Mt+5gcdvuc^mNC zRpr1~#Zo-Mnd)siW-#a(399}nMd5WOeQY7nu)FDURo=dEd;ENrMWVI3|I@WMluz;l(Q9|JpvABJZ&PF9M0Qk!-kxE%~X$|(K>iBfs%@O(kq>A4Z( z`OrV%h83Rg>b6wAN{8%T>Eya(@nHNj=qNU=R@Dv+-i5{c=C|XUKT6`svs=(2`IEJ-s0E z$w&#*;nTH=-gWncz3^4ALj$^wFRm~M4aj&1e^8Z5fTA0{aV?efod; zA<-WGIwt1NJ);>&)nA&r*%bT#Oq_4A|L<3_3{9#*shS%Oztsp;wFeJJ?UfBB9(*lR zCE?$FP16^HY8f^lTzq!ZCV<=hNPG_^NenMi^1h?*ne!< zAJTL9XripVZIl!d@QpDMRMUm+ZSVm%#S_*NJSWS-s%#n)6#rEA z_S8Dn%pU6esccm8(6lf)x$Ua(&6ijsia(x@um8(e`j+v6Iv(<@!TAd32P$9T`Z$)} z6_2^RoCs%cnCtEQ3_r%sB}{a`bu+vo1XPo;2lQBK!WZnJ!&3o9i$a#bh{zsKds240 zfx^f9S5f&2=Ueap@=4zII3C_l9dW+G{DrDOEr8!XDx`Z$K#E5Vu^(Va{UUso&jnQ( z_70Jxay0(pT2uZ%zD1AcM@}=kp1x^laDKFN7=^D%qQ3v~iLOt)2_w+4asMgt;CI&E5>=@h{si@)^u@9{i9d^;Sr3ea zp1|qQ#M z+7>*Z#Bhg5!F~{qZ8<6!u5{R5KK%Ee526&U(L1L$!rCw3MDfS|d}GRMrh$mYvy4X# zMTq8y^9l9`j{a*1Z6gX7+6C+*hHZiti{JkGj&XN*GW-d(;|w&kS#%^h52B zhk2{1e5GG@JwlH2Py3>6#yH>3QBP>V{5w}bmPcuc%49Z7FKV%B*rZni0bZt`cIv=j zQo-VqXMJma`Y2ON{RH2VR?HsVvnYSw)y_5F`e3+Vd_L0D6`OFr8u$Oo_HG^`cBjTk zc?*#}yI(}#FIowzjo3JGtB#uDHBTYIF~nsg$cA*nx0L$=!1d{Ax)`L9=3|DRm%x}g zz3_KD_!FuS2T}E5acfrMd?lJI;CP=mW@CTw^G(3#19(6EfdA71pAHI~+4d!7R0J$- z8*46`4QhRiHt559z&g@v(#^Q4*%MW=cNbX!pz;J&gx>Ff;?ib~gwa&A%pxMYwnP$>!ABtBp|n^$}X5`$mn*C;0xB;raLu=PT@=L3qC7e1%rk zcZ6zJ|5!5mq^t9tujSTi(2Se_&$<>#&a_nrJeuaVu*vY+YgMu0bdqa**Q6V3OY&}e zXdJTBzwn5{r}SyCIt%N^us%o8fbZ{4dQvfgtR2ZXZxSJ0j}p*7$}`dwKY9={{renderDom[0].text}} - {{renderDom[0].text}} + {{renderDom[0].text}}11 + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{callerUserInfo.nick || callerUserInfo.userId}} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{ callerUserInfo.nick || callerUserInfo.userId }} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{ item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.wxss b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.wxss new file mode 100644 index 0000000..6f2a097 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/GroupCall/GroupCall.wxss @@ -0,0 +1,754 @@ +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + + to { + transform: translateY(0); + } +} + +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100%; + height: 187px; +} + +.invite-call .local-video { + width: 100px; + height: 187px; +} + +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} + +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: 0; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.invite-calling-header-right { + display: flex; + align-items: center; +} + +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} + +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} + +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} + +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} + +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 120px auto 15px; +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.avatar { + background-color: black; +} + +/* 被叫者 */ +.invite-txt { + width: 126px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 16px auto 60px auto; +} + +.invite-other-txt { + width: 112px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 0 auto 24px auto; +} + +.invite-other-list { + position: absolute; + left: 14vw; + margin-top: 0 auto; + display: flex; + flex-wrap: wrap; + width: 272px; + justify-content: center; + flex-wrap: wrap; +} + +.invite-other-item { + flex: 0.25; + text-align: center; + max-width: 64px; + margin: 2px; +} + +.invite-other-item image { + border-radius: 10%; + max-width: 64px; + height: 64px; +} + +.invite-other-item-name { + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #666666; + letter-spacing: 0; + line-height: 18px; +} + +/* 全屏设置 */ +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.TUICalling-connected-video { + width: 100%; + height: 180%; +} + +/* 本地音频 */ +.stream-box { + float: left; + width: 187px; + height: 187px; + position: absolute; + top: 13vh; +} + +/* 远端音频列表 */ +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +/* 本地视频 */ +.play-item { + width: 100%; + height: 187px; + position: relative; + background-color: #000000; +} + +.pusher-ownvideo { + width: 100%; + height: 100%; +} + +/* 远端视频列表 */ +.swiper-list { + min-height: 189px; +} + +.player-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.player-item { + flex: 0.5; + min-width: 50%; + min-height: 187px; +} + +/* 音量图标 */ +.player-control { + background-color: rgba(0, 0, 0, 0.4); + border-radius: 0 6px 6px 0; + color: #fff; + z-index: 999; + position: absolute; + bottom: 0px; + left: 0px; + display: flex; + align-items: center; + height: 32px; + max-width: 50%; + z-index: 99; +} + +.player-control image { + width: 32px; + height: 32px; +} + +.player-control .name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-left: 10px; + margin-right: 10px; + flex: 1; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.control-buttons { + display: flex; +} + +.icon-button { + margin-right: 10px; +} + +/* 菜单 */ +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + font-weight: 400; + font-size: 14px; + color: #666666; + padding: 5px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + margin-top: 100px; + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.TRTCCalling-calling-list { + flex: 0.5; + /*设置最小宽度,才会让元素排不下,导致换行排列*/ + min-width: 50%; + min-height: 187px; + position: relative; +} + +.TRTCCalling-calling-list image { + width: 100%; + height: 100%; +} + +.TRTCCalling-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: -88px; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #666666; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.js new file mode 100644 index 0000000..2958092 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.js @@ -0,0 +1,107 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type:Object + }, + remoteUserInfoList: { + type: Array, + }, + isEarPhone: { + type: Boolean, + }, + bigScreenUserId: { + type: Boolean + } + }, + data:{ + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + }, + async reject() { + await TUICallKitServer.reject(); + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async switchCallMediaType() { + await TUICallKitServer.switchCallMediaType(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + toggleViewSize() { + TUICallKitServer.switchScreen(this.data.bigScreenUserId ? 'player':'localVideo') + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.json b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxml b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxml new file mode 100644 index 0000000..45c3bc2 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + {{remoteUserInfoList[0].displayUserInfo}} + 等待对方接受 + + + + + + + + 邀请你视频通话 + 等待对方接受 + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + + + + + + 切到语音通话 + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + {{callDuration}} + + + + + + 切到语音通话 + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxss b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxss new file mode 100644 index 0000000..06dee2d --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/SingleCall/SingleCall.wxss @@ -0,0 +1,508 @@ +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; + z-index: 9999; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.40); */ + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.30); */ + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100vw; + height: 100vh; + background-color: black; +} + +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + to { + transform: translateY(0); + } +} + +.invite-call .local-video { + width: 100vw; + height: 100vh; +} +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} +.btn-container { + display: flex; + align-items: center; + position: relative; +} +.invite-calling-header-left { + position: absolute; + right: 0; +} +.invite-calling-header-left image { + width: 32px; + height: 32px; +} +.invite-calling-header-right { + display: flex; + align-items: center; +} +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 140px auto 15px; + /* margin: 20vw 30vw; */ +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.invite-calling-list { + justify-content: flex-start; +} + +.invite-calling-item { + position: relative; + margin: 0 12px; +} +.invite-calling-item image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling-item-message { + position: absolute; + background: rgba(0, 0, 0, 0.5); + width: 100px; + height: 100px; + top: 0; + left: 0; + z-index: 2; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.avatar { + background: #dddddd; +} + +.player { + position: absolute; + right: 16px; + top: 107px; + width: 100px; + height: 178px; + padding: 16px; + z-index: 999; +} + +.pusher-video { + position: absolute; + width: 100%; + height: 100%; + z-index: 1; +} + +.stream-box { + position: relative; + float: left; + width: 50vw; + height: 260px; + /* background-color: #f75c45; */ + z-index: 3; +} + +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.live { + width: 100%; + height: 100%; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + color: #f0e9e9; + padding: 5px; + font-size: 14px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.mutil-img { + justify-content: flex-start !important; +} + +.TRTCCalling-call-audio-img { + display: flex; + flex-direction: column; + align-items: center; +} + +.TRTCCalling-call-audio-img > image { + width: 25vw; + height: 25vw; + margin: 0 4vw; + border-radius: 4vw; + position: relative; +} + +.TRTCCalling-call-audio-img text { + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-connected { + position: absolute; + right: -88px; +} + +.invite-calling-connected image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #ffffff; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.d.ts new file mode 100644 index 0000000..b3dd8e2 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.d.ts @@ -0,0 +1,15 @@ +import { IBellParams } from '../interface/index'; +export declare class BellContext { + private _bellContext; + private _isMuteBell; + private _calleeBellFilePath; + private _callRole; + private _callStatus; + constructor(); + setBellSrc(): void; + setBellProperties(bellParams: IBellParams): void; + play(): Promise; + stop(): Promise; + setBellMute(enable: boolean): Promise; + destroy(): void; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.js new file mode 100644 index 0000000..3afb593 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/bellContext.js @@ -0,0 +1,106 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BellContext = void 0; +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +const DEFAULT_CALLER_BELL_FILEPATH = '/TUICallKit/static/phone_dialing.mp3'; +const DEFAULT_CALLEE_BELL_FILEPATH = '/TUICallKit/static/phone_ringing.mp3'; +class BellContext { + constructor() { + this._bellContext = null; + this._isMuteBell = false; + this._calleeBellFilePath = DEFAULT_CALLEE_BELL_FILEPATH; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + // @ts-ignore + this._bellContext = wx.createInnerAudioContext(); + this._bellContext.loop = true; + } + setBellSrc() { + // @ts-ignore + const fs = wx.getFileSystemManager(); + try { + let playBellFilePath = DEFAULT_CALLER_BELL_FILEPATH; + if (this._callRole === index_1.CallRole.CALLEE) { + playBellFilePath = this._calleeBellFilePath || DEFAULT_CALLEE_BELL_FILEPATH; + } + fs.readFileSync(playBellFilePath, 'utf8', 0); + this._bellContext.src = playBellFilePath; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to setBellSrc, ${error}`); + } + } + setBellProperties(bellParams) { + this._callRole = bellParams.callRole || this._callRole; + this._callStatus = bellParams.callStatus || this._callStatus; + this._calleeBellFilePath = bellParams.calleeBellFilePath || this._calleeBellFilePath; + // undefined/false || isMuteBell => isMuteBell (不符合预期) + this._isMuteBell = (0, common_utils_1.isUndefined)(bellParams.isMuteBell) ? this._isMuteBell : bellParams.isMuteBell; + } + play() { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._callStatus !== index_1.CallStatus.CALLING) { + return; + } + this.setBellSrc(); + if (this._callRole === index_1.CallRole.CALLEE && !this._isMuteBell) { + yield this._bellContext.play(); + } + if (this._callRole === index_1.CallRole.CALLER) { + yield this._bellContext.play(); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to play audio file, ${error}`); + } + }); + } + stop() { + return __awaiter(this, void 0, void 0, function* () { + try { + this._bellContext.stop(); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to stop audio file, ${error}`); + } + }); + } + setBellMute(enable) { + return __awaiter(this, void 0, void 0, function* () { + if (this._callStatus !== index_1.CallStatus.CALLING && this._callRole !== index_1.CallRole.CALLEE) { + return; + } + if (enable) { + yield this.stop(); + } + else { + yield this.play(); + } + }); + } + destroy() { + try { + this._isMuteBell = false; + this._calleeBellFilePath = ''; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + this._bellContext.destroy(); + this._bellContext = null; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to destroy, ${error}`); + } + } +} +exports.BellContext = BellContext; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.d.ts new file mode 100644 index 0000000..c5872c6 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.d.ts @@ -0,0 +1,97 @@ +import { ITUICallService, ICallParams, IGroupCallParams, ICallbackParam, ISelfInfoParams, IInviteUserParams, IJoinInGroupCallParams, IInitParams } from '../interface/ICallService'; +import { LanguageType, LOG_LEVEL, VideoDisplayMode, VideoResolution } from '../const/index'; +import { ITUIGlobal } from '../interface/ITUIGlobal'; +import { ITUIStore } from '../interface/ITUIStore'; +declare const TUIGlobal: ITUIGlobal; +declare const TUIStore: ITUIStore; +export { TUIGlobal, TUIStore }; +export default class TUICallService implements ITUICallService { + static instance: TUICallService; + _tuiCallEngine: any; + private _tim; + private _TUICore; + private _timerId; + private _bellContext; + constructor(); + static getInstance(): TUICallService; + init(params: IInitParams): Promise; + destroyed(): Promise; + call(callParams: ICallParams): Promise; + groupCall(groupCallParams: IGroupCallParams): Promise; + inviteUser(params: IInviteUserParams): Promise; + joinInGroupCall(params: IJoinInGroupCallParams): Promise; + getTUICallEngineInstance(): any; + setLogLevel(level: LOG_LEVEL): void; + setLanguage(language: LanguageType): void; + enableFloatWindow(enable: boolean): void; + setSelfInfo(params: ISelfInfoParams): Promise; + setCallingBell(filePath?: string): Promise; + enableMuteMode(enable: boolean): Promise; + accept(): Promise; + hangup(): Promise; + reject(): Promise; + openCamera(videoViewDomID: string): Promise; + closeCamera(): Promise; + openMicrophone(): Promise; + closeMicrophone(): Promise; + switchScreen(userId: string): void; + switchCallMediaType(): Promise; + switchCamera(): Promise; + setSoundMode(type?: string): void; + getTim(): any; + private _addListenTuiCallEngineEvent; + private _removeListenTuiCallEngineEvent; + private _handleError; + private _handleNewInvitationReceived; + private _handleUserAccept; + private _handleUserEnter; + private _callerChangeToConnected; + private _handleUserLeave; + private _unNormalEventsManager; + private _handleInviteeReject; + private _handleNoResponse; + private _handleLineBusy; + private _handleCallingCancel; + private _handleCallingEnd; + private _handleSDKReady; + private _handleKickedOut; + private _handleCallTypeChange; + private _messageSentByMe; + private _handleUserUpdate; + private _handleCallError; + beforeCalling: ((...args: any[]) => void) | undefined; + afterCalling: ((...args: any[]) => void) | undefined; + onMinimized: ((...args: any[]) => void) | undefined; + onMessageSentByMe: ((...args: any[]) => void) | undefined; + kickedOut: ((...args: any[]) => void) | undefined; + statusChanged: ((...args: any[]) => void) | undefined; + setCallback(params: ICallbackParam): void; + toggleMinimize(): void; + private _executeExternalBeforeCalling; + private _executeExternalAfterCalling; + setVideoDisplayMode(displayMode: VideoDisplayMode): void; + setVideoResolution(resolution: VideoResolution): Promise; + private _handleExceptionExit; + private _setLocalUserInfoAudioVideoAvailable; + private _updateCallStoreBeforeCall; + private _updateCallStoreAfterCall; + private _resetCurrentDevice; + private _resetCallStore; + private _noDevicePermissionToast; + private _startTimer; + private _updateCallDuration; + private _stopTimer; + private _deleteRemoteUser; + private _analyzeEventData; + getGroupMemberList(count: number, offset: number): Promise; + getGroupProfile(): Promise; + private _handleCallStatusChange; + private _watchTUIStore; + private _unwatchTUIStore; + bindTUICore(TUICore: any): void; + private _callTUIService; + onNotifyEvent(eventName: string, subKey: string): Promise; + onCall(method: String, params: any): Promise; + private _handleTUICoreOnClick; + onGetExtension(extensionID: string, params: any): any[]; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.js new file mode 100644 index 0000000..02072c9 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/index.js @@ -0,0 +1,1147 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TUIStore = exports.TUIGlobal = void 0; +const tui_core_1 = require("@tencentcloud/tui-core"); +const index_1 = require("../const/index"); +// @ts-ignore +const tuicall_engine_wx_1 = require("tuicall-engine-wx"); +const index_2 = require("../locales/index"); +const miniProgram_1 = require("./miniProgram"); +const bellContext_1 = require("./bellContext"); +const index_3 = require("../utils/validate/index"); +const common_utils_1 = require("../utils/common-utils"); +const utils_1 = require("./utils"); +const timer_1 = __importDefault(require("../utils/timer")); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const tuiStore_1 = __importDefault(require("../TUIStore/tuiStore")); +const TUIGlobal = tuiGlobal_1.default.getInstance(); +exports.TUIGlobal = TUIGlobal; +const TUIStore = tuiStore_1.default.getInstance(); +exports.TUIStore = TUIStore; +const version = '2.1.1'; +class TUICallService { + constructor() { + this._tim = null; + this._TUICore = null; + this._timerId = -1; + this._bellContext = null; + // =========================【监听 TUIStore 中的状态】========================= + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + const bellParams = { + callRole: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE), + callStatus: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS), + }; + this._bellContext.setBellProperties(bellParams); + if (value === index_1.CallStatus.CALLING) { + yield ((_a = this === null || this === void 0 ? void 0 : this._bellContext) === null || _a === void 0 ? void 0 : _a.play()); + } + else { + // 状态变更通知 + if (value === index_1.CallStatus.CONNECTED) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const oldStatus = isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + this.statusChanged && this.statusChanged({ oldStatus, newStatus: (0, utils_1.generateStatusChangeText)(TUIStore) }); + if (!isGroup && callMediaType === index_1.CallMediaType.VIDEO) { + this.switchScreen(remoteUserInfoList[0].domId); + } + } + yield ((_b = this === null || this === void 0 ? void 0 : this._bellContext) === null || _b === void 0 ? void 0 : _b.stop()); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}handleCallStatusChange, ${error}.`); + } + }); + console.log(`${index_1.NAME.PREFIX}version: ${version}`); + this._watchTUIStore(); + this._bellContext = new bellContext_1.BellContext(); + // 下面:TUICore注册事件,注册组件服务,注册界面拓展 + tui_core_1.TUICore.registerEvent(tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED, tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this); + tui_core_1.TUICore.registerService(tui_core_1.TUIConstants.TUICalling.SERVICE.NAME, this); + tui_core_1.TUICore.registerExtension(tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID, this); + } + static getInstance() { + if (!TUICallService.instance) { + TUICallService.instance = new TUICallService(); + } + return TUICallService.instance; + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._tuiCallEngine) + return; + // @ts-ignore + let { userID, tim, userSig, sdkAppID, SDKAppID, isFromChat } = params; + if (this._TUICore) { + sdkAppID = this._TUICore.SDKAppID; + tim = this._TUICore.tim; + } + this._tim = tim; + console.log(`${index_1.NAME.PREFIX}init sdkAppId: ${sdkAppID || SDKAppID}, userId: ${userID}`); + this._tuiCallEngine = tuicall_engine_wx_1.TUICallEngine.createInstance({ + tim, + // @ts-ignore + sdkAppID: sdkAppID || SDKAppID, + callkitVersion: version, + chat: isFromChat || false, + }); + this._addListenTuiCallEngineEvent(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, { userId: userID }); + yield this._tuiCallEngine.login({ userID, userSig, assetsPath: '' }); // web && mini + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}init failed, error: ${error}.`); + throw error; + } + }); + } + // component destroy + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + try { + const currentCallStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (currentCallStatus !== index_1.CallStatus.IDLE) { + throw new Error(`please destroyed when status is idle, current status: ${currentCallStatus}`); + } + if (this._tuiCallEngine) { + this._removeListenTuiCallEngineEvent(); + yield this._tuiCallEngine.destroyInstance(); + this._tuiCallEngine = null; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}destroyed failed, error: ${error}.`); + throw error; + } + }); + } + // ===============================【通话操作】=============================== + call(callParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { type, userID } = callParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + yield this._updateCallStoreBeforeCall(type, [{ userId: userID }]); + this._executeExternalBeforeCalling(); // 执行外部传入的 beforeCall 方法 + const response = yield this._tuiCallEngine.call(callParams); + yield this._updateCallStoreAfterCall([userID], response); + } + catch (error) { + this._handleCallError(error, 'call'); + } + }); + } + ; + groupCall(groupCallParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList, type, groupID } = groupCallParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + const remoteUserInfoList = userIDList.map(userId => ({ userId })); + yield this._updateCallStoreBeforeCall(type, remoteUserInfoList, groupID); + this._executeExternalBeforeCalling(); + const response = yield this._tuiCallEngine.groupCall(groupCallParams); + yield this._updateCallStoreAfterCall(userIDList, response); + } + catch (error) { + this._handleCallError(error, 'groupCall'); + } + }); + } + inviteUser(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList } = params; + let inviteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(userIDList, this.getTim(), TUIStore); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, [...remoteUserInfoList, ...inviteUserInfoList]); + this._tuiCallEngine && (yield this._tuiCallEngine.inviteUser(params)); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}inviteUser failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + joinInGroupCall(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: true, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CONNECTED, + [index_1.NAME.CALL_MEDIA_TYPE]: params.type, + [index_1.NAME.GROUP_ID]: params.groupID, + [index_1.NAME.ROOM_ID]: params.roomID, + }; + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const response = yield this._tuiCallEngine.joinInGroupCall(params); + (params.type === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response); + this.setSoundMode(params.type === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}joinInGroupCall failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + // ===============================【其它对外接口】=============================== + getTUICallEngineInstance() { + return (this === null || this === void 0 ? void 0 : this._tuiCallEngine) || null; + } + setLogLevel(level) { + var _a; + (_a = this === null || this === void 0 ? void 0 : this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.setLogLevel(level); + } + setLanguage(language) { + if (language && Object.values(index_1.LanguageType).includes(language)) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LANGUAGE, language); + } + } + enableFloatWindow(enable) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ENABLE_FLOAT_WINDOW, enable); + } + setSelfInfo(params) { + return __awaiter(this, void 0, void 0, function* () { + const { nickName, avatar } = params; + try { + yield this._tuiCallEngine.setSelfInfo(nickName, avatar); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSelfInfo failed, error: ${error}.`); + } + }); + } + // 修改默认铃声:只支持本地铃声文件,不支持在线铃声文件;修改铃声修改的是被叫的铃声 + setCallingBell(filePath) { + return __awaiter(this, void 0, void 0, function* () { + let isCheckFileExist = true; + if (!isCheckFileExist) { + console.warn(`${index_1.NAME.PREFIX}setCallingBell failed, filePath: ${filePath}.`); + return; + } + const bellParams = { calleeBellFilePath: filePath }; + this._bellContext.setBellProperties(bellParams); + }); + } + enableMuteMode(enable) { + return __awaiter(this, void 0, void 0, function* () { + try { + const bellParams = { isMuteBell: enable }; + this._bellContext.setBellProperties(bellParams); + yield this._bellContext.setBellMute(enable); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}enableMuteMode failed, error: ${error}.`); + } + }); + } + // =============================【内部按钮操作方法】============================= + accept() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.accept(); + if (response) { + // 小程序接通时会进行授权弹框, 状态需要放在 accept 后, 否则先接通后再拉起权限设置 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini default open audio + } + } + catch (error) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + this._resetCallStore(); + } + }); + } + hangup() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.hangup(); + response === null || response === void 0 ? void 0 : response.forEach((item) => { + var _a; + if ((item === null || item === void 0 ? void 0 : item.code) === 0) { + this._callTUIService({ message: (_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.message }); + } + }); + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + reject() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.reject(); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + openCamera(videoViewDomID) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openCamera(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.VIDEO); + } + catch (error) { + this._noDevicePermissionToast(error, index_1.CallMediaType.VIDEO); + console.error(`${index_1.NAME.PREFIX}openCamera error: ${error}.`); + } + }); + } + closeCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeCamera(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.VIDEO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeCamera error: ${error}.`); + } + }); + } + openMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}openMicrophone failed, error: ${error}.`); + } + }); + } + closeMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeMicrophone failed, error: ${error}.`); + } + }); + } + switchScreen(userId) { + if (!userId) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.BIG_SCREEN_USER_ID, userId); + } + // support video to audio; not support audio to video + switchCallMediaType() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (callMediaType === index_1.CallMediaType.AUDIO) { + console.warn(`${index_1.NAME.PREFIX}switchCallMediaType failed, ${callMediaType} not support.`); + return; + } + const response = yield this._tuiCallEngine.switchCallMediaType(index_1.CallMediaType.AUDIO); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, index_1.CallMediaType.AUDIO); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const oldStatus = isGroup ? index_1.StatusChange.CALLING_GROUP_VIDEO : index_1.StatusChange.CALLING_C2C_VIDEO; + const newStatus = (0, utils_1.generateStatusChangeText)(TUIStore); + this.statusChanged && this.statusChanged({ oldStatus, newStatus }); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}switchCallMediaType failed, error: ${error}.`); + } + }); + } + switchCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.switchCamera(); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}_switchCamera failed, error: ${error}.`); + } + }); + } + setSoundMode(type) { + var _a; + try { + let isEarPhone = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE); + const soundMode = type || (isEarPhone ? index_1.AudioPlayBackDevice.SPEAKER : index_1.AudioPlayBackDevice.EAR); // UI 层切换时传参数 + (_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.selectAudioPlaybackDevice(soundMode); + if (type) { + isEarPhone = type === index_1.AudioPlayBackDevice.EAR; + } + else { + isEarPhone = !isEarPhone; + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE, isEarPhone); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSoundMode failed, error: ${error}.`); + } + } + // 切前后置 miniProgram, 切扬声器 + getTim() { + var _a, _b; + if (this._tim) + return this._tim; + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}getTim warning: _tuiCallEngine Instance is not available.`); + return null; + } + return ((_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.tim) || ((_b = this._tuiCallEngine) === null || _b === void 0 ? void 0 : _b.getTim()); // mini support getTim interface + } + // ==========================【TUICallEngine 事件处理】========================== + _addListenTuiCallEngineEvent() { + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}add engine event listener failed, engine is empty.`); + return; + } + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.ERROR, this._handleError, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived, this); // 收到邀请事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept, this); // 主叫收到被叫接通事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter, this); // 有用户进房事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave, this); // 有用户离开通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject, this); // 主叫收到被叫的拒绝通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse, this); // 主叫收到被叫的无应答事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy, this); // 主叫收到被叫的忙线事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel, this); // 主被叫在通话未建立时, 收到的取消事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady, this); // SDK Ready 回调 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut, this); // 未开启多端登录时, 多端登录收到的被踢事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd, this); // 主被叫在通话结束时, 收到的通话结束事件 + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange, this); + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate, this); // mini: user data update + } + _removeListenTuiCallEngineEvent() { + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.ERROR, this._handleError); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd); + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange); // 切换通话事件 miniProgram CALL_MODE + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate); // mini: user data update + } + _handleError(event) { + const { code, message } = event || {}; + const index = Object.values(index_1.ErrorCode).indexOf(code); + let callTips = ''; + if (index !== -1) { + const key = Object.keys(index_1.ErrorCode)[index]; + callTips = (0, index_2.t)(index_1.ErrorMessage[key]); + callTips && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text: callTips, type: index_1.NAME.ERROR }); + } + this._executeExternalAfterCalling(); + console.error(`${index_1.NAME.PREFIX}_handleError, errorCode: ${code}; errorMessage: ${callTips || message}.`); + } + _handleNewInvitationReceived(event) { + return __awaiter(this, void 0, void 0, function* () { + console.log(`${index_1.NAME.PREFIX}onCallReceived event data: ${JSON.stringify(event)}.`); + const { sponsor = '', isFromGroup, callMediaType, inviteData = {}, calleeIdList = [], groupID = '' } = this._analyzeEventData(event); + const currentUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + const remoteUserIdList = [sponsor, ...calleeIdList.filter((userId) => userId !== currentUserInfo.userId)]; + const type = callMediaType || inviteData.callType; + const callTipsKey = type === index_1.CallMediaType.AUDIO ? index_2.CallTips.CALLEE_CALLING_AUDIO_MSG : index_2.CallTips.CALLEE_CALLING_VIDEO_MSG; + let updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: isFromGroup, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CALLING, + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(callTipsKey), + [index_1.NAME.CALLER_USER_INFO]: { userId: sponsor }, + [index_1.NAME.GROUP_ID]: groupID, + }; + (0, miniProgram_1.initAndCheckRunEnv)(); + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + this._executeExternalBeforeCalling(); + this.statusChanged && this.statusChanged({ oldStatus: index_1.StatusChange.IDLE, newStatus: index_1.StatusChange.BE_INVITED }); + const remoteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(remoteUserIdList, this.getTim(), TUIStore); + const [userInfo] = remoteUserInfoList.filter((userInfo) => userInfo.userId === sponsor); + remoteUserInfoList.length > 0 && TUIStore.updateStore({ + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.CALLER_USER_INFO]: { + userId: sponsor, + nick: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.nick) || '', + avatar: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) || '', + }, + }, index_1.StoreName.CALL); + }); + } + _handleUserAccept(event) { + this._callerChangeToConnected(); + console.log(`${index_1.NAME.PREFIX}accept event data: ${JSON.stringify(event)}.`); + } + _handleUserEnter(event) { + return __awaiter(this, void 0, void 0, function* () { + this._callerChangeToConnected(); + const { userID: userId, data } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const isInRemoteUserList = remoteUserInfoList.find(item => (item === null || item === void 0 ? void 0 : item.userId) === userId); + if (!isInRemoteUserList) { + remoteUserInfoList.push({ userId }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + const [userInfo] = yield (0, utils_1.getRemoteUserProfile)([userId], this.getTim(), TUIStore); + remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + remoteUserInfoList.forEach((obj) => { + if ((obj === null || obj === void 0 ? void 0 : obj.userId) === userId) { + obj = Object.assign(obj, userInfo); + } + }); + } + remoteUserInfoList = remoteUserInfoList.map((obj) => { + if (obj.userId === userId) + obj.isEnter = true; + return obj; + }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + console.log(`${index_1.NAME.PREFIX}userEnter event data: ${JSON.stringify(event)}.`); + }); + } + _callerChangeToConnected() { + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.CALLING && callRole === index_1.CallRole.CALLER) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._startTimer(); + } + } + _handleUserLeave(event) { + console.log(`${index_1.NAME.PREFIX}userLeave event data: ${JSON.stringify(event)}.`); + const { data, userID: userId } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP)) { + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + const text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.END_CALL, prefix); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + } + userId && this._deleteRemoteUser([userId]); + } + _unNormalEventsManager(event, eventName) { + console.log(`${index_1.NAME.PREFIX}${eventName} event data: ${JSON.stringify(event)}.`); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + switch (eventName) { + case tuicall_engine_wx_1.EVENT.REJECT: + case tuicall_engine_wx_1.EVENT.LINE_BUSY: { + const { userID: userId } = this._analyzeEventData(event); + let callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.OTHER_SIDE_REJECT_CALL : index_2.CallTips.OTHER_SIDE_LINE_BUSY; + let text = (0, utils_1.generateText)(TUIStore, callTipsKey); + if (isGroup) { + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.REJECT_CALL : index_2.CallTips.IN_BUSY; + text = (0, utils_1.generateText)(TUIStore, callTipsKey, prefix); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userId && this._deleteRemoteUser([userId]); + break; + } + case tuicall_engine_wx_1.EVENT.NO_RESP: { + const { userIDList = [] } = this._analyzeEventData(event); + const callTipsKey = isGroup ? index_2.CallTips.TIMEOUT : index_2.CallTips.CALL_TIMEOUT; + const userInfoList = userIDList.map(userId => { + const userInfo = remoteUserInfoList.find(obj => obj.userId === userId) || {}; + return userInfo.displayUserInfo || userId; + }); + const text = isGroup ? (0, utils_1.generateText)(TUIStore, callTipsKey, userInfoList.join()) : (0, utils_1.generateText)(TUIStore, callTipsKey); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userIDList.length > 0 && this._deleteRemoteUser(userIDList); + break; + } + case tuicall_engine_wx_1.EVENT.CALLING_CANCEL: { + // TUIStore.update(StoreName.CALL, NAME.TOAST_INFO, { text: generateText(TUIStore, CallTips.CANCEL) }); + this._resetCallStore(); + break; + } + } + } + _handleInviteeReject(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.REJECT); + } + _handleNoResponse(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.NO_RESP); + } + _handleLineBusy(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.LINE_BUSY); + } + _handleCallingCancel(event) { + this._executeExternalAfterCalling(); + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.CALLING_CANCEL); + } + _handleCallingEnd(event) { + console.log(`${index_1.NAME.PREFIX}callEnd event data: ${JSON.stringify(event)}.`); + this._executeExternalAfterCalling(); + this._resetCallStore(); + } + // SDK_READY 后才能调用 tim 接口, 否则登录后立刻获取导致调用接口失败. v2.27.4+、v3 接口 login 后会抛出 SDK_READY + _handleSDKReady(event) { + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + localUserInfo = yield (0, utils_1.getMyProfile)(localUserInfo.userId, this.getTim(), TUIStore); // 方法里已经 try...catch 了 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + }); + } + _handleKickedOut(event) { + console.log(`${index_1.NAME.PREFIX}kickOut event data: ${JSON.stringify(event)}.`); + this.kickedOut && this.kickedOut(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_TIPS, (0, utils_1.generateText)(TUIStore, index_2.CallTips.KICK_OUT)); + this._resetCallStore(); + } + _handleCallTypeChange(event) { + const { newCallType, type } = this._analyzeEventData(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, newCallType || type); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + _messageSentByMe(event) { + const message = event === null || event === void 0 ? void 0 : event.data; + this.onMessageSentByMe && this.onMessageSentByMe(message); + } + // ==========================【 miniProgram 私有事件】========================== + _handleUserUpdate(event) { + const data = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.pusher) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, data.pusher); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + } + // 处理 “呼叫” 抛出的异常 + _handleCallError(error, methodName) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + (0, miniProgram_1.handlePackageError)(error); // 无套餐提示, 小程序 engine 不抛出 onError + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + console.error(`${index_1.NAME.PREFIX}${methodName} failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + setCallback(params) { + const { beforeCalling, afterCalling, onMinimized, onMessageSentByMe, kickedOut, statusChanged } = params; + beforeCalling && (this.beforeCalling = beforeCalling); + afterCalling && (this.afterCalling = afterCalling); + onMinimized && (this.onMinimized = onMinimized); + onMessageSentByMe && (this.onMessageSentByMe = onMessageSentByMe); + kickedOut && (this.kickedOut = kickedOut); + statusChanged && (this.statusChanged = statusChanged); + } + toggleMinimize() { + const isMinimized = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED, !isMinimized); + console.log(`${index_1.NAME.PREFIX}toggleMinimize: ${isMinimized} -> ${!isMinimized}.`); + this.onMinimized && this.onMinimized(isMinimized, !isMinimized); + } + _executeExternalBeforeCalling() { + this.beforeCalling && this.beforeCalling(); + } + _executeExternalAfterCalling() { + this.afterCalling && this.afterCalling(); + } + // ========================【TUICallKit 组件属性设置方法】======================== + setVideoDisplayMode(displayMode) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DISPLAY_MODE, displayMode); + } + setVideoResolution(resolution) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (!resolution) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.VIDEO_RESOLUTION, resolution); + yield this._tuiCallEngine.setVideoQuality(resolution); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}setVideoResolution failed, error: ${error}.`); + } + }); + } + // =========================【 miniProgram 私有公共方法】========================= + // 处理用户异常退出的情况,处理了右滑退出,以及返回退出的情况。 + _handleExceptionExit() { + return __awaiter(this, void 0, void 0, function* () { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + // 在呼叫状态下, 被叫调用 reject,主叫调用 hangup + if (callStatus === index_1.CallStatus.CALLING) { + callRole === index_1.CallRole.CALLER && (yield this.hangup()); + callRole === index_1.CallRole.CALLEE && (yield this.reject()); + } + // 在通话状态下, 统一调用 hangup 接口 + callStatus === index_1.CallStatus.CONNECTED && (yield this.hangup()); + }); + } + _setLocalUserInfoAudioVideoAvailable(isAvailable, type) { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + if (type === index_1.NAME.AUDIO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isAudioAvailable: isAvailable }); + } + if (type === index_1.NAME.VIDEO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isVideoAvailable: isAvailable }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + } + _updateCallStoreBeforeCall(type, remoteUserInfoList, groupID) { + return __awaiter(this, void 0, void 0, function* () { + let updateStoreParams = { + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLER, + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.IS_GROUP]: !!groupID, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(index_2.CallTips.CALLER_CALLING_MSG), + [index_1.NAME.GROUP_ID]: groupID + }; + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const callStatus = yield (0, miniProgram_1.beforeCall)(type, this); // 如果没有权限, 此时为 false. 因此需要在 call 后设置为 calling. 和 web 存在差异 + console.log(`${index_1.NAME.PREFIX}mini beforeCall return callStatus: ${callStatus}.`); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, callStatus); + const remoteUserInfoLists = yield (0, utils_1.getRemoteUserProfile)(remoteUserInfoList.map(obj => obj.userId), this.getTim(), TUIStore); + remoteUserInfoLists.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoLists); + }); + } + _updateCallStoreAfterCall(userIdList, response) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + if (response) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ROOM_ID, response.roomID); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CALLING); // 小程序未授权时, 此时状态为 idle; web 直接设置为 calling + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini, default open audio + } + else { + this._resetCallStore(); + } + }); + } + _resetCurrentDevice() { + // 挂断后,重置当前摄像头和麦克风为默认设备 + const { cameraList, microphoneList } = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST, { microphoneList, cameraList, currentCamera: (cameraList === null || cameraList === void 0 ? void 0 : cameraList[0]) || {}, currentMicrophone: (microphoneList === null || microphoneList === void 0 ? void 0 : microphoneList[0]) || {} }); + } + _resetCallStore() { + const oldStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + this._stopTimer(); + // localUserInfo, language 在通话结束后不需要清除 + // callStatus 清除需要通知; isMinimized 也需要通知(basic-vue3 中切小窗关闭后, 再呼叫还是小窗, 因此需要通知到组件侧) + // isGroup 也不清除(engine 先抛 cancel 事件, 再抛 reject 事件) + // displayMode、videoResolution 也不能清除, 组件不卸载, 这些属性也需保留, 否则采用默认值. + // enableFloatWindow 不清除:开启/关闭悬浮窗功能。 + let notResetOrNotifyKeys = Object.keys(index_1.CALL_DATA_KEY).filter((key) => { + switch (index_1.CALL_DATA_KEY[key]) { + case index_1.NAME.CALL_STATUS: + case index_1.NAME.LANGUAGE: + case index_1.NAME.IS_GROUP: + case index_1.NAME.DISPLAY_MODE: + case index_1.NAME.VIDEO_RESOLUTION: + case index_1.NAME.ENABLE_FLOAT_WINDOW: + case index_1.NAME.LOCAL_USER_INFO: { + return false; + } + default: { + return true; + } + } + }); + notResetOrNotifyKeys = notResetOrNotifyKeys.map(key => index_1.CALL_DATA_KEY[key]); + TUIStore.reset(index_1.StoreName.CALL, notResetOrNotifyKeys); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + callStatus !== index_1.CallStatus.IDLE && TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.CALL_STATUS], true); // callStatus reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_MINIMIZED], true); // isMinimized reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_EAR_PHONE], true); // isEarPhone reset need notify + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO)), { isVideoAvailable: false, isAudioAvailable: false })); + this._resetCurrentDevice(); + const newStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + if (oldStatusStr !== newStatusStr) { + this.statusChanged && this.statusChanged({ oldStatus: oldStatusStr, newStatus: newStatusStr }); + } + } + _noDevicePermissionToast(error, type) { + if ((0, common_utils_1.handleNoDevicePermissionError)(error)) { + let text = ''; + if (type === index_1.CallMediaType.AUDIO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_MICROPHONE_DEVICE_PERMISSION); + } + if (type === index_1.CallMediaType.VIDEO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_CAMERA_DEVICE_PERMISSION); + } + text && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text, type: index_1.NAME.ERROR }); + console.error(`${index_1.NAME.PREFIX}call failed, error: ${error.message}.`); + } + } + // 通话时长更新 + _startTimer() { + if (this._timerId === -1) { + this._timerId = timer_1.default.run(index_1.NAME.TIMEOUT, this._updateCallDuration.bind(this), { delay: 1000 }); + } + } + _updateCallDuration() { + let callDurationStr = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION); + const callDurationNum = (0, common_utils_1.formatTimeInverse)(callDurationStr); + callDurationStr = (0, common_utils_1.formatTime)(callDurationNum + 1); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION, callDurationStr); + } + _stopTimer() { + if (this._timerId !== -1) { + timer_1.default.clearTask(this._timerId); + this._timerId = -1; + } + } + _deleteRemoteUser(userIdList) { + if (userIdList.length === 0) + return; + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + userIdList.forEach((userId) => { + remoteUserInfoList = remoteUserInfoList.filter((obj) => obj.userId !== userId); + }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + } + _analyzeEventData(event) { + return (event === null || event === void 0 ? void 0 : event.data) || {}; // mini INVITED + } + // =========================【调用 chat api】========================= + // 获取群成员 + getGroupMemberList(count, offset) { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + let groupMemberList = yield (0, utils_1.getGroupMemberList)(groupID, this.getTim(), count, offset); + return groupMemberList; + }); + } + // 获取群信息 + getGroupProfile() { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + return yield (0, utils_1.getGroupProfile)(groupID, this.getTim()); + }); + } + _watchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _unwatchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + // =========================【web 融合 chat 提供的方法】========================= + bindTUICore(TUICore) { + this._TUICore = TUICore; + } + // 下面方法用于接入 TUICore + _callTUIService(params) { + const { message } = params || {}; + tui_core_1.TUICore.callService({ + serviceName: tui_core_1.TUIConstants.TUIChat.SERVICE.NAME, + method: tui_core_1.TUIConstants.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST, + params: { message }, + }); + } + onNotifyEvent(eventName, subKey) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (eventName === tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED) { + if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) { + // TUICallkit 收到登录成功时执行自己的业务逻辑处理 + // @ts-ignore + const { chat, userID, userSig, SDKAppID } = tui_core_1.TUILogin.getContext(); + yield this.init({ tim: chat, userID, userSig, sdkAppID: SDKAppID, isFromChat: true }); + } + else if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS) { + yield this.destroyed(); + } + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}TUICore onNotifyEvent failed, error: ${error}.`); + } + }); + } + onCall(method, params) { + return __awaiter(this, void 0, void 0, function* () { + if (method === tui_core_1.TUIConstants.TUICalling.SERVICE.METHOD.START_CALL) { + yield this._handleTUICoreOnClick(params, params.type); + } + }); + } + _handleTUICoreOnClick(options, type) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { groupID, userIDList = [] } = options, rest = __rest(options, ["groupID", "userIDList"]); + if (groupID) { + yield this.groupCall(Object.assign({ groupID, userIDList, type }, rest)); + } + else if (userIDList.length === 1) { + yield this.call(Object.assign({ userID: userIDList[0], type }, rest)); + } + } + catch (error) { + console.debug(error); + } + }); + } + onGetExtension(extensionID, params) { + if (extensionID === tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID) { + const list = []; + const audioCallExtension = { + weight: 1000, + text: '语音通话', + icon: index_1.AudioCallIcon, + data: { + name: 'voiceCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.AUDIO); }), // 点击时发起通话 + }, + }; + const videoCallExtension = { + weight: 900, + text: '视频通话', + icon: index_1.VideoCallIcon, + data: { + name: 'videoCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.VIDEO); }), // 点击时发起通话 + }, + }; + if (!(params === null || params === void 0 ? void 0 : params.filterVoice)) { + list.push(audioCallExtension); + } + if (!(params === null || params === void 0 ? void 0 : params.filterVideo)) { + list.push(videoCallExtension); + } + return list; + } + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.init), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "init", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.call), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "call", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.groupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "groupCall", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.inviteUser), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "inviteUser", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.joinInGroupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "joinInGroupCall", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setLanguage), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setLanguage", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableFloatWindow), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "enableFloatWindow", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setSelfInfo), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setSelfInfo", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setCallingBell), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setCallingBell", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableMuteMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "enableMuteMode", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "accept", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "hangup", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "reject", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "switchScreen", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCallMediaType", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setSoundMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoDisplayMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setVideoDisplayMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoResolution), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setVideoResolution", null); +exports.default = TUICallService; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.d.ts new file mode 100644 index 0000000..bd5ede2 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.d.ts @@ -0,0 +1,6 @@ +import { CallMediaType, CallStatus } from '../const/index'; +export declare function initialUI(): void; +export declare function checkRunPlatform(): void; +export declare function initAndCheckRunEnv(): void; +export declare function beforeCall(type: CallMediaType, that: any): Promise; +export declare function handlePackageError(error: any): void; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.js new file mode 100644 index 0000000..c279d08 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/miniProgram.js @@ -0,0 +1,76 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handlePackageError = exports.beforeCall = exports.initAndCheckRunEnv = exports.checkRunPlatform = exports.initialUI = void 0; +const index_1 = require("../const/index"); +function initialUI() { + // 收起键盘 + // @ts-ignore + wx.hideKeyboard({ + complete: () => { }, + }); +} +exports.initialUI = initialUI; +; +// 检测运行时环境, 当是微信开发者工具时, 提示用户需要手机调试 +function checkRunPlatform() { + // @ts-ignore + const systemInfo = wx.getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + // 当前运行在微信开发者工具里 + // @ts-ignore + wx.showModal({ + icon: 'none', + title: '运行环境提醒', + content: '微信开发者工具不支持原生推拉流组件(即 标签),请使用真机调试或者扫码预览。', + showCancel: false, + }); + } +} +exports.checkRunPlatform = checkRunPlatform; +; +function initAndCheckRunEnv() { + initialUI(); // miniProgram 收起键盘, 隐藏 tabBar + checkRunPlatform(); // miniProgram 检测运行时环境 +} +exports.initAndCheckRunEnv = initAndCheckRunEnv; +function beforeCall(type, that) { + return __awaiter(this, void 0, void 0, function* () { + try { + initAndCheckRunEnv(); + // 检查设备权限 + const deviceMap = { + microphone: true, + camera: type === index_1.CallMediaType.VIDEO, + }; + const hasDevicePermission = yield that._tuiCallEngine.deviceCheck(deviceMap); // miniProgram 检查设备权限 + return hasDevicePermission ? index_1.CallStatus.CALLING : index_1.CallStatus.IDLE; + } + catch (error) { + console.debug(error); + return index_1.CallStatus.IDLE; + } + }); +} +exports.beforeCall = beforeCall; +// 套餐问题提示, 小程序最低需要群组通话版, 1v1 通话版本使用 TRTC 就会报错 +function handlePackageError(error) { + if ((error === null || error === void 0 ? void 0 : error.code) === -1002) { + // @ts-ignore + wx.showModal({ + icon: 'none', + title: 'error', + content: (error === null || error === void 0 ? void 0 : error.message) || '', + showCancel: false, + }); + } +} +exports.handlePackageError = handlePackageError; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.d.ts new file mode 100644 index 0000000..ee19134 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.d.ts @@ -0,0 +1,9 @@ +import { IUserInfo } from '../interface/ICallService'; +import { ITUIStore } from '../interface/ITUIStore'; +export declare function setDefaultUserInfo(userId: string, domId?: string): IUserInfo; +export declare function getMyProfile(myselfUserId: string, tim: any, TUIStore: any): Promise; +export declare function getRemoteUserProfile(userIdList: Array, tim: any, TUIStore: any): Promise; +export declare function generateText(TUIStore: ITUIStore, key: string, prefix?: string, suffix?: string): string; +export declare function generateStatusChangeText(TUIStore: ITUIStore): string; +export declare function getGroupMemberList(groupID: string, tim: any, count: any, offset: any): Promise; +export declare function getGroupProfile(groupID: string, tim: any): Promise; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.js new file mode 100644 index 0000000..0eaed04 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/CallService/utils.js @@ -0,0 +1,167 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGroupProfile = exports.getGroupMemberList = exports.generateStatusChangeText = exports.generateText = exports.getRemoteUserProfile = exports.getMyProfile = exports.setDefaultUserInfo = void 0; +const index_1 = require("../const/index"); +const index_2 = require("../locales/index"); +// 设置默认的 UserInfo 信息 +function setDefaultUserInfo(userId, domId) { + const userInfo = { + userId, + nick: '', + avatar: '', + remark: '', + displayUserInfo: '', + isAudioAvailable: false, + isVideoAvailable: false, + isEnter: false, + domId: domId || userId, + }; + return domId ? userInfo : Object.assign(Object.assign({}, userInfo), { isEnter: false }); // localUserInfo 没有 isEnter, remoteUserInfoList 有 isEnter +} +exports.setDefaultUserInfo = setDefaultUserInfo; +// 获取个人用户信息 +function getMyProfile(myselfUserId, tim, TUIStore) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = setDefaultUserInfo(myselfUserId, index_1.NAME.LOCAL_VIDEO); + try { + if (!tim) + return localUserInfo; + const res = yield tim.getMyProfile(); + const currentLocalUserInfo = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); // localUserInfo may have been updated + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + localUserInfo = Object.assign(Object.assign(Object.assign({}, localUserInfo), currentLocalUserInfo), { userId: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.userID, nick: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.nick, avatar: (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.avatar }); + } + return localUserInfo; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getMyProfile failed, error: ${error}.`); + return localUserInfo; + } + }); +} +exports.getMyProfile = getMyProfile; +// 获取远端用户列表信息 +function getRemoteUserProfile(userIdList, tim, TUIStore) { + return __awaiter(this, void 0, void 0, function* () { + let remoteUserInfoList = userIdList.map((userId) => setDefaultUserInfo(userId)); + try { + if (!tim) + return remoteUserInfoList; + const res = yield tim.getFriendProfile({ userIDList: userIdList }); + if (res.code === 0) { + const { friendList = [], failureUserIDList = [] } = res.data; + let unFriendList = failureUserIDList.map((obj) => obj.userID); + if (failureUserIDList.length > 0) { + const res = yield tim.getUserProfile({ userIDList: failureUserIDList.map((obj) => obj.userID) }); + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + unFriendList = (res === null || res === void 0 ? void 0 : res.data) || []; + } + } + const currentRemoteUserInfoList = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); // remoteUserInfoList may have been updated + const tempFriendIdList = friendList.map((obj) => obj.userID); + const tempUnFriendIdList = unFriendList.map((obj) => obj.userID); + remoteUserInfoList = userIdList.map((userId) => { + var _a, _b, _c, _d, _e, _f, _g; + const defaultUserInfo = setDefaultUserInfo(userId); + const friendListIndex = tempFriendIdList.indexOf(userId); + const unFriendListIndex = tempUnFriendIdList.indexOf(userId); + let remark = ''; + let nick = ''; + let displayUserInfo = ''; + let avatar = ''; + if (friendListIndex !== -1) { + remark = ((_a = friendList[friendListIndex]) === null || _a === void 0 ? void 0 : _a.remark) || ''; + nick = ((_c = (_b = friendList[friendListIndex]) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.nick) || ''; + displayUserInfo = remark || nick || defaultUserInfo.userId || ''; + avatar = ((_e = (_d = friendList[friendListIndex]) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.avatar) || ''; + } + if (unFriendListIndex !== -1) { + nick = ((_f = unFriendList[unFriendListIndex]) === null || _f === void 0 ? void 0 : _f.nick) || ''; + displayUserInfo = nick || defaultUserInfo.userId || ''; + avatar = ((_g = unFriendList[unFriendListIndex]) === null || _g === void 0 ? void 0 : _g.avatar) || ''; + } + const userInfo = currentRemoteUserInfoList.find(subObj => subObj.userId === userId) || {}; + return Object.assign(Object.assign(Object.assign({}, defaultUserInfo), userInfo), { remark, nick, displayUserInfo, avatar }); + }); + } + return remoteUserInfoList; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getRemoteUserProfile failed, error: ${error}.`); + return remoteUserInfoList; + } + }); +} +exports.getRemoteUserProfile = getRemoteUserProfile; +// 生成弹框提示文案 +function generateText(TUIStore, key, prefix, suffix) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + let callTips = `${(0, index_2.t)(key)}`; + if (isGroup) { + callTips = prefix ? `${prefix} ${callTips}` : callTips; + callTips = suffix ? `${callTips} ${suffix}` : callTips; + } + return callTips; +} +exports.generateText = generateText; +// 生成 statusChange 抛出的字符串 +function generateStatusChangeText(TUIStore) { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.IDLE) { + return index_1.StatusChange.IDLE; + } + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + if (callStatus === index_1.CallStatus.CALLING) { + return isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + } + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (isGroup) { + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_GROUP_AUDIO : index_1.StatusChange.CALLING_GROUP_VIDEO; + } + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_C2C_AUDIO : index_1.StatusChange.CALLING_C2C_VIDEO; +} +exports.generateStatusChangeText = generateStatusChangeText; +// 获取群组[offset, count + offset]区间成员 +function getGroupMemberList(groupID, tim, count, offset) { + return __awaiter(this, void 0, void 0, function* () { + let groupMemberList = []; + try { + const res = yield tim.getGroupMemberList({ groupID, count, offset }); + if (res.code === 0) { + return res.data.memberList || groupMemberList; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupMember failed, error: ${error}.`); + return groupMemberList; + } + }); +} +exports.getGroupMemberList = getGroupMemberList; +// 获取 IM 群信息 +function getGroupProfile(groupID, tim) { + return __awaiter(this, void 0, void 0, function* () { + let groupProfile = {}; + try { + const res = yield tim.getGroupProfile({ groupID }); + if (res.code === 0) { + return res.data.group || groupProfile; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupProfile failed, error: ${error}.`); + return groupProfile; + } + }); +} +exports.getGroupProfile = getGroupProfile; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.d.ts new file mode 100644 index 0000000..81b787d --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.d.ts @@ -0,0 +1,21 @@ +import { ITUIGlobal } from '../interface/ITUIGlobal'; +export default class TUIGlobal implements ITUIGlobal { + static instance: TUIGlobal; + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + constructor(); + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance(): TUIGlobal; + initEnv(): void; + initOfficial(SDKAppID: number): void; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.js new file mode 100644 index 0000000..049ac74 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIGlobal/tuiGlobal.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const env_1 = require("../utils/env"); +class TUIGlobal { + constructor() { + this.global = env_1.APP_NAMESPACE; + this.isPC = false; + this.isH5 = false; + this.isWeChat = false; + this.isApp = false; + this.isUniPlatform = false; + this.isOfficial = false; + this.isWIN = false; + this.isMAC = false; + this.initEnv(); + } + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance() { + if (!TUIGlobal.instance) { + TUIGlobal.instance = new TUIGlobal(); + } + return TUIGlobal.instance; + } + initEnv() { + this.isPC = env_1.IS_PC; + this.isH5 = env_1.IS_H5; + this.isWeChat = env_1.IN_WX_MINI_APP; + this.isApp = env_1.IN_UNI_NATIVE_APP && !env_1.IN_WX_MINI_APP; // uniApp 打包小程序时 IN_UNI_NATIVE_APP 为 true,所以此处需要增加条件 + this.isUniPlatform = env_1.IN_UNI_APP; + this.isWIN = env_1.IS_WIN; + this.isMAC = env_1.IS_MAC; + } + initOfficial(SDKAppID) { + this.isOfficial = (SDKAppID === 1400187352 || SDKAppID === 1400188366); + } +} +exports.default = TUIGlobal; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.d.ts new file mode 100644 index 0000000..b9ada5a --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.d.ts @@ -0,0 +1,8 @@ +import { ICallStore } from '../interface/ICallStore'; +export default class CallStore { + defaultStore: ICallStore; + store: ICallStore; + update(key: keyof ICallStore, data: any): void; + getData(key: string | undefined): any; + reset(keyList?: Array): void; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.js new file mode 100644 index 0000000..8ac66ef --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/callStore.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +class CallStore { + constructor() { + this.defaultStore = { + callStatus: index_1.CallStatus.IDLE, + callRole: index_1.CallRole.UNKNOWN, + callMediaType: index_1.CallMediaType.UNKNOWN, + localUserInfo: { userId: '' }, + remoteUserInfoList: [], + callerUserInfo: { userId: '' }, + isGroup: false, + callDuration: '00:00:00', + callTips: '', + toastInfo: { text: '' }, + isMinimized: false, + enableFloatWindow: false, + bigScreenUserId: '', + language: (0, common_utils_1.getLanguage)(), + isClickable: false, + deviceList: { cameraList: [], microphoneList: [], currentCamera: {}, currentMicrophone: {} }, + showPermissionTip: false, + groupID: '', + roomID: 0, + // TUICallKit 组件上的属性 + displayMode: index_1.VideoDisplayMode.COVER, + videoResolution: index_1.VideoResolution.RESOLUTION_480P, + showSelectUser: false, + // 小程序相关属性 + pusher: {}, + player: [], + isEarPhone: false, // 是否是听筒, 默认: false + }; + this.store = Object.assign({}, this.defaultStore); + } + ; + update(key, data) { + switch (key) { + // case 'callTips': + // break; + default: + // resolve "Type 'any' is not assignable to type 'never'.ts", ref: https://github.com/microsoft/TypeScript/issues/31663 + this.store[key] = data; + } + } + getData(key) { + if (!key) + return this.store; + return this.store[key]; + } + // reset call store + reset(keyList = []) { + if (keyList.length === 0) { + keyList = Object.keys(this.store); + } + const resetToDefault = keyList.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: this.defaultStore[key] })), {}); + this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), resetToDefault); + } +} +exports.default = CallStore; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.d.ts new file mode 100644 index 0000000..964ae33 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.d.ts @@ -0,0 +1,50 @@ +import { ITUIStore, IOptions, Task } from '../interface/ITUIStore'; +import { StoreName } from '../const/index'; +export default class TUIStore implements ITUIStore { + static instance: TUIStore; + task: Task; + private storeMap; + private timerId; + constructor(); + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance(): TUIStore; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName: StoreName, options: IOptions): void; + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName: StoreName, key: string): any; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + private notify; + reset(storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean): void; + updateStore(params: any, name?: StoreName): void; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.js new file mode 100644 index 0000000..7acaa59 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/TUIStore/tuiStore.js @@ -0,0 +1,155 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const callStore_1 = __importDefault(require("./callStore")); +const common_utils_1 = require("../utils/common-utils"); +class TUIStore { + constructor() { + this.timerId = -1; + this.storeMap = { + [index_1.StoreName.CALL]: new callStore_1.default(), + }; + // todo 此处后续优化结构后调整 + this.task = {}; // 保存监听回调列表 + } + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance() { + if (!TUIStore.instance) { + TUIStore.instance = new TUIStore(); + } + return TUIStore.instance; + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName, options, params) { + if (!this.task[storeName]) { + this.task[storeName] = {}; + } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + const callback = options[key]; + if (!watcher[key]) { + watcher[key] = new Map(); + } + watcher[key].set(callback, 1); + const { notifyRangeWhenWatch } = params || {}; + // 注册监听后, 通知所有注册该 key 的监听,使用 'all' 时要特别注意是否对其他地方的监听产生影响 + if (notifyRangeWhenWatch === index_1.NAME.ALL) { + this.notify(storeName, key); + } + // 注册监听后, 仅通知自己本次监听该 key 的数据 + if (notifyRangeWhenWatch === index_1.NAME.MYSELF) { + const data = this.getData(storeName, key); + callback.call(this, data); + } + }); + } + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName, options) { + // todo 该接口暂未支持,unwatch掉同一类,如仅传入store注销掉该store下的所有callback,同样options仅传入key注销掉该key下的所有callback + // options的callback function为必填参数,后续修改 + if (!this.task[storeName]) { + return; + } + ; + // if (isString(options)) { + // // 移除所有的监听 + // if (options === '*') { + // const watcher = this.task[storeName]; + // Object.keys(watcher).forEach(key => { + // watcher[key].clear(); + // }); + // } else { + // console.warn(`${NAME.PREFIX}unwatch warning: options is ${options}`); + // } + // return; + // } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + watcher[key].delete(options[key]); + }); + } + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName, key, data) { + var _a; + // 基本数据类型时, 如果相等, 就不进行更新, 减少不必要的 notify + if ((0, common_utils_1.isString)(data) || (0, common_utils_1.isNumber)(data) || (0, common_utils_1.isBoolean)(data)) { + const currentData = this.storeMap[storeName]['store'][key]; // eslint-disable-line + if (currentData === data) + return; + } + (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.update(key, data); + this.notify(storeName, key); + } + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName, key) { + var _a; + return (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.getData(key); + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + notify(storeName, key) { + if (!this.task[storeName]) { + return; + } + const watcher = this.task[storeName]; + if (watcher[key]) { + const callbackMap = watcher[key]; + const data = this.getData(storeName, key); + for (const [callback] of callbackMap.entries()) { + callback.call(this, data); + } + } + } + reset(storeName, keyList = [], isNotificationNeeded = false) { + if (storeName in this.storeMap) { + const store = this.storeMap[storeName]; + // reset all + if (keyList.length === 0) { + keyList = Object.keys(store === null || store === void 0 ? void 0 : store.store); + } + store.reset(keyList); + if (isNotificationNeeded) { + keyList.forEach((key) => { + this.notify(storeName, key); + }); + } + } + } + // 批量修改多个 key-value + updateStore(params, name) { + const storeName = name ? name : index_1.StoreName.CALL; + Object.keys(params).forEach((key) => { + this.update(storeName, key, params[key]); + }); + } +} +exports.default = TUIStore; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.d.ts new file mode 100644 index 0000000..8af20c4 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.d.ts @@ -0,0 +1,93 @@ +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +export declare enum StoreName { + CALL = "call", + CUSTOM = "custom" +} +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallMediaType { + UNKNOWN = 0, + AUDIO = 1, + VIDEO = 2 +} +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +export declare enum CallRole { + UNKNOWN = "unknown", + CALLEE = "callee", + CALLER = "caller" +} +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallStatus { + IDLE = "idle", + CALLING = "calling", + CONNECTED = "connected" +} +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +export declare enum VideoDisplayMode { + CONTAIN = "contain", + COVER = "cover", + FILL = "fill" +} +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +export declare enum VideoResolution { + RESOLUTION_480P = "480p", + RESOLUTION_720P = "720p", + RESOLUTION_1080P = "1080p" +} +export declare enum LanguageType { + EN = "en", + 'ZH-CN' = "zh-cn", + JA_JP = "ja_JP" +} +export type TDeviceList = { + cameraList: any[]; + microphoneList: any[]; + currentCamera: any; + currentMicrophone: any; +}; +export declare const StatusChange: { + readonly IDLE: "idle"; + readonly BE_INVITED: "be-invited"; + readonly DIALING_C2C: "dialing-c2c"; + readonly DIALING_GROUP: "dialing-group"; + readonly CALLING_C2C_AUDIO: "calling-c2c-audio"; + readonly CALLING_C2C_VIDEO: "calling-c2c-video"; + readonly CALLING_GROUP_AUDIO: "calling-group-audio"; + readonly CALLING_GROUP_VIDEO: "calling-group-video"; +}; +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +export declare enum AudioPlayBackDevice { + EAR = "ear", + SPEAKER = "speaker" +} +export declare enum DeviceType { + MICROPHONE = "microphone", + CAMERA = "camera" +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.js new file mode 100644 index 0000000..e6a9f63 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/call.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeviceType = exports.AudioPlayBackDevice = exports.StatusChange = exports.LanguageType = exports.VideoResolution = exports.VideoDisplayMode = exports.CallStatus = exports.CallRole = exports.CallMediaType = exports.StoreName = void 0; +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +var StoreName; +(function (StoreName) { + StoreName["CALL"] = "call"; + StoreName["CUSTOM"] = "custom"; +})(StoreName = exports.StoreName || (exports.StoreName = {})); +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallMediaType; +(function (CallMediaType) { + CallMediaType[CallMediaType["UNKNOWN"] = 0] = "UNKNOWN"; + CallMediaType[CallMediaType["AUDIO"] = 1] = "AUDIO"; + CallMediaType[CallMediaType["VIDEO"] = 2] = "VIDEO"; +})(CallMediaType = exports.CallMediaType || (exports.CallMediaType = {})); +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +var CallRole; +(function (CallRole) { + CallRole["UNKNOWN"] = "unknown"; + CallRole["CALLEE"] = "callee"; + CallRole["CALLER"] = "caller"; +})(CallRole = exports.CallRole || (exports.CallRole = {})); +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallStatus; +(function (CallStatus) { + CallStatus["IDLE"] = "idle"; + CallStatus["CALLING"] = "calling"; + CallStatus["CONNECTED"] = "connected"; +})(CallStatus = exports.CallStatus || (exports.CallStatus = {})); +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +var VideoDisplayMode; +(function (VideoDisplayMode) { + VideoDisplayMode["CONTAIN"] = "contain"; + VideoDisplayMode["COVER"] = "cover"; + VideoDisplayMode["FILL"] = "fill"; +})(VideoDisplayMode = exports.VideoDisplayMode || (exports.VideoDisplayMode = {})); +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +var VideoResolution; +(function (VideoResolution) { + VideoResolution["RESOLUTION_480P"] = "480p"; + VideoResolution["RESOLUTION_720P"] = "720p"; + VideoResolution["RESOLUTION_1080P"] = "1080p"; +})(VideoResolution = exports.VideoResolution || (exports.VideoResolution = {})); +// 支持的语言 +var LanguageType; +(function (LanguageType) { + LanguageType["EN"] = "en"; + LanguageType["ZH-CN"] = "zh-cn"; + LanguageType["JA_JP"] = "ja_JP"; +})(LanguageType = exports.LanguageType || (exports.LanguageType = {})); +/* === 【原来 TUICallKit 对外暴露】=== */ +// 原来 web callKit 定义通知外部状态变更的变量, 对外暴露 +exports.StatusChange = { + IDLE: "idle", + BE_INVITED: "be-invited", + DIALING_C2C: "dialing-c2c", + DIALING_GROUP: "dialing-group", + CALLING_C2C_AUDIO: "calling-c2c-audio", + CALLING_C2C_VIDEO: "calling-c2c-video", + CALLING_GROUP_AUDIO: "calling-group-audio", + CALLING_GROUP_VIDEO: "calling-group-video", +}; +/* === 【小程序使用】=== */ +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +var AudioPlayBackDevice; +(function (AudioPlayBackDevice) { + AudioPlayBackDevice["EAR"] = "ear"; + AudioPlayBackDevice["SPEAKER"] = "speaker"; +})(AudioPlayBackDevice = exports.AudioPlayBackDevice || (exports.AudioPlayBackDevice = {})); +; +var DeviceType; +(function (DeviceType) { + DeviceType["MICROPHONE"] = "microphone"; + DeviceType["CAMERA"] = "camera"; +})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.d.ts new file mode 100644 index 0000000..000d4a0 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.d.ts @@ -0,0 +1,2 @@ +export declare const ErrorCode: any; +export declare const ErrorMessage: any; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.js new file mode 100644 index 0000000..1449c3c --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/error.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorMessage = exports.ErrorCode = void 0; +// 错误码 +exports.ErrorCode = { + SWITCH_TO_AUDIO_CALL_FAILED: 60001, + SWITCH_TO_VIDEO_CALL_FAILED: 60002, + MICROPHONE_UNAVAILABLE: 60003, + CAMERA_UNAVAILABLE: 60004, + BAN_DEVICE: 60005, + NOT_SUPPORTED_WEBRTC: 60006, + ERROR_BLACKLIST: 20007, +}; +exports.ErrorMessage = { + SWITCH_TO_AUDIO_CALL_FAILED: 'switchToAudioCall-call-failed', + SWITCH_TO_VIDEO_CALL_FAILED: 'switchToVideoCall-call-failed', + MICROPHONE_UNAVAILABLE: 'microphone-unavailable', + CAMERA_UNAVAILABLE: 'camera-unavailable', + BAN_DEVICE: 'ban-device', + NOT_SUPPORTED_WEBRTC: 'not-supported-webrtc', + ERROR_BLACKLIST: 'blacklist-user-tips' +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.d.ts new file mode 100644 index 0000000..a81bc31 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.d.ts @@ -0,0 +1,12 @@ +export * from './call'; +export * from './error'; +export * from './log'; +export declare const CALL_DATA_KEY: any; +export declare const NAME: any; +export declare const AudioCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call.png"; +export declare const VideoCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg"; +export declare const MAX_NUMBER_ROOM_ID = 2147483647; +export declare enum PLATFORM { + MAC = "mac", + WIN = "win" +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.js new file mode 100644 index 0000000..3ca1e32 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/index.js @@ -0,0 +1,60 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PLATFORM = exports.MAX_NUMBER_ROOM_ID = exports.VideoCallIcon = exports.AudioCallIcon = exports.NAME = exports.CALL_DATA_KEY = void 0; +__exportStar(require("./call"), exports); +__exportStar(require("./error"), exports); +__exportStar(require("./log"), exports); +// import { keys } from 'ts-transformer-keys'; +// import { ICallStore } from '../interface/store'; +// console.warn('--> ', keys()) +exports.CALL_DATA_KEY = { + CALL_STATUS: 'callStatus', + CALL_ROLE: 'callRole', + CALL_MEDIA_TYPE: 'callMediaType', + LOCAL_USER_INFO: 'localUserInfo', + REMOTE_USER_INFO_LIST: 'remoteUserInfoList', + CALLER_USER_INFO: 'callerUserInfo', + IS_GROUP: 'isGroup', + CALL_DURATION: 'callDuration', + CALL_TIPS: 'callTips', + TOAST_INFO: 'toastInfo', + IS_MINIMIZED: 'isMinimized', + ENABLE_FLOAT_WINDOW: 'enableFloatWindow', + BIG_SCREEN_USER_ID: 'bigScreenUserId', + LANGUAGE: 'language', + IS_CLICKABLE: 'isClickable', + DISPLAY_MODE: 'displayMode', + VIDEO_RESOLUTION: 'videoResolution', + PUSHER: 'pusher', + PLAYER: 'player', + IS_EAR_PHONE: 'isEarPhone', + SHOW_PERMISSION_TIP: 'SHOW_PERMISSION_TIP', + GROUP_ID: 'groupID', + ROOM_ID: 'roomID', + SHOW_SELECT_USER: 'showSelectUser', +}; +exports.NAME = Object.assign({ PREFIX: '【CallService】', AUDIO: 'audio', VIDEO: 'video', LOCAL_VIDEO: 'localVideo', ERROR: 'error', TIMEOUT: 'timeout', RAF: 'raf', INTERVAL: 'interval', DEFAULT: 'default', BOOLEAN: 'boolean', STRING: 'string', NUMBER: 'number', OBJECT: 'object', ARRAY: 'array', FUNCTION: 'function', UNDEFINED: "undefined", ALL: 'all', MYSELF: 'myself', DEVICE_LIST: 'deviceList' }, exports.CALL_DATA_KEY); +exports.AudioCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call.png'; +exports.VideoCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg'; +exports.MAX_NUMBER_ROOM_ID = 2147483647; +var PLATFORM; +(function (PLATFORM) { + // eslint-disable-next-line no-unused-vars + PLATFORM["MAC"] = "mac"; + // eslint-disable-next-line no-unused-vars + PLATFORM["WIN"] = "win"; +})(PLATFORM = exports.PLATFORM || (exports.PLATFORM = {})); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.d.ts new file mode 100644 index 0000000..d265832 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.d.ts @@ -0,0 +1,7 @@ +export declare enum LOG_LEVEL { + NORMAL = 0, + RELEASE = 1, + WARNING = 2, + ERROR = 3, + NONE = 4 +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.js new file mode 100644 index 0000000..44c05fc --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/const/log.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LOG_LEVEL = void 0; +/* eslint-disable */ +// 唯一一个变量格式有问题的, 但是为了和原来 TUICallKit 对外暴露的保持一致 +var LOG_LEVEL; +(function (LOG_LEVEL) { + LOG_LEVEL[LOG_LEVEL["NORMAL"] = 0] = "NORMAL"; + LOG_LEVEL[LOG_LEVEL["RELEASE"] = 1] = "RELEASE"; + LOG_LEVEL[LOG_LEVEL["WARNING"] = 2] = "WARNING"; + LOG_LEVEL[LOG_LEVEL["ERROR"] = 3] = "ERROR"; + LOG_LEVEL[LOG_LEVEL["NONE"] = 4] = "NONE"; +})(LOG_LEVEL = exports.LOG_LEVEL || (exports.LOG_LEVEL = {})); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.d.ts new file mode 100644 index 0000000..fc8bcff --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.d.ts @@ -0,0 +1,5 @@ +import TUICallService, { TUIGlobal, TUIStore } from './CallService/index'; +import { StoreName, NAME, CallRole, CallMediaType, CallStatus, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice } from './const/index'; +import { t } from './locales/index'; +declare const TUICallKitServer: TUICallService; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, CallStatus, CallRole, CallMediaType, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice, t, }; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.js new file mode 100644 index 0000000..4c86f2e --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/index.js @@ -0,0 +1,44 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.AudioPlayBackDevice = exports.VideoDisplayMode = exports.VideoResolution = exports.StatusChange = exports.CallMediaType = exports.CallRole = exports.CallStatus = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = __importStar(require("./CallService/index")); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +const index_2 = require("./const/index"); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_2.StoreName; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_2.NAME; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_2.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_2.CallMediaType; } }); +Object.defineProperty(exports, "CallStatus", { enumerable: true, get: function () { return index_2.CallStatus; } }); +Object.defineProperty(exports, "StatusChange", { enumerable: true, get: function () { return index_2.StatusChange; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_2.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_2.VideoDisplayMode; } }); +Object.defineProperty(exports, "AudioPlayBackDevice", { enumerable: true, get: function () { return index_2.AudioPlayBackDevice; } }); +const index_3 = require("./locales/index"); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_3.t; } }); +// 实例化 +const TUICallKitServer = index_1.default.getInstance(); +exports.TUICallKitServer = TUICallKitServer; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.d.ts new file mode 100644 index 0000000..2e6eff1 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.d.ts @@ -0,0 +1,93 @@ +import { CallStatus, CallRole } from '../const/index'; +/** + * @interface ITUICallService +*/ +export interface ITUICallService { + /** + * 初始化 Service + * @function + * @private + */ + init(params: any): void; + /** + * 1v1 通话 + * @function + * @param {SwitchUserStatusParams} options 用户状态控制参数 + */ + call(callParams: ICallParams): void; +} +type SDKAppID = { + SDKAppID: number; +} | { + sdkAppID: number; +}; +export interface IInitParamsBase { + userID: string; + userSig: string; + tim?: any; + isFromChat?: boolean; +} +export type IInitParams = IInitParamsBase & SDKAppID; +export interface ICallParams { + userID: string; + type: number; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IGroupCallParams { + userIDList: Array; + type: number; + groupID: string; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IUserInfo { + userId: string; + nick?: string; + avatar?: string; + remark?: string; + displayUserInfo?: string; + isAudioAvailable?: boolean; + isVideoAvailable?: boolean; + volume?: number; + isEnter?: boolean; + domId?: string; +} +export interface IOfflinePushInfo { + title?: string; + description?: string; + androidOPPOChannelID?: string; + extension: String; +} +export interface ICallbackParam { + beforeCalling?: (...args: any[]) => void; + afterCalling?: (...args: any[]) => void; + onMinimized?: (...args: any[]) => void; + onMessageSentByMe?: (...args: any[]) => void; + kickedOut?: (...args: any[]) => void; + statusChanged?: (...args: any[]) => void; +} +export interface ISelfInfoParams { + nickName: string; + avatar: string; +} +export interface IBellParams { + callRole?: CallRole; + callStatus?: CallStatus; + isMuteBell?: boolean; + calleeBellFilePath?: string; +} +export interface IInviteUserParams { + userIDList: string[]; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IJoinInGroupCallParams { + type: number; + groupID: string; + roomID: number; +} +export {}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallService.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.d.ts new file mode 100644 index 0000000..9dcd2e2 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.d.ts @@ -0,0 +1,33 @@ +import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList } from '../const/index'; +import { IUserInfo } from './index'; +export interface IToastInfo { + text: string; + type?: string; +} +export interface ICallStore { + callStatus: CallStatus; + callRole: CallRole; + callMediaType: CallMediaType; + localUserInfo: IUserInfo; + remoteUserInfoList: Array; + callerUserInfo: IUserInfo; + isGroup: boolean; + callDuration: string; + callTips: string; + toastInfo: IToastInfo; + isMinimized: boolean; + enableFloatWindow: boolean; + bigScreenUserId: string; + language: string; + isClickable: boolean; + showPermissionTip: boolean; + deviceList: TDeviceList; + groupID: string; + roomID: number; + displayMode: VideoDisplayMode; + videoResolution: VideoResolution; + pusher: any; + player: any[]; + isEarPhone: boolean; + showSelectUser: boolean; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ICallStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.d.ts new file mode 100644 index 0000000..91b86ce --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.d.ts @@ -0,0 +1,36 @@ +/** + * @interface TUIGlobal + * @property {Object} global 根据运行环境代理 wx、uni、window + * @property {Boolean} isPC true 标识是 pc 网页 + * @property {Boolean} isH5 true 标识是 手机 H5 + * @property {Boolean} isWeChat true 标识是 微信小程序 + * @property {Boolean} isApp true 标识是 uniapp 打包的 native app + * @property {Boolean} isUniPlatform true 标识当前应用是通过 uniapp 平台打包的产物 + * @property {Boolean} isOfficial true 标识是腾讯云官网 Demo 应用 + * @property {Boolean} isWIN true 标识是window系统pc + * @property {Boolean} isMAC true 标识是mac os系统pc +*/ +export interface ITUIGlobal { + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + /** + * 初始化 TUIGlobal 环境变量 + * @function + * @private + */ + initEnv(): void; + /** + * 初始化 isOfficial + * @function + * @param {number} SDKAppID 当前实例的应用 SDKAppID + * @private + */ + initOfficial(SDKAppID: number): void; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIGlobal.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.d.ts new file mode 100644 index 0000000..5784ffa --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.d.ts @@ -0,0 +1,75 @@ +import { StoreName } from '../const/index'; +export type Task = Record void, 1>>>; +export interface IOptions { + [key: string]: (newData?: any) => void; +} +/** + * @class TUIStore + * @property {ICustomStore} customStore 自定义 store,可根据业务需要通过以下 API 进行数据操作。 +*/ +export interface ITUIStore { + task: Task; + /** + * UI 组件注册监听 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options UI 组件注册的监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围 + * @example + * // UI 层监听会话列表更新通知 + * let onConversationListUpdated = function(conversationList) { + * console.warn(conversationList); + * } + * TUIStore.watch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 组件取消监听回调 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回调等 + * @example + * // UI 层取消监听会话列表更新通知 + * TUIStore.unwatch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + unwatch(storeName: StoreName, options: IOptions | string): void; + /** + * 获取 store 中的数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要获取的 key + * @private + */ + getData(storeName: StoreName, key: string): any; + /** + * 更新 store + * - 需要使用自定义 store 时可以用此 API 更新自定义数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要更新的 key + * @example + * // UI 层更新自定义 Store 数据 + * TUIStore.update(StoreName.CUSTOM, 'customKey', 'customData') + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 重置 store 内数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {Array} keyList 需要 reset 的 keyList + * @param {boolean} isNotificationNeeded 是否需要触发更新 + * @private + */ + reset: (storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean) => void; + /** + * 修改多个 key-value + * @param {Object} params 多个 key-value 组成的 object + * @param {StoreName} storeName store 名称 + */ + updateStore: (params: any, name?: StoreName) => void; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/ITUIStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.d.ts new file mode 100644 index 0000000..5f8f48c --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.d.ts @@ -0,0 +1,4 @@ +export * from './ICallService'; +export * from './ICallStore'; +export * from './ITUIGlobal'; +export * from './ITUIStore'; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.js new file mode 100644 index 0000000..ed699ff --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/interface/index.js @@ -0,0 +1,20 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./ICallService"), exports); +__exportStar(require("./ICallStore"), exports); +__exportStar(require("./ITUIGlobal"), exports); +__exportStar(require("./ITUIStore"), exports); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.d.ts new file mode 100644 index 0000000..c7efd74 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.d.ts @@ -0,0 +1,90 @@ +export declare const en: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'no response from the other side': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'no-user': string; + 'member-not-added': string; + 'input-phone-userID': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'Use-phone-and-computer': string; + 'Wechat scan right QR code': string; + 'Scan the QR code above': string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.js new file mode 100644 index 0000000..9188607 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/en.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.en = void 0; +exports.en = { + 'hangup': 'Hang up', + 'reject': 'Decline', + 'other side reject call': 'other side reject call', + 'reject call': 'Reject Call', + 'accept': 'Accept', + 'cancel': 'Cancel Call', + 'other side line busy': 'other side line busy', + 'in busy': 'in busy', + 'call timeout': 'call timeout', + 'no response from the other side': 'no response from the other side', + 'end call': 'end call', + 'timeout': 'timeout', + 'kick out': 'kick out', + 'caller calling message': 'Waiting for the callee to accept the invitation...', + 'callee calling video message': 'You are invited to a video call...', + 'callee calling audio message': 'You are invited to a audio call...', + 'no microphone access': 'no microphone access', + 'no camera access': 'no camera access', + 'invite member': 'Invite Member', + 'speaker': 'speaker', + 'Invited group call': 'Invited you to a group call', + 'Those involved': 'Those involved in the call are', + 'call': 'call', + 'video-call': 'video call', + 'audio-call': 'audio call', + 'search': 'search', + 'search-result': 'search result', + 'no-user': 'user not found', + 'member-not-added': 'member not added', + 'input-phone-userID': 'phone number or userID', + 'not-login': 'not logged in', + 'login-status-expire': 'login status is invalid, please refresh the page and try again', + 'experience-multi-call': 'experience multi-person calls, please download the full-featured demo: ', + 'not-support-multi-call': 'multi-person call interface is not open', + 'userID': 'userID', + 'already-enter': 'entered the call', + 'waiting': 'Calling...', + 'camera-opened': 'Camera on', + 'camera-closed': 'Camera off', + 'microphone-opened': 'Mic on', + 'microphone-closed': 'Mic off', + 'camera': 'Camera', + 'microphone': 'Microphone', + 'image-resolution': 'Resolution', + 'default-image-resolution': 'Default', + 'invited-person': 'Invite', + 'video-to-audio': 'Switch to audio', + 'me': '(me)', + 'be-rejected': 'Call declined, ', + 'be-no-response': 'No response, ', + 'be-line-busy': 'Line busy, ', + 'be-canceled': 'The call is canceled, ', + 'voice-call-end': 'Voice call ended', + 'video-call-end': 'Video call ended', + 'method-call-failed': 'Failed to sync the operation', + 'failed-to-obtain-permission': 'Failed to obtain permissions', + 'environment-detection-failed': 'Failed to check the environment', + 'switchToAudioCall-call-failed': 'switch to audio call method failed', + 'switchToVideoCall-call-failed': 'switch to video call method failed', + 'microphone-unavailable': 'No mic found', + 'camera-unavailable': 'No camera found', + 'ban-device': 'Device access denied', + 'not-supported-webrtc': 'Your current environment does not support WebRTC', + 'blacklist-user-tips': 'The identifier is in blacklist. Failed to send this message!', + 'is-already-calling': 'TUICallKit is already on a call', + 'need-init': 'Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ', + "can't call yourself": "Can't call yourself", + 'Use-phone-and-computer': 'Use your mobile phone and computer to experience video calls', + 'Wechat scan right QR code': 'Wechat scan right QR code', + 'Scan the QR code above': 'Scan the QR code above', + 'accept-error': 'Accept failed', + 'accept-device-error': 'Accept failed, unable to auth calling device', + 'call-error': 'Start call failed', + 'browser-authorization': 'Browser authorization', + 'mac-privacy': 'System Preferences -> Security and Privacy -> Privacy', + 'win-privacy': 'Setting -> Privacy and Security -> App permissions', + 'mac-preferences': 'Open System Preferences', + 'win-preferences': 'Open Setting', + 'open camera': 'Open Camera', + 'close camera': 'Close Camera', + 'open microphone': 'Open Microphone', + 'close microphone': 'Close Microphone', + 'Please enter userID': 'Please enter userID', + 'View more': 'View more', + 'people selected': 'people selected', + 'Select all': 'Select all', + 'Cancel': 'Cancel', + 'Done': 'Done', +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.d.ts new file mode 100644 index 0000000..afbb43d --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.d.ts @@ -0,0 +1,10 @@ +export declare const CallTips: any; +export declare const languageData: languageDataType; +export declare function t(key: any): string; +interface languageItemType { + [key: string]: string; +} +interface languageDataType { + [key: string]: languageItemType; +} +export {}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.js new file mode 100644 index 0000000..12a5316 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/index.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.languageData = exports.CallTips = void 0; +const index_1 = require("../CallService/index"); +const index_2 = require("../const/index"); +const en_1 = require("./en"); +const zh_cn_1 = require("./zh-cn"); +const ja_JP_1 = require("./ja_JP"); +exports.CallTips = { + OTHER_SIDE: 'other side', + CANCEL: 'cancel', + OTHER_SIDE_REJECT_CALL: 'other side reject call', + REJECT_CALL: 'reject call', + OTHER_SIDE_LINE_BUSY: 'other side line busy', + IN_BUSY: 'in busy', + CALL_TIMEOUT: 'call timeout', + END_CALL: 'end call', + TIMEOUT: 'timeout', + KICK_OUT: 'kick out', + CALLER_CALLING_MSG: 'caller calling message', + CALLEE_CALLING_VIDEO_MSG: 'callee calling video message', + CALLEE_CALLING_AUDIO_MSG: 'callee calling audio message', + NO_MICROPHONE_DEVICE_PERMISSION: 'no microphone access', + NO_CAMERA_DEVICE_PERMISSION: 'no camera access', +}; +exports.languageData = { + en: en_1.en, + 'zh-cn': zh_cn_1.zh, + ja_JP: ja_JP_1.ja_JP, +}; +// language translate +function t(key) { + var _a; + const language = index_1.TUIStore.getData(index_2.StoreName.CALL, index_2.NAME.LANGUAGE); + // eslint-disable-next-line + for (const langKey in exports.languageData) { + if (langKey === language) { + const currentLanguage = exports.languageData[langKey]; + // eslint-disable-next-line + for (const sentenceKey in currentLanguage) { + if (sentenceKey === key) { + return currentLanguage[sentenceKey]; + } + } + } + } + const enString = (_a = key['en']) === null || _a === void 0 ? void 0 : _a.key; // eslint-disable-line + console.error(`${index_2.NAME.PREFIX}translation is not found: ${key}.`); + return enString; +} +exports.t = t; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.d.ts new file mode 100644 index 0000000..d03dfc7 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.d.ts @@ -0,0 +1,85 @@ +export declare const ja_JP: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.js new file mode 100644 index 0000000..ca52108 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/ja_JP.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ja_JP = void 0; +exports.ja_JP = { + 'hangup': '通話終了', + 'reject': '拒否', + 'other side reject call': '通話が拒否されました', + 'reject call': '通話拒否', + 'accept': '応答', + 'cancel': '通話をキャンセル', + 'other side line busy': '相手が通話中です', + 'in busy': '通話中', + 'call timeout': '呼び出しタイムアウト', + 'end call': '通話終了', + 'timeout': 'タイムアウト', + 'kick out': 'キックアウトされました', + 'caller calling message': '相手が招待を承諾するのを待っています。', + 'callee calling video message': 'ビデオ通話に招待されました。', + 'callee calling audio message': '音声通話に招待されました。', + 'no microphone access': 'マイクにアクセスできません', + 'no camera access': 'カメラにアクセスできません', + 'invite member': 'メンバーを招待する', + 'speaker': 'スピーカー', + 'Invited group call': 'グループ通話に招待されました。', + 'Those involved': '参加者:', + 'call': '通話', + 'video-call': 'ビデオ通話', + 'audio-call': '音声通話', + 'search': '検索', + 'search-result': '検索結果', + 'Wechat scan right QR code': 'WeChatで右側にあるQRコードを読み取ります。', + 'Use-phone-and-computer': '携帯電話とコンピュータを使用してビデオ通話を体験してください', + 'Scan the QR code above': '上のQRコードを読み取ります。', + 'no-user': 'ユーザーが見つかりませんでした', + 'member-not-added': 'メンバーが追加されていません', + 'not-login': 'ログインしていません', + 'login-status-expire': 'ログインの有効期限が過ぎています。ページを更新してもう一度お試しください', + 'experience-multi-call': '複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください', + 'not-support-multi-call': 'グループ通話インターフェイスが開いていません', + 'input-phone-userID': '携帯電話番号/ユーザーIDを入力してください', + 'userID': 'ユーザーID', + 'already-enter': 'すでに通話に参加しています', + 'waiting': '応答を待っています...', + 'camera-opened': 'カメラがオンになっています', + 'camera-closed': 'カメラがオフになっています', + 'microphone-opened': 'マイクがオンになっています', + 'microphone-closed': 'マイクがオフになっています', + 'camera': 'カメラ', + 'microphone': 'マイク', + 'image-resolution': '解像度', + 'default-image-resolution': 'デフォルト解像度', + 'invited-person': 'メンバーを招待', + 'video-to-audio': '音声通話に切り替えます', + 'me': '(自分)', + 'be-rejected': '通話が拒否されました, ', + 'be-no-response': '応答なし, ', + 'be-line-busy': '相手が通話中です, ', + 'be-canceled': '相手が通話をキャンセルしました', + 'voice-call-end': '音声通話が終了しました', + 'video-call-end': 'ビデオ通話が終了しました', + 'method-call-failed': '操作の同期に失敗しました', + 'failed-to-obtain-permission': '権限の取得に失敗しました', + 'environment-detection-failed': '環境の検出に失敗しました', + 'switchToAudioCall-call-failed': '音声通話に切り替えることはできません', + 'switchToVideoCall-call-failed': 'ビデオ通話に切り替えることはできません', + 'microphone-unavailable': '使用できるマイクがありません', + 'camera-unavailable': '使用できるカメラがありません', + 'ban-device': 'デバイスへのアクセスが拒否されました', + 'not-supported-webrtc': '現在の環境はWebRTCをサポートしていません', + 'blacklist-user-tips': 'ユーザーはブラックリストに登録され、通話が開始できませんでした', + 'is-already-calling': 'TUICallKit はすでに通話中です', + 'need-init': 'TUICallKitで通話を開始する前に、TUICallKitServer.init() メソッドが正常に実行されたことを確認してください。', + "can't call yourself": '自分に電話をかけることができません', + 'accept-error': '接続できませんでした', + 'accept-device-error': '接続できませんでした。発信側デバイスを認証できません', + 'call-error': '通話が開始できませんでした', + 'browser-authorization': 'ブラウザ認証', + 'mac-privacy': 'システム環境設定 -> セキュリティとプライバシー ->プライバシー', + 'win-privacy': '設定 -> セキュリティとプライバシー ->アプリのアクセス許可', + 'mac-preferences': 'システム環境設定を開く', + 'win-preferences': 'システム設定を開く', + 'Please enter userID': 'ユーザーIDを入力してください', + 'View more': 'もっと見る', + 'people selected': '人が選択されました', + 'Select all': 'すべて選択', + 'Cancel': 'キャンセル', + 'Done': '完了', +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.d.ts new file mode 100644 index 0000000..369b1c7 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.d.ts @@ -0,0 +1,89 @@ +export declare const zh: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.js new file mode 100644 index 0000000..ac854ae --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/locales/zh-cn.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.zh = void 0; +exports.zh = { + 'hangup': '挂断', + 'reject': '拒绝', + 'other side reject call': '对方已拒绝', + 'reject call': '拒绝通话', + 'accept': '接受', + 'cancel': '取消通话', + 'other side line busy': '对方忙线', + 'in busy': '正在忙', + 'call timeout': '呼叫超时', + 'end call': '结束通话', + 'timeout': '超时', + 'kick out': '被踢', + 'caller calling message': '正在等待对方接受邀请…', + 'callee calling video message': '邀请您进行视频通话…', + 'callee calling audio message': '邀请您进行语音通话…', + 'no microphone access': '没有麦克风权限', + 'no camera access': '没有摄像头权限', + 'invite member': '邀请成员', + 'speaker': '扬声器', + 'Invited group call': '邀请你参加多人通话', + 'Those involved': '参与通话的有:', + 'call': '通话', + 'video-call': '视频通话', + 'audio-call': '音频通话', + 'search': '搜索', + 'search-result': '搜索结果', + 'Wechat scan right QR code': '微信扫右二维码', + 'Use-phone-and-computer': '用手机与电脑互打体验视频通话', + 'Scan the QR code above': '扫描上方二维码', + 'no-user': '未搜索到用户', + 'member-not-added': '未添加成员', + 'not-login': '未登录', + 'login-status-expire': '登录状态已失效,请刷新网页重试', + 'experience-multi-call': '体验多人通话请下载全功能demo:', + 'not-support-multi-call': '多人通话接口未开放', + 'input-phone-userID': '请输入手机号/用户ID', + 'userID': '用户ID', + 'already-enter': '已经进入当前通话', + 'waiting': '等待接听...', + 'camera-opened': '摄像头已开', + 'camera-closed': '摄像头已关', + 'microphone-opened': '麦克风已开', + 'microphone-closed': '麦克风已关', + 'camera': '摄像头', + 'microphone': '麦克风', + 'image-resolution': '分辨率', + 'default-image-resolution': '默认分辨率', + 'invited-person': '添加成员', + 'video-to-audio': '切到语音通话', + 'me': '(我)', + 'be-rejected': '对方已拒绝,', + 'be-no-response': '对方无应答,', + 'be-line-busy': '对方忙线中,', + 'be-canceled': '对方已取消', + 'voice-call-end': '语音通话结束', + 'video-call-end': '视频通话结束', + 'method-call-failed': '同步操作失败', + 'failed-to-obtain-permission': '权限获取失败', + 'environment-detection-failed': '环境检测失败', + 'switchToAudioCall-call-failed': '切语音调用失败', + 'switchToVideoCall-call-failed': '切视频调用失败', + 'microphone-unavailable': '没有可用的麦克风设备', + 'camera-unavailable': '没有可用的摄像头设备', + 'ban-device': '用户禁止使用设备', + 'not-supported-webrtc': '当前环境不支持 WebRTC', + 'blacklist-user-tips': '发起通话失败,被对方拉入黑名单,禁止发起!', + 'is-already-calling': 'TUICallKit 已在通话状态', + 'need-init': 'TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功', + "can't call yourself": '不能呼叫自己', + 'accept-error': '接通失败', + 'accept-device-error': '接通失败,通话设备获取失败', + 'call-error': '发起通话失败', + 'browser-authorization': '浏览器授权', + 'mac-privacy': '系统偏好设置 -> 安全与隐私 -> 隐私', + 'win-privacy': '设置 -> 隐私和安全性 -> 应用权限', + 'mac-preferences': '打开系统偏好设置', + 'win-preferences': '打开系统设置', + 'open camera': '打开摄像头', + 'close camera': '关闭摄像头', + 'open microphone': '打开麦克风', + 'close microphone': '关闭麦克风', + 'Please enter userID': '请输入 userID', + 'View more': '查看更多', + 'people selected': '人已选中', + 'Select all': '全选', + 'Cancel': '取消', + 'Done': '完成', +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.d.ts new file mode 100644 index 0000000..3474175 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.d.ts @@ -0,0 +1,11 @@ +export declare class CallManager { + private _globalCallPagePath; + private _isPageRedirected; + init(params: any): Promise; + private _watchTUIStore; + private _unwatchTUIStore; + private _handleCallStatusChange; + private _handleCallStatusToCalling; + private _handleCallStatusToIdle; + destroyed(): Promise; +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.js new file mode 100644 index 0000000..7f4fbe5 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/serve/callManager.js @@ -0,0 +1,133 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallManager = void 0; +const index_1 = require("../../index"); +const index_2 = require("../const/index"); +const index_3 = require("../utils/validate/index"); +/** + * @param {Number} sdkAppID 用户的sdkAppID 必传 + * @param {String} userID 用户的userID 必传 + * @param {String} userSig 用户的userSig 必传 + * @param {String} globalCallPagePath 跳转的路径 必传 + * @param {ChatSDK} tim tim实例 非必传 + */ +const PREFIX = 'callManager'; +class CallManager { + constructor() { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + switch (value) { + case index_2.CallStatus.CALLING: + case index_2.CallStatus.CONNECTED: + this._handleCallStatusToCalling(); + break; + case index_2.CallStatus.IDLE: + this._handleCallStatusToIdle(); + break; + } + }); + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + const { sdkAppID, userID, userSig, globalCallPagePath, tim } = params; + if (!globalCallPagePath) { + console.error(`${PREFIX} globalCallPagePath Can not be empty!`); + return; + } + ; + this._globalCallPagePath = globalCallPagePath; + try { + yield index_1.TUICallKitServer.init({ + sdkAppID, + userID, + userSig, + tim, + }); + this._watchTUIStore(); + // 全局监听下,关闭悬浮窗 + index_1.TUICallKitServer.enableFloatWindow(false); + console.log(`${PREFIX} init Ready!`); + } + catch (error) { + console.error(`${PREFIX} init fail!`); + } + }); + } + // =========================【监听 TUIStore 中的状态】========================= + _watchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }, { + notifyRangeWhenWatch: index_1.NAME.MYSELF, + }); + } + _unwatchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _handleCallStatusToCalling() { + if (this._isPageRedirected) + return; + // @ts-ignore + wx.navigateTo({ + url: `/${this._globalCallPagePath}`, + success: () => { + this._isPageRedirected = true; + }, + fail: () => { + console.error(`${PREFIX} navigateTo fail!`); + }, + complete: () => { }, + }); + } + _handleCallStatusToIdle() { + if (!this._isPageRedirected) + return; + // @ts-ignore + wx.navigateBack({ + success: () => { + this._isPageRedirected = false; + }, + fail: () => { + console.error(`${PREFIX} navigateBack fail!`); + }, + complete: () => { }, + }); + } + // 卸载 callManger + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._unwatchTUIStore(); + yield index_1.TUICallKitServer.destroyed(); + }); + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], CallManager.prototype, "init", null); +exports.CallManager = CallManager; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.d.ts new file mode 100644 index 0000000..d9bfeaf --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.d.ts @@ -0,0 +1,53 @@ +export declare const isUndefined: (input: any) => boolean; +export declare const isPlainObject: (input: any) => boolean; +export declare const isArray: (input: any) => boolean; +export declare const isPrivateKey: (key: string) => boolean; +export declare const isUrl: (url: string) => boolean; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +export declare const isString: (input: any) => boolean; +export declare const isBoolean: (input: any) => boolean; +export declare const isNumber: (input: any) => boolean; +export declare function formatTime(secondTime: number): string; +export declare function formatTimeInverse(stringTime: string): number; +export declare function isJSON(str: string): boolean; +export declare const JSONToObject: (str: string) => any; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +export declare const retryPromise: (promise: Promise, num?: number, time?: number) => Promise; +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleRepeatedCallError(error: any): boolean; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleNoDevicePermissionError(error: any): boolean; +export declare function performanceNow(): number; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +export declare const isFunction: (input: any) => boolean; +export declare const getLanguage: () => string; +export declare function noop(e: any): void; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +export declare const getType: (input: any) => any; +export declare function modifyObjectKey(obj: any, oldKey: any, newKey: any): any; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.js new file mode 100644 index 0000000..53237d0 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/common-utils.js @@ -0,0 +1,249 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modifyObjectKey = exports.getType = exports.noop = exports.getLanguage = exports.isFunction = exports.performanceNow = exports.handleNoDevicePermissionError = exports.handleRepeatedCallError = exports.retryPromise = exports.JSONToObject = exports.isJSON = exports.formatTimeInverse = exports.formatTime = exports.isNumber = exports.isBoolean = exports.isString = exports.isUrl = exports.isPrivateKey = exports.isArray = exports.isPlainObject = exports.isUndefined = void 0; +const index_1 = require("../const/index"); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const isUndefined = function (input) { + return typeof input === index_1.NAME.UNDEFINED; +}; +exports.isUndefined = isUndefined; +const isPlainObject = function (input) { + // 注意不能使用以下方式判断,因为IE9/IE10下,对象的__proto__是 undefined + // return isObject(input) && input.__proto__ === Object.prototype; + if (typeof input !== index_1.NAME.OBJECT || input === null) { + return false; + } + const proto = Object.getPrototypeOf(input); + if (proto === null) { // edge case Object.create(null) + return true; + } + let baseProto = proto; + while (Object.getPrototypeOf(baseProto) !== null) { + baseProto = Object.getPrototypeOf(baseProto); + } + // 原型链第一个和最后一个比较 + return proto === baseProto; +}; +exports.isPlainObject = isPlainObject; +const isArray = function (input) { + if (typeof Array.isArray === index_1.NAME.FUNCTION) { + return Array.isArray(input); + } + return Object.prototype.toString.call(input).match(/^\[object (.*)\]$/)[1].toLowerCase() === index_1.NAME.ARRAY; +}; +exports.isArray = isArray; +const isPrivateKey = function (key) { + return key.startsWith('_'); +}; +exports.isPrivateKey = isPrivateKey; +const isUrl = function (url) { + return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(url); +}; +exports.isUrl = isUrl; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +const isString = function (input) { + return typeof input === index_1.NAME.STRING; +}; +exports.isString = isString; +const isBoolean = function (input) { + return typeof input === index_1.NAME.BOOLEAN; +}; +exports.isBoolean = isBoolean; +const isNumber = function (input) { + return ( + // eslint-disable-next-line + input !== null && + ((typeof input === index_1.NAME.NUMBER && !isNaN(input - 0)) || (typeof input === index_1.NAME.OBJECT && input.constructor === Number))); +}; +exports.isNumber = isNumber; +function formatTime(secondTime) { + const hours = Math.floor(secondTime / 3600); + const minutes = Math.floor((secondTime % 3600) / 60); + const seconds = Math.floor(secondTime % 60); + let callDurationStr = hours > 9 ? `${hours}` : `0${hours}`; + callDurationStr += minutes > 9 ? `:${minutes}` : `:0${minutes}`; + callDurationStr += seconds > 9 ? `:${seconds}` : `:0${seconds}`; + return callDurationStr; +} +exports.formatTime = formatTime; +function formatTimeInverse(stringTime) { + const list = stringTime.split(':'); + return parseInt(list[0]) * 3600 + parseInt(list[1]) * 60 + parseInt(list[2]); // eslint-disable-line +} +exports.formatTimeInverse = formatTimeInverse; +// Determine if it is a JSON string +function isJSON(str) { + if (typeof str === index_1.NAME.STRING) { + try { + const data = JSON.parse(str); + if (data) { + return true; + } + return false; + } + catch (error) { + console.debug(error); + return false; + } + } + return false; +} +exports.isJSON = isJSON; +// Determine if it is a JSON string +const JSONToObject = function (str) { + if (!str || !isJSON(str)) { + return str; + } + return JSON.parse(str); +}; +exports.JSONToObject = JSONToObject; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +const retryPromise = (promise, num = 6, time = 0.5) => { + let n = num; + const func = () => promise; + return func() + .catch((error) => { + if (n === 0) { + throw error; + } + const timer = setTimeout(() => { + func(); + clearTimeout(timer); + n = n - 1; + }, time * 1000); + }); +}; +exports.retryPromise = retryPromise; +// /** +// * 节流函数(目前 TUICallKit 增加防重调用装饰器,该方法可删除) +// * @param {Function} func 传入的函数 +// * @param {wait} time 间隔时间(ms) +// */ +// export const throttle = (func: Function, wait: number) => { +// let previousTime = 0; +// return function () { +// const now = Date.now(); +// const args = [...arguments]; +// if (now - previousTime > wait) { +// func.apply(this, args); +// previousTime = now; +// } +// }; +// } +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleRepeatedCallError(error) { + if ((error === null || error === void 0 ? void 0 : error.message.indexOf('is ongoing, please avoid repeated calls')) !== -1) { + return true; + } + return false; +} +exports.handleRepeatedCallError = handleRepeatedCallError; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleNoDevicePermissionError(error) { + const { message } = error; + if (message.indexOf('NotAllowedError: Permission denied') !== -1) { + return true; + } + return false; +} +exports.handleNoDevicePermissionError = handleNoDevicePermissionError; +/* + * 获取向下取整的 performance.now() 值 + * @export + * @return {Number} + */ +function performanceNow() { + // 在不支持 performance.now 的浏览器中,使用 Date.now() + // 例如 ie 9,ie 10,避免加载 sdk 时报错 + if (!performance || !performance.now) { + return Date.now(); + } + return Math.floor(performance.now()); +} +exports.performanceNow = performanceNow; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +const isFunction = function (input) { + return typeof input === index_1.NAME.FUNCTION; +}; +exports.isFunction = isFunction; +/* + * 获取浏览器语言 + * @export + * @return {zh-cn | en} + */ +const getLanguage = () => { + if (tuiGlobal_1.default.getInstance().isWeChat) { + return 'zh-cn'; + } + // @ts-ignore + const lang = ((navigator === null || navigator === void 0 ? void 0 : navigator.language) || (navigator === null || navigator === void 0 ? void 0 : navigator.userLanguage) || '').substr(0, 2); + let language = 'en'; + switch (lang) { + case 'zh': + language = 'zh-cn'; + break; + case 'ja': + language = 'ja_JP'; + break; + default: + language = 'en'; + } + return language; +}; +exports.getLanguage = getLanguage; +function noop(e) { } +exports.noop = noop; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +const getType = function (input) { + return Object.prototype.toString + .call(input) + .match(/^\[object (.*)\]$/)[1] + .toLowerCase(); +}; +exports.getType = getType; +// 修改对象键名 +function modifyObjectKey(obj, oldKey, newKey) { + if (!obj.hasOwnProperty(oldKey)) { + return obj; + } + const newObj = {}; + Object.keys(obj).forEach(key => { + if (key === oldKey) { + newObj[newKey] = obj[key]; + } + else { + newObj[key] = obj[key]; + } + }); + return newObj; +} +exports.modifyObjectKey = modifyObjectKey; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.d.ts new file mode 100644 index 0000000..59cdbb7 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.d.ts @@ -0,0 +1,10 @@ +export declare const IN_WX_MINI_APP: boolean; +export declare const IN_UNI_NATIVE_APP: boolean; +export declare const IN_MINI_APP: boolean; +export declare const IN_UNI_APP: boolean; +export declare const IN_BROWSER: boolean; +export declare const APP_NAMESPACE: any; +export declare const IS_H5: boolean; +export declare const IS_PC: boolean; +export declare const IS_WIN: any; +export declare const IS_MAC: any; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.js new file mode 100644 index 0000000..90200e0 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/env.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_MAC = exports.IS_WIN = exports.IS_PC = exports.IS_H5 = exports.APP_NAMESPACE = exports.IN_BROWSER = exports.IN_UNI_APP = exports.IN_MINI_APP = exports.IN_UNI_NATIVE_APP = exports.IN_WX_MINI_APP = void 0; +// 在 uniApp 框架下,打包 H5、ios app、android app 时存在 wx/qq/tt/swan/my 等变量会导致引入 web sdk 环境判断失效 +// 小程序 getSystemInfoSync 返回的 fontSizeSetting 在 H5 和 app 中为 undefined,所以通过 fontSizeSetting 增强小程序环境判断 +// wx 小程序 +exports.IN_WX_MINI_APP = (typeof wx !== 'undefined' && typeof wx.getSystemInfoSync === 'function' && Boolean(wx.getSystemInfoSync().fontSizeSetting)); +// 用 uni-app 打包 native app,此时运行于 js core,无 window 等对象,此时调用 api 都得 uni.xxx,由于风格跟小程序类似,就归为 IN_MINI_APP 的一种 +exports.IN_UNI_NATIVE_APP = (typeof uni !== 'undefined' && typeof uni === 'undefined'); +exports.IN_MINI_APP = exports.IN_WX_MINI_APP || exports.IN_UNI_NATIVE_APP; +exports.IN_UNI_APP = (typeof uni !== 'undefined'); +// 在 uniApp 框架下,由于客户打包 ios app、android app 时 window 不一定存在,所以通过 !IN_MINI_APP 进行判断 +// 非 uniApp 框架下,仍然通过 window 结合 IN_MINI_APP 进行判断,可兼容 Taro3.0+ 暴露 window 对象引起的 IN_BROWSER 判断失效问题 +exports.IN_BROWSER = (function () { + if (typeof uni !== 'undefined') { + return !exports.IN_MINI_APP; + } + return (typeof window !== 'undefined') && !exports.IN_MINI_APP; +}()); +// 命名空间 +exports.APP_NAMESPACE = (function () { + if (exports.IN_WX_MINI_APP) { + return wx; + } + if (exports.IN_UNI_APP) { + return uni; + } + return window; +}()); +// eslint-disable-next-line no-mixed-operators +const USER_AGENT = exports.IN_BROWSER && window && window.navigator && window.navigator.userAgent || ''; +const IS_ANDROID = /Android/i.test(USER_AGENT); +const IS_WIN_PHONE = /(?:Windows Phone)/.test(USER_AGENT); +const IS_SYMBIAN = /(?:SymbianOS)/.test(USER_AGENT); +const IS_IOS = /iPad/i.test(USER_AGENT) || /iPhone/i.test(USER_AGENT) || /iPod/i.test(USER_AGENT); +exports.IS_H5 = IS_ANDROID || IS_WIN_PHONE || IS_SYMBIAN || IS_IOS; +exports.IS_PC = exports.IN_BROWSER && !exports.IS_H5; +exports.IS_WIN = exports.IS_PC && USER_AGENT.includes('Windows NT'); +exports.IS_MAC = exports.IS_PC && USER_AGENT.includes('Mac'); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.d.ts new file mode 100644 index 0000000..e54866b --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.d.ts @@ -0,0 +1 @@ +export declare function checkLocalMP3FileExists(src: string): Promise; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.js new file mode 100644 index 0000000..2b54e87 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/index.js @@ -0,0 +1,33 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkLocalMP3FileExists = void 0; +function checkLocalMP3FileExists(src) { + return __awaiter(this, void 0, void 0, function* () { + if (!src) + return false; + try { + const response = yield new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.open('HEAD', src, true); + xhr.onload = () => resolve(xhr); + xhr.onerror = () => reject(xhr); + xhr.send(); + }); + return response.status === 200 && response.getResponseHeader('Content-Type') === 'audio/mpeg'; + } + catch (error) { + console.warn(error); + return false; + } + }); +} +exports.checkLocalMP3FileExists = checkLocalMP3FileExists; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.d.ts new file mode 100644 index 0000000..0ddd31f --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.d.ts @@ -0,0 +1,2 @@ +declare const isEmpty: (input: any) => boolean; +export default isEmpty; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.js new file mode 100644 index 0000000..aee8359 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/is-empty.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common_utils_1 = require("./common-utils"); +const isEmpty = function (input) { + // Null and Undefined... + if (input === null || typeof (input) === 'undefined') + return true; + // Booleans... + if (typeof input === 'boolean') + return false; + // Numbers... + if (typeof input === 'number') + return input === 0; + // Strings... + if (typeof input === 'string') + return input.length === 0; + // Functions... + if (typeof input === 'function') + return input.length === 0; + // Arrays... + if (Array.isArray(input)) + return input.length === 0; + // Errors... + if (input instanceof Error) + return input.message === ''; + // plain object + if ((0, common_utils_1.isPlainObject)(input)) { + // eslint-disable-next-line + for (const key in input) { + if (Object.prototype.hasOwnProperty.call(input, key)) { + return false; + } + } + return true; + } + return false; +}; +exports.default = isEmpty; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.d.ts new file mode 100644 index 0000000..d88f832 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.d.ts @@ -0,0 +1,64 @@ +/// +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +declare class Timer { + static taskMap: Map; + static currentTaskID: number; + static generateTaskID(): number; + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName: any, callback: any, options: any): any; + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem: any): NodeJS.Timer; + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem: any): NodeJS.Timeout; + static hasTask(taskID: any): boolean; + static clearTask(taskID: any): boolean; + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem: any): boolean; +} +export default Timer; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.js new file mode 100644 index 0000000..55682e3 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/timer.js @@ -0,0 +1,154 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/* eslint-disable */ +const common_utils_1 = require("./common-utils"); +const index_1 = require("../const/index"); +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +class Timer { + static generateTaskID() { + return this.currentTaskID++; + } + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName = index_1.NAME.TIMEOUT, callback, options) { + // default options + if (taskName === index_1.NAME.INTERVAL) { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + else { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + // call run(function, {...}) + if ((0, common_utils_1.isPlainObject)(callback)) { + options = Object.assign(Object.assign({}, options), callback); + } + if ((0, common_utils_1.isFunction)(taskName)) { + callback = taskName; + taskName = index_1.NAME.TIMEOUT; + } + // 1. 创建 taskID,作为 timer task 的唯一标识,在本函数执行完后返回,用于在调用的地方实现互斥逻辑 + // 2. 根据 taskName 执行相应的函数 + const taskItem = Object.assign({ taskID: this.generateTaskID(), loopCount: 0, intervalID: null, timeoutID: null, taskName, + callback }, options); + this.taskMap.set(taskItem.taskID, taskItem); + // console.log(`timer run task:${taskItem.taskName}, task queue size: ${this.taskMap.size}`); + if (taskName === index_1.NAME.INTERNAL) { + this.interval(taskItem); + } + else { + this.timeout(taskItem); + } + return taskItem.taskID; + } + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem) { + // setInterval 缺点,浏览器退后台会降频,循环执行间隔时间不可靠 + // 创建进入定时器循环的任务函数,函数内:1. 判断是否满足执行条件,2.执行 callback + // 通过 setInterval 执行任务函数 + // 将 intervalID 记录到 taskMap 对应的 item + const task = () => { + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + }; + return taskItem.intervalID = setInterval(task, taskItem.delay); + } + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem) { + // setTimeout 浏览器退后台,延迟变为至少1s + const task = () => { + // 执行回调 + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + // 不修正延迟,每次callback间隔平均 + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + }; + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + } + static hasTask(taskID) { + return this.taskMap.has(taskID); + } + static clearTask(taskID) { + // console.log('timer clearTask start', `| taskID:${taskID} | size:${this.taskMap.size}`); + if (!this.taskMap.has(taskID)) { + return true; + } + const { intervalID, timeoutID, onVisibilitychange } = this.taskMap.get(taskID); + if (intervalID) { + clearInterval(intervalID); + } + if (timeoutID) { + clearTimeout(timeoutID); + } + if (onVisibilitychange) { + document.removeEventListener('visibilitychange', onVisibilitychange); + } + this.taskMap.delete(taskID); + // console.log('timer clearTask end ', `| size:${this.taskMap.size}`); + return true; + } + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem) { + if (!this.taskMap.has(taskItem.taskID)) { + return true; + } + if (taskItem.count !== 0 && taskItem.loopCount >= taskItem.count) { + this.clearTask(taskItem.taskID); + return true; + } + return false; + } +} +Timer.taskMap = new Map(); +Timer.currentTaskID = 1; +exports.default = Timer; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.d.ts new file mode 100644 index 0000000..85fdf03 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.d.ts @@ -0,0 +1,10 @@ +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +export declare function avoidRepeatedCall(): (target: any, name: string, descriptor: any) => any; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.js new file mode 100644 index 0000000..c7675b9 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/avoidRepeatedCall.js @@ -0,0 +1,49 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = void 0; +const index_1 = require("../../const/index"); +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +function avoidRepeatedCall() { + return function (target, name, descriptor) { + const oldFn = descriptor.value; + const isCallingSet = new Set(); + descriptor.value = function (...args) { + return __awaiter(this, void 0, void 0, function* () { + if (isCallingSet.has(this)) { + console.warn((`${index_1.NAME.PREFIX}previous ${name}() is ongoing, please avoid repeated calls`)); + // throw new Error(`previous ${name}() is ongoing, please avoid repeated calls`); + return; + } + try { + isCallingSet.add(this); + const result = yield oldFn.apply(this, args); + isCallingSet.delete(this); + return result; + } + catch (error) { + isCallingSet.delete(this); + throw error; + } + }); + }; + return descriptor; + }; +} +exports.avoidRepeatedCall = avoidRepeatedCall; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.d.ts new file mode 100644 index 0000000..665c654 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.d.ts @@ -0,0 +1,4 @@ +import { avoidRepeatedCall } from './avoidRepeatedCall'; +import { paramValidate } from './validateParams'; +import { VALIDATE_PARAMS } from './validateConfig'; +export { VALIDATE_PARAMS, paramValidate, avoidRepeatedCall, }; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.js new file mode 100644 index 0000000..7632874 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = exports.paramValidate = exports.VALIDATE_PARAMS = void 0; +const avoidRepeatedCall_1 = require("./avoidRepeatedCall"); +Object.defineProperty(exports, "avoidRepeatedCall", { enumerable: true, get: function () { return avoidRepeatedCall_1.avoidRepeatedCall; } }); +const validateParams_1 = require("./validateParams"); +Object.defineProperty(exports, "paramValidate", { enumerable: true, get: function () { return validateParams_1.paramValidate; } }); +const validateConfig_1 = require("./validateConfig"); +Object.defineProperty(exports, "VALIDATE_PARAMS", { enumerable: true, get: function () { return validateConfig_1.VALIDATE_PARAMS; } }); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.d.ts new file mode 100644 index 0000000..190b624 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.d.ts @@ -0,0 +1,173 @@ +import { VideoResolution, VideoDisplayMode } from "../../const/index"; +export declare const VALIDATE_PARAMS: { + init: { + SDKAppID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userSig: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + tim: { + required: boolean; + rules: any[]; + }; + }; + call: { + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + groupCall: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + offlinePushInfo: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + joinInGroupCall: { + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + inviteUser: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + setSelfInfo: { + nickName: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + avatar: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + enableFloatWindow: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableAIVoice: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableMuteMode: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setCallingBell: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setLanguage: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setVideoDisplayMode: { + key: string; + required: boolean; + rules: any[]; + range: VideoDisplayMode[]; + allowEmpty: boolean; + }[]; + setVideoResolution: { + key: string; + required: boolean; + rules: any[]; + range: VideoResolution[]; + allowEmpty: boolean; + }[]; +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.js new file mode 100644 index 0000000..303d99b --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateConfig.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VALIDATE_PARAMS = void 0; +const index_1 = require("../../const/index"); +exports.VALIDATE_PARAMS = { + init: { + SDKAppID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + userSig: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + tim: { + required: false, + rules: [index_1.NAME.OBJECT], + }, + }, + call: { + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false, + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + } + }, + groupCall: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + offlinePushInfo: { + required: false, + rules: [index_1.NAME.OBJECT], + allowEmpty: false, + }, + }, + joinInGroupCall: { + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + }, + inviteUser: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + }, + setSelfInfo: { + nickName: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + avatar: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + } + }, + enableFloatWindow: [ + { + key: "enable", + required: false, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableAIVoice: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableMuteMode: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + setCallingBell: [ + { + key: "filePath", + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: true, + } + ], + setLanguage: [ + { + key: "language", + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + } + ], + setVideoDisplayMode: [ + { + key: "displayMode", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoDisplayMode.CONTAIN, index_1.VideoDisplayMode.COVER, index_1.VideoDisplayMode.FILL], + allowEmpty: false + } + ], + setVideoResolution: [ + { + key: "resolution", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoResolution.RESOLUTION_1080P, index_1.VideoResolution.RESOLUTION_480P, index_1.VideoResolution.RESOLUTION_720P], + allowEmpty: false + } + ] +}; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.d.ts new file mode 100644 index 0000000..4a37885 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.d.ts @@ -0,0 +1 @@ +export declare function paramValidate(config: any): (target: any, propertyName: string, descriptor: PropertyDescriptor) => PropertyDescriptor; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.js b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.js new file mode 100644 index 0000000..5073419 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/TUICallService/utils/validate/validateParams.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paramValidate = void 0; +const common_utils_1 = require("../common-utils"); +const index_1 = require("../../const/index"); +const PREFIX = index_1.NAME.PREFIX + "API"; +function paramValidate(config) { + return function (target, propertyName, descriptor) { + let method = descriptor.value; + descriptor.value = function (...args) { + doValidate.call(this, config, args, propertyName); + return method.apply(this, args); + }; + return descriptor; + }; +} +exports.paramValidate = paramValidate; +function doValidate(config, args, name) { + try { + // 兼容 init 方法中: SDKAppID sdkAppID 两种写法的参数校验判断 + if (!args[0].SDKAppID) { + config = (0, common_utils_1.modifyObjectKey)(config, "SDKAppID", "sdkAppID"); + } + if ((0, common_utils_1.isArray)(config)) { + for (let i = 0; i < config.length; i++) { + check.call(this, Object.assign(Object.assign({}, config[i]), { value: args[i], name })); + } + } + else { + for (const key in config) { + if (config.hasOwnProperty(key)) { + check.call(this, Object.assign(Object.assign({}, config[key]), { value: args[0][key], name, + key })); + } + } + } + } + catch (error) { + console.error(error); + throw error; + } +} +function check({ required, rules, range, value, allowEmpty, name, key }) { + // 用户没传指定参数 + if ((0, common_utils_1.isUndefined)(value)) { + // 检查必填参数, 若配置是必填则报错 + if (required) { + throw new Error(`${PREFIX}<${name}>: ${key} is required.`); + } + else { + return; + } + } + // 判断参数类型是否正确 + const result = rules.some((item) => item === (0, common_utils_1.getType)(value)); + let type = ''; + if (!result) { + for (let i = 0; i < rules.length; i++) { + let str = rules[i]; + str = str.replace(str[0], str[0].toUpperCase()); + type += `${str}/`; + } + type = type.substring(0, type.length - 1); + throw new Error(`${PREFIX}<${name}>: ${key} must be ${type}, current ${key} is ${typeof value}.`); + } + // 不允许传空值, 例如: '', ' ' + if (allowEmpty === false) { + const isEmptyString = (0, common_utils_1.isString)(value) && value.trim() === ''; + if (isEmptyString) { + throw new Error(`${PREFIX}<${name}>: ${key} is blank.`); + } + } + // 判断是否符合限制条件 + if ((0, common_utils_1.isArray)(range)) { + if (range && range.indexOf(value) === -1) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } + // 取值范围, 前闭后闭 + if ((0, common_utils_1.isString)(range) && range.indexOf('~') !== -1) { + const valueList = range.split('~'); + if (value < +valueList[0] || value > +valueList[1] || ((0, common_utils_1.isNumber)(value) && Number.isNaN(value))) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.d.ts new file mode 100644 index 0000000..1d797f4 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.d.ts @@ -0,0 +1,2 @@ +export * from '@vue/composition-api'; +export * from 'vue'; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.js b/node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.js new file mode 100644 index 0000000..38b9bfe --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/adapter-vue.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// #ifndef VUE3 +// @ts-ignore +__exportStar(require("@vue/composition-api"), exports); +// #endif +// #ifdef VUE3 +__exportStar(require("vue"), exports); +// #endif diff --git a/node_modules/@tencentcloud/call-uikit-wechat/debug/GenerateTestUserSig-es.js b/node_modules/@tencentcloud/call-uikit-wechat/debug/GenerateTestUserSig-es.js new file mode 100644 index 0000000..f61fb98 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/debug/GenerateTestUserSig-es.js @@ -0,0 +1,63 @@ +import LibGenerateTestUserSig from './lib-generate-test-usersig-es.min.js'; + +/** + * 腾讯云 SDKAppId,需要替换为您自己账号下的 SDKAppId。 + * + * 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ) 创建应用,即可看到 SDKAppId, + * 它是腾讯云用于区分客户的唯一标识。 + */ +let SDKAPPID = 0; + + +/** + * 签名过期时间,建议不要设置的过短 + *

+ * 时间单位:秒 + * 默认时间:7 x 24 x 60 x 60 = 604800 = 7 天 + */ +const EXPIRETIME = 604800; + + +/** + * 计算签名用的加密密钥,获取步骤如下: + * + * step1. 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ),如果还没有应用就创建一个, + * step2. 单击“应用配置”进入基础配置页面,并进一步找到“帐号体系集成”部分。 + * step3. 点击“查看密钥”按钮,就可以看到计算 UserSig 使用的加密的密钥了,请将其拷贝并复制到如下的变量中 + * + * 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。 + * 文档:https://cloud.tencent.com/document/product/647/17275#Server + */ +let SECRETKEY = ''; + +/* + * Module: GenerateTestUserSig + * + * Function: 用于生成测试用的 UserSig,UserSig 是腾讯云为其云服务设计的一种安全保护签名。 + * 其计算方法是对 SDKAppID、UserID 和 EXPIRETIME 进行加密,加密算法为 HMAC-SHA256。 + * + * Attention: 请不要将如下代码发布到您的线上正式版本的 App 中,原因如下: + * + * 本文件中的代码虽然能够正确计算出 UserSig,但仅适合快速调通 SDK 的基本功能,不适合线上产品, + * 这是因为客户端代码中的 SECRETKEY 很容易被反编译逆向破解,尤其是 Web 端的代码被破解的难度几乎为零。 + * 一旦您的密钥泄露,攻击者就可以计算出正确的 UserSig 来盗用您的腾讯云流量。 + * + * 正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,然后由 App 按需向您的服务器获取实时算出的 UserSig。 + * 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。 + * + * Reference:https://cloud.tencent.com/document/product/647/17275#Server + */ + +export function genTestUserSig({ userID, SDKAppID, SecretKey }) { + if (SDKAppID) SDKAPPID = SDKAppID; + if (SecretKey) SECRETKEY = SecretKey; + const generator = new LibGenerateTestUserSig(SDKAPPID, SECRETKEY, EXPIRETIME); + const userSig = generator.genTestUserSig(userID); + + return { + SDKAppID: SDKAPPID, + userSig, + }; +} + +export default genTestUserSig; \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/debug/lib-generate-test-usersig-es.min.js b/node_modules/@tencentcloud/call-uikit-wechat/debug/lib-generate-test-usersig-es.min.js new file mode 100644 index 0000000..b01b70b --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/debug/lib-generate-test-usersig-es.min.js @@ -0,0 +1,2 @@ +/*eslint-disable*/ +var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=e.length;n>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return a.join("")}function s(e){var r;i||o();for(var n=e.length,s=n%3,h="",l=[],f=0,c=n-s;fc?c:f+16383));return 1===s?(r=e[n-1],h+=t[r>>2],h+=t[r<<4&63],h+="=="):2===s&&(r=(e[n-2]<<8)+e[n-1],h+=t[r>>10],h+=t[r>>4&63],h+=t[r<<2&63],h+="="),l.push(h),l.join("")}function h(e,t,r,n,i){var o,a,s=8*i-n-1,h=(1<>1,f=-7,c=r?i-1:0,u=r?-1:1,d=e[t+c];for(c+=u,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=u,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=u,f-=8);if(0===o)o=1-l;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)}function l(e,t,r,n,i,o){var a,s,h,l=8*o-i-1,f=(1<>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-a))<1&&(a--,h*=2),(t+=a+c>=1?u/h:u*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*h-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*_}var f={}.toString,c=Array.isArray||function(e){return"[object Array]"==f.call(e)};function u(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(u()=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function y(e){return!(null==e||!e._isBuffer)}function m(e,t){if(y(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return q(e).length;t=(""+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),y(t))return 0===t.length?-1:x(e,t,r,n,i);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):x(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,n,i){var o,a=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,h/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-h),o=r;o>=0;o--){for(var c=!0,u=0;ui&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?s(e):s(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(h=(31&l)<<6|63&o)>127&&(f=h);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(h=(15&l)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,n,i){if(!y(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),h=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return B(this,e,t,r);case"latin1":case"binary":return z(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,o){if(!y(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,i){return i||j(e,0,r,4),l(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||j(e,0,r,8),l(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},p.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),h(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),h(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),h(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),h(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return function(e){var t,a,s,h,l,f;i||o();var c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");l="="===e[c-2]?2:"="===e[c-1]?1:0,f=new n(3*c/4-l),s=l>0?c-4:c;var u=0;for(t=0,a=0;t>16&255,f[u++]=h>>8&255,f[u++]=255&h;return 2===l?(h=r[e.charCodeAt(t)]<<2|r[e.charCodeAt(t+1)]>>4,f[u++]=255&h):1===l&&(h=r[e.charCodeAt(t)]<<10|r[e.charCodeAt(t+1)]<<4|r[e.charCodeAt(t+2)]>>2,f[u++]=h>>8&255,f[u++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e){return null!=e&&(!!e._isBuffer||J(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&J(e.slice(0,0))}(e))}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Q(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=Q(function(e,t){var r;e.exports=(r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,h=i/s,l=(h=t?e.ceil(h):e.max((0|h)-this._minBufferSize,0))*o,f=e.min(4*l,i);if(l){for(var c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)}),Q(function(e,t){var r,n,i;e.exports=(i=(n=r=ee).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|h)<<24-o%4*8,o++}return i.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],_=e[t+4],g=e[t+5],v=e[t+6],w=e[t+7],b=e[t+8],y=e[t+9],m=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],x=e[t+14],R=e[t+15],A=o[0],B=o[1],z=o[2],L=o[3];A=l(A,B,z,L,a,7,s[0]),L=l(L,A,B,z,h,12,s[1]),z=l(z,L,A,B,d,17,s[2]),B=l(B,z,L,A,p,22,s[3]),A=l(A,B,z,L,_,7,s[4]),L=l(L,A,B,z,g,12,s[5]),z=l(z,L,A,B,v,17,s[6]),B=l(B,z,L,A,w,22,s[7]),A=l(A,B,z,L,b,7,s[8]),L=l(L,A,B,z,y,12,s[9]),z=l(z,L,A,B,m,17,s[10]),B=l(B,z,L,A,k,22,s[11]),A=l(A,B,z,L,E,7,s[12]),L=l(L,A,B,z,S,12,s[13]),z=l(z,L,A,B,x,17,s[14]),A=f(A,B=l(B,z,L,A,R,22,s[15]),z,L,h,5,s[16]),L=f(L,A,B,z,v,9,s[17]),z=f(z,L,A,B,k,14,s[18]),B=f(B,z,L,A,a,20,s[19]),A=f(A,B,z,L,g,5,s[20]),L=f(L,A,B,z,m,9,s[21]),z=f(z,L,A,B,R,14,s[22]),B=f(B,z,L,A,_,20,s[23]),A=f(A,B,z,L,y,5,s[24]),L=f(L,A,B,z,x,9,s[25]),z=f(z,L,A,B,p,14,s[26]),B=f(B,z,L,A,b,20,s[27]),A=f(A,B,z,L,S,5,s[28]),L=f(L,A,B,z,d,9,s[29]),z=f(z,L,A,B,w,14,s[30]),A=c(A,B=f(B,z,L,A,E,20,s[31]),z,L,g,4,s[32]),L=c(L,A,B,z,b,11,s[33]),z=c(z,L,A,B,k,16,s[34]),B=c(B,z,L,A,x,23,s[35]),A=c(A,B,z,L,h,4,s[36]),L=c(L,A,B,z,_,11,s[37]),z=c(z,L,A,B,w,16,s[38]),B=c(B,z,L,A,m,23,s[39]),A=c(A,B,z,L,S,4,s[40]),L=c(L,A,B,z,a,11,s[41]),z=c(z,L,A,B,p,16,s[42]),B=c(B,z,L,A,v,23,s[43]),A=c(A,B,z,L,y,4,s[44]),L=c(L,A,B,z,E,11,s[45]),z=c(z,L,A,B,R,16,s[46]),A=u(A,B=c(B,z,L,A,d,23,s[47]),z,L,a,6,s[48]),L=u(L,A,B,z,w,10,s[49]),z=u(z,L,A,B,x,15,s[50]),B=u(B,z,L,A,g,21,s[51]),A=u(A,B,z,L,E,6,s[52]),L=u(L,A,B,z,p,10,s[53]),z=u(z,L,A,B,m,15,s[54]),B=u(B,z,L,A,h,21,s[55]),A=u(A,B,z,L,b,6,s[56]),L=u(L,A,B,z,R,10,s[57]),z=u(z,L,A,B,v,15,s[58]),B=u(B,z,L,A,S,21,s[59]),A=u(A,B,z,L,_,6,s[60]),L=u(L,A,B,z,k,10,s[61]),z=u(z,L,A,B,d,15,s[62]),B=u(B,z,L,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+B|0,o[2]=o[2]+z|0,o[3]=o[3]+L|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,h=s.words,l=0;l<4;l++){var f=h[l];h[l]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function c(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(h),t.HmacMD5=o._createHmacHelper(h)}(Math),r.MD5)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).lib,o=i.WordArray,a=i.Hasher,s=n.algo,h=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=0;l<80;l++){if(l<16)h[l]=0|e[t+l];else{var f=h[l-3]^h[l-8]^h[l-14]^h[l-16];h[l]=f<<1|f>>>31}var c=(n<<5|n>>>27)+s+h[l];c+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=a._createHelper(l),n.HmacSHA1=a._createHmacHelper(l),r.SHA1)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],h=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),h[i]=r(e.pow(n,1/3)),i++),n++}();var l=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=0;d<64;d++){if(d<16)l[d]=0|e[t+d];else{var p=l[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[d]=_+l[d-7]+v+l[d-16]}var w=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),y=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&c)+h[d]+l[d];u=c,c=f,f=s,s=a+y|0,a=o,o=i,i=n,n=y+(b+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+c|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),r.SHA256)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(i=(n=r=ee).lib.WordArray,o=n.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=a._createHelper(s),n.HmacSHA224=a._createHmacHelper(s),r.SHA224)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var h=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var f=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=n.high,p=n.low,_=i.high,g=i.low,v=o.high,w=o.low,b=a.high,y=a.low,m=s.high,k=s.low,E=f.high,S=f.low,x=c.high,R=c.low,A=u.high,B=u.low,z=d,L=p,T=_,M=g,C=v,D=w,I=b,P=y,O=m,U=k,H=E,F=S,N=x,Z=R,j=A,W=B,Y=0;Y<80;Y++){var K=l[Y];if(Y<16)var X=K.high=0|e[t+2*Y],q=K.low=0|e[t+2*Y+1];else{var V=l[Y-15],G=V.high,$=V.low,J=(G>>>1|$<<31)^(G>>>8|$<<24)^G>>>7,Q=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),ee=l[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[Y-7],ae=oe.high,se=oe.low,he=l[Y-16],le=he.high,fe=he.low;X=(X=(X=J+ae+((q=Q+se)>>>0>>0?1:0))+ne+((q+=ie)>>>0>>0?1:0))+le+((q+=fe)>>>0>>0?1:0),K.high=X,K.low=q}var ce,ue=O&H^~O&N,de=U&F^~U&Z,pe=z&T^z&C^T&C,_e=L&M^L&D^M&D,ge=(z>>>28|L<<4)^(z<<30|L>>>2)^(z<<25|L>>>7),ve=(L>>>28|z<<4)^(L<<30|z>>>2)^(L<<25|z>>>7),we=(O>>>14|U<<18)^(O>>>18|U<<14)^(O<<23|U>>>9),be=(U>>>14|O<<18)^(U>>>18|O<<14)^(U<<23|O>>>9),ye=h[Y],me=ye.high,ke=ye.low,Ee=j+we+((ce=W+be)>>>0>>0?1:0),Se=ve+_e;j=N,W=Z,N=H,Z=F,H=O,F=U,O=I+(Ee=(Ee=(Ee=Ee+ue+((ce+=de)>>>0>>0?1:0))+me+((ce+=ke)>>>0>>0?1:0))+X+((ce+=q)>>>0>>0?1:0))+((U=P+ce|0)>>>0

>>0?1:0)|0,I=C,P=D,C=T,D=M,T=z,M=L,z=Ee+(ge+pe+(Se>>>0>>0?1:0))+((L=ce+Se|0)>>>0>>0?1:0)|0}p=n.low=p+L,n.high=d+z+(p>>>0>>0?1:0),g=i.low=g+M,i.high=_+T+(g>>>0>>0?1:0),w=o.low=w+D,o.high=v+C+(w>>>0>>0?1:0),y=a.low=y+P,a.high=b+I+(y>>>0

>>0?1:0),k=s.low=k+U,s.high=m+O+(k>>>0>>0?1:0),S=f.low=S+F,f.high=E+H+(S>>>0>>0?1:0),R=c.low=R+Z,c.high=x+N+(R>>>0>>0?1:0),B=u.low=B+W,u.high=A+j+(B>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),r.SHA512)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).x64,o=i.Word,a=i.WordArray,s=n.algo,h=s.SHA512,l=s.SHA384=h.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=h._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=h._createHelper(l),n.HmacSHA384=h._createHmacHelper(l),r.SHA384)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,h=[],l=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){h[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,c=0,u=0;u<7;u++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=r[i]).high^=a,B.low^=o}for(var s=0;s<24;s++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(B=r[u+5*_]).high,p^=B.low;var g=c[u];g.high=d,g.low=p}for(u=0;u<5;u++){var v=c[(u+4)%5],w=c[(u+1)%5],b=w.high,y=w.low;for(d=v.high^(b<<1|y>>>31),p=v.low^(y<<1|b>>>31),_=0;_<5;_++)(B=r[u+5*_]).high^=d,B.low^=p}for(var m=1;m<25;m++){var k=(B=r[m]).high,E=B.low,S=h[m];S<32?(d=k<>>32-S,p=E<>>32-S):(d=E<>>64-S,p=k<>>64-S);var x=c[l[m]];x.high=d,x.low=p}var R=c[0],A=r[0];for(R.high=A.high,R.low=A.low,u=0;u<5;u++)for(_=0;_<5;_++){var B=r[m=u+5*_],z=c[m],L=c[(u+1)%5+5*_],T=c[(u+2)%5+5*_];B.high=z.high^~L.high&T.high,B.low=z.low^~L.low&T.low}B=r[0];var M=f[s];B.high^=M.high,B.low^=M.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,h=s/8,l=[],f=0;f>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(u)}return new i.init(l,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(u),t.HmacSHA3=o._createHmacHelper(u)}(Math),r.SHA3)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,y,m,k,E,S,x,R,A,B=this._hash.words,z=c.words,L=u.words,T=s.words,M=h.words,C=l.words,D=f.words;for(k=o=B[0],E=a=B[1],S=d=B[2],x=y=B[3],R=m=B[4],r=0;r<80;r+=1)A=o+e[t+T[r]]|0,A+=r<16?p(a,d,y)+z[0]:r<32?_(a,d,y)+z[1]:r<48?g(a,d,y)+z[2]:r<64?v(a,d,y)+z[3]:w(a,d,y)+z[4],A=(A=b(A|=0,C[r]))+m|0,o=m,m=y,y=b(d,10),d=a,a=A,A=k+e[t+M[r]]|0,A+=r<16?w(E,S,x)+L[0]:r<32?v(E,S,x)+L[1]:r<48?g(E,S,x)+L[2]:r<64?_(E,S,x)+L[3]:p(E,S,x)+L[4],A=(A=b(A|=0,D[r]))+R|0,k=R,R=x,x=b(S,10),S=E,E=A;A=B[1]+d+x|0,B[1]=B[2]+y+R|0,B[2]=B[3]+m+k|0,B[3]=B[4]+o+E|0,B[4]=B[0]+a+S|0,B[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function _(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function w(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=ee).lib,i=n.Base,o=r.enc,a=o.Utf8,s=r.algo,void(s.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,h=o.words,l=0;l>>2];e.sigBytes-=t}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:g,padding:w}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),b=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=i.format={},m=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=s.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=s.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:n})}},k=o.SerializableCipher=a.extend({cfg:a.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),E=i.kdf={},S=E.OpenSSL={execute:function(e,t,r,n){n||(n=s.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=s.create(i.words.slice(t),4*r);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:n})}},x=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=k.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=k.decrypt.call(this,e,t,i.key,n);return o}})))}),Q(function(e,t){var r;e.exports=((r=ee).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var h=0;h>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)}),Q(function(e,t){var r;e.exports=((r=ee).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},r.pad.ZeroPadding)}),Q(function(e,t){var r;e.exports=((r=ee).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)}),Q(function(e,t){var r,n,i,o;e.exports=(i=(n=r=ee).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},r.format.Hex)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],o=[],a=[],s=[],h=[],l=[],f=[],c=[],u=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var _=e[r],g=e[_],v=e[g],w=257*e[p]^16843008*p;a[r]=w<<24|w>>>8,s[r]=w<<16|w>>>16,h[r]=w<<8|w>>>24,l[r]=w,w=16843009*v^65537*g^257*_^16843008*r,f[p]=w<<24|w>>>8,c[p]=w<<16|w>>>16,u[p]=w<<8|w>>>24,d[p]=w,r?(r=_^e[e[e[v^_]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var h=this._invKeySchedule=[],l=0;l>>24]]^c[i[s>>>16&255]]^u[i[s>>>8&255]]^d[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,h,l,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,c,u,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var h=this._nRounds,l=e[t]^r[0],f=e[t+1]^r[1],c=e[t+2]^r[2],u=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&u]^r[d++],g=n[f>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&l]^r[d++],v=n[c>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++],w=n[u>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&c]^r[d++];l=_,f=g,c=v,u=w}_=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^r[d++],g=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],w=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[d++],e[t]=_,e[t+1]=g,e[t+2]=v,e[t+3]=w},keySize:8});e.AES=t._createHelper(_)}(),r.AES)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],f=h[o];for(r=0;r<24;r++)l[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,l[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(l[0]=l[0]<<1|l[0]>>>31,r=1;r<7;r++)l[r]=l[r]>>>4*(r-1)+3;l[7]=l[7]<<5|l[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,h=0;h<8;h++)s|=l[h][((a^i[h])&f[h])>>>0];this._lBlock=a,this._rBlock=o^s}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var h=n[i];n[i]=n[o],n[o]=h}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(i[0]^=l,i[1]^=c,i[2]^=f,i[3]^=u,i[4]^=l,i[5]^=c,i[6]^=f,i[7]^=u,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)h.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(n[0]^=l,n[1]^=c,n[2]^=f,n[3]^=u,n[4]^=l,n[5]^=c,n[6]^=f,n[7]^=u,i=0;i<4;i++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)}),Q(function(e,t){e.exports=ee}));function re(){throw new Error("setTimeout has not been defined")}function ne(){throw new Error("clearTimeout has not been defined")}var ie=re,oe=ne;function ae(e){if(ie===setTimeout)return setTimeout(e,0);if((ie===re||!ie)&&setTimeout)return ie=setTimeout,setTimeout(e,0);try{return ie(e,0)}catch(t){try{return ie.call(null,e,0)}catch(t){return ie.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ie=setTimeout),"function"==typeof e.clearTimeout&&(oe=clearTimeout);var se,he=[],le=!1,fe=-1;function ce(){le&&se&&(le=!1,se.length?he=se.concat(he):fe=-1,he.length&&ue())}function ue(){if(!le){var e=ae(ce);le=!0;for(var t=he.length;t;){for(se=he,he=[];++fe1)for(var r=1;r0&&a.length>i){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function xe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Re(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Ae(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}ge.prototype=Object.create(null),ve.EventEmitter=ve,ve.usingDomains=!1,ve.prototype.domain=void 0,ve.prototype._events=void 0,ve.prototype._maxListeners=void 0,ve.defaultMaxListeners=10,ve.init=function(){this.domain=null,ve.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ge,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ve.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ve.prototype.getMaxListeners=function(){return we(this)},ve.prototype.emit=function(e){var t,r,n,i,o,a,s,h="error"===e;if(a=this._events)h=h&&null==a.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:be(r,f,this);break;case 2:ye(r,f,this,arguments[1]);break;case 3:me(r,f,this,arguments[1],arguments[2]);break;case 4:ke(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new ge,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var Be="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},ze=/%[sdj%]/g;function Le(e){if(!Ze(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Fe(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ye(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),je(r.showHidden)&&(r.showHidden=!1),je(r.depth)&&(r.depth=2),je(r.colors)&&(r.colors=!1),je(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ie),Oe(r,e,r.depth)}function Ie(e,t){var r=De.styles[t];return r?"["+De.colors[r][0]+"m"+e+"["+De.colors[r][1]+"m":e}function Pe(e,t){return e}function Oe(e,t,r){if(e.customInspect&&t&&qe(t.inspect)&&t.inspect!==De&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Ze(n)||(n=Oe(e,n,r)),n}var i=function(e,t){if(je(t))return e.stylize("undefined","undefined");if(Ze(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Fe(t))return e.stylize(""+t,"boolean");if(Ne(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Xe(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ue(t);if(0===o.length){if(qe(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(We(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ke(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Xe(t))return Ue(t)}var h,l,f="",c=!1,u=["{","}"];(h=t,Array.isArray(h)&&(c=!0,u=["[","]"]),qe(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return We(t)&&(f=" "+RegExp.prototype.toString.call(t)),Ke(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Xe(t)&&(f=" "+Ue(t)),0!==o.length||c&&0!=t.length?r<0?We(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=c?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,f,u)):u[0]+f+u[1]}function Ue(e){return"["+Error.prototype.toString.call(e)+"]"}function He(e,t,r,n,i,o){var a,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),Ge(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=Ne(r)?Oe(e,h.value,null):Oe(e,h.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),je(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Fe(e){return"boolean"==typeof e}function Ne(e){return null===e}function Ze(e){return"string"==typeof e}function je(e){return void 0===e}function We(e){return Ye(e)&&"[object RegExp]"===Ve(e)}function Ye(e){return"object"==typeof e&&null!==e}function Ke(e){return Ye(e)&&"[object Date]"===Ve(e)}function Xe(e){return Ye(e)&&("[object Error]"===Ve(e)||e instanceof Error)}function qe(e){return"function"==typeof e}function Ve(e){return Object.prototype.toString.call(e)}function Ge(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $e(){this.head=null,this.tail=null,this.length=0}De.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},De.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},$e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},$e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},$e.prototype.clear=function(){this.head=this.tail=null,this.length=0},$e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},$e.prototype.concat=function(e){if(0===this.length)return p.alloc(0);if(1===this.length)return this.head.data;for(var t=p.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Je=p.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Qe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Je(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=tt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=rt;break;default:return void(this.write=et)}this.charBuffer=new p(6),this.charReceived=0,this.charLength=0}function et(e){return e.toString(this.encoding)}function tt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function rt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Qe.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},Qe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},Qe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},ot.ReadableState=it;var nt=function(e){je(Me)&&(Me=""),e=e.toUpperCase(),Ce[e]||(new RegExp("\\b"+e+"\\b","i").test(Me)?Ce[e]=function(){var t=Le.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Ce[e]=function(){});return Ce[e]}("stream");function it(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ct&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new $e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Qe(e.encoding),this.encoding=e.encoding)}function ot(e){if(!(this instanceof ot))return new ot(e);this._readableState=new it(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ve.call(this)}function at(e,t,r,n,i){var o=function(e,t){var r=null;$(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,lt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&<(e))),function(e,t){t.readingMore||(t.readingMore=!0,de(ct,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?de(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function ct(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=p.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,de(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):lt(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?_t(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},ot.prototype._read=function(e){this.emit("error",new Error("not implemented"))},ot.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){nt("onunpipe"),e===r&&l()}function a(){nt("onend"),e.end()}n.endEmitted?de(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function l(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",u),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",c),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function c(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==wt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function u(t){var r;nt("onerror",t),_(),e.removeListener("error",u),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),_()}function p(){nt("onfinish"),e.removeListener("close",d),_()}function _(){nt("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",u),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},ot.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},kt.prototype._write=function(e,t,r){r(new Error("not implemented"))},kt.prototype._writev=null,kt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Bt(e,t),r&&(t.finished?de(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Be(Ct,ot);for(var Lt=Object.keys(kt.prototype),Tt=0;Tt=0;)e[t]=0}var Jt=0,Qt=1,er=2,tr=29,rr=256,nr=rr+1+tr,ir=30,or=19,ar=2*nr+1,sr=15,hr=16,lr=7,fr=256,cr=16,ur=17,dr=18,pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],vr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wr=new Array(2*(nr+2));$t(wr);var br=new Array(2*ir);$t(br);var yr=new Array(512);$t(yr);var mr=new Array(256);$t(mr);var kr=new Array(tr);$t(kr);var Er,Sr,xr,Rr=new Array(ir);function Ar(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Br(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function zr(e){return e<256?yr[e]:yr[256+(e>>>7)]}function Lr(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Tr(e,t,r){e.bi_valid>hr-r?(e.bi_buf|=t<>hr-e.bi_valid,e.bi_valid+=r-hr):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function Dr(e,t,r){var n,i,o=new Array(sr+1),a=0;for(n=1;n<=sr;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=Cr(o[s]++,s))}}function Ir(e){var t;for(t=0;t8?Lr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Or(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)Ur(e,o,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ur(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Ur(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,h=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,c=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=sr;o++)e.bl_count[o]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(o=p,_++),h[2*n+1]=o,n>l||(e.bl_count[o]++,a=0,n>=d&&(a=u[n-d]),s=h[2*n],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>l||(h[2*i+1]!==o&&(e.opt_len+=(o-h[2*i+1])*h[2*i],h[2*i+1]=o),n--)}}(e,t),Dr(o,l,e.bl_count)}function Nr(e,t,r){var n,i,o=-1,a=t[1],s=0,h=7,l=4;for(0===a&&(h=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function Xr(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Gt&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return qt;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Vt;for(t=32;t=3&&0===e.bl_tree[2*vr[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Yr(e,t,r,n):e.strategy===Xt||o===i?(Tr(e,(Qt<<1)+(n?1:0),3),Hr(e,wr,br)):(Tr(e,(er<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Tr(e,t-257,5),Tr(e,r-1,5),Tr(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(mr[r]+rr+1)]++,e.dyn_dtree[2*zr(t)]++),e.last_lit===e.lit_bufsize-1}function Vr(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Gr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function $r(e,t,r,n){var i=Gr,o=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}var Jr,Qr=0,en=1,tn=3,rn=4,nn=5,on=0,an=1,sn=-2,hn=-3,ln=-5,fn=-1,cn=1,un=2,dn=3,pn=4,_n=2,gn=8,vn=9,wn=286,bn=30,yn=19,mn=2*wn+1,kn=15,En=3,Sn=258,xn=Sn+En+1,Rn=32,An=42,Bn=69,zn=73,Ln=91,Tn=103,Mn=113,Cn=666,Dn=1,In=2,Pn=3,On=4,Un=3;function Hn(e,t){return e.msg=Nt[t],t}function Fn(e){return(e<<1)-(e>4?9:0)}function Nn(e){for(var t=e.length;--t>=0;)e[t]=0}function Zn(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(jt(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function jn(e,t){Xr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zn(e.strm)}function Wn(e,t){e.pending_buf[e.pending++]=t}function Yn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Kn(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-xn?e.strstart-(e.w_size-xn):0,l=e.window,f=e.w_mask,c=e.prev,u=e.strstart+Sn,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}}while((t=c[t&f])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Xn(e){var t,r,n,i,o,a,s,h,l,f,c=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-xn)){jt(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=c?n-c:0}while(--r);t=r=c;do{n=e.prev[--t],e.prev[t]=n>=c?n-c:0}while(--r);i+=c}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,h=e.strstart+e.lookahead,l=i,f=void 0,(f=a.avail_in)>l&&(f=l),r=0===f?0:(a.avail_in-=f,jt(s,a.input,a.next_in,f,h),1===a.state.wrap?a.adler=Vr(a.adler,s,f,h):2===a.state.wrap&&(a.adler=$r(a.adler,s,f,h)),a.next_in+=f,a.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=En)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<=En)if(n=qr(e,e.strstart-e.match_start,e.match_length-En),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=En){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=En-1)),e.prev_length>=En&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-En,n=qr(e,e.strstart-1-e.prev_match,e.prev_length-En),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<nn||t<0)return e?Hn(e,sn):sn;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Cn&&t!==rn)return Hn(e,0===e.avail_out?ln:sn);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===An)if(2===n.wrap)e.adler=0,Wn(n,31),Wn(n,139),Wn(n,8),n.gzhead?(Wn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Wn(n,255&n.gzhead.time),Wn(n,n.gzhead.time>>8&255),Wn(n,n.gzhead.time>>16&255),Wn(n,n.gzhead.time>>24&255),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Wn(n,255&n.gzhead.extra.length),Wn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=$r(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Bn):(Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,Un),n.status=Mn);else{var a=gn+(n.w_bits-8<<4)<<8;a|=(n.strategy>=un||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=Rn),a+=31-a%31,n.status=Mn,Yn(n,a),0!==n.strstart&&(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),e.adler=1}if(n.status===Bn)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending!==n.pending_buf_size));)Wn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zn)}else n.status=zn;if(n.status===zn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=Ln)}else n.status=Ln;if(n.status===Ln)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=Tn)}else n.status=Tn;if(n.status===Tn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Zn(e),n.pending+2<=n.pending_buf_size&&(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),e.adler=0,n.status=Mn)):n.status=Mn),0!==n.pending){if(Zn(e),0===e.avail_out)return n.last_flush=-1,on}else if(0===e.avail_in&&Fn(t)<=Fn(r)&&t!==rn)return Hn(e,ln);if(n.status===Cn&&0!==e.avail_in)return Hn(e,ln);if(0!==e.avail_in||0!==n.lookahead||t!==Qr&&n.status!==Cn){var s=n.strategy===un?function(e,t){for(var r;;){if(0===e.lookahead&&(Xn(e),0===e.lookahead)){if(t===Qr)return Dn;break}if(e.match_length=0,r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):n.strategy===dn?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Sn){if(Xn(e),e.lookahead<=Sn&&t===Qr)return Dn;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=En&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+Sn;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=En?(r=qr(e,1,e.match_length-En),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):Jr[n.level].func(n,t);if(s!==Pn&&s!==On||(n.status=Cn),s===Dn||s===Pn)return 0===e.avail_out&&(n.last_flush=-1),on;if(s===In&&(t===en?Kr(n):t!==nn&&(Yr(n,0,0,!1),t===tn&&(Nn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Zn(e),0===e.avail_out))return n.last_flush=-1,on}return t!==rn?on:n.wrap<=0?an:(2===n.wrap?(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),Wn(n,e.adler>>16&255),Wn(n,e.adler>>24&255),Wn(n,255&e.total_in),Wn(n,e.total_in>>8&255),Wn(n,e.total_in>>16&255),Wn(n,e.total_in>>24&255)):(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),Zn(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?on:an)}Jr=[new Gn(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xn(e),0===e.lookahead&&t===Qr)return Dn;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,jn(e,!1),0===e.strm.avail_out))return Dn;if(e.strstart-e.block_start>=e.w_size-xn&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):(e.strstart>e.block_start&&(jn(e,!1),e.strm.avail_out),Dn)}),new Gn(4,4,8,4,qn),new Gn(4,5,16,8,qn),new Gn(4,6,32,32,qn),new Gn(4,4,16,16,Vn),new Gn(8,16,32,32,Vn),new Gn(8,16,128,128,Vn),new Gn(8,32,128,256,Vn),new Gn(32,128,258,1024,Vn),new Gn(32,258,258,4096,Vn)];var ei=30,ti=12;function ri(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R;r=e.state,n=e.next_in,x=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),h=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,u=r.window,d=r.hold,p=r.bits,_=r.lencode,g=r.distcode,v=(1<>>=y=b>>>24,p-=y,0===(y=b>>>16&255))R[o++]=65535&b;else{if(!(16&y)){if(0==(64&y)){b=_[(65535&b)+(d&(1<>>=y,p-=y),p<15&&(d+=x[n++]<>>=y=b>>>24,p-=y,!(16&(y=b>>>16&255))){if(0==(64&y)){b=g[(65535&b)+(d&(1<h){e.msg="invalid distance too far back",r.mode=ei;break e}if(d>>>=y,p-=y,k>(y=o-a)){if((y=k-y)>f&&r.sane){e.msg="invalid distance too far back",r.mode=ei;break e}if(E=0,S=u,0===c){if(E+=l-y,y2;)R[o++]=S[E++],R[o++]=S[E++],R[o++]=S[E++],m-=3;m&&(R[o++]=S[E++],m>1&&(R[o++]=S[E++]))}else{E=o-k;do{R[o++]=R[E++],R[o++]=R[E++],R[o++]=R[E++],m-=3}while(m>2);m&&(R[o++]=R[E++],m>1&&(R[o++]=R[E++]))}break}}break}}while(n>3,d&=(1<<(p-=m<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[m];m--);if(k>m&&(k=m),0===m)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y0&&(e===ai||1!==m))return-1;for(T[1]=0,w=1;wii||e===hi&&R>oi)return 1;for(;;){p=w-S,a[b]d?(_=M[C+a[b]],g=B[z+a[b]]):(_=96,g=0),h=1<>S)+(l-=h)]=p<<24|_<<16|g|0}while(0!==l);for(h=1<>=1;if(0!==h?(A&=h-1,A+=h):A=0,b++,0==--L[w]){if(w===m)break;w=t[r+a[b]]}if(w>k&&(A&c)!==f){for(0===S&&(S=k),u+=y,x=1<<(E=w-S);E+Sii||e===hi&&R>oi)return 1;i[f=A&c]=k<<24|E<<16|u-o|0}}return 0!==A&&(i[u+A]=w-S<<24|64<<16|0),s.bits=k,0}var pi=0,_i=1,gi=2,vi=4,wi=5,bi=6,yi=0,mi=1,ki=2,Ei=-2,Si=-3,xi=-4,Ri=-5,Ai=8,Bi=1,zi=2,Li=3,Ti=4,Mi=5,Ci=6,Di=7,Ii=8,Pi=9,Oi=10,Ui=11,Hi=12,Fi=13,Ni=14,Zi=15,ji=16,Wi=17,Yi=18,Ki=19,Xi=20,qi=21,Vi=22,Gi=23,$i=24,Ji=25,Qi=26,eo=27,to=28,ro=29,no=30,io=31,oo=32,ao=852,so=592;function ho(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Yt(320),this.work=new Yt(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fo(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Bi,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Kt(ao),t.distcode=t.distdyn=new Kt(so),t.sane=1,t.back=-1,yi):Ei}(e)):Ei}function co(e,t){var r,n;return e?(n=new lo,e.state=n,n.window=null,(r=function(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ei:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,fo(e))):Ei}(e,t))!==yi&&(e.state=null),r):Ei}var uo,po,_o=!0;function go(e){if(_o){var t;for(uo=new Kt(512),po=new Kt(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(di(_i,e.lens,0,288,uo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;di(gi,e.lens,0,32,po,0,e.work,{bits:5}),_o=!1}e.lencode=uo,e.lenbits=9,e.distcode=po,e.distbits=5}function vo(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R=0,A=new Wt(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ei;(r=e.state).mode===Hi&&(r.mode=Fi),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,c=s,u=h,E=yi;e:for(;;)switch(r.mode){case Bi:if(0===r.wrap){r.mode=Fi;break}for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0),l=0,f=0,r.mode=zi;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=no;break}if((15&l)!==Ai){e.msg="unknown compression method",r.mode=no;break}if(f-=4,k=8+(15&(l>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=no;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Li;case Li:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=$r(r.check,A,4,0)),l=0,f=0,r.mode=Ti;case Ti:for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>8),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Mi;case Mi:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0}else r.head&&(r.head.extra=null);r.mode=Ci;case Ci:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),jt(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=$r(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Di;case Di:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Hi;break;case Oi:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>=7&f,f-=7&f,r.mode=eo;break}for(;f<3;){if(0===s)break e;s--,l+=n[o++]<>>=1)){case 0:r.mode=Ni;break;case 1:if(go(r),r.mode=Xi,t===bi){l>>>=2,f-=2;break e}break;case 2:r.mode=Wi;break;case 3:e.msg="invalid block type",r.mode=no}l>>>=2,f-=2;break;case Ni:for(l>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,l+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=no;break}if(r.length=65535&l,l=0,f=0,r.mode=Zi,t===bi)break e;case Zi:r.mode=ji;case ji:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;jt(i,n,o,d,a),s-=d,o+=d,h-=d,a+=d,r.length-=d;break}r.mode=Hi;break;case Wi:for(;f<14;){if(0===s)break e;s--,l+=n[o++]<>>=5,f-=5,r.ndist=1+(31&l),l>>>=5,f-=5,r.ncode=4+(15&l),l>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=no;break}r.have=0,r.mode=Yi;case Yi:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},E=di(pi,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid code lengths set",r.mode=no;break}r.have=0,r.mode=Ki;case Ki:for(;r.have>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(x=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=no;break}k=r.lens[r.have-1],d=3+(3&l),l>>>=2,f-=2}else if(17===w){for(x=g+3;f>>=g)),l>>>=3,f-=3}else{for(x=g+7;f>>=g)),l>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=no;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===no)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=no;break}if(r.lenbits=9,S={bits:r.lenbits},E=di(_i,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid literal/lengths set",r.mode=no;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},E=di(gi,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,E){e.msg="invalid distances set",r.mode=no;break}if(r.mode=Xi,t===bi)break e;case Xi:r.mode=qi;case qi:if(s>=6&&h>=258){e.next_out=a,e.avail_out=h,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=f,ri(e,u),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,r.mode===Hi&&(r.back=-1);break}for(r.back=0;v=(R=r.lencode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,r.length=w,0===v){r.mode=Qi;break}if(32&v){r.back=-1,r.mode=Hi;break}if(64&v){e.msg="invalid literal/length code",r.mode=no;break}r.extra=15&v,r.mode=Vi;case Vi:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Gi;case Gi:for(;v=(R=r.distcode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=no;break}r.offset=w,r.extra=15&v,r.mode=$i;case $i:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=no;break}r.mode=Ji;case Ji:if(0===h)break e;if(d=u-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=no;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),_=r.window}else _=i,p=a-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[a++]=_[p++]}while(--d);0===r.length&&(r.mode=qi);break;case Qi:if(0===h)break e;i[a++]=r.length,h--,r.mode=qi;break;case eo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,l|=n[o++]<=o.wsize?(jt(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),jt(o.window,t,r-n,i,o.wnext),(n-=i)?(jt(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveyo)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function ko(e,t){for(var r=0;r15&&(a=2,n-=16),i<1||i>vn||r!==gn||n<8||n>15||t<0||t>9||o<0||o>pn)return Hn(e,sn);8===n&&(n=9);var s=new $n;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<So.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsSo.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelSo.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelSo.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=So.Z_FILTERED&&e.strategy!=So.Z_HUFFMAN_ONLY&&e.strategy!=So.Z_RLE&&e.strategy!=So.Z_FIXED&&e.strategy!=So.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!$(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new So.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=So.codes[t],r.emit("error",n)};var n=So.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=So.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||So.Z_DEFAULT_WINDOWBITS,n,e.memLevel||So.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new p(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(xo).forEach(function(e){xo[xo[e]]=e}),Be(Io,Ot),Io.prototype.params=function(e,t,r){if(eSo.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=So.Z_FILTERED&&t!=So.Z_HUFFMAN_ONLY&&t!=So.Z_RLE&&t!=So.Z_FIXED&&t!=So.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(So.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else de(r)},Io.prototype.reset=function(){return this._binding.reset()},Io.prototype._flush=function(e){this._transform(new p(0),"",e)},Io.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=So.Z_FULL_FLUSH),r.ended)t&&de(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new p(0),"",t)},Io.prototype.close=function(e){if(e&&de(e),!this._closed){this._closed=!0,this._binding.close();var t=this;de(function(){t.emit("close")})}},Io.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!$(e))return r(new Error("invalid input"));o?n=So.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||So.Z_NO_FLUSH)),this._processChunk(e,n,r)},Io.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof r;if(!s){var h,l=[],f=0;this.on("error",function(e){h=e});do{var c=this._binding.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&_(c[0],c[1]));if(this._hadError)throw h;var u=p.concat(l,f);return this.close(),u}var d=this._binding.write(t,e,o,n,this._buffer,this._offset,i);function _(h,c){if(!a._hadError){var u=i-c;if(function(e,t){if(!e)throw new Error(t)}(u>=0,"have should not go down"),u>0){var d=a._buffer.slice(a._offset,a._offset+u);a._offset+=u,s?a.push(d):(l.push(d),f+=d.length)}if((0===c||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new p(a._chunkSize)),0===c){if(o+=n-h,n=h,!s)return!0;var g=a._binding.write(t,e,o,n,a._buffer,a._offset,a._chunkSize);return g.callback=_,void(g.buffer=e)}if(!s)return!1;r()}}d.buffer=e,d.callback=_},Be(Bo,Io),Be(zo,Io),Be(Lo,Io),Be(To,Io),Be(Mo,Io),Be(Co,Io),Be(Do,Io);var Po={codes:xo,createDeflate:function(e){return new Bo(e)},createInflate:function(e){return new zo(e)},createDeflateRaw:function(e){return new Mo(e)},createInflateRaw:function(e){return new Co(e)},createGzip:function(e){return new Lo(e)},createGunzip:function(e){return new To(e)},createUnzip:function(e){return new Do(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Bo(t),e,r)},deflateSync:function(e,t){return Ao(new Bo(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Lo(t),e,r)},gzipSync:function(e,t){return Ao(new Lo(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Mo(t),e,r)},deflateRawSync:function(e,t){return Ao(new Mo(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Do(t),e,r)},unzipSync:function(e,t){return Ao(new Do(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new zo(t),e,r)},inflateSync:function(e,t){return Ao(new zo(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new To(t),e,r)},gunzipSync:function(e,t){return Ao(new To(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Co(t),e,r)},inflateRawSync:function(e,t){return Ao(new Co(t),e)},Deflate:Bo,Inflate:zo,Gzip:Lo,Gunzip:To,DeflateRaw:Mo,InflateRaw:Co,Unzip:Do,Zlib:Io};export default class{constructor(e,t,r){this.SDKAPPID=e,this.EXPIRETIME=r,this.PRIVATEKEY=t}genTestUserSig(e){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(e)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+e+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(e,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(e,t){return p.from?p.from(e,t):new p(e,t)}unescape(e){return e.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(e){return e.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(e){return this.escape(this.newBuffer(e).toString("base64"))}decode(e){return this.newBuffer(this.unescape(e),"base64")}base64encode(e){return this.newBuffer(e).toString("base64")}base64decode(e){return this.newBuffer(e,"base64").toString()}_hmacsha256(e,t,r,n){let i="TLS.identifier:"+e+"\n";i+="TLS.sdkappid:"+this.SDKAPPID+"\n",i+="TLS.time:"+t+"\n",i+="TLS.expire:"+r+"\n",null!=n&&(i+="TLS.userbuf:"+n+"\n");let o=te.HmacSHA256(i,this.PRIVATEKEY);return te.enc.Base64.stringify(o)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}_isString(e){return"string"==typeof e}genSigWithUserbuf(e,t,r){let n=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":n,"TLS.expire":t},o="";if(null!=r){let a=this.base64encode(r);i["TLS.userbuf"]=a,o=this._hmacsha256(e,n,t,a)}else o=this._hmacsha256(e,n,t,null);i["TLS.sig"]=o;let a=JSON.stringify(i),s=Po.deflateSync(this.newBuffer(a)).toString("base64"),h=this.escape(s);return console.log("ret="+h),h}validate(e){let t=this.decode(e),r=Po.inflateSync(t);console.log("validate ret="+r)}} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/index.d.ts b/node_modules/@tencentcloud/call-uikit-wechat/index.d.ts new file mode 100644 index 0000000..df052ed --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/index.d.ts @@ -0,0 +1,3 @@ +import { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, StatusChange as STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, t } from './TUICallService/index'; +declare const Version = "2.1.1"; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, Version, t, }; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/index.js b/node_modules/@tencentcloud/call-uikit-wechat/index.js new file mode 100644 index 0000000..fc3be4a --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.Version = exports.VideoDisplayMode = exports.VideoResolution = exports.CallMediaType = exports.CallRole = exports.STATUS = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = require("./TUICallService/index"); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_1.StoreName; } }); +Object.defineProperty(exports, "TUICallKitServer", { enumerable: true, get: function () { return index_1.TUICallKitServer; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_1.NAME; } }); +Object.defineProperty(exports, "STATUS", { enumerable: true, get: function () { return index_1.StatusChange; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_1.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_1.CallMediaType; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_1.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_1.VideoDisplayMode; } }); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_1.t; } }); +const Version = '2.1.1'; // basic-demo 原来上报使用 +exports.Version = Version; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/package.json b/node_modules/@tencentcloud/call-uikit-wechat/package.json index e10281d..d2c79f6 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/package.json +++ b/node_modules/@tencentcloud/call-uikit-wechat/package.json @@ -1,73 +1,40 @@ { - "_from": "@tencentcloud/call-uikit-wechat@^1.1.3", - "_id": "@tencentcloud/call-uikit-wechat@1.3.2", - "_inBundle": false, - "_integrity": "sha512-SbqtN89vDzddepNtIymJhzvJy5zqgrEA0yMDCJBupC4ZeiJi2BSwqXa6XAjq0jck7GSjO4g/LriUukZoM2DrOQ==", - "_location": "/@tencentcloud/call-uikit-wechat", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@tencentcloud/call-uikit-wechat@^1.1.3", - "name": "@tencentcloud/call-uikit-wechat", - "escapedName": "@tencentcloud%2fcall-uikit-wechat", - "scope": "@tencentcloud", - "rawSpec": "^1.1.3", - "saveSpec": null, - "fetchSpec": "^1.1.3" - }, - "_requiredBy": [ - "/@tencentcloud/chat-uikit-wechat" - ], - "_resolved": "https://registry.npmmirror.com/@tencentcloud/call-uikit-wechat/-/call-uikit-wechat-1.3.2.tgz", - "_shasum": "d2c2174bd36345d9f169505b9d0527d4e2dce136", - "_spec": "@tencentcloud/call-uikit-wechat@^1.1.3", - "_where": "E:\\WeChatProjects\\test_miniprogram\\node_modules\\@tencentcloud\\chat-uikit-wechat", - "author": { - "name": "jonyttang", - "email": "jonyttang@tencent.com" + "name": "@tencentcloud/call-uikit-wechat", + "version": "2.1.1", + "main": "./tuicall-uikit-vue.umd.js", + "module": "./tuicall-uikit-vue.es.js", + "types": "./types/index.d.ts", + "description": "An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.", + "homepage": "https://cloud.tencent.com/document/product/647/78912", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/tencentyun/TUICallKit/tree/main/uni-app/TUICallKit-Miniprogram", + "directory": "Web" }, + "dependencies": { + "@tencentcloud/tui-core": "latest", + "tim-upload-plugin": "^1.3.0", + "tuicall-engine-wx": "latest" +}, "bugs": { "url": "https://github.com/tencentyun/TUICallKit/issues" }, - "bundleDependencies": false, - "dependencies": { - "tuicall-engine-wx": "^1.4.1" - }, - "deprecated": false, - "description": "An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.", - "directories": { - "doc": "docs", - "lib": "lib" - }, - "homepage": "https://cloud.tencent.com/document/product/647/78733", "keywords": [ "uikit", "call", - "Minipragram", + "vue3", "tencent", "chat", + "vue", + "vue2", "video", "audio", "voice", + "callkit", "语音", "视频", "电话", "通话" - ], - "license": "ISC", - "main": "index.js", - "name": "@tencentcloud/call-uikit-wechat", - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/tencentyun/TUICallKit.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.3.2" + ] } diff --git a/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.js b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.js new file mode 100644 index 0000000..6bcdc3f --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.js @@ -0,0 +1,4 @@ +Page({ + data: {}, + onShow() {}, +}); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.json b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.json new file mode 100644 index 0000000..4b341a7 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "TUICallKit": "../../TUICallKit/TUICallKit" + }, + "navigationStyle": "custom", + "disableScroll": true +} diff --git a/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxml b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxml new file mode 100644 index 0000000..8c49932 --- /dev/null +++ b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxss b/node_modules/@tencentcloud/call-uikit-wechat/pages/globalCall/globalCall.wxss new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/audio-false.png b/node_modules/@tencentcloud/call-uikit-wechat/static/audio-false.png new file mode 100644 index 0000000000000000000000000000000000000000..15f5cf3b72fbf44c01a77b2163c1bdac09b99dc6 GIT binary patch literal 1285 zcmcJP{W}u~0LPaxSu<;?Oxmd}q4F~4B|?@lO>51%DBZE*DU_-o~gPPg=JS*cR@ z4!!*Hb?Ny_g?4#m;?4Uh<;;Ge_4|!YNEVqG1emMKN9wDFhye$;_jG9|UyOA=6eh*| zO7+_Eb$Wr2g(Ls~`k(+`A4>FVvAk=$)Di|Hv4NrSvVc`yQ&JS|n{jXPz^29PH~ekN z#7f-bXX3310%zgkF8wY8yUX7R;ZY%M!vNkB)8I%pHD{qu1o6V;HeDm1!S8=(b(>cG zl;4VPyOGM;xb;nx?S+4D`N>O@-ci&m3PD2lw`Rd9#{sv{*GhC7GuyRQX zKGQmt0CG$oV8g(oNYcJDJ9agZaKLJV;(W5dhL0G@2W_89pxD=Q?7IH}#e{yaf#1}` z-SLqI#fq>-h>~M%+*R98{&czuG+6iSqt&*1;@Mv7Q_-4-290j5n_Ete4;xF$G;6_= z?|0S+t8jDk?wD@p+NFN;oeklTVaU-FLUBcitNhX?P7@_#cM3GhG-v(szZwoD!j*;^GPN* zNzY(IEC^~L=&(o10izrO^|MTAmj`K~e=Z+4lC{NEv-%v`VLqSs77Kh>aUSP#5Mika zG$~`*#mVbTPwQLYZPhv^k8`p@a?QIIW>S-C@Z4!d;y|vfpqnc%oKO-PhK8@0`6Xvy z$fKpn)q3F({6%*7CG;O&o(yYR3-Dt9EwKYMkCF>_bQ`*`xBSScJhSMtYl9jL%e-Of zR?nj;U!@l%8Y<+XeV7J6RIDCQ8D{1fTwEYO1~A%FzXcV=%==IM~2Q%cG=eXGZ9h-TgsS~GAKA^>l21m=p#?_2a4wW9f=Psb%~vjb_g+s zX&U)8o>21J^}CI$E`}U#0VOsC-lS8L#v_wvn$hfiOfxqSQJ$tw%i?wzz?b9K+6!j?H& zZdu;Rjqg5up1OGJ)J0oj3VT^Uo?ZoXt6WKtUogX4IhNxuZeCjF=P7#fVb9O6J2oxu zE6+&{x6{|+?#=$dSkAz}-011z7?N>s&$a7)hYSQ*FBra@dhcfTvcWS%jm~Fv zi}$HV1ES#M9`n7bEIjr%n&LtnPye39@1mSx6?;U~n8 zo-43hl3*eKWcFc69?hv@4|aIAN?VAfUf`G5)*7O*E#bsz&F77Y%2Uk}KFBm5-!_NjN*8DQ+D@&N#%g;wPxz;gEQx){R#WCxHc*~!L{W>nvj!hbl(vBV( z_xvu*S@xF2_vP}r3+AxBW#K)MtA1kbok!EZ{#wMZwf`cwM)SR>Q(Ns;{BhG)J}9wl z|F4C=PD`w7+ST**!}56H`kvB@f7f4o6(!xWP^0JIuIWZMPQSSDtgDQFS=)-M|NozV z)@VB=)Yd$E+Ro3Hk`#{LIdW&cbLX*4vEA=}y!m2nq?BdFU%&U=DZ?i-U%p7p_;Bm> zK~AyT8xA}4o0~0|y0ySNDo5G+-k;{T2@AF|2u*wag8lS*1@p7XDV8c?#(#^ya6Ouy z)jxH|Q-%A9skZw=cFvaA;9aJfyYa@t#@(E+e(cLhKK0XOjfsTFyB{X&_8dAAYdJk? zn(Q&HR_$DOm)G+?_li9wp-Oufw-_T_C_~?E>Bs?T&hVlbf zNe3mBut@$4|JJpxS z`ab`);1y?(x9O{6{R)z`!Oyc4wz7Py6mXcrp6Gw+e})Tt(1i}yFCJbd7dz&8Uepx3 zD6F~IRk?~=n`hqh{5E5K9=2aS)51ifM@+wZzX`RR*@W!04)p$Y!ij6ANgcwW8c zd3A-?wJPtcK7W3H%ed3_-Yn|I$623lPn0|&=$GToRkVFaYIo6GYZi~&Q$zl`sBEjf zDP3^F#A)A~5A{nr4UbN%`k7ItD}T1>$>RC{U0=y^h-+T}W?KeNS3j3^P6_~p-GO~G|L-|Q8* zz`6JD(U~b$_uUKxa-RpY&)O{CsPgH&tf?`lTG2Jf;+{munwnta_=A(K#@sOe_<`-- z5wlBW+@59X9;eUBmGF%s_<%#Qa)y~h=nc-w4J`nXW5I1AD_MHy}Z-Te&?n7Te{_s zORhZsEG}ZO;jebrfrUmDCw6q~vk{-6p_Qw;#r=7a_}gB&sXIR;_{$22-u@gJ*zU@~ z-1Rn)i_J+$Zt zsCl^2m3QBY&$BPhYUQ+-a%~<$%PXww&Gc=SXozVBFX{LyuqdR(Cy;N! zHJfr%f03>RO)bVJv)EOGMK-vaHq3tJcu;iXcE0jk=h@3|L{E?ExK)^-=ymg9?2Dfd zzIE`YRe0wayr@*)&cSxl&vECx`&r!|zU}Y~{XgICN|)xR&g4T6GUdEey7-P9bYG($ z5OcA!c*^T}(Q%I_ChuI-vSZGS_o0=?L|dCkGo&%#iZvu zce{tO@t-SkTwGISr68#~>sTYZvD?L!MGrbHQ@1S0@+x^^5t3N2A?SI)(c1@4U33<` z!JaM2bCpGM!&>8-#aTbD&HkPC=zo6yuG}Aei(B8W)3l#w$ZXy${8)X4C@>!}c)I$ztaD0e0suUF B9OnQ4 literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/camera-true.png b/node_modules/@tencentcloud/call-uikit-wechat/static/camera-true.png new file mode 100644 index 0000000000000000000000000000000000000000..7abf24280c0152da51d53a997bf9d717e5a23f0b GIT binary patch literal 974 zcmeAS@N?(olHy`uVBq!ia0vp^86eET3?#J*0)=sh)`qW&uS8UU}-y8Sg%P-hSXrTyfvg z;){VmH_4O)`2{n0zm;Qoe)H1FW9xcE@BjR|W7Fck@|@IgJAEx~k+l~uGcYh+^mK6y z$+)-WdS~8h1A*3u8xQYGxnJFI!OZ)zN$vmbyNi~FX*`)_c;i0vhr<;r+>cIgdtD;d zzEh?@Rqoj4lD%h7Z2PM-B7;@}~cK@npHRl$%RJ7t7b}oQVo| z0_>F<7CKDW8Q3H@NpR-JX~JKOBCFiy3oqVY;gaK&#Gtt&IXYnhYj%x(FppX7Lcd5B z?nP^gd6^;vd#tQ1bxv+ws?%WVxa?*#hnVaCyBzsktCz{yZf{8CuJSry^|9ok%9_c_ zSs#-u1h)5Qa;i^Td(ij6ktc-}oHCwUq@U+~X0i|tILyYEE45I7uXUDiQK^^UoUS@+ z>koIj*~>rt`Ny~<;pZ;9wsr9do-f;NF zsBM3~`kb6qerc#d$XDr-Z!TLdm91mF92y-}8Y@tGFswXQOh`)9KE%;kDD^_7{W_by z@_g@?Z~Du1;bca((5iDkir4u#MMp`u=&_r~=&>y{UHT`WlU>z*%B3FJT@IGh! zr#y|ERU00!mE0v8I!khrNm`pS-B&)<+p1OB85ZxFXTf#GoO>MY}xN@y`Fc zsqAe&EtB@lia8MU9*UCwwk@({bcp)nNE96&RjLU zWOVkzsRLWSD>PPaa8!H7Ju4;6?rNk}noo(6so{^T$Sr{l965Pe#ZYnkJ$I%5 z#gAksryE^k%>Wfo6%eY>0To?!_||G z@(rzL8Qs`;qJhhCMMOK-stqrCxrG1A_dnyUsdc&W)2Y&ahNE1;A#tuE$-IvpuVWY{ w{80+s?~wFw<91_(`?VL2#B5M)>#t+{Iep2!yeKUWU?yPjboFyt=akR{0CtM%Q2+n{ literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/default_avatar.png b/node_modules/@tencentcloud/call-uikit-wechat/static/default_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..0e2222d209d847a746d7fb3aaef6e7e14a8cff4a GIT binary patch literal 1727 zcmV;w20;0VP)fG_|M2$zQl0)c;$d|2>iaDTV(SeE;6;|B%1` zOqu^JhyTpt|8lPXx7Po!(f^~$|7WQGVx|9!z5i^h|ADvvd9(kS#s8+v|D4DF69nSa z000HvNkl37E6a~<|8xsg2X_%)1MTH_Lg^K?Fzg_7nPJ%jMrw=|zUe7$( z3ig={&+|Ob^E}V_8q7Vp{|{}bbz!VaZ3EZBI&0Yox`!srH3Aq58q7`LTCtP` zEG&v`!?9;-Jy_^bdxl%Bdg*;jOjYnkZ4C=eYHx5WWKO|~l5!1onaf}$E2D>77v^4J z<(0V$+!`=9hLy3DY-s=24ea68;;$Q6z^wywBUl+psf%BjOJF6D(xB`8H4gOP)`?ml z7W&jqaI00XG}(yBg__qDv3*tSyfxIQl@oNu)B|{}6$r*<2I5#52x3@>rGx?CqfSAv zruG5XI(6=omY~*Lr6|6~k{Cdp4#`B$B?LS$_ZYxX@W|W)-0M+W!O)6QGNJ3$oMGrp zO~RXr8g0Vz2)J)fUmt>dJOaRnZ9=*c6vnQHb_d(B>>Lu5GnzOs`h6^DKJ#DKE-~m( zN>@&6(W*zX5L1m6vU2opGuY1{#e2QC67P^=OD$>RhIT?t(8Ir!+737DsHKqOU;B2p zoHz_b0kkjPcM}7_5H^zl8I}o?|Npm1Wnu(IGBzn$VM>TV5?i!~~x#mEgv z9*%+BL)C9rL#jFU6uGAvm6$ytmy%2p9l1`m$q-$#3GhFt@;dgV8#g;hBIE*#1grqL zNU{fTGP}Fbh)Y{YI=5RK!$RlM0ze?u7WB^;%qzbi$VhpSW(8*CQh_@HvmzN;9++@S zC#E47@9s?jJ|9OS)1d>$i~vYf5EU?S%t&pGK4^Ao05T4Jp9^s+${ruH2%n_<3N3OX zTog&TgEC|A$-aX!ZSYA~i4bu-l=7th1Ft#+Lv`vqD%7Y;foHO{p^wS zSgALi47TmjsJ$IbQrXJ6C464lWFY@%P|nSe^LeQuhEuk(XVki=q|xyvZ!gi3~fEHXMvRaOlM&rH(UC zuWO6$NSi#g3<#`=>=<8Sn`jNL-qzOW9<24qfY_XfVjRS*^2K`)KfWS{W(W~BQ;#DT zjtctY?&mU0%?#z9mc$D{8v|ncYV6YOY3mRdbj=y@1CW&(rNPq|x~*gzpj?*Pl=FbI ziAHzbicq5O)9uVs9c8liCgHd9uq4Ly-(!gN#&jF5X+W&EA6rypnfPQ{RPgfFkA66U z9Ya80%zcOWdg4Qj>+fR-^rzIcxoG<{ZI{F{e8@;-x)iL4$keDwPM^PEpWR9w{1*~) zpZ8sGgb6jr3329eFs(e$_(0``b4~`&r>3|e3c|O9s#sK>P`BR=6b%}^>&8UwAys45 zDF(T_9tz&55o;Xt9vrG_SM#2X-M>WwCjet?9jdNXd%AK`h+sD|SKoQ61x}dIH)UNBRv8g~Ggk@pq^OyW33{ZS=>EVYKQAnhS6zDu4>00;m8gfD{3?tvi$Fo{FL-7IGw0;_`ZxyR--0$=zv3RN8(&_a5*6r}m z>+FQlw|UL5;PLmr=HRj5)|=VLZ_BFF?C!ba+=|n@TEm+luyp0}`jXbdPrsB%y^lM% zhc>r@#OLH@$E0AzpQ78%LAr{z;@f}FwaV$}Rl%48h-aMu001j=QchC<=pL^$>~NhIG1Jbts$wcNCq!CW$4+HFy&Y*beB zSV(@gvO(dHs>N*xvE#Miv&k*nkYJZx3Q!|fgtTI;L4jyhSD?sBwMC|FueYI4dwrWs zYE~>LW>uPGN-|b}28CFXOh_hdXksS}giy1fkyRtTwzAMHyG8mm6B%fiNoX6*_17@s zb)9r@-oThQ4k`D_ff3IV7b~M8Jv-lJM3-;HA(rm19Xz* z(0oESfXA{lmo!2vJ=XxpA+&O@qB{WQ9tLj^YH#Q->JT*edbD$V1?}oIQ}Z>1jLwGa zm!mE;d)=g25)g9IXAh2+pjm=u*vde}G2_mlS!Ro#=Rw3Vn=l+eGmoBCgNQpem{K4z*h}tqLLj z0epjgRhqT}K}Rf@99p3%4G8iNU?2K5)Eve62e1eIVl=4;Q9I1fHMA?z1Q)`NSx`CT z5?6+>GZs`1mFZE+hOqZ6s2s9W5<4;Og!wvyel;c68F$Rr2j~~4F&pA8nZM7_&ZY+& zkZ{d{%b^Xv6A;&B{&t}o-xaJv#%^#qv`W9V@{n=Le0}UdyL^jJ!{UzpfBzi}a24FC z`p;yCH!va14@AYCvp)>?doaSIpHdk}xnWQ3eTE^K6cKGg(gB-x+=Vfl{8CBW5u4OM zhe34}*TVa3!qEU`@KL-5NtY83&l8xnMnubyG~!Fp8yL3Cm!cB(_<4|NHjx8ad@dgL zV46cNq@4?IB;~nOg|zOFJ-CHwRZ2kK5#Pm_mY_1E@s0f#m{z7ZGsFxT0NLkA`hy3We-kZjz@8*G8#{2{Vt4&QyI#<=hxiElqmsadLPDf!2qTt zs0wBHTyPIls^mhUL-yc13~|YUI($X6+l3hpkqw1*4DT&%ez>bf=YT!9f(gs~cwG&? zp!n8>0c+~NdpkAyBueuuCRI8gO|Gl!{E|-tny2K^57;n%F>K`s6y z`qYJ9o}RB)`Gv=+<_OaCiwo5*Ohw@G*KL&Q9nOy6^EH&nxA+TBY7P2q?90;#dbgic zUFEFuSI$(sWRFfqQ=#qm)$MsI{G~tT-m^y^u6gd<4^?iQH~4Fp>Rqr$A8+wX@9vOI zIEO4-Zyk>v#$EI<_`1uc46h(5PGdEw#2-c6;qj0?b#M(iwaJ&iH5lzNe~OkGc8VUA zp+jev&9*mygfek1q=-ZyzgTi*KSANdBlyyTsG^a2Je?10wjGFyNq>gL$wY7gK@FO+ z0!=!5Y_@#}S)plF=rTHGvzHAX>uh zkWG?bR9M^ehYB>h?6X;RJ6KFbpeTTx!55W_ib6Ah;&S^6C$yNN!Wf)<8hyw7>?HY0 zK$v_Q-D7?U!QwFTZu^WA{&vwyik9b*H`rnFAI{b2Sst`I-(|i|F|Vvti7I)ciy`xI zi#cVsXods~xZ!yuP*y1+U#3mo)ghbGKj~pkubVVe9cG;GO)Q1Zx|mx%ETsy2mlwZ> zbN}eBhxxq;Rk6tK;AVt{SkB8Y*BSkSsnIW48`_$wmh-QaZH|87?C6&+kACs^$d~Vr zeglQ*x3GwQ6Orh*afyB-o#?kRiheVx=(qEVenYkBx3r6XQ^6O|)-n2xHKX6!^aV7R zjedLI=r>q?0WGe7+VY^8w?%&bw|Rd#jrM;^#tP7&5KEFN&58xZtV)wi+Fox%q4xSV znbxYVK#`SdivrPz6(Ow{YfymPvJDA#*`=VRYH=Gv?079j;jmFz&0`_?)yf8iO3RIT z8O$Z)#oQK!QEIcEUR$>DEPHt^UEd5#-aN~3tBG>lE48gcK9|cEtaizZmlIXjA@zO$ X0+|69)Fq$b00000NkvXXu0mjfTr4g< literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/hangup.png b/node_modules/@tencentcloud/call-uikit-wechat/static/hangup.png new file mode 100644 index 0000000000000000000000000000000000000000..2bf0adc28f86f99941182f75f77aa1874a74cf79 GIT binary patch literal 1262 zcmVC0002PP)t-s0002{ zSzh~CU;9{I`&eK4Szr5EUiw&G`&nQ6T44HFVEB zUi(;H`&nN4SYP^CU;9~K`&nQ7Szh~CU;9~K{8?c9SYP~GUi(^K`&?l9SYrQOXa8Ve z`dD82SYH4C|Ni*+{_^wv&(ZsTg!*D=`;?gbjgk9^jQVMB{`~y>vb6lJu>6{y{JFdO zZ*=-xV*T3N{ngg}$I1P^!2GDI{_E@h<>vn1;rybd`*nIk>fhi1001R)QchC z)5fWVLN^=?1_U44`}yw3HU8_o^l2p}n z#V|Y8fVg<*sd5EZRb;jIKxwiwrd~v#qHbnvN{7{yz(i_Vl(>BB1rfZo@|2{fIwGq- zQBoci#G*V>5;8JklQVR$Yy)>`Wa%Ecb{Tgnw{sL*Uqb@4e%$d@Bt*@{+P;j$$T5=8 zm5?B*OA)C^m`YLD1`=o35h_Jk$IIq^9u9u>TrTR13|4 ztsqs3O~DML%!v2>;q^u8f`e{A|486Ky4g%Q8C=LYt^r_=K_A@ouP#6XH`=u&w82rE zE@aE#sGKFg2DoaFPX?T2=$s7BWIFQ*?#^$n3b<3w?*9C2|=24VoMN2vc=SZzYt6aW72Orgwaoz!6JkyJ`hn40`*RZae-73 zM-l(Aq=Fc{@5$Hlb#>gkv*FNn_p8_Kd@=G6RfTAPh`i};vv;m@*Yl}|CVVbfbTf3=xZCL`m~_Zwoqg*%QMmIDFfhqr8h&xSc+-c?{A)3uj;52z zc(;8$T&`w4K`4XeJp49yeba3gA6LTpzV@%^Fh&R^ya~Md`Omrm8S@tFS+qycNkbs- z{rvA&dw7U%U z0ikxz6=U2``o)}`BW+_1K!Evllmw~fg=2Jxl{)Ki}i zq;jufB3Z0H$r}EcA4@8P-fI=MBH2lQl(vT1+?%4JA5~?kf8+Y)Sw5}<{o7>^g$cYg zgBPdp@*Livz_)1NO)7Ys4&JE5w`zlgAd>yG>)`_n_{au7w1SWA@PkYE=oUY`hL7*x z-P=J403ZOszzUYIe?>tP_>dbe$IcH7eBtmD3*UJB$mCZpKC}6q&kv1$>GV@8-+KMn z?ALBTxBI={0|!q$0?5TP9}k^8^$K7&&;0`6F+e^8==HGQF)tdM{eA_X3-mjH-(T?m Y1sYUFjB@q@e*gdg07*qoM6N<$g8n9dZ~y=R literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/loading.png b/node_modules/@tencentcloud/call-uikit-wechat/static/loading.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe6f40cc202e5ec915fc0b3473b94f19e522876 GIT binary patch literal 1367 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBHU{{FxB}__Lkeu4Q8WkWXsePS zzhDL~X~m2PHQ_uz7ydX;vHcs3&Q5DcW(&5zysK5K(`|o-R&1_kU|^BtG^vZ0UwTNSdewU46!15^^cesDfF^m@Z;iB@6neCfX?wZ&~ zjFyj5SDtq<%SdQWYiwj*#M)plT$z4to8ASz3FV?JpVHj-toZPEV&WC|8eg8CYKL{3 zIS&bKO-lK+p!I#PW8p5N#b&9JIHjzZ0kSZ$v>J8hlyGIs6L`*IhRE+4*g+qq9t zBX8M+?I&X<@;HUPTkE<`f_i|_4;3~h}l4Z{W<*ySAIU7zM4Zg^JD>`K+0KLJc{eUvT>I<-M7t^yQ>k?Y9`CTFqHXCTX{;A z;7pCe3$FI{Lz8tGvE7W&1?Jhkt50Vm(s56J7)2{C1Ohc;N7&Uw@|`U*`V7LFZ($0>7M|$?j{$zL&jPrk`G>8`~Cj zQGRiI#nnt(0o%#-Rc6YLm-4q;2im{6kX#(bx?WDeOC)s8pL1)Un0Py0VLY{iN570<{v*PXKh`FMVvWEVY>wT~;L;AdsAo#XSfS-YmIB$|D;+FE4MLRPl%GU60 zd!#${t8Q!D_Apzfduw;FzIQ(p6#MAn{9cyxnoUGO{sK&To2~!X&C|bm#BT2AXHz;eJZ5fr^y{yw zzopr0C6hiIsgCw literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/phone_dialing.mp3 b/node_modules/@tencentcloud/call-uikit-wechat/static/phone_dialing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f392528b74f642871a5114f38577b39b8547db9d GIT binary patch literal 9178 zcmai)c{o&m^v6Fl_s*EH)L`t}*oOu~O!$&rh?`ob&mNqwQJ|8$4-XIY_bT*f z<& zF(WX!THtBS%r{xEuYbbezRoWxx%qL}0^?BN**9XKyB-ic@6mC|6!2;@;?iq_e97e@ z^RDOhE}plT@%t7i-fB!XgV&cXze12XWVrxA29*#*ioZ`o+%6sC5TW013_({SfGrJt za7h#paIN6l?2N~&^+U*ipP!3MHLdUTekwlEERPYK%w75iyZ*Paxr$}VC^Cs(W?&o= ze5IWZrb!^CP{SGb5P+f{vNe$Gi4QowbcIP;_X&hH-@8*oQQf;}0hq7z0ut2)yYw|89I9d9h@H?AX_m zYZ;Wf?vQk1wE;&#@PXUje1eM~3R>pRP$~xcXRNju_cpB9gYUji2TZ&#)T?a<$kA{( zg*Ck6!=L)axm{6tUkt)7WLpX|?%B1X4=>HL<1R^%1#3$ci4RJn-U~d5>rq9oV;m|J zt4as!NO)*g+ZKr9;rTC4W04Ys4V-R4?w8B793FP#XkvB`JKdkPTO*W9I58%NUCY0> z06SzW(O7Fxj;$O%QAq>nzoWoy20kPqnAnHs@4#;J$WFXHlS)#zztyc)J*Lto-ilsa z&T8VgZnu`qu$T1A_aVk%HyXT7T$K5Soov>z4m+DF&DpoJ@#I@5MNFWsJ|0~+H}nTo(MYx zeT5&ry?e#sOE(*sG%<0U=ewnuTh(lM=!1wHyYBJ8qy61s9B*suiGP=eE@Vrt_=knB z>@+0FLw+%{8V-Qu43PQd+iOWexYXq6-Lvf;UA=+%ei*^(Scya*YYh$LOwVYFk1QNm zJLmTcz5eoLGiHwsl&GKqc1EN2XjlT#RN%HWN-!Q>61e-7vy(1#nQ_U}~5zmTo2E z@Yiy6y0U5AP0J)Boh6L39|AWlAFJU*p&D&hjAQ=tUFq^eUDvjZgEqb<8)P}%Y3yoy zO-U0kiQy|*>lAR&NcDO3&*k&${A4pnmVZpWDaSa+U{aShY=#ep*eq879>53n|A{?u zHdeD^L^)1SVB_3?RGQYzy3IDXW0enOa*>9b7tGkrV=(Pnu$vaVjLbEs>w9l z87~HPTeHD2XJsu5^ghJ;X7s(ub#8GV=o`h8jb3-@M{h@v=g4HWo#l*UdV9?tX^$`b zUT^HyPhKk==yAI?><{gWuF+)!xeiwW_p!vf> z%GhaBBNs&faShO1^Yi(?4v39VL)bue(| z3!9d@HEx|LByC2}?3Iy3h=4sD)n^8<>w2;_18X4SmgjMz!8J zlXHp;KQ|1}olG!vX3DuSJplK9^!2bT)62Tya$xG{&DKtKmQhIWvy(VVfB2U zc+RrU+xE{!B4!>>k!i2irIgcFFWz9BO4wLk&Di`M4VuRMgX$_sca-kGB~uvr*1UOt z?M;h2T0)tZ%%0<>w0e~0k^VUU3n$10?^3=9U7fK{Muvx@R4`5z;mUnkV5aI5(~H(+ z&;bLXm{sz#@-ZDZrmObq5WRC{Vs>{~y?=ba6LryiP8jOOdkUt!D#ibd8M6-#Q$2#Jfn?jgKlViv9 z!0n66>1P^|lXOpkJms4DH+$8?ZRG2qv)U=os_kEEn+t5gIDrB=&92}>4j_-}jSQ96FeM=m+7&(L>_cviDpNV_Bj z<2Vo)|Lh+l#Hd2k_!$q9?WWHcOoH;nC@MDyyx4D6(oVUz<1@S?j!vAAml9JuSIoz? zLEYR#AO)EllwZ4UMnNQE5aU=A9=iuHB;Ke%y~(#ZxL7N+8`@X;`VZCm6KlNiB4e#W znU79Z3jYZDL1!VMIJDoT<=o`xamTi4mZ5u zMTom!?|8xWMem?q=a3&5hXv*7aXN(XG^ov>&I4=$6Vh7;K-9VSFZ%ob4ZMAE;bh+- zDhXUHT+WfaK0W^+lB^}2vTyJq?SK!i%`Jbc-D%es7{?rHlS^TcPXHL{_kn2Z!T(p1cBjaiAIg+R=c1D%=X7F55? zKLRh<{Qyh|6XvgD_H2go*2FNVL{a=Kegx&Iv1$?V-b)@z4+vjh8Kcst!z0weH}U zVI#R?Vda8N70-~lkX_>QB7CV6OyD}Z(;}iYL!eQP4u1i$IOBPO8V@#Pp!OS6GdU z=a0201da^TpI8>RL`uJYbVn)^vxkeui_;C7{_nl0tFt>pR(q8W&>3qc2V9-;C8Fmo zw?T286Lv5ARa;Kg+70BS_&3@#Nw?Y(&7Zg4+KM`A z+UJsG@0IZD`Txqw>wWbtF7CFL7CwC?*b)lU?mJ_STF;t*c}U<;ap{k%lCnop@M%oWXUl$>MfJkg1DVr=3vBm&YDxm2}(N=^`dQNJ!F zySq?Csv0^xyfMyULXO@M2HcIqcjIR)fjxeY4F8;*b=LUnMMY|4lgw&~USmO}le&VH z$lvXI_f~N#C_o78YtuC<3b*)ZtWC=Z|}1x|kod~NE%>aTTFuVcQYGoPN#N1!`K;QPdXtxv zwH1^a7QK&PoM8Bnj&Fw&x=z`wL;z-Cjco-IobZMCCgVphpKiK+g({((;!s<>?Aq^2 zQePb+VOB3J_&SAsrsgTKfJ|ycyxLWPaYEsAJ>PC6A`J?{zrp;x+59~}jeS2rL15;I z747_=u;wG{jyRq_<8t)W`?3UW+28qvOUKA?Yu~zkU-llqcI8o5_J5pN&jbbzPllPS z^crvpHok?Q6BgQ*Q8MoGO0Bb&N|6oQ8RecH+^tSb&Nx-sEV18gGMi4g-M{lJkmfnF zT5BjM$2JgR>v?db@HFCY-%79wRy+6lU~s75^E7H!uf)ih;I2D!?t=@pphtVh8PbSw zZ9x(tN9F#S;NC&?wD4heWS;J8EzF)>aIah#1L#5cKbtC>jNz8hG(`8`)}>c-0}jdo z&7VUHXf+z{2LyW8mt07bJ*`r@+A+6-lOD83O17=e@4GJ524Svn2!{Im7!s4JP$4VT z5`8aoLtrZqdo_9fmwZ-*yohSGp+c0@DUnJ-$BmR0Q?s}&zFAJo0SWt%W}lSn$ijxT zhFHJh??aH+i#dViGv)Lb4hc>^h6h3kAJ+zHm9-u{Oca;T4;XoxWnBFJO*%tpc;d8OW;d8 zy0fr2>XYYJPu`v<&bNXyh2*RKa%q9Rj#T!caAFi%j?ky8?8dlU+;s3{B>+Pg!l4($)K{2YUu(8MsN+zB+ zb+7%Zs7S!zE!vupSCbsqy0}40|CW)g&E7S;g651~NlCbV*h3+6+Ca;y|NQK;2F)L5 z2nsS7#NI1JXGp1+zWKhJa(wggfM%}l81r{dut7R3NZB!Etr4Tv(GYU~Rf;u#nsUCO zjH0Kb$i+C`u%$cd=X(NZ9UKKDIEm4);hs1$$3ud1lmZ4H()+BV8|$yQj}WJLtnT?J>~?Ns0?+p66xS2tO&jhc~Y9fmzv^h(gFtU z-&YWI@6yvVs3Gmt2nh}C_Mq}>;&;4?vQKW$RJ;+>w%>on&pvRQ36DV%5{0;mUpRn| z&k-a-0QYmtuPNll(j#hq)kxEOrv?~1;4R`SgL zF0T#I#)o9CBxM)nPPn(+#r)#|PwD-ahuu!2nEnu4>)pcK_e#ct7yhcm zw;R>@)6W5gm}t1|;*Z~-9v&4v|Hy{iwWqJ}hbb30)3VhIbN!IYwaXRKLTU}faglR8 zMUrER(}|@|VVFHm1hcC=hP=wrm>^bB8JdUkk!Hh>9=S`e-gap&>dO4JVwKj+{%VY4N1*6OFmQnc$ipBN;CyMKsRGo!k+rns zp$J^hW_n^^=Xaa?Ax>uvJlujb%M_o^Bb_|t0P>(h;YUXq3DODybeuFE z$}vc!flEZ==NX^hg%K7f=9Ap$Uo-JY^-B>mm%qyo0*Bu0;eDj_r^*-7IJSLfO3^Vd ziAu`NIE!)23DWv;3}8=)>18EaqIsBU>{2r2Ip#A`#C@2zhA|pv>mb|n{hj+P&6Czt zH(Vq|>FU`AwuCPu_j28GJSFa=1YjIvxI=Cq16+ro^uzf8AFDR_P_tiswUB!|T}6Lp zo~_w=tv~9c+GEq2GFQQ9=_0R(v2x?}e4_A)GZ$LtZpTrDsC5{J1^-6%hkjob&o#&g zsE!#Q1JM%0cTp7tVA$ zM3yT)nd7)2{e626AT-Z2^QTH)^-;AI2W#0f8QTvJc9IsQ`E5tjqVs&=VN-S_#?gms z+z-+Ty9j99SM;#;tD%D4{)JJxx@=Kb)KuH?SKLY!WtA^VNer{JjKCzh&!=kLSn166 zXqr6X%i(I*8*Lbe33K&h&~-t8_$u!>=$v9T1A_$jL{E7I*W)Q`R61VdKHhcCXlQ_8 z;9BVBRDJD?xqtD^+OL-$r&>aMAg$!=H~F7EQ)~C763{t!LiaAJ^B@gN{v8yO6}m-^ zQx-PTQf53l79Mh4O(cGwacl7MYrfUJCjmdUrU!Ni)?8slqM^Y!Is|zoZw44f`&EPX zCRCsC@2({wZx8VhWWh~FA#^#3{>E#6^0-dXlJty~%AHB;9!a(^tuf_<=j9Z~edR?{ z(PWIHNf7=AtzXfoj_KxbK@P2`&?}m>(NcQ;`lf%cFD!4N68jep=6UV(17fn)nom=& zJIob~eU8(md=KBK=<;B51nV`%QH3kr1L)*8*!(_-=?{H}N-u!;G{NaZYmkTg5#$4f zG*)LnbjXXt(vA&Y7;teEDbPF4`y>-s@t)pnGw063ILh#lei#GiK!_PK$WKS}XJE}q z!AcSnwCQ)OQ|S8#d4cY#;VXg!U1~q%3Q{lghe+L|@{$Dk2!pC4e&^*bWizop%3py% zbKglP+KHjMahn7FrAg2TjUS{OWWej%X^5!)&N`~nx^&^f8-syELUP#=GHL+@5C1q1 zov${|~63iw2=Fa7h!y?vl(fO;mNfi>|@a%uE7HvNG1Q4!1@Q8*o4Us&Hl z(kfq?{^39TW>p8{_^62dg%8V4T(P(3;&VefR_(eJ@+Q{}V>xy=YRX$BkgY zzKwNiTbG}NJ?+?T%m#o%C}z8xAlJ~qsbyuN;cu82h97*L!Z<>3JzC%4M>we0pz}An zzoBpHyZr93m(cLm7mYijh@nXvZuEPGakZV?9Z-dgs?795^>QKovQfW;QWaX@=^;@V zhYY97q5C9s2x?O4!}RAd1s`21z#mnsXZolx@3=Q;`|ox;U0=?;aQ7K!S5!QJHYFT9 zJ-x*HZp2LC9CFTI$9VJbN<6x>rP{rV*&N+Wab zZ;&IziT_F?04}r8&a30{a_d6t@=Xc3fS2797>5WO>YrTcqa0Z2B=C}W@Z*7avW$z} zon)P-*Tm{nLo8JAgz`^UI~|@|8HJio=((>$mUzgV4sCM1xX<9_vD^DFjv$<=@6!R{ zVKnZks4L;%veP?^GOd&b*b+21#YU+s-pOYZV{KOpcsk{iEp1f`o}(MNynK9CcvemR z)scs^^p*NWf^+naGYGqtA+8j9j2w#>{v8wtZS$E>6;0iGk)|TG=7Wc$^`{C>-LANs zg~~m6)RoPvD_i~EE6+&_$=9*o$*#m5^^ZQSg>;Tg)rZ=z6bUym`B|?W&)Gyyd4z6-oGEhUNK{^)3K=sQb~;eR+uX-`w;? ze>qU_Q6gjE#&au9Tu5rq@EdY@g9l~n_0&5-078y$)?3PKjK1nNe0{iBen-6RrImhO z5VloFF@sA8P?_#658#A{-{=cC8xkASlmV6!W#z| zgh^UVFY!wxnunzkT1ys78ZPUvKXW?p*(GFadB1Z)(q3s<^jiQloL%J}WTB%Kt^H)= zwp0_Yd`p%U3F8RChUk8RoGK0C7+~`|5%1S96SeKY(CrrM;+^efjizQwvg!vMwro!b zjf&7XzD!X^=Cp;$;%5!>6h<%cO%La-oL{Vh`3eUZAQXaV257zTg>OQdDiQ-DfupXM z?^D*)o^t)DEux<&O*E%)T-97Qjl7CnI3)b$w(U^=I|*M|n%TLrGRz(dJhcT~U%OPH zCRP>)t%K>Gice}?&b|?otQWK+N?+{Oq>EzD@{2sGGQY64T1h+d7kd2s@k6@))v2vX zaZk$VJ6CjGgupiE03k9B?Gv70x?v-(nd?BYgQOKtK(kEqMWiypd+G100t?!)@%2{H ztN5Kk6i@Uk5I>M5btz%wui3Xs%pM}lHb2yj)1adJb+xm=9#*I1$=dC*@~6IZIOiyN zZc}28$}#y6r2dBOj$-9Rm}D|;br(ybZ*5zW1=%XXq_7jS(VPJgXm9eD5^4s=}j;^PJsVSYC*2(^z9&Wyuq#=p3ZfaxRVy^AjkIWGG6#tRTF%K5zA2M8T!eS6;vJfrU2Y^&9?R{i@ z8Jr0#i`jx2@ScS>gHmQp-58Imp)ozb)TZoogg(fbGMSj`Fts?;$Z zgEhpUbSDRZ`dL?Al6@{96dzlE_kod8@W7IML6uuR`%j?BuJWD4rB?KemYJ%PbmaWD z%W7v2#Id#1HvX4C6ixJd1@G`sH+pVPYJ+vIUTJ+cz6@37h!u`*f?e}EQyKkX7v9HM zuj3(`pY14*vu&!gETVI?nKD~;k60jxE5;FrgvDt84{{#L<@4Wy3 literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/phone_ringing.mp3 b/node_modules/@tencentcloud/call-uikit-wechat/static/phone_ringing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..c3838f3323254eb5543dfe05e57a2c2a4a241ade GIT binary patch literal 8752 zcmXY12|SeR+kW1eF*6v(GPWY4DA^jJD4DSo+NcO^$Wl?3R63n%UIqz;a$22Cq#QZX za!wsBGiZ|*r)d3mY<4Mp4Mj{XMVq_4^Gk&0KTM{a*KVU-wh~K2CIm{}2m;mU}P4 z7c~5E4Dt?Giodh*!*k2}O)&}Ef@lQJVF@7m(4EY0ADq-dA#xweq(9H@dJqoIy9I@Yy6P(V3sc6Cs1i#_e~r5uwnW zdF>*Jgz4RqNdi=H-=du^FaAmN*T4IRNyycnanh|v{ACk=5-#u9tI|}v1G{TYj8A*@ zu4eZuuAaZM5MobND-DQ#sRxBm<2G*~npgtF(P|Hid`}WIQ~jwNhDhW}#4rXjQ0}4L zB_%_aA2g(T8~-s})i+1h|M}ImAcIQD#UMX-UexMcb|1fg5qq)!4W(_n_VmQvMX4dM zYGU;Lz=ur~KAo#br!`7wY{Wrs5dsS$ZBX5kVH|-R2}}7`gjg<*`MINOe)&9#PDW1* zegi|UHH~q!Y{M%V|4Uv>%MITnyd!LJ;F(CWXYDNB@i=Ozb@H|w9>vT^R7l}7@|%+w z3+YT_q{VkzCh$gSx7F>~93+^L7J~+|8C#0c?;H8FW4BGF5i72?o-22jlvbP#)1gnQ z6+isFI7huK@Q7*f$~GhMhM`LBMWed+E>76;m$~iWzURv^z7H#35lQ!#&~=cO)J+s2 zLd0#&sT@lYazx!}X$%IRzwDtXX3mtW@fDVKu1@P4PwD^lT3D9)+&(0f@#_t06757| zmf!LVP}XBjcv1Lz2b$N?n`nfNv8H_bA-*?31hMSw7$Uxa?7kntW;6UTG;*kvUfB?@x%sm0RAN*+mi+H-*n` zFNu`SOmZ;WbQ6>wIa5CEdTwtH#fy-I;3#Zp@%x9W|0J$r32IF1G)9{I=}GRB2_jU> znvo$ASQA!cT{bhf)*DT79(fOMrgnMx&sR5H_}2W7yFdCO5K*vn?Sv3z&{1tQVfssW;Cj7NvC}j;3^aq;Uj6_^3HF;QH96#fT!=43maW zB7kNO5kYVNg{xk@M0j=5Wl>m->w%r22EO0+fHDT5D1p8hT0fhfIY6J1$3K^lpY>_2 zF``lU0xd-(v8W)@n5_}vznx9hUtQpn9l^K3`21|I&@0%2<*x_!7T;iotM z%5_hyKlN7l>3vlnCuFI`JDykLcOiv8??Az7+G5=<#Ma`QY_+r?2s@U;R3zeClK+NA zkc^v6{X1!OD`c>Cy77y0DWX}(AL?#}{yEm~ijCc0@uRm-yHj8BO$S82tF|AHeb#0g zCOhMVe%sUb?KOqJKuZurEMa@IIUJF?fa8S-lImYRe=7P-hs&+@h=I?E2tJUeYTdckQ6IY%uEAg-RmUy|9p zm00ZGh3hY$9>M1mX;O7-RvsVOqFBGc3`R#xFT>iM$!J*ZAcm!f$xuzTBc}d~dp~{r zSmq^lYfWF53PUYTYSsoT&+5>2I!4o5_ulw(-H{p97uXd33eAF4qN%Wh&F09%MDCFU z5zVqYmw^OMWcf>6AAN+FCk@YupEf=Yh^r^qNIlbW8o*X~YOj%&LY zRFi<%!Cs!NQEc6rG|r5;uNE^Y{1DCNETXBVj?LB}0bwN&iRz?%zDFHIoy;pMmdhB*}np9%p*h-U$YGmYLd~ zyXCj9TXMqOK=va6;-nfpy+{dn`{OqSGX`4?xE6~|X}VY6!e5P+h_-mRnX13fX0Boj z(WE;W*FR$VR_7>!s4%i*qG)8DW+fV6qrtx3W`ikl8L>JIKKmACwxzyu{PQ-CFlGhM z5q{mU>68tJr_XVHm%}{x;w_BI`NWCnO_>)xl>Ey?5XCEWlMF3`QIGC_`jR8LmO2hvg+rsl(Rtfj$*lfuhcePsm2&>Z16TS5CYw88)H>3p!`a<%q4$|QJi;No(k)dwK$P)=>lHH6# z23q#*VtA{n!&+WYy&_wa5cX^pO1Z8Ea@IGQNdhA$SR+=%WJqJIJ7bTxzG%3QOoAK? z?fwSkTwmt6|K}2c3A9BQC6s>Lvh1)wZ)DjqvPA+HvfC#Op(1@l9hZCN<&D15(ccR)(U`B@7C8x;){PZ+7|=Josgc%jW==IZ@YIa0erG9no$YAx^8FP5e6Avf zwvbN8^OwZ@as7)mt#Ll&&mdw%0~w6q{QR)lB+bNX&`X&o*nRwzXJ%BFd5Rm|Pd1V> zJP>FzWy15eJ0+{nz4>lE^ESm}aN_<8)jMV#7_nKfV9SEdjf?Il-5+Ghk;WyL zBh7PDRYM7d+>KrWRqY1HWI` z*BzE`;;8@lIE7!lU$K&C!v4e2kedYBO(xQC{m^tCgc2=d$)bcn> zzTvH@sXQIi$*Iy~JN?{oKBi1XBs?~lu7ZNZzz^=H|I_IjavblJ#jHLu(WGWP(? z&N2y0Yz=nNlPBkalEd0B0}B5LB6KWQGWik6{7g<}9UJ+C9@uD{fsjNmp01sQ9?kaA zoqYJ86bokZuHbbqf2cL)%pWQ5+^$_NdR+I_bzg7o$(H%S1G<^M67lRi(Y_J8V)x8$ z`F7xV?xmk7{A5Dcd{XFpdl79?SM9^DVni?6ezcQZnY8?1WmWT}`?sd`MB1$6axFKx z8aP?)+L=8oc0)WuPA`wGVQD;A^jBlZqvp2ypKCXrgu6HN$J`~Sk-2isv)JcL5TC*i zMue%^JEf(FV{+SuEVoA9V+Z1lx02|m!t)aCBqBo`oH+Ump`CC`c6n6o*NTM(PR_}K zFL`tGeHIwe6DK=H*~i9ixz=(^24n0jg@7jTlw=8`r6tR|B@EHC^e^njK z$(FU3oIBe#$o2>psxG&ePnSW(LGJ)idhVp~4H4=xYwu=@IC_%WnzO~od$5q=&t9qX z!CNDcSby)LDtVB1)T=$x?pv3&&owb!*Hf1A@%&`w7z&)+ttYAmcCq9(3kI8atbwBi zZJg19bptmc;czB}PovlDFnhJnS&BI1#GrOILF4%*kc?7tM!s!Cv*G;{?rkcmH2~BX zaEEn>Whpz43qQa+ISlOJEnfNu(oi}>wh;KnVkO~OD^s1^BU#1cu=?Bhn&bLmAhcWe zwLK5xcRf&)W+U3h6-ma+N#sKRNa+*E+abO^r83AysQ@g1F&(A(l3jBa(0<-lX&G^0 z*i2Y`^Q-&?WF$RE?JNDQPe3WgQBgD_0-r{^l-%wF#^ZAV((*L6CJ5aB*Q8KDlH znFlN7(n zHh`wI5fa5?d>?g$HkrLrv&Q)RiPxlTlzx9)KkP`|-|37b!oVP{B?Qe^X&Oh60KM>P)(;Q5gu~%Wx z5GPSZ0Q4kTRKwT{Tsxb!Ff@gTP6S1+cxWEQpNY2{-7qz4Dbkv9o?ljsXymeJ<5ChW zFRW@{B%yE+X#-U30~zQC=J%hMoXsgKqe1^bR)b^Uy}|D*OO$IIzJu+jz_Vs2qIT^X zDH9(WiLQh%CX1Bg`oW#VTbsqe_>%ME{3}vpO;?i0`QUj;P9RzkUm<4V6M#x*7?F01 zRlnX6_Cx-8UuZE0Rh^SV8NkaK(z4-Lli39i3{x0Z?VwS6=repkNWpG*^4k}VG1K_KbXk-%%XsN?#~ zR|K1drHSkdG|Ot`&a6vBM(Rf16cP!vKhQ9KfYop~yqtLz#;%Fmqy81DPK!aYDga>M zsThoLKh&4tYl{cH%EEejMw-*6djm`B-xoC;{rIAX!q-6P)s)p)ymq9Q5ih96`Y%XL zFkOa_i}nZagM5^7ykY8u1S=Sva%Q^hS>H7!1cWbd%QbPG26vG?s3ZpfM%2V(?co4{ z)d0iE^IYIZ#$|viUkaZ=uUT#ODotu%pk<-?52C9RQet!}+BUV+z35F1can(SlHdxgf8tatBrPuTNt958fGpC`u*1m#yc-Df|rkCvf3M;<)tqju41{_D?(&YpecDEx5o7k_1#R>-}%4#dqm1q zY1N?eoBJj0<2mTTs$=_u;#(U?=VD0AoKN05F}kg8NyuPVvU6aM34dSGb5Qb9Z?{qS zng~6%#Qdc+U52KB>fd7X9mV7IsiNcidpjd%5!`P-2j}|puR?gfLNupQs<|@>NfRmEjf1Sj^3DI^y9wh0n}agqXdg>d%?-pxIRIKmAbtnQxnp z@zwEX_E_D)Z|H>)c_NI_co-=j#uoG2unFKB60!7;5jQ;}-DKAHJu{D0S%n@=_nlq+ zEjZxFxPRh9qi0iAVg1nbeKZlJAF2P=8*nB6oy0n|!fPTDS66Uk8b;7R&OcYNQEv@jI#;S$_CRh* zyF~2vjpc1eNRWNL{$LV=a3~4m`(XZ+yj4u>|E7$e`SlgZvu9b7G3Gxz$Dx51hz?t~ z%VfsUOW#F2t??+h<#==V^PVMN0uITAWA^KyH?PHU{Z6M@yHxq$_F3uNVz8m^){R@g z8^D+*{O51^ip_Ywu-ozcs%`Hq#`*TASSGnr3F|#84|V)xJf64ZjOv;2S6bm|_axoc9qrQ4 z7(XAzof@yZ&Wa&IoU+<+e;z!rneyi-ohmAyB-zJJXxRJe_~qSoKTZu-cobj!taLOY zEZUz8{IyN5E;;-~^u#{vM-5#89t%|<5R`yI7n5jS1U+<$Kbu<+YqpwYiswsIrJ@V_ z^S0Dzs{Yfp`&*If{iuL+6B>+k=mXq=dsts3c)Z*b1DL@V z=`tC-!_u8`19VaaUFPcFaBOG(kUyT6@e@KSipSEf>SRXER`wJ7Cz^2cubdL|14~_zZ5r zCbKsbe@?{2_;&0MYf`a({uJ39JWt|$BE<7Ahs0Bv&uyZIzY~s_L(R@a7``o3Tx#hyX{yNw8xhot3s!QX1O014QAYo*EC(HH8(CE}z+(D3F zlllclNX!i5)AAKDX8&X1`NEMjp$=1gK8f{%zKLdP_sN@W?vI>S$Mt+5gcdvuc^mNC zRpr1~#Zo-Mnd)siW-#a(399}nMd5WOeQY7nu)FDURo=dEd;ENrMWVI3|I@WMluz;l(Q9|JpvABJZ&PF9M0Qk!-kxE%~X$|(K>iBfs%@O(kq>A4Z( z`OrV%h83Rg>b6wAN{8%T>Eya(@nHNj=qNU=R@Dv+-i5{c=C|XUKT6`svs=(2`IEJ-s0E z$w&#*;nTH=-gWncz3^4ALj$^wFRm~M4aj&1e^8Z5fTA0{aV?efod; zA<-WGIwt1NJ);>&)nA&r*%bT#Oq_4A|L<3_3{9#*shS%Oztsp;wFeJJ?UfBB9(*lR zCE?$FP16^HY8f^lTzq!ZCV<=hNPG_^NenMi^1h?*ne!< zAJTL9XripVZIl!d@QpDMRMUm+ZSVm%#S_*NJSWS-s%#n)6#rEA z_S8Dn%pU6esccm8(6lf)x$Ua(&6ijsia(x@um8(e`j+v6Iv(<@!TAd32P$9T`Z$)} z6_2^RoCs%cnCtEQ3_r%sB}{a`bu+vo1XPo;2lQBK!WZnJ!&3o9i$a#bh{zsKds240 zfx^f9S5f&2=Ueap@=4zII3C_l9dW+G{DrDOEr8!XDx`Z$K#E5Vu^(Va{UUso&jnQ( z_70Jxay0(pT2uZ%zD1AcM@}=kp1x^laDKFN7=^D%qQ3v~iLOt)2_w+4asMgt;CI&E5>=@h{si@)^u@9{i9d^;Sr3ea zp1|qQ#M z+7>*Z#Bhg5!F~{qZ8<6!u5{R5KK%Ee526&U(L1L$!rCw3MDfS|d}GRMrh$mYvy4X# zMTq8y^9l9`j{a*1Z6gX7+6C+*hHZiti{JkGj&XN*GW-d(;|w&kS#%^h52B zhk2{1e5GG@JwlH2Py3>6#yH>3QBP>V{5w}bmPcuc%49Z7FKV%B*rZni0bZt`cIv=j zQo-VqXMJma`Y2ON{RH2VR?HsVvnYSw)y_5F`e3+Vd_L0D6`OFr8u$Oo_HG^`cBjTk zc?*#}yI(}#FIowzjo3JGtB#uDHBTYIF~nsg$cA*nx0L$=!1d{Ax)`L9=3|DRm%x}g zz3_KD_!FuS2T}E5acfrMd?lJI;CP=mW@CTw^G(3#19(6EfdA71pAHI~+4d!7R0J$- z8*46`4QhRiHt559z&g@v(#^Q4*%MW=cNbX!pz;J&gx>Ff;?ib~gwa&A%pxMYwnP$>!ABtBp|n^$}X5`$mn*C;0xB;raLu=PT@=L3qC7e1%rk zcZ6zJ|5!5mq^t9tujSTi(2Se_&$<>#&a_nrJeuaVu*vY+YgMu0bdqa**Q6V3OY&}e zXdJTBzwn5{r}SyCIt%N^us%o8fbZ{4dQvfgtR2ZXZxSJ0j}p*7$}`dwKY9=8+&O*e)~Sm(?>>C~`Rn%^cOU18>%IkAEL9TZ7tC_bB_yeI+w4WxZ<70U7tqBvl_iObq;R2Gh@kPjt!kH z&Rd0qPnebEND04O@o{eWjGWSC3nn|TJrap&mWsTx*-_KzFcQ>&H2Zh*QqqEzI}N>$D(*Ek;{L% zu4*h(EBdC9;qTYnB=v3Xf&KC=?(+y|)i>_Vmi%+Qsiuk+WyQ z?+6c<{$BY>F2~#7@BiwsN?F$6Txre1*GFxSXxs2@Icy;rctNxSFN1nRyv6 zB7Vn8SzY_(HS0>th4!t^nJ;R7epov!fPsbgxleOk~ zQ?XfoTCC%npw#3hUOTf>SBnl^)7|E zTo-$(hb>;2G$C~Esy(TtTeNOS8U+ZrB+9a`lBfzc_-H5hmUW*b$8P>p&okI;AGu89 zD$?1m^2&;xDQI0#=)@zRwr-c5_+Hj@qxZIyUoV*6mc*qo)lJL>CPM~KS3j3^P6$uHq2->54Z0pVnl71_Z$6wjf78RKuMVEPlG`xTIi|+czewLJ@AKF1Z$Er``r_^N zJCC>RKeKYn;l=Cs&sx5tZR)D@>Z#EMJ)zkh6`c#pJLaFhbo=iqw zE!k%1op)dU-AAC`luCm9f*Dxe9>28C?_{6c!{72fUtc`Gd1J?>#pOAv;a(ng`dZ>5 z+^yOdfg!>4%+tj&B;($etIsFhG7w>X(4CWPu(v#-PhHB0*L=$mN(L*PIvUuefR5nrObYCuGWJk!Omk za;;w`&Z^50%JT5lb!N9+vcjERFX&0udzR0CA1H^~z3p9)x-lkiVQR^_Yx8O!&xv>P z&a}TBs$#zXiICH^+4DPs&rUFLDC*XhseRycCJ_)J-cNCuXx;oYl=$#i_Jm>?xj|4{$bBO zZO68Z3(KclmdX9^IvuWIxQMgwwq9jV?YXY?buy=RS2tX0X|u>X>Ce9Rlz)BGmjd;3 z=L4jI#E*YuaeO^>j@g?(g2&4>N;T63TJFdEV9nIKe=G9LuIyPX51(yF%s*PlJyp%p z&GGuCJ*G>{3#*#DoYy&C_@|xwZ+*M;iX9>|Sapva7WcScu0FM4M&yO96+8YG1SN(T zaL?*&|IM#H_0ayTx3cUG0v(H1bn^CkZ`gP-b;tkE%r!naG785hp6Y8+_-r>l_eft~ zEL+*$oBXHeDSTV8$?zbXy!2DAIR-mL1twHaZb+FF(fMaZ?#=96ZsVkDQGAzw%3AL$ za0 j`PXc@^YNn4A$NXnuKePU3XVU4`GdjJ)z4*}Q$iB}PRu>p literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/switch_camera.png b/node_modules/@tencentcloud/call-uikit-wechat/static/switch_camera.png new file mode 100644 index 0000000000000000000000000000000000000000..ecf21f05ff6e27fe986b8625ebf15e63ca5f9652 GIT binary patch literal 799 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!ssnsNT>t<74`c#K`h((M?^gls z)+h<`3pQrZXVI1v){y0X@A>=n+3nTNin~J&v{;*cx!PAA=WDNW_t4_G4VjOtayJ6? zFll?bIEF+VUON3{(P{&pR{uQ=d?Fk-Z>wcqe){R3f5q`5B|Q_lt~_^FJNK!#PbY<2 z+s){r?(+ z>=KQVLT$_{Ggh{+rOa5{!?Y){@!qipp6)5F4J_PKc^KKcQ)?PTB6JjO9lGo_N*f%R zrY&deX}oTBK|A#jqlw$CHO>dBnkQ~yy}+1rd*Zef4zUH6%$Ll0A z)e@;#!SU(U%D=Aup>j4t5>_YJ4^DRbw2GCf)c@{W&F@HO7FzsQD-fLloH<=Dx zuFPc&Uf=&!GCzo#z`*LrTsO`aH8&nyY6c|m{*!_Mg-f)Zg!zWpW<>mSdw0RSB zWG=qkt#8j@ev4`H5$T3~tM*@f>7hRH=CRe=IseN&d^00A=Y~q%-zy>q)HWu1Rb~hO zcq8UI{n8}Or!6cZ*A6dJpK^|o(L>>85Sw3VrJZ=c)sD*yol}(<-*V5f+f|kk&)L8g z9c8U{=i0lQ??ktm9A>z+J3EejcLIZ2&g;W{+t%y<{8*$B(I6$O6XTs0HA_x5_o~SP zDcM}@zt^{|V?X};Q?u)d8{BShMAd&y60JVly*J}nTuh|qEAPZ8g4&-HwDSoVsq#Ipy@wbM5*&&m%_dvktQ zTiJvOH!^=QFfgz4ba4#HxOaBe%d$rXJgu%vB<4(D-6W83gL|p<`~M})jg~69ZQhFM z7xbe}{4ElVF3SmK=8ivp*nv}c0+S*~nbeFVl2b@%(;1ft!<({XvxPSX zv4mugPZ08GJD>b&cZ$uPc%j|n6nxlU^<*dN^&%6>pXRWnd)VA&6ee;4nwyCjai(T=VqqdpSpZ zWcUmYOki@7@!?93?u+~V?DOj)?c<9%nQolYej$0r<=IlJ=|(4cm^6frILaBdS9Wgr zEzQVb_-KK8O5V;-{4W(5)R<&;oIjRc88E{va$YRM2HpdXMoCIx^Hq;d`(V|~z+>T2 zCR=gWs${*+`Oi}WW;kdH9clFR*m;&~w!8v^BCExTplK$SLSjxXbJ7Bgc^TN>#hj?L zX8QGP<_VeC8O}?@Y&$QmHjA!1V=`6olKdO zNlIRvG*#g8=Y&VQ{(gUZd4@^2q{Rah5tBu}QBEo$OENdkcDM7rpt$*AVsg>{V*5EW zD|TgF=s#e1Gj^GdTU-hs^P;;)xMe3#K6qWrH#~lBxX6Jj`_eVpaZgqlPrkpKVb}4O zzt8f$xm@nu_l_~(TDXQY|8k22sd+3t=l8LEV(0tuV6%SXHqLL0`cHlrU%vjk-rkPS zD_Dr zyEH%G%HE?v-_-)|-j4ZSx%iyR_qMgij^EJv`?u`<lr*<{an^LB{Ts5h9_q3 literal 0 HcmV?d00001 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/static/trans.png b/node_modules/@tencentcloud/call-uikit-wechat/static/trans.png new file mode 100644 index 0000000000000000000000000000000000000000..7a3cfb56a9bf099e4c37a555f643efa9b2bff32d GIT binary patch literal 714 zcmeAS@N?(olHy`uVBq!ia0vp^7C@}R!3-o{`*5BCQu70RLR^9L|3M76$}4vOooG@L z^$#+}jrq?ks31OmyIw6aDq$>Ato)BMG64XZJ424pvv@|8?zXSEa9&xz5_9 zQzwO+u}CZtY+ztuT;}QG7~*k!Zs_Z(CIcSUK$fWs8!Bc$`ulEK^u7N#r)?3iOK^Sr z^YFsIew>z`S$kUVPg~f!mATs6y@H`(cHai}j&*Gp`aO1D3Gln6!K2=Fx7Z|q)f92z zspUtPbyqL`lr-%Oi@9&BrbC7gx805n9&?u@Tbnu+9CPcl)8kRCRk*t?t0kezl{r!2 zCr{=gF`-{|+f0@++!mXC^N0T9I-!o!Ou*-n$f}f_@9di@ zJ0;KR+KBdPo>nd6eO+=cO77e@!_6@XD<)6=uzhb&>Fbg^?|IE0cIYe%;=HnH4@1 4) { + wx.showToast({ + icon: 'none', + title: '您当前网络不佳', + }); + } + data.playerList.map((item) => { + if (item.netStatus.netQualityLevel > 4) { + const name = data.playerList.length > 1 ? item.nick : '对方'; + wx.showToast({ + icon: 'none', + title: `${name}当前网络不佳`, + }); + } + return item; + }); + }, + // 用户拒绝 + handleInviteeReject(event) { + if (this.data.isGroup) { + this.deleteUsers(this.data.allUsers, event.data.invitee); + } else { + this.data.callingBell && this.data.callingBell.stop(); + } + wx.showToast({ + title: `${this.getUserNickName(event.data.invitee)}已拒绝`, + }); + }, + // 用户不在线 + handleNoResponse(event) { + if (this.data.isGroup) { + this.deleteUsers(this.data.allUsers, event.data.timeoutUserList); + } else { + this.data.callingBell && this.data.callingBell.stop(); + } + wx.showToast({ + icon: 'none', + title: `${event.data.timeoutUserList}无应答`, + }); + }, + // 获取用户昵称 + getUserNickName(userId) { + const { remoteUsers } = this.data; + const userObj = remoteUsers.find(item => item.userID === userId); + return userObj.nick ? userObj.nick : userObj.userID; + }, + // 用户忙线 + handleLineBusy(event) { + if (this.data.isGroup) { + this.deleteUsers(this.data.allUsers, event.data.invitee); + } else { + this.data.callingBell && this.data.callingBell.stop(); + } + this.showToast(this.getUserNickName(event.data.invitee)); + }, + showToast(event) { + this.setData({ + showToatTime: this.data.showToatTime + THROTTLE_TIME, + }); + setTimeout(() => { + wx.showToast({ + title: `${event}忙线中`, + }); + }, this.data.showToatTime); + }, + // 用户取消 + handleCallingCancel(event) { + this.data.callingBell && this.data.callingBell.stop(); + if (event.data.invitee !== this.data.config.userID) { + wx.showToast({ + title: `${this.getUserNickName(event.data.invitee)}取消通话`, + }); + } + this.reset(); + }, + // 通话超时未应答 + handleCallingTimeout(event) { + if (this.data.isGroup) { + // 若是自身未应答 则不弹窗 + if (this.data.config.userID === event.data.timeoutUserList[0]) { + this.reset(); + return; + } + const newList = this.deleteUsers(this.data.allUsers, event.data.timeoutUserList); + this.setData({ + allUsers: newList, + }); + } else { + this.data.callingBell && this.data.callingBell.stop(); + } + if (this.data.playerList.length === 0) { + this.reset(); + } + wx.showToast({ + title: `${event.data.timeoutUserList[0]}超时无应答`, + }); + }, + handleCallingUser(userIDList) { + const remoteUsers = [...this.data.remoteUsers]; + const userProfile = remoteUsers.filter(item => userIDList.some(userItem => `${userItem}` === item.userID)); + this.setData({ + remoteUsers: remoteUsers.filter(item => userIDList.some(userItem => userItem !== item.userID)), + }); + let nick = ''; + for (let i = 0; i < userProfile.length; i++) { + nick += `${userProfile[i].nick}、`; + } + return nick.slice(0, -1); + }, + // 通话结束 + handleCallingEnd(event) { + wx.showToast({ + title: '通话结束', + duration: 800, + }); + this.reset(); + }, + // SDK Ready 回调 + handleSDKReady() { + // 呼叫需在sdk ready之后 + }, + // 被踢下线 + handleKickedOut() { + wx.showToast({ + title: '您已被踢下线', + }); + }, + // 切换通话模式 + handleCallMode(event) { + this.data.config.type = event.data.type; + this.setSoundMode(AUDIO_PLAYBACK_DEVICE.EAR); + this.setData({ + config: this.data.config, + }); + }, + handleError(event) { + const { code, message } = event.data || {}; + console.warn(`${PREFIX} errorCode: ${code}, errorMessage: ${message}`); + }, + // 删除用户列表操作 + deleteUsers(usersList, userID) { + // 若userID不是数组,则将其转换为数组 + if (!Array.isArray(userID)) { + userID = [userID]; + } + const list = usersList.filter(item => !userID.includes(item.userID)); + this.setData({ + allUsers: list, + }); + }, + // 增加用户列表操作 + addUsers(usersList, userID) { + // 若userID不是数组,则将其转换为数组 + if (!Array.isArray(userID)) { + userID = [userID]; + } + const newList = [...usersList, ...userID]; + return newList; + }, + // 增加 tsignaling 事件监听 + _addTSignalingEvent() { + wx.$TUICallEngine.on(EVENT.ERROR, this.handleError, this); + // 被邀请通话 + wx.$TUICallEngine.on(EVENT.INVITED, this.handleNewInvitationReceived, this); + // 用户接听 + wx.$TUICallEngine.on(EVENT.USER_ACCEPT, this.handleUserAccept, this); + // 用户进入通话 + wx.$TUICallEngine.on(EVENT.USER_ENTER, this.handleUserEnter, this); + // 用户离开通话 + wx.$TUICallEngine.on(EVENT.USER_LEAVE, this.handleUserLeave, this); + // 用户更新数据 + wx.$TUICallEngine.on(EVENT.USER_UPDATE, this.handleUserUpdate, this); + // 用户拒绝通话 + wx.$TUICallEngine.on(EVENT.REJECT, this.handleInviteeReject, this); + // 用户无响应 + wx.$TUICallEngine.on(EVENT.NO_RESP, this.handleNoResponse, this); + // 用户忙线 + wx.$TUICallEngine.on(EVENT.LINE_BUSY, this.handleLineBusy, this); + // 通话被取消 + wx.$TUICallEngine.on(EVENT.CALLING_CANCEL, this.handleCallingCancel, this); + // 通话超时未应答 + wx.$TUICallEngine.on(EVENT.CALLING_TIMEOUT, this.handleCallingTimeout, this); + // 通话结束 + wx.$TUICallEngine.on(EVENT.CALL_END, this.handleCallingEnd, this); + // SDK Ready 回调 + wx.$TUICallEngine.on(EVENT.SDK_READY, this.handleSDKReady, this); + // 被踢下线 + wx.$TUICallEngine.on(EVENT.KICKED_OUT, this.handleKickedOut, this); + // 切换通话模式 + wx.$TUICallEngine.on(EVENT.CALL_MODE, this.handleCallMode, this); + // 自己发送消息 + wx.$TUICallEngine.on(EVENT.MESSAGE_SENT_BY_ME, this.messageSentByMe, this); + }, + // 取消 tsignaling 事件监听 + _removeTSignalingEvent() { + wx.$TUICallEngine.off(EVENT.ERROR, this.handleError); + // 被邀请通话 + wx.$TUICallEngine.off(EVENT.INVITED, this.handleNewInvitationReceived); + // 用户接听 + wx.$TUICallEngine.off(EVENT.USER_ACCEPT, this.handleUserAccept); + // 用户进入通话 + wx.$TUICallEngine.off(EVENT.USER_ENTER, this.handleUserEnter); + // 用户离开通话 + wx.$TUICallEngine.off(EVENT.USER_LEAVE, this.handleUserLeave); + // 用户更新数据 + wx.$TUICallEngine.off(EVENT.USER_UPDATE, this.handleUserUpdate); + // 用户拒绝通话 + wx.$TUICallEngine.off(EVENT.REJECT, this.handleInviteeReject); + // 用户无响应 + wx.$TUICallEngine.off(EVENT.NO_RESP, this.handleNoResponse); + // 用户忙线 + wx.$TUICallEngine.off(EVENT.LINE_BUSY, this.handleLineBusy); + // 通话被取消 + wx.$TUICallEngine.off(EVENT.CALLING_CANCEL, this.handleCallingCancel); + // 通话超时未应答 + wx.$TUICallEngine.off(EVENT.CALLING_TIMEOUT, this.handleCallingTimeout); + // 通话结束 + wx.$TUICallEngine.off(EVENT.CALL_END, this.handleCallingEnd); + // SDK Ready 回调 + wx.$TUICallEngine.off(EVENT.SDK_READY, this.handleSDKReady); + // 被踢下线 + wx.$TUICallEngine.off(EVENT.KICKED_OUT, this.handleKickedOut); + // 切换通话模式 + wx.$TUICallEngine.off(EVENT.CALL_MODE, this.handleCallMode); + // 自己发送消息 + wx.$TUICallEngine.off(EVENT.MESSAGE_SENT_BY_ME, this.messageSentByMe); + }, + /** + * C2C邀请通话,被邀请方会收到的回调 + * 如果当前处于通话中,可以调用该函数以邀请第三方进入通话 + * @param {Object} params 呼叫参数 + * @param {String} params.userID 被邀请方 + * @param {Number} params.type 0-未知,1-语音通话,2-视频通话 + * @param {Number} params.roomID 数字房间号, 范围 1~2147483647 + * @param {String=} params.userData 扩展字段: 用于在邀请信令中增加扩展信息 + */ + call: throttle(async function (params) { + this.initialUI(); + if (this.data.callStatus !== STATUS.IDLE) { + return; + } + this.checkRunPlatform(); + this.data.config.type = params.type; + // 检查设备权限 + const deviceMap = { + microphone: true, + camera: params.type === MEDIA_TYPE.VIDEO, + }; + const hasDevicePermission = await wx.$TUICallEngine.deviceCheck(deviceMap); + const callStatus = hasDevicePermission ? STATUS.CALLING : STATUS.IDLE; + this.setData({ + callStatus, + isSponsor: true, + config: this.data.config, + }); + try { + await this.getUserProfile([params.userID]); + } catch (error) { + console.warn(error); + } + wx.$TUICallEngine.call({ userID: params.userID, type: params.type, roomID: params.roomID, userData: params.userData }).then(async (res) => { + if (res) { + this.setData({ + callStatus: STATUS.CALLING, + pusher: res.pusher, + }); + this.data.callingBell.setBellSrc(INVITER_BELL_FILEPATH); + this.data.callingBell.play(); + this.setSoundMode(this.data.config.type === MEDIA_TYPE.AUDIO ? AUDIO_PLAYBACK_DEVICE.EAR : AUDIO_PLAYBACK_DEVICE.SPEAKER); + } + }) + .catch((error) => { + if (error.code === -1002) { + wx.showModal({ + icon: 'none', + title: 'error', + content: error.message, + showCancel: false, + }); + } + this.reset(); + throw new Error(error); + }); + }, THROTTLE_TIME), + /** + * IM群组邀请通话,被邀请方会收到的回调 + * 如果当前处于通话中,可以继续调用该函数继续邀请他人进入通话,同时正在通话的用户会收到的回调 + * + * @param {Object} params 呼叫参数 + * @param {Array} params.userIDList 邀请列表 + * @param {Number} params.type 1-语音通话,2-视频通话 + * @param {String} params.groupID IM群组ID + * @param {Number} params.roomID 数字房间号, 范围 1~2147483647 + * @param {String=} params.userData 扩展字段: 用于在邀请信令中增加扩展信息 + */ + groupCall: throttle(async function (params) { + // 判断是否存在groupID + if (!params.groupID) { + wx.showToast({ + title: '群ID为空', + }); + return; + } + this.initialUI(); + if (this.data.callStatus !== STATUS.IDLE) { + return; + } + this.checkRunPlatform(); + this.data.config.type = params.type; + // 检查设备权限 + const deviceMap = { + microphone: true, + camera: params.type === MEDIA_TYPE.VIDEO, + }; + const hasDevicePermission = await wx.$TUICallEngine.deviceCheck(deviceMap); + const callStatus = hasDevicePermission ? STATUS.CALLING : STATUS.IDLE; + this.setData({ + callStatus, + isSponsor: true, + isGroup: true, + sponsor: this.data.config.userID, + config: this.data.config, + }); + // 将自身的userID插入到邀请列表中,组成完整的用户信息 + const list = JSON.parse(JSON.stringify(params.userIDList)); + list.unshift(this.data.config.userID); + // 获取用户信息 + try { + await this.getUserProfile(list); + } catch (error) { + console.warn(error); + } + wx.$TUICallEngine.groupCall({ + userIDList: params.userIDList, + type: params.type, + groupID: params.groupID, + roomID: params.roomID, + userData: params.userData, + }).then(async (res) => { + if (res) { + this.data.config.type = params.type; + this.setData({ + pusher: res.pusher, + callStatus: STATUS.CALLING, + }); + this.data.callingBell.setBellSrc(INVITER_BELL_FILEPATH); + this.data.callingBell.play(); + } + }) + .catch((error) => { + if (error.code === -1002) { + wx.showModal({ + icon: 'none', + title: 'error', + content: error.message, + showCancel: false, + }); + } + this.reset(); + throw new Error(error); + }); + }, THROTTLE_TIME), + /** + * 当您作为被邀请方收到 {@link TRTCCallingDelegate#onInvited } 的回调时,可以调用该函数接听来电 + */ + accept: throttle(async function () { + wx.$TUICallEngine.accept().then((res) => { + if (res) { + this.data.callingBell && this.data.callingBell.stop(); + this.setData({ + pusher: res.pusher, + callStatus: STATUS.CONNECTED, + }); + // 多人通话需要对自身位置进行修正,将其放到首位 + if (this.data.isGroup) { + const newList = this.data.allUsers; + for (let i = 0;i < newList.length;i++) { + if (newList[i].userID === this.data.config.userID) { + newList[i].isEnter = true; + [newList[i], newList[0]] = [newList[0], newList[i]]; + } + }; + this.setData({ + allUsers: newList, + }); + } + } + }) + .catch((error) => { + console.error(error); + this.reset(); + }); + }, THROTTLE_TIME), + /** + * 当您作为被邀请方收到的回调时,可以调用该函数拒绝来电 + */ + reject: throttle(async function () { + wx.$TUICallEngine.reject().then((res) => { + this.data.callingBell && this.data.callingBell.stop(); + this.reset(); + }) + .catch((error) => { + console.error(error); + this.reset(); + }); + }, THROTTLE_TIME), + messageSentByMe(event) { + const message = event.data.data; + this.triggerEvent('sendMessage', { + message, + }); + }, + // xml层,是否开启扬声器 + setSoundMode(type) { + this.setData({ + soundMode: wx.$TUICallEngine.selectAudioPlaybackDevice(type), + }); + }, + // xml层,挂断 + hangup: throttle(async function () { + try { + await wx.$TUICallEngine.hangup(); + this.reset(); + } catch (error) { + console.error(error); + this.reset(); + } + }, THROTTLE_TIME), + // 切换大小屏 (仅支持1v1聊天) + toggleViewSize(event) { + this.setData({ + // FIXME _toggleViewSize 不应该为TUICallEngine的方法 后续修改 + screen: wx.$TUICallEngine._toggleViewSize(event), + }); + }, + // 数据重置 + reset() { + if (shouldHideTabBar) { + wx.showTabBar(); + } + this.setData({ + callStatus: STATUS.IDLE, + isSponsor: false, + isGroup: false, + soundMode: AUDIO_PLAYBACK_DEVICE.SPEAKER, + pusher: {}, // TRTC 本地流 + playerList: [], // TRTC 远端流 + showToatTime: 0, + }); + }, + // 呼叫中的事件处理 + async handleCallingEvent(data) { + const { name, event } = data.detail; + switch (name) { + case 'accept': + this.setSoundMode(this.data.config.type === MEDIA_TYPE.AUDIO ? AUDIO_PLAYBACK_DEVICE.EAR : AUDIO_PLAYBACK_DEVICE.SPEAKER); + this.accept(); + break; + case 'hangup': + await this.hangup(); + break; + case 'reject': + await this.reject(); + break; + case 'toggleSwitchCamera': + wx.$TUICallEngine.switchCamera(); + break; + case 'switchAudioCall': + wx.$TUICallEngine.switchCallMediaType(MEDIA_TYPE.AUDIO).then((res) => { + this.data.config.type = MEDIA_TYPE.AUDIO; + this.setSoundMode(AUDIO_PLAYBACK_DEVICE.EAR); + this.setData({ + config: this.data.config, + }); + }); + break; + case 'pusherErrorHandler': + this.pusherErrorHandler(event.errMsg); + break; + default: + break; + } + }, + // 通话中的事件处理 + async handleConnectedEvent(data) { + const { name, event } = data.detail; + switch (name) { + case 'toggleViewSize': + this.toggleViewSize(event); + break; + case 'pusherNetStatus': + wx.$TUICallEngine._pusherNetStatus(event); + break; + case 'playNetStatus': + wx.$TUICallEngine._playNetStatus(event); + break; + case 'pusherStateChangeHandler': + wx.$TUICallEngine._pusherStateChangeHandler(event); + break; + case 'pusherAudioVolumeNotify': + wx.$TUICallEngine._pusherAudioVolumeNotify(event); + break; + case 'playerStateChange': + wx.$TUICallEngine._playerStateChange(event); + break; + case 'playerAudioVolumeNotify': + wx.$TUICallEngine._playerAudioVolumeNotify(event); + break; + case 'pusherAudioHandler': + wx.$TUICallEngine._pusherAudioHandler(event); + break; + case 'hangup': + await this.hangup(); + break; + case 'toggleSoundMode': + this.setSoundMode(this.data.soundMode === AUDIO_PLAYBACK_DEVICE.EAR ? AUDIO_PLAYBACK_DEVICE.SPEAKER : AUDIO_PLAYBACK_DEVICE.EAR); + break; + case 'pusherVideoHandler': + wx.$TUICallEngine._pusherVideoHandler(event); + break; + case 'toggleSwitchCamera': + wx.$TUICallEngine.switchCamera(event); + break; + case 'switchAudioCall': + wx.$TUICallEngine.switchCallMediaType(MEDIA_TYPE.AUDIO).then((res) => { + this.data.config.type = MEDIA_TYPE.AUDIO; + this.setData({ + config: this.data.config, + }); + this.setSoundMode(AUDIO_PLAYBACK_DEVICE.EAR); + }); + break; + case 'pusherErrorHandler': + this.pusherErrorHandler(event.errMsg); + break; + default: + break; + } + }, + // 处理 pusher 中的异常问题 + pusherErrorHandler(code) { + switch (code) { + case 'fail:access denied': + wx.showModal({ + icon: 'none', + title: '权限提示', + content: '当前小程序 appid 不具备 的使用权限,您将无法正常使用实时通话能力,请使用企业小程序账号申请权限后再进行开发体验', + showCancel: false, + }); + break; + + default: + break; + } + }, + // 设置用户的头像、昵称 + setSelfInfo(nickName, avatar) { + return wx.$TUICallEngine.setSelfInfo(nickName, avatar); + }, + // 获取用户资料 + async getUserProfile(userList) { + const imResponse = await this.getTim().getUserProfile({ userIDList: userList }); + // 修正用户资料 + this.modifyUser(imResponse.data); + }, + // 修正用户资料 + modifyUser(userIDList) { + const { sponsor } = this.data; + if (this.data.isGroup) { + // 多人通话需要将呼叫者放到第一位 isEnter的作用是区分用户是否进入房间 + for (let i = 0;i < userIDList.length;i++) { + // 主叫方的标志位设置成true + if (userIDList[i].userID === sponsor) { + userIDList[i].isEnter = true; + // 对主叫方位置进行修正 将其放到首位 + [userIDList[i], userIDList[0]] = [userIDList[0], userIDList[i]]; + } else { + // 其他用户默认未进入房间 设置为false + userIDList[i].isEnter = false; + } + } + this.setData({ + allUsers: userIDList, + }); + } + this.setData({ + remoteUsers: userIDList, + }); + }, + // 获取 tim 实例 + getTim() { + return wx.$TUICallEngine.getTim(); + }, + + // 设置日志级别,低于 level 的日志将不会输出 + setLogLevel(leave) { + wx.$TUICallEngine.setLogLevel(leave); + }, + + // 初始化TUICallKit + async init(params) { + if (tuiCallInitReady) return; + tuiCallInitReady = true; + // 关于 tabBar 页面的特化逻辑 + this.handleTabBarLogic(); + // 兼容从config和init中传值 + const { sdkAppID, tim, userID, userSig, SDKAppID } = { ...this.data.config, ...params }; + this.setData({ + ownUserId: userID, + config: { + ...this.data.config, + sdkAppID: sdkAppID || SDKAppID, + userID, + userSig, + }, + }); + // 取消全局监听 + if (wx.$globalCallSign) { + wx.$CallManagerInstance.removeEngineInvite(); + } + this.setUniBellFilePath(); + if (!this.data.callingBell) { // 创建铃声实例 + const bellContext = new BellContext(); + this.setData({ + callingBell: bellContext, + }); + } + if (!wx.$TUICallEngine) { + wx.$TUICallEngine = TUICallEngine.createInstance({ + tim, + sdkAppID: sdkAppID || SDKAppID, + }); + /* + _addTSignalingEvent 需要在 init 之前,回调才能正常触发 + tap:https://tapd.woa.com/20396022/prong/stories/view/1020396022885781069 + */ + this._addTSignalingEvent(); + try { + await wx.$TUICallEngine.init({ + userID, + userSig, + }); + } catch (error) { + tuiCallInitReady = false; + throw new Error(error); + } + // 用于全局监听进入 TUICallKit 页面中绑定上当前页面的监听。 + } else { + this._addTSignalingEvent(); + } + console.log(`${PREFIX} init Ready!`); + }, + // 销毁 TUICallEngine + async destroyed() { + if (!wx.$TUICallEngine || !tuiCallInitReady) return; + tuiCallInitReady = false; + this._removeTSignalingEvent(); + // 全局监听模式下,离开页面需要重新绑定全局监听,但不卸载 TUICallEngine + if (wx.$globalCallSign) { + // 处理异常退出 + if (this.getCallStatus() !== STATUS.IDLE) { + await this.handleExceptionExit(); + } + wx.$CallManagerInstance.addEngineInvite(); + } else { + // 非全局监听模式下,离开页面需要卸载 TUICallEngine + wx.$TUICallEngine.destroyInstance(); + wx.$TUICallEngine = null; + } + if (this.data.callingBell) { + this.data.callingBell.destroyInstance(); + this.setData({ + callingBell: null, + }); + } + this.reset(); + console.log(`${PREFIX} destroyed OK!`); + }, + + /* + 以下两种情况需要全部符合,则需要隐藏 tabBar + 1.用户当前处于 tabBar 页面, isTabBar 为 true + 2.用户没有使用了自定义 tabBar, isCustomTabBar 为 fales + */ + handleTabBarLogic() { + const isTabBar = isTabBarPage(); + const isCustomTabBar = tabBarConfig().custom || false; + shouldHideTabBar = isTabBar && !isCustomTabBar; + }, + + // 检测运行时环境 + checkRunPlatform() { + const systemInfo = wx.getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + // 当前运行在微信开发者工具里 + wx.showModal({ + icon: 'none', + title: '运行环境提醒', + content: '微信开发者工具不支持原生推拉流组件(即 标签),请使用真机调试或者扫码预览。', + showCancel: false, + }); + } + }, + // 运行在 uniapp 小程序需要修改铃声地址 + setUniBellFilePath() { + // 防止用户退出再进入,在地址前重复拼接 + if (INVITER_BELL_FILEPATH.indexOf('wxcomponents') !== -1) { + return; + } + // comType 用于 Vue2 的判断,wxcomponents 用于 Vue3 的判断 + if (this.dataset.comType === 'wx' || this.is.indexOf('wxcomponents') !== -1) { + INVITER_BELL_FILEPATH = `wxcomponents/${INVITER_BELL_FILEPATH}`; + INVITEE_BELL_FILEPATH = `wxcomponents/${INVITEE_BELL_FILEPATH}`; + } + }, + // 自定义铃声 + setCallingBell(filePath) { + // 如需恢复默认铃声,filePath 传空即可 + this.setData({ + bellFilePath: filePath, + }); + }, + // 处理用户异常退出的情况,处理了右滑退出,以及返回退出的情况。 + async handleExceptionExit() { + // 在呼叫状态下,被叫调用 reject,主叫调用 hangup + if (this.getCallStatus() === STATUS.CALLING) { + if (this.isSponsor()) { + await this.hangup(); + } else { + await this.reject(); + } + } + // 在通话状态下,统一调用 hangup 接口 + if (this.getCallStatus() === STATUS.CONNECTED) { + await this.hangup(); + } + }, + + getCallStatus() { + return this.data.callStatus; + }, + + isSponsor() { + return this.data.isSponsor; + }, + }, + /** + * 生命周期方法 + */ + lifetimes: { + created() { + this.reset(); + }, + attached() { + + }, + ready() { + console.log(`${PREFIX} SDK Version: ${version}`); + }, + async detached() { + await this.destroyed(); + }, + error() { + }, + }, + pageLifetimes: { + async show() { + if (this.data.config.sdkAppID) { + await this.init(this.data.config); + } + }, + async hide() { + if (this.getCallStatus() === STATUS.IDLE) { + await this.destroyed(); + } + }, + resize() { + }, + }, +}); diff --git a/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.json b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.json new file mode 100644 index 0000000..c58337a --- /dev/null +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.json @@ -0,0 +1,11 @@ +{ + "component": true, + "usingComponents": { + "TUI-Calling": "./component/calling/calling", + "TUI-Connected": "./component/connected/connected", + "TUI-groupCalling": "./component/groupCalling/groupCalling", + "TUI-groupConnected": "./component/groupConnected/groupConnected" + }, + "navigationStyle": "custom", + "disableScroll": true +} \ No newline at end of file diff --git a/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxml b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxml new file mode 100644 index 0000000..6a62d72 --- /dev/null +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxml @@ -0,0 +1,52 @@ + + + + + + + + + + + + diff --git a/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxss b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxss new file mode 100644 index 0000000..e8d7140 --- /dev/null +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/TUICallKit.wxss @@ -0,0 +1,25 @@ +.TRTCCaling-container { + width: 100vw; + height: 100vh; + overflow: hidden; + /* background-image: url(https://mc.qcloudimg.com/static/img/7da57e0050d308e2e1b1e31afbc42929/bg.png); */ + margin: 0; +} +.hidden { + display: none; +} +.TUICalling { + position: fixed; + width: 100vw; + height: 100vh; + z-index: 10; + background: #ffffff; +} +.show { + top: 0; + left: 0; +} + +.groupConnected{ + background-color: #2c292923; +} \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.js b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.js similarity index 52% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.js rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.js index 54b3f6b..c8fcfbc 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.js +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.js @@ -25,7 +25,7 @@ Component({ * 组件的初始数据 */ data: { - isClick: true, + }, /** @@ -49,55 +49,7 @@ Component({ * 组件的方法列表 */ methods: { - async handleCheckAuthor(e) { - const type =this.data.callType; - wx.getSetting({ - success: async (res) => { - const isRecord = res.authSetting['scope.record']; - const isCamera = res.authSetting['scope.camera']; - if (!isRecord && type === 1) { - const title = '麦克风权限授权'; - const content = '使用语音通话,需要在设置中对麦克风进行授权允许'; - try { - await wx.authorize({ scope: 'scope.record' }); - this.accept(e); - } catch (e) { - this.handleShowModal(title, content); - } - return; - } - if ((!isRecord || !isCamera) && type === 2) { - const title = '麦克风、摄像头权限授权'; - const content = '使用视频通话,需要在设置中对麦克风、摄像头进行授权允许'; - try { - await wx.authorize({ scope: 'scope.record' }); - await wx.authorize({ scope: 'scope.camera' }); - this.accept(e); - } catch (e) { - this.handleShowModal(title, content); - } - return; - } - this.accept(e); - }, - }); - }, - handleShowModal(title, content) { - wx.showModal({ - title, - content, - confirmText: '去设置', - success: (res) => { - if (res.confirm) { - wx.openSetting(); - } - }, - }); - }, accept(event) { - this.setData({ - isClick: false, - }); const data = { name: 'accept', event, @@ -144,5 +96,13 @@ Component({ }; this.triggerEvent('callingEvent', data); }, + pusherErrorHandler(event) { + const { detail = '' } = event; + const data = { + name: 'pusherErrorHandler', + event: detail, + }; + this.triggerEvent('callingEvent', data); + }, }, }); diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.json b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.json similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.json rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.json diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.wxml b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.wxml similarity index 90% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.wxml rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.wxml index 9514ca3..f5981ca 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.wxml +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/calling/calling.wxml @@ -1,5 +1,6 @@ - - + + + - - + + @@ -65,7 +64,7 @@ 挂断 - + 接听 @@ -75,7 +74,7 @@ - + @@ -118,7 +117,7 @@ 挂断 - + 接听 @@ -133,5 +132,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss similarity index 96% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss index b17d091..a2d6283 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupCalling/groupCalling.wxss @@ -1,3 +1,17 @@ +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + to { + transform: translateY(0); + } +} + .footer { position: absolute; bottom: 5vh; diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js similarity index 94% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js index 0575d60..4d4410b 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.js @@ -102,6 +102,14 @@ Component({ }; this.triggerEvent('connectedEvent', data); }, + pusherErrorHandler(event) { + const { detail = '' } = event; + const data = { + name: 'pusherErrorHandler', + event: detail, + }; + this.triggerEvent('connectedEvent', data); + }, playerAudioVolumeNotify(event) { const data = { name: 'playerAudioVolumeNotify', diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.json b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.json similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.json rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.json diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxml b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxml similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxml rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxml diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxss b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxss similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxss rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/component/groupConnected/groupConnected.wxss diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js similarity index 73% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js index 226f5b6..2df4d44 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.js @@ -1,3 +1,4 @@ +import { MEDIA_TYPE } from '../../utils/constants'; Page({ TUICallKit: null, data: { @@ -15,7 +16,11 @@ Page({ try { await this.TUICallKit.init(config); const event = JSON.parse(option.data); + wx.$TUICallEngine.setPusherAttributesHandler({ + enableCamera: event.data.inviteData.callType === MEDIA_TYPE.VIDEO, + }); wx.$TUICallEngine.TRTCCallingDelegate.onInvited(event.data); + wx.createLivePusherContext().startPreview(); } catch (error) { console.error(error); } diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.json b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.json similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.json rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.json diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxml b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxml similarity index 100% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxml rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxml diff --git a/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxss b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall.wxss new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue similarity index 66% rename from node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue rename to node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue index 8aa483e..e9421fd 100644 --- a/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue +++ b/node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat/TUICallKit/pages/globalCall/globalCall_uni.vue @@ -3,13 +3,18 @@ + + +``` \ No newline at end of file diff --git a/node_modules/tim-upload-plugin/index.d.ts b/node_modules/tim-upload-plugin/index.d.ts new file mode 100644 index 0000000..85e9a64 --- /dev/null +++ b/node_modules/tim-upload-plugin/index.d.ts @@ -0,0 +1,5 @@ +declare class TIMUploadPlugin { + +} + +export default TIMUploadPlugin; \ No newline at end of file diff --git a/node_modules/tim-upload-plugin/index.js b/node_modules/tim-upload-plugin/index.js new file mode 100644 index 0000000..d583a0f --- /dev/null +++ b/node_modules/tim-upload-plugin/index.js @@ -0,0 +1 @@ +var global,factory;global=this,factory=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var f="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),u="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),l="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),c="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),y="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),d="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,p=d&&"ios"===uni.getDeviceInfo().platform.toLocaleLowerCase(),g=(d&&uni.getDeviceInfo().platform.toLocaleLowerCase(),f||u||l||c||y||d),m=u?qq:l?tt:c?swan:y?my:f?wx:d?uni:{},h=function(e){if("object"!==n(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o};function v(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(h(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var b=function(){function e(){o(this,e)}return a(e,[{key:"request",value:function(e,t){var n=this,o=e.downloadUrl||"",r=(e.method||"PUT").toUpperCase(),a=e.url;if(e.qs){var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return v(e)?"":h(e)?Object.keys(e).map((function(o){var r=encodeURIComponent(o)+n;return Array.isArray(e[o])?e[o].map((function(e){return r+encodeURIComponent(e)})).join(t):r+encodeURIComponent(e[o])})).filter(Boolean).join(t):void 0}(e.qs);s&&(a+="".concat(-1===a.indexOf("?")?"?":"&").concat(s))}var i=new XMLHttpRequest;i.open(r,a,!0),i.responseType=e.dataType||"text";var f=e.headers||{};if(!v(f))for(var u in f)f.hasOwnProperty(u)&&"content-length"!==u.toLowerCase()&&"user-agent"!==u.toLowerCase()&&"origin"!==u.toLowerCase()&&"host"!==u.toLowerCase()&&i.setRequestHeader(u,f[u]);return i.onload=function(){if(200===i.status)t(null,n._xhrRes(i,n._xhrBody(i,o)));else{var e={code:i.status,message:JSON.stringify(i.responseText)};t(e,n._xhrRes(i,n._xhrBody(i)))}},i.onerror=function(e){var o=n._xhrBody(i),r={code:i.status,message:JSON.stringify(i.responseText)};o||i.statusText||0!==i.status||(e.message="CORS blocked or network error"),t(r,n._xhrRes(i,o)),r=null},e.onProgress&&i.upload&&(i.upload.onprogress=function(t){var n=t.total,o=t.loaded,r=Math.floor(100*o/n);e.onProgress({total:n,loaded:o,percent:(r>=100?100:r)/100})}),i.send(e.resources),i}},{key:"_xhrRes",value:function(e,t){var n={};return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),o=e.substr(0,t).trim().toLowerCase(),r=e.substr(t+1).trim();n[o]=r}})),{statusCode:e.status,statusMessage:e.statusText,headers:n,data:t}}},{key:"_xhrBody",value:function(e,t){return 200===e.status&&t?{location:t}:{response:e.responseText}}}]),e}(),O=["unknown","image","video","audio","log"],w=["name"],S=function(){function e(){o(this,e)}return a(e,[{key:"request",value:function(e,n){var o=this,r=e.resources,a=void 0===r?"":r,s=e.headers,f=void 0===s?{}:s,u=e.url,l=e.downloadUrl,c=void 0===l?"":l,d=u,g=null,h=c.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/),v=decodeURIComponent(h[3]),b=v.indexOf("?")>-1?v.split("?")[0]:v,S={key:e.fileKey?e.fileKey:b,success_action_status:200,"Content-Type":""},C={};if(p){var P=u.split("?sign=");if(P.length>1){var j=P[1];d="".concat(P[0],"?sign=").concat(encodeURIComponent("".concat(j))),C.sign=decodeURIComponent(j),C.signature=decodeURIComponent(j)}}var x={url:d,header:f,name:"file",filePath:a,formData:t(t({},S),C),timeout:e.timeout||3e5};if(y){var R=x;R.name,x=t(t({},i(R,w)),{},{fileName:"file",fileType:O[e.fileType]})}return(g=m.uploadFile(t(t({},x),{},{success:function(e){o._handleResponse({response:e,downloadUrl:c,callback:n})},fail:function(e){o._handleResponse({response:e,downloadUrl:c,callback:n})}}))).onProgressUpdate&&g.onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),g}},{key:"_handleResponse",value:function(e){var n=e.downloadUrl,o=e.response,r=e.callback,a=o.header,s={};if(a)for(var i in a)a.hasOwnProperty(i)&&(s[i.toLowerCase()]=a[i]);var f=+o.statusCode;200===f?r(null,{statusCode:f,headers:s,data:t(t({},o.data),{},{location:n})}):r({code:f,message:JSON.stringify(o.data)},{statusCode:f,headers:s,data:void 0})}}]),e}();return function(){function e(){o(this,e),console.log("TIMUploadPlugin.VERSION: ".concat("1.3.0")),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=g?new S:new b}return a(e,[{key:"uploadFile",value:function(e,t){var n=this;return this.httpRequest.request(e,(function(o,r){o&&n.tryCount=3e4&&(this.systemClockOffset=i-s,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}]),e}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global=global||self).TIMUploadPlugin=factory(); diff --git a/node_modules/tim-upload-plugin/package.json b/node_modules/tim-upload-plugin/package.json new file mode 100644 index 0000000..2ce9721 --- /dev/null +++ b/node_modules/tim-upload-plugin/package.json @@ -0,0 +1,13 @@ +{ + "name": "tim-upload-plugin", + "version": "1.3.0", + "description": "Tencent Cloud Upload To COS SDK for IM", + "main": "index.js", + "keywords": ["腾讯云IM", "即时通讯", "通信", "COS"], + "repository": { + "type": "git", + "url": "" + }, + "author": "Tencent Cloud Terminal R&D Center", + "license": "ISC" +} diff --git a/node_modules/tuicall-engine-wx/package.json b/node_modules/tuicall-engine-wx/package.json index 9a01d65..0bd9bd2 100644 --- a/node_modules/tuicall-engine-wx/package.json +++ b/node_modules/tuicall-engine-wx/package.json @@ -1,38 +1,8 @@ { - "_from": "tuicall-engine-wx@^1.4.1", - "_id": "tuicall-engine-wx@1.4.1", - "_inBundle": false, - "_integrity": "sha512-Nxx9G4myPhPEaqnPpCEsxoOcEyU9evj/tssXXlZ2rRsPIxXZY914ypnU3QbQhl5kq02+jHJlLgCuFHiB9QzPGg==", - "_location": "/tuicall-engine-wx", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "tuicall-engine-wx@^1.4.1", - "name": "tuicall-engine-wx", - "escapedName": "tuicall-engine-wx", - "rawSpec": "^1.4.1", - "saveSpec": null, - "fetchSpec": "^1.4.1" - }, - "_requiredBy": [ - "/@tencentcloud/call-uikit-wechat" - ], - "_resolved": "https://registry.npmmirror.com/tuicall-engine-wx/-/tuicall-engine-wx-1.4.1.tgz", - "_shasum": "8c445d39939f4b00b997da43fe8eda44d1cc90c5", - "_spec": "tuicall-engine-wx@^1.4.1", - "_where": "E:\\WeChatProjects\\test_miniprogram\\node_modules\\@tencentcloud\\call-uikit-wechat", - "author": { - "name": "Tencent Cloud Client R&D Center" - }, - "bundleDependencies": false, - "dependencies": { - "tim-wx-sdk": "^2.26.1", - "trtc-wx-sdk": "^1.1.3", - "tsignaling-wx": "^1.0.3" - }, - "deprecated": false, + "name": "tuicall-engine-wx", + "version": "1.6.0", "description": "TUICallEngine miniProgram", + "main": "tuicall-engine-wx.js", "keywords": [ "通话", "Call", @@ -40,11 +10,14 @@ "音频通话", "音视频" ], - "license": "ISC", - "main": "tuicall-engine-wx.js", - "name": "tuicall-engine-wx", "repository": { "type": "git" }, - "version": "1.4.1" + "author": "Tencent Cloud Client R&D Center", + "license": "ISC", + "dependencies": { + "tim-wx-sdk": "latest", + "trtc-wx-sdk": "latest", + "tsignaling-wx": "latest" + } } diff --git a/node_modules/tuicall-engine-wx/tuicall-engine-wx.js b/node_modules/tuicall-engine-wx/tuicall-engine-wx.js index 4ca76c2..9a74e46 100644 --- a/node_modules/tuicall-engine-wx/tuicall-engine-wx.js +++ b/node_modules/tuicall-engine-wx/tuicall-engine-wx.js @@ -1 +1,9 @@ -import t from"tsignaling-wx";import e from"trtc-wx-sdk";import n from"tim-wx-sdk";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){s(a,r,i,o,c,"next",t)}function c(t){s(a,r,i,o,c,"throw",t)}o(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T(t){var e=g();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return E(t)}(this,n)}}function D(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return _(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&K[0]<4?1:+(K[0]+K[1])),!B&&St&&(!(K=St.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=St.match(/Chrome\/(\d+)/))&&(B=+K[1]);var Lt=B,At=Lt,Nt=A,Ut=!!Object.getOwnPropertySymbols&&!Nt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Mt=Ut&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Pt=_t,jt=gt,Vt=bt,Gt=Object,Ht=Mt?function(t){return"symbol"==typeof t}:function(t){var e=Pt("Symbol");return jt(e)&&Vt(e.prototype,Gt(t))},Ft=String,Kt=function(t){try{return Ft(t)}catch(t){return"Object"}},Bt=gt,zt=Kt,$t=TypeError,Jt=function(t){if(Bt(t))return t;throw $t(zt(t)+" is not a function")},Yt=Jt,qt=ot,Wt=function(t,e){var n=t[e];return qt(n)?void 0:Yt(n)},Xt=j,Qt=gt,Zt=It,te=TypeError,ee={exports:{}},ne=O,re=Object.defineProperty,ie=function(t,e){try{re(ne,t,{value:e,configurable:!0,writable:!0})}catch(n){ne[t]=e}return e},ae=ie,oe="__core-js_shared__",se=O[oe]||ae(oe,{}),ce=se;(ee.exports=function(t,e){return ce[t]||(ce[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.27.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"});var ue=ut,le=Object,he=function(t){return le(ue(t))},fe=he,de=W({}.hasOwnProperty),pe=Object.hasOwn||function(t,e){return de(fe(t),e)},ve=W,ge=0,ye=Math.random(),me=ve(1..toString),Ie=function(t){return"Symbol("+(void 0===t?"":t)+")_"+me(++ge+ye,36)},Ee=O,Te=ee.exports,De=pe,_e=Ie,be=Ut,Ce=Mt,Re=Ee.Symbol,Se=Te("wks"),we=Ce?Re.for||Re:Re&&Re.withoutSetter||_e,xe=function(t){return De(Se,t)||(Se[t]=be&&De(Re,t)?Re[t]:we("Symbol."+t)),Se[t]},ke=j,Oe=It,Le=Ht,Ae=Wt,Ne=function(t,e){var n,r;if("string"===e&&Qt(n=t.toString)&&!Zt(r=Xt(n,t)))return r;if(Qt(n=t.valueOf)&&!Zt(r=Xt(n,t)))return r;if("string"!==e&&Qt(n=t.toString)&&!Zt(r=Xt(n,t)))return r;throw te("Can't convert object to primitive value")},Ue=TypeError,Me=xe("toPrimitive"),Pe=function(t,e){if(!Oe(t)||Le(t))return t;var n,r=Ae(t,Me);if(r){if(void 0===e&&(e="default"),n=ke(r,t,e),!Oe(n)||Le(n))return n;throw Ue("Can't convert object to primitive value")}return void 0===e&&(e="number"),Ne(t,e)},je=Pe,Ve=Ht,Ge=function(t){var e=je(t,"string");return Ve(e)?e:e+""},He=It,Fe=O.document,Ke=He(Fe)&&He(Fe.createElement),Be=function(t){return Ke?Fe.createElement(t):{}},ze=Be,$e=!N&&!A((function(){return 7!=Object.defineProperty(ze("div"),"a",{get:function(){return 7}}).a})),Je=N,Ye=j,qe=V,We=z,Xe=ft,Qe=Ge,Ze=pe,tn=$e,en=Object.getOwnPropertyDescriptor;L.f=Je?en:function(t,e){if(t=Xe(t),e=Qe(e),tn)try{return en(t,e)}catch(t){}if(Ze(t,e))return We(!Ye(qe.f,t,e),t[e])};var nn={},rn=N&&A((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),an=It,on=String,sn=TypeError,cn=function(t){if(an(t))return t;throw sn(on(t)+" is not an object")},un=N,ln=$e,hn=rn,fn=cn,dn=Ge,pn=TypeError,vn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,yn="enumerable",mn="configurable",In="writable";nn.f=un?hn?function(t,e,n){if(fn(t),e=dn(e),fn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&In in n&&!n[In]){var r=gn(t,e);r&&r[In]&&(t[e]=n.value,n={configurable:mn in n?n[mn]:r[mn],enumerable:yn in n?n[yn]:r[yn],writable:!1})}return vn(t,e,n)}:vn:function(t,e,n){if(fn(t),e=dn(e),fn(n),ln)try{return vn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw pn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var En=nn,Tn=z,Dn=N?function(t,e,n){return En.f(t,e,Tn(1,n))}:function(t,e,n){return t[e]=n,t},_n={exports:{}},bn=N,Cn=pe,Rn=Function.prototype,Sn=bn&&Object.getOwnPropertyDescriptor,wn=Cn(Rn,"name"),xn={EXISTS:wn,PROPER:wn&&"something"===function(){}.name,CONFIGURABLE:wn&&(!bn||bn&&Sn(Rn,"name").configurable)},kn=gt,On=se,Ln=W(Function.toString);kn(On.inspectSource)||(On.inspectSource=function(t){return Ln(t)});var An,Nn,Un,Mn=On.inspectSource,Pn=gt,jn=O.WeakMap,Vn=Pn(jn)&&/native code/.test(String(jn)),Gn=ee.exports,Hn=Ie,Fn=Gn("keys"),Kn=function(t){return Fn[t]||(Fn[t]=Hn(t))},Bn={},zn=Vn,$n=O,Jn=It,Yn=Dn,qn=pe,Wn=se,Xn=Kn,Qn=Bn,Zn="Object already initialized",tr=$n.TypeError,er=$n.WeakMap;if(zn||Wn.state){var nr=Wn.state||(Wn.state=new er);nr.get=nr.get,nr.has=nr.has,nr.set=nr.set,An=function(t,e){if(nr.has(t))throw tr(Zn);return e.facade=t,nr.set(t,e),e},Nn=function(t){return nr.get(t)||{}},Un=function(t){return nr.has(t)}}else{var rr=Xn("state");Qn[rr]=!0,An=function(t,e){if(qn(t,rr))throw tr(Zn);return e.facade=t,Yn(t,rr,e),e},Nn=function(t){return qn(t,rr)?t[rr]:{}},Un=function(t){return qn(t,rr)}}var ir={set:An,get:Nn,has:Un,enforce:function(t){return Un(t)?Nn(t):An(t,{})},getterFor:function(t){return function(e){var n;if(!Jn(e)||(n=Nn(e)).type!==t)throw tr("Incompatible receiver, "+t+" required");return n}}},ar=W,or=A,sr=gt,cr=pe,ur=N,lr=xn.CONFIGURABLE,hr=Mn,fr=ir.enforce,dr=ir.get,pr=String,vr=Object.defineProperty,gr=ar("".slice),yr=ar("".replace),mr=ar([].join),Ir=ur&&!or((function(){return 8!==vr((function(){}),"length",{value:8}).length})),Er=String(String).split("String"),Tr=_n.exports=function(t,e,n){"Symbol("===gr(pr(e),0,7)&&(e="["+yr(pr(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!cr(t,"name")||lr&&t.name!==e)&&(ur?vr(t,"name",{value:e,configurable:!0}):t.name=e),Ir&&n&&cr(n,"arity")&&t.length!==n.arity&&vr(t,"length",{value:n.arity});try{n&&cr(n,"constructor")&&n.constructor?ur&&vr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=fr(t);return cr(r,"source")||(r.source=mr(Er,"string"==typeof e?e:"")),t};Function.prototype.toString=Tr((function(){return sr(this)&&dr(this).source||hr(this)}),"toString");var Dr=gt,_r=nn,br=_n.exports,Cr=ie,Rr=function(t,e,n,r){r||(r={});var i=r.enumerable,a=void 0!==r.name?r.name:e;if(Dr(n)&&br(n,a,r),r.global)i?t[e]=n:Cr(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=n:_r.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Sr={},wr=Math.ceil,xr=Math.floor,kr=Math.trunc||function(t){var e=+t;return(e>0?xr:wr)(e)},Or=function(t){var e=+t;return e!=e||0===e?0:kr(e)},Lr=Or,Ar=Math.max,Nr=Math.min,Ur=function(t,e){var n=Lr(t);return n<0?Ar(n+e,0):Nr(n,e)},Mr=Or,Pr=Math.min,jr=function(t){return t>0?Pr(Mr(t),9007199254740991):0},Vr=jr,Gr=function(t){return Vr(t.length)},Hr=ft,Fr=Ur,Kr=Gr,Br=function(t){return function(e,n,r){var i,a=Hr(e),o=Kr(a),s=Fr(r,o);if(t&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}},zr={includes:Br(!0),indexOf:Br(!1)},$r=pe,Jr=ft,Yr=zr.indexOf,qr=Bn,Wr=W([].push),Xr=function(t,e){var n,r=Jr(t),i=0,a=[];for(n in r)!$r(qr,n)&&$r(r,n)&&Wr(a,n);for(;e.length>i;)$r(r,n=e[i++])&&(~Yr(a,n)||Wr(a,n));return a},Qr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zr=Xr,ti=Qr.concat("length","prototype");Sr.f=Object.getOwnPropertyNames||function(t){return Zr(t,ti)};var ei={};ei.f=Object.getOwnPropertySymbols;var ni=_t,ri=Sr,ii=ei,ai=cn,oi=W([].concat),si=ni("Reflect","ownKeys")||function(t){var e=ri.f(ai(t)),n=ii.f;return n?oi(e,n(t)):e},ci=pe,ui=si,li=L,hi=nn,fi=A,di=gt,pi=/#|\.prototype\./,vi=function(t,e){var n=yi[gi(t)];return n==Ii||n!=mi&&(di(e)?fi(e):!!e)},gi=vi.normalize=function(t){return String(t).replace(pi,".").toLowerCase()},yi=vi.data={},mi=vi.NATIVE="N",Ii=vi.POLYFILL="P",Ei=vi,Ti=O,Di=L.f,_i=Dn,bi=Rr,Ci=ie,Ri=function(t,e,n){for(var r=ui(e),i=hi.f,a=li.f,o=0;o9007199254740991)throw Oi("Maximum allowed index exceeded");return t},Ai=Ge,Ni=nn,Ui=z,Mi=function(t,e,n){var r=Ai(e);r in t?Ni.f(t,r,Ui(0,n)):t[r]=n},Pi={};Pi[xe("toStringTag")]="z";var ji="[object z]"===String(Pi),Vi=ji,Gi=gt,Hi=tt,Fi=xe("toStringTag"),Ki=Object,Bi="Arguments"==Hi(function(){return arguments}()),zi=Vi?Hi:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Ki(t),Fi))?n:Bi?Hi(e):"Object"==(r=Hi(e))&&Gi(e.callee)?"Arguments":r},$i=W,Ji=A,Yi=gt,qi=zi,Wi=Mn,Xi=function(){},Qi=[],Zi=_t("Reflect","construct"),ta=/^\s*(?:class|function)\b/,ea=$i(ta.exec),na=!ta.exec(Xi),ra=function(t){if(!Yi(t))return!1;try{return Zi(Xi,Qi,t),!0}catch(t){return!1}},ia=function(t){if(!Yi(t))return!1;switch(qi(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return na||!!ea(ta,Wi(t))}catch(t){return!0}};ia.sham=!0;var aa=!Zi||Ji((function(){var t;return ra(ra.call)||!ra(Object)||!ra((function(){t=!0}))||t}))?ia:ra,oa=ki,sa=aa,ca=It,ua=xe("species"),la=Array,ha=function(t){var e;return oa(t)&&(e=t.constructor,(sa(e)&&(e===la||oa(e.prototype))||ca(e)&&null===(e=e[ua]))&&(e=void 0)),void 0===e?la:e},fa=function(t,e){return new(ha(t))(0===e?0:e)},da=A,pa=Lt,va=xe("species"),ga=function(t){return pa>=51||!da((function(){var e=[];return(e.constructor={})[va]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},ya=wi,ma=A,Ia=ki,Ea=It,Ta=he,Da=Gr,_a=Li,ba=Mi,Ca=fa,Ra=ga,Sa=Lt,wa=xe("isConcatSpreadable"),xa=Sa>=51||!ma((function(){var t=[];return t[wa]=!1,t.concat()[0]!==t})),ka=function(t){if(!Ea(t))return!1;var e=t[wa];return void 0!==e?!!e:Ia(t)};ya({target:"Array",proto:!0,arity:1,forced:!xa||!Ra("concat")},{concat:function(t){var e,n,r,i,a,o=Ta(this),s=Ca(o,0),c=0;for(e=-1,r=arguments.length;e1?arguments[1]:void 0;return Ga?Va(this,t,e)||0:Pa(this,t,e)}});var Ha=Jt,Fa=U,Ka=Aa(Aa.bind),Ba=function(t,e){return Ha(t),void 0===e?t:Fa?Ka(t,e):function(){return t.apply(e,arguments)}},za=Ba,$a=at,Ja=he,Ya=Gr,qa=fa,Wa=W([].push),Xa=function(t){var e=1==t,n=2==t,r=3==t,i=4==t,a=6==t,o=7==t,s=5==t||a;return function(c,u,l,h){for(var f,d,p=Ja(c),v=$a(p),g=za(u,l),y=Ya(v),m=0,I=h||qa,E=e?I(c,y):n||o?I(c,0):void 0;y>m;m++)if((s||m in v)&&(d=g(f=v[m],m,p),t))if(e)E[m]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return m;case 2:Wa(E,f)}else switch(t){case 4:return!1;case 7:Wa(E,f)}return a?-1:r||i?i:E}},Qa={forEach:Xa(0),map:Xa(1),filter:Xa(2),some:Xa(3),every:Xa(4),find:Xa(5),findIndex:Xa(6),filterReject:Xa(7)},Za=Qa.filter;wi({target:"Array",proto:!0,forced:!ga("filter")},{filter:function(t){return Za(this,t,arguments.length>1?arguments[1]:void 0)}});var to=zi,eo=ji?{}.toString:function(){return"[object "+to(this)+"]"};ji||Rr(Object.prototype,"toString",eo,{unsafe:!0});var no=W,ro=Rr,io=Date.prototype,ao="Invalid Date",oo="toString",so=no(io[oo]),co=no(io.getTime);String(new Date(NaN))!=ao&&ro(io,oo,(function(){var t=co(this);return t==t?so(this):ao}));var uo=Qa.map;wi({target:"Array",proto:!0,forced:!ga("map")},{map:function(t){return uo(this,t,arguments.length>1?arguments[1]:void 0)}});var lo=wi,ho=Date,fo=W(ho.prototype.getTime);lo({target:"Date",stat:!0},{now:function(){return fo(new ho)}});var po=Xr,vo=Qr,go=Object.keys||function(t){return po(t,vo)},yo=N,mo=W,Io=j,Eo=A,To=go,Do=ei,_o=V,bo=he,Co=at,Ro=Object.assign,So=Object.defineProperty,wo=mo([].concat),xo=!Ro||Eo((function(){if(yo&&1!==Ro({b:1},Ro(So({},"a",{enumerable:!0,get:function(){So(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=Ro({},t)[n]||To(Ro({},e)).join("")!=r}))?function(t,e){for(var n=bo(t),r=arguments.length,i=1,a=Do.f,o=_o.f;r>i;)for(var s,c=Co(arguments[i++]),u=a?wo(To(c),a(c)):To(c),l=u.length,h=0;l>h;)s=u[h++],yo&&!Io(o,c,s)||(n[s]=c[s]);return n}:Ro,ko=xo;wi({target:"Object",stat:!0,arity:2,forced:Object.assign!==ko},{assign:ko});var Oo,Lo,Ao,No,Uo="undefined"!=typeof process&&"process"==tt(process),Mo=gt,Po=String,jo=TypeError,Vo=W,Go=cn,Ho=function(t){if("object"==typeof t||Mo(t))return t;throw jo("Can't set "+Po(t)+" as a prototype")},Fo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Vo(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Go(n),Ho(r),e?t(n,r):n.__proto__=r,n}}():void 0),Ko=nn.f,Bo=pe,zo=xe("toStringTag"),$o=function(t,e,n){t&&!n&&(t=t.prototype),t&&!Bo(t,zo)&&Ko(t,zo,{configurable:!0,value:e})},Jo=_t,Yo=nn,qo=N,Wo=xe("species"),Xo=function(t){var e=Jo(t),n=Yo.f;qo&&e&&!e[Wo]&&n(e,Wo,{configurable:!0,get:function(){return this}})},Qo=bt,Zo=TypeError,ts=function(t,e){if(Qo(e,t))return t;throw Zo("Incorrect invocation")},es=aa,ns=Kt,rs=TypeError,is=cn,as=function(t){if(es(t))return t;throw rs(ns(t)+" is not a constructor")},os=ot,ss=xe("species"),cs=U,us=Function.prototype,ls=us.apply,hs=us.call,fs="object"==typeof Reflect&&Reflect.apply||(cs?hs.bind(ls):function(){return hs.apply(ls,arguments)}),ds=_t("document","documentElement"),ps=W([].slice),vs=TypeError,gs=function(t,e){if(ta;a++)if((s=y(t[a]))&&ll(gl,s))return s;return new vl(!1)}r=hl(t,i)}for(c=f?t.next:r.next;!(u=al(c,r)).done;){try{s=y(u.value)}catch(t){dl(r,"throw",t)}if("object"==typeof s&&s&&ll(gl,s))return s}return new vl(!1)},ml=xe("iterator"),Il=!1;try{var El=0,Tl={next:function(){return{done:!!El++}},return:function(){Il=!0}};Tl[ml]=function(){return this},Array.from(Tl,(function(){throw 2}))}catch(t){}var Dl=function(t,e){if(!e&&!Il)return!1;var n=!1;try{var r={};r[ml]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},_l=Ic,bl=Uc.CONSTRUCTOR||!Dl((function(t){_l.all(t).then(void 0,(function(){}))})),Cl=j,Rl=Jt,Sl=Mc,wl=mc,xl=yl;wi({target:"Promise",stat:!0,forced:bl},{all:function(t){var e=this,n=Sl.f(e),r=n.resolve,i=n.reject,a=wl((function(){var n=Rl(e.resolve),a=[],o=0,s=1;xl(t,(function(t){var c=o++,u=!1;s++,Cl(n,e,t).then((function(t){u||(u=!0,a[c]=t,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var kl=wi,Ol=Uc.CONSTRUCTOR,Ll=Ic,Al=_t,Nl=gt,Ul=Rr,Ml=Ll&&Ll.prototype;if(kl({target:"Promise",proto:!0,forced:Ol,real:!0},{catch:function(t){return this.then(void 0,t)}}),Nl(Ll)){var Pl=Al("Promise").prototype.catch;Ml.catch!==Pl&&Ul(Ml,"catch",Pl,{unsafe:!0})}var jl=j,Vl=Jt,Gl=Mc,Hl=mc,Fl=yl;wi({target:"Promise",stat:!0,forced:bl},{race:function(t){var e=this,n=Gl.f(e),r=n.reject,i=Hl((function(){var i=Vl(e.resolve);Fl(t,(function(t){jl(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Kl=j,Bl=Mc;wi({target:"Promise",stat:!0,forced:Uc.CONSTRUCTOR},{reject:function(t){var e=Bl.f(this);return Kl(e.reject,void 0,t),e.promise}});var zl=cn,$l=It,Jl=Mc,Yl=wi,ql=Uc.CONSTRUCTOR,Wl=function(t,e){if(zl(t),$l(e)&&e.constructor===t)return e;var n=Jl.f(t);return(0,n.resolve)(e),n.promise};_t("Promise"),Yl({target:"Promise",stat:!0,forced:ql},{resolve:function(t){return Wl(this,t)}});var Xl="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Ql=O,Zl=fs,th=gt,eh=Xl,nh=Ct,rh=ps,ih=gs,ah=Ql.Function,oh=/MSIE .\./.test(nh)||eh&&function(){var t=Ql.Bun.version.split(".");return t.length<3||0==t[0]&&(t[1]<3||3==t[1]&&0==t[2])}(),sh=function(t,e){var n=e?2:1;return oh?function(r,i){var a=ih(arguments.length,1)>n,o=th(r)?r:ah(r),s=a?rh(arguments,n):[],c=a?function(){Zl(o,this,s)}:o;return e?t(c,i):t(c)}:t},ch=wi,uh=O,lh=sh(uh.setInterval,!0);ch({global:!0,bind:!0,forced:uh.setInterval!==lh},{setInterval:lh});var hh=wi,fh=O,dh=sh(fh.setTimeout,!0);hh({global:!0,bind:!0,forced:fh.setTimeout!==dh},{setTimeout:dh});var ph=zi,vh=String,gh=function(t){if("Symbol"===ph(t))throw TypeError("Cannot convert a Symbol value to a string");return vh(t)},yh=W,mh=Or,Ih=gh,Eh=ut,Th=yh("".charAt),Dh=yh("".charCodeAt),_h=yh("".slice),bh=function(t){return function(e,n){var r,i,a=Ih(Eh(e)),o=mh(n),s=a.length;return o<0||o>=s?t?"":void 0:(r=Dh(a,o))<55296||r>56319||o+1===s||(i=Dh(a,o+1))<56320||i>57343?t?Th(a,o):r:t?_h(a,o,o+2):i-56320+(r-55296<<10)+65536}},Ch={codeAt:bh(!1),charAt:bh(!0)},Rh={},Sh=N,wh=rn,xh=nn,kh=cn,Oh=ft,Lh=go;Rh.f=Sh&&!wh?Object.defineProperties:function(t,e){kh(t);for(var n,r=Oh(e),i=Lh(e),a=i.length,o=0;a>o;)xh.f(t,n=i[o++],r[n]);return t};var Ah,Nh=cn,Uh=Rh,Mh=Qr,Ph=Bn,jh=ds,Vh=Be,Gh="prototype",Hh="script",Fh=Kn("IE_PROTO"),Kh=function(){},Bh=function(t){return"<"+Hh+">"+t+""},zh=function(t){t.write(Bh("")),t.close();var e=t.parentWindow.Object;return t=null,e},$h=function(){try{Ah=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;$h="undefined"!=typeof document?document.domain&&Ah?zh(Ah):(e=Vh("iframe"),n="java"+Hh+":",e.style.display="none",jh.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Bh("document.F=Object")),t.close(),t.F):zh(Ah);for(var r=Mh.length;r--;)delete $h[Gh][Mh[r]];return $h()};Ph[Fh]=!0;var Jh,Yh,qh,Wh=Object.create||function(t,e){var n;return null!==t?(Kh[Gh]=Nh(t),n=new Kh,Kh[Gh]=null,n[Fh]=t):n=$h(),void 0===e?n:Uh.f(n,e)},Xh=!A((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Qh=pe,Zh=gt,tf=he,ef=Xh,nf=Kn("IE_PROTO"),rf=Object,af=rf.prototype,of=ef?rf.getPrototypeOf:function(t){var e=tf(t);if(Qh(e,nf))return e[nf];var n=e.constructor;return Zh(n)&&e instanceof n?n.prototype:e instanceof rf?af:null},sf=A,cf=gt,uf=It,lf=of,hf=Rr,ff=xe("iterator"),df=!1;[].keys&&("next"in(qh=[].keys())?(Yh=lf(lf(qh)))!==Object.prototype&&(Jh=Yh):df=!0);var pf=!uf(Jh)||sf((function(){var t={};return Jh[ff].call(t)!==t}));pf&&(Jh={}),cf(Jh[ff])||hf(Jh,ff,(function(){return this}));var vf={IteratorPrototype:Jh,BUGGY_SAFARI_ITERATORS:df},gf=vf.IteratorPrototype,yf=Wh,mf=z,If=$o,Ef=Mu,Tf=function(){return this},Df=wi,_f=j,bf=gt,Cf=function(t,e,n,r){var i=e+" Iterator";return t.prototype=yf(gf,{next:mf(+!r,n)}),If(t,i,!1),Ef[i]=Tf,t},Rf=of,Sf=Fo,wf=$o,xf=Dn,kf=Rr,Of=Mu,Lf=xn.PROPER,Af=xn.CONFIGURABLE,Nf=vf.IteratorPrototype,Uf=vf.BUGGY_SAFARI_ITERATORS,Mf=xe("iterator"),Pf="keys",jf="values",Vf="entries",Gf=function(){return this},Hf=function(t,e,n,r,i,a,o){Cf(n,e,r);var s,c,u,l=function(t){if(t===i&&v)return v;if(!Uf&&t in d)return d[t];switch(t){case Pf:case jf:case Vf:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,d=t.prototype,p=d[Mf]||d["@@iterator"]||i&&d[i],v=!Uf&&p||l(i),g="Array"==e&&d.entries||p;if(g&&(s=Rf(g.call(new t)))!==Object.prototype&&s.next&&(Rf(s)!==Nf&&(Sf?Sf(s,Nf):bf(s[Mf])||kf(s,Mf,Gf)),wf(s,h,!0)),Lf&&i==jf&&p&&p.name!==jf&&(Af?xf(d,"name",jf):(f=!0,v=function(){return _f(p,this)})),i)if(c={values:l(jf),keys:a?v:l(Pf),entries:l(Vf)},o)for(u in c)(Uf||f||!(u in d))&&kf(d,u,c[u]);else Df({target:e,proto:!0,forced:Uf||f},c);return d[Mf]!==v&&kf(d,Mf,v,{name:i}),Of[e]=v,c},Ff=function(t,e){return{value:t,done:e}},Kf=Ch.charAt,Bf=gh,zf=ir,$f=Hf,Jf=Ff,Yf="String Iterator",qf=zf.set,Wf=zf.getterFor(Yf);$f(String,"String",(function(t){qf(this,{type:Yf,string:Bf(t),index:0})}),(function(){var t,e=Wf(this),n=e.string,r=e.index;return r>=n.length?Jf(void 0,!0):(t=Kf(n,r),e.index+=t.length,Jf(t,!1))}));var Xf=xe,Qf=Wh,Zf=nn.f,td=Xf("unscopables"),ed=Array.prototype;null==ed[td]&&Zf(ed,td,{configurable:!0,value:Qf(null)});var nd=function(t){ed[td][t]=!0},rd=ft,id=nd,ad=Mu,od=ir,sd=nn.f,cd=Hf,ud=Ff,ld=N,hd="Array Iterator",fd=od.set,dd=od.getterFor(hd),pd=cd(Array,"Array",(function(t,e){fd(this,{type:hd,target:rd(t),index:0,kind:e})}),(function(){var t=dd(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,ud(void 0,!0)):ud("keys"==n?r:"values"==n?e[r]:[r,e[r]],!1)}),"values"),vd=ad.Arguments=ad.Array;if(id("keys"),id("values"),id("entries"),ld&&"values"!==vd.name)try{sd(vd,"name",{value:"values"})}catch(t){}var gd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},yd=Be("span").classList,md=yd&&yd.constructor&&yd.constructor.prototype,Id=md===Object.prototype?void 0:md,Ed=O,Td=gd,Dd=Id,_d=pd,bd=Dn,Cd=xe,Rd=Cd("iterator"),Sd=Cd("toStringTag"),wd=_d.values,xd=function(t,e){if(t){if(t[Rd]!==wd)try{bd(t,Rd,wd)}catch(e){t[Rd]=wd}if(t[Sd]||bd(t,Sd,e),Td[e])for(var n in _d)if(t[n]!==_d[n])try{bd(t,n,_d[n])}catch(e){t[n]=_d[n]}}};for(var kd in Td)xd(Ed[kd]&&Ed[kd].prototype,kd);xd(Dd,"DOMTokenList");var Od=wi,Ld=ki,Ad=aa,Nd=It,Ud=Ur,Md=Gr,Pd=ft,jd=Mi,Vd=xe,Gd=ps,Hd=ga("slice"),Fd=Vd("species"),Kd=Array,Bd=Math.max;Od({target:"Array",proto:!0,forced:!Hd},{slice:function(t,e){var n,r,i,a=Pd(this),o=Md(a),s=Ud(t,o),c=Ud(void 0===e?o:e,o);if(Ld(a)&&(n=a.constructor,(Ad(n)&&(n===Kd||Ld(n.prototype))||Nd(n)&&null===(n=n[Fd]))&&(n=void 0),n===Kd||void 0===n))return Gd(a,s,c);for(r=new(void 0===n?Kd:n)(Bd(c-s,0)),i=0;s1?arguments[1]:void 0)};wi({target:"Array",proto:!0,forced:[].forEach!=$d},{forEach:$d});var Jd=O,Yd=gd,qd=Id,Wd=$d,Xd=Dn,Qd=function(t){if(t&&t.forEach!==Wd)try{Xd(t,"forEach",Wd)}catch(e){t.forEach=Wd}};for(var Zd in Yd)Yd[Zd]&&Qd(Jd[Zd]&&Jd[Zd].prototype);Qd(qd);var tp=he,ep=go;wi({target:"Object",stat:!0,forced:A((function(){ep(1)}))},{keys:function(t){return ep(tp(t))}});var np=cn,rp=rl,ip=Ba,ap=j,op=he,sp=function(t,e,n,r){try{return r?e(np(n)[0],n[1]):e(n)}catch(e){rp(t,"throw",e)}},cp=Gu,up=aa,lp=Gr,hp=Mi,fp=Zu,dp=$u,pp=Array,vp=function(t){var e=op(t),n=up(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=ip(i,r>2?arguments[2]:void 0));var o,s,c,u,l,h,f=dp(e),d=0;if(!f||this===pp&&cp(f))for(o=lp(e),s=n?new this(o):pp(o);o>d;d++)h=a?i(e[d],d):e[d],hp(s,d,h);else for(l=(u=fp(e,f)).next,s=n?new this:[];!(c=ap(l,u)).done;d++)h=a?sp(u,i,[c.value,d],!0):c.value,hp(s,d,h);return s.length=d,s};wi({target:"Array",stat:!0,forced:!Dl((function(t){Array.from(t)}))},{from:vp});var gp={exports:{}},yp={},mp=Ur,Ip=Gr,Ep=Mi,Tp=Array,Dp=Math.max,_p=function(t,e,n){for(var r=Ip(t),i=mp(e,r),a=mp(void 0===n?r:n,r),o=Tp(Dp(a-i,0)),s=0;i1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Dv(a,n?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),kv&&Ev(a,"size",{get:function(){return o(this).size}}),i},setStrong:function(t,e,n){var r=e+" Iterator",i=Av(e),a=Av(r);Sv(t,e,(function(t,e){Lv(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?wv("keys"==e?n.key:"values"==e?n.value:[n.key,n.value],!1):(t.target=void 0,wv(void 0,!0))}),n?"entries":"values",!n,!0),xv(e)}};yv("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Nv);var Uv=N,Mv=ki,Pv=TypeError,jv=Object.getOwnPropertyDescriptor,Vv=Uv&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(Mv(t)&&!jv(t,"length").writable)throw Pv("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Gv=Kt,Hv=TypeError,Fv=function(t,e){if(!delete t[e])throw Hv("Cannot delete property "+Gv(e)+" of "+Gv(t))},Kv=wi,Bv=he,zv=Ur,$v=Or,Jv=Gr,Yv=Vv,qv=Li,Wv=fa,Xv=Mi,Qv=Fv,Zv=ga("splice"),tg=Math.max,eg=Math.min;Kv({target:"Array",proto:!0,forced:!Zv},{splice:function(t,e){var n,r,i,a,o,s,c=Bv(this),u=Jv(c),l=zv(t,u),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=u-l):(n=h-2,r=eg(tg($v(e),0),u-l)),qv(u+n-r),i=Wv(c,r),a=0;au-r+n;a--)Qv(c,a-1)}else if(n>r)for(a=u-r;a>l;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:Qv(c,s);for(a=0;a= 2.20.1",ERROR_PERMISSION_DENIED:"camera or microphone not authorized",ERROR_GET_DEVICE_LIST_FAIL:"TUICallEngine - Failed to get device list",ERROR_INIT_FAIL:"init is not called, the TUICallEngine API needs to be used after init",ERROR_PARAM_INVALID:"",ERROR_REQUEST_REFUSED:"",ERROR_REQUEST_REPEATED:"TUICallEngine - Consistent with the current call type, please do not switch repeatedly",ERROR_SCENE_NOT_SUPPORTED:"In the current call scene, this function is not supported",ERROR_SIGNALING_SEND_FAIL:"signaling failed to send"},Cg="video",Rg="audio",Sg="normal",wg="reject",xg="timeout",kg="cancel",Og="busyline",Lg="unknown",Ag="SingleCall",Ng="groupCall",Ug="caller",Mg="callee",Pg="\t\n\v\f\r                 \u2028\u2029\ufeff",jg=ut,Vg=gh,Gg=Pg,Hg=W("".replace),Fg="["+Gg+"]",Kg=RegExp("^"+Fg+Fg+"*"),Bg=RegExp(Fg+Fg+"*$"),zg=function(t){return function(e){var n=Vg(jg(e));return 1&t&&(n=Hg(n,Kg,"")),2&t&&(n=Hg(n,Bg,"")),n}},$g={start:zg(1),end:zg(2),trim:zg(3)},Jg=O,Yg=A,qg=W,Wg=gh,Xg=$g.trim,Qg=Pg,Zg=Jg.parseInt,ty=Jg.Symbol,ey=ty&&ty.iterator,ny=/^[+-]?0x/i,ry=qg(ny.exec),iy=8!==Zg(Qg+"08")||22!==Zg(Qg+"0x16")||ey&&!Yg((function(){Zg(Object(ey))}))?function(t,e){var n=Xg(Wg(t));return Zg(n,e>>>0||(ry(ny,n)?16:10))}:Zg;function ay(t){var e=new Date(t);return"".concat(e.getFullYear(),"-")+"".concat(e.getMonth()+1<10?"0".concat(e.getMonth()+1):e.getMonth()+1,"-")+oy(e.getDate()," ")+oy(e.getHours(),":")+oy(e.getMinutes(),":")+oy(e.getSeconds(),"")}function oy(t,e){return"".concat(t<10?"0".concat(t).concat(e):"".concat(t).concat(e))}wi({global:!0,forced:parseInt!=iy},{parseInt:iy});var sy=["inviteID","type"],cy=function(){function t(e){u(this,t),this.TSignaling=e.TSignaling}var e,n,r,o,s,l,f;return h(t,[{key:"handleNewSignaling",value:function(t,e){return i(i({extraInfo:""},t),{},{version:4,businessID:"av_call",platform:"MiniApp",data:i({cmd:mg[t.call_type],room_id:t.room_id,message:""},e)})}},{key:"extractCallingInfoFromMessage",value:function(t){if(!t||"TIMCustomElem"!==t.type)return"";var e=JSON.parse(t.payload.data);if(e.businessID!==lg)return"";switch(e.actionType){case ag:var n=JSON.parse(e.data);return n.call_end>0&&!e.groupID?n.call_end:0!==n.call_end&&n.room_id?"发起通话":"结束群聊";case og:return"取消通话";case sg:return"已接听";case cg:return"拒绝通话";case ug:return"无应答";default:return""}}},{key:"handleError",value:function(t,e){return console.error("".concat("TSignalingClint"," ").concat(e),t),t}},{key:"_handleInviteData",value:function(t){var e=t.type,n=t.roomID,r=t.userIDList,i=t.hangup,a=t.switchMode;if(i)return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:i.callEnd},{cmd:"hangup"}));if(a){var o={version:0,call_type:e,room_id:n},s={cmd:"switchToVideo"};return a===Ig&&(o.switch_to_audio_call="switch_to_audio_call",s.cmd="switchToAudio"),JSON.stringify(this.handleNewSignaling(o,s))}return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n},{userIDs:r}))}},{key:"_handleInviteGroupData",value:function(t){var e=t.type,n=t.roomID,r=t.hangup;return r?JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:r.call_end},{cmd:"hangup"})):JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n}))}},{key:"invite",value:(f=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.userID,r=e.offlinePushInfo,i=e.hangup,o=e.switchMode,t.prev=1,t.next=4,this.TSignaling.invite({userID:n,data:this._handleInviteData(e),timeout:i?0:30,offlinePushInfo:r});case 4:return t.abrupt("return",t.sent);case 7:if(t.prev=7,t.t0=t.catch(1),!i){t.next=11;break}return t.abrupt("return",this.handleError(t.t0,"hangup C2C"));case 11:if(!o){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,o));case 13:return t.abrupt("return",this.handleError(t.t0,"invite"));case 14:case"end":return t.stop()}}),t,this,[[1,7]])}))),function(t){return f.apply(this,arguments)})},{key:"inviteGroup",value:(l=c(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.groupID,r=e.userIDList,i=e.offlinePushInfo,o=e.hangup,s=e.inCallUserIDs,c=void 0===s?[]:s,t.prev=1,t.next=4,this.TSignaling.inviteInGroup({groupID:n,inviteeList:r,timeout:o?0:30,data:this._handleInviteGroupData(e),offlinePushInfo:i,inCallUserIDs:c});case 4:return t.abrupt("return",t.sent);case 7:if(t.prev=7,t.t0=t.catch(1),!o){t.next=11;break}return t.abrupt("return",this.handleError(t.t0,"hangup group"));case 11:return t.abrupt("return",this.handleError(t.t0,"inviteGroup"));case 12:case"end":return t.stop()}}),t,this,[[1,7]])}))),function(t){return l.apply(this,arguments)})},{key:"accept",value:(s=c(a().mark((function t(e,n){var r,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.inviteID,o=e.type,s=I(e,sy),t.prev=1,t.next=4,this.TSignaling.accept({inviteID:r,data:JSON.stringify(this.handleNewSignaling(i({version:0,call_type:o},s),n))});case 4:return t.abrupt("return",t.sent);case 7:return t.prev=7,t.t0=t.catch(1),t.abrupt("return",this.handleError(t.t0,"accept"));case 10:case"end":return t.stop()}}),t,this,[[1,7]])}))),function(t,e){return s.apply(this,arguments)})},{key:"reject",value:(o=c(a().mark((function t(e){var n,r,i,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.inviteID,r=e.type,i=e.lineBusy,o={version:0,call_type:r},s=null,i?(o.line_busy=i,s=JSON.stringify(this.handleNewSignaling(o,{message:"lineBusy"}))):s=JSON.stringify(this.handleNewSignaling(o)),t.prev=4,t.next=7,this.TSignaling.reject({inviteID:n,data:s});case 7:return t.abrupt("return",t.sent);case 10:if(t.prev=10,t.t0=t.catch(4),!i){t.next=14;break}return t.abrupt("return",this.handleError(t.t0,"line_busy"));case 14:return t.abrupt("return",this.handleError(t.t0,"reject"));case 15:case"end":return t.stop()}}),t,this,[[4,10]])}))),function(t){return o.apply(this,arguments)})},{key:"cancel",value:(r=c(a().mark((function t(e){var n,r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.inviteID,r=e.callType,t.prev=1,t.next=4,this.TSignaling.cancel({inviteID:n,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:r}))});case 4:return i=t.sent,t.abrupt("return",i);case 8:return t.prev=8,t.t0=t.catch(1),t.abrupt("return",this.handleError(t.t0,"cancel"));case 11:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t){return r.apply(this,arguments)})},{key:"hangup",value:(n=c(a().mark((function t(e){var n,r,i,o,s,c,u,l,h,f,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.userIDList,r=e.callType,i=e.callEnd,o=void 0===i?0:i,s=e.isGroupCall,c=void 0!==s&&s,u=e.groupID,l=void 0===u?"":u,h={version:0,call_type:r,call_end:o},f={cmd:"hangup"},d=JSON.stringify(this.handleNewSignaling(h,f)),!c||!l){t.next=9;break}return t.next=7,this.TSignaling.inviteInGroup({inviteeList:n,groupID:l,data:d,timeout:0});case 7:t.next=11;break;case 9:return t.next=11,this.TSignaling.invite({userID:n[0],data:d,timeout:0});case 11:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"switchCallMode",value:(e=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.userID,r=e.callType,i=e.roomID,o=e.mode,t.abrupt("return",this.invite({userID:n,type:r,roomID:i,switchMode:o}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"destroyed",value:function(){this.TSignaling=null}},{key:"setLogLevel",value:function(t){this.TSignaling.setLogLevel(t)}}]),t}(),uy=function(){function t(e){u(this,t),this._emitter=e.emitter}return h(t,[{key:"onCallEnd",value:function(t){var e=t.userID,n=t.callEnd,r=t.message,i=t.roomID,a=t.callMediaType,o=t.callRole,s=t.totalTime;this._emitter.emit(rg.CALL_END,{userID:e,callEnd:n,message:r,roomID:i,callMediaType:a,callRole:o,totalTime:s})}},{key:"onInvited",value:function(t){var e=t.sponsor,n=t.inviteeList,r=t.isFromGroup,i=t.inviteData,a=t.inviteID,o=t.userIDList;this._emitter.emit(rg.INVITED,{sponsor:e,inviteeList:n,userIDList:o,isFromGroup:r,inviteID:a,inviteData:i})}},{key:"onLineBusy",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(rg.LINE_BUSY,{inviteID:e,invitee:n,userID:r,reason:"line busy"})}},{key:"onReject",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(rg.REJECT,{inviteID:e,invitee:n,userID:r,reason:"reject"})}},{key:"onNoResp",value:function(t){var e=t.groupID,n=void 0===e?"":e,r=t.inviteID,i=t.sponsor,a=t.timeoutUserList,o=t.userIDList;this._emitter.emit(rg.NO_RESP,{groupID:n,inviteID:r,sponsor:i,timeoutUserList:a,userIDList:o})}},{key:"onCancel",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(rg.CALLING_CANCEL,{inviteID:e,invitee:n,userID:r})}},{key:"onTimeout",value:function(t){var e=t.inviteID,n=t.groupID,r=t.sponsor,i=t.timeoutUserList;this._emitter.emit(rg.CALLING_TIMEOUT,{groupID:n,inviteID:e,sponsor:r,timeoutUserList:i})}},{key:"onUserAccept",value:function(t){var e=t.userID,n=t.userList;this._emitter.emit(rg.USER_ACCEPT,{userID:e,userList:n})}},{key:"onUserEnter",value:function(t){var e=t.userID,n=t.playerList;this._emitter.emit(rg.USER_ENTER,{userID:e,playerList:n})}},{key:"onUserLeave",value:function(t){var e=t.userID,n=t.playerList;this._emitter.emit(rg.USER_LEAVE,{userID:e,playerList:n})}},{key:"onUserUpdate",value:function(t){var e=t.pusher,n=t.playerList;this._emitter.emit(rg.USER_UPDATE,{pusher:e,playerList:n})}},{key:"onSdkReady",value:function(t){this._emitter.emit(rg.SDK_READY,t)}},{key:"onKickedOut",value:function(t){this._emitter.emit(rg.KICKED_OUT,t)}},{key:"onCallMode",value:function(t){this._emitter.emit(rg.CALL_MODE,t)}},{key:"onMessageSentByMe",value:function(t){this._emitter.emit(rg.MESSAGE_SENT_BY_ME,t)}},{key:"destroyed",value:function(){this._emitter=null}}]),t}(),ly="1.4.0";yv("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Nv);var hy,fy,dy=cn,py=function(){var t=dy(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},vy=j,gy=pe,yy=bt,my=py,Iy=RegExp.prototype,Ey=function(t){var e=t.flags;return void 0!==e||"flags"in Iy||gy(t,"flags")||!yy(Iy,t)?e:vy(my,t)},Ty=xn.PROPER,Dy=Rr,_y=cn,by=gh,Cy=A,Ry=Ey,Sy="toString",wy=RegExp.prototype[Sy],xy=Cy((function(){return"/a/b"!=wy.call({source:"a",flags:"b"})})),ky=Ty&&wy.name!=Sy;(xy||ky)&&Dy(RegExp.prototype,Sy,(function(){var t=_y(this);return"/"+by(t.source)+"/"+by(Ry(t))}),{unsafe:!0}),hy="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Oy=function(){},Ly=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Ay=Ly.length;Ay;)fy=Ly[Ay],console[fy]||(hy[fy]=Oy),Ay-=1;hy.methods=Ly;var Ny=hy,Uy=A,My=O.RegExp,Py=Uy((function(){var t=My("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),jy=Py||Uy((function(){return!My("a","y").sticky})),Vy={BROKEN_CARET:Py||Uy((function(){var t=My("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:jy,UNSUPPORTED_Y:Py},Gy=A,Hy=O.RegExp,Fy=Gy((function(){var t=Hy(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),Ky=A,By=O.RegExp,zy=Ky((function(){var t=By("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),$y=j,Jy=W,Yy=gh,qy=py,Wy=Vy,Xy=ee.exports,Qy=Wh,Zy=ir.get,tm=Fy,em=zy,nm=Xy("native-string-replace",String.prototype.replace),rm=RegExp.prototype.exec,im=rm,am=Jy("".charAt),om=Jy("".indexOf),sm=Jy("".replace),cm=Jy("".slice),um=function(){var t=/a/,e=/b*/g;return $y(rm,t,"a"),$y(rm,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),lm=Wy.BROKEN_CARET,hm=void 0!==/()??/.exec("")[1];(um||hm||lm||tm||em)&&(im=function(t){var e,n,r,i,a,o,s,c=this,u=Zy(c),l=Yy(t),h=u.raw;if(h)return h.lastIndex=c.lastIndex,e=$y(im,h,l),c.lastIndex=h.lastIndex,e;var f=u.groups,d=lm&&c.sticky,p=$y(qy,c),v=c.source,g=0,y=l;if(d&&(p=sm(p,"y",""),-1===om(p,"g")&&(p+="g"),y=cm(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==am(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),hm&&(n=new RegExp("^"+v+"$(?!\\s)",p)),um&&(r=c.lastIndex),i=$y(rm,d?n:c,y),d?i?(i.input=cm(i.input,g),i[0]=cm(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:um&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),hm&&i&&i.length>1&&$y(nm,i[0],n,(function(){for(a=1;a2)if(u=iI(u),43===(e=lI(u,0))||45===e){if(88===(n=lI(u,2))||120===n)return NaN}else if(48===e){switch(lI(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(o=(a=uI(u,2)).length,s=0;si)return NaN;return parseInt(a,r)}return+u},dI=Jm(aI,!oI(" 0o1")||!oI("0b1")||oI("+0x1")),pI=function(t){return Wm(sI,t)&&Zm((function(){rI(t)}))},vI=function(t){var e=arguments.length<1?0:oI(hI(t));return pI(this)?qm(Object(e),this,vI):e};vI.prototype=sI,dI&&(sI.constructor=vI),Fm({global:!0,constructor:!0,wrap:!0,forced:dI},{Number:vI});dI&&function(t,e){for(var n,r=Km?tI(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)Ym(e,n=r[i])&&!Ym(t,n)&&nI(t,n,eI(e,n))}(zm[aI],oI);var gI=Or,yI=gh,mI=ut,II=RangeError,EI=function(t){var e=yI(mI(this)),n="",r=gI(t);if(r<0||r==1/0)throw II("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},TI=W,DI=jr,_I=gh,bI=ut,CI=TI(EI),RI=TI("".slice),SI=Math.ceil,wI=function(t){return function(e,n,r){var i,a,o=_I(bI(e)),s=DI(n),c=o.length,u=void 0===r?" ":_I(r);return s<=c||""==u?o:((a=CI(u,SI((i=s-c)/u.length))).length>i&&(a=RI(a,0,i)),t?o+a:a+o)}},xI=W,kI=A,OI={start:wI(!1),end:wI(!0)}.start,LI=RangeError,AI=isFinite,NI=Math.abs,UI=Date.prototype,MI=UI.toISOString,PI=xI(UI.getTime),jI=xI(UI.getUTCDate),VI=xI(UI.getUTCFullYear),GI=xI(UI.getUTCHours),HI=xI(UI.getUTCMilliseconds),FI=xI(UI.getUTCMinutes),KI=xI(UI.getUTCMonth),BI=xI(UI.getUTCSeconds),zI=kI((function(){return"0385-07-25T07:06:39.999Z"!=MI.call(new Date(-50000000000001))}))||!kI((function(){MI.call(new Date(NaN))}))?function(){if(!AI(PI(this)))throw LI("Invalid time value");var t=this,e=VI(t),n=HI(t),r=e<0?"-":e>9999?"+":"";return r+OI(NI(e),r?6:4,0)+"-"+OI(KI(t)+1,2,0)+"-"+OI(jI(t),2,0)+"T"+OI(GI(t),2,0)+":"+OI(FI(t),2,0)+":"+OI(BI(t),2,0)+"."+OI(n,3,0)+"Z"}:MI;wi({target:"Date",proto:!0,forced:Date.prototype.toISOString!==zI},{toISOString:zI});var $I=W,JI=he,YI=Math.floor,qI=$I("".charAt),WI=$I("".replace),XI=$I("".slice),QI=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ZI=/\$([$&'`]|\d{1,2})/g,tE=fs,eE=j,nE=W,rE=Tm,iE=A,aE=cn,oE=gt,sE=ot,cE=Or,uE=jr,lE=gh,hE=ut,fE=_m,dE=Wt,pE=function(t,e,n,r,i,a){var o=n+t.length,s=r.length,c=ZI;return void 0!==i&&(i=JI(i),c=QI),WI(a,c,(function(a,c){var u;switch(qI(c,0)){case"$":return"$";case"&":return t;case"`":return XI(e,0,n);case"'":return XI(e,o);case"<":u=i[XI(c,1,-1)];break;default:var l=+c;if(0===l)return a;if(l>s){var h=YI(l/10);return 0===h?a:h<=s?void 0===r[h-1]?qI(c,1):r[h-1]+qI(c,1):a}u=r[l-1]}return void 0===u?"":u}))},vE=km,gE=xe("replace"),yE=Math.max,mE=Math.min,IE=nE([].concat),EE=nE([].push),TE=nE("".indexOf),DE=nE("".slice),_E="$0"==="a".replace(/./,"$0"),bE=!!/./[gE]&&""===/./[gE]("a","$0");function CE(t,e){t=t.split("."),e=e.split(".");for(var n=Math.max(t.length,e.length);t.lengtha)return 1;if(i=v&&(p+=DE(o,v,m)+_,v=m+y.length)}return p+DE(o,v)}]}),!!iE((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!_E||bE);var RE="TRTC-ROOM",SE=wx||qq;SE||console.error(RE,"不支持当前小程序环境");var wE,xE=SE.getSystemInfoSync(),kE=xE.safeArea;("iOS 13.3"===xE.system||"iPhoneX"===xE.model&&"iOS 13.3.1"===xE.system)&&console.log("use media audio volume type"),console.log(RE,"SystemInfo",xE),"undefined"!=typeof qq?wE=!0:"undefined"!=typeof wx&&(wE=CE(xE.version,"7.0.8")>=0||CE(xE.version,"2.4.0")>=0&&CE(xE.version,"6.0.0")<0&&CE(xE.SDKVersion,"2.10.0")>=0);var OE=wE,LE="undefined"!=typeof uni,AE=/iOS/i.test(xE.system),NE=/Android/i.test(xE.system);/mac/i.test(xE.system);var UE=xE.version,ME=xE.SDKBuild?"".concat(xE.SDKVersion,"-").concat(xE.SDKBuild):xE.SDKVersion;xE.screenHeight,kE.bottom,console.log(RE,"APP_VERSION:",UE," LIB_VERSION:",ME," is new version:",OE);var PE=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"array"===function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()}(t)},jE=function(t){return null!==t&&("number"==typeof t&&!isNaN(t-0)||"object"===o(t)&&t.constructor===Number)},VE=function(t){return"string"==typeof t},GE=function(t){return PE(t)||function(t){return null!==t&&"object"===o(t)}(t)},HE=0;Date.now||(Date.now=function(){return(new Date).getTime()});var FE=function(){0===HE&&(HE=Date.now()-1);var t=Date.now()-HE;return t>4294967295?(HE+=4294967295,Date.now()-HE):t},KE=function(t){return JSON.stringify(t,["message","code"])};function BE(){var t="unknown";return AE&&(t="ios"),NE&&(t="android"),t}var zE=-1,$E=0,JE=1,YE=2,qE=3,WE=$E,XE=new Map;function QE(){var t=new Date;return"TUICallEngine ".concat(t.toLocaleTimeString("en-US",{hour12:!1}),".").concat(function(t){var e;switch(t.toString().length){case 1:e="00".concat(t);break;case 2:e="0".concat(t);break;default:e=t}return e}(t.getMilliseconds()),":")}var ZE={_data:[],_length:0,_visible:!1,arguments2String:function(t){var e;if(1===t.length)e=QE()+t[0];else{e=QE();for(var n=0,r=t.length;n-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",i)),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}},{key:"setEnd",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.endts=Date.now(),e?this._eventStatController.pushIn(this):setTimeout((function(){t._eventStatController.pushIn(t)}),0)}},{key:"setError",value:function(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(tT),this.setMessage(nT)),this}},{key:"setCode",value:function(t){return"ECONNABORTED"===t&&(this.codeint=103),jE(t)?this.codeint=t:ZE.warn("SSOLogData.setCode value not a number, please check!",t,o(t)),this}},{key:"setMessage",value:function(t){return VE(t)?(this.message=t,this):this}},{key:"setText",value:function(t){return jE(t)?this.text=t.toString():VE(t)&&(this.text=t),this}},{key:"setTalkTime",value:function(t){return this.talktime=t,this}},{key:"setMessageType",value:function(t){return this.msgType=t,this}},{key:"setCallType",value:function(t){return this.calltype=t,this}},{key:"setNetworkType",value:function(t){return void 0===t?ZE.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=t,this}}],[{key:"bindController",value:function(e){t.prototype._eventStatController=e}}]),t}(),iT={SDK_CONSTRUCT:"sdkConstruct",SDK_READY:"sdkReady",SDK_NOT_READY:"sdkNotReady",LOGIN:"login",LOGOUT:"logout",CALL:"call",GROUP_CALL:"groupCall",ACCEPT:"accept",REJECT:"reject",HANGUP:"hangup",START_REMOTE_VIEW:"startRemoteView",STOP_REMOTE_VIEW:"stopRemoteView",START_LOCAL_VIEW:"startLocalView",STOP_LOCAL_VIEW:"stopLocalView",OPEN_CAMERA:"openCamera",CLOSE_CAMERA:"closeCamera",SET_MIC_MUTE:"setMicMute",SET_VIDEO_QUALITY:"setVideoQuality",SWITCH_TO_AUDIO_CALL:"switchToAudioCall",SWITCH_TO_VIDEO_CALL:"switchToVideoCall",CHANGE_CALL_STATUS:"changeCallStatus",TALK_TIME:"talktime",ERROR:"error",INVITED:"invited",GROUP_CALL_INVITEE_LIST_UPDATE:"group_call_invitee_list_update",USER_ENTER:"user_enter",USER_LEAVE:"user_leave",NO_RESP:"no_resp",LINE_BUSY:"line_busy",CALLING_CANCEL:"calling_cancel",KICKED_OUT:"kicked_out",CALLING_TIMEOUT:"calling_timeout",CALLING_END:"calling_end",USER_VIDEO_AVAILABLE:"user_video_available",USER_AUDIO_AVAILABLE:"user_audio_available",USER_VOICE_VOLUME:"user_voice_volume",CALL_TYPE_CHANGED:"call_type_changed",DEVICED_UPDATED:"deviced_updated",QUALITY_REPORT:"quality_report"},aT=function(){function t(){u(this,t),this._table="timweb-trtccalling",this._report=[]}return h(t,[{key:"pushIn",value:function(t){ZE.debug("SSOLogBody.pushIn",this._report.length,t),this._report.push(t)}},{key:"backfill",value:function(t){var e;PE(t)&&0!==t.length&&(ZE.debug("SSOLogBody.backfill",this._report.length,t.length),(e=this._report).unshift.apply(e,D(t)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getTable",value:function(){return this._table}},{key:"getLogsInMemory",value:function(){var t=this._report.slice();return this._reset(),t}}]),t}(),oT={CURRENT:{COMMON:"https://webim.tim.qq.com"},PRODUCTION:{COMMON:"https://webim.tim.qq.com"}},sT={IM_OPEN_STAT:"imopenstat"},cT={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},uT={imopenstat:"v4"},lT=function(){function t(){u(this,t),this.TAG="trtccalling-ssolog-event",this._reportBody=new aT,this._version=ly,this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}return h(t,[{key:"reportAtOnce",value:function(){ZE.debug("EventStatController.reportAtOnce"),this._report()}},{key:"pushIn",value:function(t){t instanceof rT&&(t.setCommonInfo({SDKAppID:Number(wx.getStorageSync("sdkAppId")),version:this._version,userID:wx.getStorageSync("userId")}),this._reportBody.pushIn(t),this._report())}},{key:"_resetLastReportTime",value:function(){this._lastReportTime=Date.now()}},{key:"_startReportTimer",value:function(){var t=this;this._timerID=setInterval((function(){Date.now()0&&(clearInterval(this._timerID),this._timerID=0)}},{key:"_report",value:function(){var t=this;if(!this._reportBody.isEmpty()){var e=Math.ceil(+new Date/1e3),n=wx.getStorageSync("sdkAppId"),r=this._reportBody.getLogsInMemory(),i={table:this._reportBody.getTable(),report:r},a=oT.CURRENT.COMMON,o=uT.imopenstat,s=sT.IM_OPEN_STAT,c=cT.TIM_WEB_TRTCCALLING_REPORT,u="".concat(a,"/").concat(o,"/").concat(s,"/").concat(c,"/?sdkappid=").concat(n,"&reqtime=").concat(e);wx.request({url:u,method:"POST",data:JSON.stringify(i),header:{"content-type":"application/json"},success:function(e){t._retryCount>0&&(ZE.debug("EventStatController.report retry success"),t._retryCount=0)},fail:function(e){ZE.warn("EventStatController.report, error:".concat(KE(e))),t._reportBody.backfill(r),t._reportBody.getLogsNumInMemory()>t.MAX_THRESHOLD||t._retryCount===t.MAX_RETRY_COUNT||0===t._timerID?t._retryCount=0:t._retryCount+=1}})}}},{key:"reset",value:function(){ZE.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}]),t}(),hT=zr.includes,fT=nd;wi({target:"Array",proto:!0,forced:A((function(){return!Array(1).includes()}))},{includes:function(t){return hT(this,t,arguments.length>1?arguments[1]:void 0)}}),fT("includes");var dT=It,pT=tt,vT=xe("match"),gT=function(t){var e;return dT(t)&&(void 0!==(e=t[vT])?!!e:"RegExp"==pT(t))},yT=gT,mT=TypeError,IT=xe("match"),ET=wi,TT=function(t){if(yT(t))throw mT("The method doesn't accept regular expressions");return t},DT=ut,_T=gh,bT=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[IT]=!1,"/./"[t](e)}catch(t){}}return!1},CT=W("".indexOf);ET({target:"String",proto:!0,forced:!bT("includes")},{includes:function(t){return!!~CT(_T(DT(this)),_T(TT(t)),arguments.length>1?arguments[1]:void 0)}});var RT=W,ST=Iv,wT=gp.exports.getWeakData,xT=ts,kT=cn,OT=ot,LT=It,AT=yl,NT=pe,UT=ir.set,MT=ir.getterFor,PT=Qa.find,jT=Qa.findIndex,VT=RT([].splice),GT=0,HT=function(t){return t.frozen||(t.frozen=new FT)},FT=function(){this.entries=[]},KT=function(t,e){return PT(t.entries,(function(t){return t[0]===e}))};FT.prototype={get:function(t){var e=KT(this,t);if(e)return e[1]},has:function(t){return!!KT(this,t)},set:function(t,e){var n=KT(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=jT(this.entries,(function(e){return e[0]===t}));return~e&&VT(this.entries,e,1),!!~e}};var BT,zT={getConstructor:function(t,e,n,r){var i=t((function(t,i){xT(t,a),UT(t,{type:e,id:GT++,frozen:void 0}),OT(i)||AT(i,t[r],{that:t,AS_ENTRIES:n})})),a=i.prototype,o=MT(e),s=function(t,e,n){var r=o(t),i=wT(kT(e),!0);return!0===i?HT(r).set(e,n):i[r.id]=n,t};return ST(a,{delete:function(t){var e=o(this);if(!LT(t))return!1;var n=wT(t);return!0===n?HT(e).delete(t):n&&NT(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!LT(t))return!1;var n=wT(t);return!0===n?HT(e).has(t):n&&NT(n,e.id)}}),ST(a,n?{get:function(t){var e=o(this);if(LT(t)){var n=wT(t);return!0===n?HT(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return s(this,t,e)}}:{add:function(t){return s(this,t,!0)}}),i}},$T=Mp,JT=O,YT=W,qT=Iv,WT=gp.exports,XT=yv,QT=zT,ZT=It,tD=ir.enforce,eD=A,nD=Vn,rD=Object,iD=Array.isArray,aD=rD.isExtensible,oD=rD.isFrozen,sD=rD.isSealed,cD=rD.freeze,uD=rD.seal,lD={},hD={},fD=!JT.ActiveXObject&&"ActiveXObject"in JT,dD=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},pD=XT("WeakMap",dD,QT),vD=pD.prototype,gD=YT(vD.set);if(nD)if(fD){BT=QT.getConstructor(dD,"WeakMap",!0),WT.enable();var yD=YT(vD.delete),mD=YT(vD.has),ID=YT(vD.get);qT(vD,{delete:function(t){if(ZT(t)&&!aD(t)){var e=tD(this);return e.frozen||(e.frozen=new BT),yD(this,t)||e.frozen.delete(t)}return yD(this,t)},has:function(t){if(ZT(t)&&!aD(t)){var e=tD(this);return e.frozen||(e.frozen=new BT),mD(this,t)||e.frozen.has(t)}return mD(this,t)},get:function(t){if(ZT(t)&&!aD(t)){var e=tD(this);return e.frozen||(e.frozen=new BT),mD(this,t)?ID(this,t):e.frozen.get(t)}return ID(this,t)},set:function(t,e){if(ZT(t)&&!aD(t)){var n=tD(this);n.frozen||(n.frozen=new BT),mD(this,t)?gD(this,t,e):n.frozen.set(t,e)}else gD(this,t,e);return this}})}else $T&&eD((function(){var t=cD([]);return gD(new pD,t,1),!oD(t)}))&&qT(vD,{set:function(t,e){var n;return iD(t)&&(oD(t)?n=lD:sD(t)&&(n=hD)),gD(this,t,e),n==lD&&cD(t),n==hD&&uD(t),this}});var ED=Qa.some;wi({target:"Array",proto:!0,forced:!Ua("some")},{some:function(t){return ED(this,t,arguments.length>1?arguments[1]:void 0)}});var TD=Jt,DD=he,_D=at,bD=Gr,CD=TypeError,RD=function(t){return function(e,n,r,i){TD(n);var a=DD(e),o=_D(a),s=bD(a),c=t?s-1:0,u=t?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=u;break}if(c+=u,t?c<0:s<=c)throw CD("Reduce of empty array with no initial value")}for(;t?c>=0:s>c;c+=u)c in o&&(i=n(i,o[c],c,a));return i}},SD={left:RD(!1),right:RD(!0)}.left;wi({target:"Array",proto:!0,forced:!Uo&&Lt>79&&Lt<83||!Ua("reduce")},{reduce:function(t){var e=arguments.length;return SD(this,t,e,e>1?arguments[1]:void 0)}});var wD=wi,xD=W,kD=Or,OD=Hm,LD=EI,AD=A,ND=RangeError,UD=String,MD=Math.floor,PD=xD(LD),jD=xD("".slice),VD=xD(1..toFixed),GD=function(t,e,n){return 0===e?n:e%2==1?GD(t,e-1,n*t):GD(t*t,e/2,n)},HD=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=MD(i/1e7)},FD=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=MD(r/e),r=r%e*1e7},KD=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var r=UD(t[e]);n=""===n?r:n+PD("0",7-r.length)+r}return n};wD({target:"Number",proto:!0,forced:AD((function(){return"0.000"!==VD(8e-5,3)||"1"!==VD(.9,0)||"1.25"!==VD(1.255,2)||"1000000000000000128"!==VD(0xde0b6b3a7640080,0)}))||!AD((function(){VD({})}))},{toFixed:function(t){var e,n,r,i,a=OD(this),o=kD(t),s=[0,0,0,0,0,0],c="",u="0";if(o<0||o>20)throw ND("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return UD(a);if(a<0&&(c="-",a=-a),a>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(a*GD(2,69,1))-69)<0?a*GD(2,-e,1):a/GD(2,e,1),n*=4503599627370496,(e=52-e)>0){for(HD(s,0,n),r=o;r>=7;)HD(s,1e7,0),r-=7;for(HD(s,GD(10,r,1),0),r=e-1;r>=23;)FD(s,1<<23),r-=23;FD(s,1<0?c+((i=u.length)<=o?"0."+PD("0",o-i)+u:jD(u,0,i-o)+"."+jD(u,i-o)):c+u}});var BD=O,zD=A,$D=gh,JD=$g.trim,YD=Pg,qD=W("".charAt),WD=BD.parseFloat,XD=BD.Symbol,QD=XD&&XD.iterator,ZD=1/WD(YD+"-0")!=-1/0||QD&&!zD((function(){WD(Object(QD))}))?function(t){var e=JD($D(t)),n=WD(e);return 0===n&&"-"==qD(e,0)?-0:n}:WD;wi({global:!0,forced:parseFloat!=ZD},{parseFloat:ZD});var t_=wi,e_=at,n_=ft,r_=Ua,i_=W([].join);t_({target:"Array",proto:!0,forced:e_!=Object||!r_("join",",")},{join:function(t){return i_(n_(this),void 0===t?",":t)}});var a_=N,o_=xn.EXISTS,s_=W,c_=nn.f,u_=Function.prototype,l_=s_(u_.toString),h_=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,f_=s_(h_.exec);a_&&!o_&&c_(u_,"name",{configurable:!0,get:function(){try{return f_(h_,l_(this))[1]}catch(t){return""}}});var d_=xn.PROPER,p_=A,v_=Pg,g_=$g.trim;wi({target:"String",proto:!0,forced:function(t){return p_((function(){return!!v_[t]()||"​…᠎"!=="​…᠎"[t]()||d_&&v_[t].name!==t}))}("trim")},{trim:function(){return g_(this)}});var y_=nn.f,m_=N,I_=O,E_=W,T_=Ei,D_=ev,__=Dn,b_=Sr.f,C_=bt,R_=gT,S_=gh,w_=Ey,x_=Vy,k_=function(t,e,n){n in t||y_(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})},O_=Rr,L_=A,A_=pe,N_=ir.enforce,U_=Xo,M_=Fy,P_=zy,j_=xe("match"),V_=I_.RegExp,G_=V_.prototype,H_=I_.SyntaxError,F_=E_(G_.exec),K_=E_("".charAt),B_=E_("".replace),z_=E_("".indexOf),$_=E_("".slice),J_=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Y_=/a/g,q_=/a/g,W_=new V_(Y_)!==Y_,X_=x_.MISSED_STICKY,Q_=x_.UNSUPPORTED_Y,Z_=m_&&(!W_||X_||M_||P_||L_((function(){return q_[j_]=!1,V_(Y_)!=Y_||V_(q_)==q_||"/a/i"!=V_(Y_,"i")})));if(T_("RegExp",Z_)){for(var tb=function(t,e){var n,r,i,a,o,s,c=C_(G_,this),u=R_(t),l=void 0===e,h=[],f=t;if(!c&&u&&l&&t.constructor===tb)return t;if((u||C_(G_,t))&&(t=t.source,l&&(e=w_(f))),t=void 0===t?"":S_(t),e=void 0===e?"":S_(e),f=t,M_&&"dotAll"in Y_&&(r=!!e&&z_(e,"s")>-1)&&(e=B_(e,/s/g,"")),n=e,X_&&"sticky"in Y_&&(i=!!e&&z_(e,"y")>-1)&&Q_&&(e=B_(e,/y/g,"")),P_&&(a=function(t){for(var e,n=t.length,r=0,i="",a=[],o={},s=!1,c=!1,u=0,l="";r<=n;r++){if("\\"===(e=K_(t,r)))e+=K_(t,++r);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:F_(J_,$_(t,r+1))&&(r+=2,c=!0),i+=e,u++;continue;case">"===e&&c:if(""===l||A_(o,l))throw new H_("Invalid capture group name");o[l]=!0,a[a.length]=[l,u],c=!1,l="";continue}c?l+=e:i+=e}return[i,a]}(t),t=a[0],h=a[1]),o=D_(V_(t,e),c?this:G_,tb),(r||i||h.length)&&(s=N_(o),r&&(s.dotAll=!0,s.raw=tb(function(t){for(var e,n=t.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(e=K_(t,r))?a||"."!==e?("["===e?a=!0:"]"===e&&(a=!1),i+=e):i+="[\\s\\S]":i+=e+K_(t,++r);return i}(t),n)),i&&(s.sticky=!0),h.length&&(s.groups=h)),t!==f)try{__(o,"source",""===f?"(?:)":f)}catch(t){}return o},eb=b_(V_),nb=0;eb.length>nb;)k_(tb,V_,eb[nb++]);G_.constructor=tb,tb.prototype=G_,O_(I_,"RegExp",tb,{constructor:!0})}U_("RegExp");var rb=_n.exports,ib=nn,ab=N,ob=function(t,e,n){return n.get&&rb(n.get,e,{getter:!0}),n.set&&rb(n.set,e,{setter:!0}),ib.f(t,e,n)},sb=py,cb=A,ub=O.RegExp,lb=ub.prototype;ab&&cb((function(){var t=!0;try{ub(".","d")}catch(e){t=!1}var e={},n="",r=t?"dgimsy":"gimsy",i=function(t,r){Object.defineProperty(e,t,{get:function(){return n+=r,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in t&&(a.hasIndices="d"),a)i(o,a[o]);return Object.getOwnPropertyDescriptor(lb,"flags").get.call(e)!==r||n!==r}))&&ob(lb,"flags",{configurable:!0,get:sb});var hb=_p,fb=Math.floor,db=function(t,e){var n=t.length,r=fb(n/2);return n<8?pb(t,e):vb(t,db(hb(t,0,r),e),db(hb(t,r),e),e)},pb=function(t,e){for(var n,r,i=t.length,a=1;a0;)t[r]=t[--r];r!==a++&&(t[r]=n)}return t},vb=function(t,e,n,r){for(var i=e.length,a=n.length,o=0,s=0;o3)){if(Ab)return!0;if(Ub)return Ub<603;var t,e,n,r,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)Mb.push({k:e+r,v:n})}for(Mb.sort((function(t,e){return e.v-t.v})),r=0;rwb(n)?1:-1}}(t)),n=Rb(i),r=0;ro&&(r=e.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",u.push(i.format(r,{count:o}))),u.length>0?e.message||u:void 0):e.message||this.notValid||"has an incorrect length"}},numericality:function(t,e,n,r,a){if(i.isDefined(t)){var o,s,c=[],u={greaterThan:function(t,e){return t>e},greaterThanOrEqualTo:function(t,e){return t>=e},equalTo:function(t,e){return t===e},lessThan:function(t,e){return to&&(n=e.tooLate||e.message||this.tooLate||"must be no later than %{date}",n=i.format(n,{date:this.format(o,e),value:this.format(t,e)}),r.push(n)),r.length?i.unique(r):void 0)}}),{parse:null,format:null}),date:function(t,e){return e=i.extend({},e,{dateOnly:!0}),i.validators.datetime.call(i.validators.datetime,t,e)},format:function(t,e){(i.isString(e)||e instanceof RegExp)&&(e={pattern:e});var n,r=(e=i.extend({},this.options,e)).message||this.message||"is invalid",a=e.pattern;if(i.isDefined(t))return i.isString(t)?(i.isString(a)&&(a=new RegExp(e.pattern,e.flags)),(n=a.exec(t))&&n[0].length==t.length?void 0:r):r},inclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),!i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is not included in the list";return i.format(n,{value:t})}},exclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is restricted";return i.isString(e.within[t])&&(t=e.within[t]),i.format(n,{value:t})}},email:i.extend((function(t,e){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid email";if(i.isDefined(t))return i.isString(t)&&this.PATTERN.exec(t)?void 0:n}),{PATTERN:/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(t,e,n,r,a){if(i.isDefined(t)){i.isString(e)&&(e={attribute:e});var o=(e=i.extend({},this.options,e)).message||this.message||"is not equal to %{attribute}";if(i.isEmpty(e.attribute)||!i.isString(e.attribute))throw new Error("The attribute must be a non empty string");var s=i.getDeepObjectValue(r,e.attribute),c=e.comparator||function(t,e){return t===e},u=e.prettify||a&&a.prettify||i.prettify;return c(t,s,e,n,r)?void 0:i.format(o,{attribute:u(e.attribute)})}},url:function(t,e){if(i.isDefined(t)){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid url",r=e.schemes||this.schemes||["http","https"],a=e.allowLocal||this.allowLocal||!1,o=e.allowDataUrl||this.allowDataUrl||!1;if(!i.isString(t))return n;var s="^(?:(?:"+r.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",c="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";return a?c+="?":s+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",s+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+c+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",o&&(s="(?:"+s+")|(?:^data:(?:\\w+\\/[-+.\\w]+(?:;[\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*$)"),new RegExp(s,"i").exec(t)?void 0:n}},type:i.extend((function(t,e,n,r,a){if(i.isString(e)&&(e={type:e}),i.isDefined(t)){var o,s=i.extend({},this.options,e),c=s.type;if(!i.isDefined(c))throw new Error("No type was specified");if(o=i.isFunction(c)?c:this.types[c],!i.isFunction(o))throw new Error("validate.validators.type.types."+c+" must be a function.");if(!o(t,s,n,r,a)){var u=e.message||this.messages[c]||this.message||s.message||(i.isFunction(c)?"must be of the correct type":"must be of type %{type}");return i.isFunction(u)&&(u=u(t,e,n,r,a)),i.format(u,{attribute:i.prettify(n),type:c})}}}),{types:{object:function(t){return i.isObject(t)&&!i.isArray(t)},array:i.isArray,integer:i.isInteger,number:i.isNumber,string:i.isString,date:i.isDate,boolean:i.isBoolean},messages:{}})},r.formatters={detailed:function(t){return t},flat:i.flattenErrorsToArray,grouped:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=i.flattenErrorsToArray(t[e]);return t},constraint:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=t[e].map((function(t){return t.validator})).sort();return t}},r.exposeModule(r,this,t,e,n)}).call(x,Kb.exports,Kb,null);var Bb=Kb.exports,zb="number",$b="string",Jb="object",Yb="function",qb="array",Wb={createInstance:{sdkAppID:{presence:!0,type:zb},tim:{type:Jb}},destroyInstance:{},init:{userID:{presence:!0,type:$b},userSig:{presence:!0,type:$b}},on:{eventCode:{presence:!0,type:$b},handler:{presence:!0,type:Yb},context:{presence:!0,type:Jb}},off:{eventCode:{presence:!0,type:$b},handler:{presence:!0,type:Yb}},call:{userID:{presence:!0,type:$b},type:{presence:!0,type:zb}},groupCall:{groupID:{presence:!0,type:$b},type:{presence:!0,type:zb},userIDList:{presence:!0,type:qb}},joinInGroupCall:{groupID:{presence:!0,type:$b},type:{presence:!0,type:zb},roomID:{presence:!0,type:zb}},inviteUser:{userIDList:{presence:!0,type:qb}},accept:{},reject:{},hangup:{},switchCallMediaType:{type:{presence:!0,type:zb}},openCamera:{},closeCamera:{},switchCamera:{},openMicrophone:{},closeMicrophone:{},selectAudioPlaybackDevice:{type:{presence:!0,type:$b}},setSelfInfo:{nickName:{presence:!0,type:$b},avatar:{presence:!0,type:$b}}},Xb={createInstance:"",destroyInstance:"",init:"",on:"",off:"",call:[ig.IDLE],groupCall:[ig.IDLE],accept:[ig.CALLING],reject:[ig.CALLING],hangup:[ig.CALLING,ig.CONNECTED],switchCallMediaType:[ig.CALLING,ig.CONNECTED],joinInGroupCall:[ig.IDLE],inviteUser:[ig.CALLING,ig.CONNECTED],openCamera:[ig.CALLING,ig.CONNECTED],closeCamera:[ig.CALLING,ig.CONNECTED],switchCamera:[ig.CALLING,ig.CONNECTED],openMicrophone:[ig.CALLING,ig.CONNECTED],closeMicrophone:[ig.CALLING,ig.CONNECTED],selectAudioPlaybackDevice:[ig.CALLING,ig.CONNECTED],setSelfInfo:""},Qb={createInstance:!1,destroyInstance:!0,init:!1,on:!0,off:!0,call:!0,groupCall:!0,joinInGroupCall:!0,inviteUser:!0,accept:!0,reject:!0,hangup:!0,switchCallMediaType:!0,openCamera:!0,closeCamera:!0,switchCamera:!0,openMicrophone:!0,closeMicrophone:!0,selectAudioPlaybackDevice:!0,setSelfInfo:!0},Zb=function(t){d(n,m(Error));var e=T(n);function n(t,r,i){var a;return u(this,n),f(E(a=e.call(this,r)),"code",void 0),f(E(a),"message",void 0),f(E(a),"data",void 0),a.code=t,a.message=r,a.data=i,a}return h(n,null,[{key:"error",value:function(t,e,r){return r?new n(t,e,r):new n(t,e)}}]),n}();Bb.validators.type.types.function=function(t){return t instanceof Function};var tC=function(){function t(){u(this,t),f(this,"paramsMatchedRule",Wb),f(this,"statusMatchedRule",Xb),f(this,"requireInit",Qb)}return h(t,[{key:"getParamsMatchedRule",value:function(t){return this.paramsMatchedRule[t]}},{key:"getStatusMatchedRule",value:function(t){return this.statusMatchedRule[t]}},{key:"getInitReadyRule",value:function(t){return this.requireInit[t]}}]),t}(),eC=function(){function t(){u(this,t)}return h(t,[{key:"notify",value:function(t,e,n){throw Zb.error(e,"[TUICallEngine:".concat(t.api,",").concat(e,"]").concat(n))}}]),t}(),nC=h((function t(e){u(this,t),f(this,"api",""),f(this,"attributes",{}),f(this,"callStatus",""),f(this,"capabilityCode",void 0),f(this,"checkDevicePermissions",void 0),f(this,"checkMicrophonePermissions",void 0),f(this,"checkCameraPermissions",void 0),f(this,"initReady",void 0),this.api=e.api,this.attributes=e.attributes,this.callStatus=e.callStatus,this.capabilityCode=e.capabilityCode,this.checkDevicePermissions=e.checkDevicePermissions,this.checkMicrophonePermissions=e.checkMicrophonePermissions,this.checkCameraPermissions=e.checkCameraPermissions,this.initReady=e.initReady})),rC=new WeakMap,iC=function(){function t(){u(this,t),w(this,rC,{writable:!0,value:void 0}),R(this,rC,[])}var e;return h(t,[{key:"addAlertHandler",value:function(t){C(this,rC).push(t)}},{key:"check",value:(e=c(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r1&&void 0!==r[1]?r[1]:{},!e.capabilityCode){t.next=14;break}return t.prev=2,t.next=5,n.tim.callExperimentalAPI("isCommercialAbilityEnabled",e.capabilityCode);case 5:!1===t.sent.data.enabled&&this.notification.notify(e,_g.ERROR_PACKAGE_NOT_SUPPORTED,bg.ERROR_PACKAGE_NOT_SUPPORTED),t.next=14;break;case 9:t.prev=9,t.t0=t.catch(2),wx.$TUICallEngine._callDataReport.setCodeAndMessage(_g.ERROR_PACKAGE_NOT_SUPPORTED,JSON.stringify(t.t0)),wx.$TUICallEngine._callDataReport.uploadToKibana(),2905===t.t0.code?this.notification.notify(e,_g.ERROR_TIM_VERSION_OUTDATED,bg.ERROR_TIM_VERSION_OUTDATED):this.notification.notify(e,_g.ERROR_PACKAGE_NOT_SUPPORTED,bg.ERROR_PACKAGE_NOT_SUPPORTED);case 14:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return e.apply(this,arguments)})}]),r}(),uC=function(t){d(r,aC);var e,n=T(r);function r(t,e){return u(this,r),n.call(this,t,e)}return h(r,[{key:"check",value:(e=c(a().mark((function t(e,n){var r=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.checkDevicePermissions){t.next=5;break}return wx.authorize({scope:"scope.record"}),wx.authorize({scope:"scope.camera"}),t.next=5,wx.getSetting().then((function(t){t.authSetting["scope.camera"]&&t.authSetting["scope.record"]||r.notification.notify(e,_g.ERROR_PERMISSION_DENIED,bg.ERROR_PERMISSION_DENIED)}));case 5:if(!e.checkMicrophonePermissions){t.next=9;break}return wx.authorize({scope:"scope.record"}),t.next=9,wx.getSetting().then((function(t){t.authSetting["scope.record"]||r.notification.notify(e,_g.ERROR_PERMISSION_DENIED,bg.ERROR_PERMISSION_DENIED)}));case 9:if(!e.checkCameraPermissions){t.next=13;break}return wx.authorize({scope:"scope.camera"}),t.next=13,wx.getSetting().then((function(t){t.authSetting["scope.camera"]||r.notification.notify(e,_g.ERROR_PERMISSION_DENIED,bg.ERROR_PERMISSION_DENIED)}));case 13:case"end":return t.stop()}}),t)}))),function(t,n){return e.apply(this,arguments)})}]),r}(),lC=function(t){d(n,aC);var e=T(n);function n(t,r){return u(this,n),e.call(this,t,r)}return h(n,[{key:"check",value:function(t,e){void 0!==t.initReady&&this.rule.getInitReadyRule(t.api)!==t.initReady&&this.notification.notify(t,_g.ERROR_INIT_FAIL,bg.ERROR_INIT_FAIL)}}]),n}(),hC=function(){function t(){u(this,t),f(this,"alertRule",void 0),f(this,"notification",void 0),f(this,"alert",void 0)}return h(t,[{key:"initializeBeans",value:function(){this.alertRule=new tC,this.notification=new eC,this.alert=new iC,this.alert.addAlertHandler(new oC(this.alertRule,this.notification)),this.alert.addAlertHandler(new lC(this.alertRule,this.notification)),this.alert.addAlertHandler(new cC(this.alertRule,this.notification)),this.alert.addAlertHandler(new uC(this.alertRule,this.notification)),this.alert.addAlertHandler(new sC(this.alertRule,this.notification))}},{key:"getAlert",value:function(){return this.alert}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new t,this.instance.initializeBeans()),this.instance}}]),t}();f(hC,"instance",void 0);var fC=W,dC=Jt,pC=It,vC=pe,gC=ps,yC=U,mC=Function,IC=fC([].concat),EC=fC([].join),TC={},DC=function(t,e,n){if(!vC(TC,e)){for(var r=[],i=0;i1)){t.next=16;break}return t.abrupt("return");case 16:if(s){t.next=22;break}return this.TRTCCallingDelegate.onCallEnd(u),t.next=20,this._resetTUICallEngine();case 20:case 31:t.next=45;break;case 22:if(this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),d=this.getHandledInviteeList(),p=this.getUnHandledInviteeList(),!c){t.next=33;break}if(1!==d.length||0!==p.length){t.next=31;break}return this.TRTCCallingDelegate.onCallEnd(u),t.next=31,this._resetTUICallEngine();case 33:if(r!==ig.CALLING){t.next=40;break}if(-1!==o.indexOf(this.getUserID())&&this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),0!==d.length||1!==p.length){t.next=40;break}return this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()}),t.next=40,this._resetTUICallEngine();case 40:if(r!==ig.CONNECTED){t.next=45;break}if(1!==d.length||0!==p.length){t.next=45;break}return this.TRTCCallingDelegate.onCallEnd(u),t.next=45,this._resetTUICallEngine();case 45:case"end":return t.stop()}}),t,this)}))),function(t){return B.apply(this,arguments)})},{key:"handleSwitchCallModeTSignaling",value:(K=c(a().mark((function t(e,n){var r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={inviteID:e,type:n.call_type},i={cmd:"switchToVideo"},n.call_type===hg.VIDEO&&(r.switch_to_audio_call="switch_to_audio_call",i.cmd="switchToAudio"),t.next=5,this.TSignalingClient.accept(r,i);case 5:o=t.sent,this.setSwitchCallModeStatus(!1),this.handleCallMode(n.call_type,o);case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return K.apply(this,arguments)})},{key:"judgeSwitchCallMode",value:function(t){return t.switch_to_audio_call&&"switch_to_audio_call"===t.switch_to_audio_call||t.data&&"switchToAudio"===t.data.cmd||t.data&&"switchToVideo"===t.data.cmd}},{key:"handleCallMode",value:function(t,e){ZE.log("".concat(RC,".handleCallMode - type"),t);var n=t!==hg.VIDEO;this.setPusherAttributesHandler({enableCamera:n}),n?(this.data.config.type=hg.VIDEO,this.data.invitation.type=hg.VIDEO):(this.data.config.type=hg.AUDIO,this.data.invitation.type=hg.AUDIO),this.TRTCCallingDelegate.onCallMode({type:this.data.config.type,message:e.data.message}),this.setSwitchCallModeStatus(!0)}},{key:"handleInvitedSignal",value:function(t){var e=t.inviter,n=t.inviteeList,r=t.isGroupCall,a=t.groupID,o=t.inviteID,s=t.inviteData,c=t.inCallUserIDs,u=void 0===c?[]:c;this.data.remoteID=e,this.data.config.type=s.call_type,this.data.invitation.inviteID=o,this.data.invitation.inviter=e,this.data.invitation.type=s.call_type,this.data.invitation.roomID=s.room_id,this.data.isInviter=!1,this.data.isGroupCall=r,this.addHandledInviteeList([e]),this.addUnHandledInviteeList([].concat(D(n),D(u))),this.addAcceptedUserList(o,[e]),this.addInviterInviteId(o,[e].concat(D(n)));var l=u.filter((function(t){return-1===n.indexOf(t)}));r&&(this.data.groupID=a),this.changeCallStatus(ig.CALLING),ZE.log("".concat(RC," NEW_INVITATION_RECEIVED invitation: "),this.data.callStatus,this.data.invitation);var h={sponsor:e,inviteeList:n,userIDList:[].concat(D(n),D(l)),isFromGroup:r,inviteID:o,groupID:a,inviteData:{version:s.version,callType:s.call_type,roomID:s.room_id}};this.setPusherAttributesHandler({enableCamera:this.data.config.type===hg.VIDEO}),wx.createLivePusherContext().startPreview();var f=this.getCallDataReport().getCallData();f=i(i({},f),{},{userId:this.getUserID(),roomID:s.room_id,inviteID:o,callRole:pg,callType:s.call_type,inviteeList:n}),this.getCallDataReport().setCallData(f),this.TRTCCallingDelegate.onInvited(h)}},{key:"addInviterInviteId",value:function(t,e){0!==e.length&&(0===(this.data._inviterInviteID[t]||[]).length?this.data._inviterInviteID[t]=e:this.data._inviterInviteID[t]=[].concat(D(this.data._inviterInviteID[t]),D(e)))}},{key:"handleInviteeAccepted",value:(F=c(a().mark((function t(e){var n,r,i,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ZE.log("".concat(RC," onInviteeAccepted - params:"),e),n=JSON.parse(e.data.data),r=e.data.invitee,i=e.data.inviteID,-1!==this.getTotalInviterInviteIdList().indexOf(i)){t.next=6;break}return t.abrupt("return");case 6:if(this.data.callStatus!==ig.IDLE){t.next=8;break}return t.abrupt("return");case 8:if(this.isGroupCall()||!this.judgeSwitchCallMode(n)||this.data.switchCallModeStatus){t.next=11;break}return this.handleCallMode(this.data.invitation.type),t.abrupt("return");case 11:if(o=this.getCallStatus(),r!==this.getUserID()||o!==ig.CALLING){t.next=17;break}return this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:r,userID:r}),t.next=16,this._resetTUICallEngine();case 16:return t.abrupt("return");case 17:return this.isInviter()&&this.data.callStatus===ig.CALLING&&this.changeCallStatus(ig.CONNECTED),this.getCallDataReport().setCallAcceptTime((new Date).getTime()),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.addAcceptedUserList(i,[r]),t.next=24,this.getUserProfile(this.data.unHandledInviteeList.map((function(t){return{userID:t}})));case 24:s=t.sent,this.TRTCCallingDelegate.onUserAccept({userID:r,userList:s});case 26:case"end":return t.stop()}}),t,this)}))),function(t){return F.apply(this,arguments)})},{key:"handleInviteeRejected",value:(H=c(a().mark((function t(e){var n,r,i,o,s,c,u,l,h,f,d,p,v,g,y;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ZE.log("".concat(RC," onInviteeRejected - params"),e),r=e.data.inviteID,this.isGroupCall()||this.getSwitchCallModeStatus()||-1===this.getAudioVideoSwitchIdList().indexOf(r)){t.next=6;break}return ZE.log("".concat(RC,".onInviteeRejected - Audio and video switching is not available")),this.setSwitchCallModeStatus(!0),t.abrupt("return");case 6:if(i=e.data.invitee,o=e.data.inviter,s=this.getUserID(),c=this.getCallStatus(),u=JSON.parse(e.data.data),-1!==this.getInviterInviteIdList().indexOf(r)){t.next=14;break}return this.deleteUnHandledInviteeList([i]),t.abrupt("return");case 14:if(c!==ig.IDLE){t.next=16;break}return t.abrupt("return");case 16:if(s!==i||c!==ig.CALLING){t.next=21;break}return this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:i,userID:i}),t.next=20,this._resetTUICallEngine();case 20:return t.abrupt("return");case 21:if(l=this.isGroupCall(),h=this.isInviter(),this.deleteUnHandledInviteeList([i]),f=this.getUnHandledInviteeList(),d=this.getHandledInviteeList(),p={inviteID:this.data.invitation.inviteID,invitee:s,userID:s},v={inviteID:this.data.invitation.inviteID,invitee:i,userID:i},g=this.data.invitation,c!==ig.CONNECTED){t.next=32;break}if(-1===d.indexOf(i)){t.next=32;break}return t.abrupt("return");case 32:if(!("line_busy"===u.line_busy||""===u.line_busy||null!=u&&null!==(n=u.data)&&void 0!==n&&n.message&&"lineBusy"===u.data.message)){t.next=46;break}if(o===g.inviter&&this.TRTCCallingDelegate.onLineBusy({inviteID:this.data.invitation.inviteID,invitee:i,userID:i}),l){t.next=40;break}return this.TRTCCallingDelegate.onCancel(p),t.next=38,this._resetTUICallEngine();case 38:t.next=44;break;case 40:if(0!==f.length||1!==d.length){t.next=44;break}return this.TRTCCallingDelegate.onCancel(p),t.next=44,this._resetTUICallEngine();case 44:case 51:t.next=72;break;case 46:if(l){t.next=53;break}return this.TRTCCallingDelegate.onReject(v),this.TRTCCallingDelegate.onCancel(p),t.next=51,this._resetTUICallEngine();case 53:if(this.TRTCCallingDelegate.onReject(v),c!==ig.CALLING){t.next=66;break}if(!h){t.next=62;break}if(0!==f.length||1!==d.length){t.next=60;break}return this.TRTCCallingDelegate.onCancel(p),t.next=60,this._resetTUICallEngine();case 60:t.next=66;break;case 62:if(1!==f.length||0!==d.length){t.next=66;break}return this.TRTCCallingDelegate.onCancel(p),t.next=66,this._resetTUICallEngine();case 66:if(c!==ig.CONNECTED){t.next=72;break}if(0!==f.length||1!==d.length){t.next=72;break}return y={roomID:this.getRoomID(),callMediaType:this.getCallType(),callRole:pg,totalTime:Math.round((Date.now()-this.data.startTalkTime)/1e3),callEnd:Math.round((Date.now()-this.data.startTalkTime)/1e3),message:"",userID:i},this.TRTCCallingDelegate.onCallEnd(y),t.next=72,this._resetTUICallEngine();case 72:case"end":return t.stop()}}),t,this)}))),function(t){return H.apply(this,arguments)})},{key:"handleInvitationCancelled",value:(G=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.data.invitation.inviteID===e.data.inviteID){t.next=2;break}return t.abrupt("return");case 2:if(this.data.callStatus!==ig.IDLE){t.next=4;break}return t.abrupt("return");case 4:if(-1!==this.getInviterInviteIdList().indexOf(e.data.inviteID)){t.next=6;break}return t.abrupt("return");case 6:return ZE.log(RC,"onInvitationCancelled","inviteID:".concat(e.data.inviteID," inviter:").concat(e.data.inviter," data:").concat(e.data.data)),this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:e.data.inviter,userID:e.data.inviter}),t.next=10,this._resetTUICallEngine();case 10:case"end":return t.stop()}}),t,this)}))),function(t){return G.apply(this,arguments)})},{key:"handleInvitationTimeout",value:(V=c(a().mark((function t(e){var n,r,i,o,s,c,u,l,h,f,d,p,v,g,y;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.data,i=r.inviter,o=r.inviteeList,s=void 0===o?[]:o,c=r.inviteID,u=this.getUserID(),l=this.isGroupCall(),h=this.isInviter(),f=this.getCallStatus(),this.deleteUnHandledInviteeList(s),ZE.warn("".concat(RC,".onInvitationTimeout - params:"),e,"currentUserID:".concat(u," isInviter:").concat(h," isGroupCall:").concat(l," \n currentCallStatus:").concat(f," inviteID:").concat(null==this||null===(n=this._newInvitationData)||void 0===n?void 0:n.inviteID)),-1!==this.getInviterInviteIdList().indexOf(c)){t.next=9;break}return t.abrupt("return");case 9:if(f!==ig.IDLE){t.next=11;break}return t.abrupt("return");case 11:if(d=this.getHandledInviteeList(),p=this.getUnHandledInviteeList(),v={groupID:this.data.groupID,inviteID:this.data.invitation.inviteID,sponsor:i,timeoutUserList:s,userIDList:s},g={inviteID:this.data.invitation.inviteID,invitee:u,userID:u},l){t.next=21;break}return h?(this.TRTCCallingDelegate.onNoResp(v),this.TRTCCallingDelegate.onCancel(g)):this.TRTCCallingDelegate.onCancel(g),t.next=19,this._resetTUICallEngine();case 19:t.next=44;break;case 21:if(f!==ig.CALLING){t.next=37;break}if(!h){t.next=30;break}if(this.TRTCCallingDelegate.onNoResp(v),0!==p.length){t.next=28;break}return this.TRTCCallingDelegate.onCancel(g),t.next=28,this._resetTUICallEngine();case 28:t.next=37;break;case 30:if(-1!==s.indexOf(u)){t.next=34;break}this.TRTCCallingDelegate.onNoResp(v),t.next=37;break;case 34:return this.TRTCCallingDelegate.onCancel(g),t.next=37,this._resetTUICallEngine();case 37:if(f!==ig.CONNECTED){t.next=44;break}if(this.TRTCCallingDelegate.onNoResp(v),1!==d.length||0!==p.length){t.next=44;break}return y={roomID:this.getRoomID(),callMediaType:this.getCallType(),callRole:this.isInviter()?dg:pg,totalTime:Math.round((Date.now()-this.data.startTalkTime)/1e3),callEnd:Math.round((Date.now()-this.data.startTalkTime)/1e3),message:"",userID:this.getUserID()},this.TRTCCallingDelegate.onCallEnd(y),t.next=44,this._resetTUICallEngine();case 44:case"end":return t.stop()}}),t,this)}))),function(t){return V.apply(this,arguments)})},{key:"handleSDKReady",value:function(){var t=this;ZE.log(RC,"TSignaling SDK ready"),this.TSignalingResolve(),this.TRTCCallingDelegate.onSdkReady({message:"SDK ready"}),this.tim.getMyProfile().then((function(e){t.data.localUser=e.data})).catch((function(t){ZE.warn("getMyProfile error:",t)}))}},{key:"handleKickedOut",value:function(){this.hangup(),this.TRTCCallingDelegate.onKickedOut({message:"kicked out"})}},{key:"_addTSignalingEvent",value:function(){wx.$TSignaling.on(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived,this),wx.$TSignaling.on(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted,this),wx.$TSignaling.on(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected,this),wx.$TSignaling.on(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled,this),wx.$TSignaling.on(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout,this),wx.$TSignaling.on(t.EVENT.SDK_READY,this.handleSDKReady,this),wx.$TSignaling.on(t.EVENT.KICKED_OUT,this.handleKickedOut,this),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.on(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"_removeTSignalingEvent",value:function(){wx.$TSignaling.off(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived),wx.$TSignaling.off(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted),wx.$TSignaling.off(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected),wx.$TSignaling.off(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled),wx.$TSignaling.off(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout),wx.$TSignaling.off(t.EVENT.SDK_READY,this.handleSDKReady),wx.$TSignaling.off(t.EVENT.KICKED_OUT,this.handleKickedOut),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.off(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"onRemoteUserJoin",value:(j=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.data,r=n.userID,i=n.userList,o=n.playerList,ZE.log(RC,"REMOTE_USER_JOIN",e,r),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.changeCallStatus(ig.CONNECTED),!(o.length>0)){t.next=11;break}return t.next=8,this.getUserProfile(o);case 8:t.t0=t.sent,t.next=12;break;case 11:t.t0=this.data.playerList;case 12:this.data.playerList=t.t0,this.data.startTalkTime||(this.data.startTalkTime=Date.now()),this.TRTCCallingDelegate.onUserEnter({userID:e.data.userID,playerList:this.data.playerList}),ZE.log(RC,"REMOTE_USER_JOIN","playerList:",this.data.playerList,"userList:",i);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:"onRemoteUserLeave",value:(P=c(a().mark((function t(e){var n,r,i,o,s,c,u,l,h;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.data.userID,ZE.log(RC,"REMOTE_USER_LEAVE",e,e.data.userID),this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),this.getCallDataReport().setExitRoomTime((new Date).getTime()),this.data.isGroupCall){t.next=16;break}return t.next=9,this.TSignalingClient.hangup({userIDList:[n],callType:this.data.config.type,callEnd:Math.round((Date.now()-this.data.startTalkTime)/1e3)});case 9:return r=this.isInviter()?dg:pg,i={roomID:this.getRoomID(),callMediaType:this.getCallType(),callRole:r,totalTime:Math.round((Date.now()-this.data.startTalkTime)/1e3),callEnd:Math.round((Date.now()-this.data.startTalkTime)/1e3),message:"",userID:this.getUserID()},this.TRTCCallingDelegate.onCallEnd(i),ZE.log(RC,"REMOTE_USER_LEAVE","playerList:"),t.next=15,this._resetTUICallEngine();case 15:return t.abrupt("return");case 16:if(o=this.getHandledInviteeList(),s=this.getUnHandledInviteeList(),c=this.getUserID(),u=this.isInviter()?dg:pg,1!==o.length||o[0]!==c||0!==s.length){t.next=26;break}return l=Math.round((Date.now()-this.data.startTalkTime)/1e3),h={roomID:this.getRoomID(),callMediaType:this.getCallType(),callRole:u,totalTime:l,userID:c,callEnd:l,message:""},this.TRTCCallingDelegate.onCallEnd(h),t.next=26,this._resetTUICallEngine();case 26:case"end":return t.stop()}}),t,this)}))),function(t){return P.apply(this,arguments)})},{key:"onLocalNetStateUpdate",value:function(t){var e=t.data.pusher.netStatus;ZE.log(RC,"onLocalNetStateUpdate",e),this.data.pusher=t.data.pusher,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onRemoteNetStateUpdate",value:(M=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.data.playerList,ZE.log(RC,"onRemoteNetStateUpdate",n),this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})},{key:"onError",value:function(t){ZE.log(RC,"onError",t)}},{key:"onRemoteVideoAdd",value:function(t){ZE.log("* room REMOTE_VIDEO_ADD",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!1})}},{key:"onRemoteVideoRemove",value:function(t){ZE.log("* room REMOTE_VIDEO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"onRemoteAudioAdd",value:(U=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ZE.log("* room REMOTE_AUDIO_ADD",e),t.next=3,this.getUserProfile([e.data.player]);case 3:n=t.sent,this.setPlayerAttributesHandler(n[0],{muteAudio:!1});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"onRemoteAudioRemove",value:function(t){ZE.log("* room REMOTE_AUDIO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"onRemoteAudioVolumeUpdate",value:(N=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ZE.log("* room REMOTE_AUDIO_VOLUME_UPDATE",e),n=e.data.playerList,this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return N.apply(this,arguments)})},{key:"onLocalAudioVolumeUpdate",value:function(t){var e=t.data.pusher;this.data.pusher=e,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onMessageSentByMe",value:function(t){this.TRTCCallingDelegate.onMessageSentByMe(t)}},{key:"_addTRTCEvent",value:function(){this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.ERROR,this.onError,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate,this)}},{key:"_removeTRTCEvent",value:function(){this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave),this.TRTC.off(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.ERROR,this.onError),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate),this.TRTC.off(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate)}},{key:"initTRTC",value:function(){var t=this.TRTC.createPusher({beautyLevel:5});this.data.pusher=t.pusherAttributes}},{key:"enterRoom",value:function(t){this._addTRTCEvent();var e=t.roomID,n=Object.assign(this.data.config,{roomID:e,enableMic:!0,autopush:!0,enableAgc:!0,enableAns:!0,enableCamera:t.callType===hg.VIDEO});this.data.enterRoomStatus=!0,this.data.pusher=this.TRTC.enterRoom(n),wx.createLivePusherContext().startPreview(),this.TRTC.getPusherInstance().start()}},{key:"exitRoom",value:(A=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.TRTC.getPusherInstance().stop();case 2:return t.next=4,this.TRTC.exitRoom();case 4:e=t.sent,this.data.pusher=e.pusher,this.data.playerList=e.playerList,this.data.unHandledInviteeList=[],this.data.enterRoomStatus=!1,this.initTRTC(),this._removeTRTCEvent();case 11:case"end":return t.stop()}}),t,this)}))),function(){return A.apply(this,arguments)})},{key:"setPusherAttributesHandler",value:function(t){this.data.pusher=this.TRTC.setPusherAttributes(t),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"setPlayerAttributesHandler",value:(L=c(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.TRTC.setPlayerAttributes(e.streamID,n),ZE.warn("setPlayerAttributesHandler",r),this.data.playerList=r.length>0?this._updateUserProfile(this.data.playerList,r):this.data.playerList,this.data.playerList.length>0&&0===r.length&&(this.data.playerList[0].hasAudio=!1,this.data.playerList[0].hasVideo=!1),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return L.apply(this,arguments)})},{key:"_mutePlayerAudio",value:function(t){var e=t.currentTarget.dataset.value;e.hasAudio&&e.muteAudio?this.setPlayerAttributesHandler(e,{muteAudio:!1}):!e.hasAudio||e.muteAudio||this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"_mutePlayerVideo",value:function(t){var e=t.currentTarget.dataset.value;e.hasVideo&&e.muteVideo?this.setPlayerAttributesHandler(e,{muteVideo:!1}):!e.hasVideo||e.muteVideo||this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"_pusherAudioHandler",value:function(){this.data.pusher.enableMic?(this.setPusherAttributesHandler({enableMic:!1}),this.TRTC.getPusherInstance().setMICVolume({volume:0})):(this.setPusherAttributesHandler({enableMic:!0}),this.TRTC.getPusherInstance().setMICVolume({volume:100}))}},{key:"_pusherVideoHandler",value:function(){this.data.pusher.enableCamera?this.setPusherAttributesHandler({enableCamera:!1}):this.setPusherAttributesHandler({enableCamera:!0})}},{key:"init",value:(O=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return hC.getInstance().getAlert().checkSync(new nC({api:"init",attributes:e})),t.next=3,this.login(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return O.apply(this,arguments)})},{key:"login",value:(k=c(a().mark((function t(e){var n=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.data.config.userID=e.userID,this.data.config.userSig=e.userSig,t.abrupt("return",new Promise((function(t,r){wx.$TSignaling.login({userID:e.userID,userSig:e.userSig}).then((function(r){return ZE.log(RC,"login","IM login success",r),wx.setStorageSync("userId","".concat(e.userID)),n._callDataReport.setUserID(e.userID),n._initReady=!0,n._resetTUICallEngine(),n._addTSignalingEvent(),n.initTRTC(),n.TSignalingResolve=t,r.data.repeatLogin&&t(null),null}))})));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return k.apply(this,arguments)})},{key:"logout",value:(x=c(a().mark((function t(){var e=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.data.callStatus!==ig.CALLING&&this.data.callStatus!==ig.CONNECTED){t.next=8;break}if(!this.isInviter()){t.next=6;break}return t.next=4,this.hangup();case 4:t.next=8;break;case 6:return t.next=8,this.reject();case 8:return t.next=10,this._resetTUICallEngine();case 10:wx.$TSignaling.logout({userID:this.data.config.userID,userSig:this.data.config.userSig}).then((function(t){return ZE.log(RC,"logout","IM logout success"),e._removeTSignalingEvent(),e._removeTRTCEvent(),t})).catch((function(t){throw ZE.error(RC,"logout","IM logout failure"),new Error(t)}));case 11:case"end":return t.stop()}}),t,this)}))),function(){return x.apply(this,arguments)})},{key:"on",value:function(t,e,n){hC.getInstance().getAlert().checkSync(new nC({api:"on",attributes:{eventCode:t,handler:e,context:n},initReady:this._initReady})),this._emitter.on(t,e,n)}},{key:"off",value:function(t,e){hC.getInstance().getAlert().checkSync(new nC({api:"off",attributes:{eventCode:t,handler:e}})),this._emitter.off(t,e)}},{key:"call",value:(w=c(a().mark((function t(e){var n,r,o,s,c,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.userID,r=e.type,t.next=3,hC.getInstance().getAlert().check(new nC({api:"call",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Dg.BASE,checkMicrophonePermissions:!0,checkCameraPermissions:r===hg.VIDEO}),{tim:this.tim});case 3:if(this.getUserID()!==n){t.next=6;break}throw ZE.log("".concat(RC,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n)),new Error("".concat(RC,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n));case 6:return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(Ag),t.prev=8,o=Math.floor(2147483646*Math.random()+1),this.enterRoom({roomID:o,callType:r}),this._callDataReport.setEnterRoomTime((new Date).getTime()),s=i(i({},s=this._callDataReport.getCallData()),{},{userId:n,roomID:o,callRole:dg,callType:r,inviteeList:[n]}),this._callDataReport.setCallData(s),t.next=17,this.TSignalingClient.invite(i({roomID:o},e));case 17:if(c=t.sent,this._callDataReport.setSendSignalingTime((new Date).getTime()),ZE.log("".concat(RC," call(userID: ").concat(n,", type: ").concat(r,") success, ").concat(c)),u="callType: ".concat(r+1,",\n conversationType: ").concat(c.data.message.conversationType,",\n userId:{ ").concat(c.data.message.from," } invite userId:{ ").concat(c.data.message.to," }"),0!==c.code){t.next=26;break}this._callDataReport.setInviteID(c.inviteID),this._setInterfaceUpLoad(iT.CALL).setCallType(r+1).setText("".concat(u," succeeded")).setEnd(),t.next=31;break;case 26:return this._callDataReport.setCodeAndMessage(c.code,c.message),this._callDataReport.uploadToKibana(),this._setInterfaceUpLoad(iT.CALL).setCallType(r+1).setText("".concat(u," failed")).setEnd(),t.next=31,this._resetTUICallEngine();case 31:return this.data.config.type=r,this.data.invitation.inviteID=c.inviteID,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=r,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.remoteID=n,this.changeCallStatus(ig.CALLING),this.addInviterInviteId(c.inviteID,[this.data.config.userID,n]),this.addUnHandledInviteeList([n]),this.addHandledInviteeList([this.getUserID()]),t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 45:t.prev=45,t.t0=t.catch(8),this._callDataReport.setCodeAndMessage(eT,JSON.stringify(t.t0)),this._callDataReport.uploadToKibana(),ZE.log("".concat(RC," call(userID:").concat(n,",type:").concat(r,") failed', error: ").concat(t.t0));case 50:case"end":return t.stop()}}),t,this,[[8,45]])}))),function(t){return w.apply(this,arguments)})},{key:"groupCall",value:(S=c(a().mark((function t(e){var n,r,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.type,t.next=3,hC.getInstance().getAlert().check(new nC({api:"groupCall",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Dg.PRO,checkMicrophonePermissions:!0,checkCameraPermissions:n===hg.VIDEO}),{tim:this.tim});case 3:return this._callDataReport.setCallScene(Ng),r=this.data.roomID||Math.floor(2147483646*Math.random()+1),this.enterRoom({roomID:r,callType:n}),t.prev=6,t.next=9,this.TSignalingClient.inviteGroup(i({roomID:r},e));case 9:return o=t.sent,this.data.config.type=e.type,this.data.invitation.inviteID=o.inviteID,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=r,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.addUnHandledInviteeList(e.userIDList),this.addHandledInviteeList([this.getUserID()]),this.changeCallStatus(ig.CALLING),this.addInviterInviteId(o.inviteID,[this.data.config.userID].concat(D(e.userIDList))),ZE.log(RC,"inviteInGroup OK",o),t.abrupt("return",{data:o.data,pusher:this.data.pusher});case 26:t.prev=26,t.t0=t.catch(6),ZE.log(RC,"inviteInGroup failed",t.t0);case 29:case"end":return t.stop()}}),t,this,[[6,26]])}))),function(t){return S.apply(this,arguments)})},{key:"joinInGroupCall",value:(R=c(a().mark((function t(e){var n,r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.roomID,r=e.type,i=e.groupID,t.next=3,hC.getInstance().getAlert().check(new nC({api:"joinInGroupCall",attributes:e,initReady:this._initReady,capabilityCode:Dg.PRO,checkMicrophonePermissions:!0,checkCameraPermissions:r===hg.VIDEO}),{tim:this.tim});case 3:return t.prev=3,this.data.config.type=r,this.data.invitation.type=r,ZE.log("".concat(RC,".joinInGroupCall roomID:").concat(n,",type:").concat(r,",userID:").concat(this.getUserID())),this.changeCallStatus(ig.CALLING),this.addHandledInviteeList([this.getUserID()]),this.data.groupID=i,this.data.roomID=n,this.data.isGroupCall=!0,this.data.isInviter=!1,this.enterRoom({roomID:n,callType:r}),t.abrupt("return",this.data.pusher);case 17:return t.prev=17,t.t0=t.catch(3),t.next=21,this._resetTUICallEngine();case 21:throw new Error("".concat(RC,".joinInGroupCall failed error: ").concat(t.t0));case 22:case"end":return t.stop()}}),t,this,[[3,17]])}))),function(t){return R.apply(this,arguments)})},{key:"inviteUser",value:(C=c(a().mark((function t(e){var n,r,i,o,s,c,u,l,h=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hC.getInstance().getAlert().check(new nC({api:"inviteUser",attributes:e,initReady:this._initReady,capabilityCode:Dg.PRO,checkMicrophonePermissions:!0,checkCameraPermissions:this.data.config.type===hg.VIDEO}),{tim:this.tim});case 2:if(n=e.userIDList,r=void 0===n?[]:n,this.isGroupCall()){t.next=6;break}throw ZE.error("".concat(RC,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)),new Error("".concat(RC,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType));case 6:if(this.isInviter()||this.data.callStatus===ig.CONNECTED){t.next=9;break}throw ZE.error("".concat(RC,".inviteUser - current status:").concat(this.data.callStatus," not support")),new Error("".concat(RC,".inviteUser - current status:").concat(this.data.callStatus," not support"));case 9:if(0!==r.length){t.next=12;break}throw ZE.error("".concat(RC,".inviteUser - userIDList is empty")),new Error("".concat(RC,".inviteUser - userIDList is empty"));case 12:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=[].concat(D(i),D(o)),0!==(c=r.filter((function(t){return-1===s.indexOf(t)}))).length){t.next=19;break}return ZE.error("".concat(RC,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))),t.abrupt("return",Promise.reject("".concat(RC,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))));case 19:return r=c,t.prev=20,u=this.data.handledInviteeList.filter((function(t){return t!==h.getUserID()})),t.next=24,this.TSignalingClient.inviteGroup({groupID:this.data.groupID,userIDList:r,type:this.data.invitation.type,roomID:this.data.roomID,timeout:this.data.callTimeout,inCallUserIDs:[].concat(D(this.data.unHandledInviteeList),D(u))});case 24:if(l=t.sent,ZE.log("inviteUser res",l),0!==l.code){t.next=30;break}return this.addUnHandledInviteeList(r),this.addInviterInviteId(l.inviteID,[this.data.config.userID].concat(D(r))),t.abrupt("return",l);case 30:t.next=35;break;case 32:throw t.prev=32,t.t0=t.catch(20),new Error("".concat(RC,".inviteUser failed, userId:").concat(this.getUserID(),", inviteeIdList:").concat(r,", error: ").concat(t.t0));case 35:case"end":return t.stop()}}),t,this,[[20,32]])}))),function(t){return C.apply(this,arguments)})},{key:"accept",value:(b=c(a().mark((function t(){var e=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hC.getInstance().getAlert().check(new nC({api:"accept",initReady:this._initReady,callStatus:this.data.callStatus,checkDevicePermissions:!0}));case 2:return t.abrupt("return",new Promise((function(t,n){ZE.log(RC,"accept() inviteID: ",e.data.invitation.inviteID),e.data.callStatus===ig.CALLING&&(e.data.config.type!==hg.VIDEO||e.data.isGroupCall?e.handleAccept(t,n):wx.createLivePusherContext().stopPreview({success:function(){var r=setTimeout(c(a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:clearTimeout(r),e.handleAccept(t,n);case 2:case"end":return i.stop()}}),i)}))),0)}}))})));case 3:case"end":return t.stop()}}),t,this)}))),function(){return b.apply(this,arguments)})},{key:"handleAccept",value:(_=c(a().mark((function t(e,n){var r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._callDataReport.setEnterRoomTime((new Date).getTime()),this.enterRoom({roomID:this.data.invitation.roomID,callType:this.data.config.type}),r=this.data.invitation.inviteID,this.changeCallStatus(ig.CONNECTED),t.next=6,this.TSignalingClient.accept({inviteID:r,type:this.data.config.type});case 6:0===(i=t.sent).code?(ZE.log(RC,"accept OK"),this.addHandledInviteeList([this.getUserID()]),this.deleteUnHandledInviteeList([this.getUserID()]),this.addAcceptedUserList(r,[this.getUserID()]),e({message:i.data.message,pusher:this.data.pusher})):(this.isGroupCall()&&(this._callDataReport.setCodeAndMessage(eT,JSON.stringify(i.data.message)),this._callDataReport.uploadToKibana()),ZE.error(RC,"accept failed",i),n(i));case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return _.apply(this,arguments)})},{key:"reject",value:(T=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hC.getInstance().getAlert().checkSync(new nC({api:"reject",callStatus:this.data.callStatus,initReady:this._initReady}));case 2:if(!this.data.invitation.inviteID){t.next=11;break}return t.next=5,this.TSignalingClient.reject({inviteID:this.data.invitation.inviteID,type:this.data.config.type});case 5:return e=t.sent,ZE.log(RC,"reject OK",e),this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()}),t.next=10,this._resetTUICallEngine();case 10:return t.abrupt("return",e);case 11:return ZE.warn("".concat(RC," 未收到邀请,无法拒绝")),t.abrupt("return","未收到邀请,无法拒绝");case 13:case"end":return t.stop()}}),t,this)}))),function(){return T.apply(this,arguments)})},{key:"hangup",value:(E=c(a().mark((function t(){var e,n,r,i,o,s,c,u,l,h,f,d,p,v,g,y,m,I=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hC.getInstance().getAlert().checkSync(new nC({api:"hangup",callStatus:this.data.callStatus,initReady:this._initReady}));case 2:if(ZE.warn("".concat(RC,". - callStatus:").concat(this.data.callStatus," _inviterInviteID:").concat(JSON.stringify(this.data.invitation))),this.data.callStatus!==ig.IDLE){t.next=5;break}throw new Error("".concat(RC,".hangup failed. current status:").concat(this.data.callStatus));case 5:if(this.data.callStatus!==ig.CALLING||0!==this.getInviterInviteIdList().length){t.next=7;break}throw new Error("".concat(RC,".call/groupCall incomplete。please wait cancel"));case 7:if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserID(),i=Math.round((Date.now()-this.data.startTalkTime)/1e3),o=this.getCallType(),c=this.getInviterInviteIdList(),this.data.callStatus!==ig.CONNECTED){t.next=28;break}if(t.prev=14,0!==c.length){t.next=21;break}return u=this.isInviter()?dg:pg,l={roomID:this.getRoomID(),callMediaType:o,callRole:u,totalTime:i,callEnd:i,message:"",userID:r},this.TRTCCallingDelegate.onCallEnd(l),t.next=21,this._resetTUICallEngine();case 21:t.next=28;break;case 23:return t.prev=23,t.t0=t.catch(14),t.next=27,this._resetTUICallEngine();case 27:throw new Error(t.t0);case 28:if(h=this.getHandledInviteeList(),f=this.getUnHandledInviteeList(),t.prev=30,e){t.next=48;break}if(!n){t.next=46;break}if(1!==f.length){t.next=42;break}return t.next=36,this.cancel();case 36:return s=t.sent,this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:r,userID:r}),t.next=40,this._resetTUICallEngine();case 40:t.next=44;break;case 42:return t.next=44,this._resetTUICallEngine();case 44:t.next=46;break;case 46:t.next=77;break;case 48:if(d=this.getCallStatus(),p={callType:this.getCallType(),isGroupCall:this.isGroupCall(),groupID:this.data.groupID,userIDList:[].concat(D(h.filter((function(t){return t!==r}))),D(f)),callEnd:Math.round((Date.now()-this.data.startTalkTime)/1e3)},!n){t.next=68;break}if(d!==ig.CALLING){t.next=58;break}return t.next=54,this.cancel(this.getInviterInviteIdList());case 54:return s=t.sent,this.TRTCCallingDelegate.onCancel({inviteID:this.data.invitation.inviteID,invitee:r,userID:r}),t.next=58,this._resetTUICallEngine();case 58:if(d!==ig.CONNECTED){t.next=66;break}v=a().mark((function t(){var e,n,i,o,u,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c[g],n=I.getInviterInviteIdUserList(e),!((i=I.getAcceptedUserList(e)).length>0)){t.next=12;break}return o=i.filter((function(t){return-1!==h.indexOf(t)})),u=n.filter((function(t){return-1!==f.indexOf(t)})),p.userIDList=[].concat(D(o),D(u)).filter((function(t){return t!==r})),ZE.warn("inviter emit hangup signal, notify userIDList:".concat(JSON.stringify(p.userIDList))),t.next=9,I.TSignalingClient.hangup(p);case 9:s=t.sent,t.next=19;break;case 12:if(l=I.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==l.indexOf(t)})).length>0)){t.next=19;break}return ZE.warn("inviter emit cancel signal, userIdList:".concat(n)),t.next=18,I.cancel([e]);case 18:s=t.sent;case 19:case"end":return t.stop()}}),t)})),g=0;case 61:if(!(g0)){t.next=12;break}return o=i.filter((function(t){return-1!==h.indexOf(t)})),u=n.filter((function(t){return-1!==f.indexOf(t)})),p.userIDList=[].concat(D(o),D(u)).filter((function(t){return t!==r})),ZE.warn("invitee emit hangup signal, notify userIDList:".concat(JSON.stringify(p.userIDList))),t.next=9,I.TSignalingClient.hangup(p);case 9:s=t.sent,t.next=19;break;case 12:if(l=I.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==l.indexOf(t)})).length>0)){t.next=19;break}return ZE.warn("invitee emit cancel signal, inviteID:".concat(e)),t.next=18,I.cancel([e]);case 18:s=t.sent;case 19:case"end":return t.stop()}}),t)})),m=0;case 70:if(!(m=3600?(r=parseInt(o/3600)<10?"0".concat(parseInt(o/3600)):parseInt(o/3600),i=parseInt(o%60/60)<10?"0".concat(parseInt(o%60/60)):parseInt(o%60/60),(a=o%3600<10?"0".concat(o%3600):o%3600)>60&&(i=parseInt(a/60)<10?"0".concat(parseInt(a/60)):parseInt(a/60),a=a%60<10?"0".concat(a%60):a%60),n="".concat(r,":").concat(i,":").concat(a)):o>=60&&o<3600?(i=parseInt(o/60)<10?"0".concat(parseInt(o/60)):parseInt(o/60),a=o%60<10?"0".concat(o%60):o%60,n="00:".concat(i,":").concat(a)):o<60&&(a=o<10?"0".concat(o):o,n="00:00:".concat(a)),n),e.data.chatTimeNum+=1,e.data.pusher.chatTime=e.data.chatTime,e.data.pusher.chatTimeNum=e.data.chatTimeNum,e.TRTCCallingDelegate.onUserUpdate({pusher:e.data.pusher,playerList:e.data.playerList})}),1e3);break;case ig.IDLE:clearInterval(this.data.timer),this.data.timer=null,this.data.chatTime="00:00:00",this.data.chatTimeNum=0}}},{key:"_resetTUICallEngine",value:(m=c(a().mark((function t(e,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ZE.log(RC," _resetTUICallEngine()",this.data.enterRoomStatus),!this.data.enterRoomStatus){t.next=4;break}return t.next=4,this.exitRoom(e,n);case 4:this.changeCallStatus(ig.IDLE),this.data.config.type=hg.AUDIO,this.initData();case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return m.apply(this,arguments)})},{key:"startRemoteView",value:(y=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.data.playerList.forEach((function(t){if(t.userID===e)return t.muteVideo=!1,void ZE.log("".concat(RC,", startRemoteView(").concat(e,")"))}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"stopRemoteView",value:function(t){this.data.playerList.forEach((function(e){if(e.userID===t)return e.muteVideo=!0,void ZE.log("".concat(RC,", stopRemoteView(").concat(t,")"))}))}},{key:"openCamera",value:function(){hC.getInstance().getAlert().checkSync(new nC({api:"openCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera||this._pusherVideoHandler(),ZE.log("".concat(RC,", openCamera() pusher: ").concat(this.data.pusher))}},{key:"closeCamera",value:function(){hC.getInstance().getAlert().checkSync(new nC({api:"closeCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera&&this._pusherVideoHandler(),ZE.log("".concat(RC,", closeCamera() pusher: ").concat(this.data.pusher))}},{key:"switchCamera",value:function(){if(hC.getInstance().getAlert().checkSync(new nC({api:"switchCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.callStatus!==ig.CONNECTED){var t="front"===this.data.pusher.frontCamera?"back":"front";this.setPusherAttributesHandler({frontCamera:t}),wx.createLivePusherContext().switchCamera()}else this.TRTC.getPusherInstance().switchCamera();ZE.log("".concat(RC,", switchCamera(), frontCamera").concat(this.data.pusher.frontCamera))}},{key:"openMicrophone",value:function(){hC.getInstance().getAlert().checkSync(new nC({api:"openMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic||this._pusherAudioHandler(),ZE.log("".concat(RC,", openMicrophone() pusher: ").concat(this.data.pusher))}},{key:"closeMicrophone",value:function(){hC.getInstance().getAlert().checkSync(new nC({api:"closeMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic&&this._pusherAudioHandler(),ZE.log("".concat(RC,", closeMicrophone() pusher: ").concat(this.data.pusher))}},{key:"selectAudioPlaybackDevice",value:function(t){hC.getInstance().getAlert().checkSync(new nC({api:"selectAudioPlaybackDevice",callStatus:this.data.callStatus,attributes:{type:t},initReady:this._initReady}));var e=!1;switch(t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(e)}},{key:"setHandsFree",value:function(t){return this.data.soundMode=t?"speaker":"ear",ZE.log("".concat(RC,", setHandsFree() result: ").concat(this.data.soundMode)),this.data.soundMode}},{key:"switchAudioCall",value:(g=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isGroupCall()){t.next=3;break}return ZE.warn("".concat(RC,".switchToAudioCall is not applicable to groupCall.")),t.abrupt("return");case 3:if(this.data.invitation.type!==hg.AUDIO){t.next=6;break}return ZE.warn("".concat(RC," Now the call mode is audio call.")),t.abrupt("return");case 6:if(this.data.switchCallModeStatus){t.next=9;break}return ZE.warn("".concat(RC," audio and video call switching.")),t.abrupt("return");case 9:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Ig}));case 12:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:"switchCallMediaType",value:(v=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hC.getInstance().getAlert().check(new nC({api:"switchCallMediaType",attributes:{type:e},callStatus:this.data.callStatus,initReady:this._initReady}));case 2:if(!this.isGroupCall()){t.next=5;break}return ZE.warn("".concat(RC,".switchToAudioCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.switchCallModeStatus){t.next=8;break}return ZE.warn("".concat(RC," audio and video call switching.")),t.abrupt("return");case 8:t.t0=e,t.next=t.t0===hg.AUDIO?11:t.t0===hg.VIDEO?14:16;break;case 11:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Ig}));case 14:throw ZE.warn("".concat(RC," Audio switching Video is not supported yet")),new Error("".concat(RC," Audio switching Video is not supported yet"));case 16:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"setSwitchCallModeStatus",value:function(t){this.data.switchCallModeStatus=t}},{key:"switchVideoCall",value:(p=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isGroupCall()){t.next=3;break}return ZE.warn("".concat(RC,".switchToVideoCall is not applicable to groupCall.")),t.abrupt("return");case 3:if(this.data.invitation.type!==hg.VIDEO){t.next=6;break}return ZE.warn("".concat(RC," Now the call mode is video call.")),t.abrupt("return");case 6:if(this.data.switchCallModeStatus){t.next=9;break}return ZE.warn("".concat(RC," audio and video call switching.")),t.abrupt("return");case 9:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!0}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Eg}));case 12:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})},{key:"setSoundMode",value:function(t){var e=!1,n=!1;switch(t||(n=!0,t=this.data.soundMode),t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(n?!e:e)}},{key:"_hangUp",value:function(){this.hangup()}},{key:"_pusherStateChangeHandler",value:function(t){this.TRTC.pusherEventHandler(t)}},{key:"_playerStateChange",value:function(t){this._emitter.emit(rg.REMOTE_STATE_UPDATE,t)}},{key:"_playerAudioVolumeNotify",value:function(t){this.data.playerList.length>0&&this.TRTC.playerAudioVolumeNotify(t)}},{key:"_pusherAudioVolumeNotify",value:function(t){this.TRTC.pusherAudioVolumeNotify(t)}},{key:"_updateUserProfile",value:function(t,e){return 0===e.length||0===t.length?e:e.map((function(e){var n=e,r=t.filter((function(t){return t.userID===e.userID}));return n.avatar=r[0]&&r[0].avatar?r[0].avatar:"",n.nick=r[0]&&r[0].nick?r[0].nick:"",n}))}},{key:"_getUserProfile",value:function(t){var e=this;this.tim.getUserProfile({userIDList:t}).then((function(t){ZE.log("getUserProfile success",t),ZE.log(t.data),e.data.remoteUsers=t.data})).catch((function(t){ZE.warn("getUserProfile error:",t)}))}},{key:"getUserProfile",value:(d=c(a().mark((function t(e){var n,r,i,o,s=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"array",0!==e.length){t.next=3;break}return t.abrupt("return",[]);case 3:return r=e.map((function(t){return t.userID})),t.next=6,this.tim.getUserProfile({userIDList:r});case 6:i=t.sent,o=null,t.t0=n,t.next="array"===t.t0?11:"map"===t.t0?13:16;break;case 11:return o=e.map((function(t,e){return t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,t})),t.abrupt("break",16);case 13:return o={},e.forEach((function(t,e){t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,o[t.userID]=t})),t.abrupt("break",16);case 16:return t.abrupt("return",o);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"setSelfInfo",value:function(t,e){return hC.getInstance().getAlert().checkSync(new nC({api:"setSelfInfo",attributes:{nickName:t,avatar:e},initReady:this._initReady})),this.tim.updateMyProfile({nick:t,avatar:e})}},{key:"_pusherNetStatus",value:function(t){this.TRTC.pusherNetStatusHandler(t)}},{key:"_playNetStatus",value:function(t){this.TRTC.playerNetStatus(t)}},{key:"_toggleViewSize",value:function(t){var e=t.currentTarget.dataset.screen;return ZE.log("get screen",e,t),1===this.data.playerList.length&&e!==this.data.screen&&this.data.invitation.type===hg.VIDEO&&(this.data.screen=e),this.data.screen}},{key:"getTim",value:function(){return this.tim}},{key:"_setInterfaceUpLoad",value:function(t){return ZE.time(t),new rT(t)}},{key:"destroyed",value:(l=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.data.callStatus!==ig.CALLING&&this.data.callStatus!==ig.CONNECTED||(this.isInviter()?this.hangup():this.reject()),this._resetTUICallEngine(),this._removeTSignalingEvent(),this._removeTRTCEvent(),this._timExternal){t.next=7;break}return t.next=7,this.logout();case 7:this._initReady=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"checkDevicePermissions",value:(s=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=c(a().mark((function t(e,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wx.getSetting&&wx.getSetting()||e(),wx.authorize({scope:"scope.record"}),wx.authorize({scope:"scope.camera"}),wx.getSetting().then((function(t){ZE.log("getSetting",t),t.authSetting["scope.camera"]&&t.authSetting["scope.record"]?e():n("camera or record not authorized")}));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return s.apply(this,arguments)})},{key:"callExperimentalAPI",value:(o=c(a().mark((function t(e){var n=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=c(a().mark((function t(r,i){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.tim.callExperimentalAPI("isCommercialAbilityEnabled",e);case 3:(o=t.sent).data.enabled?r(o):i("The package you purchased does not support this ability"),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),2905===t.t0.code?i("tim version is too old, Please upgrade version >= 2.20.1"):i("The package you purchased does not support this ability");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(t){return o.apply(this,arguments)})}],[{key:"createInstance",value:function(t){return hC.getInstance().getAlert().checkSync(new nC({api:"createInstance",attributes:t})),r.instance||(r.instance=new r(t)),r.instance.initData(),r.instance}}]),r}();f(SC,"instance",null),f(SC,"AUDIO_PLAYBACK_DEVICE",Tg),f(SC,"MEDIA_TYPE",hg),f(SC,"EVENT",rg),f(SC,"STATUS",ig);export{Tg as AUDIO_PLAYBACK_DEVICE,rg as EVENT,hg as MEDIA_TYPE,ig as STATUS,SC as TUICallEngine,SC as default}; +import t from"tsignaling-wx";import e from"trtc-wx-sdk";import n from"tim-wx-sdk";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function c(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){c(a,r,i,o,s,"next",t)}function s(t){c(a,r,i,o,s,"throw",t)}o(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T(t){var e=y();return function(){var n,r=v(t);if(e){var i=v(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _(t)}(this,n)}}function C(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&K[0]<4?1:+(K[0]+K[1])),!z&&wt&&(!(K=wt.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=wt.match(/Chrome\/(\d+)/))&&(z=+K[1]);var kt=z,At=kt,Nt=N,Ut=k.String,Pt=!!Object.getOwnPropertySymbols&&!Nt((function(){var t=Symbol("symbol detection");return!Ut(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Mt=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,jt=Ct,Vt=yt,Gt=bt,Ht=Object,Bt=Mt?function(t){return"symbol"==typeof t}:function(t){var e=jt("Symbol");return Vt(e)&&Gt(e.prototype,Ht(t))},Ft=String,Kt=function(t){try{return Ft(t)}catch(t){return"Object"}},zt=yt,Jt=Kt,Wt=TypeError,$t=function(t){if(zt(t))return t;throw new Wt(Jt(t)+" is not a function")},qt=$t,Yt=st,Xt=function(t,e){var n=t[e];return Yt(n)?void 0:qt(n)},Qt=V,Zt=yt,te=Et,ee=TypeError,ne={exports:{}},re=k,ie=Object.defineProperty,ae=function(t,e){try{ie(re,t,{value:e,configurable:!0,writable:!0})}catch(n){re[t]=e}return e},oe=ae,se="__core-js_shared__",ce=k[se]||oe(se,{}),le=ce;(ne.exports=function(t,e){return le[t]||(le[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.34.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"});var ue=ut,he=Object,fe=function(t){return he(ue(t))},de=fe,pe=X({}.hasOwnProperty),ve=Object.hasOwn||function(t,e){return pe(de(t),e)},ge=X,ye=0,Ie=Math.random(),me=ge(1..toString),Ee=function(t){return"Symbol("+(void 0===t?"":t)+")_"+me(++ye+Ie,36)},_e=k,Te=ne.exports,Ce=ve,be=Ee,De=Pt,Re=Mt,we=_e.Symbol,Se=Te("wks"),xe=Re?we.for||we:we&&we.withoutSetter||be,Le=function(t){return Ce(Se,t)||(Se[t]=De&&Ce(we,t)?we[t]:xe("Symbol."+t)),Se[t]},Oe=V,ke=Et,Ae=Bt,Ne=Xt,Ue=function(t,e){var n,r;if("string"===e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;if(Zt(n=t.valueOf)&&!te(r=Qt(n,t)))return r;if("string"!==e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;throw new ee("Can't convert object to primitive value")},Pe=TypeError,Me=Le("toPrimitive"),je=function(t,e){if(!ke(t)||Ae(t))return t;var n,r=Ne(t,Me);if(r){if(void 0===e&&(e="default"),n=Oe(r,t,e),!ke(n)||Ae(n))return n;throw new Pe("Can't convert object to primitive value")}return void 0===e&&(e="number"),Ue(t,e)},Ve=je,Ge=Bt,He=function(t){var e=Ve(t,"string");return Ge(e)?e:e+""},Be=Et,Fe=k.document,Ke=Be(Fe)&&Be(Fe.createElement),ze=function(t){return Ke?Fe.createElement(t):{}},Je=ze,We=!U&&!N((function(){return 7!==Object.defineProperty(Je("div"),"a",{get:function(){return 7}}).a})),$e=U,qe=V,Ye=G,Xe=J,Qe=dt,Ze=He,tn=ve,en=We,nn=Object.getOwnPropertyDescriptor;A.f=$e?nn:function(t,e){if(t=Qe(t),e=Ze(e),en)try{return nn(t,e)}catch(t){}if(tn(t,e))return Xe(!qe(Ye.f,t,e),t[e])};var rn={},an=U&&N((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),on=Et,sn=String,cn=TypeError,ln=function(t){if(on(t))return t;throw new cn(sn(t)+" is not an object")},un=U,hn=We,fn=an,dn=ln,pn=He,vn=TypeError,gn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,In="enumerable",mn="configurable",En="writable";rn.f=un?fn?function(t,e,n){if(dn(t),e=pn(e),dn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&En in n&&!n[En]){var r=yn(t,e);r&&r[En]&&(t[e]=n.value,n={configurable:mn in n?n[mn]:r[mn],enumerable:In in n?n[In]:r[In],writable:!1})}return gn(t,e,n)}:gn:function(t,e,n){if(dn(t),e=pn(e),dn(n),hn)try{return gn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new vn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var _n=rn,Tn=J,Cn=U?function(t,e,n){return _n.f(t,e,Tn(1,n))}:function(t,e,n){return t[e]=n,t},bn={exports:{}},Dn=U,Rn=ve,wn=Function.prototype,Sn=Dn&&Object.getOwnPropertyDescriptor,xn=Rn(wn,"name"),Ln={EXISTS:xn,PROPER:xn&&"something"===function(){}.name,CONFIGURABLE:xn&&(!Dn||Dn&&Sn(wn,"name").configurable)},On=yt,kn=ce,An=X(Function.toString);On(kn.inspectSource)||(kn.inspectSource=function(t){return An(t)});var Nn,Un,Pn,Mn=kn.inspectSource,jn=yt,Vn=k.WeakMap,Gn=jn(Vn)&&/native code/.test(String(Vn)),Hn=ne.exports,Bn=Ee,Fn=Hn("keys"),Kn=function(t){return Fn[t]||(Fn[t]=Bn(t))},zn={},Jn=Gn,Wn=k,$n=Et,qn=Cn,Yn=ve,Xn=ce,Qn=Kn,Zn=zn,tr="Object already initialized",er=Wn.TypeError,nr=Wn.WeakMap;if(Jn||Xn.state){var rr=Xn.state||(Xn.state=new nr);rr.get=rr.get,rr.has=rr.has,rr.set=rr.set,Nn=function(t,e){if(rr.has(t))throw new er(tr);return e.facade=t,rr.set(t,e),e},Un=function(t){return rr.get(t)||{}},Pn=function(t){return rr.has(t)}}else{var ir=Qn("state");Zn[ir]=!0,Nn=function(t,e){if(Yn(t,ir))throw new er(tr);return e.facade=t,qn(t,ir,e),e},Un=function(t){return Yn(t,ir)?t[ir]:{}},Pn=function(t){return Yn(t,ir)}}var ar={set:Nn,get:Un,has:Pn,enforce:function(t){return Pn(t)?Un(t):Nn(t,{})},getterFor:function(t){return function(e){var n;if(!$n(e)||(n=Un(e)).type!==t)throw new er("Incompatible receiver, "+t+" required");return n}}},or=X,sr=N,cr=yt,lr=ve,ur=U,hr=Ln.CONFIGURABLE,fr=Mn,dr=ar.enforce,pr=ar.get,vr=String,gr=Object.defineProperty,yr=or("".slice),Ir=or("".replace),mr=or([].join),Er=ur&&!sr((function(){return 8!==gr((function(){}),"length",{value:8}).length})),_r=String(String).split("String"),Tr=bn.exports=function(t,e,n){"Symbol("===yr(vr(e),0,7)&&(e="["+Ir(vr(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!lr(t,"name")||hr&&t.name!==e)&&(ur?gr(t,"name",{value:e,configurable:!0}):t.name=e),Er&&n&&lr(n,"arity")&&t.length!==n.arity&&gr(t,"length",{value:n.arity});try{n&&lr(n,"constructor")&&n.constructor?ur&&gr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=dr(t);return lr(r,"source")||(r.source=mr(_r,"string"==typeof e?e:"")),t};Function.prototype.toString=Tr((function(){return cr(this)&&pr(this).source||fr(this)}),"toString");var Cr=yt,br=rn,Dr=bn.exports,Rr=ae,wr=function(t,e,n,r){r||(r={});var i=r.enumerable,a=void 0!==r.name?r.name:e;if(Cr(n)&&Dr(n,a,r),r.global)i?t[e]=n:Rr(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=n:br.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Sr={},xr=Math.ceil,Lr=Math.floor,Or=Math.trunc||function(t){var e=+t;return(e>0?Lr:xr)(e)},kr=function(t){var e=+t;return e!=e||0===e?0:Or(e)},Ar=kr,Nr=Math.max,Ur=Math.min,Pr=function(t,e){var n=Ar(t);return n<0?Nr(n+e,0):Ur(n,e)},Mr=kr,jr=Math.min,Vr=function(t){return t>0?jr(Mr(t),9007199254740991):0},Gr=Vr,Hr=function(t){return Gr(t.length)},Br=dt,Fr=Pr,Kr=Hr,zr=function(t){return function(e,n,r){var i,a=Br(e),o=Kr(a),s=Fr(r,o);if(t&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}},Jr={includes:zr(!0),indexOf:zr(!1)},Wr=ve,$r=dt,qr=Jr.indexOf,Yr=zn,Xr=X([].push),Qr=function(t,e){var n,r=$r(t),i=0,a=[];for(n in r)!Wr(Yr,n)&&Wr(r,n)&&Xr(a,n);for(;e.length>i;)Wr(r,n=e[i++])&&(~qr(a,n)||Xr(a,n));return a},Zr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ti=Qr,ei=Zr.concat("length","prototype");Sr.f=Object.getOwnPropertyNames||function(t){return ti(t,ei)};var ni={};ni.f=Object.getOwnPropertySymbols;var ri=Ct,ii=Sr,ai=ni,oi=ln,si=X([].concat),ci=ri("Reflect","ownKeys")||function(t){var e=ii.f(oi(t)),n=ai.f;return n?si(e,n(t)):e},li=ve,ui=ci,hi=A,fi=rn,di=N,pi=yt,vi=/#|\.prototype\./,gi=function(t,e){var n=Ii[yi(t)];return n===Ei||n!==mi&&(pi(e)?di(e):!!e)},yi=gi.normalize=function(t){return String(t).replace(vi,".").toLowerCase()},Ii=gi.data={},mi=gi.NATIVE="N",Ei=gi.POLYFILL="P",_i=gi,Ti=k,Ci=A.f,bi=Cn,Di=wr,Ri=ae,wi=function(t,e,n){for(var r=ui(e),i=fi.f,a=hi.f,o=0;o9007199254740991)throw ki("Maximum allowed index exceeded");return t},Ni=He,Ui=rn,Pi=J,Mi=function(t,e,n){var r=Ni(e);r in t?Ui.f(t,r,Pi(0,n)):t[r]=n},ji={};ji[Le("toStringTag")]="z";var Vi="[object z]"===String(ji),Gi=Vi,Hi=yt,Bi=et,Fi=Le("toStringTag"),Ki=Object,zi="Arguments"===Bi(function(){return arguments}()),Ji=Gi?Bi:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Ki(t),Fi))?n:zi?Bi(e):"Object"===(r=Bi(e))&&Hi(e.callee)?"Arguments":r},Wi=X,$i=N,qi=yt,Yi=Ji,Xi=Mn,Qi=function(){},Zi=[],ta=Ct("Reflect","construct"),ea=/^\s*(?:class|function)\b/,na=Wi(ea.exec),ra=!ea.test(Qi),ia=function(t){if(!qi(t))return!1;try{return ta(Qi,Zi,t),!0}catch(t){return!1}},aa=function(t){if(!qi(t))return!1;switch(Yi(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ra||!!na(ea,Xi(t))}catch(t){return!0}};aa.sham=!0;var oa=!ta||$i((function(){var t;return ia(ia.call)||!ia(Object)||!ia((function(){t=!0}))||t}))?aa:ia,sa=Oi,ca=oa,la=Et,ua=Le("species"),ha=Array,fa=function(t){var e;return sa(t)&&(e=t.constructor,(ca(e)&&(e===ha||sa(e.prototype))||la(e)&&null===(e=e[ua]))&&(e=void 0)),void 0===e?ha:e},da=function(t,e){return new(fa(t))(0===e?0:e)},pa=N,va=kt,ga=Le("species"),ya=function(t){return va>=51||!pa((function(){var e=[];return(e.constructor={})[ga]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ia=xi,ma=N,Ea=Oi,_a=Et,Ta=fe,Ca=Hr,ba=Ai,Da=Mi,Ra=da,wa=ya,Sa=kt,xa=Le("isConcatSpreadable"),La=Sa>=51||!ma((function(){var t=[];return t[xa]=!1,t.concat()[0]!==t})),Oa=function(t){if(!_a(t))return!1;var e=t[xa];return void 0!==e?!!e:Ea(t)};Ia({target:"Array",proto:!0,arity:1,forced:!La||!wa("concat")},{concat:function(t){var e,n,r,i,a,o=Ta(this),s=Ra(o,0),c=0;for(e=-1,r=arguments.length;e1?arguments[1]:void 0;return Za?Qa(this,t,e)||0:Ya(this,t,e)}});var to=$t,eo=P,no=Ja(Ja.bind),ro=function(t,e){return to(t),void 0===e?t:eo?no(t,e):function(){return t.apply(e,arguments)}},io=ro,ao=ot,oo=fe,so=Hr,co=da,lo=X([].push),uo=function(t){var e=1===t,n=2===t,r=3===t,i=4===t,a=6===t,o=7===t,s=5===t||a;return function(c,l,u,h){for(var f,d,p=oo(c),v=ao(p),g=so(v),y=io(l,u),I=0,m=h||co,E=e?m(c,g):n||o?m(c,0):void 0;g>I;I++)if((s||I in v)&&(d=y(f=v[I],I,p),t))if(e)E[I]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return I;case 2:lo(E,f)}else switch(t){case 4:return!1;case 7:lo(E,f)}return a?-1:r||i?i:E}},ho={forEach:uo(0),map:uo(1),filter:uo(2),some:uo(3),every:uo(4),find:uo(5),findIndex:uo(6),filterReject:uo(7)},fo=ho.filter;xi({target:"Array",proto:!0,forced:!ya("filter")},{filter:function(t){return fo(this,t,arguments.length>1?arguments[1]:void 0)}});var po=Ji,vo=Vi?{}.toString:function(){return"[object "+po(this)+"]"};Vi||wr(Object.prototype,"toString",vo,{unsafe:!0});var go=ho.map;xi({target:"Array",proto:!0,forced:!ya("map")},{map:function(t){return go(this,t,arguments.length>1?arguments[1]:void 0)}});var yo=xi,Io=Date,mo=X(Io.prototype.getTime);yo({target:"Date",stat:!0},{now:function(){return mo(new Io)}});var Eo=U,_o=X,To=V,Co=N,bo=Ha,Do=ni,Ro=G,wo=fe,So=ot,xo=Object.assign,Lo=Object.defineProperty,Oo=_o([].concat),ko=!xo||Co((function(){if(Eo&&1!==xo({b:1},xo(Lo({},"a",{enumerable:!0,get:function(){Lo(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!==xo({},t)[n]||bo(xo({},e)).join("")!==r}))?function(t,e){for(var n=wo(t),r=arguments.length,i=1,a=Do.f,o=Ro.f;r>i;)for(var s,c=So(arguments[i++]),l=a?Oo(bo(c),a(c)):bo(c),u=l.length,h=0;u>h;)s=l[h++],Eo&&!To(o,c,s)||(n[s]=c[s]);return n}:xo,Ao=ko;xi({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ao},{assign:Ao});var No,Uo,Po,Mo,jo="process"===et(k.process),Vo=X,Go=$t,Ho=yt,Bo=String,Fo=TypeError,Ko=function(t,e,n){try{return Vo(Go(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},zo=ln,Jo=function(t){if("object"==typeof t||Ho(t))return t;throw new Fo("Can't set "+Bo(t)+" as a prototype")},Wo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Ko(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return zo(n),Jo(r),e?t(n,r):n.__proto__=r,n}}():void 0),$o=rn.f,qo=ve,Yo=Le("toStringTag"),Xo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!qo(t,Yo)&&$o(t,Yo,{configurable:!0,value:e})},Qo=bn.exports,Zo=rn,ts=function(t,e,n){return n.get&&Qo(n.get,e,{getter:!0}),n.set&&Qo(n.set,e,{setter:!0}),Zo.f(t,e,n)},es=Ct,ns=ts,rs=U,is=Le("species"),as=function(t){var e=es(t);rs&&e&&!e[is]&&ns(e,is,{configurable:!0,get:function(){return this}})},os=bt,ss=TypeError,cs=function(t,e){if(os(e,t))return t;throw new ss("Incorrect invocation")},ls=oa,us=Kt,hs=TypeError,fs=ln,ds=function(t){if(ls(t))return t;throw new hs(us(t)+" is not a constructor")},ps=st,vs=Le("species"),gs=P,ys=Function.prototype,Is=ys.apply,ms=ys.call,Es="object"==typeof Reflect&&Reflect.apply||(gs?ms.bind(Is):function(){return ms.apply(Is,arguments)}),_s=Ct("document","documentElement"),Ts=X([].slice),Cs=TypeError,bs=function(t,e){if(ta;a++)if((s=y(t[a]))&&Iu(bu,s))return s;return new Cu(!1)}r=mu(t,i)}for(c=f?t.next:r.next;!(l=du(c,r)).done;){try{s=y(l.value)}catch(t){_u(r,"throw",t)}if("object"==typeof s&&s&&Iu(bu,s))return s}return new Cu(!1)},Ru=Le("iterator"),wu=!1;try{var Su=0,xu={next:function(){return{done:!!Su++}},return:function(){wu=!0}};xu[Ru]=function(){return this},Array.from(xu,(function(){throw 2}))}catch(t){}var Lu=function(t,e){try{if(!e&&!wu)return!1}catch(t){return!1}var n=!1;try{var r={};r[Ru]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ou=wc,ku=Fc.CONSTRUCTOR||!Lu((function(t){Ou.all(t).then(void 0,(function(){}))})),Au=V,Nu=$t,Uu=Kc,Pu=Rc,Mu=Du;xi({target:"Promise",stat:!0,forced:ku},{all:function(t){var e=this,n=Uu.f(e),r=n.resolve,i=n.reject,a=Pu((function(){var n=Nu(e.resolve),a=[],o=0,s=1;Mu(t,(function(t){var c=o++,l=!1;s++,Au(n,e,t).then((function(t){l||(l=!0,a[c]=t,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var ju=xi,Vu=Fc.CONSTRUCTOR,Gu=wc,Hu=Ct,Bu=yt,Fu=wr,Ku=Gu&&Gu.prototype;if(ju({target:"Promise",proto:!0,forced:Vu,real:!0},{catch:function(t){return this.then(void 0,t)}}),Bu(Gu)){var zu=Hu("Promise").prototype.catch;Ku.catch!==zu&&Fu(Ku,"catch",zu,{unsafe:!0})}var Ju=V,Wu=$t,$u=Kc,qu=Rc,Yu=Du;xi({target:"Promise",stat:!0,forced:ku},{race:function(t){var e=this,n=$u.f(e),r=n.reject,i=qu((function(){var i=Wu(e.resolve);Yu(t,(function(t){Ju(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Xu=V,Qu=Kc;xi({target:"Promise",stat:!0,forced:Fc.CONSTRUCTOR},{reject:function(t){var e=Qu.f(this);return Xu(e.reject,void 0,t),e.promise}});var Zu=ln,th=Et,eh=Kc,nh=xi,rh=Fc.CONSTRUCTOR,ih=function(t,e){if(Zu(t),th(e)&&e.constructor===t)return e;var n=eh.f(t);return(0,n.resolve)(e),n.promise};Ct("Promise"),nh({target:"Promise",stat:!0,forced:rh},{resolve:function(t){return ih(this,t)}});var ah="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,oh=k,sh=Es,ch=yt,lh=ah,uh=Dt,hh=Ts,fh=bs,dh=oh.Function,ph=/MSIE .\./.test(uh)||lh&&function(){var t=oh.Bun.version.split(".");return t.length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2])}(),vh=function(t,e){var n=e?2:1;return ph?function(r,i){var a=fh(arguments.length,1)>n,o=ch(r)?r:dh(r),s=a?hh(arguments,n):[],c=a?function(){sh(o,this,s)}:o;return e?t(c,i):t(c)}:t},gh=xi,yh=k,Ih=vh(yh.setInterval,!0);gh({global:!0,bind:!0,forced:yh.setInterval!==Ih},{setInterval:Ih});var mh=xi,Eh=k,_h=vh(Eh.setTimeout,!0);mh({global:!0,bind:!0,forced:Eh.setTimeout!==_h},{setTimeout:_h});var Th=Ji,Ch=String,bh=function(t){if("Symbol"===Th(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ch(t)},Dh=X,Rh=kr,wh=bh,Sh=ut,xh=Dh("".charAt),Lh=Dh("".charCodeAt),Oh=Dh("".slice),kh=function(t){return function(e,n){var r,i,a=wh(Sh(e)),o=Rh(n),s=a.length;return o<0||o>=s?t?"":void 0:(r=Lh(a,o))<55296||r>56319||o+1===s||(i=Lh(a,o+1))<56320||i>57343?t?xh(a,o):r:t?Oh(a,o,o+2):i-56320+(r-55296<<10)+65536}},Ah={codeAt:kh(!1),charAt:kh(!0)},Nh={},Uh=U,Ph=an,Mh=rn,jh=ln,Vh=dt,Gh=Ha;Nh.f=Uh&&!Ph?Object.defineProperties:function(t,e){jh(t);for(var n,r=Vh(e),i=Gh(e),a=i.length,o=0;a>o;)Mh.f(t,n=i[o++],r[n]);return t};var Hh,Bh=ln,Fh=Nh,Kh=Zr,zh=zn,Jh=_s,Wh=ze,$h="prototype",qh="script",Yh=Kn("IE_PROTO"),Xh=function(){},Qh=function(t){return"<"+qh+">"+t+""},Zh=function(t){t.write(Qh("")),t.close();var e=t.parentWindow.Object;return t=null,e},tf=function(){try{Hh=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;tf="undefined"!=typeof document?document.domain&&Hh?Zh(Hh):(e=Wh("iframe"),n="java"+qh+":",e.style.display="none",Jh.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Qh("document.F=Object")),t.close(),t.F):Zh(Hh);for(var r=Kh.length;r--;)delete tf[$h][Kh[r]];return tf()};zh[Yh]=!0;var ef,nf,rf,af=Object.create||function(t,e){var n;return null!==t?(Xh[$h]=Bh(t),n=new Xh,Xh[$h]=null,n[Yh]=t):n=tf(),void 0===e?n:Fh.f(n,e)},of=!N((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),sf=ve,cf=yt,lf=fe,uf=of,hf=Kn("IE_PROTO"),ff=Object,df=ff.prototype,pf=uf?ff.getPrototypeOf:function(t){var e=lf(t);if(sf(e,hf))return e[hf];var n=e.constructor;return cf(n)&&e instanceof n?n.prototype:e instanceof ff?df:null},vf=N,gf=yt,yf=Et,If=pf,mf=wr,Ef=Le("iterator"),_f=!1;[].keys&&("next"in(rf=[].keys())?(nf=If(If(rf)))!==Object.prototype&&(ef=nf):_f=!0);var Tf=!yf(ef)||vf((function(){var t={};return ef[Ef].call(t)!==t}));Tf&&(ef={}),gf(ef[Ef])||mf(ef,Ef,(function(){return this}));var Cf={IteratorPrototype:ef,BUGGY_SAFARI_ITERATORS:_f},bf=Cf.IteratorPrototype,Df=af,Rf=J,wf=Xo,Sf=Kl,xf=function(){return this},Lf=xi,Of=V,kf=yt,Af=function(t,e,n,r){var i=e+" Iterator";return t.prototype=Df(bf,{next:Rf(+!r,n)}),wf(t,i,!1),Sf[i]=xf,t},Nf=pf,Uf=Wo,Pf=Xo,Mf=Cn,jf=wr,Vf=Kl,Gf=Ln.PROPER,Hf=Ln.CONFIGURABLE,Bf=Cf.IteratorPrototype,Ff=Cf.BUGGY_SAFARI_ITERATORS,Kf=Le("iterator"),zf="keys",Jf="values",Wf="entries",$f=function(){return this},qf=function(t,e,n,r,i,a,o){Af(n,e,r);var s,c,l,u=function(t){if(t===i&&v)return v;if(!Ff&&t&&t in d)return d[t];switch(t){case zf:case Jf:case Wf:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,d=t.prototype,p=d[Kf]||d["@@iterator"]||i&&d[i],v=!Ff&&p||u(i),g="Array"===e&&d.entries||p;if(g&&(s=Nf(g.call(new t)))!==Object.prototype&&s.next&&(Nf(s)!==Bf&&(Uf?Uf(s,Bf):kf(s[Kf])||jf(s,Kf,$f)),Pf(s,h,!0)),Gf&&i===Jf&&p&&p.name!==Jf&&(Hf?Mf(d,"name",Jf):(f=!0,v=function(){return Of(p,this)})),i)if(c={values:u(Jf),keys:a?v:u(zf),entries:u(Wf)},o)for(l in c)(Ff||f||!(l in d))&&jf(d,l,c[l]);else Lf({target:e,proto:!0,forced:Ff||f},c);return d[Kf]!==v&&jf(d,Kf,v,{name:i}),Vf[e]=v,c},Yf=function(t,e){return{value:t,done:e}},Xf=Ah.charAt,Qf=bh,Zf=ar,td=qf,ed=Yf,nd="String Iterator",rd=Zf.set,id=Zf.getterFor(nd);td(String,"String",(function(t){rd(this,{type:nd,string:Qf(t),index:0})}),(function(){var t,e=id(this),n=e.string,r=e.index;return r>=n.length?ed(void 0,!0):(t=Xf(n,r),e.index+=t.length,ed(t,!1))}));var ad=Le,od=af,sd=rn.f,cd=ad("unscopables"),ld=Array.prototype;void 0===ld[cd]&&sd(ld,cd,{configurable:!0,value:od(null)});var ud=function(t){ld[cd][t]=!0},hd=dt,fd=ud,dd=Kl,pd=ar,vd=rn.f,gd=qf,yd=Yf,Id=U,md="Array Iterator",Ed=pd.set,_d=pd.getterFor(md),Td=gd(Array,"Array",(function(t,e){Ed(this,{type:md,target:hd(t),index:0,kind:e})}),(function(){var t=_d(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=void 0,yd(void 0,!0);switch(t.kind){case"keys":return yd(n,!1);case"values":return yd(e[n],!1)}return yd([n,e[n]],!1)}),"values"),Cd=dd.Arguments=dd.Array;if(fd("keys"),fd("values"),fd("entries"),Id&&"values"!==Cd.name)try{vd(Cd,"name",{value:"values"})}catch(t){}var bd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Dd=ze("span").classList,Rd=Dd&&Dd.constructor&&Dd.constructor.prototype,wd=Rd===Object.prototype?void 0:Rd,Sd=k,xd=bd,Ld=wd,Od=Td,kd=Cn,Ad=Xo,Nd=Le("iterator"),Ud=Od.values,Pd=function(t,e){if(t){if(t[Nd]!==Ud)try{kd(t,Nd,Ud)}catch(e){t[Nd]=Ud}if(Ad(t,e,!0),xd[e])for(var n in Od)if(t[n]!==Od[n])try{kd(t,n,Od[n])}catch(e){t[n]=Od[n]}}};for(var Md in xd)Pd(Sd[Md]&&Sd[Md].prototype,Md);Pd(Ld,"DOMTokenList");var jd=xi,Vd=Oi,Gd=oa,Hd=Et,Bd=Pr,Fd=Hr,Kd=dt,zd=Mi,Jd=Le,Wd=Ts,$d=ya("slice"),qd=Jd("species"),Yd=Array,Xd=Math.max;jd({target:"Array",proto:!0,forced:!$d},{slice:function(t,e){var n,r,i,a=Kd(this),o=Fd(a),s=Bd(t,o),c=Bd(void 0===e?o:e,o);if(Vd(a)&&(n=a.constructor,(Gd(n)&&(n===Yd||Vd(n.prototype))||Hd(n)&&null===(n=n[qd]))&&(n=void 0),n===Yd||void 0===n))return Wd(a,s,c);for(r=new(void 0===n?Yd:n)(Xd(c-s,0)),i=0;s1?arguments[1]:void 0)};xi({target:"Array",proto:!0,forced:[].forEach!==Zd},{forEach:Zd});var tp=k,ep=bd,np=wd,rp=Zd,ip=Cn,ap=function(t){if(t&&t.forEach!==rp)try{ip(t,"forEach",rp)}catch(e){t.forEach=rp}};for(var op in ep)ep[op]&&ap(tp[op]&&tp[op].prototype);ap(np);var sp=ln,cp=hu,lp=ro,up=V,hp=fe,fp=function(t,e,n,r){try{return r?e(sp(n)[0],n[1]):e(n)}catch(e){cp(t,"throw",e)}},dp=$l,pp=oa,vp=Hr,gp=Mi,yp=su,Ip=tu,mp=Array,Ep=function(t){var e=hp(t),n=pp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=lp(i,r>2?arguments[2]:void 0));var o,s,c,l,u,h,f=Ip(e),d=0;if(!f||this===mp&&dp(f))for(o=vp(e),s=n?new this(o):mp(o);o>d;d++)h=a?i(e[d],d):e[d],gp(s,d,h);else for(u=(l=yp(e,f)).next,s=n?new this:[];!(c=up(u,l)).done;d++)h=a?fp(l,i,[c.value,d],!0):c.value,gp(s,d,h);return s.length=d,s};xi({target:"Array",stat:!0,forced:!Lu((function(t){Array.from(t)}))},{from:Ep});var _p={exports:{}},Tp={},Cp=Pr,bp=Hr,Dp=Mi,Rp=Array,wp=Math.max,Sp=et,xp=dt,Lp=Sr.f,Op=function(t,e,n){for(var r=bp(t),i=Cp(e,r),a=Cp(void 0===n?r:n,r),o=Rp(wp(a-i,0)),s=0;i1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Rv(a,n?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),Nv&&Dv(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(t,e,n){var r=e+" Iterator",i=Mv(e),a=Mv(r);Ov(t,e,(function(t,e){Pv(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?kv("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=void 0,kv(void 0,!0))}),n?"entries":"values",!n,!0),Av(e)}};_v("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),jv);var Vv=U,Gv=Oi,Hv=TypeError,Bv=Object.getOwnPropertyDescriptor,Fv=Vv&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(Gv(t)&&!Bv(t,"length").writable)throw new Hv("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Kv=Kt,zv=TypeError,Jv=xi,Wv=fe,$v=Pr,qv=kr,Yv=Hr,Xv=Fv,Qv=Ai,Zv=da,tg=Mi,eg=function(t,e){if(!delete t[e])throw new zv("Cannot delete property "+Kv(e)+" of "+Kv(t))},ng=ya("splice"),rg=Math.max,ig=Math.min;Jv({target:"Array",proto:!0,forced:!ng},{splice:function(t,e){var n,r,i,a,o,s,c=Wv(this),l=Yv(c),u=$v(t,l),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=l-u):(n=h-2,r=ig(rg(qv(e),0),l-u)),Qv(l+n-r),i=Zv(c,r),a=0;al-r+n;a--)eg(c,a-1)}else if(n>r)for(a=l-r;a>u;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:eg(c,s);for(a=0;a 标签),请使用真机调试或者扫码预览。",Lg={RECORD:"scope.record",CAMERA:"scope.camera"},Og="https://buy.cloud.tencent.com/avc?addRavLicense=1",kg="https://buy.tencentcloud.com/avc?addRavLicense=1",Ag=1,Ng=9,Ug=17,Pg=18,Mg=21,jg=15,Vg="\t\n\v\f\r                 \u2028\u2029\ufeff",Gg=ut,Hg=bh,Bg=Vg,Fg=X("".replace),Kg=RegExp("^["+Bg+"]+"),zg=RegExp("(^|[^"+Bg+"])["+Bg+"]+$"),Jg=function(t){return function(e){var n=Hg(Gg(e));return 1&t&&(n=Fg(n,Kg,"")),2&t&&(n=Fg(n,zg,"$1")),n}},Wg={start:Jg(1),end:Jg(2),trim:Jg(3)},$g=k,qg=N,Yg=X,Xg=bh,Qg=Wg.trim,Zg=Vg,ty=$g.parseInt,ey=$g.Symbol,ny=ey&&ey.iterator,ry=/^[+-]?0x/i,iy=Yg(ry.exec),ay=8!==ty(Zg+"08")||22!==ty(Zg+"0x16")||ny&&!qg((function(){ty(Object(ny))}))?function(t,e){var n=Qg(Xg(t));return ty(n,e>>>0||(iy(ry,n)?16:10))}:ty;function oy(t){var e=new Date(t);return"".concat(e.getFullYear(),"-")+"".concat(e.getMonth()+1<10?"0".concat(e.getMonth()+1):e.getMonth()+1,"-")+sy(e.getDate()," ")+sy(e.getHours(),":")+sy(e.getMinutes(),":")+sy(e.getSeconds(),"")}function sy(t,e){return"".concat(t<10?"0".concat(t).concat(e):"".concat(t).concat(e))}xi({global:!0,forced:parseInt!==ay},{parseInt:ay});var cy={exports:{}};self;var ly=L(cy.exports=(()=>(()=>{var t={530:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=void 0;var r=n(928);e.formatClsLog=function(){return function(t,e){try{e({logs:null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else"time"===n&&(e[n]=new Date(t[n]).toISOString()),e[n]=t[n]+""})),{contents:e,time:t.time}})),source:""})}catch(t){console.debug(t)}}}},597:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatESLog=void 0;var r=n(928);e.formatESLog=function(t){var e=t.table;return function(t,n){try{var i=null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else e[n]="level"===n?t[n]+"":"time"===n?new Date(t[n]).toISOString():t[n]})),e}));n({table:e,report:i})}catch(t){console.debug(t)}}}},150:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=e.formatESLog=void 0;var r=n(314);Object.defineProperty(e,"formatClsLog",{enumerable:!0,get:function(){return r.formatClsLog}});var i=n(597);Object.defineProperty(e,"formatESLog",{enumerable:!0,get:function(){return i.formatESLog}})},757:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPipeline=void 0;var r=n(928);e.createPipeline=function(t){if(!t||!t.reduce||!t.length)throw new TypeError("createPipeline need at least one function param");return 1===t.length?function(e,n){t[0](e,n||r.noop)}:t.reduce((function(t,e){return function(n,i){return void 0===i&&(i=r.noop),t(n,(function(t){return null==e?void 0:e(t,i)}))}}))}},758:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.limitLengthPipe=e.MAX_LOG_LENGTH=void 0;var r=n(928);e.MAX_LOG_LENGTH=102400,e.limitLengthPipe=function(){return function(t,n){try{var i=(t=t||{}).logs,a=void 0===i?[]:i;t.logs=null==a?void 0:a.map((function(t){var n=e.MAX_LOG_LENGTH,i=t.contents;return Object.keys(i).forEach((function(t){var e=i[t];try{e&&e.length>n&&(i[t]=null==e?void 0:e.substring(0,n))}catch(a){console.debug("size of content > limitSize"),i[t]=(0,r.stringifyPlus)(e).substring(0,n)}})),t})),n(t)}catch(t){console.debug(t)}}}},23:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createThrottlePipe=void 0,e.createThrottlePipe=function(t,e){var n,r=[];return function(i,a){if(Array.isArray(i)?r=r.concat(i):r.push(i),e&&r.length>=e||t.sendNow&&r.length>0)return a(r.splice(0,r.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout((function(){n=null,r.length>0&&a(r.splice(0,r.length))}),t.delay||1e3)}}},434:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,3];case 2:return n.sent(),[3,1];case 3:return s++,[4,new Promise((function(e,n){wx.request(r(r({},t),{success:function(t){e(t)},fail:function(t){n(t)}}))}))];case 4:return[2,n.sent()];case 5:return e=n.sent(),[2,Promise.reject(e)];case 6:return s--,(0,o.resolveFirstBlock)(),[7];case 7:return[2]}}))}))}},310:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,2];case 1:return i.sent(),[3,0];case 2:return s++,r=n.method,u=n.headers,f=void 0===u?{}:u,d=n.responseType,p=void 0===d?"json":d,r=(r||"get").toUpperCase(),Object.assign(f,{"Content-type":"application/json"}),(v=new window.XMLHttpRequest).responseType=p,v.timeout=1e4,v.onreadystatechange=function(){4===v.readyState&&(200===v.status?l({data:v.response}):h({code:v.status,msg:v.statusText}))},v.ontimeout=function(t){h({code:v.status,msg:v.statusText})},v.onloadend=function(){v&&(c((function(t){l(t)}),(function(t){h(t)}),{status:v.status,statusText:v.statusText}),v=null)},v.onabort=function(){v&&(h(new Error("Request aborted")),v=null)},v.onerror=function(){h(new Error("Network Error")),v=null},"GET"===r?t="url".concat(-1===t.indexOf("?")?"?":"&").concat(a.default.stringify(e)):"POST"===r&&(e=JSON.stringify(e)),v.open(r,t,!0),Object.keys(f).forEach((function(t){v.setRequestHeader(t,f[t])})),v.send("POST"===r?e:null),[2]}}))}))}))];case 1:return[2,h.sent()];case 2:throw l=h.sent(),new Error(l);case 3:return s--,(0,o.resolveFirstBlock)(),[7];case 4:return[2]}}))}))}},928:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.date2ISOString=e.stringifyPlus=e.noop=e.isBrowser=e.isMiniProgram=e.isPlainObject=e.appendParams=void 0,e.appendParams=function(t,n){void 0===n&&(n={});var r=[];return Object.keys(n).forEach((function(t){var i=n[t];if(void 0!==i){if((0,e.isPlainObject)(i))try{i=JSON.stringify(i)}catch(t){}r.push("".concat(t,"=").concat(encodeURIComponent(i)))}})),r.length?(t.indexOf("?")>-1?"".concat(t,"&"):"".concat(t,"?"))+r.join("&"):t},e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},e.isMiniProgram=function(){try{return!(!(null===wx||void 0===wx?void 0:wx.request)||!(null===wx||void 0===wx?void 0:wx.connectSocket))}catch(t){return!1}},e.isBrowser=function(){try{return!(0,e.isMiniProgram)()&&"undefined"!=typeof window&&void 0!==window.document}catch(t){return!1}},e.noop=function(){};var n=function(){var t=new WeakSet;return function(e,n){if(n instanceof Error)return"Error.message: ".concat(n.message," \n Error.stack: ").concat(n.stack);if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular ".concat(e||"root","]");t.add(n)}return n}};e.stringifyPlus=function(t){if("string"==typeof t)return t;try{return t instanceof Error?(JSON.stringify(t,n())||"undefined").replace(/"/gim,""):JSON.stringify(t,n())||"undefined"}catch(t){return"error happen when aegis stringify: \n ".concat(t.message," \n ").concat(t.stack)}},e.date2ISOString=function(){var t,e=new Date,n=e.toISOString(),r=e.getTimezoneOffset()/60;return t=r<0?r>-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",t)}},580:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n(928);e.default={stringify:function(t){return t?Object.keys(t).map((function(e){var n=t[e];if((0,r.isPlainObject)(n))n=JSON.stringify(n);else{if("string"!=typeof n&&"number"!=typeof n)return"";n=+n}return encodeURIComponent(e)+"="+encodeURIComponent(n)})).filter((function(t){return t.length>0})).join("&"):""}}},690:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.startBlocking=e.resolveFirstBlock=void 0;var n=[];e.startBlocking=function(){var t,e=new Promise((function(e){t=e}));return n.push({promise:e,resolve:t}),e},e.resolveFirstBlock=function(){n.length&&(n[0].resolve(),n.shift())}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0});var e=n(530),i={debug:console.debug,info:console.info,warn:console.warn,error:console.error,updateGetReportData:function(t){console.debug(t)}},a=null;t.default=function(t){if(!a){var n=t||{},r=n.clsConfig,o=(n.esConfig,r.endpoint),s=r.topicId;if(!o||!s)return console.debug("endpoint and topicId must not be null"),i;a=new e.default(t)}return a}})(),r})())()),uy=U,hy=Ln.EXISTS,fy=X,dy=ts,py=Function.prototype,vy=fy(py.toString),gy=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,yy=fy(gy.exec);uy&&!hy&&dy(py,"name",{configurable:!0,get:function(){try{return yy(gy,vy(this))[1]}catch(t){return""}}});var Iy={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:20003,ERROR_BLACKLIST:20007},my="未连接到网络",Ey="You do not have TUICallKit package, please open the free experience in the console: https://console.intl.cloud.tencent.com/im/detail or purchase the official package: ${purchaseAddress}",_y="The package you purchased does not support this ability. You can refer to here to purchase: ${purchaseAddress}",Ty="TIM SDK version is too old. Please upgrade version",Cy="init is not complete, this API needs to be used after init. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",by="The API is support use in the state of. Please go to: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",Dy={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"切换语音通话失败",FAILURE_SWITCH_TO_VIDEO:"切换视频通话失败",ERROR_NULL:"成功",ERROR_PACKAGE_NOT_PURCHASED:"您的应用还未开通音视频通话(TUICallKit)能力,您可以去控制台申请免费体验: https://console.cloud.tencent.com/im/detail 或购买通话能力套餐包: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"您暂不支持使用该能力,请前往如下购买页购买开通: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK 版本太旧,请升级版本",ERROR_PERMISSION_DENIED:"摄像头/麦克风权限被拒绝。解决方案请前往: https://cloud.tencent.com/document/product/647/78770",ERROR_GET_DEVICE_LIST_FAIL:"获取设备列表失败",ERROR_INIT_FAIL:"TUICallEngine init 未完成,需要在 init 完成后使用此 API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"当前通话状态无法使用该API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"当前方法正在执行中,请勿重复调用",ERROR_REQUEST_REPEATED_SWITCH:"与当前通话类型一致,请勿重复切换",ERROR_SCENE_NOT_SUPPORTED:"当前通话场景不支持该功能",ERROR_SIGNALING_SEND_FAIL:"信令发送失败",ERROR_INVALID_INVITEID:"inviteID 无效或邀请已处理。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"消息发送方或接收方 UserID 无效或不存在。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"参数错误"},Ry=function(t){p(n,m(Error));var e=T(n);function n(t){var r,i=t.message,a=t.code,o=void 0===a?Iy.UNKNOWN:a;return u(this,n),r=e.call(this,"".concat(i).concat(function(t){for(var e=0,n=Object.keys(Dy);e")),r.code=o,r.name="TUICallEngineError",r.message_=i,r}return f(n,[{key:"getCode",value:function(){return this.code}}]),n}(),wy=["inviteID","type"],Sy=function(){function t(e){u(this,t),this.TSignaling=e.TSignaling,this._logger=ly()}var e,n,r,o,s,c,h;return f(t,[{key:"handleNewSignaling",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._logger.info("TSignaling.handleNewSignaling.start",{text:{data:{data:t,params:e,userData:n}},type:"api"}),i(i({userData:n||""},t),{},{version:4,businessID:"av_call",platform:"MiniApp",data:i({cmd:_g[t.call_type],room_id:t.room_id,message:""},e)})}},{key:"extractCallingInfoFromMessage",value:function(t){if(!t||"TIMCustomElem"!==t.type)return"";var e=JSON.parse(t.payload.data);if(e.businessID!==dg)return"";switch(e.actionType){case cg:var n=JSON.parse(e.data);return n.call_end>0&&!e.groupID?n.call_end:0!==n.call_end&&n.room_id?"发起通话":"结束群聊";case lg:return"取消通话";case ug:return"已接听";case hg:return"拒绝通话";case fg:return"无应答";default:return""}}},{key:"handleError",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.code,n=void 0===e?"":e,r=t.message;if(n)throw new Ry({message:void 0===r?"":r,code:n})}},{key:"_handleInviteData",value:function(t){var e=t.type,n=t.roomID,r=t.userIDList,i=t.hangup,a=t.switchMode,o=t.userData;if(i)return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:i.callEnd},{cmd:"hangup"}));if(a){var s={version:0,call_type:e,room_id:n},c={cmd:"switchToVideo"};return a===Tg&&(s.switch_to_audio_call="switch_to_audio_call",c.cmd="switchToAudio"),JSON.stringify(this.handleNewSignaling(s,c))}return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n},{userIDs:r},o))}},{key:"_handleInviteGroupData",value:function(t){var e=t.type,n=t.roomID,r=t.hangup,i=t.userData;return r?JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:r.call_end},{cmd:"hangup"},i)):JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n}))}},{key:"invite",value:(h=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.invite.start",{text:{data:{params:e}},type:"api"}),n=e.userID,r=e.offlinePushInfo,i=e.hangup,o=e.switchMode,t.prev=2,t.next=5,this.TSignaling.invite({userID:n,data:this._handleInviteData(e),timeout:i?0:30,offlinePushInfo:r});case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.invite.fail",{text:{data:{hangup:i,switchMode:o},error:t.t0},type:"api"}),!i){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,"hangup C2C"));case 13:if(!o){t.next=15;break}return t.abrupt("return",this.handleError(t.t0,o));case 15:return t.abrupt("return",this.handleError(t.t0,"invite"));case 16:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return h.apply(this,arguments)})},{key:"inviteGroup",value:(c=l(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.inviteGroup.start",{text:{data:{params:e}},type:"api"}),n=e.groupID,r=e.userIDList,i=e.offlinePushInfo,o=e.hangup,s=e.inCallUserIDs,c=void 0===s?[]:s,t.prev=2,t.next=5,this.TSignaling.inviteInGroup({groupID:n,inviteeList:r,timeout:o?0:30,data:this._handleInviteGroupData(e),offlinePushInfo:i,inCallUserIDs:c});case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.inviteGroup.fail",{text:{data:{hangup:o},error:t.t0},type:"api"}),!o){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,"hangup group"));case 13:return t.abrupt("return",this.handleError(t.t0,"inviteGroup"));case 14:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return c.apply(this,arguments)})},{key:"accept",value:(s=l(a().mark((function t(e,n){var r,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.accept.start",{text:{data:{params:e,supportParams:n}},type:"api"}),r=e.inviteID,o=e.type,s=E(e,wy),t.prev=2,t.next=5,this.TSignaling.accept({inviteID:r,data:JSON.stringify(this.handleNewSignaling(i({version:0,call_type:o},s),n))});case 5:return t.abrupt("return",t.sent);case 8:return t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.accept.fail",{text:{error:t.t0},type:"api"}),t.abrupt("return",this.handleError(t.t0,"accept"));case 12:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t,e){return s.apply(this,arguments)})},{key:"reject",value:(o=l(a().mark((function t(e){var n,r,i,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.reject.start",{text:{data:{params:e}},type:"api"}),n=e.inviteID,r=e.type,i=e.lineBusy,o={version:0,call_type:r},s=null,i?(o.line_busy=i,s=JSON.stringify(this.handleNewSignaling(o,{message:"lineBusy"}))):s=JSON.stringify(this.handleNewSignaling(o)),t.prev=5,t.next=8,this.TSignaling.reject({inviteID:n,data:s});case 8:return t.abrupt("return",t.sent);case 11:if(t.prev=11,t.t0=t.catch(5),this._logger.error("TSignaling.reject.fail",{text:{error:t.t0},type:"api"}),!i){t.next=16;break}return t.abrupt("return",this.handleError(t.t0,"line_busy"));case 16:return t.abrupt("return",this.handleError(t.t0,"reject"));case 17:case"end":return t.stop()}}),t,this,[[5,11]])}))),function(t){return o.apply(this,arguments)})},{key:"cancel",value:(r=l(a().mark((function t(e){var n,r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.cancel.start",{text:{data:{params:e}},type:"api"}),n=e.inviteID,r=e.callType,t.prev=2,t.next=5,this.TSignaling.cancel({inviteID:n,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:r}))});case 5:return i=t.sent,t.abrupt("return",i);case 9:return t.prev=9,t.t0=t.catch(2),this._logger.error("TSignaling.cancel.fail",{text:{error:t.t0},type:"api"}),t.abrupt("return",this.handleError(t.t0,"cancel"));case 13:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return r.apply(this,arguments)})},{key:"hangup",value:(n=l(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.hangup.start",{text:{data:{params:e}},type:"api"}),n=e.userIDList,r=e.callType,i=e.callEnd,o=void 0===i?0:i,s=e.isGroupCall,c=void 0!==s&&s,l=e.groupID,u=void 0===l?"":l,h={version:0,call_type:r,call_end:o},f={cmd:"hangup"},d=JSON.stringify(this.handleNewSignaling(h,f)),!c||!u){t.next=10;break}return t.next=8,this.TSignaling.inviteInGroup({inviteeList:n,groupID:u,data:d,timeout:0});case 8:t.next=12;break;case 10:return t.next=12,this.TSignaling.invite({userID:n[0],data:d,timeout:0});case 12:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"switchCallMode",value:(e=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.switchCallMode.start",{text:{data:{params:e}},type:"api"}),n=e.userID,r=e.callType,i=e.roomID,o=e.mode,t.abrupt("return",this.invite({userID:n,type:r,roomID:i,switchMode:o}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"destroyed",value:function(){this._logger.info("TSignaling.destroyed.start",{type:"api"}),this.TSignaling=null}},{key:"setLogLevel",value:function(t){this.TSignaling.setLogLevel(t)}}]),t}(),xy=function(){function t(e){u(this,t),this._emitter=e.emitter,this._logger=ly()}return f(t,[{key:"onError",value:function(t){this._logger.error("TUICallEvent.onError",{text:{error:t},type:"event"}),this._emitter.emit(og.ERROR,t)}},{key:"onCallBegin",value:function(t){this._logger.info("TUICallEvent.onCallBegin",{text:{data:t},type:"event"}),this._emitter.emit(og.ON_CALL_BEGIN,t)}},{key:"onCallEnd",value:function(t){this._logger.info("TUICallEvent.onCallEnd",{text:{data:t},type:"event"});var e=t.userID,n=t.callEnd,r=t.message,i=t.roomID,a=t.callMediaType,o=t.callRole,s=t.totalTime;this._emitter.emit(og.CALL_END,{userID:e,callEnd:n,message:r,roomID:i,callMediaType:a,callRole:o,totalTime:s})}},{key:"onInvited",value:function(t){this._logger.info("TUICallEvent.onInvited",{text:{data:t},type:"event"}),this._emitter.emit(og.INVITED,t),this._emitter.emit(og.ON_CALL_RECEIVED,t)}},{key:"onLineBusy",value:function(t){this._logger.info("TUICallEvent.onLineBusy",{text:{data:t},type:"event"});var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(og.LINE_BUSY,{inviteID:e,invitee:n,userID:r,reason:"line busy"})}},{key:"onReject",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(og.REJECT,{inviteID:e,invitee:n,userID:r,reason:"reject"})}},{key:"onNoResp",value:function(t){this._logger.info("TUICallEvent.onNoResp",{text:{data:t},type:"event"});var e=t.groupID,n=void 0===e?"":e,r=t.inviteID,i=t.sponsor,a=t.timeoutUserList,o=t.userIDList;this._emitter.emit(og.NO_RESP,{groupID:n,inviteID:r,sponsor:i,timeoutUserList:a,userIDList:o})}},{key:"onCancel",value:function(t){this._emitter.emit(og.CALLING_CANCEL,t),this._emitter.emit(og.ON_CALL_CANCELED,t)}},{key:"onTimeout",value:function(t){this._logger.info("TUICallEvent.onTimeout",{text:{data:t},type:"event"});var e=t.inviteID,n=t.groupID,r=t.sponsor,i=t.timeoutUserList;this._emitter.emit(og.CALLING_TIMEOUT,{groupID:n,inviteID:e,sponsor:r,timeoutUserList:i})}},{key:"onUserAccept",value:function(t){this._logger.info("TUICallEvent.onUserAccept",{text:{data:t},type:"event"});var e=t.userID,n=t.userList;this._emitter.emit(og.USER_ACCEPT,{userID:e,userList:n})}},{key:"onUserEnter",value:function(t){this._logger.info("TUICallEvent.onUserEnter",{text:{data:t},type:"event"});var e=t.userID,n=t.playerList;this._emitter.emit(og.USER_ENTER,{userID:e,playerList:n})}},{key:"onUserLeave",value:function(t){this._logger.info("TUICallEvent.onUserLeave",{text:{data:t},type:"event"});var e=t.userID,n=t.playerList;this._emitter.emit(og.USER_LEAVE,{userID:e,playerList:n})}},{key:"onUserUpdate",value:function(t){var e=t.pusher,n=t.playerList;this._emitter.emit(og.USER_UPDATE,{pusher:e,playerList:n})}},{key:"onSdkReady",value:function(t){this._logger.info("TUICallEvent.onSdkReady",{text:{data:t},type:"event"}),this._emitter.emit(og.SDK_READY,t)}},{key:"onKickedOut",value:function(t){this._logger.info("TUICallEvent.onKickedOut",{text:{data:t},type:"event"}),this._emitter.emit(og.KICKED_OUT,t)}},{key:"onCallMode",value:function(t){this._logger.info("TUICallEvent.onCallMode",{text:{data:t},type:"event"}),this._emitter.emit(og.CALL_MODE,t)}},{key:"onMessageSentByMe",value:function(t){this._logger.info("TUICallEvent.onMessageSentByMe",{text:{data:t},type:"event"}),this._emitter.emit(og.MESSAGE_SENT_BY_ME,t)}},{key:"destroyed",value:function(){this._logger.info("TUICallEvent.destroyed",{type:"api"}),this._emitter=null}}]),t}(),Ly="1.6.0";_v("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),jv);var Oy=ln,ky=function(){var t=Oy(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},Ay=V,Ny=ve,Uy=bt,Py=ky,My=RegExp.prototype,jy=Ln.PROPER,Vy=wr,Gy=ln,Hy=bh,By=N,Fy=function(t){var e=t.flags;return void 0!==e||"flags"in My||Ny(t,"flags")||!Uy(My,t)?e:Ay(Py,t)},Ky="toString",zy=RegExp.prototype[Ky],Jy=By((function(){return"/a/b"!==zy.call({source:"a",flags:"b"})})),Wy=jy&&zy.name!==Ky;(Jy||Wy)&&Vy(RegExp.prototype,Ky,(function(){var t=Gy(this);return"/"+Hy(t.source)+"/"+Hy(Fy(t))}),{unsafe:!0});var $y,qy,Yy=Vp;xi({target:"Object",stat:!0,forced:Object.isExtensible!==Yy},{isExtensible:Yy}),$y="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Xy=function(){},Qy=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Zy=Qy.length-1;Zy;)qy=Qy[Zy],console[qy]||($y[qy]=Xy),Zy-=1;Object.isExtensible($y)&&($y.methods=Qy);var tI,eI,nI=$y,rI=N,iI=k.RegExp,aI=rI((function(){var t=iI("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),oI=aI||rI((function(){return!iI("a","y").sticky})),sI={BROKEN_CARET:aI||rI((function(){var t=iI("^r","gy");return t.lastIndex=2,null!==t.exec("str")})),MISSED_STICKY:oI,UNSUPPORTED_Y:aI},cI=N,lI=k.RegExp,uI=cI((function(){var t=lI(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})),hI=N,fI=k.RegExp,dI=hI((function(){var t=fI("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),pI=V,vI=X,gI=bh,yI=ky,II=sI,mI=ne.exports,EI=af,_I=ar.get,TI=uI,CI=dI,bI=mI("native-string-replace",String.prototype.replace),DI=RegExp.prototype.exec,RI=DI,wI=vI("".charAt),SI=vI("".indexOf),xI=vI("".replace),LI=vI("".slice),OI=(eI=/b*/g,pI(DI,tI=/a/,"a"),pI(DI,eI,"a"),0!==tI.lastIndex||0!==eI.lastIndex),kI=II.BROKEN_CARET,AI=void 0!==/()??/.exec("")[1];(OI||AI||kI||TI||CI)&&(RI=function(t){var e,n,r,i,a,o,s,c=this,l=_I(c),u=gI(t),h=l.raw;if(h)return h.lastIndex=c.lastIndex,e=pI(RI,h,u),c.lastIndex=h.lastIndex,e;var f=l.groups,d=kI&&c.sticky,p=pI(yI,c),v=c.source,g=0,y=u;if(d&&(p=xI(p,"y",""),-1===SI(p,"g")&&(p+="g"),y=LI(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==wI(u,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),AI&&(n=new RegExp("^"+v+"$(?!\\s)",p)),OI&&(r=c.lastIndex),i=pI(DI,d?n:c,y),d?i?(i.input=LI(i.input,g),i[0]=LI(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:OI&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),AI&&i&&i.length>1&&pI(bI,i[0],n,(function(){for(a=1;a2)if(l=Rm(l),43===(e=km(l,0))||45===e){if(88===(n=km(l,2))||120===n)return NaN}else if(48===e){switch(km(l,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+l}for(o=(a=Om(l,2)).length,s=0;si)return NaN;return parseInt(a,r)}return+l},Nm=vm(wm,!Sm(" 0o1")||!Sm("0b1")||Sm("+0x1")),Um=function(t){var e,n=arguments.length<1?0:Sm(function(t){var e=Em(t,"number");return"bigint"==typeof e?e:Am(e)}(t));return Im(xm,e=this)&&_m((function(){Dm(e)}))?ym(Object(n),this,Um):n};Um.prototype=xm,Nm&&(xm.constructor=Um),um({global:!0,constructor:!0,wrap:!0,forced:Nm},{Number:Um});Nm&&function(t,e){for(var n,r=hm?Tm(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)gm(e,n=r[i])&&!gm(t,n)&&bm(t,n,Cm(e,n))}(dm[wm],Sm);var Pm=kr,Mm=bh,jm=ut,Vm=RangeError,Gm=function(t){var e=Mm(jm(this)),n="",r=Pm(t);if(r<0||r===1/0)throw new Vm("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},Hm=X,Bm=Vr,Fm=bh,Km=ut,zm=Hm(Gm),Jm=Hm("".slice),Wm=Math.ceil,$m=function(t){return function(e,n,r){var i,a,o=Fm(Km(e)),s=Bm(n),c=o.length,l=void 0===r?" ":Fm(r);return s<=c||""===l?o:((a=zm(l,Wm((i=s-c)/l.length))).length>i&&(a=Jm(a,0,i)),t?o+a:a+o)}},qm=X,Ym=N,Xm={start:$m(!1),end:$m(!0)}.start,Qm=RangeError,Zm=isFinite,tE=Math.abs,eE=Date.prototype,nE=eE.toISOString,rE=qm(eE.getTime),iE=qm(eE.getUTCDate),aE=qm(eE.getUTCFullYear),oE=qm(eE.getUTCHours),sE=qm(eE.getUTCMilliseconds),cE=qm(eE.getUTCMinutes),lE=qm(eE.getUTCMonth),uE=qm(eE.getUTCSeconds),hE=Ym((function(){return"0385-07-25T07:06:39.999Z"!==nE.call(new Date(-50000000000001))}))||!Ym((function(){nE.call(new Date(NaN))}))?function(){if(!Zm(rE(this)))throw new Qm("Invalid time value");var t=this,e=aE(t),n=sE(t),r=e<0?"-":e>9999?"+":"";return r+Xm(tE(e),r?6:4,0)+"-"+Xm(lE(t)+1,2,0)+"-"+Xm(iE(t),2,0)+"T"+Xm(oE(t),2,0)+":"+Xm(cE(t),2,0)+":"+Xm(uE(t),2,0)+"."+Xm(n,3,0)+"Z"}:nE;xi({target:"Date",proto:!0,forced:Date.prototype.toISOString!==hE},{toISOString:hE});var fE=X,dE=fe,pE=Math.floor,vE=fE("".charAt),gE=fE("".replace),yE=fE("".slice),IE=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,mE=/\$([$&'`]|\d{1,2})/g,EE=Es,_E=V,TE=X,CE=FI,bE=N,DE=ln,RE=yt,wE=st,SE=kr,xE=Vr,LE=bh,OE=ut,kE=zI,AE=Xt,NE=function(t,e,n,r,i,a){var o=n+t.length,s=r.length,c=mE;return void 0!==i&&(i=dE(i),c=IE),gE(a,c,(function(a,c){var l;switch(vE(c,0)){case"$":return"$";case"&":return t;case"`":return yE(e,0,n);case"'":return yE(e,o);case"<":l=i[yE(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>s){var h=pE(u/10);return 0===h?a:h<=s?void 0===r[h-1]?vE(c,1):r[h-1]+vE(c,1):a}l=r[u-1]}return void 0===l?"":l}))},UE=QI,PE=Le("replace"),ME=Math.max,jE=Math.min,VE=TE([].concat),GE=TE([].push),HE=TE("".indexOf),BE=TE("".slice),FE="$0"==="a".replace(/./,"$0"),KE=!!/./[PE]&&""===/./[PE]("a","$0");CE("replace",(function(t,e,n){var r=KE?"$":"$0";return[function(t,n){var r=OE(this),i=wE(t)?void 0:AE(t,PE);return i?_E(i,t,r,n):_E(e,LE(r),t,n)},function(t,i){var a=DE(this),o=LE(t);if("string"==typeof i&&-1===HE(i,r)&&-1===HE(i,"$<")){var s=n(e,a,o,i);if(s.done)return s.value}var c=RE(i);c||(i=LE(i));var l,u=a.global;u&&(l=a.unicode,a.lastIndex=0);for(var h,f=[];null!==(h=UE(a,o))&&(GE(f,h),u);){""===LE(h[0])&&(a.lastIndex=kE(o,xE(a.lastIndex),l))}for(var d,p="",v=0,g=0;g=v&&(p+=BE(o,v,m)+y,v=m+I.length)}return p+BE(o,v)}]}),!!bE((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!FE||KE);var zE,JE=Et,WE=et,$E=Le("match"),qE=function(t){var e;return JE(t)&&(void 0!==(e=t[$E])?!!e:"RegExp"===WE(t))},YE=TypeError,XE=function(t){if(qE(t))throw new YE("The method doesn't accept regular expressions");return t},QE=Le("match"),ZE=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[QE]=!1,"/./"[t](e)}catch(t){}}return!1},t_=xi,e_=Ja,n_=A.f,r_=Vr,i_=bh,a_=XE,o_=ut,s_=ZE,c_=e_("".startsWith),l_=e_("".slice),u_=Math.min,h_=s_("startsWith");function f_(t,e){t=t.split("."),e=e.split(".");for(var n=Math.max(t.length,e.length);t.lengtha)return 1;if(i1?arguments[1]:void 0,e.length)),r=i_(t);return c_?c_(e,r,n):l_(e,n,n+r.length)===r}});var d_="TRTC-ROOM",p_=wx||qq;p_||console.error(d_,"不支持当前小程序环境");var v_,g_=p_.getSystemInfoSync(),y_=g_.safeArea;("iOS 13.3"===g_.system||"iPhoneX"===g_.model&&"iOS 13.3.1"===g_.system)&&console.log("use media audio volume type"),console.log(d_,"SystemInfo",g_),"undefined"!=typeof qq?v_=!0:"undefined"!=typeof wx&&(v_=f_(g_.version,"7.0.8")>=0||f_(g_.version,"2.4.0")>=0&&f_(g_.version,"6.0.0")<0&&f_(g_.SDKVersion,"2.10.0")>=0);var I_=v_,m_="undefined"!=typeof uni,E_=/iOS/i.test(g_.system),__=/Android/i.test(g_.system);/mac/i.test(g_.system);var T_=g_.version,C_=g_.SDKBuild?"".concat(g_.SDKVersion,"-").concat(g_.SDKBuild):g_.SDKVersion;g_.screenHeight,y_.bottom,console.log(d_,"APP_VERSION:",T_," LIB_VERSION:",C_," is new version:",I_);var b_=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"array"===function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()}(t)},D_=function(t){return null!==t&&("number"==typeof t&&!isNaN(t-0)||"object"===s(t)&&t.constructor===Number)},R_=function(t){return"string"==typeof t},w_=function(t){return null!==t&&"object"===s(t)},S_=function(t){return void 0===t},x_=0;Date.now||(Date.now=function(){return(new Date).getTime()});var L_=function(){0===x_&&(x_=Date.now()-1);var t=Date.now()-x_;return t>4294967295?(x_+=4294967295,Date.now()-x_):t},O_=function(t){return t instanceof Error},k_=function(t){return JSON.stringify(t,["message","code"])};function A_(){var t="unknown";return E_&&(t="ios"),__&&(t="android"),t}function N_(t){return U_.apply(this,arguments)}function U_(){return(U_=l(a().mark((function t(e){var n,r,i,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:return n=e.microphone,r=void 0!==n&&n,i=e.camera,o=void 0!==i&&i,t.prev=3,t.next=6,wx.getSetting();case 6:if(s=t.sent,c=s.authSetting[Lg.RECORD],l=s.authSetting[Lg.CAMERA],!r||!o){t.next=11;break}return t.abrupt("return",c&&l);case 11:if(!r){t.next=13;break}return t.abrupt("return",c);case 13:if(!o){t.next=15;break}return t.abrupt("return",l);case 15:return t.abrupt("return",!1);case 18:return t.prev=18,t.t0=t.catch(3),t.abrupt("return",!1);case 21:case"end":return t.stop()}}),t,null,[[3,18]])})))).apply(this,arguments)}function P_(t){return t===wg.AV_CALL}function M_(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function j_(t){var e=String(t);return e.startsWith("14")||e.startsWith("16")||e.startsWith("17")}function V_(t){var e=j_(t)?Og:kg;return"".concat(e,"&position=").concat(t,"®ionId=").concat(function(t){return t>=2e7&&t<3e7||t>=172e7&&t<173e7?Ng:t>=3e7&&t<4e7||t>=173e7&&t<174e7?Pg:t>=4e7&&t<5e7||t>=174e7&&t<175e7?Ug:t>=5e7&&t<6e7||t>=175e7&&t<176e7?Mg:t>=7e7&&t<8e7||t>=177e7&&t<178e7?jg:Ag}(t))}var G_=0,H_=new Map;function B_(){var t=new Date;return"TUICallEngine ".concat(t.toLocaleTimeString("en-US",{hour12:!1}),".").concat(function(t){var e;switch(t.toString().length){case 1:e="00".concat(t);break;case 2:e="0".concat(t);break;default:e=t}return e}(t.getMilliseconds()),":")}var F_={_data:[],_length:0,_visible:!1,arguments2String:function(t){var e,n;if(1===t.length)e=B_()+t[0];else{e=B_();for(var r=0,i=t.length;r-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",i)),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}},{key:"setEnd",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.endts=Date.now(),e?this._eventStatController.pushIn(this):setTimeout((function(){t._eventStatController.pushIn(t)}),0)}},{key:"setError",value:function(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(Iy.NO_NETWORK),this.setMessage(my)),this}},{key:"setCode",value:function(t){return"ECONNABORTED"===t&&(this.codeint=103),D_(t)?this.codeint=t:F_.warn("SSOLogData.setCode value not a number, please check!",t,s(t)),this}},{key:"setMessage",value:function(t){return R_(t)?(this.message=t,this):this}},{key:"setText",value:function(t){return D_(t)?this.text=t.toString():R_(t)&&(this.text=t),this}},{key:"setTalkTime",value:function(t){return this.talktime=t,this}},{key:"setMessageType",value:function(t){return this.msgType=t,this}},{key:"setCallType",value:function(t){return this.calltype=t,this}},{key:"setNetworkType",value:function(t){return S_(t)?F_.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=t,this}}],[{key:"bindController",value:function(e){t.prototype._eventStatController=e}}]),t}(),z_="sdkConstruct",J_="quality_report",W_=function(){function t(){u(this,t),this._table="timweb-trtccalling",this._report=[]}return f(t,[{key:"pushIn",value:function(t){F_.debug("SSOLogBody.pushIn",this._report.length,t),this._report.push(t)}},{key:"backfill",value:function(t){var e;b_(t)&&0!==t.length&&(F_.debug("SSOLogBody.backfill",this._report.length,t.length),(e=this._report).unshift.apply(e,C(t)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getTable",value:function(){return this._table}},{key:"getLogsInMemory",value:function(){var t=this._report.slice();return this._reset(),t}}]),t}(),$_={CURRENT:{COMMON:"https://webim.tim.qq.com"},PRODUCTION:{COMMON:"https://webim.tim.qq.com"}},q_={IM_OPEN_STAT:"imopenstat"},Y_={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},X_={imopenstat:"v4"},Q_=function(){function t(){u(this,t),this.TAG="trtccalling-ssolog-event",this._reportBody=new W_,this._version=Ly,this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}return f(t,[{key:"reportAtOnce",value:function(){F_.debug("EventStatController.reportAtOnce"),this._report()}},{key:"pushIn",value:function(t){t instanceof K_&&(t.setCommonInfo({SDKAppID:Number(wx.getStorageSync("sdkAppId")),version:this._version,userID:wx.getStorageSync("userId")}),this._reportBody.pushIn(t),this._report())}},{key:"_resetLastReportTime",value:function(){this._lastReportTime=Date.now()}},{key:"_startReportTimer",value:function(){var t=this;this._timerID=setInterval((function(){Date.now()0&&(clearInterval(this._timerID),this._timerID=0)}},{key:"_report",value:function(){var t=this;if(!this._reportBody.isEmpty()){var e=Math.ceil(+new Date/1e3),n=wx.getStorageSync("sdkAppId"),r=this._reportBody.getLogsInMemory(),i={table:this._reportBody.getTable(),report:r},a=$_.CURRENT.COMMON,o=X_.imopenstat,s=q_.IM_OPEN_STAT,c=Y_.TIM_WEB_TRTCCALLING_REPORT,l="".concat(a,"/").concat(o,"/").concat(s,"/").concat(c,"/?sdkappid=").concat(n,"&reqtime=").concat(e);wx.request({url:l,method:"POST",data:JSON.stringify(i),header:{"content-type":"application/json"},success:function(e){t._retryCount>0&&(F_.debug("EventStatController.report retry success"),t._retryCount=0)},fail:function(e){F_.warn("EventStatController.report, error:".concat(k_(e))),t._reportBody.backfill(r),t._reportBody.getLogsNumInMemory()>t.MAX_THRESHOLD||t._retryCount===t.MAX_RETRY_COUNT||0===t._timerID?t._retryCount=0:t._retryCount+=1}})}}},{key:"reset",value:function(){F_.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}]),t}(),Z_=Jr.includes,tT=ud;xi({target:"Array",proto:!0,forced:N((function(){return!Array(1).includes()}))},{includes:function(t){return Z_(this,t,arguments.length>1?arguments[1]:void 0)}}),tT("includes");var eT=xi,nT=XE,rT=ut,iT=bh,aT=ZE,oT=X("".indexOf);eT({target:"String",proto:!0,forced:!aT("includes")},{includes:function(t){return!!~oT(iT(rT(this)),iT(nT(t)),arguments.length>1?arguments[1]:void 0)}});var sT=X,cT=Cv,lT=_p.exports.getWeakData,uT=cs,hT=ln,fT=st,dT=Et,pT=Du,vT=ve,gT=ar.set,yT=ar.getterFor,IT=ho.find,mT=ho.findIndex,ET=sT([].splice),_T=0,TT=function(t){return t.frozen||(t.frozen=new CT)},CT=function(){this.entries=[]},bT=function(t,e){return IT(t.entries,(function(t){return t[0]===e}))};CT.prototype={get:function(t){var e=bT(this,t);if(e)return e[1]},has:function(t){return!!bT(this,t)},set:function(t,e){var n=bT(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=mT(this.entries,(function(e){return e[0]===t}));return~e&&ET(this.entries,e,1),!!~e}};var DT,RT={getConstructor:function(t,e,n,r){var i=t((function(t,i){uT(t,a),gT(t,{type:e,id:_T++,frozen:void 0}),fT(i)||pT(i,t[r],{that:t,AS_ENTRIES:n})})),a=i.prototype,o=yT(e),s=function(t,e,n){var r=o(t),i=lT(hT(e),!0);return!0===i?TT(r).set(e,n):i[r.id]=n,t};return cT(a,{delete:function(t){var e=o(this);if(!dT(t))return!1;var n=lT(t);return!0===n?TT(e).delete(t):n&&vT(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!dT(t))return!1;var n=lT(t);return!0===n?TT(e).has(t):n&&vT(n,e.id)}}),cT(a,n?{get:function(t){var e=o(this);if(dT(t)){var n=lT(t);return!0===n?TT(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return s(this,t,e)}}:{add:function(t){return s(this,t,!0)}}),i}},wT=Gp,ST=k,xT=X,LT=Cv,OT=_p.exports,kT=_v,AT=RT,NT=Et,UT=ar.enforce,PT=N,MT=Gn,jT=Object,VT=Array.isArray,GT=jT.isExtensible,HT=jT.isFrozen,BT=jT.isSealed,FT=jT.freeze,KT=jT.seal,zT={},JT={},WT=!ST.ActiveXObject&&"ActiveXObject"in ST,$T=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},qT=kT("WeakMap",$T,AT),YT=qT.prototype,XT=xT(YT.set);if(MT)if(WT){DT=AT.getConstructor($T,"WeakMap",!0),OT.enable();var QT=xT(YT.delete),ZT=xT(YT.has),tC=xT(YT.get);LT(YT,{delete:function(t){if(NT(t)&&!GT(t)){var e=UT(this);return e.frozen||(e.frozen=new DT),QT(this,t)||e.frozen.delete(t)}return QT(this,t)},has:function(t){if(NT(t)&&!GT(t)){var e=UT(this);return e.frozen||(e.frozen=new DT),ZT(this,t)||e.frozen.has(t)}return ZT(this,t)},get:function(t){if(NT(t)&&!GT(t)){var e=UT(this);return e.frozen||(e.frozen=new DT),ZT(this,t)?tC(this,t):e.frozen.get(t)}return tC(this,t)},set:function(t,e){if(NT(t)&&!GT(t)){var n=UT(this);n.frozen||(n.frozen=new DT),ZT(this,t)?XT(this,t,e):n.frozen.set(t,e)}else XT(this,t,e);return this}})}else wT&&PT((function(){var t=FT([]);return XT(new qT,t,1),!HT(t)}))&<(YT,{set:function(t,e){var n;return VT(t)&&(HT(t)?n=zT:BT(t)&&(n=JT)),XT(this,t,e),n===zT&&FT(t),n===JT&&KT(t),this}});var eC={exports:{}}; +/*! + * validate.js 0.13.1 + * + * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp + * Validate.js may be freely distributed under the MIT license. + * For all details and documentation: + * http://validatejs.org/ + */(function(t,e,n){var r=function(t,e,n){n=i.extend({},i.options,n);var a=i.runValidations(t,e,n);if(a.some((function(t){return i.isPromise(t.error)})))throw new Error("Use validate.async if you want support for promises");return r.processValidationResults(a,n)},i=r;i.extend=function(t){return[].slice.call(arguments,1).forEach((function(e){for(var n in e)t[n]=e[n]})),t},i.extend(r,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var t=i.format("%{major}.%{minor}.%{patch}",i.version);return i.isEmpty(i.version.metadata)||(t+="+"+i.version.metadata),t}},Promise:"undefined"!=typeof Promise?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(t,e,n){var r,a,o,s,c,l,u,h=[];for(r in(i.isDomElement(t)||i.isJqueryElement(t))&&(t=i.collectFormValues(t)),e)for(a in o=i.getDeepObjectValue(t,r),s=i.result(e[r],o,t,r,n,e)){if(!(c=i.validators[a]))throw u=i.format("Unknown validator %{name}",{name:a}),new Error(u);l=s[a],(l=i.result(l,o,t,r,n,e))&&h.push({attribute:r,value:o,validator:a,globalOptions:n,attributes:t,options:l,error:c.call(c,o,l,r,t,n)})}return h},processValidationResults:function(t,e){t=i.pruneEmptyErrors(t,e),t=i.expandMultipleErrors(t,e),t=i.convertErrorMessages(t,e);var n=e.format||"grouped";if("function"!=typeof i.formatters[n])throw new Error(i.format("Unknown format %{format}",e));return t=i.formatters[n](t),i.isEmpty(t)?void 0:t},async:function(t,e,n){var r=(n=i.extend({},i.async.options,n)).wrapErrors||function(t){return t};!1!==n.cleanAttributes&&(t=i.cleanAttributes(t,e));var a=i.runValidations(t,e,n);return new i.Promise((function(o,s){i.waitForResults(a).then((function(){var c=i.processValidationResults(a,n);c?s(new r(c,n,t,e)):o(t)}),(function(t){s(t)}))}))},single:function(t,e,n){return n=i.extend({},i.single.options,n,{format:"flat",fullMessages:!1}),i({single:t},{single:e},n)},waitForResults:function(t){return t.reduce((function(t,e){return i.isPromise(e.error)?t.then((function(){return e.error.then((function(t){e.error=t||null}))})):t}),new i.Promise((function(t){t()})))},result:function(t){var e=[].slice.call(arguments,1);return"function"==typeof t&&(t=t.apply(null,e)),t},isNumber:function(t){return"number"==typeof t&&!isNaN(t)},isFunction:function(t){return"function"==typeof t},isInteger:function(t){return i.isNumber(t)&&t%1==0},isBoolean:function(t){return"boolean"==typeof t},isObject:function(t){return t===Object(t)},isDate:function(t){return t instanceof Date},isDefined:function(t){return null!=t},isPromise:function(t){return!!t&&i.isFunction(t.then)},isJqueryElement:function(t){return t&&i.isString(t.jquery)},isDomElement:function(t){return!!t&&!(!t.querySelectorAll||!t.querySelector)&&(!(!i.isObject(document)||t!==document)||("object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName))},isEmpty:function(t){var e;if(!i.isDefined(t))return!0;if(i.isFunction(t))return!1;if(i.isString(t))return i.EMPTY_STRING_REGEXP.test(t);if(i.isArray(t))return 0===t.length;if(i.isDate(t))return!1;if(i.isObject(t)){for(e in t)return!1;return!0}return!1},format:i.extend((function(t,e){return i.isString(t)?t.replace(i.format.FORMAT_REGEXP,(function(t,n,r){return"%"===n?"%{"+r+"}":String(e[r])})):t}),{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(t){return i.isNumber(t)?100*t%1==0?""+t:parseFloat(Math.round(100*t)/100).toFixed(2):i.isArray(t)?t.map((function(t){return i.prettify(t)})).join(", "):i.isObject(t)?i.isDefined(t.toString)?t.toString():JSON.stringify(t):(t=""+t).replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,(function(t,e,n){return e+" "+n.toLowerCase()})).toLowerCase()},stringifyValue:function(t,e){return(e&&e.prettify||i.prettify)(t)},isString:function(t){return"string"==typeof t},isArray:function(t){return"[object Array]"==={}.toString.call(t)},isHash:function(t){return i.isObject(t)&&!i.isArray(t)&&!i.isFunction(t)},contains:function(t,e){return!!i.isDefined(t)&&(i.isArray(t)?-1!==t.indexOf(e):e in t)},unique:function(t){return i.isArray(t)?t.filter((function(t,e,n){return n.indexOf(t)==e})):t},forEachKeyInKeypath:function(t,e,n){if(i.isString(e)){var r,a="",o=!1;for(r=0;ro&&(r=e.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",c.push(i.format(r,{count:o}))),c.length>0?e.message||c:void 0):e.message||this.notValid||"has an incorrect length"}},numericality:function(t,e,n,r,a){if(i.isDefined(t)){var o,s,c=[],l={greaterThan:function(t,e){return t>e},greaterThanOrEqualTo:function(t,e){return t>=e},equalTo:function(t,e){return t===e},lessThan:function(t,e){return to&&(n=e.tooLate||e.message||this.tooLate||"must be no later than %{date}",n=i.format(n,{date:this.format(o,e),value:this.format(t,e)}),r.push(n)),r.length?i.unique(r):void 0)}}),{parse:null,format:null}),date:function(t,e){return e=i.extend({},e,{dateOnly:!0}),i.validators.datetime.call(i.validators.datetime,t,e)},format:function(t,e){(i.isString(e)||e instanceof RegExp)&&(e={pattern:e});var n,r=(e=i.extend({},this.options,e)).message||this.message||"is invalid",a=e.pattern;if(i.isDefined(t))return i.isString(t)?(i.isString(a)&&(a=new RegExp(e.pattern,e.flags)),(n=a.exec(t))&&n[0].length==t.length?void 0:r):r},inclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),!i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is not included in the list";return i.format(n,{value:t})}},exclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is restricted";return i.isString(e.within[t])&&(t=e.within[t]),i.format(n,{value:t})}},email:i.extend((function(t,e){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid email";if(i.isDefined(t))return i.isString(t)&&this.PATTERN.exec(t)?void 0:n}),{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(t,e,n,r,a){if(i.isDefined(t)){i.isString(e)&&(e={attribute:e});var o=(e=i.extend({},this.options,e)).message||this.message||"is not equal to %{attribute}";if(i.isEmpty(e.attribute)||!i.isString(e.attribute))throw new Error("The attribute must be a non empty string");var s=i.getDeepObjectValue(r,e.attribute),c=e.comparator||function(t,e){return t===e},l=e.prettify||a&&a.prettify||i.prettify;return c(t,s,e,n,r)?void 0:i.format(o,{attribute:l(e.attribute)})}},url:function(t,e){if(i.isDefined(t)){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid url",r=e.schemes||this.schemes||["http","https"],a=e.allowLocal||this.allowLocal||!1,o=e.allowDataUrl||this.allowDataUrl||!1;if(!i.isString(t))return n;var s="^(?:(?:"+r.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",c="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";return a?c+="?":s+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",s+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+c+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",o&&(s="(?:"+s+")|(?:^data:(?:\\w+\\/[-+.\\w]+(?:;[\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*$)"),new RegExp(s,"i").exec(t)?void 0:n}},type:i.extend((function(t,e,n,r,a){if(i.isString(e)&&(e={type:e}),i.isDefined(t)){var o,s=i.extend({},this.options,e),c=s.type;if(!i.isDefined(c))throw new Error("No type was specified");if(o=i.isFunction(c)?c:this.types[c],!i.isFunction(o))throw new Error("validate.validators.type.types."+c+" must be a function.");if(!o(t,s,n,r,a)){var l=e.message||this.messages[c]||this.message||s.message||(i.isFunction(c)?"must be of the correct type":"must be of type %{type}");return i.isFunction(l)&&(l=l(t,e,n,r,a)),i.format(l,{attribute:i.prettify(n),type:c})}}}),{types:{object:function(t){return i.isObject(t)&&!i.isArray(t)},array:i.isArray,integer:i.isInteger,number:i.isNumber,string:i.isString,date:i.isDate,boolean:i.isBoolean},messages:{}})},r.formatters={detailed:function(t){return t},flat:i.flattenErrorsToArray,grouped:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=i.flattenErrorsToArray(t[e]);return t},constraint:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=t[e].map((function(t){return t.validator})).sort();return t}},r.exposeModule(r,this,t,e,n)}).call(x,eC.exports,eC,null);var nC=eC.exports,rC="number",iC="string",aC="object",oC="function",sC="array",cC={createInstance:{sdkAppID:{presence:!0,type:rC},tim:{type:aC}},destroyInstance:{},init:{userID:{presence:!0,type:iC},userSig:{presence:!0,type:iC}},on:{eventCode:{presence:!0,type:iC},handler:{presence:!0,type:oC},context:{presence:!0,type:aC}},off:{eventCode:{presence:!0,type:iC},handler:{presence:!0,type:oC}},call:{userID:{presence:!0,type:iC},type:{presence:!0,type:rC},roomID:{presence:!1,type:rC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:Rg}}},groupCall:{groupID:{presence:!0,type:iC},type:{presence:!0,type:rC},userIDList:{presence:!0,type:sC},roomID:{presence:!1,type:rC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:Rg}}},joinInGroupCall:{groupID:{presence:!0,type:iC},type:{presence:!0,type:rC},roomID:{presence:!0,type:rC}},inviteUser:{userIDList:{presence:!0,type:sC}},accept:{},reject:{},hangup:{},switchCallMediaType:{type:{presence:!0,type:rC}},openCamera:{},closeCamera:{},switchCamera:{},openMicrophone:{},closeMicrophone:{},selectAudioPlaybackDevice:{type:{presence:!0,type:iC}},setSelfInfo:{nickName:{presence:!0,type:iC},avatar:{presence:!0,type:iC}}},lC={createInstance:"",destroyInstance:"",init:"",on:"",off:"",call:[sg.IDLE],groupCall:[sg.IDLE],accept:[sg.CALLING],reject:[sg.CALLING],hangup:[sg.CALLING,sg.CONNECTED],switchCallMediaType:[sg.CALLING,sg.CONNECTED],joinInGroupCall:[sg.IDLE],inviteUser:[sg.CALLING,sg.CONNECTED],openCamera:[sg.CALLING,sg.CONNECTED],closeCamera:[sg.CALLING,sg.CONNECTED],switchCamera:[sg.CALLING,sg.CONNECTED],openMicrophone:[sg.CALLING,sg.CONNECTED],closeMicrophone:[sg.CALLING,sg.CONNECTED],selectAudioPlaybackDevice:[sg.CALLING,sg.CONNECTED],setSelfInfo:""},uC={createInstance:!1,destroyInstance:!0,init:!1,off:!0,call:!0,groupCall:!0,joinInGroupCall:!0,inviteUser:!0,accept:!0,reject:!0,hangup:!0,switchCallMediaType:!0,openCamera:!0,closeCamera:!0,switchCamera:!0,openMicrophone:!0,closeMicrophone:!0,selectAudioPlaybackDevice:!0,setSelfInfo:!0},hC=function(t){p(n,m(Error));var e=T(n);function n(t,r,i){var a;return u(this,n),d(_(a=e.call(this,r)),"code",void 0),d(_(a),"message",void 0),d(_(a),"data",void 0),a.code=t,a.message=r,a.data=i,a}return f(n,null,[{key:"error",value:function(t,e,r){return r?new n(t,e,r):new n(t,e)}}]),n}();function fC(t){var e=j_(t)?"".concat(Dy.ERROR_PACKAGE_NOT_PURCHASED):"".concat(Ey);return e=e.replace("${purchaseAddress}",V_(t))}nC.validators.type.types.function=function(t){return t instanceof Function};var dC=function(){function t(){u(this,t),d(this,"paramsMatchedRule",cC),d(this,"statusMatchedRule",lC),d(this,"requireInit",uC)}return f(t,[{key:"getParamsMatchedRule",value:function(t){return this.paramsMatchedRule[t]}},{key:"getStatusMatchedRule",value:function(t){return this.statusMatchedRule[t]}},{key:"getInitReadyRule",value:function(t){return this.requireInit[t]}}]),t}(),pC=function(){function t(){u(this,t),this._logger=ly()}return f(t,[{key:"notify",value:function(t,e,n,r){throw this._logger.error("check:".concat(t.api),{text:{data:t,error:{code:e,message:n}}}),hC.error(e,"[TUICallEngine:".concat(t.api,",").concat(e,"]").concat(n).concat(r))}}]),t}(),vC=f((function t(e){u(this,t),d(this,"api",""),d(this,"attributes",{}),d(this,"callStatus",""),d(this,"capabilityCode",void 0),d(this,"initReady",void 0),this.api=e.api,this.attributes=e.attributes,this.callStatus=e.callStatus,this.capabilityCode=e.capabilityCode,this.initReady=e.initReady,this.sdkAppID=e.sdkAppID})),gC=new WeakMap,yC=function(){function t(){u(this,t),S(this,gC,{writable:!0,value:void 0}),R(this,gC,[])}var e;return f(t,[{key:"addAlertHandler",value:function(t){D(this,gC).push(t)}},{key:"check",value:(e=l(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r1&&void 0!==o[1]?o[1]:{},!e.capabilityCode){t.next=21;break}return t.prev=2,t.next=5,n.tim.callExperimentalAPI("isCommercialAbilityEnabled",e.capabilityCode);case 5:!1===t.sent.data.enabled&&this.notification.notify(e,Iy.ERROR_PACKAGE_NOT_SUPPORTED,_y,Dy.ERROR_PACKAGE_NOT_SUPPORTED),t.next=21;break;case 9:if(t.prev=9,t.t0=t.catch(2),wx.$TUICallEngine._callDataReport.setCodeAndMessage(Iy.ERROR_PACKAGE_NOT_SUPPORTED,JSON.stringify(t.t0)),wx.$TUICallEngine._callDataReport.uploadToKibana(),2905!==t.t0.code){t.next=17;break}this.notification.notify(e,Iy.ERROR_TIM_VERSION_OUTDATED,Ty,Dy.ERROR_TIM_VERSION_OUTDATED),t.next=21;break;case 17:throw r=null,i=0,e.capabilityCode===Dg.PRO?(r="".concat((a=e.sdkAppID,s=void 0,s=j_(a)?"".concat(Dy.ERROR_PACKAGE_NOT_SUPPORTED):"".concat(_y),s=s.replace("${purchaseAddress}",V_(a)))," "),i=Iy.ERROR_PACKAGE_NOT_SUPPORTED):(r="".concat(fC(e.sdkAppID)," "),i=Iy.ERROR_PACKAGE_NOT_PURCHASED),new hC(i,r);case 21:case"end":return t.stop()}var a,s}),t,this,[[2,9]])}))),function(t){return e.apply(this,arguments)})}]),r}(),TC=function(t){p(n,IC);var e=T(n);function n(t,r){return u(this,n),e.call(this,t,r)}return f(n,[{key:"check",value:function(t,e){void 0!==t.initReady&&this.rule.getInitReadyRule(t.api)!==t.initReady&&this.notification.notify(t,Iy.ERROR_INIT_FAIL,Cy,Dy.ERROR_INIT_FAIL)}}]),n}(),CC=function(){function t(){u(this,t),d(this,"alertRule",void 0),d(this,"notification",void 0),d(this,"alert",void 0)}return f(t,[{key:"initializeBeans",value:function(){this.alertRule=new dC,this.notification=new pC,this.alert=new yC,this.alert.addAlertHandler(new mC(this.alertRule,this.notification)),this.alert.addAlertHandler(new TC(this.alertRule,this.notification)),this.alert.addAlertHandler(new _C(this.alertRule,this.notification)),this.alert.addAlertHandler(new EC(this.alertRule,this.notification))}},{key:"getAlert",value:function(){return this.alert}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new t,this.instance.initializeBeans()),this.instance}}]),t}();d(CC,"instance",void 0);var bC=X,DC=$t,RC=Et,wC=ve,SC=Ts,xC=P,LC=Function,OC=bC([].concat),kC=bC([].join),AC={},NC=xC?LC.bind:function(t){var e=DC(this),n=e.prototype,r=SC(arguments,1),i=function(){var n=OC(r,SC(arguments));return this instanceof i?function(t,e,n){if(!wC(AC,e)){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=void 0===e?"":e,r=t.sdkAppId,i=void 0===r?0:r,a=t.userID,o=void 0===a?"":a,s=A_(),c=m_?"uniminiprogram":"wxminiprogram";this._callData={version:n,platform:s,framework:c,sdkAppId:i,userID:o,roomID:0,inviteID:"",callRole:vg,callScene:"",callType:Ig,inviteeList:[],result:wg.UNKNOWN,totalTime:0,totalScore:0,code:0,message:"",abilityBit:!1,enterRoomTime:"",sendSignalingTime:"",callAcceptTime:"",exitRoomTime:"",callEndTime:"",network:0,audio:0,video:0}}},{key:"reset",value:function(){this.initializeCallData(),this._ssoLog=null}},{key:"clearCallDataAfterUpload",value:function(){var t=this.getCallData(),e=t.version,n=t.sdkAppId,r=t.userID;this.initializeCallData({version:e,sdkAppId:n,userID:r})}},{key:"uploadToKibana",value:function(){try{this._ssoLog.setText(this.packageCallDataToKibana()).setEnd(),this.clearCallDataAfterUpload()}catch(t){}}}]),t}(),jC=function(){function t(e,n){u(this,t),d(this,"_eventEmitter",void 0),d(this,"_callDataReport",void 0),this._eventEmitter=e.emitter,this._callDataReport=n,this.registerListener()}return f(t,[{key:"registerListener",value:function(){this._eventEmitter.on(og.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(og.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(og.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(og.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(og.REJECT,this.onReject.bind(this))}},{key:"removeLister",value:function(){this._eventEmitter.off(og.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.off(og.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.off(og.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.off(og.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.off(og.REJECT,this.onReject.bind(this))}},{key:"onCallEnd",value:function(t){var e=t.data.totalTime,n=void 0===e?0:e;this._callDataReport.setTotalTime(n),this._callDataReport.setCallEndTime((new Date).getTime()),this._callDataReport.setResult(wg.NORMAL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:"onCallingCancel",value:function(){this._callDataReport.getResult()||this._callDataReport.setResult(wg.CANCEL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:"onNoResponse",value:function(){this._callDataReport.setResult(wg.TIMEOUT)}},{key:"onLineBusy",value:function(){this._callDataReport.setResult(wg.BUSYLINE)}},{key:"onReject",value:function(){this._callDataReport.setResult(wg.REJECT)}}]),t}();function VC(t){return GC.apply(this,arguments)}function GC(){return GC=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e===pg.AUDIO||e===pg.VIDEO){t.next=2;break}return t.abrupt("return");case 2:return t.abrupt("return",new Promise(function(){var t=l(a().mark((function t(n,r){var i,o,s,c,l,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={microphone:!0,camera:e===pg.VIDEO},t.next=3,N_(i);case 3:if((o=t.sent)||e!==pg.AUDIO){t.next=16;break}return t.prev=5,t.next=8,wx.authorize({scope:Lg.RECORD});case 8:t.next=16;break;case 10:t.prev=10,t.t0=t.catch(5),s=Sg.MIC_TITLE,c=Sg.MIC_CONTENT,HC(s,c),r();case 16:if(o||e!==pg.VIDEO){t.next=30;break}return t.prev=17,t.next=20,wx.authorize({scope:Lg.RECORD});case 20:return t.next=22,wx.authorize({scope:Lg.CAMERA});case 22:t.next=30;break;case 24:t.prev=24,t.t1=t.catch(17),l=Sg.CAMERA_TITLE,u=Sg.CAMERA_CONTENT,HC(l,u),r();case 30:n();case 31:case"end":return t.stop()}}),t,null,[[5,10],[17,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 3:case"end":return t.stop()}}),t)}))),GC.apply(this,arguments)}function HC(t,e){wx.showModal({title:t,content:e,confirmText:Sg.CONFIRM_TEXT,success:function(t){t.confirm&&wx.openSetting()}})}var BC=xi,FC=X,KC=kr,zC=lm,JC=Gm,WC=N,$C=RangeError,qC=String,YC=Math.floor,XC=FC(JC),QC=FC("".slice),ZC=FC(1..toFixed),tb=function(t,e,n){return 0===e?n:e%2==1?tb(t,e-1,n*t):tb(t*t,e/2,n)},eb=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=YC(i/1e7)},nb=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=YC(r/e),r=r%e*1e7},rb=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var r=qC(t[e]);n=""===n?r:n+XC("0",7-r.length)+r}return n};BC({target:"Number",proto:!0,forced:WC((function(){return"0.000"!==ZC(8e-5,3)||"1"!==ZC(.9,0)||"1.25"!==ZC(1.255,2)||"1000000000000000128"!==ZC(0xde0b6b3a7640080,0)}))||!WC((function(){ZC({})}))},{toFixed:function(t){var e,n,r,i,a=zC(this),o=KC(t),s=[0,0,0,0,0,0],c="",l="0";if(o<0||o>20)throw new $C("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return qC(a);if(a<0&&(c="-",a=-a),a>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(a*tb(2,69,1))-69)<0?a*tb(2,-e,1):a/tb(2,e,1),n*=4503599627370496,(e=52-e)>0){for(eb(s,0,n),r=o;r>=7;)eb(s,1e7,0),r-=7;for(eb(s,tb(10,r,1),0),r=e-1;r>=23;)nb(s,1<<23),r-=23;nb(s,1<0?c+((i=l.length)<=o?"0."+XC("0",o-i)+l:QC(l,0,i-o)+"."+QC(l,i-o)):c+l}});var ib=function(){function t(){u(this,t)}return f(t,null,[{key:"generateTaskID",value:function(){return this.currentTaskID+=1}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wg.TIMEOUT,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;n=i(i({},t===wg.INTERVAL?{delay:2e3,count:0,backgroundTask:!0}:t===wg.RAF?{fps:60,delay:16.6,count:0,backgroundTask:!0}:{delay:2e3,count:0,backgroundTask:!0}),n),w_(e)&&(n=i(i({},n),e)),s(t)===wg.FUNCTION&&(e=t,t=wg.TIMEOUT);var r=i({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,taskName:t,callback:e},n);return this.taskMap.set(r.taskID,r),this[t](r),r.taskID}},{key:"interval",value:function(t){var e=this;return t.intervalID=setInterval((function(){t.callback(),t.loopCount+=1,e.isBreakLoop(t)}),t.delay)}},{key:"timeout",value:function(t){var e=this;return t.timeoutID=setTimeout((function n(){if(t.callback(),t.loopCount+=1,!e.isBreakLoop(t))return t.timeoutID=setTimeout(n,t.delay)}),t.delay)}},{key:"raf",value:function(t){var e=this;t.delay=(1e3/t.fps).toFixed(2);var n,r=M_(),i=function i(){if(document.hidden&&t.backgroundTask){if(n=M_()-r,r=M_(),t.callback(),t.loopCount+=1,e.isBreakLoop(t))return;return t.timeoutID=setTimeout(i,t.delay-Math.floor(n%t.delay))}if((n=M_()-r)>=t.delay&&(r=M_()-Math.floor(n%t.delay),t.callback(),t.loopCount+=1),!e.isBreakLoop(t))return t.rafID=requestAnimationFrame(i)};if(t.rafID=requestAnimationFrame(i),t.backgroundTask){var a=function(){if(document.hidden){var e=M_()-r;e>=t.delay?i():t.timeoutID=setTimeout(i,t.delay-e)}};document.addEventListener("visibilitychange",a),t.onVisibilitychange=a,document.hidden&&a()}return t.taskID}},{key:"hasTask",value:function(t){return this.taskMap.has(t)}},{key:"clearTask",value:function(t){if(!this.taskMap.has(t))return!0;var e=this.taskMap.get(t),n=e.intervalID,r=e.timeoutID,i=e.onVisibilitychange;return n&&clearInterval(n),r&&clearTimeout(r),i&&document.removeEventListener("visibilitychange",i),this.taskMap.delete(t),!0}},{key:"isBreakLoop",value:function(t){return!this.taskMap.has(t.taskID)||0!==t.count&&t.loopCount>=t.count&&(this.clearTask(t.taskID),!0)}}]),t}();d(ib,"taskMap",new Map),d(ib,"currentTaskID",1);var ab={serviceCommand:"".concat(wg.CALLKIT_RECORDS_SVR,".*")},ob="sendTRTCCustomData",sb=function(){function t(e){u(this,t),d(this,"_callRecordData",void 0),d(this,"_tim",void 0),d(this,"_heartbeat",void 0),d(this,"_lastHeartBeatTime",void 0),d(this,"_bodyStatus",void 0),this._tim=e.tim,this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=wg.WAITING,this.initializeCallData(e)}var e,n,r,o;return f(t,[{key:"getCallRecordData",value:function(){return this._callRecordData}},{key:"initializeCallData",value:function(t){var e=t||{},n=e.version,r=void 0===n?"":n,i=e.userID,a=void 0===i?"":i,o={name:g_.platform,version:g_.version},s={version:1,command:wg.EVENT_REPORT,sdk_version:r,seq:0,os_name:wg.MINI_PROGRAM,os_version:o.version||"",device_name:o.name||"",framework:wg.MINI_PROGRAM,call_type:"",media_type:"",client_ts:0,role:vg,user_id:a,room_id:"",call_id:""};this._callRecordData={head:s,body:{event_type:"",code:0,message:"",invitee_list:[]}}}},{key:"reset",value:function(){this.initializeCallData()}},{key:"_setCallType",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_type:t}))}},{key:"_setMediaType",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{media_type:UC(t)}))}},{key:"_setCallRole",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{role:t}))}},{key:"_setUserID",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{user_id:t}))}},{key:"_setRoomID",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{room_id:"".concat(t)}))}},{key:"_setInviteID",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_id:t}))}},{key:"_setEventType",value:function(t){t&&(this._callRecordData.body=i(i({},this._callRecordData.body),{},{event_type:t}))}},{key:"_setInviteeList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._callRecordData.body=i(i({},this._callRecordData.body),{},{invitee_list:t})}},{key:"_setSeq",value:function(){var t=this.getCallRecordData().head.seq;this._callRecordData.head=i(i({},this._callRecordData.head),{},{seq:t+1})}},{key:"setBodyStatus",value:function(t){if(t){var e=wg.WAITING;switch(t){case sg.CALLING:e=wg.WAITING;break;case sg.CONNECTED:e=wg.CALLING}this._bodyStatus=e}}},{key:"eventUpload",value:(o=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.userID,u=e.roomID,h=e.inviteID,f=e.inviteeList,d=void 0===f?[]:f,r){t.next=3;break}return t.abrupt("return");case 3:return this._callRecordData.head=i(i({},this._callRecordData.head),{},{command:wg.EVENT_REPORT,client_ts:Math.floor(Date.now()/1e3)}),this._setCallType(o),this._setMediaType(s),this._setCallRole(c),this._setUserID(l),this._setRoomID(u),this._setInviteID(h),this._setEventType(r),this._setInviteeList(d),this._setSeq(),p=this.getCallRecordData(),v=p.head,g=p.body,y={head:i(i({},v),{},{role:PC(v.role)}),body:g},I=i(i({},ab),{},{data:JSON.stringify(y)}),t.next=18,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(ob,I);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"eventUploadNotSave",value:(r=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.roomID,u=e.inviteID,this._setSeq(),h=this.getCallRecordData(),f=h.head,d=h.body,p={head:i(i({},f),{},{role:PC(c),call_id:u,call_type:o,media_type:UC(s),room_id:"".concat(l),client_ts:Math.floor(Date.now()/1e3)}),body:i(i({},d),{},{event_type:r})},v=i(i({},ab),{},{data:JSON.stringify(p)}),t.next=7,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(ob,v);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"heartBeatUpload",value:(n=l(a().mark((function t(){var e,n,r,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._setSeq(),n=this._callRecordData.head,r={head:i(i({},n),{},{role:PC(n.role),clientTs:Date.now(),command:wg.HEART_BEAT}),body:{status:this._bodyStatus}},o=i(i({},ab),{},{data:r}),t.next=6,null==this||null===(e=this._tim)||void 0===e?void 0:e.callExperimentalAPI(ob,o);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"startHeartbeat",value:function(){-1===this._heartbeat&&(F_.info("start heart beat..."),this.heartBeatUpload(),this._heartbeat=ib.run(wg.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))}},{key:"stopHeartbeat",value:function(){-1!==this._heartbeat&&(F_.info("stop heart beat"),ib.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=wg.WAITING)}},{key:"doHeartbeat",value:(e=l(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.heartBeatUpload(),e=Date.now(),this._lastHeartBeatTime>0&&e-this._lastHeartBeatTime>1e4&&F_.warn("heartbeat took ".concat(e-this._lastHeartBeatTime)),this._lastHeartBeatTime=e;case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),cb=function(){function t(e,n){u(this,t),d(this,"_eventEmitter",void 0),d(this,"_callRecordDataReport",void 0),d(this,"_isCallAccepted",void 0),this._eventEmitter=e,this._callRecordDataReport=n,this._isCallAccepted=!1,this.registerListener()}return f(t,[{key:"registerListener",value:function(){this._eventEmitter.on(og.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(og.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(og.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(og.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(og.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(og.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(og.REJECT,this.onReject.bind(this))}},{key:"removeLister",value:function(){this._eventEmitter.off(og.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(og.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(og.CALL_END,this.onCallEnd),this._eventEmitter.off(og.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(og.NO_RESP,this.onNoResponse),this._eventEmitter.off(og.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(og.REJECT,this.onReject)}},{key:"onCallReceived",value:function(){this._callRecordDataReport.startHeartbeat()}},{key:"onCallAccepted",value:function(){var t=this._callRecordDataReport.getCallRecordData().head;if((null==t?void 0:t.role)===wg.INVITER){if(this._isCallAccepted&&t.call_type===wg.GROUP)return;this._isCallAccepted=!0;var e={eventType:wg.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(e),this._callRecordDataReport.setBodyStatus(sg.CONNECTED)}}},{key:"onCallEnd",value:function(){var t={eventType:wg.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(t),this._callRecordDataReport.stopHeartbeat()}},{key:"onCallingCancel",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head,n=e.role===wg.INVITER?wg.CANCEL_CALL:wg.CALL_CANCELED;this._isCallAccepted=!1;var r=(t.data||{}).reason;((void 0===r?"":r)===wg.NORMAL||e.role===wg.INVITER&&e.call_type===wg.GROUP)&&this._callRecordDataReport.eventUpload({eventType:n}),this._callRecordDataReport.stopHeartbeat()}},{key:"onNoResponse",value:function(){this._uploadInC2C(wg.TIMEOUT)}},{key:"onLineBusy",value:function(){this._uploadInC2C(wg.BUSYLINE)}},{key:"onReject",value:function(){this._uploadInC2C(wg.REJECT)}},{key:"_uploadInC2C",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head;if((null==e?void 0:e.call_type)===wg.SINGLE){var n="";switch(t){case wg.TIMEOUT:n=e.role===wg.INVITER?wg.CALL_MISSED:wg.NOT_ANSWER_CALL;break;case wg.REJECT:n=e.role===wg.INVITER&&wg.CALL_REJECTED;break;case wg.BUSYLINE:n=e.role===wg.INVITER?wg.CALL_BUSY:wg.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:n})}}}]),t}(),lb="TUICallEngine",ub=ly({clsConfig:{endpoint:"https://ap-nanjing.cls.tencentcs.com",topicId:"a1310e66-a3f5-4572-a1c3-7a327a27496d"}}),hb=function(){function r(i){u(this,r),d(this,"_initReady",!1),d(this,"_timExternal",!1),d(this,"_initialCallId",""),this.data={config:{sdkAppID:i.sdkAppID,userID:"",userSig:"",type:1}},this.initData(),this.EVENT=og,this.MEDIA_TYPE=pg,this.CALL_TYPE=pg,this._emitter=new ag,this.TRTC=new e(this,{TUIScene:"TUICallKit"});var a="TUICallKit";try{(wx&&wx._isTIMCallKit||wx&&wx.getStorageSync&&wx.getStorageSync("_isTIMCallKit")||getApp&&getApp()&&getApp().globalData&&getApp().globalData._isTIMCallKit)&&(a="TIMCallKit")}catch(t){console.error(t)}wx.TUIScene=a,this._callDataReport=new MC({version:Ly,sdkAppId:i.sdkAppID}),this._dataReportObserver=new jC({emitter:this._emitter},this._callDataReport),i.tim?(this.tim=i.tim,this._timExternal=!0):wx.$TIM?(this.tim=wx.$TIM,this._timExternal=!0):this.tim=n.create({SDKAppID:i.sdkAppID}),this._callRecordReport=new sb({version:Ly,tim:this.tim}),this._recordReportObserver=new cb(this._emitter,this._callRecordReport),wx.$TSignaling||(wx.$TSignaling=new t({SDKAppID:i.sdkAppID,tim:this.tim,isRejectNotifyAll:!0})),wx.getSystemInfoSync().platform===wg.DEVTOOLS&&F_.warn("".concat(xg)),wx.setStorageSync("sdkAppId",i.sdkAppID),this.TSignalingClient=new Sy({TSignaling:wx.$TSignaling}),this.TRTCCallingDelegate=new xy({emitter:this._emitter}),this._eventStatController=new Q_;var o=new K_(z_);K_.bindController(this._eventStatController),o.setText("version=".concat(Ly)).setEnd(),this._initLogger(i),F_.info("".concat(lb," SDK Version:").concat(Ly,", SDKAppID:").concat(i.sdkAppID))}var o,s,c,h,p,v,g,y,I,m,E,_,T,b,D,R,w,S,x,L,O,k,A,N,U,P,M,j,V,G,H,B,F,K,z,J,W;return f(r,[{key:"destroyInstance",value:function(){if(r.instance){this._callDataReport&&this._callDataReport.reset&&this._callDataReport.reset(),this._dataReportObserver&&this._dataReportObserver.reset&&this._dataReportObserver.removeLister(),this._callRecordReport&&this._callRecordReport.reset(),this._recordReportObserver&&this._recordReportObserver.removeLister(),r.instance.destroyed(),r.instance=null;try{wx.removeStorageSync("sdkAppId"),wx.removeStorageSync("userId")}catch(t){console.error(t)}}}},{key:"_initLogger",value:function(t){var e=this;wx.getSystemInfo({success:function(t){var e=t.brand,n=t.model,r=t.language,i=t.platform,a=t.version;ub.updateGetReportData((function(){return{useragent:{brand:e,model:n,language:r,platform:i,version:a}}}))}}),this._logger=ub,this._logger.updateGetReportData((function(){return{app:"TUICallEngine-mini",version:Ly,platform:wg.MINI_PROGRAM,sdkappid:t.sdkAppID,time:+new Date,userid:e.getUserID(),callinfo:{roomid:e.getRoomID(),inviteid:e.getInitialCallId(),callrole:e.isInviter()?wg.INVITER:wg.INVITEE,groupid:e.getGroupID(),calltype:e.getCallType(),handledInviteeList:e.getHandledInviteeList(),unHandledInviteeList:e.getUnHandledInviteeList()},callkitversion:t.callkitVersion||wg.UNKNOWN,framework:t.frameWork||wg.UNKNOWN,isfromchat:t.chat?"true":"false"}}))}},{key:"setLogLevel",value:function(t){"number"!=typeof t||isNaN(t)?F_.error("".concat(lb,",setLogLevel parameter must be a number(0~4)")):(F_.setLevel(t),this.TSignalingClient.setLogLevel(t),this.TRTC.setLogLevel(t))}},{key:"initData",value:function(){var t={callStatus:sg.IDLE,soundMode:this.data.config.type===pg.AUDIO?bg.EAR:bg.SPEAKER,active:!1,invitation:{inviteID:"",inviter:"",type:"",roomID:""},startTalkTime:0,localUser:null,remoteUsers:[],remoteID:"",timer:null,chatTimeNum:0,chatTime:"00:00:00",screen:"pusher",pusher:{},playerList:[],isInviter:!0,unHandledInviteeList:[],handledInviteeList:[],_inviterInviteID:{},_audioVideoSwitchIdList:[],_acceptedUserObject:{},isGroupCall:!1,groupID:"",switchCallModeStatus:!0,enterRoomStatus:!1,devicePermission:!1};this.data=i(i({},this.data),t)}},{key:"handleNewInvitationReceived",value:(W=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.NEW_INVITATION_RECEIVED",{text:{data:i(i({},e),{},{currentCallStatus:o})},type:"event"}),o=this.getCallStatus(),F_.log("".concat(lb,".onNewInvitationReceived - params:"),e,"currentCallStatus:".concat(o)),s=e.data,c=s.inviter,l=s.inviteeList,u=s.data,h=s.inviteID,f=s.groupID,P_((d=JSON.parse(u)).businessID)){t.next=7;break}return t.abrupt("return");case 7:if(p=(null==d||null===(n=d.data)||void 0===n?void 0:n.initialCallId)||"",this.getUserID()!==c){t.next=10;break}return t.abrupt("return");case 10:if(g={inviter:c,inviteeList:l,inviteID:h,isGroupCall:v=!!f,inviteData:d,groupID:f,initialCallId:p,currentCallStatus:o,inCallUserIDs:(null==d?void 0:d.inCallUserIDs)||[]},"hangup"!==(null==d||null===(r=d.data)||void 0===r?void 0:r.cmd)){t.next=19;break}if(F_.log("".concat(lb,".hangup - params:"),c,d,this.getHandledInviteeList(),this.getUnHandledInviteeList(),o,v),o!==sg.IDLE){t.next=16;break}return t.abrupt("return");case 16:return t.next=18,this.handleHangupSignal(g);case 18:return t.abrupt("return");case 19:if(v||!this.judgeSwitchCallMode(d)){t.next=25;break}if(o===sg.IDLE||d.room_id!==this.data.invitation.roomID){t.next=24;break}return t.next=23,this.handleSwitchCallModeTSignaling(h,d);case 23:this.addAudioVideoSwitchIdList(h);case 24:return t.abrupt("return");case 25:if(o===sg.IDLE){t.next=30;break}return t.next=28,this.TSignalingClient.reject({inviteID:h,type:u.call_type,lineBusy:"line_busy"});case 28:return this.getCallRecordReport().eventUploadNotSave({inviteID:p||h,callRole:wg.INVITEE,eventType:wg.IGNORE_CALL,roomID:d.room_id,mediaType:d.call_type,callType:f?wg.GROUP:wg.SINGLE}),t.abrupt("return");case 30:this.handleInvitedSignal(g);case 31:case"end":return t.stop()}}),t,this)}))),function(t){return W.apply(this,arguments)})},{key:"handleHangupSignal",value:(J=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.inviter,r=e.currentCallStatus,o=e.inviteData,s=e.inviteeList,c=this.isGroupCall(),l=this.isInviter(),r!==sg.CALLING){t.next=11;break}if(u=this.getUnHandledInviteeList(),h=this.getHandledInviteeList(),-1!==u.indexOf(n)&&this.deleteUnHandledInviteeList([n]),-1!==h.indexOf(n)){t.next=9;break}return t.abrupt("return");case 9:t.next=15;break;case 11:if(this.deleteHandledInviteeList([n]),!(-1===(f=this.getHandledInviteeList()).indexOf(n)&&f.length>1)){t.next=15;break}return t.abrupt("return");case 15:if(d=this.generateCallEndData({totalTime:o.call_end||0}),c){t.next=22;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=20,this._resetTUICallEngine();case 20:case 31:t.next=46;break;case 22:if(this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),!l){t.next=33;break}if(1!==p.length||0!==v.length){t.next=31;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=31,this._resetTUICallEngine();case 33:if(r!==sg.CALLING){t.next=41;break}if(-1!==s.indexOf(this.getUserID())&&this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),0!==p.length||1!==v.length){t.next=41;break}return g=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},g),{},{reason:wg.NORMAL})),t.next=41,this._resetTUICallEngine();case 41:if(r!==sg.CONNECTED){t.next=46;break}if(1!==p.length||0!==v.length){t.next=46;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=46,this._resetTUICallEngine();case 46:case"end":return t.stop()}}),t,this)}))),function(t){return J.apply(this,arguments)})},{key:"handleSwitchCallModeTSignaling",value:(z=l(a().mark((function t(e,n){var r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={inviteID:e,type:n.call_type},i={cmd:"switchToVideo"},n.call_type===pg.VIDEO&&(r.switch_to_audio_call="switch_to_audio_call",i.cmd="switchToAudio"),t.next=5,this.TSignalingClient.accept(r,i);case 5:o=t.sent,this.setSwitchCallModeStatus(!1),this.handleCallMode(n.call_type,o);case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return z.apply(this,arguments)})},{key:"judgeSwitchCallMode",value:function(t){return t.switch_to_audio_call&&"switch_to_audio_call"===t.switch_to_audio_call||t.data&&"switchToAudio"===t.data.cmd||t.data&&"switchToVideo"===t.data.cmd}},{key:"handleCallMode",value:function(t,e){F_.log("".concat(lb,".handleCallMode - type"),t);var n=t!==pg.VIDEO;this.setPusherAttributesHandler({enableCamera:n}),n?(this.data.config.type=pg.VIDEO,this.data.invitation.type=pg.VIDEO):(this.data.config.type=pg.AUDIO,this.data.invitation.type=pg.AUDIO),this.TRTCCallingDelegate.onCallMode({type:this.data.config.type,message:e.data.message}),this.setSwitchCallModeStatus(!0)}},{key:"handleInvitedSignal",value:(K=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.inviter,r=e.inviteeList,o=e.isGroupCall,s=e.groupID,c=e.inviteID,l=e.inviteData,u=e.inCallUserIDs,h=void 0===u?[]:u,f=e.initialCallId,d=void 0===f?"":f,this.data.remoteID=n,this.data.config.type=l.call_type,this.data.invitation.inviteID=c,this.data.invitation.inviter=n,this.data.invitation.type=l.call_type,this.data.invitation.roomID=l.room_id,this.data.isInviter=!1,this.data.isGroupCall=o,this.data.roomID=l.room_id,this.addHandledInviteeList([n]),this.addUnHandledInviteeList([].concat(C(r),C(h))),this.addAcceptedUserList(c,[n]),this.addInviterInviteId(c,[n].concat(C(r))),this.setInitialCallId(d),p=h.filter((function(t){return-1===r.indexOf(t)})),o&&(this.data.groupID=s),this.changeCallStatus(sg.CALLING),F_.log("".concat(lb," NEW_INVITATION_RECEIVED invitation: "),this.data.callStatus,this.data.invitation),v={sponsor:n,inviteeList:r,userIDList:[].concat(C(r),C(p)),isFromGroup:o,inviteID:c,groupID:s,inviteData:{version:l.version,callType:l.call_type,roomID:l.room_id},userData:l.userData,calleeIdList:r,callMediaType:l.call_type},this.setPusherAttributesHandler({enableCamera:this.data.config.type===pg.VIDEO}),g=i(i({},g=this.getCallDataReport().getCallData()),{},{userId:this.getUserID(),roomID:l.room_id,inviteID:c,callRole:yg,callType:l.call_type,inviteeList:r}),y={eventType:wg.RECEIVE_CALL,callType:s?wg.GROUP:wg.SINGLE,mediaType:l.call_type,callRole:wg.INVITEE,userID:this.getUserID(),roomID:l.room_id,inviteID:d||c},this.getCallRecordReport().eventUpload(y),this.getCallDataReport().setCallData(g),I=this.generateEventData()||{},this.TRTCCallingDelegate.onInvited(i(i({},I),v)),t.next=30,N_({camera:!0});case 30:this.data.devicePermission=t.sent,this.data.devicePermission&&this.data.config.type===pg.VIDEO&&wx.createLivePusherContext().startPreview();case 32:case"end":return t.stop()}}),t,this)}))),function(t){return K.apply(this,arguments)})},{key:"addInviterInviteId",value:function(t,e){0!==e.length&&(0===(this.data._inviterInviteID[t]||[]).length?this.data._inviterInviteID[t]=e:this.data._inviterInviteID[t]=[].concat(C(this.data._inviterInviteID[t]),C(e)))}},{key:"handleInviteeAccepted",value:(F=l(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITEE_ACCEPTED",{text:{data:i(i({},e),{},{currentCallStatus:this.data.callStatus}),type:"event"}}),F_.log("".concat(lb," onInviteeAccepted - params:"),e),P_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=5;break}return t.abrupt("return");case 5:if(r=e.data.invitee,o=e.data.inviteID,-1!==this.getTotalInviterInviteIdList().indexOf(o)){t.next=9;break}return t.abrupt("return");case 9:if(this.data.callStatus!==sg.IDLE){t.next=11;break}return t.abrupt("return");case 11:if(this.isGroupCall()||!this.judgeSwitchCallMode(n)||this.data.switchCallModeStatus){t.next=14;break}return this.handleCallMode(this.data.invitation.type),t.abrupt("return");case 14:if(s=this.getCallStatus(),r!==this.getUserID()||s!==sg.CALLING){t.next=21;break}return c=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},c)),t.next=20,this._resetTUICallEngine();case 20:return t.abrupt("return");case 21:return this.isInviter()&&this.data.callStatus===sg.CALLING&&this.changeCallStatus(sg.CONNECTED),this.getCallDataReport().setCallAcceptTime((new Date).getTime()),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.addAcceptedUserList(o,[r]),t.next=28,this.getUserProfile(this.data.unHandledInviteeList.map((function(t){return{userID:t}})));case 28:l=t.sent,this.TRTCCallingDelegate.onUserAccept({userID:r,userList:l});case 30:case"end":return t.stop()}}),t,this)}))),function(t){return F.apply(this,arguments)})},{key:"handleInviteeRejected",value:(B=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITEE_REJECTED",{text:{data:e},type:"event"}),F_.log("".concat(lb," onInviteeRejected - params"),e),r=e.data.inviteID,P_(null==(o=JSON.parse(e.data.data))?void 0:o.businessID)){t.next=6;break}return t.abrupt("return");case 6:if(this.isGroupCall()||this.getSwitchCallModeStatus()||-1===this.getAudioVideoSwitchIdList().indexOf(r)){t.next=10;break}return F_.log("".concat(lb,".onInviteeRejected - Audio and video switching is not available")),this.setSwitchCallModeStatus(!0),t.abrupt("return");case 10:if(s=e.data.invitee,c=e.data.inviter,l=this.getUserID(),u=this.getCallStatus(),-1!==this.getInviterInviteIdList().indexOf(r)){t.next=19;break}if(!this.isInviter()||-1===this.getInviterInviteIdUserList().indexOf(s)){t.next=17;break}return t.abrupt("return");case 17:return this.deleteUnHandledInviteeList([s]),t.abrupt("return");case 19:if(u!==sg.IDLE){t.next=21;break}return t.abrupt("return");case 21:if(h=this.generateEventData(),l!==s||u!==sg.CALLING){t.next=27;break}return this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:s,userID:s},h)),t.next=26,this._resetTUICallEngine();case 26:return t.abrupt("return");case 27:if(f=this.isGroupCall(),d=this.isInviter(),this.deleteUnHandledInviteeList([s]),p=this.getUnHandledInviteeList(),v=this.getHandledInviteeList(),g=i({inviteID:this.data.invitation.inviteID,invitee:l,userID:l},h),y={inviteID:this.data.invitation.inviteID,invitee:s,userID:s},I=this.data.invitation,u!==sg.CONNECTED){t.next=38;break}if(-1===v.indexOf(s)){t.next=38;break}return t.abrupt("return");case 38:if(!("line_busy"===o.line_busy||""===o.line_busy||null!=o&&null!==(n=o.data)&&void 0!==n&&n.message&&"lineBusy"===o.data.message)){t.next=52;break}if(c===I.inviter&&this.TRTCCallingDelegate.onLineBusy({inviteID:this.data.invitation.inviteID,invitee:s,userID:s}),f){t.next=46;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.BUSYLINE})),t.next=44,this._resetTUICallEngine();case 44:t.next=50;break;case 46:if(0!==p.length||1!==v.length){t.next=50;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.BUSYLINE})),t.next=50,this._resetTUICallEngine();case 50:case 57:t.next=78;break;case 52:if(f){t.next=59;break}return this.TRTCCallingDelegate.onReject(y),this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.REJECT})),t.next=57,this._resetTUICallEngine();case 59:if(this.TRTCCallingDelegate.onReject(y),u!==sg.CALLING){t.next=72;break}if(!d){t.next=68;break}if(0!==p.length||1!==v.length){t.next=66;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.REJECT})),t.next=66,this._resetTUICallEngine();case 66:t.next=72;break;case 68:if(1!==p.length||0!==v.length){t.next=72;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:wg.REJECT})),t.next=72,this._resetTUICallEngine();case 72:if(u!==sg.CONNECTED){t.next=78;break}if(0!==p.length||1!==v.length){t.next=78;break}return m=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(m),t.next=78,this._resetTUICallEngine();case 78:case"end":return t.stop()}}),t,this)}))),function(t){return B.apply(this,arguments)})},{key:"handleInvitationCancelled",value:(H=l(a().mark((function t(e){var n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITATION_CANCELLED",{text:{data:e,type:"event"}}),this.data.invitation.inviteID===e.data.inviteID){t.next=3;break}return t.abrupt("return");case 3:if(P_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=6;break}return t.abrupt("return");case 6:if(this.data.callStatus!==sg.IDLE){t.next=8;break}return t.abrupt("return");case 8:if(-1!==this.getInviterInviteIdList().indexOf(e.data.inviteID)){t.next=10;break}return t.abrupt("return");case 10:return F_.log(lb,"onInvitationCancelled","inviteID:".concat(e.data.inviteID," inviter:").concat(e.data.inviter," data:").concat(e.data.data)),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:e.data.inviter,userID:e.data.inviter},r),{},{reason:wg.NORMAL})),t.next=15,this._resetTUICallEngine();case 15:case"end":return t.stop()}}),t,this)}))),function(t){return H.apply(this,arguments)})},{key:"handleInvitationTimeout",value:(G=l(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITATION_TIMEOUT",{text:{data:e,type:"event"}}),r=e.data,o=r.inviter,s=r.inviteeList,c=void 0===s?[]:s,l=r.inviteID,u=this.getUserID(),h=this.isGroupCall(),f=this.isInviter(),d=this.getCallStatus(),this.deleteUnHandledInviteeList(c),F_.warn("".concat(lb,".onInvitationTimeout - params:"),e,"currentUserID:".concat(u," isInviter:").concat(f," isGroupCall:").concat(h," \n currentCallStatus:").concat(d," inviteID:").concat(null==this||null===(n=this._newInvitationData)||void 0===n?void 0:n.inviteID)),-1!==this.getInviterInviteIdList().indexOf(l)){t.next=10;break}return t.abrupt("return");case 10:if(d!==sg.IDLE){t.next=12;break}return t.abrupt("return");case 12:if(p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),g={groupID:this.data.groupID,inviteID:this.data.invitation.inviteID,sponsor:o,timeoutUserList:c,userIDList:c},y=this.generateEventData(),I=i(i({inviteID:this.data.invitation.inviteID,invitee:u,userID:u},y),{},{reason:wg.TIMEOUT}),h){t.next=23;break}return f?(this.TRTCCallingDelegate.onNoResp(g),this.TRTCCallingDelegate.onCancel(I)):(this.TRTCCallingDelegate.onCancel(I),m=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},m),{},{eventType:wg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}))),t.next=21,this._resetTUICallEngine();case 21:t.next=48;break;case 23:if(d!==sg.CALLING){t.next=41;break}if(!f){t.next=32;break}if(this.TRTCCallingDelegate.onNoResp(g),0!==v.length){t.next=30;break}return this.TRTCCallingDelegate.onCancel(I),t.next=30,this._resetTUICallEngine();case 30:t.next=41;break;case 32:if(-1!==c.indexOf(u)){t.next=36;break}this.TRTCCallingDelegate.onNoResp(g),t.next=39;break;case 36:return this.TRTCCallingDelegate.onCancel(I),t.next=39,this._resetTUICallEngine();case 39:E=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},E),{},{eventType:wg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}));case 41:if(d!==sg.CONNECTED){t.next=48;break}if(this.TRTCCallingDelegate.onNoResp(g),1!==p.length||0!==v.length){t.next=48;break}return _=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(_),t.next=48,this._resetTUICallEngine();case 48:case"end":return t.stop()}}),t,this)}))),function(t){return G.apply(this,arguments)})},{key:"handleSDKReady",value:function(){var t=this;this._logger.info("ChatSdkEvent.SDK_READY",{text:{type:"event"}}),F_.log(lb,"TSignaling SDK ready"),this.TSignalingResolve(),this.TRTCCallingDelegate.onSdkReady({message:"SDK ready"}),this.tim.getMyProfile().then((function(e){t.data.localUser=e.data})).catch((function(t){F_.warn("getMyProfile error:",t)}))}},{key:"handleKickedOut",value:(V=l(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("ChatSdkEvent.KICKED_OUT",{text:{type:"event"}}),this.getCallStatus()!==sg.CONNECTED){t.next=6;break}return e=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(e),t.next=6,this._resetTUICallEngine();case 6:if(this.getCallStatus()!==sg.CALLING){t.next=14;break}return n=this.getUserID(),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:n,userID:n},r),{},{reason:wg.BANNED})),t.next=12,this.cancel();case 12:return t.next=14,this._resetTUICallEngine();case 14:this._initReady=!1,this.TRTCCallingDelegate.onKickedOut({message:"kicked out"});case 16:case"end":return t.stop()}}),t,this)}))),function(){return V.apply(this,arguments)})},{key:"_addTSignalingEvent",value:function(){wx.$TSignaling.on(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived,this),wx.$TSignaling.on(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted,this),wx.$TSignaling.on(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected,this),wx.$TSignaling.on(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled,this),wx.$TSignaling.on(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout,this),wx.$TSignaling.on(t.EVENT.SDK_READY,this.handleSDKReady,this),wx.$TSignaling.on(t.EVENT.KICKED_OUT,this.handleKickedOut,this),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.on(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"_removeTSignalingEvent",value:function(){wx.$TSignaling.off(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived),wx.$TSignaling.off(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted),wx.$TSignaling.off(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected),wx.$TSignaling.off(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled),wx.$TSignaling.off(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout),wx.$TSignaling.off(t.EVENT.SDK_READY,this.handleSDKReady),wx.$TSignaling.off(t.EVENT.KICKED_OUT,this.handleKickedOut),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.off(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"onLocalJoin",value:function(){var t=this.generateEventData();this.TRTCCallingDelegate.onCallBegin(t)}},{key:"onRemoteUserJoin",value:(j=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.data,r=n.userID,i=n.userList,o=n.playerList,F_.log(lb,"REMOTE_USER_JOIN",e,r),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.changeCallStatus(sg.CONNECTED),!(o.length>0)){t.next=11;break}return t.next=8,this.getUserProfile(o);case 8:t.t0=t.sent,t.next=12;break;case 11:t.t0=this.data.playerList;case 12:this.data.playerList=t.t0,this.data.startTalkTime||(this.data.startTalkTime=Date.now()),this.TRTCCallingDelegate.onUserEnter({userID:e.data.userID,playerList:this.data.playerList}),F_.log(lb,"REMOTE_USER_JOIN","playerList:",this.data.playerList,"userList:",i);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:"onRemoteUserLeave",value:(M=l(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.getCallStatus()!==sg.IDLE){t.next=2;break}return t.abrupt("return");case 2:if(n=e.data.userID,F_.log(lb,"REMOTE_USER_LEAVE",e,e.data.userID),this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),this.getCallDataReport().setExitRoomTime((new Date).getTime()),this.data.isGroupCall){t.next=17;break}return t.next=11,this.TSignalingClient.hangup({userIDList:[n],callType:this.data.config.type,callEnd:this.generateCallTotalTime()});case 11:return r=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(r),F_.log(lb,"REMOTE_USER_LEAVE","playerList:"),t.next=16,this._resetTUICallEngine();case 16:return t.abrupt("return");case 17:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=this.getUserID(),1!==i.length||i[0]!==s||0!==o.length){t.next=25;break}return c=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(c),t.next=25,this._resetTUICallEngine();case 25:case"end":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})},{key:"onLocalNetStateUpdate",value:function(t){var e=t.data.pusher.netStatus;F_.log(lb,"onLocalNetStateUpdate",e),this.data.pusher=t.data.pusher,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onRemoteNetStateUpdate",value:(P=l(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.data.playerList,F_.log(lb,"onRemoteNetStateUpdate",n),this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return P.apply(this,arguments)})},{key:"onError",value:function(t){F_.warn(lb,"onError",t),this.TRTCCallingDelegate.onError(t)}},{key:"onRemoteVideoAdd",value:function(t){F_.log("* room REMOTE_VIDEO_ADD",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!1})}},{key:"onRemoteVideoRemove",value:function(t){F_.log("* room REMOTE_VIDEO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"onRemoteAudioAdd",value:(U=l(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return F_.log("* room REMOTE_AUDIO_ADD",e),t.next=3,this.getUserProfile([e.data.player]);case 3:n=t.sent,this.setPlayerAttributesHandler(n[0],{muteAudio:!1});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"onRemoteAudioRemove",value:function(t){F_.log("* room REMOTE_AUDIO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"onRemoteAudioVolumeUpdate",value:(N=l(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:F_.log("* room REMOTE_AUDIO_VOLUME_UPDATE",e),n=e.data.playerList,this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return N.apply(this,arguments)})},{key:"onLocalAudioVolumeUpdate",value:function(t){var e=t.data.pusher;this.data.pusher=e,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onMessageSentByMe",value:function(t){this.TRTCCallingDelegate.onMessageSentByMe(t)}},{key:"_addTRTCEvent",value:function(){this.TRTC.on(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.ERROR,this.onError,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate,this)}},{key:"_removeTRTCEvent",value:function(){this.TRTC.off(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave),this.TRTC.off(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.ERROR,this.onError),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate),this.TRTC.off(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate)}},{key:"initTRTC",value:function(){var t={beautyLevel:5};this._logger.info("".concat(lb,".initTRTC.start"),{type:"api",data:{pusherConfig:t}});var e=this.TRTC.createPusher(t);this.data.pusher=e.pusherAttributes}},{key:"enterRoom",value:function(t){var e=+new Date;this._logger.info("".concat(lb,".enterRoom.start"),{text:{data:t},type:"api"}),this._addTRTCEvent();var n=t.roomID,r=Object.assign(this.data.config,{roomID:n,enableMic:!0,autopush:!0,enableAgc:!0,enableAns:!0,enableCamera:t.callType===pg.VIDEO});this.data.enterRoomStatus=!0,this.data.pusher=this.TRTC.enterRoom(r);var a=+new Date;this._logger.info("".concat(lb,".enterRoom.success"),{text:{data:i(i({},t),{},{cost:a-e})},type:"api"}),wx.createLivePusherContext().startPreview(),this.getCurrentPusherInstance().start()}},{key:"exitRoom",value:(A=l(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".exitRoom.start"),{type:"api"}),t.next=3,this.getCurrentPusherInstance().stop();case 3:return t.next=5,this.TRTC.exitRoom();case 5:e=t.sent,this.data.pusher=e.pusher,this.data.playerList=e.playerList,this.data.unHandledInviteeList=[],this.data.enterRoomStatus=!1,this.initTRTC(),this._removeTRTCEvent();case 12:case"end":return t.stop()}}),t,this)}))),function(){return A.apply(this,arguments)})},{key:"setPusherAttributesHandler",value:function(t){this._logger.info("".concat(lb,".setPusherAttributesHandler.start"),{text:{data:t},type:"api"}),this.data.pusher=this.TRTC.setPusherAttributes(t),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"setPlayerAttributesHandler",value:(k=l(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info("".concat(lb,".setPlayerAttributesHandler.start"),{text:{data:n},type:"api"}),r=this.TRTC.setPlayerAttributes(e.streamID,n),F_.warn("setPlayerAttributesHandler",r),this.data.playerList=r.length>0?this._updateUserProfile(this.data.playerList,r):this.data.playerList,this.data.playerList.length>0&&0===r.length&&(this.data.playerList[0].hasAudio=!1,this.data.playerList[0].hasVideo=!1),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return k.apply(this,arguments)})},{key:"_mutePlayerAudio",value:function(t){this._logger.info("".concat(lb,"._mutePlayerAudio.start"),{text:{data:t},type:"api"});var e=t.currentTarget.dataset.value;e.hasAudio&&e.muteAudio?this.setPlayerAttributesHandler(e,{muteAudio:!1}):!e.hasAudio||e.muteAudio||this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"_mutePlayerVideo",value:function(t){this._logger.info("".concat(lb,"._mutePlayerVideo.start"),{text:{data:t},type:"api"});var e=t.currentTarget.dataset.value;e.hasVideo&&e.muteVideo?this.setPlayerAttributesHandler(e,{muteVideo:!1}):!e.hasVideo||e.muteVideo||this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"_pusherAudioHandler",value:function(){this._logger.info("".concat(lb,"._pusherAudioHandler.start"),{type:"api",text:{data:{enableMic:this.data.pusher.enableMic}}}),this.data.pusher.enableMic?(this.setPusherAttributesHandler({enableMic:!1}),this.getCurrentPusherInstance().setMICVolume({volume:0})):(this.setPusherAttributesHandler({enableMic:!0}),this.getCurrentPusherInstance().setMICVolume({volume:100}))}},{key:"_pusherVideoHandler",value:function(){this._logger.info("".concat(lb,"._pusherVideoHandler.start"),{type:"api",text:{data:{enableCamera:this.data.pusher.enableCamera}}}),this.data.pusher.enableCamera?this.setPusherAttributesHandler({enableCamera:!1}):this.setPusherAttributesHandler({enableCamera:!0})}},{key:"init",value:(O=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return CC.getInstance().getAlert().checkSync(new vC({api:"init",attributes:e})),t.next=3,this.login(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return O.apply(this,arguments)})},{key:"login",value:(L=l(a().mark((function t(e){var n=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.updateGetReportData((function(){return{userid:e.userID}})),this._logger.info("".concat(lb,".login.start"),{type:"api",text:i(i({},e),{},{userSig:""})}),this.data.config.userID=e.userID,this.data.config.userSig=e.userSig,t.abrupt("return",new Promise((function(t,r){wx.$TSignaling.login({userID:e.userID,userSig:e.userSig}).then((function(r){return F_.log(lb,"login","IM login success",r),wx.setStorageSync("userId","".concat(e.userID)),n._callDataReport.setUserID(e.userID),n._initReady=!0,n._resetTUICallEngine(),n._addTSignalingEvent(),n.initTRTC(),n.TSignalingResolve=t,r.data.repeatLogin&&t(null),null})).catch((function(t){n._logger.error("".concat(lb,".login.fail"),{type:"api",text:{error:t}}),F_.error("".concat(lb," init failed', error: ").concat(t)),r(t)}))})));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return L.apply(this,arguments)})},{key:"logout",value:(x=l(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".logout.start"),{type:"api",text:{data:{userID:this.data.config.userID,initReady:this._initReady}}}),this._initReady){t.next=3;break}return t.abrupt("return");case 3:return e=this.data.config,n=e.userID,r=e.userSig,t.prev=4,t.next=7,wx.$TSignaling.logout({userID:n,userSig:r});case 7:F_.log(lb,"logout","IM logout success"),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(4),this._logger.error("".concat(lb,".logout.fail"),{type:"api",text:{error:t.t0}}),F_.error(lb,"logout","IM logout failure");case 14:case"end":return t.stop()}}),t,this,[[4,10]])}))),function(){return x.apply(this,arguments)})},{key:"on",value:function(t,e,n){CC.getInstance().getAlert().checkSync(new vC({api:"on",attributes:{eventCode:t,handler:e,context:n}})),this._emitter.on(t,e,n)}},{key:"off",value:function(t,e){CC.getInstance().getAlert().checkSync(new vC({api:"off",attributes:{eventCode:t,handler:e}})),this._emitter.off(t,e)}},{key:"call",value:(S=l(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".call.start"),{type:"api",text:{data:e}}),n=e.userID,r=e.type,t.next=4,CC.getInstance().getAlert().check(new vC({api:"call",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Dg.BASE,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,VC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(lb,".call.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 13:if(this.getUserID()!==n){t.next=17;break}throw this._logger.error("".concat(lb,".call.fail"),{text:{error:"Called id can not be yourself. userId:".concat(this.getUserID(),", inviteeId:").concat(n)},type:"api"}),F_.log("".concat(lb,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n)),new Error("".concat(lb,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n));case 17:return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(wg.SINGLE_CALL),o={callType:wg.SINGLE,mediaType:r,inviteeList:[n]},t.prev=20,s=e.roomID||Math.floor(2147483646*Math.random()+1),this.data.roomID=s,this.data.config.type=r,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=r,this.data.invitation.roomID=s,this.data.isInviter=!0,this.data.remoteID=n,this.changeCallStatus(sg.CALLING),t.next=32,this.TSignalingClient.invite(i(i({},e),{},{roomID:s}));case 32:if(c=t.sent,this.enterRoom({roomID:s,callType:r}),this._callDataReport.setEnterRoomTime((new Date).getTime()),l=i(i({},l=this._callDataReport.getCallData()),{},{userId:n,roomID:s,callRole:gg,callType:r,inviteeList:[n]}),this._callDataReport.setCallData(l),this._callDataReport.setSendSignalingTime((new Date).getTime()),F_.log("".concat(lb," call(userID: ").concat(n,", type: ").concat(r,") success, ").concat(c)),0!==c.code){t.next=51;break}this.data.invitation.inviteID=c.inviteID,this.addInviterInviteId(c.inviteID,[this.data.config.userID,n]),this.addUnHandledInviteeList([n]),this.addHandledInviteeList([this.getUserID()]),this._callDataReport.setInviteID(c.inviteID),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:wg.START_CALL},o)),this._callRecordReport.startHeartbeat(),t.next=57;break;case 51:return this._callDataReport.setCodeAndMessage(c.code,c.message),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:wg.CALL_FAILED},o)),this._logger.error("".concat(lb,".call.fail"),{text:{error:c},type:"api"}),t.next=57,this._resetTUICallEngine();case 57:return t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 60:return t.prev=60,t.t1=t.catch(20),t.t1.code===Iy.ERROR_BLACKLIST?(this.TRTCCallingDelegate.onError(Iy.ERROR_BLACKLIST,t.t1.message),this._callDataReport.setCodeAndMessage(Iy.ERROR_BLACKLIST,t.t1.message)):this._callDataReport.setCodeAndMessage(Iy.UNKNOWN,JSON.stringify(t.t1)),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:wg.CALL_FAILED},o)),this._logger.error("".concat(lb,".call.fail"),{text:{error:t.t1},type:"api"}),F_.error("".concat(lb," call(userID:").concat(n,",type:").concat(r,") failed', error: ").concat(t.t1)),t.next=69,this._resetTUICallEngine();case 69:throw new Error(t.t1);case 70:case"end":return t.stop()}}),t,this,[[4,9],[20,60]])}))),function(t){return S.apply(this,arguments)})},{key:"groupCall",value:(w=l(a().mark((function t(e){var n,r,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".groupCall.start"),{type:"api",text:{data:e}}),n=e.type,r=e.userIDList,t.next=4,CC.getInstance().getAlert().check(new vC({api:"groupCall",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Dg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,VC(n);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(lb,".groupCall.fail"),{type:"api",text:{error:t.t0}}),t.abrupt("return");case 13:if(-1===r.indexOf(this.getUserID())){t.next=16;break}throw this._logger.error("".concat(lb,".groupCall.fail"),{type:"api",text:{error:"Called list can not contain yourself"}}),new Error("".concat(lb,".groupCall failed. Called list can't contain yourself. userID:").concat(this.getUserID(),", inviteeIDList:").concat(r));case 16:return this._callDataReport.setCallScene(wg.GROUP_CALL),o=e.roomID||Math.floor(2147483646*Math.random()+1),this.enterRoom({roomID:o,callType:n}),s={callType:wg.GROUP,mediaType:n,inviteeList:e.userIDList},this.data.config.type=e.type,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.changeCallStatus(sg.CALLING),t.prev=28,t.next=31,this.TSignalingClient.inviteGroup(i(i({},e),{},{roomID:o}));case 31:return c=t.sent,this.data.config.type=e.type,this.data.invitation.inviteID=c.inviteID,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.data.roomID=o,this.addUnHandledInviteeList(e.userIDList),this.addHandledInviteeList([this.getUserID()]),this.addInviterInviteId(c.inviteID,[this.data.config.userID].concat(C(e.userIDList))),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:wg.START_CALL},s)),this._callRecordReport.startHeartbeat(),F_.log(lb,"groupCall OK",c),t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 51:return t.prev=51,t.t1=t.catch(28),this._logger.error("".concat(lb,".groupCall.fail"),{type:"api",text:{error:t.t1}}),F_.error(lb,"groupCall failed",t.t1),this._callRecordUpload(i({eventType:wg.CALL_FAILED},s)),t.next=58,this._resetTUICallEngine();case 58:throw new Error(t.t1);case 59:case"end":return t.stop()}}),t,this,[[4,9],[28,51]])}))),function(t){return w.apply(this,arguments)})},{key:"joinInGroupCall",value:(R=l(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".joinInGroupCall.start"),{text:{data:e},type:"api"}),n=e.roomID,r=e.type,i=e.groupID,t.next=4,CC.getInstance().getAlert().check(new vC({api:"joinInGroupCall",attributes:e,initReady:this._initReady,capabilityCode:Dg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,VC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(lb,".joinInGroupCall.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 13:return t.prev=13,this.data.config.type=r,this.data.invitation.type=r,F_.log("".concat(lb,".joinInGroupCall roomID:").concat(n,",type:").concat(r,",userID:").concat(this.getUserID())),this.changeCallStatus(sg.CALLING),this.addHandledInviteeList([this.getUserID()]),this.data.groupID=i,this.data.roomID=n,this.data.isGroupCall=!0,this.data.isInviter=!1,this.enterRoom({roomID:n,callType:r}),this.changeCallStatus(sg.CONNECTED),this.getCallRecordReport().setBodyStatus(sg.CONNECTED),o={eventType:wg.JOIN_IN_GROUP_CALL,callType:wg.GROUP,mediaType:this._callType},this._callRecordUpload(o),this._callRecordReport.startHeartbeat(),t.abrupt("return",this.data.pusher);case 32:return t.prev=32,t.t1=t.catch(13),this._logger.error("".concat(lb,".joinInGroupCall.fail"),{text:{error:t.t1},type:"api"}),t.next=37,this._resetTUICallEngine();case 37:throw new Error("".concat(lb,".joinInGroupCall failed error: ").concat(t.t1));case 38:case"end":return t.stop()}}),t,this,[[4,9],[13,32]])}))),function(t){return R.apply(this,arguments)})},{key:"inviteUser",value:(D=l(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".inviteUser.start"),{text:{data:e},type:"api"}),t.next=3,CC.getInstance().getAlert().check(new vC({api:"inviteUser",attributes:e,initReady:this._initReady,capabilityCode:Dg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 3:if(n=e.userIDList,r=void 0===n?[]:n,this.isGroupCall()){t.next=8;break}throw this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:"".concat(lb,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)},type:"api"}),F_.error("".concat(lb,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)),new Error("".concat(lb,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType));case 8:if(this.isInviter()||this.data.callStatus===sg.CONNECTED){t.next=12;break}throw this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:"".concat(lb,".inviteUser - current status:").concat(this.data.callStatus," not support")},type:"api"}),F_.error("".concat(lb,".inviteUser - current status:").concat(this.data.callStatus," not support")),new Error("".concat(lb,".inviteUser - current status:").concat(this.data.callStatus," not support"));case 12:if(0!==r.length){t.next=16;break}throw this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:"userIDList is empty"},type:"api"}),F_.error("".concat(lb,".inviteUser - userIDList is empty")),new Error("".concat(lb,".inviteUser - userIDList is empty"));case 16:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=[].concat(C(i),C(o)),0!==(c=r.filter((function(t){return-1===s.indexOf(t)}))).length){t.next=24;break}return this._logger.error("".concat(lb,".inviteUser.fail"),{text:{data:{userIDList:r},error:"userIDList in call list"},type:"api"}),F_.error("".concat(lb,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))),t.abrupt("return",Promise.reject("".concat(lb,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))));case 24:return r=c,t.prev=25,l=this.data.handledInviteeList.filter((function(t){return t!==f.getUserID()})),t.next=29,this.TSignalingClient.inviteGroup({groupID:this.data.groupID,userIDList:r,type:this.data.invitation.type,roomID:this.data.roomID,timeout:this.data.callTimeout,inCallUserIDs:[].concat(C(this.data.unHandledInviteeList),C(l)),initialCallId:this.getInitialCallId()});case 29:if(u=t.sent,F_.log("inviteUser res",u),0!==u.code){t.next=38;break}return this.addUnHandledInviteeList(r),this.addInviterInviteId(u.inviteID,[this.data.config.userID].concat(C(r))),h={eventType:wg.INVITE_USER,callType:wg.GROUP,mediaType:this._callType,inviteeList:r},this._callRecordUpload(h),this._callRecordReport.startHeartbeat(),t.abrupt("return",u);case 38:t.next=44;break;case 40:throw t.prev=40,t.t0=t.catch(25),this._logger.error("".concat(lb,".inviteUser.fail"),{text:{error:t.t0},type:"api"}),new Error("".concat(lb,".inviteUser failed, userId:").concat(this.getUserID(),", inviteeIdList:").concat(r,", error: ").concat(t.t0));case 44:case"end":return t.stop()}}),t,this,[[25,40]])}))),function(t){return D.apply(this,arguments)})},{key:"accept",value:(b=l(a().mark((function t(){var e=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".accept.start"),{type:"api"}),t.next=3,CC.getInstance().getAlert().check(new vC({api:"accept",initReady:this._initReady,callStatus:this.data.callStatus,sdkAppID:this.data.config.sdkAppID}));case 3:return t.prev=3,t.next=6,VC(this.data.config.type);case 6:t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(3),this._logger.error("".concat(lb,".accept.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 12:return t.abrupt("return",new Promise((function(t,n){if(F_.log(lb,"accept() inviteID: ",e.data.invitation.inviteID),e.data.config.type!==pg.VIDEO||e.data.isGroupCall)e.handleAccept(t,n);else if(e.data.devicePermission){wx.createLivePusherContext().stopPreview();var r=setTimeout(l(a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:clearTimeout(r),e.handleAccept(t,n);case 2:case"end":return i.stop()}}),i)}))),0)}else e.handleAccept(t,n)})));case 13:case"end":return t.stop()}}),t,this,[[3,8]])}))),function(){return b.apply(this,arguments)})},{key:"handleAccept",value:(T=l(a().mark((function t(e,n){var r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".handleAccept.start"),{type:"api"}),this._callDataReport.setEnterRoomTime((new Date).getTime()),this.enterRoom({roomID:this.data.invitation.roomID,callType:this.data.config.type}),r=this.data.invitation.inviteID,t.next=6,this.TSignalingClient.accept({inviteID:r,type:this.data.config.type});case 6:0===(i=t.sent).code?(F_.log(lb,"accept OK"),this.addHandledInviteeList([this.getUserID()]),this.deleteUnHandledInviteeList([this.getUserID()]),this.addAcceptedUserList(r,[this.getUserID()]),this._callRecordUpload({eventType:wg.ACCEPT_CALL}),e({message:i.data.message,pusher:this.data.pusher}),this.changeCallStatus(sg.CONNECTED),this.getCallRecordReport().setBodyStatus(sg.CONNECTED)):(this.isGroupCall()&&(this._callDataReport.setCodeAndMessage(Iy.NOT_MEDIA_ACCESS,JSON.stringify(i.data.message)),this._callDataReport.uploadToKibana()),this._logger.error("".concat(lb,".accept.fail"),{text:{error:i},type:"api"}),F_.error(lb,"accept failed",i),n(i),this._resetTUICallEngine());case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return T.apply(this,arguments)})},{key:"reject",value:(_=l(a().mark((function t(){var e,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".reject.start"),{text:{data:{invitation:this.data.invitation,type:this.data.config.type}},type:"api"}),t.next=3,CC.getInstance().getAlert().checkSync(new vC({api:"reject",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(!this.data.invitation.inviteID){t.next=14;break}return t.next=6,this.TSignalingClient.reject({inviteID:this.data.invitation.inviteID,type:this.data.config.type});case 6:return e=t.sent,F_.log(lb,"reject OK",e),n=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},n),{},{reason:wg.REJECT})),this._callRecordUpload({eventType:wg.REJECT_CALL}),t.next=13,this._resetTUICallEngine();case 13:return t.abrupt("return",e);case 14:return this._logger.error("".concat(lb,".reject.fail"),{text:{error:"未收到邀请,无法拒绝"},type:"api"}),F_.warn("".concat(lb," 未收到邀请,无法拒绝")),t.abrupt("return","未收到邀请,无法拒绝");case 17:case"end":return t.stop()}}),t,this)}))),function(){return _.apply(this,arguments)})},{key:"hangup",value:(E=l(a().mark((function t(){var e,n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".hangup.start"),{text:{data:{isGroupCall:this.isGroupCall(),isInviter:this.isInviter(),currentUserID:this.getUserID(),totalTime:this.generateCallTotalTime(),callType:this.getCallType()}},type:"api"}),t.next=3,CC.getInstance().getAlert().checkSync(new vC({api:"hangup",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(F_.warn("".concat(lb,". - callStatus:").concat(this.data.callStatus," _inviterInviteID:").concat(JSON.stringify(this.data.invitation))),this.data.callStatus!==sg.IDLE){t.next=7;break}throw this._logger.error("".concat(lb,".hangup.fail"),{text:{data:{currentStatus:this.data.callStatus},error:"hangup failed. current status:"},type:"api"}),new Error("".concat(lb,".hangup failed. current status:").concat(this.data.callStatus));case 7:if(this.data.callStatus!==sg.CALLING||0!==this.getInviterInviteIdList().length){t.next=10;break}throw this._logger.error("".concat(lb,".hangup.fail"),{text:{error:"call/groupCall incomplete。please wait cancel"},type:"api"}),new Error("".concat(lb,".call/groupCall incomplete。please wait cancel"));case 10:if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserID(),o=this.generateCallTotalTime(),s=this.getCallType(),l=this.getInviterInviteIdList(),this.data.callStatus!==sg.CONNECTED){t.next=31;break}if(t.prev=17,0!==l.length){t.next=23;break}return u=this.generateCallEndData({callMediaType:s,totalTime:o}),this.TRTCCallingDelegate.onCallEnd(u),t.next=23,this._resetTUICallEngine();case 23:t.next=31;break;case 25:return t.prev=25,t.t0=t.catch(17),this._logger.error("".concat(lb,".hangup.fail"),{text:{error:t.t0},type:"api"}),t.next=30,this._resetTUICallEngine();case 30:throw new Error(t.t0);case 31:if(h=this.getHandledInviteeList(),f=this.getUnHandledInviteeList(),d=this.generateEventData(),t.prev=34,e){t.next=53;break}if(p=this.generateCallEndData(),!n){t.next=48;break}if(1!==f.length){t.next=45;break}return t.next=41,this.cancel();case 41:c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:wg.NORMAL})),t.next=46;break;case 45:this.TRTCCallingDelegate.onCallEnd(p);case 46:t.next=49;break;case 48:this.TRTCCallingDelegate.onCallEnd(p);case 49:return t.next=51,this._resetTUICallEngine();case 51:t.next=82;break;case 53:if(v=this.getCallStatus(),g={callType:this.getCallType(),isGroupCall:this.isGroupCall(),groupID:this.data.groupID,userIDList:[].concat(C(h.filter((function(t){return t!==r}))),C(f)),callEnd:this.generateCallTotalTime()},!n){t.next=73;break}if(v!==sg.CALLING){t.next=63;break}return t.next=59,this.cancel(this.getInviterInviteIdList());case 59:return c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:wg.NORMAL})),t.next=63,this._resetTUICallEngine();case 63:if(v!==sg.CONNECTED){t.next=71;break}y=a().mark((function t(){var e,n,i,o,s,u,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l[I],n=_.getInviterInviteIdUserList(e),!((i=_.getAcceptedUserList(e)).length>0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(C(o),C(s)).filter((function(t){return t!==r})),F_.warn("inviter emit hangup signal, notify userIDList:".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return F_.warn("inviter emit cancel signal, userIdList:".concat(n)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case"end":return t.stop()}}),t)})),I=0;case 66:if(!(I0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(C(o),C(s)).filter((function(t){return t!==r})),F_.warn("invitee emit hangup signal, notify userIDList:".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return F_.warn("invitee emit cancel signal, inviteID:".concat(e)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case"end":return t.stop()}}),t)})),E=0;case 75:if(!(E=3600?(r=parseInt(o/3600)<10?"0".concat(parseInt(o/3600)):parseInt(o/3600),i=parseInt(o%60/60)<10?"0".concat(parseInt(o%60/60)):parseInt(o%60/60),(a=o%3600<10?"0".concat(o%3600):o%3600)>60&&(i=parseInt(a/60)<10?"0".concat(parseInt(a/60)):parseInt(a/60),a=a%60<10?"0".concat(a%60):a%60),n="".concat(r,":").concat(i,":").concat(a)):o>=60&&o<3600?(i=parseInt(o/60)<10?"0".concat(parseInt(o/60)):parseInt(o/60),a=o%60<10?"0".concat(o%60):o%60,n="00:".concat(i,":").concat(a)):o<60&&(a=o<10?"0".concat(o):o,n="00:00:".concat(a)),n),e.data.chatTimeNum+=1,e.data.pusher.chatTime=e.data.chatTime,e.data.pusher.chatTimeNum=e.data.chatTimeNum,e.TRTCCallingDelegate.onUserUpdate({pusher:e.data.pusher,playerList:e.data.playerList})}),1e3);break;case sg.IDLE:clearInterval(this.data.timer),this.data.timer=null,this.data.chatTime="00:00:00",this.data.chatTimeNum=0}}},{key:"_resetTUICallEngine",value:(I=l(a().mark((function t(e,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,"._resetTUICallEngine.start"),{text:{data:{callEnd:e,type:n}},type:"api"}),this.changeCallStatus(sg.IDLE),F_.log(lb," _resetTUICallEngine()",this.data.enterRoomStatus),!this.data.enterRoomStatus){t.next=6;break}return t.next=6,this.exitRoom(e,n);case 6:this.data.config.type=pg.AUDIO,this._initialCallId="",this.initData();case 9:case"end":return t.stop()}}),t,this)}))),function(t,e){return I.apply(this,arguments)})},{key:"startRemoteView",value:(y=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info("".concat(lb,".startRemoteView.start"),{text:{data:{userID:e}},type:"api"}),this.data.playerList.forEach((function(t){if(t.userID===e)return t.muteVideo=!1,void F_.log("".concat(lb,", startRemoteView(").concat(e,")"))}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"stopRemoteView",value:function(t){this._logger.info("".concat(lb,".stopRemoteView.start"),{text:{data:{userID:t}},type:"api"}),this.data.playerList.forEach((function(e){if(e.userID===t)return e.muteVideo=!0,void F_.log("".concat(lb,", stopRemoteView(").concat(t,")"))}))}},{key:"openCamera",value:function(){this._logger.info("".concat(lb,".openCamera.start"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"openCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera||this._pusherVideoHandler(),F_.log("".concat(lb,", openCamera() pusher: ").concat(this.data.pusher))}},{key:"closeCamera",value:function(){this._logger.info("".concat(lb,".closeCamera.start"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"closeCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera&&this._pusherVideoHandler(),F_.log("".concat(lb,", closeCamera() pusher: ").concat(this.data.pusher))}},{key:"switchCamera",value:function(){this._logger.info("".concat(lb,".switchCamera.start"),{text:{data:{frontCamera:this.data.pusher.frontCamera}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"switchCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.getCurrentPusherInstance().switchCamera(),F_.log("".concat(lb,", switchCamera(), frontCamera").concat(this.data.pusher.frontCamera))}},{key:"openMicrophone",value:function(){this._logger.info("".concat(lb,".openMicrophone.start"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"openMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic||this._pusherAudioHandler(),F_.log("".concat(lb,", openMicrophone() pusher: ").concat(this.data.pusher))}},{key:"closeMicrophone",value:function(){this._logger.info("".concat(lb,".closeMicrophone.start"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"closeMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic&&this._pusherAudioHandler(),F_.log("".concat(lb,", closeMicrophone() pusher: ").concat(this.data.pusher))}},{key:"selectAudioPlaybackDevice",value:function(t){this._logger.info("".concat(lb,".selectAudioPlaybackDevice.start"),{text:{data:{type:t}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"selectAudioPlaybackDevice",callStatus:this.data.callStatus,attributes:{type:t},initReady:this._initReady}));var e=!1;switch(t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(e)}},{key:"setHandsFree",value:function(t){return this.data.soundMode=t?"speaker":"ear",F_.log("".concat(lb,", setHandsFree() result: ").concat(this.data.soundMode)),this.data.soundMode}},{key:"switchAudioCall",value:(g=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".switchAudioCall.start"),{type:"api"}),!this.isGroupCall()){t.next=5;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),F_.warn("".concat(lb,".switchToAudioCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.invitation.type!==pg.AUDIO){t.next=9;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"the call mode is audio call"},type:"api"}),F_.warn("".concat(lb," Now the call mode is audio call.")),t.abrupt("return");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),F_.warn("".concat(lb," audio and video call switching.")),t.abrupt("return");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Tg}));case 16:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:"switchCallMediaType",value:(v=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(lb,".closeMicrophone.start"),{text:{data:{type:e}},type:"api"}),t.next=3,CC.getInstance().getAlert().check(new vC({api:"switchCallMediaType",attributes:{type:e},callStatus:this.data.callStatus,initReady:this._initReady,sdkAppID:this.data.config.sdkAppID}));case 3:if(!this.isGroupCall()){t.next=7;break}throw this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),F_.error("".concat(lb,".switchToAudioCall is not applicable to groupCall.")),new hC(Iy.ERROR_SCENE_NOT_SUPPORTED,"".concat(lb,".switchToAudioCall is not applicable to groupCall."));case 7:if(this.data.switchCallModeStatus){t.next=11;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),F_.warn("".concat(lb," audio and video call switching.")),t.abrupt("return");case 11:t.t0=e,t.next=t.t0===pg.AUDIO?14:t.t0===pg.VIDEO?17:20;break;case 14:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Tg}));case 17:throw this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"Audio switching Video is not supported yet"},type:"api"}),F_.warn("".concat(lb," Audio switching Video is not supported yet")),new Error("".concat(lb," Audio switching Video is not supported yet"));case 20:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"setSwitchCallModeStatus",value:function(t){this.data.switchCallModeStatus=t}},{key:"switchVideoCall",value:(p=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".switchVideoCall.start"),{type:"api"}),!this.isGroupCall()){t.next=5;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),F_.warn("".concat(lb,".switchToVideoCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.invitation.type!==pg.VIDEO){t.next=9;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"Now the call mode is video call"},type:"api"}),F_.warn("".concat(lb," Now the call mode is video call.")),t.abrupt("return");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error("".concat(lb,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),F_.warn("".concat(lb," audio and video call switching.")),t.abrupt("return");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!0}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Cg}));case 16:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})},{key:"setSoundMode",value:function(t){var e=!1,n=!1;switch(t||(n=!0,t=this.data.soundMode),t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(n?!e:e)}},{key:"_hangUp",value:function(){this.hangup()}},{key:"getCurrentPusherInstance",value:function(){return this.TRTC.getPusherInstance().context=wx.createLivePusherContext(),this.TRTC.getPusherInstance()}},{key:"_pusherStateChangeHandler",value:function(t){this.TRTC.pusherEventHandler(t)}},{key:"_playerStateChange",value:function(t){this._emitter.emit(og.REMOTE_STATE_UPDATE,t)}},{key:"_playerAudioVolumeNotify",value:function(t){this.data.playerList.length>0&&this.TRTC.playerAudioVolumeNotify(t)}},{key:"_pusherAudioVolumeNotify",value:function(t){this.TRTC.pusherAudioVolumeNotify(t)}},{key:"_updateUserProfile",value:function(t,e){return 0===e.length||0===t.length?e:e.map((function(e){var n=e,r=t.filter((function(t){return t.userID===e.userID}));return n.avatar=r[0]&&r[0].avatar?r[0].avatar:"",n.nick=r[0]&&r[0].nick?r[0].nick:"",n}))}},{key:"_getUserProfile",value:function(t){var e=this;this.tim.getUserProfile({userIDList:t}).then((function(t){F_.log("getUserProfile success",t),F_.log(t.data),e.data.remoteUsers=t.data})).catch((function(t){F_.warn("getUserProfile error:",t)}))}},{key:"getUserProfile",value:(h=l(a().mark((function t(e){var n,r,i,o,s=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"array",0!==e.length){t.next=3;break}return t.abrupt("return",[]);case 3:return r=e.map((function(t){return t.userID})),t.next=6,this.tim.getUserProfile({userIDList:r});case 6:i=t.sent,o=null,t.t0=n,t.next="array"===t.t0?11:"map"===t.t0?13:16;break;case 11:return o=e.map((function(t,e){return t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,t})),t.abrupt("break",16);case 13:return o={},e.forEach((function(t,e){t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,o[t.userID]=t})),t.abrupt("break",16);case 16:return t.abrupt("return",o);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})},{key:"setSelfInfo",value:function(t,e){return this._logger.info("".concat(lb,".setSelfInfo.start"),{text:{data:{nickName:t,avatar:e}},type:"api"}),CC.getInstance().getAlert().checkSync(new vC({api:"setSelfInfo",attributes:{nickName:t,avatar:e},initReady:this._initReady})),this.tim.updateMyProfile({nick:t,avatar:e})}},{key:"deviceCheck",value:(c=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",N_(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)})},{key:"_pusherNetStatus",value:function(t){this.TRTC.pusherNetStatusHandler(t)}},{key:"_playNetStatus",value:function(t){this.TRTC.playerNetStatus(t)}},{key:"_toggleViewSize",value:function(t){var e=t.currentTarget.dataset.screen;return F_.log("get screen",e,t),1===this.data.playerList.length&&e!==this.data.screen&&this.data.invitation.type===pg.VIDEO&&(this.data.screen=e),this.data.screen}},{key:"getTim",value:function(){return this.tim}},{key:"destroyed",value:(s=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".destroyed.start"),{type:"api"}),this.getCallStatus()===sg.IDLE){t.next=4;break}return t.next=4,this.handleExceptionExit();case 4:if(this._resetTUICallEngine(),this._removeTSignalingEvent(),this._removeTRTCEvent(),this._timExternal){t.next=10;break}return t.next=10,this.logout();case 10:this._initReady=!1;case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"handleExceptionExit",value:(o=l(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(lb,".handleExceptionExit.start"),{text:{data:{callStatus:this.getCallStatus()}},type:"api"}),t.prev=1,this.getCallStatus()!==sg.CALLING){t.next=10;break}if(!this.isInviter()){t.next=8;break}return t.next=6,this.hangup();case 6:t.next=10;break;case 8:return t.next=10,this.reject();case 10:if(this.getCallStatus()!==sg.CONNECTED){t.next=13;break}return t.next=13,this.hangup();case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),this._logger.error("".concat(lb,".handleExceptionExit.fail"),{text:{data:{error:t.t0}},type:"api"});case 18:case"end":return t.stop()}}),t,this,[[1,15]])}))),function(){return o.apply(this,arguments)})},{key:"_callRecordUpload",value:function(t){var e=i(i({},t),{},{callRole:this.isInviter()?wg.INVITER:wg.INVITEE,userID:this.getUserID(),roomID:this.getRoomID(),inviteID:this.getInitialCallId()});this._callRecordReport.eventUpload(e)}},{key:"generateCallEndData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.roomId,n=t.callMediaType,r=t.callRole,i=t.totalTime,a=t.userId;return e=e||this.getRoomID(),n=n||this.getCallType(),r||(r=this.isInviter()?gg:yg),{roomID:e,callMediaType:n,callRole:r,totalTime:i=S_(i)?this.generateCallTotalTime():i,userID:a=a||this.getUserID(),callEnd:i,message:t.message||""}}},{key:"generateEventData",value:function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomID(),callRole:this.isInviter()?wg.INVITER:wg.INVITEE,callMediaType:this.getCallType()}}},{key:"setInitialCallId",value:function(t){this._initialCallId=t}},{key:"getInitialCallId",value:function(){return this._initialCallId}},{key:"getConnectStartTime",value:function(){return this.data.startTalkTime}},{key:"generateCallTotalTime",value:function(){return 0===this.getConnectStartTime()?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)}}],[{key:"createInstance",value:function(t){return ub.updateEsConfig({url:"".concat("https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report","?sdkappid=").concat(null==t?void 0:t.sdkAppID),table:"timweb-trtccalling"}),CC.getInstance().getAlert().checkSync(new vC({api:"createInstance",attributes:t})),r.instance||(r.instance=new r(t)),r.instance.initData(),r.instance}}]),r}();d(hb,"instance",null),d(hb,"AUDIO_PLAYBACK_DEVICE",bg),d(hb,"MEDIA_TYPE",pg),d(hb,"EVENT",og),d(hb,"STATUS",sg);export{bg as AUDIO_PLAYBACK_DEVICE,og as EVENT,pg as MEDIA_TYPE,sg as STATUS,hb as TUICallEngine,hb as default}; diff --git a/package-lock.json b/package-lock.json index 2f586b7..aa96b01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,23 +1,157 @@ { "name": "test_miniprogram", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "test_miniprogram", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@tencentcloud/call-uikit-wechat": "^2.1.1", + "@tencentcloud/chat-uikit-wechat": "^1.0.14", + "@vant/weapp": "^1.10.12", + "tdesign-miniprogram": "^0.34.0-beta.0" + } + }, + "node_modules/@tencentcloud/call-uikit-wechat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@tencentcloud/call-uikit-wechat/-/call-uikit-wechat-2.1.1.tgz", + "integrity": "sha512-g04uiihICVeXXg4NmUNdsSl8wVU211E0bNJKHDlMnaD+fTfcQZtewN0za68wC5uvtsHN9Eu8S2qHLIaV3g9YJg==", + "dependencies": { + "@tencentcloud/tui-core": "latest", + "tim-upload-plugin": "^1.3.0", + "tuicall-engine-wx": "latest" + } + }, + "node_modules/@tencentcloud/chat": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@tencentcloud/chat/-/chat-3.2.4.tgz", + "integrity": "sha512-EC1M5exzI3BIvAt8apAq0/sZbecCaXri6mxE4Wifvzsz7OvJldF9qetMgUcLVC/nyQMt54BIEKnB3LolSHcPTQ==" + }, + "node_modules/@tencentcloud/chat-uikit-wechat": { + "version": "1.0.14", + "resolved": "https://registry.npmmirror.com/@tencentcloud/chat-uikit-wechat/-/chat-uikit-wechat-1.0.14.tgz", + "integrity": "sha512-oAD0ZPcsj+VEnElIhmspnbaNKfrK/KDrN3QNY2csd8TVvqe5QDnkeo9W8aAoIWZGkVhZXB5iwa+pigoslRgrww==", + "dependencies": { + "@tencentcloud/call-uikit-wechat": "^1.1.3" + } + }, + "node_modules/@tencentcloud/chat-uikit-wechat/node_modules/@tencentcloud/call-uikit-wechat": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@tencentcloud/call-uikit-wechat/-/call-uikit-wechat-1.4.4.tgz", + "integrity": "sha512-ti4OtU7FhM/mJuflo2RIUiG/6UNMY8WLJ/vZp7+n1nkeyG3QeHou8HAjKqH/TEpCo1PXaNOK0pUXoWH1WejyRg==", + "dependencies": { + "tuicall-engine-wx": "^1.4.8" + } + }, + "node_modules/@tencentcloud/tui-core": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@tencentcloud/tui-core/-/tui-core-2.0.2.tgz", + "integrity": "sha512-kyMwVcUmrVU2TKeZa8r3RzPmY8MSgN2u9ihYQhsdljuFkkZ25bG7iXfUvcquRkdaVNFS4SDuKzx7hbZHzxUSog==", + "dependencies": { + "@tencentcloud/chat": "latest", + "tim-profanity-filter-plugin": "latest", + "tim-upload-plugin": "latest" + } + }, + "node_modules/@vant/weapp": { + "version": "1.10.12", + "resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.12.tgz", + "integrity": "sha512-92HtmIOdBD6gGTGhAt8/6bjPvwidgs+49/M4GhPUr9FyJ2xRUxE4d3I+zDtd+GM+v053eiuiQ6V/96DYzW/AVw==" + }, + "node_modules/dayjs": { + "version": "1.11.7", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" + }, + "node_modules/tdesign-miniprogram": { + "version": "0.34.0-beta.0", + "resolved": "https://registry.npmmirror.com/tdesign-miniprogram/-/tdesign-miniprogram-0.34.0-beta.0.tgz", + "integrity": "sha512-Pb33eN9X/2z0t0r6urhFhdPEsHFIRkq0/C7ui7AUN1kRrzUkiVWO9kmlg94Lm3pb1SHJwZZYQs566YWL77FO5Q==", + "dependencies": { + "dayjs": "^1.10.7" + } + }, + "node_modules/tim-profanity-filter-plugin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tim-profanity-filter-plugin/-/tim-profanity-filter-plugin-1.1.0.tgz", + "integrity": "sha512-+49p+n5LJs18rSPBvJFyq/m6ib8wiXvPEx2/Sz3M7hhDXAz69WuZ8cB/painNrN0MKAETf6G5cWa6xtVZfAK7A==" + }, + "node_modules/tim-upload-plugin": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/tim-upload-plugin/-/tim-upload-plugin-1.3.0.tgz", + "integrity": "sha512-meoGeB3vOs3FvtBh+ik7zlOj8C03tC6MZEkjc8BKYvgTrCzBWVDXZi9a3X8AM/YtoyuTaeLuEmaLQj1O/5luuw==" + }, + "node_modules/tim-wx-sdk": { + "version": "2.26.1", + "resolved": "https://registry.npmmirror.com/tim-wx-sdk/-/tim-wx-sdk-2.26.1.tgz", + "integrity": "sha512-z9SRDcnlqK2dnC0+LouR0jSA9QgGgrVPZ1XffLXzPTi+JnwOUCzIu2iUnuBVHnF1QI1RRLS6YaxdpmKOv58iaA==" + }, + "node_modules/trtc-wx-sdk": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/trtc-wx-sdk/-/trtc-wx-sdk-1.1.3.tgz", + "integrity": "sha512-RqK3fPCr3c8q1cHk1he3Taj82jRiNSPPofrH0Aq6SqwftrGlyuJg5hi/7QnH5knNjfH4WcSuJ/LcCYRvnnnmoA==" + }, + "node_modules/tsignaling-wx": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/tsignaling-wx/-/tsignaling-wx-1.0.3.tgz", + "integrity": "sha512-IADPsaB6S7kjiG4eDelRQAEUMzRKmn/spNeaSY+um40Q49nZ0ZhP9XoZraqg+5GWfYX/xRiusCugAEUgR2HLAw==" + }, + "node_modules/tuicall-engine-wx": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tuicall-engine-wx/-/tuicall-engine-wx-1.6.0.tgz", + "integrity": "sha512-6VbEHomPV+vgYVVjnqdZXcyoOcvi9T4jcgH/RttvvjN/3WRwLGdxb/L+yQCue7yzz9N/a1UKvdwwf7W9BQH+vg==", + "dependencies": { + "tim-wx-sdk": "latest", + "trtc-wx-sdk": "latest", + "tsignaling-wx": "latest" + } + } + }, "dependencies": { "@tencentcloud/call-uikit-wechat": { - "version": "1.3.2", - "resolved": "https://registry.npmmirror.com/@tencentcloud/call-uikit-wechat/-/call-uikit-wechat-1.3.2.tgz", - "integrity": "sha512-SbqtN89vDzddepNtIymJhzvJy5zqgrEA0yMDCJBupC4ZeiJi2BSwqXa6XAjq0jck7GSjO4g/LriUukZoM2DrOQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@tencentcloud/call-uikit-wechat/-/call-uikit-wechat-2.1.1.tgz", + "integrity": "sha512-g04uiihICVeXXg4NmUNdsSl8wVU211E0bNJKHDlMnaD+fTfcQZtewN0za68wC5uvtsHN9Eu8S2qHLIaV3g9YJg==", "requires": { - "tuicall-engine-wx": "^1.4.1" + "@tencentcloud/tui-core": "latest", + "tim-upload-plugin": "^1.3.0", + "tuicall-engine-wx": "latest" } }, + "@tencentcloud/chat": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@tencentcloud/chat/-/chat-3.2.4.tgz", + "integrity": "sha512-EC1M5exzI3BIvAt8apAq0/sZbecCaXri6mxE4Wifvzsz7OvJldF9qetMgUcLVC/nyQMt54BIEKnB3LolSHcPTQ==" + }, "@tencentcloud/chat-uikit-wechat": { "version": "1.0.14", "resolved": "https://registry.npmmirror.com/@tencentcloud/chat-uikit-wechat/-/chat-uikit-wechat-1.0.14.tgz", "integrity": "sha512-oAD0ZPcsj+VEnElIhmspnbaNKfrK/KDrN3QNY2csd8TVvqe5QDnkeo9W8aAoIWZGkVhZXB5iwa+pigoslRgrww==", "requires": { "@tencentcloud/call-uikit-wechat": "^1.1.3" + }, + "dependencies": { + "@tencentcloud/call-uikit-wechat": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@tencentcloud/call-uikit-wechat/-/call-uikit-wechat-1.4.4.tgz", + "integrity": "sha512-ti4OtU7FhM/mJuflo2RIUiG/6UNMY8WLJ/vZp7+n1nkeyG3QeHou8HAjKqH/TEpCo1PXaNOK0pUXoWH1WejyRg==", + "requires": { + "tuicall-engine-wx": "^1.4.8" + } + } + } + }, + "@tencentcloud/tui-core": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@tencentcloud/tui-core/-/tui-core-2.0.2.tgz", + "integrity": "sha512-kyMwVcUmrVU2TKeZa8r3RzPmY8MSgN2u9ihYQhsdljuFkkZ25bG7iXfUvcquRkdaVNFS4SDuKzx7hbZHzxUSog==", + "requires": { + "@tencentcloud/chat": "latest", + "tim-profanity-filter-plugin": "latest", + "tim-upload-plugin": "latest" } }, "@vant/weapp": { @@ -38,6 +172,16 @@ "dayjs": "^1.10.7" } }, + "tim-profanity-filter-plugin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tim-profanity-filter-plugin/-/tim-profanity-filter-plugin-1.1.0.tgz", + "integrity": "sha512-+49p+n5LJs18rSPBvJFyq/m6ib8wiXvPEx2/Sz3M7hhDXAz69WuZ8cB/painNrN0MKAETf6G5cWa6xtVZfAK7A==" + }, + "tim-upload-plugin": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/tim-upload-plugin/-/tim-upload-plugin-1.3.0.tgz", + "integrity": "sha512-meoGeB3vOs3FvtBh+ik7zlOj8C03tC6MZEkjc8BKYvgTrCzBWVDXZi9a3X8AM/YtoyuTaeLuEmaLQj1O/5luuw==" + }, "tim-wx-sdk": { "version": "2.26.1", "resolved": "https://registry.npmmirror.com/tim-wx-sdk/-/tim-wx-sdk-2.26.1.tgz", @@ -54,13 +198,13 @@ "integrity": "sha512-IADPsaB6S7kjiG4eDelRQAEUMzRKmn/spNeaSY+um40Q49nZ0ZhP9XoZraqg+5GWfYX/xRiusCugAEUgR2HLAw==" }, "tuicall-engine-wx": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/tuicall-engine-wx/-/tuicall-engine-wx-1.4.1.tgz", - "integrity": "sha512-Nxx9G4myPhPEaqnPpCEsxoOcEyU9evj/tssXXlZ2rRsPIxXZY914ypnU3QbQhl5kq02+jHJlLgCuFHiB9QzPGg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tuicall-engine-wx/-/tuicall-engine-wx-1.6.0.tgz", + "integrity": "sha512-6VbEHomPV+vgYVVjnqdZXcyoOcvi9T4jcgH/RttvvjN/3WRwLGdxb/L+yQCue7yzz9N/a1UKvdwwf7W9BQH+vg==", "requires": { - "tim-wx-sdk": "^2.26.1", - "trtc-wx-sdk": "^1.1.3", - "tsignaling-wx": "^1.0.3" + "tim-wx-sdk": "latest", + "trtc-wx-sdk": "latest", + "tsignaling-wx": "latest" } } } diff --git a/package.json b/package.json index 8bb1b7f..28be0f9 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "author": "", "license": "ISC", "dependencies": { + "@tencentcloud/call-uikit-wechat": "^2.1.1", "@tencentcloud/chat-uikit-wechat": "^1.0.14", "@vant/weapp": "^1.10.12", "tdesign-miniprogram": "^0.34.0-beta.0" diff --git a/project.private.config.json b/project.private.config.json index ba3a899..2f5205c 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -2,7 +2,8 @@ "projectname": "miniprogram-doctor", "setting": { "compileHotReLoad": true, - "urlCheck": true + "urlCheck": false, + "bigPackageSizeSupport": true }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "condition": {