@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.
- package/README.ja.md +42 -0
- package/README.md +42 -0
- package/dist/ast/index.cjs +1 -1
- package/dist/ast/index.js +2 -2
- package/dist/extensions/builtins.d.ts +24 -1
- package/dist/extensions/ellipsis.d.ts +3 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +149 -149
- package/dist/index.js.map +1 -1
- package/dist/js/fromJS.d.ts +1 -1
- package/dist/mapEntries-CZLpI8fS.cjs +14 -0
- package/dist/mapEntries-CZLpI8fS.cjs.map +1 -0
- package/dist/{mapEntries-BdzS6bFp.js → mapEntries-KwZz9nq2.js} +627 -570
- package/dist/mapEntries-KwZz9nq2.js.map +1 -0
- package/dist/types.d.ts +55 -0
- package/package.json +7 -7
- package/dist/mapEntries-BdzS6bFp.js.map +0 -1
- package/dist/mapEntries-DJtvWpWq.cjs +0 -14
- package/dist/mapEntries-DJtvWpWq.cjs.map +0 -1
|
@@ -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
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
550
|
-
function
|
|
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
|
|
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
|
-
|
|
574
|
-
let r =
|
|
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
|
|
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 ??
|
|
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 ??
|
|
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 =
|
|
605
|
-
return (e?.floatFormat === "hex" ?
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
995
|
-
super(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1018
|
+
}, Je = 888n, R = class extends j {
|
|
1019
1019
|
constructor(e) {
|
|
1020
|
-
e === void 0 ? super(
|
|
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
|
|
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
|
-
},
|
|
1026
|
-
function
|
|
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
|
|
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
|
|
1040
|
+
var tt = class extends j {
|
|
1041
1041
|
bigValue;
|
|
1042
1042
|
constructor(e) {
|
|
1043
|
-
if (e <=
|
|
1044
|
-
super(
|
|
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
|
-
},
|
|
1052
|
+
}, nt = class extends j {
|
|
1053
1053
|
bigValue;
|
|
1054
1054
|
constructor(e) {
|
|
1055
|
-
if (e >=
|
|
1056
|
-
super(
|
|
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
|
-
},
|
|
1065
|
-
function
|
|
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
|
|
1070
|
-
return t?.preserveComments &&
|
|
1069
|
+
}), r = new vt(n, t ?? {}).parse();
|
|
1070
|
+
return t?.preserveComments && dt(r, n.comments, e), r;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
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
|
|
1079
|
+
function ct(e) {
|
|
1080
1080
|
return e.startsWith("-") ? -BigInt(e.slice(1)) : BigInt(e);
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
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:
|
|
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
|
|
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
|
|
1150
|
+
function dt(e, t, n) {
|
|
1151
1151
|
if (t.length === 0) return;
|
|
1152
|
-
let r =
|
|
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
|
-
|
|
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
|
-
|
|
1177
|
+
pt(m.node, "leading", r);
|
|
1178
1178
|
continue;
|
|
1179
1179
|
}
|
|
1180
|
-
|
|
1180
|
+
pt(p?.node ?? e, "dangling", r);
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1201
|
+
e instanceof j && n(e.content);
|
|
1202
1202
|
};
|
|
1203
1203
|
return n(e), t;
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function pt(e, t, n) {
|
|
1206
1206
|
e.comments ??= {}, e.comments[t] ??= [], e.comments[t].push(n);
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
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
|
|
1223
|
-
["b32",
|
|
1224
|
-
["h32",
|
|
1225
|
-
["same",
|
|
1226
|
-
["hash",
|
|
1227
|
-
["uuid",
|
|
1228
|
-
["UUID",
|
|
1229
|
-
]
|
|
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
|
-
|
|
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
|
|
1290
|
-
case "EMPTY_INDEF_TEXT": return this.t.consume(), new
|
|
1291
|
-
case "TRUE": return this.t.consume(), new
|
|
1292
|
-
case "FALSE": return this.t.consume(), new
|
|
1293
|
-
case "NULL": return this.t.consume(), new
|
|
1294
|
-
case "UNDEFINED": return this.t.consume(), new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1352
|
-
else if (i.preserveAppSeqSource) return new
|
|
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
|
|
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
|
|
1362
|
-
let e = [new
|
|
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
|
|
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 } =
|
|
1372
|
-
if (i > 18446744073709551615n) return this.t.peek().type === "LPAREN" && this._fail("tag number exceeds maximum uint64", e), new
|
|
1373
|
-
if (i < -18446744073709551616n) return new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 } =
|
|
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
|
|
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(
|
|
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(
|
|
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
|
|
1422
|
-
return i !== "" && r.push(new B(i)), new
|
|
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
|
|
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
|
|
1465
|
+
if (this._options.allowInvalidUtf8) return at.decode(e);
|
|
1454
1466
|
try {
|
|
1455
|
-
return
|
|
1467
|
+
return it.decode(e);
|
|
1456
1468
|
} catch {
|
|
1457
|
-
return this._warnOrFail("byte string in text concatenation is not valid UTF-8", t),
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
1501
|
-
return s(), new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 } =
|
|
1541
|
-
return this.expect("RPAREN"), new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1618
|
-
let e = new
|
|
1619
|
-
if (e instanceof
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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
|
-
...
|
|
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,
|
|
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 ?
|
|
1746
|
+
throw new r(e, t ? yt(t) : void 0);
|
|
1735
1747
|
}
|
|
1736
1748
|
};
|
|
1737
|
-
function
|
|
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
|
|
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(
|
|
1760
|
-
return
|
|
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
|
|
1767
|
-
let { cdn: a, newline: o } =
|
|
1768
|
-
if (s === null) return c === void 0 ? Se(e) + t :
|
|
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 ?
|
|
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
|
|
1779
|
-
e.push(...
|
|
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
|
|
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 ?
|
|
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 =
|
|
1793
|
-
return d.length <= 1 ? Se(e) + t :
|
|
1804
|
+
let d = Ft(e, u);
|
|
1805
|
+
return d.length <= 1 ? Se(e) + t : Ct(d, t, s, r);
|
|
1794
1806
|
}
|
|
1795
|
-
function
|
|
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
|
|
1809
|
-
let t = e?.splitCdn === void 0 || e?.splitNewline === void 0 ?
|
|
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
|
|
1816
|
-
return e.map((e) => e === "cboredn" ? (
|
|
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
|
|
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
|
|
1847
|
+
function Dt(e) {
|
|
1836
1848
|
try {
|
|
1837
|
-
|
|
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 &&
|
|
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" &&
|
|
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" &&
|
|
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
|
-
|
|
1871
|
+
jt.has(a.type) ? (r++, i = {
|
|
1860
1872
|
point: a.endOffset,
|
|
1861
1873
|
contentDepth: r,
|
|
1862
1874
|
kind: "opener"
|
|
1863
|
-
}) :
|
|
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
|
|
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 (
|
|
1884
|
-
else if (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
]),
|
|
1936
|
+
]), Mt = /* @__PURE__ */ new Set([
|
|
1925
1937
|
"RBRACKET",
|
|
1926
1938
|
"RBRACE",
|
|
1927
1939
|
"RPAREN",
|
|
1928
1940
|
"GT_GT"
|
|
1929
1941
|
]);
|
|
1930
|
-
function
|
|
1942
|
+
function Nt(e, t, n) {
|
|
1931
1943
|
return e.some((e) => e.start >= t && e.end <= n);
|
|
1932
1944
|
}
|
|
1933
|
-
function
|
|
1945
|
+
function Pt(e, t, n) {
|
|
1934
1946
|
return /^[\t\n\r ]*$/.test(e.slice(t, n));
|
|
1935
1947
|
}
|
|
1936
|
-
function
|
|
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
|
|
1963
|
-
function
|
|
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
|
|
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
|
|
1971
|
-
function
|
|
1972
|
-
if (!
|
|
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
|
|
1995
|
+
return e >= 0 ? new Vt(BigInt(e)) : new Ht(BigInt(e));
|
|
1984
1996
|
}
|
|
1985
|
-
return new
|
|
1997
|
+
return new Ut(a / 1e3 + i);
|
|
1986
1998
|
}
|
|
1987
|
-
var
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
2026
|
+
}, Wt = class extends j {
|
|
2015
2027
|
constructor(e, t) {
|
|
2016
|
-
super(
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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
|
|
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
|
|
2049
|
+
function Kt(e) {
|
|
2038
2050
|
let t = e?.jsDate ?? !1;
|
|
2039
2051
|
function n(e) {
|
|
2040
|
-
return t ? new
|
|
2052
|
+
return t ? new Gt(e) : new Wt(e);
|
|
2041
2053
|
}
|
|
2042
2054
|
let r = {
|
|
2043
2055
|
appStringPrefixes: ["dt", "DT"],
|
|
2044
|
-
tagNumbers: [
|
|
2056
|
+
tagNumbers: [Bt],
|
|
2045
2057
|
parseAppString(e, t, r) {
|
|
2046
|
-
return e === "DT" ? n(t) :
|
|
2058
|
+
return e === "DT" ? n(t) : zt(t, r);
|
|
2047
2059
|
},
|
|
2048
2060
|
parseAppSequence(e, t, r) {
|
|
2049
|
-
let i =
|
|
2050
|
-
return e === "DT" ? n(i) :
|
|
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
|
|
2056
|
-
else if (n instanceof
|
|
2057
|
-
else if (n instanceof
|
|
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
|
|
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
|
|
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
|
|
2078
|
+
var qt = Kt(), Jt = Kt({ jsDate: !0 });
|
|
2067
2079
|
//#endregion
|
|
2068
2080
|
//#region src/utils/ip.ts
|
|
2069
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
2115
|
+
function Zt(e) {
|
|
2104
2116
|
return Array.from(e).join(".");
|
|
2105
2117
|
}
|
|
2106
|
-
function
|
|
2107
|
-
let t = e.slice(0, 10).every((e) => e === 0) && e[10] === 255 && e[11] === 255 ?
|
|
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
|
|
2122
|
-
function
|
|
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
|
|
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
|
|
2141
|
+
function rn(e) {
|
|
2130
2142
|
return /^\d/.test(e) && e.includes(".") && !e.includes(":") ? {
|
|
2131
|
-
bytes:
|
|
2143
|
+
bytes: Yt(e),
|
|
2132
2144
|
isV4: !0
|
|
2133
2145
|
} : {
|
|
2134
|
-
bytes:
|
|
2146
|
+
bytes: Xt(e),
|
|
2135
2147
|
isV4: !1
|
|
2136
2148
|
};
|
|
2137
2149
|
}
|
|
2138
|
-
function
|
|
2139
|
-
if (e.length === 4) return
|
|
2140
|
-
if (e.length === 16) return
|
|
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
|
|
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
|
|
2165
|
+
function sn(e, t) {
|
|
2154
2166
|
let n = new Uint8Array(t);
|
|
2155
2167
|
return n.set(e), n;
|
|
2156
2168
|
}
|
|
2157
|
-
var
|
|
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 `${
|
|
2173
|
+
return `${$t}'${an(this.value)}'${n}`;
|
|
2162
2174
|
}
|
|
2163
|
-
},
|
|
2175
|
+
}, ln = class extends F {
|
|
2164
2176
|
_isV4;
|
|
2165
2177
|
constructor(e, t, n) {
|
|
2166
|
-
super([new
|
|
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 `${
|
|
2183
|
+
return `${$t}'${an(sn(r, this._isV4 ? 4 : 16))}/${n}'`;
|
|
2172
2184
|
}
|
|
2173
|
-
},
|
|
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
|
|
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}'${
|
|
2195
|
+
return `${H}'${an(r.value)}'${n}`;
|
|
2184
2196
|
}
|
|
2185
|
-
if (r instanceof
|
|
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 =
|
|
2188
|
-
return `${H}'${
|
|
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
|
|
2205
|
+
function dn(e, t) {
|
|
2194
2206
|
let n = t.indexOf("/");
|
|
2195
2207
|
if (n === -1) {
|
|
2196
|
-
let { bytes: n, isV4: r } =
|
|
2197
|
-
return e === H ? new
|
|
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 } =
|
|
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 =
|
|
2204
|
-
return e === H ? new
|
|
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
|
|
2207
|
-
appStringPrefixes: [
|
|
2208
|
-
tagNumbers: [U,
|
|
2218
|
+
var fn = {
|
|
2219
|
+
appStringPrefixes: [$t, H],
|
|
2220
|
+
tagNumbers: [U, en],
|
|
2209
2221
|
parseAppString(e, t) {
|
|
2210
|
-
return
|
|
2222
|
+
return dn(e, t);
|
|
2211
2223
|
},
|
|
2212
2224
|
parseAppSequence(e, t) {
|
|
2213
|
-
return
|
|
2225
|
+
return dn(e, nn(t));
|
|
2214
2226
|
},
|
|
2215
2227
|
parseTag(e, t) {
|
|
2216
|
-
if (!(e !== U && e !==
|
|
2228
|
+
if (!(e !== U && e !== en) && (t instanceof M || t instanceof F)) return new un(e, t);
|
|
2217
2229
|
}
|
|
2218
|
-
},
|
|
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
|
-
]),
|
|
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
|
|
2252
|
-
function
|
|
2253
|
-
return Array.from(
|
|
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 :
|
|
2255
|
+
for (let r of e) n += t(r) ? r : bn(r);
|
|
2258
2256
|
return n;
|
|
2259
2257
|
}
|
|
2260
|
-
function
|
|
2258
|
+
function xn(e) {
|
|
2261
2259
|
return /[A-Za-z0-9\-._~]/.test(e);
|
|
2262
2260
|
}
|
|
2263
|
-
function
|
|
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) ||
|
|
2271
|
+
return Cn(e) || e === "/" || e === "?";
|
|
2268
2272
|
}
|
|
2269
2273
|
function En(e) {
|
|
2270
|
-
return (
|
|
2274
|
+
return xn(e) || Sn(e) || e === ":";
|
|
2271
2275
|
}
|
|
2272
2276
|
function Dn(e) {
|
|
2273
|
-
return
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
2300
|
+
t.push(new O(BigInt(e)));
|
|
2303
2301
|
}
|
|
2304
|
-
return new
|
|
2302
|
+
return new F(t);
|
|
2305
2303
|
}
|
|
2306
|
-
function
|
|
2304
|
+
function kn(e) {
|
|
2307
2305
|
let t = e.items, n = 0, r = "";
|
|
2308
|
-
if (n < t.length && t[n] instanceof
|
|
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,
|
|
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
|
|
2313
|
+
if (i instanceof M) {
|
|
2316
2314
|
n++;
|
|
2317
2315
|
let { length: e } = i.value;
|
|
2318
|
-
if (e === 4) r +=
|
|
2319
|
-
else if (e === 16) r += "[" +
|
|
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,
|
|
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,
|
|
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
|
|
2325
|
+
return n < t.length && t[n] instanceof O && (r += ":" + t[n].value.toString()), r;
|
|
2328
2326
|
}
|
|
2329
|
-
function
|
|
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:
|
|
2330
|
+
authority: On(r),
|
|
2333
2331
|
pathSegments: i
|
|
2334
2332
|
};
|
|
2335
2333
|
}
|
|
2336
|
-
function
|
|
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 =
|
|
2347
|
-
if (o.push(n === void 0 ? new B(e) : new
|
|
2348
|
-
let { authority: e, pathSegments: n } =
|
|
2349
|
-
o.push(e, new
|
|
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(
|
|
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(
|
|
2353
|
+
o.push(L.TRUE, new F(e));
|
|
2356
2354
|
}
|
|
2357
2355
|
} else if (t.startsWith("//")) {
|
|
2358
|
-
let { authority: e, pathSegments: n } =
|
|
2359
|
-
o.push(
|
|
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(
|
|
2363
|
-
} else if (t === "") o.push(new
|
|
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
|
|
2367
|
+
o.push(new O(n), new F(a));
|
|
2370
2368
|
}
|
|
2371
|
-
if (i !== null && o.push(new
|
|
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
|
|
2371
|
+
e instanceof F && e.items.length === 0 && o.pop();
|
|
2374
2372
|
}
|
|
2375
|
-
return o.length === 1 && o[0] instanceof
|
|
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
|
|
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,
|
|
2383
|
+
return G(e.value, wn);
|
|
2386
2384
|
});
|
|
2387
2385
|
r += "?" + e.join("&");
|
|
2388
2386
|
}
|
|
2389
|
-
} else t instanceof
|
|
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,
|
|
2389
|
+
return n < e.length && e[n] instanceof B && (r += "#" + G(e[n].value, Tn)), r;
|
|
2392
2390
|
}
|
|
2393
|
-
function
|
|
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,
|
|
2394
|
+
return G(e.value, Cn);
|
|
2397
2395
|
});
|
|
2398
2396
|
}
|
|
2399
|
-
function
|
|
2397
|
+
function Nn(e) {
|
|
2400
2398
|
if (e.length === 0) return "";
|
|
2401
2399
|
let t = 0, n = e[t++];
|
|
2402
|
-
if (n instanceof
|
|
2400
|
+
if (n instanceof k || n instanceof B) {
|
|
2403
2401
|
let r;
|
|
2404
|
-
if (n instanceof
|
|
2405
|
-
let e =
|
|
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
|
|
2412
|
-
else if (i instanceof
|
|
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
|
|
2415
|
+
if (t < e.length && e[t] instanceof F) {
|
|
2418
2416
|
let n = e[t++];
|
|
2419
|
-
n.items.length > 0 && (s = (o ? "/" : "") +
|
|
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
|
|
2424
|
-
if (t >= e.length || !(e[t] instanceof
|
|
2425
|
-
let n =
|
|
2426
|
-
if (t < e.length && e[t] instanceof
|
|
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 = "/" +
|
|
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
|
|
2430
|
+
if (n instanceof L && n.value === 21) {
|
|
2433
2431
|
let n = "/";
|
|
2434
|
-
if (t < e.length && e[t] instanceof
|
|
2432
|
+
if (t < e.length && e[t] instanceof F) {
|
|
2435
2433
|
let r = e[t++];
|
|
2436
|
-
n = "/" +
|
|
2434
|
+
n = "/" + Mn(r).join("/");
|
|
2437
2435
|
}
|
|
2438
2436
|
return n + K(e, t);
|
|
2439
2437
|
}
|
|
2440
|
-
if (n instanceof
|
|
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
|
|
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 =
|
|
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
|
|
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 `${
|
|
2458
|
+
return `${pn}'${Nn(this.items)}'${t}`;
|
|
2461
2459
|
} catch {
|
|
2462
2460
|
return super._toCDN(e, t);
|
|
2463
2461
|
}
|
|
2464
2462
|
}
|
|
2465
|
-
},
|
|
2463
|
+
}, Fn = class extends j {
|
|
2466
2464
|
constructor(e) {
|
|
2467
|
-
super(
|
|
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(
|
|
2475
|
-
return `${
|
|
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
|
|
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
|
|
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
|
|
2489
|
-
let n = new
|
|
2490
|
-
return e ===
|
|
2486
|
+
function Ln(e, t) {
|
|
2487
|
+
let n = new Pn(jn(t));
|
|
2488
|
+
return e === mn ? new Fn(n) : n;
|
|
2491
2489
|
}
|
|
2492
|
-
var
|
|
2493
|
-
appStringPrefixes: [
|
|
2494
|
-
tagNumbers: [
|
|
2490
|
+
var Rn = {
|
|
2491
|
+
appStringPrefixes: [pn, mn],
|
|
2492
|
+
tagNumbers: [hn],
|
|
2495
2493
|
parseAppString(e, t) {
|
|
2496
|
-
return
|
|
2494
|
+
return Ln(e, t);
|
|
2497
2495
|
},
|
|
2498
2496
|
parseAppSequence(e, t) {
|
|
2499
|
-
return
|
|
2497
|
+
return Ln(e, In(t));
|
|
2500
2498
|
},
|
|
2501
2499
|
parseTag(e, t) {
|
|
2502
|
-
if (e !== 99n || !(t instanceof
|
|
2503
|
-
let n = new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2536
|
+
var Wn = new TextDecoder("utf-8", {
|
|
2525
2537
|
fatal: !0,
|
|
2526
2538
|
ignoreBOM: !0
|
|
2527
|
-
}),
|
|
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
|
|
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
|
|
2547
|
-
if (e instanceof
|
|
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
|
|
2550
|
-
if (e instanceof
|
|
2551
|
-
if (e instanceof
|
|
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
|
|
2557
|
-
if (e instanceof
|
|
2558
|
-
if (e instanceof
|
|
2559
|
-
if (e instanceof
|
|
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
|
|
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
|
|
2572
|
-
if (e instanceof
|
|
2573
|
-
if (e instanceof
|
|
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
|
|
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
|
|
2581
|
-
if (e instanceof
|
|
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
|
|
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
|
|
2589
|
-
function
|
|
2590
|
-
return
|
|
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
|
|
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
|
|
2608
|
+
function Qn(e, t, n) {
|
|
2597
2609
|
if (n <= 23) return {
|
|
2598
|
-
value:
|
|
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
|
|
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
|
|
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
|
|
2666
|
-
let i =
|
|
2667
|
-
t.has(i) && n.push(
|
|
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 =
|
|
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
|
|
2685
|
+
function nr(e, t, n) {
|
|
2674
2686
|
return new Uint8Array(e.buffer, e.byteOffset + t, n).slice();
|
|
2675
2687
|
}
|
|
2676
|
-
function
|
|
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 } =
|
|
2693
|
+
let { value: n, nextOffset: r } = Qn(e, t, o);
|
|
2682
2694
|
return {
|
|
2683
|
-
value: new
|
|
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 } =
|
|
2700
|
+
let { value: n, nextOffset: r } = Qn(e, t, o), i = Hn(o, n);
|
|
2689
2701
|
return {
|
|
2690
|
-
value: new
|
|
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 } =
|
|
2708
|
+
let { chunks: i, nextOffset: a } = er(e, t, n, r, "byte string", (e) => e instanceof M);
|
|
2697
2709
|
return {
|
|
2698
|
-
value: new
|
|
2710
|
+
value: new N(i),
|
|
2699
2711
|
nextOffset: a
|
|
2700
2712
|
};
|
|
2701
2713
|
}
|
|
2702
|
-
let { value: i, nextOffset: a } =
|
|
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
|
|
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 } =
|
|
2722
|
+
let { chunks: i, nextOffset: a } = er(e, t, n, r, "text string", (e) => e instanceof B);
|
|
2711
2723
|
return {
|
|
2712
|
-
value: new
|
|
2724
|
+
value: new P(i),
|
|
2713
2725
|
nextOffset: a
|
|
2714
2726
|
};
|
|
2715
2727
|
}
|
|
2716
|
-
let { value: i, nextOffset: a } =
|
|
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 ?
|
|
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 =
|
|
2733
|
+
l = Wn.decode(c);
|
|
2722
2734
|
} catch {
|
|
2723
|
-
u =
|
|
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
|
|
2755
|
+
value: new F(i, { indefiniteLength: !0 }),
|
|
2744
2756
|
nextOffset: a
|
|
2745
2757
|
};
|
|
2746
2758
|
}
|
|
2747
|
-
let { value: i, nextOffset: 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
|
|
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
|
-
|
|
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
|
|
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 } =
|
|
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
|
-
|
|
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
|
|
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 } =
|
|
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
|
|
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
|
|
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
|
|
2820
|
+
value: new L(o),
|
|
2809
2821
|
nextOffset: t
|
|
2810
2822
|
};
|
|
2811
2823
|
if (o === 20) return {
|
|
2812
|
-
value: new
|
|
2824
|
+
value: new L(20),
|
|
2813
2825
|
nextOffset: t
|
|
2814
2826
|
};
|
|
2815
2827
|
if (o === 21) return {
|
|
2816
|
-
value: new
|
|
2828
|
+
value: new L(21),
|
|
2817
2829
|
nextOffset: t
|
|
2818
2830
|
};
|
|
2819
2831
|
if (o === 22) return {
|
|
2820
|
-
value: new
|
|
2832
|
+
value: new L(22),
|
|
2821
2833
|
nextOffset: t
|
|
2822
2834
|
};
|
|
2823
2835
|
if (o === 23) return {
|
|
2824
|
-
value: new
|
|
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 =
|
|
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
|
|
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
|
|
2858
|
+
value: new A(n, {
|
|
2847
2859
|
precision: "half",
|
|
2848
|
-
rawBits: Number.isNaN(n) ?
|
|
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
|
|
2869
|
+
value: new A(n, {
|
|
2858
2870
|
precision: "single",
|
|
2859
|
-
rawBits: Number.isNaN(n) ?
|
|
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
|
|
2880
|
+
value: new A(n, {
|
|
2869
2881
|
precision: "double",
|
|
2870
|
-
rawBits: Number.isNaN(n) ?
|
|
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
|
|
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
|
|
2885
|
-
let n =
|
|
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), ...
|
|
2888
|
-
if (!t?.allowTrailing &&
|
|
2889
|
-
J(
|
|
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 =
|
|
2894
|
-
for (; n < r.byteLength;) ({nextOffset: n} = X(r, n, e,
|
|
2905
|
+
}, n = c;
|
|
2906
|
+
for (; n < r.byteLength;) ({nextOffset: n} = X(r, n, e, o));
|
|
2895
2907
|
}
|
|
2896
|
-
return
|
|
2908
|
+
return s;
|
|
2897
2909
|
}
|
|
2898
2910
|
//#endregion
|
|
2899
2911
|
//#region src/extensions/cbordata.ts
|
|
2900
|
-
var
|
|
2901
|
-
tagNumbers: [
|
|
2912
|
+
var or = 24n, sr = {
|
|
2913
|
+
tagNumbers: [or],
|
|
2902
2914
|
parseTag(e, t, n) {
|
|
2903
|
-
if (e !== 24n || !(t instanceof
|
|
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
|
|
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
|
-
}
|
|
2918
|
-
|
|
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
|
|
2926
|
-
if (t instanceof
|
|
2927
|
-
|
|
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
|
|
2931
|
-
if (t.content instanceof
|
|
2932
|
-
else n.push(
|
|
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(
|
|
2976
|
+
n.push(dr.encode(t.value));
|
|
2937
2977
|
return;
|
|
2938
2978
|
}
|
|
2939
|
-
if (t instanceof
|
|
2979
|
+
if (t instanceof M) {
|
|
2940
2980
|
n.push(t.value);
|
|
2941
2981
|
return;
|
|
2942
2982
|
}
|
|
2943
|
-
if (t instanceof
|
|
2944
|
-
n.push(
|
|
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
|
|
2948
|
-
n.push(
|
|
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
|
|
2993
|
+
function _r(e, t) {
|
|
2954
2994
|
try {
|
|
2955
|
-
return
|
|
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
|
|
3000
|
+
return pr.decode(e);
|
|
2961
3001
|
}
|
|
2962
3002
|
}
|
|
2963
|
-
function
|
|
3003
|
+
function vr(e, t, n) {
|
|
2964
3004
|
let r = [];
|
|
2965
|
-
for (let n of t)
|
|
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 =
|
|
2969
|
-
s.length = 0, e.length !== 0 && a.push(i ? new B(
|
|
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 ===
|
|
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 =
|
|
2974
|
-
return i ? new B(
|
|
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
|
|
3016
|
+
return c(), a.length === 1 ? new R() : new R(a);
|
|
2977
3017
|
}
|
|
2978
|
-
function
|
|
3018
|
+
function yr(e) {
|
|
2979
3019
|
return {
|
|
2980
3020
|
appStringPrefixes: [e],
|
|
2981
3021
|
preserveAppSeqSource: !0,
|
|
2982
3022
|
parseAppString(t, n, r) {
|
|
2983
|
-
return
|
|
3023
|
+
return vr(e, [new B(n)], r);
|
|
2984
3024
|
},
|
|
2985
3025
|
parseAppSequence(t, n, r) {
|
|
2986
|
-
return
|
|
3026
|
+
return vr(e, n, r);
|
|
2987
3027
|
}
|
|
2988
3028
|
};
|
|
2989
3029
|
}
|
|
2990
|
-
var
|
|
2991
|
-
function
|
|
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
|
|
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
|
|
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
|
|
3005
|
-
else if (o instanceof
|
|
3006
|
-
else if (o instanceof
|
|
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 =
|
|
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 =
|
|
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 ??
|
|
3022
|
-
i.push(new
|
|
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
|
|
3065
|
+
return r ? new P(a) : new N(i);
|
|
3026
3066
|
}
|
|
3027
|
-
function
|
|
3067
|
+
function Dr(e) {
|
|
3028
3068
|
return {
|
|
3029
3069
|
appStringPrefixes: [e],
|
|
3030
3070
|
preserveAppSeqSource: !0,
|
|
3031
3071
|
parseAppString(t, n, r) {
|
|
3032
|
-
return new
|
|
3072
|
+
return new qe(Er(e, [new B(n)], r), `${e}${xe(n)}`);
|
|
3033
3073
|
},
|
|
3034
3074
|
parseAppSequence(t, n, r) {
|
|
3035
|
-
return
|
|
3075
|
+
return Er(e, n, r);
|
|
3036
3076
|
}
|
|
3037
3077
|
};
|
|
3038
3078
|
}
|
|
3039
|
-
var
|
|
3079
|
+
var Or = Dr("ilbs"), kr = Dr("ilts");
|
|
3040
3080
|
//#endregion
|
|
3041
3081
|
//#region src/utils/strip-comments.ts
|
|
3042
|
-
function
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
3109
|
-
if (e.length === 2) return new
|
|
3110
|
-
if (e.length === 4) return new
|
|
3111
|
-
if (e.length === 8) return new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3152
|
-
if (t === 3) return new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3211
|
+
return new DataView(t.buffer).setFloat32(0, e, !1), new Mr(t);
|
|
3172
3212
|
}
|
|
3173
3213
|
}
|
|
3174
|
-
return
|
|
3214
|
+
return Pr(e);
|
|
3175
3215
|
}
|
|
3176
|
-
var
|
|
3216
|
+
var zr = {
|
|
3177
3217
|
appStringPrefixes: ["float"],
|
|
3178
3218
|
parseAppString(t, n, r, i) {
|
|
3179
|
-
let a =
|
|
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
|
|
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),
|
|
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) ?
|
|
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
|
|
3201
|
-
return
|
|
3202
|
-
}
|
|
3203
|
-
},
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
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
|
|
3222
|
-
let t = e?.extensions, n =
|
|
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
|
|
3285
|
+
function Kr(e, t) {
|
|
3229
3286
|
if (t?.replacer) {
|
|
3230
|
-
let { replacer: n, ...r } = t, i =
|
|
3231
|
-
return i === h ?
|
|
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,
|
|
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
|
|
3247
|
-
}
|
|
3248
|
-
if (e instanceof m.Null) return
|
|
3249
|
-
if (e instanceof m.Undefined) return
|
|
3250
|
-
if (e instanceof g) return new
|
|
3251
|
-
if (e === null) return
|
|
3252
|
-
if (e === void 0) return
|
|
3253
|
-
if (e === !0) return
|
|
3254
|
-
if (e === !1) return
|
|
3255
|
-
if (typeof e == "bigint") return e > 18446744073709551615n ? new
|
|
3256
|
-
if (typeof e == "number") return (t?.encodeIntegerAs ?? "int") === "int" && Number.isInteger(e) && !Object.is(e, -0) ? e >= 0 ? new
|
|
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
|
|
3260
|
-
if (ArrayBuffer.isView(e)) return e instanceof Uint8Array && t?.uint8ArrayAs === "array" ? new
|
|
3261
|
-
if (e instanceof $) return new
|
|
3262
|
-
if (Array.isArray(e)) return new
|
|
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
|
|
3323
|
+
return new I(n);
|
|
3267
3324
|
}
|
|
3268
3325
|
throw TypeError(`fromJS: unsupported value type: ${typeof e}`);
|
|
3269
3326
|
}
|
|
3270
|
-
function
|
|
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
|
|
3274
|
-
let
|
|
3275
|
-
function
|
|
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 ||
|
|
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
|
|
3291
|
-
for (let t of n) Object.prototype.hasOwnProperty.call(e, t) && (
|
|
3292
|
-
return
|
|
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
|
|
3297
|
-
function
|
|
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 =
|
|
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 =
|
|
3311
|
-
|
|
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 =
|
|
3317
|
-
return
|
|
3373
|
+
let r = c(t, String(n), e);
|
|
3374
|
+
return o(r) ? null : r;
|
|
3318
3375
|
});
|
|
3319
|
-
if (
|
|
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 =
|
|
3323
|
-
|
|
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
|
|
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 :
|
|
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 {
|
|
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-
|
|
3408
|
+
//# sourceMappingURL=mapEntries-KwZz9nq2.js.map
|