UNPKG

@zegocloud/zego-uikit-prebuilt-uniapp-test

Version:

zegocloud prebuilt meeting rtc sdk

2 lines 1.5 MB
/*! For license information please see index.js.LICENSE.txt */ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}("undefined"!=typeof self?self:this,(()=>(()=>{var __webpack_modules__={526:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(440),t),n(r(436),t),n(r(880),t),n(r(532),t),n(r(98),t)},532:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.Language=t.ScenarioModel=void 0,function(e){e[e.SINGLE_CALL=0]="SINGLE_CALL",e[e.GROUP_CALL=1]="GROUP_CALL"}(r||(t.ScenarioModel=r={})),function(e){e.ZH="zh",e.EN="en"}(i||(t.Language=i={}))},440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallEndDescription=t.Pages=t.Naming=void 0;const i=r(880);t.Naming={CALL_ID:"callID",LOCAL_USER:"localUser",TOKEN:"token",ROOM_USER_LIST:"roomUserList",LIVE_PUSHER:"livePusher",LIVE_PLAYER:"livePlayer",CALL_STATUS:"callStatus",PREBUILT_CALL_CONFIG:"prebuiltCallConfig",LIVE_PLAYER_LIST:"livePlayerList"},t.Pages={SINGLE_CALL:"zego_uikit_prebuilt_call/src/pages/call/SingleCall"},t.CallEndDescription={[i.CallStatus.InApply]:"等待对方接听中…",[i.CallStatus.WaitCall]:"邀请您进行视频通话",[i.CallStatus.EndCall]:"本次通话时长",[i.CallStatus.CancelCall]:"您的呼叫已取消",[i.CallStatus.CancelledCall]:"对方已取消呼叫",[i.CallStatus.RefuseCall]:"呼叫邀请已被您拒绝",[i.CallStatus.RejectedCall]:"您的呼叫邀请已被拒绝",[i.CallStatus.CallTimeoutInviter]:"您的呼叫已超时",[i.CallStatus.CallTimeoutInvitee]:"您的呼叫邀请已超时",[i.CallStatus.HiddenPage]:"离开当前应用呼叫邀请和通话会被取消",[i.CallStatus.RemoteAbnormalExit]:"与您通话的用户已离开"}},98:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultZegoUIKitPrebuiltCallConfig=void 0;const i=r(532);t.DefaultZegoUIKitPrebuiltCallConfig={scenarioModel:i.ScenarioModel.SINGLE_CALL,language:i.Language.ZH,turnOnCameraWhenJoining:!0,turnOnMicrophoneWhenJoining:!0,audioVideoViewConfig:{showMicrophoneStateOnView:!0,showCameraStateOnView:!0,showUserNameOnView:!0,showSoundWavesInAudioMode:!0},bottomMenuBarConfig:{hideAutomatically:!0,buttonConfig:{toggleCameraOnImage:"",toggleCameraOffImage:"",toggleMicrophoneOnImage:"",toggleMicrophoneOffImage:"",hangUpButtonImage:"",switchCameraFrontImage:"",switchCameraBackImage:""}},zegoAvatarViewProvider:{getAvatar:e=>""}}},880:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.CallStatus=t.ConnectType=void 0,function(e){e[e.INITIAL=-1]="INITIAL",e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTED=1]="CONNECTED",e[e.CONNECTING=2]="CONNECTING"}(r||(t.ConnectType=r={})),function(e){e[e.NONE=0]="NONE",e[e.InApply=1]="InApply",e[e.WaitCall=2]="WaitCall",e[e.Calling=3]="Calling",e[e.EndCall=4]="EndCall",e[e.CancelCall=5]="CancelCall",e[e.CancelledCall=6]="CancelledCall",e[e.RefuseCall=7]="RefuseCall",e[e.RejectedCall=8]="RejectedCall",e[e.CallTimeoutInviter=9]="CallTimeoutInviter",e[e.CallTimeoutInvitee=10]="CallTimeoutInvitee",e[e.HiddenPage=11]="HiddenPage",e[e.HangUp=12]="HangUp",e[e.HangedUp=13]="HangedUp",e[e.RemoteAbnormalExit=14]="RemoteAbnormalExit"}(i||(t.CallStatus=i={}))},436:(e,t)=>{"use strict";function r(e,t){for(const i in t)t[i]instanceof Object&&i in e&&Object.assign(t[i],r(e[i],t[i]));return Object.assign({},e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.makeStreamID=function(e,t,r="main"){return`${e}_${t}_${r}`},t.mergeConfigs=function(e,t){return t?r(e,t):e}},352:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ZegoUIKitPrebuiltCall=void 0;const o=r(526),a=s(r(213)),u=s(r(439));n(r(526),t),t.ZegoUIKitPrebuiltCall=class{static init(e,t,r,i,n,s,o){return u.default.getInstance().init(e,t,r,i,n,s,o)}static joinRoom(e,t,r,i,n){const s=(0,o.mergeConfigs)(o.DefaultZegoUIKitPrebuiltCallConfig,n);this.config=s,a.default.joinRoom(i,e,{userID:t,userName:r},s)}static endCall(){}static unInit(){return u.default.getInstance().unInit()}}},426:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.ZegoCallInvitationRole=t.ZegoCallInvitationType=void 0,function(e){e[e.voiceCall=0]="voiceCall",e[e.videoCall=1]="videoCall"}(r||(t.ZegoCallInvitationType=r={})),function(e){e[e.inviter=0]="inviter",e[e.invitee=1]="invitee"}(i||(t.ZegoCallInvitationRole=i={}))},439:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(426),a=s(r(213)),u=r(998);class c{constructor(){this.defaultConfig={turnOnCameraWhenJoining:!0,turnOnMicrophoneWhenJoining:!0},this.LISTENER_ID=(0,u.makeListenerID)()}static getInstance(){return c.instance||(c.instance=new c),c.instance}init(e,t,r,i,n,s,o){return this.token=n,this.localUser={userID:r,userName:i,avatar:`https://api.multiavatar.com/${r}.svg?apikey=XqHm465NYsdLfb`,isCameraOn:!0,isMicrophoneOn:!0},this.invitationEvents=o,this.customConfig=s,(0,u.zloginfo)("init",this.customConfig),a.default.init(e,t,r,i,n,a.ZegoUIKitScenario.CALL_INTIVATION,s).then((e=>(a.default.getSignalingPlugin().addCallInvitationListener(this.LISTENER_ID,{onCallInvitationCreated:(e,t)=>{(0,u.zloginfo)("===onCallInvitationCreated",e,t)},onCallInvitationReceived:(e,t)=>{(0,u.zloginfo)("===onCallInvitationReceived",e,t);const r=JSON.parse(t),i=JSON.parse(r.data);this.type=i.type,(0,u.zloginfo)("===onCallInvitationReceived",i),c.navigateTo("/zego_uikit_prebuilt_call/src/pages/call_invitation/ZegoCallInviteePage","dataFromCallInvitation",{callID:e,caller:{userID:i.inviter.id,userName:i.inviter.name},extendedData:t}),c.getInstance().onIncomingCallReceived(e,{userID:i.inviter.id,userName:i.inviter.name},i.type,i.invitees,i.custom_data)},onCallInvitationRefused:(e,t,r)=>{(0,u.zloginfo)("===onCallInvitationRefused",e,t,r);const i=r&&JSON.parse(r);switch(null==i?void 0:i.reason){case"decline":c.getInstance().onOutgoingCallDeclined(e,t);break;case"busy":c.getInstance().onOutgoingCallRejectedCauseBusy(e,t)}c.navigateBack()},onCallInvitationTimeoutofInviter:(e,t,r)=>{(0,u.zloginfo)("===onCallInvitationTimeoutofInviter",e),c.getInstance().onOutgoingCallTimeout(e,t,r),c.navigateBack()},onCallInvitationTimeoutofInvitee:(e,t)=>{(0,u.zloginfo)("===onCallInvitationTimeoutofInvitee",e,t),c.getInstance().onIncomingCallTimeout(e,t),c.navigateBack()}}),Promise.resolve(!0)))).catch((e=>((0,u.zlogerror)(e),Promise.reject(!1))))}unInit(){a.default.getSignalingPlugin().removeCallInvitationListener(this.LISTENER_ID),a.default.unInit()}onInvitationSent(e,t,r){console.log("===oninvitation sent",t),this.type=e,c.navigateTo("/zego_uikit_prebuilt_call/src/pages/call_invitation/ZegoCallInviterPage","dataFromSendInvitation",{invitees:t,customData:r})}joinRoom(e,t){var r;this.role=t,this.config=Object.assign(Object.assign({},this.defaultConfig),this.customConfig),this.type===o.ZegoCallInvitationType.voiceCall&&(this.localUser.isCameraOn=null!==(r=this.customConfig.turnOnCameraWhenJoining)&&void 0!==r&&r,this.config.turnOnCameraWhenJoining=this.localUser.isCameraOn),(0,u.zloginfo)("joinRoom",this.config,this.customConfig,this.defaultConfig),a.default.joinRoom(e,this.token,this.localUser,this.config),c.redirectTo("/zego_uikit_prebuilt_call/src/pages/call_invitation/ZegoCallInvitationRoom")}leaveRoom(){a.default.getSignalingPlugin().endInvitation()}endInvitation(){a.default.getSignalingPlugin().zimCallID=""}onIncomingCallReceived(e,t,r,i,n){this.invitationEvents&&this.invitationEvents.onIncomingCallReceived&&this.invitationEvents.onIncomingCallReceived(e,t,r,i,n)}onIncomingCallCanceled(e,t,r){this.invitationEvents&&this.invitationEvents.onIncomingCallCanceled&&this.invitationEvents.onIncomingCallCanceled(e,t,r)}onIncomingCallTimeout(e,t){this.invitationEvents&&this.invitationEvents.onIncomingCallTimeout&&this.invitationEvents.onIncomingCallTimeout(e,t)}onIncomingCallAcceptButtonPressed(){this.invitationEvents&&this.invitationEvents.onIncomingCallAcceptButtonPressed&&this.invitationEvents.onIncomingCallAcceptButtonPressed()}onIncomingCallDeclineButtonPressed(){this.invitationEvents&&this.invitationEvents.onIncomingCallDeclineButtonPressed&&this.invitationEvents.onIncomingCallDeclineButtonPressed()}onOutgoingCallTimeout(e,t,r){this.invitationEvents&&this.invitationEvents.onOutgoingCallTimeout&&this.invitationEvents.onOutgoingCallTimeout(e,t,r)}onOutgoingCallAccepted(e,t){this.invitationEvents&&this.invitationEvents.onOutgoingCallAccepted&&this.invitationEvents.onOutgoingCallAccepted(e,t)}onOutgoingCallRejectedCauseBusy(e,t,r){this.invitationEvents&&this.invitationEvents.onOutgoingCallRejectedCauseBusy&&this.invitationEvents.onOutgoingCallRejectedCauseBusy(e,t,r)}onOutgoingCallDeclined(e,t){this.invitationEvents&&this.invitationEvents.onOutgoingCallDeclined&&this.invitationEvents.onOutgoingCallDeclined(e,t)}onOutgoingCallCancelButtonPressed(){this.invitationEvents&&this.invitationEvents.onOutgoingCallCancelButtonPressed&&this.invitationEvents.onOutgoingCallCancelButtonPressed()}static navigateTo(e,t,r){uni.navigateTo({url:e,animationType:"slide-in-top",success:e=>{t&&e.eventChannel.emit(t,Object.assign({},r))},fail:()=>{console.error("navigateTo fail!")},complete:()=>{}})}static navigateBack(){uni.navigateBack({success:()=>{},fail:()=>{console.error("$navigateBack fail!")},complete:()=>{}})}static redirectTo(e,t,r){uni.redirectTo({url:e,animationType:"slide-in-top",success:e=>{t&&e.eventChannel.emit(t,Object.assign({},r))},fail:()=>{console.error("redirectTo fail!")},complete:()=>{}})}}t.default=c},998:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.makeListenerID=function(){return`listener_${Date.now()}_${s++}`},t.convertToCamelCase=function(e){if("object"==typeof e)return e.map((e=>{for(const t in e)t.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")));const t=Object.keys(e);return t.map((e=>e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))))),console.log("===keys",t),e}))},n(r(944),t);let s=0},944:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zlogerror=t.zlogwarning=t.zloginfo=void 0;const r="ZEGOUIKitPrebuiltCall";t.zloginfo=(...e)=>{console.log(`${r}[INFO]: `,...e)},t.zlogwarning=(...e)=>{console.warn(`${r}[WARN]: `,...e)},t.zlogerror=(...e)=>{console.error(`${r}[ERROR]: `,...e)}},213:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=s(r(378));t.default=class{static init(e,t,r,i,n,s,a){return o.default.getInstance().init(e,t,r,i,n,s,a)}static unInit(){return o.default.getInstance().unInit()}static authCheck(){return o.default.getInstance().authCheck()}static joinRoom(e,t,r,i){return o.default.getInstance().joinRoom(e,t,r,i)}static isLocalUser(e){return o.default.getInstance().isLocalUser(e)}static updatePlayerState(e,t){return o.default.getInstance().express.updatePlayerState(e,t)}static updatePlayerNetStatus(e,t){return o.default.getInstance().express.updatePlayerNetStatus(e,t)}static updateAudioVolumeNotify(e,t){return o.default.getInstance().express.updateAudioVolumeNotify(e,t)}static getLocalUser(){return o.default.getInstance().getLocalUser()}static setStreamExtraInfo(e,t){return o.default.getInstance().express.setStreamExtraInfo(e,t)}static updateUser(e){return o.default.getInstance().updateUser(e)}static logoutRoom(){return o.default.getInstance().logoutRoom()}static getSignalingPlugin(){return o.default.getInstance().invitationService}static addUIKitListener(e,t){return o.default.getInstance().addUIKitListener(e,t)}static removeUIKitListener(e){return o.default.getInstance().removeUIKitListener(e)}},n(r(445),t)},445:(e,t)=>{"use strict";var r,i,n,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Language=t.ZegoUIKitScenario=t.ScenarioModel=t.CallStatus=void 0,function(e){e[e.NONE=0]="NONE",e[e.InApply=1]="InApply",e[e.WaitCall=2]="WaitCall",e[e.Calling=3]="Calling",e[e.EndCall=4]="EndCall",e[e.CancelCall=5]="CancelCall",e[e.CancelledCall=6]="CancelledCall",e[e.RefuseCall=7]="RefuseCall",e[e.RejectedCall=8]="RejectedCall",e[e.CallTimeoutInviter=9]="CallTimeoutInviter",e[e.CallTimeoutInvitee=10]="CallTimeoutInvitee",e[e.HiddenPage=11]="HiddenPage",e[e.HangUp=12]="HangUp",e[e.HangedUp=13]="HangedUp",e[e.RemoteAbnormalExit=14]="RemoteAbnormalExit"}(r||(t.CallStatus=r={})),function(e){e[e.SINGLE_CALL=0]="SINGLE_CALL",e[e.GROUP_CALL=1]="GROUP_CALL"}(i||(t.ScenarioModel=i={})),function(e){e[e.SINGLE_CALL=0]="SINGLE_CALL",e[e.GROUP_CALL=1]="GROUP_CALL",e[e.CALL_INTIVATION=2]="CALL_INTIVATION"}(n||(t.ZegoUIKitScenario=n={})),function(e){e.ZH="zh",e.EN="en"}(s||(t.Language=s={}))},154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotifyList=void 0,t.NotifyList=class{constructor(){this.listeners=[]}addListener(e,t){this.listeners.push({key:e,data:t})}removeListener(e){this.listeners=this.listeners.filter((t=>t.key!==e))}notifyAllListener(e){this.listeners.forEach((t=>{e(t.data)}))}clear(){this.listeners=[]}}},378:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(105),o=r(99),a=r(175),u=r(445),c=n(r(509)),l=r(154);class d{constructor(){this.mode=u.ZegoUIKitScenario.SINGLE_CALL,this.userList=[],this.uikitListeners=new l.NotifyList,this.initEventHandler={roomStreamUpdate(e,t,r){return i(this,void 0,void 0,(function*(){(0,o.zlogwarning)("roomStreamUpdate",e,t,r);const n=d.getInstance().userList;if("ADD"===t)try{(0,o.zlogwarning)("roomStreamUpdate",n),r.forEach((e=>i(this,void 0,void 0,(function*(){const t=JSON.parse(e.extraInfo);(0,o.zlogwarning)("roomStreamUpdate 流新增用户在用户列表里",n);const i=yield(0,a.startPlay)(e.streamID);if(i){const s=n.filter((e=>e.userID===r[0].user.userID))[0];if(s)s.isCameraOn=t.isCameraOn,s.isMicrophoneOn=t.isMicrophoneOn,s.streamConfig=i,s.mainStreamID=e.streamID,d.getInstance().updateUser(s);else{const r={userID:e.user.userID,userName:e.user.userName,isCameraOn:t.isCameraOn,isMicrophoneOn:t.isMicrophoneOn,streamConfig:i,mainStreamID:e.streamID};d.getInstance().userJoin(r)}}}))))}catch(e){return void(0,o.zlogerror)("roomStreamUpdate add error",e)}else try{r.forEach((e=>i(this,void 0,void 0,(function*(){n.some((t=>t.userID===e.user.userID))&&((0,a.stopPlay)(e.streamID),d.getInstance().userLeave(e.user))}))))}catch(e){return void(0,o.zlogerror)("roomStreamUpdate delete error",e)}}))},streamExtraInfoUpdate(e,t){(0,o.zloginfo)("streamExtraInfoUpdate streamList: ",t,t[0].extraInfo);const r=JSON.parse(t[0].extraInfo),i=d.getInstance().userList,n=i.filter((e=>e.userID===t[0].user.userID))[0];(0,o.zloginfo)("streamExtraInfoUpdate user: ",n,i),n&&(n.isCameraOn=r.isCameraOn,n.isMicrophoneOn=r.isMicrophoneOn),d.getInstance().updateUser(n)},roomUserUpdate(e,t,r){(0,o.zlogwarning)("roomUserUpdate, roomID: ",e,t,r),"DELETE"===t?r.forEach((e=>{d.getInstance().userLeave(e)})):"ADD"===t&&r.forEach((e=>{d.getInstance().userJoin(e)}))},roomStateUpdate(e,t,r,i){(0,o.zlogwarning)("roomStateUpdate",e,t,r,i)},roomStateChanged(e,t,r,i){(0,o.zlogwarning)("roomStateChanged",e,t,r,i)},tokenWillExpire(e){(0,o.zlogerror)("tokenWillExpire",e)},remoteCameraStatusUpdate(e){(0,o.zlogerror)("remoteCameraStatusUpdate",e)}}}static getInstance(){return d.instance||(d.instance=new d),d.instance}static get runtime(){return uni}init(e,t,r,n,l,h,p){return i(this,void 0,void 0,(function*(){return(0,o.zloginfo)(`new instance of ZegoExpressService, appID=${e}, server=${t}, mode=${h}`),this.mode=h,d.getInstance().express=new s.ZegoExpressEngine(e,t),(0,o.zloginfo)("version",d.getInstance().express.getVersion(),d.getInstance().express),d.getInstance().express.setDebugVerbose(!1),d.getInstance().express.setLogConfig({logLevel:"warn"}),(0,a.bindEventListeners)(this.initEventHandler),h===u.ZegoUIKitScenario.CALL_INTIVATION?(yield c.default.getInstance().initZIM(e,r,n,l))?(this.invitationService=c.default.getInstance(),Promise.resolve(!0)):Promise.reject(!1):Promise.resolve(!0)}))}unInit(){this.mode===u.ZegoUIKitScenario.CALL_INTIVATION&&c.default.getInstance().unInitZIM()}static createLivePusherContext(){return d.runtime.createLivePusherContext()}static createLivePlayerContext(e){return d.runtime.createLivePlayerContext(e)}authCheck(){return i(this,void 0,void 0,(function*(){let e;try{e=yield d.getInstance().express.checkSystemRequirements()}catch(e){return(0,o.zlogerror)("authCheck",e),d.runtime.showModal({title:"提示",content:"检查权限出现错误,无法使用该功能,请联系技术支持寻求帮助。",showCancel:!1}),!1}return(0,o.zloginfo)("checkSystemRequirements",e),new Promise((t=>{if(e&&10001===e.code)(0,o.zloginfo)("result ",e.code),d.runtime.showModal({title:"提示",content:"当前微信版本过低,无法使用该功能,请升级到最新微信版本后再试。",showCancel:!1}),t(!1);else if(e&&10002!==e.code)t(!0);else{(0,o.zloginfo)("result ",e&&e.code);const r=d.runtime.authorize({scope:"scope.camera",success:()=>((0,o.zloginfo)("authorize camera success"),!0),fail:e=>((0,o.zloginfo)("授权摄像头失败:",e),!1)}),i=d.runtime.authorize({scope:"scope.record",success:()=>((0,o.zloginfo)("authorize record success"),!0),fail:e=>((0,o.zloginfo)("获取麦克风失败:",e),!1)});t(!(!r||!i))}}))}))}joinRoom(e,t,r,n){return i(this,void 0,void 0,(function*(){(0,o.zloginfo)("uikit core join room",e,t,r,n),(0,o.zloginfo)("joinroom userlist",this.userList),this.roomID=e;const i=yield d.getInstance().express.loginRoom(e,t,r,{userUpdate:!0,maxMemberCount:0});if((0,o.zloginfo)("express login room",i),i)try{const t=`${e}_${r.userID}_main`,i={extraInfo:JSON.stringify({isCameraOn:n.turnOnCameraWhenJoining,isMicrophoneOn:n.turnOnMicrophoneWhenJoining,hasVideo:!0,hasAudio:!0})},s=yield(0,a.startPush)(t,i);this.localUser={userID:r.userID,userName:r.userName,isCameraOn:n.turnOnCameraWhenJoining,isMicrophoneOn:n.turnOnMicrophoneWhenJoining,streamConfig:s},this.userJoin(this.localUser),d.getInstance().uikitListeners.notifyAllListener((e=>{var t;null===(t=e.onLocalUserUpdated)||void 0===t||t.call(e,this.localUser)}))}catch(e){console.log("===err",e)}return i}))}userJoin(e){this.containsUser(e.userID)||(console.warn("===user join",e),this.userList.push(e),d.getInstance().uikitListeners.notifyAllListener((e=>{var t;null===(t=e.onUserListUpdated)||void 0===t||t.call(e,this.userList)})))}updateUser(e){this.userList.map((t=>{t.userID===e.userID&&(console.warn("===update user 存在相同userid"),t=Object.assign({},e))})),console.warn("===update user userlist",this.userList),d.getInstance().uikitListeners.notifyAllListener((e=>{var t;null===(t=e.onUserListUpdated)||void 0===t||t.call(e,this.userList)}))}containsUser(e){return(0,o.zloginfo)("containsUser",this.userList),this.userList.some((t=>t.userID===e))}userLeave(e){this.userList=this.userList.filter((t=>t.userID!==e.userID)),d.getInstance().uikitListeners.notifyAllListener((t=>{var r,i;null===(r=t.onUserListUpdated)||void 0===r||r.call(t,this.userList),null===(i=t.onUserLeaved)||void 0===i||i.call(t,e)}))}isLocalUser(e){var t;return console.log("===islocaluser",e,null===(t=this.localUser)||void 0===t?void 0:t.userID),null!=this.localUser&&e===this.localUser.userID}getLocalUser(){return this.localUser}logoutRoom(){var e,t;return(0,o.zlogwarning)("logoutRoom",this.localUser),null===(e=this.localUser)||void 0===e||e.streamConfig.pusherContext.stop(),(0,a.stopPush)(null===(t=this.localUser)||void 0===t?void 0:t.streamConfig.streamID),this.userList=[],d.getInstance().express.logoutRoom(this.roomID)}addUIKitListener(e,t){this.uikitListeners.addListener(e,t)}removeUIKitListener(e){this.uikitListeners.removeListener(e)}}t.default=d},175:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.startPush=function(e,t){return i(this,void 0,void 0,(function*(){try{const{url:r}=yield o.default.getInstance().express.startPublishingStream(e,t);(0,s.zloginfo)("startPush for pushStreamID=",e," url=",r);const i=o.default.createLivePusherContext();return i.start(),{mode:"RTC",autopush:!0,minBitrate:800,maxBitrate:1500,videoAspect:"3:4",enableAutoFocus:!1,url:r,streamID:e,pusherContext:i}}catch(e){return(0,s.zlogerror)("error",e),!1}}))},t.stopPush=function(e){o.default.getInstance().express.stopPublishingStream(e)},t.startPlay=function(e){return i(this,void 0,void 0,(function*(){try{return(0,s.zloginfo)("startPlay1 streamID=",e),o.default.getInstance().express.startPlayingStream(e,{sourceType:"BGP"}).then((({url:t})=>{(0,s.zloginfo)("startPlay2 streamID=",e,"url=",t);const r=o.default.createLivePlayerContext(e),i={mode:"RTC",autoplay:!0,url:t,streamID:e,playerContext:r,objectFit:"fillCrop",muteAudio:!1,enableMetadata:!0};return Promise.resolve(i)})).catch((e=>((0,s.zlogerror)("startPlayingStream error",e),Promise.reject(!1))))}catch(e){return(0,s.zlogerror)("error",e),!1}}))},t.stopPlay=function(e){return o.default.getInstance().express.stopPlayingStream(e),!0},t.bindEventListeners=function(e){for(let t of Object.keys(e)){const r=t;o.default.getInstance().express.on(r,e[r])}},t.unbindEventListeners=function(e){for(let t of Object.keys(e)){const r=t;o.default.getInstance().express.off(r,e[r])}};const s=r(99),o=n(r(378))},509:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),s=r(99),o=r(154);class a{constructor(){this.invitationListeners=new o.NotifyList,this.zimEventListeners={error(e,t){(0,s.zlogwarning)("zim error",e,t)},tokenWillExpire(e,t){(0,s.zlogwarning)("zim tokenWillExpire",e,t)},callUserStateChanged(e,t){(0,s.zlogwarning)("zim callUserStateChanged",e,t,a.getInstance().zimCallID);const{callID:r,callUserList:i}=t;r===a.getInstance().zimCallID&&i.forEach((e=>{const{extendedData:t,state:r,userID:i}=e;if(i!==a.getInstance().userID)switch(r){case 1:(0,s.zloginfo)("zim state1"),a.getInstance().zimCallID&&a.getInstance().invitationListeners.notifyAllListener((e=>{var t;null===(t=e.onCallInvitationAccepted)||void 0===t||t.call(e,a.getInstance().zrtcRoomID,i)}));break;case 2:(0,s.zloginfo)("zim state2"),a.getInstance().zimCallID&&(a.getInstance().invitationListeners.notifyAllListener((e=>{var r;null===(r=e.onCallInvitationRefused)||void 0===r||r.call(e,a.getInstance().zrtcRoomID,i,t)})),a.getInstance().zimCallID="",a.getInstance().zrtcRoomID="");break;case 3:break;case 6:a.getInstance().zimCallID&&(a.getInstance().invitationListeners.notifyAllListener((e=>{var r;null===(r=e.onCallInvitationTimeoutofInviter)||void 0===r||r.call(e,a.getInstance().zrtcRoomID,i,t)})),a.getInstance().zimCallID="",a.getInstance().zrtcRoomID="");break;default:(0,s.zloginfo)("invitee state",i,r,t)}}))},callInvitationCreated(e,t){(0,s.zlogwarning)("zim callInvitationCreated",t,a.getInstance().zimCallID);const{callID:r,extendedData:i}=t;a.getInstance().zimCallID},callInvitationReceived(e,t){(0,s.zlogwarning)("zim callInvitationReceived",e,t.callID,t.inviter,t.extendedData),(0,s.zlogwarning)("zim received",a.getInstance().zimCallID);const{callID:r,inviter:i,extendedData:n}=t;if(a.getInstance().zimCallID){if(r!==a.getInstance().zimCallID){const e={reson:"busy"};a.getInstance().refuseInvitation(r,JSON.stringify(e))}}else{const e=JSON.parse(n),t=JSON.parse(e.data);(0,s.zlogwarning)("zim callInvitationReceived",t),a.getInstance().zrtcRoomID=t.call_id,a.getInstance().zimCallID=r,a.getInstance().caller={userID:t.inviter.id,userName:t.inviter.name},a.getInstance().invitationListeners.notifyAllListener((e=>{var t;null===(t=e.onCallInvitationReceived)||void 0===t||t.call(e,a.getInstance().zrtcRoomID,n)}))}},callInvitationCancelled(e,t){(0,s.zlogwarning)("zim callInvitationCancelled",e,t);const{callID:r,mode:i,inviter:n,extendedData:o}=t;r===a.getInstance().zimCallID&&(a.getInstance().zimCallID="",a.getInstance().invitationListeners.notifyAllListener((e=>{var t;null===(t=e.onCallInvitationCancelled)||void 0===t||t.call(e,a.getInstance().zrtcRoomID,o)})))},callInvitationTimeout(e,t){(0,s.zlogwarning)("zim callInvitationTimeout",e,t);const{callID:r,mode:i}=t;r===a.getInstance().zimCallID&&(a.getInstance().zimCallID="",a.getInstance().invitationListeners.notifyAllListener((e=>{var t;null===(t=e.onCallInvitationTimeoutofInvitee)||void 0===t||t.call(e,a.getInstance().zrtcRoomID,a.getInstance().caller)})))}}}static getInstance(){return a.instance||(a.instance=new a),a.instance}initZIM(e,t,r,o){return i(this,void 0,void 0,(function*(){return(0,s.zlogwarning)("init zim",this.zrtcRoomID,this.zim,this.zimCallID,this.userID,this.userName,this.token,this.caller),this.zim?((0,s.zlogwarning)("已存在 zim 实例"),!1):(n.ZIM.create({appID:e}),this.zim=n.ZIM.getInstance(),this.bindEventListeners(this.zimEventListeners),this.userID=t,this.userName=r,this.token=o,this.login())}))}unInitZIM(){return i(this,void 0,void 0,(function*(){(0,s.zlogwarning)("uninit zim"),yield this.zim.logout(),this.userID="",this.userName="",this.token="",this.zim.destroy(),this.zim=null,this.zrtcRoomID="",this.zimCallID="",this.caller={}}))}login(){return i(this,arguments,void 0,(function*(e=1){if(!(e>4))return this.zim.login(this.userID,{userName:this.userName,token:this.token,isOfflineLogin:!1}).then((()=>((0,s.zloginfo)(`登录zim成功,userID: ${this.userID}`),this.zim.uploadLog(),Promise.resolve(!0)))).catch((t=>((0,s.zloginfo)(`登录zim失败!! userID1: ${this.userID}`),setTimeout((()=>{this.login(++e)}),2e3*e),Promise.reject(!1))));(0,s.zlogerror)("登录zim失败!!, 重试次数:",e)}))}logout(){return this.zim.logout()}bindEventListeners(e){for(let t of Object.keys(e)){const r=t;this.zim.on(r,e[r])}}sendInvitation(e,t,r,i=60,n){if((0,s.zloginfo)("===sendInvitation()",e,t,r,i,n),!e.length)return Promise.reject({code:100001,message:"invitee 为空!"});if(e.length>1)return Promise.reject({code:100003,message:"暂不支持呼叫多人"});if(this.zimCallID)return Promise.reject({code:100002,message:"已有呼叫邀请"});const o=e.map((e=>e.userID));this.zrtcRoomID=n||`call_${this.userID}_${(new Date).getTime()}`;const a={call_id:this.zrtcRoomID,invitees:e.map((e=>({user_id:e.userID,user_name:e.userName}))),inviter:{id:this.userID,name:this.userName},type:t,custom_data:r},u={inviter_name:this.userName,type:t,data:JSON.stringify(a)},c={mode:0,timeout:i,extendedData:JSON.stringify(u),enableNotReceivedCheck:!1};return(0,s.zloginfo)("zim callInvite()",o,c),this.zim.callInvite(o,c).then((({callID:t,timeout:i,errorUserList:n})=>((0,s.zloginfo)(`发起呼叫邀请成功, callID: ${t}, invitees: ${e}, errorUserList: ${n}`),this.zimCallID=t,Promise.resolve({code:0,callID:this.zrtcRoomID,timeout:i,errorUserList:n,customData:r})))).catch((t=>((0,s.zloginfo)(`发起呼叫邀请失败!! invitees: ${e}, err:`,t),Promise.reject({code:t.code||100003,message:t.message||"zim 呼叫邀请失败!"}))))}cancelInvitation(e,t){return(0,s.zloginfo)("取消呼叫邀请",this.zimCallID,e,t),this.zim.callCancel(e,this.zimCallID,{extendedData:t}).then((t=>((0,s.zloginfo)(`取消呼叫邀请成功, res:${t}, callID: ${this.zimCallID}, inviteesIDList: ${e}`),this.endInvitation(),Promise.resolve({code:0})))).catch((t=>((0,s.zlogerror)(`取消呼叫邀请失败, err:${t}, callID: ${this.zimCallID}, inviteesIDList: ${e}`,t),Promise.reject({code:t.code||100004,message:t.message||"取消呼叫邀请失败"}))))}acceptInvitation(e,t){return this.zim.callAccept(this.zimCallID,{extendedData:t}).then((e=>((0,s.zloginfo)("接受呼叫邀请成功",e),Promise.resolve({callID:this.zrtcRoomID})))).catch((e=>((0,s.zlogerror)("接受呼叫邀请失败",e),Promise.reject({code:e.code||100005,message:e.message||"接受呼叫邀请失败!"}))))}refuseInvitation(e,t){return this.zim.callReject(e||this.zimCallID,{extendedData:t||JSON.stringify({reason:"decline"})}).then((t=>((0,s.zloginfo)(`拒绝呼叫邀请成功, res:${t}, callID: ${this.zimCallID}`),!e&&(this.zimCallID=""),Promise.resolve({callID:this.zrtcRoomID})))).catch((e=>((0,s.zlogerror)(`拒绝呼叫邀请失败, err:${e}, callID: ${this.zimCallID}`),Promise.reject({code:e.code||100006,message:e.message||"拒绝呼叫邀请失败"}))))}endInvitation(){this.zimCallID="",this.zrtcRoomID=""}addCallInvitationListener(e,t){this.invitationListeners.addListener(e,t)}removeCallInvitationListener(e){this.invitationListeners.removeListener(e)}}t.default=a},99:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zlogerror=t.zlogwarning=t.zloginfo=void 0;const r="ZEGOUIKit";t.zloginfo=(...e)=>{console.log(`${r}[INFO]: `,...e)},t.zlogwarning=(...e)=>{console.warn(`${r}[WARN]: `,...e)},t.zlogerror=(...e)=>{console.error(`${r}[ERROR]: `,...e)}},105:function(module){var i;"undefined"!=typeof self&&self,i=function(){return(()=>{var __webpack_modules__={537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),i=0,n=2,s=!0;n<arguments.length;)r[i++]=arguments[n++];return new Promise((function(n,o){r[i]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){s&&(s=!1,o(e))}}))}},419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),n=new Array(123),s=0;s<64;)n[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var n,s=null,o=[],a=0,u=0;t<r;){var c=e[t++];switch(u){case 0:o[a++]=i[c>>2],n=(3&c)<<4,u=1;break;case 1:o[a++]=i[n|c>>4],n=(15&c)<<2,u=2;break;case 2:o[a++]=i[n|c>>6],o[a++]=i[63&c],u=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return u&&(o[a++]=i[n],o[a++]=61,1===u&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";r.decode=function(e,t,r){for(var i,s=r,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=n[c]))throw Error(o);switch(a){case 0:i=c,a=1;break;case 1:t[r++]=i<<2|(48&c)>>4,i=c,a=2;break;case 2:t[r++]=(15&i)<<4|(60&c)>>2,i=c,a=3;break;case 3:t[r++]=(3&i)<<6|c,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function s(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function a(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:s,e.writeFloatBE=i?s:n,e.readFloatLE=i?o:a,e.readFloatBE=i?a:o}():function(){function t(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(t)/Math.LN2);e((n<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,i)}}function o(e,t,r){var i=e(t,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i),e.readFloatLE=o.bind(null,n),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function a(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:s,e.writeDoubleBE=i?s:n,e.readDoubleLE=i?o:a,e.readDoubleBE=i?a:o}():function(){function t(e,t,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)e(0,n,s+t),e(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))e(0,n,s+t),e(2146959360,n,s+r);else if(i>17976931348623157e292)e(0,n,s+t),e((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,n,s+t),e((o<<31|a/4294967296)>>>0,n,s+r);else{var u=Math.floor(Math.log(i)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=i*Math.pow(2,-u))>>>0,n,s+t),e((o<<31|u+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function o(e,t,r,i,n){var s=e(i,n+t),o=e(i,n+r),a=2*(o>>31)+1,u=o>>>20&2047,c=4294967296*(1048575&o)+s;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=o.bind(null,n,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function i(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},662:e=>{"use strict";e.exports=function(e,t,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(r){if(r<1||r>n)return e(r);o+r>i&&(s=e(i),o=0);var a=t.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,s=[],o=0;t<r;)(i=e[t++])<128?s[o++]=i:i>191&&i<224?s[o++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,r){for(var i,n,s=r,o=0;o<e.length;++o)(i=e.charCodeAt(o))<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(o+1)))?(++o,t[r++]=(i=65536+((1023&i)<<10)+(1023&n))>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-s}},100:(e,t,r)=>{"use strict";e.exports=r(482)},482:(e,t,r)=>{"use strict";var i=t;function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=r(173),i.BufferWriter=r(155),i.Reader=r(408),i.BufferReader=r(593),i.util=r(693),i.rpc=r(994),i.roots=r(54),i.configure=n,n()},408:(e,t,r)=>{"use strict";e.exports=u;var i,n=r(693),s=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},d=function(){return n.Buffer?function(e){return(u.create=function(e){return n.Buffer.isBuffer(e)?new i(e):l(e)})(e)}:l};function h(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}u.create=d(),u.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){i=e,u.create=d(),i._configure();var t=n.Long?"toLong":"toNumber";n.merge(u.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=s;var i=r(408);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(693);function s(e){i.call(this,e)}s._configure=function(){n.Buffer&&(s.prototype._slice=n.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},54:e=>{"use strict";e.exports={}},994:(e,t,r)=>{"use strict";t.Service=r(948)},948:(e,t,r)=>{"use strict";e.exports=n;var i=r(693);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return i.asPromise(e,a,t,r,n,s);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,r){if(e)return a.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",r,t),o(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},630:(e,t,r)=>{"use strict";e.exports=n;var i=r(693);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=n.zero=new n(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(i.isString(e)){if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):s},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?s:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},693:function(e,t,r){"use strict";var i=t;function n(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)void 0!==e[i[n]]&&r||(e[i[n]]=t[i[n]]);return e}function s(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}i.asPromise=r(537),i.base64=r(419),i.EventEmitter=r(211),i.float=r(945),i.inquire=r(199),i.utf8=r(997),i.pool=r(662),i.LongBits=r(630),i.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),i.global=i.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return"string"==typeof e||e instanceof String},i.isObject=function(e){return e&&"object"==typeof e},i.isset=i.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=n,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=s,i.ProtocolError=s("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&null!=this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var e=i.Buffer;e?(i._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},i._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):i._Buffer_from=i._Buffer_allocUnsafe=null}},173:(e,t,r)=>{"use strict";e.exports=d;var i,n=r(693),s=n.LongBits,o=n.base64,a=n.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var h=function(){return n.Buffer?function(){return(d.create=function(){return new i})()}:function(){return new d}};function p(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=h(),d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},(f.prototype=Object.create(u.prototype)).fn=function(e,t,r){for(;e