@cloudflare/realtimekit 1.2.0-staging.4 → 1.2.0
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/.config/build-types.sh +40 -0
- package/.config/vite.e2ee.es.ts +28 -0
- package/.config/vite.mock.es.ts +25 -3
- package/LICENSE.txt +201 -1
- package/README.md +3 -4
- package/dist/ClientMock.cjs.js +6 -0
- package/dist/ClientMock.d.ts +13 -0
- package/dist/{mock.es.js → ClientMock.es.js} +924 -2486
- package/dist/EncryptionManager.cjs.js +1 -0
- package/dist/EncryptionManager.d.ts +6036 -0
- package/dist/EncryptionManager.es.js +669 -0
- package/dist/dependencies.txt +772 -0
- package/dist/index.cjs.js +13 -21
- package/dist/index.d.ts +1307 -1167
- package/dist/index.es.js +10430 -12535
- package/dist/index.es5.js +29874 -0
- package/dist/index.iife.js +23 -0
- package/dist/index.rn.js +14 -21
- package/dist/ts3.4/dist/ClientMock.d.ts +11 -0
- package/dist/ts3.4/dist/EncryptionManager.d.ts +5980 -0
- package/dist/ts3.4/dist/index.d.ts +2294 -2155
- package/package.json +47 -10
- package/.config/rewrite-types.mjs +0 -30
- package/build-types.sh +0 -21
- package/dist/browser.js +0 -22
- package/dist/mock.cjs.js +0 -7
- package/dist/mock.d.ts +0 -1
- package/dist/ts3.4/dist/mock.d.ts +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Exit bash script if any of the commands fails
|
|
4
|
+
set -e
|
|
5
|
+
# Back up the original package.json
|
|
6
|
+
cp package.json package.json.bak
|
|
7
|
+
|
|
8
|
+
# Remove all dependencies starting with the prefix @dyte-in
|
|
9
|
+
# The imported types from these dependencies will be bundled
|
|
10
|
+
cat package.json.bak | jq '.dependencies |= delpaths([keys[] | select(contains("@dyte-in") or contains("@dyteinternals")) | [.]])' >package.json
|
|
11
|
+
|
|
12
|
+
function restore {
|
|
13
|
+
echo "Restoring package.json"
|
|
14
|
+
mv package.json.bak package.json
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Always run the restore function on exit
|
|
18
|
+
trap restore EXIT
|
|
19
|
+
|
|
20
|
+
npx tsup src/index.ts --external @dytesdk/mediasoup-client,@protobuf-ts/runtime,worker-timers,bowser,lodash-es,sdp-transform --dts-resolve --dts-only --format esm
|
|
21
|
+
|
|
22
|
+
npx tsup src/e2ee/EncryptionManager.ts --dts-resolve --dts-only --format esm
|
|
23
|
+
|
|
24
|
+
npx tsup src/mock/ClientMock.ts --dts-resolve --dts-only --format esm
|
|
25
|
+
|
|
26
|
+
OS="$(uname)"
|
|
27
|
+
SED_CMD=""
|
|
28
|
+
|
|
29
|
+
if [[ "$OS" == "Darwin" ]]; then
|
|
30
|
+
# macOS (BSD sed requires backup extension or '')
|
|
31
|
+
SED_CMD="sed -i '' '/#private;/d'"
|
|
32
|
+
else
|
|
33
|
+
# Linux (GNU sed)
|
|
34
|
+
SED_CMD="sed -i '/#private;/d'"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
echo $SED_CMD
|
|
38
|
+
|
|
39
|
+
# Find and process all .d.ts files
|
|
40
|
+
find dist/ -name '*.d.ts' -exec bash -c "$SED_CMD \"{}\"" \;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import pkg from '../package.json';
|
|
3
|
+
|
|
4
|
+
const publicDependencies = Object.keys(pkg.dependencies).filter(
|
|
5
|
+
(dependency) => !dependency.startsWith('@dyte-in/')
|
|
6
|
+
&& !dependency.startsWith('@dyteinternals/')
|
|
7
|
+
&& dependency !== 'lodash-es'
|
|
8
|
+
&& dependency !== 'axios'
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
build: {
|
|
13
|
+
emptyOutDir: false,
|
|
14
|
+
lib: {
|
|
15
|
+
entry: ['src/e2ee/EncryptionManager.ts'],
|
|
16
|
+
formats: ['cjs', 'es'],
|
|
17
|
+
fileName: (format, entryName) => `${entryName}.${format}.js`,
|
|
18
|
+
},
|
|
19
|
+
target: 'es2015',
|
|
20
|
+
rollupOptions: {
|
|
21
|
+
external: publicDependencies,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
envPrefix: 'RTK_',
|
|
25
|
+
server: {
|
|
26
|
+
port: 3000,
|
|
27
|
+
},
|
|
28
|
+
});
|
package/.config/vite.mock.es.ts
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
import { defineConfig } from 'vite';
|
|
2
|
+
import pkg from '../package.json';
|
|
3
|
+
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
|
4
|
+
|
|
5
|
+
const publicDependencies = Object.keys(pkg.dependencies).filter(
|
|
6
|
+
(dependency) => !dependency.startsWith('@dyte-in/')
|
|
7
|
+
&& !dependency.startsWith('@dyteinternals/')
|
|
8
|
+
&& dependency !== 'lodash-es'
|
|
9
|
+
&& dependency !== 'axios'
|
|
10
|
+
);
|
|
2
11
|
|
|
3
12
|
export default defineConfig({
|
|
4
13
|
build: {
|
|
5
14
|
emptyOutDir: false,
|
|
6
15
|
lib: {
|
|
7
|
-
entry: 'src/mock.ts',
|
|
16
|
+
entry: ['src/mock/ClientMock.ts'],
|
|
8
17
|
formats: ['cjs', 'es'],
|
|
9
|
-
fileName: (format) =>
|
|
18
|
+
fileName: (format, entryName) => `${entryName}.${format}.js`,
|
|
19
|
+
},
|
|
20
|
+
target: 'es2015',
|
|
21
|
+
rollupOptions: {
|
|
22
|
+
external: publicDependencies,
|
|
10
23
|
},
|
|
11
|
-
target: 'es2015'
|
|
12
24
|
},
|
|
25
|
+
envPrefix: 'RTK_',
|
|
26
|
+
server: {
|
|
27
|
+
port: 3000,
|
|
28
|
+
},
|
|
29
|
+
plugins: [
|
|
30
|
+
nodePolyfills({
|
|
31
|
+
// To add only specific polyfills, add them here. If no option is passed, adds all polyfills
|
|
32
|
+
include: ['events', 'buffer'],
|
|
33
|
+
})
|
|
34
|
+
],
|
|
13
35
|
});
|
package/LICENSE.txt
CHANGED
|
@@ -1 +1,201 @@
|
|
|
1
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Cloudflare
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
A real-time video and audio SDK for building custom, collaborative communication experiences.
|
|
10
10
|
<br />
|
|
11
|
-
<a href="https://
|
|
11
|
+
<a href="https://developers.cloudflare.com/realtime/realtimekit/"><strong>Explore the docs »</strong></a>
|
|
12
12
|
<br />
|
|
13
13
|
<br />
|
|
14
14
|
<a href="https://demo.realtime.cloudflare.com">View Demo</a>
|
|
@@ -56,7 +56,7 @@ npm install @cloudflare/realtimekit
|
|
|
56
56
|
<!-- USAGE EXAMPLES -->
|
|
57
57
|
## Usage
|
|
58
58
|
|
|
59
|
-
A `meeting` object can be created using the `
|
|
59
|
+
A `meeting` object can be created using the `RealtimeKitClient.init()` method.
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
62
|
const meeting = await RealtimeKit.init({
|
|
@@ -76,11 +76,10 @@ The `meeting` object is used for all interaction with Cloudflare's servers. For
|
|
|
76
76
|
await meeting.join();
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
_For more examples, please refer to the [
|
|
79
|
+
_For more examples, please refer to the [documentation](https://developers.cloudflare.com/realtime/realtimekit/)._
|
|
80
80
|
|
|
81
81
|
## About
|
|
82
82
|
|
|
83
83
|
`@cloudflare/realtimekit` is created & maintained by Cloudflare, Inc.
|
|
84
84
|
|
|
85
85
|
The names and logos are trademarks of Cloudflare, Inc.
|
|
86
|
-
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var ks=Object.defineProperty,vs=Object.defineProperties;var Rs=Object.getOwnPropertyDescriptors;var rn=Object.getOwnPropertySymbols;var _s=Object.prototype.hasOwnProperty,Ps=Object.prototype.propertyIsEnumerable;var Oe=(e,t,a)=>t in e?ks(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,qe=(e,t)=>{for(var a in t||(t={}))_s.call(t,a)&&Oe(e,a,t[a]);if(rn)for(var a of rn(t))Ps.call(t,a)&&Oe(e,a,t[a]);return e},on=(e,t)=>vs(e,Rs(t));var k=(e,t,a)=>(Oe(e,typeof t!="symbol"?t+"":t,a),a),an=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)};var j=(e,t,a)=>(an(e,t,"read from private field"),a?a.call(e):t.get(e)),se=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},$e=(e,t,a,p)=>(an(e,t,"write to private field"),p?p.call(e,a):t.set(e,a),a);var cn=(e,t,a)=>new Promise((p,u)=>{var m=P=>{try{h(a.next(P))}catch(b){u(b)}},g=P=>{try{h(a.throw(P))}catch(b){u(b)}},h=P=>P.done?p(P.value):Promise.resolve(P.value).then(m,g);h((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@protobuf-ts/runtime");var te=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Te={},ws={get exports(){return Te},set exports(e){Te=e}},J=typeof Reflect=="object"?Reflect:null,pn=J&&typeof J.apply=="function"?J.apply:function(t,a,p){return Function.prototype.apply.call(t,a,p)},ue;J&&typeof J.ownKeys=="function"?ue=J.ownKeys:Object.getOwnPropertySymbols?ue=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:ue=function(t){return Object.getOwnPropertyNames(t)};function Cs(e){console&&console.warn&&console.warn(e)}var vn=Number.isNaN||function(t){return t!==t};function v(){v.init.call(this)}ws.exports=v;Te.once=bs;v.EventEmitter=v;v.prototype._events=void 0;v.prototype._eventsCount=0;v.prototype._maxListeners=void 0;var dn=10;function ve(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return dn},set:function(e){if(typeof e!="number"||e<0||vn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");dn=e}});v.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};v.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||vn(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Rn(e){return e._maxListeners===void 0?v.defaultMaxListeners:e._maxListeners}v.prototype.getMaxListeners=function(){return Rn(this)};v.prototype.emit=function(t){for(var a=[],p=1;p<arguments.length;p++)a.push(arguments[p]);var u=t==="error",m=this._events;if(m!==void 0)u=u&&m.error===void 0;else if(!u)return!1;if(u){var g;if(a.length>0&&(g=a[0]),g instanceof Error)throw g;var h=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw h.context=g,h}var P=m[t];if(P===void 0)return!1;if(typeof P=="function")pn(P,this,a);else for(var b=P.length,Pe=Mn(P,b),p=0;p<b;++p)pn(Pe[p],this,a);return!0};function _n(e,t,a,p){var u,m,g;if(ve(a),m=e._events,m===void 0?(m=e._events=Object.create(null),e._eventsCount=0):(m.newListener!==void 0&&(e.emit("newListener",t,a.listener?a.listener:a),m=e._events),g=m[t]),g===void 0)g=m[t]=a,++e._eventsCount;else if(typeof g=="function"?g=m[t]=p?[a,g]:[g,a]:p?g.unshift(a):g.push(a),u=Rn(e),u>0&&g.length>u&&!g.warned){g.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=g.length,Cs(h)}return e}v.prototype.addListener=function(t,a){return _n(this,t,a,!1)};v.prototype.on=v.prototype.addListener;v.prototype.prependListener=function(t,a){return _n(this,t,a,!0)};function Ms(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Pn(e,t,a){var p={fired:!1,wrapFn:void 0,target:e,type:t,listener:a},u=Ms.bind(p);return u.listener=a,p.wrapFn=u,u}v.prototype.once=function(t,a){return ve(a),this.on(t,Pn(this,t,a)),this};v.prototype.prependOnceListener=function(t,a){return ve(a),this.prependListener(t,Pn(this,t,a)),this};v.prototype.removeListener=function(t,a){var p,u,m,g,h;if(ve(a),u=this._events,u===void 0)return this;if(p=u[t],p===void 0)return this;if(p===a||p.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete u[t],u.removeListener&&this.emit("removeListener",t,p.listener||a));else if(typeof p!="function"){for(m=-1,g=p.length-1;g>=0;g--)if(p[g]===a||p[g].listener===a){h=p[g].listener,m=g;break}if(m<0)return this;m===0?p.shift():Ss(p,m),p.length===1&&(u[t]=p[0]),u.removeListener!==void 0&&this.emit("removeListener",t,h||a)}return this};v.prototype.off=v.prototype.removeListener;v.prototype.removeAllListeners=function(t){var a,p,u;if(p=this._events,p===void 0)return this;if(p.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):p[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete p[t]),this;if(arguments.length===0){var m=Object.keys(p),g;for(u=0;u<m.length;++u)g=m[u],g!=="removeListener"&&this.removeAllListeners(g);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=p[t],typeof a=="function")this.removeListener(t,a);else if(a!==void 0)for(u=a.length-1;u>=0;u--)this.removeListener(t,a[u]);return this};function wn(e,t,a){var p=e._events;if(p===void 0)return[];var u=p[t];return u===void 0?[]:typeof u=="function"?a?[u.listener||u]:[u]:a?Es(u):Mn(u,u.length)}v.prototype.listeners=function(t){return wn(this,t,!0)};v.prototype.rawListeners=function(t){return wn(this,t,!1)};v.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Cn.call(e,t)};v.prototype.listenerCount=Cn;function Cn(e){var t=this._events;if(t!==void 0){var a=t[e];if(typeof a=="function")return 1;if(a!==void 0)return a.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?ue(this._events):[]};function Mn(e,t){for(var a=new Array(t),p=0;p<t;++p)a[p]=e[p];return a}function Ss(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Es(e){for(var t=new Array(e.length),a=0;a<t.length;++a)t[a]=e[a].listener||e[a];return t}function bs(e,t){return new Promise(function(a,p){function u(g){e.removeListener(t,m),p(g)}function m(){typeof e.removeListener=="function"&&e.removeListener("error",u),a([].slice.call(arguments))}Sn(e,t,m,{once:!0}),t!=="error"&&Ls(e,u,{once:!0})})}function Ls(e,t,a){typeof e.on=="function"&&Sn(e,"error",t,a)}function Sn(e,t,a,p){if(typeof e.on=="function")p.once?e.once(t,a):e.on(t,a);else if(typeof e.addEventListener=="function")e.addEventListener(t,function u(m){p.once&&e.removeEventListener(t,u),a(m)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}const xs=`
|
|
2
|
+
m=video 9 UDP/TLS/RTP/SAVPF 96
|
|
3
|
+
a=msid:stream-id track-id
|
|
4
|
+
m=audio 9 UDP/TLS/RTP/SAVPF 96
|
|
5
|
+
a=msid:stream-id track-id
|
|
6
|
+
`,un={track:null,transport:null,rtcpTransport:null,dtmf:{insertDTMF:()=>{},ontonechange:null,canInsertDTMF:!1,toneBuffer:"",addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0},transform:null,mid:null,getParameters:()=>({}),setParameters:()=>Promise.resolve({}),replaceTrack:()=>Promise.resolve({}),getStats:()=>Promise.resolve(new Map),setStreams:()=>{},setTransform:()=>Promise.resolve()};class Os extends Te{constructor(){super();k(this,"localDescription",null);k(this,"remoteDescription",null);k(this,"currentLocalDescription",null);k(this,"currentRemoteDescription",null);k(this,"pendingLocalDescription",null);k(this,"pendingRemoteDescription",null);k(this,"signalingState","stable");k(this,"iceConnectionState","new");k(this,"iceGatheringState","new");k(this,"connectionState","new");k(this,"canTrickleIceCandidates",null);k(this,"sctp",null);k(this,"senders",[]);k(this,"receivers",[]);k(this,"transceivers",[]);k(this,"onicecandidate",null);k(this,"onicecandidateerror",null);k(this,"onconnectionstatechange",null);k(this,"oniceconnectionstatechange",null);k(this,"onicegatheringstatechange",null);k(this,"onsignalingstatechange",null);k(this,"onnegotiationneeded",null);k(this,"ontrack",null);k(this,"ondatachannel",null);k(this,"addEventListener");k(this,"removeEventListener");this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}createOffer(){return Promise.resolve({sdp:xs,type:"offer"})}createAnswer(){return Promise.resolve({})}setLocalDescription(){return this.iceConnectionState="connected",this.iceGatheringState="complete",this.connectionState="connected",this.signalingState="stable",this.emit("iceconnectionstatechange"),Promise.resolve()}setRemoteDescription(){return Promise.resolve()}addIceCandidate(){return Promise.resolve()}getStats(){return Promise.resolve(new Map)}getConfiguration(){return{}}setConfiguration(){}close(){}createDataChannel(){return{close:()=>{},send:()=>{}}}addTrack(){return un}removeTrack(){}addTransceiver(){return{stop:()=>{},setDirection:()=>{},setCodecPreferences:()=>{},sender:un}}getTransceivers(){return[]}getSenders(){return[]}getReceivers(){return[]}restartIce(){}static generateCertificate(){return Promise.resolve({expires:Date.now(),getFingerprints:()=>[]})}}function qs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var En={exports:{}},C=En.exports={},A,I;function De(){throw new Error("setTimeout has not been defined")}function Ue(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?A=setTimeout:A=De}catch(e){A=De}try{typeof clearTimeout=="function"?I=clearTimeout:I=Ue}catch(e){I=Ue}})();function bn(e){if(A===setTimeout)return setTimeout(e,0);if((A===De||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch(t){try{return A.call(null,e,0)}catch(a){return A.call(this,e,0)}}}function $s(e){if(I===clearTimeout)return clearTimeout(e);if((I===Ue||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(e);try{return I(e)}catch(t){try{return I.call(null,e)}catch(a){return I.call(this,e)}}}var U=[],Z=!1,W,le=-1;function Ns(){!Z||!W||(Z=!1,W.length?U=W.concat(U):le=-1,U.length&&Ln())}function Ln(){if(!Z){var e=bn(Ns);Z=!0;for(var t=U.length;t;){for(W=U,U=[];++le<t;)W&&W[le].run();le=-1,t=U.length}W=null,Z=!1,$s(e)}}C.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];U.push(new xn(e,t)),U.length===1&&!Z&&bn(Ln)};function xn(e,t){this.fun=e,this.array=t}xn.prototype.run=function(){this.fun.apply(null,this.array)};C.title="browser";C.browser=!0;C.env={};C.argv=[];C.version="";C.versions={};function B(){}C.on=B;C.addListener=B;C.once=B;C.off=B;C.removeListener=B;C.removeAllListeners=B;C.emit=B;C.prependListener=B;C.prependOnceListener=B;C.listeners=function(e){return[]};C.binding=function(e){throw new Error("process.binding is not supported")};C.cwd=function(){return"/"};C.chdir=function(e){throw new Error("process.chdir is not supported")};C.umask=function(){return 0};var As=En.exports;const Ne=qs(As);function Is(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var re={},Ds={get exports(){return re},set exports(e){re=e}};(function(e,t){(function(a,p){p(t)})(te,function(a){var p=typeof window!="undefined"?window:typeof te!="undefined"?te:typeof self!="undefined"?self:{},u=function(s,c){if(c=c.split(":")[0],s=+s,!s)return!1;switch(c){case"http":case"ws":return s!==80;case"https":case"wss":return s!==443;case"ftp":return s!==21;case"gopher":return s!==70;case"file":return!1}return s!==0},m=Object.prototype.hasOwnProperty,g;function h(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch(s){return null}}function P(o){try{return encodeURIComponent(o)}catch(s){return null}}function b(o){for(var s=/([^=?#&]+)=?([^&]*)/g,c={},n;n=s.exec(o);){var i=h(n[1]),d=h(n[2]);i===null||d===null||i in c||(c[i]=d)}return c}function Pe(o,s){s=s||"";var c=[],n,i;typeof s!="string"&&(s="?");for(i in o)if(m.call(o,i)){if(n=o[i],!n&&(n===null||n===g||isNaN(n))&&(n=""),i=P(i),n=P(n),i===null||n===null)continue;c.push(i+"="+n)}return c.length?s+c.join("&"):""}var Qn=Pe,Xn=b,ie={stringify:Qn,parse:Xn},ze=/[\n\r\t]/g,es=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,ns=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,ss=/^[a-zA-Z]:/,ts=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function we(o){return(o||"").toString().replace(ts,"")}var Ce=[["#","hash"],["?","query"],function(s,c){return $(c.protocol)?s.replace(/\\/g,"/"):s},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Ye={hash:1,query:1};function Qe(o){var s;typeof window!="undefined"?s=window:typeof p!="undefined"?s=p:typeof self!="undefined"?s=self:s={};var c=s.location||{};o=o||c;var n={},i=typeof o,d;if(o.protocol==="blob:")n=new N(unescape(o.pathname),{});else if(i==="string"){n=new N(o,{});for(d in Ye)delete n[d]}else if(i==="object"){for(d in o)d in Ye||(n[d]=o[d]);n.slashes===void 0&&(n.slashes=es.test(o.href))}return n}function $(o){return o==="file:"||o==="ftp:"||o==="http:"||o==="https:"||o==="ws:"||o==="wss:"}function Xe(o,s){o=we(o),o=o.replace(ze,""),s=s||{};var c=ns.exec(o),n=c[1]?c[1].toLowerCase():"",i=!!c[2],d=!!c[3],l=0,T;return i?d?(T=c[2]+c[3]+c[4],l=c[2].length+c[3].length):(T=c[2]+c[4],l=c[2].length):d?(T=c[3]+c[4],l=c[3].length):T=c[4],n==="file:"?l>=2&&(T=T.slice(2)):$(n)?T=c[4]:n?i&&(T=T.slice(2)):l>=2&&$(s.protocol)&&(T=c[4]),{protocol:n,slashes:i||$(n),slashesCount:l,rest:T}}function rs(o,s){if(o==="")return s;for(var c=(s||"/").split("/").slice(0,-1).concat(o.split("/")),n=c.length,i=c[n-1],d=!1,l=0;n--;)c[n]==="."?c.splice(n,1):c[n]===".."?(c.splice(n,1),l++):l&&(n===0&&(d=!0),c.splice(n,1),l--);return d&&c.unshift(""),(i==="."||i==="..")&&c.push(""),c.join("/")}function N(o,s,c){if(o=we(o),o=o.replace(ze,""),!(this instanceof N))return new N(o,s,c);var n,i,d,l,T,y,_=Ce.slice(),S=typeof s,f=this,xe=0;for(S!=="object"&&S!=="string"&&(c=s,s=null),c&&typeof c!="function"&&(c=ie.parse),s=Qe(s),i=Xe(o||"",s),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&s.slashes,f.protocol=i.protocol||s.protocol||"",o=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||ss.test(o))||!i.slashes&&(i.protocol||i.slashesCount<2||!$(f.protocol)))&&(_[3]=[/(.*)/,"pathname"]);xe<_.length;xe++){if(l=_[xe],typeof l=="function"){o=l(o,f);continue}d=l[0],y=l[1],d!==d?f[y]=o:typeof d=="string"?(T=d==="@"?o.lastIndexOf(d):o.indexOf(d),~T&&(typeof l[2]=="number"?(f[y]=o.slice(0,T),o=o.slice(T+l[2])):(f[y]=o.slice(T),o=o.slice(0,T)))):(T=d.exec(o))&&(f[y]=T[1],o=o.slice(0,T.index)),f[y]=f[y]||n&&l[3]&&s[y]||"",l[4]&&(f[y]=f[y].toLowerCase())}c&&(f.query=c(f.query)),n&&s.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||s.pathname!=="")&&(f.pathname=rs(f.pathname,s.pathname)),f.pathname.charAt(0)!=="/"&&$(f.protocol)&&(f.pathname="/"+f.pathname),u(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(T=f.auth.indexOf(":"),~T?(f.username=f.auth.slice(0,T),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(T+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&$(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function os(o,s,c){var n=this;switch(o){case"query":typeof s=="string"&&s.length&&(s=(c||ie.parse)(s)),n[o]=s;break;case"port":n[o]=s,u(s,n.protocol)?s&&(n.host=n.hostname+":"+s):(n.host=n.hostname,n[o]="");break;case"hostname":n[o]=s,n.port&&(s+=":"+n.port),n.host=s;break;case"host":n[o]=s,/:\d+$/.test(s)?(s=s.split(":"),n.port=s.pop(),n.hostname=s.join(":")):(n.hostname=s,n.port="");break;case"protocol":n.protocol=s.toLowerCase(),n.slashes=!c;break;case"pathname":case"hash":if(s){var i=o==="pathname"?"/":"#";n[o]=s.charAt(0)!==i?i+s:s}else n[o]=s;break;case"username":case"password":n[o]=encodeURIComponent(s);break;case"auth":var d=s.indexOf(":");~d?(n.username=s.slice(0,d),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=s.slice(d+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(s))}for(var l=0;l<Ce.length;l++){var T=Ce[l];T[4]&&(n[T[1]]=n[T[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&$(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function as(o){(!o||typeof o!="function")&&(o=ie.stringify);var s,c=this,n=c.host,i=c.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var d=i+(c.protocol&&c.slashes||$(c.protocol)?"//":"");return c.username?(d+=c.username,c.password&&(d+=":"+c.password),d+="@"):c.password?(d+=":"+c.password,d+="@"):c.protocol!=="file:"&&$(c.protocol)&&!n&&c.pathname!=="/"&&(d+="@"),n[n.length-1]===":"&&(n+=":"),d+=n+c.pathname,s=typeof c.query=="object"?o(c.query):c.query,s&&(d+=s.charAt(0)!=="?"?"?"+s:s),c.hash&&(d+=c.hash),d}N.prototype={set:os,toString:as},N.extractProtocol=Xe,N.location=Qe,N.trimLeft=we,N.qs=ie;var Me=N;function ee(o,s){setTimeout(function(c){return o.call(c)},4,s)}function ce(o,s){typeof Ne!="undefined"&&Ne.env.NODE_ENV!=="test"&&console[o].call(null,s)}function Se(o,s){o===void 0&&(o=[]);var c=[];return o.forEach(function(n){s(n)||c.push(n)}),c}function is(o,s){o===void 0&&(o=[]);var c=[];return o.forEach(function(n){s(n)&&c.push(n)}),c}var K=function(){this.listeners={}};K.prototype.addEventListener=function(s,c){typeof c=="function"&&(Array.isArray(this.listeners[s])||(this.listeners[s]=[]),is(this.listeners[s],function(n){return n===c}).length===0&&this.listeners[s].push(c))},K.prototype.removeEventListener=function(s,c){var n=this.listeners[s];this.listeners[s]=Se(n,function(i){return i===c})},K.prototype.dispatchEvent=function(s){for(var c=this,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var d=s.type,l=this.listeners[d];return Array.isArray(l)?(l.forEach(function(T){n.length>0?T.apply(c,n):T.call(c,s)}),!0):!1};function G(o){var s=o.indexOf("?");return s>=0?o.slice(0,s):o}var D=function(){this.urlMap={}};D.prototype.attachWebSocket=function(s,c){var n=G(c),i=this.urlMap[n];if(i&&i.server&&i.websockets.indexOf(s)===-1)return i.websockets.push(s),i.server},D.prototype.addMembershipToRoom=function(s,c){var n=this.urlMap[G(s.url)];n&&n.server&&n.websockets.indexOf(s)!==-1&&(n.roomMemberships[c]||(n.roomMemberships[c]=[]),n.roomMemberships[c].push(s))},D.prototype.attachServer=function(s,c){var n=G(c),i=this.urlMap[n];if(!i)return this.urlMap[n]={server:s,websockets:[],roomMemberships:{}},s},D.prototype.serverLookup=function(s){var c=G(s),n=this.urlMap[c];if(n)return n.server},D.prototype.websocketsLookup=function(s,c,n){var i=G(s),d,l=this.urlMap[i];if(d=l?l.websockets:[],c){var T=l.roomMemberships[c];d=T||[]}return n?d.filter(function(y){return y!==n}):d},D.prototype.removeServer=function(s){delete this.urlMap[G(s)]},D.prototype.removeWebSocket=function(s,c){var n=G(c),i=this.urlMap[n];i&&(i.websockets=Se(i.websockets,function(d){return d===s}))},D.prototype.removeMembershipFromRoom=function(s,c){var n=this.urlMap[G(s.url)],i=n.roomMemberships[c];n&&i!==null&&(n.roomMemberships[c]=Se(i,function(d){return d===s}))};var w=new D,L={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},E={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},V=function(){};V.prototype.stopPropagation=function(){},V.prototype.stopImmediatePropagation=function(){},V.prototype.initEvent=function(s,c,n){s===void 0&&(s="undefined"),c===void 0&&(c=!1),n===void 0&&(n=!1),this.type=""+s,this.bubbles=Boolean(c),this.cancelable=Boolean(n)};var cs=function(o){function s(c,n){if(n===void 0&&(n={}),o.call(this),!c)throw new TypeError(E.EVENT_ERROR+" 1 argument required, but only 0 present.");if(typeof n!="object")throw new TypeError(E.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var i=n.bubbles,d=n.cancelable;this.type=""+c,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=d?Boolean(d):!1,this.cancelBubble=!1,this.bubbles=i?Boolean(i):!1}return o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(V),ps=function(o){function s(c,n){if(n===void 0&&(n={}),o.call(this),!c)throw new TypeError(E.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if(typeof n!="object")throw new TypeError(E.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var i=n.bubbles,d=n.cancelable,l=n.data,T=n.origin,y=n.lastEventId,_=n.ports;this.type=""+c,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=d?Boolean(d):!1,this.canncelBubble=!1,this.bubbles=i?Boolean(i):!1,this.origin=""+T,this.ports=typeof _=="undefined"?null:_,this.data=typeof l=="undefined"?null:l,this.lastEventId=""+(y||"")}return o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(V),ds=function(o){function s(c,n){if(n===void 0&&(n={}),o.call(this),!c)throw new TypeError(E.EVENT.CLOSE+" 1 argument required, but only 0 present.");if(typeof n!="object")throw new TypeError(E.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var i=n.bubbles,d=n.cancelable,l=n.code,T=n.reason,y=n.wasClean;this.type=""+c,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=d?Boolean(d):!1,this.cancelBubble=!1,this.bubbles=i?Boolean(i):!1,this.code=typeof l=="number"?parseInt(l,10):0,this.reason=""+(T||""),this.wasClean=y?Boolean(y):!1}return o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(V);function x(o){var s=o.type,c=o.target,n=new cs(s);return c&&(n.target=c,n.srcElement=c,n.currentTarget=c),n}function ne(o){var s=o.type,c=o.origin,n=o.data,i=o.target,d=new ps(s,{data:n,origin:c});return i&&(d.target=i,d.srcElement=i,d.currentTarget=i),d}function O(o){var s=o.code,c=o.reason,n=o.type,i=o.target,d=o.wasClean;d||(d=s===L.CLOSE_NORMAL||s===L.CLOSE_NO_STATUS);var l=new ds(n,{code:s,reason:c,wasClean:d});return i&&(l.target=i,l.srcElement=i,l.currentTarget=i),l}function en(o,s,c){o.readyState=M.CLOSING;var n=w.serverLookup(o.url),i=O({type:"close",target:o.target,code:s,reason:c});ee(function(){w.removeWebSocket(o,o.url),o.readyState=M.CLOSED,o.dispatchEvent(i),n&&n.dispatchEvent(i,n)},o)}function us(o,s,c){o.readyState=M.CLOSING;var n=w.serverLookup(o.url),i=O({type:"close",target:o.target,code:s,reason:c,wasClean:!1}),d=x({type:"error",target:o.target});ee(function(){w.removeWebSocket(o,o.url),o.readyState=M.CLOSED,o.dispatchEvent(d),o.dispatchEvent(i),n&&n.dispatchEvent(i,n)},o)}function pe(o){return Object.prototype.toString.call(o)!=="[object Blob]"&&!(o instanceof ArrayBuffer)&&(o=String(o)),o}var Ee=new WeakMap;function nn(o){if(Ee.has(o))return Ee.get(o);var s=new Proxy(o,{get:function(n,i){if(i==="close")return function(T){T===void 0&&(T={});var y=T.code||L.CLOSE_NORMAL,_=T.reason||"";en(s,y,_)};if(i==="send")return function(T){T=pe(T),o.dispatchEvent(ne({type:"message",data:T,origin:this.url,target:o}))};var d=function(l){return l==="message"?"server::"+l:l};return i==="on"?function(T,y){o.addEventListener(d(T),y)}:i==="off"?function(T,y){o.removeEventListener(d(T),y)}:i==="target"?o:n[i]}});return Ee.set(o,s),s}function ls(o){var s=encodeURIComponent(o).match(/%[89ABab]/g);return o.length+(s?s.length:0)}function ms(o){var s=new Me(o),c=s.pathname,n=s.protocol,i=s.hash;if(!o)throw new TypeError(E.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(c||(s.pathname="/"),n==="")throw new SyntaxError(E.CONSTRUCTOR_ERROR+" The URL '"+s.toString()+"' is invalid.");if(n!=="ws:"&&n!=="wss:")throw new SyntaxError(E.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+n+"' is not allowed.");if(i!=="")throw new SyntaxError(E.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+i+"'). Fragment identifiers are not allowed in WebSocket URLs.");return s.toString()}function Ts(o){if(o===void 0&&(o=[]),!Array.isArray(o)&&typeof o!="string")throw new SyntaxError(E.CONSTRUCTOR_ERROR+" The subprotocol '"+o.toString()+"' is invalid.");typeof o=="string"&&(o=[o]);var s=o.map(function(n){return{count:1,protocol:n}}).reduce(function(n,i){return n[i.protocol]=(n[i.protocol]||0)+i.count,n},{}),c=Object.keys(s).filter(function(n){return s[n]>1});if(c.length>0)throw new SyntaxError(E.CONSTRUCTOR_ERROR+" The subprotocol '"+c[0]+"' is duplicated.");return o}var M=function(o){function s(n,i){o.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=ms(n),i=Ts(i),this.protocol=i[0]||"",this.binaryType="blob",this.readyState=s.CONNECTING;var d=nn(this),l=w.attachWebSocket(d,this.url);ee(function(){if(this.readyState===s.CONNECTING)if(l)if(l.options.verifyClient&&typeof l.options.verifyClient=="function"&&!l.options.verifyClient())this.readyState=s.CLOSED,ce("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),w.removeWebSocket(d,this.url),this.dispatchEvent(x({type:"error",target:this})),this.dispatchEvent(O({type:"close",target:this,code:L.CLOSE_NORMAL}));else{if(l.options.selectProtocol&&typeof l.options.selectProtocol=="function"){var y=l.options.selectProtocol(i),_=y!=="",S=i.indexOf(y)!==-1;if(_&&!S){this.readyState=s.CLOSED,ce("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),w.removeWebSocket(d,this.url),this.dispatchEvent(x({type:"error",target:this})),this.dispatchEvent(O({type:"close",target:this,code:L.CLOSE_NORMAL}));return}this.protocol=y}this.readyState=s.OPEN,this.dispatchEvent(x({type:"open",target:this})),l.dispatchEvent(x({type:"connection"}),d)}else this.readyState=s.CLOSED,this.dispatchEvent(x({type:"error",target:this})),this.dispatchEvent(O({type:"close",target:this,code:L.CLOSE_NORMAL})),ce("error","WebSocket connection to '"+this.url+"' failed")},this)}o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s;var c={onopen:{},onmessage:{},onclose:{},onerror:{}};return c.onopen.get=function(){return this._onopen},c.onmessage.get=function(){return this._onmessage},c.onclose.get=function(){return this._onclose},c.onerror.get=function(){return this._onerror},c.onopen.set=function(n){this.removeEventListener("open",this._onopen),this._onopen=n,this.addEventListener("open",n)},c.onmessage.set=function(n){this.removeEventListener("message",this._onmessage),this._onmessage=n,this.addEventListener("message",n)},c.onclose.set=function(n){this.removeEventListener("close",this._onclose),this._onclose=n,this.addEventListener("close",n)},c.onerror.set=function(n){this.removeEventListener("error",this._onerror),this._onerror=n,this.addEventListener("error",n)},s.prototype.send=function(i){var d=this;if(this.readyState===s.CONNECTING)throw new Error("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state");var l=ne({type:"server::message",origin:this.url,data:pe(i)}),T=w.serverLookup(this.url);T&&ee(function(){d.dispatchEvent(l,i)},T)},s.prototype.close=function(i,d){if(i!==void 0&&(typeof i!="number"||i!==1e3&&(i<3e3||i>4999)))throw new TypeError(E.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+i+" is neither.");if(d!==void 0){var l=ls(d);if(l>123)throw new SyntaxError(E.CLOSE_ERROR+" The message must not be greater than 123 bytes.")}if(!(this.readyState===s.CLOSING||this.readyState===s.CLOSED)){var T=nn(this);this.readyState===s.CONNECTING?us(T,i||L.CLOSE_ABNORMAL,d):en(T,i||L.CLOSE_NO_STATUS,d)}},Object.defineProperties(s.prototype,c),s}(K);M.CONNECTING=0,M.prototype.CONNECTING=M.CONNECTING,M.OPEN=1,M.prototype.OPEN=M.OPEN,M.CLOSING=2,M.prototype.CLOSING=M.CLOSING,M.CLOSED=3,M.prototype.CLOSED=M.CLOSED;var H=function(o){function s(n,i){var d=this;n===void 0&&(n="socket.io"),i===void 0&&(i=""),o.call(this),this.binaryType="blob";var l=new Me(n);l.pathname||(l.pathname="/"),this.url=l.toString(),this.readyState=s.CONNECTING,this.protocol="",this.target=this,typeof i=="string"||typeof i=="object"&&i!==null?this.protocol=i:Array.isArray(i)&&i.length>0&&(this.protocol=i[0]);var T=w.attachWebSocket(this,this.url);ee(function(){T?(this.readyState=s.OPEN,T.dispatchEvent(x({type:"connection"}),T,this),T.dispatchEvent(x({type:"connect"}),T,this),this.dispatchEvent(x({type:"connect",target:this}))):(this.readyState=s.CLOSED,this.dispatchEvent(x({type:"error",target:this})),this.dispatchEvent(O({type:"close",target:this,code:L.CLOSE_NORMAL})),ce("error","Socket.io connection to '"+this.url+"' failed"))},this),this.addEventListener("close",function(y){d.dispatchEvent(O({type:"disconnect",target:y.target,code:y.code}))})}o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s;var c={broadcast:{}};return s.prototype.close=function(){if(this.readyState===s.OPEN){var i=w.serverLookup(this.url);return w.removeWebSocket(this,this.url),this.readyState=s.CLOSED,this.dispatchEvent(O({type:"close",target:this,code:L.CLOSE_NORMAL})),i&&i.dispatchEvent(O({type:"disconnect",target:this,code:L.CLOSE_NORMAL}),i),this}},s.prototype.disconnect=function(){return this.close()},s.prototype.emit=function(i){for(var d=[],l=arguments.length-1;l-- >0;)d[l]=arguments[l+1];if(this.readyState!==s.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var T=ne({type:i,origin:this.url,data:d}),y=w.serverLookup(this.url);return y&&y.dispatchEvent.apply(y,[T].concat(d)),this},s.prototype.send=function(i){return this.emit("message",i),this},c.broadcast.get=function(){if(this.readyState!==s.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var n=this,i=w.serverLookup(this.url);if(!i)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(l,T){return i.emit(l,T,{websockets:w.websocketsLookup(n.url,null,n)}),n},to:function(l){return i.to(l,n)},in:function(l){return i.in(l,n)}}},s.prototype.on=function(i,d){return this.addEventListener(i,d),this},s.prototype.off=function(i,d){this.removeEventListener(i,d)},s.prototype.hasListeners=function(i){var d=this.listeners[i];return Array.isArray(d)?!!d.length:!1},s.prototype.join=function(i){w.addMembershipToRoom(this,i)},s.prototype.leave=function(i){w.removeMembershipFromRoom(this,i)},s.prototype.to=function(i){return this.broadcast.to(i)},s.prototype.in=function(){return this.to.apply(null,arguments)},s.prototype.dispatchEvent=function(i){for(var d=this,l=[],T=arguments.length-1;T-- >0;)l[T]=arguments[T+1];var y=i.type,_=this.listeners[y];if(!Array.isArray(_))return!1;_.forEach(function(S){l.length>0?S.apply(d,l):S.call(d,i.data?i.data:i)})},Object.defineProperties(s.prototype,c),s}(K);H.CONNECTING=0,H.OPEN=1,H.CLOSING=2,H.CLOSED=3;var be=function(s,c){return new H(s,c)};be.connect=function(s,c){return be(s,c)};var gs=function(o){return o.reduce(function(s,c){return s.indexOf(c)>-1?s:s.concat(c)},[])};function sn(){return typeof window!="undefined"?window:typeof Ne=="object"&&typeof Is=="function"&&typeof te=="object"?te:this}var tn={mock:!0,verifyClient:null,selectProtocol:null},Le=function(o){function s(c,n){n===void 0&&(n=tn),o.call(this);var i=new Me(c);i.pathname||(i.pathname="/"),this.url=i.toString(),this.originalWebSocket=null;var d=w.attachServer(this,this.url);if(!d)throw this.dispatchEvent(x({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},tn,n),this.options.mock&&this.mockWebsocket()}return o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.mockWebsocket=function(){var n=sn();this.originalWebSocket=n.WebSocket,n.WebSocket=M},s.prototype.restoreWebsocket=function(){var n=sn();this.originalWebSocket!==null&&(n.WebSocket=this.originalWebSocket),this.originalWebSocket=null},s.prototype.stop=function(n){n===void 0&&(n=function(){}),this.options.mock&&this.restoreWebsocket(),w.removeServer(this.url),typeof n=="function"&&n()},s.prototype.on=function(n,i){this.addEventListener(n,i)},s.prototype.off=function(n,i){this.removeEventListener(n,i)},s.prototype.close=function(n){n===void 0&&(n={});var i=n.code,d=n.reason,l=n.wasClean,T=w.websocketsLookup(this.url);w.removeServer(this.url),T.forEach(function(y){y.readyState=M.CLOSED,y.dispatchEvent(O({type:"close",target:y.target,code:i||L.CLOSE_NORMAL,reason:d||"",wasClean:l}))}),this.dispatchEvent(O({type:"close"}),this)},s.prototype.emit=function(n,i,d){var l=this;d===void 0&&(d={});var T=d.websockets;T||(T=w.websocketsLookup(this.url));var y;typeof d!="object"||arguments.length>3?(i=Array.prototype.slice.call(arguments,1,arguments.length),y=i.map(function(_){return pe(_)})):y=pe(i),T.forEach(function(_){var S=_ instanceof H?i:y;Array.isArray(S)?_.dispatchEvent.apply(_,[ne({type:n,data:S,origin:l.url,target:_.target})].concat(S)):_.dispatchEvent(ne({type:n,data:S,origin:l.url,target:_.target}))})},s.prototype.clients=function(){return w.websocketsLookup(this.url)},s.prototype.to=function(n,i,d){var l=this;d===void 0&&(d=[]);var T=this,y=gs(d.concat(w.websocketsLookup(this.url,n,i)));return{to:function(_,S){return l.to.call(l,_,S,y)},emit:function(S,f){T.emit(S,f,{websockets:y})}}},s.prototype.in=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return this.to.apply(null,n)},s.prototype.simulate=function(n){var i=w.websocketsLookup(this.url);n==="error"&&i.forEach(function(d){d.readyState=M.CLOSED,d.dispatchEvent(x({type:"error",target:d.target}))})},s}(K);Le.of=function(s){return new Le(s)};var fs=Le,ys=M,hs=be;a.Server=fs,a.WebSocket=ys,a.SocketIO=hs,Object.defineProperty(a,"__esModule",{value:!0})})})(Ds,re);var Be={},Us={get exports(){return Be},set exports(e){Be=e}},z=typeof Reflect=="object"?Reflect:null,ln=z&&typeof z.apply=="function"?z.apply:function(e,t,a){return Function.prototype.apply.call(e,t,a)},me;z&&typeof z.ownKeys=="function"?me=z.ownKeys:Object.getOwnPropertySymbols?me=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:me=function(e){return Object.getOwnPropertyNames(e)};function Bs(e){console&&console.warn&&console.warn(e)}var On=Number.isNaN||function(e){return e!==e};function R(){R.init.call(this)}Us.exports=R;Be.once=Fs;R.EventEmitter=R;R.prototype._events=void 0;R.prototype._eventsCount=0;R.prototype._maxListeners=void 0;var mn=10;function Re(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(R,"defaultMaxListeners",{enumerable:!0,get:function(){return mn},set:function(e){if(typeof e!="number"||e<0||On(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");mn=e}});R.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};R.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||On(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function qn(e){return e._maxListeners===void 0?R.defaultMaxListeners:e._maxListeners}R.prototype.getMaxListeners=function(){return qn(this)};R.prototype.emit=function(e){for(var t=[],a=1;a<arguments.length;a++)t.push(arguments[a]);var p=e==="error",u=this._events;if(u!==void 0)p=p&&u.error===void 0;else if(!p)return!1;if(p){var m;if(t.length>0&&(m=t[0]),m instanceof Error)throw m;var g=new Error("Unhandled error."+(m?" ("+m.message+")":""));throw g.context=m,g}var h=u[e];if(h===void 0)return!1;if(typeof h=="function")ln(h,this,t);else for(var P=h.length,b=Dn(h,P),a=0;a<P;++a)ln(b[a],this,t);return!0};function $n(e,t,a,p){var u,m,g;if(Re(a),m=e._events,m===void 0?(m=e._events=Object.create(null),e._eventsCount=0):(m.newListener!==void 0&&(e.emit("newListener",t,a.listener?a.listener:a),m=e._events),g=m[t]),g===void 0)g=m[t]=a,++e._eventsCount;else if(typeof g=="function"?g=m[t]=p?[a,g]:[g,a]:p?g.unshift(a):g.push(a),u=qn(e),u>0&&g.length>u&&!g.warned){g.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=g.length,Bs(h)}return e}R.prototype.addListener=function(e,t){return $n(this,e,t,!1)};R.prototype.on=R.prototype.addListener;R.prototype.prependListener=function(e,t){return $n(this,e,t,!0)};function Gs(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Nn(e,t,a){var p={fired:!1,wrapFn:void 0,target:e,type:t,listener:a},u=Gs.bind(p);return u.listener=a,p.wrapFn=u,u}R.prototype.once=function(e,t){return Re(t),this.on(e,Nn(this,e,t)),this};R.prototype.prependOnceListener=function(e,t){return Re(t),this.prependListener(e,Nn(this,e,t)),this};R.prototype.removeListener=function(e,t){var a,p,u,m,g;if(Re(t),p=this._events,p===void 0)return this;if(a=p[e],a===void 0)return this;if(a===t||a.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete p[e],p.removeListener&&this.emit("removeListener",e,a.listener||t));else if(typeof a!="function"){for(u=-1,m=a.length-1;m>=0;m--)if(a[m]===t||a[m].listener===t){g=a[m].listener,u=m;break}if(u<0)return this;u===0?a.shift():js(a,u),a.length===1&&(p[e]=a[0]),p.removeListener!==void 0&&this.emit("removeListener",e,g||t)}return this};R.prototype.off=R.prototype.removeListener;R.prototype.removeAllListeners=function(e){var t,a,p;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[e]),this;if(arguments.length===0){var u=Object.keys(a),m;for(p=0;p<u.length;++p)m=u[p],m!=="removeListener"&&this.removeAllListeners(m);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=a[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(p=t.length-1;p>=0;p--)this.removeListener(e,t[p]);return this};function An(e,t,a){var p=e._events;if(p===void 0)return[];var u=p[t];return u===void 0?[]:typeof u=="function"?a?[u.listener||u]:[u]:a?Ws(u):Dn(u,u.length)}R.prototype.listeners=function(e){return An(this,e,!0)};R.prototype.rawListeners=function(e){return An(this,e,!1)};R.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):In.call(e,t)};R.prototype.listenerCount=In;function In(e){var t=this._events;if(t!==void 0){var a=t[e];if(typeof a=="function")return 1;if(a!==void 0)return a.length}return 0}R.prototype.eventNames=function(){return this._eventsCount>0?me(this._events):[]};function Dn(e,t){for(var a=new Array(t),p=0;p<t;++p)a[p]=e[p];return a}function js(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Ws(e){for(var t=new Array(e.length),a=0;a<t.length;++a)t[a]=e[a].listener||e[a];return t}function Fs(e,t){return new Promise(function(a,p){function u(g){e.removeListener(t,m),p(g)}function m(){typeof e.removeListener=="function"&&e.removeListener("error",u),a([].slice.call(arguments))}Un(e,t,m,{once:!0}),t!=="error"&&Ks(e,u,{once:!0})})}function Ks(e,t,a){typeof e.on=="function"&&Un(e,"error",t,a)}function Un(e,t,a,p){if(typeof e.on=="function")p.once?e.once(t,a):e.on(t,a);else if(typeof e.addEventListener=="function")e.addEventListener(t,function u(m){p.once&&e.removeEventListener(t,u),a(m)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}class Vs extends r.MessageType{constructor(){super("message.v1.SocketMessage",[{no:1,name:"event",kind:"scalar",T:13},{no:2,name:"id",kind:"scalar",opt:!0,T:9},{no:3,name:"payload",kind:"scalar",opt:!0,T:12},{no:4,name:"metadata",kind:"scalar",opt:!0,T:12}])}}const Tn=new Vs;var ge;(function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER"})(ge||(ge={}));var Ge;(function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO"})(Ge||(Ge={}));class Hs extends r.MessageType{constructor(){super("media.Codec",[{no:1,name:"channels",kind:"scalar",opt:!0,T:5},{no:2,name:"clock_rate",kind:"scalar",T:5},{no:3,name:"mime_type",kind:"scalar",T:9},{no:4,name:"sdp_fmtp_line",kind:"scalar",opt:!0,T:9},{no:5,name:"payload_type",kind:"scalar",opt:!0,T:13}])}}const Bn=new Hs;class Js extends r.MessageType{constructor(){super("media.HeaderExtension",[{no:1,name:"direction",kind:"scalar",opt:!0,T:9},{no:2,name:"uri",kind:"scalar",T:9}])}}const Zs=new Js;class zs extends r.MessageType{constructor(){super("media.Fingerprint",[{no:1,name:"algorithm",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}}new zs;class Ys extends r.MessageType{constructor(){super("media.SessionDescription",[{no:1,name:"target",kind:"enum",T:()=>["media.Target",ge]},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"sdp",kind:"scalar",T:9}])}}const q=new Ys;class Qs extends r.MessageType{constructor(){super("media.ProducerPayload",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"msid",kind:"scalar",T:9},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const Xs=new Qs;class et extends r.MessageType{constructor(){super("media.CreateTransportRequest",[{no:1,name:"consuming",kind:"scalar",T:8},{no:2,name:"force_tcp",kind:"scalar",opt:!0,T:8},{no:3,name:"description",kind:"message",T:()=>q},{no:4,name:"private_ice",kind:"scalar",opt:!0,T:8},{no:5,name:"producers",kind:"message",repeat:1,T:()=>Xs}])}}new et;class nt extends r.MessageType{constructor(){super("media.AudioActivityRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"energy",kind:"scalar",T:5},{no:3,name:"silent",kind:"scalar",T:8}])}}new nt;class st extends r.MessageType{constructor(){super("media.CreateTransportResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>q},{no:3,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:4,name:"producer_ids",kind:"scalar",repeat:2,T:9}])}}const Gn=new st;class tt extends r.MessageType{constructor(){super("media.RenegotiateRequest",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>q}])}}new tt;class rt extends r.MessageType{constructor(){super("media.RenegotiateResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>q}])}}new rt;class ot extends r.MessageType{constructor(){super("media.NestedScore",[{no:1,name:"encoding_idx",kind:"scalar",T:5},{no:2,name:"rid",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5},{no:4,name:"ssrc",kind:"scalar",T:3,L:0}])}}const at=new ot;class it extends r.MessageType{constructor(){super("media.ProducerTrack",[{no:1,name:"track_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"stream_id",kind:"scalar",T:9}])}}const ct=new it;class pt extends r.MessageType{constructor(){super("media.ProducerEntry",[{no:1,name:"producing_transport_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9}])}}new pt;class dt extends r.MessageType{constructor(){super("media.ConsumerEntry",[{no:1,name:"consuming_transport_id",kind:"scalar",T:9},{no:2,name:"consumer_id",kind:"scalar",T:9}])}}new dt;class ut extends r.MessageType{constructor(){super("media.ProducerState",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"kind",kind:"enum",T:()=>["media.ProducerKind",Ge]},{no:3,name:"pause",kind:"scalar",T:8},{no:4,name:"screen_share",kind:"scalar",T:8},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"codec",kind:"message",T:()=>Bn}])}}const ae=new ut;class lt extends r.MessageType{constructor(){super("media.ConsumerState",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>ae},{no:3,name:"producer_track",kind:"message",T:()=>ct},{no:4,name:"error_code",kind:"scalar",opt:!0,T:9}])}}const mt=new lt;class Tt extends r.MessageType{constructor(){super("media.ProducerIdToConsumerMap",[{no:1,name:"map",kind:"map",K:9,V:{kind:"message",T:()=>mt}}])}}const jn=new Tt;class gt extends r.MessageType{constructor(){super("media.PeerRtpCapabilitites",[{no:1,name:"sender",kind:"message",T:()=>fn},{no:2,name:"receiver",kind:"message",T:()=>fn}])}}const Wn=new gt;class ft extends r.MessageType{constructor(){super("media.RtpCapability",[{no:1,name:"codecs",kind:"message",repeat:1,T:()=>Bn},{no:2,name:"header_extensions",kind:"message",repeat:1,T:()=>Zs}])}}const gn=new ft;class yt extends r.MessageType{constructor(){super("media.RtpCapabilitites",[{no:1,name:"audio",kind:"message",T:()=>gn},{no:2,name:"video",kind:"message",T:()=>gn}])}}const fn=new yt;class ht extends r.MessageType{constructor(){super("media.PreferredCodec",[{no:1,name:"audio",kind:"scalar",opt:!0,T:9},{no:2,name:"video",kind:"scalar",opt:!0,T:9}])}}const kt=new ht;class vt extends r.MessageType{constructor(){super("media.Simulcast",[{no:1,name:"preferred_rid",kind:"scalar",opt:!0,T:9},{no:2,name:"priority_ordering",kind:"scalar",opt:!0,T:9},{no:3,name:"rid_not_available",kind:"scalar",opt:!0,T:9}])}}const Fn=new vt;class Rt extends r.MessageType{constructor(){super("media.edge.GeoLocation",[{no:1,name:"latitude",kind:"scalar",T:2},{no:2,name:"longitude",kind:"scalar",T:2},{no:3,name:"region",kind:"scalar",opt:!0,T:9}])}}const _t=new Rt;class Pt extends r.MessageType{constructor(){super("media.edge.PeerJoinRequest",[{no:1,name:"display_name",kind:"scalar",opt:!0,T:9},{no:2,name:"prejoined",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:5,name:"preset",kind:"scalar",opt:!0,T:12},{no:6,name:"user_id",kind:"scalar",opt:!0,T:9},{no:7,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:8,name:"location",kind:"message",T:()=>_t},{no:9,name:"capabilities",kind:"message",T:()=>Wn}])}}new Pt;class wt extends r.MessageType{constructor(){super("media.edge.PeerJoinCompleteRequest",[])}}new wt;class Ct extends r.MessageType{constructor(){super("media.edge.PeerLeaveRequest",[{no:1,name:"close_room",kind:"scalar",T:8}])}}new Ct;class Mt extends r.MessageType{constructor(){super("media.edge.ConsumeMultipleProducerRequest",[{no:1,name:"producer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8}])}}new Mt;class St extends r.MessageType{constructor(){super("media.edge.ConsumePeerRequest",[{no:1,name:"producing_peer_id",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8},{no:3,name:"producer_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preferred_codec",kind:"message",T:()=>kt},{no:5,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:6,name:"simulcast",kind:"message",T:()=>Fn}])}}const Et=new St;class bt extends r.MessageType{constructor(){super("media.edge.ConsumePeersRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Et},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new bt;class Lt extends r.MessageType{constructor(){super("media.edge.UpdateConsumerSimulcastConfigRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"simulcast",kind:"message",T:()=>Fn},{no:3,name:"producing_transport_id",kind:"scalar",T:9},{no:4,name:"mid",kind:"scalar",T:9}])}}const xt=new Lt;class Ot extends r.MessageType{constructor(){super("media.edge.UpdateConsumersSimulcastConfigRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>xt},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Ot;class qt extends r.MessageType{constructor(){super("media.edge.ProducerCreateRequest",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"description",kind:"message",T:()=>q},{no:5,name:"msid",kind:"scalar",T:9},{no:6,name:"app_data",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new qt;class $t extends r.MessageType{constructor(){super("media.edge.SelectedPeersRequest",[])}}new $t;class Nt extends r.MessageType{constructor(){super("media.edge.GlobalPeerPinningRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Nt;class At extends r.MessageType{constructor(){super("media.edge.ProducerToggleRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new At;class It extends r.MessageType{constructor(){super("media.edge.ConsumerToggleRequest",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new It;class Dt extends r.MessageType{constructor(){super("media.edge.ProducerCloseRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>q},{no:3,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new Dt;class Ut extends r.MessageType{constructor(){super("media.edge.ConsumerCloseRequest",[{no:1,name:"consumer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"description",kind:"message",T:()=>q},{no:3,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Ut;class Bt extends r.MessageType{constructor(){super("media.edge.KickPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Bt;class Gt extends r.MessageType{constructor(){super("media.edge.KickAllPeersRequest",[{no:1,name:"propagate_kick_across_rooms",kind:"scalar",T:8}])}}new Gt;class jt extends r.MessageType{constructor(){super("media.edge.PeerDisplayNameEditRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new jt;class Wt extends r.MessageType{constructor(){super("media.edge.HostMediaControlForPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"video",kind:"scalar",T:8},{no:4,name:"scree_share",kind:"scalar",T:8}])}}new Wt;class Ft extends r.MessageType{constructor(){super("media.edge.HostMediaControlForAllPeerRequest",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8}])}}new Ft;class Kt extends r.MessageType{constructor(){super("media.edge.GetRoomStateResponse",[{no:1,name:"display_title",kind:"scalar",T:9},{no:2,name:"locked_mode",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"room_name",kind:"scalar",T:9},{no:5,name:"current_peer_id",kind:"scalar",T:9},{no:6,name:"is_recording",kind:"scalar",opt:!0,T:8},{no:7,name:"recorder_participant_id",kind:"scalar",opt:!0,T:9},{no:8,name:"pinned_peer_ids",kind:"scalar",repeat:2,T:9}])}}const Vt=new Kt;class Ht extends r.MessageType{constructor(){super("media.edge.ErrorResponse",[{no:1,name:"error_message",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:5}])}}new Ht;class Jt extends r.MessageType{constructor(){super("media.edge.EmptyResponse",[])}}new Jt;class Zt extends r.MessageType{constructor(){super("media.edge.RoomParticipants",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"producer_states",kind:"message",repeat:1,T:()=>ae},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"user_id",kind:"scalar",opt:!0,T:9},{no:5,name:"capabilities",kind:"message",T:()=>Wn}])}}const Kn=new Zt;class zt extends r.MessageType{constructor(){super("media.edge.SelectedPeersResponse",[{no:1,name:"audio_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"compulsory_peers",kind:"scalar",repeat:2,T:9}])}}const Yt=new zt;class Qt extends r.MessageType{constructor(){super("media.edge.SelectedPeersDiffEntry",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"priority",kind:"scalar",T:5}])}}const Xt=new Qt;class er extends r.MessageType{constructor(){super("media.edge.SelectedPeersDiffResponse",[{no:1,name:"entries",kind:"message",repeat:1,T:()=>Xt}])}}new er;class nr extends r.MessageType{constructor(){super("media.edge.PeerJoinResponse",[])}}new nr;class sr extends r.MessageType{constructor(){super("media.edge.PeerJoinCompleteResponse",[{no:1,name:"room_state",kind:"message",T:()=>Vt},{no:2,name:"participants",kind:"message",repeat:1,T:()=>Kn},{no:3,name:"selected_peers",kind:"message",T:()=>Yt},{no:4,name:"max_preferred_streams",kind:"scalar",T:5}])}}const tr=new sr;class rr extends r.MessageType{constructor(){super("media.edge.PeerLeaveResponse",[{no:1,name:"closed",kind:"scalar",T:8}])}}new rr;class or extends r.MessageType{constructor(){super("media.edge.ConsumeMultipleProducerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>jn}])}}new or;class ar extends r.MessageType{constructor(){super("media.edge.ConsumePeerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>jn},{no:3,name:"description",kind:"message",T:()=>q}])}}new ar;class ir extends r.MessageType{constructor(){super("media.edge.ProducerCreateResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"producer_id",kind:"scalar",T:9},{no:4,name:"description",kind:"message",T:()=>q}])}}const cr=new ir;class pr extends r.MessageType{constructor(){super("media.edge.ProducerScoreResponse",[{no:1,name:"responseid",kind:"scalar",T:9},{no:2,name:"score",kind:"message",T:()=>at}])}}new pr;class dr extends r.MessageType{constructor(){super("media.edge.ActiveSpeakerResponse",[{no:1,name:"responsepeer_id",kind:"scalar",T:9},{no:2,name:"volume",kind:"scalar",T:5}])}}new dr;class ur extends r.MessageType{constructor(){super("media.edge.NoActiveSpeakerResponse",[])}}new ur;class lr extends r.MessageType{constructor(){super("media.edge.ProducerToggleResponse",[])}}new lr;class mr extends r.MessageType{constructor(){super("media.edge.ConsumerToggleResponse",[])}}new mr;class Tr extends r.MessageType{constructor(){super("media.edge.ProducerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>q}])}}new Tr;class gr extends r.MessageType{constructor(){super("media.edge.ConsumerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>q}])}}new gr;class fr extends r.MessageType{constructor(){super("media.edge.GlobalPeerPinningResponse",[])}}new fr;class yr extends r.MessageType{constructor(){super("media.edge.KickPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new yr;class hr extends r.MessageType{constructor(){super("media.edge.KickAllPeersResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new hr;class kr extends r.MessageType{constructor(){super("media.edge.HostMediaControlForPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new kr;class vr extends r.MessageType{constructor(){super("media.edge.HostMediaControlForAllPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new vr;class Rr extends r.MessageType{constructor(){super("media.edge.PeerDisplayNameEditResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Rr;class _r extends r.MessageType{constructor(){super("media.edge.PeerJoinBroadcastResponse",[{no:1,name:"participant",kind:"message",T:()=>Kn}])}}new _r;class Pr extends r.MessageType{constructor(){super("media.edge.TrackSubscriptionKind",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8}])}}const yn=new Pr;class wr extends r.MessageType{constructor(){super("media.edge.TrackSubscription",[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"webcam",kind:"message",T:()=>yn},{no:3,name:"screenshare",kind:"message",T:()=>yn}])}}const Cr=new wr;class Mr extends r.MessageType{constructor(){super("media.edge.PeerProducingTransportCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"transport_details",kind:"message",T:()=>Gn},{no:3,name:"track_subscriptions",kind:"message",repeat:1,T:()=>Cr}])}}new Mr;class Sr extends r.MessageType{constructor(){super("media.edge.PeerProducerCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>ae}])}}new Sr;class Er extends r.MessageType{constructor(){super("media.edge.PeerProducerToggleBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>ae},{no:3,name:"initiator_participant_id",kind:"scalar",opt:!0,T:9}])}}new Er;class br extends r.MessageType{constructor(){super("media.edge.PeerProducerCloseBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>ae}])}}new br;class Lr extends r.MessageType{constructor(){super("media.edge.PeerLeaveBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Lr;class xr extends r.MessageType{constructor(){super("media.edge.GlobalPeerPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new xr;class Or extends r.MessageType{constructor(){super("media.edge.GlobalPeerUnPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Or;class qr extends r.MessageType{constructor(){super("media.edge.RecordingStartedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new qr;class $r extends r.MessageType{constructor(){super("media.edge.RecordingStoppedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new $r;class Nr extends r.MessageType{constructor(){super("media.edge.PeerDisplayNameEditBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Nr;class Ar extends r.MessageType{constructor(){super("media.edge.PeerPingRequestBroadcastResponse",[{no:1,name:"password",kind:"scalar",T:9}])}}new Ar;class Ir extends r.MessageType{constructor(){super("media.edge.MediaRoomTerminationBroadcastResponse",[{no:1,name:"reason",kind:"scalar",T:9}])}}new Ir;class Dr extends r.MessageType{constructor(){super("socket.ai.MeetingTranscript",[{no:1,name:"meeting_id",kind:"scalar",T:9},{no:2,name:"transcript",kind:"scalar",T:9},{no:3,name:"is_partial",kind:"scalar",T:8}])}}new Dr;class Ur extends r.MessageType{constructor(){super("socket.api.BaseSocketHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9}])}}new Ur;class Br extends r.MessageType{constructor(){super("socket.api.ErrorMessage",[{no:1,name:"code",kind:"scalar",opt:!0,T:5},{no:2,name:"message",kind:"scalar",T:9}])}}new Br;var fe;(function(e){e[e.BROWSER=0]="BROWSER",e[e.TRACK=1]="TRACK",e[e.COMPOSITE=2]="COMPOSITE"})(fe||(fe={}));var oe;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ON_STAGE=1]="ON_STAGE",e[e.APPROVED_STAGE=2]="APPROVED_STAGE",e[e.REQUESTED_STAGE=3]="REQUESTED_STAGE",e[e.OFF_STAGE=4]="OFF_STAGE"})(oe||(oe={}));var je;(function(e){e[e.NONE=0]="NONE",e[e.RECORDER=1]="RECORDER",e[e.LIVESTREAMER=2]="LIVESTREAMER"})(je||(je={}));var We;(function(e){e[e.PEERS=0]="PEERS",e[e.ROOMS=1]="ROOMS"})(We||(We={}));var Fe;(function(e){e[e.HIVE=0]="HIVE",e[e.CHAT=1]="CHAT",e[e.PING=2]="PING"})(Fe||(Fe={}));class Gr extends r.MessageType{constructor(){super("socket.room.PeerFlags",[{no:1,name:"preset_name",kind:"scalar",T:9},{no:2,name:"recorder_type",kind:"scalar",T:9},{no:3,name:"hidden_participant",kind:"scalar",T:8}])}}const jr=new Gr;class Wr extends r.MessageType{constructor(){super("socket.room.Peer",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",oe,"STAGE_TYPE_"]},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:7,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:8,name:"waitlisted",kind:"scalar",T:8},{no:9,name:"flags",kind:"message",T:()=>jr}])}}const _e=new Wr;class Fr extends r.MessageType{constructor(){super("socket.room.PeerInfoResponse",[{no:1,name:"peer",kind:"message",T:()=>_e}])}}const hn=new Fr;class Kr extends r.MessageType{constructor(){super("socket.room.PeerStatusUpdate",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",oe,"STAGE_TYPE_"]}])}}new Kr;class Vr extends r.MessageType{constructor(){super("socket.room.RoomPeersInfoRequest",[{no:1,name:"seach_query",kind:"scalar",T:9},{no:2,name:"limit",kind:"scalar",T:5},{no:3,name:"offset",kind:"scalar",T:5}])}}new Vr;class Hr extends r.MessageType{constructor(){super("socket.room.RoomPeersInfoResponse",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>_e}])}}const Jr=new Hr;class Zr extends r.MessageType{constructor(){super("socket.room.RoomPeerCountResponse",[{no:1,name:"count",kind:"scalar",T:4,L:2}])}}new Zr;class zr extends r.MessageType{constructor(){super("socket.room.Room",[{no:1,name:"room_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:4,name:"created_at",kind:"scalar",T:4,L:2},{no:5,name:"active_recordings",kind:"message",repeat:1,T:()=>Qr},{no:6,name:"room_uuid",kind:"scalar",opt:!0,T:9}])}}const Vn=new zr;class Yr extends r.MessageType{constructor(){super("socket.room.ActiveRecording",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",fe]},{no:3,name:"recording_status",kind:"scalar",T:9}])}}const Qr=new Yr;class Xr extends r.MessageType{constructor(){super("socket.room.RoomInfoResponse",[{no:1,name:"room",kind:"message",T:()=>Vn}])}}const eo=new Xr;class no extends r.MessageType{constructor(){super("socket.room.GetPeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9}])}}new no;class so extends r.MessageType{constructor(){super("socket.room.UpdatePeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9}])}}new so;class to extends r.MessageType{constructor(){super("socket.room.JoinRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>_e},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:5,name:"use_hive",kind:"scalar",opt:!0,T:8},{no:6,name:"preset",kind:"scalar",opt:!0,T:12},{no:7,name:"capabilities",kind:"enum",repeat:1,T:()=>["socket.room.Capabilities",Fe,"CAPABILITIES_"]},{no:8,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new to;class ro extends r.MessageType{constructor(){super("socket.room.LeaveRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>_e},{no:2,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new ro;class oo extends r.MessageType{constructor(){super("socket.room.UpdateRoomInfoRequest",[{no:1,name:"room",kind:"message",T:()=>Vn}])}}new oo;class ao extends r.MessageType{constructor(){super("socket.room.GetConnectedRoomsDumpRequest",[])}}new ao;class io extends r.MessageType{constructor(){super("socket.room.ServiceError",[{no:1,name:"message",kind:"scalar",opt:!0,T:9},{no:2,name:"code",kind:"scalar",opt:!0,T:9}])}}const He=new io;class co extends r.MessageType{constructor(){super("socket.room.ConnectedMeetingPeer",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:5,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}}const po=new co;class uo extends r.MessageType{constructor(){super("socket.room.ConnectedMeetingDump",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>po}])}}const kn=new uo;class lo extends r.MessageType{constructor(){super("socket.room.GetConnectedRoomsDumpResponse",[{no:1,name:"parent_meeting",kind:"message",T:()=>kn},{no:2,name:"meetings",kind:"message",repeat:1,T:()=>kn}])}}const mo=new lo;class To extends r.MessageType{constructor(){super("socket.room.CreateRoomRequestPayload",[{no:1,name:"title",kind:"scalar",opt:!0,T:9}])}}const go=new To;class fo extends r.MessageType{constructor(){super("socket.room.CreateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>go}])}}new fo;class yo extends r.MessageType{constructor(){super("socket.room.CreateRoomResponsePayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>He}])}}const ho=new yo;class ko extends r.MessageType{constructor(){super("socket.room.CreateConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ho}])}}new ko;class vo extends r.MessageType{constructor(){super("socket.room.UpdateRoomRequestPayload",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}}const Ro=new vo;class _o extends r.MessageType{constructor(){super("socket.room.UpdateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Ro}])}}new _o;class Po extends r.MessageType{constructor(){super("socket.room.DisableRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}}const wo=new Po;class Co extends r.MessageType{constructor(){super("socket.room.DisableConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>wo}])}}new Co;class Mo extends r.MessageType{constructor(){super("socket.room.DisableConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Eo}])}}new Mo;class So extends r.MessageType{constructor(){super("socket.room.DisableConnectedRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"status",kind:"scalar",opt:!0,T:9},{no:3,name:"title",kind:"scalar",opt:!0,T:9},{no:4,name:"error",kind:"message",T:()=>He}])}}const Eo=new So;class bo extends r.MessageType{constructor(){super("socket.room.MovePeerPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"preset_id",kind:"scalar",opt:!0,T:9}])}}const Lo=new bo;class xo extends r.MessageType{constructor(){super("socket.room.MovePeersBetweenRoomsRequest",[{no:1,name:"source_meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"destination_meeting_id",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>Lo}])}}new xo;class Oo extends r.MessageType{constructor(){super("socket.room.MovedPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>He}])}}const qo=new Oo;class $o extends r.MessageType{constructor(){super("socket.room.MovePeersBetweenRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>qo}])}}new $o;class No extends r.MessageType{constructor(){super("socket.room.TransferPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"auth_token",kind:"scalar",opt:!0,T:9}])}}new No;class Ao extends r.MessageType{constructor(){super("socket.room.GetAllAddedParticipantsResponse",[{no:1,name:"participants",kind:"message",repeat:1,T:()=>Do}])}}new Ao;class Io extends r.MessageType{constructor(){super("socket.room.AddedParticipant",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Do=new Io;class Uo extends r.MessageType{constructor(){super("socket.room.RemoveParticipantsRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Uo;class Bo extends r.MessageType{constructor(){super("socket.room.BroadcastMessage",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"timestamp",kind:"scalar",T:4,L:2},{no:4,name:"ids",kind:"scalar",repeat:2,T:9},{no:5,name:"broadcast_type",kind:"enum",opt:!0,T:()=>["socket.room.BroadcastType",We,"BROADCAST_TYPE_"]}])}}new Bo;class Go extends r.MessageType{constructor(){super("socket.room.AcceptWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Go;class jo extends r.MessageType{constructor(){super("socket.room.DenyWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new jo;class Wo extends r.MessageType{constructor(){super("socket.room.WaitingRoomRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"picture",kind:"scalar",opt:!0,T:9},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_name",kind:"scalar",opt:!0,T:9}])}}const Fo=new Wo;class Ko extends r.MessageType{constructor(){super("socket.room.GetWaitingRoomRequests",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Fo}])}}new Ko;class Vo extends r.MessageType{constructor(){super("socket.room.GetRoomStageStateResponse",[{no:1,name:"on_stage_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"approved_stage_peers",kind:"scalar",repeat:2,T:9},{no:3,name:"requested_stage_peers",kind:"scalar",repeat:2,T:9}])}}new Vo;var Ke;(function(e){e[e.NONE=0]="NONE",e[e.SKIP=1]="SKIP",e[e.ON_PRIVILEGED_USER_ENTRY=2]="ON_PRIVILEGED_USER_ENTRY",e[e.SKIP_ON_ACCEPT=3]="SKIP_ON_ACCEPT"})(Ke||(Ke={}));var ye;(function(e){e[e.NONE=0]="NONE",e[e.ALLOWED=1]="ALLOWED",e[e.NOT_ALLOWED=2]="NOT_ALLOWED",e[e.CAN_REQUEST=3]="CAN_REQUEST"})(ye||(ye={}));class Ho extends r.MessageType{constructor(){super("socket.preset.PollsPermissionUpdate",[{no:1,name:"can_create",kind:"scalar",opt:!0,T:8},{no:2,name:"can_vote",kind:"scalar",opt:!0,T:8},{no:3,name:"can_view",kind:"scalar",opt:!0,T:8}])}}const Jo=new Ho;class Zo extends r.MessageType{constructor(){super("socket.preset.PluginsPermissionsUpdate",[{no:1,name:"can_close",kind:"scalar",opt:!0,T:8},{no:2,name:"can_start",kind:"scalar",opt:!0,T:8}])}}const zo=new Zo;class Yo extends r.MessageType{constructor(){super("socket.preset.PublicChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"text",kind:"scalar",opt:!0,T:8},{no:3,name:"files",kind:"scalar",opt:!0,T:8}])}}const Qo=new Yo;class Xo extends r.MessageType{constructor(){super("socket.preset.PrivateChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"can_receive",kind:"scalar",opt:!0,T:8},{no:3,name:"text",kind:"scalar",opt:!0,T:8},{no:4,name:"files",kind:"scalar",opt:!0,T:8}])}}const ea=new Xo;class na extends r.MessageType{constructor(){super("socket.preset.ChatPermissionUpdate",[{no:1,name:"public",kind:"message",T:()=>Qo},{no:2,name:"private",kind:"message",T:()=>ea}])}}const sa=new na;class ta extends r.MessageType{constructor(){super("socket.preset.ConnectedMeetingPermissionUpdate",[{no:1,name:"can_alter_connected_meetings",kind:"scalar",opt:!0,T:8},{no:2,name:"can_switch_to_parent_meeting",kind:"scalar",opt:!0,T:8},{no:3,name:"can_switch_connected_meetings",kind:"scalar",opt:!0,T:8}])}}const ra=new ta;class oa extends r.MessageType{constructor(){super("socket.preset.StreamPermission",[{no:1,name:"can_produce",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",ye,"STREAM_PERMISSION_TYPE_"]},{no:2,name:"can_consume",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",ye,"STREAM_PERMISSION_TYPE_"]}])}}const Ae=new oa;class aa extends r.MessageType{constructor(){super("socket.preset.MediaPermissionUpdate",[{no:1,name:"video",kind:"message",T:()=>Ae},{no:2,name:"audio",kind:"message",T:()=>Ae},{no:3,name:"screenshare",kind:"message",T:()=>Ae}])}}const ia=new aa;class ca extends r.MessageType{constructor(){super("socket.preset.PresetUpdates",[{no:1,name:"polls",kind:"message",T:()=>Jo},{no:2,name:"plugins",kind:"message",T:()=>zo},{no:3,name:"chat",kind:"message",T:()=>sa},{no:4,name:"accept_waiting_requests",kind:"scalar",opt:!0,T:8},{no:5,name:"can_accept_production_requests",kind:"scalar",opt:!0,T:8},{no:6,name:"can_edit_display_name",kind:"scalar",opt:!0,T:8},{no:7,name:"can_record",kind:"scalar",opt:!0,T:8},{no:8,name:"can_livestream",kind:"scalar",opt:!0,T:8},{no:9,name:"can_spotlight",kind:"scalar",opt:!0,T:8},{no:10,name:"disable_participant_audio",kind:"scalar",opt:!0,T:8},{no:11,name:"disable_participant_screensharing",kind:"scalar",opt:!0,T:8},{no:12,name:"disable_participant_video",kind:"scalar",opt:!0,T:8},{no:13,name:"kick_participant",kind:"scalar",opt:!0,T:8},{no:14,name:"pin_participant",kind:"scalar",opt:!0,T:8},{no:15,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:16,name:"waiting_room_type",kind:"enum",opt:!0,T:()=>["socket.preset.WaitingRoomType",Ke,"WAITING_ROOM_TYPE_"]},{no:17,name:"is_recorder",kind:"scalar",opt:!0,T:8},{no:18,name:"recorder_type",kind:"enum",opt:!0,T:()=>["socket.room.RecorderType",je,"RECORDER_TYPE_"]},{no:19,name:"hidden_participant",kind:"scalar",opt:!0,T:8},{no:20,name:"show_participant_list",kind:"scalar",opt:!0,T:8},{no:21,name:"can_change_participant_permissions",kind:"scalar",opt:!0,T:8},{no:22,name:"connected_meetings",kind:"message",T:()=>ra},{no:23,name:"media",kind:"message",T:()=>ia}])}}const Je=new ca;class pa extends r.MessageType{constructor(){super("socket.preset.ReadPeersPresetRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new pa;class da extends r.MessageType{constructor(){super("socket.preset.PeerPreset",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"preset",kind:"scalar",T:12}])}}const ua=new da;class la extends r.MessageType{constructor(){super("socket.preset.ReadPeersPresetResponse",[{no:1,name:"peer_presets",kind:"message",repeat:1,T:()=>ua}])}}new la;class ma extends r.MessageType{constructor(){super("socket.preset.UpdatePeerPreset",[{no:1,name:"user_ids",kind:"scalar",T:9},{no:2,name:"patch",kind:"message",T:()=>Je}])}}const Hn=new ma;class Ta extends r.MessageType{constructor(){super("socket.preset.UpdatePeersPresetRequest",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>Hn}])}}new Ta;class ga extends r.MessageType{constructor(){super("socket.preset.UpdatePeersPresetResponse",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>Hn}])}}new ga;class fa extends r.MessageType{constructor(){super("socket.preset.PeerUserIDMap",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}])}}const ya=new fa;class ha extends r.MessageType{constructor(){super("socket.preset.BulkUpdatePeerPresetRequest",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>ya},{no:2,name:"patch",kind:"message",T:()=>Je}])}}new ha;class ka extends r.MessageType{constructor(){super("socket.preset.BulkUpdatePeerPresetResponse",[{no:2,name:"patch",kind:"message",T:()=>Je}])}}new ka;class va extends r.MessageType{constructor(){super("socket.chat.ChatMessage",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"user_id",kind:"scalar",T:9},{no:4,name:"display_name",kind:"scalar",T:9},{no:5,name:"pinned",kind:"scalar",T:8},{no:6,name:"is_edited",kind:"scalar",T:8},{no:7,name:"payload_type",kind:"scalar",T:5},{no:8,name:"payload",kind:"scalar",T:9},{no:10,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:11,name:"created_at",kind:"scalar",T:4,L:2},{no:12,name:"created_at_ms",kind:"scalar",opt:!0,T:4,L:2},{no:13,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:14,name:"channel_index",kind:"scalar",opt:!0,T:9}])}}const F=new va;class Ra extends r.MessageType{constructor(){super("socket.chat.GetPaginatedChatMessageRoomRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Ra;class _a extends r.MessageType{constructor(){super("socket.chat.GetPaginatedChatMessageRoomResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>F},{no:2,name:"next",kind:"scalar",T:8}])}}new _a;class Pa extends r.MessageType{constructor(){super("socket.chat.GetChatMessagesResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>F}])}}new Pa;class wa extends r.MessageType{constructor(){super("socket.chat.SendChatMessageToRoomRequest",[{no:1,name:"payload_type",kind:"scalar",T:5},{no:2,name:"payload",kind:"scalar",T:9}])}}new wa;class Ca extends r.MessageType{constructor(){super("socket.chat.SendChatMessageToRoomResponse",[{no:1,name:"message",kind:"message",T:()=>F}])}}new Ca;class Ma extends r.MessageType{constructor(){super("socket.chat.SendChatMessageToPeersRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new Ma;class Sa extends r.MessageType{constructor(){super("socket.chat.SendChatMessageToPeersResponse",[{no:1,name:"message",kind:"message",T:()=>F}])}}new Sa;class Ea extends r.MessageType{constructor(){super("socket.chat.SendChatMessageToChannelRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new Ea;class ba extends r.MessageType{constructor(){super("socket.chat.SendChatMessageToChannelResponse",[{no:1,name:"message",kind:"message",T:()=>F}])}}new ba;class La extends r.MessageType{constructor(){super("socket.chat.EditChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",opt:!0,T:5},{no:3,name:"payload",kind:"scalar",opt:!0,T:9},{no:4,name:"pinned",kind:"scalar",opt:!0,T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new La;class xa extends r.MessageType{constructor(){super("socket.chat.PinChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new xa;class Oa extends r.MessageType{constructor(){super("socket.chat.PinChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Oa;class qa extends r.MessageType{constructor(){super("socket.chat.EditChatMessageResponse",[{no:1,name:"message",kind:"message",T:()=>F}])}}new qa;class $a extends r.MessageType{constructor(){super("socket.chat.DeleteChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new $a;class Na extends r.MessageType{constructor(){super("socket.chat.DeleteChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Na;class Aa extends r.MessageType{constructor(){super("socket.chat.SearchChatMessagesRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:6,name:"search_term",kind:"scalar",T:9}])}}new Aa;class Ia extends r.MessageType{constructor(){super("socket.chat.MarkChannelIndexAsReadRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"channel_index",kind:"scalar",T:9}])}}new Ia;class Da extends r.MessageType{constructor(){super("socket.chat.MarkChannelIndexAsReadResponse",[{no:1,name:"channel_index",kind:"scalar",T:9}])}}new Da;class Ua extends r.MessageType{constructor(){super("socket.chat.CreateChatChannelRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8}])}}new Ua;class Ba extends r.MessageType{constructor(){super("socket.chat.UpdateChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:4,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"scalar",opt:!0,T:9},{no:6,name:"is_direct_message",kind:"scalar",opt:!0,T:8}])}}new Ba;class Ga extends r.MessageType{constructor(){super("socket.chat.CreateChatChannelResponse",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Ga;class ja extends r.MessageType{constructor(){super("socket.chat.GetChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new ja;class Wa extends r.MessageType{constructor(){super("socket.chat.LatestMessageAndUnreadCount",[{no:1,name:"message",kind:"message",T:()=>F},{no:2,name:"unread_count",kind:"scalar",T:4,L:2}])}}const Fa=new Wa;class Ka extends r.MessageType{constructor(){super("socket.chat.ChatChannel",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8},{no:6,name:"latest_message_and_unread_count",kind:"message",T:()=>Fa},{no:7,name:"target_user_ids",kind:"scalar",repeat:2,T:9}])}}const Va=new Ka;class Ha extends r.MessageType{constructor(){super("socket.chat.GetChatChannelResponse",[{no:1,name:"chat_channels",kind:"message",repeat:1,T:()=>Va}])}}new Ha;class Ja extends r.MessageType{constructor(){super("socket.chat.ChannelMember",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Za=new Ja;class za extends r.MessageType{constructor(){super("socket.chat.GetChatChannelMembersResponse",[{no:1,name:"channel_members",kind:"message",repeat:1,T:()=>Za}])}}new za;class Ya extends r.MessageType{constructor(){super("socket.plugin.AddPluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new Ya;class Qa extends r.MessageType{constructor(){super("socket.plugin.RemovePluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new Qa;class Xa extends r.MessageType{constructor(){super("socket.plugin.EnablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new Xa;class ei extends r.MessageType{constructor(){super("socket.plugin.DisablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new ei;class ni extends r.MessageType{constructor(){super("socket.plugin.EnablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new ni;class si extends r.MessageType{constructor(){super("socket.plugin.DisablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new si;class ti extends r.MessageType{constructor(){super("socket.plugin.PluginEventToRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new ti;class ri extends r.MessageType{constructor(){super("socket.plugin.PluginEventToPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"plugin_data",kind:"scalar",T:12}])}}new ri;class oi extends r.MessageType{constructor(){super("socket.plugin.StoreKeys",[{no:1,name:"store_key",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",opt:!0,T:12}])}}const Ze=new oi;class ai extends r.MessageType{constructor(){super("socket.plugin.PluginStoreInsertKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"insert_keys",kind:"message",repeat:1,T:()=>Ze}])}}new ai;class ii extends r.MessageType{constructor(){super("socket.plugin.PluginStoreGetKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"get_keys",kind:"message",repeat:1,T:()=>Ze}])}}new ii;class ci extends r.MessageType{constructor(){super("socket.plugin.PluginStoreDeleteKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"delete_keys",kind:"message",repeat:1,T:()=>Ze}])}}new ci;class pi extends r.MessageType{constructor(){super("socket.plugin.PluginStoreDeleteRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9}])}}new pi;class di extends r.MessageType{constructor(){super("socket.plugin.EnablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"enabled_by",kind:"scalar",T:9}])}}const ui=new di;class li extends r.MessageType{constructor(){super("socket.plugin.EnablePluginsResponse",[{no:1,name:"plugins",kind:"message",repeat:1,T:()=>ui}])}}new li;class mi extends r.MessageType{constructor(){super("socket.plugin.DisablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"disabled_by",kind:"scalar",T:9}])}}new mi;class Ti extends r.MessageType{constructor(){super("socket.plugin.PluginStoreItem",[{no:1,name:"timestamp",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"store_key",kind:"scalar",T:9},{no:4,name:"payload",kind:"scalar",T:12}])}}const gi=new Ti;class fi extends r.MessageType{constructor(){super("socket.plugin.PluginStoreResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"store_items",kind:"message",repeat:1,T:()=>gi}])}}new fi;class yi extends r.MessageType{constructor(){super("socket.plugin.PluginEventResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new yi;class hi extends r.MessageType{constructor(){super("socket.livestreaming.LiveStreamingEvent",[{no:1,name:"livestream_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",T:9},{no:5,name:"playback_url",kind:"scalar",T:9},{no:6,name:"org_id",kind:"scalar",T:9},{no:7,name:"room_name",kind:"scalar",T:9},{no:8,name:"room_uuid",kind:"scalar",T:9},{no:9,name:"status",kind:"scalar",T:9},{no:10,name:"manual_ingest",kind:"scalar",opt:!0,T:8}])}}new hi;class ki extends r.MessageType{constructor(){super("socket.livestreaming.GetStagePeersResponse",[{no:1,name:"stage_peers",kind:"scalar",repeat:2,T:9}])}}new ki;class vi extends r.MessageType{constructor(){super("socket.livestreaming.StageRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9}])}}const Ri=new vi;class _i extends r.MessageType{constructor(){super("socket.livestreaming.GetStageRequestsResponse",[{no:1,name:"stage_requests",kind:"message",repeat:1,T:()=>Ri}])}}new _i;class Pi extends r.MessageType{constructor(){super("socket.livestreaming.GrantStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Pi;class wi extends r.MessageType{constructor(){super("socket.livestreaming.DenyStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new wi;class Ci extends r.MessageType{constructor(){super("socket.livestreaming.LeaveStageRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Ci;class Mi extends r.MessageType{constructor(){super("socket.polls.Poll",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"created_by",kind:"scalar",T:9},{no:3,name:"created_by_user_id",kind:"scalar",T:9},{no:4,name:"question",kind:"scalar",T:9},{no:5,name:"options",kind:"message",repeat:1,T:()=>Ei},{no:6,name:"hide_votes",kind:"scalar",T:8},{no:7,name:"anonymous",kind:"scalar",T:8},{no:8,name:"votes",kind:"scalar",repeat:2,T:9}])}}const Jn=new Mi;class Si extends r.MessageType{constructor(){super("socket.polls.PollOption",[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",opt:!0,T:4,L:2},{no:3,name:"votes",kind:"message",repeat:1,T:()=>Li}])}}const Ei=new Si;class bi extends r.MessageType{constructor(){super("socket.polls.PollVote",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}])}}const Li=new bi;class xi extends r.MessageType{constructor(){super("socket.polls.NewPollRequest",[{no:1,name:"question",kind:"scalar",T:9},{no:2,name:"options",kind:"scalar",repeat:2,T:9},{no:3,name:"anonymous",kind:"scalar",T:8},{no:4,name:"hide_votes",kind:"scalar",T:8},{no:5,name:"created_by",kind:"scalar",opt:!0,T:9},{no:6,name:"created_by_user_id",kind:"scalar",opt:!0,T:9}])}}new xi;class Oi extends r.MessageType{constructor(){super("socket.polls.VotePollRequest",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"index",kind:"scalar",T:4,L:2}])}}new Oi;class qi extends r.MessageType{constructor(){super("socket.polls.UpdatePollResponse",[{no:1,name:"poll",kind:"message",T:()=>Jn}])}}new qi;class $i extends r.MessageType{constructor(){super("socket.polls.GetPollsResponse",[{no:1,name:"polls",kind:"message",repeat:1,T:()=>Jn}])}}new $i;class Ni extends r.MessageType{constructor(){super("socket.recording.RecordingEvent",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",fe]}])}}new Ni;class Ai extends r.MessageType{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const t=this.create(),a=Date.now();return t.seconds=r.PbLong.from(Math.floor(a/1e3)).toBigInt(),t.nanos=a%1e3*1e6,t}toDate(t){return new Date(r.PbLong.from(t.seconds).toNumber()*1e3+Math.ceil(t.nanos/1e6))}fromDate(t){const a=this.create(),p=t.getTime();return a.seconds=r.PbLong.from(Math.floor(p/1e3)).toBigInt(),a.nanos=p%1e3*1e6,a}internalJsonWrite(t,a){let p=r.PbLong.from(t.seconds).toNumber()*1e3;if(p<Date.parse("0001-01-01T00:00:00Z")||p>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(t.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let u="Z";if(t.nanos>0){let m=(t.nanos+1e9).toString().substring(1);m.substring(3)==="000000"?u="."+m.substring(0,3)+"Z":m.substring(6)==="000"?u="."+m.substring(0,6)+"Z":u="."+m+"Z"}return new Date(p).toISOString().replace(".000Z",u)}internalJsonRead(t,a,p){if(typeof t!="string")throw new Error("Unable to parse Timestamp from JSON "+r.typeofJsonValue(t)+".");let u=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!u)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let m=Date.parse(u[1]+"-"+u[2]+"-"+u[3]+"T"+u[4]+":"+u[5]+":"+u[6]+(u[8]?u[8]:"Z"));if(Number.isNaN(m))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(m<Date.parse("0001-01-01T00:00:00Z")||m>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return p||(p=this.create()),p.seconds=r.PbLong.from(m/1e3).toBigInt(),p.nanos=0,u[7]&&(p.nanos=parseInt("1"+u[7]+"0".repeat(9-u[7].length))-1e9),p}}new Ai;class Ii extends r.MessageType{constructor(){super("common.BaseHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9},{no:9,name:"room_object_id",kind:"scalar",opt:!0,T:9},{no:10,name:"preset",kind:"scalar",opt:!0,T:9},{no:11,name:"use_start_session",kind:"scalar",opt:!0,T:8}])}}const Ve=new Ii;class Di extends r.MessageType{constructor(){super("common.BulkedHubMessage",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>Ve}])}}new Di;class Ui extends r.MessageType{constructor(){super("common.CFWorkersResponse",[{no:1,name:"responses",kind:"message",repeat:1,T:()=>Ve},{no:2,name:"broadcast_responses",kind:"message",repeat:1,T:()=>Ve}])}}new Ui;const Bi=0,Gi=1,ji=2,Wi=3,Fi=4,Ki=5,Vi={getPeerInfo:0,updatePeerInfo:1,getRoomPeersInfo:2,joinRoom:3,leaveRoom:4,getRoomInfo:5,updateRoomInfo:6,closeRoom:7,startedLivestream:8,stoppedLivestream:9,erroredLivestream:10,getStagePeers:11,getStageRequests:12,requestStageAccess:13,cancelStageRequest:14,grantStageAccess:15,denyStageAccess:16,roomPeerCount:17,joinStage:18,leaveStage:19,getConnectedRoomsDump:20,createConnectedRooms:21,deleteConnectedRooms:22,movePeers:23,transferPeer:24,movedPeer:25,connectedRoomsUpdated:26,connectedRoomsDeleted:27,getAllAddedParticipants:28,broadcastMessage:29,kick:30,kickAll:31,transcript:32,getWaitingRoomRequests:33,acceptWaitingRoomRequests:34,waitingRoomRequestAccepted:35,denyWaitingRoomRequests:36,waitingRoomRequestDenied:37,peerStageStatusUpdate:38,broadcastToEntity:39,recordingStarted:40,recordingStopped:41,recordingPaused:42,getRoomStageState:43,livestreamingInvoked:44},Hi={getMessages:0,sendMessageToRoom:1,sendMessageToPeers:2,editMessage:3,deleteMessage:4,getPaginatedMessages:5,sendMessageToChannel:6,searchChannelMessages:7,getAllChatChannels:8,markChannelIndexAsRead:9,pinMessage:10},Ji={getPlugins:0,addPlugin:1,enablePluginForRoom:2,disablePluginForPeers:3,enablePluginForPeers:4,disablePluginForRoom:5,removePlugin:6,customPluginEventToRoom:7,customPluginEventToPeers:8,storeInsertKeys:9,storeGetKeys:10,storeDeleteKeys:11,storeDelete:12},Zi={createPoll:0,getPolls:1,votePoll:2,updatePoll:3},Zn={unknown:0,createWebRTCTransport:1,produce:2,consume:3,toggleProducer:4,toggleConsumer:5,closeProducer:6,closeConsumer:7,updateConsumersSimulcastConfig:8,joinRoom:16,leaveRoom:17,selectedPeer:18,globalPinPeer:19,selfJoinComplete:20,peerJoinedBroadcast:25,peerLeaveBroadcast:26,peerProducerCreateBroadcast:27,peerProducerToggleBroadcast:28,peerProducerCloseBroadcast:29,globalPeerPinBroadcast:30,recordingStartedBroadcast:31,recordingStoppedBroadcast:32,peerDisplayNameEditBroadcast:33,mediaRoomTerminationBroadcastResponse:36,selectedPeerDiff:40,renegotiateSessionDescription:50,errorResponse:60,kickPeer:90,kickAll:91,changeDisplayName:92,hostControlPeer:93,hostControlAllPeers:94,audioActivity:100},zi={createChatChannel:0,getChatChannel:1,deprecatedGetAllChatChannels:2,getChannelMembers:3,updateChatChannel:4},Yi={getUserPresets:0,updateUserPreset:1};function X(e,t){return Object.keys(t).reduce((a,p)=>(a[p]=(e<<16)+t[p],a),{})}function zn(e,t){return Object.keys(e).reduce((a,p)=>(a[p]=t|e[p],a),{})}const de=X(Bi,Vi);X(Gi,Hi);X(ji,Ji);X(Wi,Zi);X(Fi,zi);const Ie=zn(Zn,16777216);zn(Zn,50331648);X(Ki,Yi);const Yn="ws://localhost:8080/ws";class Qi extends re.WebSocket{constructor(t,a){super(Yn,a)}}var Y,he,Q,ke;class Xi{constructor(){se(this,Y,void 0);se(this,he,[]);se(this,Q,void 0);se(this,ke,15e3);k(this,"roomId","roomId");k(this,"roomUuid","roomUuid");k(this,"cleanBuffer",t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}init({peerId:t,mockParticipants:a}){$e(this,Q,t),window.WebSocket=Qi,$e(this,Y,a);const{RTK_MOCK_SERVER:p}=window;if(p)try{p.close()}catch(m){}const u=new re.Server(Yn,{mock:!1});window.RTK_MOCK_SERVER=u,u.on("connection",m=>{j(this,he).push(m),this.addConnectionListeners(m)})}addConnectionListeners(t){t.on("message",a=>{if(a==="3")return;const p=Tn.fromBinary(a);let u;switch(p.event){case de.joinRoom:{u=hn.toBinary(hn.fromJson({peer:{peerId:j(this,Q),userId:"self-userId",displayName:"name",waitlisted:!1,stageType:oe.ON_STAGE}}));break}case de.getRoomPeersInfo:{u=Jr.toBinary({peers:j(this,Y).map(P=>on(qe({},P),{userId:P.peerId,waitlisted:!1,stageType:1}))});break}case de.getRoomInfo:{u=eo.toBinary({room:{roomId:this.roomId,title:"title",createdAt:Date.now(),activeRecordings:[],roomUuid:this.roomUuid}});break}case Ie.createWebRTCTransport:{u=Gn.toBinary({transportId:"transportId",description:{type:"answer",sdp:"sdp",target:ge.PUBLISHER},producerIds:[]});break}case Ie.selfJoinComplete:{const P=j(this,Y).map(b=>qe({producerStates:[]},b));u=tr.toBinary({maxPreferredStreams:6,participants:P,selectedPeers:{audioPeers:[],compulsoryPeers:[]},roomState:{displayTitle:"title",lockedMode:!1,roomUuid:this.roomUuid,roomName:this.roomUuid,currentPeerId:j(this,Q),pinnedPeerIds:[]}});break}case de.getConnectedRoomsDump:{u=mo.toBinary({parentMeeting:{participants:[]},meetings:[]});break}case Ie.produce:{u=cr.toBinary({status:!0,producerId:"producer-id"});break}}const m={event:p.event,id:p.id,payload:u},g=Tn.toBinary(m),h=this.cleanBuffer(g);t.send(h)}),setInterval(()=>{t.send("2")},j(this,ke))}}Y=new WeakMap,he=new WeakMap,Q=new WeakMap,ke=new WeakMap;function ec(e){new Xi().init(e),window.RTCPeerConnection=Os,window.fetch=()=>cn(this,null,function*(){const a=new window.Response(JSON.stringify({}),{status:200,headers:{"Content-type":"application/json"}});return Promise.resolve(a)})}exports.setupStubs=ec;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface StubsParams {
|
|
2
|
+
peerId: string;
|
|
3
|
+
mockParticipants: MockParticipant[];
|
|
4
|
+
}
|
|
5
|
+
declare function setupStubs(params: StubsParams): void;
|
|
6
|
+
|
|
7
|
+
interface MockParticipant {
|
|
8
|
+
peerId: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
stageStatus: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { MockParticipant, setupStubs };
|