@realsee/live 0.5.4-alpha.1 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/realsee-live.cjs.development.js +9 -6
- package/dist/realsee-live.cjs.development.js.map +1 -1
- package/dist/realsee-live.cjs.production.js +1 -1
- package/dist/realsee-live.cjs.production.js.map +1 -1
- package/dist/realsee-live.esm.js +9 -6
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +712 -527
- package/dist/realsee-live.umd.development.js.map +1 -1
- package/dist/realsee-live.umd.production.js +1 -1
- package/dist/realsee-live.umd.production.js.map +1 -1
- package/docs/classes/BrowserRTC4Chime.html +5 -5
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("trtc-js-sdk"),t=require("amazon-chime-sdk-js"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),i=r(n),s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((r=r.apply(e,t||[])).next())}))}function l(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function d(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var f=Symbol("$$REALSEE_LIVE_EVENT$$");function h(e){return e[f]||(e[f]={}),e[f]}var p,v,m=function(){function e(){}return e.prototype.hasListener=function(e){var t=h(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,n){var r=this,o=h(this);return o[e]||(o[e]=[]),o[e].push([t,n||!1]),function(){return r.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var n,r=h(this);if(r[e]||(r[e]=[]),void 0!==t){for(var o=0;o<r[e].length&&r[e][o][0]!==t;o++);o<r[e].length&&r[e].splice(o,1)}else r[e].length=0}else(n=this)[f]||delete n[f]},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=!1,o=h(this),i=o[e]||[],s=0,c=i.slice();s<c.length;s++){var a=c[s],u=a[0],l=a[1],d=void 0!==l&&l,f=u.apply(void 0,t);d&&this.off(e,u),!1===f&&(r=!0)}return r},e}(),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t}(m);exports.RTCType=void 0,(p=exports.RTCType||(exports.RTCType={})).RealseeBrowserRTC="RealseeBrowserRTC",p.RealseeVRWebViewRTC="RealseeVRWebViewRTC",p.RealseeBrowserChimeRTC="RealseeBrowserChimeRTC",exports.BuiltInRTCType=void 0,(v=exports.BuiltInRTCType||(exports.BuiltInRTCType={})).RealseeXTRTC="trtc",v.RealseeXChimeRTC="chime";var _;!function(e){e.info="INFO",e.log="LOG",e.error="ERROR",e.warn="WARN"}(_||(_={}));var b=function(e,t){var n,r,o,i,s,c,a,u;switch(void 0===t&&(t=[]),t.unshift("Realsee Live ".concat((n=new Date,r=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0"),i=n.getDate().toString().padStart(2,"0"),s=n.getHours().toString().padStart(2,"0"),c=n.getMinutes().toString().padStart(2,"0"),a=n.getSeconds().toString().padStart(2,"0"),u=n.getMilliseconds(),"[".concat(r,"-").concat(o,"-").concat(i," ").concat(s,":").concat(c,":").concat(a,".").concat(u,"]"))," <").concat(e,"> ")),e){case _.info:return console.info.apply(console,t);case _.error:return console.error.apply(console,t);case _.warn:return console.warn.apply(console,t);default:return console.log.apply(console,t)}},y={log:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.log,e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.info,e)},error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.error,e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.warn,e)}};function w(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function S(){return(w()+w()+"-"+w()+"-4"+w().substr(0,3)+"-"+w()+"-"+w()+w()+w()).toLowerCase()}var k,E=function(e){function t(t){var n=e.call(this)||this;return n.type=exports.RTCType.RealseeBrowserRTC,n.joined=!1,n.micro=!1,n.voiceId="",n._getVoiceSign=function(){throw new Error("方法 getVoiceSign 未实现")},n.checkRequirement=function(){return o.default.checkSystemRequirements()},n.$dom=document.createElement("div"),n._trtc={client:null,stream:null},n.join=function(e){return u(n,void 0,void 0,(function(){var t,n,r,i=this;return l(this,(function(s){switch(s.label){case 0:return this.emit("joinWillStart"),[4,this._getVoiceSign({voiceId:e.voiceId,roomId:e.roomId,userId:e.userId})];case 1:return t=s.sent(),this._trtc.client=o.default.createClient(a(a({mode:"rtc"},t),{enableAutoPlayDialog:"function"!=typeof this._autoPlayConfirm})),null===(r=this._trtc.client)||void 0===r||r.enableAudioVolumeEvaluation(),this._registerRtcEvent(),[4,new Promise((function(t){var n;null===(n=i._trtc.client)||void 0===n||n.join({roomId:Number(e.voiceId)}).then((function(){return t(!0)})).catch((function(){return t(!1)}))}))];case 2:return n=s.sent(),this.joined=n,n?(this._trtc.stream=o.default.createStream({userId:t.userId,audio:!0,video:!1}),[4,new Promise((function(e){var t;null===(t=i._trtc.stream)||void 0===t||t.initialize().then((function(){return e(!0)})).catch((function(){return e(!1)}))}))]):[2,!1];case 3:return n=s.sent(),[4,new Promise((function(e){var t;null===(t=i._trtc.client)||void 0===t||t.publish(i._trtc.stream).then((function(){return e(!0)})).catch((function(){return e(!1)}))}))];case 4:return n=s.sent(),this.joined=n,this.joined&&this.emit("joined"),[2,n]}}))}))},n._handleStreamAdded=function(e){var t,r=e.stream;console.log("远端流增加: "+r.getId()),null===(t=n._trtc.client)||void 0===t||t.subscribe(r)},n._handleStreamSubscribed=function(e){var t=e.stream;console.log("远端流订阅成功:"+t.getId());var r=t.getId(),o="rs-rtc-remote_stream-".concat(r),i=document.createElement("div");i.id=o,n.$dom.appendChild(i),"function"==typeof n._autoPlayConfirm?(t.play(o).catch((function(e){})),t.on("error",(function(e){if(16451===e.getCode()){n._autoPlayConfirm({onConfirm:function(){return t.resume()}})}}))):t.play(o)},n._getVoiceSign=t.getVoiceSign,n._autoPlayConfirm=t.autoPlayConfirm,n._initParentDom(),n}return c(t,e),t.prototype._initParentDom=function(){this.$dom.id="rs-rtc-".concat(S()),this.$dom.style.display="none",document.body.appendChild(this.$dom)},t.prototype.quit=function(){var e=this;return new Promise((function(t){return u(e,void 0,void 0,(function(){var e,n,r=this;return l(this,(function(o){switch(o.label){case 0:return this.joined=!1,this._trtc.stream?[4,null===(e=this._trtc.client)||void 0===e?void 0:e.unpublish(this._trtc.stream)]:[3,2];case 1:o.sent(),this._trtc.stream.stop(),this._trtc.stream.close(),this._trtc.stream=null,o.label=2;case 2:return null===(n=this._trtc.client)||void 0===n||n.leave().then((function(){return r._trtc.client=null})).then((function(){return t(!0)})).catch((function(){return t(!1)})),t(!0),[2]}}))}))}))},t.prototype.detectMicro=function(){return new Promise((function(e){try{navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return e(!0)})).catch((function(t){y.error(t.message),e(!1)}))}catch(t){console.error(t),e(!1)}}))},t.prototype.toggleMicro=function(e){var t,n,r,o;return Promise.resolve((e?null===(n=null===(t=this._trtc)||void 0===t?void 0:t.stream)||void 0===n?void 0:n.unmuteAudio():null===(o=null===(r=this._trtc)||void 0===r?void 0:r.stream)||void 0===o?void 0:o.muteAudio())||!1)},t.prototype.shock=function(){throw new Error("Method not implemented.")},t.prototype._registerRtcEvent=function(){var e,t,n,r,o=this;null===(e=this._trtc.client)||void 0===e||e.on("stream-added",this._handleStreamAdded),null===(t=this._trtc.client)||void 0===t||t.on("stream-subscribed",this._handleStreamSubscribed),null===(n=this._trtc.client)||void 0===n||n.on("audio-volume",(function(e){return o.emit("userVolumes",e.result.map((function(e){return{userId:e.userId,audioVolume:e.audioVolume}})))})),null===(r=this._trtc.client)||void 0===r||r.on("error",(function(e){return o.emit("error",e)}))},t}(g),C=function(e){function n(n){var r=e.call(this)||this;return r.type=exports.RTCType.RealseeBrowserChimeRTC,r.joined=!1,r.micro=!1,r.voiceId="",r.userId="",r.deviceChangeObserver={},r.audioVideoObserver={},r._getVoiceSign=function(){throw new Error("方法 getVoiceSign 未实现")},r.$dom=document.createElement("div"),r.$audio=document.createElement("audio"),r._initDom=function(){r.$audio.id="rs-rtc-".concat(S()),r.$dom.id="rs-rtc-".concat(S()),r.$dom.appendChild(r.$audio),document.body.appendChild(r.$dom)},r.initObservers=function(){r.deviceChangeObserver={audioInputsChanged:function(e){null==e||e.forEach((function(e){r.logger.info("Device ID: ".concat(e.deviceId," Microphone: ").concat(e.label))}))},audioOutputsChanged:function(e){r.logger.info("Audio outputs updated: ".concat(e))},videoInputsChanged:function(e){r.logger.info("Video inputs updated: ".concat(e))},audioInputMuteStateChanged:function(e,t){r.logger.info("Device ".concat(e.toString()," ").concat(t?"is muted in hardware":"is not muted"))}},r.audioVideoObserver={audioVideoDidStart:function(){r.logger.info("Started")},audioVideoDidStop:function(e){r.logger.info("Stopped with a session status code: ".concat(e.statusCode()))},audioVideoDidStartConnecting:function(e){e&&r.logger.info("Attempting to reconnect")}}},r._registerRtcEvent=function(){var e,n,o,i,s,c,a=(null===(o=null===(n=null===(e=r.meetingSession)||void 0===e?void 0:e.configuration)||void 0===n?void 0:n.credentials)||void 0===o?void 0:o.attendeeId)||"";if(a){var u=new Map,l=function(){var e=[];return u.forEach((function(t,n){e.push({userId:t.userId,volume:t.muted||0===t.signalStrength||!Boolean(t.volume)?0:t.volume})})),e};null===(i=r.meetingSession)||void 0===i||i.audioVideo.realtimeSubscribeToAttendeeIdPresence((function(e,n,o){var i;if(!n)return u.delete(e),void r.emit("userVolumes",l());null===(i=r.meetingSession)||void 0===i||i.audioVideo.realtimeSubscribeToVolumeIndicator(e,(function(e,n,i,s){new t.DefaultModality(e).base()===e&&(u.set(e,{userId:o||e,volume:n,muted:i,signalStrength:s}),r.emit("userVolumes",l()))}))})),null===(s=r.meetingSession)||void 0===s||s.audioVideo.realtimeSubscribeToVolumeIndicator(a,(function(e,n,o,i){new t.DefaultModality(e).base()===e&&null!==i&&1!==i&&r.emit("weakNetwork")})),null===(c=r.meetingSession)||void 0===c||c.audioVideo.realtimeSubscribeToFatalError((function(e){return r.emit("error",e)}))}},r._getVoiceSign=n.getVoiceSign,r._initDom(),r.logger=new t.ConsoleLogger("WebRTCLogger",n.logLevel||t.LogLevel.INFO),r.deviceController=new t.DefaultDeviceController(r.logger),r.initObservers(),r}return c(n,e),n.prototype.join=function(e){return u(this,void 0,void 0,(function(){var n=this;return l(this,(function(r){return[2,new Promise((function(r,o){return u(n,void 0,void 0,(function(){var n,o,i,s,c,u,d,f,h,p,v,m,g,_=this;return l(this,(function(l){switch(l.label){case 0:this.emit("joinWillStart"),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,this._getVoiceSign(a(a({},e),{roomId:e.roomId||0}))];case 2:return n=l.sent(),o=n.userId,i=n.userSig,this.userId=o,s=JSON.parse(decodeURIComponent(i)),c=s.attendence,u=s.vendor_wrapper,d=new t.MeetingSessionConfiguration({Meeting:u},{Attendee:{ExternalUserId:c.external_user_id,AttendeeId:c.attendee_id,JoinToken:c.join_token}}),this.meetingSession=new t.DefaultMeetingSession(d,this.logger,this.deviceController),this._registerRtcEvent(),this.meetingSession.audioVideo.addDeviceChangeObserver(this.deviceChangeObserver),this.meetingSession.audioVideo.addObserver(this.audioVideoObserver),this.meetingSession.audioVideo.bindAudioElement(this.$audio),f={audioVideoDidStart:function(){var e;null===(e=_.meetingSession)||void 0===e||e.audioVideo.realtimeMuteLocalAudio(),_.joined=!0,_.emit("joined"),r(!0)},audioVideoDidStop:function(){_.joined=!1,r(!1)}},this.meetingSession.audioVideo.addObserver(f),[4,this.deviceController.listAudioInputDevices(!0)];case 3:return h=l.sent(),p=h.find((function(e){return"default"===e.deviceId})),v=h.find((function(e){return""!==e.deviceId})),this.audioInput=p||v,[4,this.meetingSession.audioVideo.startAudioInput((null===(g=this.audioInput)||void 0===g?void 0:g.deviceId)||"default")];case 4:return l.sent(),this.meetingSession.audioVideo.start(),[3,6];case 5:return m=l.sent(),this.emit("error",m),this.logger.error(m.message),r(!1),[3,6];case 6:return[2]}}))}))}))]}))}))},n.prototype.quit=function(){var e=this;return this.joined?new Promise((function(n,r){var o,i;e.joined=!1;var s={audioVideoDidStop:function(r){return u(e,void 0,void 0,(function(){var e,o;return l(this,(function(i){return e=r.statusCode(),null===(o=this.meetingSession)||void 0===o||o.deviceController.destroy(),e===t.MeetingSessionStatusCode.Left?(this.logger.info("You left the session"),n(!0)):(this.logger.info("Stopped with a session status code: ".concat(e)),n(!0)),[2]}))}))}};null===(o=e.meetingSession)||void 0===o||o.audioVideo.addObserver(s),null===(i=e.meetingSession)||void 0===i||i.audioVideo.stop()})):Promise.resolve(!0)},n.prototype.detectMicro=function(){return u(this,void 0,void 0,(function(){var e=this;return l(this,(function(t){return[2,new Promise((function(t){try{navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return t(!0)})).catch((function(){return t(!1)}))}catch(n){e.logger.error(n.message),t(!1)}}))]}))}))},n.prototype.toggleMicro=function(e){var t,n,r;return u(this,void 0,void 0,(function(){var o;return l(this,(function(i){return e?null===(t=this.meetingSession)||void 0===t||t.audioVideo.realtimeUnmuteLocalAudio():null===(n=this.meetingSession)||void 0===n||n.audioVideo.realtimeMuteLocalAudio(),void 0!==(o=null===(r=this.meetingSession)||void 0===r?void 0:r.audioVideo.realtimeIsLocalAudioMuted())?[2,e!==o]:[2,!1]}))}))},n.prototype.shock=function(){throw new Error("Method not implemented.")},n}(g);exports.RTCJoinedInfoCodeEnum=void 0,(k=exports.RTCJoinedInfoCodeEnum||(exports.RTCJoinedInfoCodeEnum={}))[k.Success=0]="Success",k[k.Failure=1]="Failure",k[k.ReJoin=2]="ReJoin",k[k.NoMicroPermission=3]="NoMicroPermission";var T,O,I,R,B,A,L,N,W,P,x=function(e){function t(t){var n=t.jsBridge,r=t.getVoiceSign,o=e.call(this)||this;return o.type=exports.RTCType.RealseeVRWebViewRTC,o.joined=!1,o.micro=!1,o.voiceId="",o.options={jsBridge:n,getVoiceSign:r},"WxMiniProgramWebView"!==o.jsBridge.webViewType&&o.jsBridge.callAndListen("live/userVolumes",(function(e){o.emit("userVolumes",e)})),o.jsBridge.callAndListen("live/weakNetwork",(function(e){e&&o.emit("weakNetwork")})),o}return c(t,e),Object.defineProperty(t.prototype,"jsBridge",{get:function(){return this.options.jsBridge},enumerable:!1,configurable:!0}),t.prototype.join=function(e){return u(this,void 0,void 0,(function(){var t,n,r,o,i,s,c,a;return l(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),this.emit("joinWillStart"),[4,this.options.getVoiceSign(e)];case 1:return t=u.sent(),n=t.sdkAppId,r=t.userId,o=t.userSig,Boolean(n)&&Boolean(r)&&Boolean(o)?(this.type=e.type,[4,this.jsBridge.callAndBackfeed("live/join?sdkAppID=".concat(n,"&userID=").concat(r,"&roomID=").concat(Number(e.voiceId),"&userSig=").concat(o))]):(this.emit("error",new Error("加入房间失败:rtc 签名请求异常")),this.joined=!1,[2,this.joined]);case 2:return i=u.sent(),s=i[0],c=i[1],s?s.code===exports.RTCJoinedInfoCodeEnum.Success?(this.emit("joined"),this.joined=!0):(this.emit("error",s),this.joined=!1):(this.emit("error",c||new Error("加入房间失败:未知异常。")),this.joined=!1),[2,this.joined];case 3:return a=u.sent(),this.emit("error",new Error("加入房间失败:"+a.message)),this.joined=!1,[2,this.joined];case 4:return[2]}}))}))},t.prototype.quit=function(){return u(this,void 0,void 0,(function(){var e,t,n;return l(this,(function(r){switch(r.label){case 0:return[4,this.jsBridge.callAndBackfeed("live/quit")];case 1:return e=r.sent(),t=e[0],n=e[1],null===t&&this.emit("error",n||new Error("退出房间失败:未知异常。")),this.joined=!1,[2,!!t]}}))}))},t.prototype.detectMicro=function(){return u(this,void 0,void 0,(function(){var e,t,n;return l(this,(function(r){switch(r.label){case 0:return[4,this.jsBridge.detectMicro()];case 1:return e=r.sent(),t=e[0],n=e[1],null===t?(this.emit("error",n||new Error("麦克风监测异常!")),[2,!1]):[2,t]}}))}))},t.prototype.toggleMicro=function(e){return u(this,void 0,void 0,(function(){var t,n,r;return l(this,(function(o){switch(o.label){case 0:return[4,this.jsBridge.callAndBackfeed("live/toggleMicro?flag=".concat(e?1:0))];case 1:return t=o.sent(),n=t[0],r=t[1],null===n?(this.emit("error",r||new Error("麦克风监测异常!")),[2,!1]):(this.micro=n,[2,n])}}))}))},t.prototype.shock=function(){this.jsBridge.shock(1)},t}(g);function M(e){switch(e){case 1e3:return exports.WebSocketCloseError.Err_1000;case 1001:return exports.WebSocketCloseError.Err_1001;case 1002:return exports.WebSocketCloseError.Err_1002;case 1003:return exports.WebSocketCloseError.Err_1003;case 1006:return exports.WebSocketCloseError.Err_1006;case 1007:return exports.WebSocketCloseError.Err_1007;case 1008:return exports.WebSocketCloseError.Err_1008;case 1009:return exports.WebSocketCloseError.Err_1009}return exports.WebSocketCloseError.Err_unknown}exports.Command=void 0,(T=exports.Command||(exports.Command={})).SelfUserInfo="SELF_USER_INFO",T.RoomInfo="ROOM_INFO",T.RTCInfo="RTC_INFO",T.UserList="USER_LIST",T.BuiltinMsg="BUILTIN_MSG",T.CustomEvent="CUSTOM_EVENT",T.KeyframeSync="KEYFRAME_SYNC",T.UserKickOut="USER_KICK_OUT",exports.BuiltinEventType=void 0,(O=exports.BuiltinEventType||(exports.BuiltinEventType={})).UserChange="user_change",O.RoomChange="room_change",exports.BuiltinActionType=void 0,(I=exports.BuiltinActionType||(exports.BuiltinActionType={})).UserMicroStatus="change_micro_status",I.UserMicroStatusSync="sync_micro_status",I.UserPermission="change_permission",I.UserStatus="change_status",I.UserInfo="change_info",I.RoomClose="close",exports.MicroStatus=void 0,(R=exports.MicroStatus||(exports.MicroStatus={})).OPEN="OPEN",R.CLOSE="CLOSE",exports.LiveState=void 0,(B=exports.LiveState||(exports.LiveState={}))[B.NOTINITIALIZED=-1]="NOTINITIALIZED",B[B.CONNECTING=0]="CONNECTING",B[B.OPEN=1]="OPEN",B[B.CLOSED=3]="CLOSED",exports.UserStatus=void 0,(A=exports.UserStatus||(exports.UserStatus={}))[A.Normal=0]="Normal",A[A.Removed=1]="Removed",A[A.Replaced=2]="Replaced",exports.MemUserStatus=void 0,(L=exports.MemUserStatus||(exports.MemUserStatus={})).WAIT_ENTER="WAIT_ENTER",L.ONLINE="ONLINE",L.LEAVE="LEAVE",L.KICK_OUT="KICK_OUT",L.BE_REPLACE="BE_REPLACE",L.EXCEPTION="EXCEPTION",exports.WebSocketState=void 0,(N=exports.WebSocketState||(exports.WebSocketState={}))[N.NOTINITIALIZED=-1]="NOTINITIALIZED",N[N.CONNECTING=0]="CONNECTING",N[N.OPEN=1]="OPEN",N[N.CLOSING=2]="CLOSING",N[N.CLOSED=3]="CLOSED",exports.WebSocketErrorType=void 0,(W=exports.WebSocketErrorType||(exports.WebSocketErrorType={})).Error="Error",W.Close="Close",W.MicroAuth="MicroAuth",W.DuplicateConnect="DuplicateConnect",W.IllegalURL="IllegalURL",W.Unknown="Unknown",W.IllegalArgs="IllegalArgs",exports.WebSocketCloseError=void 0,(P=exports.WebSocketCloseError||(exports.WebSocketCloseError={})).Err_1000="CLOSE_NORMAL",P.Err_1001="CLOSE_GOING_AWAY",P.Err_1002="CLOSE_PROTOCOL_ERROR",P.Err_1003="CLOSE_UNSUPPORTED",P.Err_1006="CLOSE_ABNORMAL",P.Err_1007="Unsupported Data",P.Err_1008="Policy Violation",P.Err_1009="CLOSE_TOO_LARGE",P.Err_unknown="unknown";var j=function(e,t){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},j(e,t)};function V(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},U.apply(this,arguments)};function D(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((r=r.apply(e,t||[])).next())}))}function H(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}var J={};function q(e,t,n){var r;if(void 0===n&&(n=!0),J[e])J[e].queue.push({once:n,callback:t});else{var o="$jsBridgeFn_"+Date.now().toString(16).toUpperCase()+"_"+Math.ceil(1e4*Math.random()).toString(16).toUpperCase();J[e]={uuid:o,queue:[{once:n,callback:t}]}}return Object.assign(window,((r={})[J[e].uuid]=function(t){J[e].queue=J[e].queue.reduce((function(e,n){var r=n.once,o=n.callback;return r||e.push(n),o(t),e}),[])},r)),J[e].uuid}var $,K=function(){function e(){}return e.prototype.checkReady=function(e){return Promise.resolve([!1,null])},e.prototype.callAndBackfeed=function(e){return Promise.resolve([!1,null])},e.prototype.callAndListen=function(e,t){return Promise.resolve([!1,null])},e}(),F=window,G=function(e){function t(){var t=e.call(this)||this;return Promise.resolve().then((function(){return D(t,void 0,void 0,(function(){var e;return H(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.checkBridgeReady()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn(e),[3,3];case 3:return[2]}}))}))})),t}return V(t,e),t.prototype.checkBridgeReady=function(e){var t=this;if(void 0===e&&(e=6e3),this.hybridBridge)return!0;var n=performance.now();return new Promise((function(r,o){var i=function(){if(t.hybridBridge)return r(!0);if(F.HybridBridgeLJ){var s=F.HybridBridgeLJ;null==s||s.getStaticData(q("HYBRID_BRIDGE_NAME",(function(e){return t.deviceInfo=JSON.parse(e),t.hybridBridge=s,r(!0)})))}if(performance.now()-n>(e||6e3))return o(new Error("HybridBridge 初始化超时~"));requestAnimationFrame(i)};i()}))},t.prototype.checkReady=function(e){return void 0===e&&(e=6e3),D(this,void 0,void 0,(function(){var t,n,r,o;return H(this,(function(i){switch(i.label){case 0:if(t=[null,null],this.hybridBridge)return t[0]=!0,[2,t];i.label=1;case 1:return i.trys.push([1,3,,4]),n=t,r=0,[4,this.checkBridgeReady(e)];case 2:return n[r]=i.sent(),[3,4];case 3:return o=i.sent(),t[0]=!1,t[1]=o,[3,4];case 4:return[2,t]}}))}))},Object.defineProperty(t.prototype,"ready",{get:function(){return!!this.hybridBridge},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scheme",{get:function(){var e;return(null===(e=this.deviceInfo)||void 0===e?void 0:e.scheme)||""},enumerable:!1,configurable:!0}),t.prototype.createSchemeLink=function(e){return e.startsWith(this.scheme)?e:this.scheme+"://"+e},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){var t,n,r,o,i=this;return H(this,(function(s){switch(s.label){case 0:return t=[!1,null],[4,this.checkReady()];case 1:return n=s.sent(),r=n[0],o=n[1],r?[4,new Promise((function(n){return D(i,void 0,void 0,(function(){var r,o;return H(this,(function(i){return r=this.createSchemeLink(e),o=JSON.stringify({actionUrl:r,functionName:q(this.createSchemeLink(e),(function(e){var r=function(){try{return JSON.parse(e)}catch(t){return e}}();t[0]=1===r||0!==r&&r,n(t)}))}),this.hybridBridge.callAndBackfeed(o),[2]}))}))}))]:(t[0]=!1,t[1]=o,[2,t]);case 2:return[2,s.sent()]}}))}))},t.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){var n,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return n=[!1,null],[4,this.checkReady()];case 1:return r=c.sent(),o=r[0],i=r[1],o?[4,new Promise((function(r){return D(s,void 0,void 0,(function(){var o,i,s;return H(this,(function(c){return o=this.createSchemeLink(e),i=function(e){var s=function(){try{return JSON.parse(e)}catch(t){return e}}();t(1===s||0!==s&&s),n[0]=function(){var e=J[o];if(e){var t=e.queue.findIndex((function(e){return e.callback===i}));-1!==t&&e.queue.splice(t,1)}},r(n)},s=JSON.stringify({actionUrl:o,functionName:q(o,i,!1)}),this.hybridBridge.callAndListen(s),[2]}))}))}))]:(n[0]=!1,n[1]=i,[2,n]);case 2:return[2,c.sent()]}}))}))},t}(K);!function(e){e.callAndBackfeed="callAndBack",e.callAndListen="callAndListen"}($||($={}));var z,Y=window,Z=function(){function e(){this.checkBridgeReady()}return e.prototype.checkBridgeReady=function(e){var t=this;if(void 0===e&&(e=6e3),this.worker)return!0;var n=performance.now();return new Promise((function(r,o){var i=function(){if(t.worker)return r(!0);if(Y.webkit&&Y.webkit.messageHandlers&&Y.webkit.messageHandlers.realsee){var s=Y.webkit.messageHandlers.realsee;s.postMessage(JSON.stringify({type:"getStaticData",param:JSON.stringify({functionName:q("HYBRID_BRIDGE_NAME",(function(e){return t.deviceInfo=JSON.parse(e),t.worker=s,r(!0)}))})}))}else{if(performance.now()-n>(e||6e3))return o(new Error("HybridBridge 初始化超时~"));requestAnimationFrame(i)}};i()}))},e.prototype.checkReady=function(e){return void 0===e&&(e=6e3),D(this,void 0,void 0,(function(){var t,n,r,o;return H(this,(function(i){switch(i.label){case 0:if(t=[null,null],this.worker)return t[0]=!0,[2,t];i.label=1;case 1:return i.trys.push([1,3,,4]),n=t,r=0,[4,this.checkBridgeReady(e)];case 2:return n[r]=i.sent(),[3,4];case 3:return o=i.sent(),t[0]=!1,t[1]=o,[3,4];case 4:return[2,t]}}))}))},Object.defineProperty(e.prototype,"ready",{get:function(){return!!this.worker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scheme",{get:function(){var e;return(null===(e=this.deviceInfo)||void 0===e?void 0:e.scheme)||""},enumerable:!1,configurable:!0}),e.prototype.createSchemeLink=function(e){return e.startsWith(this.scheme)?e:this.scheme+"://"+e},e.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){var t,n,r,o,i=this;return H(this,(function(s){switch(s.label){case 0:return t=[!1,null],[4,this.checkReady()];case 1:return n=s.sent(),r=n[0],o=n[1],r?[4,new Promise((function(n){return D(i,void 0,void 0,(function(){var r,o;return H(this,(function(i){return r=this.createSchemeLink(e),o=JSON.stringify({actionUrl:r,functionName:q(this.createSchemeLink(e),(function(e){var r=function(){try{return JSON.parse(e)}catch(t){return e}}();t[0]=1===r||0!==r&&r,n(t)}))}),this.worker.postMessage(JSON.stringify({type:"callAndBackfeed",param:o})),[2]}))}))}))]:(t[0]=!1,t[1]=o,[2,t]);case 2:return[2,s.sent()]}}))}))},e.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){var n,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return n=[!1,null],[4,this.checkReady()];case 1:return r=c.sent(),o=r[0],i=r[1],o?[4,new Promise((function(r){return D(s,void 0,void 0,(function(){var o,i,s;return H(this,(function(c){return o=this.createSchemeLink(e),i=function(e){var s=function(){try{return JSON.parse(e)}catch(t){return e}}();t(1===s||0!==s&&s),n[0]=function(){var e=J[o];if(e){var t=e.queue.findIndex((function(e){return e.callback===i}));-1!==t&&e.queue.splice(t,1)}},r(n)},s=JSON.stringify({actionUrl:o,functionName:q(o,i,!1)}),this.worker.postMessage(JSON.stringify({type:"callAndListen",param:s})),[2]}))}))}))]:(n[0]=!1,n[1]=i,[2,n]);case 2:return[2,c.sent()]}}))}))},e}();function X(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Q(){return(X()+X()+"-"+X()+"-4"+X().substr(0,3)+"-"+X()+"-"+X()+X()+X()).toLowerCase()}!function(e){e.isReady="Are You OK?",e.ready="I`m OK!",e.ping="ping",e.pong="pong",e.alive="I`m alive!"}(z||(z={}));var ee=function(e,t){var n=Object.keys(t).reduce((function(e,n){return e.replace("{{".concat(n,"}}"),"".concat(t[n]))}),e);return encodeURI(n)},te=function(e,t){return e in t},ne=function(e){return void 0===e&&(e=""),e.replace("?","").split("&").map((function(e){var t,n=e.split("="),r=n[0],o=n[1];return(t={})[r]=decodeURIComponent(o),t})).reduce((function(e,t){return U(U({},e),t)}),{})},re="$$REALSEE_JSBRIDGE_EVENT$$";function oe(e){return e[re]||(e[re]={}),e[re]}var ie,se=function(){function e(){}return e.prototype.hasListener=function(e){var t=oe(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,n){var r=this,o=oe(this);return o[e]||(o[e]=[]),o[e].push([t,n||!1]),function(){return r.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var n,r=oe(this);if(r[e]||(r[e]=[]),void 0!==t){for(var o=0;o<r[e].length&&r[e][o][0]!==t;o++);o<r[e].length&&r[e].splice(o,1)}else r[e].length=0}else(n=this)[re]||delete n[re]},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=!1,o=oe(this),i=o[e]||[],s=0,c=i.slice();s<c.length;s++){var a=c[s],u=a[0],l=a[1],d=void 0!==l&&l,f=u.apply(void 0,t);d&&this.off(e,u),!1===f&&(r=!0)}return r},e}(),ce=function(e){function t(t){var n=e.call(this)||this;return n._options={timeout:1e4,shouldReconnect:function(e,t){if(1008!==e.code&&1011!==e.code)return[0,3e3,1e4][t.attempts]},should1000Reconnect:!1,ignoreConnectivityEvents:!1,automaticOpen:!1},n._attempts=0,n._reconnects=-1,n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._connectivityEventsAttached=!1,n._clearPendingReconnectIfNeeded=function(){n._pendingReconnect&&(clearTimeout(n._pendingReconnect),n._pendingReconnect=void 0)},n._online=function(e){n._reconnectWhenOnlineAgain&&(n._clearPendingReconnectIfNeeded(),n._reconnect(e))},n._offline=function(){var e;n._reconnectWhenOnlineAgain=!0,null===(e=n._realWebSocket)||void 0===e||e.close(1e3)},n._detachConnectivityEvents=function(){n._connectivityEventsAttached&&(null===globalThis||void 0===globalThis||globalThis.removeEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.removeEventListener("offline",n._offline),n._connectivityEventsAttached=!1)},n._attachConnectivityEvents=function(){n._connectivityEventsAttached||(null===globalThis||void 0===globalThis||globalThis.addEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.addEventListener("offline",n._offline),n._connectivityEventsAttached=!0)},n.send=function(e){var t,r,o;(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)===(null===(r=n._realWebSocket)||void 0===r?void 0:r.OPEN)&&(null===(o=n._realWebSocket)||void 0===o||o.send(e))},n.close=function(e,t){var r;return"number"!=typeof e&&(t=e,e=1e3),n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!0,n._detachConnectivityEvents(),null===(r=n._realWebSocket)||void 0===r?void 0:r.close(e,t)},n.open=function(e){var t,r;e&&(n._url=e),(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)!==WebSocket.OPEN&&(null===(r=n._realWebSocket)||void 0===r?void 0:r.readyState)!==WebSocket.CONNECTING&&(n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._createWebSocket())},n._createWebSocket=function(){var e,t,r,o="string"==typeof n._url?n._url:null===(e=n._url)||void 0===e?void 0:e.call(n,n);if(o){n._pendingReconnect=void 0,n._removeWebSocketEvent(),n._realWebSocket=new WebSocket(o,n._protocols||void 0),n._attempts=n._attempts+1,n.emit("connecting",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}));n._connectTimeout=setTimeout((function(){n._connectTimeout=void 0,n._detachConnectivityEvents(),n.emit("timeout",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}))}),null===(t=n._options)||void 0===t?void 0:t.timeout),n._dispatchWebSocketEvent(),(null===(r=n._options)||void 0===r?void 0:r.ignoreConnectivityEvents)||n._attachConnectivityEvents()}},n._removeWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.removeEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.removeEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.removeEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.removeEventListener("message",n._webSocketMessageHandler)},n._dispatchWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.addEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.addEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.addEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.addEventListener("message",n._webSocketMessageHandler)},n._webSocketOpenHandler=function(e){n._connectTimeout&&(clearTimeout(n._connectTimeout),n._connectTimeout=void 0);var t=++n._reconnects,r=n._attempts;return n._attempts=0,n._reconnectWhenOnlineAgain=!1,n.emit("open",Object.assign(e,{detail:{reconnects:t,attempts:r}}))},n._webSocketCloseHandler=function(e){return n._reconnect(e),n.emit("close",e)},n._webSocketErrorHandler=function(e){return n.emit("error",new CustomEvent("error",{detail:{error:e}}))},n._webSocketMessageHandler=function(e){return n.emit("message",e)},t&&n.setOptions(t),n}return V(t,e),Object.defineProperty(t.prototype,"attempts",{get:function(){return this._attempts},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(e){if(e){this._url=e.url,this._protocols=e.protocols;var t=Object.assign(this._options,e.robustOptions||{});if("number"!=typeof(null==t?void 0:t.timeout))throw new Error("timeout must be the number of milliseconds to timeout a connection attempt");if("function"!=typeof(null==t?void 0:t.shouldReconnect))throw new Error("shouldReconnect must be a function that returns the number of milliseconds to wait for a reconnect attempt, or null or undefined to not reconnect.");this._options=t,this._options.automaticOpen&&this._createWebSocket()}},t.prototype._reconnect=function(e){var t,n,r,o;if(!(null===(t=this._options)||void 0===t?void 0:t.should1000Reconnect)&&1e3===e.code||this._explicitlyClosed)this._attempts=0;else if(!1!==(null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===n?void 0:n.onLine)){var i=null===(o=null===(r=this._options)||void 0===r?void 0:r.shouldReconnect)||void 0===o?void 0:o.call(r,e,this);"number"==typeof i&&(this._pendingReconnect=setTimeout(this._createWebSocket,i))}else this._reconnectWhenOnlineAgain=!0},t}(se),ae=function(){function e(){var t,n,r=this;if(this._rsWeappBridgeMethodAdapter={},this._ws=new ce,this._readyState="close",this.initialize=function(e){return void 0===e&&(e=6e3),D(r,void 0,void 0,(function(){var t,n,r,o,i,s,c,a,u,l,d;return H(this,(function(f){switch(f.label){case 0:if(t=[!1,null],n=ne(globalThis.location.search),r=n.wssid,o=n.wstsp,i=n.wssig,s=n.wsmnt,c=void 0===s?"wss://ws.realsee.com":s,!(r&&o&&i&&c))return t[1]=new Error("HybridBridge 参数缺失,初始化失败~"),[2,t];a=ee("{{origin}}/{{endpoint}}/{{uuid}}/{{member}}/{{ak}}/{{ts}}/{{sign}}",{origin:c,endpoint:"proxy",uuid:r,member:"webview",ak:"vr_live_miniapp",ts:o,sign:i}),f.label=1;case 1:return f.trys.push([1,6,,7]),[4,this._open(a)];case 2:return f.sent()?(this.initBuiltInHandlers(),u=t,l=0,[4,this.waitReady(e)]):[3,4];case 3:return u[l]=f.sent(),[3,5];case 4:t[1]=new Error("HybridBridge ws未连接,初始化失败~"),f.label=5;case 5:return[3,7];case 6:return d=f.sent(),t[1]=d,[3,7];case 7:return[2,t]}}))}))},this.initBuiltInHandlers=function(){r._registerLifecycleHandler(),r._registerHeartbeatHandler(),r._registerMessageHandler(),r._registerBridgeRequestHandler(),r._registerReadyHandler()},this._open=function(e){return new Promise((function(t){r._ws.once("open",(function(){r._receivedMessage(z.ready,(function(){return t(!0)}),!0),r._ws.once("timeout",(function(){return t(!1)})),r.send(z.isReady)})),r._ws.open(e)}))},this._registerLifecycleHandler=function(){r._ws.on("connecting",(function(){console.log("RsWeappBridge connecting"),r._readyState="connecting"})),r._ws.on("open",(function(){console.log("RsWeappBridge open"),r._readyState="open"})),r._ws.on("close",(function(){r._readyState="close"})),r._ws.on("error",(function(){console.log("RsWeappBridge error"),r._readyState="close"})),r._ws.on("timeout",(function(){console.log("RsWeappBridge timeout"),r._readyState="close"}))},this._registerHeartbeatHandler=function(){r._receivedMessage(z.ping,(function(){return setTimeout((function(){return r._ws.send(z.pong)}),500)})),r._receivedMessage(z.pong,(function(){return setTimeout((function(){return r._ws.send(z.ping)}),1e3)}))},this._receivedMessage=function(e,t,n){var o=function(i){i.data===e&&(t(),n&&r._ws.off("message",o))};r._ws.on("message",o)},this._registerReadyHandler=function(){r._receivedMessage(z.isReady,(function(){return r._ws.send(z.ready)}))},this.send=function(e){r._ws.send(e)},this.waitReady=function(e){return void 0===e&&(e=6e3),new Promise((function(t,n){r._receivedMessage(z.ready,(function(){return t(!0)})),r.send(z.isReady),setTimeout((function(){return n("HybridBridge 初始化超时~")}),e)}))},this._parseMessage=function(e){try{return JSON.parse(e.data)}catch(t){return e.data}},this._registerMessageHandler=function(){r._ws.on("message",(function(e){var t=r._parseMessage(e);if("object"==typeof t){var n=t.id,o=t.command,i=t.data;"message"===o&&"function"==typeof r._rsWeappBridgeMethodAdapter.bindMessage&&r._rsWeappBridgeMethodAdapter.bindMessage({id:n,data:i})}}))},this.getStaticData=function(e){r.callAndBackfeed(JSON.stringify({actionUrl:"common/staticData",functionName:e}))},this.callAndBackfeed=function(e){var t=JSON.parse(e),n=t.actionUrl,o=void 0===n?"":n,i=t.functionName,s=void 0===i?"":i;if(!o)throw new Error("callAndBackfeed actionUrl is empty!");if(!s)throw new Error("callAndBackfeed functionName is empty!");r._callAndBackfeed(o,(function(e){"function"==typeof globalThis[s]&&globalThis[s](e)}))},this.callAndListen=function(e){var t=JSON.parse(e),n=t.actionUrl,o=t.functionName;if(!n)throw new Error("callAndListen actionUrl is empty!");if(!o)throw new Error("callAndListen functionName is empty!");var i=function(e){"function"==typeof globalThis[o]&&globalThis[o](e)};try{r._callAndListen(n,i)}catch(e){console.warn(e),i(!1)}},this.execute=function(e,t){return D(r,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this._invokeBridgeMethod(e,t)];case 1:return[2,n.sent()]}}))}))},this._invokeBridgeMethod=function(e,t){return new Promise((function(n,o){var i=Q(),s=function(t){var c=r._parseMessage(t);"object"==typeof c&&c.method===e&&c.id===i&&(r._ws.off("message",s),c.error?o(c.error):n(c.data))};r._ws.on("message",s),r.send(JSON.stringify({method:e,args:t,id:i}))}))},(null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.window)||void 0===t?void 0:t.__Realsee_WxMini_HybridBridge__)instanceof e)return null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.window)||void 0===n?void 0:n.__Realsee_WxMini_HybridBridge__;(null===globalThis||void 0===globalThis?void 0:globalThis.window)&&(globalThis.window.__Realsee_WxMini_HybridBridge__=this,this.initBuiltInHandlers())}return Object.defineProperty(e.prototype,"isReady",{get:function(){return"open"===this._readyState},enumerable:!1,configurable:!0}),e.prototype._registerBridgeRequestHandler=function(){var e=this;this._ws.on("message",(function(t){return D(e,void 0,void 0,(function(){var e,n,r,o,i,s,c,a;return H(this,(function(u){switch(u.label){case 0:if("object"!=typeof(e=this._parseMessage(t)))return[3,7];if(n=e.id,r=e.method,o=e.args,"request"!==e.command)return[3,7];if(!r)return[3,7];if(i=null,s=null,c=null,"function"==typeof this._rsWeappBridgeMethodAdapter[r]?c=this._rsWeappBridgeMethodAdapter[r]:globalThis&&te(r,globalThis)&&(c=globalThis[r]),"function"!=typeof c)return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,c(o)];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),s=a.message||a,[3,4];case 4:return[3,6];case 5:s="Method not implemented.",u.label=6;case 6:this.send(JSON.stringify({id:n,method:r,result:i,error:s,command:"response"})),u.label=7;case 7:return[2]}}))}))}))},e.prototype._callAndBackfeed=function(e,t){var n=this,r=Q(),o=JSON.stringify({id:r,actionUrl:e,command:"rsSchemeRequest",type:"callAndBackfeed"}),i=null,s=function(e){var o=n._parseMessage(e);if("object"==typeof o){var c=o.id,a=o.result,u=o.errmsg;"rsSchemeResponse"===o.command&&c===r&&(n._ws.off("message",s),i&&clearTimeout(i),u?(console.warn(u),t(0)):t(a))}};this._ws.on("message",s),this.send(o),i=globalThis.setTimeout((function(){console.warn("callAndBackfeed timeout"),t(0)}),3e4)},e.prototype._callAndListen=function(e,t){var n=this,r=Q(),o=JSON.stringify({id:r,actionUrl:e,command:"rsSchemeRequest",type:"callAndListen"});this._ws.on("message",(function(e){var o=n._parseMessage(e);if("object"==typeof o){var i=o.id,s=o.result,c=o.errmsg;"rsSchemeResponse"===o.command&&i===r&&(c?(console.warn(c),t(!1)):t(s))}})),this.send(o)},e.prototype.invoke=function(e,t){return D(this,void 0,void 0,(function(){var n=this;return H(this,(function(r){return[2,new Promise((function(r,o){var i=Q(),s=JSON.stringify({id:i,method:e,args:t,command:"request"}),c=null,a=function(t){var s=n._parseMessage(t);if("object"==typeof s){var u=s.id,l=s.result,d=s.error;"response"===s.command&&u===i&&s.method===e&&(n._ws.off("message",a),c&&clearTimeout(c),d?o(d):r(l))}};n._ws.on("message",a),n.send(s),c=setTimeout((function(){return o("method invoke timeout")}),3e4)}))]}))}))},e}(),ue=ae,le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._hybridBridge=new ue,t.initializing=!1,t}return V(t,e),Object.defineProperty(t.prototype,"hybridBridge",{get:function(){return this._hybridBridge},enumerable:!1,configurable:!0}),t.prototype.checkBridgeReady=function(e){var t=this;return void 0===e&&(e=6e4),!!this.ready||new Promise((function(n,r){return D(t,void 0,void 0,(function(){var t,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return this.ready?[2,n(!0)]:this.initializing?((t=function(){if(s.ready)return n(!0);requestAnimationFrame(t)})(),[3,3]):[3,1];case 1:return this.initializing=!0,[4,this._hybridBridge.initialize(e)];case 2:if(r=c.sent(),o=r[0],i=r[1],!o||i)throw i||new Error("HybridBridge 初始化失败~");return this._hybridBridge.getStaticData(q("HYBRID_BRIDGE_NAME",(function(e){s.deviceInfo=function(){try{return JSON.parse(e)}catch(t){return e}}()}))),this.initializing=!1,[2,n(!0)];case 3:return[2]}}))}))}))},t.prototype.checkReady=function(e){return void 0===e&&(e=6e4),D(this,void 0,void 0,(function(){var t,n,r,o;return H(this,(function(i){switch(i.label){case 0:if(t=[null,null],this.ready)return t[0]=!0,[2,t];i.label=1;case 1:return i.trys.push([1,3,,4]),n=t,r=0,[4,this.checkBridgeReady(e)];case 2:return n[r]=i.sent(),[3,4];case 3:return o=i.sent(),t[0]=!1,t[1]=o,[3,4];case 4:return[2,t]}}))}))},Object.defineProperty(t.prototype,"ready",{get:function(){return!!this._hybridBridge.isReady},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scheme",{get:function(){var e;return(null===(e=this.deviceInfo)||void 0===e?void 0:e.scheme)||""},enumerable:!1,configurable:!0}),t.prototype.createSchemeLink=function(e){return e.startsWith(this.scheme)?e:this.scheme+"://"+e},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){var t,n,r,o,i=this;return H(this,(function(s){switch(s.label){case 0:return t=[!1,null],[4,this.checkReady()];case 1:return n=s.sent(),r=n[0],o=n[1],r?[4,new Promise((function(n){return D(i,void 0,void 0,(function(){var r,o;return H(this,(function(i){return r=this.createSchemeLink(e),o=JSON.stringify({actionUrl:r,functionName:q(this.createSchemeLink(e),(function(e){var r=e;try{r=JSON.parse(e)}catch(e){}t[0]=1===r||0!==r&&r,n(t)}))}),this._hybridBridge.callAndBackfeed(o),[2]}))}))}))]:(t[0]=!1,t[1]=o,[2,t]);case 2:return[2,s.sent()]}}))}))},t.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){var n,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return n=[!1,null],[4,this.checkReady()];case 1:return r=c.sent(),o=r[0],i=r[1],o?[4,new Promise((function(r){return D(s,void 0,void 0,(function(){var o,i,s;return H(this,(function(c){return o=this.createSchemeLink(e),i=function(e){var s=e;try{s=JSON.parse(e)}catch(e){}t(1===s||0!==s&&s),n[0]=function(){var e=J[o];if(e){var t=e.queue.findIndex((function(e){return e.callback===i}));-1!==t&&e.queue.splice(t,1)}},r(n)},s=JSON.stringify({actionUrl:o,functionName:q(o,i,!1)}),this._hybridBridge.callAndListen(s),[2]}))}))}))]:(n[0]=!1,n[1]=i,[2,n]);case 2:return[2,c.sent()]}}))}))},t.prototype.invoke=function(e,t){var n,r;return D(this,void 0,void 0,(function(){var o,i,s,c;return H(this,(function(a){switch(a.label){case 0:return o=[!1,null],[4,this.checkReady()];case 1:if(i=a.sent(),s=i[0],c=i[1],s)return[3,2];throw o[0]=!1,o[1]=c,c;case 2:return[4,null===(r=(n=this._hybridBridge).invoke)||void 0===r?void 0:r.call(n,e,t)];case 3:return[2,a.sent()]}}))}))},t}(K);!function(e){e.WebView="WebKit",e.WKWebview="WKWebview",e.UIWebview="UIWebview",e.Browser="Browser",e.WeChatMPWebView="WxMiniProgramWebView",e.Unsupported="Unsupported"}(ie||(ie={}));var de,fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.webViewType=ie.Unsupported,t}return V(t,e),t}(se),he=globalThis.navigator.userAgent,pe=/android/gi.test(he),ve=/iPhone|iPad\s+OS/gi.test(he),me=/MicroMessenger/gi.test(he)&&/miniProgram/gi.test(he),ge=/realsee/gi.test(he),_e={timeout:6e3},be=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.options=Object.assign(_e,t),ge||console.warn("未知容器:此版本 `jsBridge` 不支持当前 WebView 容器 ... "),n.webViewType=pe?ie.WebView:ve?ie.WKWebview:ie.Browser,n._controller=pe?new G:ve?new Z:new K,n.callAndListen("common/webViewState",(function(e){n.emit("webViewStateChange",e)})),n.callAndListen("common/webViewError",(function(e){n.emit("error",e)})),n}return V(t,e),t.prototype.ready=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this._controller.checkReady(this.options.timeout)];case 1:return[2,e.sent()]}}))}))},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this._controller.callAndBackfeed(e)];case 1:return[2,t.sent()]}}))}))},t.prototype.callAndListen=function(e,t){var n;return D(this,void 0,void 0,(function(){return H(this,(function(r){switch(r.label){case 0:return[4,null===(n=this._controller)||void 0===n?void 0:n.callAndListen(e,t)];case 1:return[2,r.sent()]}}))}))},t.prototype.setLeftTopBackButton=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return this.webViewType===ie.WebView?[2,[!0,null]]:[4,this.callAndBackfeed("common/setLeftTopBackButton?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.getBangsHeight=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getBangsHeight")];case 1:return[2,e.sent()]}}))}))},t.prototype.shock=function(e){return void 0===e&&(e=4),D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/shock?duration=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.minimize=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/minimize")];case 1:return[2,e.sent()]}}))}))},t.prototype.loadProgress=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e<0?0:e>100?100:e,[4,this.callAndBackfeed("common/loadProgress?progress=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeLoading=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeLoading")];case 1:return[2,e.sent()]}}))}))},t.prototype.setOrientation=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/setOrientation?orientation=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.keepScreenLight=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/keepScreenLight?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeWebView=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeWebView")];case 1:return[2,e.sent()]}}))}))},t.prototype.openWebView=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this.callAndBackfeed("common/openWebView?way=".concat(t,"&url=").concat(encodeURIComponent(e)))];case 1:return[2,n.sent()]}}))}))},t.prototype.saveImage2Album=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/saveImage2Album?base64=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.actionShare=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/actionShare?json=".concat(JSON.stringify(e)))];case 1:return[2,t.sent()]}}))}))},t.prototype.getDeviceInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getDeviceInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getUserInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getUserInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getWebViewState=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getWebViewState")];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(){return D(this,void 0,void 0,(function(){var e;return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/login")];case 1:return(e=t.sent())[0]?[4,this.getUserInfo()]:[3,3];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},t.prototype.logout=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/logout")];case 1:return[2,e.sent()]}}))}))},t.prototype.detectMicro=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/detectMicro")];case 1:return[2,e.sent()]}}))}))},t.prototype.preload=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e.map((function(e){return e.startsWith("//")?"https:"+e:e})),[4,this.callAndBackfeed("common/preload?urls=".concat(JSON.stringify(e)))];case 1:return[2,t.sent()]}}))}))},t.prototype.createCacheProxyUrl=function(e){var t=this;e=Array.isArray(e)?e:[e];var n=window.navigator.userAgent;if(!/supportCache/i.test(n))return e;return e.map((function(e){return t.webViewType===ie.WKWebview?e.replace(/https*:/,"").replace(/\/\//,"realseeproxycache://"):t.webViewType===ie.WebView?e+(-1!==e.indexOf("?")?"&":"?")+"realseeproxycache=1":e}))},t}(fe);!function(e){e.Append="Append",e.Replace="Replace",e.Single="Single"}(de||(de={}));var ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.webViewType=ie.Browser,t}return V(t,e),t.prototype.ready=function(){return Promise.resolve([!0,null])},t.prototype.callAndBackfeed=function(e){return Promise.resolve([!1,null])},t.prototype.callAndListen=function(e,t){return Promise.resolve([function(){},null])},t.prototype.loadProgress=function(e){return Promise.resolve([!0,null])},t.prototype.closeLoading=function(){return Promise.resolve([!0,null])},t.prototype.getDeviceInfo=function(){return Promise.resolve([!1,null])},t.prototype.getWebViewState=function(){return Promise.resolve([!1,null])},t.prototype.setLeftTopBackButton=function(e){return Promise.resolve([!1,null])},t.prototype.login=function(){return Promise.resolve([!1,null])},t.prototype.logout=function(){return Promise.resolve([!1,null])},t.prototype.getUserInfo=function(){return Promise.resolve([!1,null])},t.prototype.openWebView=function(e,t){switch(t){case de.Replace:case de.Single:setTimeout((function(){return globalThis.location.replace(e)}),200);break;case de.Append:default:setTimeout((function(){return globalThis.location.href=e}),200)}return Promise.resolve([!0,null])},t.prototype.closeWebView=function(){return globalThis.close(),Promise.resolve([!0,null])},t.prototype.getBangsHeight=function(){return Promise.resolve([0,null])},t.prototype.setOrientation=function(e){return Promise.resolve([!1,null])},t.prototype.keepScreenLight=function(e){return Promise.resolve([!1,null])},t.prototype.shock=function(e){return Promise.resolve([!1,null])},t.prototype.minimize=function(){return Promise.resolve([!1,null])},t.prototype.saveImage2Album=function(e){return Promise.resolve([!1,null])},t.prototype.detectMicro=function(){return new Promise((function(e){try{globalThis.navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return e([!0,null])})).catch((function(t){return e([!1,t])}))}catch(t){console.error(t),e([!1,t])}}))},t.prototype.actionShare=function(e){return Promise.resolve([!1,null])},t.prototype.preload=function(e){return Promise.resolve([!1,null])},t.prototype.createCacheProxyUrl=function(e){return[]},t}(fe),we={timeout:6e4},Se=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n._controller=new le,n.options=Object.assign(we,t),me||console.warn("未知容器:此版本 `jsBridge` 不支持当前 WebView 容器 ... "),n.webViewType=ie.WeChatMPWebView,n.callAndListen("common/webViewState",(function(e){n.emit("webViewStateChange",e)})),n.callAndListen("common/webViewError",(function(e){n.emit("error",e)})),n}return V(t,e),t.prototype.ready=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this._controller.checkReady(this.options.timeout)];case 1:return[2,e.sent()]}}))}))},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this._controller.callAndBackfeed(e)];case 1:return[2,t.sent()]}}))}))},t.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this._controller.callAndListen(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.setLeftTopBackButton=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return this.webViewType===ie.WebView?[2,[!0,null]]:[4,this.callAndBackfeed("common/setLeftTopBackButton?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.getBangsHeight=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getBangsHeight")];case 1:return[2,e.sent()]}}))}))},t.prototype.shock=function(e){return void 0===e&&(e=4),D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/shock?duration=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.minimize=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/minimize")];case 1:return[2,e.sent()]}}))}))},t.prototype.loadProgress=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e<0?0:e>100?100:e,[4,this.callAndBackfeed("common/loadProgress?progress=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeLoading=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeLoading")];case 1:return[2,e.sent()]}}))}))},t.prototype.setOrientation=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/setOrientation?orientation=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.keepScreenLight=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/keepScreenLight?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeWebView=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeWebView")];case 1:return[2,e.sent()]}}))}))},t.prototype.openWebView=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this.callAndBackfeed("common/openWebView?way=".concat(t,"&url=").concat(encodeURIComponent(e)))];case 1:return[2,n.sent()]}}))}))},t.prototype.saveImage2Album=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/saveImage2Album?base64=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.actionShare=function(e){var t,n,r;return D(this,void 0,void 0,(function(){var o;return H(this,(function(i){switch(i.label){case 0:return o={path:null===(t=e.miniprogram)||void 0===t?void 0:t[0].path,title:null===(n=e.miniprogram)||void 0===n?void 0:n[0].title,imageUrl:null===(r=e.miniprogram)||void 0===r?void 0:r[0].hdImageData},[4,this.callAndBackfeed("common/actionShare?json=".concat(JSON.stringify(o)))];case 1:return[2,i.sent()]}}))}))},t.prototype.getDeviceInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getDeviceInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getUserInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getUserInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getWebViewState=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getWebViewState")];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(){return D(this,void 0,void 0,(function(){var e;return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/login")];case 1:return(e=t.sent())[0]?[4,this.getUserInfo()]:[3,3];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},t.prototype.logout=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/logout")];case 1:return[2,e.sent()]}}))}))},t.prototype.detectMicro=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/detectMicro")];case 1:return[2,e.sent()]}}))}))},t.prototype.preload=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e.map((function(e){return e.startsWith("//")?"https:"+e:e})),[4,this.callAndBackfeed("common/preload?urls=".concat(JSON.stringify(e)))];case 1:return[2,t.sent()]}}))}))},t.prototype.createCacheProxyUrl=function(e){var t=this;e=Array.isArray(e)?e:[e];var n=window.navigator.userAgent;if(!/supportCache/i.test(n))return e;return e.map((function(e){return t.webViewType===ie.WKWebview?e.replace(/https*:/,"").replace(/\/\//,"realseeproxycache://"):t.webViewType===ie.WebView?e+(-1!==e.indexOf("?")?"&":"?")+"realseeproxycache=1":e}))},t.prototype.invokeNativeApi=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this._controller.invoke(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.execute=function(e,t){var n,r,o;return D(this,void 0,void 0,(function(){return H(this,(function(i){switch(i.label){case 0:return[4,null===(o=null===(r=null===(n=this._controller)||void 0===n?void 0:n.hybridBridge)||void 0===r?void 0:r.execute)||void 0===o?void 0:o.call(r,e,t)];case 1:return[2,i.sent()]}}))}))},t}(fe),ke=function(e){function t(t){return void 0===t&&(t={}),e.call(this),ge&&(pe||ve)?new be(t):me?new Se(t):new ye}return V(t,e),t}(fe);function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce,Te,Oe=(Ce=function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.OFF=4]="OFF"}(n=t.LogLevel||(t.LogLevel={})),t.default=n},Ce(Te={exports:{}},Te.exports),Te.exports),Ie=Ee(Oe);function Re(e,t){void 0===t&&(t={});var n=-1!==e.indexOf("?");return e+Object.keys(t).reduce((function(e,r,o){return"".concat(e).concat(0!==o||n?"&":"?").concat(r,"=").concat(t[r])}),"")}var Be=globalThis.navigator.userAgent,Ae=/android/gi.test(Be),Le=/iPhone|iPad\s+OS/gi.test(Be),Ne=/MicroMessenger/gi.test(Be)&&/miniProgram/gi.test(Be),We=/realsee/gi.test(Be);function Pe(e){return"[object Object]"===Object.prototype.toString.call(e)}function xe(e,t){return e===t||typeof e==typeof t&&!(!Number.isNaN(e)||!Number.isNaN(t))}function Me(e,t){return!!xe(e,t)||(Pe(e)&&Pe(t)?function(e,t){var n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(var o=0,i=n.length;o<i;o++){var s=n[o];if(!xe(e[s],t[s]))return!1}return!0}(e,t):!(!Array.isArray(e)||!Array.isArray(t))&&function(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(!xe(e[n],t[n]))return!1;return!0}(e,t))}function je(e,t){return!!xe(e,t)||(Pe(e)&&Pe(t)?function(e,t){var n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(var o=0,i=n.length;o<i;o++){var s=n[o];if(!je(e[s],t[s]))return!1}return!0}(e,t):!(!Array.isArray(e)||!Array.isArray(t))&&function(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(!je(e[n],t[n]))return!1;return!0}(e,t))}function Ve(e,t,n){return void 0===n&&(n={deep:!1}),n.deep?je(e,t):Me(e,t)}var Ue=function(e){function t(t){var n=e.call(this)||this;return n._readyState=exports.WebSocketState.NOTINITIALIZED,n._options={timeout:1e4,shouldReconnect:function(e,t){if(1008!==e.code&&1011!==e.code)return[0,3e3,1e4][t.attempts]},should1000Reconnect:!1,ignoreConnectivityEvents:!1,automaticOpen:!1},n._attempts=0,n._reconnects=-1,n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._connectivityEventsAttached=!1,n._healthCheck=function(){return u(n,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return this._realWebSocket&&this._realWebSocket.readyState!==this._readyState&&(this._readyState=this._realWebSocket.readyState,this._readyState===exports.WebSocketState.CLOSING&&this.emit("closing")),[4,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:return e.sent(),this._heathCheckTimer=requestAnimationFrame(this._healthCheck),[2]}}))}))},n._clearHeathCheckIfNeed=function(){n._heathCheckTimer&&(cancelAnimationFrame(n._heathCheckTimer),n._heathCheckTimer=void 0)},n._startHealthCheck=function(){n._clearHeathCheckIfNeed(),n._heathCheckTimer=requestAnimationFrame(n._healthCheck)},n._stopHealthCheck=function(){n._clearHeathCheckIfNeed()},n._clearPendingReconnectIfNeeded=function(){n._pendingReconnect&&(clearTimeout(n._pendingReconnect),n._pendingReconnect=void 0)},n._online=function(e){n._reconnectWhenOnlineAgain&&(n._clearPendingReconnectIfNeeded(),n._reconnect(e))},n._offline=function(){var e;n._reconnectWhenOnlineAgain=!0,null===(e=n._realWebSocket)||void 0===e||e.close(1e3,"offline")},n._detachConnectivityEvents=function(){n._connectivityEventsAttached&&(null===globalThis||void 0===globalThis||globalThis.removeEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.removeEventListener("offline",n._offline),n._connectivityEventsAttached=!1)},n._attachConnectivityEvents=function(){n._connectivityEventsAttached||(null===globalThis||void 0===globalThis||globalThis.addEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.addEventListener("offline",n._offline),n._connectivityEventsAttached=!0)},n.send=function(e){var t,r,o;(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)===(null===(r=n._realWebSocket)||void 0===r?void 0:r.OPEN)&&(null===(o=n._realWebSocket)||void 0===o||o.send(e))},n.close=function(e,t){var r;return"number"!=typeof e&&(t=e,e=1e3),n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!0,n._detachConnectivityEvents(),null===(r=n._realWebSocket)||void 0===r?void 0:r.close(e,t)},n.open=function(e){var t,r;e&&(n._url=e),(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)!==WebSocket.OPEN&&(null===(r=n._realWebSocket)||void 0===r?void 0:r.readyState)!==WebSocket.CONNECTING&&(n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._createWebSocket())},n._createWebSocket=function(){var e,t,r,o="string"==typeof n._url?n._url:null===(e=n._url)||void 0===e?void 0:e.call(n,n);if(o){n._pendingReconnect=void 0,n._removeWebSocketEvent(),n._realWebSocket=new WebSocket(o,n._protocols||void 0),n._attempts=n._attempts+1,n.emit("connecting",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}));n._connectTimeout=setTimeout((function(){n._connectTimeout=void 0,n._detachConnectivityEvents(),n.emit("timeout",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}))}),null===(t=n._options)||void 0===t?void 0:t.timeout),n._dispatchWebSocketEvent(),(null===(r=n._options)||void 0===r?void 0:r.ignoreConnectivityEvents)||n._attachConnectivityEvents()}},n._removeWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.removeEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.removeEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.removeEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.removeEventListener("message",n._webSocketMessageHandler)},n._dispatchWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.addEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.addEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.addEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.addEventListener("message",n._webSocketMessageHandler)},n._webSocketOpenHandler=function(e){n._connectTimeout&&(clearTimeout(n._connectTimeout),n._connectTimeout=void 0);var t=++n._reconnects,r=n._attempts;return n._attempts=0,n._reconnectWhenOnlineAgain=!1,n._startHealthCheck(),n.emit("open",Object.assign(e,{detail:{reconnects:t,attempts:r}}))},n._webSocketCloseHandler=function(e){return n._reconnect(e),n._stopHealthCheck(),n.emit("close",e)},n._webSocketErrorHandler=function(e){return n.emit("error",new CustomEvent("error",{detail:{error:e}}))},n._webSocketMessageHandler=function(e){return n.emit("message",e)},t&&n.setOptions(t),n._startHealthCheck(),n}return c(t,e),Object.defineProperty(t.prototype,"attempts",{get:function(){return this._attempts},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(e){if(e){this._url=e.url,this._protocols=e.protocols;var t=Object.assign(this._options,e.robustOptions||{});if("number"!=typeof(null==t?void 0:t.timeout))throw new Error("timeout must be the number of milliseconds to timeout a connection attempt");if("function"!=typeof(null==t?void 0:t.shouldReconnect))throw new Error("shouldReconnect must be a function that returns the number of milliseconds to wait for a reconnect attempt, or null or undefined to not reconnect.");this._options=t,this._options.automaticOpen&&this._createWebSocket()}},t.prototype._reconnect=function(e){var t,n,r,o;if(!(null===(t=this._options)||void 0===t?void 0:t.should1000Reconnect)&&1e3===e.code||this._explicitlyClosed)this._attempts=0;else if(!1!==(null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===n?void 0:n.onLine)){var i=null===(o=null===(r=this._options)||void 0===r?void 0:r.shouldReconnect)||void 0===o?void 0:o.call(r,e,this);"number"==typeof i&&(this._pendingReconnect=setTimeout(this._createWebSocket,i))}else this._reconnectWhenOnlineAgain=!0},t}(m),De=function(e){function t(){var t=e.call(this)||this;return t._ws=new Ue({url:"",robustOptions:{timeout:18e4}}),t._state=exports.LiveState.NOTINITIALIZED,t._addWebSocketEventListeners=function(){t._ws.on("close",t._handleCloseEvent),t._ws.on("closing",t._handleClosingEvent),t._ws.on("connecting",t._handleConnectingEvent),t._ws.on("error",t._handleErrorEvent),t._ws.on("message",t._handleMessageEvent),t._ws.on("open",t._handleOpenEvent),t._ws.on("timeout",t._handleTimeoutEvent)},t._removeWebSocketEventListeners=function(){t._ws.off("close",t._handleCloseEvent),t._ws.off("closing",t._handleClosingEvent),t._ws.off("connecting",t._handleConnectingEvent),t._ws.off("error",t._handleErrorEvent),t._ws.off("message",t._handleMessageEvent),t._ws.off("open",t._handleOpenEvent),t._ws.off("timeout",t._handleTimeoutEvent)},t._handleCloseEvent=function(e){y.info("live room closed bacause of ".concat(e.code,"-").concat(e.reason||M(e.code))),t.state=exports.LiveState.CLOSED},t._handleClosingEvent=function(){var e;y.info("live room is closing, onLine:",null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===e?void 0:e.onLine),t.state=exports.LiveState.CLOSED},t._handleConnectingEvent=function(){y.info("live room is connecting"),t.state=exports.LiveState.CONNECTING},t._handleErrorEvent=function(e){y.error("live room error",e),t.state=exports.LiveState.CLOSED},t._handleMessageEvent=function(e){var n=function(){try{return JSON.parse(e.data)}catch(t){return e.data}}();t.emit("message",n)},t._handleOpenEvent=function(e){y.info("live room open",e.detail),t.state=exports.LiveState.OPEN,e.detail.reconnects>0&&t.emit("reconnected",e.detail)},t._handleTimeoutEvent=function(e){y.error("live room connect timeout!",e.detail),t.state=exports.LiveState.CLOSED},t.dispose=function(){return u(t,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return this._removeWebSocketEventListeners(),[4,this.close("live room close by controller disposed!")];case 1:return[2,e.sent()]}}))}))},t.open=function(e){return t._ws.open(e)},t.close=function(e,n){return new Promise((function(r){t._ws.once("close",(function(){return r(!0)})),t._ws.close(e,n)}))},t._addWebSocketEventListeners(),t}return c(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var t=JSON.parse(JSON.stringify(this._state));this._state=e,this.emit("stateChange",this.state,t)},enumerable:!1,configurable:!0}),t.prototype.sendMessage=function(e){if(void 0===e&&(e=""),null==e||""===e)throw new Error("live message is empty!");if(this.state===exports.LiveState.OPEN)return this._ws.send(JSON.stringify(e));throw new Error("live has not yet been initialized!")},t}(m),He=function(e){return Promise.reject("unimplemented method GetVoiceSign")},Je=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n=[]),{command:e,front_request_id:S(),data:a(a({},t),{to_user_ids:Array.isArray(n)?n:[n]})}},qe=function(e){function t(t){var n,r=this;return(r=e.call(this)||this)._options={},r.keyframes=new m,r._buildInData={keyframes:{}},r.getFramesByKey=function(e){return r.snapshot[e]},r.sendKeyframe=function(e,t){var n;if(r.state!==exports.LiveState.OPEN)return!1;r._buildInData.keyframes=a(a({},r._buildInData.keyframes),((n={})[e]=t,n));var o=Je(exports.Command.KeyframeSync,r.snapshot);try{return r._controller.sendMessage(o),!0}catch(e){return y.error(e),!1}},r._controller=new De,r._addLiveControllerEventListeners=function(){r._controller.on("stateChange",r._handleStateChange),r._controller.on("message",r._handleMessage)},r._removeLiveControllerEventListeners=function(){r._controller.off("stateChange",r._handleStateChange),r._controller.off("message",r._handleMessage)},r._handleStateChange=function(e,t){return r.emit("stateChange",e,t)},r._handleMessage=function(e){return u(r,void 0,void 0,(function(){var t,n,r,o,i,s,c,a,u,f,h,p,v,m,g,_,b,w,S,k,E=this;return l(this,(function(l){switch(l.label){case 0:if("object"!=typeof e)return[3,22];if(t=e.command,n=e.data,r=void 0===n?{}:n,o=e.frontRequestId,"SUCCESS"!==e.code)return[3,21];switch(t){case exports.Command.SelfUserInfo:return[3,1];case exports.Command.RoomInfo:return[3,2];case exports.Command.RTCInfo:return[3,3];case exports.Command.UserList:return[3,10];case exports.Command.CustomEvent:return[3,11];case exports.Command.KeyframeSync:return[3,12];case exports.Command.BuiltinMsg:return[3,13];case exports.Command.UserKickOut:return[3,18]}return[3,19];case 1:return i=r,Ve(this.selfInfo,i,{deep:!0})||(this._buildInData.selfInfo=i,this.emit("selfInfoUpdate",this._buildInData.selfInfo,o)),[3,20];case 2:return s=r,this._buildInData.roomInfo=Object.assign({},s),this.emit("readyKeyframeSync",s.last_frame||{}),[3,20];case 3:return a=(c=r).voice_id,u=c.type,this._buildInData.rtcInfo={voiceId:a,type:u},(null===(_=this.$RTC)||void 0===_?void 0:_.joined)?[3,8]:[4,null===(b=this.$RTC)||void 0===b?void 0:b.join({voiceId:a,userId:(null===(w=this.selfInfo)||void 0===w?void 0:w.id)||"",roomId:null===(S=this.roomInfo)||void 0===S?void 0:S.info.room_code,type:u})];case 4:return l.sent()?(f=null!==(k=this._options.initialMicroStatus)&&void 0!==k?k:exports.MicroStatus.OPEN,[4,this.toggleMicro(f===exports.MicroStatus.OPEN)]):[3,6];case 5:return l.sent(),[3,7];case 6:y.error("加入语音房间失败"),l.label=7;case 7:return[3,9];case 8:y.warn("已加入语音房间,无需重复加入!"),l.label=9;case 9:return[3,20];case 10:return h=r,this._buildInData.userList=h,this.emit("userListUpdate",this.userList,o),[3,20];case 11:return p=r,this.emit("broadcast",p,o),[3,20];case 12:return v=r,m=Object.keys(v).reduce((function(e,t){var n;if(Ve(v[t],E._buildInData.keyframes[t],{deep:!0}))return e;var r=[v[t],E._buildInData.keyframes[t],o],i=t;return(n=E.keyframes).emit.apply(n,d([i],r,!1)),E._buildInData.keyframes[t]=v[t],e[t]=v[t],e}),{}),this.emit("keyframes",m,o),[3,20];case 13:return g=r,this.emit("builtinEvent",g),g.event_type===exports.BuiltinEventType.UserChange&&this.emit("userChange",g),g.event_type===exports.BuiltinEventType.RoomChange&&this.emit("roomChange",g),g.event_type!==exports.BuiltinEventType.UserChange||g.action!==exports.BuiltinActionType.UserMicroStatus?[3,15]:[4,this.toggleMicro(g.data.status===exports.MicroStatus.OPEN)];case 14:l.sent(),l.label=15;case 15:return g.event_type!==exports.BuiltinEventType.RoomChange||g.action!==exports.BuiltinActionType.RoomClose?[3,17]:[4,this.exit()];case 16:l.sent(),l.label=17;case 17:return[3,20];case 18:return this.emit("kickOut"),[3,20];case 19:console.warn("unknown command: ",t),l.label=20;case 20:return[3,22];case 21:this.emit("error",e),l.label=22;case 22:return[2]}}))}))},r._clearLiveData=function(){r._buildInData={keyframes:{}}},r.connect=function(e){return void 0===e&&(e={}),u(r,void 0,void 0,(function(){var t,n,r,o,i,s,c,a,u,d,f,h;return l(this,(function(l){switch(l.label){case 0:return this._options.url=null!==(d=null!==(u=e.url)&&void 0!==u?u:this._options.url)&&void 0!==d?d:"",this._options.getTicket=null!==(f=e.getTicket)&&void 0!==f?f:this._options.getTicket,this._options.initialMicroStatus=null!==(h=e.rtcMicStatus)&&void 0!==h?h:this._options.initialMicroStatus,/^ws(s):\/\//.test(this._options.url)&&"function"==typeof this._options.getTicket?(t=e.force,n=void 0!==t&&t,this._options.rtc?[4,this._options.rtc.detectMicro()]:[3,2]):/^ws(s):\/\//.test(this._options.url)?"function"!=typeof this._options.getTicket?[2,new Error("getTicket muse be function")]:[2,!1]:[2,new Error("Illegal realsee live room link")];case 1:if(!l.sent())return[2,new Error("Failed to obtain microphone authorization")];l.label=2;case 2:if((r=this.state)!==exports.LiveState.CONNECTING&&r!==exports.LiveState.OPEN)return[3,8];if(!n)return[3,7];l.label=3;case 3:return l.trys.push([3,5,,6]),[4,this._controller.close("force close by connect")];case 4:return l.sent(),[3,6];case 5:return o=l.sent(),console.warn(o),[3,6];case 6:return[3,8];case 7:return[2,new Error("已有Live实例正在连接中,请勿重复连接!")];case 8:return this._clearLiveData(),s=Re,c=[this._options.url],a={},[4,this._options.getTicket()];case 9:return i=s.apply(void 0,c.concat([(a.ticket=l.sent(),a.force=Number(!!n),a)])),this._controller.open(i),[2,!0]}}))}))},r.exit=function(){return u(r,void 0,void 0,(function(){var e,t;return l(this,(function(n){switch(n.label){case 0:if(this._clearLiveData(),this.state!==exports.LiveState.OPEN)return[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this.$RTC)||void 0===t?void 0:t.quit()];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),y.warn(e),[3,4];case 4:return[4,this._controller.close()];case 5:return[2,n.sent()]}}))}))},r.close=function(){return u(r,void 0,void 0,(function(){var e,t;return l(this,(function(n){switch(n.label){case 0:return(null===(t=null===(e=this.selfInfo)||void 0===e?void 0:e.permission)||void 0===t?void 0:t.close_live_room)?[4,this.updateStatus(exports.BuiltinEventType.RoomChange,exports.BuiltinActionType.RoomClose,{})]:[3,2];case 1:return[2,n.sent()];case 2:return[2]}}))}))},r.dispose=function(){return u(r,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return this._removeLiveControllerEventListeners(),this._clearLiveData(),[4,this._controller.dispose()];case 1:return[2,e.sent()]}}))}))},r.setSelfInfo=function(e){return u(r,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserInfo,e)];case 1:return[2,t.sent()]}}))}))},r.toggleMicro=function(e){return u(r,void 0,void 0,(function(){var t,n,r,o;return l(this,(function(i){switch(i.label){case 0:return(null===(r=null===(n=this.selfInfo)||void 0===n?void 0:n.permission)||void 0===r?void 0:r.control_own_micro)?[4,null===(o=this.$RTC)||void 0===o?void 0:o.toggleMicro(e)]:[2,!1];case 1:return(t=i.sent())?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserMicroStatus,{status:e?exports.MicroStatus.OPEN:exports.MicroStatus.CLOSE},[])]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2,t]}}))}))},r.forbidMicro=function(e,t){return u(r,void 0,void 0,(function(){var n,r;return l(this,(function(o){switch(o.label){case 0:return("function"!=typeof this._options.canForbidUserMicro||this._options.canForbidUserMicro(t))&&(null===(r=null===(n=this.selfInfo)||void 0===n?void 0:n.permission)||void 0===r?void 0:r.control_other_micro)?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserMicroStatus,{status:e},t)]:[2,!1];case 1:return[2,o.sent()]}}))}))},r.forbidSync=function(e,t){return u(r,void 0,void 0,(function(){var n,r;return l(this,(function(o){switch(o.label){case 0:return("function"!=typeof this._options.canForbidUserSync||this._options.canForbidUserSync(t))&&(null===(r=null===(n=this.selfInfo)||void 0===n?void 0:n.permission)||void 0===r?void 0:r.control_other_sync)?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserPermission,{sync_frame:e},t)]:[2,!1];case 1:return[2,o.sent()]}}))}))},r.kick=function(e){return u(r,void 0,void 0,(function(){var t,n;return l(this,(function(r){switch(r.label){case 0:return("function"!=typeof this._options.canForbidUserKick||this._options.canForbidUserKick(e))&&(null===(n=null===(t=this.selfInfo)||void 0===t?void 0:t.permission)||void 0===n?void 0:n.change_other_status)?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserStatus,{status:"KICK_OUT"},e)]:[2,!1];case 1:return[2,r.sent()]}}))}))},r._addLiveControllerEventListeners(),r._options=Object.assign({initialMicroStatus:exports.MicroStatus.OPEN},t),r._options.jsBridge=t.jsBridge?t.jsBridge:t.useBuiltInJsBridge?new ke:void 0,r._options.getVoiceSign=null!==(n=t.getVoiceSign)&&void 0!==n?n:He,r._options.autoPlayConfirm=t.autoPlayConfirm,r._options.rtc=function(){if(t.rtc)return t.rtc;if(t.rtcType)switch(t.getVoiceSign||y.error("GetVoiceSign method must be passed when using built-in RTC instances"),t.rtcType){case exports.RTCType.RealseeVRWebViewRTC:return r._options.jsBridge?new x({jsBridge:r._options.jsBridge,getVoiceSign:r._options.getVoiceSign}):void y.error("JsBridge instance must be passed when using built-in VRWebViewRTC instances");case exports.RTCType.RealseeBrowserChimeRTC:return new C({getVoiceSign:r._options.getVoiceSign,logLevel:t.__debug__?Ie.DEBUG:Ie.ERROR});case exports.RTCType.RealseeBrowserRTC:return r._options.autoPlayConfirm||y.error("autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"),new E({getVoiceSign:r._options.getVoiceSign,autoPlayConfirm:r._options.autoPlayConfirm});default:return void y.error("unknown built-in RTC type")}return t.useBuiltInRTC?(t.getVoiceSign||y.error("GetVoiceSign method must be passed when using built-in RTC instances"),r._options.jsBridge?We&&(Ae||Le)||Ne?new x({jsBridge:r._options.jsBridge,getVoiceSign:r._options.getVoiceSign}):t.builtInRTCType===exports.BuiltInRTCType.RealseeXChimeRTC?new C({getVoiceSign:r._options.getVoiceSign}):new E({getVoiceSign:r._options.getVoiceSign,autoPlayConfirm:r._options.autoPlayConfirm}):void y.error("jsBridge instance must be passed when using built-in RTC instances")):void 0}(),r._options.rtc||y.warn("unused rtc"),r._options.url&&r._options.getTicket&&r.connect(),r._options.__debug__&&Object.assign(window,{$liveController:r._controller,$live:r}),r}return c(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return Object.freeze(this._options||{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._controller.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readyState",{get:function(){return this._controller.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.options.url},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"$RTC",{get:function(){return this._options.rtc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsBridge",{get:function(){return this._options.jsBridge},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this._buildInData.keyframes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfInfo",{get:function(){return this._buildInData.selfInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userList",{get:function(){return this._buildInData.userList||[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomInfo",{get:function(){return this._buildInData.roomInfo},enumerable:!1,configurable:!0}),t.prototype.updateStatus=function(e,t,n,r){return u(this,void 0,void 0,(function(){var o,i;return l(this,(function(s){if(this.state!==exports.LiveState.OPEN)return[2,!1];o=Object.assign({event_type:e,action:t},{data:n}),i=Je(exports.Command.BuiltinMsg,o,r);try{return this._controller.sendMessage(i),[2,!0]}catch(e){return y.error(e),[2,!1]}return[2]}))}))},t.prototype.broadcast=function(e,t,n){var r=this;return this.state===exports.LiveState.OPEN&&new Promise((function(o,i){var s=Je(exports.Command.CustomEvent,e,t),c=s.front_request_id,a=n?setTimeout((function(){i(new Error("RESPONSE TIMEOUT")),r.off("broadcast",u)}),n):void 0,u=function(e,t){t===c&&(a&&clearTimeout(a),r.off("broadcast",u),o(e))};r.on("broadcast",u);try{r._controller.sendMessage(s)}catch(e){i(e)}}))},t}(m),$e=function(e){var t,n;return(null===window||void 0===window?void 0:window.__Realsee_Live__)&&(null===(n=null===(t=null===window||void 0===window?void 0:window.__Realsee_Live__)||void 0===t?void 0:t.dispose)||void 0===n||n.call(t),window.__Realsee_Live__=null),new qe(e)};exports.BrowserRTC=E,exports.BrowserRTC4Chime=C,exports.CoreRTC=g,exports.VRWebViewRTC=x,exports.createLive=$e,exports.createLiveReact=function(e){var t=this,r=n.createContext(null),o=$e(e),s=o.jsBridge,c=function(){var e=i.default.useContext(r);if(!e)throw new Error("LiveProvider never found.");return e};return{live:o,jsBridge:s,LiveProvider:function(e){return i.default.createElement(r.Provider,{value:o},e.children)},unsafe__useLiveInstance:function(){return o},unsafe__useRTCInstance:function(){return o.$RTC},useConnect:function(){return function(e){return u(t,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,o.connect(e)];case 1:return[2,t.sent()]}}))}))}},useKeyframe:function(e){var t=c(),n=i.default.useState(t.getFramesByKey(e)),r=n[0],o=n[1];return i.default.useEffect((function(){var n=e,r=function(e){return o(e)};return t.keyframes.on(n,r),function(){return t.keyframes.off(n,r)}}),[t]),[r,i.default.useCallback((function(n){return t.sendKeyframe(e,n)}),[t])]},useKeyframeUpdateCallback:function(e,t,n){void 0===n&&(n=[]);var r=c(),o=d([r,name],n,!0),s=function(){return r.keyframes.off(e,t)};return i.default.useEffect((function(){return r.keyframes.on(e,t),s}),o),s},useLiveAction:function(){var e=this,t=c();return{connect:function(n){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.connect(n)];case 1:return[2,e.sent()]}}))}))},broadcast:function(n,r,o){return void 0===o&&(o=0),u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.broadcast(n,r,o)];case 1:return[2,e.sent()]}}))}))},exit:function(){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.exit()];case 1:return[2,e.sent()]}}))}))},kick:function(n){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.kick(n)];case 1:return[2,e.sent()]}}))}))},toggleMicro:function(e){return t.toggleMicro(e)},forbidMicro:function(n,r){return void 0===r&&(r=[]),u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.forbidMicro(n,r)];case 1:return[2,e.sent()]}}))}))},forbidSync:function(e,n){return void 0===n&&(n=[]),t.forbidSync(e,n)},sendKeyframe:function(e,n){return t.sendKeyframe(e,n)},getFramesByKey:function(e){return t.getFramesByKey(e)},setSelfInfo:function(e){return t.setSelfInfo(e)},updateStatus:function(e,n,r,o){return t.updateStatus(e,n,r,o)}}},useLiveEventCallback:function(e,t,n){void 0===n&&(n=[]);var r=c(),o=function(){return r.off(e,t)},s=d([r,e],n,!0);return i.default.useEffect((function(){return r.on(e,t),o}),s),o},useLiveState:function(){var e=c(),t=i.default.useState(e.state),n=t[0],r=t[1];return i.default.useEffect((function(){var t=function(e){return r(e)};return e.on("stateChange",t),function(){return e.off("stateChange",t)}}),[e]),n},useRTCAction:function(){var e=c();return{join:function(t){return e.$RTC.join(t)},quit:function(){return e.$RTC.quit()},shock:function(){var t,n;return null===(n=(t=e.$RTC).shock)||void 0===n?void 0:n.call(t)},toggleMicro:function(t){return e.$RTC.toggleMicro(t)},detectMicro:function(){return e.$RTC.detectMicro()}}},useRTCEventCallback:function(e,t,n){void 0===n&&(n=[]);var r=c(),o=function(){return r.$RTC.off(e,t)},s=d([r,e],n,!0);return i.default.useEffect((function(){return r.$RTC.on(e,t),o}),s),o},useSelfInfo:function(){var e=this,t=c(),n=i.default.useState(t.selfInfo||{}),r=n[0],o=n[1],s=function(e){return o(e)};i.default.useEffect((function(){return t.on("selfInfoUpdate",s),function(){return t.off("selfInfoUpdate",s)}}),[t]);var a=i.default.useCallback((function(n){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.setSelfInfo(n)];case 1:return[2,e.sent()]}}))}))}),[t]);return[r,a]},useKeyframesSnapshot:function(){var e=c(),t=i.default.useState(e.snapshot),n=t[0],r=t[1];return i.default.useEffect((function(){var t=function(e){return r(e)};return e.on("keyframes",t),function(){return e.off("keyframes",t)}})),n},useUserList:function(){var e=c(),t=i.default.useState(e.userList),n=t[0],r=t[1],o=function(e){return r(e)};return i.default.useEffect((function(){return e.on("userListUpdate",o),function(){return e.off("userListUpdate",o)}}),[e]),n}}},exports.parseLiveMsg=function(e){try{var t=JSON.parse(e),n={code:t.code,message:t.message,command:t.command,roomCode:t.room_code,appID:t.app_id,requestId:t.request_id,frontRequestId:t.front_request_id,triggerUserID:t.trigger_user_id,data:t.data||{}},r=Object.keys(n).filter((function(e){return void 0===n[e]}));return r.length>0&&console.warn("推送数据格式异常:".concat(r.join(" ")," 值不存在!")),n}catch(e){return!1}},exports.parseWSClsErr=M;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("trtc-js-sdk"),t=require("amazon-chime-sdk-js"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),i=r(n),s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((r=r.apply(e,t||[])).next())}))}function l(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function d(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var f=Symbol("$$REALSEE_LIVE_EVENT$$");function h(e){return e[f]||(e[f]={}),e[f]}var p,v,m=function(){function e(){}return e.prototype.hasListener=function(e){var t=h(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,n){var r=this,o=h(this);return o[e]||(o[e]=[]),o[e].push([t,n||!1]),function(){return r.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var n,r=h(this);if(r[e]||(r[e]=[]),void 0!==t){for(var o=0;o<r[e].length&&r[e][o][0]!==t;o++);o<r[e].length&&r[e].splice(o,1)}else r[e].length=0}else(n=this)[f]||delete n[f]},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=!1,o=h(this),i=o[e]||[],s=0,c=i.slice();s<c.length;s++){var a=c[s],u=a[0],l=a[1],d=void 0!==l&&l,f=u.apply(void 0,t);d&&this.off(e,u),!1===f&&(r=!0)}return r},e}(),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t}(m);exports.RTCType=void 0,(p=exports.RTCType||(exports.RTCType={})).RealseeBrowserRTC="RealseeBrowserRTC",p.RealseeVRWebViewRTC="RealseeVRWebViewRTC",p.RealseeBrowserChimeRTC="RealseeBrowserChimeRTC",exports.BuiltInRTCType=void 0,(v=exports.BuiltInRTCType||(exports.BuiltInRTCType={})).RealseeXTRTC="trtc",v.RealseeXChimeRTC="chime";var _;!function(e){e.info="INFO",e.log="LOG",e.error="ERROR",e.warn="WARN"}(_||(_={}));var b=function(e,t){var n,r,o,i,s,c,a,u;switch(void 0===t&&(t=[]),t.unshift("Realsee Live ".concat((n=new Date,r=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0"),i=n.getDate().toString().padStart(2,"0"),s=n.getHours().toString().padStart(2,"0"),c=n.getMinutes().toString().padStart(2,"0"),a=n.getSeconds().toString().padStart(2,"0"),u=n.getMilliseconds(),"[".concat(r,"-").concat(o,"-").concat(i," ").concat(s,":").concat(c,":").concat(a,".").concat(u,"]"))," <").concat(e,"> ")),e){case _.info:return console.info.apply(console,t);case _.error:return console.error.apply(console,t);case _.warn:return console.warn.apply(console,t);default:return console.log.apply(console,t)}},y={log:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.log,e)},info:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.info,e)},error:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.error,e)},warn:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b(_.warn,e)}};function w(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function S(){return(w()+w()+"-"+w()+"-4"+w().substr(0,3)+"-"+w()+"-"+w()+w()+w()).toLowerCase()}var k,E=function(e){function t(t){var n=e.call(this)||this;return n.type=exports.RTCType.RealseeBrowserRTC,n.joined=!1,n.micro=!1,n.voiceId="",n._getVoiceSign=function(){throw new Error("方法 getVoiceSign 未实现")},n.checkRequirement=function(){return o.default.checkSystemRequirements()},n.$dom=document.createElement("div"),n._trtc={client:null,stream:null},n.join=function(e){return u(n,void 0,void 0,(function(){var t,n,r,i=this;return l(this,(function(s){switch(s.label){case 0:return this.emit("joinWillStart"),[4,this._getVoiceSign({voiceId:e.voiceId,roomId:e.roomId,userId:e.userId})];case 1:return t=s.sent(),this._trtc.client=o.default.createClient(a(a({mode:"rtc"},t),{enableAutoPlayDialog:"function"!=typeof this._autoPlayConfirm})),null===(r=this._trtc.client)||void 0===r||r.enableAudioVolumeEvaluation(),this._registerRtcEvent(),[4,new Promise((function(t){var n;null===(n=i._trtc.client)||void 0===n||n.join({roomId:Number(e.voiceId)}).then((function(){return t(!0)})).catch((function(){return t(!1)}))}))];case 2:return n=s.sent(),this.joined=n,n?(this._trtc.stream=o.default.createStream({userId:t.userId,audio:!0,video:!1}),[4,new Promise((function(e){var t;null===(t=i._trtc.stream)||void 0===t||t.initialize().then((function(){return e(!0)})).catch((function(){return e(!1)}))}))]):[2,!1];case 3:return n=s.sent(),[4,new Promise((function(e){var t;null===(t=i._trtc.client)||void 0===t||t.publish(i._trtc.stream).then((function(){return e(!0)})).catch((function(){return e(!1)}))}))];case 4:return n=s.sent(),this.joined=n,this.joined&&this.emit("joined"),[2,n]}}))}))},n._handleStreamAdded=function(e){var t,r=e.stream;console.log("远端流增加: "+r.getId()),null===(t=n._trtc.client)||void 0===t||t.subscribe(r)},n._handleStreamSubscribed=function(e){var t=e.stream;console.log("远端流订阅成功:"+t.getId());var r=t.getId(),o="rs-rtc-remote_stream-".concat(r),i=document.createElement("div");i.id=o,n.$dom.appendChild(i),"function"==typeof n._autoPlayConfirm?(t.play(o).catch((function(e){})),t.on("error",(function(e){if(16451===e.getCode()){n._autoPlayConfirm({onConfirm:function(){return t.resume()}})}}))):t.play(o)},n._getVoiceSign=t.getVoiceSign,n._autoPlayConfirm=t.autoPlayConfirm,n._initParentDom(),n}return c(t,e),t.prototype._initParentDom=function(){this.$dom.id="rs-rtc-".concat(S()),this.$dom.style.display="none",document.body.appendChild(this.$dom)},t.prototype.quit=function(){var e=this;return new Promise((function(t){return u(e,void 0,void 0,(function(){var e,n,r=this;return l(this,(function(o){switch(o.label){case 0:return this.joined=!1,this._trtc.stream?[4,null===(e=this._trtc.client)||void 0===e?void 0:e.unpublish(this._trtc.stream)]:[3,2];case 1:o.sent(),this._trtc.stream.stop(),this._trtc.stream.close(),this._trtc.stream=null,o.label=2;case 2:return null===(n=this._trtc.client)||void 0===n||n.leave().then((function(){return r._trtc.client=null})).then((function(){return t(!0)})).catch((function(){return t(!1)})),t(!0),[2]}}))}))}))},t.prototype.detectMicro=function(){return new Promise((function(e){try{navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return e(!0)})).catch((function(t){y.error(t.message),e(!1)}))}catch(t){console.error(t),e(!1)}}))},t.prototype.toggleMicro=function(e){var t,n,r,o;return Promise.resolve((e?null===(n=null===(t=this._trtc)||void 0===t?void 0:t.stream)||void 0===n?void 0:n.unmuteAudio():null===(o=null===(r=this._trtc)||void 0===r?void 0:r.stream)||void 0===o?void 0:o.muteAudio())||!1)},t.prototype.shock=function(){throw new Error("Method not implemented.")},t.prototype._registerRtcEvent=function(){var e,t,n,r,o=this;null===(e=this._trtc.client)||void 0===e||e.on("stream-added",this._handleStreamAdded),null===(t=this._trtc.client)||void 0===t||t.on("stream-subscribed",this._handleStreamSubscribed),null===(n=this._trtc.client)||void 0===n||n.on("audio-volume",(function(e){return o.emit("userVolumes",e.result.map((function(e){return{userId:e.userId,audioVolume:e.audioVolume}})))})),null===(r=this._trtc.client)||void 0===r||r.on("error",(function(e){return o.emit("error",e)}))},t}(g),C=function(e){function n(n){var r=e.call(this)||this;return r.type=exports.RTCType.RealseeBrowserChimeRTC,r.joined=!1,r.micro=!1,r.voiceId="",r.userId="",r.deviceChangeObserver={},r.audioVideoObserver={},r._getVoiceSign=function(){throw new Error("方法 getVoiceSign 未实现")},r.$dom=document.createElement("div"),r.$audio=document.createElement("audio"),r._initDom=function(){r.$audio.id="rs-rtc-".concat(S()),r.$dom.id="rs-rtc-".concat(S()),r.$dom.appendChild(r.$audio),document.body.appendChild(r.$dom)},r.initObservers=function(){r.deviceChangeObserver={audioInputsChanged:function(e){null==e||e.forEach((function(e){r.logger.info("Device ID: ".concat(e.deviceId," Microphone: ").concat(e.label))}))},audioOutputsChanged:function(e){r.logger.info("Audio outputs updated: ".concat(e))},videoInputsChanged:function(e){r.logger.info("Video inputs updated: ".concat(e))},audioInputMuteStateChanged:function(e,t){r.logger.info("Device ".concat(e.toString()," ").concat(t?"is muted in hardware":"is not muted"))}},r.audioVideoObserver={audioVideoDidStart:function(){r.logger.info("Started")},audioVideoDidStop:function(e){r.logger.info("Stopped with a session status code: ".concat(e.statusCode()))},audioVideoDidStartConnecting:function(e){e&&r.logger.info("Attempting to reconnect")}}},r._registerRtcEvent=function(){var e,n,o,i,s,c,a=(null===(o=null===(n=null===(e=r.meetingSession)||void 0===e?void 0:e.configuration)||void 0===n?void 0:n.credentials)||void 0===o?void 0:o.attendeeId)||"";if(a){var u=new Map,l=function(){var e=[];return u.forEach((function(t,n){e.push({userId:t.userId,volume:t.muted||0===t.signalStrength||!Boolean(t.volume)?0:t.volume})})),e};null===(i=r.meetingSession)||void 0===i||i.audioVideo.realtimeSubscribeToAttendeeIdPresence((function(e,n,o){var i;if(!n)return u.delete(e),void r.emit("userVolumes",l());null===(i=r.meetingSession)||void 0===i||i.audioVideo.realtimeSubscribeToVolumeIndicator(e,(function(e,n,i,s){new t.DefaultModality(e).base()===e&&(u.set(e,{userId:o||e,volume:n,muted:i,signalStrength:s}),r.emit("userVolumes",l()))}))})),null===(s=r.meetingSession)||void 0===s||s.audioVideo.realtimeSubscribeToVolumeIndicator(a,(function(e,n,o,i){new t.DefaultModality(e).base()===e&&null!==i&&1!==i&&r.emit("weakNetwork")})),null===(c=r.meetingSession)||void 0===c||c.audioVideo.realtimeSubscribeToFatalError((function(e){return r.emit("error",e)}))}},r._getVoiceSign=n.getVoiceSign,r._initDom(),r.logger=new t.ConsoleLogger("WebRTCLogger",n.logLevel||t.LogLevel.INFO),r.deviceController=new t.DefaultDeviceController(r.logger),r.initObservers(),r}return c(n,e),n.prototype.join=function(e){return u(this,void 0,void 0,(function(){var n=this;return l(this,(function(r){return[2,new Promise((function(r,o){return u(n,void 0,void 0,(function(){var n,o,i,s,c,u,d,f,h,p,v,m,g,_=this;return l(this,(function(l){switch(l.label){case 0:this.emit("joinWillStart"),l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this._getVoiceSign(a(a({},e),{roomId:e.roomId||0}))];case 2:return n=l.sent(),o=n.userId,i=n.userSig,this.userId=o,s=JSON.parse(decodeURIComponent(i)),c=s.attendence,u=s.vendor_wrapper,d=new t.MeetingSessionConfiguration({Meeting:u},{Attendee:{ExternalUserId:c.external_user_id,AttendeeId:c.attendee_id,JoinToken:c.join_token}}),this.meetingSession=new t.DefaultMeetingSession(d,this.logger,this.deviceController),this._registerRtcEvent(),this.meetingSession.audioVideo.addDeviceChangeObserver(this.deviceChangeObserver),this.meetingSession.audioVideo.addObserver(this.audioVideoObserver),this.meetingSession.audioVideo.bindAudioElement(this.$audio),f={audioVideoDidStart:function(){var e;null===(e=_.meetingSession)||void 0===e||e.audioVideo.realtimeMuteLocalAudio(),_.joined=!0,_.emit("joined"),r(!0)},audioVideoDidStop:function(){_.joined=!1,r(!1)}},this.meetingSession.audioVideo.addObserver(f),[4,this.deviceController.listAudioInputDevices(!0)];case 3:return h=l.sent(),p=h.find((function(e){return"default"===e.deviceId})),v=h.find((function(e){return""!==e.deviceId})),this.audioInput=p||v,[4,this.meetingSession.audioVideo.stopVideoInput()];case 4:return l.sent(),[4,this.meetingSession.audioVideo.startAudioInput((null===(g=this.audioInput)||void 0===g?void 0:g.deviceId)||"default")];case 5:return l.sent(),this.meetingSession.audioVideo.start(),[3,7];case 6:return m=l.sent(),this.emit("error",m),this.logger.error(m.message),r(!1),[3,7];case 7:return[2]}}))}))}))]}))}))},n.prototype.quit=function(){var e=this;return this.joined?new Promise((function(n,r){var o,i;e.joined=!1;var s={audioVideoDidStop:function(r){return u(e,void 0,void 0,(function(){var e,o;return l(this,(function(i){return e=r.statusCode(),null===(o=this.meetingSession)||void 0===o||o.deviceController.destroy(),e===t.MeetingSessionStatusCode.Left?(this.logger.info("You left the session"),n(!0)):(this.logger.info("Stopped with a session status code: ".concat(e)),n(!0)),[2]}))}))}};null===(o=e.meetingSession)||void 0===o||o.audioVideo.addObserver(s),null===(i=e.meetingSession)||void 0===i||i.audioVideo.stop()})):Promise.resolve(!0)},n.prototype.detectMicro=function(){return u(this,void 0,void 0,(function(){var e=this;return l(this,(function(t){return[2,new Promise((function(t){try{navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return t(!0)})).catch((function(){return t(!1)}))}catch(n){e.logger.error(n.message),t(!1)}}))]}))}))},n.prototype.toggleMicro=function(e){var t,n,r;return u(this,void 0,void 0,(function(){var o;return l(this,(function(i){return e?null===(t=this.meetingSession)||void 0===t||t.audioVideo.realtimeUnmuteLocalAudio():null===(n=this.meetingSession)||void 0===n||n.audioVideo.realtimeMuteLocalAudio(),void 0!==(o=null===(r=this.meetingSession)||void 0===r?void 0:r.audioVideo.realtimeIsLocalAudioMuted())?[2,e!==o]:[2,!1]}))}))},n.prototype.shock=function(){throw new Error("Method not implemented.")},n}(g);exports.RTCJoinedInfoCodeEnum=void 0,(k=exports.RTCJoinedInfoCodeEnum||(exports.RTCJoinedInfoCodeEnum={}))[k.Success=0]="Success",k[k.Failure=1]="Failure",k[k.ReJoin=2]="ReJoin",k[k.NoMicroPermission=3]="NoMicroPermission";var T,O,I,R,B,A,L,N,W,P,x=function(e){function t(t){var n=t.jsBridge,r=t.getVoiceSign,o=e.call(this)||this;return o.type=exports.RTCType.RealseeVRWebViewRTC,o.joined=!1,o.micro=!1,o.voiceId="",o.options={jsBridge:n,getVoiceSign:r},"WxMiniProgramWebView"!==o.jsBridge.webViewType&&o.jsBridge.callAndListen("live/userVolumes",(function(e){o.emit("userVolumes",e)})),o.jsBridge.callAndListen("live/weakNetwork",(function(e){e&&o.emit("weakNetwork")})),o}return c(t,e),Object.defineProperty(t.prototype,"jsBridge",{get:function(){return this.options.jsBridge},enumerable:!1,configurable:!0}),t.prototype.join=function(e){return u(this,void 0,void 0,(function(){var t,n,r,o,i,s,c,a;return l(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),this.emit("joinWillStart"),[4,this.options.getVoiceSign(e)];case 1:return t=u.sent(),n=t.sdkAppId,r=t.userId,o=t.userSig,Boolean(n)&&Boolean(r)&&Boolean(o)?(this.type=e.type,[4,this.jsBridge.callAndBackfeed("live/join?sdkAppID=".concat(n,"&userID=").concat(r,"&roomID=").concat(Number(e.voiceId),"&userSig=").concat(o))]):(this.emit("error",new Error("加入房间失败:rtc 签名请求异常")),this.joined=!1,[2,this.joined]);case 2:return i=u.sent(),s=i[0],c=i[1],s?s.code===exports.RTCJoinedInfoCodeEnum.Success?(this.emit("joined"),this.joined=!0):(this.emit("error",s),this.joined=!1):(this.emit("error",c||new Error("加入房间失败:未知异常。")),this.joined=!1),[2,this.joined];case 3:return a=u.sent(),this.emit("error",new Error("加入房间失败:"+a.message)),this.joined=!1,[2,this.joined];case 4:return[2]}}))}))},t.prototype.quit=function(){return u(this,void 0,void 0,(function(){var e,t,n;return l(this,(function(r){switch(r.label){case 0:return[4,this.jsBridge.callAndBackfeed("live/quit")];case 1:return e=r.sent(),t=e[0],n=e[1],null===t&&this.emit("error",n||new Error("退出房间失败:未知异常。")),this.joined=!1,[2,!!t]}}))}))},t.prototype.detectMicro=function(){return u(this,void 0,void 0,(function(){var e,t,n;return l(this,(function(r){switch(r.label){case 0:return[4,this.jsBridge.detectMicro()];case 1:return e=r.sent(),t=e[0],n=e[1],null===t?(this.emit("error",n||new Error("麦克风监测异常!")),[2,!1]):[2,t]}}))}))},t.prototype.toggleMicro=function(e){return u(this,void 0,void 0,(function(){var t,n,r;return l(this,(function(o){switch(o.label){case 0:return[4,this.jsBridge.callAndBackfeed("live/toggleMicro?flag=".concat(e?1:0))];case 1:return t=o.sent(),n=t[0],r=t[1],null===n?(this.emit("error",r||new Error("麦克风监测异常!")),[2,!1]):(this.micro=n,[2,n])}}))}))},t.prototype.shock=function(){this.jsBridge.shock(1)},t}(g);function M(e){switch(e){case 1e3:return exports.WebSocketCloseError.Err_1000;case 1001:return exports.WebSocketCloseError.Err_1001;case 1002:return exports.WebSocketCloseError.Err_1002;case 1003:return exports.WebSocketCloseError.Err_1003;case 1006:return exports.WebSocketCloseError.Err_1006;case 1007:return exports.WebSocketCloseError.Err_1007;case 1008:return exports.WebSocketCloseError.Err_1008;case 1009:return exports.WebSocketCloseError.Err_1009}return exports.WebSocketCloseError.Err_unknown}exports.Command=void 0,(T=exports.Command||(exports.Command={})).SelfUserInfo="SELF_USER_INFO",T.RoomInfo="ROOM_INFO",T.RTCInfo="RTC_INFO",T.UserList="USER_LIST",T.BuiltinMsg="BUILTIN_MSG",T.CustomEvent="CUSTOM_EVENT",T.KeyframeSync="KEYFRAME_SYNC",T.UserKickOut="USER_KICK_OUT",exports.BuiltinEventType=void 0,(O=exports.BuiltinEventType||(exports.BuiltinEventType={})).UserChange="user_change",O.RoomChange="room_change",exports.BuiltinActionType=void 0,(I=exports.BuiltinActionType||(exports.BuiltinActionType={})).UserMicroStatus="change_micro_status",I.UserMicroStatusSync="sync_micro_status",I.UserPermission="change_permission",I.UserStatus="change_status",I.UserInfo="change_info",I.RoomClose="close",exports.MicroStatus=void 0,(R=exports.MicroStatus||(exports.MicroStatus={})).OPEN="OPEN",R.CLOSE="CLOSE",exports.LiveState=void 0,(B=exports.LiveState||(exports.LiveState={}))[B.NOTINITIALIZED=-1]="NOTINITIALIZED",B[B.CONNECTING=0]="CONNECTING",B[B.OPEN=1]="OPEN",B[B.CLOSED=3]="CLOSED",exports.UserStatus=void 0,(A=exports.UserStatus||(exports.UserStatus={}))[A.Normal=0]="Normal",A[A.Removed=1]="Removed",A[A.Replaced=2]="Replaced",exports.MemUserStatus=void 0,(L=exports.MemUserStatus||(exports.MemUserStatus={})).WAIT_ENTER="WAIT_ENTER",L.ONLINE="ONLINE",L.LEAVE="LEAVE",L.KICK_OUT="KICK_OUT",L.BE_REPLACE="BE_REPLACE",L.EXCEPTION="EXCEPTION",exports.WebSocketState=void 0,(N=exports.WebSocketState||(exports.WebSocketState={}))[N.NOTINITIALIZED=-1]="NOTINITIALIZED",N[N.CONNECTING=0]="CONNECTING",N[N.OPEN=1]="OPEN",N[N.CLOSING=2]="CLOSING",N[N.CLOSED=3]="CLOSED",exports.WebSocketErrorType=void 0,(W=exports.WebSocketErrorType||(exports.WebSocketErrorType={})).Error="Error",W.Close="Close",W.MicroAuth="MicroAuth",W.DuplicateConnect="DuplicateConnect",W.IllegalURL="IllegalURL",W.Unknown="Unknown",W.IllegalArgs="IllegalArgs",exports.WebSocketCloseError=void 0,(P=exports.WebSocketCloseError||(exports.WebSocketCloseError={})).Err_1000="CLOSE_NORMAL",P.Err_1001="CLOSE_GOING_AWAY",P.Err_1002="CLOSE_PROTOCOL_ERROR",P.Err_1003="CLOSE_UNSUPPORTED",P.Err_1006="CLOSE_ABNORMAL",P.Err_1007="Unsupported Data",P.Err_1008="Policy Violation",P.Err_1009="CLOSE_TOO_LARGE",P.Err_unknown="unknown";var j=function(e,t){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},j(e,t)};function V(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},U.apply(this,arguments)};function D(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((r=r.apply(e,t||[])).next())}))}function H(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}var J={};function q(e,t,n){var r;if(void 0===n&&(n=!0),J[e])J[e].queue.push({once:n,callback:t});else{var o="$jsBridgeFn_"+Date.now().toString(16).toUpperCase()+"_"+Math.ceil(1e4*Math.random()).toString(16).toUpperCase();J[e]={uuid:o,queue:[{once:n,callback:t}]}}return Object.assign(window,((r={})[J[e].uuid]=function(t){J[e].queue=J[e].queue.reduce((function(e,n){var r=n.once,o=n.callback;return r||e.push(n),o(t),e}),[])},r)),J[e].uuid}var $,K=function(){function e(){}return e.prototype.checkReady=function(e){return Promise.resolve([!1,null])},e.prototype.callAndBackfeed=function(e){return Promise.resolve([!1,null])},e.prototype.callAndListen=function(e,t){return Promise.resolve([!1,null])},e}(),F=window,G=function(e){function t(){var t=e.call(this)||this;return Promise.resolve().then((function(){return D(t,void 0,void 0,(function(){var e;return H(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.checkBridgeReady()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn(e),[3,3];case 3:return[2]}}))}))})),t}return V(t,e),t.prototype.checkBridgeReady=function(e){var t=this;if(void 0===e&&(e=6e3),this.hybridBridge)return!0;var n=performance.now();return new Promise((function(r,o){var i=function(){if(t.hybridBridge)return r(!0);if(F.HybridBridgeLJ){var s=F.HybridBridgeLJ;null==s||s.getStaticData(q("HYBRID_BRIDGE_NAME",(function(e){return t.deviceInfo=JSON.parse(e),t.hybridBridge=s,r(!0)})))}if(performance.now()-n>(e||6e3))return o(new Error("HybridBridge 初始化超时~"));requestAnimationFrame(i)};i()}))},t.prototype.checkReady=function(e){return void 0===e&&(e=6e3),D(this,void 0,void 0,(function(){var t,n,r,o;return H(this,(function(i){switch(i.label){case 0:if(t=[null,null],this.hybridBridge)return t[0]=!0,[2,t];i.label=1;case 1:return i.trys.push([1,3,,4]),n=t,r=0,[4,this.checkBridgeReady(e)];case 2:return n[r]=i.sent(),[3,4];case 3:return o=i.sent(),t[0]=!1,t[1]=o,[3,4];case 4:return[2,t]}}))}))},Object.defineProperty(t.prototype,"ready",{get:function(){return!!this.hybridBridge},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scheme",{get:function(){var e;return(null===(e=this.deviceInfo)||void 0===e?void 0:e.scheme)||""},enumerable:!1,configurable:!0}),t.prototype.createSchemeLink=function(e){return e.startsWith(this.scheme)?e:this.scheme+"://"+e},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){var t,n,r,o,i=this;return H(this,(function(s){switch(s.label){case 0:return t=[!1,null],[4,this.checkReady()];case 1:return n=s.sent(),r=n[0],o=n[1],r?[4,new Promise((function(n){return D(i,void 0,void 0,(function(){var r,o;return H(this,(function(i){return r=this.createSchemeLink(e),o=JSON.stringify({actionUrl:r,functionName:q(this.createSchemeLink(e),(function(e){var r=function(){try{return JSON.parse(e)}catch(t){return e}}();t[0]=1===r||0!==r&&r,n(t)}))}),this.hybridBridge.callAndBackfeed(o),[2]}))}))}))]:(t[0]=!1,t[1]=o,[2,t]);case 2:return[2,s.sent()]}}))}))},t.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){var n,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return n=[!1,null],[4,this.checkReady()];case 1:return r=c.sent(),o=r[0],i=r[1],o?[4,new Promise((function(r){return D(s,void 0,void 0,(function(){var o,i,s;return H(this,(function(c){return o=this.createSchemeLink(e),i=function(e){var s=function(){try{return JSON.parse(e)}catch(t){return e}}();t(1===s||0!==s&&s),n[0]=function(){var e=J[o];if(e){var t=e.queue.findIndex((function(e){return e.callback===i}));-1!==t&&e.queue.splice(t,1)}},r(n)},s=JSON.stringify({actionUrl:o,functionName:q(o,i,!1)}),this.hybridBridge.callAndListen(s),[2]}))}))}))]:(n[0]=!1,n[1]=i,[2,n]);case 2:return[2,c.sent()]}}))}))},t}(K);!function(e){e.callAndBackfeed="callAndBack",e.callAndListen="callAndListen"}($||($={}));var z,Y=window,Z=function(){function e(){this.checkBridgeReady()}return e.prototype.checkBridgeReady=function(e){var t=this;if(void 0===e&&(e=6e3),this.worker)return!0;var n=performance.now();return new Promise((function(r,o){var i=function(){if(t.worker)return r(!0);if(Y.webkit&&Y.webkit.messageHandlers&&Y.webkit.messageHandlers.realsee){var s=Y.webkit.messageHandlers.realsee;s.postMessage(JSON.stringify({type:"getStaticData",param:JSON.stringify({functionName:q("HYBRID_BRIDGE_NAME",(function(e){return t.deviceInfo=JSON.parse(e),t.worker=s,r(!0)}))})}))}else{if(performance.now()-n>(e||6e3))return o(new Error("HybridBridge 初始化超时~"));requestAnimationFrame(i)}};i()}))},e.prototype.checkReady=function(e){return void 0===e&&(e=6e3),D(this,void 0,void 0,(function(){var t,n,r,o;return H(this,(function(i){switch(i.label){case 0:if(t=[null,null],this.worker)return t[0]=!0,[2,t];i.label=1;case 1:return i.trys.push([1,3,,4]),n=t,r=0,[4,this.checkBridgeReady(e)];case 2:return n[r]=i.sent(),[3,4];case 3:return o=i.sent(),t[0]=!1,t[1]=o,[3,4];case 4:return[2,t]}}))}))},Object.defineProperty(e.prototype,"ready",{get:function(){return!!this.worker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scheme",{get:function(){var e;return(null===(e=this.deviceInfo)||void 0===e?void 0:e.scheme)||""},enumerable:!1,configurable:!0}),e.prototype.createSchemeLink=function(e){return e.startsWith(this.scheme)?e:this.scheme+"://"+e},e.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){var t,n,r,o,i=this;return H(this,(function(s){switch(s.label){case 0:return t=[!1,null],[4,this.checkReady()];case 1:return n=s.sent(),r=n[0],o=n[1],r?[4,new Promise((function(n){return D(i,void 0,void 0,(function(){var r,o;return H(this,(function(i){return r=this.createSchemeLink(e),o=JSON.stringify({actionUrl:r,functionName:q(this.createSchemeLink(e),(function(e){var r=function(){try{return JSON.parse(e)}catch(t){return e}}();t[0]=1===r||0!==r&&r,n(t)}))}),this.worker.postMessage(JSON.stringify({type:"callAndBackfeed",param:o})),[2]}))}))}))]:(t[0]=!1,t[1]=o,[2,t]);case 2:return[2,s.sent()]}}))}))},e.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){var n,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return n=[!1,null],[4,this.checkReady()];case 1:return r=c.sent(),o=r[0],i=r[1],o?[4,new Promise((function(r){return D(s,void 0,void 0,(function(){var o,i,s;return H(this,(function(c){return o=this.createSchemeLink(e),i=function(e){var s=function(){try{return JSON.parse(e)}catch(t){return e}}();t(1===s||0!==s&&s),n[0]=function(){var e=J[o];if(e){var t=e.queue.findIndex((function(e){return e.callback===i}));-1!==t&&e.queue.splice(t,1)}},r(n)},s=JSON.stringify({actionUrl:o,functionName:q(o,i,!1)}),this.worker.postMessage(JSON.stringify({type:"callAndListen",param:s})),[2]}))}))}))]:(n[0]=!1,n[1]=i,[2,n]);case 2:return[2,c.sent()]}}))}))},e}();function X(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Q(){return(X()+X()+"-"+X()+"-4"+X().substr(0,3)+"-"+X()+"-"+X()+X()+X()).toLowerCase()}!function(e){e.isReady="Are You OK?",e.ready="I`m OK!",e.ping="ping",e.pong="pong",e.alive="I`m alive!"}(z||(z={}));var ee=function(e,t){var n=Object.keys(t).reduce((function(e,n){return e.replace("{{".concat(n,"}}"),"".concat(t[n]))}),e);return encodeURI(n)},te=function(e,t){return e in t},ne=function(e){return void 0===e&&(e=""),e.replace("?","").split("&").map((function(e){var t,n=e.split("="),r=n[0],o=n[1];return(t={})[r]=decodeURIComponent(o),t})).reduce((function(e,t){return U(U({},e),t)}),{})},re="$$REALSEE_JSBRIDGE_EVENT$$";function oe(e){return e[re]||(e[re]={}),e[re]}var ie,se=function(){function e(){}return e.prototype.hasListener=function(e){var t=oe(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,n){var r=this,o=oe(this);return o[e]||(o[e]=[]),o[e].push([t,n||!1]),function(){return r.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var n,r=oe(this);if(r[e]||(r[e]=[]),void 0!==t){for(var o=0;o<r[e].length&&r[e][o][0]!==t;o++);o<r[e].length&&r[e].splice(o,1)}else r[e].length=0}else(n=this)[re]||delete n[re]},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=!1,o=oe(this),i=o[e]||[],s=0,c=i.slice();s<c.length;s++){var a=c[s],u=a[0],l=a[1],d=void 0!==l&&l,f=u.apply(void 0,t);d&&this.off(e,u),!1===f&&(r=!0)}return r},e}(),ce=function(e){function t(t){var n=e.call(this)||this;return n._options={timeout:1e4,shouldReconnect:function(e,t){if(1008!==e.code&&1011!==e.code)return[0,3e3,1e4][t.attempts]},should1000Reconnect:!1,ignoreConnectivityEvents:!1,automaticOpen:!1},n._attempts=0,n._reconnects=-1,n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._connectivityEventsAttached=!1,n._clearPendingReconnectIfNeeded=function(){n._pendingReconnect&&(clearTimeout(n._pendingReconnect),n._pendingReconnect=void 0)},n._online=function(e){n._reconnectWhenOnlineAgain&&(n._clearPendingReconnectIfNeeded(),n._reconnect(e))},n._offline=function(){var e;n._reconnectWhenOnlineAgain=!0,null===(e=n._realWebSocket)||void 0===e||e.close(1e3)},n._detachConnectivityEvents=function(){n._connectivityEventsAttached&&(null===globalThis||void 0===globalThis||globalThis.removeEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.removeEventListener("offline",n._offline),n._connectivityEventsAttached=!1)},n._attachConnectivityEvents=function(){n._connectivityEventsAttached||(null===globalThis||void 0===globalThis||globalThis.addEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.addEventListener("offline",n._offline),n._connectivityEventsAttached=!0)},n.send=function(e){var t,r,o;(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)===(null===(r=n._realWebSocket)||void 0===r?void 0:r.OPEN)&&(null===(o=n._realWebSocket)||void 0===o||o.send(e))},n.close=function(e,t){var r;return"number"!=typeof e&&(t=e,e=1e3),n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!0,n._detachConnectivityEvents(),null===(r=n._realWebSocket)||void 0===r?void 0:r.close(e,t)},n.open=function(e){var t,r;e&&(n._url=e),(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)!==WebSocket.OPEN&&(null===(r=n._realWebSocket)||void 0===r?void 0:r.readyState)!==WebSocket.CONNECTING&&(n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._createWebSocket())},n._createWebSocket=function(){var e,t,r,o="string"==typeof n._url?n._url:null===(e=n._url)||void 0===e?void 0:e.call(n,n);if(o){n._pendingReconnect=void 0,n._removeWebSocketEvent(),n._realWebSocket=new WebSocket(o,n._protocols||void 0),n._attempts=n._attempts+1,n.emit("connecting",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}));n._connectTimeout=setTimeout((function(){n._connectTimeout=void 0,n._detachConnectivityEvents(),n.emit("timeout",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}))}),null===(t=n._options)||void 0===t?void 0:t.timeout),n._dispatchWebSocketEvent(),(null===(r=n._options)||void 0===r?void 0:r.ignoreConnectivityEvents)||n._attachConnectivityEvents()}},n._removeWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.removeEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.removeEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.removeEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.removeEventListener("message",n._webSocketMessageHandler)},n._dispatchWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.addEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.addEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.addEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.addEventListener("message",n._webSocketMessageHandler)},n._webSocketOpenHandler=function(e){n._connectTimeout&&(clearTimeout(n._connectTimeout),n._connectTimeout=void 0);var t=++n._reconnects,r=n._attempts;return n._attempts=0,n._reconnectWhenOnlineAgain=!1,n.emit("open",Object.assign(e,{detail:{reconnects:t,attempts:r}}))},n._webSocketCloseHandler=function(e){return n._reconnect(e),n.emit("close",e)},n._webSocketErrorHandler=function(e){return n.emit("error",new CustomEvent("error",{detail:{error:e}}))},n._webSocketMessageHandler=function(e){return n.emit("message",e)},t&&n.setOptions(t),n}return V(t,e),Object.defineProperty(t.prototype,"attempts",{get:function(){return this._attempts},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(e){if(e){this._url=e.url,this._protocols=e.protocols;var t=Object.assign(this._options,e.robustOptions||{});if("number"!=typeof(null==t?void 0:t.timeout))throw new Error("timeout must be the number of milliseconds to timeout a connection attempt");if("function"!=typeof(null==t?void 0:t.shouldReconnect))throw new Error("shouldReconnect must be a function that returns the number of milliseconds to wait for a reconnect attempt, or null or undefined to not reconnect.");this._options=t,this._options.automaticOpen&&this._createWebSocket()}},t.prototype._reconnect=function(e){var t,n,r,o;if(!(null===(t=this._options)||void 0===t?void 0:t.should1000Reconnect)&&1e3===e.code||this._explicitlyClosed)this._attempts=0;else if(!1!==(null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===n?void 0:n.onLine)){var i=null===(o=null===(r=this._options)||void 0===r?void 0:r.shouldReconnect)||void 0===o?void 0:o.call(r,e,this);"number"==typeof i&&(this._pendingReconnect=setTimeout(this._createWebSocket,i))}else this._reconnectWhenOnlineAgain=!0},t}(se),ae=function(){function e(){var t,n,r=this;if(this._rsWeappBridgeMethodAdapter={},this._ws=new ce,this._readyState="close",this.initialize=function(e){return void 0===e&&(e=6e3),D(r,void 0,void 0,(function(){var t,n,r,o,i,s,c,a,u,l,d;return H(this,(function(f){switch(f.label){case 0:if(t=[!1,null],n=ne(globalThis.location.search),r=n.wssid,o=n.wstsp,i=n.wssig,s=n.wsmnt,c=void 0===s?"wss://ws.realsee.com":s,!(r&&o&&i&&c))return t[1]=new Error("HybridBridge 参数缺失,初始化失败~"),[2,t];a=ee("{{origin}}/{{endpoint}}/{{uuid}}/{{member}}/{{ak}}/{{ts}}/{{sign}}",{origin:c,endpoint:"proxy",uuid:r,member:"webview",ak:"vr_live_miniapp",ts:o,sign:i}),f.label=1;case 1:return f.trys.push([1,6,,7]),[4,this._open(a)];case 2:return f.sent()?(this.initBuiltInHandlers(),u=t,l=0,[4,this.waitReady(e)]):[3,4];case 3:return u[l]=f.sent(),[3,5];case 4:t[1]=new Error("HybridBridge ws未连接,初始化失败~"),f.label=5;case 5:return[3,7];case 6:return d=f.sent(),t[1]=d,[3,7];case 7:return[2,t]}}))}))},this.initBuiltInHandlers=function(){r._registerLifecycleHandler(),r._registerHeartbeatHandler(),r._registerMessageHandler(),r._registerBridgeRequestHandler(),r._registerReadyHandler()},this._open=function(e){return new Promise((function(t){r._ws.once("open",(function(){r._receivedMessage(z.ready,(function(){return t(!0)}),!0),r._ws.once("timeout",(function(){return t(!1)})),r.send(z.isReady)})),r._ws.open(e)}))},this._registerLifecycleHandler=function(){r._ws.on("connecting",(function(){console.log("RsWeappBridge connecting"),r._readyState="connecting"})),r._ws.on("open",(function(){console.log("RsWeappBridge open"),r._readyState="open"})),r._ws.on("close",(function(){r._readyState="close"})),r._ws.on("error",(function(){console.log("RsWeappBridge error"),r._readyState="close"})),r._ws.on("timeout",(function(){console.log("RsWeappBridge timeout"),r._readyState="close"}))},this._registerHeartbeatHandler=function(){r._receivedMessage(z.ping,(function(){return setTimeout((function(){return r._ws.send(z.pong)}),500)})),r._receivedMessage(z.pong,(function(){return setTimeout((function(){return r._ws.send(z.ping)}),1e3)}))},this._receivedMessage=function(e,t,n){var o=function(i){i.data===e&&(t(),n&&r._ws.off("message",o))};r._ws.on("message",o)},this._registerReadyHandler=function(){r._receivedMessage(z.isReady,(function(){return r._ws.send(z.ready)}))},this.send=function(e){r._ws.send(e)},this.waitReady=function(e){return void 0===e&&(e=6e3),new Promise((function(t,n){r._receivedMessage(z.ready,(function(){return t(!0)})),r.send(z.isReady),setTimeout((function(){return n("HybridBridge 初始化超时~")}),e)}))},this._parseMessage=function(e){try{return JSON.parse(e.data)}catch(t){return e.data}},this._registerMessageHandler=function(){r._ws.on("message",(function(e){var t=r._parseMessage(e);if("object"==typeof t){var n=t.id,o=t.command,i=t.data;"message"===o&&"function"==typeof r._rsWeappBridgeMethodAdapter.bindMessage&&r._rsWeappBridgeMethodAdapter.bindMessage({id:n,data:i})}}))},this.getStaticData=function(e){r.callAndBackfeed(JSON.stringify({actionUrl:"common/staticData",functionName:e}))},this.callAndBackfeed=function(e){var t=JSON.parse(e),n=t.actionUrl,o=void 0===n?"":n,i=t.functionName,s=void 0===i?"":i;if(!o)throw new Error("callAndBackfeed actionUrl is empty!");if(!s)throw new Error("callAndBackfeed functionName is empty!");r._callAndBackfeed(o,(function(e){"function"==typeof globalThis[s]&&globalThis[s](e)}))},this.callAndListen=function(e){var t=JSON.parse(e),n=t.actionUrl,o=t.functionName;if(!n)throw new Error("callAndListen actionUrl is empty!");if(!o)throw new Error("callAndListen functionName is empty!");var i=function(e){"function"==typeof globalThis[o]&&globalThis[o](e)};try{r._callAndListen(n,i)}catch(e){console.warn(e),i(!1)}},this.execute=function(e,t){return D(r,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this._invokeBridgeMethod(e,t)];case 1:return[2,n.sent()]}}))}))},this._invokeBridgeMethod=function(e,t){return new Promise((function(n,o){var i=Q(),s=function(t){var c=r._parseMessage(t);"object"==typeof c&&c.method===e&&c.id===i&&(r._ws.off("message",s),c.error?o(c.error):n(c.data))};r._ws.on("message",s),r.send(JSON.stringify({method:e,args:t,id:i}))}))},(null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.window)||void 0===t?void 0:t.__Realsee_WxMini_HybridBridge__)instanceof e)return null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.window)||void 0===n?void 0:n.__Realsee_WxMini_HybridBridge__;(null===globalThis||void 0===globalThis?void 0:globalThis.window)&&(globalThis.window.__Realsee_WxMini_HybridBridge__=this,this.initBuiltInHandlers())}return Object.defineProperty(e.prototype,"isReady",{get:function(){return"open"===this._readyState},enumerable:!1,configurable:!0}),e.prototype._registerBridgeRequestHandler=function(){var e=this;this._ws.on("message",(function(t){return D(e,void 0,void 0,(function(){var e,n,r,o,i,s,c,a;return H(this,(function(u){switch(u.label){case 0:if("object"!=typeof(e=this._parseMessage(t)))return[3,7];if(n=e.id,r=e.method,o=e.args,"request"!==e.command)return[3,7];if(!r)return[3,7];if(i=null,s=null,c=null,"function"==typeof this._rsWeappBridgeMethodAdapter[r]?c=this._rsWeappBridgeMethodAdapter[r]:globalThis&&te(r,globalThis)&&(c=globalThis[r]),"function"!=typeof c)return[3,5];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,c(o)];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),s=a.message||a,[3,4];case 4:return[3,6];case 5:s="Method not implemented.",u.label=6;case 6:this.send(JSON.stringify({id:n,method:r,result:i,error:s,command:"response"})),u.label=7;case 7:return[2]}}))}))}))},e.prototype._callAndBackfeed=function(e,t){var n=this,r=Q(),o=JSON.stringify({id:r,actionUrl:e,command:"rsSchemeRequest",type:"callAndBackfeed"}),i=null,s=function(e){var o=n._parseMessage(e);if("object"==typeof o){var c=o.id,a=o.result,u=o.errmsg;"rsSchemeResponse"===o.command&&c===r&&(n._ws.off("message",s),i&&clearTimeout(i),u?(console.warn(u),t(0)):t(a))}};this._ws.on("message",s),this.send(o),i=globalThis.setTimeout((function(){console.warn("callAndBackfeed timeout"),t(0)}),3e4)},e.prototype._callAndListen=function(e,t){var n=this,r=Q(),o=JSON.stringify({id:r,actionUrl:e,command:"rsSchemeRequest",type:"callAndListen"});this._ws.on("message",(function(e){var o=n._parseMessage(e);if("object"==typeof o){var i=o.id,s=o.result,c=o.errmsg;"rsSchemeResponse"===o.command&&i===r&&(c?(console.warn(c),t(!1)):t(s))}})),this.send(o)},e.prototype.invoke=function(e,t){return D(this,void 0,void 0,(function(){var n=this;return H(this,(function(r){return[2,new Promise((function(r,o){var i=Q(),s=JSON.stringify({id:i,method:e,args:t,command:"request"}),c=null,a=function(t){var s=n._parseMessage(t);if("object"==typeof s){var u=s.id,l=s.result,d=s.error;"response"===s.command&&u===i&&s.method===e&&(n._ws.off("message",a),c&&clearTimeout(c),d?o(d):r(l))}};n._ws.on("message",a),n.send(s),c=setTimeout((function(){return o("method invoke timeout")}),3e4)}))]}))}))},e}(),ue=ae,le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._hybridBridge=new ue,t.initializing=!1,t}return V(t,e),Object.defineProperty(t.prototype,"hybridBridge",{get:function(){return this._hybridBridge},enumerable:!1,configurable:!0}),t.prototype.checkBridgeReady=function(e){var t=this;return void 0===e&&(e=6e4),!!this.ready||new Promise((function(n,r){return D(t,void 0,void 0,(function(){var t,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return this.ready?[2,n(!0)]:this.initializing?((t=function(){if(s.ready)return n(!0);requestAnimationFrame(t)})(),[3,3]):[3,1];case 1:return this.initializing=!0,[4,this._hybridBridge.initialize(e)];case 2:if(r=c.sent(),o=r[0],i=r[1],!o||i)throw i||new Error("HybridBridge 初始化失败~");return this._hybridBridge.getStaticData(q("HYBRID_BRIDGE_NAME",(function(e){s.deviceInfo=function(){try{return JSON.parse(e)}catch(t){return e}}()}))),this.initializing=!1,[2,n(!0)];case 3:return[2]}}))}))}))},t.prototype.checkReady=function(e){return void 0===e&&(e=6e4),D(this,void 0,void 0,(function(){var t,n,r,o;return H(this,(function(i){switch(i.label){case 0:if(t=[null,null],this.ready)return t[0]=!0,[2,t];i.label=1;case 1:return i.trys.push([1,3,,4]),n=t,r=0,[4,this.checkBridgeReady(e)];case 2:return n[r]=i.sent(),[3,4];case 3:return o=i.sent(),t[0]=!1,t[1]=o,[3,4];case 4:return[2,t]}}))}))},Object.defineProperty(t.prototype,"ready",{get:function(){return!!this._hybridBridge.isReady},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scheme",{get:function(){var e;return(null===(e=this.deviceInfo)||void 0===e?void 0:e.scheme)||""},enumerable:!1,configurable:!0}),t.prototype.createSchemeLink=function(e){return e.startsWith(this.scheme)?e:this.scheme+"://"+e},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){var t,n,r,o,i=this;return H(this,(function(s){switch(s.label){case 0:return t=[!1,null],[4,this.checkReady()];case 1:return n=s.sent(),r=n[0],o=n[1],r?[4,new Promise((function(n){return D(i,void 0,void 0,(function(){var r,o;return H(this,(function(i){return r=this.createSchemeLink(e),o=JSON.stringify({actionUrl:r,functionName:q(this.createSchemeLink(e),(function(e){var r=e;try{r=JSON.parse(e)}catch(e){}t[0]=1===r||0!==r&&r,n(t)}))}),this._hybridBridge.callAndBackfeed(o),[2]}))}))}))]:(t[0]=!1,t[1]=o,[2,t]);case 2:return[2,s.sent()]}}))}))},t.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){var n,r,o,i,s=this;return H(this,(function(c){switch(c.label){case 0:return n=[!1,null],[4,this.checkReady()];case 1:return r=c.sent(),o=r[0],i=r[1],o?[4,new Promise((function(r){return D(s,void 0,void 0,(function(){var o,i,s;return H(this,(function(c){return o=this.createSchemeLink(e),i=function(e){var s=e;try{s=JSON.parse(e)}catch(e){}t(1===s||0!==s&&s),n[0]=function(){var e=J[o];if(e){var t=e.queue.findIndex((function(e){return e.callback===i}));-1!==t&&e.queue.splice(t,1)}},r(n)},s=JSON.stringify({actionUrl:o,functionName:q(o,i,!1)}),this._hybridBridge.callAndListen(s),[2]}))}))}))]:(n[0]=!1,n[1]=i,[2,n]);case 2:return[2,c.sent()]}}))}))},t.prototype.invoke=function(e,t){var n,r;return D(this,void 0,void 0,(function(){var o,i,s,c;return H(this,(function(a){switch(a.label){case 0:return o=[!1,null],[4,this.checkReady()];case 1:if(i=a.sent(),s=i[0],c=i[1],s)return[3,2];throw o[0]=!1,o[1]=c,c;case 2:return[4,null===(r=(n=this._hybridBridge).invoke)||void 0===r?void 0:r.call(n,e,t)];case 3:return[2,a.sent()]}}))}))},t}(K);!function(e){e.WebView="WebKit",e.WKWebview="WKWebview",e.UIWebview="UIWebview",e.Browser="Browser",e.WeChatMPWebView="WxMiniProgramWebView",e.Unsupported="Unsupported"}(ie||(ie={}));var de,fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.webViewType=ie.Unsupported,t}return V(t,e),t}(se),he=globalThis.navigator.userAgent,pe=/android/gi.test(he),ve=/iPhone|iPad\s+OS/gi.test(he),me=/MicroMessenger/gi.test(he)&&/miniProgram/gi.test(he),ge=/realsee/gi.test(he),_e={timeout:6e3},be=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.options=Object.assign(_e,t),ge||console.warn("未知容器:此版本 `jsBridge` 不支持当前 WebView 容器 ... "),n.webViewType=pe?ie.WebView:ve?ie.WKWebview:ie.Browser,n._controller=pe?new G:ve?new Z:new K,n.callAndListen("common/webViewState",(function(e){n.emit("webViewStateChange",e)})),n.callAndListen("common/webViewError",(function(e){n.emit("error",e)})),n}return V(t,e),t.prototype.ready=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this._controller.checkReady(this.options.timeout)];case 1:return[2,e.sent()]}}))}))},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this._controller.callAndBackfeed(e)];case 1:return[2,t.sent()]}}))}))},t.prototype.callAndListen=function(e,t){var n;return D(this,void 0,void 0,(function(){return H(this,(function(r){switch(r.label){case 0:return[4,null===(n=this._controller)||void 0===n?void 0:n.callAndListen(e,t)];case 1:return[2,r.sent()]}}))}))},t.prototype.setLeftTopBackButton=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return this.webViewType===ie.WebView?[2,[!0,null]]:[4,this.callAndBackfeed("common/setLeftTopBackButton?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.getBangsHeight=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getBangsHeight")];case 1:return[2,e.sent()]}}))}))},t.prototype.shock=function(e){return void 0===e&&(e=4),D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/shock?duration=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.minimize=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/minimize")];case 1:return[2,e.sent()]}}))}))},t.prototype.loadProgress=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e<0?0:e>100?100:e,[4,this.callAndBackfeed("common/loadProgress?progress=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeLoading=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeLoading")];case 1:return[2,e.sent()]}}))}))},t.prototype.setOrientation=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/setOrientation?orientation=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.keepScreenLight=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/keepScreenLight?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeWebView=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeWebView")];case 1:return[2,e.sent()]}}))}))},t.prototype.openWebView=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this.callAndBackfeed("common/openWebView?way=".concat(t,"&url=").concat(encodeURIComponent(e)))];case 1:return[2,n.sent()]}}))}))},t.prototype.saveImage2Album=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/saveImage2Album?base64=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.actionShare=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/actionShare?json=".concat(JSON.stringify(e)))];case 1:return[2,t.sent()]}}))}))},t.prototype.getDeviceInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getDeviceInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getUserInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getUserInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getWebViewState=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getWebViewState")];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(){return D(this,void 0,void 0,(function(){var e;return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/login")];case 1:return(e=t.sent())[0]?[4,this.getUserInfo()]:[3,3];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},t.prototype.logout=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/logout")];case 1:return[2,e.sent()]}}))}))},t.prototype.detectMicro=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/detectMicro")];case 1:return[2,e.sent()]}}))}))},t.prototype.preload=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e.map((function(e){return e.startsWith("//")?"https:"+e:e})),[4,this.callAndBackfeed("common/preload?urls=".concat(JSON.stringify(e)))];case 1:return[2,t.sent()]}}))}))},t.prototype.createCacheProxyUrl=function(e){var t=this;e=Array.isArray(e)?e:[e];var n=window.navigator.userAgent;if(!/supportCache/i.test(n))return e;return e.map((function(e){return t.webViewType===ie.WKWebview?e.replace(/https*:/,"").replace(/\/\//,"realseeproxycache://"):t.webViewType===ie.WebView?e+(-1!==e.indexOf("?")?"&":"?")+"realseeproxycache=1":e}))},t}(fe);!function(e){e.Append="Append",e.Replace="Replace",e.Single="Single"}(de||(de={}));var ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.webViewType=ie.Browser,t}return V(t,e),t.prototype.ready=function(){return Promise.resolve([!0,null])},t.prototype.callAndBackfeed=function(e){return Promise.resolve([!1,null])},t.prototype.callAndListen=function(e,t){return Promise.resolve([function(){},null])},t.prototype.loadProgress=function(e){return Promise.resolve([!0,null])},t.prototype.closeLoading=function(){return Promise.resolve([!0,null])},t.prototype.getDeviceInfo=function(){return Promise.resolve([!1,null])},t.prototype.getWebViewState=function(){return Promise.resolve([!1,null])},t.prototype.setLeftTopBackButton=function(e){return Promise.resolve([!1,null])},t.prototype.login=function(){return Promise.resolve([!1,null])},t.prototype.logout=function(){return Promise.resolve([!1,null])},t.prototype.getUserInfo=function(){return Promise.resolve([!1,null])},t.prototype.openWebView=function(e,t){switch(t){case de.Replace:case de.Single:setTimeout((function(){return globalThis.location.replace(e)}),200);break;case de.Append:default:setTimeout((function(){return globalThis.location.href=e}),200)}return Promise.resolve([!0,null])},t.prototype.closeWebView=function(){return globalThis.close(),Promise.resolve([!0,null])},t.prototype.getBangsHeight=function(){return Promise.resolve([0,null])},t.prototype.setOrientation=function(e){return Promise.resolve([!1,null])},t.prototype.keepScreenLight=function(e){return Promise.resolve([!1,null])},t.prototype.shock=function(e){return Promise.resolve([!1,null])},t.prototype.minimize=function(){return Promise.resolve([!1,null])},t.prototype.saveImage2Album=function(e){return Promise.resolve([!1,null])},t.prototype.detectMicro=function(){return new Promise((function(e){try{globalThis.navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(){return e([!0,null])})).catch((function(t){return e([!1,t])}))}catch(t){console.error(t),e([!1,t])}}))},t.prototype.actionShare=function(e){return Promise.resolve([!1,null])},t.prototype.preload=function(e){return Promise.resolve([!1,null])},t.prototype.createCacheProxyUrl=function(e){return[]},t}(fe),we={timeout:6e4},Se=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n._controller=new le,n.options=Object.assign(we,t),me||console.warn("未知容器:此版本 `jsBridge` 不支持当前 WebView 容器 ... "),n.webViewType=ie.WeChatMPWebView,n.callAndListen("common/webViewState",(function(e){n.emit("webViewStateChange",e)})),n.callAndListen("common/webViewError",(function(e){n.emit("error",e)})),n}return V(t,e),t.prototype.ready=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this._controller.checkReady(this.options.timeout)];case 1:return[2,e.sent()]}}))}))},t.prototype.callAndBackfeed=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this._controller.callAndBackfeed(e)];case 1:return[2,t.sent()]}}))}))},t.prototype.callAndListen=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this._controller.callAndListen(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.setLeftTopBackButton=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return this.webViewType===ie.WebView?[2,[!0,null]]:[4,this.callAndBackfeed("common/setLeftTopBackButton?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.getBangsHeight=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getBangsHeight")];case 1:return[2,e.sent()]}}))}))},t.prototype.shock=function(e){return void 0===e&&(e=4),D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/shock?duration=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.minimize=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/minimize")];case 1:return[2,e.sent()]}}))}))},t.prototype.loadProgress=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e<0?0:e>100?100:e,[4,this.callAndBackfeed("common/loadProgress?progress=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeLoading=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeLoading")];case 1:return[2,e.sent()]}}))}))},t.prototype.setOrientation=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/setOrientation?orientation=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.keepScreenLight=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/keepScreenLight?enable=".concat(e?1:0))];case 1:return[2,t.sent()]}}))}))},t.prototype.closeWebView=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/closeWebView")];case 1:return[2,e.sent()]}}))}))},t.prototype.openWebView=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this.callAndBackfeed("common/openWebView?way=".concat(t,"&url=").concat(encodeURIComponent(e)))];case 1:return[2,n.sent()]}}))}))},t.prototype.saveImage2Album=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/saveImage2Album?base64=".concat(e))];case 1:return[2,t.sent()]}}))}))},t.prototype.actionShare=function(e){var t,n,r;return D(this,void 0,void 0,(function(){var o;return H(this,(function(i){switch(i.label){case 0:return o={path:null===(t=e.miniprogram)||void 0===t?void 0:t[0].path,title:null===(n=e.miniprogram)||void 0===n?void 0:n[0].title,imageUrl:null===(r=e.miniprogram)||void 0===r?void 0:r[0].hdImageData},[4,this.callAndBackfeed("common/actionShare?json=".concat(JSON.stringify(o)))];case 1:return[2,i.sent()]}}))}))},t.prototype.getDeviceInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getDeviceInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getUserInfo=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getUserInfo")];case 1:return[2,e.sent()]}}))}))},t.prototype.getWebViewState=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/getWebViewState")];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(){return D(this,void 0,void 0,(function(){var e;return H(this,(function(t){switch(t.label){case 0:return[4,this.callAndBackfeed("common/login")];case 1:return(e=t.sent())[0]?[4,this.getUserInfo()]:[3,3];case 2:return[2,t.sent()];case 3:return[2,e]}}))}))},t.prototype.logout=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/logout")];case 1:return[2,e.sent()]}}))}))},t.prototype.detectMicro=function(){return D(this,void 0,void 0,(function(){return H(this,(function(e){switch(e.label){case 0:return[4,this.callAndBackfeed("common/detectMicro")];case 1:return[2,e.sent()]}}))}))},t.prototype.preload=function(e){return D(this,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:return e=e.map((function(e){return e.startsWith("//")?"https:"+e:e})),[4,this.callAndBackfeed("common/preload?urls=".concat(JSON.stringify(e)))];case 1:return[2,t.sent()]}}))}))},t.prototype.createCacheProxyUrl=function(e){var t=this;e=Array.isArray(e)?e:[e];var n=window.navigator.userAgent;if(!/supportCache/i.test(n))return e;return e.map((function(e){return t.webViewType===ie.WKWebview?e.replace(/https*:/,"").replace(/\/\//,"realseeproxycache://"):t.webViewType===ie.WebView?e+(-1!==e.indexOf("?")?"&":"?")+"realseeproxycache=1":e}))},t.prototype.invokeNativeApi=function(e,t){return D(this,void 0,void 0,(function(){return H(this,(function(n){switch(n.label){case 0:return[4,this._controller.invoke(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.execute=function(e,t){var n,r,o;return D(this,void 0,void 0,(function(){return H(this,(function(i){switch(i.label){case 0:return[4,null===(o=null===(r=null===(n=this._controller)||void 0===n?void 0:n.hybridBridge)||void 0===r?void 0:r.execute)||void 0===o?void 0:o.call(r,e,t)];case 1:return[2,i.sent()]}}))}))},t}(fe),ke=function(e){function t(t){return void 0===t&&(t={}),e.call(this),ge&&(pe||ve)?new be(t):me?new Se(t):new ye}return V(t,e),t}(fe);function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce,Te,Oe=(Ce=function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.OFF=4]="OFF"}(n=t.LogLevel||(t.LogLevel={})),t.default=n},Ce(Te={exports:{}},Te.exports),Te.exports),Ie=Ee(Oe);function Re(e,t){void 0===t&&(t={});var n=-1!==e.indexOf("?");return e+Object.keys(t).reduce((function(e,r,o){return"".concat(e).concat(0!==o||n?"&":"?").concat(r,"=").concat(t[r])}),"")}var Be=globalThis.navigator.userAgent,Ae=/android/gi.test(Be),Le=/iPhone|iPad\s+OS/gi.test(Be),Ne=/MicroMessenger/gi.test(Be)&&/miniProgram/gi.test(Be),We=/realsee/gi.test(Be);function Pe(e){return"[object Object]"===Object.prototype.toString.call(e)}function xe(e,t){return e===t||typeof e==typeof t&&!(!Number.isNaN(e)||!Number.isNaN(t))}function Me(e,t){return!!xe(e,t)||(Pe(e)&&Pe(t)?function(e,t){var n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(var o=0,i=n.length;o<i;o++){var s=n[o];if(!xe(e[s],t[s]))return!1}return!0}(e,t):!(!Array.isArray(e)||!Array.isArray(t))&&function(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(!xe(e[n],t[n]))return!1;return!0}(e,t))}function je(e,t){return!!xe(e,t)||(Pe(e)&&Pe(t)?function(e,t){var n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(var o=0,i=n.length;o<i;o++){var s=n[o];if(!je(e[s],t[s]))return!1}return!0}(e,t):!(!Array.isArray(e)||!Array.isArray(t))&&function(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(!je(e[n],t[n]))return!1;return!0}(e,t))}function Ve(e,t,n){return void 0===n&&(n={deep:!1}),n.deep?je(e,t):Me(e,t)}var Ue=function(e){function t(t){var n=e.call(this)||this;return n._readyState=exports.WebSocketState.NOTINITIALIZED,n._options={timeout:1e4,shouldReconnect:function(e,t){if(1008!==e.code&&1011!==e.code)return[0,3e3,1e4][t.attempts]},should1000Reconnect:!1,ignoreConnectivityEvents:!1,automaticOpen:!1},n._attempts=0,n._reconnects=-1,n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._connectivityEventsAttached=!1,n._healthCheck=function(){return u(n,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return this._realWebSocket&&this._realWebSocket.readyState!==this._readyState&&(this._readyState=this._realWebSocket.readyState,this._readyState===exports.WebSocketState.CLOSING&&this.emit("closing")),[4,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:return e.sent(),this._heathCheckTimer=requestAnimationFrame(this._healthCheck),[2]}}))}))},n._clearHeathCheckIfNeed=function(){n._heathCheckTimer&&(cancelAnimationFrame(n._heathCheckTimer),n._heathCheckTimer=void 0)},n._startHealthCheck=function(){n._clearHeathCheckIfNeed(),n._heathCheckTimer=requestAnimationFrame(n._healthCheck)},n._stopHealthCheck=function(){n._clearHeathCheckIfNeed()},n._clearPendingReconnectIfNeeded=function(){n._pendingReconnect&&(clearTimeout(n._pendingReconnect),n._pendingReconnect=void 0)},n._online=function(e){n._reconnectWhenOnlineAgain&&(n._clearPendingReconnectIfNeeded(),n._reconnect(e))},n._offline=function(){var e;n._reconnectWhenOnlineAgain=!0,null===(e=n._realWebSocket)||void 0===e||e.close(1e3,"offline")},n._detachConnectivityEvents=function(){n._connectivityEventsAttached&&(null===globalThis||void 0===globalThis||globalThis.removeEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.removeEventListener("offline",n._offline),n._connectivityEventsAttached=!1)},n._attachConnectivityEvents=function(){n._connectivityEventsAttached||(null===globalThis||void 0===globalThis||globalThis.addEventListener("online",n._online),null===globalThis||void 0===globalThis||globalThis.addEventListener("offline",n._offline),n._connectivityEventsAttached=!0)},n.send=function(e){var t,r,o;(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)===(null===(r=n._realWebSocket)||void 0===r?void 0:r.OPEN)&&(null===(o=n._realWebSocket)||void 0===o||o.send(e))},n.close=function(e,t){var r;return"number"!=typeof e&&(t=e,e=1e3),n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!0,n._detachConnectivityEvents(),null===(r=n._realWebSocket)||void 0===r?void 0:r.close(e,t)},n.open=function(e){var t,r;e&&(n._url=e),(null===(t=n._realWebSocket)||void 0===t?void 0:t.readyState)!==WebSocket.OPEN&&(null===(r=n._realWebSocket)||void 0===r?void 0:r.readyState)!==WebSocket.CONNECTING&&(n._clearPendingReconnectIfNeeded(),n._reconnectWhenOnlineAgain=!1,n._explicitlyClosed=!1,n._createWebSocket())},n._createWebSocket=function(){var e,t,r,o="string"==typeof n._url?n._url:null===(e=n._url)||void 0===e?void 0:e.call(n,n);if(o){n._pendingReconnect=void 0,n._removeWebSocketEvent(),n._realWebSocket=new WebSocket(o,n._protocols||void 0),n._attempts=n._attempts+1,n.emit("connecting",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}));n._connectTimeout=setTimeout((function(){n._connectTimeout=void 0,n._detachConnectivityEvents(),n.emit("timeout",new CustomEvent("connecting",{detail:{attempts:n._attempts,reconnects:n._reconnects}}))}),null===(t=n._options)||void 0===t?void 0:t.timeout),n._dispatchWebSocketEvent(),(null===(r=n._options)||void 0===r?void 0:r.ignoreConnectivityEvents)||n._attachConnectivityEvents()}},n._removeWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.removeEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.removeEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.removeEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.removeEventListener("message",n._webSocketMessageHandler)},n._dispatchWebSocketEvent=function(){var e,t,r,o;null===(e=n._realWebSocket)||void 0===e||e.addEventListener("open",n._webSocketOpenHandler),null===(t=n._realWebSocket)||void 0===t||t.addEventListener("close",n._webSocketCloseHandler),null===(r=n._realWebSocket)||void 0===r||r.addEventListener("error",n._webSocketErrorHandler),null===(o=n._realWebSocket)||void 0===o||o.addEventListener("message",n._webSocketMessageHandler)},n._webSocketOpenHandler=function(e){n._connectTimeout&&(clearTimeout(n._connectTimeout),n._connectTimeout=void 0);var t=++n._reconnects,r=n._attempts;return n._attempts=0,n._reconnectWhenOnlineAgain=!1,n._startHealthCheck(),n.emit("open",Object.assign(e,{detail:{reconnects:t,attempts:r}}))},n._webSocketCloseHandler=function(e){return n._reconnect(e),n._stopHealthCheck(),n.emit("close",e)},n._webSocketErrorHandler=function(e){return n.emit("error",new CustomEvent("error",{detail:{error:e}}))},n._webSocketMessageHandler=function(e){return n.emit("message",e)},t&&n.setOptions(t),n._startHealthCheck(),n}return c(t,e),Object.defineProperty(t.prototype,"attempts",{get:function(){return this._attempts},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(e){if(e){this._url=e.url,this._protocols=e.protocols;var t=Object.assign(this._options,e.robustOptions||{});if("number"!=typeof(null==t?void 0:t.timeout))throw new Error("timeout must be the number of milliseconds to timeout a connection attempt");if("function"!=typeof(null==t?void 0:t.shouldReconnect))throw new Error("shouldReconnect must be a function that returns the number of milliseconds to wait for a reconnect attempt, or null or undefined to not reconnect.");this._options=t,this._options.automaticOpen&&this._createWebSocket()}},t.prototype._reconnect=function(e){var t,n,r,o;if(!(null===(t=this._options)||void 0===t?void 0:t.should1000Reconnect)&&1e3===e.code||this._explicitlyClosed)this._attempts=0;else if(!1!==(null===(n=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===n?void 0:n.onLine)){var i=null===(o=null===(r=this._options)||void 0===r?void 0:r.shouldReconnect)||void 0===o?void 0:o.call(r,e,this);"number"==typeof i&&(this._pendingReconnect=setTimeout(this._createWebSocket,i))}else this._reconnectWhenOnlineAgain=!0},t}(m),De=function(e){function t(){var t=e.call(this)||this;return t._ws=new Ue({url:"",robustOptions:{timeout:18e4}}),t._state=exports.LiveState.NOTINITIALIZED,t._addWebSocketEventListeners=function(){t._ws.on("close",t._handleCloseEvent),t._ws.on("closing",t._handleClosingEvent),t._ws.on("connecting",t._handleConnectingEvent),t._ws.on("error",t._handleErrorEvent),t._ws.on("message",t._handleMessageEvent),t._ws.on("open",t._handleOpenEvent),t._ws.on("timeout",t._handleTimeoutEvent)},t._removeWebSocketEventListeners=function(){t._ws.off("close",t._handleCloseEvent),t._ws.off("closing",t._handleClosingEvent),t._ws.off("connecting",t._handleConnectingEvent),t._ws.off("error",t._handleErrorEvent),t._ws.off("message",t._handleMessageEvent),t._ws.off("open",t._handleOpenEvent),t._ws.off("timeout",t._handleTimeoutEvent)},t._handleCloseEvent=function(e){y.info("live room closed bacause of ".concat(e.code,"-").concat(e.reason||M(e.code))),t.state=exports.LiveState.CLOSED},t._handleClosingEvent=function(){var e;y.info("live room is closing, onLine:",null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===e?void 0:e.onLine),t.state=exports.LiveState.CLOSED},t._handleConnectingEvent=function(){y.info("live room is connecting"),t.state=exports.LiveState.CONNECTING},t._handleErrorEvent=function(e){y.error("live room error",e),t.state=exports.LiveState.CLOSED},t._handleMessageEvent=function(e){var n=function(){try{return JSON.parse(e.data)}catch(t){return e.data}}();t.emit("message",n)},t._handleOpenEvent=function(e){y.info("live room open",e.detail),t.state=exports.LiveState.OPEN,e.detail.reconnects>0&&t.emit("reconnected",e.detail)},t._handleTimeoutEvent=function(e){y.error("live room connect timeout!",e.detail),t.state=exports.LiveState.CLOSED},t.dispose=function(){return u(t,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return this._removeWebSocketEventListeners(),[4,this.close("live room close by controller disposed!")];case 1:return[2,e.sent()]}}))}))},t.open=function(e){return t._ws.open(e)},t.close=function(e,n){return new Promise((function(r){t._ws.once("close",(function(){return r(!0)})),t._ws.close(e,n)}))},t._addWebSocketEventListeners(),t}return c(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var t=JSON.parse(JSON.stringify(this._state));this._state=e,this.emit("stateChange",this.state,t)},enumerable:!1,configurable:!0}),t.prototype.sendMessage=function(e){if(void 0===e&&(e=""),null==e||""===e)throw new Error("live message is empty!");if(this.state===exports.LiveState.OPEN)return this._ws.send(JSON.stringify(e));throw new Error("live has not yet been initialized!")},t}(m),He=function(e){return Promise.reject("unimplemented method GetVoiceSign")},Je=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n=[]),{command:e,front_request_id:S(),data:a(a({},t),{to_user_ids:Array.isArray(n)?n:[n]})}},qe=function(e){function t(t){var n,r=this;return(r=e.call(this)||this)._options={},r.keyframes=new m,r._buildInData={keyframes:{}},r.getFramesByKey=function(e){return r.snapshot[e]},r.sendKeyframe=function(e,t){var n;if(r.state!==exports.LiveState.OPEN)return!1;r._buildInData.keyframes=a(a({},r._buildInData.keyframes),((n={})[e]=t,n));var o=Je(exports.Command.KeyframeSync,r.snapshot);try{return r._controller.sendMessage(o),!0}catch(e){return y.error(e),!1}},r._controller=new De,r._addLiveControllerEventListeners=function(){r._controller.on("stateChange",r._handleStateChange),r._controller.on("message",r._handleMessage)},r._removeLiveControllerEventListeners=function(){r._controller.off("stateChange",r._handleStateChange),r._controller.off("message",r._handleMessage)},r._handleStateChange=function(e,t){return r.emit("stateChange",e,t)},r._handleMessage=function(e){return u(r,void 0,void 0,(function(){var t,n,r,o,i,s,c,a,u,f,h,p,v,m,g,_,b,w,S,k,E=this;return l(this,(function(l){switch(l.label){case 0:if("object"!=typeof e)return[3,22];if(t=e.command,n=e.data,r=void 0===n?{}:n,o=e.frontRequestId,"SUCCESS"!==e.code)return[3,21];switch(t){case exports.Command.SelfUserInfo:return[3,1];case exports.Command.RoomInfo:return[3,2];case exports.Command.RTCInfo:return[3,3];case exports.Command.UserList:return[3,10];case exports.Command.CustomEvent:return[3,11];case exports.Command.KeyframeSync:return[3,12];case exports.Command.BuiltinMsg:return[3,13];case exports.Command.UserKickOut:return[3,18]}return[3,19];case 1:return i=r,Ve(this.selfInfo,i,{deep:!0})||(this._buildInData.selfInfo=i,this.emit("selfInfoUpdate",this._buildInData.selfInfo,o)),[3,20];case 2:return s=r,this._buildInData.roomInfo=Object.assign({},s),this.emit("readyKeyframeSync",s.last_frame||{}),[3,20];case 3:return a=(c=r).voice_id,u=c.type,this._buildInData.rtcInfo={voiceId:a,type:u},(null===(_=this.$RTC)||void 0===_?void 0:_.joined)?[3,8]:[4,null===(b=this.$RTC)||void 0===b?void 0:b.join({voiceId:a,userId:(null===(w=this.selfInfo)||void 0===w?void 0:w.id)||"",roomId:null===(S=this.roomInfo)||void 0===S?void 0:S.info.room_code,type:u})];case 4:return l.sent()?(f=null!==(k=this._options.initialMicroStatus)&&void 0!==k?k:exports.MicroStatus.OPEN,[4,this.toggleMicro(f===exports.MicroStatus.OPEN)]):[3,6];case 5:return l.sent(),[3,7];case 6:y.error("加入语音房间失败"),l.label=7;case 7:return[3,9];case 8:y.warn("已加入语音房间,无需重复加入!"),l.label=9;case 9:return[3,20];case 10:return h=r,this._buildInData.userList=h,this.emit("userListUpdate",this.userList,o),[3,20];case 11:return p=r,this.emit("broadcast",p,o),[3,20];case 12:return v=r,m=Object.keys(v).reduce((function(e,t){var n;if(Ve(v[t],E._buildInData.keyframes[t],{deep:!0}))return e;var r=[v[t],E._buildInData.keyframes[t],o],i=t;return(n=E.keyframes).emit.apply(n,d([i],r,!1)),E._buildInData.keyframes[t]=v[t],e[t]=v[t],e}),{}),this.emit("keyframes",m,o),[3,20];case 13:return g=r,this.emit("builtinEvent",g),g.event_type===exports.BuiltinEventType.UserChange&&this.emit("userChange",g),g.event_type===exports.BuiltinEventType.RoomChange&&this.emit("roomChange",g),g.event_type!==exports.BuiltinEventType.UserChange||g.action!==exports.BuiltinActionType.UserMicroStatus?[3,15]:[4,this.toggleMicro(g.data.status===exports.MicroStatus.OPEN)];case 14:l.sent(),l.label=15;case 15:return g.event_type!==exports.BuiltinEventType.RoomChange||g.action!==exports.BuiltinActionType.RoomClose?[3,17]:[4,this.exit()];case 16:l.sent(),l.label=17;case 17:return[3,20];case 18:return this.emit("kickOut"),[3,20];case 19:console.warn("unknown command: ",t),l.label=20;case 20:return[3,22];case 21:this.emit("error",e),l.label=22;case 22:return[2]}}))}))},r._clearLiveData=function(){r._buildInData={keyframes:{}}},r.connect=function(e){return void 0===e&&(e={}),u(r,void 0,void 0,(function(){var t,n,r,o,i,s,c,a,u,d,f,h;return l(this,(function(l){switch(l.label){case 0:return this._options.url=null!==(d=null!==(u=e.url)&&void 0!==u?u:this._options.url)&&void 0!==d?d:"",this._options.getTicket=null!==(f=e.getTicket)&&void 0!==f?f:this._options.getTicket,this._options.initialMicroStatus=null!==(h=e.rtcMicStatus)&&void 0!==h?h:this._options.initialMicroStatus,/^ws(s):\/\//.test(this._options.url)&&"function"==typeof this._options.getTicket?(t=e.force,n=void 0!==t&&t,this._options.rtc?[4,this._options.rtc.detectMicro()]:[3,2]):/^ws(s):\/\//.test(this._options.url)?"function"!=typeof this._options.getTicket?[2,new Error("getTicket muse be function")]:[2,!1]:[2,new Error("Illegal realsee live room link")];case 1:if(!l.sent())return[2,new Error("Failed to obtain microphone authorization")];l.label=2;case 2:if((r=this.state)!==exports.LiveState.CONNECTING&&r!==exports.LiveState.OPEN)return[3,8];if(!n)return[3,7];l.label=3;case 3:return l.trys.push([3,5,,6]),[4,this._controller.close("force close by connect")];case 4:return l.sent(),[3,6];case 5:return o=l.sent(),console.warn(o),[3,6];case 6:return[3,8];case 7:return[2,new Error("已有Live实例正在连接中,请勿重复连接!")];case 8:return this._clearLiveData(),s=Re,c=[this._options.url],a={},[4,this._options.getTicket()];case 9:return i=s.apply(void 0,c.concat([(a.ticket=l.sent(),a.force=Number(!!n),a)])),this._controller.open(i),[2,!0]}}))}))},r.exit=function(){return u(r,void 0,void 0,(function(){var e,t;return l(this,(function(n){switch(n.label){case 0:if(this._clearLiveData(),this.state!==exports.LiveState.OPEN)return[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this.$RTC)||void 0===t?void 0:t.quit()];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),y.warn(e),[3,4];case 4:return[4,this._controller.close()];case 5:return[2,n.sent()]}}))}))},r.close=function(){return u(r,void 0,void 0,(function(){var e,t;return l(this,(function(n){switch(n.label){case 0:return(null===(t=null===(e=this.selfInfo)||void 0===e?void 0:e.permission)||void 0===t?void 0:t.close_live_room)?[4,this.updateStatus(exports.BuiltinEventType.RoomChange,exports.BuiltinActionType.RoomClose,{})]:[3,2];case 1:return[2,n.sent()];case 2:return[2]}}))}))},r.dispose=function(){return u(r,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return this._removeLiveControllerEventListeners(),this._clearLiveData(),[4,this._controller.dispose()];case 1:return[2,e.sent()]}}))}))},r.setSelfInfo=function(e){return u(r,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserInfo,e)];case 1:return[2,t.sent()]}}))}))},r.toggleMicro=function(e){return u(r,void 0,void 0,(function(){var t,n,r,o;return l(this,(function(i){switch(i.label){case 0:return(null===(r=null===(n=this.selfInfo)||void 0===n?void 0:n.permission)||void 0===r?void 0:r.control_own_micro)?[4,null===(o=this.$RTC)||void 0===o?void 0:o.toggleMicro(e)]:[2,!1];case 1:return(t=i.sent())?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserMicroStatus,{status:e?exports.MicroStatus.OPEN:exports.MicroStatus.CLOSE},[])]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2,t]}}))}))},r.forbidMicro=function(e,t){return u(r,void 0,void 0,(function(){var n,r;return l(this,(function(o){switch(o.label){case 0:return("function"!=typeof this._options.canForbidUserMicro||this._options.canForbidUserMicro(t))&&(null===(r=null===(n=this.selfInfo)||void 0===n?void 0:n.permission)||void 0===r?void 0:r.control_other_micro)?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserMicroStatus,{status:e},t)]:[2,!1];case 1:return[2,o.sent()]}}))}))},r.forbidSync=function(e,t){return u(r,void 0,void 0,(function(){var n,r;return l(this,(function(o){switch(o.label){case 0:return("function"!=typeof this._options.canForbidUserSync||this._options.canForbidUserSync(t))&&(null===(r=null===(n=this.selfInfo)||void 0===n?void 0:n.permission)||void 0===r?void 0:r.control_other_sync)?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserPermission,{sync_frame:e},t)]:[2,!1];case 1:return[2,o.sent()]}}))}))},r.kick=function(e){return u(r,void 0,void 0,(function(){var t,n;return l(this,(function(r){switch(r.label){case 0:return("function"!=typeof this._options.canForbidUserKick||this._options.canForbidUserKick(e))&&(null===(n=null===(t=this.selfInfo)||void 0===t?void 0:t.permission)||void 0===n?void 0:n.change_other_status)?[4,this.updateStatus(exports.BuiltinEventType.UserChange,exports.BuiltinActionType.UserStatus,{status:"KICK_OUT"},e)]:[2,!1];case 1:return[2,r.sent()]}}))}))},r._addLiveControllerEventListeners(),r._options=Object.assign({initialMicroStatus:exports.MicroStatus.OPEN},t),r._options.jsBridge=t.jsBridge?t.jsBridge:t.useBuiltInJsBridge?new ke:void 0,r._options.getVoiceSign=null!==(n=t.getVoiceSign)&&void 0!==n?n:He,r._options.autoPlayConfirm=t.autoPlayConfirm,r._options.rtc=function(){if(t.rtc)return t.rtc;if(t.rtcType)switch(t.getVoiceSign||y.error("GetVoiceSign method must be passed when using built-in RTC instances"),t.rtcType){case exports.RTCType.RealseeVRWebViewRTC:return r._options.jsBridge?new x({jsBridge:r._options.jsBridge,getVoiceSign:r._options.getVoiceSign}):void y.error("JsBridge instance must be passed when using built-in VRWebViewRTC instances");case exports.RTCType.RealseeBrowserChimeRTC:return new C({getVoiceSign:r._options.getVoiceSign,logLevel:t.__debug__?Ie.DEBUG:Ie.ERROR});case exports.RTCType.RealseeBrowserRTC:return r._options.autoPlayConfirm||y.error("autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"),new E({getVoiceSign:r._options.getVoiceSign,autoPlayConfirm:r._options.autoPlayConfirm});default:return void y.error("unknown built-in RTC type")}return t.useBuiltInRTC?(t.getVoiceSign||y.error("GetVoiceSign method must be passed when using built-in RTC instances"),r._options.jsBridge?We&&(Ae||Le)||Ne?new x({jsBridge:r._options.jsBridge,getVoiceSign:r._options.getVoiceSign}):t.builtInRTCType===exports.BuiltInRTCType.RealseeXChimeRTC?new C({getVoiceSign:r._options.getVoiceSign}):new E({getVoiceSign:r._options.getVoiceSign,autoPlayConfirm:r._options.autoPlayConfirm}):void y.error("jsBridge instance must be passed when using built-in RTC instances")):void 0}(),r._options.rtc||y.warn("unused rtc"),r._options.url&&r._options.getTicket&&r.connect(),r._options.__debug__&&Object.assign(window,{$liveController:r._controller,$live:r}),r}return c(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return Object.freeze(this._options||{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._controller.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readyState",{get:function(){return this._controller.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.options.url},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"$RTC",{get:function(){return this._options.rtc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsBridge",{get:function(){return this._options.jsBridge},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this._buildInData.keyframes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfInfo",{get:function(){return this._buildInData.selfInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userList",{get:function(){return this._buildInData.userList||[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomInfo",{get:function(){return this._buildInData.roomInfo},enumerable:!1,configurable:!0}),t.prototype.updateStatus=function(e,t,n,r){return u(this,void 0,void 0,(function(){var o,i;return l(this,(function(s){if(this.state!==exports.LiveState.OPEN)return[2,!1];o=Object.assign({event_type:e,action:t},{data:n}),i=Je(exports.Command.BuiltinMsg,o,r);try{return this._controller.sendMessage(i),[2,!0]}catch(e){return y.error(e),[2,!1]}return[2]}))}))},t.prototype.broadcast=function(e,t,n){var r=this;return this.state===exports.LiveState.OPEN&&new Promise((function(o,i){var s=Je(exports.Command.CustomEvent,e,t),c=s.front_request_id,a=n?setTimeout((function(){i(new Error("RESPONSE TIMEOUT")),r.off("broadcast",u)}),n):void 0,u=function(e,t){t===c&&(a&&clearTimeout(a),r.off("broadcast",u),o(e))};r.on("broadcast",u);try{r._controller.sendMessage(s)}catch(e){i(e)}}))},t}(m),$e=function(e){var t,n;return(null===window||void 0===window?void 0:window.__Realsee_Live__)&&(null===(n=null===(t=null===window||void 0===window?void 0:window.__Realsee_Live__)||void 0===t?void 0:t.dispose)||void 0===n||n.call(t),window.__Realsee_Live__=null),new qe(e)};exports.BrowserRTC=E,exports.BrowserRTC4Chime=C,exports.CoreRTC=g,exports.VRWebViewRTC=x,exports.createLive=$e,exports.createLiveReact=function(e){var t=this,r=n.createContext(null),o=$e(e),s=o.jsBridge,c=function(){var e=i.default.useContext(r);if(!e)throw new Error("LiveProvider never found.");return e};return{live:o,jsBridge:s,LiveProvider:function(e){return i.default.createElement(r.Provider,{value:o},e.children)},unsafe__useLiveInstance:function(){return o},unsafe__useRTCInstance:function(){return o.$RTC},useConnect:function(){return function(e){return u(t,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,o.connect(e)];case 1:return[2,t.sent()]}}))}))}},useKeyframe:function(e){var t=c(),n=i.default.useState(t.getFramesByKey(e)),r=n[0],o=n[1];return i.default.useEffect((function(){var n=e,r=function(e){return o(e)};return t.keyframes.on(n,r),function(){return t.keyframes.off(n,r)}}),[t]),[r,i.default.useCallback((function(n){return t.sendKeyframe(e,n)}),[t])]},useKeyframeUpdateCallback:function(e,t,n){void 0===n&&(n=[]);var r=c(),o=d([r,name],n,!0),s=function(){return r.keyframes.off(e,t)};return i.default.useEffect((function(){return r.keyframes.on(e,t),s}),o),s},useLiveAction:function(){var e=this,t=c();return{connect:function(n){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.connect(n)];case 1:return[2,e.sent()]}}))}))},broadcast:function(n,r,o){return void 0===o&&(o=0),u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.broadcast(n,r,o)];case 1:return[2,e.sent()]}}))}))},exit:function(){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.exit()];case 1:return[2,e.sent()]}}))}))},kick:function(n){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.kick(n)];case 1:return[2,e.sent()]}}))}))},toggleMicro:function(e){return t.toggleMicro(e)},forbidMicro:function(n,r){return void 0===r&&(r=[]),u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.forbidMicro(n,r)];case 1:return[2,e.sent()]}}))}))},forbidSync:function(e,n){return void 0===n&&(n=[]),t.forbidSync(e,n)},sendKeyframe:function(e,n){return t.sendKeyframe(e,n)},getFramesByKey:function(e){return t.getFramesByKey(e)},setSelfInfo:function(e){return t.setSelfInfo(e)},updateStatus:function(e,n,r,o){return t.updateStatus(e,n,r,o)}}},useLiveEventCallback:function(e,t,n){void 0===n&&(n=[]);var r=c(),o=function(){return r.off(e,t)},s=d([r,e],n,!0);return i.default.useEffect((function(){return r.on(e,t),o}),s),o},useLiveState:function(){var e=c(),t=i.default.useState(e.state),n=t[0],r=t[1];return i.default.useEffect((function(){var t=function(e){return r(e)};return e.on("stateChange",t),function(){return e.off("stateChange",t)}}),[e]),n},useRTCAction:function(){var e=c();return{join:function(t){return e.$RTC.join(t)},quit:function(){return e.$RTC.quit()},shock:function(){var t,n;return null===(n=(t=e.$RTC).shock)||void 0===n?void 0:n.call(t)},toggleMicro:function(t){return e.$RTC.toggleMicro(t)},detectMicro:function(){return e.$RTC.detectMicro()}}},useRTCEventCallback:function(e,t,n){void 0===n&&(n=[]);var r=c(),o=function(){return r.$RTC.off(e,t)},s=d([r,e],n,!0);return i.default.useEffect((function(){return r.$RTC.on(e,t),o}),s),o},useSelfInfo:function(){var e=this,t=c(),n=i.default.useState(t.selfInfo||{}),r=n[0],o=n[1],s=function(e){return o(e)};i.default.useEffect((function(){return t.on("selfInfoUpdate",s),function(){return t.off("selfInfoUpdate",s)}}),[t]);var a=i.default.useCallback((function(n){return u(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,t.setSelfInfo(n)];case 1:return[2,e.sent()]}}))}))}),[t]);return[r,a]},useKeyframesSnapshot:function(){var e=c(),t=i.default.useState(e.snapshot),n=t[0],r=t[1];return i.default.useEffect((function(){var t=function(e){return r(e)};return e.on("keyframes",t),function(){return e.off("keyframes",t)}})),n},useUserList:function(){var e=c(),t=i.default.useState(e.userList),n=t[0],r=t[1],o=function(e){return r(e)};return i.default.useEffect((function(){return e.on("userListUpdate",o),function(){return e.off("userListUpdate",o)}}),[e]),n}}},exports.parseLiveMsg=function(e){try{var t=JSON.parse(e),n={code:t.code,message:t.message,command:t.command,roomCode:t.room_code,appID:t.app_id,requestId:t.request_id,frontRequestId:t.front_request_id,triggerUserID:t.trigger_user_id,data:t.data||{}},r=Object.keys(n).filter((function(e){return void 0===n[e]}));return r.length>0&&console.warn("推送数据格式异常:".concat(r.join(" ")," 值不存在!")),n}catch(e){return!1}},exports.parseWSClsErr=M;
|
|
2
2
|
//# sourceMappingURL=realsee-live.cjs.production.js.map
|