livekit-client 2.19.0 → 2.19.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.
@@ -491,16 +491,15 @@ function int64ToString(lo, hi) {
491
491
  * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
492
492
  */
493
493
  function uInt64ToString(lo, hi) {
494
- ({
495
- lo,
496
- hi
497
- } = toUnsigned(lo, hi));
498
494
  // Skip the expensive conversion if the number is small enough to use the
499
495
  // built-in conversions.
500
496
  // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with
501
497
  // highBits <= 0x1FFFFF can be safely expressed with a double and retain
502
498
  // integer precision.
503
499
  // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true.
500
+ var _toUnsigned = toUnsigned(lo, hi);
501
+ lo = _toUnsigned.lo;
502
+ hi = _toUnsigned.hi;
504
503
  if (hi <= 0x1FFFFF) {
505
504
  return String(TWO_PWR_32_DBL * hi + lo);
506
505
  }
@@ -921,19 +920,55 @@ function isScalarZeroValue(type, value) {
921
920
  }
922
921
  }
923
922
 
924
- // Copyright 2021-2024 Buf Technologies, Inc.
925
- //
926
- // Licensed under the Apache License, Version 2.0 (the "License");
927
- // you may not use this file except in compliance with the License.
928
- // You may obtain a copy of the License at
929
- //
930
- // http://www.apache.org/licenses/LICENSE-2.0
931
- //
932
- // Unless required by applicable law or agreed to in writing, software
933
- // distributed under the License is distributed on an "AS IS" BASIS,
934
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
935
- // See the License for the specific language governing permissions and
936
- // limitations under the License.
923
+ function _arrayLikeToArray(r, a) {
924
+ (null == a || a > r.length) && (a = r.length);
925
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
926
+ return n;
927
+ }
928
+ function _arrayWithHoles(r) {
929
+ if (Array.isArray(r)) return r;
930
+ }
931
+ function _iterableToArrayLimit(r, l) {
932
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
933
+ if (null != t) {
934
+ var e,
935
+ n,
936
+ i,
937
+ u,
938
+ a = [],
939
+ f = true,
940
+ o = false;
941
+ try {
942
+ if (i = (t = t.call(r)).next, 0 === l) {
943
+ if (Object(t) !== t) return;
944
+ f = !1;
945
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
946
+ } catch (r) {
947
+ o = true, n = r;
948
+ } finally {
949
+ try {
950
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
951
+ } finally {
952
+ if (o) throw n;
953
+ }
954
+ }
955
+ return a;
956
+ }
957
+ }
958
+ function _nonIterableRest() {
959
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
960
+ }
961
+ function _slicedToArray(r, e) {
962
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
963
+ }
964
+ function _unsupportedIterableToArray(r, a) {
965
+ if (r) {
966
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
967
+ var t = {}.toString.call(r).slice(8, -1);
968
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
969
+ }
970
+ }
971
+
937
972
  /* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/restrict-plus-operands */
938
973
  /**
939
974
  * Protobuf binary format wire types.
@@ -1246,7 +1281,10 @@ class BinaryReader {
1246
1281
  break;
1247
1282
  case WireType.StartGroup:
1248
1283
  for (;;) {
1249
- const [fn, wt] = this.tag();
1284
+ const _this$tag = this.tag(),
1285
+ _this$tag2 = _slicedToArray(_this$tag, 2),
1286
+ fn = _this$tag2[0],
1287
+ wt = _this$tag2[1];
1250
1288
  if (wt === WireType.EndGroup) {
1251
1289
  if (fieldNo !== undefined && fn !== fieldNo) {
1252
1290
  throw new Error("invalid end group tag");
@@ -1298,7 +1336,10 @@ class BinaryReader {
1298
1336
  * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
1299
1337
  */
1300
1338
  sint64() {
1301
- let [lo, hi] = this.varint64();
1339
+ let _this$varint = this.varint64(),
1340
+ _this$varint2 = _slicedToArray(_this$varint, 2),
1341
+ lo = _this$varint2[0],
1342
+ hi = _this$varint2[1];
1302
1343
  // decode zig zag
1303
1344
  let s = -(lo & 1);
1304
1345
  lo = (lo >>> 1 | (hi & 1) << 31) ^ s;
@@ -1309,7 +1350,10 @@ class BinaryReader {
1309
1350
  * Read a `bool` field, a variant.
1310
1351
  */
1311
1352
  bool() {
1312
- let [lo, hi] = this.varint64();
1353
+ let _this$varint3 = this.varint64(),
1354
+ _this$varint4 = _slicedToArray(_this$varint3, 2),
1355
+ lo = _this$varint4[0],
1356
+ hi = _this$varint4[1];
1313
1357
  return lo !== 0 || hi !== 0;
1314
1358
  }
1315
1359
  /**
@@ -1576,19 +1620,6 @@ const protoBase64 = {
1576
1620
  }
1577
1621
  };
1578
1622
 
1579
- // Copyright 2021-2024 Buf Technologies, Inc.
1580
- //
1581
- // Licensed under the Apache License, Version 2.0 (the "License");
1582
- // you may not use this file except in compliance with the License.
1583
- // You may obtain a copy of the License at
1584
- //
1585
- // http://www.apache.org/licenses/LICENSE-2.0
1586
- //
1587
- // Unless required by applicable law or agreed to in writing, software
1588
- // distributed under the License is distributed on an "AS IS" BASIS,
1589
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1590
- // See the License for the specific language governing permissions and
1591
- // limitations under the License.
1592
1623
  /**
1593
1624
  * Retrieve an extension value from a message.
1594
1625
  *
@@ -1607,7 +1638,10 @@ function getExtension(message, extension, options) {
1607
1638
  assertExtendee(extension, message);
1608
1639
  const opt = extension.runtime.bin.makeReadOptions(options);
1609
1640
  const ufs = filterUnknownFields(message.getType().runtime.bin.listUnknownFields(message), extension.field);
1610
- const [container, get] = createExtensionContainer(extension);
1641
+ const _createExtensionConta = createExtensionContainer(extension),
1642
+ _createExtensionConta2 = _slicedToArray(_createExtensionConta, 2),
1643
+ container = _createExtensionConta2[0],
1644
+ get = _createExtensionConta2[1];
1611
1645
  for (const uf of ufs) {
1612
1646
  extension.runtime.bin.readField(container, opt.readerFactory(uf.data), extension.field, uf.wireType, opt);
1613
1647
  }
@@ -1642,7 +1676,10 @@ function setExtension(message, extension, value, options) {
1642
1676
  extension.runtime.bin.writeField(f, value, writer, writeOpt);
1643
1677
  const reader = readOpt.readerFactory(writer.finish());
1644
1678
  while (reader.pos < reader.len) {
1645
- const [no, wireType] = reader.tag();
1679
+ const _reader$tag = reader.tag(),
1680
+ _reader$tag2 = _slicedToArray(_reader$tag, 2),
1681
+ no = _reader$tag2[0],
1682
+ wireType = _reader$tag2[1];
1646
1683
  const data = reader.skip(wireType, no);
1647
1684
  message.getType().runtime.bin.onUnknownField(message, no, wireType, data);
1648
1685
  }
@@ -1811,19 +1848,6 @@ function wrapField(type, value) {
1811
1848
  "google.protobuf.BytesValue": ScalarType.BYTES
1812
1849
  });
1813
1850
 
1814
- // Copyright 2021-2024 Buf Technologies, Inc.
1815
- //
1816
- // Licensed under the Apache License, Version 2.0 (the "License");
1817
- // you may not use this file except in compliance with the License.
1818
- // You may obtain a copy of the License at
1819
- //
1820
- // http://www.apache.org/licenses/LICENSE-2.0
1821
- //
1822
- // Unless required by applicable law or agreed to in writing, software
1823
- // distributed under the License is distributed on an "AS IS" BASIS,
1824
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1825
- // See the License for the specific language governing permissions and
1826
- // limitations under the License.
1827
1851
  /* eslint-disable no-case-declarations,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call */
1828
1852
  // Default options for parsing JSON.
1829
1853
  const jsonReadDefaults = {
@@ -1855,7 +1879,10 @@ function makeJsonFormat() {
1855
1879
  message = message !== null && message !== void 0 ? message : new type();
1856
1880
  const oneofSeen = new Map();
1857
1881
  const registry = options.typeRegistry;
1858
- for (const [jsonKey, jsonValue] of Object.entries(json)) {
1882
+ for (const _ref of Object.entries(json)) {
1883
+ var _ref2 = _slicedToArray(_ref, 2);
1884
+ const jsonKey = _ref2[0];
1885
+ const jsonValue = _ref2[1];
1859
1886
  const field = type.fields.findJsonName(jsonKey);
1860
1887
  if (field) {
1861
1888
  if (field.oneof) {
@@ -1876,7 +1903,10 @@ function makeJsonFormat() {
1876
1903
  const ext = registry.findExtension(jsonKey.substring(1, jsonKey.length - 1));
1877
1904
  if (ext && ext.extendee.typeName == type.typeName) {
1878
1905
  found = true;
1879
- const [container, get] = createExtensionContainer(ext);
1906
+ const _createExtensionConta = createExtensionContainer(ext),
1907
+ _createExtensionConta2 = _slicedToArray(_createExtensionConta, 2),
1908
+ container = _createExtensionConta2[0],
1909
+ get = _createExtensionConta2[1];
1880
1910
  readField$1(container, jsonValue, ext.field, options, ext);
1881
1911
  // We pass on the options as BinaryReadOptions/BinaryWriteOptions,
1882
1912
  // so that users can bring their own binary reader and writer factories
@@ -2019,7 +2049,10 @@ function readField$1(target, jsonValue, field, options, parentType) {
2019
2049
  throw new Error("cannot decode field ".concat(parentType.typeName, ".").concat(field.name, " from JSON: ").concat(debugJsonValue(jsonValue)));
2020
2050
  }
2021
2051
  const targetMap = target[localName];
2022
- for (const [jsonMapKey, jsonMapValue] of Object.entries(jsonValue)) {
2052
+ for (const _ref3 of Object.entries(jsonValue)) {
2053
+ var _ref4 = _slicedToArray(_ref3, 2);
2054
+ const jsonMapKey = _ref4[0];
2055
+ const jsonMapValue = _ref4[1];
2023
2056
  if (jsonMapValue === null) {
2024
2057
  throw new Error("cannot decode field ".concat(parentType.typeName, ".").concat(field.name, " from JSON: map value null"));
2025
2058
  }
@@ -2274,19 +2307,28 @@ function writeField$1(field, value, options) {
2274
2307
  const entries = Object.entries(value);
2275
2308
  switch (field.V.kind) {
2276
2309
  case "scalar":
2277
- for (const [entryKey, entryValue] of entries) {
2310
+ for (const _ref5 of entries) {
2311
+ var _ref6 = _slicedToArray(_ref5, 2);
2312
+ const entryKey = _ref6[0];
2313
+ const entryValue = _ref6[1];
2278
2314
  jsonObj[entryKey.toString()] = writeScalar$1(field.V.T, entryValue); // JSON standard allows only (double quoted) string as property key
2279
2315
  }
2280
2316
  break;
2281
2317
  case "message":
2282
- for (const [entryKey, entryValue] of entries) {
2318
+ for (const _ref7 of entries) {
2319
+ var _ref8 = _slicedToArray(_ref7, 2);
2320
+ const entryKey = _ref8[0];
2321
+ const entryValue = _ref8[1];
2283
2322
  // JSON standard allows only (double quoted) string as property key
2284
2323
  jsonObj[entryKey.toString()] = entryValue.toJson(options);
2285
2324
  }
2286
2325
  break;
2287
2326
  case "enum":
2288
2327
  const enumType = field.V.T;
2289
- for (const [entryKey, entryValue] of entries) {
2328
+ for (const _ref9 of entries) {
2329
+ var _ref0 = _slicedToArray(_ref9, 2);
2330
+ const entryKey = _ref0[0];
2331
+ const entryValue = _ref0[1];
2290
2332
  // JSON standard allows only (double quoted) string as property key
2291
2333
  jsonObj[entryKey.toString()] = writeEnum(enumType, entryValue, options.enumAsInteger);
2292
2334
  }
@@ -2382,19 +2424,6 @@ function writeScalar$1(type, value) {
2382
2424
  }
2383
2425
  }
2384
2426
 
2385
- // Copyright 2021-2024 Buf Technologies, Inc.
2386
- //
2387
- // Licensed under the Apache License, Version 2.0 (the "License");
2388
- // you may not use this file except in compliance with the License.
2389
- // You may obtain a copy of the License at
2390
- //
2391
- // http://www.apache.org/licenses/LICENSE-2.0
2392
- //
2393
- // Unless required by applicable law or agreed to in writing, software
2394
- // distributed under the License is distributed on an "AS IS" BASIS,
2395
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2396
- // See the License for the specific language governing permissions and
2397
- // limitations under the License.
2398
2427
  /* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return */
2399
2428
  const unknownFieldsSymbol = Symbol("@bufbuild/protobuf/unknown-fields");
2400
2429
  // Default options for parsing binary data.
@@ -2450,7 +2479,10 @@ function makeBinaryFormat() {
2450
2479
  const end = delimitedMessageEncoding ? reader.len : reader.pos + lengthOrEndTagFieldNo;
2451
2480
  let fieldNo, wireType;
2452
2481
  while (reader.pos < end) {
2453
- [fieldNo, wireType] = reader.tag();
2482
+ var _reader$tag = reader.tag();
2483
+ var _reader$tag2 = _slicedToArray(_reader$tag, 2);
2484
+ fieldNo = _reader$tag2[0];
2485
+ wireType = _reader$tag2[1];
2454
2486
  if (delimitedMessageEncoding === true && wireType == WireType.EndGroup) {
2455
2487
  break;
2456
2488
  }
@@ -2503,10 +2535,8 @@ function makeBinaryFormat() {
2503
2535
  function readField(target,
2504
2536
  // eslint-disable-line @typescript-eslint/no-explicit-any -- `any` is the best choice for dynamic access
2505
2537
  reader, field, wireType, options) {
2506
- let {
2507
- repeated,
2508
- localName
2509
- } = field;
2538
+ let repeated = field.repeated,
2539
+ localName = field.localName;
2510
2540
  if (field.oneof) {
2511
2541
  target = target[field.oneof.localName];
2512
2542
  if (target.case != localName) {
@@ -2556,7 +2586,10 @@ reader, field, wireType, options) {
2556
2586
  }
2557
2587
  break;
2558
2588
  case "map":
2559
- let [mapKey, mapVal] = readMapEntry(field, reader, options);
2589
+ let _readMapEntry = readMapEntry(field, reader, options),
2590
+ _readMapEntry2 = _slicedToArray(_readMapEntry, 2),
2591
+ mapKey = _readMapEntry2[0],
2592
+ mapVal = _readMapEntry2[1];
2560
2593
  // safe to assume presence of map object, oneof cannot contain repeated values
2561
2594
  target[localName][mapKey] = mapVal;
2562
2595
  break;
@@ -2578,7 +2611,9 @@ function readMapEntry(field, reader, options) {
2578
2611
  end = reader.pos + length;
2579
2612
  let key, val;
2580
2613
  while (reader.pos < end) {
2581
- const [fieldNo] = reader.tag();
2614
+ const _reader$tag3 = reader.tag(),
2615
+ _reader$tag4 = _slicedToArray(_reader$tag3, 1),
2616
+ fieldNo = _reader$tag4[0];
2582
2617
  switch (fieldNo) {
2583
2618
  case 1:
2584
2619
  key = readScalar(reader, field.K);
@@ -2692,7 +2727,10 @@ function writeField(field, value, writer, options) {
2692
2727
  break;
2693
2728
  case "map":
2694
2729
  assert(typeof value == "object" && value != null);
2695
- for (const [key, val] of Object.entries(value)) {
2730
+ for (const _ref of Object.entries(value)) {
2731
+ var _ref2 = _slicedToArray(_ref, 2);
2732
+ const key = _ref2[0];
2733
+ const val = _ref2[1];
2696
2734
  writeMapEntry(writer, options, field, key, val);
2697
2735
  }
2698
2736
  break;
@@ -2743,7 +2781,10 @@ function writeMessageField(writer, options, field, value) {
2743
2781
  }
2744
2782
  function writeScalar(writer, type, fieldNo, value) {
2745
2783
  assert(value !== undefined);
2746
- let [wireType, method] = scalarTypeInfo(type);
2784
+ let _scalarTypeInfo = scalarTypeInfo(type),
2785
+ _scalarTypeInfo2 = _slicedToArray(_scalarTypeInfo, 2),
2786
+ wireType = _scalarTypeInfo2[0],
2787
+ method = _scalarTypeInfo2[1];
2747
2788
  writer.tag(fieldNo, wireType)[method](value);
2748
2789
  }
2749
2790
  function writePacked(writer, type, fieldNo, value) {
@@ -2751,7 +2792,9 @@ function writePacked(writer, type, fieldNo, value) {
2751
2792
  return;
2752
2793
  }
2753
2794
  writer.tag(fieldNo, WireType.LengthDelimited).fork();
2754
- let [, method] = scalarTypeInfo(type);
2795
+ let _scalarTypeInfo3 = scalarTypeInfo(type),
2796
+ _scalarTypeInfo4 = _slicedToArray(_scalarTypeInfo3, 2),
2797
+ method = _scalarTypeInfo4[1];
2755
2798
  for (let i = 0; i < value.length; i++) {
2756
2799
  writer[method](value[i]);
2757
2800
  }
@@ -2791,19 +2834,6 @@ function scalarTypeInfo(type) {
2791
2834
  return [wireType, method];
2792
2835
  }
2793
2836
 
2794
- // Copyright 2021-2024 Buf Technologies, Inc.
2795
- //
2796
- // Licensed under the Apache License, Version 2.0 (the "License");
2797
- // you may not use this file except in compliance with the License.
2798
- // You may obtain a copy of the License at
2799
- //
2800
- // http://www.apache.org/licenses/LICENSE-2.0
2801
- //
2802
- // Unless required by applicable law or agreed to in writing, software
2803
- // distributed under the License is distributed on an "AS IS" BASIS,
2804
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2805
- // See the License for the specific language governing permissions and
2806
- // limitations under the License.
2807
2837
  /* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-argument,no-case-declarations */
2808
2838
  function makeUtilCommon() {
2809
2839
  return {
@@ -2852,7 +2882,10 @@ function makeUtilCommon() {
2852
2882
  case "scalar":
2853
2883
  case "enum":
2854
2884
  if (member.V.T === ScalarType.BYTES) {
2855
- for (const [k, v] of Object.entries(s[localName])) {
2885
+ for (const _ref of Object.entries(s[localName])) {
2886
+ var _ref2 = _slicedToArray(_ref, 2);
2887
+ const k = _ref2[0];
2888
+ const v = _ref2[1];
2856
2889
  t[localName][k] = toU8Arr(v);
2857
2890
  }
2858
2891
  } else {
@@ -2984,7 +3017,10 @@ function makeUtilCommon() {
2984
3017
  copy = source.map(cloneSingularField);
2985
3018
  } else if (member.kind == "map") {
2986
3019
  copy = any[member.localName];
2987
- for (const [key, v] of Object.entries(source)) {
3020
+ for (const _ref3 of Object.entries(source)) {
3021
+ var _ref4 = _slicedToArray(_ref3, 2);
3022
+ const key = _ref4[0];
3023
+ const v = _ref4[1];
2988
3024
  copy[key] = cloneSingularField(v);
2989
3025
  }
2990
3026
  } else if (member.kind == "oneof") {
@@ -3497,9 +3533,7 @@ function getBrowser(userAgent) {
3497
3533
  const ua = (navigator.userAgent).toLowerCase();
3498
3534
  if (browserDetails === undefined || force) {
3499
3535
  const browser = browsersList.find(_ref => {
3500
- let {
3501
- test
3502
- } = _ref;
3536
+ let test = _ref.test;
3503
3537
  return test.test(ua);
3504
3538
  });
3505
3539
  browserDetails = browser === null || browser === void 0 ? void 0 : browser.describe(ua);