@orbit-build/cli 1.9.2 → 1.9.3
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/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/index.js +487 -157
- package/package.json +1 -1
package/THIRD_PARTY_NOTICES.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -234550,15 +234550,33 @@ var require_data = __commonJS({
|
|
|
234550
234550
|
}
|
|
234551
234551
|
});
|
|
234552
234552
|
|
|
234553
|
-
// ../../node_modules/.pnpm/fast-uri@3.1.
|
|
234553
|
+
// ../../node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/utils.js
|
|
234554
234554
|
var require_utils2 = __commonJS({
|
|
234555
|
-
"../../node_modules/.pnpm/fast-uri@3.1.
|
|
234555
|
+
"../../node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
234556
234556
|
"use strict";
|
|
234557
234557
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
234558
234558
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
234559
234559
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
234560
234560
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
234561
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
234561
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
|
|
234562
|
+
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
234563
|
+
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
234564
|
+
var BYTE_HEX = new Array(256);
|
|
234565
|
+
{
|
|
234566
|
+
const HEX_DIGITS = "0123456789ABCDEF";
|
|
234567
|
+
for (let i2 = 0; i2 < 256; i2++) {
|
|
234568
|
+
BYTE_HEX[i2] = "%" + HEX_DIGITS[i2 >> 4] + HEX_DIGITS[i2 & 15];
|
|
234569
|
+
}
|
|
234570
|
+
}
|
|
234571
|
+
function percentEncodeNonAscii(cp) {
|
|
234572
|
+
if (cp < 2048) {
|
|
234573
|
+
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
234574
|
+
}
|
|
234575
|
+
if (cp < 65536) {
|
|
234576
|
+
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
234577
|
+
}
|
|
234578
|
+
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
234579
|
+
}
|
|
234562
234580
|
function stringArrayToHexStripped(input) {
|
|
234563
234581
|
let acc = "";
|
|
234564
234582
|
let code = 0;
|
|
@@ -234583,91 +234601,105 @@ var require_utils2 = __commonJS({
|
|
|
234583
234601
|
}
|
|
234584
234602
|
return acc;
|
|
234585
234603
|
}
|
|
234604
|
+
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
234605
|
+
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
234606
|
+
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
234586
234607
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
234587
|
-
function
|
|
234588
|
-
|
|
234589
|
-
|
|
234590
|
-
|
|
234591
|
-
|
|
234592
|
-
|
|
234593
|
-
|
|
234594
|
-
if (hex !== "") {
|
|
234595
|
-
address.push(hex);
|
|
234596
|
-
} else {
|
|
234597
|
-
output.error = true;
|
|
234598
|
-
return false;
|
|
234608
|
+
function isZoneIdentifier(zone) {
|
|
234609
|
+
if (zone.length === 0) return false;
|
|
234610
|
+
for (let i2 = 0; i2 < zone.length; i2++) {
|
|
234611
|
+
if (isZoneCharacter(zone[i2])) continue;
|
|
234612
|
+
if (zone[i2] === "%" && i2 + 2 < zone.length && isHexPair(zone.slice(i2 + 1, i2 + 3))) {
|
|
234613
|
+
i2 += 2;
|
|
234614
|
+
continue;
|
|
234599
234615
|
}
|
|
234600
|
-
|
|
234616
|
+
return false;
|
|
234601
234617
|
}
|
|
234602
234618
|
return true;
|
|
234603
234619
|
}
|
|
234604
|
-
function
|
|
234605
|
-
let
|
|
234606
|
-
|
|
234607
|
-
|
|
234608
|
-
|
|
234609
|
-
let
|
|
234610
|
-
|
|
234611
|
-
|
|
234612
|
-
|
|
234613
|
-
|
|
234614
|
-
|
|
234615
|
-
|
|
234616
|
-
}
|
|
234617
|
-
if (cursor3 === ":") {
|
|
234618
|
-
if (endipv6Encountered === true) {
|
|
234619
|
-
endIpv6 = true;
|
|
234620
|
-
}
|
|
234621
|
-
if (!consume(buffer, address, output)) {
|
|
234622
|
-
break;
|
|
234620
|
+
function compressIPv6ZeroRun(hextets) {
|
|
234621
|
+
let bestStart = -1;
|
|
234622
|
+
let bestLength = 0;
|
|
234623
|
+
let runStart = -1;
|
|
234624
|
+
let runLength = 0;
|
|
234625
|
+
for (let i2 = 0; i2 < hextets.length; i2++) {
|
|
234626
|
+
if (hextets[i2] === "0") {
|
|
234627
|
+
if (runStart === -1) runStart = i2;
|
|
234628
|
+
runLength++;
|
|
234629
|
+
if (runLength > bestLength) {
|
|
234630
|
+
bestLength = runLength;
|
|
234631
|
+
bestStart = runStart;
|
|
234623
234632
|
}
|
|
234624
|
-
if (++tokenCount > 7) {
|
|
234625
|
-
output.error = true;
|
|
234626
|
-
break;
|
|
234627
|
-
}
|
|
234628
|
-
if (i2 > 0 && input[i2 - 1] === ":") {
|
|
234629
|
-
endipv6Encountered = true;
|
|
234630
|
-
}
|
|
234631
|
-
address.push(":");
|
|
234632
|
-
continue;
|
|
234633
|
-
} else if (cursor3 === "%") {
|
|
234634
|
-
if (!consume(buffer, address, output)) {
|
|
234635
|
-
break;
|
|
234636
|
-
}
|
|
234637
|
-
consume = consumeIsZone;
|
|
234638
234633
|
} else {
|
|
234639
|
-
|
|
234634
|
+
runStart = -1;
|
|
234635
|
+
runLength = 0;
|
|
234636
|
+
}
|
|
234637
|
+
}
|
|
234638
|
+
if (bestLength < 2) return hextets.join(":");
|
|
234639
|
+
const head = hextets.slice(0, bestStart).join(":");
|
|
234640
|
+
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
234641
|
+
return head + "::" + tail;
|
|
234642
|
+
}
|
|
234643
|
+
function normalizeIPv6Address(input) {
|
|
234644
|
+
const compression = input.indexOf("::");
|
|
234645
|
+
if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
|
|
234646
|
+
const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
|
|
234647
|
+
const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
|
|
234648
|
+
if (compression !== -1) {
|
|
234649
|
+
if (left.length === 1 && left[0] === "") left.length = 0;
|
|
234650
|
+
if (right.length === 1 && right[0] === "") right.length = 0;
|
|
234651
|
+
}
|
|
234652
|
+
const parts = left.concat(right);
|
|
234653
|
+
let hextetCount = 0;
|
|
234654
|
+
for (let i2 = 0; i2 < parts.length; i2++) {
|
|
234655
|
+
const part = parts[i2];
|
|
234656
|
+
if (part === "") return void 0;
|
|
234657
|
+
if (part.indexOf(".") !== -1) {
|
|
234658
|
+
if (i2 !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
|
|
234659
|
+
hextetCount += 2;
|
|
234640
234660
|
continue;
|
|
234641
234661
|
}
|
|
234662
|
+
if (!isHextet(part)) return void 0;
|
|
234663
|
+
parts[i2] = parseInt(part, 16).toString(16);
|
|
234664
|
+
hextetCount++;
|
|
234642
234665
|
}
|
|
234643
|
-
if (
|
|
234644
|
-
if (
|
|
234645
|
-
|
|
234646
|
-
} else if (endIpv6) {
|
|
234647
|
-
address.push(buffer.join(""));
|
|
234648
|
-
} else {
|
|
234649
|
-
address.push(stringArrayToHexStripped(buffer));
|
|
234650
|
-
}
|
|
234666
|
+
if (compression === -1) {
|
|
234667
|
+
if (hextetCount !== 8) return void 0;
|
|
234668
|
+
return compressIPv6ZeroRun(parts);
|
|
234651
234669
|
}
|
|
234652
|
-
|
|
234653
|
-
|
|
234670
|
+
if (hextetCount >= 8) return void 0;
|
|
234671
|
+
const expanded = parts.slice(0, left.length);
|
|
234672
|
+
for (let i2 = hextetCount; i2 < 8; i2++) expanded.push("0");
|
|
234673
|
+
for (let i2 = left.length; i2 < parts.length; i2++) expanded.push(parts[i2]);
|
|
234674
|
+
return compressIPv6ZeroRun(expanded);
|
|
234654
234675
|
}
|
|
234655
234676
|
function normalizeIPv6(host) {
|
|
234656
|
-
|
|
234657
|
-
|
|
234658
|
-
}
|
|
234659
|
-
|
|
234660
|
-
if (
|
|
234661
|
-
|
|
234662
|
-
|
|
234663
|
-
|
|
234664
|
-
|
|
234665
|
-
|
|
234666
|
-
|
|
234667
|
-
|
|
234668
|
-
|
|
234669
|
-
|
|
234670
|
-
|
|
234677
|
+
const bracketed = host[0] === "[" && host[host.length - 1] === "]";
|
|
234678
|
+
const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
|
|
234679
|
+
if (hasBracket && !bracketed) return { host, isIPV6: false, error: true };
|
|
234680
|
+
let input = bracketed ? host.slice(1, -1) : host;
|
|
234681
|
+
if (bracketed && isIPvFuture(input)) {
|
|
234682
|
+
input = input.toLowerCase();
|
|
234683
|
+
return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
|
|
234684
|
+
}
|
|
234685
|
+
if (findToken(input, ":") < 2) {
|
|
234686
|
+
return { host, isIPV6: false, error: bracketed };
|
|
234687
|
+
}
|
|
234688
|
+
let zoneIdentifier = "";
|
|
234689
|
+
const zoneSeparator = input.indexOf("%");
|
|
234690
|
+
if (zoneSeparator !== -1) {
|
|
234691
|
+
const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
|
|
234692
|
+
zoneIdentifier = input.slice(zoneSeparator + separatorLength);
|
|
234693
|
+
if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true };
|
|
234694
|
+
input = input.slice(0, zoneSeparator);
|
|
234695
|
+
}
|
|
234696
|
+
const address = normalizeIPv6Address(input);
|
|
234697
|
+
if (address === void 0) return { host, isIPV6: false, error: true };
|
|
234698
|
+
return {
|
|
234699
|
+
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
234700
|
+
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
234701
|
+
isIPV6: true
|
|
234702
|
+
};
|
|
234671
234703
|
}
|
|
234672
234704
|
function findToken(str, token) {
|
|
234673
234705
|
let ind = 0;
|
|
@@ -234786,7 +234818,8 @@ var require_utils2 = __commonJS({
|
|
|
234786
234818
|
function normalizePathEncoding(input) {
|
|
234787
234819
|
let output = "";
|
|
234788
234820
|
for (let i2 = 0; i2 < input.length; i2++) {
|
|
234789
|
-
|
|
234821
|
+
const ch = input[i2];
|
|
234822
|
+
if (ch === "%" && i2 + 2 < input.length) {
|
|
234790
234823
|
const hex = input.slice(i2 + 1, i2 + 3);
|
|
234791
234824
|
if (isHexPair(hex)) {
|
|
234792
234825
|
const normalizedHex = hex.toUpperCase();
|
|
@@ -234800,10 +234833,152 @@ var require_utils2 = __commonJS({
|
|
|
234800
234833
|
continue;
|
|
234801
234834
|
}
|
|
234802
234835
|
}
|
|
234803
|
-
if (isPathCharacter(
|
|
234804
|
-
output +=
|
|
234836
|
+
if (isPathCharacter(ch)) {
|
|
234837
|
+
output += ch;
|
|
234838
|
+
} else {
|
|
234839
|
+
const code = input.charCodeAt(i2);
|
|
234840
|
+
if (code < 128) {
|
|
234841
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
234842
|
+
} else if (code < 55296 || code > 57343) {
|
|
234843
|
+
output += percentEncodeNonAscii(code);
|
|
234844
|
+
} else if (code <= 56319 && i2 + 1 < input.length) {
|
|
234845
|
+
const low = input.charCodeAt(i2 + 1);
|
|
234846
|
+
if (low >= 56320 && low <= 57343) {
|
|
234847
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
234848
|
+
i2++;
|
|
234849
|
+
} else {
|
|
234850
|
+
output += percentEncodeNonAscii(65533);
|
|
234851
|
+
}
|
|
234852
|
+
} else {
|
|
234853
|
+
output += percentEncodeNonAscii(65533);
|
|
234854
|
+
}
|
|
234855
|
+
}
|
|
234856
|
+
}
|
|
234857
|
+
return output;
|
|
234858
|
+
}
|
|
234859
|
+
function serializePathEncoding(input, pathNoScheme = false) {
|
|
234860
|
+
let output = "";
|
|
234861
|
+
let firstSegment = pathNoScheme && input[0] !== "/";
|
|
234862
|
+
for (let i2 = 0; i2 < input.length; i2++) {
|
|
234863
|
+
const ch = input[i2];
|
|
234864
|
+
if (ch === "%" && i2 + 2 < input.length) {
|
|
234865
|
+
const hex = input.slice(i2 + 1, i2 + 3);
|
|
234866
|
+
if (isHexPair(hex)) {
|
|
234867
|
+
output += "%" + hex.toUpperCase();
|
|
234868
|
+
i2 += 2;
|
|
234869
|
+
continue;
|
|
234870
|
+
}
|
|
234871
|
+
}
|
|
234872
|
+
if (ch === "/") {
|
|
234873
|
+
firstSegment = false;
|
|
234874
|
+
}
|
|
234875
|
+
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
234876
|
+
output += ch;
|
|
234877
|
+
} else {
|
|
234878
|
+
const code = input.charCodeAt(i2);
|
|
234879
|
+
if (code < 128) {
|
|
234880
|
+
output += BYTE_HEX[code];
|
|
234881
|
+
} else if (code < 55296 || code > 57343) {
|
|
234882
|
+
output += percentEncodeNonAscii(code);
|
|
234883
|
+
} else if (code <= 56319 && i2 + 1 < input.length) {
|
|
234884
|
+
const low = input.charCodeAt(i2 + 1);
|
|
234885
|
+
if (low >= 56320 && low <= 57343) {
|
|
234886
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
234887
|
+
i2++;
|
|
234888
|
+
} else {
|
|
234889
|
+
output += percentEncodeNonAscii(65533);
|
|
234890
|
+
}
|
|
234891
|
+
} else {
|
|
234892
|
+
output += percentEncodeNonAscii(65533);
|
|
234893
|
+
}
|
|
234894
|
+
}
|
|
234895
|
+
}
|
|
234896
|
+
return output;
|
|
234897
|
+
}
|
|
234898
|
+
function encodeComponent(input, isAllowed) {
|
|
234899
|
+
let output = "";
|
|
234900
|
+
for (let i2 = 0; i2 < input.length; i2++) {
|
|
234901
|
+
const ch = input[i2];
|
|
234902
|
+
if (ch === "%" && i2 + 2 < input.length) {
|
|
234903
|
+
const hex = input.slice(i2 + 1, i2 + 3);
|
|
234904
|
+
if (isHexPair(hex)) {
|
|
234905
|
+
output += "%" + hex.toUpperCase();
|
|
234906
|
+
i2 += 2;
|
|
234907
|
+
continue;
|
|
234908
|
+
}
|
|
234909
|
+
}
|
|
234910
|
+
if (isAllowed(ch)) {
|
|
234911
|
+
output += ch;
|
|
234912
|
+
} else {
|
|
234913
|
+
const code = input.charCodeAt(i2);
|
|
234914
|
+
if (code < 128) {
|
|
234915
|
+
output += BYTE_HEX[code];
|
|
234916
|
+
} else if (code < 55296 || code > 57343) {
|
|
234917
|
+
output += percentEncodeNonAscii(code);
|
|
234918
|
+
} else if (code <= 56319 && i2 + 1 < input.length) {
|
|
234919
|
+
const low = input.charCodeAt(i2 + 1);
|
|
234920
|
+
if (low >= 56320 && low <= 57343) {
|
|
234921
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
234922
|
+
i2++;
|
|
234923
|
+
} else {
|
|
234924
|
+
output += percentEncodeNonAscii(65533);
|
|
234925
|
+
}
|
|
234926
|
+
} else {
|
|
234927
|
+
output += percentEncodeNonAscii(65533);
|
|
234928
|
+
}
|
|
234929
|
+
}
|
|
234930
|
+
}
|
|
234931
|
+
return output;
|
|
234932
|
+
}
|
|
234933
|
+
function encodeUserinfo(input) {
|
|
234934
|
+
return encodeComponent(input, isUserinfoCharacter);
|
|
234935
|
+
}
|
|
234936
|
+
function encodeQuery(input) {
|
|
234937
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
234938
|
+
}
|
|
234939
|
+
function encodeFragment(input) {
|
|
234940
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
234941
|
+
}
|
|
234942
|
+
function isEscapeSafe(cp) {
|
|
234943
|
+
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
|
|
234944
|
+
}
|
|
234945
|
+
function normalizeQueryFragmentEncoding(input) {
|
|
234946
|
+
let output = "";
|
|
234947
|
+
for (let i2 = 0; i2 < input.length; i2++) {
|
|
234948
|
+
const ch = input[i2];
|
|
234949
|
+
if (ch === "%" && i2 + 2 < input.length) {
|
|
234950
|
+
const hex = input.slice(i2 + 1, i2 + 3);
|
|
234951
|
+
if (isHexPair(hex)) {
|
|
234952
|
+
const normalizedHex = hex.toUpperCase();
|
|
234953
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
234954
|
+
if (isUnreserved(decoded)) {
|
|
234955
|
+
output += decoded;
|
|
234956
|
+
} else {
|
|
234957
|
+
output += "%" + normalizedHex;
|
|
234958
|
+
}
|
|
234959
|
+
i2 += 2;
|
|
234960
|
+
continue;
|
|
234961
|
+
}
|
|
234962
|
+
}
|
|
234963
|
+
if (isQueryFragmentCharacter(ch)) {
|
|
234964
|
+
output += ch;
|
|
234805
234965
|
} else {
|
|
234806
|
-
|
|
234966
|
+
const code = input.charCodeAt(i2);
|
|
234967
|
+
if (code < 128) {
|
|
234968
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
234969
|
+
} else if (code < 55296 || code > 57343) {
|
|
234970
|
+
output += percentEncodeNonAscii(code);
|
|
234971
|
+
} else if (code <= 56319 && i2 + 1 < input.length) {
|
|
234972
|
+
const low = input.charCodeAt(i2 + 1);
|
|
234973
|
+
if (low >= 56320 && low <= 57343) {
|
|
234974
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
234975
|
+
i2++;
|
|
234976
|
+
} else {
|
|
234977
|
+
output += percentEncodeNonAscii(65533);
|
|
234978
|
+
}
|
|
234979
|
+
} else {
|
|
234980
|
+
output += percentEncodeNonAscii(65533);
|
|
234981
|
+
}
|
|
234807
234982
|
}
|
|
234808
234983
|
}
|
|
234809
234984
|
return output;
|
|
@@ -234826,14 +235001,18 @@ var require_utils2 = __commonJS({
|
|
|
234826
235001
|
function recomposeAuthority(component) {
|
|
234827
235002
|
const uriTokens = [];
|
|
234828
235003
|
if (component.userinfo !== void 0) {
|
|
234829
|
-
uriTokens.push(component.userinfo);
|
|
235004
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
234830
235005
|
uriTokens.push("@");
|
|
234831
235006
|
}
|
|
234832
235007
|
if (component.host !== void 0) {
|
|
234833
|
-
let host =
|
|
235008
|
+
let host = component.host;
|
|
234834
235009
|
if (!isIPv4(host)) {
|
|
234835
|
-
|
|
234836
|
-
if (ipV6res.isIPV6
|
|
235010
|
+
let ipV6res = normalizeIPv6(host);
|
|
235011
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
235012
|
+
host = normalizePercentEncoding(host, true);
|
|
235013
|
+
ipV6res = normalizeIPv6(host);
|
|
235014
|
+
}
|
|
235015
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
234837
235016
|
host = `[${ipV6res.escapedHost}]`;
|
|
234838
235017
|
} else {
|
|
234839
235018
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -234853,6 +235032,11 @@ var require_utils2 = __commonJS({
|
|
|
234853
235032
|
reescapeHostDelimiters,
|
|
234854
235033
|
normalizePercentEncoding,
|
|
234855
235034
|
normalizePathEncoding,
|
|
235035
|
+
serializePathEncoding,
|
|
235036
|
+
normalizeQueryFragmentEncoding,
|
|
235037
|
+
encodeUserinfo,
|
|
235038
|
+
encodeQuery,
|
|
235039
|
+
encodeFragment,
|
|
234856
235040
|
escapePreservingEscapes,
|
|
234857
235041
|
removeDotSegments,
|
|
234858
235042
|
isIPv4,
|
|
@@ -234863,12 +235047,12 @@ var require_utils2 = __commonJS({
|
|
|
234863
235047
|
}
|
|
234864
235048
|
});
|
|
234865
235049
|
|
|
234866
|
-
// ../../node_modules/.pnpm/fast-uri@3.1.
|
|
235050
|
+
// ../../node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/schemes.js
|
|
234867
235051
|
var require_schemes = __commonJS({
|
|
234868
|
-
"../../node_modules/.pnpm/fast-uri@3.1.
|
|
235052
|
+
"../../node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
234869
235053
|
"use strict";
|
|
234870
235054
|
var { isUUID } = require_utils2();
|
|
234871
|
-
var URN_REG =
|
|
235055
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
234872
235056
|
var supportedSchemeNames = (
|
|
234873
235057
|
/** @type {const} */
|
|
234874
235058
|
[
|
|
@@ -234929,9 +235113,10 @@ var require_schemes = __commonJS({
|
|
|
234929
235113
|
wsComponent.secure = void 0;
|
|
234930
235114
|
}
|
|
234931
235115
|
if (wsComponent.resourceName) {
|
|
234932
|
-
const
|
|
235116
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
235117
|
+
const path9 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
234933
235118
|
wsComponent.path = path9 && path9 !== "/" ? path9 : void 0;
|
|
234934
|
-
wsComponent.query =
|
|
235119
|
+
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
234935
235120
|
wsComponent.resourceName = void 0;
|
|
234936
235121
|
}
|
|
234937
235122
|
wsComponent.fragment = void 0;
|
|
@@ -234943,7 +235128,7 @@ var require_schemes = __commonJS({
|
|
|
234943
235128
|
return urnComponent;
|
|
234944
235129
|
}
|
|
234945
235130
|
const matches = urnComponent.path.match(URN_REG);
|
|
234946
|
-
if (matches) {
|
|
235131
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
234947
235132
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
234948
235133
|
urnComponent.nid = matches[1].toLowerCase();
|
|
234949
235134
|
urnComponent.nss = matches[2];
|
|
@@ -235073,12 +235258,21 @@ var require_schemes = __commonJS({
|
|
|
235073
235258
|
}
|
|
235074
235259
|
});
|
|
235075
235260
|
|
|
235076
|
-
// ../../node_modules/.pnpm/fast-uri@3.1.
|
|
235261
|
+
// ../../node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/index.js
|
|
235077
235262
|
var require_fast_uri = __commonJS({
|
|
235078
|
-
"../../node_modules/.pnpm/fast-uri@3.1.
|
|
235263
|
+
"../../node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/index.js"(exports, module) {
|
|
235079
235264
|
"use strict";
|
|
235080
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
235265
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils2();
|
|
235081
235266
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
235267
|
+
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
235268
|
+
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
235269
|
+
function decodeValidScheme(scheme) {
|
|
235270
|
+
const decodedScheme = unescape(String(scheme));
|
|
235271
|
+
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
235272
|
+
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
235273
|
+
}
|
|
235274
|
+
return decodedScheme;
|
|
235275
|
+
}
|
|
235082
235276
|
function normalize3(uri, options) {
|
|
235083
235277
|
if (typeof uri === "string") {
|
|
235084
235278
|
uri = /** @type {T} */
|
|
@@ -235091,12 +235285,34 @@ var require_fast_uri = __commonJS({
|
|
|
235091
235285
|
}
|
|
235092
235286
|
function resolve38(baseURI, relativeURI, options) {
|
|
235093
235287
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
235094
|
-
const {
|
|
235095
|
-
|
|
235096
|
-
|
|
235288
|
+
const {
|
|
235289
|
+
parsed: baseParsed,
|
|
235290
|
+
malformedAuthorityOrPort: baseMalformed,
|
|
235291
|
+
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
235292
|
+
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
235293
|
+
malformedHost: baseMalformedHost,
|
|
235294
|
+
malformedScheme: baseMalformedScheme
|
|
235295
|
+
} = parseWithStatus(baseURI, schemelessOptions);
|
|
235296
|
+
const {
|
|
235297
|
+
parsed: relativeParsed,
|
|
235298
|
+
malformedAuthorityOrPort: relativeMalformed,
|
|
235299
|
+
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
235300
|
+
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
235301
|
+
malformedHost: relativeMalformedHost,
|
|
235302
|
+
malformedScheme: relativeMalformedScheme
|
|
235303
|
+
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
235304
|
+
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
235097
235305
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
235098
235306
|
}
|
|
235099
235307
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
235308
|
+
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
235309
|
+
const resolvedHost = resolved.host;
|
|
235310
|
+
const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
235311
|
+
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
235312
|
+
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
|
|
235313
|
+
if (resolved.error && !encodedASCIIHost) {
|
|
235314
|
+
throw new Error(resolved.error);
|
|
235315
|
+
}
|
|
235100
235316
|
schemelessOptions.skipEscape = true;
|
|
235101
235317
|
return serialize(resolved, schemelessOptions);
|
|
235102
235318
|
}
|
|
@@ -235156,7 +235372,7 @@ var require_fast_uri = __commonJS({
|
|
|
235156
235372
|
function equal(uriA, uriB, options) {
|
|
235157
235373
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
235158
235374
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
235159
|
-
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA
|
|
235375
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
|
|
235160
235376
|
}
|
|
235161
235377
|
function serialize(cmpts, opts) {
|
|
235162
235378
|
const component = {
|
|
@@ -235177,19 +235393,22 @@ var require_fast_uri = __commonJS({
|
|
|
235177
235393
|
};
|
|
235178
235394
|
const options = Object.assign({}, opts);
|
|
235179
235395
|
const uriTokens = [];
|
|
235396
|
+
if (component.scheme) {
|
|
235397
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
235398
|
+
}
|
|
235180
235399
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
235181
235400
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
235401
|
+
const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
|
|
235402
|
+
const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
|
|
235182
235403
|
if (component.path !== void 0) {
|
|
235183
235404
|
if (!options.skipEscape) {
|
|
235184
|
-
component.path =
|
|
235185
|
-
if (component.scheme !== void 0) {
|
|
235186
|
-
component.path = component.path.split("%3A").join(":");
|
|
235187
|
-
}
|
|
235405
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
235188
235406
|
} else {
|
|
235189
235407
|
component.path = normalizePercentEncoding(component.path);
|
|
235190
235408
|
}
|
|
235191
235409
|
}
|
|
235192
235410
|
if (options.reference !== "suffix" && component.scheme) {
|
|
235411
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
235193
235412
|
uriTokens.push(component.scheme, ":");
|
|
235194
235413
|
}
|
|
235195
235414
|
const authority = recomposeAuthority(component);
|
|
@@ -235207,16 +235426,19 @@ var require_fast_uri = __commonJS({
|
|
|
235207
235426
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
235208
235427
|
s = removeDotSegments(s);
|
|
235209
235428
|
}
|
|
235429
|
+
if (pathNoScheme) {
|
|
235430
|
+
s = serializePathEncoding(s, true);
|
|
235431
|
+
}
|
|
235210
235432
|
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
235211
235433
|
s = "/%2F" + s.slice(2);
|
|
235212
235434
|
}
|
|
235213
235435
|
uriTokens.push(s);
|
|
235214
235436
|
}
|
|
235215
235437
|
if (component.query !== void 0) {
|
|
235216
|
-
uriTokens.push("?", component.query);
|
|
235438
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
235217
235439
|
}
|
|
235218
235440
|
if (component.fragment !== void 0) {
|
|
235219
|
-
uriTokens.push("#", component.fragment);
|
|
235441
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
235220
235442
|
}
|
|
235221
235443
|
return uriTokens.join("");
|
|
235222
235444
|
}
|
|
@@ -235232,6 +235454,32 @@ var require_fast_uri = __commonJS({
|
|
|
235232
235454
|
}
|
|
235233
235455
|
return void 0;
|
|
235234
235456
|
}
|
|
235457
|
+
function hasMalformedPercentEncoding(component) {
|
|
235458
|
+
if (component === void 0) return false;
|
|
235459
|
+
let percent = component.indexOf("%");
|
|
235460
|
+
while (percent !== -1) {
|
|
235461
|
+
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
235462
|
+
return true;
|
|
235463
|
+
}
|
|
235464
|
+
percent = component.indexOf("%", percent + 3);
|
|
235465
|
+
}
|
|
235466
|
+
return false;
|
|
235467
|
+
}
|
|
235468
|
+
function hasMalformedComponentPercentEncoding(matches) {
|
|
235469
|
+
const host = matches[4];
|
|
235470
|
+
return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !(host[0] === "[" && host[host.length - 1] === "]") && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
235471
|
+
}
|
|
235472
|
+
function canonicalizeHost(parsed, options, schemeHandler, isIP3) {
|
|
235473
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && parsed.host[0] !== "[" && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP3 === false && nonSimpleDomain(parsed.host)) {
|
|
235474
|
+
try {
|
|
235475
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
235476
|
+
} catch (e) {
|
|
235477
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
235478
|
+
return true;
|
|
235479
|
+
}
|
|
235480
|
+
}
|
|
235481
|
+
return false;
|
|
235482
|
+
}
|
|
235235
235483
|
function parseWithStatus(uri, opts) {
|
|
235236
235484
|
const options = Object.assign({}, opts);
|
|
235237
235485
|
const parsed = {
|
|
@@ -235244,6 +235492,11 @@ var require_fast_uri = __commonJS({
|
|
|
235244
235492
|
fragment: void 0
|
|
235245
235493
|
};
|
|
235246
235494
|
let malformedAuthorityOrPort = false;
|
|
235495
|
+
let malformedPercentEncoding = false;
|
|
235496
|
+
let malformedSchemeSpecific = false;
|
|
235497
|
+
let malformedHost = false;
|
|
235498
|
+
let malformedIPLiteral = false;
|
|
235499
|
+
let malformedScheme = false;
|
|
235247
235500
|
let isIP3 = false;
|
|
235248
235501
|
if (options.reference === "suffix") {
|
|
235249
235502
|
if (options.scheme) {
|
|
@@ -235280,6 +235533,19 @@ var require_fast_uri = __commonJS({
|
|
|
235280
235533
|
parsed.path = matches[6] || "";
|
|
235281
235534
|
parsed.query = matches[7];
|
|
235282
235535
|
parsed.fragment = matches[8];
|
|
235536
|
+
if (parsed.scheme !== void 0) {
|
|
235537
|
+
const decodedScheme = unescape(parsed.scheme);
|
|
235538
|
+
if (VALID_SCHEME.test(decodedScheme)) {
|
|
235539
|
+
parsed.scheme = decodedScheme.toLowerCase();
|
|
235540
|
+
} else {
|
|
235541
|
+
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
235542
|
+
malformedScheme = true;
|
|
235543
|
+
}
|
|
235544
|
+
}
|
|
235545
|
+
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
235546
|
+
if (malformedPercentEncoding) {
|
|
235547
|
+
parsed.error = parsed.error || "URI contains malformed percent-encoding.";
|
|
235548
|
+
}
|
|
235283
235549
|
if (isNaN(parsed.port)) {
|
|
235284
235550
|
parsed.port = matches[5];
|
|
235285
235551
|
}
|
|
@@ -235291,9 +235557,15 @@ var require_fast_uri = __commonJS({
|
|
|
235291
235557
|
if (parsed.host) {
|
|
235292
235558
|
const ipv4result = isIPv4(parsed.host);
|
|
235293
235559
|
if (ipv4result === false) {
|
|
235560
|
+
const bracketedIPLiteral = parsed.host[0] === "[" && parsed.host[parsed.host.length - 1] === "]";
|
|
235294
235561
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
235295
|
-
|
|
235296
|
-
|
|
235562
|
+
isIP3 = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
235563
|
+
malformedIPLiteral = bracketedIPLiteral && ipv6result.error === true;
|
|
235564
|
+
parsed.host = isIP3 ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
235565
|
+
if (malformedIPLiteral) {
|
|
235566
|
+
parsed.error = parsed.error || "URI host is malformed.";
|
|
235567
|
+
malformedAuthorityOrPort = true;
|
|
235568
|
+
}
|
|
235297
235569
|
} else {
|
|
235298
235570
|
isIP3 = true;
|
|
235299
235571
|
}
|
|
@@ -235311,42 +235583,34 @@ var require_fast_uri = __commonJS({
|
|
|
235311
235583
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
235312
235584
|
}
|
|
235313
235585
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
235314
|
-
|
|
235315
|
-
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP3 === false && nonSimpleDomain(parsed.host)) {
|
|
235316
|
-
try {
|
|
235317
|
-
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
235318
|
-
} catch (e) {
|
|
235319
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
235320
|
-
}
|
|
235321
|
-
}
|
|
235322
|
-
}
|
|
235586
|
+
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP3);
|
|
235323
235587
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
235324
235588
|
if (uri.indexOf("%") !== -1) {
|
|
235325
|
-
if (parsed.
|
|
235326
|
-
parsed.
|
|
235327
|
-
|
|
235328
|
-
if (parsed.host !== void 0) {
|
|
235329
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP3);
|
|
235589
|
+
if (parsed.host !== void 0 && !malformedIPLiteral) {
|
|
235590
|
+
const host = isIP3 ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
235591
|
+
parsed.host = reescapeHostDelimiters(host, isIP3);
|
|
235330
235592
|
}
|
|
235331
235593
|
}
|
|
235332
235594
|
if (parsed.path) {
|
|
235333
235595
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
235334
235596
|
}
|
|
235597
|
+
if (parsed.query) {
|
|
235598
|
+
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
235599
|
+
}
|
|
235335
235600
|
if (parsed.fragment) {
|
|
235336
|
-
|
|
235337
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
235338
|
-
} catch {
|
|
235339
|
-
parsed.error = parsed.error || "URI malformed";
|
|
235340
|
-
}
|
|
235601
|
+
parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
|
|
235341
235602
|
}
|
|
235342
235603
|
}
|
|
235343
235604
|
if (schemeHandler && schemeHandler.parse) {
|
|
235344
235605
|
schemeHandler.parse(parsed, options);
|
|
235606
|
+
if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) {
|
|
235607
|
+
malformedSchemeSpecific = true;
|
|
235608
|
+
}
|
|
235345
235609
|
}
|
|
235346
235610
|
} else {
|
|
235347
235611
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
235348
235612
|
}
|
|
235349
|
-
return { parsed, malformedAuthorityOrPort };
|
|
235613
|
+
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
235350
235614
|
}
|
|
235351
235615
|
function parse7(uri, opts) {
|
|
235352
235616
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -235355,20 +235619,28 @@ var require_fast_uri = __commonJS({
|
|
|
235355
235619
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
235356
235620
|
}
|
|
235357
235621
|
function normalizeStringWithStatus(uri, opts) {
|
|
235358
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
235622
|
+
const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
235359
235623
|
return {
|
|
235360
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
235361
|
-
malformedAuthorityOrPort
|
|
235624
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
|
|
235625
|
+
malformedAuthorityOrPort,
|
|
235626
|
+
malformedPercentEncoding,
|
|
235627
|
+
malformedSchemeSpecific,
|
|
235628
|
+
malformedHost,
|
|
235629
|
+
malformedScheme
|
|
235362
235630
|
};
|
|
235363
235631
|
}
|
|
235364
235632
|
function normalizeComparableURI(uri, opts) {
|
|
235365
|
-
if (typeof uri
|
|
235366
|
-
|
|
235367
|
-
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
235633
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
235634
|
+
return void 0;
|
|
235368
235635
|
}
|
|
235369
|
-
|
|
235370
|
-
|
|
235636
|
+
let value;
|
|
235637
|
+
try {
|
|
235638
|
+
value = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
235639
|
+
} catch {
|
|
235640
|
+
return void 0;
|
|
235371
235641
|
}
|
|
235642
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
235643
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
|
|
235372
235644
|
}
|
|
235373
235645
|
var fastUri = {
|
|
235374
235646
|
SCHEMES,
|
|
@@ -244045,6 +244317,7 @@ import { z as z23 } from "zod";
|
|
|
244045
244317
|
import { z as z33 } from "zod";
|
|
244046
244318
|
var DEEPSEEK_V4_FLASH = "deepseek-v4-flash";
|
|
244047
244319
|
var DEEPSEEK_V4_PRO = "deepseek-v4-pro";
|
|
244320
|
+
var DEEPSEEK_V4_FLASH_VISION_EXP = "deepseek-v4-flash-vision-exp";
|
|
244048
244321
|
var DEEPSEEK_V4_FLASH_VERSION = "DeepSeek-V4-Flash-0731";
|
|
244049
244322
|
var DEEPSEEK_V4_PRO_VERSION = "DeepSeek-V4-Pro-0813";
|
|
244050
244323
|
var DEEPSEEK_V4_CONTEXT_TOKENS = 1e6;
|
|
@@ -244073,7 +244346,8 @@ function getDeepSeekV4ModelProfile(model) {
|
|
|
244073
244346
|
supportsResponses: true,
|
|
244074
244347
|
reasoningEfforts: DEEPSEEK_REASONING_EFFORTS,
|
|
244075
244348
|
parallelToolCalls: true,
|
|
244076
|
-
officialRequestModel: officialRequestModel && leaf === DEEPSEEK_V4_FLASH
|
|
244349
|
+
officialRequestModel: officialRequestModel && leaf === DEEPSEEK_V4_FLASH,
|
|
244350
|
+
vision: false
|
|
244077
244351
|
};
|
|
244078
244352
|
}
|
|
244079
244353
|
if (leaf === DEEPSEEK_V4_PRO || leaf === `${DEEPSEEK_V4_PRO}-0813`) {
|
|
@@ -244086,7 +244360,22 @@ function getDeepSeekV4ModelProfile(model) {
|
|
|
244086
244360
|
supportsResponses: true,
|
|
244087
244361
|
reasoningEfforts: DEEPSEEK_REASONING_EFFORTS,
|
|
244088
244362
|
parallelToolCalls: true,
|
|
244089
|
-
officialRequestModel: officialRequestModel && leaf === DEEPSEEK_V4_PRO
|
|
244363
|
+
officialRequestModel: officialRequestModel && leaf === DEEPSEEK_V4_PRO,
|
|
244364
|
+
vision: false
|
|
244365
|
+
};
|
|
244366
|
+
}
|
|
244367
|
+
if (leaf === DEEPSEEK_V4_FLASH_VISION_EXP) {
|
|
244368
|
+
return {
|
|
244369
|
+
lane: "flash",
|
|
244370
|
+
legacyAlias: false,
|
|
244371
|
+
optimizedThinkingDefault: true,
|
|
244372
|
+
canonicalModel: DEEPSEEK_V4_FLASH_VISION_EXP,
|
|
244373
|
+
modelVersion: "DeepSeek-V4-Flash-Vision-Exp",
|
|
244374
|
+
supportsResponses: true,
|
|
244375
|
+
reasoningEfforts: DEEPSEEK_REASONING_EFFORTS,
|
|
244376
|
+
parallelToolCalls: true,
|
|
244377
|
+
officialRequestModel,
|
|
244378
|
+
vision: true
|
|
244090
244379
|
};
|
|
244091
244380
|
}
|
|
244092
244381
|
if (leaf === "deepseek-chat") {
|
|
@@ -244099,7 +244388,8 @@ function getDeepSeekV4ModelProfile(model) {
|
|
|
244099
244388
|
supportsResponses: true,
|
|
244100
244389
|
reasoningEfforts: DEEPSEEK_REASONING_EFFORTS,
|
|
244101
244390
|
parallelToolCalls: true,
|
|
244102
|
-
officialRequestModel
|
|
244391
|
+
officialRequestModel,
|
|
244392
|
+
vision: false
|
|
244103
244393
|
};
|
|
244104
244394
|
}
|
|
244105
244395
|
if (leaf === "deepseek-reasoner") {
|
|
@@ -244112,7 +244402,8 @@ function getDeepSeekV4ModelProfile(model) {
|
|
|
244112
244402
|
supportsResponses: true,
|
|
244113
244403
|
reasoningEfforts: DEEPSEEK_REASONING_EFFORTS,
|
|
244114
244404
|
parallelToolCalls: true,
|
|
244115
|
-
officialRequestModel
|
|
244405
|
+
officialRequestModel,
|
|
244406
|
+
vision: false
|
|
244116
244407
|
};
|
|
244117
244408
|
}
|
|
244118
244409
|
return void 0;
|
|
@@ -245615,13 +245906,13 @@ function normalizeMaxOutputTokens(value) {
|
|
|
245615
245906
|
Math.min(DEEPSEEK_V4_MAX_OUTPUT_TOKENS, Math.floor(value))
|
|
245616
245907
|
);
|
|
245617
245908
|
}
|
|
245618
|
-
function buildInputItems(input) {
|
|
245909
|
+
function buildInputItems(input, supportsVision) {
|
|
245619
245910
|
const items = [];
|
|
245620
245911
|
const functionCalls = /* @__PURE__ */ new Set();
|
|
245621
245912
|
const functionOutputs = /* @__PURE__ */ new Set();
|
|
245622
245913
|
for (const message2 of input.messages) {
|
|
245623
245914
|
const images = message2.content.filter((block2) => block2.type === "image");
|
|
245624
|
-
if (images.length > 0) {
|
|
245915
|
+
if (images.length > 0 && !supportsVision) {
|
|
245625
245916
|
throw new Error(
|
|
245626
245917
|
"The selected DeepSeek model does not accept image input. Switch to a vision-capable model or remove the attachment."
|
|
245627
245918
|
);
|
|
@@ -245689,7 +245980,21 @@ function buildInputItems(input) {
|
|
|
245689
245980
|
}
|
|
245690
245981
|
continue;
|
|
245691
245982
|
}
|
|
245692
|
-
|
|
245983
|
+
if (message2.role === "user" && images.length > 0) {
|
|
245984
|
+
items.push({
|
|
245985
|
+
type: "message",
|
|
245986
|
+
role: "user",
|
|
245987
|
+
content: [
|
|
245988
|
+
...text2 ? [{ type: "input_text", text: text2 }] : [],
|
|
245989
|
+
...images.map((image) => ({
|
|
245990
|
+
type: "input_image",
|
|
245991
|
+
image_url: `data:${image.mediaType};base64,${image.data}`
|
|
245992
|
+
}))
|
|
245993
|
+
]
|
|
245994
|
+
});
|
|
245995
|
+
} else {
|
|
245996
|
+
items.push({ type: "message", role: message2.role, content: text2 });
|
|
245997
|
+
}
|
|
245693
245998
|
}
|
|
245694
245999
|
for (const callId of functionOutputs) {
|
|
245695
246000
|
if (!functionCalls.has(callId)) {
|
|
@@ -245705,7 +246010,7 @@ function buildDeepSeekResponsesRequest(input, profile, extraBody = {}, requestMo
|
|
|
245705
246010
|
const body = {
|
|
245706
246011
|
...extraBody,
|
|
245707
246012
|
model: requestModel,
|
|
245708
|
-
input: buildInputItems(input),
|
|
246013
|
+
input: buildInputItems(input, profile.vision),
|
|
245709
246014
|
stream: input.stream !== false,
|
|
245710
246015
|
store: false,
|
|
245711
246016
|
reasoning: {
|
|
@@ -246246,12 +246551,12 @@ async function* chatWithDeepSeekResponses(input, options) {
|
|
|
246246
246551
|
input.abortSignal?.removeEventListener("abort", onAbort);
|
|
246247
246552
|
}
|
|
246248
246553
|
}
|
|
246249
|
-
function buildDeepSeekChatMessages(input, isDeepSeekV4) {
|
|
246554
|
+
function buildDeepSeekChatMessages(input, isDeepSeekV4, supportsVision = false) {
|
|
246250
246555
|
const messages = [];
|
|
246251
246556
|
for (const message2 of input.messages) {
|
|
246252
246557
|
const text2 = message2.content.filter((block2) => block2.type === "text").map((block2) => block2.text).join("\n");
|
|
246253
246558
|
const images = message2.content.filter((block2) => block2.type === "image");
|
|
246254
|
-
if (images.length > 0 && isDeepSeekV4) {
|
|
246559
|
+
if (images.length > 0 && isDeepSeekV4 && !supportsVision) {
|
|
246255
246560
|
throw new Error(
|
|
246256
246561
|
"The selected DeepSeek model does not accept image input. Switch to a vision-capable model or remove the attachment."
|
|
246257
246562
|
);
|
|
@@ -246646,7 +246951,7 @@ var OpenAICompatibleProvider = class _OpenAICompatibleProvider {
|
|
|
246646
246951
|
toolCalls: supportsNativeTools,
|
|
246647
246952
|
jsonMode: deepSeekV4Profile ? true : !isReasoner,
|
|
246648
246953
|
thinking: Boolean(deepSeekV4Profile) || isReasoner || isOpenAIReasoner,
|
|
246649
|
-
vision: deepSeekV4Profile ?
|
|
246954
|
+
vision: deepSeekV4Profile ? deepSeekV4Profile.vision : lowercase.includes("vision") || lowercase.includes("gpt-4o") || lowercase.includes("claude-3"),
|
|
246650
246955
|
promptCaching: true,
|
|
246651
246956
|
...deepSeekV4Profile ? {
|
|
246652
246957
|
maxContextTokens: DEEPSEEK_V4_CONTEXT_TOKENS,
|
|
@@ -246655,6 +246960,7 @@ var OpenAICompatibleProvider = class _OpenAICompatibleProvider {
|
|
|
246655
246960
|
reasoningEfforts: [...deepSeekV4Profile.reasoningEfforts],
|
|
246656
246961
|
parallelToolCalls: deepSeekV4Profile.parallelToolCalls,
|
|
246657
246962
|
modelVersion: deepSeekV4Profile.modelVersion,
|
|
246963
|
+
...deepSeekV4Profile.vision ? { maxImages: 16, maxImageBytes: 10 * 1024 * 1024 } : {},
|
|
246658
246964
|
effectiveContextWindowPercent: DEEPSEEK_V4_EFFECTIVE_CONTEXT_PERCENT
|
|
246659
246965
|
} : {}
|
|
246660
246966
|
};
|
|
@@ -246756,7 +247062,11 @@ var OpenAICompatibleProvider = class _OpenAICompatibleProvider {
|
|
|
246756
247062
|
let openaiMessages;
|
|
246757
247063
|
let tools;
|
|
246758
247064
|
try {
|
|
246759
|
-
openaiMessages = buildDeepSeekChatMessages(
|
|
247065
|
+
openaiMessages = buildDeepSeekChatMessages(
|
|
247066
|
+
input,
|
|
247067
|
+
isDeepSeekV4,
|
|
247068
|
+
deepSeekV4Profile?.vision === true
|
|
247069
|
+
);
|
|
246760
247070
|
tools = input.tools?.map((tool) => ({
|
|
246761
247071
|
type: "function",
|
|
246762
247072
|
function: {
|
|
@@ -247514,6 +247824,9 @@ var DeepSeekProvider = class _DeepSeekProvider {
|
|
|
247514
247824
|
}
|
|
247515
247825
|
return {
|
|
247516
247826
|
...this.capabilities,
|
|
247827
|
+
vision: profile.vision,
|
|
247828
|
+
maxImages: profile.vision ? 16 : void 0,
|
|
247829
|
+
maxImageBytes: profile.vision ? 10 * 1024 * 1024 : void 0,
|
|
247517
247830
|
modelVersion: profile.modelVersion,
|
|
247518
247831
|
reasoningEfforts: [...profile.reasoningEfforts]
|
|
247519
247832
|
};
|
|
@@ -256703,7 +257016,6 @@ var JSVectorStore = class {
|
|
|
256703
257016
|
(d) => d.vector && d.vector.length > 0
|
|
256704
257017
|
);
|
|
256705
257018
|
if (existingDoc && existingDoc.vector && existingDoc.vector.length !== queryVector.length || this.header && this.header.dimension !== queryVector.length) {
|
|
256706
|
-
await this.clear();
|
|
256707
257019
|
return [];
|
|
256708
257020
|
}
|
|
256709
257021
|
}
|
|
@@ -256947,7 +257259,6 @@ var BM25Store = class {
|
|
|
256947
257259
|
const validatedDocuments = z35.array(DocumentSchema).parse(documents);
|
|
256948
257260
|
for (const doc of validatedDocuments) {
|
|
256949
257261
|
const tokens = tokenize(doc.text);
|
|
256950
|
-
if (tokens.length === 0) continue;
|
|
256951
257262
|
const oldDoc = this.docs[doc.id];
|
|
256952
257263
|
if (oldDoc) {
|
|
256953
257264
|
for (const term of Object.keys(oldDoc.terms)) {
|
|
@@ -256957,6 +257268,10 @@ var BM25Store = class {
|
|
|
256957
257268
|
}
|
|
256958
257269
|
}
|
|
256959
257270
|
}
|
|
257271
|
+
if (tokens.length === 0) {
|
|
257272
|
+
delete this.docs[doc.id];
|
|
257273
|
+
continue;
|
|
257274
|
+
}
|
|
256960
257275
|
const terms2 = createRecord();
|
|
256961
257276
|
for (const t2 of tokens) {
|
|
256962
257277
|
terms2[t2] = (terms2[t2] || 0) + 1;
|
|
@@ -257063,6 +257378,8 @@ var BM25Store = class {
|
|
|
257063
257378
|
}
|
|
257064
257379
|
this.cacheState = "valid";
|
|
257065
257380
|
} catch {
|
|
257381
|
+
this.cacheState = "invalid";
|
|
257382
|
+
throw new Error("Failed to persist the Orbit BM25 cache.");
|
|
257066
257383
|
}
|
|
257067
257384
|
}
|
|
257068
257385
|
async load() {
|
|
@@ -257201,11 +257518,16 @@ var HybridSearch = class {
|
|
|
257201
257518
|
this.batchDepth += 1;
|
|
257202
257519
|
}
|
|
257203
257520
|
async commitBatch() {
|
|
257204
|
-
if (this.batchDepth
|
|
257205
|
-
this.batchDepth -= 1;
|
|
257521
|
+
if (this.batchDepth > 0) this.batchDepth -= 1;
|
|
257206
257522
|
if (this.batchDepth > 0 || !this.batchChanged) return;
|
|
257523
|
+
const results = await Promise.allSettled([
|
|
257524
|
+
this.vectorStore.save(),
|
|
257525
|
+
this.bm25Store.save()
|
|
257526
|
+
]);
|
|
257527
|
+
for (const result of results) {
|
|
257528
|
+
if (result.status === "rejected") throw result.reason;
|
|
257529
|
+
}
|
|
257207
257530
|
this.batchChanged = false;
|
|
257208
|
-
await Promise.all([this.vectorStore.save(), this.bm25Store.save()]);
|
|
257209
257531
|
}
|
|
257210
257532
|
/**
|
|
257211
257533
|
* Performs hybrid search using Reciprocal Rank Fusion (RRF).
|
|
@@ -257230,8 +257552,6 @@ var HybridSearch = class {
|
|
|
257230
257552
|
} catch {
|
|
257231
257553
|
}
|
|
257232
257554
|
const docMap = /* @__PURE__ */ new Map();
|
|
257233
|
-
const allDocs = this.vectorStore.getDocuments();
|
|
257234
|
-
const allDocsMap = new Map(allDocs.map((d) => [d.id, d]));
|
|
257235
257555
|
const vectorRanks = /* @__PURE__ */ new Map();
|
|
257236
257556
|
const bm25Ranks = /* @__PURE__ */ new Map();
|
|
257237
257557
|
vectorCandidates.forEach((cand, index) => {
|
|
@@ -257240,11 +257560,17 @@ var HybridSearch = class {
|
|
|
257240
257560
|
});
|
|
257241
257561
|
bm25Candidates.forEach((cand, index) => {
|
|
257242
257562
|
bm25Ranks.set(cand.id, index + 1);
|
|
257243
|
-
const doc = allDocsMap.get(cand.id);
|
|
257244
|
-
if (doc) {
|
|
257245
|
-
docMap.set(cand.id, doc);
|
|
257246
|
-
}
|
|
257247
257563
|
});
|
|
257564
|
+
const missingIds = new Set(
|
|
257565
|
+
bm25Candidates.filter((cand) => !docMap.has(cand.id)).map((cand) => cand.id)
|
|
257566
|
+
);
|
|
257567
|
+
if (missingIds.size > 0) {
|
|
257568
|
+
for (const doc of this.vectorStore.getDocuments()) {
|
|
257569
|
+
if (!missingIds.delete(doc.id)) continue;
|
|
257570
|
+
docMap.set(doc.id, doc);
|
|
257571
|
+
if (missingIds.size === 0) break;
|
|
257572
|
+
}
|
|
257573
|
+
}
|
|
257248
257574
|
const rrfK = 60;
|
|
257249
257575
|
const hybridScores = /* @__PURE__ */ new Map();
|
|
257250
257576
|
for (const docId of docMap.keys()) {
|
|
@@ -257943,6 +258269,7 @@ var SymbolIndexer = class {
|
|
|
257943
258269
|
changed = true;
|
|
257944
258270
|
}
|
|
257945
258271
|
}
|
|
258272
|
+
await hybridSearch.commitBatch();
|
|
257946
258273
|
if (changed) {
|
|
257947
258274
|
indexData.indexedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
257948
258275
|
const parentDir = dirname32(this.indexPath);
|
|
@@ -257962,7 +258289,6 @@ var SymbolIndexer = class {
|
|
|
257962
258289
|
}
|
|
257963
258290
|
embedCache.save();
|
|
257964
258291
|
}
|
|
257965
|
-
await hybridSearch.commitBatch();
|
|
257966
258292
|
} catch {
|
|
257967
258293
|
}
|
|
257968
258294
|
}
|
|
@@ -276158,7 +276484,11 @@ function compareProviderBenchmarkResults(results) {
|
|
|
276158
276484
|
}
|
|
276159
276485
|
|
|
276160
276486
|
// src/runtime/ModelCatalog.ts
|
|
276161
|
-
var DEEPSEEK_MODELS = [
|
|
276487
|
+
var DEEPSEEK_MODELS = [
|
|
276488
|
+
DEEPSEEK_V4_FLASH,
|
|
276489
|
+
DEEPSEEK_V4_PRO,
|
|
276490
|
+
DEEPSEEK_V4_FLASH_VISION_EXP
|
|
276491
|
+
];
|
|
276162
276492
|
var DEEPSEEK_LEGACY_ALIAS_DEPRECATION = "2026-07-24T15:59:00Z";
|
|
276163
276493
|
var DEEPSEEK_LEGACY_ALIAS_MIGRATIONS = {
|
|
276164
276494
|
"deepseek-chat": { model: "deepseek-v4-flash", thinking: "disabled" },
|