moqtail 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +153 -473
  2. package/dist/client-CjdF7_cL.d.cts +1928 -0
  3. package/dist/{client-BviQ20Lc.cjs → client-FnSNJocV.cjs} +1102 -1192
  4. package/dist/client-I8mDg-Ls.d.mts +1928 -0
  5. package/dist/{client-zi0lmuIL.mjs → client-MXn-lkAA.mjs} +940 -1018
  6. package/dist/client.cjs +202 -7
  7. package/dist/client.d.cts +23 -1944
  8. package/dist/client.d.mts +23 -1944
  9. package/dist/client.mjs +195 -2
  10. package/dist/emitter-UbeRcbuf.mjs +109 -0
  11. package/dist/{logger-c2NoQqtx.cjs → emitter-qNJYD3yQ.cjs} +61 -2
  12. package/dist/{index-BY6e1obL.d.cts → index-BaZgHZ8D.d.mts} +124 -324
  13. package/dist/index-Bn8VlVoN.d.cts +2261 -0
  14. package/dist/index-Ch5QUygw.d.mts +2261 -0
  15. package/dist/index.cjs +18 -14
  16. package/dist/index.d.cts +20 -4
  17. package/dist/index.d.mts +20 -4
  18. package/dist/index.mjs +5 -4
  19. package/dist/logger-B8IYkljn.d.cts +64 -0
  20. package/dist/logger-B8IYkljn.d.mts +64 -0
  21. package/dist/model.cjs +380 -572
  22. package/dist/model.d.cts +2901 -2
  23. package/dist/model.d.mts +17 -2
  24. package/dist/model.mjs +380 -572
  25. package/dist/player/component.cjs +364 -0
  26. package/dist/player/component.d.cts +59 -0
  27. package/dist/player/component.d.mts +59 -0
  28. package/dist/player/component.mjs +362 -0
  29. package/dist/player-C6y-qpHz.cjs +8488 -0
  30. package/dist/player-DfJB6vBH.mjs +8293 -0
  31. package/dist/player.cjs +31 -0
  32. package/dist/player.d.cts +17 -0
  33. package/dist/player.d.mts +17 -0
  34. package/dist/player.mjs +1 -0
  35. package/dist/util.cjs +9 -10
  36. package/dist/util.d.cts +20 -13
  37. package/dist/util.d.mts +20 -13
  38. package/dist/util.mjs +4 -6
  39. package/package.json +46 -5
  40. package/dist/index-BY6e1obL.d.mts +0 -3087
  41. package/dist/logger-ByDB8lYF.mjs +0 -56
  42. package/dist/logger-dEoueCj7.d.cts +0 -35
  43. package/dist/logger-dEoueCj7.d.mts +0 -35
package/dist/model.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/model/error/error.ts
2
+ // src/model/error/error.ts
3
3
  /**
4
4
  * Copyright 2025 The MOQtail Authors
5
5
  *
@@ -196,8 +196,7 @@ var TerminationError = class extends MOQtailError {
196
196
  this.terminationCode = terminationCode;
197
197
  }
198
198
  };
199
- //#endregion
200
- //#region src/model/common/pair.ts
199
+ // src/model/common/pair.ts
201
200
  /**
202
201
  * Copyright 2025 The MOQtail Authors
203
202
  *
@@ -450,8 +449,7 @@ function isVarInt(pair) {
450
449
  function isBytes(pair) {
451
450
  return pair.value instanceof Uint8Array;
452
451
  }
453
- //#endregion
454
- //#region src/model/common/location.ts
452
+ // src/model/common/location.ts
455
453
  /**
456
454
  * Copyright 2025 The MOQtail Authors
457
455
  *
@@ -537,8 +535,7 @@ var Location = class Location {
537
535
  return 0;
538
536
  }
539
537
  };
540
- //#endregion
541
- //#region src/model/common/tuple.ts
538
+ // src/model/common/tuple.ts
542
539
  /**
543
540
  * Copyright 2025 The MOQtail Authors
544
541
  *
@@ -707,8 +704,7 @@ var Tuple = class Tuple {
707
704
  return this.fields.every((f, i) => f.value.toString() === other.fields[i].value.toString());
708
705
  }
709
706
  };
710
- //#endregion
711
- //#region src/model/common/reason_phrase.ts
707
+ // src/model/common/reason_phrase.ts
712
708
  /**
713
709
  * Copyright 2025 The MOQtail Authors
714
710
  *
@@ -812,8 +808,7 @@ var ReasonPhrase = class ReasonPhrase {
812
808
  }
813
809
  }
814
810
  };
815
- //#endregion
816
- //#region src/model/error/constant.ts
811
+ // src/model/error/constant.ts
817
812
  /**
818
813
  * Copyright 2025 The MOQtail Authors
819
814
  *
@@ -880,8 +875,7 @@ let TerminationCode = /* @__PURE__ */ function(TerminationCode) {
880
875
  }
881
876
  _TerminationCode.tryFrom = tryFrom;
882
877
  })(TerminationCode || (TerminationCode = {}));
883
- //#endregion
884
- //#region src/model/error/stream_reset.ts
878
+ // src/model/error/stream_reset.ts
885
879
  /**
886
880
  * Copyright 2026 The MOQtail Authors
887
881
  *
@@ -935,8 +929,7 @@ let StreamResetCode = /* @__PURE__ */ function(StreamResetCode) {
935
929
  }
936
930
  _StreamResetCode.tryFrom = tryFrom;
937
931
  })(StreamResetCode || (StreamResetCode = {}));
938
- //#endregion
939
- //#region src/model/data/constant.ts
932
+ // src/model/data/constant.ts
940
933
  /**
941
934
  * Copyright 2025 The MOQtail Authors
942
935
  *
@@ -1240,8 +1233,268 @@ let ObjectStatus = /* @__PURE__ */ function(ObjectStatus) {
1240
1233
  }
1241
1234
  _ObjectStatus.tryFrom = tryFrom;
1242
1235
  })(ObjectStatus || (ObjectStatus = {}));
1243
- //#endregion
1244
- //#region src/model/data/datagram.ts
1236
+ // src/model/common/grease.ts
1237
+ /**
1238
+ * Copyright 2026 The MOQtail Authors
1239
+ *
1240
+ * Licensed under the Apache License, Version 2.0 (the "License");
1241
+ * you may not use this file except in compliance with the License.
1242
+ * You may obtain a copy of the License at
1243
+ *
1244
+ * http://www.apache.org/licenses/LICENSE-2.0
1245
+ *
1246
+ * Unless required by applicable law or agreed to in writing, software
1247
+ * distributed under the License is distributed on an "AS IS" BASIS,
1248
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1249
+ * See the License for the specific language governing permissions and
1250
+ * limitations under the License.
1251
+ */
1252
+ /**
1253
+ * GREASE reservations (§14). Values matching `0x7f * N + 0x9D` are reserved across
1254
+ * several registries (Setup Options, Properties, error codes) so peers can emit them
1255
+ * to exercise unknown-value handling. Receivers treat them like any other unknown
1256
+ * value: ignore, never fatal.
1257
+ */
1258
+ /** Step between successive GREASE values. */
1259
+ const GREASE_STEP = 127n;
1260
+ /** The smallest GREASE value (N = 0). */
1261
+ const GREASE_BASE = 157n;
1262
+ /** The largest GREASE value that still fits a varint, i.e. `0x3fffffffffffffde`. */
1263
+ const GREASE_MAX = 4611686018427387870n;
1264
+ /**
1265
+ * @public
1266
+ * True if `value` is a reserved GREASE value, i.e. `0x7f * N + 0x9D` for some
1267
+ * non-negative `N`.
1268
+ */
1269
+ function isGrease(value) {
1270
+ const v = BigInt(value);
1271
+ return v >= 157n && (v - 157n) % 127n === 0n;
1272
+ }
1273
+ /**
1274
+ * @public
1275
+ * The `N`-th GREASE value, `0x7f * N + 0x9D`, or undefined if it would exceed what a
1276
+ * varint can carry (the pattern is capped at `0x3fffffffffffffde`).
1277
+ */
1278
+ function greaseValue(n) {
1279
+ const value = GREASE_STEP * BigInt(n) + GREASE_BASE;
1280
+ return value > GREASE_MAX ? void 0 : value;
1281
+ }
1282
+ // src/model/property/constant.ts
1283
+ /**
1284
+ * Copyright 2025 The MOQtail Authors
1285
+ *
1286
+ * Licensed under the Apache License, Version 2.0 (the "License");
1287
+ * you may not use this file except in compliance with the License.
1288
+ * You may obtain a copy of the License at
1289
+ *
1290
+ * http://www.apache.org/licenses/LICENSE-2.0
1291
+ *
1292
+ * Unless required by applicable law or agreed to in writing, software
1293
+ * distributed under the License is distributed on an "AS IS" BASIS,
1294
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1295
+ * See the License for the specific language governing permissions and
1296
+ * limitations under the License.
1297
+ */
1298
+ let LOCPropertyId = /* @__PURE__ */ function(LOCPropertyId) {
1299
+ LOCPropertyId[LOCPropertyId["Timescale"] = 8] = "Timescale";
1300
+ LOCPropertyId[LOCPropertyId["VideoFrameMarking"] = 9] = "VideoFrameMarking";
1301
+ LOCPropertyId[LOCPropertyId["AudioLevel"] = 12] = "AudioLevel";
1302
+ LOCPropertyId[LOCPropertyId["VideoConfig"] = 13] = "VideoConfig";
1303
+ LOCPropertyId[LOCPropertyId["AudioConfig"] = 15] = "AudioConfig";
1304
+ LOCPropertyId[LOCPropertyId["Timestamp"] = 16] = "Timestamp";
1305
+ return LOCPropertyId;
1306
+ }({});
1307
+ let TrackPropertyType = /* @__PURE__ */ function(TrackPropertyType) {
1308
+ TrackPropertyType[TrackPropertyType["ObjectDeliveryTimeout"] = 2] = "ObjectDeliveryTimeout";
1309
+ TrackPropertyType[TrackPropertyType["MaxCacheDuration"] = 4] = "MaxCacheDuration";
1310
+ TrackPropertyType[TrackPropertyType["SubgroupDeliveryTimeout"] = 6] = "SubgroupDeliveryTimeout";
1311
+ TrackPropertyType[TrackPropertyType["ImmutableProperties"] = 11] = "ImmutableProperties";
1312
+ TrackPropertyType[TrackPropertyType["DefaultPublisherPriority"] = 14] = "DefaultPublisherPriority";
1313
+ TrackPropertyType[TrackPropertyType["DefaultPublisherGroupOrder"] = 34] = "DefaultPublisherGroupOrder";
1314
+ TrackPropertyType[TrackPropertyType["DynamicGroups"] = 48] = "DynamicGroups";
1315
+ TrackPropertyType[TrackPropertyType["PriorGroupIdGap"] = 60] = "PriorGroupIdGap";
1316
+ TrackPropertyType[TrackPropertyType["PriorObjectIdGap"] = 62] = "PriorObjectIdGap";
1317
+ return TrackPropertyType;
1318
+ }({});
1319
+ function locPropertyIdFromNumber(value) {
1320
+ switch (value) {
1321
+ case 8: return 8;
1322
+ case 9: return 9;
1323
+ case 12: return 12;
1324
+ case 13: return 13;
1325
+ case 15: return 15;
1326
+ case 16: return 16;
1327
+ default: throw new InvalidTypeError("locPropertyIdFromNumber", `Invalid LOC property id: ${value}`);
1328
+ }
1329
+ }
1330
+ /**
1331
+ * @public
1332
+ * Registration-policy ranges for the Property Type space.
1333
+ *
1334
+ */
1335
+ const PropertyRanges = {
1336
+ /** Standards Action or IESG Approval (1-byte encoding). */
1337
+ StandardsAction: {
1338
+ from: 0n,
1339
+ to: 119n
1340
+ },
1341
+ /** Application-specific use, no registration permitted (1-byte encoding). */
1342
+ AppSpecific1Byte: {
1343
+ from: 120n,
1344
+ to: 127n
1345
+ },
1346
+ /** Specification Required (2-byte encoding). */
1347
+ SpecRequired: {
1348
+ from: 128n,
1349
+ to: 14335n
1350
+ },
1351
+ /** Application-specific use, no registration permitted (2-byte encoding). */
1352
+ AppSpecific2Byte: {
1353
+ from: 14336n,
1354
+ to: 16383n
1355
+ },
1356
+ /** Mandatory Track Properties; Track scope only. */
1357
+ MandatoryTrack: {
1358
+ from: 16384n,
1359
+ to: 32767n
1360
+ },
1361
+ /** First Come First Served begins here (open-ended). */
1362
+ Fcfs: { from: 32768n }
1363
+ };
1364
+ function inRange(range, typeValue) {
1365
+ return typeValue >= range.from && (range.to === void 0 || typeValue <= range.to);
1366
+ }
1367
+ /**
1368
+ * @public
1369
+ * True if a Property Type is reserved for application-specific use (either encoding-width
1370
+ * range), for which no IANA registration is permitted.
1371
+ */
1372
+ function isApplicationSpecificProperty(typeValue) {
1373
+ const v = BigInt(typeValue);
1374
+ return inRange(PropertyRanges.AppSpecific1Byte, v) || inRange(PropertyRanges.AppSpecific2Byte, v);
1375
+ }
1376
+ // src/model/property/object_property.ts
1377
+ /**
1378
+ * Copyright 2026 The MOQtail Authors
1379
+ *
1380
+ * Licensed under the Apache License, Version 2.0 (the "License");
1381
+ * you may not use this file except in compliance with the License.
1382
+ * You may obtain a copy of the License at
1383
+ *
1384
+ * http://www.apache.org/licenses/LICENSE-2.0
1385
+ *
1386
+ * Unless required by applicable law or agreed to in writing, software
1387
+ * distributed under the License is distributed on an "AS IS" BASIS,
1388
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1389
+ * See the License for the specific language governing permissions and
1390
+ * limitations under the License.
1391
+ */
1392
+ var ImmutablePropertiesObjectProperty = class ImmutablePropertiesObjectProperty {
1393
+ properties;
1394
+ static TYPE = 11;
1395
+ constructor(properties) {
1396
+ this.properties = properties;
1397
+ }
1398
+ toKeyValuePair() {
1399
+ return KeyValuePair.tryNewBytes(ImmutablePropertiesObjectProperty.TYPE, serializeKvpList(this.properties).toUint8Array());
1400
+ }
1401
+ static fromKeyValuePair(pair) {
1402
+ if (Number(pair.typeValue) !== ImmutablePropertiesObjectProperty.TYPE || !(pair.value instanceof Uint8Array)) return void 0;
1403
+ const properties = deserializeKvpListUntilEmpty(new FrozenByteBuffer(pair.value));
1404
+ properties.forEach(rejectMandatoryTrackProperty);
1405
+ if (properties.some((inner) => Number(inner.typeValue) === 11)) throw new ProtocolViolationError("ImmutablePropertiesObjectProperty.fromKeyValuePair", "ImmutableProperties must not contain nested ImmutableProperties (0x0B)");
1406
+ return new ImmutablePropertiesObjectProperty(properties);
1407
+ }
1408
+ };
1409
+ function rejectMandatoryTrackProperty(pair) {
1410
+ const { from, to } = PropertyRanges.MandatoryTrack;
1411
+ if (pair.typeValue >= from && pair.typeValue <= to && !isGrease(pair.typeValue)) throw new ProtocolViolationError("ObjectProperty.fromKeyValuePair", `Mandatory Track Property 0x${pair.typeValue.toString(16)} is not allowed on an Object`);
1412
+ }
1413
+ var PriorGroupIdGapProperty = class PriorGroupIdGapProperty {
1414
+ gap;
1415
+ static TYPE = 60;
1416
+ constructor(gap) {
1417
+ this.gap = gap;
1418
+ }
1419
+ toKeyValuePair() {
1420
+ return KeyValuePair.tryNewVarInt(PriorGroupIdGapProperty.TYPE, this.gap);
1421
+ }
1422
+ static fromKeyValuePair(pair) {
1423
+ if (Number(pair.typeValue) !== PriorGroupIdGapProperty.TYPE || typeof pair.value !== "bigint") return void 0;
1424
+ return new PriorGroupIdGapProperty(pair.value);
1425
+ }
1426
+ };
1427
+ var PriorObjectIdGapProperty = class PriorObjectIdGapProperty {
1428
+ gap;
1429
+ static TYPE = 62;
1430
+ constructor(gap) {
1431
+ this.gap = gap;
1432
+ }
1433
+ toKeyValuePair() {
1434
+ return KeyValuePair.tryNewVarInt(PriorObjectIdGapProperty.TYPE, this.gap);
1435
+ }
1436
+ static fromKeyValuePair(pair) {
1437
+ if (Number(pair.typeValue) !== PriorObjectIdGapProperty.TYPE || typeof pair.value !== "bigint") return void 0;
1438
+ return new PriorObjectIdGapProperty(pair.value);
1439
+ }
1440
+ };
1441
+ var UnknownObjectProperty = class {
1442
+ kvp;
1443
+ constructor(kvp) {
1444
+ this.kvp = kvp;
1445
+ }
1446
+ toKeyValuePair() {
1447
+ return this.kvp;
1448
+ }
1449
+ };
1450
+ let ObjectProperty;
1451
+ (function(_ObjectProperty) {
1452
+ function fromKeyValuePair(pair) {
1453
+ rejectMandatoryTrackProperty(pair);
1454
+ return ImmutablePropertiesObjectProperty.fromKeyValuePair(pair) ?? PriorGroupIdGapProperty.fromKeyValuePair(pair) ?? PriorObjectIdGapProperty.fromKeyValuePair(pair) ?? new UnknownObjectProperty(pair);
1455
+ }
1456
+ _ObjectProperty.fromKeyValuePair = fromKeyValuePair;
1457
+ function deserializeRaw(buf) {
1458
+ try {
1459
+ const pairs = deserializeKvpListUntilEmpty(buf);
1460
+ pairs.forEach(fromKeyValuePair);
1461
+ return pairs;
1462
+ } catch (e) {
1463
+ if (e instanceof NotEnoughBytesError) throw new ProtocolViolationError("ObjectProperty.deserializeRaw", e.message);
1464
+ throw e;
1465
+ }
1466
+ }
1467
+ _ObjectProperty.deserializeRaw = deserializeRaw;
1468
+ function toKeyValuePair(ext) {
1469
+ return ext.toKeyValuePair();
1470
+ }
1471
+ _ObjectProperty.toKeyValuePair = toKeyValuePair;
1472
+ function deserializeAll(buf) {
1473
+ return deserializeKvpListUntilEmpty(buf).map(fromKeyValuePair);
1474
+ }
1475
+ _ObjectProperty.deserializeAll = deserializeAll;
1476
+ function serializeInto(exts, payload) {
1477
+ payload.putBytes(serializeKvpList(exts.map((ext) => ext.toKeyValuePair())).toUint8Array());
1478
+ }
1479
+ _ObjectProperty.serializeInto = serializeInto;
1480
+ function isImmutableProperties(ext) {
1481
+ return ext instanceof ImmutablePropertiesObjectProperty;
1482
+ }
1483
+ _ObjectProperty.isImmutableProperties = isImmutableProperties;
1484
+ function isPriorGroupIdGap(ext) {
1485
+ return ext instanceof PriorGroupIdGapProperty;
1486
+ }
1487
+ _ObjectProperty.isPriorGroupIdGap = isPriorGroupIdGap;
1488
+ function isPriorObjectIdGap(ext) {
1489
+ return ext instanceof PriorObjectIdGapProperty;
1490
+ }
1491
+ _ObjectProperty.isPriorObjectIdGap = isPriorObjectIdGap;
1492
+ function isUnknown(ext) {
1493
+ return ext instanceof UnknownObjectProperty;
1494
+ }
1495
+ _ObjectProperty.isUnknown = isUnknown;
1496
+ })(ObjectProperty || (ObjectProperty = {}));
1497
+ // src/model/data/datagram.ts
1245
1498
  /**
1246
1499
  * Copyright 2026 The MOQtail Authors
1247
1500
  *
@@ -1341,7 +1594,10 @@ var Datagram = class Datagram {
1341
1594
  if (ObjectDatagramType.hasDefaultPriority(msgType)) publisherPriority = null;
1342
1595
  else publisherPriority = buf.getU8();
1343
1596
  let properties = null;
1344
- if (ObjectDatagramType.hasProperties(msgType)) properties = deserializeKvpListUntilEmpty(new FrozenByteBuffer(buf.getLengthPrefixedBytes()));
1597
+ if (ObjectDatagramType.hasProperties(msgType)) {
1598
+ const headerBytes = new FrozenByteBuffer(buf.getLengthPrefixedBytes());
1599
+ properties = ObjectProperty.deserializeRaw(headerBytes);
1600
+ }
1345
1601
  let payload = null;
1346
1602
  let objectStatus = null;
1347
1603
  if (ObjectDatagramType.isStatus(msgType)) objectStatus = ObjectStatus.tryFrom(buf.getVI());
@@ -1350,8 +1606,7 @@ var Datagram = class Datagram {
1350
1606
  return new Datagram(msgType, trackAlias, new Location(groupId, objectId), publisherPriority, properties, payload, objectStatus, endOfGroup);
1351
1607
  }
1352
1608
  };
1353
- //#endregion
1354
- //#region src/model/data/fetch_header.ts
1609
+ // src/model/data/fetch_header.ts
1355
1610
  /**
1356
1611
  * Copyright 2025 The MOQtail Authors
1357
1612
  *
@@ -1387,8 +1642,7 @@ var FetchHeader = class FetchHeader {
1387
1642
  return new FetchHeader(type, requestId);
1388
1643
  }
1389
1644
  };
1390
- //#endregion
1391
- //#region src/model/control/constant.ts
1645
+ // src/model/control/constant.ts
1392
1646
  /**
1393
1647
  * Copyright 2025 The MOQtail Authors
1394
1648
  *
@@ -1683,8 +1937,7 @@ let RequestErrorCode = /* @__PURE__ */ function(RequestErrorCode) {
1683
1937
  }
1684
1938
  _RequestErrorCode.fromWire = fromWire;
1685
1939
  })(RequestErrorCode || (RequestErrorCode = {}));
1686
- //#endregion
1687
- //#region src/model/data/fetch_object.ts
1940
+ // src/model/data/fetch_object.ts
1688
1941
  /**
1689
1942
  * Copyright 2025 The MOQtail Authors
1690
1943
  *
@@ -1909,7 +2162,8 @@ var FetchObject = class FetchObject {
1909
2162
  let properties = null;
1910
2163
  if (hasProperties) {
1911
2164
  const extLen = buf.getNumberVI();
1912
- properties = deserializeKvpListUntilEmpty(new FrozenByteBuffer(buf.getBytes(extLen)));
2165
+ const headerBytes = new FrozenByteBuffer(buf.getBytes(extLen));
2166
+ properties = ObjectProperty.deserializeRaw(headerBytes);
1913
2167
  }
1914
2168
  const payloadLen = buf.getNumberVI();
1915
2169
  const payload = buf.getBytes(payloadLen);
@@ -1918,8 +2172,7 @@ var FetchObject = class FetchObject {
1918
2172
  return FetchObject.newObject(groupId, resolvedSubgroupId, objectId, publisherPriority, forwardingPreference, properties, payload);
1919
2173
  }
1920
2174
  };
1921
- //#endregion
1922
- //#region src/model/data/full_track_name.ts
2175
+ // src/model/data/full_track_name.ts
1923
2176
  /**
1924
2177
  * Copyright 2025 The MOQtail Authors
1925
2178
  *
@@ -2020,103 +2273,7 @@ var FullTrackName = class FullTrackName {
2020
2273
  return new FullTrackName(namespace, name);
2021
2274
  }
2022
2275
  };
2023
- //#endregion
2024
- //#region src/model/property/constant.ts
2025
- /**
2026
- * Copyright 2025 The MOQtail Authors
2027
- *
2028
- * Licensed under the Apache License, Version 2.0 (the "License");
2029
- * you may not use this file except in compliance with the License.
2030
- * You may obtain a copy of the License at
2031
- *
2032
- * http://www.apache.org/licenses/LICENSE-2.0
2033
- *
2034
- * Unless required by applicable law or agreed to in writing, software
2035
- * distributed under the License is distributed on an "AS IS" BASIS,
2036
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2037
- * See the License for the specific language governing permissions and
2038
- * limitations under the License.
2039
- */
2040
- let LOCPropertyId = /* @__PURE__ */ function(LOCPropertyId) {
2041
- LOCPropertyId[LOCPropertyId["Timescale"] = 8] = "Timescale";
2042
- LOCPropertyId[LOCPropertyId["VideoFrameMarking"] = 9] = "VideoFrameMarking";
2043
- LOCPropertyId[LOCPropertyId["AudioLevel"] = 12] = "AudioLevel";
2044
- LOCPropertyId[LOCPropertyId["VideoConfig"] = 13] = "VideoConfig";
2045
- LOCPropertyId[LOCPropertyId["AudioConfig"] = 15] = "AudioConfig";
2046
- LOCPropertyId[LOCPropertyId["Timestamp"] = 16] = "Timestamp";
2047
- return LOCPropertyId;
2048
- }({});
2049
- let TrackPropertyType = /* @__PURE__ */ function(TrackPropertyType) {
2050
- TrackPropertyType[TrackPropertyType["ObjectDeliveryTimeout"] = 2] = "ObjectDeliveryTimeout";
2051
- TrackPropertyType[TrackPropertyType["MaxCacheDuration"] = 4] = "MaxCacheDuration";
2052
- TrackPropertyType[TrackPropertyType["SubgroupDeliveryTimeout"] = 6] = "SubgroupDeliveryTimeout";
2053
- TrackPropertyType[TrackPropertyType["ImmutableProperties"] = 11] = "ImmutableProperties";
2054
- TrackPropertyType[TrackPropertyType["DefaultPublisherPriority"] = 14] = "DefaultPublisherPriority";
2055
- TrackPropertyType[TrackPropertyType["DefaultPublisherGroupOrder"] = 34] = "DefaultPublisherGroupOrder";
2056
- TrackPropertyType[TrackPropertyType["DynamicGroups"] = 48] = "DynamicGroups";
2057
- TrackPropertyType[TrackPropertyType["PriorGroupIdGap"] = 60] = "PriorGroupIdGap";
2058
- TrackPropertyType[TrackPropertyType["PriorObjectIdGap"] = 62] = "PriorObjectIdGap";
2059
- return TrackPropertyType;
2060
- }({});
2061
- function locPropertyIdFromNumber(value) {
2062
- switch (value) {
2063
- case 8: return 8;
2064
- case 9: return 9;
2065
- case 12: return 12;
2066
- case 13: return 13;
2067
- case 15: return 15;
2068
- case 16: return 16;
2069
- default: throw new InvalidTypeError("locPropertyIdFromNumber", `Invalid LOC property id: ${value}`);
2070
- }
2071
- }
2072
- /**
2073
- * @public
2074
- * Registration-policy ranges for the Property Type space.
2075
- *
2076
- */
2077
- const PropertyRanges = {
2078
- /** Standards Action or IESG Approval (1-byte encoding). */
2079
- StandardsAction: {
2080
- from: 0n,
2081
- to: 119n
2082
- },
2083
- /** Application-specific use, no registration permitted (1-byte encoding). */
2084
- AppSpecific1Byte: {
2085
- from: 120n,
2086
- to: 127n
2087
- },
2088
- /** Specification Required (2-byte encoding). */
2089
- SpecRequired: {
2090
- from: 128n,
2091
- to: 14335n
2092
- },
2093
- /** Application-specific use, no registration permitted (2-byte encoding). */
2094
- AppSpecific2Byte: {
2095
- from: 14336n,
2096
- to: 16383n
2097
- },
2098
- /** Mandatory Track Properties; Track scope only. */
2099
- MandatoryTrack: {
2100
- from: 16384n,
2101
- to: 32767n
2102
- },
2103
- /** First Come First Served begins here (open-ended). */
2104
- Fcfs: { from: 32768n }
2105
- };
2106
- function inRange(range, typeValue) {
2107
- return typeValue >= range.from && (range.to === void 0 || typeValue <= range.to);
2108
- }
2109
- /**
2110
- * @public
2111
- * True if a Property Type is reserved for application-specific use (either encoding-width
2112
- * range), for which no IANA registration is permitted.
2113
- */
2114
- function isApplicationSpecificProperty(typeValue) {
2115
- const v = BigInt(typeValue);
2116
- return inRange(PropertyRanges.AppSpecific1Byte, v) || inRange(PropertyRanges.AppSpecific2Byte, v);
2117
- }
2118
- //#endregion
2119
- //#region src/model/property/timestamp.ts
2276
+ // src/model/property/timestamp.ts
2120
2277
  /**
2121
2278
  * Copyright 2025 The MOQtail Authors
2122
2279
  *
@@ -2145,8 +2302,7 @@ var Timestamp = class Timestamp {
2145
2302
  if (Number(pair.typeValue) === Timestamp.TYPE && typeof pair.value === "bigint") return new Timestamp(pair.value);
2146
2303
  }
2147
2304
  };
2148
- //#endregion
2149
- //#region src/model/property/timescale.ts
2305
+ // src/model/property/timescale.ts
2150
2306
  /**
2151
2307
  * Copyright 2026 The MOQtail Authors
2152
2308
  *
@@ -2175,8 +2331,7 @@ var Timescale = class Timescale {
2175
2331
  if (Number(pair.typeValue) === Timescale.TYPE && typeof pair.value === "bigint") return new Timescale(pair.value);
2176
2332
  }
2177
2333
  };
2178
- //#endregion
2179
- //#region src/model/property/video_frame_marking.ts
2334
+ // src/model/property/video_frame_marking.ts
2180
2335
  /**
2181
2336
  * Copyright 2025 The MOQtail Authors
2182
2337
  *
@@ -2212,8 +2367,7 @@ var VideoFrameMarking = class VideoFrameMarking {
2212
2367
  if (Number(pair.typeValue) === VideoFrameMarking.TYPE && pair.value instanceof Uint8Array) return new VideoFrameMarking(pair.value);
2213
2368
  }
2214
2369
  };
2215
- //#endregion
2216
- //#region src/model/property/audio_level.ts
2370
+ // src/model/property/audio_level.ts
2217
2371
  /**
2218
2372
  * Copyright 2025 The MOQtail Authors
2219
2373
  *
@@ -2242,8 +2396,7 @@ var AudioLevel = class AudioLevel {
2242
2396
  if (Number(pair.typeValue) === AudioLevel.TYPE && typeof pair.value === "bigint") return new AudioLevel(pair.value);
2243
2397
  }
2244
2398
  };
2245
- //#endregion
2246
- //#region src/model/property/video_config.ts
2399
+ // src/model/property/video_config.ts
2247
2400
  /**
2248
2401
  * Copyright 2025 The MOQtail Authors
2249
2402
  *
@@ -2272,8 +2425,7 @@ var VideoConfig = class VideoConfig {
2272
2425
  if (Number(pair.typeValue) === VideoConfig.TYPE && pair.value instanceof Uint8Array) return new VideoConfig(pair.value);
2273
2426
  }
2274
2427
  };
2275
- //#endregion
2276
- //#region src/model/property/audio_config.ts
2428
+ // src/model/property/audio_config.ts
2277
2429
  /**
2278
2430
  * Copyright 2026 The MOQtail Authors
2279
2431
  *
@@ -2302,8 +2454,7 @@ var AudioConfig = class AudioConfig {
2302
2454
  if (Number(pair.typeValue) === AudioConfig.TYPE && pair.value instanceof Uint8Array) return new AudioConfig(pair.value);
2303
2455
  }
2304
2456
  };
2305
- //#endregion
2306
- //#region src/model/property/loc.ts
2457
+ // src/model/property/loc.ts
2307
2458
  let LOCProperty;
2308
2459
  (function(_LOCProperty) {
2309
2460
  function fromKeyValuePair(pair) {
@@ -2382,55 +2533,7 @@ var LOCProperties = class {
2382
2533
  return result;
2383
2534
  }
2384
2535
  };
2385
- //#endregion
2386
- //#region src/model/common/grease.ts
2387
- /**
2388
- * Copyright 2026 The MOQtail Authors
2389
- *
2390
- * Licensed under the Apache License, Version 2.0 (the "License");
2391
- * you may not use this file except in compliance with the License.
2392
- * You may obtain a copy of the License at
2393
- *
2394
- * http://www.apache.org/licenses/LICENSE-2.0
2395
- *
2396
- * Unless required by applicable law or agreed to in writing, software
2397
- * distributed under the License is distributed on an "AS IS" BASIS,
2398
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2399
- * See the License for the specific language governing permissions and
2400
- * limitations under the License.
2401
- */
2402
- /**
2403
- * GREASE reservations (§14). Values matching `0x7f * N + 0x9D` are reserved across
2404
- * several registries (Setup Options, Properties, error codes) so peers can emit them
2405
- * to exercise unknown-value handling. Receivers treat them like any other unknown
2406
- * value: ignore, never fatal.
2407
- */
2408
- /** Step between successive GREASE values. */
2409
- const GREASE_STEP = 127n;
2410
- /** The smallest GREASE value (N = 0). */
2411
- const GREASE_BASE = 157n;
2412
- /** The largest GREASE value that still fits a varint, i.e. `0x3fffffffffffffde`. */
2413
- const GREASE_MAX = 4611686018427387870n;
2414
- /**
2415
- * @public
2416
- * True if `value` is a reserved GREASE value, i.e. `0x7f * N + 0x9D` for some
2417
- * non-negative `N`.
2418
- */
2419
- function isGrease(value) {
2420
- const v = BigInt(value);
2421
- return v >= 157n && (v - 157n) % 127n === 0n;
2422
- }
2423
- /**
2424
- * @public
2425
- * The `N`-th GREASE value, `0x7f * N + 0x9D`, or undefined if it would exceed what a
2426
- * varint can carry (the pattern is capped at `0x3fffffffffffffde`).
2427
- */
2428
- function greaseValue(n) {
2429
- const value = GREASE_STEP * BigInt(n) + GREASE_BASE;
2430
- return value > GREASE_MAX ? void 0 : value;
2431
- }
2432
- //#endregion
2433
- //#region src/model/property/track_property.ts
2536
+ // src/model/property/track_property.ts
2434
2537
  /**
2435
2538
  * Copyright 2026 The MOQtail Authors
2436
2539
  *
@@ -2610,8 +2713,7 @@ let TrackProperty;
2610
2713
  }
2611
2714
  _TrackProperty.isUnknown = isUnknown;
2612
2715
  })(TrackProperty || (TrackProperty = {}));
2613
- //#endregion
2614
- //#region src/model/property/object_property.ts
2716
+ // src/model/property/find.ts
2615
2717
  /**
2616
2718
  * Copyright 2026 The MOQtail Authors
2617
2719
  *
@@ -2627,96 +2729,25 @@ let TrackProperty;
2627
2729
  * See the License for the specific language governing permissions and
2628
2730
  * limitations under the License.
2629
2731
  */
2630
- var ImmutablePropertiesObjectProperty = class ImmutablePropertiesObjectProperty {
2631
- properties;
2632
- static TYPE = 11;
2633
- constructor(properties) {
2634
- this.properties = properties;
2635
- }
2636
- toKeyValuePair() {
2637
- return KeyValuePair.tryNewBytes(ImmutablePropertiesObjectProperty.TYPE, serializeKvpList(this.properties).toUint8Array());
2638
- }
2639
- static fromKeyValuePair(pair) {
2640
- if (Number(pair.typeValue) !== ImmutablePropertiesObjectProperty.TYPE || !(pair.value instanceof Uint8Array)) return void 0;
2641
- const properties = deserializeKvpListUntilEmpty(new FrozenByteBuffer(pair.value));
2642
- if (properties.some((inner) => Number(inner.typeValue) === 11)) throw new ProtocolViolationError("ImmutablePropertiesObjectProperty.fromKeyValuePair", "ImmutableProperties must not contain nested ImmutableProperties (0x0B)");
2643
- return new ImmutablePropertiesObjectProperty(properties);
2644
- }
2645
- };
2646
- var PriorGroupIdGapProperty = class PriorGroupIdGapProperty {
2647
- gap;
2648
- static TYPE = 60;
2649
- constructor(gap) {
2650
- this.gap = gap;
2651
- }
2652
- toKeyValuePair() {
2653
- return KeyValuePair.tryNewVarInt(PriorGroupIdGapProperty.TYPE, this.gap);
2654
- }
2655
- static fromKeyValuePair(pair) {
2656
- if (Number(pair.typeValue) !== PriorGroupIdGapProperty.TYPE || typeof pair.value !== "bigint") return void 0;
2657
- return new PriorGroupIdGapProperty(pair.value);
2658
- }
2659
- };
2660
- var PriorObjectIdGapProperty = class PriorObjectIdGapProperty {
2661
- gap;
2662
- static TYPE = 62;
2663
- constructor(gap) {
2664
- this.gap = gap;
2665
- }
2666
- toKeyValuePair() {
2667
- return KeyValuePair.tryNewVarInt(PriorObjectIdGapProperty.TYPE, this.gap);
2668
- }
2669
- static fromKeyValuePair(pair) {
2670
- if (Number(pair.typeValue) !== PriorObjectIdGapProperty.TYPE || typeof pair.value !== "bigint") return void 0;
2671
- return new PriorObjectIdGapProperty(pair.value);
2672
- }
2673
- };
2674
- var UnknownObjectProperty = class {
2675
- kvp;
2676
- constructor(kvp) {
2677
- this.kvp = kvp;
2678
- }
2679
- toKeyValuePair() {
2680
- return this.kvp;
2681
- }
2682
- };
2683
- let ObjectProperty;
2684
- (function(_ObjectProperty) {
2685
- function fromKeyValuePair(pair) {
2686
- return ImmutablePropertiesObjectProperty.fromKeyValuePair(pair) ?? PriorGroupIdGapProperty.fromKeyValuePair(pair) ?? PriorObjectIdGapProperty.fromKeyValuePair(pair) ?? new UnknownObjectProperty(pair);
2687
- }
2688
- _ObjectProperty.fromKeyValuePair = fromKeyValuePair;
2689
- function toKeyValuePair(ext) {
2690
- return ext.toKeyValuePair();
2691
- }
2692
- _ObjectProperty.toKeyValuePair = toKeyValuePair;
2693
- function deserializeAll(buf) {
2694
- return deserializeKvpListUntilEmpty(buf).map(fromKeyValuePair);
2695
- }
2696
- _ObjectProperty.deserializeAll = deserializeAll;
2697
- function serializeInto(exts, payload) {
2698
- payload.putBytes(serializeKvpList(exts.map((ext) => ext.toKeyValuePair())).toUint8Array());
2699
- }
2700
- _ObjectProperty.serializeInto = serializeInto;
2701
- function isImmutableProperties(ext) {
2702
- return ext instanceof ImmutablePropertiesObjectProperty;
2703
- }
2704
- _ObjectProperty.isImmutableProperties = isImmutableProperties;
2705
- function isPriorGroupIdGap(ext) {
2706
- return ext instanceof PriorGroupIdGapProperty;
2707
- }
2708
- _ObjectProperty.isPriorGroupIdGap = isPriorGroupIdGap;
2709
- function isPriorObjectIdGap(ext) {
2710
- return ext instanceof PriorObjectIdGapProperty;
2711
- }
2712
- _ObjectProperty.isPriorObjectIdGap = isPriorObjectIdGap;
2713
- function isUnknown(ext) {
2714
- return ext instanceof UnknownObjectProperty;
2732
+ /**
2733
+ * @public
2734
+ * Finds the first property of `reader`'s type in a track or object property list and
2735
+ * returns it typed, or `undefined`. Unknown properties keep their raw key-value pair, so
2736
+ * a type the model doesn't know is still found.
2737
+ *
2738
+ * @example
2739
+ * ```ts
2740
+ * const timeout = findProperty(subscribeOk.trackProperties, ObjectDeliveryTimeoutProperty)
2741
+ * ```
2742
+ */
2743
+ function findProperty(properties, reader) {
2744
+ const type = BigInt(reader.TYPE);
2745
+ for (const property of properties ?? []) {
2746
+ const pair = property instanceof KeyValuePair ? property : property.toKeyValuePair();
2747
+ if (pair.typeValue === type) return reader.fromKeyValuePair(pair);
2715
2748
  }
2716
- _ObjectProperty.isUnknown = isUnknown;
2717
- })(ObjectProperty || (ObjectProperty = {}));
2718
- //#endregion
2719
- //#region src/model/data/subgroup_object.ts
2749
+ }
2750
+ // src/model/data/subgroup_object.ts
2720
2751
  /**
2721
2752
  * Copyright 2025 The MOQtail Authors
2722
2753
  *
@@ -2771,7 +2802,8 @@ var SubgroupObject = class SubgroupObject {
2771
2802
  let properties = null;
2772
2803
  if (hasProperties) {
2773
2804
  const extLen = buf.getNumberVI();
2774
- properties = deserializeKvpListUntilEmpty(new FrozenByteBuffer(buf.getBytes(extLen)));
2805
+ const headerBytes = new FrozenByteBuffer(buf.getBytes(extLen));
2806
+ properties = ObjectProperty.deserializeRaw(headerBytes);
2775
2807
  }
2776
2808
  const payloadLen = buf.getNumberVI();
2777
2809
  let objectStatus = null;
@@ -2781,8 +2813,7 @@ var SubgroupObject = class SubgroupObject {
2781
2813
  return new SubgroupObject(objectId, normalizeProperties(properties), objectStatus, payload);
2782
2814
  }
2783
2815
  };
2784
- //#endregion
2785
- //#region src/model/data/object.ts
2816
+ // src/model/data/object.ts
2786
2817
  var MoqtObject = class MoqtObject {
2787
2818
  fullTrackName;
2788
2819
  publisherPriority;
@@ -2902,8 +2933,7 @@ var MoqtObject = class MoqtObject {
2902
2933
  else return SubgroupObject.newWithStatus(this.location.object, this.properties, this.objectStatus);
2903
2934
  }
2904
2935
  };
2905
- //#endregion
2906
- //#region src/model/data/subgroup_header.ts
2936
+ // src/model/data/subgroup_header.ts
2907
2937
  /**
2908
2938
  * Copyright 2025 The MOQtail Authors
2909
2939
  *
@@ -2974,8 +3004,7 @@ var SubgroupHeader = class SubgroupHeader {
2974
3004
  if (this.subgroupId === void 0 && SubgroupHeaderType.isSubgroupIdFirstObjectId(this.type)) this.subgroupId = firstObjectId;
2975
3005
  }
2976
3006
  };
2977
- //#endregion
2978
- //#region src/model/data/request_id.ts
3007
+ // src/model/data/request_id.ts
2979
3008
  /**
2980
3009
  * Copyright 2025 The MOQtail Authors
2981
3010
  *
@@ -3093,8 +3122,7 @@ var RequestIdMap = class {
3093
3122
  return this.nameToRequestId.has(name);
3094
3123
  }
3095
3124
  };
3096
- //#endregion
3097
- //#region src/model/data/header.ts
3125
+ // src/model/data/header.ts
3098
3126
  /**
3099
3127
  * Copyright 2025 The MOQtail Authors
3100
3128
  *
@@ -3142,8 +3170,7 @@ let Header;
3142
3170
  }
3143
3171
  _Header.deserialize = deserialize;
3144
3172
  })(Header || (Header = {}));
3145
- //#endregion
3146
- //#region src/model/common/byte_buffer.ts
3173
+ // src/model/common/byte_buffer.ts
3147
3174
  /**
3148
3175
  * Copyright 2025 The MOQtail Authors
3149
3176
  *
@@ -3386,8 +3413,7 @@ var FrozenByteBuffer = class extends BaseByteBuffer {
3386
3413
  return this.buf.length;
3387
3414
  }
3388
3415
  };
3389
- //#endregion
3390
- //#region src/model/control/publish_skipped.ts
3416
+ // src/model/control/publish_skipped.ts
3391
3417
  /**
3392
3418
  * Copyright 2026 The MOQtail Authors
3393
3419
  *
@@ -3439,8 +3465,7 @@ var PublishSkipped = class PublishSkipped {
3439
3465
  return new PublishSkipped(trackNamespaceSuffix, trackName);
3440
3466
  }
3441
3467
  };
3442
- //#endregion
3443
- //#region src/model/parameter/constant.ts
3468
+ // src/model/parameter/constant.ts
3444
3469
  /**
3445
3470
  * Copyright 2026 The MOQtail Authors
3446
3471
  *
@@ -3564,8 +3589,7 @@ function tokenAliasTypeFromNumber(value) {
3564
3589
  default: throw new InvalidTypeError("tokenAliasTypeFromNumber", `Invalid token alias type: ${value}`);
3565
3590
  }
3566
3591
  }
3567
- //#endregion
3568
- //#region src/model/common/moqt_url.ts
3592
+ // src/model/common/moqt_url.ts
3569
3593
  /**
3570
3594
  * Copyright 2026 The MOQtail Authors
3571
3595
  *
@@ -3581,6 +3605,8 @@ function tokenAliasTypeFromNumber(value) {
3581
3605
  * See the License for the specific language governing permissions and
3582
3606
  * limitations under the License.
3583
3607
  */
3608
+ /** URI schemes are case-insensitive (RFC 3986 §3.1, MSF 11.1). */
3609
+ const MOQT_SCHEME = /^moqt:\/\//i;
3584
3610
  /**
3585
3611
  * @public
3586
3612
  * A parsed `moqt://authority/path[?query][#fragment]` URI.
@@ -3604,7 +3630,7 @@ var MoqtUrl = class MoqtUrl {
3604
3630
  this.fragment = fragment;
3605
3631
  }
3606
3632
  static parse(input) {
3607
- if (!input.startsWith("moqt://")) throw new ProtocolViolationError("MoqtUrl.parse", `URL must use the moqt:// scheme: ${input}`);
3633
+ if (!MOQT_SCHEME.test(input)) throw new ProtocolViolationError("MoqtUrl.parse", `URL must use the moqt:// scheme: ${input}`);
3608
3634
  let rest = input.slice(7);
3609
3635
  let fragment;
3610
3636
  const hashIdx = rest.indexOf("#");
@@ -3660,7 +3686,7 @@ function parseFragment(fragment) {
3660
3686
  */
3661
3687
  function resolveTransportUrl(url) {
3662
3688
  const raw = typeof url === "string" ? url : url.toString();
3663
- if (!raw.startsWith("moqt://")) return {
3689
+ if (!MOQT_SCHEME.test(raw)) return {
3664
3690
  transportUrl: raw,
3665
3691
  moqtUrl: void 0
3666
3692
  };
@@ -3670,8 +3696,7 @@ function resolveTransportUrl(url) {
3670
3696
  moqtUrl
3671
3697
  };
3672
3698
  }
3673
- //#endregion
3674
- //#region src/model/common/redirect.ts
3699
+ // src/model/common/redirect.ts
3675
3700
  /**
3676
3701
  * Copyright 2026 The MOQtail Authors
3677
3702
  *
@@ -3722,8 +3747,7 @@ var Redirect = class Redirect {
3722
3747
  return new Redirect(connectUri, trackNamespace, trackName);
3723
3748
  }
3724
3749
  };
3725
- //#endregion
3726
- //#region src/model/parameter/common/authorization_token.ts
3750
+ // src/model/parameter/common/authorization_token.ts
3727
3751
  /**
3728
3752
  * Copyright 2026 The MOQtail Authors
3729
3753
  *
@@ -3790,7 +3814,6 @@ var AuthorizationToken = class AuthorizationToken {
3790
3814
  case 3:
3791
3815
  payload.putVI(this.variant.tokenType);
3792
3816
  payload.putBytes(this.variant.tokenValue);
3793
- break;
3794
3817
  }
3795
3818
  return KeyValuePair.tryNewBytes(AuthorizationToken.TYPE, payload.toUint8Array());
3796
3819
  }
@@ -3836,8 +3859,7 @@ var AuthorizationToken = class AuthorizationToken {
3836
3859
  }
3837
3860
  }
3838
3861
  };
3839
- //#endregion
3840
- //#region src/model/parameter/message/fill_timeout.ts
3862
+ // src/model/parameter/message/fill_timeout.ts
3841
3863
  /**
3842
3864
  * Copyright 2026 The MOQtail Authors
3843
3865
  *
@@ -3871,8 +3893,7 @@ var FillTimeout = class FillTimeout {
3871
3893
  return new FillTimeout(pair.value);
3872
3894
  }
3873
3895
  };
3874
- //#endregion
3875
- //#region src/model/parameter/message/object_delivery_timeout.ts
3896
+ // src/model/parameter/message/object_delivery_timeout.ts
3876
3897
  /**
3877
3898
  * Copyright 2026 The MOQtail Authors
3878
3899
  *
@@ -3908,8 +3929,7 @@ var ObjectDeliveryTimeout = class ObjectDeliveryTimeout {
3908
3929
  return new ObjectDeliveryTimeout(pair.value);
3909
3930
  }
3910
3931
  };
3911
- //#endregion
3912
- //#region src/model/parameter/message/rendezvous_timeout.ts
3932
+ // src/model/parameter/message/rendezvous_timeout.ts
3913
3933
  /**
3914
3934
  * Copyright 2026 The MOQtail Authors
3915
3935
  *
@@ -3943,8 +3963,7 @@ var RendezvousTimeout = class RendezvousTimeout {
3943
3963
  return new RendezvousTimeout(pair.value);
3944
3964
  }
3945
3965
  };
3946
- //#endregion
3947
- //#region src/model/parameter/message/subgroup_delivery_timeout.ts
3966
+ // src/model/parameter/message/subgroup_delivery_timeout.ts
3948
3967
  /**
3949
3968
  * Copyright 2026 The MOQtail Authors
3950
3969
  *
@@ -3978,8 +3997,7 @@ var SubgroupDeliveryTimeout = class SubgroupDeliveryTimeout {
3978
3997
  return new SubgroupDeliveryTimeout(pair.value);
3979
3998
  }
3980
3999
  };
3981
- //#endregion
3982
- //#region src/model/parameter/message/expires.ts
4000
+ // src/model/parameter/message/expires.ts
3983
4001
  /**
3984
4002
  * Copyright 2026 The MOQtail Authors
3985
4003
  *
@@ -4014,8 +4032,7 @@ var Expires = class Expires {
4014
4032
  return new Expires(pair.value);
4015
4033
  }
4016
4034
  };
4017
- //#endregion
4018
- //#region src/model/parameter/message/forward.ts
4035
+ // src/model/parameter/message/forward.ts
4019
4036
  /**
4020
4037
  * Copyright 2026 The MOQtail Authors
4021
4038
  *
@@ -4052,8 +4069,7 @@ var Forward = class Forward {
4052
4069
  return new Forward(pair.value === 1n);
4053
4070
  }
4054
4071
  };
4055
- //#endregion
4056
- //#region src/model/parameter/message/include_properties.ts
4072
+ // src/model/parameter/message/include_properties.ts
4057
4073
  /**
4058
4074
  * Copyright 2026 The MOQtail Authors
4059
4075
  *
@@ -4091,8 +4107,7 @@ var IncludeProperties = class IncludeProperties {
4091
4107
  return new IncludeProperties(pair.value === 1n);
4092
4108
  }
4093
4109
  };
4094
- //#endregion
4095
- //#region src/model/parameter/message/group_order_param.ts
4110
+ // src/model/parameter/message/group_order_param.ts
4096
4111
  /**
4097
4112
  * Copyright 2026 The MOQtail Authors
4098
4113
  *
@@ -4129,8 +4144,7 @@ var GroupOrderParam = class GroupOrderParam {
4129
4144
  return new GroupOrderParam(Number(pair.value));
4130
4145
  }
4131
4146
  };
4132
- //#endregion
4133
- //#region src/model/parameter/message/largest_object.ts
4147
+ // src/model/parameter/message/largest_object.ts
4134
4148
  /**
4135
4149
  * Copyright 2026 The MOQtail Authors
4136
4150
  *
@@ -4171,8 +4185,7 @@ var LargestObject = class LargestObject {
4171
4185
  return new LargestObject(location);
4172
4186
  }
4173
4187
  };
4174
- //#endregion
4175
- //#region src/model/parameter/message/new_group_request.ts
4188
+ // src/model/parameter/message/new_group_request.ts
4176
4189
  /**
4177
4190
  * Copyright 2026 The MOQtail Authors
4178
4191
  *
@@ -4207,8 +4220,7 @@ var NewGroupRequest = class NewGroupRequest {
4207
4220
  return new NewGroupRequest(pair.value);
4208
4221
  }
4209
4222
  };
4210
- //#endregion
4211
- //#region src/model/parameter/message/switching_set_assignment.ts
4223
+ // src/model/parameter/message/switching_set_assignment.ts
4212
4224
  /**
4213
4225
  * Copyright 2026 The MOQtail Authors
4214
4226
  *
@@ -4275,8 +4287,7 @@ var SwitchingSetAssignment = class SwitchingSetAssignment {
4275
4287
  return new SwitchingSetAssignment(switchingSetId, algorithmId, throughputThresholdKbps, setThroughputWeight, activateSwitching, setRank);
4276
4288
  }
4277
4289
  };
4278
- //#endregion
4279
- //#region src/model/parameter/message/subscriber_priority.ts
4290
+ // src/model/parameter/message/subscriber_priority.ts
4280
4291
  /**
4281
4292
  * Copyright 2026 The MOQtail Authors
4282
4293
  *
@@ -4313,8 +4324,7 @@ var SubscriberPriority = class SubscriberPriority {
4313
4324
  return new SubscriberPriority(Number(pair.value));
4314
4325
  }
4315
4326
  };
4316
- //#endregion
4317
- //#region src/model/parameter/message/location_filter.ts
4327
+ // src/model/parameter/message/location_filter.ts
4318
4328
  /**
4319
4329
  * Copyright 2026 The MOQtail Authors
4320
4330
  *
@@ -4488,8 +4498,7 @@ var LocationFilter = class LocationFilter {
4488
4498
  return filter;
4489
4499
  }
4490
4500
  };
4491
- //#endregion
4492
- //#region src/model/parameter/message/switch_from.ts
4501
+ // src/model/parameter/message/switch_from.ts
4493
4502
  /**
4494
4503
  * Copyright 2026 The MOQtail Authors
4495
4504
  *
@@ -4540,8 +4549,7 @@ var SwitchFrom = class SwitchFrom {
4540
4549
  return new SwitchFrom(requestId, Number(modeValue), (flags & 128) !== 0);
4541
4550
  }
4542
4551
  };
4543
- //#endregion
4544
- //#region src/model/parameter/message/fill_parameters.ts
4552
+ // src/model/parameter/message/fill_parameters.ts
4545
4553
  /**
4546
4554
  * Copyright 2026 The MOQtail Authors
4547
4555
  *
@@ -4599,8 +4607,7 @@ var FillParameters = class FillParameters {
4599
4607
  return new FillParameters(MessageParameters.fromKeyValuePairs(pairs));
4600
4608
  }
4601
4609
  };
4602
- //#endregion
4603
- //#region src/model/parameter/message/range_filter.ts
4610
+ // src/model/parameter/message/range_filter.ts
4604
4611
  /**
4605
4612
  * Copyright 2026 The MOQtail Authors
4606
4613
  *
@@ -4792,8 +4799,7 @@ var RangeFilter = class RangeFilter {
4792
4799
  return new RangeFilter(kind, setId, propertyType, deltas);
4793
4800
  }
4794
4801
  };
4795
- //#endregion
4796
- //#region src/model/parameter/message_parameter.ts
4802
+ // src/model/parameter/message_parameter.ts
4797
4803
  /**
4798
4804
  * Copyright 2026 The MOQtail Authors
4799
4805
  *
@@ -4984,14 +4990,14 @@ function valueShapeOf(typeValue) {
4984
4990
  case BigInt(53): return 1;
4985
4991
  case BigInt(9): return 2;
4986
4992
  case BigInt(33): return 3;
4993
+ case BigInt(52): return 4;
4987
4994
  case BigInt(36):
4988
- case BigInt(52):
4989
4995
  case BigInt(37):
4990
4996
  case BigInt(38):
4991
4997
  case BigInt(39):
4992
4998
  case BigInt(40):
4993
- case BigInt(41): return 4;
4994
- default: return typeValue % 2n === 0n ? 0 : 4;
4999
+ case BigInt(41): return 5;
5000
+ default: return typeValue % 2n === 0n ? 0 : 5;
4995
5001
  }
4996
5002
  }
4997
5003
  /**
@@ -5011,14 +5017,13 @@ function serializeMessageParameterKvps(items) {
5011
5017
  break;
5012
5018
  case 2:
5013
5019
  case 3:
5020
+ case 4:
5014
5021
  if (isBytes(kvp)) buf.putBytes(kvp.value);
5015
5022
  break;
5016
- case 4:
5023
+ case 5:
5017
5024
  if (isBytes(kvp)) buf.putLengthPrefixedBytes(kvp.value);
5018
5025
  break;
5019
- case 0:
5020
- if (isVarInt(kvp)) buf.putVI(kvp.value);
5021
- break;
5026
+ case 0: if (isVarInt(kvp)) buf.putVI(kvp.value);
5022
5027
  }
5023
5028
  prevType = kvp.typeValue;
5024
5029
  }
@@ -5053,11 +5058,12 @@ function readMessageParameterKvps(buf, more) {
5053
5058
  items.push(KeyValuePair.newBytes(typeValue, LocationFilter.deserializeValue(buf).serializeValue()));
5054
5059
  break;
5055
5060
  case 4:
5056
- items.push(KeyValuePair.deserializeBytesValue(buf, typeValue));
5061
+ items.push(KeyValuePair.newBytes(typeValue, Tuple.deserialize(buf).serialize().toUint8Array()));
5057
5062
  break;
5058
- case 0:
5059
- items.push(KeyValuePair.tryNewVarInt(typeValue, buf.getVI()));
5063
+ case 5:
5064
+ items.push(KeyValuePair.deserializeBytesValue(buf, typeValue));
5060
5065
  break;
5066
+ case 0: items.push(KeyValuePair.tryNewVarInt(typeValue, buf.getVI()));
5061
5067
  }
5062
5068
  prevType = typeValue;
5063
5069
  }
@@ -5078,8 +5084,7 @@ function applyMessageParameterUpdate(current, updates) {
5078
5084
  const kept = current.filter((p) => !updated.has(typeOf(p)));
5079
5085
  current.splice(0, current.length, ...kept, ...updates.filter((u) => !(u instanceof RangeFilter && u.isRemoval)));
5080
5086
  }
5081
- //#endregion
5082
- //#region src/model/control/publish_namespace.ts
5087
+ // src/model/control/publish_namespace.ts
5083
5088
  /**
5084
5089
  * Copyright 2025 The MOQtail Authors
5085
5090
  *
@@ -5163,8 +5168,7 @@ var PublishNamespace = class PublishNamespace {
5163
5168
  return new PublishNamespace(requestId, trackNamespace, parameters);
5164
5169
  }
5165
5170
  };
5166
- //#endregion
5167
- //#region src/model/control/namespace.ts
5171
+ // src/model/control/namespace.ts
5168
5172
  /**
5169
5173
  * Copyright 2025 The MOQtail Authors
5170
5174
  *
@@ -5209,8 +5213,7 @@ var Namespace = class Namespace {
5209
5213
  return new Namespace(trackNamespaceSuffix);
5210
5214
  }
5211
5215
  };
5212
- //#endregion
5213
- //#region src/model/control/namespace_done.ts
5216
+ // src/model/control/namespace_done.ts
5214
5217
  /**
5215
5218
  * Copyright 2025 The MOQtail Authors
5216
5219
  *
@@ -5255,8 +5258,7 @@ var NamespaceDone = class NamespaceDone {
5255
5258
  return new NamespaceDone(trackNamespaceSuffix);
5256
5259
  }
5257
5260
  };
5258
- //#endregion
5259
- //#region src/model/control/setup.ts
5261
+ // src/model/control/setup.ts
5260
5262
  /**
5261
5263
  * Copyright 2026 The MOQtail Authors
5262
5264
  *
@@ -5305,8 +5307,7 @@ var Setup = class Setup {
5305
5307
  return new Setup(setupOptions);
5306
5308
  }
5307
5309
  };
5308
- //#endregion
5309
- //#region src/model/control/fetch.ts
5310
+ // src/model/control/fetch.ts
5310
5311
  /**
5311
5312
  * Copyright 2025 The MOQtail Authors
5312
5313
  *
@@ -5363,8 +5364,7 @@ var Fetch = class Fetch {
5363
5364
  return new Fetch(requestId, fullTrackName, parameters);
5364
5365
  }
5365
5366
  };
5366
- //#endregion
5367
- //#region src/model/control/fetch_ok.ts
5367
+ // src/model/control/fetch_ok.ts
5368
5368
  /**
5369
5369
  * Copyright 2025 The MOQtail Authors
5370
5370
  *
@@ -5428,8 +5428,7 @@ var FetchOk = class FetchOk {
5428
5428
  return new FetchOk(endOfTrack, endLocation, parameters, trackProperties);
5429
5429
  }
5430
5430
  };
5431
- //#endregion
5432
- //#region src/model/control/goaway.ts
5431
+ // src/model/control/goaway.ts
5433
5432
  /**
5434
5433
  * Copyright 2025 The MOQtail Authors
5435
5434
  *
@@ -5504,8 +5503,7 @@ var GoAway = class GoAway {
5504
5503
  return new GoAway(newSessionUri, timeout);
5505
5504
  }
5506
5505
  };
5507
- //#endregion
5508
- //#region src/model/control/subscribe.ts
5506
+ // src/model/control/subscribe.ts
5509
5507
  /**
5510
5508
  * Copyright 2025 The MOQtail Authors
5511
5509
  *
@@ -5558,8 +5556,7 @@ var Subscribe = class Subscribe {
5558
5556
  return new Subscribe(requestId, fullTrackName, parameters);
5559
5557
  }
5560
5558
  };
5561
- //#endregion
5562
- //#region src/model/control/publish_done.ts
5559
+ // src/model/control/publish_done.ts
5563
5560
  /**
5564
5561
  * Copyright 2025 The MOQtail Authors
5565
5562
  *
@@ -5615,8 +5612,7 @@ var PublishDone = class PublishDone {
5615
5612
  return new PublishDone(statusCode, streamCount, errorReason);
5616
5613
  }
5617
5614
  };
5618
- //#endregion
5619
- //#region src/model/control/publish.ts
5615
+ // src/model/control/publish.ts
5620
5616
  /**
5621
5617
  * Copyright 2025 The MOQtail Authors
5622
5618
  *
@@ -5674,8 +5670,7 @@ var Publish = class Publish {
5674
5670
  return new Publish(requestId, fullTrackName, trackAlias, parameters, trackProperties);
5675
5671
  }
5676
5672
  };
5677
- //#endregion
5678
- //#region src/model/control/subscribe_ok.ts
5673
+ // src/model/control/subscribe_ok.ts
5679
5674
  /**
5680
5675
  * Copyright 2025 The MOQtail Authors
5681
5676
  *
@@ -5733,8 +5728,7 @@ var SubscribeOk = class SubscribeOk {
5733
5728
  return new SubscribeOk(trackAlias, parameters, trackProperties);
5734
5729
  }
5735
5730
  };
5736
- //#endregion
5737
- //#region src/model/control/request_update.ts
5731
+ // src/model/control/request_update.ts
5738
5732
  /**
5739
5733
  * Copyright 2025 The MOQtail Authors
5740
5734
  *
@@ -5798,8 +5792,7 @@ var RequestUpdate = class RequestUpdate {
5798
5792
  return true;
5799
5793
  }
5800
5794
  };
5801
- //#endregion
5802
- //#region src/model/control/track_status.ts
5795
+ // src/model/control/track_status.ts
5803
5796
  /**
5804
5797
  * Copyright 2025 The MOQtail Authors
5805
5798
  *
@@ -5868,8 +5861,7 @@ var TrackStatus = class TrackStatus {
5868
5861
  return new TrackStatus(requestId, trackAlias, fullTrackName, subscriberPriority, groupOrder, forward, locationFilter, subscribeParameters);
5869
5862
  }
5870
5863
  };
5871
- //#endregion
5872
- //#region src/model/control/subscribe_namespace.ts
5864
+ // src/model/control/subscribe_namespace.ts
5873
5865
  /**
5874
5866
  * Copyright 2025 The MOQtail Authors
5875
5867
  *
@@ -5919,8 +5911,7 @@ var SubscribeNamespace = class SubscribeNamespace {
5919
5911
  return new SubscribeNamespace(requestId, trackNamespacePrefix, parameters);
5920
5912
  }
5921
5913
  };
5922
- //#endregion
5923
- //#region src/model/control/subscribe_tracks.ts
5914
+ // src/model/control/subscribe_tracks.ts
5924
5915
  /**
5925
5916
  * Copyright 2026 The MOQtail Authors
5926
5917
  *
@@ -5977,8 +5968,7 @@ var SubscribeTracks = class SubscribeTracks {
5977
5968
  return new SubscribeTracks(requestId, trackNamespacePrefix, parameters);
5978
5969
  }
5979
5970
  };
5980
- //#endregion
5981
- //#region src/model/control/request_ok.ts
5971
+ // src/model/control/request_ok.ts
5982
5972
  /**
5983
5973
  * Copyright 2026 The MOQtail Authors
5984
5974
  *
@@ -6061,8 +6051,7 @@ var RequestOk = class RequestOk {
6061
6051
  return new RequestOk(parameters, trackProperties);
6062
6052
  }
6063
6053
  };
6064
- //#endregion
6065
- //#region src/model/control/request_error.ts
6054
+ // src/model/control/request_error.ts
6066
6055
  /**
6067
6056
  * Copyright 2025 The MOQtail Authors
6068
6057
  *
@@ -6124,8 +6113,7 @@ var RequestError = class RequestError {
6124
6113
  return new RequestError(errorCode, retryInterval, reasonPhrase, redirect);
6125
6114
  }
6126
6115
  };
6127
- //#endregion
6128
- //#region src/model/control/control_message.ts
6116
+ // src/model/control/control_message.ts
6129
6117
  /**
6130
6118
  * Copyright 2025 The MOQtail Authors
6131
6119
  *
@@ -6178,176 +6166,7 @@ let ControlMessage;
6178
6166
  }
6179
6167
  _ControlMessage.serialize = serialize;
6180
6168
  })(ControlMessage || (ControlMessage = {}));
6181
- //#endregion
6182
- //#region src/model/catalog/cmsf.ts
6183
- function isString(v) {
6184
- return typeof v === "string";
6185
- }
6186
- function isNumber(v) {
6187
- return typeof v === "number";
6188
- }
6189
- function isStringArray(v) {
6190
- return Array.isArray(v) && v.every((item) => isString(item));
6191
- }
6192
- function isValidPackaging(v) {
6193
- return v === "cmaf" || v === "chunk-per-object" || v === "timeline";
6194
- }
6195
- function isValidRole(v) {
6196
- return v === "video" || v === "audio" || v === "timeline";
6197
- }
6198
- function isValidBase64(str) {
6199
- try {
6200
- return btoa(atob(str)) === str;
6201
- } catch {
6202
- return false;
6203
- }
6204
- }
6205
- function validateTrack(track) {
6206
- if (typeof track !== "object" || track === null) throw new Error("Track must be an object");
6207
- const t = track;
6208
- if (!isString(t["name"])) throw new Error("Track.name must be a string");
6209
- if (!isValidPackaging(t["packaging"])) throw new Error("Track.packaging must be 'cmaf', 'chunk-per-object', or 'timeline'");
6210
- if (!isValidRole(t["role"])) throw new Error("Track.role must be 'video', 'audio', or 'timeline'");
6211
- const name = t["name"];
6212
- const packaging = t["packaging"];
6213
- const role = t["role"];
6214
- let codec;
6215
- if (t["codec"] !== void 0) {
6216
- if (!isString(t["codec"])) throw new Error("Track.codec must be a string");
6217
- codec = t["codec"];
6218
- }
6219
- let depends;
6220
- if (t["depends"] !== void 0) {
6221
- if (!isStringArray(t["depends"])) throw new Error("Track.depends must be an array of strings");
6222
- depends = t["depends"];
6223
- }
6224
- let mimeType;
6225
- if (t["mimeType"] !== void 0) {
6226
- if (!isString(t["mimeType"])) throw new Error("Track.mimeType must be a string");
6227
- mimeType = t["mimeType"];
6228
- }
6229
- let width;
6230
- if (t["width"] !== void 0) {
6231
- if (!isNumber(t["width"])) throw new Error("Track.width must be a number");
6232
- width = t["width"];
6233
- }
6234
- let height;
6235
- if (t["height"] !== void 0) {
6236
- if (!isNumber(t["height"])) throw new Error("Track.height must be a number");
6237
- height = t["height"];
6238
- }
6239
- let timescale;
6240
- if (t["timescale"] !== void 0) {
6241
- if (!isNumber(t["timescale"])) throw new Error("Track.timescale must be a number");
6242
- timescale = t["timescale"];
6243
- }
6244
- let bitrate;
6245
- if (t["bitrate"] !== void 0) {
6246
- if (!isNumber(t["bitrate"])) throw new Error("Track.bitrate must be a number");
6247
- bitrate = t["bitrate"];
6248
- }
6249
- let initData;
6250
- if (t["initData"] !== void 0) {
6251
- if (!isString(t["initData"])) throw new Error("Track.initData must be a string");
6252
- if (!isValidBase64(t["initData"])) throw new Error("Track.initData must be a valid base64 string");
6253
- initData = t["initData"];
6254
- }
6255
- if (packaging === "cmaf" && (!codec || codec.length === 0)) throw new Error("codec is required when packaging is 'cmaf'");
6256
- if (packaging === "timeline" && mimeType !== "text/csv") throw new Error("mimeType must be 'text/csv' when packaging is 'timeline'");
6257
- if (packaging === "timeline" && (!depends || depends.length === 0)) throw new Error("At least one dependee must be present when packaging is 'timeline'");
6258
- const result = {
6259
- name,
6260
- packaging,
6261
- role
6262
- };
6263
- if (codec !== void 0) result.codec = codec;
6264
- if (depends !== void 0) result.depends = depends;
6265
- if (mimeType !== void 0) result.mimeType = mimeType;
6266
- if (width !== void 0) result.width = width;
6267
- if (height !== void 0) result.height = height;
6268
- if (timescale !== void 0) result.timescale = timescale;
6269
- if (bitrate !== void 0) result.bitrate = bitrate;
6270
- if (initData !== void 0) result.initData = initData;
6271
- return result;
6272
- }
6273
- function validateCMSF(obj) {
6274
- if (typeof obj !== "object" || obj === null) throw new Error("CMSF must be an object");
6275
- const o = obj;
6276
- if (!isString(o["version"])) throw new Error("CMSF.version must be a string");
6277
- if (!Array.isArray(o["tracks"])) throw new Error("CMSF.tracks must be an array");
6278
- return {
6279
- version: o["version"],
6280
- tracks: o["tracks"].map(validateTrack)
6281
- };
6282
- }
6283
- var CMSFCatalog = class CMSFCatalog {
6284
- #catalog;
6285
- constructor(catalog) {
6286
- this.#catalog = catalog;
6287
- }
6288
- static from(payload) {
6289
- const json = new TextDecoder().decode(payload);
6290
- const catalog = validateCMSF(JSON.parse(json));
6291
- return new CMSFCatalog(catalog);
6292
- }
6293
- getByTrackName(trackName) {
6294
- return this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6295
- }
6296
- getTracks(role) {
6297
- if (role) return this.#catalog.tracks.filter((track) => track.role === role);
6298
- return this.#catalog.tracks;
6299
- }
6300
- getVideo(index = 0) {
6301
- const videos = this.#catalog.tracks.filter((track) => track.role === "video");
6302
- if (index < 0 || index >= videos.length) return void 0;
6303
- return videos[index];
6304
- }
6305
- getAudio(index = 0) {
6306
- const audios = this.#catalog.tracks.filter((track) => track.role === "audio");
6307
- if (index < 0 || index >= audios.length) return void 0;
6308
- return audios[index];
6309
- }
6310
- getTimeline(index = 0) {
6311
- const timelines = this.#catalog.tracks.filter((track) => track.role === "timeline");
6312
- if (index < 0 || index >= timelines.length) return void 0;
6313
- return timelines[index];
6314
- }
6315
- getCodecString(trackName) {
6316
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6317
- if (!track) return void 0;
6318
- if (!track.codec) throw new Error(`Track ${trackName} does not have a codec`);
6319
- return track.codec;
6320
- }
6321
- getRole(trackName) {
6322
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6323
- if (!track) return void 0;
6324
- return track.role;
6325
- }
6326
- getPackaging(trackName) {
6327
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6328
- if (!track) return void 0;
6329
- return track.packaging;
6330
- }
6331
- isCMAF(trackName) {
6332
- const packaging = this.getPackaging(trackName);
6333
- return packaging === "cmaf" || packaging === "chunk-per-object";
6334
- }
6335
- getTimescale(trackName) {
6336
- return this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName))?.timescale;
6337
- }
6338
- getInitData(trackName) {
6339
- const track = this.#catalog.tracks.find((track) => track.name === this.extractTrackName(trackName));
6340
- if (!track) return void 0;
6341
- if (!track.initData) throw new Error(`Track ${trackName} does not have initData`);
6342
- return new Uint8Array(atob(track.initData).split("").map((c) => c.charCodeAt(0)));
6343
- }
6344
- extractTrackName(input) {
6345
- const parts = input.split("/");
6346
- return parts[parts.length - 1];
6347
- }
6348
- };
6349
- //#endregion
6350
- //#region src/model/parameter/setup/path.ts
6169
+ // src/model/parameter/setup/path.ts
6351
6170
  /**
6352
6171
  * Copyright 2025 The MOQtail Authors
6353
6172
  *
@@ -6379,8 +6198,7 @@ var Path = class Path {
6379
6198
  return new Path(moqtPath);
6380
6199
  }
6381
6200
  };
6382
- //#endregion
6383
- //#region src/model/parameter/setup/max_auth_token_cache_size.ts
6201
+ // src/model/parameter/setup/max_auth_token_cache_size.ts
6384
6202
  /**
6385
6203
  * Copyright 2025 The MOQtail Authors
6386
6204
  *
@@ -6410,8 +6228,7 @@ var MaxAuthTokenCacheSize = class MaxAuthTokenCacheSize {
6410
6228
  return new MaxAuthTokenCacheSize(pair.value);
6411
6229
  }
6412
6230
  };
6413
- //#endregion
6414
- //#region src/model/parameter/setup/authority.ts
6231
+ // src/model/parameter/setup/authority.ts
6415
6232
  /**
6416
6233
  * Copyright 2026 The MOQtail Authors
6417
6234
  *
@@ -6433,7 +6250,7 @@ var MaxAuthTokenCacheSize = class MaxAuthTokenCacheSize {
6433
6250
  *
6434
6251
  * Client-only; MUST NOT be sent by a server or over WebTransport. moqtail-ts always
6435
6252
  * connects over WebTransport, so its own handshake never sends this — see
6436
- * `MOQtailClient.new`.
6253
+ * `MOQtailClient.init`.
6437
6254
  */
6438
6255
  var Authority = class Authority {
6439
6256
  authority;
@@ -6451,8 +6268,7 @@ var Authority = class Authority {
6451
6268
  return new Authority(authority);
6452
6269
  }
6453
6270
  };
6454
- //#endregion
6455
- //#region src/model/parameter/setup/max_filter_ranges.ts
6271
+ // src/model/parameter/setup/max_filter_ranges.ts
6456
6272
  /**
6457
6273
  * Copyright 2026 The MOQtail Authors
6458
6274
  *
@@ -6487,8 +6303,7 @@ var MaxFilterRanges = class MaxFilterRanges {
6487
6303
  return new MaxFilterRanges(pair.value);
6488
6304
  }
6489
6305
  };
6490
- //#endregion
6491
- //#region src/model/parameter/setup/moqt_implementation.ts
6306
+ // src/model/parameter/setup/moqt_implementation.ts
6492
6307
  /**
6493
6308
  * Copyright 2026 The MOQtail Authors
6494
6309
  *
@@ -6524,8 +6339,7 @@ var MoqtImplementation = class MoqtImplementation {
6524
6339
  return new MoqtImplementation(info);
6525
6340
  }
6526
6341
  };
6527
- //#endregion
6528
- //#region src/model/parameter/setup/max_request_updates.ts
6342
+ // src/model/parameter/setup/max_request_updates.ts
6529
6343
  /**
6530
6344
  * Copyright 2026 The MOQtail Authors
6531
6345
  *
@@ -6560,8 +6374,7 @@ var MaxRequestUpdates = class MaxRequestUpdates {
6560
6374
  return new MaxRequestUpdates(pair.value);
6561
6375
  }
6562
6376
  };
6563
- //#endregion
6564
- //#region src/model/parameter/setup/ssts_algorithms.ts
6377
+ // src/model/parameter/setup/ssts_algorithms.ts
6565
6378
  /**
6566
6379
  * Copyright 2026 The MOQtail Authors
6567
6380
  *
@@ -6605,8 +6418,7 @@ var SstsAlgorithms = class SstsAlgorithms {
6605
6418
  return new SstsAlgorithms(algorithms);
6606
6419
  }
6607
6420
  };
6608
- //#endregion
6609
- //#region src/model/parameter/setup_option.ts
6421
+ // src/model/parameter/setup_option.ts
6610
6422
  let SetupOption;
6611
6423
  (function(_SetupOption) {
6612
6424
  function fromKeyValuePair(pair) {
@@ -6700,8 +6512,7 @@ var SetupOptions = class {
6700
6512
  return result;
6701
6513
  }
6702
6514
  };
6703
- //#endregion
6704
- //#region src/model/parameter/message/combined_filter.ts
6515
+ // src/model/parameter/message/combined_filter.ts
6705
6516
  /**
6706
6517
  * Copyright 2026 The MOQtail Authors
6707
6518
  *
@@ -6764,9 +6575,7 @@ var CombinedFilter = class {
6764
6575
  case RangeFilterKind.Priority:
6765
6576
  set.priority = ranges;
6766
6577
  break;
6767
- case RangeFilterKind.ObjectProperty:
6768
- set.properties.set(filter.propertyType, ranges);
6769
- break;
6578
+ case RangeFilterKind.ObjectProperty: set.properties.set(filter.propertyType, ranges);
6770
6579
  }
6771
6580
  }
6772
6581
  this.rangeCount = rangeCount;
@@ -6819,14 +6628,12 @@ function propertiesPass(required, properties) {
6819
6628
  }
6820
6629
  return true;
6821
6630
  }
6822
- //#endregion
6823
6631
  exports.AudioConfig = AudioConfig;
6824
6632
  exports.AudioLevel = AudioLevel;
6825
6633
  exports.Authority = Authority;
6826
6634
  exports.AuthorizationToken = AuthorizationToken;
6827
6635
  exports.BaseByteBuffer = BaseByteBuffer;
6828
6636
  exports.ByteBuffer = ByteBuffer;
6829
- exports.CMSFCatalog = CMSFCatalog;
6830
6637
  exports.CastingError = CastingError;
6831
6638
  exports.CombinedFilter = CombinedFilter;
6832
6639
  Object.defineProperty(exports, "ControlMessage", {
@@ -7067,6 +6874,7 @@ exports.deserializeKvpList = deserializeKvpList;
7067
6874
  exports.deserializeKvpListUntilEmpty = deserializeKvpListUntilEmpty;
7068
6875
  exports.deserializeMessageParameterKvps = deserializeMessageParameterKvps;
7069
6876
  exports.encodeRanges = encodeRanges;
6877
+ exports.findProperty = findProperty;
7070
6878
  exports.greaseValue = greaseValue;
7071
6879
  exports.isApplicationSpecificProperty = isApplicationSpecificProperty;
7072
6880
  exports.isBytes = isBytes;