@cloudflare/realtimekit-recording-sdk 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,69 +1,69 @@
1
- var Xt = Object.defineProperty;
2
- var Gt = (n, e, t) => e in n ? Xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Qe = (n, e, t) => (Gt(n, typeof e != "symbol" ? e + "" : e, t), t), Ue = (n, e, t) => {
1
+ var Ht = Object.defineProperty;
2
+ var en = (n, e, t) => e in n ? Ht(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var it = (n, e, t) => (en(n, typeof e != "symbol" ? e + "" : e, t), t), We = (n, e, t) => {
4
4
  if (!e.has(n))
5
5
  throw TypeError("Cannot " + t);
6
6
  };
7
- var l = (n, e, t) => (Ue(n, e, "read from private field"), t ? t.call(n) : e.get(n)), A = (n, e, t) => {
7
+ var l = (n, e, t) => (We(n, e, "read from private field"), t ? t.call(n) : e.get(n)), D = (n, e, t) => {
8
8
  if (e.has(n))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  e instanceof WeakSet ? e.add(n) : e.set(n, t);
11
- }, C = (n, e, t, i) => (Ue(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t);
12
- var He = (n, e, t) => (Ue(n, e, "access private method"), t);
13
- var Ye = { exports: {} }, ie = typeof Reflect == "object" ? Reflect : null, et = ie && typeof ie.apply == "function" ? ie.apply : function(e, t, i) {
11
+ }, C = (n, e, t, i) => (We(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t);
12
+ var rt = (n, e, t) => (We(n, e, "access private method"), t);
13
+ var et = { exports: {} }, re = typeof Reflect == "object" ? Reflect : null, st = re && typeof re.apply == "function" ? re.apply : function(e, t, i) {
14
14
  return Function.prototype.apply.call(e, t, i);
15
- }, ye;
16
- ie && typeof ie.ownKeys == "function" ? ye = ie.ownKeys : Object.getOwnPropertySymbols ? ye = function(e) {
15
+ }, Ie;
16
+ re && typeof re.ownKeys == "function" ? Ie = re.ownKeys : Object.getOwnPropertySymbols ? Ie = function(e) {
17
17
  return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
18
- } : ye = function(e) {
18
+ } : Ie = function(e) {
19
19
  return Object.getOwnPropertyNames(e);
20
20
  };
21
- function Zt(n) {
21
+ function tn(n) {
22
22
  console && console.warn && console.warn(n);
23
23
  }
24
- var gt = Number.isNaN || function(e) {
24
+ var vt = Number.isNaN || function(e) {
25
25
  return e !== e;
26
26
  };
27
- function w() {
28
- w.init.call(this);
29
- }
30
- Ye.exports = w;
31
- Ye.exports.once = Qt;
32
- w.EventEmitter = w;
33
- w.prototype._events = void 0;
34
- w.prototype._eventsCount = 0;
35
- w.prototype._maxListeners = void 0;
36
- var tt = 10;
37
- function De(n) {
27
+ function v() {
28
+ v.init.call(this);
29
+ }
30
+ et.exports = v;
31
+ et.exports.once = on;
32
+ v.EventEmitter = v;
33
+ v.prototype._events = void 0;
34
+ v.prototype._eventsCount = 0;
35
+ v.prototype._maxListeners = void 0;
36
+ var ot = 10;
37
+ function Ve(n) {
38
38
  if (typeof n != "function")
39
39
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof n);
40
40
  }
41
- Object.defineProperty(w, "defaultMaxListeners", {
41
+ Object.defineProperty(v, "defaultMaxListeners", {
42
42
  enumerable: !0,
43
43
  get: function() {
44
- return tt;
44
+ return ot;
45
45
  },
46
46
  set: function(n) {
47
- if (typeof n != "number" || n < 0 || gt(n))
47
+ if (typeof n != "number" || n < 0 || vt(n))
48
48
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + n + ".");
49
- tt = n;
49
+ ot = n;
50
50
  }
51
51
  });
52
- w.init = function() {
52
+ v.init = function() {
53
53
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
54
54
  };
55
- w.prototype.setMaxListeners = function(e) {
56
- if (typeof e != "number" || e < 0 || gt(e))
55
+ v.prototype.setMaxListeners = function(e) {
56
+ if (typeof e != "number" || e < 0 || vt(e))
57
57
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
58
58
  return this._maxListeners = e, this;
59
59
  };
60
- function mt(n) {
61
- return n._maxListeners === void 0 ? w.defaultMaxListeners : n._maxListeners;
60
+ function kt(n) {
61
+ return n._maxListeners === void 0 ? v.defaultMaxListeners : n._maxListeners;
62
62
  }
63
- w.prototype.getMaxListeners = function() {
64
- return mt(this);
63
+ v.prototype.getMaxListeners = function() {
64
+ return kt(this);
65
65
  };
66
- w.prototype.emit = function(e) {
66
+ v.prototype.emit = function(e) {
67
67
  for (var t = [], i = 1; i < arguments.length; i++)
68
68
  t.push(arguments[i]);
69
69
  var r = e === "error", s = this._events;
@@ -82,51 +82,51 @@ w.prototype.emit = function(e) {
82
82
  if (f === void 0)
83
83
  return !1;
84
84
  if (typeof f == "function")
85
- et(f, this, t);
85
+ st(f, this, t);
86
86
  else
87
- for (var h = f.length, d = vt(f, h), i = 0; i < h; ++i)
88
- et(d[i], this, t);
87
+ for (var h = f.length, d = Rt(f, h), i = 0; i < h; ++i)
88
+ st(d[i], this, t);
89
89
  return !0;
90
90
  };
91
- function pt(n, e, t, i) {
91
+ function It(n, e, t, i) {
92
92
  var r, s, o;
93
- if (De(t), s = n._events, s === void 0 ? (s = n._events = /* @__PURE__ */ Object.create(null), n._eventsCount = 0) : (s.newListener !== void 0 && (n.emit(
93
+ if (Ve(t), s = n._events, s === void 0 ? (s = n._events = /* @__PURE__ */ Object.create(null), n._eventsCount = 0) : (s.newListener !== void 0 && (n.emit(
94
94
  "newListener",
95
95
  e,
96
96
  t.listener ? t.listener : t
97
97
  ), s = n._events), o = s[e]), o === void 0)
98
98
  o = s[e] = t, ++n._eventsCount;
99
- else if (typeof o == "function" ? o = s[e] = i ? [t, o] : [o, t] : i ? o.unshift(t) : o.push(t), r = mt(n), r > 0 && o.length > r && !o.warned) {
99
+ else if (typeof o == "function" ? o = s[e] = i ? [t, o] : [o, t] : i ? o.unshift(t) : o.push(t), r = kt(n), r > 0 && o.length > r && !o.warned) {
100
100
  o.warned = !0;
101
101
  var a = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
102
- a.name = "MaxListenersExceededWarning", a.emitter = n, a.type = e, a.count = o.length, Zt(a);
102
+ a.name = "MaxListenersExceededWarning", a.emitter = n, a.type = e, a.count = o.length, tn(a);
103
103
  }
104
104
  return n;
105
105
  }
106
- w.prototype.addListener = function(e, t) {
107
- return pt(this, e, t, !1);
106
+ v.prototype.addListener = function(e, t) {
107
+ return It(this, e, t, !1);
108
108
  };
109
- w.prototype.on = w.prototype.addListener;
110
- w.prototype.prependListener = function(e, t) {
111
- return pt(this, e, t, !0);
109
+ v.prototype.on = v.prototype.addListener;
110
+ v.prototype.prependListener = function(e, t) {
111
+ return It(this, e, t, !0);
112
112
  };
113
- function Yt() {
113
+ function nn() {
114
114
  if (!this.fired)
115
115
  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);
116
116
  }
117
- function wt(n, e, t) {
118
- var i = { fired: !1, wrapFn: void 0, target: n, type: e, listener: t }, r = Yt.bind(i);
117
+ function Nt(n, e, t) {
118
+ var i = { fired: !1, wrapFn: void 0, target: n, type: e, listener: t }, r = nn.bind(i);
119
119
  return r.listener = t, i.wrapFn = r, r;
120
120
  }
121
- w.prototype.once = function(e, t) {
122
- return De(t), this.on(e, wt(this, e, t)), this;
121
+ v.prototype.once = function(e, t) {
122
+ return Ve(t), this.on(e, Nt(this, e, t)), this;
123
123
  };
124
- w.prototype.prependOnceListener = function(e, t) {
125
- return De(t), this.prependListener(e, wt(this, e, t)), this;
124
+ v.prototype.prependOnceListener = function(e, t) {
125
+ return Ve(t), this.prependListener(e, Nt(this, e, t)), this;
126
126
  };
127
- w.prototype.removeListener = function(e, t) {
127
+ v.prototype.removeListener = function(e, t) {
128
128
  var i, r, s, o, a;
129
- if (De(t), r = this._events, r === void 0)
129
+ if (Ve(t), r = this._events, r === void 0)
130
130
  return this;
131
131
  if (i = r[e], i === void 0)
132
132
  return this;
@@ -140,12 +140,12 @@ w.prototype.removeListener = function(e, t) {
140
140
  }
141
141
  if (s < 0)
142
142
  return this;
143
- s === 0 ? i.shift() : qt(i, s), i.length === 1 && (r[e] = i[0]), r.removeListener !== void 0 && this.emit("removeListener", e, a || t);
143
+ s === 0 ? i.shift() : rn(i, s), i.length === 1 && (r[e] = i[0]), r.removeListener !== void 0 && this.emit("removeListener", e, a || t);
144
144
  }
145
145
  return this;
146
146
  };
147
- w.prototype.off = w.prototype.removeListener;
148
- w.prototype.removeAllListeners = function(e) {
147
+ v.prototype.off = v.prototype.removeListener;
148
+ v.prototype.removeAllListeners = function(e) {
149
149
  var t, i, r;
150
150
  if (i = this._events, i === void 0)
151
151
  return this;
@@ -164,24 +164,24 @@ w.prototype.removeAllListeners = function(e) {
164
164
  this.removeListener(e, t[r]);
165
165
  return this;
166
166
  };
167
- function bt(n, e, t) {
167
+ function Et(n, e, t) {
168
168
  var i = n._events;
169
169
  if (i === void 0)
170
170
  return [];
171
171
  var r = i[e];
172
- return r === void 0 ? [] : typeof r == "function" ? t ? [r.listener || r] : [r] : t ? zt(r) : vt(r, r.length);
172
+ return r === void 0 ? [] : typeof r == "function" ? t ? [r.listener || r] : [r] : t ? sn(r) : Rt(r, r.length);
173
173
  }
174
- w.prototype.listeners = function(e) {
175
- return bt(this, e, !0);
174
+ v.prototype.listeners = function(e) {
175
+ return Et(this, e, !0);
176
176
  };
177
- w.prototype.rawListeners = function(e) {
178
- return bt(this, e, !1);
177
+ v.prototype.rawListeners = function(e) {
178
+ return Et(this, e, !1);
179
179
  };
180
- w.listenerCount = function(n, e) {
181
- return typeof n.listenerCount == "function" ? n.listenerCount(e) : yt.call(n, e);
180
+ v.listenerCount = function(n, e) {
181
+ return typeof n.listenerCount == "function" ? n.listenerCount(e) : Tt.call(n, e);
182
182
  };
183
- w.prototype.listenerCount = yt;
184
- function yt(n) {
183
+ v.prototype.listenerCount = Tt;
184
+ function Tt(n) {
185
185
  var e = this._events;
186
186
  if (e !== void 0) {
187
187
  var t = e[n];
@@ -192,25 +192,25 @@ function yt(n) {
192
192
  }
193
193
  return 0;
194
194
  }
195
- w.prototype.eventNames = function() {
196
- return this._eventsCount > 0 ? ye(this._events) : [];
195
+ v.prototype.eventNames = function() {
196
+ return this._eventsCount > 0 ? Ie(this._events) : [];
197
197
  };
198
- function vt(n, e) {
198
+ function Rt(n, e) {
199
199
  for (var t = new Array(e), i = 0; i < e; ++i)
200
200
  t[i] = n[i];
201
201
  return t;
202
202
  }
203
- function qt(n, e) {
203
+ function rn(n, e) {
204
204
  for (; e + 1 < n.length; e++)
205
205
  n[e] = n[e + 1];
206
206
  n.pop();
207
207
  }
208
- function zt(n) {
208
+ function sn(n) {
209
209
  for (var e = new Array(n.length), t = 0; t < e.length; ++t)
210
210
  e[t] = n[t].listener || n[t];
211
211
  return e;
212
212
  }
213
- function Qt(n, e) {
213
+ function on(n, e) {
214
214
  return new Promise(function(t, i) {
215
215
  function r(o) {
216
216
  n.removeListener(e, s), i(o);
@@ -218,13 +218,13 @@ function Qt(n, e) {
218
218
  function s() {
219
219
  typeof n.removeListener == "function" && n.removeListener("error", r), t([].slice.call(arguments));
220
220
  }
221
- kt(n, e, s, { once: !0 }), e !== "error" && Ht(n, r, { once: !0 });
221
+ Ot(n, e, s, { once: !0 }), e !== "error" && an(n, r, { once: !0 });
222
222
  });
223
223
  }
224
- function Ht(n, e, t) {
225
- typeof n.on == "function" && kt(n, "error", e, t);
224
+ function an(n, e, t) {
225
+ typeof n.on == "function" && Ot(n, "error", e, t);
226
226
  }
227
- function kt(n, e, t, i) {
227
+ function Ot(n, e, t, i) {
228
228
  if (typeof n.on == "function")
229
229
  i.once ? n.once(e, t) : n.on(e, t);
230
230
  else if (typeof n.addEventListener == "function")
@@ -234,10 +234,10 @@ function kt(n, e, t, i) {
234
234
  else
235
235
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof n);
236
236
  }
237
- var en = Ye.exports;
238
- class tn {
237
+ var cn = et.exports;
238
+ class un {
239
239
  constructor() {
240
- Qe(this, "client");
240
+ it(this, "client");
241
241
  }
242
242
  logToConsole() {
243
243
  return window.devMode === !0 && !this.isInitialized();
@@ -272,20 +272,20 @@ class tn {
272
272
  this.isInitialized() && ((r = this.client) == null || r.__internals__.logger.warn(this.generateMessage(e), t, i)), this.logToConsole() && console.warn(e);
273
273
  }
274
274
  }
275
- const v = new tn(), Nt = 1e3, nn = 60 * Nt, rn = 1 * Nt;
276
- var H, G, ge, oe, Ae, It;
277
- class sn extends en.EventEmitter {
275
+ const N = new un(), Lt = 1e3, fn = 60 * Lt, hn = 1 * Lt;
276
+ var H, G, we, ce, _e, St;
277
+ class ln extends cn.EventEmitter {
278
278
  constructor(t, i) {
279
279
  super();
280
- A(this, Ae);
281
- A(this, H, null);
282
- A(this, G, !1);
283
- A(this, ge, !1);
284
- A(this, oe, null);
285
- this.meeting = t, this.options = i, He(this, Ae, It).call(this);
280
+ D(this, _e);
281
+ D(this, H, null);
282
+ D(this, G, !1);
283
+ D(this, we, !1);
284
+ D(this, ce, null);
285
+ this.meeting = t, this.options = i, rt(this, _e, St).call(this);
286
286
  }
287
287
  cleanup() {
288
- v.info("Cleaning up recording controller"), delete window.dyteRecording, delete window.realtimeKitRecording, this.meeting.removeAllListeners(), this.removeAllListeners(), l(this, oe) !== null && clearInterval(l(this, oe));
288
+ N.info("Cleaning up recording controller"), delete window.dyteRecording, delete window.realtimeKitRecording, this.meeting.removeAllListeners(), this.removeAllListeners(), l(this, ce) !== null && clearInterval(l(this, ce));
289
289
  }
290
290
  getParticipantCount() {
291
291
  return this.meeting.getParticipantCount();
@@ -305,7 +305,7 @@ class sn extends en.EventEmitter {
305
305
  return;
306
306
  }
307
307
  if ((/* @__PURE__ */ new Date()).getTime() - l(this, H).getTime() > this.options.waitTimeMs) {
308
- v.info("Setting triggerDyteRecording & triggerRealtimeKitRecording to false"), C(this, G, !0), window.triggerDyteRecording = !1, window.triggerRealtimeKitRecording = !1;
308
+ N.info("Setting triggerDyteRecording & triggerRealtimeKitRecording to false"), C(this, G, !0), window.triggerDyteRecording = !1, window.triggerRealtimeKitRecording = !1;
309
309
  return;
310
310
  }
311
311
  C(this, G, !1), window.triggerDyteRecording = !0, window.triggerRealtimeKitRecording = !0;
@@ -313,13 +313,13 @@ class sn extends en.EventEmitter {
313
313
  stopRecording() {
314
314
  if (this.options.autoStop)
315
315
  throw new Error("Cannot stop recording when autoStop is true");
316
- v.info("Stopping recording"), window.triggerDyteRecording && (window.triggerDyteRecording = !1), window.triggerRealtimeKitRecording && (window.triggerRealtimeKitRecording = !1);
316
+ N.info("Stopping recording"), window.triggerDyteRecording && (window.triggerDyteRecording = !1), window.triggerRealtimeKitRecording && (window.triggerRealtimeKitRecording = !1);
317
317
  }
318
318
  get meetingJoined() {
319
- return l(this, ge);
319
+ return l(this, we);
320
320
  }
321
321
  }
322
- H = new WeakMap(), G = new WeakMap(), ge = new WeakMap(), oe = new WeakMap(), Ae = new WeakSet(), It = function() {
322
+ H = new WeakMap(), G = new WeakMap(), we = new WeakMap(), ce = new WeakMap(), _e = new WeakSet(), St = function() {
323
323
  window.dyteRecording !== void 0 && (window.dyteRecording = void 0, window.realtimeKitRecording = void 0, window.triggerDyteRecording = !1, window.triggerRealtimeKitRecording = !1), window.realtimeKitRecording !== void 0 && (window.dyteRecording = void 0, window.realtimeKitRecording = void 0, window.triggerDyteRecording = !1, window.triggerRealtimeKitRecording = !1), window.triggerDyteRecording = !0, window.triggerRealtimeKitRecording = !0, window.dyteRecording = {
324
324
  // Kept for backward compatibility with Dyte golang workers
325
325
  getParticipantCount: () => this.getParticipantCount(),
@@ -332,18 +332,18 @@ H = new WeakMap(), G = new WeakMap(), ge = new WeakMap(), oe = new WeakMap(), Ae
332
332
  isMeetingJoined: () => this.meetingJoined,
333
333
  getMeeting: () => this.meeting.getMeeting()
334
334
  }, this.meeting.handleParticipantJoin(() => {
335
- v.info(`Participant joined. Total participants: ${this.getParticipantCount()}. Scanning meeting state`), this.scanMeetingState(), this.emit("participantCount", this.getParticipantCount());
335
+ N.info(`Participant joined. Total participants: ${this.getParticipantCount()}. Scanning meeting state`), this.scanMeetingState(), this.emit("participantCount", this.getParticipantCount());
336
336
  }), this.meeting.handleParticipantLeave(() => {
337
- v.info(`Participant left. Remaining participants: ${this.getParticipantCount()}. Scanning meeting state`), this.scanMeetingState(), this.emit("participantCount", this.getParticipantCount());
337
+ N.info(`Participant left. Remaining participants: ${this.getParticipantCount()}. Scanning meeting state`), this.scanMeetingState(), this.emit("participantCount", this.getParticipantCount());
338
338
  }), this.meeting.handleMeetingJoined(() => {
339
- v.info("Meeting joined"), C(this, ge, !0), this.emit("participantCount", this.getParticipantCount());
339
+ N.info("Meeting joined"), C(this, we, !0), this.emit("participantCount", this.getParticipantCount());
340
340
  }), this.meeting.handleMeetingLeft(({ state: t }) => {
341
- t !== "ended" && t !== "kicked" || (v.info("Meeting ended"), this.emit("meetingEnded"), this.cleanup(), window.triggerDyteRecording = !1, window.triggerRealtimeKitRecording = !1);
342
- }), this.options.autoStop && C(this, oe, setInterval(() => {
341
+ t !== "ended" && t !== "kicked" || (N.info("Meeting ended"), this.emit("meetingEnded"), this.cleanup(), window.triggerDyteRecording = !1, window.triggerRealtimeKitRecording = !1);
342
+ }), this.options.autoStop && C(this, ce, setInterval(() => {
343
343
  this.scanMeetingState();
344
344
  }, this.options.scanInterval));
345
345
  };
346
- class on {
346
+ class dn {
347
347
  constructor(e) {
348
348
  this.meeting = e;
349
349
  }
@@ -372,7 +372,7 @@ class on {
372
372
  this.meeting.self.removeAllListeners();
373
373
  }
374
374
  }
375
- function Et(n) {
375
+ function Ft(n) {
376
376
  let e = typeof n;
377
377
  if (e == "object") {
378
378
  if (Array.isArray(n))
@@ -382,20 +382,20 @@ function Et(n) {
382
382
  }
383
383
  return e;
384
384
  }
385
- function an(n) {
385
+ function gn(n) {
386
386
  return n !== null && typeof n == "object" && !Array.isArray(n);
387
387
  }
388
- let W = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), xe = [];
388
+ let W = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), Ke = [];
389
389
  for (let n = 0; n < W.length; n++)
390
- xe[W[n].charCodeAt(0)] = n;
391
- xe["-".charCodeAt(0)] = W.indexOf("+");
392
- xe["_".charCodeAt(0)] = W.indexOf("/");
393
- function cn(n) {
390
+ Ke[W[n].charCodeAt(0)] = n;
391
+ Ke["-".charCodeAt(0)] = W.indexOf("+");
392
+ Ke["_".charCodeAt(0)] = W.indexOf("/");
393
+ function mn(n) {
394
394
  let e = n.length * 3 / 4;
395
395
  n[n.length - 2] == "=" ? e -= 2 : n[n.length - 1] == "=" && (e -= 1);
396
396
  let t = new Uint8Array(e), i = 0, r = 0, s, o = 0;
397
397
  for (let a = 0; a < n.length; a++) {
398
- if (s = xe[n.charCodeAt(a)], s === void 0)
398
+ if (s = Ke[n.charCodeAt(a)], s === void 0)
399
399
  switch (n[a]) {
400
400
  case "=":
401
401
  r = 0;
@@ -427,7 +427,7 @@ function cn(n) {
427
427
  throw Error("invalid base64 string.");
428
428
  return t.subarray(0, i);
429
429
  }
430
- function un(n) {
430
+ function pn(n) {
431
431
  let e = "", t = 0, i, r = 0;
432
432
  for (let s = 0; s < n.length; s++)
433
433
  switch (i = n[s], t) {
@@ -443,7 +443,7 @@ function un(n) {
443
443
  }
444
444
  return t && (e += W[r], e += "=", t == 1 && (e += "=")), e;
445
445
  }
446
- var Ee;
446
+ var Se;
447
447
  (function(n) {
448
448
  n.symbol = Symbol.for("protobuf-ts/unknown"), n.onRead = (t, i, r, s, o) => {
449
449
  (e(i) ? i[n.symbol] : i[n.symbol] = []).push({ no: r, wireType: s, data: o });
@@ -458,12 +458,12 @@ var Ee;
458
458
  return [];
459
459
  }, n.last = (t, i) => n.list(t, i).slice(-1)[0];
460
460
  const e = (t) => t && Array.isArray(t[n.symbol]);
461
- })(Ee || (Ee = {}));
462
- var O;
461
+ })(Se || (Se = {}));
462
+ var L;
463
463
  (function(n) {
464
464
  n[n.Varint = 0] = "Varint", n[n.Bit64 = 1] = "Bit64", n[n.LengthDelimited = 2] = "LengthDelimited", n[n.StartGroup = 3] = "StartGroup", n[n.EndGroup = 4] = "EndGroup", n[n.Bit32 = 5] = "Bit32";
465
- })(O || (O = {}));
466
- function fn() {
465
+ })(L || (L = {}));
466
+ function wn() {
467
467
  let n = 0, e = 0;
468
468
  for (let i = 0; i < 28; i += 7) {
469
469
  let r = this.buf[this.pos++];
@@ -480,7 +480,7 @@ function fn() {
480
480
  }
481
481
  throw new Error("invalid varint");
482
482
  }
483
- function Ve(n, e, t) {
483
+ function $e(n, e, t) {
484
484
  for (let s = 0; s < 28; s = s + 7) {
485
485
  const o = n >>> s, a = !(!(o >>> 7) && e == 0), f = (a ? o | 128 : o) & 255;
486
486
  if (t.push(f), !a)
@@ -496,26 +496,26 @@ function Ve(n, e, t) {
496
496
  t.push(e >>> 31 & 1);
497
497
  }
498
498
  }
499
- const ve = 65536 * 65536;
500
- function Tt(n) {
499
+ const Ne = 65536 * 65536;
500
+ function Ct(n) {
501
501
  let e = n[0] == "-";
502
502
  e && (n = n.slice(1));
503
503
  const t = 1e6;
504
504
  let i = 0, r = 0;
505
505
  function s(o, a) {
506
506
  const f = Number(n.slice(o, a));
507
- r *= t, i = i * t + f, i >= ve && (r = r + (i / ve | 0), i = i % ve);
507
+ r *= t, i = i * t + f, i >= Ne && (r = r + (i / Ne | 0), i = i % Ne);
508
508
  }
509
509
  return s(-24, -18), s(-18, -12), s(-12, -6), s(-6), [e, i, r];
510
510
  }
511
- function Pe(n, e) {
511
+ function Xe(n, e) {
512
512
  if (e >>> 0 <= 2097151)
513
- return "" + (ve * e + (n >>> 0));
513
+ return "" + (Ne * e + (n >>> 0));
514
514
  let t = n & 16777215, i = (n >>> 24 | e << 8) >>> 0 & 16777215, r = e >> 16 & 65535, s = t + i * 6777216 + r * 6710656, o = i + r * 8147497, a = r * 2, f = 1e7;
515
515
  s >= f && (o += Math.floor(s / f), s %= f), o >= f && (a += Math.floor(o / f), o %= f);
516
- function h(d, k) {
517
- let m = d ? String(d) : "";
518
- return k ? "0000000".slice(m.length) + m : m;
516
+ function h(d, E) {
517
+ let g = d ? String(d) : "";
518
+ return E ? "0000000".slice(g.length) + g : g;
519
519
  }
520
520
  return h(
521
521
  a,
@@ -533,7 +533,7 @@ function Pe(n, e) {
533
533
  1
534
534
  );
535
535
  }
536
- function nt(n, e) {
536
+ function at(n, e) {
537
537
  if (n >= 0) {
538
538
  for (; n > 127; )
539
539
  e.push(n & 127 | 128), n = n >>> 7;
@@ -544,7 +544,7 @@ function nt(n, e) {
544
544
  e.push(1);
545
545
  }
546
546
  }
547
- function hn() {
547
+ function bn() {
548
548
  let n = this.buf[this.pos++], e = n & 127;
549
549
  if (!(n & 128))
550
550
  return this.assertBounds(), e;
@@ -561,10 +561,10 @@ function hn() {
561
561
  throw new Error("invalid varint");
562
562
  return this.assertBounds(), e >>> 0;
563
563
  }
564
- let y;
565
- function ln() {
564
+ let I;
565
+ function yn() {
566
566
  const n = new DataView(new ArrayBuffer(8));
567
- y = globalThis.BigInt !== void 0 && typeof n.getBigInt64 == "function" && typeof n.getBigUint64 == "function" && typeof n.setBigInt64 == "function" && typeof n.setBigUint64 == "function" ? {
567
+ I = globalThis.BigInt !== void 0 && typeof n.getBigInt64 == "function" && typeof n.getBigUint64 == "function" && typeof n.setBigInt64 == "function" && typeof n.setBigUint64 == "function" ? {
568
568
  MIN: BigInt("-9223372036854775808"),
569
569
  MAX: BigInt("9223372036854775807"),
570
570
  UMIN: BigInt("0"),
@@ -573,13 +573,13 @@ function ln() {
573
573
  V: n
574
574
  } : void 0;
575
575
  }
576
- ln();
577
- function Rt(n) {
576
+ yn();
577
+ function Mt(n) {
578
578
  if (!n)
579
579
  throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support");
580
580
  }
581
- const Ot = /^-?[0-9]+$/, Te = 4294967296, we = 2147483648;
582
- class Lt {
581
+ const At = /^-?[0-9]+$/, Fe = 4294967296, ve = 2147483648;
582
+ class Dt {
583
583
  /**
584
584
  * Create a new instance with the given bits.
585
585
  */
@@ -596,46 +596,46 @@ class Lt {
596
596
  * Convert to a native number.
597
597
  */
598
598
  toNumber() {
599
- let e = this.hi * Te + (this.lo >>> 0);
599
+ let e = this.hi * Fe + (this.lo >>> 0);
600
600
  if (!Number.isSafeInteger(e))
601
601
  throw new Error("cannot convert to safe number");
602
602
  return e;
603
603
  }
604
604
  }
605
- class M extends Lt {
605
+ class M extends Dt {
606
606
  /**
607
607
  * Create instance from a `string`, `number` or `bigint`.
608
608
  */
609
609
  static from(e) {
610
- if (y)
610
+ if (I)
611
611
  switch (typeof e) {
612
612
  case "string":
613
613
  if (e == "0")
614
614
  return this.ZERO;
615
615
  if (e == "")
616
616
  throw new Error("string is no integer");
617
- e = y.C(e);
617
+ e = I.C(e);
618
618
  case "number":
619
619
  if (e === 0)
620
620
  return this.ZERO;
621
- e = y.C(e);
621
+ e = I.C(e);
622
622
  case "bigint":
623
623
  if (!e)
624
624
  return this.ZERO;
625
- if (e < y.UMIN)
625
+ if (e < I.UMIN)
626
626
  throw new Error("signed value for ulong");
627
- if (e > y.UMAX)
627
+ if (e > I.UMAX)
628
628
  throw new Error("ulong too large");
629
- return y.V.setBigUint64(0, e, !0), new M(y.V.getInt32(0, !0), y.V.getInt32(4, !0));
629
+ return I.V.setBigUint64(0, e, !0), new M(I.V.getInt32(0, !0), I.V.getInt32(4, !0));
630
630
  }
631
631
  else
632
632
  switch (typeof e) {
633
633
  case "string":
634
634
  if (e == "0")
635
635
  return this.ZERO;
636
- if (e = e.trim(), !Ot.test(e))
636
+ if (e = e.trim(), !At.test(e))
637
637
  throw new Error("string is no integer");
638
- let [t, i, r] = Tt(e);
638
+ let [t, i, r] = Ct(e);
639
639
  if (t)
640
640
  throw new Error("signed value for ulong");
641
641
  return new M(i, r);
@@ -646,7 +646,7 @@ class M extends Lt {
646
646
  throw new Error("number is no integer");
647
647
  if (e < 0)
648
648
  throw new Error("signed value for ulong");
649
- return new M(e, e / Te);
649
+ return new M(e, e / Fe);
650
650
  }
651
651
  throw new Error("unknown value " + typeof e);
652
652
  }
@@ -654,54 +654,54 @@ class M extends Lt {
654
654
  * Convert to decimal string.
655
655
  */
656
656
  toString() {
657
- return y ? this.toBigInt().toString() : Pe(this.lo, this.hi);
657
+ return I ? this.toBigInt().toString() : Xe(this.lo, this.hi);
658
658
  }
659
659
  /**
660
660
  * Convert to native bigint.
661
661
  */
662
662
  toBigInt() {
663
- return Rt(y), y.V.setInt32(0, this.lo, !0), y.V.setInt32(4, this.hi, !0), y.V.getBigUint64(0, !0);
663
+ return Mt(I), I.V.setInt32(0, this.lo, !0), I.V.setInt32(4, this.hi, !0), I.V.getBigUint64(0, !0);
664
664
  }
665
665
  }
666
666
  M.ZERO = new M(0, 0);
667
- class S extends Lt {
667
+ class S extends Dt {
668
668
  /**
669
669
  * Create instance from a `string`, `number` or `bigint`.
670
670
  */
671
671
  static from(e) {
672
- if (y)
672
+ if (I)
673
673
  switch (typeof e) {
674
674
  case "string":
675
675
  if (e == "0")
676
676
  return this.ZERO;
677
677
  if (e == "")
678
678
  throw new Error("string is no integer");
679
- e = y.C(e);
679
+ e = I.C(e);
680
680
  case "number":
681
681
  if (e === 0)
682
682
  return this.ZERO;
683
- e = y.C(e);
683
+ e = I.C(e);
684
684
  case "bigint":
685
685
  if (!e)
686
686
  return this.ZERO;
687
- if (e < y.MIN)
687
+ if (e < I.MIN)
688
688
  throw new Error("signed long too small");
689
- if (e > y.MAX)
689
+ if (e > I.MAX)
690
690
  throw new Error("signed long too large");
691
- return y.V.setBigInt64(0, e, !0), new S(y.V.getInt32(0, !0), y.V.getInt32(4, !0));
691
+ return I.V.setBigInt64(0, e, !0), new S(I.V.getInt32(0, !0), I.V.getInt32(4, !0));
692
692
  }
693
693
  else
694
694
  switch (typeof e) {
695
695
  case "string":
696
696
  if (e == "0")
697
697
  return this.ZERO;
698
- if (e = e.trim(), !Ot.test(e))
698
+ if (e = e.trim(), !At.test(e))
699
699
  throw new Error("string is no integer");
700
- let [t, i, r] = Tt(e);
700
+ let [t, i, r] = Ct(e);
701
701
  if (t) {
702
- if (r > we || r == we && i != 0)
702
+ if (r > ve || r == ve && i != 0)
703
703
  throw new Error("signed long too small");
704
- } else if (r >= we)
704
+ } else if (r >= ve)
705
705
  throw new Error("signed long too large");
706
706
  let s = new S(i, r);
707
707
  return t ? s.negate() : s;
@@ -710,7 +710,7 @@ class S extends Lt {
710
710
  return this.ZERO;
711
711
  if (!Number.isSafeInteger(e))
712
712
  throw new Error("number is no integer");
713
- return e > 0 ? new S(e, e / Te) : new S(-e, -e / Te).negate();
713
+ return e > 0 ? new S(e, e / Fe) : new S(-e, -e / Fe).negate();
714
714
  }
715
715
  throw new Error("unknown value " + typeof e);
716
716
  }
@@ -718,7 +718,7 @@ class S extends Lt {
718
718
  * Do we have a minus sign?
719
719
  */
720
720
  isNegative() {
721
- return (this.hi & we) !== 0;
721
+ return (this.hi & ve) !== 0;
722
722
  }
723
723
  /**
724
724
  * Negate two's complement.
@@ -732,32 +732,32 @@ class S extends Lt {
732
732
  * Convert to decimal string.
733
733
  */
734
734
  toString() {
735
- if (y)
735
+ if (I)
736
736
  return this.toBigInt().toString();
737
737
  if (this.isNegative()) {
738
738
  let e = this.negate();
739
- return "-" + Pe(e.lo, e.hi);
739
+ return "-" + Xe(e.lo, e.hi);
740
740
  }
741
- return Pe(this.lo, this.hi);
741
+ return Xe(this.lo, this.hi);
742
742
  }
743
743
  /**
744
744
  * Convert to native bigint.
745
745
  */
746
746
  toBigInt() {
747
- return Rt(y), y.V.setInt32(0, this.lo, !0), y.V.setInt32(4, this.hi, !0), y.V.getBigInt64(0, !0);
747
+ return Mt(I), I.V.setInt32(0, this.lo, !0), I.V.setInt32(4, this.hi, !0), I.V.getBigInt64(0, !0);
748
748
  }
749
749
  }
750
750
  S.ZERO = new S(0, 0);
751
- const it = {
751
+ const ct = {
752
752
  readUnknownField: !0,
753
- readerFactory: (n) => new gn(n)
753
+ readerFactory: (n) => new kn(n)
754
754
  };
755
- function dn(n) {
756
- return n ? Object.assign(Object.assign({}, it), n) : it;
755
+ function vn(n) {
756
+ return n ? Object.assign(Object.assign({}, ct), n) : ct;
757
757
  }
758
- class gn {
758
+ class kn {
759
759
  constructor(e, t) {
760
- this.varint64 = fn, this.uint32 = hn, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder("utf-8", {
760
+ this.varint64 = wn, this.uint32 = bn, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder("utf-8", {
761
761
  fatal: !0,
762
762
  ignoreBOM: !0
763
763
  });
@@ -778,22 +778,22 @@ class gn {
778
778
  skip(e) {
779
779
  let t = this.pos;
780
780
  switch (e) {
781
- case O.Varint:
781
+ case L.Varint:
782
782
  for (; this.buf[this.pos++] & 128; )
783
783
  ;
784
784
  break;
785
- case O.Bit64:
785
+ case L.Bit64:
786
786
  this.pos += 4;
787
- case O.Bit32:
787
+ case L.Bit32:
788
788
  this.pos += 4;
789
789
  break;
790
- case O.LengthDelimited:
790
+ case L.LengthDelimited:
791
791
  let i = this.uint32();
792
792
  this.pos += i;
793
793
  break;
794
- case O.StartGroup:
794
+ case L.StartGroup:
795
795
  let r;
796
- for (; (r = this.tag()[1]) !== O.EndGroup; )
796
+ for (; (r = this.tag()[1]) !== L.EndGroup; )
797
797
  this.skip(r);
798
798
  break;
799
799
  default:
@@ -897,37 +897,37 @@ class gn {
897
897
  return this.textDecoder.decode(this.bytes());
898
898
  }
899
899
  }
900
- function g(n, e) {
900
+ function m(n, e) {
901
901
  if (!n)
902
902
  throw new Error(e);
903
903
  }
904
- const mn = 34028234663852886e22, pn = -34028234663852886e22, wn = 4294967295, bn = 2147483647, yn = -2147483648;
905
- function ue(n) {
904
+ const In = 34028234663852886e22, Nn = -34028234663852886e22, En = 4294967295, Tn = 2147483647, Rn = -2147483648;
905
+ function he(n) {
906
906
  if (typeof n != "number")
907
907
  throw new Error("invalid int 32: " + typeof n);
908
- if (!Number.isInteger(n) || n > bn || n < yn)
908
+ if (!Number.isInteger(n) || n > Tn || n < Rn)
909
909
  throw new Error("invalid int 32: " + n);
910
910
  }
911
- function Re(n) {
911
+ function Ce(n) {
912
912
  if (typeof n != "number")
913
913
  throw new Error("invalid uint 32: " + typeof n);
914
- if (!Number.isInteger(n) || n > wn || n < 0)
914
+ if (!Number.isInteger(n) || n > En || n < 0)
915
915
  throw new Error("invalid uint 32: " + n);
916
916
  }
917
- function qe(n) {
917
+ function tt(n) {
918
918
  if (typeof n != "number")
919
919
  throw new Error("invalid float 32: " + typeof n);
920
- if (Number.isFinite(n) && (n > mn || n < pn))
920
+ if (Number.isFinite(n) && (n > In || n < Nn))
921
921
  throw new Error("invalid float 32: " + n);
922
922
  }
923
- const rt = {
923
+ const ut = {
924
924
  writeUnknownFields: !0,
925
- writerFactory: () => new kn()
925
+ writerFactory: () => new Ln()
926
926
  };
927
- function vn(n) {
928
- return n ? Object.assign(Object.assign({}, rt), n) : rt;
927
+ function On(n) {
928
+ return n ? Object.assign(Object.assign({}, ut), n) : ut;
929
929
  }
930
- class kn {
930
+ class Ln {
931
931
  constructor(e) {
932
932
  this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
933
933
  }
@@ -983,7 +983,7 @@ class kn {
983
983
  * Write a `uint32` value, an unsigned 32 bit varint.
984
984
  */
985
985
  uint32(e) {
986
- for (Re(e); e > 127; )
986
+ for (Ce(e); e > 127; )
987
987
  this.buf.push(e & 127 | 128), e = e >>> 7;
988
988
  return this.buf.push(e), this;
989
989
  }
@@ -991,7 +991,7 @@ class kn {
991
991
  * Write a `int32` value, a signed 32 bit varint.
992
992
  */
993
993
  int32(e) {
994
- return ue(e), nt(e, this.buf), this;
994
+ return he(e), at(e, this.buf), this;
995
995
  }
996
996
  /**
997
997
  * Write a `bool` value, a variant.
@@ -1016,7 +1016,7 @@ class kn {
1016
1016
  * Write a `float` value, 32-bit floating point number.
1017
1017
  */
1018
1018
  float(e) {
1019
- qe(e);
1019
+ tt(e);
1020
1020
  let t = new Uint8Array(4);
1021
1021
  return new DataView(t.buffer).setFloat32(0, e, !0), this.raw(t);
1022
1022
  }
@@ -1031,7 +1031,7 @@ class kn {
1031
1031
  * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
1032
1032
  */
1033
1033
  fixed32(e) {
1034
- Re(e);
1034
+ Ce(e);
1035
1035
  let t = new Uint8Array(4);
1036
1036
  return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t);
1037
1037
  }
@@ -1039,7 +1039,7 @@ class kn {
1039
1039
  * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
1040
1040
  */
1041
1041
  sfixed32(e) {
1042
- ue(e);
1042
+ he(e);
1043
1043
  let t = new Uint8Array(4);
1044
1044
  return new DataView(t.buffer).setInt32(0, e, !0), this.raw(t);
1045
1045
  }
@@ -1047,7 +1047,7 @@ class kn {
1047
1047
  * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
1048
1048
  */
1049
1049
  sint32(e) {
1050
- return ue(e), e = (e << 1 ^ e >> 31) >>> 0, nt(e, this.buf), this;
1050
+ return he(e), e = (e << 1 ^ e >> 31) >>> 0, at(e, this.buf), this;
1051
1051
  }
1052
1052
  /**
1053
1053
  * Write a `fixed64` value, a signed, fixed-length 64-bit integer.
@@ -1068,39 +1068,39 @@ class kn {
1068
1068
  */
1069
1069
  int64(e) {
1070
1070
  let t = S.from(e);
1071
- return Ve(t.lo, t.hi, this.buf), this;
1071
+ return $e(t.lo, t.hi, this.buf), this;
1072
1072
  }
1073
1073
  /**
1074
1074
  * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
1075
1075
  */
1076
1076
  sint64(e) {
1077
1077
  let t = S.from(e), i = t.hi >> 31, r = t.lo << 1 ^ i, s = (t.hi << 1 | t.lo >>> 31) ^ i;
1078
- return Ve(r, s, this.buf), this;
1078
+ return $e(r, s, this.buf), this;
1079
1079
  }
1080
1080
  /**
1081
1081
  * Write a `uint64` value, an unsigned 64-bit varint.
1082
1082
  */
1083
1083
  uint64(e) {
1084
1084
  let t = M.from(e);
1085
- return Ve(t.lo, t.hi, this.buf), this;
1085
+ return $e(t.lo, t.hi, this.buf), this;
1086
1086
  }
1087
1087
  }
1088
- const st = {
1088
+ const ft = {
1089
1089
  emitDefaultValues: !1,
1090
1090
  enumAsInteger: !1,
1091
1091
  useProtoFieldName: !1,
1092
1092
  prettySpaces: 0
1093
- }, ot = {
1093
+ }, ht = {
1094
1094
  ignoreUnknownFields: !1
1095
1095
  };
1096
- function Nn(n) {
1097
- return n ? Object.assign(Object.assign({}, ot), n) : ot;
1096
+ function Sn(n) {
1097
+ return n ? Object.assign(Object.assign({}, ht), n) : ht;
1098
1098
  }
1099
- function In(n) {
1100
- return n ? Object.assign(Object.assign({}, st), n) : st;
1099
+ function Fn(n) {
1100
+ return n ? Object.assign(Object.assign({}, ft), n) : ft;
1101
1101
  }
1102
- const St = Symbol.for("protobuf-ts/message-type");
1103
- function at(n) {
1102
+ const xt = Symbol.for("protobuf-ts/message-type");
1103
+ function lt(n) {
1104
1104
  let e = !1;
1105
1105
  const t = [];
1106
1106
  for (let i = 0; i < n.length; i++) {
@@ -1109,23 +1109,23 @@ function at(n) {
1109
1109
  }
1110
1110
  return t.join("");
1111
1111
  }
1112
- var c;
1112
+ var u;
1113
1113
  (function(n) {
1114
1114
  n[n.DOUBLE = 1] = "DOUBLE", n[n.FLOAT = 2] = "FLOAT", n[n.INT64 = 3] = "INT64", n[n.UINT64 = 4] = "UINT64", n[n.INT32 = 5] = "INT32", n[n.FIXED64 = 6] = "FIXED64", n[n.FIXED32 = 7] = "FIXED32", n[n.BOOL = 8] = "BOOL", n[n.STRING = 9] = "STRING", n[n.BYTES = 12] = "BYTES", n[n.UINT32 = 13] = "UINT32", n[n.SFIXED32 = 15] = "SFIXED32", n[n.SFIXED64 = 16] = "SFIXED64", n[n.SINT32 = 17] = "SINT32", n[n.SINT64 = 18] = "SINT64";
1115
- })(c || (c = {}));
1116
- var V;
1115
+ })(u || (u = {}));
1116
+ var K;
1117
1117
  (function(n) {
1118
1118
  n[n.BIGINT = 0] = "BIGINT", n[n.STRING = 1] = "STRING", n[n.NUMBER = 2] = "NUMBER";
1119
- })(V || (V = {}));
1120
- var Oe;
1119
+ })(K || (K = {}));
1120
+ var Me;
1121
1121
  (function(n) {
1122
1122
  n[n.NO = 0] = "NO", n[n.PACKED = 1] = "PACKED", n[n.UNPACKED = 2] = "UNPACKED";
1123
- })(Oe || (Oe = {}));
1124
- function En(n) {
1123
+ })(Me || (Me = {}));
1124
+ function Cn(n) {
1125
1125
  var e, t, i, r;
1126
- return n.localName = (e = n.localName) !== null && e !== void 0 ? e : at(n.name), n.jsonName = (t = n.jsonName) !== null && t !== void 0 ? t : at(n.name), n.repeat = (i = n.repeat) !== null && i !== void 0 ? i : Oe.NO, n.opt = (r = n.opt) !== null && r !== void 0 ? r : n.repeat || n.oneof ? !1 : n.kind == "message", n;
1126
+ return n.localName = (e = n.localName) !== null && e !== void 0 ? e : lt(n.name), n.jsonName = (t = n.jsonName) !== null && t !== void 0 ? t : lt(n.name), n.repeat = (i = n.repeat) !== null && i !== void 0 ? i : Me.NO, n.opt = (r = n.opt) !== null && r !== void 0 ? r : n.repeat || n.oneof ? !1 : n.kind == "message", n;
1127
1127
  }
1128
- function Tn(n) {
1128
+ function Mn(n) {
1129
1129
  if (typeof n != "object" || n === null || !n.hasOwnProperty("oneofKind"))
1130
1130
  return !1;
1131
1131
  switch (typeof n.oneofKind) {
@@ -1137,7 +1137,7 @@ function Tn(n) {
1137
1137
  return !1;
1138
1138
  }
1139
1139
  }
1140
- class Rn {
1140
+ class An {
1141
1141
  constructor(e) {
1142
1142
  var t;
1143
1143
  this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
@@ -1197,7 +1197,7 @@ class Rn {
1197
1197
  return !0;
1198
1198
  for (const o of s.oneofs) {
1199
1199
  const a = e[o];
1200
- if (!Tn(a))
1200
+ if (!Mn(a))
1201
1201
  return !1;
1202
1202
  if (a.oneofKind === void 0)
1203
1203
  continue;
@@ -1216,7 +1216,7 @@ class Rn {
1216
1216
  case "scalar":
1217
1217
  return e === void 0 ? t.opt : s ? this.scalars(e, t.T, r, t.L) : this.scalar(e, t.T, t.L);
1218
1218
  case "enum":
1219
- return e === void 0 ? t.opt : s ? this.scalars(e, c.INT32, r) : this.scalar(e, c.INT32);
1219
+ return e === void 0 ? t.opt : s ? this.scalars(e, u.INT32, r) : this.scalar(e, u.INT32);
1220
1220
  case "message":
1221
1221
  return e === void 0 ? !0 : s ? this.messages(e, t.T(), i, r) : this.message(e, t.T(), i, r);
1222
1222
  case "map":
@@ -1230,7 +1230,7 @@ class Rn {
1230
1230
  case "scalar":
1231
1231
  return this.scalars(Object.values(e), t.V.T, r, t.V.L);
1232
1232
  case "enum":
1233
- return this.scalars(Object.values(e), c.INT32, r);
1233
+ return this.scalars(Object.values(e), u.INT32, r);
1234
1234
  case "message":
1235
1235
  return this.messages(Object.values(e), t.V.T(), i, r);
1236
1236
  }
@@ -1259,27 +1259,27 @@ class Rn {
1259
1259
  scalar(e, t, i) {
1260
1260
  let r = typeof e;
1261
1261
  switch (t) {
1262
- case c.UINT64:
1263
- case c.FIXED64:
1264
- case c.INT64:
1265
- case c.SFIXED64:
1266
- case c.SINT64:
1262
+ case u.UINT64:
1263
+ case u.FIXED64:
1264
+ case u.INT64:
1265
+ case u.SFIXED64:
1266
+ case u.SINT64:
1267
1267
  switch (i) {
1268
- case V.BIGINT:
1268
+ case K.BIGINT:
1269
1269
  return r == "bigint";
1270
- case V.NUMBER:
1270
+ case K.NUMBER:
1271
1271
  return r == "number" && !isNaN(e);
1272
1272
  default:
1273
1273
  return r == "string";
1274
1274
  }
1275
- case c.BOOL:
1275
+ case u.BOOL:
1276
1276
  return r == "boolean";
1277
- case c.STRING:
1277
+ case u.STRING:
1278
1278
  return r == "string";
1279
- case c.BYTES:
1279
+ case u.BYTES:
1280
1280
  return e instanceof Uint8Array;
1281
- case c.DOUBLE:
1282
- case c.FLOAT:
1281
+ case u.DOUBLE:
1282
+ case u.FLOAT:
1283
1283
  return r == "number" && !isNaN(e);
1284
1284
  default:
1285
1285
  return r == "number" && Number.isInteger(e);
@@ -1300,30 +1300,30 @@ class Rn {
1300
1300
  mapKeys(e, t, i) {
1301
1301
  let r = Object.keys(e);
1302
1302
  switch (t) {
1303
- case c.INT32:
1304
- case c.FIXED32:
1305
- case c.SFIXED32:
1306
- case c.SINT32:
1307
- case c.UINT32:
1303
+ case u.INT32:
1304
+ case u.FIXED32:
1305
+ case u.SFIXED32:
1306
+ case u.SINT32:
1307
+ case u.UINT32:
1308
1308
  return this.scalars(r.slice(0, i).map((s) => parseInt(s)), t, i);
1309
- case c.BOOL:
1309
+ case u.BOOL:
1310
1310
  return this.scalars(r.slice(0, i).map((s) => s == "true" ? !0 : s == "false" ? !1 : s), t, i);
1311
1311
  default:
1312
- return this.scalars(r, t, i, V.STRING);
1312
+ return this.scalars(r, t, i, K.STRING);
1313
1313
  }
1314
1314
  }
1315
1315
  }
1316
1316
  function _(n, e) {
1317
1317
  switch (e) {
1318
- case V.BIGINT:
1318
+ case K.BIGINT:
1319
1319
  return n.toBigInt();
1320
- case V.NUMBER:
1320
+ case K.NUMBER:
1321
1321
  return n.toNumber();
1322
1322
  default:
1323
1323
  return n.toString();
1324
1324
  }
1325
1325
  }
1326
- class On {
1326
+ class Dn {
1327
1327
  constructor(e) {
1328
1328
  this.info = e;
1329
1329
  }
@@ -1339,7 +1339,7 @@ class On {
1339
1339
  // Cannot parse JSON <type of jsonValue> for <type name>#<fieldName>.
1340
1340
  assert(e, t, i) {
1341
1341
  if (!e) {
1342
- let r = Et(i);
1342
+ let r = Ft(i);
1343
1343
  throw (r == "number" || r == "boolean") && (r = i.toString()), new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`);
1344
1344
  }
1345
1345
  }
@@ -1377,48 +1377,48 @@ class On {
1377
1377
  if (a.kind == "map") {
1378
1378
  if (o === null)
1379
1379
  continue;
1380
- this.assert(an(o), a.name, o);
1380
+ this.assert(gn(o), a.name, o);
1381
1381
  const d = h[f];
1382
- for (const [k, m] of Object.entries(o)) {
1383
- this.assert(m !== null, a.name + " map value", null);
1384
- let D;
1382
+ for (const [E, g] of Object.entries(o)) {
1383
+ this.assert(g !== null, a.name + " map value", null);
1384
+ let A;
1385
1385
  switch (a.V.kind) {
1386
1386
  case "message":
1387
- D = a.V.T().internalJsonRead(m, i);
1387
+ A = a.V.T().internalJsonRead(g, i);
1388
1388
  break;
1389
1389
  case "enum":
1390
- if (D = this.enum(a.V.T(), m, a.name, i.ignoreUnknownFields), D === !1)
1390
+ if (A = this.enum(a.V.T(), g, a.name, i.ignoreUnknownFields), A === !1)
1391
1391
  continue;
1392
1392
  break;
1393
1393
  case "scalar":
1394
- D = this.scalar(m, a.V.T, a.V.L, a.name);
1394
+ A = this.scalar(g, a.V.T, a.V.L, a.name);
1395
1395
  break;
1396
1396
  }
1397
- this.assert(D !== void 0, a.name + " map value", m);
1398
- let K = k;
1399
- a.K == c.BOOL && (K = K == "true" ? !0 : K == "false" ? !1 : K), K = this.scalar(K, a.K, V.STRING, a.name).toString(), d[K] = D;
1397
+ this.assert(A !== void 0, a.name + " map value", g);
1398
+ let U = E;
1399
+ a.K == u.BOOL && (U = U == "true" ? !0 : U == "false" ? !1 : U), U = this.scalar(U, a.K, K.STRING, a.name).toString(), d[U] = A;
1400
1400
  }
1401
1401
  } else if (a.repeat) {
1402
1402
  if (o === null)
1403
1403
  continue;
1404
1404
  this.assert(Array.isArray(o), a.name, o);
1405
1405
  const d = h[f];
1406
- for (const k of o) {
1407
- this.assert(k !== null, a.name, null);
1408
- let m;
1406
+ for (const E of o) {
1407
+ this.assert(E !== null, a.name, null);
1408
+ let g;
1409
1409
  switch (a.kind) {
1410
1410
  case "message":
1411
- m = a.T().internalJsonRead(k, i);
1411
+ g = a.T().internalJsonRead(E, i);
1412
1412
  break;
1413
1413
  case "enum":
1414
- if (m = this.enum(a.T(), k, a.name, i.ignoreUnknownFields), m === !1)
1414
+ if (g = this.enum(a.T(), E, a.name, i.ignoreUnknownFields), g === !1)
1415
1415
  continue;
1416
1416
  break;
1417
1417
  case "scalar":
1418
- m = this.scalar(k, a.T, a.L, a.name);
1418
+ g = this.scalar(E, a.T, a.L, a.name);
1419
1419
  break;
1420
1420
  }
1421
- this.assert(m !== void 0, a.name, o), d.push(m);
1421
+ this.assert(g !== void 0, a.name, o), d.push(g);
1422
1422
  }
1423
1423
  } else
1424
1424
  switch (a.kind) {
@@ -1451,25 +1451,25 @@ class On {
1451
1451
  * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`).
1452
1452
  */
1453
1453
  enum(e, t, i, r) {
1454
- if (e[0] == "google.protobuf.NullValue" && g(t === null || t === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} only accepts null.`), t === null)
1454
+ if (e[0] == "google.protobuf.NullValue" && m(t === null || t === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} only accepts null.`), t === null)
1455
1455
  return 0;
1456
1456
  switch (typeof t) {
1457
1457
  case "number":
1458
- return g(Number.isInteger(t), `Unable to parse field ${this.info.typeName}#${i}, enum can only be integral number, got ${t}.`), t;
1458
+ return m(Number.isInteger(t), `Unable to parse field ${this.info.typeName}#${i}, enum can only be integral number, got ${t}.`), t;
1459
1459
  case "string":
1460
1460
  let s = t;
1461
1461
  e[2] && t.substring(0, e[2].length) === e[2] && (s = t.substring(e[2].length));
1462
1462
  let o = e[1][s];
1463
- return typeof o > "u" && r ? !1 : (g(typeof o == "number", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} has no value for "${t}".`), o);
1463
+ return typeof o > "u" && r ? !1 : (m(typeof o == "number", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} has no value for "${t}".`), o);
1464
1464
  }
1465
- g(!1, `Unable to parse field ${this.info.typeName}#${i}, cannot parse enum value from ${typeof t}".`);
1465
+ m(!1, `Unable to parse field ${this.info.typeName}#${i}, cannot parse enum value from ${typeof t}".`);
1466
1466
  }
1467
1467
  scalar(e, t, i, r) {
1468
1468
  let s;
1469
1469
  try {
1470
1470
  switch (t) {
1471
- case c.DOUBLE:
1472
- case c.FLOAT:
1471
+ case u.DOUBLE:
1472
+ case u.FLOAT:
1473
1473
  if (e === null)
1474
1474
  return 0;
1475
1475
  if (e === "NaN")
@@ -1497,40 +1497,40 @@ class On {
1497
1497
  s = "too large or small";
1498
1498
  break;
1499
1499
  }
1500
- return t == c.FLOAT && qe(o), o;
1501
- case c.INT32:
1502
- case c.FIXED32:
1503
- case c.SFIXED32:
1504
- case c.SINT32:
1505
- case c.UINT32:
1500
+ return t == u.FLOAT && tt(o), o;
1501
+ case u.INT32:
1502
+ case u.FIXED32:
1503
+ case u.SFIXED32:
1504
+ case u.SINT32:
1505
+ case u.UINT32:
1506
1506
  if (e === null)
1507
1507
  return 0;
1508
1508
  let a;
1509
1509
  if (typeof e == "number" ? a = e : e === "" ? s = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? s = "extra whitespace" : a = Number(e)), a === void 0)
1510
1510
  break;
1511
- return t == c.UINT32 ? Re(a) : ue(a), a;
1512
- case c.INT64:
1513
- case c.SFIXED64:
1514
- case c.SINT64:
1511
+ return t == u.UINT32 ? Ce(a) : he(a), a;
1512
+ case u.INT64:
1513
+ case u.SFIXED64:
1514
+ case u.SINT64:
1515
1515
  if (e === null)
1516
1516
  return _(S.ZERO, i);
1517
1517
  if (typeof e != "number" && typeof e != "string")
1518
1518
  break;
1519
1519
  return _(S.from(e), i);
1520
- case c.FIXED64:
1521
- case c.UINT64:
1520
+ case u.FIXED64:
1521
+ case u.UINT64:
1522
1522
  if (e === null)
1523
1523
  return _(M.ZERO, i);
1524
1524
  if (typeof e != "number" && typeof e != "string")
1525
1525
  break;
1526
1526
  return _(M.from(e), i);
1527
- case c.BOOL:
1527
+ case u.BOOL:
1528
1528
  if (e === null)
1529
1529
  return !1;
1530
1530
  if (typeof e != "boolean")
1531
1531
  break;
1532
1532
  return e;
1533
- case c.STRING:
1533
+ case u.STRING:
1534
1534
  if (e === null)
1535
1535
  return "";
1536
1536
  if (typeof e != "string") {
@@ -1544,12 +1544,12 @@ class On {
1544
1544
  break;
1545
1545
  }
1546
1546
  return e;
1547
- case c.BYTES:
1547
+ case u.BYTES:
1548
1548
  if (e === null || e === "")
1549
1549
  return new Uint8Array(0);
1550
1550
  if (typeof e != "string")
1551
1551
  break;
1552
- return cn(e);
1552
+ return mn(e);
1553
1553
  }
1554
1554
  } catch (o) {
1555
1555
  s = o.message;
@@ -1557,7 +1557,7 @@ class On {
1557
1557
  this.assert(!1, r + (s ? " - " + s : ""), e);
1558
1558
  }
1559
1559
  }
1560
- class Ln {
1560
+ class xn {
1561
1561
  constructor(e) {
1562
1562
  var t;
1563
1563
  this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
@@ -1578,62 +1578,62 @@ class Ln {
1578
1578
  continue;
1579
1579
  const a = s.kind == "scalar" || s.kind == "enum" ? Object.assign(Object.assign({}, t), { emitDefaultValues: !0 }) : t;
1580
1580
  let f = this.field(s, o[s.localName], a);
1581
- g(f !== void 0), i[t.useProtoFieldName ? s.name : s.jsonName] = f;
1581
+ m(f !== void 0), i[t.useProtoFieldName ? s.name : s.jsonName] = f;
1582
1582
  }
1583
1583
  return i;
1584
1584
  }
1585
1585
  field(e, t, i) {
1586
1586
  let r;
1587
1587
  if (e.kind == "map") {
1588
- g(typeof t == "object" && t !== null);
1588
+ m(typeof t == "object" && t !== null);
1589
1589
  const s = {};
1590
1590
  switch (e.V.kind) {
1591
1591
  case "scalar":
1592
1592
  for (const [f, h] of Object.entries(t)) {
1593
1593
  const d = this.scalar(e.V.T, h, e.name, !1, !0);
1594
- g(d !== void 0), s[f.toString()] = d;
1594
+ m(d !== void 0), s[f.toString()] = d;
1595
1595
  }
1596
1596
  break;
1597
1597
  case "message":
1598
1598
  const o = e.V.T();
1599
1599
  for (const [f, h] of Object.entries(t)) {
1600
1600
  const d = this.message(o, h, e.name, i);
1601
- g(d !== void 0), s[f.toString()] = d;
1601
+ m(d !== void 0), s[f.toString()] = d;
1602
1602
  }
1603
1603
  break;
1604
1604
  case "enum":
1605
1605
  const a = e.V.T();
1606
1606
  for (const [f, h] of Object.entries(t)) {
1607
- g(h === void 0 || typeof h == "number");
1607
+ m(h === void 0 || typeof h == "number");
1608
1608
  const d = this.enum(a, h, e.name, !1, !0, i.enumAsInteger);
1609
- g(d !== void 0), s[f.toString()] = d;
1609
+ m(d !== void 0), s[f.toString()] = d;
1610
1610
  }
1611
1611
  break;
1612
1612
  }
1613
1613
  (i.emitDefaultValues || Object.keys(s).length > 0) && (r = s);
1614
1614
  } else if (e.repeat) {
1615
- g(Array.isArray(t));
1615
+ m(Array.isArray(t));
1616
1616
  const s = [];
1617
1617
  switch (e.kind) {
1618
1618
  case "scalar":
1619
1619
  for (let f = 0; f < t.length; f++) {
1620
1620
  const h = this.scalar(e.T, t[f], e.name, e.opt, !0);
1621
- g(h !== void 0), s.push(h);
1621
+ m(h !== void 0), s.push(h);
1622
1622
  }
1623
1623
  break;
1624
1624
  case "enum":
1625
1625
  const o = e.T();
1626
1626
  for (let f = 0; f < t.length; f++) {
1627
- g(t[f] === void 0 || typeof t[f] == "number");
1627
+ m(t[f] === void 0 || typeof t[f] == "number");
1628
1628
  const h = this.enum(o, t[f], e.name, e.opt, !0, i.enumAsInteger);
1629
- g(h !== void 0), s.push(h);
1629
+ m(h !== void 0), s.push(h);
1630
1630
  }
1631
1631
  break;
1632
1632
  case "message":
1633
1633
  const a = e.T();
1634
1634
  for (let f = 0; f < t.length; f++) {
1635
1635
  const h = this.message(a, t[f], e.name, i);
1636
- g(h !== void 0), s.push(h);
1636
+ m(h !== void 0), s.push(h);
1637
1637
  }
1638
1638
  break;
1639
1639
  }
@@ -1659,76 +1659,76 @@ class Ln {
1659
1659
  if (e[0] == "google.protobuf.NullValue")
1660
1660
  return !s && !r ? void 0 : null;
1661
1661
  if (t === void 0) {
1662
- g(r);
1662
+ m(r);
1663
1663
  return;
1664
1664
  }
1665
1665
  if (!(t === 0 && !s && !r))
1666
- return g(typeof t == "number"), g(Number.isInteger(t)), o || !e[1].hasOwnProperty(t) ? t : e[2] ? e[2] + e[1][t] : e[1][t];
1666
+ return m(typeof t == "number"), m(Number.isInteger(t)), o || !e[1].hasOwnProperty(t) ? t : e[2] ? e[2] + e[1][t] : e[1][t];
1667
1667
  }
1668
1668
  message(e, t, i, r) {
1669
1669
  return t === void 0 ? r.emitDefaultValues ? null : void 0 : e.internalJsonWrite(t, r);
1670
1670
  }
1671
1671
  scalar(e, t, i, r, s) {
1672
1672
  if (t === void 0) {
1673
- g(r);
1673
+ m(r);
1674
1674
  return;
1675
1675
  }
1676
1676
  const o = s || r;
1677
1677
  switch (e) {
1678
- case c.INT32:
1679
- case c.SFIXED32:
1680
- case c.SINT32:
1681
- return t === 0 ? o ? 0 : void 0 : (ue(t), t);
1682
- case c.FIXED32:
1683
- case c.UINT32:
1684
- return t === 0 ? o ? 0 : void 0 : (Re(t), t);
1685
- case c.FLOAT:
1686
- qe(t);
1687
- case c.DOUBLE:
1688
- return t === 0 ? o ? 0 : void 0 : (g(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t);
1689
- case c.STRING:
1690
- return t === "" ? o ? "" : void 0 : (g(typeof t == "string"), t);
1691
- case c.BOOL:
1692
- return t === !1 ? o ? !1 : void 0 : (g(typeof t == "boolean"), t);
1693
- case c.UINT64:
1694
- case c.FIXED64:
1695
- g(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
1678
+ case u.INT32:
1679
+ case u.SFIXED32:
1680
+ case u.SINT32:
1681
+ return t === 0 ? o ? 0 : void 0 : (he(t), t);
1682
+ case u.FIXED32:
1683
+ case u.UINT32:
1684
+ return t === 0 ? o ? 0 : void 0 : (Ce(t), t);
1685
+ case u.FLOAT:
1686
+ tt(t);
1687
+ case u.DOUBLE:
1688
+ return t === 0 ? o ? 0 : void 0 : (m(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t);
1689
+ case u.STRING:
1690
+ return t === "" ? o ? "" : void 0 : (m(typeof t == "string"), t);
1691
+ case u.BOOL:
1692
+ return t === !1 ? o ? !1 : void 0 : (m(typeof t == "boolean"), t);
1693
+ case u.UINT64:
1694
+ case u.FIXED64:
1695
+ m(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
1696
1696
  let a = M.from(t);
1697
1697
  return a.isZero() && !o ? void 0 : a.toString();
1698
- case c.INT64:
1699
- case c.SFIXED64:
1700
- case c.SINT64:
1701
- g(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
1698
+ case u.INT64:
1699
+ case u.SFIXED64:
1700
+ case u.SINT64:
1701
+ m(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
1702
1702
  let f = S.from(t);
1703
1703
  return f.isZero() && !o ? void 0 : f.toString();
1704
- case c.BYTES:
1705
- return g(t instanceof Uint8Array), t.byteLength ? un(t) : o ? "" : void 0;
1704
+ case u.BYTES:
1705
+ return m(t instanceof Uint8Array), t.byteLength ? pn(t) : o ? "" : void 0;
1706
1706
  }
1707
1707
  }
1708
1708
  }
1709
- function We(n, e = V.STRING) {
1709
+ function Ge(n, e = K.STRING) {
1710
1710
  switch (n) {
1711
- case c.BOOL:
1711
+ case u.BOOL:
1712
1712
  return !1;
1713
- case c.UINT64:
1714
- case c.FIXED64:
1713
+ case u.UINT64:
1714
+ case u.FIXED64:
1715
1715
  return _(M.ZERO, e);
1716
- case c.INT64:
1717
- case c.SFIXED64:
1718
- case c.SINT64:
1716
+ case u.INT64:
1717
+ case u.SFIXED64:
1718
+ case u.SINT64:
1719
1719
  return _(S.ZERO, e);
1720
- case c.DOUBLE:
1721
- case c.FLOAT:
1720
+ case u.DOUBLE:
1721
+ case u.FLOAT:
1722
1722
  return 0;
1723
- case c.BYTES:
1723
+ case u.BYTES:
1724
1724
  return new Uint8Array(0);
1725
- case c.STRING:
1725
+ case u.STRING:
1726
1726
  return "";
1727
1727
  default:
1728
1728
  return 0;
1729
1729
  }
1730
1730
  }
1731
- class Sn {
1731
+ class Bn {
1732
1732
  constructor(e) {
1733
1733
  this.info = e;
1734
1734
  }
@@ -1754,41 +1754,41 @@ class Sn {
1754
1754
  for (; e.pos < s; ) {
1755
1755
  const [o, a] = e.tag(), f = this.fieldNoToField.get(o);
1756
1756
  if (!f) {
1757
- let m = i.readUnknownField;
1758
- if (m == "throw")
1757
+ let g = i.readUnknownField;
1758
+ if (g == "throw")
1759
1759
  throw new Error(`Unknown field ${o} (wire type ${a}) for ${this.info.typeName}`);
1760
- let D = e.skip(a);
1761
- m !== !1 && (m === !0 ? Ee.onRead : m)(this.info.typeName, t, o, a, D);
1760
+ let A = e.skip(a);
1761
+ g !== !1 && (g === !0 ? Se.onRead : g)(this.info.typeName, t, o, a, A);
1762
1762
  continue;
1763
1763
  }
1764
- let h = t, d = f.repeat, k = f.localName;
1765
- switch (f.oneof && (h = h[f.oneof], h.oneofKind !== k && (h = t[f.oneof] = {
1766
- oneofKind: k
1764
+ let h = t, d = f.repeat, E = f.localName;
1765
+ switch (f.oneof && (h = h[f.oneof], h.oneofKind !== E && (h = t[f.oneof] = {
1766
+ oneofKind: E
1767
1767
  })), f.kind) {
1768
1768
  case "scalar":
1769
1769
  case "enum":
1770
- let m = f.kind == "enum" ? c.INT32 : f.T, D = f.kind == "scalar" ? f.L : void 0;
1770
+ let g = f.kind == "enum" ? u.INT32 : f.T, A = f.kind == "scalar" ? f.L : void 0;
1771
1771
  if (d) {
1772
- let pe = h[k];
1773
- if (a == O.LengthDelimited && m != c.STRING && m != c.BYTES) {
1774
- let _e = e.uint32() + e.pos;
1775
- for (; e.pos < _e; )
1776
- pe.push(this.scalar(e, m, D));
1772
+ let ye = h[E];
1773
+ if (a == L.LengthDelimited && g != u.STRING && g != u.BYTES) {
1774
+ let Pe = e.uint32() + e.pos;
1775
+ for (; e.pos < Pe; )
1776
+ ye.push(this.scalar(e, g, A));
1777
1777
  } else
1778
- pe.push(this.scalar(e, m, D));
1778
+ ye.push(this.scalar(e, g, A));
1779
1779
  } else
1780
- h[k] = this.scalar(e, m, D);
1780
+ h[E] = this.scalar(e, g, A);
1781
1781
  break;
1782
1782
  case "message":
1783
1783
  if (d) {
1784
- let pe = h[k], _e = f.T().internalBinaryRead(e, e.uint32(), i);
1785
- pe.push(_e);
1784
+ let ye = h[E], Pe = f.T().internalBinaryRead(e, e.uint32(), i);
1785
+ ye.push(Pe);
1786
1786
  } else
1787
- h[k] = f.T().internalBinaryRead(e, e.uint32(), i, h[k]);
1787
+ h[E] = f.T().internalBinaryRead(e, e.uint32(), i, h[E]);
1788
1788
  break;
1789
1789
  case "map":
1790
- let [K, Jt] = this.mapEntry(f, e, i);
1791
- h[k][K] = Jt;
1790
+ let [U, Qt] = this.mapEntry(f, e, i);
1791
+ h[E][U] = Qt;
1792
1792
  break;
1793
1793
  }
1794
1794
  }
@@ -1802,7 +1802,7 @@ class Sn {
1802
1802
  let [f, h] = t.tag();
1803
1803
  switch (f) {
1804
1804
  case 1:
1805
- e.K == c.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K, V.STRING);
1805
+ e.K == u.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K, K.STRING);
1806
1806
  break;
1807
1807
  case 2:
1808
1808
  switch (e.V.kind) {
@@ -1822,13 +1822,13 @@ class Sn {
1822
1822
  }
1823
1823
  }
1824
1824
  if (o === void 0) {
1825
- let f = We(e.K);
1826
- o = e.K == c.BOOL ? f.toString() : f;
1825
+ let f = Ge(e.K);
1826
+ o = e.K == u.BOOL ? f.toString() : f;
1827
1827
  }
1828
1828
  if (a === void 0)
1829
1829
  switch (e.V.kind) {
1830
1830
  case "scalar":
1831
- a = We(e.V.T, e.V.L);
1831
+ a = Ge(e.V.T, e.V.L);
1832
1832
  break;
1833
1833
  case "enum":
1834
1834
  a = 0;
@@ -1841,40 +1841,40 @@ class Sn {
1841
1841
  }
1842
1842
  scalar(e, t, i) {
1843
1843
  switch (t) {
1844
- case c.INT32:
1844
+ case u.INT32:
1845
1845
  return e.int32();
1846
- case c.STRING:
1846
+ case u.STRING:
1847
1847
  return e.string();
1848
- case c.BOOL:
1848
+ case u.BOOL:
1849
1849
  return e.bool();
1850
- case c.DOUBLE:
1850
+ case u.DOUBLE:
1851
1851
  return e.double();
1852
- case c.FLOAT:
1852
+ case u.FLOAT:
1853
1853
  return e.float();
1854
- case c.INT64:
1854
+ case u.INT64:
1855
1855
  return _(e.int64(), i);
1856
- case c.UINT64:
1856
+ case u.UINT64:
1857
1857
  return _(e.uint64(), i);
1858
- case c.FIXED64:
1858
+ case u.FIXED64:
1859
1859
  return _(e.fixed64(), i);
1860
- case c.FIXED32:
1860
+ case u.FIXED32:
1861
1861
  return e.fixed32();
1862
- case c.BYTES:
1862
+ case u.BYTES:
1863
1863
  return e.bytes();
1864
- case c.UINT32:
1864
+ case u.UINT32:
1865
1865
  return e.uint32();
1866
- case c.SFIXED32:
1866
+ case u.SFIXED32:
1867
1867
  return e.sfixed32();
1868
- case c.SFIXED64:
1868
+ case u.SFIXED64:
1869
1869
  return _(e.sfixed64(), i);
1870
- case c.SINT32:
1870
+ case u.SINT32:
1871
1871
  return e.sint32();
1872
- case c.SINT64:
1872
+ case u.SINT64:
1873
1873
  return _(e.sint64(), i);
1874
1874
  }
1875
1875
  }
1876
1876
  }
1877
- class Fn {
1877
+ class _n {
1878
1878
  constructor(e) {
1879
1879
  this.info = e;
1880
1880
  }
@@ -1901,47 +1901,47 @@ class Fn {
1901
1901
  switch (s.kind) {
1902
1902
  case "scalar":
1903
1903
  case "enum":
1904
- let d = s.kind == "enum" ? c.INT32 : s.T;
1904
+ let d = s.kind == "enum" ? u.INT32 : s.T;
1905
1905
  if (f)
1906
- if (g(Array.isArray(o)), f == Oe.PACKED)
1906
+ if (m(Array.isArray(o)), f == Me.PACKED)
1907
1907
  this.packed(t, d, s.no, o);
1908
1908
  else
1909
- for (const k of o)
1910
- this.scalar(t, d, s.no, k, !0);
1909
+ for (const E of o)
1910
+ this.scalar(t, d, s.no, E, !0);
1911
1911
  else
1912
- o === void 0 ? g(s.opt) : this.scalar(t, d, s.no, o, a || s.opt);
1912
+ o === void 0 ? m(s.opt) : this.scalar(t, d, s.no, o, a || s.opt);
1913
1913
  break;
1914
1914
  case "message":
1915
1915
  if (f) {
1916
- g(Array.isArray(o));
1917
- for (const k of o)
1918
- this.message(t, i, s.T(), s.no, k);
1916
+ m(Array.isArray(o));
1917
+ for (const E of o)
1918
+ this.message(t, i, s.T(), s.no, E);
1919
1919
  } else
1920
1920
  this.message(t, i, s.T(), s.no, o);
1921
1921
  break;
1922
1922
  case "map":
1923
- g(typeof o == "object" && o !== null);
1924
- for (const [k, m] of Object.entries(o))
1925
- this.mapEntry(t, i, s, k, m);
1923
+ m(typeof o == "object" && o !== null);
1924
+ for (const [E, g] of Object.entries(o))
1925
+ this.mapEntry(t, i, s, E, g);
1926
1926
  break;
1927
1927
  }
1928
1928
  }
1929
1929
  let r = i.writeUnknownFields;
1930
- r !== !1 && (r === !0 ? Ee.onWrite : r)(this.info.typeName, e, t);
1930
+ r !== !1 && (r === !0 ? Se.onWrite : r)(this.info.typeName, e, t);
1931
1931
  }
1932
1932
  mapEntry(e, t, i, r, s) {
1933
- e.tag(i.no, O.LengthDelimited), e.fork();
1933
+ e.tag(i.no, L.LengthDelimited), e.fork();
1934
1934
  let o = r;
1935
1935
  switch (i.K) {
1936
- case c.INT32:
1937
- case c.FIXED32:
1938
- case c.UINT32:
1939
- case c.SFIXED32:
1940
- case c.SINT32:
1936
+ case u.INT32:
1937
+ case u.FIXED32:
1938
+ case u.UINT32:
1939
+ case u.SFIXED32:
1940
+ case u.SINT32:
1941
1941
  o = Number.parseInt(r);
1942
1942
  break;
1943
- case c.BOOL:
1944
- g(r == "true" || r == "false"), o = r == "true";
1943
+ case u.BOOL:
1944
+ m(r == "true" || r == "false"), o = r == "true";
1945
1945
  break;
1946
1946
  }
1947
1947
  switch (this.scalar(e, i.K, 1, o, !0), i.V.kind) {
@@ -1949,7 +1949,7 @@ class Fn {
1949
1949
  this.scalar(e, i.V.T, 2, s, !0);
1950
1950
  break;
1951
1951
  case "enum":
1952
- this.scalar(e, c.INT32, 2, s, !0);
1952
+ this.scalar(e, u.INT32, 2, s, !0);
1953
1953
  break;
1954
1954
  case "message":
1955
1955
  this.message(e, t, i.V.T(), 2, s);
@@ -1958,7 +1958,7 @@ class Fn {
1958
1958
  e.join();
1959
1959
  }
1960
1960
  message(e, t, i, r, s) {
1961
- s !== void 0 && (i.internalBinaryWrite(s, e.tag(r, O.LengthDelimited).fork(), t), e.join());
1961
+ s !== void 0 && (i.internalBinaryWrite(s, e.tag(r, L.LengthDelimited).fork(), t), e.join());
1962
1962
  }
1963
1963
  /**
1964
1964
  * Write a single scalar value.
@@ -1973,7 +1973,7 @@ class Fn {
1973
1973
  packed(e, t, i, r) {
1974
1974
  if (!r.length)
1975
1975
  return;
1976
- g(t !== c.BYTES && t !== c.STRING), e.tag(i, O.LengthDelimited), e.fork();
1976
+ m(t !== u.BYTES && t !== u.STRING), e.tag(i, L.LengthDelimited), e.fork();
1977
1977
  let [, s] = this.scalarInfo(t);
1978
1978
  for (let o = 0; o < r.length; o++)
1979
1979
  e[s](r[o]);
@@ -1990,59 +1990,59 @@ class Fn {
1990
1990
  * If argument `value` is omitted, [2] is always false.
1991
1991
  */
1992
1992
  scalarInfo(e, t) {
1993
- let i = O.Varint, r, s = t === void 0, o = t === 0;
1993
+ let i = L.Varint, r, s = t === void 0, o = t === 0;
1994
1994
  switch (e) {
1995
- case c.INT32:
1995
+ case u.INT32:
1996
1996
  r = "int32";
1997
1997
  break;
1998
- case c.STRING:
1999
- o = s || !t.length, i = O.LengthDelimited, r = "string";
1998
+ case u.STRING:
1999
+ o = s || !t.length, i = L.LengthDelimited, r = "string";
2000
2000
  break;
2001
- case c.BOOL:
2001
+ case u.BOOL:
2002
2002
  o = t === !1, r = "bool";
2003
2003
  break;
2004
- case c.UINT32:
2004
+ case u.UINT32:
2005
2005
  r = "uint32";
2006
2006
  break;
2007
- case c.DOUBLE:
2008
- i = O.Bit64, r = "double";
2007
+ case u.DOUBLE:
2008
+ i = L.Bit64, r = "double";
2009
2009
  break;
2010
- case c.FLOAT:
2011
- i = O.Bit32, r = "float";
2010
+ case u.FLOAT:
2011
+ i = L.Bit32, r = "float";
2012
2012
  break;
2013
- case c.INT64:
2013
+ case u.INT64:
2014
2014
  o = s || S.from(t).isZero(), r = "int64";
2015
2015
  break;
2016
- case c.UINT64:
2016
+ case u.UINT64:
2017
2017
  o = s || M.from(t).isZero(), r = "uint64";
2018
2018
  break;
2019
- case c.FIXED64:
2020
- o = s || M.from(t).isZero(), i = O.Bit64, r = "fixed64";
2019
+ case u.FIXED64:
2020
+ o = s || M.from(t).isZero(), i = L.Bit64, r = "fixed64";
2021
2021
  break;
2022
- case c.BYTES:
2023
- o = s || !t.byteLength, i = O.LengthDelimited, r = "bytes";
2022
+ case u.BYTES:
2023
+ o = s || !t.byteLength, i = L.LengthDelimited, r = "bytes";
2024
2024
  break;
2025
- case c.FIXED32:
2026
- i = O.Bit32, r = "fixed32";
2025
+ case u.FIXED32:
2026
+ i = L.Bit32, r = "fixed32";
2027
2027
  break;
2028
- case c.SFIXED32:
2029
- i = O.Bit32, r = "sfixed32";
2028
+ case u.SFIXED32:
2029
+ i = L.Bit32, r = "sfixed32";
2030
2030
  break;
2031
- case c.SFIXED64:
2032
- o = s || S.from(t).isZero(), i = O.Bit64, r = "sfixed64";
2031
+ case u.SFIXED64:
2032
+ o = s || S.from(t).isZero(), i = L.Bit64, r = "sfixed64";
2033
2033
  break;
2034
- case c.SINT32:
2034
+ case u.SINT32:
2035
2035
  r = "sint32";
2036
2036
  break;
2037
- case c.SINT64:
2037
+ case u.SINT64:
2038
2038
  o = s || S.from(t).isZero(), r = "sint64";
2039
2039
  break;
2040
2040
  }
2041
2041
  return [i, r, s || o];
2042
2042
  }
2043
2043
  }
2044
- function Cn(n) {
2045
- const e = n.messagePrototype ? Object.create(n.messagePrototype) : Object.defineProperty({}, St, { value: n });
2044
+ function Vn(n) {
2045
+ const e = n.messagePrototype ? Object.create(n.messagePrototype) : Object.defineProperty({}, xt, { value: n });
2046
2046
  for (let t of n.fields) {
2047
2047
  let i = t.localName;
2048
2048
  if (!t.opt)
@@ -2053,7 +2053,7 @@ function Cn(n) {
2053
2053
  else
2054
2054
  switch (t.kind) {
2055
2055
  case "scalar":
2056
- e[i] = We(t.T, t.L);
2056
+ e[i] = Ge(t.T, t.L);
2057
2057
  break;
2058
2058
  case "enum":
2059
2059
  e[i] = 0;
@@ -2065,7 +2065,7 @@ function Cn(n) {
2065
2065
  }
2066
2066
  return e;
2067
2067
  }
2068
- function Ke(n, e, t) {
2068
+ function je(n, e, t) {
2069
2069
  let i, r = t, s;
2070
2070
  for (let o of n.fields) {
2071
2071
  let a = o.localName;
@@ -2112,7 +2112,7 @@ function Ke(n, e, t) {
2112
2112
  }
2113
2113
  }
2114
2114
  }
2115
- function Mn(n, e, t) {
2115
+ function Kn(n, e, t) {
2116
2116
  if (e === t)
2117
2117
  return !0;
2118
2118
  if (!e || !t)
@@ -2122,28 +2122,28 @@ function Mn(n, e, t) {
2122
2122
  switch (i.kind) {
2123
2123
  case "enum":
2124
2124
  case "scalar":
2125
- let a = i.kind == "enum" ? c.INT32 : i.T;
2126
- if (!(i.repeat ? ct(a, s, o) : Ft(a, s, o)))
2125
+ let a = i.kind == "enum" ? u.INT32 : i.T;
2126
+ if (!(i.repeat ? dt(a, s, o) : Bt(a, s, o)))
2127
2127
  return !1;
2128
2128
  break;
2129
2129
  case "map":
2130
- if (!(i.V.kind == "message" ? ut(i.V.T(), be(s), be(o)) : ct(i.V.kind == "enum" ? c.INT32 : i.V.T, be(s), be(o))))
2130
+ if (!(i.V.kind == "message" ? gt(i.V.T(), ke(s), ke(o)) : dt(i.V.kind == "enum" ? u.INT32 : i.V.T, ke(s), ke(o))))
2131
2131
  return !1;
2132
2132
  break;
2133
2133
  case "message":
2134
2134
  let f = i.T();
2135
- if (!(i.repeat ? ut(f, s, o) : f.equals(s, o)))
2135
+ if (!(i.repeat ? gt(f, s, o) : f.equals(s, o)))
2136
2136
  return !1;
2137
2137
  break;
2138
2138
  }
2139
2139
  }
2140
2140
  return !0;
2141
2141
  }
2142
- const be = Object.values;
2143
- function Ft(n, e, t) {
2142
+ const ke = Object.values;
2143
+ function Bt(n, e, t) {
2144
2144
  if (e === t)
2145
2145
  return !0;
2146
- if (n !== c.BYTES)
2146
+ if (n !== u.BYTES)
2147
2147
  return !1;
2148
2148
  let i = e, r = t;
2149
2149
  if (i.length !== r.length)
@@ -2153,15 +2153,15 @@ function Ft(n, e, t) {
2153
2153
  return !1;
2154
2154
  return !0;
2155
2155
  }
2156
- function ct(n, e, t) {
2156
+ function dt(n, e, t) {
2157
2157
  if (e.length !== t.length)
2158
2158
  return !1;
2159
2159
  for (let i = 0; i < e.length; i++)
2160
- if (!Ft(n, e[i], t[i]))
2160
+ if (!Bt(n, e[i], t[i]))
2161
2161
  return !1;
2162
2162
  return !0;
2163
2163
  }
2164
- function ut(n, e, t) {
2164
+ function gt(n, e, t) {
2165
2165
  if (e.length !== t.length)
2166
2166
  return !1;
2167
2167
  for (let i = 0; i < e.length; i++)
@@ -2169,14 +2169,14 @@ function ut(n, e, t) {
2169
2169
  return !1;
2170
2170
  return !0;
2171
2171
  }
2172
- const Ct = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})), An = Ct[St] = {};
2173
- class Dn {
2172
+ const _t = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})), Un = _t[xt] = {};
2173
+ class Pn {
2174
2174
  constructor(e, t, i) {
2175
- this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(En), this.options = i ?? {}, An.value = this, this.messagePrototype = Object.create(null, Ct), this.refTypeCheck = new Rn(this), this.refJsonReader = new On(this), this.refJsonWriter = new Ln(this), this.refBinReader = new Sn(this), this.refBinWriter = new Fn(this);
2175
+ this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(Cn), this.options = i ?? {}, Un.value = this, this.messagePrototype = Object.create(null, _t), this.refTypeCheck = new An(this), this.refJsonReader = new Dn(this), this.refJsonWriter = new xn(this), this.refBinReader = new Bn(this), this.refBinWriter = new _n(this);
2176
2176
  }
2177
2177
  create(e) {
2178
- let t = Cn(this);
2179
- return e !== void 0 && Ke(this, t, e), t;
2178
+ let t = Vn(this);
2179
+ return e !== void 0 && je(this, t, e), t;
2180
2180
  }
2181
2181
  /**
2182
2182
  * Clone the message.
@@ -2185,7 +2185,7 @@ class Dn {
2185
2185
  */
2186
2186
  clone(e) {
2187
2187
  let t = this.create();
2188
- return Ke(this, t, e), t;
2188
+ return je(this, t, e), t;
2189
2189
  }
2190
2190
  /**
2191
2191
  * Determines whether two message of the same type have the same field values.
@@ -2194,7 +2194,7 @@ class Dn {
2194
2194
  * Will also return true if both messages are `undefined`.
2195
2195
  */
2196
2196
  equals(e, t) {
2197
- return Mn(this, e, t);
2197
+ return Kn(this, e, t);
2198
2198
  }
2199
2199
  /**
2200
2200
  * Is the given value assignable to our message type
@@ -2214,20 +2214,20 @@ class Dn {
2214
2214
  * Copy partial data into the target message.
2215
2215
  */
2216
2216
  mergePartial(e, t) {
2217
- Ke(this, e, t);
2217
+ je(this, e, t);
2218
2218
  }
2219
2219
  /**
2220
2220
  * Create a new message from binary format.
2221
2221
  */
2222
2222
  fromBinary(e, t) {
2223
- let i = dn(t);
2223
+ let i = vn(t);
2224
2224
  return this.internalBinaryRead(i.readerFactory(e), e.byteLength, i);
2225
2225
  }
2226
2226
  /**
2227
2227
  * Read a new message from a JSON value.
2228
2228
  */
2229
2229
  fromJson(e, t) {
2230
- return this.internalJsonRead(e, Nn(t));
2230
+ return this.internalJsonRead(e, Sn(t));
2231
2231
  }
2232
2232
  /**
2233
2233
  * Read a new message from a JSON string.
@@ -2241,7 +2241,7 @@ class Dn {
2241
2241
  * Write the message to canonical JSON value.
2242
2242
  */
2243
2243
  toJson(e, t) {
2244
- return this.internalJsonWrite(e, In(t));
2244
+ return this.internalJsonWrite(e, Fn(t));
2245
2245
  }
2246
2246
  /**
2247
2247
  * Convert the message to canonical JSON string.
@@ -2256,7 +2256,7 @@ class Dn {
2256
2256
  * Write the message to binary format.
2257
2257
  */
2258
2258
  toBinary(e, t) {
2259
- let i = vn(t);
2259
+ let i = On(t);
2260
2260
  return this.internalBinaryWrite(e, i.writerFactory(), i).finish();
2261
2261
  }
2262
2262
  /**
@@ -2272,7 +2272,7 @@ class Dn {
2272
2272
  let r = i ?? this.create();
2273
2273
  return this.refJsonReader.read(e, r, t), r;
2274
2274
  }
2275
- throw new Error(`Unable to parse message ${this.typeName} from JSON ${Et(e)}.`);
2275
+ throw new Error(`Unable to parse message ${this.typeName} from JSON ${Ft(e)}.`);
2276
2276
  }
2277
2277
  /**
2278
2278
  * This is an internal method. If you just want to write a message
@@ -2306,74 +2306,74 @@ class Dn {
2306
2306
  return this.refBinReader.read(e, s, i, t), s;
2307
2307
  }
2308
2308
  }
2309
- var xn = Object.defineProperty, Bn = (n, e, t) => e in n ? xn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, _n = (n, e, t) => (Bn(n, typeof e != "symbol" ? e + "" : e, t), t), ze = (n, e, t) => {
2309
+ var Wn = Object.defineProperty, $n = (n, e, t) => e in n ? Wn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, jn = (n, e, t) => ($n(n, typeof e != "symbol" ? e + "" : e, t), t), nt = (n, e, t) => {
2310
2310
  if (!e.has(n))
2311
2311
  throw TypeError("Cannot " + t);
2312
- }, u = (n, e, t) => (ze(n, e, "read from private field"), t ? t.call(n) : e.get(n)), N = (n, e, t) => {
2312
+ }, c = (n, e, t) => (nt(n, e, "read from private field"), t ? t.call(n) : e.get(n)), b = (n, e, t) => {
2313
2313
  if (e.has(n))
2314
2314
  throw TypeError("Cannot add the same private member more than once");
2315
2315
  e instanceof WeakSet ? e.add(n) : e.set(n, t);
2316
- }, p = (n, e, t, i) => (ze(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t), E = (n, e, t) => (ze(n, e, "access private method"), t), Le = {}, Un = {
2316
+ }, p = (n, e, t, i) => (nt(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t), w = (n, e, t) => (nt(n, e, "access private method"), t), Ae = {}, Jn = {
2317
2317
  get exports() {
2318
- return Le;
2318
+ return Ae;
2319
2319
  },
2320
2320
  set exports(n) {
2321
- Le = n;
2321
+ Ae = n;
2322
2322
  }
2323
- }, re = typeof Reflect == "object" ? Reflect : null, ft = re && typeof re.apply == "function" ? re.apply : function(n, e, t) {
2323
+ }, se = typeof Reflect == "object" ? Reflect : null, mt = se && typeof se.apply == "function" ? se.apply : function(n, e, t) {
2324
2324
  return Function.prototype.apply.call(n, e, t);
2325
- }, ke;
2326
- re && typeof re.ownKeys == "function" ? ke = re.ownKeys : Object.getOwnPropertySymbols ? ke = function(n) {
2325
+ }, Ee;
2326
+ se && typeof se.ownKeys == "function" ? Ee = se.ownKeys : Object.getOwnPropertySymbols ? Ee = function(n) {
2327
2327
  return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n));
2328
- } : ke = function(n) {
2328
+ } : Ee = function(n) {
2329
2329
  return Object.getOwnPropertyNames(n);
2330
2330
  };
2331
- function Vn(n) {
2331
+ function Xn(n) {
2332
2332
  console && console.warn && console.warn(n);
2333
2333
  }
2334
- var Mt = Number.isNaN || function(n) {
2334
+ var Vt = Number.isNaN || function(n) {
2335
2335
  return n !== n;
2336
2336
  };
2337
- function b() {
2338
- b.init.call(this);
2339
- }
2340
- Un.exports = b;
2341
- Le.once = $n;
2342
- b.EventEmitter = b;
2343
- b.prototype._events = void 0;
2344
- b.prototype._eventsCount = 0;
2345
- b.prototype._maxListeners = void 0;
2346
- var ht = 10;
2347
- function Be(n) {
2337
+ function k() {
2338
+ k.init.call(this);
2339
+ }
2340
+ Jn.exports = k;
2341
+ Ae.once = qn;
2342
+ k.EventEmitter = k;
2343
+ k.prototype._events = void 0;
2344
+ k.prototype._eventsCount = 0;
2345
+ k.prototype._maxListeners = void 0;
2346
+ var pt = 10;
2347
+ function Ue(n) {
2348
2348
  if (typeof n != "function")
2349
2349
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof n);
2350
2350
  }
2351
- Object.defineProperty(b, "defaultMaxListeners", {
2351
+ Object.defineProperty(k, "defaultMaxListeners", {
2352
2352
  enumerable: !0,
2353
2353
  get: function() {
2354
- return ht;
2354
+ return pt;
2355
2355
  },
2356
2356
  set: function(n) {
2357
- if (typeof n != "number" || n < 0 || Mt(n))
2357
+ if (typeof n != "number" || n < 0 || Vt(n))
2358
2358
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + n + ".");
2359
- ht = n;
2359
+ pt = n;
2360
2360
  }
2361
2361
  });
2362
- b.init = function() {
2362
+ k.init = function() {
2363
2363
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
2364
2364
  };
2365
- b.prototype.setMaxListeners = function(n) {
2366
- if (typeof n != "number" || n < 0 || Mt(n))
2365
+ k.prototype.setMaxListeners = function(n) {
2366
+ if (typeof n != "number" || n < 0 || Vt(n))
2367
2367
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
2368
2368
  return this._maxListeners = n, this;
2369
2369
  };
2370
- function At(n) {
2371
- return n._maxListeners === void 0 ? b.defaultMaxListeners : n._maxListeners;
2370
+ function Kt(n) {
2371
+ return n._maxListeners === void 0 ? k.defaultMaxListeners : n._maxListeners;
2372
2372
  }
2373
- b.prototype.getMaxListeners = function() {
2374
- return At(this);
2373
+ k.prototype.getMaxListeners = function() {
2374
+ return Kt(this);
2375
2375
  };
2376
- b.prototype.emit = function(n) {
2376
+ k.prototype.emit = function(n) {
2377
2377
  for (var e = [], t = 1; t < arguments.length; t++)
2378
2378
  e.push(arguments[t]);
2379
2379
  var i = n === "error", r = this._events;
@@ -2392,51 +2392,51 @@ b.prototype.emit = function(n) {
2392
2392
  if (a === void 0)
2393
2393
  return !1;
2394
2394
  if (typeof a == "function")
2395
- ft(a, this, e);
2395
+ mt(a, this, e);
2396
2396
  else
2397
- for (var f = a.length, h = Ut(a, f), t = 0; t < f; ++t)
2398
- ft(h[t], this, e);
2397
+ for (var f = a.length, h = jt(a, f), t = 0; t < f; ++t)
2398
+ mt(h[t], this, e);
2399
2399
  return !0;
2400
2400
  };
2401
- function Dt(n, e, t, i) {
2401
+ function Ut(n, e, t, i) {
2402
2402
  var r, s, o;
2403
- if (Be(t), s = n._events, s === void 0 ? (s = n._events = /* @__PURE__ */ Object.create(null), n._eventsCount = 0) : (s.newListener !== void 0 && (n.emit(
2403
+ if (Ue(t), s = n._events, s === void 0 ? (s = n._events = /* @__PURE__ */ Object.create(null), n._eventsCount = 0) : (s.newListener !== void 0 && (n.emit(
2404
2404
  "newListener",
2405
2405
  e,
2406
2406
  t.listener ? t.listener : t
2407
2407
  ), s = n._events), o = s[e]), o === void 0)
2408
2408
  o = s[e] = t, ++n._eventsCount;
2409
- else if (typeof o == "function" ? o = s[e] = i ? [t, o] : [o, t] : i ? o.unshift(t) : o.push(t), r = At(n), r > 0 && o.length > r && !o.warned) {
2409
+ else if (typeof o == "function" ? o = s[e] = i ? [t, o] : [o, t] : i ? o.unshift(t) : o.push(t), r = Kt(n), r > 0 && o.length > r && !o.warned) {
2410
2410
  o.warned = !0;
2411
2411
  var a = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
2412
- a.name = "MaxListenersExceededWarning", a.emitter = n, a.type = e, a.count = o.length, Vn(a);
2412
+ a.name = "MaxListenersExceededWarning", a.emitter = n, a.type = e, a.count = o.length, Xn(a);
2413
2413
  }
2414
2414
  return n;
2415
2415
  }
2416
- b.prototype.addListener = function(n, e) {
2417
- return Dt(this, n, e, !1);
2416
+ k.prototype.addListener = function(n, e) {
2417
+ return Ut(this, n, e, !1);
2418
2418
  };
2419
- b.prototype.on = b.prototype.addListener;
2420
- b.prototype.prependListener = function(n, e) {
2421
- return Dt(this, n, e, !0);
2419
+ k.prototype.on = k.prototype.addListener;
2420
+ k.prototype.prependListener = function(n, e) {
2421
+ return Ut(this, n, e, !0);
2422
2422
  };
2423
- function Kn() {
2423
+ function Gn() {
2424
2424
  if (!this.fired)
2425
2425
  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);
2426
2426
  }
2427
- function xt(n, e, t) {
2428
- var i = { fired: !1, wrapFn: void 0, target: n, type: e, listener: t }, r = Kn.bind(i);
2427
+ function Pt(n, e, t) {
2428
+ var i = { fired: !1, wrapFn: void 0, target: n, type: e, listener: t }, r = Gn.bind(i);
2429
2429
  return r.listener = t, i.wrapFn = r, r;
2430
2430
  }
2431
- b.prototype.once = function(n, e) {
2432
- return Be(e), this.on(n, xt(this, n, e)), this;
2431
+ k.prototype.once = function(n, e) {
2432
+ return Ue(e), this.on(n, Pt(this, n, e)), this;
2433
2433
  };
2434
- b.prototype.prependOnceListener = function(n, e) {
2435
- return Be(e), this.prependListener(n, xt(this, n, e)), this;
2434
+ k.prototype.prependOnceListener = function(n, e) {
2435
+ return Ue(e), this.prependListener(n, Pt(this, n, e)), this;
2436
2436
  };
2437
- b.prototype.removeListener = function(n, e) {
2437
+ k.prototype.removeListener = function(n, e) {
2438
2438
  var t, i, r, s, o;
2439
- if (Be(e), i = this._events, i === void 0)
2439
+ if (Ue(e), i = this._events, i === void 0)
2440
2440
  return this;
2441
2441
  if (t = i[n], t === void 0)
2442
2442
  return this;
@@ -2450,12 +2450,12 @@ b.prototype.removeListener = function(n, e) {
2450
2450
  }
2451
2451
  if (r < 0)
2452
2452
  return this;
2453
- r === 0 ? t.shift() : Pn(t, r), t.length === 1 && (i[n] = t[0]), i.removeListener !== void 0 && this.emit("removeListener", n, o || e);
2453
+ r === 0 ? t.shift() : Zn(t, r), t.length === 1 && (i[n] = t[0]), i.removeListener !== void 0 && this.emit("removeListener", n, o || e);
2454
2454
  }
2455
2455
  return this;
2456
2456
  };
2457
- b.prototype.off = b.prototype.removeListener;
2458
- b.prototype.removeAllListeners = function(n) {
2457
+ k.prototype.off = k.prototype.removeListener;
2458
+ k.prototype.removeAllListeners = function(n) {
2459
2459
  var e, t, i;
2460
2460
  if (t = this._events, t === void 0)
2461
2461
  return this;
@@ -2474,24 +2474,24 @@ b.prototype.removeAllListeners = function(n) {
2474
2474
  this.removeListener(n, e[i]);
2475
2475
  return this;
2476
2476
  };
2477
- function Bt(n, e, t) {
2477
+ function Wt(n, e, t) {
2478
2478
  var i = n._events;
2479
2479
  if (i === void 0)
2480
2480
  return [];
2481
2481
  var r = i[e];
2482
- return r === void 0 ? [] : typeof r == "function" ? t ? [r.listener || r] : [r] : t ? Wn(r) : Ut(r, r.length);
2482
+ return r === void 0 ? [] : typeof r == "function" ? t ? [r.listener || r] : [r] : t ? Yn(r) : jt(r, r.length);
2483
2483
  }
2484
- b.prototype.listeners = function(n) {
2485
- return Bt(this, n, !0);
2484
+ k.prototype.listeners = function(n) {
2485
+ return Wt(this, n, !0);
2486
2486
  };
2487
- b.prototype.rawListeners = function(n) {
2488
- return Bt(this, n, !1);
2487
+ k.prototype.rawListeners = function(n) {
2488
+ return Wt(this, n, !1);
2489
2489
  };
2490
- b.listenerCount = function(n, e) {
2491
- return typeof n.listenerCount == "function" ? n.listenerCount(e) : _t.call(n, e);
2490
+ k.listenerCount = function(n, e) {
2491
+ return typeof n.listenerCount == "function" ? n.listenerCount(e) : $t.call(n, e);
2492
2492
  };
2493
- b.prototype.listenerCount = _t;
2494
- function _t(n) {
2493
+ k.prototype.listenerCount = $t;
2494
+ function $t(n) {
2495
2495
  var e = this._events;
2496
2496
  if (e !== void 0) {
2497
2497
  var t = e[n];
@@ -2502,25 +2502,25 @@ function _t(n) {
2502
2502
  }
2503
2503
  return 0;
2504
2504
  }
2505
- b.prototype.eventNames = function() {
2506
- return this._eventsCount > 0 ? ke(this._events) : [];
2505
+ k.prototype.eventNames = function() {
2506
+ return this._eventsCount > 0 ? Ee(this._events) : [];
2507
2507
  };
2508
- function Ut(n, e) {
2508
+ function jt(n, e) {
2509
2509
  for (var t = new Array(e), i = 0; i < e; ++i)
2510
2510
  t[i] = n[i];
2511
2511
  return t;
2512
2512
  }
2513
- function Pn(n, e) {
2513
+ function Zn(n, e) {
2514
2514
  for (; e + 1 < n.length; e++)
2515
2515
  n[e] = n[e + 1];
2516
2516
  n.pop();
2517
2517
  }
2518
- function Wn(n) {
2518
+ function Yn(n) {
2519
2519
  for (var e = new Array(n.length), t = 0; t < e.length; ++t)
2520
2520
  e[t] = n[t].listener || n[t];
2521
2521
  return e;
2522
2522
  }
2523
- function $n(n, e) {
2523
+ function qn(n, e) {
2524
2524
  return new Promise(function(t, i) {
2525
2525
  function r(o) {
2526
2526
  n.removeListener(e, s), i(o);
@@ -2528,13 +2528,13 @@ function $n(n, e) {
2528
2528
  function s() {
2529
2529
  typeof n.removeListener == "function" && n.removeListener("error", r), t([].slice.call(arguments));
2530
2530
  }
2531
- Vt(n, e, s, { once: !0 }), e !== "error" && jn(n, r, { once: !0 });
2531
+ Jt(n, e, s, { once: !0 }), e !== "error" && zn(n, r, { once: !0 });
2532
2532
  });
2533
2533
  }
2534
- function jn(n, e, t) {
2535
- typeof n.on == "function" && Vt(n, "error", e, t);
2534
+ function zn(n, e, t) {
2535
+ typeof n.on == "function" && Jt(n, "error", e, t);
2536
2536
  }
2537
- function Vt(n, e, t, i) {
2537
+ function Jt(n, e, t, i) {
2538
2538
  if (typeof n.on == "function")
2539
2539
  i.once ? n.once(e, t) : n.on(e, t);
2540
2540
  else if (typeof n.addEventListener == "function")
@@ -2544,7 +2544,7 @@ function Vt(n, e, t, i) {
2544
2544
  else
2545
2545
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof n);
2546
2546
  }
2547
- class Jn extends Dn {
2547
+ class Qn extends Pn {
2548
2548
  constructor() {
2549
2549
  super("message.v1.SocketMessage", [
2550
2550
  {
@@ -2581,36 +2581,36 @@ class Jn extends Dn {
2581
2581
  ]);
2582
2582
  }
2583
2583
  }
2584
- const lt = new Jn();
2585
- class Kt {
2584
+ const wt = new Qn();
2585
+ class Xt {
2586
2586
  static encode(e) {
2587
- return lt.toBinary(e);
2587
+ return wt.toBinary(e);
2588
2588
  }
2589
2589
  static decode(e) {
2590
- return lt.fromBinary(new Uint8Array(e));
2590
+ return wt.fromBinary(new Uint8Array(e));
2591
2591
  }
2592
2592
  }
2593
- function Xn(n, e) {
2593
+ function Hn(n, e) {
2594
2594
  return Math.floor(Math.random() * (e - n + 1) + n);
2595
2595
  }
2596
2596
  var J;
2597
- class Gn {
2597
+ class ei {
2598
2598
  constructor(e = {}) {
2599
- _n(this, "opts"), N(this, J, void 0), this.opts = {
2599
+ jn(this, "opts"), b(this, J, void 0), this.opts = {
2600
2600
  initialTimeout: e.initialTimeout || 1e3,
2601
2601
  maxTimeout: e.maxTimeout || 1e4,
2602
2602
  factor: e.factor || 2
2603
2603
  }, p(this, J, 0);
2604
2604
  }
2605
2605
  async wait() {
2606
- p(this, J, u(this, J) + 1);
2607
- const e = Xn(0, Math.min(this.opts.maxTimeout, this.opts.initialTimeout * 2 ** u(this, J)));
2606
+ p(this, J, c(this, J) + 1);
2607
+ const e = Hn(0, Math.min(this.opts.maxTimeout, this.opts.initialTimeout * 2 ** c(this, J)));
2608
2608
  await new Promise((t) => {
2609
2609
  setTimeout(t, e);
2610
2610
  });
2611
2611
  }
2612
2612
  getAttempts() {
2613
- return u(this, J);
2613
+ return c(this, J);
2614
2614
  }
2615
2615
  reset() {
2616
2616
  p(this, J, 0);
@@ -2624,79 +2624,79 @@ const j = {
2624
2624
  error: 3
2625
2625
  };
2626
2626
  var z, Q;
2627
- class Zn {
2627
+ class ti {
2628
2628
  constructor(e) {
2629
- N(this, z, void 0), N(this, Q, void 0), p(this, z, console), p(this, Q, e);
2629
+ b(this, z, void 0), b(this, Q, void 0), p(this, z, console), p(this, Q, e);
2630
2630
  }
2631
2631
  debug(...e) {
2632
- j[u(this, Q)] > j.debug || u(this, z).debug("[Sockrates]:", ...e);
2632
+ j[c(this, Q)] > j.debug || c(this, z).debug("[Sockrates]:", ...e);
2633
2633
  }
2634
2634
  info(...e) {
2635
- j[u(this, Q)] > j.info || u(this, z).info("[Sockrates]:", ...e);
2635
+ j[c(this, Q)] > j.info || c(this, z).info("[Sockrates]:", ...e);
2636
2636
  }
2637
2637
  warn(...e) {
2638
- j[u(this, Q)] > j.warn || u(this, z).warn("[Sockrates]:", ...e);
2638
+ j[c(this, Q)] > j.warn || c(this, z).warn("[Sockrates]:", ...e);
2639
2639
  }
2640
2640
  error(...e) {
2641
- j[u(this, Q)] > j.error || u(this, z).error("[Sockrates]:", ...e);
2641
+ j[c(this, Q)] > j.error || c(this, z).error("[Sockrates]:", ...e);
2642
2642
  }
2643
2643
  }
2644
2644
  z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap();
2645
- var Pt = /* @__PURE__ */ ((n) => (n[n.CONNECTING = 0] = "CONNECTING", n[n.OPEN = 1] = "OPEN", n[n.CLOSING = 2] = "CLOSING", n[n.CLOSED = 3] = "CLOSED", n))(Pt || {});
2646
- const Yn = "2", qn = "3";
2647
- var R, te, I, L, X, F, $, q, B, ne, P, $e, Wt, ce, Ne, je, $t, Je, dt, Se, Xe, Ge, jt, fe, Ie, he, Fe, Ce, Ze, se, le, de, Me;
2648
- class zn {
2645
+ var Gt = /* @__PURE__ */ ((n) => (n[n.CONNECTING = 0] = "CONNECTING", n[n.OPEN = 1] = "OPEN", n[n.CLOSING = 2] = "CLOSING", n[n.CLOSED = 3] = "CLOSED", n))(Gt || {});
2646
+ const bt = "2", yt = "3";
2647
+ var O, te, y, T, X, F, $, q, B, ne, ie, P, Ze, Zt, fe, Te, Ye, Yt, Re, Je, De, qe, ze, qt, le, Oe, oe, de, xe, Qe, ae, ge, He, zt, me, Le, pe, Be;
2648
+ class ni {
2649
2649
  constructor(e, t) {
2650
- N(this, $e), N(this, ce), N(this, je), N(this, Je), N(this, Se), N(this, Ge), N(this, fe), N(this, he), N(this, Ce), N(this, se), N(this, de), N(this, R, void 0), N(this, te, void 0), N(this, I, void 0), N(this, L, void 0), N(this, X, void 0), N(this, F, void 0), N(this, $, void 0), N(this, q, void 0), N(this, B, void 0), N(this, ne, void 0), N(this, P, void 0);
2651
- var i, r, s, o, a, f, h, d, k;
2652
- p(this, te, e), p(this, X, []), p(this, F, new Le()), p(this, $, !0), p(this, B, !1), p(this, I, t ?? {}), (i = u(this, I)).autoReconnect ?? (i.autoReconnect = !0), (r = u(this, I)).retryConnectionInterval ?? (r.retryConnectionInterval = 1e3), (s = u(this, I)).pingTimeout ?? (s.pingTimeout = 3e4), (o = u(this, I)).connectionTimeout ?? (o.connectionTimeout = 5e3), (a = u(this, I)).debug ?? (a.debug = !0), (f = u(this, I)).maxReconnectionAttempts ?? (f.maxReconnectionAttempts = 10), (h = u(this, I)).disconnectOnPingTimeout ?? (h.disconnectOnPingTimeout = !0), (d = u(this, I)).queueOnDisconnect ?? (d.queueOnDisconnect = !1), (k = u(this, I)).flushOnReconnect ?? (k.flushOnReconnect = !1), p(this, q, {
2650
+ b(this, Ze), b(this, fe), b(this, Ye), b(this, Re), b(this, De), b(this, ze), b(this, le), b(this, oe), b(this, xe), b(this, ae), b(this, He), b(this, me), b(this, pe), b(this, O, void 0), b(this, te, void 0), b(this, y, void 0), b(this, T, void 0), b(this, X, void 0), b(this, F, void 0), b(this, $, void 0), b(this, q, void 0), b(this, B, void 0), b(this, ne, void 0), b(this, ie, void 0), b(this, P, void 0);
2651
+ var i, r, s, o, a, f, h, d, E, g, A;
2652
+ p(this, te, e), p(this, X, []), p(this, F, new Ae()), p(this, $, !0), p(this, B, !1), p(this, y, t ?? {}), (i = c(this, y)).autoReconnect ?? (i.autoReconnect = !0), (r = c(this, y)).retryConnectionInterval ?? (r.retryConnectionInterval = 1e3), (s = c(this, y)).pingTimeout ?? (s.pingTimeout = 3e4), (o = c(this, y)).connectionTimeout ?? (o.connectionTimeout = 5e3), (a = c(this, y)).debug ?? (a.debug = !0), (f = c(this, y)).maxReconnectionAttempts ?? (f.maxReconnectionAttempts = 10), (h = c(this, y)).disconnectOnPingTimeout ?? (h.disconnectOnPingTimeout = !0), (d = c(this, y)).queueOnDisconnect ?? (d.queueOnDisconnect = !1), (E = c(this, y)).flushOnReconnect ?? (E.flushOnReconnect = !1), (g = c(this, y)).clientInitiatedPings ?? (g.clientInitiatedPings = !1), (A = c(this, y)).clientInitiatedPingInterval ?? (A.clientInitiatedPingInterval = 3e4), p(this, q, {
2653
2653
  code: void 0,
2654
2654
  reason: void 0
2655
- }), p(this, L, u(this, I).logger ?? new Zn(u(this, I).debug ? "debug" : "info")), p(this, P, new Gn());
2655
+ }), p(this, T, c(this, y).logger ?? new ti(c(this, y).debug ? "debug" : "info")), p(this, P, new ei());
2656
2656
  }
2657
2657
  /**
2658
2658
  * Ready state of the current WebSocket.
2659
2659
  */
2660
2660
  get readyState() {
2661
2661
  var e;
2662
- return (e = u(this, R)) == null ? void 0 : e.readyState;
2662
+ return (e = c(this, O)) == null ? void 0 : e.readyState;
2663
2663
  }
2664
2664
  /**
2665
2665
  * Sockrates connection URL.
2666
2666
  */
2667
2667
  get url() {
2668
- return u(this, te);
2668
+ return c(this, te);
2669
2669
  }
2670
2670
  /**
2671
2671
  * Update connection URL.
2672
2672
  */
2673
2673
  updateURL(e) {
2674
- p(this, te, e), E(this, Ge, jt).call(this);
2674
+ p(this, te, e), w(this, ze, qt).call(this);
2675
2675
  }
2676
2676
  /**
2677
2677
  * Configuration options passed to Sockrates.
2678
2678
  */
2679
2679
  get config() {
2680
- return u(this, I);
2680
+ return c(this, y);
2681
2681
  }
2682
2682
  /**
2683
2683
  * Messages that got queued due to the
2684
2684
  * socket not being connected.
2685
2685
  */
2686
2686
  get sendQueue() {
2687
- return u(this, X);
2687
+ return c(this, X);
2688
2688
  }
2689
2689
  /**
2690
2690
  * Flushes all messages that were queued
2691
2691
  * due to the socket not being connected.
2692
2692
  */
2693
2693
  flush() {
2694
- if (!u(this, I).queueOnDisconnect)
2694
+ if (!c(this, y).queueOnDisconnect)
2695
2695
  return !1;
2696
2696
  const e = [];
2697
- return u(this, X).forEach((t) => {
2697
+ return c(this, X).forEach((t) => {
2698
2698
  this.send(t.event, t.id, t.payload, t.metadata) || e.push(t);
2699
- }), p(this, X, e), u(this, X);
2699
+ }), p(this, X, e), c(this, X);
2700
2700
  }
2701
2701
  async connect(e = !1) {
2702
2702
  if (!e && [
@@ -2704,41 +2704,41 @@ class zn {
2704
2704
  1
2705
2705
  /* OPEN */
2706
2706
  ].includes(this.readyState)) {
2707
- u(this, L).debug("Websocket was already connecting or connected.");
2707
+ c(this, T).debug("Websocket was already connecting or connected.");
2708
2708
  return;
2709
2709
  }
2710
- if (u(this, $) !== !1)
2710
+ if (c(this, $) !== !1)
2711
2711
  return new Promise((t, i) => {
2712
- E(this, se, le).call(this), E(this, de, Me).call(this);
2712
+ w(this, ae, ge).call(this), w(this, pe, Be).call(this);
2713
2713
  try {
2714
- p(this, R, new WebSocket(E(this, $e, Wt).call(this, u(this, te)))), u(this, R).binaryType = "arraybuffer", u(this, L).debug("Connecting");
2714
+ p(this, O, new WebSocket(w(this, Ze, Zt).call(this, c(this, te)))), c(this, O).binaryType = "arraybuffer", c(this, T).debug("Connecting");
2715
2715
  const r = setTimeout(() => {
2716
- u(this, L).debug("Connection timeout. Closing socket"), p(this, $, !0), E(this, de, Me).call(this), u(this, R).close(3001, "Connection Timeout"), u(this, I).autoReconnect && !u(this, B) && (u(this, F).emit(
2716
+ c(this, T).debug("Connection timeout. Closing socket"), p(this, $, !0), w(this, pe, Be).call(this), c(this, O).close(3001, "Connection Timeout"), c(this, y).autoReconnect && !c(this, B) && (c(this, F).emit(
2717
2717
  "reconnecting"
2718
2718
  /* reconnecting */
2719
- ), E(this, fe, Ie).call(this)), i(new Error("Connection timed out!"));
2720
- }, u(this, I).connectionTimeout);
2721
- u(this, R).onopen = () => {
2722
- u(this, L).debug(`Ready State: ${Pt[u(this, R).readyState]}`), r && clearTimeout(r), E(this, Ce, Ze).call(this), p(this, q, {
2719
+ ), w(this, le, Oe).call(this)), i(new Error("Connection timed out!"));
2720
+ }, c(this, y).connectionTimeout);
2721
+ c(this, O).onopen = () => {
2722
+ c(this, T).debug(`Ready State: ${Gt[c(this, O).readyState]}`), r && clearTimeout(r), w(this, xe, Qe).call(this), w(this, He, zt).call(this), p(this, q, {
2723
2723
  code: void 0,
2724
2724
  reason: void 0
2725
- }), u(this, F).emit(
2725
+ }), c(this, F).emit(
2726
2726
  "connected"
2727
2727
  /* connected */
2728
- ), u(this, I).flushOnReconnect && this.flush(), t();
2729
- }, u(this, R).onclose = (s) => {
2728
+ ), c(this, y).flushOnReconnect && this.flush(), t();
2729
+ }, c(this, O).onclose = (s) => {
2730
2730
  try {
2731
2731
  r && clearTimeout(r);
2732
2732
  const { code: o, reason: a } = s;
2733
- i(a), u(this, L).debug("Socket closed. Close event:", { event: s }), u(this, L).debug(`Connection closed code: ${o}`), u(this, L).debug(`Connection closed reason: ${a}`), u(this, B) || E(this, Se, Xe).call(this, o, a);
2733
+ i(a), c(this, T).debug("Socket closed. Close event:", { event: s }), c(this, T).debug(`Connection closed code: ${o}`), c(this, T).debug(`Connection closed reason: ${a}`), c(this, B) || w(this, De, qe).call(this, o, a);
2734
2734
  } catch (o) {
2735
- E(this, ce, Ne).call(this, o);
2735
+ w(this, fe, Te).call(this, o);
2736
2736
  }
2737
- }, u(this, R).onerror = (s) => {
2738
- E(this, ce, Ne).call(this, s);
2739
- }, u(this, R).onmessage = (s) => E(this, je, $t).call(this, s);
2737
+ }, c(this, O).onerror = (s) => {
2738
+ w(this, fe, Te).call(this, s);
2739
+ }, c(this, O).onmessage = (s) => w(this, Ye, Yt).call(this, s);
2740
2740
  } catch (r) {
2741
- E(this, ce, Ne).call(this, r, i);
2741
+ w(this, fe, Te).call(this, r, i);
2742
2742
  }
2743
2743
  });
2744
2744
  }
@@ -2748,10 +2748,10 @@ class zn {
2748
2748
  */
2749
2749
  send(e, t, i, r) {
2750
2750
  const s = { event: e, id: t, payload: i, metadata: r };
2751
- if (u(this, I).queueOnDisconnect && (!u(this, R) || u(this, R).readyState !== 1))
2752
- return u(this, L).debug("Queuing message since socket is not connected!", s), u(this, X).push(s), !1;
2753
- const o = Kt.encode(s);
2754
- return E(this, he, Fe).call(this, o);
2751
+ if (c(this, y).queueOnDisconnect && (!c(this, O) || c(this, O).readyState !== 1))
2752
+ return c(this, T).debug("Queuing message since socket is not connected!", s), c(this, X).push(s), !1;
2753
+ const o = Xt.encode(s);
2754
+ return w(this, oe, de).call(this, o);
2755
2755
  }
2756
2756
  /**
2757
2757
  * Alias for `send`.
@@ -2763,20 +2763,20 @@ class zn {
2763
2763
  * Send a raw message to the socket server.
2764
2764
  */
2765
2765
  sendRaw(e) {
2766
- return E(this, he, Fe).call(this, e);
2766
+ return w(this, oe, de).call(this, e);
2767
2767
  }
2768
2768
  /**
2769
2769
  * Alias to `on`.
2770
2770
  */
2771
2771
  receive(e, t) {
2772
- return u(this, F).on(e.toString(), t);
2772
+ return c(this, F).on(e.toString(), t);
2773
2773
  }
2774
2774
  /**
2775
2775
  * Event listener that is fired on receiving socket messages.
2776
2776
  */
2777
2777
  on(e, t) {
2778
2778
  if (typeof e == "string" && (e === "connected" || e === "disconnected" || e === "errored" || e === "reconnected" || e === "reconnecting" || e === "reconnectAttempt" || e === "reconnectFailure" || e === "failed")) {
2779
- u(this, F).on(e, t);
2779
+ c(this, F).on(e, t);
2780
2780
  return;
2781
2781
  }
2782
2782
  this.receive(e, t);
@@ -2785,7 +2785,7 @@ class zn {
2785
2785
  * Remove all event listeners that were added using `on`.
2786
2786
  */
2787
2787
  removeAllListeners() {
2788
- u(this, F).removeAllListeners();
2788
+ c(this, F).removeAllListeners();
2789
2789
  }
2790
2790
  /**
2791
2791
  * Alias to `removeListener`.
@@ -2797,7 +2797,7 @@ class zn {
2797
2797
  * Remove a specific listener that was added using `on`.
2798
2798
  */
2799
2799
  removeListener(e, t) {
2800
- u(this, F).removeListener(e.toString(), t);
2800
+ c(this, F).removeListener(e.toString(), t);
2801
2801
  }
2802
2802
  /**
2803
2803
  * Alias to `removeListeners`.
@@ -2809,7 +2809,7 @@ class zn {
2809
2809
  * Remove all listeners for a specific event.
2810
2810
  */
2811
2811
  removeListeners(e) {
2812
- u(this, F).listeners(e.toString()).map(
2812
+ c(this, F).listeners(e.toString()).map(
2813
2813
  (t) => this.removeListener(e, t)
2814
2814
  );
2815
2815
  }
@@ -2817,13 +2817,13 @@ class zn {
2817
2817
  * Disconnect the socket.
2818
2818
  */
2819
2819
  disconnect() {
2820
- p(this, $, !1), E(this, se, le).call(this), this.removeAllListeners(), p(this, q, {
2820
+ p(this, $, !1), w(this, ae, ge).call(this), w(this, me, Le).call(this), this.removeAllListeners(), p(this, q, {
2821
2821
  code: 1e3,
2822
2822
  reason: "Sockrates disconnect method called"
2823
- }), u(this, R).close(1e3, "Sockrates disconnect method called.");
2823
+ }), c(this, O).close(1e3, "Sockrates disconnect method called.");
2824
2824
  }
2825
2825
  }
2826
- R = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakSet(), Wt = function(n) {
2826
+ O = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakSet(), Zt = function(n) {
2827
2827
  if (n.startsWith("ws://") || n.startsWith("wss://"))
2828
2828
  return n;
2829
2829
  if (n.startsWith("https://"))
@@ -2831,72 +2831,82 @@ R = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), I = /* @_
2831
2831
  if (n.startsWith("http://"))
2832
2832
  return `ws://${n.substring(7)}`;
2833
2833
  throw new Error("Invalid URL. URL must start with http(s):// or ws(s)://.");
2834
- }, ce = /* @__PURE__ */ new WeakSet(), Ne = function(n, e) {
2835
- u(this, L).error("Error:", { error: n }), u(this, F).emit("errored", { error: n }), e == null || e(n);
2836
- }, je = /* @__PURE__ */ new WeakSet(), $t = function(n) {
2837
- if (E(this, Ce, Ze).call(this), n.data === Yn) {
2838
- u(this, L).debug("Received ping from server"), E(this, he, Fe).call(this, qn);
2834
+ }, fe = /* @__PURE__ */ new WeakSet(), Te = function(n, e) {
2835
+ c(this, T).error("Error:", { error: n }), c(this, F).emit("errored", { error: n }), e == null || e(n);
2836
+ }, Ye = /* @__PURE__ */ new WeakSet(), Yt = function(n) {
2837
+ if (w(this, xe, Qe).call(this), n.data === bt) {
2838
+ c(this, T).debug("Received ping from server"), w(this, oe, de).call(this, yt);
2839
+ return;
2840
+ }
2841
+ if (n.data === yt) {
2842
+ c(this, T).debug("Received pong from server");
2839
2843
  return;
2840
2844
  }
2841
- const e = Kt.decode(n.data), { id: t, payload: i } = e;
2842
- u(this, L).debug("Received message", { event: e.event, messageID: t }), u(this, F).emit(e.event.toString(), { id: t, payload: i });
2843
- }, Je = /* @__PURE__ */ new WeakSet(), dt = function() {
2844
- return u(this, R).readyState === 1;
2845
- }, Se = /* @__PURE__ */ new WeakSet(), Xe = function(n, e) {
2846
- p(this, q, { reason: e, code: n }), u(this, F).emit("disconnected", { code: n, reason: e });
2847
- }, Ge = /* @__PURE__ */ new WeakSet(), jt = function() {
2848
- const { reason: n, code: e } = u(this, q);
2849
- e && e !== 1e3 && u(this, $) && u(this, I).autoReconnect && !u(this, B) && (u(this, L).debug(`Triggering reconnection due to ${n}.`), u(this, F).emit(
2845
+ const e = Xt.decode(n.data), { id: t, payload: i } = e;
2846
+ c(this, T).debug("Received message", { event: e.event, messageID: t }), c(this, F).emit(e.event.toString(), { id: t, payload: i });
2847
+ }, Re = /* @__PURE__ */ new WeakSet(), Je = function() {
2848
+ return c(this, O).readyState === 1;
2849
+ }, De = /* @__PURE__ */ new WeakSet(), qe = function(n, e) {
2850
+ p(this, q, { reason: e, code: n }), c(this, F).emit("disconnected", { code: n, reason: e });
2851
+ }, ze = /* @__PURE__ */ new WeakSet(), qt = function() {
2852
+ const { reason: n, code: e } = c(this, q);
2853
+ e && e !== 1e3 && c(this, $) && c(this, y).autoReconnect && !c(this, B) && (c(this, T).debug(`Triggering reconnection due to ${n}.`), c(this, F).emit(
2850
2854
  "reconnecting"
2851
2855
  /* reconnecting */
2852
- ), E(this, fe, Ie).call(this));
2853
- }, fe = /* @__PURE__ */ new WeakSet(), Ie = async function(n = !0) {
2854
- if (n && u(this, B)) {
2855
- u(this, L).debug("Reconnect called when already in a reconnect loop. Ignoring.");
2856
+ ), w(this, le, Oe).call(this));
2857
+ }, le = /* @__PURE__ */ new WeakSet(), Oe = async function(n = !0) {
2858
+ if (n && c(this, B)) {
2859
+ c(this, T).debug("Reconnect called when already in a reconnect loop. Ignoring.");
2856
2860
  return;
2857
2861
  }
2858
- if (u(this, B) || u(this, P).reset(), u(this, I).maxReconnectionAttempts !== null && u(this, P).getAttempts() >= u(this, I).maxReconnectionAttempts) {
2859
- u(this, F).emit(
2862
+ if (c(this, B) || c(this, P).reset(), c(this, y).maxReconnectionAttempts !== null && c(this, P).getAttempts() >= c(this, y).maxReconnectionAttempts) {
2863
+ c(this, F).emit(
2860
2864
  "failed"
2861
2865
  /* failed */
2862
2866
  ), p(this, B, !1);
2863
2867
  return;
2864
2868
  }
2865
- p(this, B, !0), E(this, de, Me).call(this), E(this, se, le).call(this);
2869
+ p(this, B, !0), w(this, pe, Be).call(this), w(this, ae, ge).call(this);
2866
2870
  try {
2867
- if (await u(this, P).wait(), u(this, $) === !1)
2871
+ if (await c(this, P).wait(), c(this, $) === !1)
2868
2872
  return;
2869
- if (u(this, L).debug(`Reconnection attempt ${u(this, P).getAttempts()}`), u(this, F).emit("reconnectAttempt", { attempt: u(this, P).getAttempts() }), await this.connect(), !E(this, Je, dt).call(this))
2873
+ if (c(this, T).debug(`Reconnection attempt ${c(this, P).getAttempts()}`), c(this, F).emit("reconnectAttempt", { attempt: c(this, P).getAttempts() }), await this.connect(), !w(this, Re, Je).call(this))
2870
2874
  throw Error("Reconnect Failed");
2871
2875
  p(this, B, !1), p(this, q, {
2872
2876
  code: void 0,
2873
2877
  reason: void 0
2874
- }), u(this, F).emit(
2878
+ }), c(this, F).emit(
2875
2879
  "reconnected"
2876
2880
  /* reconnected */
2877
2881
  );
2878
2882
  } catch {
2879
- u(this, L).debug("Failed to reconnect."), u(this, F).emit("reconnectFailure", { attempt: u(this, P).getAttempts() }), E(this, fe, Ie).call(this, !1);
2883
+ c(this, T).debug("Failed to reconnect."), c(this, F).emit("reconnectFailure", { attempt: c(this, P).getAttempts() }), w(this, le, Oe).call(this, !1);
2880
2884
  }
2881
- }, he = /* @__PURE__ */ new WeakSet(), Fe = function(n) {
2885
+ }, oe = /* @__PURE__ */ new WeakSet(), de = function(n) {
2882
2886
  try {
2883
- return u(this, R).send(n), !0;
2887
+ return c(this, O).send(n), !0;
2884
2888
  } catch (e) {
2885
- return u(this, L).error(e.message), !1;
2889
+ return c(this, T).error(e.message), !1;
2886
2890
  }
2887
- }, Ce = /* @__PURE__ */ new WeakSet(), Ze = function() {
2888
- this.config.disconnectOnPingTimeout && (u(this, L).debug("Resetting ping timeout"), E(this, se, le).call(this), p(this, ne, setTimeout(() => {
2891
+ }, xe = /* @__PURE__ */ new WeakSet(), Qe = function() {
2892
+ this.config.disconnectOnPingTimeout && (c(this, T).debug("Resetting ping timeout"), w(this, ae, ge).call(this), p(this, ne, setTimeout(() => {
2889
2893
  var n;
2890
- u(this, L).debug("Disconnecting the socket due to ping timeout"), p(this, $, !0);
2894
+ c(this, T).debug("Disconnecting the socket due to ping timeout"), p(this, $, !0);
2891
2895
  const e = 3002, t = "Ping timeout";
2892
- (n = u(this, R)) == null || n.close(e, t), E(this, Se, Xe).call(this, e, t);
2893
- }, u(this, I).pingTimeout)));
2894
- }, se = /* @__PURE__ */ new WeakSet(), le = function() {
2895
- u(this, ne) && (clearTimeout(u(this, ne)), p(this, ne, void 0));
2896
- }, de = /* @__PURE__ */ new WeakSet(), Me = function() {
2897
- u(this, R) && (u(this, R).onopen = void 0, u(this, R).onerror = void 0, u(this, R).onmessage = void 0, u(this, R).onclose = void 0);
2896
+ (n = c(this, O)) == null || n.close(e, t), w(this, De, qe).call(this, e, t);
2897
+ }, c(this, y).pingTimeout)));
2898
+ }, ae = /* @__PURE__ */ new WeakSet(), ge = function() {
2899
+ c(this, ne) && (clearTimeout(c(this, ne)), p(this, ne, void 0));
2900
+ }, He = /* @__PURE__ */ new WeakSet(), zt = function() {
2901
+ w(this, me, Le).call(this), c(this, y).clientInitiatedPings && p(this, ie, setInterval(() => {
2902
+ w(this, Re, Je).call(this) && (c(this, T).debug("Sending client-initiated ping"), w(this, oe, de).call(this, bt));
2903
+ }, c(this, y).clientInitiatedPingInterval));
2904
+ }, me = /* @__PURE__ */ new WeakSet(), Le = function() {
2905
+ c(this, ie) && (clearInterval(c(this, ie)), p(this, ie, void 0));
2906
+ }, pe = /* @__PURE__ */ new WeakSet(), Be = function() {
2907
+ w(this, me, Le).call(this), c(this, O) && (c(this, O).onopen = void 0, c(this, O).onerror = void 0, c(this, O).onmessage = void 0, c(this, O).onclose = void 0);
2898
2908
  };
2899
- class Qn {
2909
+ class ii {
2900
2910
  constructor(e, t) {
2901
2911
  this.url = e, console.info(`Creating websocket with url: ${e} and config: ${t}`);
2902
2912
  }
@@ -2913,12 +2923,12 @@ class Qn {
2913
2923
  console.info(`Adding listener to websocket: ${e} with listener: ${t}`);
2914
2924
  }
2915
2925
  }
2916
- var Z, ee, me;
2917
- class Hn {
2926
+ var Z, ee, be;
2927
+ class ri {
2918
2928
  constructor(e, t = !1) {
2919
- A(this, Z, null);
2920
- A(this, ee, !1);
2921
- A(this, me, !1);
2929
+ D(this, Z, null);
2930
+ D(this, ee, !1);
2931
+ D(this, be, !1);
2922
2932
  this.wsUrl = e, this.devMode = t;
2923
2933
  }
2924
2934
  get connected() {
@@ -2926,191 +2936,188 @@ class Hn {
2926
2936
  }
2927
2937
  async connect(e) {
2928
2938
  let t;
2929
- this.devMode ? t = new Qn(this.wsUrl, {
2939
+ this.devMode ? t = new ii(this.wsUrl, {
2930
2940
  queueOnDisconnect: !0,
2931
2941
  flushOnReconnect: !0
2932
- }) : t = new zn(this.wsUrl, {
2942
+ }) : t = new ni(this.wsUrl, {
2933
2943
  queueOnDisconnect: !0,
2934
2944
  flushOnReconnect: !0
2935
- }), e.participants.addListener(
2936
- "broadcastedMessage",
2937
- (i) => t.sendRaw(JSON.stringify(i))
2938
- ), v.info("Connecting to websocket"), t.on("connected", () => {
2939
- v.info("Connected to websocket");
2945
+ }), e.participants.addListener("broadcastedMessage", (i) => t.sendRaw(JSON.stringify(i))), N.info("Connecting to websocket"), t.on("connected", () => {
2946
+ N.info("Connected to websocket");
2940
2947
  }), await t.connect(!0), C(this, Z, t), C(this, ee, !0);
2941
2948
  }
2942
2949
  disconnect() {
2943
2950
  l(this, Z) && (l(this, Z).disconnect(), C(this, ee, !1));
2944
2951
  }
2945
2952
  startRecordingMessage() {
2946
- if (l(this, me))
2953
+ if (l(this, be))
2947
2954
  throw new Error("Start recording message already sent");
2948
2955
  if (l(this, Z) && l(this, ee))
2949
- C(this, me, !0), l(this, Z).sendRaw(JSON.stringify({ type: "StartRecording" }));
2956
+ C(this, be, !0), l(this, Z).sendRaw(JSON.stringify({ type: "StartRecording" }));
2950
2957
  else
2951
2958
  throw new Error("Not connected to websocket, make sure you have called init.");
2952
2959
  }
2953
2960
  }
2954
- Z = new WeakMap(), ee = new WeakMap(), me = new WeakMap();
2955
- class ei {
2961
+ Z = new WeakMap(), ee = new WeakMap(), be = new WeakMap();
2962
+ class si {
2956
2963
  constructor() {
2957
2964
  }
2958
2965
  checkIfSDKEnabled() {
2959
- return v.info("Check if SDK enabled"), window.dyteRecordingSdk === !0 || window.realtimeKitRecordingSdk === !0;
2966
+ return N.info("Check if SDK enabled"), window.dyteRecordingSdk === !0 || window.realtimeKitRecordingSdk === !0;
2960
2967
  }
2961
2968
  checkIfRecordingTriggerAdded() {
2962
- return v.info("Check if recording trigger added"), window.triggerDyteRecording === !0 || window.triggerRealtimeKitRecording === !0;
2969
+ return N.info("Check if recording trigger added"), window.triggerDyteRecording === !0 || window.triggerRealtimeKitRecording === !0;
2963
2970
  }
2964
2971
  checkMeetingJoined() {
2965
2972
  var e;
2966
- return v.info("Check if meeting joined getter available"), ((e = window.realtimeKitRecording) == null ? void 0 : e.isMeetingJoined()) !== !0;
2973
+ return N.info("Check if meeting joined getter available"), ((e = window.realtimeKitRecording) == null ? void 0 : e.isMeetingJoined()) !== !0;
2967
2974
  }
2968
2975
  checkParticipantCount() {
2969
2976
  var e;
2970
- return v.info("Check if participant count getter available"), ((e = window.realtimeKitRecording) == null ? void 0 : e.getParticipantCount()) !== void 0;
2977
+ return N.info("Check if participant count getter available"), ((e = window.realtimeKitRecording) == null ? void 0 : e.getParticipantCount()) !== void 0;
2971
2978
  }
2972
2979
  pageLoadTests() {
2973
- v.info("Running on page load tests");
2974
- let e = [];
2980
+ N.info("Running on page load tests");
2981
+ const e = [];
2975
2982
  if (this.checkIfSDKEnabled() || e.push("SDK not enabled"), e.length > 0)
2976
2983
  throw new Error(e.join(", "));
2977
2984
  }
2978
2985
  sdkInitTests() {
2979
- v.info("Running SDK init tests");
2980
- let e = [];
2986
+ N.info("Running SDK init tests");
2987
+ const e = [];
2981
2988
  if (this.checkIfRecordingTriggerAdded() || e.push("Recording trigger not added"), this.checkParticipantCount() || e.push("Participant count getter not working"), e.length > 0)
2982
2989
  throw new Error(e.join(`
2983
2990
  `));
2984
2991
  }
2985
2992
  showAlert(e) {
2986
- v.error(e), e += "You can contact Dyte support for help", window.alert(e);
2993
+ N.error(e), e += "You can contact Dyte support for help", window.alert(e);
2987
2994
  }
2988
2995
  }
2989
- var Y, T, x, U, ae;
2990
- class ni {
2996
+ var Y, R, x, V, ue;
2997
+ class ai {
2991
2998
  /**
2992
- * This method is used to instantiate the RealtimeKitRecording class.
2993
- * @param options The options object.
2994
- * @param options.waitTimeMs The time it waits after all the peer have left to leave the meeting. (If you pass
2995
- * autoStop as false, this option is ignored)
2996
- * @param options.autoStart If you wish to start recording as soon as the `init` is called.
2997
- * @param options.autoStop If you wish to disable automatic peer leave and call `stopRecording` manually set this to `false`.
2998
- * @param options.scanInterval Interval between scans for automatic peer leave.
2999
- * @param options.websocketUrl The url of the websocket server to connect to. Defaults to localhost:8080/ws. Do not change this unless you know what you are doing.
3000
- */
2999
+ * This method is used to instantiate the RealtimeKitRecording class.
3000
+ * @param options The options object.
3001
+ * @param options.waitTimeMs The time it waits after all the peer have left to leave the meeting. (If you pass
3002
+ * autoStop as false, this option is ignored)
3003
+ * @param options.autoStart If you wish to start recording as soon as the `init` is called.
3004
+ * @param options.autoStop If you wish to disable automatic peer leave and call `stopRecording` manually set this to `false`.
3005
+ * @param options.scanInterval Interval between scans for automatic peer leave.
3006
+ * @param options.websocketUrl The url of the websocket server to connect to. Defaults to localhost:8080/ws. Do not change this unless you know what you are doing.
3007
+ */
3001
3008
  constructor(e) {
3002
- A(this, Y, void 0);
3003
- A(this, T, void 0);
3004
- A(this, x, void 0);
3005
- A(this, U, void 0);
3006
- A(this, ae, void 0);
3007
- e.waitTimeMs && !e.autoStop && v.warn("You have passed both waitTimeMs and autoStop. waitTimeMs will be ignored"), C(this, T, {
3008
- waitTimeMs: e.waitTimeMs ?? 1 * nn,
3009
+ D(this, Y, void 0);
3010
+ D(this, R, void 0);
3011
+ D(this, x, void 0);
3012
+ D(this, V, void 0);
3013
+ D(this, ue, void 0);
3014
+ e.waitTimeMs && !e.autoStop && N.warn("You have passed both waitTimeMs and autoStop. waitTimeMs will be ignored"), C(this, R, {
3015
+ waitTimeMs: e.waitTimeMs ?? 1 * fn,
3009
3016
  websocketUrl: e.websocketUrl ?? "ws://localhost:8080/ws",
3010
3017
  autoStart: e.autoStart ?? !0,
3011
3018
  autoStop: e.autoStop ?? !0,
3012
3019
  devMode: window.navigator.webdriver == !1,
3013
- scanInterval: e.scanInterval ?? rn
3014
- }), window.dyteRecordingSdk = !0, window.realtimeKitRecordingSdk = !0, window.devMode = l(this, T).devMode, C(this, U, new ei()), this.performOnPageLoadChecks();
3020
+ scanInterval: e.scanInterval ?? hn
3021
+ }), window.dyteRecordingSdk = !0, window.realtimeKitRecordingSdk = !0, window.devMode = l(this, R).devMode, C(this, V, new si()), this.performOnPageLoadChecks();
3015
3022
  }
3016
3023
  /**
3017
- * The `init` method can be used to instantiate the RealtimeKitRecording class.
3018
- * @param client The RealtimeKitClient instance.
3019
- */
3024
+ * The `init` method can be used to instantiate the RealtimeKitRecording class.
3025
+ * @param client The RealtimeKitClient instance.
3026
+ */
3020
3027
  async init(e) {
3021
- v.info("Initializing RealtimeKit Recording SDK");
3022
- const t = new sn(new on(e), {
3023
- autoStop: l(this, T).autoStop,
3024
- waitTimeMs: l(this, T).waitTimeMs,
3025
- scanInterval: l(this, T).scanInterval
3026
- }), i = new Hn(l(this, T).websocketUrl, l(this, T).devMode);
3027
- await i.connect(e), C(this, x, i), C(this, Y, t), this.sdkInitTests(), v.init(e), C(this, ae, e), l(this, T).autoStart && await this.startRecording();
3028
- }
3029
- /**
3030
- * The `startRecording` method can be used to manually start recording.
3031
- * Make sure meeting is not already joined before calling this method.
3032
- * @note This method has a timeout of 2mins. If this method is not called within 2mins of the websocket
3033
- * being connected, the recording will error out.
3034
- */
3028
+ N.info("Initializing RealtimeKit Recording SDK");
3029
+ const t = new ln(new dn(e), {
3030
+ autoStop: l(this, R).autoStop,
3031
+ waitTimeMs: l(this, R).waitTimeMs,
3032
+ scanInterval: l(this, R).scanInterval
3033
+ }), i = new ri(l(this, R).websocketUrl, l(this, R).devMode);
3034
+ await i.connect(e), C(this, x, i), C(this, Y, t), this.sdkInitTests(), N.init(e), C(this, ue, e), l(this, R).autoStart && await this.startRecording();
3035
+ }
3036
+ /**
3037
+ * The `startRecording` method can be used to manually start recording.
3038
+ * Make sure meeting is not already joined before calling this method.
3039
+ * @note This method has a timeout of 2mins. If this method is not called within 2mins of the websocket
3040
+ * being connected, the recording will error out.
3041
+ */
3035
3042
  async startRecording() {
3036
3043
  var e, t;
3037
- if ((e = l(this, ae)) != null && e.self.roomJoined) {
3038
- const i = "Meeting already joined. Cannot start recording. SDK will call joinRoom automatically.";
3039
- if (v.warn(i), l(this, T).devMode)
3044
+ if ((e = l(this, ue)) != null && e.self.roomJoined) {
3045
+ const i = "Meeting already joined. Cannot start recording. SDK will call meeting.join() automatically.";
3046
+ if (N.warn(i), l(this, R).devMode)
3040
3047
  throw new Error(i);
3041
3048
  }
3042
- if (await ((t = l(this, ae)) == null ? void 0 : t.joinRoom()), v.info("Sending start recording request"), l(this, x))
3049
+ if (await ((t = l(this, ue)) == null ? void 0 : t.join()), N.info("Sending start recording request"), l(this, x))
3043
3050
  try {
3044
3051
  l(this, x).startRecordingMessage();
3045
3052
  } catch (i) {
3046
3053
  const r = `Failed to start recording with error: ${i}`;
3047
- if (v.error(r), l(this, T).devMode)
3054
+ if (N.error(r), l(this, R).devMode)
3048
3055
  throw new Error(r);
3049
3056
  }
3050
3057
  }
3051
3058
  /**
3052
- * The `stopRecording` method can be used to stop recording.
3053
- * @throws Error if `autoStop` is true.
3054
- */
3059
+ * The `stopRecording` method can be used to stop recording.
3060
+ * @throws Error if `autoStop` is true.
3061
+ */
3055
3062
  stopRecording() {
3056
- if (v.info("Stopping RealtimeKit Recording SDK"), l(this, Y))
3063
+ if (N.info("Stopping RealtimeKit Recording SDK"), l(this, Y))
3057
3064
  l(this, Y).stopRecording(), l(this, x) && l(this, x).connected && l(this, x).disconnect();
3058
3065
  else {
3059
3066
  const e = "recording controller not initialized";
3060
- if (v.error(e), l(this, T).devMode)
3067
+ if (N.error(e), l(this, R).devMode)
3061
3068
  throw new Error(e);
3062
3069
  }
3063
3070
  }
3064
3071
  /**
3065
- * The `cleanup` method can be used to cleanup the SDK.
3066
- */
3072
+ * The `cleanup` method can be used to cleanup the SDK.
3073
+ */
3067
3074
  async cleanup() {
3068
- if (v.info("Cleaning up RealtimeKit Recording SDK"), delete window.devMode, delete window.realtimeKitRecordingSdk, delete window.dyteRecordingSdk, l(this, Y))
3075
+ if (N.info("Cleaning up RealtimeKit Recording SDK"), delete window.devMode, delete window.realtimeKitRecordingSdk, delete window.dyteRecordingSdk, l(this, Y))
3069
3076
  try {
3070
3077
  l(this, Y).cleanup(), l(this, x) && l(this, x).connected && l(this, x).disconnect();
3071
3078
  } catch (e) {
3072
3079
  const t = `Failed to cleanup with error: ${e}`;
3073
- if (v.error(t), l(this, T).devMode)
3080
+ if (N.error(t), l(this, R).devMode)
3074
3081
  throw new Error(t);
3075
3082
  }
3076
3083
  else {
3077
3084
  const e = "recording controller not initialized";
3078
- if (v.error("recording controller not initialized"), l(this, T).devMode)
3085
+ if (N.error("recording controller not initialized"), l(this, R).devMode)
3079
3086
  throw new Error(e);
3080
3087
  }
3081
3088
  }
3082
3089
  performOnPageLoadChecks() {
3083
- if (l(this, U))
3090
+ if (l(this, V))
3084
3091
  try {
3085
- l(this, U).pageLoadTests();
3092
+ l(this, V).pageLoadTests();
3086
3093
  } catch (e) {
3087
3094
  const t = `Failed to perform page load checks with error: ${e}`;
3088
- if (typeof e == "string" && l(this, T).devMode && l(this, U).showAlert(e), l(this, T).devMode)
3095
+ if (typeof e == "string" && l(this, R).devMode && l(this, V).showAlert(e), l(this, R).devMode)
3089
3096
  throw new Error(t);
3090
3097
  }
3091
3098
  else {
3092
3099
  const e = "SDK Checks controller not initialized";
3093
- if (l(this, T).devMode)
3100
+ if (l(this, R).devMode)
3094
3101
  throw new Error(e);
3095
3102
  }
3096
3103
  }
3097
3104
  sdkInitTests() {
3098
- if (l(this, U))
3105
+ if (l(this, V))
3099
3106
  try {
3100
- l(this, U).sdkInitTests();
3107
+ l(this, V).sdkInitTests();
3101
3108
  } catch (e) {
3102
3109
  const t = `Failed to perform sdk init checks with error: ${e}`;
3103
- if (typeof e == "string" && l(this, T).devMode && l(this, U).showAlert(e), l(this, T).devMode)
3110
+ if (typeof e == "string" && l(this, R).devMode && l(this, V).showAlert(e), l(this, R).devMode)
3104
3111
  throw new Error(t);
3105
3112
  }
3106
3113
  else {
3107
3114
  const e = "SDK Checks controller not initialized";
3108
- if (l(this, T).devMode)
3115
+ if (l(this, R).devMode)
3109
3116
  throw new Error(e);
3110
3117
  }
3111
3118
  }
3112
3119
  }
3113
- Y = new WeakMap(), T = new WeakMap(), x = new WeakMap(), U = new WeakMap(), ae = new WeakMap();
3120
+ Y = new WeakMap(), R = new WeakMap(), x = new WeakMap(), V = new WeakMap(), ue = new WeakMap();
3114
3121
  export {
3115
- ni as RealtimeKitRecording
3122
+ ai as RealtimeKitRecording
3116
3123
  };