@cbortech/cbor 0.26.0 → 0.26.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.
@@ -420,12 +420,12 @@ function Le(e) {
420
420
  function Re(e) {
421
421
  return Ie.setFloat32(0, e, !1), Object.is(Ie.getFloat32(0, !1), e);
422
422
  }
423
- function D(e) {
423
+ function ze(e) {
424
424
  return Le(e) ? "half" : Re(e) ? "single" : "double";
425
425
  }
426
426
  //#endregion
427
427
  //#region src/ast/CborItem.ts
428
- var O = class e {
428
+ var D = class e {
429
429
  start;
430
430
  end;
431
431
  comments;
@@ -493,7 +493,7 @@ var O = class e {
493
493
  comment: this._toCDN(n, 0)
494
494
  }];
495
495
  }
496
- }, k = class extends O {
496
+ }, O = class extends D {
497
497
  value;
498
498
  encodingWidth;
499
499
  constructor(e, t) {
@@ -517,7 +517,7 @@ var O = class e {
517
517
  let t = e?.integerAs ?? "auto";
518
518
  return t === "bigint" ? this.value : t === "number" || this.value <= BigInt(2 ** 53 - 1) ? Number(this.value) : this.value;
519
519
  }
520
- }, A = class extends O {
520
+ }, k = class extends D {
521
521
  argument;
522
522
  encodingWidth;
523
523
  constructor(e, t) {
@@ -546,8 +546,8 @@ var O = class e {
546
546
  let t = this.value, n = e?.integerAs ?? "auto";
547
547
  return n === "bigint" ? t : n === "number" || t >= BigInt(-(2 ** 53 - 1)) ? Number(t) : t;
548
548
  }
549
- }, ze = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
550
- function Be(e) {
549
+ }, Be = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
550
+ function Ve(e) {
551
551
  let t = e.startsWith("-"), n = e.slice(t ? 3 : 2), r = n.search(/[pP]/);
552
552
  if (r === -1) throw SyntaxError(`EDN parse error: hex float missing 'p' exponent: ${e}`);
553
553
  let i = n.slice(0, r), a = n.slice(r + 1);
@@ -565,20 +565,20 @@ function Be(e) {
565
565
  let l = c * 2 ** o;
566
566
  return t ? -l : l;
567
567
  }
568
- function Ve(e) {
568
+ function He(e) {
569
569
  if (isNaN(e)) return "NaN";
570
570
  if (!isFinite(e)) return e > 0 ? "Infinity" : "-Infinity";
571
571
  let t = Object.is(e, -0) || e < 0, n = Math.abs(e);
572
572
  if (n === 0) return t ? "-0x0p+0" : "0x0p+0";
573
- ze.setFloat64(0, n, !1);
574
- let r = ze.getUint32(0, !1), i = ze.getUint32(4, !1), a = r >>> 20 & 2047, o = r & 1048575, s = i, c = (o.toString(16).padStart(5, "0") + s.toString(16).padStart(8, "0")).replace(/0+$/, ""), l = c === "" ? "" : `.${c}`, u, d;
573
+ Be.setFloat64(0, n, !1);
574
+ let r = Be.getUint32(0, !1), i = Be.getUint32(4, !1), a = r >>> 20 & 2047, o = r & 1048575, s = i, c = (o.toString(16).padStart(5, "0") + s.toString(16).padStart(8, "0")).replace(/0+$/, ""), l = c === "" ? "" : `.${c}`, u, d;
575
575
  a === 0 ? (u = "0", d = -1022) : (u = "1", d = a - 1023);
576
576
  let f = d >= 0 ? `+${d}` : `${d}`, p = `0x${u}${l}p${f}`;
577
577
  return t ? `-${p}` : p;
578
578
  }
579
579
  //#endregion
580
580
  //#region src/ast/CborFloat.ts
581
- var j = class extends O {
581
+ var A = class extends D {
582
582
  value;
583
583
  precision;
584
584
  ednSource;
@@ -587,7 +587,7 @@ var j = class extends O {
587
587
  super(), this.value = e, this.precision = t?.precision, this.rawBits = t?.rawBits;
588
588
  }
589
589
  _encodeTo(e, t) {
590
- let n = this.precision ?? D(this.value), r = Number.isNaN(this.value) ? this.rawBits : void 0;
590
+ let n = this.precision ?? ze(this.value), r = Number.isNaN(this.value) ? this.rawBits : void 0;
591
591
  n === "half" ? (e.writeByte(249), r?.length === 2 ? e.writeBytes(r) : e.writeFloat16(this.value)) : n === "single" ? (e.writeByte(250), r?.length === 4 ? e.writeBytes(r) : e.writeFloat32(this.value)) : (e.writeByte(251), r?.length === 8 ? e.writeBytes(r) : e.writeFloat64(this.value));
592
592
  }
593
593
  _toCDN(e, t) {
@@ -596,18 +596,18 @@ var j = class extends O {
596
596
  if (n === "never") return this.ednSource.replace(/_[0-3i]$/, "");
597
597
  if (n === "always") {
598
598
  if (/_[0-3i]$/.test(this.ednSource)) return this.ednSource;
599
- let e = this.precision ?? D(this.value), t = e === "half" ? "_1" : e === "single" ? "_2" : "_3";
599
+ let e = this.precision ?? ze(this.value), t = e === "half" ? "_1" : e === "single" ? "_2" : "_3";
600
600
  return this.ednSource + t;
601
601
  }
602
602
  return this.ednSource;
603
603
  }
604
- let r = D(this.value);
605
- return (e?.floatFormat === "hex" ? Ve(this.value) : Ce(this.value)) + we(this.value, this.precision, r, n);
604
+ let r = ze(this.value);
605
+ return (e?.floatFormat === "hex" ? He(this.value) : Ce(this.value)) + we(this.value, this.precision, r, n);
606
606
  }
607
607
  _toJS(e) {
608
608
  return this.value;
609
609
  }
610
- }, M = class extends O {
610
+ }, j = class extends D {
611
611
  tag;
612
612
  content;
613
613
  encodingWidth;
@@ -637,7 +637,7 @@ var j = class extends O {
637
637
  let t = this.content._toJS(e);
638
638
  return e?.stripTags ? t : m.set(t, this.tag);
639
639
  }
640
- }, N = class extends O {
640
+ }, M = class extends D {
641
641
  indefiniteLength = !1;
642
642
  value;
643
643
  ednEncoding;
@@ -668,7 +668,7 @@ var j = class extends O {
668
668
  _toJS(e) {
669
669
  return this.value;
670
670
  }
671
- }, P = class extends O {
671
+ }, N = class extends D {
672
672
  indefiniteLength = !0;
673
673
  chunks;
674
674
  constructor(e) {
@@ -683,7 +683,7 @@ var j = class extends O {
683
683
  if ((e?.encodingIndicators ?? "auto") === "never") {
684
684
  let t = this.chunks.reduce((e, t) => e + t.value.length, 0), n = new Uint8Array(t), r = 0;
685
685
  for (let e of this.chunks) n.set(e.value, r), r += e.value.length;
686
- return new N(n)._toCDN(e, 0);
686
+ return new M(n)._toCDN(e, 0);
687
687
  }
688
688
  return this.chunks.length === 0 ? "''_" : `(_ ${this.chunks.map((t) => t._toCDN(e, 0)).join(", ")})`;
689
689
  }
@@ -705,7 +705,7 @@ var j = class extends O {
705
705
  for (let e of this.chunks) n.set(e.value, r), r += e.value.length;
706
706
  return n;
707
707
  }
708
- }, F = class extends O {
708
+ }, P = class extends D {
709
709
  indefiniteLength = !0;
710
710
  chunks;
711
711
  constructor(e) {
@@ -735,7 +735,7 @@ var j = class extends O {
735
735
  _toJS(e) {
736
736
  return this.chunks.map((e) => e.value).join("");
737
737
  }
738
- }, I = class extends O {
738
+ }, F = class extends D {
739
739
  items;
740
740
  indefiniteLength;
741
741
  encodingWidth;
@@ -803,7 +803,7 @@ var j = class extends O {
803
803
  }
804
804
  return r;
805
805
  }
806
- }, L = class extends O {
806
+ }, I = class extends D {
807
807
  entries;
808
808
  indefiniteLength;
809
809
  encodingWidth;
@@ -838,7 +838,7 @@ var j = class extends O {
838
838
  entryLeadingNode: (e) => this.entries[e][0],
839
839
  entryTrailing: (e, t) => {
840
840
  let [n, r] = this.entries[e];
841
- return He([
841
+ return Ue([
842
842
  ...n.comments?.trailing ?? [],
843
843
  ...r.comments?.leading ?? [],
844
844
  ...r.comments?.trailing ?? []
@@ -914,12 +914,12 @@ var j = class extends O {
914
914
  })() : n();
915
915
  }
916
916
  };
917
- function He(e, t) {
917
+ function Ue(e, t) {
918
918
  return e.length === 0 ? "" : " " + e.map((e) => v(e, t).trimEnd()).join(" ");
919
919
  }
920
920
  //#endregion
921
921
  //#region src/ast/CborSimple.ts
922
- var R = class e extends O {
922
+ var L = class e extends D {
923
923
  value;
924
924
  constructor(e) {
925
925
  if (super(), !Number.isInteger(e) || e < 0 || e > 255) throw RangeError("CborSimple value must be an integer in 0–255");
@@ -954,7 +954,7 @@ var R = class e extends O {
954
954
  default: return new g(this.value);
955
955
  }
956
956
  }
957
- }, Ue = class extends O {
957
+ }, We = class extends D {
958
958
  items;
959
959
  encodingWidth;
960
960
  constructor(e, t) {
@@ -989,17 +989,17 @@ var R = class e extends O {
989
989
  _toJS(e) {
990
990
  return this._content();
991
991
  }
992
- }, We = 999n, Ge = class extends M {
992
+ }, Ge = 999n, Ke = class extends j {
993
993
  constructor(e, t) {
994
- let n = t.length === 1 && t[0] instanceof B ? t[0] : new I(t);
995
- super(We, new I([new B(e), n]));
994
+ let n = t.length === 1 && t[0] instanceof B ? t[0] : new F(t);
995
+ super(Ge, new F([new B(e), n]));
996
996
  }
997
997
  _toCDN(e, t) {
998
998
  if (e?.appStrings === !1) return super._toCDN(e, t);
999
999
  let n = this.content, r = n.items[0].value, i = n.items[1];
1000
1000
  return i instanceof B ? `${r}${xe(i.value)}` : `${r}<<${i.items.map((n) => n._toCDN(e, t)).join(", ")}>>`;
1001
1001
  }
1002
- }, Ke = class extends O {
1002
+ }, qe = class extends D {
1003
1003
  inner;
1004
1004
  ednSource;
1005
1005
  constructor(e, t) {
@@ -1015,15 +1015,15 @@ var R = class e extends O {
1015
1015
  _toJS(e) {
1016
1016
  return this.inner._toJS(e);
1017
1017
  }
1018
- }, qe = 888n, z = class extends M {
1018
+ }, Je = 888n, R = class extends j {
1019
1019
  constructor(e) {
1020
- e === void 0 ? super(qe, R.NULL) : super(qe, new I(e));
1020
+ e === void 0 ? super(Je, L.NULL) : super(Je, new F(e));
1021
1021
  }
1022
1022
  _toCDN(e, t) {
1023
- return this.content instanceof R ? "..." : this.content instanceof I ? this.content.items.map((n) => n._toCDN(e, t)).join(" + ") : super._toCDN(e, t);
1023
+ return e?.appStrings === !1 ? super._toCDN(e, t) : this.content instanceof L ? "..." : this.content instanceof F ? this.content.items.map((n) => n._toCDN(e, t)).join(" + ") : super._toCDN(e, t);
1024
1024
  }
1025
- }, Je = 2n, Ye = 3n, Xe = 18446744073709551615n, Ze = -18446744073709551616n;
1026
- function Qe(e) {
1025
+ }, Ye = 2n, Xe = 3n, Ze = 18446744073709551615n, Qe = -18446744073709551616n;
1026
+ function $e(e) {
1027
1027
  if (e < 0n) throw RangeError("bigintToBytes requires a non-negative value");
1028
1028
  if (e === 0n) return /* @__PURE__ */ new Uint8Array();
1029
1029
  let t = e.toString(16);
@@ -1032,16 +1032,16 @@ function Qe(e) {
1032
1032
  for (let e = 0; e < n.length; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
1033
1033
  return n;
1034
1034
  }
1035
- function $e(e) {
1035
+ function et(e) {
1036
1036
  let t = 0n;
1037
1037
  for (let n of e) t = t << 8n | BigInt(n);
1038
1038
  return t;
1039
1039
  }
1040
- var et = class extends M {
1040
+ var tt = class extends j {
1041
1041
  bigValue;
1042
1042
  constructor(e) {
1043
- if (e <= Xe) throw RangeError(`CborBigUint value ${e} fits in CborUint; use CborUint instead`);
1044
- super(Je, new N(Qe(e))), this.bigValue = e;
1043
+ if (e <= Ze) throw RangeError(`CborBigUint value ${e} fits in CborUint; use CborUint instead`);
1044
+ super(Ye, new M($e(e))), this.bigValue = e;
1045
1045
  }
1046
1046
  _toCDN(e, t) {
1047
1047
  return this.bigValue.toString();
@@ -1049,11 +1049,11 @@ var et = class extends M {
1049
1049
  _toJS(e) {
1050
1050
  return this.bigValue;
1051
1051
  }
1052
- }, tt = class extends M {
1052
+ }, nt = class extends j {
1053
1053
  bigValue;
1054
1054
  constructor(e) {
1055
- if (e >= Ze) throw RangeError(`CborBigNint value ${e} fits in CborNint; use CborNint instead`);
1056
- super(Ye, new N(Qe(-1n - e))), this.bigValue = e;
1055
+ if (e >= Qe) throw RangeError(`CborBigNint value ${e} fits in CborNint; use CborNint instead`);
1056
+ super(Xe, new M($e(-1n - e))), this.bigValue = e;
1057
1057
  }
1058
1058
  _toCDN(e, t) {
1059
1059
  return this.bigValue.toString();
@@ -1061,25 +1061,25 @@ var et = class extends M {
1061
1061
  _toJS(e) {
1062
1062
  return this.bigValue;
1063
1063
  }
1064
- }, nt = new TextEncoder(), rt = new TextDecoder("utf-8", { fatal: !0 }), it = new TextDecoder("utf-8", { fatal: !1 });
1065
- function at(e, t) {
1064
+ }, rt = new TextEncoder(), it = new TextDecoder("utf-8", { fatal: !0 }), at = new TextDecoder("utf-8", { fatal: !1 });
1065
+ function ot(e, t) {
1066
1066
  let n = new a(e, {
1067
1067
  offset: t?.offset,
1068
1068
  skipRS: t?._skipRS
1069
- }), r = new _t(n, t ?? {}).parse();
1070
- return t?.preserveComments && ut(r, n.comments, e), r;
1069
+ }), r = new vt(n, t ?? {}).parse();
1070
+ return t?.preserveComments && dt(r, n.comments, e), r;
1071
1071
  }
1072
- function ot(e) {
1072
+ function st(e) {
1073
1073
  let t = e, n;
1074
1074
  return /[_][0-7i]$/.test(e) && (n = e[e.length - 1], t = e.slice(0, -2)), {
1075
1075
  numStr: t,
1076
1076
  rawSuffix: n
1077
1077
  };
1078
1078
  }
1079
- function st(e) {
1079
+ function ct(e) {
1080
1080
  return e.startsWith("-") ? -BigInt(e.slice(1)) : BigInt(e);
1081
1081
  }
1082
- function ct(e, t) {
1082
+ function lt(e, t) {
1083
1083
  if (e.endsWith("_i") || e.endsWith("_0")) {
1084
1084
  let n = "_0 and _i encoding indicators are not valid for floating-point values";
1085
1085
  if (t) t(n), e = e.slice(0, -2);
@@ -1103,14 +1103,14 @@ function ct(e, t) {
1103
1103
  };
1104
1104
  let n = e, r;
1105
1105
  return e.endsWith("_1") ? (r = "half", n = e.slice(0, -2)) : e.endsWith("_2") ? (r = "single", n = e.slice(0, -2)) : e.endsWith("_3") && (r = "double", n = e.slice(0, -2)), /^-?0[xX]/.test(n) ? {
1106
- value: Be(n),
1106
+ value: Ve(n),
1107
1107
  precision: r
1108
1108
  } : {
1109
1109
  value: parseFloat(n),
1110
1110
  precision: r
1111
1111
  };
1112
1112
  }
1113
- function lt(e, t) {
1113
+ function ut(e, t) {
1114
1114
  let n = e.indexOf("="), r = n >= 0 ? e.slice(0, n) : e, i = n >= 0 ? e.slice(n) : "";
1115
1115
  if (/[^A-Za-z0-9+/\-_]/.test(r)) {
1116
1116
  let e = [...r].find((e) => !/[A-Za-z0-9+/\-_]/.test(e)) ?? "";
@@ -1147,9 +1147,9 @@ function lt(e, t) {
1147
1147
  for (let e = 0; e < c.length; e++) l[e] = c.charCodeAt(e);
1148
1148
  return l;
1149
1149
  }
1150
- function ut(e, t, n) {
1150
+ function dt(e, t, n) {
1151
1151
  if (t.length === 0) return;
1152
- let r = dt(e), i = pt(n), a = [...r].sort((e, t) => e.start - t.start || t.end - e.end), o = [...r].sort((e, t) => e.end - t.end || e.start - t.start), s = [...t].sort((e, t) => e.start - t.start), c = [], l = 0;
1152
+ let r = ft(e), i = mt(n), a = [...r].sort((e, t) => e.start - t.start || t.end - e.end), o = [...r].sort((e, t) => e.end - t.end || e.start - t.start), s = [...t].sort((e, t) => e.start - t.start), c = [], l = 0;
1153
1153
  for (let t of s) {
1154
1154
  let r = { ...t }, s = 0, u = o.length;
1155
1155
  for (; s < u;) {
@@ -1158,7 +1158,7 @@ function ut(e, t, n) {
1158
1158
  }
1159
1159
  let d = s > 0 ? o[s - 1] : void 0, f = d ? n.slice(d.end, t.start) : "";
1160
1160
  if (d && i(d.end) === t.line && !f.includes(":")) {
1161
- ft(d.node, "trailing", r);
1161
+ pt(d.node, "trailing", r);
1162
1162
  continue;
1163
1163
  }
1164
1164
  for (; l < a.length && a[l].start < t.start;) {
@@ -1174,38 +1174,38 @@ function ut(e, t, n) {
1174
1174
  }
1175
1175
  let m = s < a.length ? a[s] : void 0;
1176
1176
  if ((!p || m && m.end <= p.end) && m) {
1177
- ft(m.node, "leading", r);
1177
+ pt(m.node, "leading", r);
1178
1178
  continue;
1179
1179
  }
1180
- ft(p?.node ?? e, "dangling", r);
1180
+ pt(p?.node ?? e, "dangling", r);
1181
1181
  }
1182
1182
  }
1183
- function dt(e) {
1183
+ function ft(e) {
1184
1184
  let t = [], n = (e) => {
1185
1185
  if (e.start !== void 0 && e.end !== void 0 && t.push({
1186
1186
  node: e,
1187
1187
  start: e.start,
1188
1188
  end: e.end
1189
- }), e instanceof I || e instanceof Ue) {
1189
+ }), e instanceof F || e instanceof We) {
1190
1190
  for (let t of e.items) n(t);
1191
1191
  return;
1192
1192
  }
1193
- if (e instanceof L) {
1193
+ if (e instanceof I) {
1194
1194
  for (let [t, r] of e.entries) n(t), n(r);
1195
1195
  return;
1196
1196
  }
1197
- if (e instanceof P || e instanceof F) {
1197
+ if (e instanceof N || e instanceof P) {
1198
1198
  for (let t of e.chunks) n(t);
1199
1199
  return;
1200
1200
  }
1201
- e instanceof M && n(e.content);
1201
+ e instanceof j && n(e.content);
1202
1202
  };
1203
1203
  return n(e), t;
1204
1204
  }
1205
- function ft(e, t, n) {
1205
+ function pt(e, t, n) {
1206
1206
  e.comments ??= {}, e.comments[t] ??= [], e.comments[t].push(n);
1207
1207
  }
1208
- function pt(e) {
1208
+ function mt(e) {
1209
1209
  let t = [0];
1210
1210
  for (let n = 0; n < e.length; n++) e[n] === "\n" && t.push(n + 1);
1211
1211
  return (n) => {
@@ -1219,14 +1219,25 @@ function pt(e) {
1219
1219
  return a + 1;
1220
1220
  };
1221
1221
  }
1222
- var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'extensions' option (extensions: [${e}])`, ht = (e, t) => `install ${t}, import { ${e} } from '${t}', and pass it via the 'extensions' option (extensions: [${e}])`, gt = /* @__PURE__ */ new Map([
1223
- ["b32", mt("b32")],
1224
- ["h32", mt("h32")],
1225
- ["same", mt("same")],
1226
- ["hash", ht("hash", "@cbortech/hash-extension")],
1227
- ["uuid", ht("uuid", "@cbortech/uuid-extension")],
1228
- ["UUID", ht("uuid", "@cbortech/uuid-extension")]
1229
- ]), _t = class {
1222
+ var ht = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'extensions' option (extensions: [${e}])`, gt = (e, t) => `install ${t}, import { ${e} } from '${t}', and pass it via the 'extensions' option (extensions: [${e}])`, z = (e) => `'${e}' is a default built-in extension that was excluded via the 'builtinExtensions' option; add it back to that array (or omit 'builtinExtensions' to use the default set)`, _t = /* @__PURE__ */ new Map([
1223
+ ["b32", ht("b32")],
1224
+ ["h32", ht("h32")],
1225
+ ["same", ht("same")],
1226
+ ["hash", gt("hash", "@cbortech/hash-extension")],
1227
+ ["uuid", gt("uuid", "@cbortech/uuid-extension")],
1228
+ ["UUID", gt("uuid", "@cbortech/uuid-extension")],
1229
+ ["dt", z("dt")],
1230
+ ["DT", z("dt")],
1231
+ ["ip", z("ip")],
1232
+ ["IP", z("ip")],
1233
+ ["cri", z("cri")],
1234
+ ["CRI", z("cri")],
1235
+ ["t1", z("t1")],
1236
+ ["b1", z("b1")],
1237
+ ["ilbs", z("ilbs")],
1238
+ ["ilts", z("ilts")],
1239
+ ["float", z("float")]
1240
+ ]), vt = class {
1230
1241
  t;
1231
1242
  _options;
1232
1243
  extByPrefix;
@@ -1236,7 +1247,8 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1236
1247
  _hintedPrefixes = /* @__PURE__ */ new Set();
1237
1248
  constructor(e, t) {
1238
1249
  this.t = e, this._options = t, this.extByPrefix = /* @__PURE__ */ new Map(), this.extByTag = /* @__PURE__ */ new Map(), this.unresolvedExtension = t.unresolvedExtension ?? "cpa999";
1239
- for (let e of [...Fr, ...t.extensions ?? []]) {
1250
+ let n = Z(t.builtinExtensions);
1251
+ for (let e of [...n, ...t.extensions ?? []]) {
1240
1252
  for (let t of e.appStringPrefixes ?? []) this.extByPrefix.set(t, e);
1241
1253
  for (let t of e.tagNumbers ?? []) this.extByTag.set(t, e);
1242
1254
  }
@@ -1286,12 +1298,12 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1286
1298
  case "BYTES_HEX":
1287
1299
  case "SQSTR":
1288
1300
  case "BYTES_B64": return this.t.consume(), this._parseBytesConcat(this._decodeBytesToken(e), e.type, e.raw);
1289
- case "EMPTY_INDEF_BYTES": return this.t.consume(), new P([]);
1290
- case "EMPTY_INDEF_TEXT": return this.t.consume(), new F([]);
1291
- case "TRUE": return this.t.consume(), new R(21);
1292
- case "FALSE": return this.t.consume(), new R(20);
1293
- case "NULL": return this.t.consume(), new R(22);
1294
- case "UNDEFINED": return this.t.consume(), new R(23);
1301
+ case "EMPTY_INDEF_BYTES": return this.t.consume(), new N([]);
1302
+ case "EMPTY_INDEF_TEXT": return this.t.consume(), new P([]);
1303
+ case "TRUE": return this.t.consume(), new L(21);
1304
+ case "FALSE": return this.t.consume(), new L(20);
1305
+ case "NULL": return this.t.consume(), new L(22);
1306
+ case "UNDEFINED": return this.t.consume(), new L(23);
1295
1307
  case "SIMPLE": return this.parseSimple();
1296
1308
  case "LBRACKET": return this.parseArray();
1297
1309
  case "LBRACE": return this.parseMap();
@@ -1306,21 +1318,21 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1306
1318
  }
1307
1319
  let r = this.extByPrefix.get(e.appPrefix);
1308
1320
  if (!r?.parseAppString) {
1309
- if (r || this._hintMissingExtension(e.appPrefix, e), this.unresolvedExtension === "cpa999") return new Ge(e.appPrefix, [new B(e.value)]);
1321
+ if (r || this._hintMissingExtension(e.appPrefix, e), this.unresolvedExtension === "cpa999") return new Ke(e.appPrefix, [new B(e.value)]);
1310
1322
  this._fail(`unknown app-string extension: ${JSON.stringify(e.appPrefix)}`, e);
1311
1323
  }
1312
1324
  {
1313
1325
  let i = this._pendingWarnings.length;
1314
1326
  try {
1315
1327
  let i = r.parseAppString(e.appPrefix, e.value, this._extOnError(e), t === void 0 ? void 0 : { encodingWidth: t });
1316
- return t !== void 0 && this._applyEiToResult(i, t, e), i instanceof N && Object.getPrototypeOf(i) === N.prototype && i.ednSource === void 0 ? new N(i.value, {
1328
+ return t !== void 0 && this._applyEiToResult(i, t, e), i instanceof M && Object.getPrototypeOf(i) === M.prototype && i.ednSource === void 0 ? new M(i.value, {
1317
1329
  ednEncoding: i.ednEncoding,
1318
1330
  encodingWidth: i.encodingWidth,
1319
1331
  ednSource: e.raw + n
1320
- }) : (i instanceof j && i.ednSource === void 0 && (i.ednSource = e.raw + n), i);
1332
+ }) : (i instanceof A && i.ednSource === void 0 && (i.ednSource = e.raw + n), i);
1321
1333
  } catch (t) {
1322
1334
  if (this._options.strict !== !1) throw t;
1323
- return this._pendingWarnings.length === i && this._warn(t instanceof Error ? t.message : String(t), e), new Ge(e.appPrefix, [new B(e.value)]);
1335
+ return this._pendingWarnings.length === i && this._warn(t instanceof Error ? t.message : String(t), e), new Ke(e.appPrefix, [new B(e.value)]);
1324
1336
  }
1325
1337
  }
1326
1338
  }
@@ -1338,7 +1350,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1338
1350
  this.t.peek().type === "ENCODING_INDICATOR" && (r = this.t.consume(), n = this._resolveEncodingWidth(r.value, r));
1339
1351
  let i = this.extByPrefix.get(e.appPrefix);
1340
1352
  if (!i) {
1341
- if (this._hintMissingExtension(e.appPrefix, e), this.unresolvedExtension === "cpa999") return new Ge(e.appPrefix, t);
1353
+ if (this._hintMissingExtension(e.appPrefix, e), this.unresolvedExtension === "cpa999") return new Ke(e.appPrefix, t);
1342
1354
  this._fail(`unknown app-string extension: ${JSON.stringify(e.appPrefix)}`, e);
1343
1355
  }
1344
1356
  i.parseAppSequence || this._fail(`app-string extension ${JSON.stringify(e.appPrefix)} does not support <<...>> form`, e);
@@ -1348,60 +1360,60 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1348
1360
  let a = i.parseAppSequence(e.appPrefix, t, this._extOnError(e));
1349
1361
  n !== void 0 && this._applyEiToResult(a, n, r ?? e);
1350
1362
  let o = this.t.source.slice(e.offset, this.t.lastEndOffset);
1351
- if (a instanceof j) a.ednSource === void 0 && (a.ednSource = o);
1352
- else if (i.preserveAppSeqSource) return new Ke(a, o);
1363
+ if (a instanceof A) a.ednSource === void 0 && (a.ednSource = o);
1364
+ else if (i.preserveAppSeqSource) return new qe(a, o);
1353
1365
  return a;
1354
1366
  } catch (n) {
1355
1367
  if (this._options.strict !== !1) throw n;
1356
- return this._pendingWarnings.length === a && this._warn(n instanceof Error ? n.message : String(n), e), new Ge(e.appPrefix, t);
1368
+ return this._pendingWarnings.length === a && this._warn(n instanceof Error ? n.message : String(n), e), new Ke(e.appPrefix, t);
1357
1369
  }
1358
1370
  }
1359
1371
  }
1360
1372
  case "ELLIPSIS": {
1361
- if (this.t.consume(), this.t.peek().type !== "PLUS") return new z();
1362
- let e = [new z()];
1373
+ if (this.t.consume(), this.t.peek().type !== "PLUS") return new R();
1374
+ let e = [new R()];
1363
1375
  for (; this.t.peek().type === "PLUS";) this.t.consume(), e.push(this.parseValue());
1364
- return new z(e);
1376
+ return new R(e);
1365
1377
  }
1366
1378
  case "BYTES_HEX_ELIDED": return this.t.consume(), this._parseHexElidedConcat(e);
1367
1379
  default: this._fail(`unexpected token: ${JSON.stringify(e.value)}`, e);
1368
1380
  }
1369
1381
  }
1370
1382
  parseIntegerOrTag() {
1371
- let e = this.t.consume(), { numStr: t, rawSuffix: n } = ot(e.value), r = n === void 0 ? this.consumeEncodingIndicator() : this._resolveEncodingWidth(n, e), i = st(t);
1372
- if (i > 18446744073709551615n) return this.t.peek().type === "LPAREN" && this._fail("tag number exceeds maximum uint64", e), new et(i);
1373
- if (i < -18446744073709551616n) return new tt(i);
1383
+ let e = this.t.consume(), { numStr: t, rawSuffix: n } = st(e.value), r = n === void 0 ? this.consumeEncodingIndicator() : this._resolveEncodingWidth(n, e), i = ct(t);
1384
+ if (i > 18446744073709551615n) return this.t.peek().type === "LPAREN" && this._fail("tag number exceeds maximum uint64", e), new tt(i);
1385
+ if (i < -18446744073709551616n) return new nt(i);
1374
1386
  if (r !== void 0) {
1375
1387
  let t = i >= 0n ? i : -(i + 1n);
1376
1388
  r = this._validateEncodingFit(t, r, e);
1377
1389
  }
1378
- let a = i >= 0n ? new k(i, r === void 0 ? void 0 : { encodingWidth: r }) : new A(i, r === void 0 ? void 0 : { encodingWidth: r });
1390
+ let a = i >= 0n ? new O(i, r === void 0 ? void 0 : { encodingWidth: r }) : new k(i, r === void 0 ? void 0 : { encodingWidth: r });
1379
1391
  if (this.t.peek().type === "LPAREN") {
1380
- a instanceof k || this._fail("tag number must be non-negative", e), this.t.consume();
1392
+ a instanceof O || this._fail("tag number must be non-negative", e), this.t.consume();
1381
1393
  let t = this._pendingWarnings.splice(0), n = this.parseValue();
1382
1394
  this.expect("RPAREN");
1383
1395
  let i = a.value, o = this.extByTag.get(i);
1384
1396
  if (o?.parseTag) {
1385
1397
  let e = o.parseTag(i, n);
1386
- if (e !== void 0) return e instanceof M && r !== void 0 && e.encodingWidth === void 0 && (e.encodingWidth = r), t.length > 0 && (e.warnings ??= [], e.warnings.push(...t)), e;
1398
+ if (e !== void 0) return e instanceof j && r !== void 0 && e.encodingWidth === void 0 && (e.encodingWidth = r), t.length > 0 && (e.warnings ??= [], e.warnings.push(...t)), e;
1387
1399
  }
1388
- let s = new M(i, n, r === void 0 ? void 0 : { encodingWidth: r });
1400
+ let s = new j(i, n, r === void 0 ? void 0 : { encodingWidth: r });
1389
1401
  return t.length > 0 && (s.warnings ??= [], s.warnings.push(...t)), s;
1390
1402
  }
1391
1403
  return a;
1392
1404
  }
1393
1405
  parseFloat() {
1394
- let e = this.t.consume(), t = (t) => this._warnOrFail(t, e), { value: n, precision: r } = ct(e.value, t);
1406
+ let e = this.t.consume(), t = (t) => this._warnOrFail(t, e), { value: n, precision: r } = lt(e.value, t);
1395
1407
  if (r === "half" || r === "single") {
1396
1408
  let e = r === "half" ? C(S(n)) : Math.fround(n);
1397
1409
  Object.is(n, e) || isNaN(n) && isNaN(e) || t(`${n} cannot be exactly represented as ${r === "half" ? "f16 (_1)" : "f32 (_2)"}; use _3 or remove the indicator`);
1398
1410
  }
1399
- return new j(n, r === void 0 ? void 0 : { precision: r });
1411
+ return new A(n, r === void 0 ? void 0 : { precision: r });
1400
1412
  }
1401
1413
  parseString() {
1402
1414
  let e = this.t.consume();
1403
1415
  if (this.t.peek().type !== "PLUS") {
1404
- let t = this.consumeEncodingIndicator(() => BigInt(nt.encode(e.value).length));
1416
+ let t = this.consumeEncodingIndicator(() => BigInt(rt.encode(e.value).length));
1405
1417
  return new B(e.value, t === void 0 ? void 0 : { encodingWidth: t });
1406
1418
  }
1407
1419
  let t = !1, n = [{ text: e.value }];
@@ -1411,15 +1423,15 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1411
1423
  e.type === "ELLIPSIS" ? (this.t.consume(), n.push({ ellipsis: !0 }), t = !0) : e.type === "TSTR" || e.type === "RAWSTRING" ? (this.t.consume(), n.push({ text: e.value })) : this._isBytesToken(e.type) ? (this.t.consume(), n.push({ text: this._decodeUtf8(this._decodeBytesToken(e), e) })) : this._fail(`expected string or byte string after +, got ${JSON.stringify(e.value)}`, e);
1412
1424
  }
1413
1425
  if (!t) {
1414
- let e = n.map((e) => "text" in e ? e.text : ""), t = e.join(""), r = this.consumeEncodingIndicator(() => BigInt(nt.encode(t).length));
1426
+ let e = n.map((e) => "text" in e ? e.text : ""), t = e.join(""), r = this.consumeEncodingIndicator(() => BigInt(rt.encode(t).length));
1415
1427
  return new B(t, {
1416
1428
  ednParts: e,
1417
1429
  ...r === void 0 ? {} : { encodingWidth: r }
1418
1430
  });
1419
1431
  }
1420
1432
  let r = [], i = "";
1421
- for (let e of n) "ellipsis" in e ? (i !== "" && (r.push(new B(i)), i = ""), r.push(new z())) : i += e.text;
1422
- return i !== "" && r.push(new B(i)), new z(r);
1433
+ for (let e of n) "ellipsis" in e ? (i !== "" && (r.push(new B(i)), i = ""), r.push(new R())) : i += e.text;
1434
+ return i !== "" && r.push(new B(i)), new R(r);
1423
1435
  }
1424
1436
  _isBytesToken(e) {
1425
1437
  return e === "BYTES_HEX" || e === "SQSTR" || e === "BYTES_B64";
@@ -1441,7 +1453,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1441
1453
  }
1442
1454
  case "BYTES_HEX": return this._hexToBytes(e.value, e);
1443
1455
  case "BYTES_B64": try {
1444
- return lt(e.value, t);
1456
+ return ut(e.value, t);
1445
1457
  } catch (t) {
1446
1458
  if (t instanceof r || !(t instanceof SyntaxError)) throw t;
1447
1459
  this._fail(t.message, e);
@@ -1450,11 +1462,11 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1450
1462
  }
1451
1463
  }
1452
1464
  _decodeUtf8(e, t) {
1453
- if (this._options.allowInvalidUtf8) return it.decode(e);
1465
+ if (this._options.allowInvalidUtf8) return at.decode(e);
1454
1466
  try {
1455
- return rt.decode(e);
1467
+ return it.decode(e);
1456
1468
  } catch {
1457
- return this._warnOrFail("byte string in text concatenation is not valid UTF-8", t), it.decode(e);
1469
+ return this._warnOrFail("byte string in text concatenation is not valid UTF-8", t), at.decode(e);
1458
1470
  }
1459
1471
  }
1460
1472
  _tokenTypeToCdnEncoding(e) {
@@ -1463,7 +1475,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1463
1475
  _parseBytesConcat(e, t, n) {
1464
1476
  if (this.t.peek().type !== "PLUS") {
1465
1477
  let r = this.consumeEncodingIndicator(() => BigInt(e.length));
1466
- return new N(e, {
1478
+ return new M(e, {
1467
1479
  ednEncoding: this._tokenTypeToCdnEncoding(t),
1468
1480
  ednSource: n,
1469
1481
  ...r === void 0 ? {} : { encodingWidth: r }
@@ -1480,32 +1492,32 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1480
1492
  else if (e.type === "BYTES_HEX_ELIDED") {
1481
1493
  this.t.consume();
1482
1494
  let t = this._buildBytesElidedItems(e.value, e);
1483
- for (let e of t) e instanceof z ? (i.push({ ellipsis: !0 }), r = !0) : e instanceof N && i.push({ bytes: e.value });
1495
+ for (let e of t) e instanceof R ? (i.push({ ellipsis: !0 }), r = !0) : e instanceof M && i.push({ bytes: e.value });
1484
1496
  } else this._isBytesToken(e.type) ? (this.t.consume(), i.push({
1485
1497
  bytes: this._decodeBytesToken(e),
1486
1498
  source: e.raw
1487
- })) : e.type === "TSTR" || e.type === "RAWSTRING" ? (this.t.consume(), this._warnOrFail("text string in a byte-string concatenation is not allowed; use a byte string literal (h'...', b64'...', or '...') instead", e), i.push({ bytes: nt.encode(e.value) })) : this._fail(`expected byte string after +, got ${JSON.stringify(e.value)}`, e);
1499
+ })) : e.type === "TSTR" || e.type === "RAWSTRING" ? (this.t.consume(), this._warnOrFail("text string in a byte-string concatenation is not allowed; use a byte string literal (h'...', b64'...', or '...') instead", e), i.push({ bytes: rt.encode(e.value) })) : this._fail(`expected byte string after +, got ${JSON.stringify(e.value)}`, e);
1488
1500
  }
1489
1501
  if (!r) {
1490
1502
  let e = i.map((e) => "bytes" in e ? e : { bytes: /* @__PURE__ */ new Uint8Array() }), n = this._concatBytes(e.map((e) => e.bytes)), r = this.consumeEncodingIndicator(() => BigInt(n.length));
1491
- return new N(n, {
1503
+ return new M(n, {
1492
1504
  ednEncoding: this._tokenTypeToCdnEncoding(t),
1493
1505
  ednParts: e,
1494
1506
  ...r === void 0 ? {} : { encodingWidth: r }
1495
1507
  });
1496
1508
  }
1497
1509
  let a = [], o = [], s = () => {
1498
- o.length > 0 && (a.push(new N(this._concatBytes([...o]))), o.length = 0);
1510
+ o.length > 0 && (a.push(new M(this._concatBytes([...o]))), o.length = 0);
1499
1511
  };
1500
- for (let e of i) "ellipsis" in e ? (s(), a.push(new z())) : o.push(e.bytes);
1501
- return s(), new z(a);
1512
+ for (let e of i) "ellipsis" in e ? (s(), a.push(new R())) : o.push(e.bytes);
1513
+ return s(), new R(a);
1502
1514
  }
1503
1515
  _parseHexElidedConcat(e) {
1504
1516
  let t = this._buildBytesElidedItems(e.value, e);
1505
1517
  for (; this.t.peek().type === "PLUS";) {
1506
1518
  this.t.consume();
1507
1519
  let e = this.t.peek();
1508
- if (e.type === "ELLIPSIS") this.t.consume(), t.push(new z());
1520
+ if (e.type === "ELLIPSIS") this.t.consume(), t.push(new R());
1509
1521
  else if (e.type === "BYTES_HEX_ELIDED") {
1510
1522
  this.t.consume();
1511
1523
  let n = this._buildBytesElidedItems(e.value, e);
@@ -1513,20 +1525,20 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1513
1525
  } else if (this._isBytesToken(e.type)) {
1514
1526
  this.t.consume();
1515
1527
  let n = this._decodeBytesToken(e), r = t[t.length - 1];
1516
- r instanceof N ? t[t.length - 1] = new N(this._concatBytes([r.value, n])) : t.push(new N(n));
1528
+ r instanceof M ? t[t.length - 1] = new M(this._concatBytes([r.value, n])) : t.push(new M(n));
1517
1529
  } else this._fail(`expected byte string after +, got ${JSON.stringify(e.value)}`, e);
1518
1530
  }
1519
- return new z(t);
1531
+ return new R(t);
1520
1532
  }
1521
1533
  _buildBytesElidedItems(e, t) {
1522
1534
  let n = e.split("..."), r = [];
1523
- for (let e = 0; e < n.length; e++) e > 0 && r.push(new z()), n[e].length > 0 && r.push(new N(this._hexToBytes(n[e], t)));
1535
+ for (let e = 0; e < n.length; e++) e > 0 && r.push(new R()), n[e].length > 0 && r.push(new M(this._hexToBytes(n[e], t)));
1524
1536
  return r;
1525
1537
  }
1526
1538
  _mergeFirstBytesItem(e, t) {
1527
1539
  if (t.length === 0) return;
1528
1540
  let n = e[e.length - 1], r = t[0];
1529
- n instanceof N && r instanceof N ? (e[e.length - 1] = new N(this._concatBytes([n.value, r.value])), e.push(...t.slice(1))) : e.push(...t);
1541
+ n instanceof M && r instanceof M ? (e[e.length - 1] = new M(this._concatBytes([n.value, r.value])), e.push(...t.slice(1))) : e.push(...t);
1530
1542
  }
1531
1543
  _concatBytes(e) {
1532
1544
  let t = e.reduce((e, t) => e + t.byteLength, 0), n = new Uint8Array(t), r = 0;
@@ -1537,8 +1549,8 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1537
1549
  this.t.consume(), this.expect("LPAREN");
1538
1550
  let e = this.t.peek();
1539
1551
  e.type !== "INTEGER" && this._fail(`expected integer inside simple(), got ${JSON.stringify(e.value)}`, e), this.t.consume();
1540
- let { numStr: t } = ot(e.value), n = Number(st(t));
1541
- return this.expect("RPAREN"), new R(n);
1552
+ let { numStr: t } = st(e.value), n = Number(ct(t));
1553
+ return this.expect("RPAREN"), new L(n);
1542
1554
  }
1543
1555
  parseEmbeddedCBOR() {
1544
1556
  this.t.consume();
@@ -1555,7 +1567,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1555
1567
  let e = this.t.consume();
1556
1568
  t = this._resolveEncodingWidth(e.value, e);
1557
1569
  }
1558
- return new Ue(e, { encodingWidth: t });
1570
+ return new We(e, { encodingWidth: t });
1559
1571
  }
1560
1572
  parseArray() {
1561
1573
  this.t.consume();
@@ -1569,7 +1581,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1569
1581
  i.push(this.parseValue());
1570
1582
  }
1571
1583
  this.expect("RBRACKET"), t !== void 0 && n !== void 0 && (t = this._validateEncodingFit(BigInt(i.length), t, n));
1572
- let a = new I(i, {
1584
+ let a = new F(i, {
1573
1585
  indefiniteLength: e,
1574
1586
  encodingWidth: t
1575
1587
  });
@@ -1590,7 +1602,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1590
1602
  i.push([e, t]);
1591
1603
  }
1592
1604
  this.expect("RBRACE"), t !== void 0 && n !== void 0 && (t = this._validateEncodingFit(BigInt(i.length), t, n));
1593
- let a = new L(i, {
1605
+ let a = new I(i, {
1594
1606
  indefiniteLength: e,
1595
1607
  encodingWidth: t
1596
1608
  });
@@ -1614,15 +1626,15 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1614
1626
  }
1615
1627
  this.expect("RPAREN"), n.length === 0 && this._fail("empty indefinite group (_ ) is ambiguous; use ''_ for bytes or \"\"_ for text");
1616
1628
  let r = n[0];
1617
- if (r instanceof N) {
1618
- let e = new P(n.map((e, t) => {
1619
- if (e instanceof N) return e;
1629
+ if (r instanceof M) {
1630
+ let e = new N(n.map((e, t) => {
1631
+ if (e instanceof M) return e;
1620
1632
  this._fail(`indefinite byte string chunk ${t} must be a byte string, not a text string`);
1621
1633
  }));
1622
1634
  return t.length > 0 && (e.warnings = t), e;
1623
1635
  }
1624
1636
  if (r instanceof B) {
1625
- let e = new F(n.map((e, t) => {
1637
+ let e = new P(n.map((e, t) => {
1626
1638
  if (e instanceof B) return e;
1627
1639
  this._fail(`indefinite text string chunk ${t} must be a text string, not a byte string`);
1628
1640
  }));
@@ -1641,7 +1653,7 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1641
1653
  return t.type !== e && this._fail(`expected ${e}, got ${t.type} (${JSON.stringify(t.value)})`, t), t;
1642
1654
  }
1643
1655
  _applyEiToResult(e, t, n) {
1644
- if (e instanceof j) {
1656
+ if (e instanceof A) {
1645
1657
  let r = t === 1 ? "half" : t === 2 ? "single" : t === 3 ? "double" : void 0;
1646
1658
  if (r === void 0) this._warnOrFail(`encoding indicator _${t} is not valid for a float; use _1, _2, or _3`, n);
1647
1659
  else if (e.precision !== r) {
@@ -1651,37 +1663,37 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1651
1663
  }
1652
1664
  e.precision = r;
1653
1665
  }
1654
- } else if (e instanceof k) {
1666
+ } else if (e instanceof O) {
1655
1667
  if (e.encodingWidth === void 0) {
1656
1668
  let r = this._validateEncodingFit(e.value, t, n);
1657
1669
  r !== void 0 && (e.encodingWidth = r);
1658
1670
  }
1659
- } else if (e instanceof A) {
1671
+ } else if (e instanceof k) {
1660
1672
  if (e.encodingWidth === void 0) {
1661
1673
  let r = this._validateEncodingFit(e.argument, t, n);
1662
1674
  r !== void 0 && (e.encodingWidth = r);
1663
1675
  }
1664
- } else if (e instanceof N) {
1676
+ } else if (e instanceof M) {
1665
1677
  if (e.encodingWidth === void 0) {
1666
1678
  let r = this._validateEncodingFit(BigInt(e.value.length), t, n);
1667
1679
  r !== void 0 && (e.encodingWidth = r);
1668
1680
  }
1669
1681
  } else if (e instanceof B) {
1670
1682
  if (e.encodingWidth === void 0) {
1671
- let r = this._validateEncodingFit(BigInt(nt.encode(e.value).length), t, n);
1683
+ let r = this._validateEncodingFit(BigInt(rt.encode(e.value).length), t, n);
1672
1684
  r !== void 0 && (e.encodingWidth = r);
1673
1685
  }
1674
- } else if (e instanceof I) {
1686
+ } else if (e instanceof F) {
1675
1687
  if (e.encodingWidth === void 0) {
1676
1688
  let r = this._validateEncodingFit(BigInt(e.items.length), t, n);
1677
1689
  r !== void 0 && (e.encodingWidth = r);
1678
1690
  }
1679
- } else if (e instanceof L) {
1691
+ } else if (e instanceof I) {
1680
1692
  if (e.encodingWidth === void 0) {
1681
1693
  let r = this._validateEncodingFit(BigInt(e.entries.length), t, n);
1682
1694
  r !== void 0 && (e.encodingWidth = r);
1683
1695
  }
1684
- } else if (e instanceof M) {
1696
+ } else if (e instanceof j) {
1685
1697
  if (e.encodingWidth === void 0) {
1686
1698
  let r = this._validateEncodingFit(e.tag, t, n);
1687
1699
  r !== void 0 && (e.encodingWidth = r);
@@ -1713,28 +1725,28 @@ var mt = (e) => `import { ${e} } from '@cbortech/cbor' and pass it via the 'exte
1713
1725
  this._warn(e, t), this._options.strict !== !1 && this._fail(e, t);
1714
1726
  }
1715
1727
  _hintMissingExtension(e, t) {
1716
- let n = gt.get(e);
1728
+ let n = _t.get(e);
1717
1729
  if (n === void 0 || this._hintedPrefixes.has(e)) return;
1718
1730
  this._hintedPrefixes.add(e);
1719
1731
  let r = `app-string prefix '${e}' requires an extension that is not enabled; ${n}`;
1720
1732
  this._options.onWarning ? this._options.onWarning({
1721
1733
  message: r,
1722
- ...vt(t)
1734
+ ...yt(t)
1723
1735
  }) : this._options.silent || console.warn(`CDN: ${r}`);
1724
1736
  }
1725
1737
  _warn(e, t) {
1726
1738
  let n = { message: e };
1727
- if (t !== void 0 && Object.assign(n, vt(t)), this._pendingWarnings.push(n), this._options.onWarning) this._options.onWarning(n);
1739
+ if (t !== void 0 && Object.assign(n, yt(t)), this._pendingWarnings.push(n), this._options.onWarning) this._options.onWarning(n);
1728
1740
  else if (!this._options.silent) {
1729
1741
  let n = t ? ` at line ${t.line}, column ${t.col}` : "";
1730
1742
  console.warn(`CDN strict violation${n}: ${e}`);
1731
1743
  }
1732
1744
  }
1733
1745
  _fail(e, t) {
1734
- throw new r(e, t ? vt(t) : void 0);
1746
+ throw new r(e, t ? yt(t) : void 0);
1735
1747
  }
1736
1748
  };
1737
- function vt(e) {
1749
+ function yt(e) {
1738
1750
  return {
1739
1751
  offset: e.offset,
1740
1752
  line: e.line,
@@ -1744,7 +1756,7 @@ function vt(e) {
1744
1756
  }
1745
1757
  //#endregion
1746
1758
  //#region src/ast/CborTextString.ts
1747
- var yt = new TextEncoder(), bt = !1, B = class extends O {
1759
+ var bt = new TextEncoder(), xt = !1, B = class extends D {
1748
1760
  indefiniteLength = !1;
1749
1761
  value;
1750
1762
  encodingWidth;
@@ -1756,43 +1768,43 @@ var yt = new TextEncoder(), bt = !1, B = class extends O {
1756
1768
  e.writeTextString(3, this.value, this.encodingWidth);
1757
1769
  }
1758
1770
  _toCDN(e, t) {
1759
- let n = x(e, this.encodingWidth, () => b(BigInt(yt.encode(this.value).length)));
1760
- return xt(this.value, n, e, t, this.ednParts);
1771
+ let n = x(e, this.encodingWidth, () => b(BigInt(bt.encode(this.value).length)));
1772
+ return St(this.value, n, e, t, this.ednParts);
1761
1773
  }
1762
1774
  _toJS(e) {
1763
1775
  return this.value;
1764
1776
  }
1765
1777
  };
1766
- function xt(e, t, n, r, i) {
1767
- let { cdn: a, newline: o } = Ct(n), s = ee(n), c = n?.preserveConcatenation && i !== void 0 && i.length > 1 ? i : void 0;
1768
- if (s === null) return c === void 0 ? Se(e) + t : St(c.map((e) => ({
1778
+ function St(e, t, n, r, i) {
1779
+ let { cdn: a, newline: o } = wt(n), s = ee(n), c = n?.preserveConcatenation && i !== void 0 && i.length > 1 ? i : void 0;
1780
+ if (s === null) return c === void 0 ? Se(e) + t : Ct(c.map((e) => ({
1769
1781
  text: e,
1770
1782
  contentDepth: 0
1771
1783
  })), t, null, r);
1772
1784
  if (!a && !o && c === void 0) return Se(e) + t;
1773
- let l = a ? Et(e) : null;
1785
+ let l = a ? Dt(e) : null;
1774
1786
  if (l === null && c !== void 0) {
1775
1787
  let e = [];
1776
1788
  for (let t of c) if (o) {
1777
1789
  let n = /* @__PURE__ */ new Map();
1778
- for (let { point: e, contentDepth: r } of Tt(t, 0)) n.set(e, r);
1779
- e.push(...Pt(t, n));
1790
+ for (let { point: e, contentDepth: r } of Et(t, 0)) n.set(e, r);
1791
+ e.push(...Ft(t, n));
1780
1792
  } else e.push({
1781
1793
  text: t,
1782
1794
  contentDepth: 0
1783
1795
  });
1784
- return St(e, t, s, r);
1796
+ return Ct(e, t, s, r);
1785
1797
  }
1786
1798
  let u = /* @__PURE__ */ new Map();
1787
1799
  if (l !== null) for (let { point: e, contentDepth: t } of l) u.set(e, t);
1788
1800
  if (o) {
1789
- let t = l === null ? Tt(e, 0) : Dt(e);
1801
+ let t = l === null ? Et(e, 0) : Ot(e);
1790
1802
  for (let { point: e, contentDepth: n } of t) u.has(e) || u.set(e, n);
1791
1803
  }
1792
- let d = Pt(e, u);
1793
- return d.length <= 1 ? Se(e) + t : St(d, t, s, r);
1804
+ let d = Ft(e, u);
1805
+ return d.length <= 1 ? Se(e) + t : Ct(d, t, s, r);
1794
1806
  }
1795
- function St(e, t, n, r) {
1807
+ function Ct(e, t, n, r) {
1796
1808
  let i = e.map(({ text: n }, r) => {
1797
1809
  let i = Se(n);
1798
1810
  return r === e.length - 1 ? i + t : i;
@@ -1805,17 +1817,17 @@ function St(e, t, n, r) {
1805
1817
  }
1806
1818
  return a;
1807
1819
  }
1808
- function Ct(e) {
1809
- let t = e?.splitCdn === void 0 || e?.splitNewline === void 0 ? wt(e?.textStringFormat ?? []) : [];
1820
+ function wt(e) {
1821
+ let t = e?.splitCdn === void 0 || e?.splitNewline === void 0 ? Tt(e?.textStringFormat ?? []) : [];
1810
1822
  return {
1811
1823
  cdn: e?.splitCdn ?? t.includes("cdn"),
1812
1824
  newline: e?.splitNewline ?? t.includes("newline")
1813
1825
  };
1814
1826
  }
1815
- function wt(e) {
1816
- return e.map((e) => e === "cboredn" ? (bt || (bt = !0, console.warn("`textStringFormat: ['cboredn']` is deprecated; use `textStringFormat: ['cdn']` instead.")), "cdn") : e);
1827
+ function Tt(e) {
1828
+ return e.map((e) => e === "cboredn" ? (xt || (xt = !0, console.warn("`textStringFormat: ['cboredn']` is deprecated; use `textStringFormat: ['cdn']` instead.")), "cdn") : e);
1817
1829
  }
1818
- function Tt(e, t) {
1830
+ function Et(e, t) {
1819
1831
  let n = [];
1820
1832
  for (let r = 0; r < e.length; r++) {
1821
1833
  let i = e[r];
@@ -1832,9 +1844,9 @@ function Tt(e, t) {
1832
1844
  }
1833
1845
  return n;
1834
1846
  }
1835
- function Et(e) {
1847
+ function Dt(e) {
1836
1848
  try {
1837
- at(e);
1849
+ ot(e);
1838
1850
  } catch {
1839
1851
  return null;
1840
1852
  }
@@ -1843,24 +1855,24 @@ function Et(e) {
1843
1855
  let a = n.consume();
1844
1856
  if (a.type === "EOF") break;
1845
1857
  let c = !1;
1846
- if (o || (o = !0, a.offset > 0 && Mt(n.comments, 0, a.offset) && t.push({
1858
+ if (o || (o = !0, a.offset > 0 && Nt(n.comments, 0, a.offset) && t.push({
1847
1859
  point: a.offset,
1848
1860
  contentDepth: r
1849
1861
  })), i !== null) {
1850
- if (i.kind === "opener" && kt.has(a.type)) {
1862
+ if (i.kind === "opener" && At.has(a.type)) {
1851
1863
  i.point = a.endOffset, s = a.endOffset;
1852
1864
  continue;
1853
- } else i.kind === "opener" && jt.has(a.type) && Nt(e, i.point, a.offset) ? c = !0 : t.push({
1865
+ } else i.kind === "opener" && Mt.has(a.type) && Pt(e, i.point, a.offset) ? c = !0 : t.push({
1854
1866
  point: a.offset,
1855
1867
  contentDepth: i.contentDepth
1856
1868
  });
1857
1869
  i = null;
1858
1870
  }
1859
- At.has(a.type) ? (r++, i = {
1871
+ jt.has(a.type) ? (r++, i = {
1860
1872
  point: a.endOffset,
1861
1873
  contentDepth: r,
1862
1874
  kind: "opener"
1863
- }) : jt.has(a.type) ? (r = Math.max(0, r - 1), c || t.push({
1875
+ }) : Mt.has(a.type) ? (r = Math.max(0, r - 1), c || t.push({
1864
1876
  point: a.offset,
1865
1877
  contentDepth: r
1866
1878
  })) : a.type === "COMMA" && (i = {
@@ -1875,23 +1887,23 @@ function Et(e) {
1875
1887
  contentDepth: r
1876
1888
  }), t;
1877
1889
  }
1878
- function Dt(e) {
1890
+ function Ot(e) {
1879
1891
  let t = [], n = new a(e), r = 0;
1880
1892
  for (;;) {
1881
1893
  let i = n.consume();
1882
1894
  if (i.type === "EOF") break;
1883
- if (At.has(i.type)) r++;
1884
- else if (jt.has(i.type)) r = Math.max(0, r - 1);
1895
+ if (jt.has(i.type)) r++;
1896
+ else if (Mt.has(i.type)) r = Math.max(0, r - 1);
1885
1897
  else if (i.type !== "COMMA") {
1886
1898
  if (i.type === "TSTR") {
1887
1899
  let n = e.slice(i.offset, i.endOffset);
1888
- for (let e of Ot(n)) t.push({
1900
+ for (let e of kt(n)) t.push({
1889
1901
  point: i.offset + e,
1890
1902
  contentDepth: r + 1
1891
1903
  });
1892
1904
  } else if (i.type === "RAWSTRING") {
1893
1905
  let n = e.slice(i.offset, i.endOffset);
1894
- for (let { point: e } of Tt(n, 0)) t.push({
1906
+ for (let { point: e } of Et(n, 0)) t.push({
1895
1907
  point: i.offset + e,
1896
1908
  contentDepth: r + 1
1897
1909
  });
@@ -1900,7 +1912,7 @@ function Dt(e) {
1900
1912
  }
1901
1913
  return t;
1902
1914
  }
1903
- function Ot(e) {
1915
+ function kt(e) {
1904
1916
  let t = [], n = 1, r = e.length - 1;
1905
1917
  for (; n < r;) {
1906
1918
  let r = e[n];
@@ -1916,24 +1928,24 @@ function Ot(e) {
1916
1928
  }
1917
1929
  return t;
1918
1930
  }
1919
- var kt = /* @__PURE__ */ new Set(["ENCODING_INDICATOR", "UNDERSCORE"]), At = /* @__PURE__ */ new Set([
1931
+ var At = /* @__PURE__ */ new Set(["ENCODING_INDICATOR", "UNDERSCORE"]), jt = /* @__PURE__ */ new Set([
1920
1932
  "LBRACKET",
1921
1933
  "LBRACE",
1922
1934
  "LPAREN",
1923
1935
  "LT_LT"
1924
- ]), jt = /* @__PURE__ */ new Set([
1936
+ ]), Mt = /* @__PURE__ */ new Set([
1925
1937
  "RBRACKET",
1926
1938
  "RBRACE",
1927
1939
  "RPAREN",
1928
1940
  "GT_GT"
1929
1941
  ]);
1930
- function Mt(e, t, n) {
1942
+ function Nt(e, t, n) {
1931
1943
  return e.some((e) => e.start >= t && e.end <= n);
1932
1944
  }
1933
- function Nt(e, t, n) {
1945
+ function Pt(e, t, n) {
1934
1946
  return /^[\t\n\r ]*$/.test(e.slice(t, n));
1935
1947
  }
1936
- function Pt(e, t) {
1948
+ function Ft(e, t) {
1937
1949
  let n = [...t].filter(([t]) => t > 0 && t < e.length).sort(([e], [t]) => e - t);
1938
1950
  if (n.length === 0) return [{
1939
1951
  text: e,
@@ -1959,17 +1971,17 @@ function V(e) {
1959
1971
  for (; s.length < 3;) s += "0";
1960
1972
  return `${i}.${s}Z`;
1961
1973
  }
1962
- var Ft = new TextDecoder("utf-8", { fatal: !0 });
1963
- function It(e) {
1974
+ var It = new TextDecoder("utf-8", { fatal: !0 });
1975
+ function Lt(e) {
1964
1976
  if (e.length !== 1) throw SyntaxError("dt<<...>>: expected exactly one item");
1965
1977
  let t = e[0];
1966
1978
  if (t instanceof B) return t.value;
1967
- if (t instanceof N) return Ft.decode(t.value);
1979
+ if (t instanceof M) return It.decode(t.value);
1968
1980
  throw SyntaxError("dt<<...>>: expected a text string or byte string");
1969
1981
  }
1970
- var Lt = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/i;
1971
- function Rt(e, t) {
1972
- if (!Lt.test(e)) {
1982
+ var Rt = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/i;
1983
+ function zt(e, t) {
1984
+ if (!Rt.test(e)) {
1973
1985
  let n = `dt: invalid RFC 3339 date-time: ${JSON.stringify(e)}`;
1974
1986
  if (t) t(n);
1975
1987
  else throw SyntaxError(n);
@@ -1980,11 +1992,11 @@ function Rt(e, t) {
1980
1992
  if (isNaN(a)) throw SyntaxError(`dt: invalid RFC 3339 date-time: ${JSON.stringify(e)}`);
1981
1993
  if (i === void 0) {
1982
1994
  let e = a / 1e3;
1983
- return e >= 0 ? new Bt(BigInt(e)) : new Vt(BigInt(e));
1995
+ return e >= 0 ? new Vt(BigInt(e)) : new Ht(BigInt(e));
1984
1996
  }
1985
- return new Ht(a / 1e3 + i);
1997
+ return new Ut(a / 1e3 + i);
1986
1998
  }
1987
- var zt = 1n, Bt = class extends k {
1999
+ var Bt = 1n, Vt = class extends O {
1988
2000
  constructor(e, t) {
1989
2001
  super(e, t);
1990
2002
  }
@@ -1993,7 +2005,7 @@ var zt = 1n, Bt = class extends k {
1993
2005
  let n = x(e, this.encodingWidth, () => b(this.value));
1994
2006
  return `dt'${V(Number(this.value))}'${n}`;
1995
2007
  }
1996
- }, Vt = class extends A {
2008
+ }, Ht = class extends k {
1997
2009
  constructor(e, t) {
1998
2010
  super(e, t);
1999
2011
  }
@@ -2002,71 +2014,71 @@ var zt = 1n, Bt = class extends k {
2002
2014
  let n = x(e, this.encodingWidth, () => b(this.argument));
2003
2015
  return `dt'${V(Number(this.value))}'${n}`;
2004
2016
  }
2005
- }, Ht = class extends j {
2017
+ }, Ut = class extends A {
2006
2018
  constructor(e, t) {
2007
2019
  super(e, t);
2008
2020
  }
2009
2021
  _toCDN(e, t) {
2010
2022
  if (e?.appStrings === !1) return super._toCDN(e, t);
2011
- let n = D(this.value), r = we(this.value, this.precision, n, e?.encodingIndicators ?? "auto");
2023
+ let n = ze(this.value), r = we(this.value, this.precision, n, e?.encodingIndicators ?? "auto");
2012
2024
  return `dt'${V(this.value)}'${r}`;
2013
2025
  }
2014
- }, Ut = class extends M {
2026
+ }, Wt = class extends j {
2015
2027
  constructor(e, t) {
2016
- super(zt, typeof e == "string" ? Rt(e) : e, t);
2028
+ super(Bt, typeof e == "string" ? zt(e) : e, t);
2017
2029
  }
2018
2030
  _toCDN(e, t) {
2019
2031
  if (e?.appStrings === !1) return super._toCDN(e, t);
2020
2032
  let n = this.content;
2021
- if (n instanceof j ? n.precision !== void 0 && n.precision !== D(n.value) : n.encodingWidth !== void 0) return super._toCDN({
2033
+ if (n instanceof A ? n.precision !== void 0 && n.precision !== ze(n.value) : n.encodingWidth !== void 0) return super._toCDN({
2022
2034
  ...e,
2023
2035
  appStrings: !1
2024
2036
  }, t);
2025
- let r = n instanceof j ? n.value : Number(n.value), i = x(e, this.encodingWidth, () => b(zt));
2037
+ let r = n instanceof A ? n.value : Number(n.value), i = x(e, this.encodingWidth, () => b(Bt));
2026
2038
  return `DT'${V(r)}'${i}`;
2027
2039
  }
2028
- }, Wt = class extends Ut {
2040
+ }, Gt = class extends Wt {
2029
2041
  constructor(e, t) {
2030
2042
  super(e, t);
2031
2043
  }
2032
2044
  _toJS(e) {
2033
- let t = this.content, n = t instanceof j ? t.value * 1e3 : Number(t.value) * 1e3;
2045
+ let t = this.content, n = t instanceof A ? t.value * 1e3 : Number(t.value) * 1e3;
2034
2046
  return new Date(n);
2035
2047
  }
2036
2048
  };
2037
- function Gt(e) {
2049
+ function Kt(e) {
2038
2050
  let t = e?.jsDate ?? !1;
2039
2051
  function n(e) {
2040
- return t ? new Wt(e) : new Ut(e);
2052
+ return t ? new Gt(e) : new Wt(e);
2041
2053
  }
2042
2054
  let r = {
2043
2055
  appStringPrefixes: ["dt", "DT"],
2044
- tagNumbers: [zt],
2056
+ tagNumbers: [Bt],
2045
2057
  parseAppString(e, t, r) {
2046
- return e === "DT" ? n(t) : Rt(t, r);
2058
+ return e === "DT" ? n(t) : zt(t, r);
2047
2059
  },
2048
2060
  parseAppSequence(e, t, r) {
2049
- let i = It(t);
2050
- return e === "DT" ? n(i) : Rt(i, r);
2061
+ let i = Lt(t);
2062
+ return e === "DT" ? n(i) : zt(i, r);
2051
2063
  },
2052
2064
  parseTag(e, n) {
2053
2065
  if (e !== 1n) return;
2054
2066
  let r;
2055
- if (n instanceof k) r = new Bt(n.value, { encodingWidth: n.encodingWidth });
2056
- else if (n instanceof A) r = new Vt(n.value, { encodingWidth: n.encodingWidth });
2057
- else if (n instanceof j) r = new Ht(n.value), n.precision !== void 0 && (r.precision = n.precision);
2067
+ if (n instanceof O) r = new Vt(n.value, { encodingWidth: n.encodingWidth });
2068
+ else if (n instanceof k) r = new Ht(n.value, { encodingWidth: n.encodingWidth });
2069
+ else if (n instanceof A) r = new Ut(n.value), n.precision !== void 0 && (r.precision = n.precision);
2058
2070
  else return;
2059
- return r.start = n.start, r.end = n.end, t ? new Wt(r) : new Ut(r);
2071
+ return r.start = n.start, r.end = n.end, t ? new Gt(r) : new Wt(r);
2060
2072
  }
2061
2073
  };
2062
2074
  return t && (r.fromJS = (e, t) => {
2063
- if (e instanceof Date) return new Wt(V(e.getTime() / 1e3));
2075
+ if (e instanceof Date) return new Gt(V(e.getTime() / 1e3));
2064
2076
  }, r.isJSType = (e) => e instanceof Date), r;
2065
2077
  }
2066
- var Kt = Gt(), qt = Gt({ jsDate: !0 });
2078
+ var qt = Kt(), Jt = Kt({ jsDate: !0 });
2067
2079
  //#endregion
2068
2080
  //#region src/utils/ip.ts
2069
- function Jt(e) {
2081
+ function Yt(e) {
2070
2082
  let t = e.split(".");
2071
2083
  if (t.length !== 4) throw SyntaxError(`ip: invalid IPv4 address: ${JSON.stringify(e)}`);
2072
2084
  let n = /* @__PURE__ */ new Uint8Array(4);
@@ -2079,11 +2091,11 @@ function Jt(e) {
2079
2091
  }
2080
2092
  return n;
2081
2093
  }
2082
- function Yt(e) {
2094
+ function Xt(e) {
2083
2095
  let t = /* @__PURE__ */ new Uint8Array(16);
2084
2096
  if (e === "::") return t;
2085
2097
  let n = e, r = null, i = e.match(/^(.*):(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/);
2086
- i && (n = i[1], n.endsWith(":") && (n += ":"), r = Jt(i[2]));
2098
+ i && (n = i[1], n.endsWith(":") && (n += ":"), r = Yt(i[2]));
2087
2099
  let a = n.split("::");
2088
2100
  if (a.length > 2) throw SyntaxError(`ip: invalid IPv6 address: ${JSON.stringify(e)}`);
2089
2101
  let o = a.length === 2, s = a[0] ? a[0].split(":") : [], c = o && a[1] ? a[1].split(":") : [], l = r ? 6 : 8;
@@ -2100,11 +2112,11 @@ function Yt(e) {
2100
2112
  }
2101
2113
  return r && t.set(r, 12), t;
2102
2114
  }
2103
- function Xt(e) {
2115
+ function Zt(e) {
2104
2116
  return Array.from(e).join(".");
2105
2117
  }
2106
- function Zt(e) {
2107
- let t = e.slice(0, 10).every((e) => e === 0) && e[10] === 255 && e[11] === 255 ? Xt(e.slice(12)) : null, n = t ? 6 : 8, r = [];
2118
+ function Qt(e) {
2119
+ let t = e.slice(0, 10).every((e) => e === 0) && e[10] === 255 && e[11] === 255 ? Zt(e.slice(12)) : null, n = t ? 6 : 8, r = [];
2108
2120
  for (let t = 0; t < n * 2; t += 2) r.push(e[t] << 8 | e[t + 1]);
2109
2121
  let i = -1, a = 0, o = 0;
2110
2122
  for (; o < n;) if (r[o] === 0) {
@@ -2118,29 +2130,29 @@ function Zt(e) {
2118
2130
  }
2119
2131
  //#endregion
2120
2132
  //#region src/extensions/ip.ts
2121
- var Qt = "ip", H = "IP", U = 52n, $t = 54n, en = new TextDecoder("utf-8", { fatal: !0 });
2122
- function tn(e) {
2133
+ var $t = "ip", H = "IP", U = 52n, en = 54n, tn = new TextDecoder("utf-8", { fatal: !0 });
2134
+ function nn(e) {
2123
2135
  if (e.length !== 1) throw SyntaxError("ip<<...>>: expected exactly one item");
2124
2136
  let t = e[0];
2125
2137
  if (t instanceof B) return t.value;
2126
- if (t instanceof N) return en.decode(t.value);
2138
+ if (t instanceof M) return tn.decode(t.value);
2127
2139
  throw SyntaxError("ip<<...>>: expected a text string or byte string");
2128
2140
  }
2129
- function nn(e) {
2141
+ function rn(e) {
2130
2142
  return /^\d/.test(e) && e.includes(".") && !e.includes(":") ? {
2131
- bytes: Jt(e),
2143
+ bytes: Yt(e),
2132
2144
  isV4: !0
2133
2145
  } : {
2134
- bytes: Yt(e),
2146
+ bytes: Xt(e),
2135
2147
  isV4: !1
2136
2148
  };
2137
2149
  }
2138
- function rn(e) {
2139
- if (e.length === 4) return Xt(e);
2140
- if (e.length === 16) return Zt(e);
2150
+ function an(e) {
2151
+ if (e.length === 4) return Zt(e);
2152
+ if (e.length === 16) return Qt(e);
2141
2153
  throw SyntaxError(`ip: unexpected byte length: ${e.length}`);
2142
2154
  }
2143
- function an(e, t) {
2155
+ function on(e, t) {
2144
2156
  let n = new Uint8Array(e.length);
2145
2157
  n.set(e);
2146
2158
  let r = Math.floor(t / 8), i = t % 8;
@@ -2150,86 +2162,72 @@ function an(e, t) {
2150
2162
  for (; a > 0 && n[a - 1] === 0;) a--;
2151
2163
  return n.slice(0, a);
2152
2164
  }
2153
- function on(e, t) {
2165
+ function sn(e, t) {
2154
2166
  let n = new Uint8Array(t);
2155
2167
  return n.set(e), n;
2156
2168
  }
2157
- var sn = class extends N {
2169
+ var cn = class extends M {
2158
2170
  _toCDN(e, t) {
2159
2171
  if (e?.appStrings === !1) return super._toCDN(e, t);
2160
2172
  let n = x(e, this.encodingWidth, () => b(BigInt(this.value.length)));
2161
- return `${Qt}'${rn(this.value)}'${n}`;
2173
+ return `${$t}'${an(this.value)}'${n}`;
2162
2174
  }
2163
- }, cn = class extends I {
2175
+ }, ln = class extends F {
2164
2176
  _isV4;
2165
2177
  constructor(e, t, n) {
2166
- super([new k(BigInt(e)), new N(t)]), this._isV4 = n;
2178
+ super([new O(BigInt(e)), new M(t)]), this._isV4 = n;
2167
2179
  }
2168
2180
  _toCDN(e, t) {
2169
2181
  if (e?.appStrings === !1) return super._toCDN(e, t);
2170
2182
  let n = Number(this.items[0].value), r = this.items[1].value;
2171
- return `${Qt}'${rn(on(r, this._isV4 ? 4 : 16))}/${n}'`;
2183
+ return `${$t}'${an(sn(r, this._isV4 ? 4 : 16))}/${n}'`;
2172
2184
  }
2173
- }, ln = class extends M {
2185
+ }, un = class extends j {
2174
2186
  constructor(e, t) {
2175
2187
  super(e, t);
2176
2188
  }
2177
2189
  _toCDN(e, t) {
2178
2190
  if (e?.appStrings === !1) return super._toCDN(e, t);
2179
2191
  let n = this.tag === U ? 4 : 16, r = this.content;
2180
- if (r instanceof N) {
2192
+ if (r instanceof M) {
2181
2193
  if (r.encodingWidth !== void 0) return super._toCDN(e, t);
2182
2194
  let n = x(e, this.encodingWidth, () => b(this.tag));
2183
- return `${H}'${rn(r.value)}'${n}`;
2195
+ return `${H}'${an(r.value)}'${n}`;
2184
2196
  }
2185
- if (r instanceof I && r.items.length === 2 && r.items[0] instanceof k && r.items[1] instanceof N) {
2197
+ if (r instanceof F && r.items.length === 2 && r.items[0] instanceof O && r.items[1] instanceof M) {
2186
2198
  if (r.encodingWidth !== void 0 || r.items[0].encodingWidth !== void 0 || r.items[1].encodingWidth !== void 0) return super._toCDN(e, t);
2187
- let i = Number(r.items[0].value), a = on(r.items[1].value, n), o = x(e, this.encodingWidth, () => b(this.tag));
2188
- return `${H}'${rn(a)}/${i}'${o}`;
2199
+ let i = Number(r.items[0].value), a = sn(r.items[1].value, n), o = x(e, this.encodingWidth, () => b(this.tag));
2200
+ return `${H}'${an(a)}/${i}'${o}`;
2189
2201
  }
2190
2202
  return super._toCDN(e, t);
2191
2203
  }
2192
2204
  };
2193
- function un(e, t) {
2205
+ function dn(e, t) {
2194
2206
  let n = t.indexOf("/");
2195
2207
  if (n === -1) {
2196
- let { bytes: n, isV4: r } = nn(t);
2197
- return e === H ? new ln(r ? U : $t, new N(n)) : new sn(n);
2208
+ let { bytes: n, isV4: r } = rn(t);
2209
+ return e === H ? new un(r ? U : en, new M(n)) : new cn(n);
2198
2210
  }
2199
2211
  let r = t.slice(0, n), i = t.slice(n + 1);
2200
2212
  if (!/^\d+$/.test(i)) throw SyntaxError(`ip: invalid prefix length: ${JSON.stringify(i)}`);
2201
- let a = parseInt(i, 10), { bytes: o, isV4: s } = nn(r), c = s ? 32 : 128;
2213
+ let a = parseInt(i, 10), { bytes: o, isV4: s } = rn(r), c = s ? 32 : 128;
2202
2214
  if (a > c) throw SyntaxError(`ip: prefix length ${a} exceeds maximum ${c} for ${s ? "IPv4" : "IPv6"}`);
2203
- let l = an(o, a);
2204
- return e === H ? new ln(s ? U : $t, new I([new k(BigInt(a)), new N(l)])) : new cn(a, l, s);
2215
+ let l = on(o, a);
2216
+ return e === H ? new un(s ? U : en, new F([new O(BigInt(a)), new M(l)])) : new ln(a, l, s);
2205
2217
  }
2206
- var dn = {
2207
- appStringPrefixes: [Qt, H],
2208
- tagNumbers: [U, $t],
2218
+ var fn = {
2219
+ appStringPrefixes: [$t, H],
2220
+ tagNumbers: [U, en],
2209
2221
  parseAppString(e, t) {
2210
- return un(e, t);
2222
+ return dn(e, t);
2211
2223
  },
2212
2224
  parseAppSequence(e, t) {
2213
- return un(e, tn(t));
2225
+ return dn(e, nn(t));
2214
2226
  },
2215
2227
  parseTag(e, t) {
2216
- if (!(e !== U && e !== $t) && (t instanceof N || t instanceof I)) return new ln(e, t);
2228
+ if (!(e !== U && e !== en) && (t instanceof M || t instanceof F)) return new un(e, t);
2217
2229
  }
2218
- }, fn = 18446744073709551615n, pn = -18446744073709551616n, mn = {
2219
- tagNumbers: [Je, Ye],
2220
- parseTag(e, t) {
2221
- if (t instanceof N) {
2222
- if (e === 2n) {
2223
- let e = $e(t.value);
2224
- return e > fn ? new et(e) : void 0;
2225
- }
2226
- if (e === 3n) {
2227
- let e = -1n - $e(t.value);
2228
- return e < pn ? new tt(e) : void 0;
2229
- }
2230
- }
2231
- }
2232
- }, hn = "cri", gn = "CRI", _n = 99n, vn = /* @__PURE__ */ new Map([
2230
+ }, pn = "cri", mn = "CRI", hn = 99n, gn = /* @__PURE__ */ new Map([
2233
2231
  ["coap", -1n],
2234
2232
  ["coaps", -2n],
2235
2233
  ["http", -3n],
@@ -2240,7 +2238,7 @@ var dn = {
2240
2238
  ["coaps+tcp", -8n],
2241
2239
  ["coap+ws", -25n],
2242
2240
  ["coaps+ws", -26n]
2243
- ]), yn = new Map([...vn.entries()].map(([e, t]) => [t, e]));
2241
+ ]), _n = new Map([...gn.entries()].map(([e, t]) => [t, e]));
2244
2242
  function W(e) {
2245
2243
  try {
2246
2244
  return decodeURIComponent(e);
@@ -2248,39 +2246,39 @@ function W(e) {
2248
2246
  return e;
2249
2247
  }
2250
2248
  }
2251
- var bn = new TextEncoder(), xn = new TextDecoder("utf-8", { fatal: !0 });
2252
- function Sn(e) {
2253
- return Array.from(bn.encode(e), (e) => `%${e.toString(16).toUpperCase().padStart(2, "0")}`).join("");
2249
+ var vn = new TextEncoder(), yn = new TextDecoder("utf-8", { fatal: !0 });
2250
+ function bn(e) {
2251
+ return Array.from(vn.encode(e), (e) => `%${e.toString(16).toUpperCase().padStart(2, "0")}`).join("");
2254
2252
  }
2255
2253
  function G(e, t) {
2256
2254
  let n = "";
2257
- for (let r of e) n += t(r) ? r : Sn(r);
2255
+ for (let r of e) n += t(r) ? r : bn(r);
2258
2256
  return n;
2259
2257
  }
2260
- function Cn(e) {
2258
+ function xn(e) {
2261
2259
  return /[A-Za-z0-9\-._~]/.test(e);
2262
2260
  }
2263
- function wn(e) {
2261
+ function Sn(e) {
2264
2262
  return /[!$&'()*+,;=]/.test(e);
2265
2263
  }
2264
+ function Cn(e) {
2265
+ return xn(e) || Sn(e) || e === ":" || e === "@";
2266
+ }
2267
+ function wn(e) {
2268
+ return (Cn(e) || e === "/" || e === "?") && e !== "&";
2269
+ }
2266
2270
  function Tn(e) {
2267
- return Cn(e) || wn(e) || e === ":" || e === "@";
2271
+ return Cn(e) || e === "/" || e === "?";
2268
2272
  }
2269
2273
  function En(e) {
2270
- return (Tn(e) || e === "/" || e === "?") && e !== "&";
2274
+ return xn(e) || Sn(e) || e === ":";
2271
2275
  }
2272
2276
  function Dn(e) {
2273
- return Tn(e) || e === "/" || e === "?";
2277
+ return xn(e) || Sn(e);
2274
2278
  }
2275
2279
  function On(e) {
2276
- return Cn(e) || wn(e) || e === ":";
2277
- }
2278
- function kn(e) {
2279
- return Cn(e) || wn(e);
2280
- }
2281
- function An(e) {
2282
2280
  let t = [], n = e, r = n.indexOf("@");
2283
- r >= 0 && (t.push(R.FALSE), t.push(new B(W(n.slice(0, r)))), n = n.slice(r + 1));
2281
+ r >= 0 && (t.push(L.FALSE), t.push(new B(W(n.slice(0, r)))), n = n.slice(r + 1));
2284
2282
  let i, a = null;
2285
2283
  if (n.startsWith("[")) {
2286
2284
  let e = n.indexOf("]");
@@ -2289,51 +2287,51 @@ function An(e) {
2289
2287
  let r = n.slice(e + 1);
2290
2288
  if (r.startsWith(":")) a = r.slice(1);
2291
2289
  else if (r.length > 0) throw SyntaxError("cri: unexpected characters after ']' in authority");
2292
- t.push(new N(Yt(i)));
2290
+ t.push(new M(Xt(i)));
2293
2291
  } else {
2294
2292
  let e = n.lastIndexOf(":");
2295
- if (e >= 0 ? (i = n.slice(0, e), a = n.slice(e + 1)) : i = n, i !== "") if (/^\d{1,3}(\.\d{1,3}){3}$/.test(i)) t.push(new N(Jt(i)));
2293
+ if (e >= 0 ? (i = n.slice(0, e), a = n.slice(e + 1)) : i = n, i !== "") if (/^\d{1,3}(\.\d{1,3}){3}$/.test(i)) t.push(new M(Yt(i)));
2296
2294
  else for (let e of i.toLowerCase().split(".")) t.push(new B(e));
2297
2295
  }
2298
2296
  if (a !== null && a !== "") {
2299
2297
  if (!/^\d+$/.test(a)) throw SyntaxError(`cri: invalid port: ${JSON.stringify(a)}`);
2300
2298
  let e = parseInt(a, 10);
2301
2299
  if (e > 65535) throw SyntaxError(`cri: port ${e} out of range`);
2302
- t.push(new k(BigInt(e)));
2300
+ t.push(new O(BigInt(e)));
2303
2301
  }
2304
- return new I(t);
2302
+ return new F(t);
2305
2303
  }
2306
- function jn(e) {
2304
+ function kn(e) {
2307
2305
  let t = e.items, n = 0, r = "";
2308
- if (n < t.length && t[n] instanceof R && t[n].value === 20) {
2306
+ if (n < t.length && t[n] instanceof L && t[n].value === 20) {
2309
2307
  n++;
2310
2308
  let e = t[n++];
2311
- r += G(e.value, On) + "@";
2309
+ r += G(e.value, En) + "@";
2312
2310
  }
2313
2311
  if (n >= t.length) return r;
2314
2312
  let i = t[n];
2315
- if (i instanceof N) {
2313
+ if (i instanceof M) {
2316
2314
  n++;
2317
2315
  let { length: e } = i.value;
2318
- if (e === 4) r += Xt(i.value);
2319
- else if (e === 16) r += "[" + Zt(i.value) + "]";
2316
+ if (e === 4) r += Zt(i.value);
2317
+ else if (e === 16) r += "[" + Qt(i.value) + "]";
2320
2318
  else throw Error(`cri: unexpected host-ip byte length: ${e}`);
2321
- n < t.length && t[n] instanceof B && (r += `%25${G(t[n++].value, kn)}`);
2319
+ n < t.length && t[n] instanceof B && (r += `%25${G(t[n++].value, Dn)}`);
2322
2320
  } else {
2323
2321
  let e = [];
2324
- for (; n < t.length && t[n] instanceof B;) e.push(G(t[n++].value, kn));
2322
+ for (; n < t.length && t[n] instanceof B;) e.push(G(t[n++].value, Dn));
2325
2323
  r += e.join(".");
2326
2324
  }
2327
- return n < t.length && t[n] instanceof k && (r += ":" + t[n].value.toString()), r;
2325
+ return n < t.length && t[n] instanceof O && (r += ":" + t[n].value.toString()), r;
2328
2326
  }
2329
- function Mn(e) {
2327
+ function An(e) {
2330
2328
  let t = e.slice(2), n = t.indexOf("/"), r, i;
2331
2329
  return n >= 0 ? (r = t.slice(0, n), i = t.slice(n + 1).split("/").map((e) => new B(W(e)))) : (r = t, i = []), {
2332
- authority: An(r),
2330
+ authority: On(r),
2333
2331
  pathSegments: i
2334
2332
  };
2335
2333
  }
2336
- function Nn(e) {
2334
+ function jn(e) {
2337
2335
  let t = e, n = null, r = t.indexOf("#");
2338
2336
  r >= 0 && (n = W(t.slice(r + 1)), t = t.slice(0, r));
2339
2337
  let i = null, a = t.indexOf("?");
@@ -2343,108 +2341,108 @@ function Nn(e) {
2343
2341
  }
2344
2342
  let o = [], s = /^([a-zA-Z][a-zA-Z0-9+.\-]*):([\s\S]*)$/.exec(t);
2345
2343
  if (s) {
2346
- let e = s[1].toLowerCase(), t = s[2], n = vn.get(e);
2347
- if (o.push(n === void 0 ? new B(e) : new A(n)), t.startsWith("//")) {
2348
- let { authority: e, pathSegments: n } = Mn(t);
2349
- o.push(e, new I(n));
2344
+ let e = s[1].toLowerCase(), t = s[2], n = gn.get(e);
2345
+ if (o.push(n === void 0 ? new B(e) : new k(n)), t.startsWith("//")) {
2346
+ let { authority: e, pathSegments: n } = An(t);
2347
+ o.push(e, new F(n));
2350
2348
  } else if (t.startsWith("/")) {
2351
2349
  let e = t.slice(1).split("/").map((e) => new B(W(e)));
2352
- o.push(R.NULL, new I(e));
2350
+ o.push(L.NULL, new F(e));
2353
2351
  } else {
2354
2352
  let e = t.split("/").map((e) => new B(W(e)));
2355
- o.push(R.TRUE, new I(e));
2353
+ o.push(L.TRUE, new F(e));
2356
2354
  }
2357
2355
  } else if (t.startsWith("//")) {
2358
- let { authority: e, pathSegments: n } = Mn(t);
2359
- o.push(R.FALSE, e, new I(n));
2356
+ let { authority: e, pathSegments: n } = An(t);
2357
+ o.push(L.FALSE, e, new F(n));
2360
2358
  } else if (t.startsWith("/")) {
2361
2359
  let e = t.slice(1).split("/").map((e) => new B(W(e)));
2362
- o.push(R.TRUE, new I(e));
2363
- } else if (t === "") o.push(new k(0n));
2360
+ o.push(L.TRUE, new F(e));
2361
+ } else if (t === "") o.push(new O(0n));
2364
2362
  else {
2365
2363
  let n = 1n, r = t, i = !1;
2366
2364
  for (r.startsWith("./") && (i = !0, r = r.slice(2)); r.startsWith("../");) n++, r = r.slice(3);
2367
2365
  if (r === ".." ? (n++, r = "") : r === "." && (r = ""), n === 1n && !i && r !== "" && r.split("/")[0].includes(":")) throw SyntaxError(`cri: invalid relative-path reference — first segment must not contain ':' without a './' prefix (RFC 3986 §3.3): ${JSON.stringify(e)}`);
2368
2366
  let a = r === "" ? [] : r.split("/").map((e) => new B(W(e)));
2369
- o.push(new k(n), new I(a));
2367
+ o.push(new O(n), new F(a));
2370
2368
  }
2371
- if (i !== null && o.push(new I(i)), n !== null && (i === null && o.push(R.NULL), o.push(new B(n))), n !== null && i === null && o.splice(o.length - 2, 1), i === null && n === null) {
2369
+ if (i !== null && o.push(new F(i)), n !== null && (i === null && o.push(L.NULL), o.push(new B(n))), n !== null && i === null && o.splice(o.length - 2, 1), i === null && n === null) {
2372
2370
  let e = o[o.length - 1];
2373
- e instanceof I && e.items.length === 0 && o.pop();
2371
+ e instanceof F && e.items.length === 0 && o.pop();
2374
2372
  }
2375
- return o.length === 1 && o[0] instanceof k && o[0].value === 0n ? [] : o;
2373
+ return o.length === 1 && o[0] instanceof O && o[0].value === 0n ? [] : o;
2376
2374
  }
2377
2375
  function K(e, t) {
2378
2376
  let n = t, r = "";
2379
2377
  if (n < e.length) {
2380
2378
  let t = e[n];
2381
- if (t instanceof I) {
2379
+ if (t instanceof F) {
2382
2380
  if (n++, t.items.length > 0) {
2383
2381
  let e = t.items.map((e) => {
2384
2382
  if (!(e instanceof B)) throw Error("cri: query item must be a text string");
2385
- return G(e.value, En);
2383
+ return G(e.value, wn);
2386
2384
  });
2387
2385
  r += "?" + e.join("&");
2388
2386
  }
2389
- } else t instanceof R && t.value === 22 && n++;
2387
+ } else t instanceof L && t.value === 22 && n++;
2390
2388
  }
2391
- return n < e.length && e[n] instanceof B && (r += "#" + G(e[n].value, Dn)), r;
2389
+ return n < e.length && e[n] instanceof B && (r += "#" + G(e[n].value, Tn)), r;
2392
2390
  }
2393
- function Pn(e) {
2391
+ function Mn(e) {
2394
2392
  return e.items.map((e) => {
2395
2393
  if (!(e instanceof B)) throw Error("cri: path segment must be a text string");
2396
- return G(e.value, Tn);
2394
+ return G(e.value, Cn);
2397
2395
  });
2398
2396
  }
2399
- function Fn(e) {
2397
+ function Nn(e) {
2400
2398
  if (e.length === 0) return "";
2401
2399
  let t = 0, n = e[t++];
2402
- if (n instanceof A || n instanceof B) {
2400
+ if (n instanceof k || n instanceof B) {
2403
2401
  let r;
2404
- if (n instanceof A) {
2405
- let e = yn.get(n.value);
2402
+ if (n instanceof k) {
2403
+ let e = _n.get(n.value);
2406
2404
  if (e === void 0) throw Error(`cri: unrecognised scheme-id ${n.value}`);
2407
2405
  r = e + ":";
2408
2406
  } else r = n.value + ":";
2409
2407
  if (t >= e.length) return r;
2410
2408
  let i = e[t++], a = "", o = !1;
2411
- if (i instanceof I) a = "//" + jn(i), o = !0;
2412
- else if (i instanceof R) if (i.value === 22) o = !0;
2409
+ if (i instanceof F) a = "//" + kn(i), o = !0;
2410
+ else if (i instanceof L) if (i.value === 22) o = !0;
2413
2411
  else if (i.value === 21) o = !1;
2414
2412
  else throw Error(`cri: unexpected no-authority value: simple(${i.value})`);
2415
2413
  else throw Error("cri: unexpected type for authority element");
2416
2414
  let s = "";
2417
- if (t < e.length && e[t] instanceof I) {
2415
+ if (t < e.length && e[t] instanceof F) {
2418
2416
  let n = e[t++];
2419
- n.items.length > 0 && (s = (o ? "/" : "") + Pn(n).join("/"));
2417
+ n.items.length > 0 && (s = (o ? "/" : "") + Mn(n).join("/"));
2420
2418
  }
2421
2419
  return r + a + s + K(e, t);
2422
2420
  }
2423
- if (n instanceof R && n.value === 20) {
2424
- if (t >= e.length || !(e[t] instanceof I)) throw Error("cri: network-path reference requires an authority array");
2425
- let n = jn(e[t++]), r = "";
2426
- if (t < e.length && e[t] instanceof I) {
2421
+ if (n instanceof L && n.value === 20) {
2422
+ if (t >= e.length || !(e[t] instanceof F)) throw Error("cri: network-path reference requires an authority array");
2423
+ let n = kn(e[t++]), r = "";
2424
+ if (t < e.length && e[t] instanceof F) {
2427
2425
  let n = e[t++];
2428
- n.items.length > 0 && (r = "/" + Pn(n).join("/"));
2426
+ n.items.length > 0 && (r = "/" + Mn(n).join("/"));
2429
2427
  }
2430
2428
  return "//" + n + r + K(e, t);
2431
2429
  }
2432
- if (n instanceof R && n.value === 21) {
2430
+ if (n instanceof L && n.value === 21) {
2433
2431
  let n = "/";
2434
- if (t < e.length && e[t] instanceof I) {
2432
+ if (t < e.length && e[t] instanceof F) {
2435
2433
  let r = e[t++];
2436
- n = "/" + Pn(r).join("/");
2434
+ n = "/" + Mn(r).join("/");
2437
2435
  }
2438
2436
  return n + K(e, t);
2439
2437
  }
2440
- if (n instanceof k) {
2438
+ if (n instanceof O) {
2441
2439
  let r = n.value;
2442
2440
  if (r === 0n) return K(e, t);
2443
2441
  let i = r === 1n ? "" : "../".repeat(Number(r) - 1), a;
2444
- if (t < e.length && e[t] instanceof I) {
2442
+ if (t < e.length && e[t] instanceof F) {
2445
2443
  let n = e[t++];
2446
2444
  if (n.items.length > 0) {
2447
- let e = Pn(n);
2445
+ let e = Mn(n);
2448
2446
  a = (r === 1n && e[0].includes(":") ? "./" : i) + e.join("/");
2449
2447
  } else a = i === "" ? "./" : i;
2450
2448
  } else a = i === "" ? "./" : i;
@@ -2452,86 +2450,100 @@ function Fn(e) {
2452
2450
  }
2453
2451
  throw Error("cri: unrecognised first element type in CRI array");
2454
2452
  }
2455
- var In = class extends I {
2453
+ var Pn = class extends F {
2456
2454
  _toCDN(e, t) {
2457
2455
  if (e?.appStrings === !1) return super._toCDN(e, t);
2458
2456
  try {
2459
2457
  let t = x(e, this.encodingWidth, () => b(BigInt(this.items.length)));
2460
- return `${hn}'${Fn(this.items)}'${t}`;
2458
+ return `${pn}'${Nn(this.items)}'${t}`;
2461
2459
  } catch {
2462
2460
  return super._toCDN(e, t);
2463
2461
  }
2464
2462
  }
2465
- }, Ln = class extends M {
2463
+ }, Fn = class extends j {
2466
2464
  constructor(e) {
2467
- super(_n, e);
2465
+ super(hn, e);
2468
2466
  }
2469
2467
  _toCDN(e, t) {
2470
2468
  if (e?.appStrings === !1) return super._toCDN(e, t);
2471
2469
  try {
2472
2470
  let n = this.content;
2473
2471
  if (n.encodingWidth !== void 0) return super._toCDN(e, t);
2474
- let r = x(e, this.encodingWidth, () => b(_n));
2475
- return `${gn}'${Fn(n.items)}'${r}`;
2472
+ let r = x(e, this.encodingWidth, () => b(hn));
2473
+ return `${mn}'${Nn(n.items)}'${r}`;
2476
2474
  } catch {
2477
2475
  return super._toCDN(e, t);
2478
2476
  }
2479
2477
  }
2480
2478
  };
2481
- function Rn(e) {
2479
+ function In(e) {
2482
2480
  if (e.length !== 1) throw SyntaxError("cri<<...>>: expected exactly one item");
2483
2481
  let t = e[0];
2484
2482
  if (t instanceof B) return t.value;
2485
- if (t instanceof N) return xn.decode(t.value);
2483
+ if (t instanceof M) return yn.decode(t.value);
2486
2484
  throw SyntaxError("cri<<...>>: expected a text string or byte string");
2487
2485
  }
2488
- function zn(e, t) {
2489
- let n = new In(Nn(t));
2490
- return e === gn ? new Ln(n) : n;
2486
+ function Ln(e, t) {
2487
+ let n = new Pn(jn(t));
2488
+ return e === mn ? new Fn(n) : n;
2491
2489
  }
2492
- var Bn = {
2493
- appStringPrefixes: [hn, gn],
2494
- tagNumbers: [_n],
2490
+ var Rn = {
2491
+ appStringPrefixes: [pn, mn],
2492
+ tagNumbers: [hn],
2495
2493
  parseAppString(e, t) {
2496
- return zn(e, t);
2494
+ return Ln(e, t);
2497
2495
  },
2498
2496
  parseAppSequence(e, t) {
2499
- return zn(e, Rn(t));
2497
+ return Ln(e, In(t));
2500
2498
  },
2501
2499
  parseTag(e, t) {
2502
- if (e !== 99n || !(t instanceof I)) return;
2503
- let n = new In(t.items, {
2500
+ if (e !== 99n || !(t instanceof F)) return;
2501
+ let n = new Pn(t.items, {
2504
2502
  indefiniteLength: t.indefiniteLength,
2505
2503
  encodingWidth: t.encodingWidth
2506
2504
  });
2507
- return n.start = t.start, n.end = t.end, new Ln(n);
2505
+ return n.start = t.start, n.end = t.end, new Fn(n);
2506
+ }
2507
+ }, zn = 18446744073709551615n, Bn = -18446744073709551616n, Vn = {
2508
+ tagNumbers: [Ye, Xe],
2509
+ parseTag(e, t) {
2510
+ if (t instanceof M) {
2511
+ if (e === 2n) {
2512
+ let e = et(t.value);
2513
+ return e > zn ? new tt(e) : void 0;
2514
+ }
2515
+ if (e === 3n) {
2516
+ let e = -1n - et(t.value);
2517
+ return e < Bn ? new nt(e) : void 0;
2518
+ }
2519
+ }
2508
2520
  }
2509
2521
  };
2510
2522
  //#endregion
2511
2523
  //#region src/cbor/decoder.ts
2512
- function Vn(e, t) {
2524
+ function Hn(e, t) {
2513
2525
  if (e === 24 && t <= 23n) return 0;
2514
2526
  if (e === 25 && t <= 255n) return 1;
2515
2527
  if (e === 26 && t <= 65535n) return 2;
2516
2528
  if (e === 27 && t <= 4294967295n) return 3;
2517
2529
  }
2518
- function Hn(e, t) {
2530
+ function Un(e, t) {
2519
2531
  if (e === 24 && t <= 23) return 0;
2520
2532
  if (e === 25 && t <= 255) return 1;
2521
2533
  if (e === 26 && t <= 65535) return 2;
2522
2534
  if (e === 27 && t <= 4294967295) return 3;
2523
2535
  }
2524
- var Un = new TextDecoder("utf-8", {
2536
+ var Wn = new TextDecoder("utf-8", {
2525
2537
  fatal: !0,
2526
2538
  ignoreBOM: !0
2527
- }), Wn = new TextDecoder("utf-8", {
2539
+ }), Gn = new TextDecoder("utf-8", {
2528
2540
  fatal: !1,
2529
2541
  ignoreBOM: !0
2530
2542
  });
2531
2543
  function q(e) {
2532
2544
  throw Error(`CBOR decode error: ${e}`);
2533
2545
  }
2534
- function Gn(e, t, n) {
2546
+ function Kn(e, t, n) {
2535
2547
  let r = {
2536
2548
  message: e,
2537
2549
  offset: t
@@ -2543,59 +2555,59 @@ function J(e, t) {
2543
2555
  e.warnings ??= [], e.warnings.push(t);
2544
2556
  }
2545
2557
  function Y(e) {
2546
- if (e instanceof k) return ["u", String(e.value)];
2547
- if (e instanceof A) return ["n", String(e.value)];
2558
+ if (e instanceof O) return ["u", String(e.value)];
2559
+ if (e instanceof k) return ["n", String(e.value)];
2548
2560
  if (e instanceof B) return ["t", e.value];
2549
- if (e instanceof F) return ["t", e.chunks.map((e) => e.value).join("")];
2550
- if (e instanceof N) return ["b", i(e.value)];
2551
- if (e instanceof P) {
2561
+ if (e instanceof P) return ["t", e.chunks.map((e) => e.value).join("")];
2562
+ if (e instanceof M) return ["b", i(e.value)];
2563
+ if (e instanceof N) {
2552
2564
  let t = "";
2553
2565
  for (let n of e.chunks) t += i(n.value);
2554
2566
  return ["b", t];
2555
2567
  }
2556
- if (e instanceof j) return isNaN(e.value) ? ["f", "NaN"] : Object.is(e.value, -0) ? ["f", "-0"] : ["f", String(e.value)];
2557
- if (e instanceof R) return ["s", e.value];
2558
- if (e instanceof I) return ["A", e.items.map(Y)];
2559
- if (e instanceof L) {
2568
+ if (e instanceof A) return isNaN(e.value) ? ["f", "NaN"] : Object.is(e.value, -0) ? ["f", "-0"] : ["f", String(e.value)];
2569
+ if (e instanceof L) return ["s", e.value];
2570
+ if (e instanceof F) return ["A", e.items.map(Y)];
2571
+ if (e instanceof I) {
2560
2572
  let t = e.entries.map(([e, t]) => [Y(e), Y(t)]);
2561
2573
  if (t.length <= 1) return ["M", t];
2562
2574
  let n = t.map((e) => [JSON.stringify(e[0]), e]);
2563
2575
  return n.sort((e, t) => e[0] < t[0] ? -1 : +(e[0] > t[0])), ["M", n.map((e) => e[1])];
2564
2576
  }
2565
- return e instanceof M ? [
2577
+ return e instanceof j ? [
2566
2578
  "G",
2567
2579
  String(e.tag),
2568
2580
  Y(e.content)
2569
2581
  ] : ["c", i(e.toCBOR())];
2570
2582
  }
2571
- function Kn(e) {
2572
- if (e instanceof k) return "u" + e.value;
2573
- if (e instanceof A) return "n" + e.value;
2583
+ function qn(e) {
2584
+ if (e instanceof O) return "u" + e.value;
2585
+ if (e instanceof k) return "n" + e.value;
2574
2586
  if (e instanceof B) return "t" + e.value;
2575
- if (e instanceof F) {
2587
+ if (e instanceof P) {
2576
2588
  let t = "t";
2577
2589
  for (let n of e.chunks) t += n.value;
2578
2590
  return t;
2579
2591
  }
2580
- if (e instanceof N) return "b" + i(e.value);
2581
- if (e instanceof P) {
2592
+ if (e instanceof M) return "b" + i(e.value);
2593
+ if (e instanceof N) {
2582
2594
  let t = "b";
2583
2595
  for (let n of e.chunks) t += i(n.value);
2584
2596
  return t;
2585
2597
  }
2586
- return e instanceof j ? isNaN(e.value) ? "fNaN" : Object.is(e.value, -0) ? "f-0" : "f" + e.value : e instanceof R ? "s" + e.value : JSON.stringify(Y(e));
2598
+ return e instanceof A ? isNaN(e.value) ? "fNaN" : Object.is(e.value, -0) ? "f-0" : "f" + e.value : e instanceof L ? "s" + e.value : JSON.stringify(Y(e));
2587
2599
  }
2588
- var qn = Array.from({ length: 24 }, (e, t) => BigInt(t)), Jn;
2589
- function Yn() {
2590
- return Jn ??= Fr.filter((e) => e.parseTag !== void 0);
2600
+ var Jn = Array.from({ length: 24 }, (e, t) => BigInt(t)), Yn;
2601
+ function Xn(e) {
2602
+ return e === void 0 ? Yn ??= Z(void 0).filter((e) => e.parseTag !== void 0) : Z(e).filter((e) => e.parseTag !== void 0);
2591
2603
  }
2592
- function Xn(e, t) {
2604
+ function Zn(e, t) {
2593
2605
  for (let n = 0; n < t; n++) if (e[n] >= 128) return;
2594
2606
  return String.fromCharCode.apply(null, e);
2595
2607
  }
2596
- function Zn(e, t, n) {
2608
+ function Qn(e, t, n) {
2597
2609
  if (n <= 23) return {
2598
- value: qn[n],
2610
+ value: Jn[n],
2599
2611
  nextOffset: t
2600
2612
  };
2601
2613
  switch (n) {
@@ -2618,7 +2630,7 @@ function Zn(e, t, n) {
2618
2630
  default: q(`reserved additional info value: ${n}`);
2619
2631
  }
2620
2632
  }
2621
- function Qn(e, t, n) {
2633
+ function $n(e, t, n) {
2622
2634
  if (n <= 23) return {
2623
2635
  value: n,
2624
2636
  nextOffset: t
@@ -2647,7 +2659,7 @@ function Qn(e, t, n) {
2647
2659
  default: q(`reserved additional info value: ${n}`);
2648
2660
  }
2649
2661
  }
2650
- function $n(e, t, n, r, i, a) {
2662
+ function er(e, t, n, r, i, a) {
2651
2663
  let o = [], s = t;
2652
2664
  for (;;) {
2653
2665
  if (s >= e.byteLength && q(`unexpected end of indefinite ${i}`), e.getUint8(s) === 255) {
@@ -2662,65 +2674,65 @@ function $n(e, t, n, r, i, a) {
2662
2674
  nextOffset: s
2663
2675
  };
2664
2676
  }
2665
- function er(e, t, n, r) {
2666
- let i = Kn(e);
2667
- t.has(i) && n.push(Gn(`duplicate map key at offset ${e.start}`, e.start, r)), t.add(i);
2677
+ function tr(e, t, n, r) {
2678
+ let i = qn(e);
2679
+ t.has(i) && n.push(Kn(`duplicate map key at offset ${e.start}`, e.start, r)), t.add(i);
2668
2680
  }
2669
2681
  function X(e, t, n, r) {
2670
- let i = t, a = nr(e, t, n, r);
2682
+ let i = t, a = rr(e, t, n, r);
2671
2683
  return a.value.start = i, a.value.end = a.nextOffset, a;
2672
2684
  }
2673
- function tr(e, t, n) {
2685
+ function nr(e, t, n) {
2674
2686
  return new Uint8Array(e.buffer, e.byteOffset + t, n).slice();
2675
2687
  }
2676
- function nr(e, t, n, r) {
2688
+ function rr(e, t, n, r) {
2677
2689
  t >= e.byteLength && q("unexpected end of input");
2678
2690
  let i = e.getUint8(t++), a = i >> 5, o = i & 31;
2679
2691
  switch (a) {
2680
2692
  case 0: {
2681
- let { value: n, nextOffset: r } = Zn(e, t, o);
2693
+ let { value: n, nextOffset: r } = Qn(e, t, o);
2682
2694
  return {
2683
- value: new k(n, { encodingWidth: Vn(o, n) }),
2695
+ value: new O(n, { encodingWidth: Hn(o, n) }),
2684
2696
  nextOffset: r
2685
2697
  };
2686
2698
  }
2687
2699
  case 1: {
2688
- let { value: n, nextOffset: r } = Zn(e, t, o), i = Vn(o, n);
2700
+ let { value: n, nextOffset: r } = Qn(e, t, o), i = Hn(o, n);
2689
2701
  return {
2690
- value: new A(-1n - n, { encodingWidth: i }),
2702
+ value: new k(-1n - n, { encodingWidth: i }),
2691
2703
  nextOffset: r
2692
2704
  };
2693
2705
  }
2694
2706
  case 2: {
2695
2707
  if (o === 31) {
2696
- let { chunks: i, nextOffset: a } = $n(e, t, n, r, "byte string", (e) => e instanceof N);
2708
+ let { chunks: i, nextOffset: a } = er(e, t, n, r, "byte string", (e) => e instanceof M);
2697
2709
  return {
2698
- value: new P(i),
2710
+ value: new N(i),
2699
2711
  nextOffset: a
2700
2712
  };
2701
2713
  }
2702
- let { value: i, nextOffset: a } = Qn(e, t, o), s = Hn(o, i);
2714
+ let { value: i, nextOffset: a } = $n(e, t, o), s = Un(o, i);
2703
2715
  return a + i > e.byteLength && q("byte string extends beyond input"), {
2704
- value: new N(new Uint8Array(e.buffer, e.byteOffset + a, i).slice(), { encodingWidth: s }),
2716
+ value: new M(new Uint8Array(e.buffer, e.byteOffset + a, i).slice(), { encodingWidth: s }),
2705
2717
  nextOffset: a + i
2706
2718
  };
2707
2719
  }
2708
2720
  case 3: {
2709
2721
  if (o === 31) {
2710
- let { chunks: i, nextOffset: a } = $n(e, t, n, r, "text string", (e) => e instanceof B);
2722
+ let { chunks: i, nextOffset: a } = er(e, t, n, r, "text string", (e) => e instanceof B);
2711
2723
  return {
2712
- value: new F(i),
2724
+ value: new P(i),
2713
2725
  nextOffset: a
2714
2726
  };
2715
2727
  }
2716
- let { value: i, nextOffset: a } = Qn(e, t, o), s = Hn(o, i);
2728
+ let { value: i, nextOffset: a } = $n(e, t, o), s = Un(o, i);
2717
2729
  a + i > e.byteLength && q("text string extends beyond input");
2718
- let c = new Uint8Array(e.buffer, e.byteOffset + a, i), l, u, d = i < 64 ? Xn(c, i) : void 0;
2730
+ let c = new Uint8Array(e.buffer, e.byteOffset + a, i), l, u, d = i < 64 ? Zn(c, i) : void 0;
2719
2731
  if (d !== void 0) l = d;
2720
2732
  else try {
2721
- l = Un.decode(c);
2733
+ l = Wn.decode(c);
2722
2734
  } catch {
2723
- u = Gn("invalid UTF-8 sequence in text string", a, n), l = Wn.decode(c);
2735
+ u = Kn("invalid UTF-8 sequence in text string", a, n), l = Gn.decode(c);
2724
2736
  }
2725
2737
  let f = new B(l, { encodingWidth: s });
2726
2738
  return u && J(f, u), {
@@ -2740,17 +2752,17 @@ function nr(e, t, n, r) {
2740
2752
  i.push(t.value), a = t.nextOffset;
2741
2753
  }
2742
2754
  return {
2743
- value: new I(i, { indefiniteLength: !0 }),
2755
+ value: new F(i, { indefiniteLength: !0 }),
2744
2756
  nextOffset: a
2745
2757
  };
2746
2758
  }
2747
- let { value: i, nextOffset: a } = Qn(e, t, o), s = Hn(o, i), c = [], l = a;
2759
+ let { value: i, nextOffset: a } = $n(e, t, o), s = Un(o, i), c = [], l = a;
2748
2760
  for (let t = 0; t < i; t++) {
2749
2761
  let t = X(e, l, n, r);
2750
2762
  c.push(t.value), l = t.nextOffset;
2751
2763
  }
2752
2764
  return {
2753
- value: new I(c, { encodingWidth: s }),
2765
+ value: new F(c, { encodingWidth: s }),
2754
2766
  nextOffset: l
2755
2767
  };
2756
2768
  }
@@ -2763,25 +2775,25 @@ function nr(e, t, n, r) {
2763
2775
  break;
2764
2776
  }
2765
2777
  let t = X(e, s, n, r);
2766
- er(t.value, a, o, n), s = t.nextOffset;
2778
+ tr(t.value, a, o, n), s = t.nextOffset;
2767
2779
  let c = X(e, s, n, r);
2768
2780
  s = c.nextOffset, i.push([t.value, c.value]);
2769
2781
  }
2770
- let c = new L(i, { indefiniteLength: !0 });
2782
+ let c = new I(i, { indefiniteLength: !0 });
2771
2783
  for (let e of o) J(c, e);
2772
2784
  return {
2773
2785
  value: c,
2774
2786
  nextOffset: s
2775
2787
  };
2776
2788
  }
2777
- let { value: i, nextOffset: a } = Qn(e, t, o), s = Hn(o, i), c = [], l = /* @__PURE__ */ new Set(), u = [], d = a;
2789
+ let { value: i, nextOffset: a } = $n(e, t, o), s = Un(o, i), c = [], l = /* @__PURE__ */ new Set(), u = [], d = a;
2778
2790
  for (let t = 0; t < i; t++) {
2779
2791
  let t = X(e, d, n, r);
2780
- er(t.value, l, u, n), d = t.nextOffset;
2792
+ tr(t.value, l, u, n), d = t.nextOffset;
2781
2793
  let i = X(e, d, n, r);
2782
2794
  d = i.nextOffset, c.push([t.value, i.value]);
2783
2795
  }
2784
- let f = new L(c, { encodingWidth: s });
2796
+ let f = new I(c, { encodingWidth: s });
2785
2797
  for (let e of u) J(f, e);
2786
2798
  return {
2787
2799
  value: f,
@@ -2790,52 +2802,52 @@ function nr(e, t, n, r) {
2790
2802
  }
2791
2803
  case 6: {
2792
2804
  o === 31 && q("tags cannot use indefinite-length encoding");
2793
- let { value: i, nextOffset: a } = Zn(e, t, o), s = Vn(o, i), c = X(e, a, n, r);
2805
+ let { value: i, nextOffset: a } = Qn(e, t, o), s = Hn(o, i), c = X(e, a, n, r);
2794
2806
  for (let e of r) {
2795
2807
  let t = e.parseTag(i, c.value, n);
2796
- if (t !== void 0) return t instanceof M && s !== void 0 && (t.encodingWidth = s), {
2808
+ if (t !== void 0) return t instanceof j && s !== void 0 && (t.encodingWidth = s), {
2797
2809
  value: t,
2798
2810
  nextOffset: c.nextOffset
2799
2811
  };
2800
2812
  }
2801
2813
  return {
2802
- value: new M(i, c.value, { encodingWidth: s }),
2814
+ value: new j(i, c.value, { encodingWidth: s }),
2803
2815
  nextOffset: c.nextOffset
2804
2816
  };
2805
2817
  }
2806
2818
  case 7:
2807
2819
  if (o <= 19) return {
2808
- value: new R(o),
2820
+ value: new L(o),
2809
2821
  nextOffset: t
2810
2822
  };
2811
2823
  if (o === 20) return {
2812
- value: new R(20),
2824
+ value: new L(20),
2813
2825
  nextOffset: t
2814
2826
  };
2815
2827
  if (o === 21) return {
2816
- value: new R(21),
2828
+ value: new L(21),
2817
2829
  nextOffset: t
2818
2830
  };
2819
2831
  if (o === 22) return {
2820
- value: new R(22),
2832
+ value: new L(22),
2821
2833
  nextOffset: t
2822
2834
  };
2823
2835
  if (o === 23) return {
2824
- value: new R(23),
2836
+ value: new L(23),
2825
2837
  nextOffset: t
2826
2838
  };
2827
2839
  if (o === 24) {
2828
2840
  t + 1 > e.byteLength && q("unexpected end of input");
2829
2841
  let r = e.getUint8(t);
2830
2842
  if (r < 32) {
2831
- let e = Gn(`simple value ${r} must be encoded in initial byte (0–31 reserved for extended encoding)`, t - 1, n), i = new R(r);
2843
+ let e = Kn(`simple value ${r} must be encoded in initial byte (0–31 reserved for extended encoding)`, t - 1, n), i = new L(r);
2832
2844
  return J(i, e), {
2833
2845
  value: i,
2834
2846
  nextOffset: t + 1
2835
2847
  };
2836
2848
  }
2837
2849
  return {
2838
- value: new R(r),
2850
+ value: new L(r),
2839
2851
  nextOffset: t + 1
2840
2852
  };
2841
2853
  }
@@ -2843,9 +2855,9 @@ function nr(e, t, n, r) {
2843
2855
  t + 2 > e.byteLength && q("unexpected end of input");
2844
2856
  let n = C(e.getUint16(t, !1));
2845
2857
  return {
2846
- value: new j(n, {
2858
+ value: new A(n, {
2847
2859
  precision: "half",
2848
- rawBits: Number.isNaN(n) ? tr(e, t, 2) : void 0
2860
+ rawBits: Number.isNaN(n) ? nr(e, t, 2) : void 0
2849
2861
  }),
2850
2862
  nextOffset: t + 2
2851
2863
  };
@@ -2854,9 +2866,9 @@ function nr(e, t, n, r) {
2854
2866
  t + 4 > e.byteLength && q("unexpected end of input");
2855
2867
  let n = e.getFloat32(t, !1);
2856
2868
  return {
2857
- value: new j(n, {
2869
+ value: new A(n, {
2858
2870
  precision: "single",
2859
- rawBits: Number.isNaN(n) ? tr(e, t, 4) : void 0
2871
+ rawBits: Number.isNaN(n) ? nr(e, t, 4) : void 0
2860
2872
  }),
2861
2873
  nextOffset: t + 4
2862
2874
  };
@@ -2865,9 +2877,9 @@ function nr(e, t, n, r) {
2865
2877
  t + 8 > e.byteLength && q("unexpected end of input");
2866
2878
  let n = e.getFloat64(t, !1);
2867
2879
  return {
2868
- value: new j(n, {
2880
+ value: new A(n, {
2869
2881
  precision: "double",
2870
- rawBits: Number.isNaN(n) ? tr(e, t, 8) : void 0
2882
+ rawBits: Number.isNaN(n) ? nr(e, t, 8) : void 0
2871
2883
  }),
2872
2884
  nextOffset: t + 8
2873
2885
  };
@@ -2876,170 +2888,198 @@ function nr(e, t, n, r) {
2876
2888
  }
2877
2889
  return q(`unknown major type: ${a}`);
2878
2890
  }
2879
- function rr(e) {
2891
+ function ir(e) {
2880
2892
  if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return new Uint8Array(e);
2881
2893
  if (ArrayBuffer.isView(e)) return new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
2882
2894
  throw TypeError("expected ArrayBufferView or ArrayBufferLike");
2883
2895
  }
2884
- function ir(e, t) {
2885
- let n = rr(e), r = new DataView(n.buffer, n.byteOffset, n.byteLength), i = t?.offset ?? 0;
2896
+ function ar(e, t) {
2897
+ let n = ir(e), r = new DataView(n.buffer, n.byteOffset, n.byteLength), i = t?.offset ?? 0;
2886
2898
  if (!Number.isInteger(i) || i < 0 || i > r.byteLength) throw RangeError(`CBOR decode offset must be an integer between 0 and ${r.byteLength}`);
2887
- let a = t?.extensions?.length ? [...t.extensions.filter((e) => e.parseTag !== void 0), ...Yn()] : Yn(), { value: o, nextOffset: s } = X(r, i, t, a);
2888
- if (!t?.allowTrailing && s !== r.byteLength) {
2889
- J(o, Gn(`${r.byteLength - s} trailing byte(s) after end of CBOR item`, s, t));
2899
+ let a = Xn(t?.builtinExtensions), o = t?.extensions?.length ? [...t.extensions.filter((e) => e.parseTag !== void 0), ...a] : a, { value: s, nextOffset: c } = X(r, i, t, o);
2900
+ if (!t?.allowTrailing && c !== r.byteLength) {
2901
+ J(s, Kn(`${r.byteLength - c} trailing byte(s) after end of CBOR item`, c, t));
2890
2902
  let e = {
2891
2903
  strict: !1,
2892
2904
  silent: !0
2893
- }, n = s;
2894
- for (; n < r.byteLength;) ({nextOffset: n} = X(r, n, e, a));
2905
+ }, n = c;
2906
+ for (; n < r.byteLength;) ({nextOffset: n} = X(r, n, e, o));
2895
2907
  }
2896
- return o;
2908
+ return s;
2897
2909
  }
2898
2910
  //#endregion
2899
2911
  //#region src/extensions/cbordata.ts
2900
- var ar = 24n, or = {
2901
- tagNumbers: [ar],
2912
+ var or = 24n, sr = {
2913
+ tagNumbers: [or],
2902
2914
  parseTag(e, t, n) {
2903
- if (e !== 24n || !(t instanceof N)) return;
2915
+ if (e !== 24n || !(t instanceof M)) return;
2904
2916
  let r = n ? {
2905
2917
  extensions: n.extensions,
2918
+ builtinExtensions: n.builtinExtensions,
2906
2919
  strict: n.strict,
2907
2920
  onWarning: n.onWarning,
2908
2921
  silent: n.silent
2909
2922
  } : void 0;
2910
2923
  try {
2911
- return new M(ar, new Ue([ir(t.value, r)], { encodingWidth: t.encodingWidth }));
2924
+ return new j(or, new We([ar(t.value, r)], { encodingWidth: t.encodingWidth }));
2912
2925
  } catch (e) {
2913
2926
  if (r?.strict !== !1) throw e;
2914
2927
  return;
2915
2928
  }
2916
2929
  }
2917
- }, sr = new TextEncoder(), cr = new TextDecoder("utf-8", { fatal: !0 }), lr = new TextDecoder("utf-8", { fatal: !1 }), ur = Symbol("ellipsis");
2918
- function dr(e) {
2930
+ };
2931
+ //#endregion
2932
+ //#region src/extensions/ellipsis.ts
2933
+ function cr(e) {
2934
+ return e instanceof R && !(e.content instanceof F);
2935
+ }
2936
+ function lr(e) {
2937
+ let t = !1, n = !1, r = !1, i;
2938
+ for (let a of e) {
2939
+ let e;
2940
+ if (cr(a)) e = !0, r = !0;
2941
+ else if (a instanceof B) e = !1, t = !0;
2942
+ else if (a instanceof M) e = !1, n = !0;
2943
+ else return !1;
2944
+ if (e === i) return !1;
2945
+ i = e;
2946
+ }
2947
+ return r && !(t && n);
2948
+ }
2949
+ var ur = {
2950
+ tagNumbers: [Je],
2951
+ parseTag(e, t) {
2952
+ if (e === 888n) {
2953
+ if (t instanceof L && t.value === 22) return new R();
2954
+ if (t instanceof F && lr(t.items)) return new R(t.items);
2955
+ }
2956
+ }
2957
+ }, dr = new TextEncoder(), fr = new TextDecoder("utf-8", { fatal: !0 }), pr = new TextDecoder("utf-8", { fatal: !1 }), mr = Symbol("ellipsis");
2958
+ function hr(e) {
2919
2959
  let t = 0;
2920
2960
  for (let n of e) t += n.length;
2921
2961
  let n = new Uint8Array(t), r = 0;
2922
2962
  for (let t of e) n.set(t, r), r += t.length;
2923
2963
  return n;
2924
2964
  }
2925
- function fr(e, t, n) {
2926
- if (t instanceof Ke) {
2927
- fr(e, t.inner, n);
2965
+ function gr(e, t, n) {
2966
+ if (t instanceof qe) {
2967
+ gr(e, t.inner, n);
2928
2968
  return;
2929
2969
  }
2930
- if (t instanceof z) {
2931
- if (t.content instanceof I) for (let r of t.content.items) fr(e, r, n);
2932
- else n.push(ur);
2970
+ if (t instanceof R) {
2971
+ if (t.content instanceof F) for (let r of t.content.items) gr(e, r, n);
2972
+ else n.push(mr);
2933
2973
  return;
2934
2974
  }
2935
2975
  if (t instanceof B) {
2936
- n.push(sr.encode(t.value));
2976
+ n.push(dr.encode(t.value));
2937
2977
  return;
2938
2978
  }
2939
- if (t instanceof N) {
2979
+ if (t instanceof M) {
2940
2980
  n.push(t.value);
2941
2981
  return;
2942
2982
  }
2943
- if (t instanceof F) {
2944
- n.push(sr.encode(t.chunks.map((e) => e.value).join("")));
2983
+ if (t instanceof P) {
2984
+ n.push(dr.encode(t.chunks.map((e) => e.value).join("")));
2945
2985
  return;
2946
2986
  }
2947
- if (t instanceof P) {
2948
- n.push(dr(t.chunks.map((e) => e.value)));
2987
+ if (t instanceof N) {
2988
+ n.push(hr(t.chunks.map((e) => e.value)));
2949
2989
  return;
2950
2990
  }
2951
2991
  throw SyntaxError(`${e}<<...>> arguments must be (text or byte) strings or ellipses`);
2952
2992
  }
2953
- function pr(e, t) {
2993
+ function _r(e, t) {
2954
2994
  try {
2955
- return cr.decode(e);
2995
+ return fr.decode(e);
2956
2996
  } catch {
2957
2997
  let n = "t1 concatenation result is not valid UTF-8";
2958
2998
  if (t) t(n);
2959
2999
  else throw SyntaxError(n);
2960
- return lr.decode(e);
3000
+ return pr.decode(e);
2961
3001
  }
2962
3002
  }
2963
- function mr(e, t, n) {
3003
+ function vr(e, t, n) {
2964
3004
  let r = [];
2965
- for (let n of t) fr(e, n, r);
3005
+ for (let n of t) gr(e, n, r);
2966
3006
  let i = e === "t1", a = [], o = !1, s = [], c = () => {
2967
3007
  if (s.length === 0) return;
2968
- let e = dr(s);
2969
- s.length = 0, e.length !== 0 && a.push(i ? new B(pr(e, n)) : new N(e));
3008
+ let e = hr(s);
3009
+ s.length = 0, e.length !== 0 && a.push(i ? new B(_r(e, n)) : new M(e));
2970
3010
  };
2971
- for (let e of r) e === ur ? (c(), a[a.length - 1] instanceof z || (a.push(new z()), o = !0)) : s.push(e);
3011
+ for (let e of r) e === mr ? (c(), a[a.length - 1] instanceof R || (a.push(new R()), o = !0)) : s.push(e);
2972
3012
  if (!o) {
2973
- let e = dr(s);
2974
- return i ? new B(pr(e, n)) : new N(e);
3013
+ let e = hr(s);
3014
+ return i ? new B(_r(e, n)) : new M(e);
2975
3015
  }
2976
- return c(), a.length === 1 ? new z() : new z(a);
3016
+ return c(), a.length === 1 ? new R() : new R(a);
2977
3017
  }
2978
- function hr(e) {
3018
+ function yr(e) {
2979
3019
  return {
2980
3020
  appStringPrefixes: [e],
2981
3021
  preserveAppSeqSource: !0,
2982
3022
  parseAppString(t, n, r) {
2983
- return mr(e, [new B(n)], r);
3023
+ return vr(e, [new B(n)], r);
2984
3024
  },
2985
3025
  parseAppSequence(t, n, r) {
2986
- return mr(e, n, r);
3026
+ return vr(e, n, r);
2987
3027
  }
2988
3028
  };
2989
3029
  }
2990
- var gr = hr("t1"), _r = hr("b1"), vr = new TextEncoder(), yr = new TextDecoder("utf-8", { fatal: !0 }), br = new TextDecoder("utf-8", { fatal: !1 });
2991
- function xr(e) {
3030
+ var br = yr("t1"), xr = yr("b1"), Sr = new TextEncoder(), Cr = new TextDecoder("utf-8", { fatal: !0 }), wr = new TextDecoder("utf-8", { fatal: !1 });
3031
+ function Tr(e) {
2992
3032
  let t = 0;
2993
3033
  for (let n of e) t += n.length;
2994
3034
  let n = new Uint8Array(t), r = 0;
2995
3035
  for (let t of e) n.set(t, r), r += t.length;
2996
3036
  return n;
2997
3037
  }
2998
- function Sr(e, t, n) {
3038
+ function Er(e, t, n) {
2999
3039
  let r = e === "ilts", i = [], a = [];
3000
3040
  for (let o of t) {
3001
- if (o instanceof Ke && (o = o.inner), o instanceof z) throw SyntaxError(`${e}<<...>> cannot contain ellipses; there is no way to include an elision in an indefinite-length string`);
3041
+ if (o instanceof qe && (o = o.inner), o instanceof R) throw SyntaxError(`${e}<<...>> cannot contain ellipses; there is no way to include an elision in an indefinite-length string`);
3002
3042
  let t, s, c;
3003
3043
  if (o instanceof B) t = o.value, c = o.encodingWidth;
3004
- else if (o instanceof N) s = o.value, c = o.encodingWidth;
3005
- else if (o instanceof F) t = o.chunks.map((e) => e.value).join("");
3006
- else if (o instanceof P) s = xr(o.chunks.map((e) => e.value));
3044
+ else if (o instanceof M) s = o.value, c = o.encodingWidth;
3045
+ else if (o instanceof P) t = o.chunks.map((e) => e.value).join("");
3046
+ else if (o instanceof N) s = Tr(o.chunks.map((e) => e.value));
3007
3047
  else throw SyntaxError(`${e}<<...>> arguments must be (text or byte) strings`);
3008
3048
  if (r) {
3009
3049
  let e;
3010
3050
  if (t !== void 0) e = t;
3011
3051
  else try {
3012
- e = yr.decode(s);
3052
+ e = Cr.decode(s);
3013
3053
  } catch {
3014
3054
  let t = "ilts chunk is not valid UTF-8";
3015
3055
  if (n) n(t);
3016
3056
  else throw SyntaxError(t);
3017
- e = br.decode(s);
3057
+ e = wr.decode(s);
3018
3058
  }
3019
3059
  a.push(new B(e, c === void 0 ? void 0 : { encodingWidth: c }));
3020
3060
  } else {
3021
- let e = s ?? vr.encode(t);
3022
- i.push(new N(e, c === void 0 ? void 0 : { encodingWidth: c }));
3061
+ let e = s ?? Sr.encode(t);
3062
+ i.push(new M(e, c === void 0 ? void 0 : { encodingWidth: c }));
3023
3063
  }
3024
3064
  }
3025
- return r ? new F(a) : new P(i);
3065
+ return r ? new P(a) : new N(i);
3026
3066
  }
3027
- function Cr(e) {
3067
+ function Dr(e) {
3028
3068
  return {
3029
3069
  appStringPrefixes: [e],
3030
3070
  preserveAppSeqSource: !0,
3031
3071
  parseAppString(t, n, r) {
3032
- return new Ke(Sr(e, [new B(n)], r), `${e}${xe(n)}`);
3072
+ return new qe(Er(e, [new B(n)], r), `${e}${xe(n)}`);
3033
3073
  },
3034
3074
  parseAppSequence(t, n, r) {
3035
- return Sr(e, n, r);
3075
+ return Er(e, n, r);
3036
3076
  }
3037
3077
  };
3038
3078
  }
3039
- var wr = Cr("ilbs"), Tr = Cr("ilts");
3079
+ var Or = Dr("ilbs"), kr = Dr("ilts");
3040
3080
  //#endregion
3041
3081
  //#region src/utils/strip-comments.ts
3042
- function Er(e) {
3082
+ function Ar(e) {
3043
3083
  let t = "", n = 0;
3044
3084
  for (; n < e.length;) {
3045
3085
  let r = e[n];
@@ -3074,7 +3114,7 @@ function Er(e) {
3074
3114
  }
3075
3115
  //#endregion
3076
3116
  //#region src/extensions/float.ts
3077
- var Dr = class extends j {
3117
+ var jr = class extends A {
3078
3118
  _bits;
3079
3119
  constructor(e) {
3080
3120
  super(C(e), { precision: "half" }), this._bits = e & 65535;
@@ -3086,7 +3126,7 @@ var Dr = class extends j {
3086
3126
  this._bits & 255
3087
3127
  ]);
3088
3128
  }
3089
- }, Or = class extends j {
3129
+ }, Mr = class extends A {
3090
3130
  _raw;
3091
3131
  constructor(e) {
3092
3132
  super(new DataView(e.buffer, e.byteOffset).getFloat32(0, !1), { precision: "single" }), this._raw = e.slice();
@@ -3095,7 +3135,7 @@ var Dr = class extends j {
3095
3135
  let e = /* @__PURE__ */ new Uint8Array(5);
3096
3136
  return e[0] = 250, e.set(this._raw, 1), e;
3097
3137
  }
3098
- }, kr = class extends j {
3138
+ }, Nr = class extends A {
3099
3139
  _raw;
3100
3140
  constructor(e) {
3101
3141
  super(new DataView(e.buffer, e.byteOffset).getFloat64(0, !1), { precision: "double" }), this._raw = e.slice();
@@ -3105,13 +3145,13 @@ var Dr = class extends j {
3105
3145
  return e[0] = 251, e.set(this._raw, 1), e;
3106
3146
  }
3107
3147
  };
3108
- function Z(e) {
3109
- if (e.length === 2) return new Dr(e[0] << 8 | e[1]);
3110
- if (e.length === 4) return new Or(e);
3111
- if (e.length === 8) return new kr(e);
3148
+ function Pr(e) {
3149
+ if (e.length === 2) return new jr(e[0] << 8 | e[1]);
3150
+ if (e.length === 4) return new Mr(e);
3151
+ if (e.length === 8) return new Nr(e);
3112
3152
  throw SyntaxError(`float'...' requires 4, 8, or 16 hex digits (2, 4, or 8 bytes); got ${e.length} bytes`);
3113
3153
  }
3114
- function Ar(e) {
3154
+ function Fr(e) {
3115
3155
  let t = e >>> 15 & 1, n = e >>> 10 & 31, r = e & 1023, i;
3116
3156
  if (n === 31) i = t << 31 | 2139095040 | r << 13;
3117
3157
  else if (n === 0 && r === 0) i = t << 31;
@@ -3123,7 +3163,7 @@ function Ar(e) {
3123
3163
  let a = /* @__PURE__ */ new Uint8Array(4);
3124
3164
  return new DataView(a.buffer).setUint32(0, i >>> 0, !1), a;
3125
3165
  }
3126
- function jr(e) {
3166
+ function Ir(e) {
3127
3167
  let t = e >>> 15 & 1, n = e >>> 10 & 31, r = e & 1023, i = /* @__PURE__ */ new Uint8Array(8), a = new DataView(i.buffer);
3128
3168
  if (n === 31) a.setUint32(0, (t << 31 | 2146435072 | r << 10) >>> 0, !1), a.setUint32(4, 0, !1);
3129
3169
  else if (n === 0 && r === 0) a.setUint32(0, t << 31 >>> 0, !1), a.setUint32(4, 0, !1);
@@ -3134,7 +3174,7 @@ function jr(e) {
3134
3174
  } else a.setUint32(0, (t << 31 | n + 1008 << 20 | r << 10) >>> 0, !1), a.setUint32(4, 0, !1);
3135
3175
  return i;
3136
3176
  }
3137
- function Mr(e) {
3177
+ function Lr(e) {
3138
3178
  let t = new DataView(e.buffer, e.byteOffset).getUint32(0, !1), n = t >>> 31 & 1, r = t >>> 23 & 255, i = t & 8388607, a = /* @__PURE__ */ new Uint8Array(8), o = new DataView(a.buffer);
3139
3179
  if (r === 255) o.setUint32(0, (n << 31 | 2146435072 | i >>> 3) >>> 0, !1), o.setUint32(4, (i & 7) << 29, !1);
3140
3180
  else if (r === 0 && i === 0) o.setUint32(0, n << 31 >>> 0, !1), o.setUint32(4, 0, !1);
@@ -3144,49 +3184,49 @@ function Mr(e) {
3144
3184
  }
3145
3185
  return a;
3146
3186
  }
3147
- function Nr(e, t, n) {
3187
+ function Rr(e, t, n) {
3148
3188
  let r = e.length === 2 ? 1 : e.length === 4 ? 2 : 3;
3149
3189
  if (r === 1) {
3150
3190
  let n = e[0] << 8 | e[1];
3151
- if (t === 2) return new Or(Ar(n));
3152
- if (t === 3) return new kr(jr(n));
3191
+ if (t === 2) return new Mr(Fr(n));
3192
+ if (t === 3) return new Nr(Ir(n));
3153
3193
  }
3154
3194
  if (r === 2) {
3155
- if (t === 3) return new kr(Mr(e));
3195
+ if (t === 3) return new Nr(Lr(e));
3156
3196
  if (t === 1) {
3157
3197
  let t = new DataView(e.buffer, e.byteOffset).getFloat32(0, !1), r = S(t);
3158
- return !Object.is(C(r), t) && !isNaN(t) && n("float'...' value cannot be exactly represented as float16 (_1)"), new Dr(r);
3198
+ return !Object.is(C(r), t) && !isNaN(t) && n("float'...' value cannot be exactly represented as float16 (_1)"), new jr(r);
3159
3199
  }
3160
3200
  }
3161
3201
  if (r === 3) {
3162
3202
  let r = new DataView(e.buffer, e.byteOffset).getFloat64(0, !1);
3163
3203
  if (t === 1) {
3164
3204
  let e = S(r);
3165
- return !Object.is(C(e), r) && !isNaN(r) && n("float'...' value cannot be exactly represented as float16 (_1)"), new Dr(e);
3205
+ return !Object.is(C(e), r) && !isNaN(r) && n("float'...' value cannot be exactly represented as float16 (_1)"), new jr(e);
3166
3206
  }
3167
3207
  if (t === 2) {
3168
3208
  let e = Math.fround(r);
3169
3209
  !Object.is(e, r) && !isNaN(r) && n("float'...' value cannot be exactly represented as float32 (_2)");
3170
3210
  let t = /* @__PURE__ */ new Uint8Array(4);
3171
- return new DataView(t.buffer).setFloat32(0, e, !1), new Or(t);
3211
+ return new DataView(t.buffer).setFloat32(0, e, !1), new Mr(t);
3172
3212
  }
3173
3213
  }
3174
- return Z(e);
3214
+ return Pr(e);
3175
3215
  }
3176
- var Pr = {
3216
+ var zr = {
3177
3217
  appStringPrefixes: ["float"],
3178
3218
  parseAppString(t, n, r, i) {
3179
- let a = Er(n);
3219
+ let a = Ar(n);
3180
3220
  if (!/^[0-9a-fA-F]*$/.test(a)) throw SyntaxError("float'...' contains non-hex characters");
3181
3221
  if (a.length % 2 != 0) throw SyntaxError(`float'...' hex content has odd length (${a.length} digits)`);
3182
3222
  let o = e(a), s = i?.encodingWidth;
3183
- if (s === void 0) return Z(o);
3223
+ if (s === void 0) return Pr(o);
3184
3224
  if (s !== 1 && s !== 2 && s !== 3) {
3185
3225
  let e = `float'...' encoding indicator _${s} is not valid; use _1, _2, or _3`;
3186
- if (r) return r(e), Z(o);
3226
+ if (r) return r(e), Pr(o);
3187
3227
  throw SyntaxError(e);
3188
3228
  }
3189
- return s === (o.length === 2 ? 1 : o.length === 4 ? 2 : 3) ? Z(o) : Nr(o, s, r ?? ((e) => {
3229
+ return s === (o.length === 2 ? 1 : o.length === 4 ? 2 : 3) ? Pr(o) : Rr(o, s, r ?? ((e) => {
3190
3230
  throw SyntaxError(e);
3191
3231
  }));
3192
3232
  },
@@ -3197,40 +3237,57 @@ var Pr = {
3197
3237
  if (n) n(e);
3198
3238
  else throw SyntaxError(e);
3199
3239
  }
3200
- if (!(t[0] instanceof N)) throw SyntaxError("float<<...>> item must be a byte string");
3201
- return Z(t[0].value);
3202
- }
3203
- }, Fr = [
3204
- Kt,
3205
- dn,
3206
- mn,
3207
- Bn,
3208
- or,
3209
- gr,
3210
- _r,
3211
- wr,
3212
- Tr,
3213
- Pr
3214
- ], Ir;
3215
- function Lr() {
3216
- return Ir ??= {
3217
- fromJS: Fr.filter((e) => e.fromJS !== void 0),
3218
- parseTag: Fr.filter((e) => e.parseTag !== void 0)
3240
+ if (!(t[0] instanceof M)) throw SyntaxError("float<<...>> item must be a byte string");
3241
+ return Pr(t[0].value);
3242
+ }
3243
+ }, Br = [
3244
+ Vn,
3245
+ sr,
3246
+ ur
3247
+ ], Vr = [
3248
+ qt,
3249
+ fn,
3250
+ Rn,
3251
+ br,
3252
+ xr,
3253
+ Or,
3254
+ kr,
3255
+ zr
3256
+ ], Hr;
3257
+ function Z(e) {
3258
+ return e === void 0 ? Hr ??= [...Br, ...Vr] : e === !1 ? Br : [...Br, ...e];
3259
+ }
3260
+ //#endregion
3261
+ //#region src/js/fromJS.ts
3262
+ var Ur;
3263
+ function Wr(e) {
3264
+ if (e === void 0) {
3265
+ if (Ur) return Ur;
3266
+ let e = Z(void 0);
3267
+ return Ur = {
3268
+ fromJS: e.filter((e) => e.fromJS !== void 0),
3269
+ parseTag: e.filter((e) => e.parseTag !== void 0)
3270
+ };
3271
+ }
3272
+ let t = Z(e);
3273
+ return {
3274
+ fromJS: t.filter((e) => e.fromJS !== void 0),
3275
+ parseTag: t.filter((e) => e.parseTag !== void 0)
3219
3276
  };
3220
3277
  }
3221
- function Rr(e) {
3222
- let t = e?.extensions, n = Lr();
3278
+ function Gr(e) {
3279
+ let t = e?.extensions, n = Wr(e?.builtinExtensions);
3223
3280
  return t?.length ? {
3224
3281
  fromJS: [...t.filter((e) => e.fromJS !== void 0), ...n.fromJS],
3225
3282
  parseTag: [...t.filter((e) => e.parseTag !== void 0), ...n.parseTag]
3226
3283
  } : n;
3227
3284
  }
3228
- function zr(e, t) {
3285
+ function Kr(e, t) {
3229
3286
  if (t?.replacer) {
3230
- let { replacer: n, ...r } = t, i = Vr(e, n, r.extensions, r.undefinedOmits);
3231
- return i === h ? R.UNDEFINED : zr(i, Object.keys(r).length > 0 ? r : void 0);
3287
+ let { replacer: n, ...r } = t, i = Jr(e, n, r.extensions, r.undefinedOmits, r.builtinExtensions);
3288
+ return i === h ? L.UNDEFINED : Kr(i, Object.keys(r).length > 0 ? r : void 0);
3232
3289
  }
3233
- return Q(e, t, !0, Rr(t));
3290
+ return Q(e, t, !0, Gr(t));
3234
3291
  }
3235
3292
  function Q(e, t, n, r) {
3236
3293
  for (let n of r.fromJS) {
@@ -3243,36 +3300,36 @@ function Q(e, t, n, r) {
3243
3300
  let t = e.parseTag(n, i);
3244
3301
  if (t !== void 0) return t;
3245
3302
  }
3246
- return new M(n, i);
3247
- }
3248
- if (e instanceof m.Null) return R.NULL;
3249
- if (e instanceof m.Undefined) return R.UNDEFINED;
3250
- if (e instanceof g) return new R(e.value);
3251
- if (e === null) return R.NULL;
3252
- if (e === void 0) return R.UNDEFINED;
3253
- if (e === !0) return R.TRUE;
3254
- if (e === !1) return R.FALSE;
3255
- if (typeof e == "bigint") return e > 18446744073709551615n ? new et(e) : e < -18446744073709551616n ? new tt(e) : e >= 0n ? new k(e) : new A(e);
3256
- if (typeof e == "number") return (t?.encodeIntegerAs ?? "int") === "int" && Number.isInteger(e) && !Object.is(e, -0) ? e >= 0 ? new k(BigInt(e)) : new A(BigInt(e)) : new j(e);
3303
+ return new j(n, i);
3304
+ }
3305
+ if (e instanceof m.Null) return L.NULL;
3306
+ if (e instanceof m.Undefined) return L.UNDEFINED;
3307
+ if (e instanceof g) return new L(e.value);
3308
+ if (e === null) return L.NULL;
3309
+ if (e === void 0) return L.UNDEFINED;
3310
+ if (e === !0) return L.TRUE;
3311
+ if (e === !1) return L.FALSE;
3312
+ if (typeof e == "bigint") return e > 18446744073709551615n ? new tt(e) : e < -18446744073709551616n ? new nt(e) : e >= 0n ? new O(e) : new k(e);
3313
+ if (typeof e == "number") return (t?.encodeIntegerAs ?? "int") === "int" && Number.isInteger(e) && !Object.is(e, -0) ? e >= 0 ? new O(BigInt(e)) : new k(BigInt(e)) : new A(e);
3257
3314
  if (typeof e == "string") return new B(e);
3258
3315
  if (e instanceof Number || e instanceof Boolean || e instanceof String || Object.prototype.toString.call(e) === "[object BigInt]") return Q(e.valueOf(), t, !1, r);
3259
- if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return new N(new Uint8Array(e));
3260
- if (ArrayBuffer.isView(e)) return e instanceof Uint8Array && t?.uint8ArrayAs === "array" ? new I(Array.from(e, (e) => new k(BigInt(e)))) : new N(new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
3261
- if (e instanceof $) return new L([...e].map(([e, n]) => [Q(e, t, !0, r), Q(n, t, !0, r)]));
3262
- if (Array.isArray(e)) return new I(e.map((e) => Q(e, t, !0, r)));
3316
+ if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return new M(new Uint8Array(e));
3317
+ if (ArrayBuffer.isView(e)) return e instanceof Uint8Array && t?.uint8ArrayAs === "array" ? new F(Array.from(e, (e) => new O(BigInt(e)))) : new M(new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
3318
+ if (e instanceof $) return new I([...e].map(([e, n]) => [Q(e, t, !0, r), Q(n, t, !0, r)]));
3319
+ if (Array.isArray(e)) return new F(e.map((e) => Q(e, t, !0, r)));
3263
3320
  if (typeof e == "object") {
3264
3321
  let n = [];
3265
3322
  for (let [i, a] of Object.entries(e)) n.push([new B(i), Q(a, t, !0, r)]);
3266
- return new L(n);
3323
+ return new I(n);
3267
3324
  }
3268
3325
  throw TypeError(`fromJS: unsupported value type: ${typeof e}`);
3269
3326
  }
3270
- function Br(e) {
3327
+ function qr(e) {
3271
3328
  return ArrayBuffer.isView(e) || e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer || e instanceof Number || e instanceof Boolean || e instanceof String || Object.prototype.toString.call(e) === "[object BigInt]" || e instanceof m.Null || e instanceof m.Undefined || e instanceof g;
3272
3329
  }
3273
- function Vr(e, t, n, r) {
3274
- let i = [...n ?? [], ...Fr].filter((e) => e.isJSType !== void 0);
3275
- function a(e) {
3330
+ function Jr(e, t, n, r, i) {
3331
+ let a = [...n ?? [], ...Z(i)].filter((e) => e.isJSType !== void 0);
3332
+ function o(e) {
3276
3333
  return e === h || r === !0 && e === void 0;
3277
3334
  }
3278
3335
  if (Array.isArray(t)) {
@@ -3281,20 +3338,20 @@ function Vr(e, t, n, r) {
3281
3338
  if (typeof e != "object" || !e) return e;
3282
3339
  if (e instanceof $) return $.from(e, ([e, t]) => [e, r(t)]);
3283
3340
  if (Array.isArray(e)) return e.map(r);
3284
- if (m.symbol in e || Br(e) || i.some((t) => t.isJSType(e))) return e;
3341
+ if (m.symbol in e || qr(e) || a.some((t) => t.isJSType(e))) return e;
3285
3342
  let t = Object.getPrototypeOf(e);
3286
3343
  if (t === Object.prototype || t === null) {
3287
3344
  let t = e.toJSON;
3288
3345
  if (typeof t == "function") return r(t.call(e));
3289
3346
  }
3290
- let a = {};
3291
- for (let t of n) Object.prototype.hasOwnProperty.call(e, t) && (a[t] = r(e[t]));
3292
- return a;
3347
+ let i = {};
3348
+ for (let t of n) Object.prototype.hasOwnProperty.call(e, t) && (i[t] = r(e[t]));
3349
+ return i;
3293
3350
  }
3294
3351
  return r(e);
3295
3352
  }
3296
- let o = t;
3297
- function s(e, t, n) {
3353
+ let s = t;
3354
+ function c(e, t, n) {
3298
3355
  if (typeof e == "object" && e && !(e instanceof $)) {
3299
3356
  let n = Object.getPrototypeOf(e);
3300
3357
  if (n === Object.prototype || n === null) {
@@ -3302,31 +3359,31 @@ function Vr(e, t, n, r) {
3302
3359
  typeof n == "function" && (e = n.call(e, t));
3303
3360
  }
3304
3361
  }
3305
- if (e = o.call(n, t, e), typeof e == "object" && e) {
3362
+ if (e = s.call(n, t, e), typeof e == "object" && e) {
3306
3363
  if (m.symbol in e) return e;
3307
3364
  if (e instanceof $) {
3308
3365
  let t = new $();
3309
3366
  for (let [n, r] of e) {
3310
- let i = s(r, n, e);
3311
- a(i) || t.push([n, i]);
3367
+ let i = c(r, n, e);
3368
+ o(i) || t.push([n, i]);
3312
3369
  }
3313
3370
  return t;
3314
3371
  }
3315
3372
  if (Array.isArray(e)) return e.map((t, n) => {
3316
- let r = s(t, String(n), e);
3317
- return a(r) ? null : r;
3373
+ let r = c(t, String(n), e);
3374
+ return o(r) ? null : r;
3318
3375
  });
3319
- if (Br(e) || i.some((t) => t.isJSType(e))) return e;
3376
+ if (qr(e) || a.some((t) => t.isJSType(e))) return e;
3320
3377
  let t = {};
3321
3378
  for (let n of Object.keys(e)) {
3322
- let r = s(e[n], n, e);
3323
- a(r) || (t[n] = r);
3379
+ let r = c(e[n], n, e);
3380
+ o(r) || (t[n] = r);
3324
3381
  }
3325
3382
  return t;
3326
3383
  }
3327
3384
  return e;
3328
3385
  }
3329
- return s(e, "", { "": e });
3386
+ return c(e, "", { "": e });
3330
3387
  }
3331
3388
  //#endregion
3332
3389
  //#region src/mapEntries.ts
@@ -3334,7 +3391,7 @@ var $ = class extends Array {
3334
3391
  toJSON() {
3335
3392
  let e = {};
3336
3393
  for (let [t, n] of this) {
3337
- let r = typeof t == "string" ? t : zr(t).toCDN();
3394
+ let r = typeof t == "string" ? t : Kr(t).toCDN();
3338
3395
  r === "__proto__" ? Object.defineProperty(e, r, {
3339
3396
  value: n,
3340
3397
  writable: !0,
@@ -3346,6 +3403,6 @@ var $ = class extends Array {
3346
3403
  }
3347
3404
  };
3348
3405
  //#endregion
3349
- export { o as A, M as C, O as D, k as E, m as M, c as N, g as O, N as S, A as T, R as _, Er as a, F as b, _r as c, qt as d, B as f, Ue as g, et as h, Pr as i, s as j, h as k, gr as l, tt as m, Vr as n, wr as o, at as p, zr as r, Tr as s, $ as t, ir as u, L as v, j as w, P as x, I as y };
3406
+ export { O as A, F as C, j as D, M as E, s as F, m as I, c as L, g as M, h as N, A as O, o as P, I as S, N as T, ot as _, zr as a, We as b, kr as c, ar as d, Rn as f, B as g, Jt as h, Vr as i, D as j, k, xr as l, qt as m, Jr as n, Ar as o, fn as p, Kr as r, Or as s, $ as t, br as u, nt as v, P as w, L as x, tt as y };
3350
3407
 
3351
- //# sourceMappingURL=mapEntries-BdzS6bFp.js.map
3408
+ //# sourceMappingURL=mapEntries-KwZz9nq2.js.map