@realsee/live 0.6.3 → 0.6.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/index.cjs.js +12 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1104 -1130
- package/dist/index.es.js.map +1 -1
- package/dist/rtc/BrowserRTC4Chime.d.ts +6 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/BrowserRTC4Chime.html +87 -29
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ConsoleLogger as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
1
|
+
var Vt = Object.defineProperty;
|
|
2
|
+
var $t = (r, s, e) => s in r ? Vt(r, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[s] = e;
|
|
3
|
+
var o = (r, s, e) => ($t(r, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
|
+
import xt from "@realsee/jsbridge-x";
|
|
5
|
+
import Ne from "trtc-js-sdk";
|
|
6
|
+
import { ConsoleLogger as Ut, LogLevel as Ft, DefaultDeviceController as Bt, MeetingSessionConfiguration as Wt, DefaultMeetingSession as Kt, DefaultModality as tt, MeetingSessionStatusCode as qt } from "amazon-chime-sdk-js";
|
|
7
|
+
import D, { createContext as Gt } from "react";
|
|
8
|
+
const ce = Symbol("$$REALSEE_LIVE_EVENT$$");
|
|
9
|
+
function pe(r) {
|
|
10
|
+
return r[ce] || (r[ce] = {}), r[ce];
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function Yt(r) {
|
|
13
|
+
r[ce] || delete r[ce];
|
|
14
14
|
}
|
|
15
|
-
class
|
|
15
|
+
class ue {
|
|
16
16
|
/**
|
|
17
17
|
* 判断是否注册了事件
|
|
18
18
|
* @param name 事件类型
|
|
19
19
|
*/
|
|
20
20
|
hasListener(s) {
|
|
21
|
-
const e =
|
|
21
|
+
const e = pe(this);
|
|
22
22
|
return e && e[s] && e[s].length > 0;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -30,9 +30,9 @@ class ae {
|
|
|
30
30
|
* @template K 预设的监听事件名称
|
|
31
31
|
* @template C 回调函数函数上下文
|
|
32
32
|
*/
|
|
33
|
-
on(s, e,
|
|
34
|
-
const
|
|
35
|
-
return
|
|
33
|
+
on(s, e, i) {
|
|
34
|
+
const n = pe(this);
|
|
35
|
+
return n[s] || (n[s] = []), n[s].push([e, i || !1]), () => this.off(s, e);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* 注册事件(是否只执行一次)
|
|
@@ -56,18 +56,18 @@ class ae {
|
|
|
56
56
|
*/
|
|
57
57
|
off(s, e) {
|
|
58
58
|
if (s === void 0) {
|
|
59
|
-
|
|
59
|
+
Yt(this);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
|
|
62
|
+
const i = pe(this);
|
|
63
|
+
if (i[s] || (i[s] = []), e === void 0) {
|
|
64
|
+
i[s].length = 0;
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
let
|
|
68
|
-
for (;
|
|
67
|
+
let n = 0;
|
|
68
|
+
for (; n < i[s].length && i[s][n][0] !== e; n++)
|
|
69
69
|
;
|
|
70
|
-
|
|
70
|
+
n < i[s].length && i[s].splice(n, 1);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* 触发事件
|
|
@@ -77,23 +77,23 @@ class ae {
|
|
|
77
77
|
* @template K 预设的监听事件名称
|
|
78
78
|
*/
|
|
79
79
|
emit(s, ...e) {
|
|
80
|
-
let
|
|
81
|
-
const
|
|
82
|
-
for (let u of
|
|
83
|
-
const [
|
|
84
|
-
|
|
80
|
+
let i = !1;
|
|
81
|
+
const c = pe(this)[s] || [];
|
|
82
|
+
for (let u of c.slice()) {
|
|
83
|
+
const [d, g = !1] = u, v = d(...e);
|
|
84
|
+
g && this.off(s, d), v === !1 && (i = !0);
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return i;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class Me extends ue {
|
|
90
90
|
}
|
|
91
|
-
var Q = /* @__PURE__ */ ((
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
return `[${s}-${e}-${
|
|
95
|
-
},
|
|
96
|
-
switch (s.unshift(`Realsee Live ${
|
|
91
|
+
var Q = /* @__PURE__ */ ((r) => (r.RealseeBrowserRTC = "RealseeBrowserRTC", r.RealseeVRWebViewRTC = "RealseeVRWebViewRTC", r.RealseeBrowserChimeRTC = "RealseeBrowserChimeRTC", r))(Q || {}), ut = /* @__PURE__ */ ((r) => (r.RealseeXTRTC = "trtc", r.RealseeXChimeRTC = "chime", r))(ut || {});
|
|
92
|
+
const Ht = () => {
|
|
93
|
+
const r = new Date(), s = r.getFullYear(), e = (r.getMonth() + 1).toString().padStart(2, "0"), i = r.getDate().toString().padStart(2, "0"), n = r.getHours().toString().padStart(2, "0"), c = r.getMinutes().toString().padStart(2, "0"), u = r.getSeconds().toString().padStart(2, "0"), d = r.getMilliseconds();
|
|
94
|
+
return `[${s}-${e}-${i} ${n}:${c}:${u}.${d}]`;
|
|
95
|
+
}, be = (r, s = []) => {
|
|
96
|
+
switch (s.unshift(`Realsee Live ${Ht()} <${r}> `), r) {
|
|
97
97
|
case "INFO":
|
|
98
98
|
return console.info(...s);
|
|
99
99
|
case "ERROR":
|
|
@@ -103,19 +103,19 @@ const Kt = () => {
|
|
|
103
103
|
default:
|
|
104
104
|
return console.log(...s);
|
|
105
105
|
}
|
|
106
|
-
},
|
|
107
|
-
log:
|
|
108
|
-
info:
|
|
109
|
-
error:
|
|
110
|
-
warn:
|
|
111
|
-
},
|
|
106
|
+
}, Jt = (...r) => be("LOG", r), zt = (...r) => be("INFO", r), Xt = (...r) => be("ERROR", r), Zt = (...r) => be("WARN", r), Qt = {
|
|
107
|
+
log: Jt,
|
|
108
|
+
info: zt,
|
|
109
|
+
error: Xt,
|
|
110
|
+
warn: Zt
|
|
111
|
+
}, O = Qt;
|
|
112
112
|
function X() {
|
|
113
113
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Ee() {
|
|
116
116
|
return (X() + X() + "-" + X() + "-4" + X().substr(0, 3) + "-" + X() + "-" + X() + X() + X()).toLowerCase();
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class rt extends Me {
|
|
119
119
|
constructor(e) {
|
|
120
120
|
super();
|
|
121
121
|
o(this, "type", Q.RealseeBrowserRTC);
|
|
@@ -126,105 +126,105 @@ class tt extends De {
|
|
|
126
126
|
throw new Error("方法 getVoiceSign 未实现");
|
|
127
127
|
});
|
|
128
128
|
o(this, "_autoPlayConfirm");
|
|
129
|
-
o(this, "checkRequirement", () =>
|
|
129
|
+
o(this, "checkRequirement", () => Ne.checkSystemRequirements());
|
|
130
130
|
o(this, "$dom", document.createElement("div"));
|
|
131
131
|
o(this, "_trtc", {
|
|
132
132
|
client: null,
|
|
133
133
|
stream: null
|
|
134
134
|
});
|
|
135
135
|
o(this, "join", async (e) => {
|
|
136
|
-
var
|
|
136
|
+
var c;
|
|
137
137
|
this.emit("joinWillStart");
|
|
138
|
-
const
|
|
138
|
+
const i = await this._getVoiceSign({
|
|
139
139
|
voiceId: e.voiceId,
|
|
140
140
|
roomId: e.roomId,
|
|
141
141
|
userId: e.userId
|
|
142
142
|
});
|
|
143
|
-
this._trtc.client =
|
|
143
|
+
this._trtc.client = Ne.createClient({
|
|
144
144
|
mode: "rtc",
|
|
145
|
-
...
|
|
145
|
+
...i,
|
|
146
146
|
enableAutoPlayDialog: typeof this._autoPlayConfirm != "function"
|
|
147
|
-
}), (
|
|
148
|
-
let
|
|
149
|
-
var
|
|
150
|
-
(
|
|
147
|
+
}), (c = this._trtc.client) == null || c.enableAudioVolumeEvaluation(), this._registerRtcEvent();
|
|
148
|
+
let n = await new Promise((u) => {
|
|
149
|
+
var d;
|
|
150
|
+
(d = this._trtc.client) == null || d.join({ roomId: Number(e.voiceId) }).then(() => u(!0)).catch(() => u(!1));
|
|
151
151
|
});
|
|
152
|
-
return this.joined =
|
|
153
|
-
userId:
|
|
152
|
+
return this.joined = n, n ? (this._trtc.stream = Ne.createStream({
|
|
153
|
+
userId: i.userId,
|
|
154
154
|
audio: !0,
|
|
155
155
|
video: !1
|
|
156
|
-
}),
|
|
157
|
-
var
|
|
158
|
-
(
|
|
159
|
-
}),
|
|
160
|
-
var
|
|
161
|
-
(
|
|
162
|
-
}), this.joined =
|
|
156
|
+
}), n = await new Promise((u) => {
|
|
157
|
+
var d;
|
|
158
|
+
(d = this._trtc.stream) == null || d.initialize().then(() => u(!0)).catch(() => u(!1));
|
|
159
|
+
}), n = await new Promise((u) => {
|
|
160
|
+
var d;
|
|
161
|
+
(d = this._trtc.client) == null || d.publish(this._trtc.stream).then(() => u(!0)).catch(() => u(!1));
|
|
162
|
+
}), this.joined = n, this.joined && this.emit("joined"), n) : !1;
|
|
163
163
|
});
|
|
164
164
|
o(this, "_handleStreamAdded", (e) => {
|
|
165
|
-
var
|
|
166
|
-
const
|
|
167
|
-
console.log("远端流增加: " +
|
|
165
|
+
var n;
|
|
166
|
+
const i = e.stream;
|
|
167
|
+
console.log("远端流增加: " + i.getId()), (n = this._trtc.client) == null || n.subscribe(i);
|
|
168
168
|
});
|
|
169
169
|
o(this, "_handleStreamSubscribed", (e) => {
|
|
170
|
-
const
|
|
171
|
-
console.log("远端流订阅成功:" +
|
|
172
|
-
const
|
|
173
|
-
u.id =
|
|
174
|
-
}),
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
this._autoPlayConfirm({ onConfirm:
|
|
170
|
+
const i = e.stream;
|
|
171
|
+
console.log("远端流订阅成功:" + i.getId());
|
|
172
|
+
const c = `rs-rtc-remote_stream-${i.getId()}`, u = document.createElement("div");
|
|
173
|
+
u.id = c, this.$dom.appendChild(u), typeof this._autoPlayConfirm == "function" ? (i.play(c).catch((d) => {
|
|
174
|
+
}), i.on("error", (d) => {
|
|
175
|
+
if (d.getCode() === 16451) {
|
|
176
|
+
const v = () => i.resume();
|
|
177
|
+
this._autoPlayConfirm({ onConfirm: v });
|
|
178
178
|
}
|
|
179
|
-
})) :
|
|
179
|
+
})) : i.play(c);
|
|
180
180
|
});
|
|
181
181
|
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initParentDom();
|
|
182
182
|
}
|
|
183
183
|
_initParentDom() {
|
|
184
|
-
this.$dom.id = `rs-rtc-${
|
|
184
|
+
this.$dom.id = `rs-rtc-${Ee()}`, this.$dom.style.display = "none", document.body.appendChild(this.$dom);
|
|
185
185
|
}
|
|
186
186
|
quit() {
|
|
187
187
|
return new Promise(async (e) => {
|
|
188
|
-
var
|
|
189
|
-
this.joined = !1, this._trtc.stream && (await ((
|
|
188
|
+
var i, n;
|
|
189
|
+
this.joined = !1, this._trtc.stream && (await ((i = this._trtc.client) == null ? void 0 : i.unpublish(this._trtc.stream)), this._trtc.stream.stop(), this._trtc.stream.close(), this._trtc.stream = null), (n = this._trtc.client) == null || n.leave().then(() => this._trtc.client = null).then(() => e(!0)).catch(() => e(!1)), e(!0);
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
detectMicro() {
|
|
193
193
|
return new Promise((e) => {
|
|
194
|
-
const
|
|
194
|
+
const i = { audio: !0, video: !1 };
|
|
195
195
|
try {
|
|
196
|
-
navigator.mediaDevices.getUserMedia(
|
|
197
|
-
|
|
196
|
+
navigator.mediaDevices.getUserMedia(i).then(() => e(!0)).catch((n) => {
|
|
197
|
+
O.error(n.message), e(!1);
|
|
198
198
|
});
|
|
199
|
-
} catch (
|
|
200
|
-
console.error(
|
|
199
|
+
} catch (n) {
|
|
200
|
+
console.error(n), e(!1);
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
toggleMicro(e) {
|
|
205
|
-
var
|
|
205
|
+
var i, n, c, u;
|
|
206
206
|
return Promise.resolve(
|
|
207
|
-
(e ? (
|
|
207
|
+
(e ? (n = (i = this._trtc) == null ? void 0 : i.stream) == null ? void 0 : n.unmuteAudio() : (u = (c = this._trtc) == null ? void 0 : c.stream) == null ? void 0 : u.muteAudio()) || !1
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
shock() {
|
|
211
211
|
throw new Error("Method not implemented.");
|
|
212
212
|
}
|
|
213
213
|
_registerRtcEvent() {
|
|
214
|
-
var e,
|
|
215
|
-
(e = this._trtc.client) == null || e.on("stream-added", this._handleStreamAdded), (
|
|
214
|
+
var e, i, n, c;
|
|
215
|
+
(e = this._trtc.client) == null || e.on("stream-added", this._handleStreamAdded), (i = this._trtc.client) == null || i.on("stream-subscribed", this._handleStreamSubscribed), (n = this._trtc.client) == null || n.on(
|
|
216
216
|
"audio-volume",
|
|
217
217
|
(u) => this.emit(
|
|
218
218
|
"userVolumes",
|
|
219
|
-
u.result.map(({ userId:
|
|
220
|
-
userId:
|
|
221
|
-
audioVolume:
|
|
219
|
+
u.result.map(({ userId: d, audioVolume: g }) => ({
|
|
220
|
+
userId: d,
|
|
221
|
+
audioVolume: g
|
|
222
222
|
}))
|
|
223
223
|
)
|
|
224
|
-
), (
|
|
224
|
+
), (c = this._trtc.client) == null || c.on("error", (u) => this.emit("error", u));
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
class
|
|
227
|
+
class it extends Me {
|
|
228
228
|
constructor(e) {
|
|
229
229
|
super();
|
|
230
230
|
o(this, "type", Q.RealseeBrowserChimeRTC);
|
|
@@ -239,16 +239,18 @@ class rt extends De {
|
|
|
239
239
|
o(this, "audioOutput");
|
|
240
240
|
o(this, "deviceChangeObserver", {});
|
|
241
241
|
o(this, "audioVideoObserver", {});
|
|
242
|
+
o(this, "audioMixObserver");
|
|
242
243
|
o(this, "_getVoiceSign", () => {
|
|
243
244
|
throw new Error("方法 getVoiceSign 未实现");
|
|
244
245
|
});
|
|
246
|
+
o(this, "_autoPlayConfirm");
|
|
245
247
|
o(this, "$dom", document.createElement("div"));
|
|
246
248
|
o(this, "$audio", document.createElement("audio"));
|
|
247
249
|
/**
|
|
248
250
|
* 对audio标签初始化
|
|
249
251
|
*/
|
|
250
252
|
o(this, "_initDom", () => {
|
|
251
|
-
this.$audio.id = `rs-rtc-${
|
|
253
|
+
this.$audio.id = `rs-rtc-${Ee()}`, this.$dom.id = `rs-rtc-${Ee()}`, this.$dom.appendChild(this.$audio), document.body.appendChild(this.$dom);
|
|
252
254
|
});
|
|
253
255
|
/**
|
|
254
256
|
* 初始化事件监听器
|
|
@@ -256,20 +258,20 @@ class rt extends De {
|
|
|
256
258
|
o(this, "initObservers", () => {
|
|
257
259
|
this.deviceChangeObserver = {
|
|
258
260
|
audioInputsChanged: (e) => {
|
|
259
|
-
this.logger.info(`audioInputsChanged ${typeof e}`), e == null || e.forEach((
|
|
260
|
-
this.logger.info(`Device ID: ${
|
|
261
|
+
this.logger.info(`audioInputsChanged ${typeof e}`), e == null || e.forEach((i) => {
|
|
262
|
+
this.logger.info(`Device ID: ${i.deviceId} Microphone: ${i.label}`);
|
|
261
263
|
});
|
|
262
264
|
},
|
|
263
265
|
audioOutputsChanged: (e) => {
|
|
264
|
-
this.logger.info(`audioOutputsChanged ${typeof e}`), e == null || e.forEach((
|
|
265
|
-
this.logger.info(`Device ID: ${
|
|
266
|
+
this.logger.info(`audioOutputsChanged ${typeof e}`), e == null || e.forEach((i) => {
|
|
267
|
+
this.logger.info(`Device ID: ${i.deviceId} Speaker: ${i.label}`);
|
|
266
268
|
});
|
|
267
269
|
},
|
|
268
270
|
// videoInputsChanged: (freshVideoInputDeviceList: any) => {
|
|
269
271
|
// this.logger.info(`Video inputs updated: ${freshVideoInputDeviceList}`);
|
|
270
272
|
// },
|
|
271
|
-
audioInputMuteStateChanged: (e,
|
|
272
|
-
this.logger.info(`Device ${e.toString()} ${
|
|
273
|
+
audioInputMuteStateChanged: (e, i) => {
|
|
274
|
+
this.logger.info(`Device ${e.toString()} ${i ? "is muted in hardware" : "is not muted"}`);
|
|
273
275
|
}
|
|
274
276
|
}, this.audioVideoObserver = {
|
|
275
277
|
audioVideoDidStart: () => {
|
|
@@ -281,52 +283,67 @@ class rt extends De {
|
|
|
281
283
|
audioVideoDidStartConnecting: (e) => {
|
|
282
284
|
e && this.logger.info("Attempting to reconnect");
|
|
283
285
|
}
|
|
286
|
+
}, this.audioMixObserver = {
|
|
287
|
+
meetingAudioStreamBecameActive: (e) => {
|
|
288
|
+
if (this.$audio.paused) {
|
|
289
|
+
const i = () => this.$audio.play().then(() => {
|
|
290
|
+
}).catch((n) => {
|
|
291
|
+
if (O.error("播放远端流失败!", n), typeof this._autoPlayConfirm == "function") {
|
|
292
|
+
const c = () => i();
|
|
293
|
+
this._autoPlayConfirm({ onConfirm: c });
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
i();
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
meetingAudioStreamBecameInactive: (e) => {
|
|
300
|
+
}
|
|
284
301
|
};
|
|
285
302
|
});
|
|
286
303
|
/**
|
|
287
304
|
* 注册rtc事件
|
|
288
305
|
*/
|
|
289
306
|
o(this, "_registerRtcEvent", () => {
|
|
290
|
-
var
|
|
291
|
-
const e = ((
|
|
307
|
+
var i, n, c, u, d, g;
|
|
308
|
+
const e = ((c = (n = (i = this.meetingSession) == null ? void 0 : i.configuration) == null ? void 0 : n.credentials) == null ? void 0 : c.attendeeId) || "";
|
|
292
309
|
if (e) {
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
userId:
|
|
298
|
-
volume:
|
|
310
|
+
const v = /* @__PURE__ */ new Map(), E = () => {
|
|
311
|
+
const y = [];
|
|
312
|
+
return v.forEach((I, _) => {
|
|
313
|
+
y.push({
|
|
314
|
+
userId: I.userId,
|
|
315
|
+
volume: I.muted || I.signalStrength === 0 || !Boolean(I.volume) ? 0 : I.volume
|
|
299
316
|
});
|
|
300
|
-
}),
|
|
317
|
+
}), y;
|
|
301
318
|
};
|
|
302
319
|
(u = this.meetingSession) == null || u.audioVideo.realtimeSubscribeToAttendeeIdPresence(
|
|
303
|
-
(
|
|
304
|
-
var
|
|
305
|
-
if (!
|
|
306
|
-
|
|
320
|
+
(y, I, _) => {
|
|
321
|
+
var V;
|
|
322
|
+
if (!I) {
|
|
323
|
+
v.delete(y), this.emit("userVolumes", E());
|
|
307
324
|
return;
|
|
308
325
|
}
|
|
309
|
-
(
|
|
310
|
-
|
|
311
|
-
(
|
|
312
|
-
new
|
|
313
|
-
userId:
|
|
326
|
+
(V = this.meetingSession) == null || V.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
327
|
+
y,
|
|
328
|
+
(C, k, U, P) => {
|
|
329
|
+
new tt(C).base() === C && (v.set(C, {
|
|
330
|
+
userId: _ || C,
|
|
314
331
|
volume: k,
|
|
315
|
-
muted:
|
|
316
|
-
signalStrength:
|
|
317
|
-
}), this.emit("userVolumes",
|
|
332
|
+
muted: U,
|
|
333
|
+
signalStrength: P
|
|
334
|
+
}), this.emit("userVolumes", E()));
|
|
318
335
|
}
|
|
319
336
|
);
|
|
320
337
|
}
|
|
321
|
-
), (
|
|
338
|
+
), (d = this.meetingSession) == null || d.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
322
339
|
e,
|
|
323
|
-
(
|
|
324
|
-
new
|
|
340
|
+
(y, I, _, V) => {
|
|
341
|
+
new tt(y).base() === y && V !== null && V !== 1 && this.emit("weakNetwork");
|
|
325
342
|
}
|
|
326
|
-
), (
|
|
343
|
+
), (g = this.meetingSession) == null || g.audioVideo.realtimeSubscribeToFatalError((y) => this.emit("error", y));
|
|
327
344
|
}
|
|
328
345
|
});
|
|
329
|
-
this._getVoiceSign = e.getVoiceSign, this._initDom(), this.logger = new
|
|
346
|
+
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel || Ft.INFO), this.deviceController = new Bt(this.logger), this.initObservers();
|
|
330
347
|
}
|
|
331
348
|
/**
|
|
332
349
|
* 加入语音会议
|
|
@@ -334,99 +351,114 @@ class rt extends De {
|
|
|
334
351
|
* @returns
|
|
335
352
|
*/
|
|
336
353
|
async join(e) {
|
|
337
|
-
return new Promise(async (
|
|
338
|
-
var
|
|
354
|
+
return new Promise(async (i, n) => {
|
|
355
|
+
var c, u;
|
|
339
356
|
this.emit("joinWillStart");
|
|
340
357
|
try {
|
|
341
|
-
const { sdkAppId:
|
|
358
|
+
const { sdkAppId: d, userId: g, roomId: v, userSig: E } = await this._getVoiceSign({
|
|
342
359
|
...e,
|
|
343
360
|
roomId: e.roomId || 0
|
|
344
361
|
});
|
|
345
|
-
this.userId =
|
|
346
|
-
const { attendence:
|
|
347
|
-
decodeURIComponent(
|
|
348
|
-
),
|
|
362
|
+
this.userId = g;
|
|
363
|
+
const { attendence: y, vendor_wrapper: I } = JSON.parse(
|
|
364
|
+
decodeURIComponent(E)
|
|
365
|
+
), _ = new Wt(
|
|
349
366
|
{
|
|
350
|
-
Meeting:
|
|
367
|
+
Meeting: I
|
|
351
368
|
},
|
|
352
369
|
{
|
|
353
370
|
Attendee: {
|
|
354
|
-
ExternalUserId:
|
|
355
|
-
AttendeeId:
|
|
356
|
-
JoinToken:
|
|
371
|
+
ExternalUserId: y.external_user_id,
|
|
372
|
+
AttendeeId: y.attendee_id,
|
|
373
|
+
JoinToken: y.join_token
|
|
357
374
|
}
|
|
358
375
|
}
|
|
359
376
|
);
|
|
360
|
-
this.meetingSession = new
|
|
361
|
-
const
|
|
377
|
+
this.meetingSession = new Kt(_, this.logger, this.deviceController), this._registerRtcEvent(), this.meetingSession.audioVideo.addDeviceChangeObserver(this.deviceChangeObserver), this.meetingSession.audioVideo.addObserver(this.audioVideoObserver), this.meetingSession.audioVideo.bindAudioElement(this.$audio);
|
|
378
|
+
const V = {
|
|
362
379
|
audioVideoDidStart: () => {
|
|
363
|
-
var
|
|
364
|
-
(
|
|
380
|
+
var C;
|
|
381
|
+
(C = this.meetingSession) == null || C.audioVideo.realtimeMuteLocalAudio(), this.joined = !0, this.emit("joined"), i(!0);
|
|
365
382
|
},
|
|
366
383
|
audioVideoDidStop: () => {
|
|
367
|
-
this.joined = !1,
|
|
384
|
+
this.joined = !1, i(!1);
|
|
368
385
|
}
|
|
369
386
|
};
|
|
370
|
-
this.meetingSession.audioVideo.addObserver(
|
|
387
|
+
this.meetingSession.audioVideo.addObserver(V), this.audioMixObserver && this.meetingSession.audioVideo.addAudioMixObserver(this.audioMixObserver), this.meetingSession.audioVideo.setDeviceLabelTrigger(
|
|
371
388
|
async () => await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 })
|
|
372
389
|
);
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
390
|
+
try {
|
|
391
|
+
const C = await this.meetingSession.audioVideo.listAudioInputDevices();
|
|
392
|
+
O.info("audioInputDevices ===>", C);
|
|
393
|
+
const k = ((c = C[0]) == null ? void 0 : c.deviceId) || "default";
|
|
394
|
+
await this.meetingSession.audioVideo.startAudioInput(k);
|
|
395
|
+
} catch (C) {
|
|
396
|
+
O.error(`设置语音输入设备失败:${C.message}`);
|
|
397
|
+
}
|
|
398
|
+
try {
|
|
399
|
+
const C = await this.meetingSession.audioVideo.listAudioOutputDevices();
|
|
400
|
+
O.info("audioOutputDevices ===>", C);
|
|
401
|
+
const k = ((u = C[0]) == null ? void 0 : u.deviceId) || "default";
|
|
402
|
+
await this.meetingSession.audioVideo.chooseAudioOutput(k);
|
|
403
|
+
} catch (C) {
|
|
404
|
+
O.error(`设置语音输出设备失败:${C.message}`);
|
|
405
|
+
}
|
|
406
|
+
this.meetingSession.audioVideo.start();
|
|
407
|
+
} catch (d) {
|
|
408
|
+
this.emit("error", d), this.logger.error(d.message), i(!1);
|
|
377
409
|
}
|
|
378
410
|
});
|
|
379
411
|
}
|
|
380
412
|
quit() {
|
|
381
|
-
return this.joined ? new Promise((e,
|
|
382
|
-
var
|
|
413
|
+
return this.joined ? new Promise((e, i) => {
|
|
414
|
+
var c, u;
|
|
383
415
|
this.joined = !1;
|
|
384
|
-
const
|
|
385
|
-
audioVideoDidStop: async (
|
|
386
|
-
var
|
|
387
|
-
const
|
|
388
|
-
(
|
|
416
|
+
const n = {
|
|
417
|
+
audioVideoDidStop: async (d) => {
|
|
418
|
+
var v;
|
|
419
|
+
const g = d.statusCode();
|
|
420
|
+
(v = this.meetingSession) == null || v.deviceController.destroy(), g === qt.Left ? (this.logger.info("You left the session"), e(!0)) : (this.logger.info(`Stopped with a session status code: ${g}`), e(!0));
|
|
389
421
|
}
|
|
390
422
|
};
|
|
391
|
-
(
|
|
423
|
+
(c = this.meetingSession) == null || c.audioVideo.addObserver(n), (u = this.meetingSession) == null || u.audioVideo.stop();
|
|
392
424
|
}) : Promise.resolve(!0);
|
|
393
425
|
}
|
|
394
426
|
async detectMicro() {
|
|
395
427
|
return new Promise((e) => {
|
|
396
|
-
const
|
|
428
|
+
const i = { audio: !0, video: !1 };
|
|
397
429
|
try {
|
|
398
|
-
navigator.mediaDevices.getUserMedia(
|
|
399
|
-
} catch (
|
|
400
|
-
this.logger.error(
|
|
430
|
+
navigator.mediaDevices.getUserMedia(i).then(() => e(!0)).catch(() => e(!1));
|
|
431
|
+
} catch (n) {
|
|
432
|
+
this.logger.error(n.message), e(!1);
|
|
401
433
|
}
|
|
402
434
|
});
|
|
403
435
|
}
|
|
404
436
|
async toggleMicro(e) {
|
|
405
|
-
var
|
|
406
|
-
e ? (
|
|
407
|
-
const
|
|
408
|
-
return
|
|
437
|
+
var n, c, u;
|
|
438
|
+
e ? (n = this.meetingSession) == null || n.audioVideo.realtimeUnmuteLocalAudio() : (c = this.meetingSession) == null || c.audioVideo.realtimeMuteLocalAudio();
|
|
439
|
+
const i = (u = this.meetingSession) == null ? void 0 : u.audioVideo.realtimeIsLocalAudioMuted();
|
|
440
|
+
return i !== void 0 ? e !== i : !1;
|
|
409
441
|
}
|
|
410
442
|
shock() {
|
|
411
443
|
throw new Error("Method not implemented.");
|
|
412
444
|
}
|
|
413
445
|
}
|
|
414
|
-
var lt = /* @__PURE__ */ ((
|
|
415
|
-
class nt extends
|
|
416
|
-
constructor({ jsBridge: e, getVoiceSign:
|
|
446
|
+
var lt = /* @__PURE__ */ ((r) => (r[r.Success = 0] = "Success", r[r.Failure = 1] = "Failure", r[r.ReJoin = 2] = "ReJoin", r[r.NoMicroPermission = 3] = "NoMicroPermission", r))(lt || {});
|
|
447
|
+
class nt extends Me {
|
|
448
|
+
constructor({ jsBridge: e, getVoiceSign: i }) {
|
|
417
449
|
super();
|
|
418
450
|
o(this, "type", Q.RealseeVRWebViewRTC);
|
|
419
451
|
o(this, "joined", !1);
|
|
420
452
|
o(this, "micro", !1);
|
|
421
453
|
o(this, "voiceId", "");
|
|
422
454
|
o(this, "options");
|
|
423
|
-
this.options = { jsBridge: e, getVoiceSign:
|
|
455
|
+
this.options = { jsBridge: e, getVoiceSign: i }, this.jsBridge.webViewType !== "WxMiniProgramWebView" && this.jsBridge.callAndListen(
|
|
424
456
|
"live/userVolumes",
|
|
425
|
-
(
|
|
426
|
-
this.emit("userVolumes",
|
|
457
|
+
(n) => {
|
|
458
|
+
this.emit("userVolumes", n);
|
|
427
459
|
}
|
|
428
|
-
), this.jsBridge.callAndListen("live/weakNetwork", (
|
|
429
|
-
|
|
460
|
+
), this.jsBridge.callAndListen("live/weakNetwork", (n) => {
|
|
461
|
+
n && this.emit("weakNetwork");
|
|
430
462
|
});
|
|
431
463
|
}
|
|
432
464
|
get jsBridge() {
|
|
@@ -435,49 +467,49 @@ class nt extends De {
|
|
|
435
467
|
async join(e) {
|
|
436
468
|
try {
|
|
437
469
|
this.emit("joinWillStart");
|
|
438
|
-
const { sdkAppId:
|
|
470
|
+
const { sdkAppId: i, userId: n, userSig: c } = await this.options.getVoiceSign(
|
|
439
471
|
e
|
|
440
472
|
);
|
|
441
|
-
if (!(Boolean(
|
|
473
|
+
if (!(Boolean(i) && Boolean(n) && Boolean(c)))
|
|
442
474
|
return this.emit("error", new Error("加入房间失败:rtc 签名请求异常")), this.joined = !1, this.joined;
|
|
443
475
|
this.type = e.type;
|
|
444
|
-
const [u,
|
|
445
|
-
`live/join?sdkAppID=${
|
|
476
|
+
const [u, d] = await this.jsBridge.callAndBackfeed(
|
|
477
|
+
`live/join?sdkAppID=${i}&userID=${n}&roomID=${Number(
|
|
446
478
|
e.voiceId
|
|
447
|
-
)}&userSig=${
|
|
479
|
+
)}&userSig=${c}`
|
|
448
480
|
);
|
|
449
481
|
return u ? u.code === lt.Success ? (this.emit("joined"), this.joined = !0) : (this.emit("error", u), this.joined = !1) : (this.emit(
|
|
450
482
|
"error",
|
|
451
|
-
|
|
483
|
+
d || new Error("加入房间失败:未知异常。")
|
|
452
484
|
), this.joined = !1), this.joined;
|
|
453
|
-
} catch (
|
|
454
|
-
return this.emit("error", new Error("加入房间失败:" +
|
|
485
|
+
} catch (i) {
|
|
486
|
+
return this.emit("error", new Error("加入房间失败:" + i.message)), this.joined = !1, this.joined;
|
|
455
487
|
}
|
|
456
488
|
}
|
|
457
489
|
async quit() {
|
|
458
|
-
const [e,
|
|
490
|
+
const [e, i] = await this.jsBridge.callAndBackfeed(
|
|
459
491
|
"live/quit"
|
|
460
492
|
);
|
|
461
|
-
return e === null && this.emit("error",
|
|
493
|
+
return e === null && this.emit("error", i || new Error("退出房间失败:未知异常。")), this.joined = !1, !!e;
|
|
462
494
|
}
|
|
463
495
|
async detectMicro() {
|
|
464
|
-
const [e,
|
|
465
|
-
return e === null ? (this.emit("error",
|
|
496
|
+
const [e, i] = await this.jsBridge.detectMicro();
|
|
497
|
+
return e === null ? (this.emit("error", i || new Error("麦克风监测异常!")), !1) : e;
|
|
466
498
|
}
|
|
467
499
|
async toggleMicro(e) {
|
|
468
|
-
const [
|
|
500
|
+
const [i, n] = await this.jsBridge.callAndBackfeed(
|
|
469
501
|
`live/toggleMicro?flag=${e ? 1 : 0}`
|
|
470
502
|
);
|
|
471
|
-
return
|
|
503
|
+
return i === null ? (this.emit("error", n || new Error("麦克风监测异常!")), !1) : (this.micro = i, i);
|
|
472
504
|
}
|
|
473
505
|
shock() {
|
|
474
506
|
this.jsBridge.shock(1);
|
|
475
507
|
}
|
|
476
508
|
}
|
|
477
|
-
var
|
|
478
|
-
function
|
|
509
|
+
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}), H = /* @__PURE__ */ ((r) => (r.UserMicroStatus = "change_micro_status", r.UserMicroStatusSync = "sync_micro_status", r.UserPermission = "change_permission", r.UserStatus = "change_status", r.UserInfo = "change_info", r.RoomClose = "close", r))(H || {}), Z = /* @__PURE__ */ ((r) => (r.OPEN = "OPEN", r.CLOSE = "CLOSE", r))(Z || {});
|
|
510
|
+
function Nr(r) {
|
|
479
511
|
try {
|
|
480
|
-
const s = JSON.parse(
|
|
512
|
+
const s = JSON.parse(r), e = {
|
|
481
513
|
code: s.code,
|
|
482
514
|
message: s.message,
|
|
483
515
|
command: s.command,
|
|
@@ -487,17 +519,17 @@ function Tr(t) {
|
|
|
487
519
|
frontRequestId: s.front_request_id,
|
|
488
520
|
triggerUserID: s.trigger_user_id,
|
|
489
521
|
data: s.data || {}
|
|
490
|
-
},
|
|
491
|
-
(
|
|
522
|
+
}, i = Object.keys(e).filter(
|
|
523
|
+
(n) => e[n] === void 0
|
|
492
524
|
);
|
|
493
|
-
return
|
|
525
|
+
return i.length > 0 && console.warn(`推送数据格式异常:${i.join(" ")} 值不存在!`), e;
|
|
494
526
|
} catch (s) {
|
|
495
527
|
return !1;
|
|
496
528
|
}
|
|
497
529
|
}
|
|
498
|
-
var x = /* @__PURE__ */ ((
|
|
499
|
-
function
|
|
500
|
-
switch (
|
|
530
|
+
var x = /* @__PURE__ */ ((r) => (r[r.NOTINITIALIZED = -1] = "NOTINITIALIZED", r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSED = 3] = "CLOSED", r))(x || {}), er = /* @__PURE__ */ ((r) => (r[r.Normal = 0] = "Normal", r[r.Removed = 1] = "Removed", r[r.Replaced = 2] = "Replaced", r))(er || {}), tr = /* @__PURE__ */ ((r) => (r.WAIT_ENTER = "WAIT_ENTER", r.ONLINE = "ONLINE", r.LEAVE = "LEAVE", r.KICK_OUT = "KICK_OUT", r.BE_REPLACE = "BE_REPLACE", r.EXCEPTION = "EXCEPTION", r))(tr || {}), Le = /* @__PURE__ */ ((r) => (r[r.NOTINITIALIZED = -1] = "NOTINITIALIZED", r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSING = 2] = "CLOSING", r[r.CLOSED = 3] = "CLOSED", r))(Le || {}), rr = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Close = "Close", r.MicroAuth = "MicroAuth", r.DuplicateConnect = "DuplicateConnect", r.IllegalURL = "IllegalURL", r.Unknown = "Unknown", r.IllegalArgs = "IllegalArgs", r))(rr || {}), ir = /* @__PURE__ */ ((r) => (r.Err_1000 = "CLOSE_NORMAL", r.Err_1001 = "CLOSE_GOING_AWAY", r.Err_1002 = "CLOSE_PROTOCOL_ERROR", r.Err_1003 = "CLOSE_UNSUPPORTED", r.Err_1006 = "CLOSE_ABNORMAL", r.Err_1007 = "Unsupported Data", r.Err_1008 = "Policy Violation", r.Err_1009 = "CLOSE_TOO_LARGE", r.Err_unknown = "unknown", r))(ir || {});
|
|
531
|
+
function nr(r) {
|
|
532
|
+
switch (r) {
|
|
501
533
|
case 1e3:
|
|
502
534
|
return "CLOSE_NORMAL";
|
|
503
535
|
case 1001:
|
|
@@ -517,80 +549,80 @@ function tr(t) {
|
|
|
517
549
|
}
|
|
518
550
|
return "unknown";
|
|
519
551
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
552
|
+
function sr(r) {
|
|
553
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
522
554
|
}
|
|
523
555
|
var ft = {};
|
|
524
|
-
(function(
|
|
525
|
-
Object.defineProperty(
|
|
556
|
+
(function(r) {
|
|
557
|
+
Object.defineProperty(r, "__esModule", { value: !0 }), r.LogLevel = void 0;
|
|
526
558
|
var s;
|
|
527
559
|
(function(e) {
|
|
528
560
|
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";
|
|
529
|
-
})(s =
|
|
561
|
+
})(s = r.LogLevel || (r.LogLevel = {})), r.default = s;
|
|
530
562
|
})(ft);
|
|
531
|
-
const
|
|
532
|
-
function
|
|
533
|
-
const e =
|
|
534
|
-
(
|
|
563
|
+
const st = /* @__PURE__ */ sr(ft);
|
|
564
|
+
function or(r, s = {}) {
|
|
565
|
+
const e = r.indexOf("?") !== -1, i = Object.keys(s).reduce(
|
|
566
|
+
(n, c, u) => `${n}${u === 0 && !e ? "?" : "&"}${c}=${s[c]}`,
|
|
535
567
|
""
|
|
536
568
|
);
|
|
537
|
-
return
|
|
569
|
+
return r + i;
|
|
538
570
|
}
|
|
539
|
-
const
|
|
540
|
-
function
|
|
541
|
-
return Object.prototype.toString.call(
|
|
571
|
+
const le = globalThis.navigator.userAgent, ar = /android/gi.test(le), cr = /iPhone|iPad\s+OS/gi.test(le), ur = /MicroMessenger/gi.test(le) && /miniProgram/gi.test(le), lr = /realsee/gi.test(le);
|
|
572
|
+
function ye(r) {
|
|
573
|
+
return Object.prototype.toString.call(r) === "[object Object]";
|
|
542
574
|
}
|
|
543
|
-
function
|
|
544
|
-
return
|
|
575
|
+
function Se(r, s) {
|
|
576
|
+
return r === s ? !0 : typeof r != typeof s ? !1 : !!(Number.isNaN(r) && Number.isNaN(s));
|
|
545
577
|
}
|
|
546
|
-
function
|
|
547
|
-
const e = Object.getOwnPropertyNames(
|
|
548
|
-
if (e.length !==
|
|
578
|
+
function fr(r, s) {
|
|
579
|
+
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(s);
|
|
580
|
+
if (e.length !== i.length)
|
|
549
581
|
return !1;
|
|
550
|
-
for (let
|
|
551
|
-
const u = e[
|
|
552
|
-
if (!
|
|
582
|
+
for (let n = 0, c = e.length; n < c; n++) {
|
|
583
|
+
const u = e[n];
|
|
584
|
+
if (!Se(r[u], s[u]))
|
|
553
585
|
return !1;
|
|
554
586
|
}
|
|
555
587
|
return !0;
|
|
556
588
|
}
|
|
557
|
-
function
|
|
558
|
-
if (
|
|
589
|
+
function dr(r, s) {
|
|
590
|
+
if (r.length !== s.length)
|
|
559
591
|
return !1;
|
|
560
|
-
for (let e = 0,
|
|
561
|
-
if (!
|
|
592
|
+
for (let e = 0, i = r.length; e < i; e++)
|
|
593
|
+
if (!Se(r[e], s[e]))
|
|
562
594
|
return !1;
|
|
563
595
|
return !0;
|
|
564
596
|
}
|
|
565
|
-
function
|
|
566
|
-
return
|
|
597
|
+
function hr(r, s) {
|
|
598
|
+
return Se(r, s) ? !0 : ye(r) && ye(s) ? fr(r, s) : Array.isArray(r) && Array.isArray(s) ? dr(r, s) : !1;
|
|
567
599
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
600
|
+
function De(r, s) {
|
|
601
|
+
return Se(r, s) ? !0 : ye(r) && ye(s) ? gr(r, s) : Array.isArray(r) && Array.isArray(s) ? _r(r, s) : !1;
|
|
570
602
|
}
|
|
571
|
-
function
|
|
572
|
-
if (
|
|
603
|
+
function _r(r, s) {
|
|
604
|
+
if (r.length !== s.length)
|
|
573
605
|
return !1;
|
|
574
|
-
for (let e = 0,
|
|
575
|
-
if (!
|
|
606
|
+
for (let e = 0, i = r.length; e < i; e++)
|
|
607
|
+
if (!De(r[e], s[e]))
|
|
576
608
|
return !1;
|
|
577
609
|
return !0;
|
|
578
610
|
}
|
|
579
|
-
function
|
|
580
|
-
const e = Object.getOwnPropertyNames(
|
|
581
|
-
if (e.length !==
|
|
611
|
+
function gr(r, s) {
|
|
612
|
+
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(s);
|
|
613
|
+
if (e.length !== i.length)
|
|
582
614
|
return !1;
|
|
583
|
-
for (let
|
|
584
|
-
const u = e[
|
|
585
|
-
if (!
|
|
615
|
+
for (let n = 0, c = e.length; n < c; n++) {
|
|
616
|
+
const u = e[n];
|
|
617
|
+
if (!De(r[u], s[u]))
|
|
586
618
|
return !1;
|
|
587
619
|
}
|
|
588
620
|
return !0;
|
|
589
621
|
}
|
|
590
|
-
function
|
|
591
|
-
return e.deep ?
|
|
622
|
+
function ot(r, s, e = { deep: !1 }) {
|
|
623
|
+
return e.deep ? De(r, s) : hr(r, s);
|
|
592
624
|
}
|
|
593
|
-
class
|
|
625
|
+
class mr extends ue {
|
|
594
626
|
constructor(e) {
|
|
595
627
|
super();
|
|
596
628
|
o(this, "_realWebSocket");
|
|
@@ -599,9 +631,9 @@ class hr extends ae {
|
|
|
599
631
|
o(this, "_readyState", Le.NOTINITIALIZED);
|
|
600
632
|
o(this, "_options", {
|
|
601
633
|
timeout: 1e4,
|
|
602
|
-
shouldReconnect: (e,
|
|
634
|
+
shouldReconnect: (e, i) => {
|
|
603
635
|
if (!(e.code === 1008 || e.code === 1011))
|
|
604
|
-
return [0, 3e3, 1e4][
|
|
636
|
+
return [0, 3e3, 1e4][i.attempts % 3];
|
|
605
637
|
},
|
|
606
638
|
should1000Reconnect: !1,
|
|
607
639
|
ignoreConnectivityEvents: !1,
|
|
@@ -677,8 +709,8 @@ class hr extends ae {
|
|
|
677
709
|
* @returns
|
|
678
710
|
*/
|
|
679
711
|
o(this, "send", (e) => {
|
|
680
|
-
var
|
|
681
|
-
((
|
|
712
|
+
var i, n, c;
|
|
713
|
+
((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((c = this._realWebSocket) == null || c.send(e));
|
|
682
714
|
});
|
|
683
715
|
/**
|
|
684
716
|
* 关闭连接
|
|
@@ -686,23 +718,23 @@ class hr extends ae {
|
|
|
686
718
|
* @param reason 原因
|
|
687
719
|
* @returns
|
|
688
720
|
*/
|
|
689
|
-
o(this, "close", (e,
|
|
690
|
-
var
|
|
691
|
-
return typeof e != "number" && (
|
|
721
|
+
o(this, "close", (e, i) => {
|
|
722
|
+
var n;
|
|
723
|
+
return typeof e != "number" && (i = e, e = 1e3), this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !0, this._detachConnectivityEvents(), (n = this._realWebSocket) == null ? void 0 : n.close(e, i);
|
|
692
724
|
});
|
|
693
725
|
/**
|
|
694
726
|
* 进行ws连接
|
|
695
727
|
*/
|
|
696
728
|
o(this, "open", (e) => {
|
|
697
|
-
var
|
|
698
|
-
e && (this._url = e), ((
|
|
729
|
+
var i, n;
|
|
730
|
+
e && (this._url = e), ((i = this._realWebSocket) == null ? void 0 : i.readyState) !== WebSocket.OPEN && ((n = this._realWebSocket) == null ? void 0 : n.readyState) !== WebSocket.CONNECTING && (this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !1, this._createWebSocket());
|
|
699
731
|
});
|
|
700
732
|
/**
|
|
701
733
|
* 创建ws连接
|
|
702
734
|
*/
|
|
703
735
|
o(this, "_createWebSocket", () => {
|
|
704
|
-
var
|
|
705
|
-
const e = typeof this._url == "string" ? this._url : (
|
|
736
|
+
var n, c, u;
|
|
737
|
+
const e = typeof this._url == "string" ? this._url : (n = this._url) == null ? void 0 : n.call(this, this);
|
|
706
738
|
if (!e)
|
|
707
739
|
return;
|
|
708
740
|
this._pendingReconnect = void 0, this._removeWebSocketEvent(), this._realWebSocket = new WebSocket(e, this._protocols || void 0), this._attempts = this._attempts + 1, this.emit(
|
|
@@ -711,7 +743,7 @@ class hr extends ae {
|
|
|
711
743
|
detail: { attempts: this._attempts, reconnects: this._reconnects }
|
|
712
744
|
})
|
|
713
745
|
);
|
|
714
|
-
const
|
|
746
|
+
const i = () => {
|
|
715
747
|
this._connectTimeout = void 0, this._detachConnectivityEvents(), this.emit(
|
|
716
748
|
"timeout",
|
|
717
749
|
new CustomEvent("connecting", {
|
|
@@ -722,36 +754,21 @@ class hr extends ae {
|
|
|
722
754
|
})
|
|
723
755
|
);
|
|
724
756
|
};
|
|
725
|
-
this._connectTimeout = setTimeout(
|
|
757
|
+
this._connectTimeout = setTimeout(i, (c = this._options) == null ? void 0 : c.timeout), this._dispatchWebSocketEvent(), (u = this._options) != null && u.ignoreConnectivityEvents || this._attachConnectivityEvents();
|
|
726
758
|
});
|
|
727
759
|
/**
|
|
728
760
|
* 断开ws事件
|
|
729
761
|
*/
|
|
730
762
|
o(this, "_removeWebSocketEvent", () => {
|
|
731
|
-
var e,
|
|
732
|
-
(e = this._realWebSocket) == null || e.removeEventListener(
|
|
733
|
-
"open",
|
|
734
|
-
this._webSocketOpenHandler
|
|
735
|
-
), (n = this._realWebSocket) == null || n.removeEventListener(
|
|
736
|
-
"close",
|
|
737
|
-
this._webSocketCloseHandler
|
|
738
|
-
), (i = this._realWebSocket) == null || i.removeEventListener(
|
|
739
|
-
"error",
|
|
740
|
-
this._webSocketErrorHandler
|
|
741
|
-
), (a = this._realWebSocket) == null || a.removeEventListener(
|
|
742
|
-
"message",
|
|
743
|
-
this._webSocketMessageHandler
|
|
744
|
-
);
|
|
763
|
+
var e, i, n, c;
|
|
764
|
+
(e = this._realWebSocket) == null || e.removeEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.removeEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.removeEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.removeEventListener("message", this._webSocketMessageHandler);
|
|
745
765
|
});
|
|
746
766
|
/**
|
|
747
767
|
* 分发ws事件
|
|
748
768
|
*/
|
|
749
769
|
o(this, "_dispatchWebSocketEvent", () => {
|
|
750
|
-
var e,
|
|
751
|
-
(e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (
|
|
752
|
-
"message",
|
|
753
|
-
this._webSocketMessageHandler
|
|
754
|
-
);
|
|
770
|
+
var e, i, n, c;
|
|
771
|
+
(e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.addEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.addEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.addEventListener("message", this._webSocketMessageHandler);
|
|
755
772
|
});
|
|
756
773
|
/**
|
|
757
774
|
* ws连接事件
|
|
@@ -759,11 +776,8 @@ class hr extends ae {
|
|
|
759
776
|
*/
|
|
760
777
|
o(this, "_webSocketOpenHandler", (e) => {
|
|
761
778
|
this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
762
|
-
const
|
|
763
|
-
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit(
|
|
764
|
-
"open",
|
|
765
|
-
Object.assign(e, { detail: { reconnects: n, attempts: i } })
|
|
766
|
-
);
|
|
779
|
+
const i = ++this._reconnects, n = this._attempts;
|
|
780
|
+
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit("open", Object.assign(e, { detail: { reconnects: i, attempts: n } }));
|
|
767
781
|
});
|
|
768
782
|
/**
|
|
769
783
|
* ws 关闭事件
|
|
@@ -776,10 +790,7 @@ class hr extends ae {
|
|
|
776
790
|
* @param event
|
|
777
791
|
* @returns
|
|
778
792
|
*/
|
|
779
|
-
o(this, "_webSocketErrorHandler", (e) => this.emit(
|
|
780
|
-
"error",
|
|
781
|
-
new CustomEvent("error", { detail: { error: e } })
|
|
782
|
-
));
|
|
793
|
+
o(this, "_webSocketErrorHandler", (e) => this.emit("error", new CustomEvent("error", { detail: { error: e } })));
|
|
783
794
|
/**
|
|
784
795
|
* ws消息
|
|
785
796
|
* @param event
|
|
@@ -795,16 +806,14 @@ class hr extends ae {
|
|
|
795
806
|
if (!e)
|
|
796
807
|
return;
|
|
797
808
|
this._url = e.url, this._protocols = e.protocols;
|
|
798
|
-
const
|
|
799
|
-
if (typeof (
|
|
800
|
-
throw new Error(
|
|
801
|
-
|
|
802
|
-
);
|
|
803
|
-
if (typeof (n == null ? void 0 : n.shouldReconnect) != "function")
|
|
809
|
+
const i = Object.assign(this._options, e.robustOptions || {});
|
|
810
|
+
if (typeof (i == null ? void 0 : i.timeout) != "number")
|
|
811
|
+
throw new Error("timeout must be the number of milliseconds to timeout a connection attempt");
|
|
812
|
+
if (typeof (i == null ? void 0 : i.shouldReconnect) != "function")
|
|
804
813
|
throw new Error(
|
|
805
814
|
"shouldReconnect must be a function that returns the number of milliseconds to wait for a reconnect attempt, or null or undefined to not reconnect."
|
|
806
815
|
);
|
|
807
|
-
this._options =
|
|
816
|
+
this._options = i, this._options.automaticOpen && this._createWebSocket();
|
|
808
817
|
}
|
|
809
818
|
/**
|
|
810
819
|
* 进行重连
|
|
@@ -812,26 +821,26 @@ class hr extends ae {
|
|
|
812
821
|
* @returns
|
|
813
822
|
*/
|
|
814
823
|
_reconnect(e) {
|
|
815
|
-
var
|
|
816
|
-
if (!((
|
|
824
|
+
var n, c, u, d;
|
|
825
|
+
if (!((n = this._options) != null && n.should1000Reconnect) && e.code === 1e3 || this._explicitlyClosed) {
|
|
817
826
|
this._attempts = 0;
|
|
818
827
|
return;
|
|
819
828
|
}
|
|
820
|
-
if (((
|
|
829
|
+
if (((c = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : c.onLine) === !1) {
|
|
821
830
|
this._reconnectWhenOnlineAgain = !0;
|
|
822
831
|
return;
|
|
823
832
|
}
|
|
824
|
-
const
|
|
825
|
-
typeof
|
|
833
|
+
const i = (d = (u = this._options) == null ? void 0 : u.shouldReconnect) == null ? void 0 : d.call(u, e, this);
|
|
834
|
+
typeof i == "number" && (this._pendingReconnect = setTimeout(this._createWebSocket, i));
|
|
826
835
|
}
|
|
827
836
|
}
|
|
828
|
-
class
|
|
837
|
+
class vr extends ue {
|
|
829
838
|
constructor() {
|
|
830
839
|
super();
|
|
831
840
|
/**
|
|
832
841
|
* ws代理器
|
|
833
842
|
*/
|
|
834
|
-
o(this, "_ws", new
|
|
843
|
+
o(this, "_ws", new mr({
|
|
835
844
|
url: "",
|
|
836
845
|
robustOptions: { timeout: 18e4 }
|
|
837
846
|
}));
|
|
@@ -856,8 +865,8 @@ class _r extends ae {
|
|
|
856
865
|
* @param event
|
|
857
866
|
*/
|
|
858
867
|
o(this, "_handleCloseEvent", (e) => {
|
|
859
|
-
|
|
860
|
-
`live room closed bacause of ${e.code}-${e.reason ||
|
|
868
|
+
O.info(
|
|
869
|
+
`live room closed bacause of ${e.code}-${e.reason || nr(e.code)}`
|
|
861
870
|
), this.state = x.CLOSED;
|
|
862
871
|
});
|
|
863
872
|
/**
|
|
@@ -865,49 +874,49 @@ class _r extends ae {
|
|
|
865
874
|
*/
|
|
866
875
|
o(this, "_handleClosingEvent", () => {
|
|
867
876
|
var e;
|
|
868
|
-
|
|
877
|
+
O.info("live room is closing, onLine:", (e = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : e.onLine), this.state = x.CLOSED;
|
|
869
878
|
});
|
|
870
879
|
/**
|
|
871
880
|
* 连接中
|
|
872
881
|
* @param event
|
|
873
882
|
*/
|
|
874
883
|
o(this, "_handleConnectingEvent", () => {
|
|
875
|
-
|
|
884
|
+
O.info("live room is connecting"), this.state = x.CONNECTING;
|
|
876
885
|
});
|
|
877
886
|
/**
|
|
878
887
|
* 连接发送异常
|
|
879
888
|
* @param event
|
|
880
889
|
*/
|
|
881
890
|
o(this, "_handleErrorEvent", (e) => {
|
|
882
|
-
|
|
891
|
+
O.error("live room error", e), this.state = x.CLOSED;
|
|
883
892
|
});
|
|
884
893
|
/**
|
|
885
894
|
* 接收到消息
|
|
886
895
|
* @param event
|
|
887
896
|
*/
|
|
888
897
|
o(this, "_handleMessageEvent", (e) => {
|
|
889
|
-
let
|
|
898
|
+
let i = (() => {
|
|
890
899
|
try {
|
|
891
900
|
return JSON.parse(e.data);
|
|
892
|
-
} catch (
|
|
901
|
+
} catch (n) {
|
|
893
902
|
return e.data;
|
|
894
903
|
}
|
|
895
904
|
})();
|
|
896
|
-
this.emit("message",
|
|
905
|
+
this.emit("message", i);
|
|
897
906
|
});
|
|
898
907
|
/**
|
|
899
908
|
* 连接建立成功
|
|
900
909
|
* @param event
|
|
901
910
|
*/
|
|
902
911
|
o(this, "_handleOpenEvent", (e) => {
|
|
903
|
-
|
|
912
|
+
O.info("live room open", e.detail), this.state = x.OPEN, e.detail.reconnects > 0 && this.emit("reconnected", e.detail);
|
|
904
913
|
});
|
|
905
914
|
/**
|
|
906
915
|
* 处理超时
|
|
907
916
|
* @param event
|
|
908
917
|
*/
|
|
909
918
|
o(this, "_handleTimeoutEvent", (e) => {
|
|
910
|
-
|
|
919
|
+
O.error("live room connect timeout!", e.detail), this.state = x.CLOSED;
|
|
911
920
|
});
|
|
912
921
|
/**
|
|
913
922
|
* 释放资源,释放之后需要重新实例化
|
|
@@ -925,14 +934,14 @@ class _r extends ae {
|
|
|
925
934
|
* @param code
|
|
926
935
|
* @param reason
|
|
927
936
|
*/
|
|
928
|
-
o(this, "close", (e,
|
|
929
|
-
this._ws.once("close", () =>
|
|
937
|
+
o(this, "close", (e, i) => new Promise((n) => {
|
|
938
|
+
this._ws.once("close", () => n(!0)), this._ws.close(e, i);
|
|
930
939
|
}));
|
|
931
940
|
this._addWebSocketEventListeners();
|
|
932
941
|
}
|
|
933
942
|
set state(e) {
|
|
934
|
-
const
|
|
935
|
-
this._state = e, this.emit("stateChange", this.state,
|
|
943
|
+
const i = JSON.parse(JSON.stringify(this._state));
|
|
944
|
+
this._state = e, this.emit("stateChange", this.state, i);
|
|
936
945
|
}
|
|
937
946
|
get state() {
|
|
938
947
|
return this._state;
|
|
@@ -949,20 +958,20 @@ class _r extends ae {
|
|
|
949
958
|
throw new Error("live has not yet been initialized!");
|
|
950
959
|
}
|
|
951
960
|
}
|
|
952
|
-
const
|
|
953
|
-
command:
|
|
954
|
-
front_request_id:
|
|
961
|
+
const pr = (r) => Promise.reject("unimplemented method GetVoiceSign"), je = (r, s = {}, e = []) => ({
|
|
962
|
+
command: r,
|
|
963
|
+
front_request_id: Ee(),
|
|
955
964
|
data: {
|
|
956
965
|
...s,
|
|
957
966
|
to_user_ids: Array.isArray(e) ? e : [e]
|
|
958
967
|
}
|
|
959
|
-
}),
|
|
960
|
-
var
|
|
961
|
-
window != null && window.__Realsee_Live__ && ((s = (
|
|
968
|
+
}), Er = () => {
|
|
969
|
+
var r, s;
|
|
970
|
+
window != null && window.__Realsee_Live__ && ((s = (r = window == null ? void 0 : window.__Realsee_Live__) == null ? void 0 : r.dispose) == null || s.call(r), window.__Realsee_Live__ = null);
|
|
962
971
|
};
|
|
963
|
-
class
|
|
972
|
+
class yr extends ue {
|
|
964
973
|
constructor(e) {
|
|
965
|
-
var
|
|
974
|
+
var i;
|
|
966
975
|
super();
|
|
967
976
|
/**
|
|
968
977
|
* 带看的配置
|
|
@@ -971,7 +980,7 @@ class vr extends ae {
|
|
|
971
980
|
/**
|
|
972
981
|
* 帧数据监听
|
|
973
982
|
*/
|
|
974
|
-
o(this, "keyframes", new
|
|
983
|
+
o(this, "keyframes", new ue());
|
|
975
984
|
/**
|
|
976
985
|
* 内置的一些数据
|
|
977
986
|
*/
|
|
@@ -990,24 +999,24 @@ class vr extends ae {
|
|
|
990
999
|
* @param frame 帧数据本体
|
|
991
1000
|
* @returns
|
|
992
1001
|
*/
|
|
993
|
-
o(this, "sendKeyframe", (e,
|
|
1002
|
+
o(this, "sendKeyframe", (e, i) => {
|
|
994
1003
|
if (this.state !== x.OPEN)
|
|
995
1004
|
return !1;
|
|
996
1005
|
this._buildInData.keyframes = {
|
|
997
1006
|
...this._buildInData.keyframes,
|
|
998
|
-
[e]:
|
|
1007
|
+
[e]: i
|
|
999
1008
|
};
|
|
1000
|
-
const
|
|
1009
|
+
const n = je(K.KeyframeSync, this.snapshot);
|
|
1001
1010
|
try {
|
|
1002
|
-
return this._controller.sendMessage(
|
|
1003
|
-
} catch (
|
|
1004
|
-
return
|
|
1011
|
+
return this._controller.sendMessage(n), !0;
|
|
1012
|
+
} catch (c) {
|
|
1013
|
+
return O.error(c), !1;
|
|
1005
1014
|
}
|
|
1006
1015
|
});
|
|
1007
1016
|
/**
|
|
1008
1017
|
* 带看控制器
|
|
1009
1018
|
*/
|
|
1010
|
-
o(this, "_controller", new
|
|
1019
|
+
o(this, "_controller", new vr());
|
|
1011
1020
|
/**
|
|
1012
1021
|
* 添加带看控制的事件监听
|
|
1013
1022
|
*/
|
|
@@ -1025,101 +1034,101 @@ class vr extends ae {
|
|
|
1025
1034
|
* @param state
|
|
1026
1035
|
* @returns
|
|
1027
1036
|
*/
|
|
1028
|
-
o(this, "_handleStateChange", (e,
|
|
1037
|
+
o(this, "_handleStateChange", (e, i) => this.emit("stateChange", e, i));
|
|
1029
1038
|
/**
|
|
1030
1039
|
* 消息接收
|
|
1031
1040
|
* @param liveMsg
|
|
1032
1041
|
*/
|
|
1033
1042
|
o(this, "_handleMessage", async (e) => {
|
|
1034
|
-
var
|
|
1043
|
+
var i, n, c, u, d;
|
|
1035
1044
|
if (typeof e == "object") {
|
|
1036
|
-
const { command:
|
|
1037
|
-
if (
|
|
1038
|
-
switch (
|
|
1039
|
-
case
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1045
|
+
const { command: g, data: v = {}, frontRequestId: E, code: y, message: I } = e;
|
|
1046
|
+
if (y === "SUCCESS")
|
|
1047
|
+
switch (g) {
|
|
1048
|
+
case K.SelfUserInfo: {
|
|
1049
|
+
const _ = v;
|
|
1050
|
+
ot(this.selfInfo, _, { deep: !0 }) || (this._buildInData.selfInfo = _, this.emit(
|
|
1042
1051
|
"selfInfoUpdate",
|
|
1043
1052
|
this._buildInData.selfInfo,
|
|
1044
|
-
|
|
1053
|
+
E
|
|
1045
1054
|
));
|
|
1046
1055
|
break;
|
|
1047
1056
|
}
|
|
1048
|
-
case
|
|
1049
|
-
const
|
|
1050
|
-
this._buildInData.roomInfo = Object.assign({},
|
|
1057
|
+
case K.RoomInfo: {
|
|
1058
|
+
const _ = v;
|
|
1059
|
+
this._buildInData.roomInfo = Object.assign({}, _), this.emit(
|
|
1051
1060
|
"readyKeyframeSync",
|
|
1052
|
-
|
|
1061
|
+
_.last_frame || {}
|
|
1053
1062
|
);
|
|
1054
1063
|
break;
|
|
1055
1064
|
}
|
|
1056
|
-
case
|
|
1057
|
-
const { voice_id:
|
|
1058
|
-
if (this._buildInData.rtcInfo = { voiceId:
|
|
1059
|
-
|
|
1065
|
+
case K.RTCInfo: {
|
|
1066
|
+
const { voice_id: _, type: V } = v;
|
|
1067
|
+
if (this._buildInData.rtcInfo = { voiceId: _, type: V }, (i = this.$RTC) != null && i.joined)
|
|
1068
|
+
O.warn("已加入语音房间,无需重复加入!");
|
|
1060
1069
|
else if (await ((u = this.$RTC) == null ? void 0 : u.join({
|
|
1061
|
-
voiceId:
|
|
1062
|
-
userId: ((
|
|
1063
|
-
roomId: (
|
|
1064
|
-
type:
|
|
1070
|
+
voiceId: _,
|
|
1071
|
+
userId: ((n = this.selfInfo) == null ? void 0 : n.id) || "",
|
|
1072
|
+
roomId: (c = this.roomInfo) == null ? void 0 : c.info.room_code,
|
|
1073
|
+
type: V
|
|
1065
1074
|
}))) {
|
|
1066
|
-
const k = (
|
|
1075
|
+
const k = (d = this._options.initialMicroStatus) != null ? d : Z.OPEN;
|
|
1067
1076
|
await this.toggleMicro(k === Z.OPEN);
|
|
1068
1077
|
} else
|
|
1069
|
-
|
|
1078
|
+
O.error("加入语音房间失败");
|
|
1070
1079
|
break;
|
|
1071
1080
|
}
|
|
1072
|
-
case
|
|
1073
|
-
const
|
|
1074
|
-
this._buildInData.userList =
|
|
1081
|
+
case K.UserList: {
|
|
1082
|
+
const _ = v;
|
|
1083
|
+
this._buildInData.userList = _, this.emit("userListUpdate", this.userList, E);
|
|
1075
1084
|
break;
|
|
1076
1085
|
}
|
|
1077
|
-
case
|
|
1078
|
-
const
|
|
1079
|
-
this.emit("broadcast",
|
|
1086
|
+
case K.CustomEvent: {
|
|
1087
|
+
const _ = v;
|
|
1088
|
+
this.emit("broadcast", _, E);
|
|
1080
1089
|
break;
|
|
1081
1090
|
}
|
|
1082
|
-
case
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1091
|
+
case K.KeyframeSync: {
|
|
1092
|
+
const _ = v, V = Object.keys(
|
|
1093
|
+
_
|
|
1085
1094
|
).reduce(
|
|
1086
|
-
(
|
|
1087
|
-
if (
|
|
1088
|
-
|
|
1095
|
+
(C, k) => {
|
|
1096
|
+
if (ot(
|
|
1097
|
+
_[k],
|
|
1089
1098
|
this._buildInData.keyframes[k],
|
|
1090
1099
|
{
|
|
1091
1100
|
deep: !0
|
|
1092
1101
|
}
|
|
1093
1102
|
))
|
|
1094
|
-
return
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1103
|
+
return C;
|
|
1104
|
+
const U = [
|
|
1105
|
+
_[k],
|
|
1097
1106
|
this._buildInData.keyframes[k],
|
|
1098
|
-
|
|
1099
|
-
],
|
|
1107
|
+
E
|
|
1108
|
+
], P = k;
|
|
1100
1109
|
return this.keyframes.emit(
|
|
1101
|
-
|
|
1102
|
-
...
|
|
1103
|
-
), this._buildInData.keyframes[k] =
|
|
1110
|
+
P,
|
|
1111
|
+
...U
|
|
1112
|
+
), this._buildInData.keyframes[k] = _[k], C[k] = _[k], C;
|
|
1104
1113
|
},
|
|
1105
1114
|
{}
|
|
1106
1115
|
);
|
|
1107
|
-
this.emit("keyframes",
|
|
1116
|
+
this.emit("keyframes", V, E);
|
|
1108
1117
|
break;
|
|
1109
1118
|
}
|
|
1110
|
-
case
|
|
1111
|
-
const
|
|
1112
|
-
this.emit("builtinEvent",
|
|
1113
|
-
|
|
1114
|
-
),
|
|
1119
|
+
case K.BuiltinMsg: {
|
|
1120
|
+
const _ = v;
|
|
1121
|
+
this.emit("builtinEvent", _), _.event_type === q.UserChange && this.emit("userChange", _), _.event_type === q.RoomChange && this.emit("roomChange", _), _.event_type === q.UserChange && _.action === H.UserMicroStatus && await this.toggleMicro(
|
|
1122
|
+
_.data.status === Z.OPEN
|
|
1123
|
+
), _.event_type === q.RoomChange && _.action === H.RoomClose && await this.exit();
|
|
1115
1124
|
break;
|
|
1116
1125
|
}
|
|
1117
|
-
case
|
|
1126
|
+
case K.UserKickOut: {
|
|
1118
1127
|
this.emit("kickOut");
|
|
1119
1128
|
break;
|
|
1120
1129
|
}
|
|
1121
1130
|
default:
|
|
1122
|
-
console.warn("unknown command: ",
|
|
1131
|
+
console.warn("unknown command: ", g);
|
|
1123
1132
|
}
|
|
1124
1133
|
else
|
|
1125
1134
|
this.emit("error", e);
|
|
@@ -1137,28 +1146,28 @@ class vr extends ae {
|
|
|
1137
1146
|
* @returns
|
|
1138
1147
|
*/
|
|
1139
1148
|
o(this, "connect", async (e = {}) => {
|
|
1140
|
-
var u,
|
|
1141
|
-
if (this._options.url = (
|
|
1149
|
+
var u, d, g, v;
|
|
1150
|
+
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (g = e.getTicket) != null ? g : this._options.getTicket, this._options.initialMicroStatus = (v = e.rtcMicStatus) != null ? v : this._options.initialMicroStatus, !/^ws(s):\/\//.test(this._options.url) || typeof this._options.getTicket != "function")
|
|
1142
1151
|
return /^ws(s):\/\//.test(this._options.url) ? typeof this._options.getTicket != "function" ? new Error("getTicket muse be function") : !1 : new Error("Illegal realsee live room link");
|
|
1143
|
-
const { force:
|
|
1152
|
+
const { force: i = !1 } = e;
|
|
1144
1153
|
if (this._options.rtc && !await this._options.rtc.detectMicro())
|
|
1145
1154
|
return new Error("Failed to obtain microphone authorization");
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
if (
|
|
1155
|
+
const n = this.state;
|
|
1156
|
+
if (n === x.CONNECTING || n === x.OPEN)
|
|
1157
|
+
if (i)
|
|
1149
1158
|
try {
|
|
1150
1159
|
await this._controller.close("force close by connect");
|
|
1151
|
-
} catch (
|
|
1152
|
-
console.warn(
|
|
1160
|
+
} catch (E) {
|
|
1161
|
+
console.warn(E);
|
|
1153
1162
|
}
|
|
1154
1163
|
else
|
|
1155
1164
|
return new Error("已有Live实例正在连接中,请勿重复连接!");
|
|
1156
1165
|
this._clearLiveData();
|
|
1157
|
-
const
|
|
1166
|
+
const c = or(this._options.url, {
|
|
1158
1167
|
ticket: await this._options.getTicket(),
|
|
1159
|
-
force: Number(!!
|
|
1168
|
+
force: Number(!!i)
|
|
1160
1169
|
});
|
|
1161
|
-
return this._controller.open(
|
|
1170
|
+
return this._controller.open(c), !0;
|
|
1162
1171
|
});
|
|
1163
1172
|
/**
|
|
1164
1173
|
* 退出带看
|
|
@@ -1170,8 +1179,8 @@ class vr extends ae {
|
|
|
1170
1179
|
return !0;
|
|
1171
1180
|
try {
|
|
1172
1181
|
await ((e = this.$RTC) == null ? void 0 : e.quit());
|
|
1173
|
-
} catch (
|
|
1174
|
-
|
|
1182
|
+
} catch (i) {
|
|
1183
|
+
O.warn(i);
|
|
1175
1184
|
}
|
|
1176
1185
|
return await this._controller.close();
|
|
1177
1186
|
});
|
|
@@ -1182,11 +1191,11 @@ class vr extends ae {
|
|
|
1182
1191
|
* @returns
|
|
1183
1192
|
*/
|
|
1184
1193
|
o(this, "close", async () => {
|
|
1185
|
-
var e,
|
|
1186
|
-
if ((
|
|
1194
|
+
var e, i;
|
|
1195
|
+
if ((i = (e = this.selfInfo) == null ? void 0 : e.permission) != null && i.close_live_room)
|
|
1187
1196
|
return await this.updateStatus(
|
|
1188
1197
|
q.RoomChange,
|
|
1189
|
-
|
|
1198
|
+
H.RoomClose,
|
|
1190
1199
|
{}
|
|
1191
1200
|
);
|
|
1192
1201
|
});
|
|
@@ -1202,23 +1211,23 @@ class vr extends ae {
|
|
|
1202
1211
|
*/
|
|
1203
1212
|
o(this, "setSelfInfo", async (e) => await this.updateStatus(
|
|
1204
1213
|
q.UserChange,
|
|
1205
|
-
|
|
1214
|
+
H.UserInfo,
|
|
1206
1215
|
e
|
|
1207
1216
|
));
|
|
1208
1217
|
// 仅用于用户自己的麦克风控制
|
|
1209
1218
|
o(this, "toggleMicro", async (e) => {
|
|
1210
|
-
var
|
|
1211
|
-
if (!((
|
|
1219
|
+
var n, c, u;
|
|
1220
|
+
if (!((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_own_micro))
|
|
1212
1221
|
return !1;
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1222
|
+
const i = await ((u = this.$RTC) == null ? void 0 : u.toggleMicro(e));
|
|
1223
|
+
return i && await this.updateStatus(
|
|
1215
1224
|
q.UserChange,
|
|
1216
|
-
|
|
1225
|
+
H.UserMicroStatus,
|
|
1217
1226
|
{
|
|
1218
1227
|
status: e ? Z.OPEN : Z.CLOSE
|
|
1219
1228
|
},
|
|
1220
1229
|
[]
|
|
1221
|
-
),
|
|
1230
|
+
), i;
|
|
1222
1231
|
});
|
|
1223
1232
|
/**
|
|
1224
1233
|
* 控制别人的麦
|
|
@@ -1226,15 +1235,15 @@ class vr extends ae {
|
|
|
1226
1235
|
* @param toUserIds
|
|
1227
1236
|
* @returns
|
|
1228
1237
|
*/
|
|
1229
|
-
o(this, "forbidMicro", async (e,
|
|
1230
|
-
var
|
|
1231
|
-
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(
|
|
1238
|
+
o(this, "forbidMicro", async (e, i) => {
|
|
1239
|
+
var n, c;
|
|
1240
|
+
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(i) || !((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_other_micro) ? !1 : await this.updateStatus(
|
|
1232
1241
|
q.UserChange,
|
|
1233
|
-
|
|
1242
|
+
H.UserMicroStatus,
|
|
1234
1243
|
{
|
|
1235
1244
|
status: e
|
|
1236
1245
|
},
|
|
1237
|
-
|
|
1246
|
+
i
|
|
1238
1247
|
);
|
|
1239
1248
|
});
|
|
1240
1249
|
/**
|
|
@@ -1243,13 +1252,13 @@ class vr extends ae {
|
|
|
1243
1252
|
* @param toUserIds
|
|
1244
1253
|
* @returns
|
|
1245
1254
|
*/
|
|
1246
|
-
o(this, "forbidSync", async (e,
|
|
1247
|
-
var
|
|
1248
|
-
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(
|
|
1255
|
+
o(this, "forbidSync", async (e, i) => {
|
|
1256
|
+
var n, c;
|
|
1257
|
+
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(i) || !((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_other_sync) ? !1 : await this.updateStatus(
|
|
1249
1258
|
q.UserChange,
|
|
1250
|
-
|
|
1259
|
+
H.UserPermission,
|
|
1251
1260
|
{ sync_frame: e },
|
|
1252
|
-
|
|
1261
|
+
i
|
|
1253
1262
|
);
|
|
1254
1263
|
});
|
|
1255
1264
|
/**
|
|
@@ -1258,10 +1267,10 @@ class vr extends ae {
|
|
|
1258
1267
|
* @returns
|
|
1259
1268
|
*/
|
|
1260
1269
|
o(this, "kick", async (e) => {
|
|
1261
|
-
var
|
|
1262
|
-
return typeof this._options.canForbidUserKick == "function" && !this._options.canForbidUserKick(e) || !((
|
|
1270
|
+
var i, n;
|
|
1271
|
+
return typeof this._options.canForbidUserKick == "function" && !this._options.canForbidUserKick(e) || !((n = (i = this.selfInfo) == null ? void 0 : i.permission) != null && n.change_other_status) ? !1 : await this.updateStatus(
|
|
1263
1272
|
q.UserChange,
|
|
1264
|
-
|
|
1273
|
+
H.UserStatus,
|
|
1265
1274
|
{
|
|
1266
1275
|
status: "KICK_OUT"
|
|
1267
1276
|
},
|
|
@@ -1275,12 +1284,12 @@ class vr extends ae {
|
|
|
1275
1284
|
if (e.jsBridge)
|
|
1276
1285
|
return e.jsBridge;
|
|
1277
1286
|
if (e.useBuiltInJsBridge)
|
|
1278
|
-
return new
|
|
1279
|
-
})(), this._options.getVoiceSign = (
|
|
1287
|
+
return new xt();
|
|
1288
|
+
})(), this._options.getVoiceSign = (i = e.getVoiceSign) != null ? i : pr, this._options.autoPlayConfirm = e.autoPlayConfirm, this._options.rtc = (() => {
|
|
1280
1289
|
if (e.rtc)
|
|
1281
1290
|
return e.rtc;
|
|
1282
1291
|
if (e.rtcType)
|
|
1283
|
-
switch (e.getVoiceSign ||
|
|
1292
|
+
switch (e.getVoiceSign || O.error(
|
|
1284
1293
|
"GetVoiceSign method must be passed when using built-in RTC instances"
|
|
1285
1294
|
), e.rtcType) {
|
|
1286
1295
|
case Q.RealseeVRWebViewRTC: {
|
|
@@ -1289,47 +1298,47 @@ class vr extends ae {
|
|
|
1289
1298
|
jsBridge: this._options.jsBridge,
|
|
1290
1299
|
getVoiceSign: this._options.getVoiceSign
|
|
1291
1300
|
});
|
|
1292
|
-
|
|
1301
|
+
O.error(
|
|
1293
1302
|
"JsBridge instance must be passed when using built-in VRWebViewRTC instances"
|
|
1294
1303
|
);
|
|
1295
1304
|
return;
|
|
1296
1305
|
}
|
|
1297
1306
|
case Q.RealseeBrowserChimeRTC:
|
|
1298
|
-
return new
|
|
1307
|
+
return new it({
|
|
1299
1308
|
getVoiceSign: this._options.getVoiceSign,
|
|
1300
|
-
logLevel: e.__debug__ ?
|
|
1309
|
+
logLevel: e.__debug__ ? st.DEBUG : st.INFO
|
|
1301
1310
|
});
|
|
1302
1311
|
case Q.RealseeBrowserRTC:
|
|
1303
|
-
return this._options.autoPlayConfirm ||
|
|
1312
|
+
return this._options.autoPlayConfirm || O.error(
|
|
1304
1313
|
"autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"
|
|
1305
|
-
), new
|
|
1314
|
+
), new rt({
|
|
1306
1315
|
getVoiceSign: this._options.getVoiceSign,
|
|
1307
1316
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1308
1317
|
});
|
|
1309
1318
|
default: {
|
|
1310
|
-
|
|
1319
|
+
O.error("unknown built-in RTC type");
|
|
1311
1320
|
return;
|
|
1312
1321
|
}
|
|
1313
1322
|
}
|
|
1314
1323
|
if (e.useBuiltInRTC) {
|
|
1315
|
-
if (e.getVoiceSign ||
|
|
1324
|
+
if (e.getVoiceSign || O.error(
|
|
1316
1325
|
"GetVoiceSign method must be passed when using built-in RTC instances"
|
|
1317
1326
|
), this._options.jsBridge)
|
|
1318
|
-
return
|
|
1327
|
+
return lr && (ar || cr) || ur ? new nt({
|
|
1319
1328
|
jsBridge: this._options.jsBridge,
|
|
1320
1329
|
getVoiceSign: this._options.getVoiceSign
|
|
1321
|
-
}) : e.builtInRTCType === ut.RealseeXChimeRTC ? new
|
|
1330
|
+
}) : e.builtInRTCType === ut.RealseeXChimeRTC ? new it({
|
|
1322
1331
|
getVoiceSign: this._options.getVoiceSign
|
|
1323
|
-
}) : new
|
|
1332
|
+
}) : new rt({
|
|
1324
1333
|
getVoiceSign: this._options.getVoiceSign,
|
|
1325
1334
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1326
1335
|
});
|
|
1327
|
-
|
|
1336
|
+
O.error(
|
|
1328
1337
|
"jsBridge instance must be passed when using built-in RTC instances"
|
|
1329
1338
|
);
|
|
1330
1339
|
return;
|
|
1331
1340
|
}
|
|
1332
|
-
})(), this._options.rtc ||
|
|
1341
|
+
})(), this._options.rtc || O.warn("unused rtc"), this._options.url && this._options.getTicket && this.connect(), this._options.__debug__ && Object.assign(window, { $liveController: this._controller, $live: this });
|
|
1333
1342
|
}
|
|
1334
1343
|
get options() {
|
|
1335
1344
|
return Object.freeze(this._options || {});
|
|
@@ -1398,17 +1407,17 @@ class vr extends ae {
|
|
|
1398
1407
|
* @param toUserIds
|
|
1399
1408
|
* @returns
|
|
1400
1409
|
*/
|
|
1401
|
-
async updateStatus(e,
|
|
1410
|
+
async updateStatus(e, i, n, c) {
|
|
1402
1411
|
if (this.state !== x.OPEN)
|
|
1403
1412
|
return !1;
|
|
1404
1413
|
const u = Object.assign(
|
|
1405
|
-
{ event_type: e, action:
|
|
1406
|
-
{ data:
|
|
1407
|
-
),
|
|
1414
|
+
{ event_type: e, action: i },
|
|
1415
|
+
{ data: n }
|
|
1416
|
+
), d = je(K.BuiltinMsg, u, c);
|
|
1408
1417
|
try {
|
|
1409
|
-
return this._controller.sendMessage(
|
|
1410
|
-
} catch (
|
|
1411
|
-
return
|
|
1418
|
+
return this._controller.sendMessage(d), !0;
|
|
1419
|
+
} catch (g) {
|
|
1420
|
+
return O.error(g), !1;
|
|
1412
1421
|
}
|
|
1413
1422
|
}
|
|
1414
1423
|
/**
|
|
@@ -1418,88 +1427,37 @@ class vr extends ae {
|
|
|
1418
1427
|
* @param timeout
|
|
1419
1428
|
* @returns
|
|
1420
1429
|
*/
|
|
1421
|
-
broadcast(e,
|
|
1422
|
-
return this.state !== x.OPEN ? !1 : new Promise((
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1430
|
+
broadcast(e, i, n) {
|
|
1431
|
+
return this.state !== x.OPEN ? !1 : new Promise((c, u) => {
|
|
1432
|
+
const d = je(
|
|
1433
|
+
K.CustomEvent,
|
|
1425
1434
|
e,
|
|
1426
|
-
|
|
1427
|
-
),
|
|
1428
|
-
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast",
|
|
1429
|
-
},
|
|
1430
|
-
|
|
1435
|
+
i
|
|
1436
|
+
), g = d.front_request_id, v = n ? setTimeout(() => {
|
|
1437
|
+
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast", E);
|
|
1438
|
+
}, n) : void 0, E = (y, I) => {
|
|
1439
|
+
I === g && (v && clearTimeout(v), this.off("broadcast", E), c(y));
|
|
1431
1440
|
};
|
|
1432
|
-
this.on("broadcast",
|
|
1441
|
+
this.on("broadcast", E);
|
|
1433
1442
|
try {
|
|
1434
|
-
this._controller.sendMessage(
|
|
1435
|
-
} catch (
|
|
1436
|
-
u(
|
|
1443
|
+
this._controller.sendMessage(d);
|
|
1444
|
+
} catch (y) {
|
|
1445
|
+
u(y);
|
|
1437
1446
|
}
|
|
1438
1447
|
});
|
|
1439
1448
|
}
|
|
1440
1449
|
}
|
|
1441
|
-
const
|
|
1442
|
-
var Ae = {},
|
|
1450
|
+
const br = (r) => (Er(), new yr(r));
|
|
1451
|
+
var Ae = {}, Sr = {
|
|
1443
1452
|
get exports() {
|
|
1444
1453
|
return Ae;
|
|
1445
1454
|
},
|
|
1446
|
-
set exports(
|
|
1447
|
-
Ae =
|
|
1448
|
-
}
|
|
1449
|
-
}, ie = {};
|
|
1450
|
-
/*
|
|
1451
|
-
object-assign
|
|
1452
|
-
(c) Sindre Sorhus
|
|
1453
|
-
@license MIT
|
|
1454
|
-
*/
|
|
1455
|
-
var je, ot;
|
|
1456
|
-
function dt() {
|
|
1457
|
-
if (ot)
|
|
1458
|
-
return je;
|
|
1459
|
-
ot = 1;
|
|
1460
|
-
var t = Object.getOwnPropertySymbols, s = Object.prototype.hasOwnProperty, e = Object.prototype.propertyIsEnumerable;
|
|
1461
|
-
function n(a) {
|
|
1462
|
-
if (a == null)
|
|
1463
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
1464
|
-
return Object(a);
|
|
1465
|
-
}
|
|
1466
|
-
function i() {
|
|
1467
|
-
try {
|
|
1468
|
-
if (!Object.assign)
|
|
1469
|
-
return !1;
|
|
1470
|
-
var a = new String("abc");
|
|
1471
|
-
if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
|
|
1472
|
-
return !1;
|
|
1473
|
-
for (var u = {}, f = 0; f < 10; f++)
|
|
1474
|
-
u["_" + String.fromCharCode(f)] = f;
|
|
1475
|
-
var v = Object.getOwnPropertyNames(u).map(function(_) {
|
|
1476
|
-
return u[_];
|
|
1477
|
-
});
|
|
1478
|
-
if (v.join("") !== "0123456789")
|
|
1479
|
-
return !1;
|
|
1480
|
-
var h = {};
|
|
1481
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(_) {
|
|
1482
|
-
h[_] = _;
|
|
1483
|
-
}), Object.keys(Object.assign({}, h)).join("") === "abcdefghijklmnopqrst";
|
|
1484
|
-
} catch (_) {
|
|
1485
|
-
return !1;
|
|
1486
|
-
}
|
|
1455
|
+
set exports(r) {
|
|
1456
|
+
Ae = r;
|
|
1487
1457
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
for (var E in f)
|
|
1492
|
-
s.call(f, E) && (v[E] = f[E]);
|
|
1493
|
-
if (t) {
|
|
1494
|
-
h = t(f);
|
|
1495
|
-
for (var w = 0; w < h.length; w++)
|
|
1496
|
-
e.call(f, h[w]) && (v[h[w]] = f[h[w]]);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
return v;
|
|
1500
|
-
}, je;
|
|
1501
|
-
}
|
|
1502
|
-
/** @license React v17.0.2
|
|
1458
|
+
}, oe = {};
|
|
1459
|
+
/**
|
|
1460
|
+
* @license React
|
|
1503
1461
|
* react-jsx-runtime.production.min.js
|
|
1504
1462
|
*
|
|
1505
1463
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1508,30 +1466,26 @@ function dt() {
|
|
|
1508
1466
|
* LICENSE file in the root directory of this source tree.
|
|
1509
1467
|
*/
|
|
1510
1468
|
var at;
|
|
1511
|
-
function
|
|
1469
|
+
function Cr() {
|
|
1512
1470
|
if (at)
|
|
1513
|
-
return
|
|
1514
|
-
at = 1
|
|
1515
|
-
var
|
|
1516
|
-
|
|
1517
|
-
var
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
for (_ in v = f.defaultProps, v)
|
|
1528
|
-
E[_] === void 0 && (E[_] = v[_]);
|
|
1529
|
-
return { $$typeof: s, type: f, key: w, ref: m, props: E, _owner: n.current };
|
|
1530
|
-
}
|
|
1531
|
-
return ie.jsx = u, ie.jsxs = u, ie;
|
|
1471
|
+
return oe;
|
|
1472
|
+
at = 1;
|
|
1473
|
+
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, n = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1474
|
+
function u(d, g, v) {
|
|
1475
|
+
var E, y = {}, I = null, _ = null;
|
|
1476
|
+
v !== void 0 && (I = "" + v), g.key !== void 0 && (I = "" + g.key), g.ref !== void 0 && (_ = g.ref);
|
|
1477
|
+
for (E in g)
|
|
1478
|
+
i.call(g, E) && !c.hasOwnProperty(E) && (y[E] = g[E]);
|
|
1479
|
+
if (d && d.defaultProps)
|
|
1480
|
+
for (E in g = d.defaultProps, g)
|
|
1481
|
+
y[E] === void 0 && (y[E] = g[E]);
|
|
1482
|
+
return { $$typeof: s, type: d, key: I, ref: _, props: y, _owner: n.current };
|
|
1483
|
+
}
|
|
1484
|
+
return oe.Fragment = e, oe.jsx = u, oe.jsxs = u, oe;
|
|
1532
1485
|
}
|
|
1533
|
-
var
|
|
1534
|
-
/**
|
|
1486
|
+
var ae = {};
|
|
1487
|
+
/**
|
|
1488
|
+
* @license React
|
|
1535
1489
|
* react-jsx-runtime.development.js
|
|
1536
1490
|
*
|
|
1537
1491
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1540,706 +1494,726 @@ var Ne = {};
|
|
|
1540
1494
|
* LICENSE file in the root directory of this source tree.
|
|
1541
1495
|
*/
|
|
1542
1496
|
var ct;
|
|
1543
|
-
function
|
|
1544
|
-
return ct || (ct = 1, function(
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
t
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
return typeof c == "function" ? c : null;
|
|
1559
|
-
}
|
|
1560
|
-
var b = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1561
|
-
function y(r) {
|
|
1562
|
-
{
|
|
1563
|
-
for (var c = arguments.length, l = new Array(c > 1 ? c - 1 : 0), g = 1; g < c; g++)
|
|
1564
|
-
l[g - 1] = arguments[g];
|
|
1565
|
-
D("error", r, l);
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
function D(r, c, l) {
|
|
1569
|
-
{
|
|
1570
|
-
var g = b.ReactDebugCurrentFrame, O = g.getStackAddendum();
|
|
1571
|
-
O !== "" && (c += "%s", l = l.concat([O]));
|
|
1572
|
-
var R = l.map(function(C) {
|
|
1573
|
-
return "" + C;
|
|
1574
|
-
});
|
|
1575
|
-
R.unshift("Warning: " + c), Function.prototype.apply.call(console[r], console, R);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
var U = !1;
|
|
1579
|
-
function z(r) {
|
|
1580
|
-
return !!(typeof r == "string" || typeof r == "function" || r === t.Fragment || r === u || r === H || r === a || r === _ || r === E || r === J || U || typeof r == "object" && r !== null && (r.$$typeof === m || r.$$typeof === w || r.$$typeof === f || r.$$typeof === v || r.$$typeof === h || r.$$typeof === k || r.$$typeof === A || r[0] === M));
|
|
1497
|
+
function wr() {
|
|
1498
|
+
return ct || (ct = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1499
|
+
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), V = Symbol.iterator, C = "@@iterator";
|
|
1500
|
+
function k(t) {
|
|
1501
|
+
if (t === null || typeof t != "object")
|
|
1502
|
+
return null;
|
|
1503
|
+
var a = V && t[V] || t[C];
|
|
1504
|
+
return typeof a == "function" ? a : null;
|
|
1505
|
+
}
|
|
1506
|
+
var U = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1507
|
+
function P(t) {
|
|
1508
|
+
{
|
|
1509
|
+
for (var a = arguments.length, l = new Array(a > 1 ? a - 1 : 0), h = 1; h < a; h++)
|
|
1510
|
+
l[h - 1] = arguments[h];
|
|
1511
|
+
fe("error", t, l);
|
|
1581
1512
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1513
|
+
}
|
|
1514
|
+
function fe(t, a, l) {
|
|
1515
|
+
{
|
|
1516
|
+
var h = U.ReactDebugCurrentFrame, b = h.getStackAddendum();
|
|
1517
|
+
b !== "" && (a += "%s", l = l.concat([b]));
|
|
1518
|
+
var R = l.map(function(p) {
|
|
1519
|
+
return String(p);
|
|
1520
|
+
});
|
|
1521
|
+
R.unshift("Warning: " + a), Function.prototype.apply.call(console[t], console, R);
|
|
1585
1522
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1523
|
+
}
|
|
1524
|
+
var f = !1, w = !1, A = !1, S = !1, N = !1, M;
|
|
1525
|
+
M = Symbol.for("react.module.reference");
|
|
1526
|
+
function F(t) {
|
|
1527
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || N || t === n || t === v || t === E || S || t === _ || f || w || A || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === y || t.$$typeof === u || t.$$typeof === d || t.$$typeof === g || // This needs to include all possible module reference object
|
|
1528
|
+
// types supported by any Flight configuration anywhere since
|
|
1529
|
+
// we don't know which Flight build this will end up being used
|
|
1530
|
+
// with.
|
|
1531
|
+
t.$$typeof === M || t.getModuleId !== void 0));
|
|
1532
|
+
}
|
|
1533
|
+
function J(t, a, l) {
|
|
1534
|
+
var h = t.displayName;
|
|
1535
|
+
if (h)
|
|
1536
|
+
return h;
|
|
1537
|
+
var b = a.displayName || a.name || "";
|
|
1538
|
+
return b !== "" ? l + "(" + b + ")" : l;
|
|
1539
|
+
}
|
|
1540
|
+
function ne(t) {
|
|
1541
|
+
return t.displayName || "Context";
|
|
1542
|
+
}
|
|
1543
|
+
function G(t) {
|
|
1544
|
+
if (t == null)
|
|
1545
|
+
return null;
|
|
1546
|
+
if (typeof t.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
1547
|
+
return t.displayName || t.name || null;
|
|
1548
|
+
if (typeof t == "string")
|
|
1549
|
+
return t;
|
|
1550
|
+
switch (t) {
|
|
1551
|
+
case i:
|
|
1552
|
+
return "Fragment";
|
|
1553
|
+
case e:
|
|
1554
|
+
return "Portal";
|
|
1555
|
+
case c:
|
|
1556
|
+
return "Profiler";
|
|
1557
|
+
case n:
|
|
1558
|
+
return "StrictMode";
|
|
1559
|
+
case v:
|
|
1560
|
+
return "Suspense";
|
|
1561
|
+
case E:
|
|
1562
|
+
return "SuspenseList";
|
|
1588
1563
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
if (typeof r == "string")
|
|
1595
|
-
return r;
|
|
1596
|
-
switch (r) {
|
|
1597
|
-
case t.Fragment:
|
|
1598
|
-
return "Fragment";
|
|
1599
|
-
case i:
|
|
1600
|
-
return "Portal";
|
|
1564
|
+
if (typeof t == "object")
|
|
1565
|
+
switch (t.$$typeof) {
|
|
1566
|
+
case d:
|
|
1567
|
+
var a = t;
|
|
1568
|
+
return ne(a) + ".Consumer";
|
|
1601
1569
|
case u:
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
return "
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
return
|
|
1615
|
-
case f:
|
|
1616
|
-
var l = r;
|
|
1617
|
-
return be(l._context) + ".Provider";
|
|
1618
|
-
case h:
|
|
1619
|
-
return ue(r, r.render, "ForwardRef");
|
|
1620
|
-
case w:
|
|
1621
|
-
return F(r.type);
|
|
1622
|
-
case A:
|
|
1623
|
-
return F(r._render);
|
|
1624
|
-
case m: {
|
|
1625
|
-
var g = r, O = g._payload, R = g._init;
|
|
1626
|
-
try {
|
|
1627
|
-
return F(R(O));
|
|
1628
|
-
} catch (C) {
|
|
1629
|
-
return null;
|
|
1630
|
-
}
|
|
1570
|
+
var l = t;
|
|
1571
|
+
return ne(l._context) + ".Provider";
|
|
1572
|
+
case g:
|
|
1573
|
+
return J(t, t.render, "ForwardRef");
|
|
1574
|
+
case y:
|
|
1575
|
+
var h = t.displayName || null;
|
|
1576
|
+
return h !== null ? h : G(t.type) || "Memo";
|
|
1577
|
+
case I: {
|
|
1578
|
+
var b = t, R = b._payload, p = b._init;
|
|
1579
|
+
try {
|
|
1580
|
+
return G(p(R));
|
|
1581
|
+
} catch (m) {
|
|
1582
|
+
return null;
|
|
1631
1583
|
}
|
|
1632
1584
|
}
|
|
1633
|
-
return null;
|
|
1634
|
-
}
|
|
1635
|
-
var ee = 0, T, B, te, le, Me, $e, xe;
|
|
1636
|
-
function Ue() {
|
|
1637
|
-
}
|
|
1638
|
-
Ue.__reactDisabledLog = !0;
|
|
1639
|
-
function ht() {
|
|
1640
|
-
{
|
|
1641
|
-
if (ee === 0) {
|
|
1642
|
-
T = console.log, B = console.info, te = console.warn, le = console.error, Me = console.group, $e = console.groupCollapsed, xe = console.groupEnd;
|
|
1643
|
-
var r = {
|
|
1644
|
-
configurable: !0,
|
|
1645
|
-
enumerable: !0,
|
|
1646
|
-
value: Ue,
|
|
1647
|
-
writable: !0
|
|
1648
|
-
};
|
|
1649
|
-
Object.defineProperties(console, {
|
|
1650
|
-
info: r,
|
|
1651
|
-
log: r,
|
|
1652
|
-
warn: r,
|
|
1653
|
-
error: r,
|
|
1654
|
-
group: r,
|
|
1655
|
-
groupCollapsed: r,
|
|
1656
|
-
groupEnd: r
|
|
1657
|
-
});
|
|
1658
|
-
}
|
|
1659
|
-
ee++;
|
|
1660
1585
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
groupCollapsed: e({}, r, {
|
|
1687
|
-
value: $e
|
|
1688
|
-
}),
|
|
1689
|
-
groupEnd: e({}, r, {
|
|
1690
|
-
value: xe
|
|
1691
|
-
})
|
|
1692
|
-
});
|
|
1693
|
-
}
|
|
1694
|
-
ee < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1586
|
+
return null;
|
|
1587
|
+
}
|
|
1588
|
+
var z = Object.assign, ee = 0, T, B, te, de, Ve, $e, xe;
|
|
1589
|
+
function Ue() {
|
|
1590
|
+
}
|
|
1591
|
+
Ue.__reactDisabledLog = !0;
|
|
1592
|
+
function dt() {
|
|
1593
|
+
{
|
|
1594
|
+
if (ee === 0) {
|
|
1595
|
+
T = console.log, B = console.info, te = console.warn, de = console.error, Ve = console.group, $e = console.groupCollapsed, xe = console.groupEnd;
|
|
1596
|
+
var t = {
|
|
1597
|
+
configurable: !0,
|
|
1598
|
+
enumerable: !0,
|
|
1599
|
+
value: Ue,
|
|
1600
|
+
writable: !0
|
|
1601
|
+
};
|
|
1602
|
+
Object.defineProperties(console, {
|
|
1603
|
+
info: t,
|
|
1604
|
+
log: t,
|
|
1605
|
+
warn: t,
|
|
1606
|
+
error: t,
|
|
1607
|
+
group: t,
|
|
1608
|
+
groupCollapsed: t,
|
|
1609
|
+
groupEnd: t
|
|
1610
|
+
});
|
|
1695
1611
|
}
|
|
1612
|
+
ee++;
|
|
1696
1613
|
}
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1614
|
+
}
|
|
1615
|
+
function ht() {
|
|
1616
|
+
{
|
|
1617
|
+
if (ee--, ee === 0) {
|
|
1618
|
+
var t = {
|
|
1619
|
+
configurable: !0,
|
|
1620
|
+
enumerable: !0,
|
|
1621
|
+
writable: !0
|
|
1622
|
+
};
|
|
1623
|
+
Object.defineProperties(console, {
|
|
1624
|
+
log: z({}, t, {
|
|
1625
|
+
value: T
|
|
1626
|
+
}),
|
|
1627
|
+
info: z({}, t, {
|
|
1628
|
+
value: B
|
|
1629
|
+
}),
|
|
1630
|
+
warn: z({}, t, {
|
|
1631
|
+
value: te
|
|
1632
|
+
}),
|
|
1633
|
+
error: z({}, t, {
|
|
1634
|
+
value: de
|
|
1635
|
+
}),
|
|
1636
|
+
group: z({}, t, {
|
|
1637
|
+
value: Ve
|
|
1638
|
+
}),
|
|
1639
|
+
groupCollapsed: z({}, t, {
|
|
1640
|
+
value: $e
|
|
1641
|
+
}),
|
|
1642
|
+
groupEnd: z({}, t, {
|
|
1643
|
+
value: xe
|
|
1644
|
+
})
|
|
1645
|
+
});
|
|
1709
1646
|
}
|
|
1647
|
+
ee < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1710
1648
|
}
|
|
1711
|
-
|
|
1649
|
+
}
|
|
1650
|
+
var Ce = U.ReactCurrentDispatcher, we;
|
|
1651
|
+
function he(t, a, l) {
|
|
1712
1652
|
{
|
|
1713
|
-
|
|
1714
|
-
|
|
1653
|
+
if (we === void 0)
|
|
1654
|
+
try {
|
|
1655
|
+
throw Error();
|
|
1656
|
+
} catch (b) {
|
|
1657
|
+
var h = b.stack.trim().match(/\n( *(at )?)/);
|
|
1658
|
+
we = h && h[1] || "";
|
|
1659
|
+
}
|
|
1660
|
+
return `
|
|
1661
|
+
` + we + t;
|
|
1715
1662
|
}
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
var
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1663
|
+
}
|
|
1664
|
+
var Re = !1, _e;
|
|
1665
|
+
{
|
|
1666
|
+
var _t = typeof WeakMap == "function" ? WeakMap : Map;
|
|
1667
|
+
_e = new _t();
|
|
1668
|
+
}
|
|
1669
|
+
function Fe(t, a) {
|
|
1670
|
+
if (!t || Re)
|
|
1671
|
+
return "";
|
|
1672
|
+
{
|
|
1673
|
+
var l = _e.get(t);
|
|
1674
|
+
if (l !== void 0)
|
|
1675
|
+
return l;
|
|
1676
|
+
}
|
|
1677
|
+
var h;
|
|
1678
|
+
Re = !0;
|
|
1679
|
+
var b = Error.prepareStackTrace;
|
|
1680
|
+
Error.prepareStackTrace = void 0;
|
|
1681
|
+
var R;
|
|
1682
|
+
R = Ce.current, Ce.current = null, dt();
|
|
1683
|
+
try {
|
|
1684
|
+
if (a) {
|
|
1685
|
+
var p = function() {
|
|
1686
|
+
throw Error();
|
|
1687
|
+
};
|
|
1688
|
+
if (Object.defineProperty(p.prototype, "props", {
|
|
1689
|
+
set: function() {
|
|
1733
1690
|
throw Error();
|
|
1734
|
-
};
|
|
1735
|
-
if (Object.defineProperty(C.prototype, "props", {
|
|
1736
|
-
set: function() {
|
|
1737
|
-
throw Error();
|
|
1738
|
-
}
|
|
1739
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
1740
|
-
try {
|
|
1741
|
-
Reflect.construct(C, []);
|
|
1742
|
-
} catch (Y) {
|
|
1743
|
-
g = Y;
|
|
1744
|
-
}
|
|
1745
|
-
Reflect.construct(r, [], C);
|
|
1746
|
-
} else {
|
|
1747
|
-
try {
|
|
1748
|
-
C.call();
|
|
1749
|
-
} catch (Y) {
|
|
1750
|
-
g = Y;
|
|
1751
|
-
}
|
|
1752
|
-
r.call(C.prototype);
|
|
1753
1691
|
}
|
|
1692
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
1693
|
+
try {
|
|
1694
|
+
Reflect.construct(p, []);
|
|
1695
|
+
} catch (Y) {
|
|
1696
|
+
h = Y;
|
|
1697
|
+
}
|
|
1698
|
+
Reflect.construct(t, [], p);
|
|
1754
1699
|
} else {
|
|
1755
1700
|
try {
|
|
1756
|
-
|
|
1701
|
+
p.call();
|
|
1757
1702
|
} catch (Y) {
|
|
1758
|
-
|
|
1703
|
+
h = Y;
|
|
1759
1704
|
}
|
|
1760
|
-
|
|
1705
|
+
t.call(p.prototype);
|
|
1761
1706
|
}
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
j--;
|
|
1768
|
-
for (; P >= 1 && j >= 0; P--, j--)
|
|
1769
|
-
if (p[P] !== $[j]) {
|
|
1770
|
-
if (P !== 1 || j !== 1)
|
|
1771
|
-
do
|
|
1772
|
-
if (P--, j--, j < 0 || p[P] !== $[j]) {
|
|
1773
|
-
var K = `
|
|
1774
|
-
` + p[P].replace(" at new ", " at ");
|
|
1775
|
-
return typeof r == "function" && de.set(r, K), K;
|
|
1776
|
-
}
|
|
1777
|
-
while (P >= 1 && j >= 0);
|
|
1778
|
-
break;
|
|
1779
|
-
}
|
|
1707
|
+
} else {
|
|
1708
|
+
try {
|
|
1709
|
+
throw Error();
|
|
1710
|
+
} catch (Y) {
|
|
1711
|
+
h = Y;
|
|
1780
1712
|
}
|
|
1781
|
-
|
|
1782
|
-
we = !1, ye.current = R, _t(), Error.prepareStackTrace = O;
|
|
1713
|
+
t();
|
|
1783
1714
|
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1715
|
+
} catch (Y) {
|
|
1716
|
+
if (Y && h && typeof Y.stack == "string") {
|
|
1717
|
+
for (var m = Y.stack.split(`
|
|
1718
|
+
`), $ = h.stack.split(`
|
|
1719
|
+
`), j = m.length - 1, L = $.length - 1; j >= 1 && L >= 0 && m[j] !== $[L]; )
|
|
1720
|
+
L--;
|
|
1721
|
+
for (; j >= 1 && L >= 0; j--, L--)
|
|
1722
|
+
if (m[j] !== $[L]) {
|
|
1723
|
+
if (j !== 1 || L !== 1)
|
|
1724
|
+
do
|
|
1725
|
+
if (j--, L--, L < 0 || m[j] !== $[L]) {
|
|
1726
|
+
var W = `
|
|
1727
|
+
` + m[j].replace(" at new ", " at ");
|
|
1728
|
+
return t.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", t.displayName)), typeof t == "function" && _e.set(t, W), W;
|
|
1729
|
+
}
|
|
1730
|
+
while (j >= 1 && L >= 0);
|
|
1731
|
+
break;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
} finally {
|
|
1735
|
+
Re = !1, Ce.current = R, ht(), Error.prepareStackTrace = b;
|
|
1789
1736
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1737
|
+
var ie = t ? t.displayName || t.name : "", et = ie ? he(ie) : "";
|
|
1738
|
+
return typeof t == "function" && _e.set(t, et), et;
|
|
1739
|
+
}
|
|
1740
|
+
function gt(t, a, l) {
|
|
1741
|
+
return Fe(t, !1);
|
|
1742
|
+
}
|
|
1743
|
+
function mt(t) {
|
|
1744
|
+
var a = t.prototype;
|
|
1745
|
+
return !!(a && a.isReactComponent);
|
|
1746
|
+
}
|
|
1747
|
+
function ge(t, a, l) {
|
|
1748
|
+
if (t == null)
|
|
1749
|
+
return "";
|
|
1750
|
+
if (typeof t == "function")
|
|
1751
|
+
return Fe(t, mt(t));
|
|
1752
|
+
if (typeof t == "string")
|
|
1753
|
+
return he(t);
|
|
1754
|
+
switch (t) {
|
|
1755
|
+
case v:
|
|
1756
|
+
return he("Suspense");
|
|
1757
|
+
case E:
|
|
1758
|
+
return he("SuspenseList");
|
|
1793
1759
|
}
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1760
|
+
if (typeof t == "object")
|
|
1761
|
+
switch (t.$$typeof) {
|
|
1762
|
+
case g:
|
|
1763
|
+
return gt(t.render);
|
|
1764
|
+
case y:
|
|
1765
|
+
return ge(t.type, a, l);
|
|
1766
|
+
case I: {
|
|
1767
|
+
var h = t, b = h._payload, R = h._init;
|
|
1768
|
+
try {
|
|
1769
|
+
return ge(R(b), a, l);
|
|
1770
|
+
} catch (p) {
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1806
1773
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1774
|
+
return "";
|
|
1775
|
+
}
|
|
1776
|
+
var me = Object.prototype.hasOwnProperty, Be = {}, We = U.ReactDebugCurrentFrame;
|
|
1777
|
+
function ve(t) {
|
|
1778
|
+
if (t) {
|
|
1779
|
+
var a = t._owner, l = ge(t.type, t._source, a ? a.type : null);
|
|
1780
|
+
We.setExtraStackFrame(l);
|
|
1781
|
+
} else
|
|
1782
|
+
We.setExtraStackFrame(null);
|
|
1783
|
+
}
|
|
1784
|
+
function vt(t, a, l, h, b) {
|
|
1785
|
+
{
|
|
1786
|
+
var R = Function.call.bind(me);
|
|
1787
|
+
for (var p in t)
|
|
1788
|
+
if (R(t, p)) {
|
|
1789
|
+
var m = void 0;
|
|
1790
|
+
try {
|
|
1791
|
+
if (typeof t[p] != "function") {
|
|
1792
|
+
var $ = Error((h || "React class") + ": " + l + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1793
|
+
throw $.name = "Invariant Violation", $;
|
|
1820
1794
|
}
|
|
1795
|
+
m = t[p](a, p, h, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1796
|
+
} catch (j) {
|
|
1797
|
+
m = j;
|
|
1821
1798
|
}
|
|
1799
|
+
m && !(m instanceof Error) && (ve(b), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", l, p, typeof m), ve(null)), m instanceof Error && !(m.message in Be) && (Be[m.message] = !0, ve(b), P("Failed %s type: %s", l, m.message), ve(null));
|
|
1822
1800
|
}
|
|
1823
|
-
return "";
|
|
1824
|
-
}
|
|
1825
|
-
var Fe = {}, qe = b.ReactDebugCurrentFrame;
|
|
1826
|
-
function _e(r) {
|
|
1827
|
-
if (r) {
|
|
1828
|
-
var c = r._owner, l = he(r.type, r._source, c ? c.type : null);
|
|
1829
|
-
qe.setExtraStackFrame(l);
|
|
1830
|
-
} else
|
|
1831
|
-
qe.setExtraStackFrame(null);
|
|
1832
1801
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
throw $.name = "Invariant Violation", $;
|
|
1843
|
-
}
|
|
1844
|
-
p = r[C](c, C, g, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1845
|
-
} catch (P) {
|
|
1846
|
-
p = P;
|
|
1847
|
-
}
|
|
1848
|
-
p && !(p instanceof Error) && (_e(O), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", l, C, typeof p), _e(null)), p instanceof Error && !(p.message in Fe) && (Fe[p.message] = !0, _e(O), y("Failed %s type: %s", l, p.message), _e(null));
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1802
|
+
}
|
|
1803
|
+
var pt = Array.isArray;
|
|
1804
|
+
function Oe(t) {
|
|
1805
|
+
return pt(t);
|
|
1806
|
+
}
|
|
1807
|
+
function Et(t) {
|
|
1808
|
+
{
|
|
1809
|
+
var a = typeof Symbol == "function" && Symbol.toStringTag, l = a && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
1810
|
+
return l;
|
|
1851
1811
|
}
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
Oe = {};
|
|
1859
|
-
function Et(r) {
|
|
1860
|
-
if (Se.call(r, "ref")) {
|
|
1861
|
-
var c = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
1862
|
-
if (c && c.isReactWarning)
|
|
1863
|
-
return !1;
|
|
1864
|
-
}
|
|
1865
|
-
return r.ref !== void 0;
|
|
1812
|
+
}
|
|
1813
|
+
function yt(t) {
|
|
1814
|
+
try {
|
|
1815
|
+
return Ke(t), !1;
|
|
1816
|
+
} catch (a) {
|
|
1817
|
+
return !0;
|
|
1866
1818
|
}
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
return
|
|
1819
|
+
}
|
|
1820
|
+
function Ke(t) {
|
|
1821
|
+
return "" + t;
|
|
1822
|
+
}
|
|
1823
|
+
function qe(t) {
|
|
1824
|
+
if (yt(t))
|
|
1825
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Et(t)), Ke(t);
|
|
1826
|
+
}
|
|
1827
|
+
var se = U.ReactCurrentOwner, bt = {
|
|
1828
|
+
key: !0,
|
|
1829
|
+
ref: !0,
|
|
1830
|
+
__self: !0,
|
|
1831
|
+
__source: !0
|
|
1832
|
+
}, Ge, Ye, Ie;
|
|
1833
|
+
Ie = {};
|
|
1834
|
+
function St(t) {
|
|
1835
|
+
if (me.call(t, "ref")) {
|
|
1836
|
+
var a = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
1837
|
+
if (a && a.isReactWarning)
|
|
1838
|
+
return !1;
|
|
1874
1839
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1840
|
+
return t.ref !== void 0;
|
|
1841
|
+
}
|
|
1842
|
+
function Ct(t) {
|
|
1843
|
+
if (me.call(t, "key")) {
|
|
1844
|
+
var a = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
1845
|
+
if (a && a.isReactWarning)
|
|
1846
|
+
return !1;
|
|
1880
1847
|
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
get: l,
|
|
1888
|
-
configurable: !0
|
|
1889
|
-
});
|
|
1890
|
-
}
|
|
1848
|
+
return t.key !== void 0;
|
|
1849
|
+
}
|
|
1850
|
+
function wt(t, a) {
|
|
1851
|
+
if (typeof t.ref == "string" && se.current && a && se.current.stateNode !== a) {
|
|
1852
|
+
var l = G(se.current.type);
|
|
1853
|
+
Ie[l] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G(se.current.type), t.ref), Ie[l] = !0);
|
|
1891
1854
|
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
}
|
|
1855
|
+
}
|
|
1856
|
+
function Rt(t, a) {
|
|
1857
|
+
{
|
|
1858
|
+
var l = function() {
|
|
1859
|
+
Ge || (Ge = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
1860
|
+
};
|
|
1861
|
+
l.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
1862
|
+
get: l,
|
|
1863
|
+
configurable: !0
|
|
1864
|
+
});
|
|
1902
1865
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
type: r,
|
|
1909
|
-
key: c,
|
|
1910
|
-
ref: l,
|
|
1911
|
-
props: C,
|
|
1912
|
-
// Record the component responsible for creating this element.
|
|
1913
|
-
_owner: R
|
|
1866
|
+
}
|
|
1867
|
+
function Ot(t, a) {
|
|
1868
|
+
{
|
|
1869
|
+
var l = function() {
|
|
1870
|
+
Ye || (Ye = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
1914
1871
|
};
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1872
|
+
l.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
1873
|
+
get: l,
|
|
1874
|
+
configurable: !0
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
var It = function(t, a, l, h, b, R, p) {
|
|
1879
|
+
var m = {
|
|
1880
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
1881
|
+
$$typeof: s,
|
|
1882
|
+
// Built-in properties that belong on the element
|
|
1883
|
+
type: t,
|
|
1884
|
+
key: a,
|
|
1885
|
+
ref: l,
|
|
1886
|
+
props: p,
|
|
1887
|
+
// Record the component responsible for creating this element.
|
|
1888
|
+
_owner: R
|
|
1931
1889
|
};
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1890
|
+
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
1891
|
+
configurable: !1,
|
|
1892
|
+
enumerable: !1,
|
|
1893
|
+
writable: !0,
|
|
1894
|
+
value: !1
|
|
1895
|
+
}), Object.defineProperty(m, "_self", {
|
|
1896
|
+
configurable: !1,
|
|
1897
|
+
enumerable: !1,
|
|
1898
|
+
writable: !1,
|
|
1899
|
+
value: h
|
|
1900
|
+
}), Object.defineProperty(m, "_source", {
|
|
1901
|
+
configurable: !1,
|
|
1902
|
+
enumerable: !1,
|
|
1903
|
+
writable: !1,
|
|
1904
|
+
value: b
|
|
1905
|
+
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
1906
|
+
};
|
|
1907
|
+
function Tt(t, a, l, h, b) {
|
|
1908
|
+
{
|
|
1909
|
+
var R, p = {}, m = null, $ = null;
|
|
1910
|
+
l !== void 0 && (qe(l), m = "" + l), Ct(a) && (qe(a.key), m = "" + a.key), St(a) && ($ = a.ref, wt(a, b));
|
|
1911
|
+
for (R in a)
|
|
1912
|
+
me.call(a, R) && !bt.hasOwnProperty(R) && (p[R] = a[R]);
|
|
1913
|
+
if (t && t.defaultProps) {
|
|
1914
|
+
var j = t.defaultProps;
|
|
1915
|
+
for (R in j)
|
|
1916
|
+
p[R] === void 0 && (p[R] = j[R]);
|
|
1948
1917
|
}
|
|
1918
|
+
if (m || $) {
|
|
1919
|
+
var L = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
1920
|
+
m && Rt(p, L), $ && Ot(p, L);
|
|
1921
|
+
}
|
|
1922
|
+
return It(t, m, $, b, h, se.current, p);
|
|
1949
1923
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1924
|
+
}
|
|
1925
|
+
var Te = U.ReactCurrentOwner, He = U.ReactDebugCurrentFrame;
|
|
1926
|
+
function re(t) {
|
|
1927
|
+
if (t) {
|
|
1928
|
+
var a = t._owner, l = ge(t.type, t._source, a ? a.type : null);
|
|
1929
|
+
He.setExtraStackFrame(l);
|
|
1930
|
+
} else
|
|
1931
|
+
He.setExtraStackFrame(null);
|
|
1932
|
+
}
|
|
1933
|
+
var ke;
|
|
1934
|
+
ke = !1;
|
|
1935
|
+
function Pe(t) {
|
|
1936
|
+
return typeof t == "object" && t !== null && t.$$typeof === s;
|
|
1937
|
+
}
|
|
1938
|
+
function Je() {
|
|
1939
|
+
{
|
|
1940
|
+
if (Te.current) {
|
|
1941
|
+
var t = G(Te.current.type);
|
|
1942
|
+
if (t)
|
|
1943
|
+
return `
|
|
1969
1944
|
|
|
1970
|
-
Check the render method of \`` +
|
|
1971
|
-
}
|
|
1972
|
-
return "";
|
|
1945
|
+
Check the render method of \`` + t + "`.";
|
|
1973
1946
|
}
|
|
1947
|
+
return "";
|
|
1974
1948
|
}
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1949
|
+
}
|
|
1950
|
+
function kt(t) {
|
|
1951
|
+
{
|
|
1952
|
+
if (t !== void 0) {
|
|
1953
|
+
var a = t.fileName.replace(/^.*[\\\/]/, ""), l = t.lineNumber;
|
|
1954
|
+
return `
|
|
1980
1955
|
|
|
1981
|
-
Check your code at ` +
|
|
1982
|
-
}
|
|
1983
|
-
return "";
|
|
1956
|
+
Check your code at ` + a + ":" + l + ".";
|
|
1984
1957
|
}
|
|
1958
|
+
return "";
|
|
1985
1959
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1960
|
+
}
|
|
1961
|
+
var ze = {};
|
|
1962
|
+
function Pt(t) {
|
|
1963
|
+
{
|
|
1964
|
+
var a = Je();
|
|
1965
|
+
if (!a) {
|
|
1966
|
+
var l = typeof t == "string" ? t : t.displayName || t.name;
|
|
1967
|
+
l && (a = `
|
|
1993
1968
|
|
|
1994
1969
|
Check the top-level render call using <` + l + ">.");
|
|
1995
|
-
}
|
|
1996
|
-
return c;
|
|
1997
1970
|
}
|
|
1971
|
+
return a;
|
|
1998
1972
|
}
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
1973
|
+
}
|
|
1974
|
+
function Xe(t, a) {
|
|
1975
|
+
{
|
|
1976
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
1977
|
+
return;
|
|
1978
|
+
t._store.validated = !0;
|
|
1979
|
+
var l = Pt(a);
|
|
1980
|
+
if (ze[l])
|
|
1981
|
+
return;
|
|
1982
|
+
ze[l] = !0;
|
|
1983
|
+
var h = "";
|
|
1984
|
+
t && t._owner && t._owner !== Te.current && (h = " It was passed a child from " + G(t._owner.type) + "."), re(t), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, h), re(null);
|
|
2011
1985
|
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
else if (Te(r))
|
|
2022
|
-
r._store && (r._store.validated = !0);
|
|
2023
|
-
else if (r) {
|
|
2024
|
-
var O = N(r);
|
|
2025
|
-
if (typeof O == "function" && O !== r.entries)
|
|
2026
|
-
for (var R = O.call(r), C; !(C = R.next()).done; )
|
|
2027
|
-
Te(C.value) && ze(C.value, c);
|
|
1986
|
+
}
|
|
1987
|
+
function Ze(t, a) {
|
|
1988
|
+
{
|
|
1989
|
+
if (typeof t != "object")
|
|
1990
|
+
return;
|
|
1991
|
+
if (Oe(t))
|
|
1992
|
+
for (var l = 0; l < t.length; l++) {
|
|
1993
|
+
var h = t[l];
|
|
1994
|
+
Pe(h) && Xe(h, a);
|
|
2028
1995
|
}
|
|
1996
|
+
else if (Pe(t))
|
|
1997
|
+
t._store && (t._store.validated = !0);
|
|
1998
|
+
else if (t) {
|
|
1999
|
+
var b = k(t);
|
|
2000
|
+
if (typeof b == "function" && b !== t.entries)
|
|
2001
|
+
for (var R = b.call(t), p; !(p = R.next()).done; )
|
|
2002
|
+
Pe(p.value) && Xe(p.value, a);
|
|
2029
2003
|
}
|
|
2030
2004
|
}
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2005
|
+
}
|
|
2006
|
+
function Nt(t) {
|
|
2007
|
+
{
|
|
2008
|
+
var a = t.type;
|
|
2009
|
+
if (a == null || typeof a == "string")
|
|
2010
|
+
return;
|
|
2011
|
+
var l;
|
|
2012
|
+
if (typeof a == "function")
|
|
2013
|
+
l = a.propTypes;
|
|
2014
|
+
else if (typeof a == "object" && (a.$$typeof === g || // Note: Memo only checks outer props here.
|
|
2015
|
+
// Inner props are checked in the reconciler.
|
|
2016
|
+
a.$$typeof === y))
|
|
2017
|
+
l = a.propTypes;
|
|
2018
|
+
else
|
|
2019
|
+
return;
|
|
2020
|
+
if (l) {
|
|
2021
|
+
var h = G(a);
|
|
2022
|
+
vt(l, t.props, "prop", h, t);
|
|
2023
|
+
} else if (a.PropTypes !== void 0 && !ke) {
|
|
2024
|
+
ke = !0;
|
|
2025
|
+
var b = G(a);
|
|
2026
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
2054
2027
|
}
|
|
2028
|
+
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2055
2029
|
}
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2030
|
+
}
|
|
2031
|
+
function jt(t) {
|
|
2032
|
+
{
|
|
2033
|
+
for (var a = Object.keys(t.props), l = 0; l < a.length; l++) {
|
|
2034
|
+
var h = a[l];
|
|
2035
|
+
if (h !== "children" && h !== "key") {
|
|
2036
|
+
re(t), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), re(null);
|
|
2037
|
+
break;
|
|
2064
2038
|
}
|
|
2065
|
-
r.ref !== null && (re(r), y("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
2066
2039
|
}
|
|
2040
|
+
t.ref !== null && (re(t), P("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
2067
2041
|
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
var j = Ot(r, c, l, O, R);
|
|
2080
|
-
if (j == null)
|
|
2081
|
-
return j;
|
|
2082
|
-
if (C) {
|
|
2083
|
-
var K = c.children;
|
|
2084
|
-
if (K !== void 0)
|
|
2085
|
-
if (g)
|
|
2086
|
-
if (Array.isArray(K)) {
|
|
2087
|
-
for (var ne = 0; ne < K.length; ne++)
|
|
2088
|
-
Xe(K[ne], r);
|
|
2089
|
-
Object.freeze && Object.freeze(K);
|
|
2090
|
-
} else
|
|
2091
|
-
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2092
|
-
else
|
|
2093
|
-
Xe(K, r);
|
|
2094
|
-
}
|
|
2095
|
-
return r === t.Fragment ? kt(j) : Tt(j), j;
|
|
2042
|
+
}
|
|
2043
|
+
function Qe(t, a, l, h, b, R) {
|
|
2044
|
+
{
|
|
2045
|
+
var p = F(t);
|
|
2046
|
+
if (!p) {
|
|
2047
|
+
var m = "";
|
|
2048
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
2049
|
+
var $ = kt(b);
|
|
2050
|
+
$ ? m += $ : m += Je();
|
|
2051
|
+
var j;
|
|
2052
|
+
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof === s ? (j = "<" + (G(t.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : j = typeof t, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, m);
|
|
2096
2053
|
}
|
|
2054
|
+
var L = Tt(t, a, l, b, R);
|
|
2055
|
+
if (L == null)
|
|
2056
|
+
return L;
|
|
2057
|
+
if (p) {
|
|
2058
|
+
var W = a.children;
|
|
2059
|
+
if (W !== void 0)
|
|
2060
|
+
if (h)
|
|
2061
|
+
if (Oe(W)) {
|
|
2062
|
+
for (var ie = 0; ie < W.length; ie++)
|
|
2063
|
+
Ze(W[ie], t);
|
|
2064
|
+
Object.freeze && Object.freeze(W);
|
|
2065
|
+
} else
|
|
2066
|
+
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2067
|
+
else
|
|
2068
|
+
Ze(W, t);
|
|
2069
|
+
}
|
|
2070
|
+
return t === i ? jt(L) : Nt(L), L;
|
|
2097
2071
|
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
}(
|
|
2072
|
+
}
|
|
2073
|
+
function Lt(t, a, l) {
|
|
2074
|
+
return Qe(t, a, l, !0);
|
|
2075
|
+
}
|
|
2076
|
+
function At(t, a, l) {
|
|
2077
|
+
return Qe(t, a, l, !1);
|
|
2078
|
+
}
|
|
2079
|
+
var Mt = At, Dt = Lt;
|
|
2080
|
+
ae.Fragment = i, ae.jsx = Mt, ae.jsxs = Dt;
|
|
2081
|
+
}()), ae;
|
|
2108
2082
|
}
|
|
2109
|
-
(function(
|
|
2110
|
-
process.env.NODE_ENV === "production" ?
|
|
2111
|
-
})(
|
|
2112
|
-
const
|
|
2113
|
-
function
|
|
2114
|
-
const s =
|
|
2115
|
-
const
|
|
2116
|
-
if (!
|
|
2083
|
+
(function(r) {
|
|
2084
|
+
process.env.NODE_ENV === "production" ? r.exports = Cr() : r.exports = wr();
|
|
2085
|
+
})(Sr);
|
|
2086
|
+
const Rr = Ae.jsx;
|
|
2087
|
+
function jr(r) {
|
|
2088
|
+
const s = Gt(null), e = br(r), i = e.jsBridge, n = (f) => /* @__PURE__ */ Rr(s.Provider, { value: e, children: f.children }), c = () => {
|
|
2089
|
+
const f = D.useContext(s);
|
|
2090
|
+
if (!f)
|
|
2117
2091
|
throw new Error("LiveProvider never found.");
|
|
2118
|
-
return
|
|
2119
|
-
}, u = () => e,
|
|
2120
|
-
function
|
|
2121
|
-
const
|
|
2122
|
-
return
|
|
2123
|
-
}
|
|
2124
|
-
function
|
|
2125
|
-
const
|
|
2092
|
+
return f;
|
|
2093
|
+
}, u = () => e, d = () => e.$RTC, g = () => d(), v = () => async (f) => await e.connect(f);
|
|
2094
|
+
function E(f, w, A = []) {
|
|
2095
|
+
const S = c(), N = [S, name, ...A], M = () => S.keyframes.off(f, w);
|
|
2096
|
+
return D.useEffect(() => (S.keyframes.on(f, w), M), N), M;
|
|
2097
|
+
}
|
|
2098
|
+
function y() {
|
|
2099
|
+
const f = c();
|
|
2126
2100
|
return {
|
|
2127
|
-
connect: async (T) => await
|
|
2128
|
-
broadcast: async (T, B, te = 0) => await
|
|
2129
|
-
exit: async () => await
|
|
2130
|
-
kick: async (T) => await
|
|
2131
|
-
toggleMicro: (T) =>
|
|
2132
|
-
forbidMicro: async (T, B = []) => await
|
|
2133
|
-
forbidSync: (T, B = []) =>
|
|
2134
|
-
sendKeyframe: (T, B) =>
|
|
2135
|
-
getFramesByKey: (T) =>
|
|
2136
|
-
setSelfInfo: (T) =>
|
|
2137
|
-
updateStatus: (T, B, te,
|
|
2101
|
+
connect: async (T) => await f.connect(T),
|
|
2102
|
+
broadcast: async (T, B, te = 0) => await f.broadcast(T, B, te),
|
|
2103
|
+
exit: async () => await f.exit(),
|
|
2104
|
+
kick: async (T) => await f.kick(T),
|
|
2105
|
+
toggleMicro: (T) => f.toggleMicro(T),
|
|
2106
|
+
forbidMicro: async (T, B = []) => await f.forbidMicro(T, B),
|
|
2107
|
+
forbidSync: (T, B = []) => f.forbidSync(T, B),
|
|
2108
|
+
sendKeyframe: (T, B) => f.sendKeyframe(T, B),
|
|
2109
|
+
getFramesByKey: (T) => f.getFramesByKey(T),
|
|
2110
|
+
setSelfInfo: (T) => f.setSelfInfo(T),
|
|
2111
|
+
updateStatus: (T, B, te, de) => f.updateStatus(T, B, te, de)
|
|
2138
2112
|
};
|
|
2139
2113
|
}
|
|
2140
|
-
function
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2143
|
-
const
|
|
2144
|
-
return
|
|
2145
|
-
}, [
|
|
2146
|
-
const
|
|
2147
|
-
(
|
|
2148
|
-
[
|
|
2114
|
+
function I(f) {
|
|
2115
|
+
const w = c(), [A, S] = D.useState(w.getFramesByKey(f));
|
|
2116
|
+
D.useEffect(() => {
|
|
2117
|
+
const M = (ne) => S(ne), F = f, J = M;
|
|
2118
|
+
return w.keyframes.on(F, J), () => w.keyframes.off(F, J);
|
|
2119
|
+
}, [w]);
|
|
2120
|
+
const N = D.useCallback(
|
|
2121
|
+
(M) => w.sendKeyframe(f, M),
|
|
2122
|
+
[w]
|
|
2149
2123
|
);
|
|
2150
|
-
return [
|
|
2124
|
+
return [A, N];
|
|
2151
2125
|
}
|
|
2152
|
-
function
|
|
2153
|
-
const
|
|
2154
|
-
return
|
|
2126
|
+
function _(f, w, A = []) {
|
|
2127
|
+
const S = c(), N = () => S.off(f, w), M = [S, f, ...A];
|
|
2128
|
+
return D.useEffect(() => (S.on(f, w), N), M), N;
|
|
2155
2129
|
}
|
|
2156
|
-
function
|
|
2157
|
-
const
|
|
2158
|
-
return
|
|
2159
|
-
const
|
|
2160
|
-
return
|
|
2161
|
-
}, [
|
|
2130
|
+
function V() {
|
|
2131
|
+
const f = c(), [w, A] = D.useState(f.state);
|
|
2132
|
+
return D.useEffect(() => {
|
|
2133
|
+
const S = (N) => A(N);
|
|
2134
|
+
return f.on("stateChange", S), () => f.off("stateChange", S);
|
|
2135
|
+
}, [f]), w;
|
|
2162
2136
|
}
|
|
2163
|
-
function
|
|
2164
|
-
const
|
|
2137
|
+
function C() {
|
|
2138
|
+
const f = c();
|
|
2165
2139
|
return {
|
|
2166
|
-
join: (
|
|
2167
|
-
quit: () =>
|
|
2140
|
+
join: (F) => f.$RTC.join(F),
|
|
2141
|
+
quit: () => f.$RTC.quit(),
|
|
2168
2142
|
shock: () => {
|
|
2169
|
-
var
|
|
2170
|
-
return (
|
|
2143
|
+
var F, J;
|
|
2144
|
+
return (J = (F = f.$RTC).shock) == null ? void 0 : J.call(F);
|
|
2171
2145
|
},
|
|
2172
|
-
toggleMicro: (
|
|
2173
|
-
detectMicro: () =>
|
|
2146
|
+
toggleMicro: (F) => f.$RTC.toggleMicro(F),
|
|
2147
|
+
detectMicro: () => f.$RTC.detectMicro()
|
|
2174
2148
|
};
|
|
2175
2149
|
}
|
|
2176
|
-
function k(
|
|
2177
|
-
const
|
|
2178
|
-
return
|
|
2179
|
-
}
|
|
2180
|
-
function
|
|
2181
|
-
const
|
|
2182
|
-
|
|
2183
|
-
),
|
|
2184
|
-
|
|
2185
|
-
const
|
|
2186
|
-
async (
|
|
2187
|
-
[
|
|
2150
|
+
function k(f, w, A = []) {
|
|
2151
|
+
const S = c(), N = () => S.$RTC.off(f, w), M = [S, f, ...A];
|
|
2152
|
+
return D.useEffect(() => (S.$RTC.on(f, w), N), M), N;
|
|
2153
|
+
}
|
|
2154
|
+
function U() {
|
|
2155
|
+
const f = c(), [w, A] = D.useState(
|
|
2156
|
+
f.selfInfo || {}
|
|
2157
|
+
), S = (M) => A(M);
|
|
2158
|
+
D.useEffect(() => (f.on("selfInfoUpdate", S), () => f.off("selfInfoUpdate", S)), [f]);
|
|
2159
|
+
const N = D.useCallback(
|
|
2160
|
+
async (M) => await f.setSelfInfo(M),
|
|
2161
|
+
[f]
|
|
2188
2162
|
);
|
|
2189
|
-
return [
|
|
2163
|
+
return [w, N];
|
|
2190
2164
|
}
|
|
2191
|
-
function
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2165
|
+
function P() {
|
|
2166
|
+
const f = c(), [w, A] = D.useState(
|
|
2167
|
+
f.snapshot
|
|
2194
2168
|
);
|
|
2195
|
-
return
|
|
2196
|
-
const
|
|
2197
|
-
return
|
|
2198
|
-
}),
|
|
2169
|
+
return D.useEffect(() => {
|
|
2170
|
+
const S = (N) => A(N);
|
|
2171
|
+
return f.on("keyframes", S), () => f.off("keyframes", S);
|
|
2172
|
+
}), w;
|
|
2199
2173
|
}
|
|
2200
|
-
function
|
|
2201
|
-
const
|
|
2202
|
-
return
|
|
2174
|
+
function fe() {
|
|
2175
|
+
const f = c(), [w, A] = D.useState(f.userList), S = (N) => A(N);
|
|
2176
|
+
return D.useEffect(() => (f.on("userListUpdate", S), () => f.off("userListUpdate", S)), [f]), w;
|
|
2203
2177
|
}
|
|
2204
2178
|
return {
|
|
2205
2179
|
live: e,
|
|
2206
|
-
jsBridge:
|
|
2207
|
-
LiveProvider:
|
|
2180
|
+
jsBridge: i,
|
|
2181
|
+
LiveProvider: n,
|
|
2208
2182
|
unsafe__useLiveInstance: u,
|
|
2209
|
-
unsafe__useRTCInstance:
|
|
2210
|
-
useConnect:
|
|
2211
|
-
useKeyframe:
|
|
2212
|
-
useKeyframeUpdateCallback:
|
|
2213
|
-
useLiveAction:
|
|
2214
|
-
useLiveEventCallback:
|
|
2215
|
-
useLiveState:
|
|
2216
|
-
useRTCAction:
|
|
2183
|
+
unsafe__useRTCInstance: g,
|
|
2184
|
+
useConnect: v,
|
|
2185
|
+
useKeyframe: I,
|
|
2186
|
+
useKeyframeUpdateCallback: E,
|
|
2187
|
+
useLiveAction: y,
|
|
2188
|
+
useLiveEventCallback: _,
|
|
2189
|
+
useLiveState: V,
|
|
2190
|
+
useRTCAction: C,
|
|
2217
2191
|
useRTCEventCallback: k,
|
|
2218
|
-
useSelfInfo:
|
|
2219
|
-
useKeyframesSnapshot:
|
|
2220
|
-
useUserList:
|
|
2192
|
+
useSelfInfo: U,
|
|
2193
|
+
useKeyframesSnapshot: P,
|
|
2194
|
+
useUserList: fe
|
|
2221
2195
|
};
|
|
2222
2196
|
}
|
|
2223
2197
|
export {
|
|
2224
|
-
|
|
2225
|
-
|
|
2198
|
+
rt as BrowserRTC,
|
|
2199
|
+
it as BrowserRTC4Chime,
|
|
2226
2200
|
ut as BuiltInRTCType,
|
|
2227
|
-
|
|
2201
|
+
H as BuiltinActionType,
|
|
2228
2202
|
q as BuiltinEventType,
|
|
2229
|
-
|
|
2230
|
-
|
|
2203
|
+
K as Command,
|
|
2204
|
+
Me as CoreRTC,
|
|
2231
2205
|
x as LiveState,
|
|
2232
|
-
|
|
2206
|
+
tr as MemUserStatus,
|
|
2233
2207
|
Z as MicroStatus,
|
|
2234
2208
|
lt as RTCJoinedInfoCodeEnum,
|
|
2235
2209
|
Q as RTCType,
|
|
2236
|
-
|
|
2210
|
+
er as UserStatus,
|
|
2237
2211
|
nt as VRWebViewRTC,
|
|
2238
|
-
|
|
2239
|
-
|
|
2212
|
+
ir as WebSocketCloseError,
|
|
2213
|
+
rr as WebSocketErrorType,
|
|
2240
2214
|
Le as WebSocketState,
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2215
|
+
br as createLive,
|
|
2216
|
+
jr as createLiveReact,
|
|
2217
|
+
Nr as parseLiveMsg,
|
|
2218
|
+
nr as parseWSClsErr
|
|
2245
2219
|
};
|