@eigenpal/cli 0.20.94 → 0.20.95

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/dist/cli.js CHANGED
@@ -10729,22 +10729,8 @@ var require_utils = __commonJS(function(exports, module) {
10729
10729
  var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
10730
10730
  var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
10731
10731
  var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
10732
- var BYTE_HEX = new Array(256);
10733
- {
10734
- const HEX_DIGITS = "0123456789ABCDEF";
10735
- for (let i = 0;i < 256; i++) {
10736
- BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
10737
- }
10738
- }
10739
- function percentEncodeNonAscii(cp) {
10740
- if (cp < 2048) {
10741
- return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
10742
- }
10743
- if (cp < 65536) {
10744
- return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
10745
- }
10746
- return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
10747
- }
10732
+ var isRegNameCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=]$/u);
10733
+ var isLiteralRegName = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=]*$/u);
10748
10734
  function stringArrayToHexStripped(input) {
10749
10735
  let acc = "";
10750
10736
  let code = 0;
@@ -10773,6 +10759,11 @@ var require_utils = __commonJS(function(exports, module) {
10773
10759
  var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
10774
10760
  var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
10775
10761
  var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
10762
+ var nonSimpleDomainChars = RegExp.prototype.test.bind(/[^\d!"$&'()*+,\-.;=_`a-z{}~]/u);
10763
+ var numericLastLabel = RegExp.prototype.test.bind(/(?:^|\.)\d+$/u);
10764
+ function nonSimpleMailtoDomain(domain) {
10765
+ return nonSimpleDomainChars(domain) || numericLastLabel(domain);
10766
+ }
10776
10767
  function isZoneIdentifier(zone) {
10777
10768
  if (zone.length === 0)
10778
10769
  return false;
@@ -10919,7 +10910,7 @@ var require_utils = __commonJS(function(exports, module) {
10919
10910
  continue;
10920
10911
  }
10921
10912
  } else if (input[0] === "/") {
10922
- if (input[1] === "." || input[1] === "/") {
10913
+ if (input[1] === ".") {
10923
10914
  output.push("/");
10924
10915
  break;
10925
10916
  }
@@ -10969,13 +10960,47 @@ var require_utils = __commonJS(function(exports, module) {
10969
10960
  }
10970
10961
  return output.join("");
10971
10962
  }
10972
- var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
10973
- var HOST_DELIM_RE = /[@/?#:]/g;
10974
- var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
10975
- function reescapeHostDelimiters(host, isIP) {
10976
- const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
10977
- re.lastIndex = 0;
10978
- return host.replace(re, (ch) => HOST_DELIMS[ch]);
10963
+ function removeDotSegmentsRelative(path) {
10964
+ if (path === "" || path[0] === "/") {
10965
+ return removeDotSegments(path);
10966
+ }
10967
+ const segments = path.split("/");
10968
+ const last = segments.length - 1;
10969
+ const output = [];
10970
+ let trailingDirectory = false;
10971
+ for (let i = 0;i <= last; i++) {
10972
+ const segment = segments[i];
10973
+ if (segment === "." || segment === "..") {
10974
+ if (segment === "..") {
10975
+ if (output.length !== 0 && output[output.length - 1] !== "..") {
10976
+ output.pop();
10977
+ } else {
10978
+ output.push("..");
10979
+ }
10980
+ }
10981
+ trailingDirectory = i === last;
10982
+ } else {
10983
+ output.push(segment);
10984
+ }
10985
+ }
10986
+ if (trailingDirectory && output[output.length - 1] !== "..") {
10987
+ output.push("");
10988
+ }
10989
+ if (output.length === 0 || output[0] === "" || output[0].includes(":")) {
10990
+ output.unshift(".");
10991
+ }
10992
+ return output.join("/");
10993
+ }
10994
+ var IP_HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23" };
10995
+ var IP_HOST_DELIM_RE = /[@/?#]/g;
10996
+ function encodeHost(host, isIP, allowNonAscii = false) {
10997
+ if (!isIP) {
10998
+ if (isLiteralRegName(host))
10999
+ return host;
11000
+ return encodeComponent(host, isRegNameCharacter, allowNonAscii);
11001
+ }
11002
+ IP_HOST_DELIM_RE.lastIndex = 0;
11003
+ return host.replace(IP_HOST_DELIM_RE, (ch) => IP_HOST_DELIMS[ch]);
10979
11004
  }
10980
11005
  function normalizePercentEncoding(input, decodeUnreserved = false) {
10981
11006
  if (input.indexOf("%") === -1) {
@@ -11001,6 +11026,25 @@ var require_utils = __commonJS(function(exports, module) {
11001
11026
  }
11002
11027
  return output;
11003
11028
  }
11029
+ var BYTE_HEX = new Array(256);
11030
+ {
11031
+ const HEX_DIGITS = "0123456789ABCDEF";
11032
+ for (let i = 0;i < 256; i++) {
11033
+ BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
11034
+ }
11035
+ }
11036
+ function isEscapeSafe(cp) {
11037
+ 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;
11038
+ }
11039
+ function percentEncodeNonAscii(cp) {
11040
+ if (cp < 2048) {
11041
+ return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
11042
+ }
11043
+ if (cp < 65536) {
11044
+ return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
11045
+ }
11046
+ return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
11047
+ }
11004
11048
  function normalizePathEncoding(input) {
11005
11049
  let output = "";
11006
11050
  for (let i = 0;i < input.length; i++) {
@@ -11081,24 +11125,30 @@ var require_utils = __commonJS(function(exports, module) {
11081
11125
  }
11082
11126
  return output;
11083
11127
  }
11084
- function encodeComponent(input, isAllowed) {
11128
+ function normalizeQueryFragmentEncoding(input) {
11085
11129
  let output = "";
11086
11130
  for (let i = 0;i < input.length; i++) {
11087
11131
  const ch = input[i];
11088
11132
  if (ch === "%" && i + 2 < input.length) {
11089
11133
  const hex = input.slice(i + 1, i + 3);
11090
11134
  if (isHexPair(hex)) {
11091
- output += "%" + hex.toUpperCase();
11135
+ const normalizedHex = hex.toUpperCase();
11136
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
11137
+ if (isUnreserved(decoded)) {
11138
+ output += decoded;
11139
+ } else {
11140
+ output += "%" + normalizedHex;
11141
+ }
11092
11142
  i += 2;
11093
11143
  continue;
11094
11144
  }
11095
11145
  }
11096
- if (isAllowed(ch)) {
11146
+ if (isQueryFragmentCharacter(ch)) {
11097
11147
  output += ch;
11098
11148
  } else {
11099
11149
  const code = input.charCodeAt(i);
11100
11150
  if (code < 128) {
11101
- output += BYTE_HEX[code];
11151
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
11102
11152
  } else if (code < 55296 || code > 57343) {
11103
11153
  output += percentEncodeNonAscii(code);
11104
11154
  } else if (code <= 56319 && i + 1 < input.length) {
@@ -11116,63 +11166,55 @@ var require_utils = __commonJS(function(exports, module) {
11116
11166
  }
11117
11167
  return output;
11118
11168
  }
11119
- function encodeUserinfo(input) {
11120
- return encodeComponent(input, isUserinfoCharacter);
11121
- }
11122
- function encodeQuery(input) {
11123
- return encodeComponent(input, isQueryFragmentCharacter);
11124
- }
11125
- function encodeFragment(input) {
11126
- return encodeComponent(input, isQueryFragmentCharacter);
11127
- }
11128
- function isEscapeSafe(cp) {
11129
- 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;
11130
- }
11131
- function normalizeQueryFragmentEncoding(input) {
11169
+ function encodeComponent(input, isAllowed, allowNonAscii = false) {
11132
11170
  let output = "";
11133
11171
  for (let i = 0;i < input.length; i++) {
11134
11172
  const ch = input[i];
11135
11173
  if (ch === "%" && i + 2 < input.length) {
11136
11174
  const hex = input.slice(i + 1, i + 3);
11137
11175
  if (isHexPair(hex)) {
11138
- const normalizedHex = hex.toUpperCase();
11139
- const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
11140
- if (isUnreserved(decoded)) {
11141
- output += decoded;
11142
- } else {
11143
- output += "%" + normalizedHex;
11144
- }
11176
+ output += "%" + hex.toUpperCase();
11145
11177
  i += 2;
11146
11178
  continue;
11147
11179
  }
11148
11180
  }
11149
- if (isQueryFragmentCharacter(ch)) {
11181
+ if (isAllowed(ch)) {
11150
11182
  output += ch;
11151
11183
  } else {
11152
11184
  const code = input.charCodeAt(i);
11153
11185
  if (code < 128) {
11154
- output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
11186
+ output += BYTE_HEX[code];
11155
11187
  } else if (code < 55296 || code > 57343) {
11156
- output += percentEncodeNonAscii(code);
11188
+ output += allowNonAscii ? ch : percentEncodeNonAscii(code);
11157
11189
  } else if (code <= 56319 && i + 1 < input.length) {
11158
11190
  const low = input.charCodeAt(i + 1);
11159
11191
  if (low >= 56320 && low <= 57343) {
11160
- output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
11192
+ output += allowNonAscii ? ch + input[i + 1] : percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
11161
11193
  i++;
11162
11194
  } else {
11163
- output += percentEncodeNonAscii(65533);
11195
+ output += allowNonAscii ? "�" : percentEncodeNonAscii(65533);
11164
11196
  }
11165
11197
  } else {
11166
- output += percentEncodeNonAscii(65533);
11198
+ output += allowNonAscii ? "�" : percentEncodeNonAscii(65533);
11167
11199
  }
11168
11200
  }
11169
11201
  }
11170
11202
  return output;
11171
11203
  }
11204
+ function encodeUserinfo(input) {
11205
+ return encodeComponent(input, isUserinfoCharacter);
11206
+ }
11207
+ function encodeQuery(input) {
11208
+ return encodeComponent(input, isQueryFragmentCharacter);
11209
+ }
11210
+ function encodeFragment(input) {
11211
+ return encodeComponent(input, isQueryFragmentCharacter);
11212
+ }
11172
11213
  function escapePreservingEscapes(input) {
11173
11214
  let output = "";
11174
11215
  for (let i = 0;i < input.length; i++) {
11175
- if (input[i] === "%" && i + 2 < input.length) {
11216
+ const ch = input[i];
11217
+ if (ch === "%" && i + 2 < input.length) {
11176
11218
  const hex = input.slice(i + 1, i + 3);
11177
11219
  if (isHexPair(hex)) {
11178
11220
  output += "%" + hex.toUpperCase();
@@ -11180,11 +11222,42 @@ var require_utils = __commonJS(function(exports, module) {
11180
11222
  continue;
11181
11223
  }
11182
11224
  }
11183
- output += escape(input[i]);
11225
+ const code = input.charCodeAt(i);
11226
+ if (code < 128) {
11227
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
11228
+ } else if (code < 55296 || code > 57343) {
11229
+ output += percentEncodeNonAscii(code);
11230
+ } else if (code <= 56319 && i + 1 < input.length) {
11231
+ const low = input.charCodeAt(i + 1);
11232
+ if (low >= 56320 && low <= 57343) {
11233
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
11234
+ i++;
11235
+ } else {
11236
+ output += percentEncodeNonAscii(65533);
11237
+ }
11238
+ } else {
11239
+ output += percentEncodeNonAscii(65533);
11240
+ }
11184
11241
  }
11185
11242
  return output;
11186
11243
  }
11187
- function recomposeAuthority(component) {
11244
+ function recomposeZonedIPv6Host(component) {
11245
+ const zone = component.ipv6Zone;
11246
+ if (zone === undefined)
11247
+ return;
11248
+ const host = component.host;
11249
+ const separator = host.indexOf("%");
11250
+ if (separator === -1)
11251
+ return;
11252
+ const address = host.slice(0, separator);
11253
+ const escaped = address + "%25" + zone;
11254
+ const derived = normalizeIPv6("[" + escaped + "]");
11255
+ if (derived.isIPV6 === true && derived.host === host) {
11256
+ return "[" + escaped + "]";
11257
+ }
11258
+ return;
11259
+ }
11260
+ function recomposeAuthority(component, allowNonAscii = false) {
11188
11261
  const uriTokens = [];
11189
11262
  if (component.userinfo !== undefined) {
11190
11263
  uriTokens.push(encodeUserinfo(component.userinfo));
@@ -11193,15 +11266,20 @@ var require_utils = __commonJS(function(exports, module) {
11193
11266
  if (component.host !== undefined) {
11194
11267
  let host = component.host;
11195
11268
  if (!isIPv4(host)) {
11196
- let ipV6res = normalizeIPv6(host);
11197
- if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
11198
- host = normalizePercentEncoding(host, true);
11199
- ipV6res = normalizeIPv6(host);
11200
- }
11201
- if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
11202
- host = `[${ipV6res.escapedHost}]`;
11269
+ const zonedHost = recomposeZonedIPv6Host(component);
11270
+ if (zonedHost !== undefined) {
11271
+ host = zonedHost;
11203
11272
  } else {
11204
- host = reescapeHostDelimiters(host, false);
11273
+ let ipV6res = normalizeIPv6(host);
11274
+ if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
11275
+ host = normalizePercentEncoding(host, true);
11276
+ ipV6res = normalizeIPv6(host);
11277
+ }
11278
+ if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
11279
+ host = `[${ipV6res.escapedHost}]`;
11280
+ } else {
11281
+ host = encodeHost(host, false, allowNonAscii);
11282
+ }
11205
11283
  }
11206
11284
  }
11207
11285
  uriTokens.push(host);
@@ -11217,9 +11295,12 @@ var require_utils = __commonJS(function(exports, module) {
11217
11295
  return uriTokens.length ? uriTokens.join("") : undefined;
11218
11296
  }
11219
11297
  module.exports = {
11298
+ BYTE_HEX,
11299
+ percentEncodeNonAscii,
11220
11300
  nonSimpleDomain,
11301
+ nonSimpleMailtoDomain,
11221
11302
  recomposeAuthority,
11222
- reescapeHostDelimiters,
11303
+ encodeHost,
11223
11304
  normalizePercentEncoding,
11224
11305
  normalizePathEncoding,
11225
11306
  serializePathEncoding,
@@ -11229,6 +11310,7 @@ var require_utils = __commonJS(function(exports, module) {
11229
11310
  encodeFragment,
11230
11311
  escapePreservingEscapes,
11231
11312
  removeDotSegments,
11313
+ removeDotSegmentsRelative,
11232
11314
  isIPv4,
11233
11315
  isUUID,
11234
11316
  normalizeIPv6,
@@ -11238,7 +11320,7 @@ var require_utils = __commonJS(function(exports, module) {
11238
11320
 
11239
11321
  // ../../node_modules/fast-uri/lib/schemes.js
11240
11322
  var require_schemes = __commonJS(function(exports, module) {
11241
- var { isUUID } = require_utils();
11323
+ var { isUUID, BYTE_HEX, percentEncodeNonAscii, nonSimpleMailtoDomain } = require_utils();
11242
11324
  var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
11243
11325
  var supportedSchemeNames = [
11244
11326
  "http",
@@ -11246,7 +11328,8 @@ var require_schemes = __commonJS(function(exports, module) {
11246
11328
  "ws",
11247
11329
  "wss",
11248
11330
  "urn",
11249
- "urn:uuid"
11331
+ "urn:uuid",
11332
+ "mailto"
11250
11333
  ];
11251
11334
  function isValidSchemeName(name) {
11252
11335
  return supportedSchemeNames.indexOf(name) !== -1;
@@ -11383,7 +11466,8 @@ var require_schemes = __commonJS(function(exports, module) {
11383
11466
  scheme: "urn",
11384
11467
  parse: urnParse,
11385
11468
  serialize: urnSerialize,
11386
- skipNormalize: true
11469
+ skipNormalize: true,
11470
+ absolutePath: true
11387
11471
  };
11388
11472
  var urnuuid = {
11389
11473
  scheme: "urn:uuid",
@@ -11391,13 +11475,262 @@ var require_schemes = __commonJS(function(exports, module) {
11391
11475
  serialize: urnuuidSerialize,
11392
11476
  skipNormalize: true
11393
11477
  };
11478
+ var LOCAL_PART_ALLOWED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+=";
11479
+ var HFNAME_ALLOWED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+,;:@";
11480
+ var DTEXT_ALLOWED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+;:";
11481
+ function allowSet(chars, allowNonAscii = false) {
11482
+ const table = new Uint8Array(128);
11483
+ for (let i = 0;i < chars.length; i++) {
11484
+ table[chars.charCodeAt(i)] = 1;
11485
+ }
11486
+ const escaped = chars.replace(/[\\\]^-]/gu, "\\$&");
11487
+ const cls = allowNonAscii ? `[${escaped}]|[^\\0-\\x7F\\uD800-\\uDFFF]` : `[${escaped}]`;
11488
+ return { all: new RegExp(`^(?:${cls})*$`, "u"), table, allowNonAscii };
11489
+ }
11490
+ var LOCAL_PART = allowSet(LOCAL_PART_ALLOWED);
11491
+ var HFNAME = allowSet(HFNAME_ALLOWED);
11492
+ var DTEXT = allowSet(DTEXT_ALLOWED);
11493
+ var DTEXT_IRI = allowSet(DTEXT_ALLOWED, true);
11494
+ var HEX_PAIR = /^[\da-f]{2}$/iu;
11495
+ var MAILTO_DOMAIN_LITERAL = /^\[[\x21-\x5A\x5E-\x7E]*\]$/u;
11496
+ var MAILTO_DOMAIN_ERROR = "URI mailto has an invalid recipient domain.";
11497
+ var MAILTO_AUTHORITY_ERROR = "URI mailto must not have an authority component.";
11498
+ var HAS_SURROGATE = /[\uD800-\uDFFF]/u;
11499
+ function decodeHex(str) {
11500
+ if (typeof str !== "string" || str.indexOf("%") === -1) {
11501
+ return str;
11502
+ }
11503
+ try {
11504
+ return decodeURIComponent(str);
11505
+ } catch {
11506
+ return str;
11507
+ }
11508
+ }
11509
+ function replaceLoneSurrogates(input) {
11510
+ let result = "";
11511
+ for (let i = 0;i < input.length; i++) {
11512
+ const code = input.charCodeAt(i);
11513
+ if (code >= 55296 && code <= 56319 && i + 1 < input.length) {
11514
+ const low = input.charCodeAt(i + 1);
11515
+ if (low >= 56320 && low <= 57343) {
11516
+ result += input[i] + input[i + 1];
11517
+ i++;
11518
+ continue;
11519
+ }
11520
+ }
11521
+ result += code >= 55296 && code <= 57343 ? "�" : input[i];
11522
+ }
11523
+ return result;
11524
+ }
11525
+ function encodeWithAllow(input, set) {
11526
+ if (set.all.test(input)) {
11527
+ return input;
11528
+ }
11529
+ const table = set.table;
11530
+ let result = "";
11531
+ for (let i = 0;i < input.length; i++) {
11532
+ const code = input.charCodeAt(i);
11533
+ if (code < 128) {
11534
+ if (table[code] === 1) {
11535
+ result += input[i];
11536
+ } else if (code === 37 && i + 2 < input.length && HEX_PAIR.test(input.slice(i + 1, i + 3))) {
11537
+ result += "%" + input.slice(i + 1, i + 3).toUpperCase();
11538
+ i += 2;
11539
+ } else {
11540
+ result += BYTE_HEX[code];
11541
+ }
11542
+ continue;
11543
+ }
11544
+ if (code < 55296 || code > 57343) {
11545
+ result += set.allowNonAscii ? input[i] : percentEncodeNonAscii(code);
11546
+ continue;
11547
+ }
11548
+ if (code <= 56319 && i + 1 < input.length) {
11549
+ const low = input.charCodeAt(i + 1);
11550
+ if (low >= 56320 && low <= 57343) {
11551
+ result += set.allowNonAscii ? input[i] + input[i + 1] : percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
11552
+ i++;
11553
+ continue;
11554
+ }
11555
+ }
11556
+ result += set.allowNonAscii ? "�" : percentEncodeNonAscii(65533);
11557
+ }
11558
+ return result;
11559
+ }
11560
+ function mailtoNormalizeDomain(domain, options, component) {
11561
+ const normalizedDomain = String(domain).toLowerCase();
11562
+ if (MAILTO_DOMAIN_LITERAL.test(normalizedDomain)) {
11563
+ return normalizedDomain;
11564
+ }
11565
+ if (normalizedDomain !== "" && !nonSimpleMailtoDomain(normalizedDomain)) {
11566
+ return normalizedDomain;
11567
+ }
11568
+ try {
11569
+ const parsedDomain = new URL("http://" + normalizedDomain);
11570
+ if (parsedDomain.username || parsedDomain.password || parsedDomain.port || parsedDomain.pathname !== "/" || parsedDomain.search || parsedDomain.hash || !parsedDomain.hostname) {
11571
+ throw new Error(MAILTO_DOMAIN_ERROR);
11572
+ }
11573
+ return options && options.unicodeSupport ? normalizedDomain : parsedDomain.hostname;
11574
+ } catch {
11575
+ if (component) {
11576
+ component.error = component.error || MAILTO_DOMAIN_ERROR;
11577
+ }
11578
+ return normalizedDomain;
11579
+ }
11580
+ }
11581
+ function mailtoEncodeDomain(domain, options) {
11582
+ const set = options && options.unicodeSupport ? DTEXT_IRI : DTEXT;
11583
+ if (domain.length > 1 && domain[0] === "[" && domain[domain.length - 1] === "]") {
11584
+ return "[" + encodeWithAllow(domain.slice(1, -1), set) + "]";
11585
+ }
11586
+ return encodeWithAllow(domain, set);
11587
+ }
11588
+ function mailtoParse(component, options) {
11589
+ const mailtoComponent = component;
11590
+ let rawPath = mailtoComponent.path;
11591
+ let rawQuery = mailtoComponent.query;
11592
+ if (rawPath && HAS_SURROGATE.test(rawPath))
11593
+ rawPath = replaceLoneSurrogates(rawPath);
11594
+ if (rawQuery && HAS_SURROGATE.test(rawQuery))
11595
+ rawQuery = replaceLoneSurrogates(rawQuery);
11596
+ const to = rawPath ? rawPath.indexOf(",") === -1 ? [rawPath] : rawPath.split(",") : [];
11597
+ mailtoComponent.path = undefined;
11598
+ if (rawQuery) {
11599
+ let headers = null;
11600
+ let start = 0;
11601
+ while (start <= rawQuery.length) {
11602
+ let end = rawQuery.indexOf("&", start);
11603
+ if (end === -1)
11604
+ end = rawQuery.length;
11605
+ const token = rawQuery.slice(start, end);
11606
+ start = end + 1;
11607
+ const eqIdx = token.indexOf("=");
11608
+ if (eqIdx !== token.lastIndexOf("=")) {
11609
+ mailtoComponent.error = mailtoComponent.error || "URI mailto has malformed header fields.";
11610
+ continue;
11611
+ }
11612
+ const name = decodeHex(eqIdx === -1 ? token : token.slice(0, eqIdx));
11613
+ const normalizedName = name.toLowerCase();
11614
+ const value = eqIdx === -1 ? "" : token.slice(eqIdx + 1);
11615
+ if (normalizedName === "to") {
11616
+ const addrs = value.split(",");
11617
+ for (let j = 0;j < addrs.length; j++)
11618
+ to.push(addrs[j]);
11619
+ continue;
11620
+ }
11621
+ if (normalizedName === "subject") {
11622
+ mailtoComponent.subject = decodeHex(value);
11623
+ continue;
11624
+ }
11625
+ if (normalizedName === "body") {
11626
+ mailtoComponent.body = decodeHex(value);
11627
+ continue;
11628
+ }
11629
+ if (headers === null)
11630
+ headers = Object.create(null);
11631
+ headers[name] = decodeHex(value);
11632
+ }
11633
+ if (headers !== null)
11634
+ mailtoComponent.headers = headers;
11635
+ }
11636
+ mailtoComponent.query = undefined;
11637
+ if (to.length > 0 && (mailtoComponent.userinfo !== undefined || mailtoComponent.host !== undefined || mailtoComponent.port !== undefined)) {
11638
+ mailtoComponent.userinfo = undefined;
11639
+ mailtoComponent.host = undefined;
11640
+ mailtoComponent.port = undefined;
11641
+ mailtoComponent.error = mailtoComponent.error || MAILTO_AUTHORITY_ERROR;
11642
+ }
11643
+ for (let i = 0;i < to.length; i++) {
11644
+ const rawAddr = to[i];
11645
+ const atIdx = rawAddr.lastIndexOf("@");
11646
+ if (atIdx < 0) {
11647
+ mailtoComponent.error = mailtoComponent.error || MAILTO_DOMAIN_ERROR;
11648
+ to[i] = decodeHex(rawAddr);
11649
+ continue;
11650
+ }
11651
+ const local = decodeHex(rawAddr.slice(0, atIdx));
11652
+ const domain = mailtoNormalizeDomain(decodeHex(rawAddr.slice(atIdx + 1)), options, mailtoComponent);
11653
+ to[i] = local + "@" + domain;
11654
+ }
11655
+ if (to.length)
11656
+ mailtoComponent.to = to;
11657
+ return mailtoComponent;
11658
+ }
11659
+ function mailtoEncodeHeaderName(name) {
11660
+ return encodeWithAllow(name.replace(/%/gu, "%25"), HFNAME);
11661
+ }
11662
+ function mailtoSerialize(component, options) {
11663
+ const mailtoComponent = component;
11664
+ const to = Array.isArray(mailtoComponent.to) ? mailtoComponent.to.slice() : [];
11665
+ const sourceHeaders = mailtoComponent.headers && typeof mailtoComponent.headers === "object" ? Object.assign(Object.create(null), mailtoComponent.headers) : Object.create(null);
11666
+ const headers = Object.create(null);
11667
+ for (const name in sourceHeaders) {
11668
+ const normalizedName = name.toLowerCase();
11669
+ if (normalizedName === "to") {
11670
+ const addrs = String(sourceHeaders[name]).split(",");
11671
+ for (let i = 0;i < addrs.length; i++)
11672
+ to.push(addrs[i]);
11673
+ } else if (normalizedName === "subject" || normalizedName === "body") {
11674
+ headers[normalizedName] = sourceHeaders[name];
11675
+ } else {
11676
+ headers[name] = sourceHeaders[name];
11677
+ }
11678
+ }
11679
+ if (mailtoComponent.subject !== undefined)
11680
+ headers.subject = mailtoComponent.subject;
11681
+ if (mailtoComponent.body !== undefined)
11682
+ headers.body = mailtoComponent.body;
11683
+ mailtoComponent.headers = headers;
11684
+ if (to.length) {
11685
+ mailtoComponent.userinfo = undefined;
11686
+ mailtoComponent.host = undefined;
11687
+ mailtoComponent.port = undefined;
11688
+ for (let i = 0;i < to.length; i++) {
11689
+ const addr = String(to[i]);
11690
+ const atIdx = addr.lastIndexOf("@");
11691
+ const rawLocal = atIdx >= 0 ? addr.slice(0, atIdx) : addr;
11692
+ const rawDomain = atIdx >= 0 ? addr.slice(atIdx + 1) : "";
11693
+ const local = encodeWithAllow(rawLocal, LOCAL_PART);
11694
+ const decodedDomain = decodeHex(rawDomain);
11695
+ const normalizedDomain = mailtoNormalizeDomain(decodedDomain, options);
11696
+ to[i] = local + "@" + mailtoEncodeDomain(normalizedDomain, options);
11697
+ }
11698
+ mailtoComponent.path = to.join(",");
11699
+ options.skipEscape = true;
11700
+ } else {
11701
+ mailtoComponent.path = undefined;
11702
+ }
11703
+ let query = "";
11704
+ let count = 0;
11705
+ for (const name in headers) {
11706
+ if (count++ !== 0)
11707
+ query += "&";
11708
+ query += mailtoEncodeHeaderName(name) + "=" + encodeWithAllow(String(headers[name]), HFNAME);
11709
+ }
11710
+ if (count !== 0) {
11711
+ mailtoComponent.query = query;
11712
+ } else {
11713
+ mailtoComponent.headers = undefined;
11714
+ }
11715
+ return mailtoComponent;
11716
+ }
11717
+ var mailto = {
11718
+ scheme: "mailto",
11719
+ parse: mailtoParse,
11720
+ serialize: mailtoSerialize,
11721
+ domainHost: false,
11722
+ unicodeSupport: true,
11723
+ skipNormalize: true,
11724
+ absolutePath: true
11725
+ };
11394
11726
  var SCHEMES = {
11395
11727
  http,
11396
11728
  https,
11397
11729
  ws,
11398
11730
  wss,
11399
11731
  urn,
11400
- "urn:uuid": urnuuid
11732
+ "urn:uuid": urnuuid,
11733
+ mailto
11401
11734
  };
11402
11735
  Object.setPrototypeOf(SCHEMES, null);
11403
11736
  function getSchemeHandler(scheme) {
@@ -11413,16 +11746,18 @@ var require_schemes = __commonJS(function(exports, module) {
11413
11746
 
11414
11747
  // ../../node_modules/fast-uri/index.js
11415
11748
  var require_fast_uri = __commonJS(function(exports, module) {
11416
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
11749
+ var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, encodeHost, isIPv4, nonSimpleDomain } = require_utils();
11417
11750
  var { SCHEMES, getSchemeHandler } = require_schemes();
11418
11751
  var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
11419
11752
  var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
11420
- function decodeValidScheme(scheme) {
11421
- const decodedScheme = unescape(String(scheme));
11422
- if (!VALID_SCHEME.test(decodedScheme)) {
11753
+ var MALFORMED_HOST_ERROR = "URI host is malformed.";
11754
+ var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
11755
+ function validateScheme(scheme) {
11756
+ const stringScheme = String(scheme);
11757
+ if (!VALID_SCHEME.test(stringScheme)) {
11423
11758
  throw new TypeError(MALFORMED_SCHEME_ERROR);
11424
11759
  }
11425
- return decodedScheme;
11760
+ return stringScheme;
11426
11761
  }
11427
11762
  function normalize(uri, options) {
11428
11763
  if (typeof uri === "string") {
@@ -11437,6 +11772,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
11437
11772
  const {
11438
11773
  parsed: baseParsed,
11439
11774
  malformedAuthorityOrPort: baseMalformed,
11775
+ malformedReferenceEdge: baseMalformedReferenceEdge,
11440
11776
  malformedPercentEncoding: baseMalformedPercentEncoding,
11441
11777
  malformedSchemeSpecific: baseMalformedSchemeSpecific,
11442
11778
  malformedHost: baseMalformedHost,
@@ -11445,26 +11781,42 @@ var require_fast_uri = __commonJS(function(exports, module) {
11445
11781
  const {
11446
11782
  parsed: relativeParsed,
11447
11783
  malformedAuthorityOrPort: relativeMalformed,
11784
+ malformedReferenceEdge: relativeMalformedReferenceEdge,
11448
11785
  malformedPercentEncoding: relativeMalformedPercentEncoding,
11449
11786
  malformedSchemeSpecific: relativeMalformedSchemeSpecific,
11450
11787
  malformedHost: relativeMalformedHost,
11451
11788
  malformedScheme: relativeMalformedScheme
11452
11789
  } = parseWithStatus(relativeURI, schemelessOptions);
11453
- if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
11790
+ if (baseMalformed || relativeMalformed || baseMalformedReferenceEdge || relativeMalformedReferenceEdge || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
11454
11791
  throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
11455
11792
  }
11456
11793
  const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
11457
11794
  const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
11458
11795
  const resolvedHost = resolved.host;
11796
+ if ((resolved.scheme === "http" || resolved.scheme === "https") && !resolvedHost) {
11797
+ throw new Error("HTTP URIs must have a host.");
11798
+ }
11459
11799
  const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
11800
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
11801
+ throw new Error(MALFORMED_HOST_ERROR);
11802
+ }
11460
11803
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
11461
11804
  const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
11462
11805
  if (resolved.error && !encodedASCIIHost) {
11463
11806
  throw new Error(resolved.error);
11464
11807
  }
11465
11808
  schemelessOptions.skipEscape = true;
11809
+ if (resolvedSchemeHandler && resolvedSchemeHandler.absolutePath) {
11810
+ schemelessOptions.absolutePath = true;
11811
+ }
11466
11812
  return serialize(resolved, schemelessOptions);
11467
11813
  }
11814
+ function copyHost(target, source) {
11815
+ target.host = source.host;
11816
+ if (source.ipv6Zone !== undefined) {
11817
+ target.ipv6Zone = source.ipv6Zone;
11818
+ }
11819
+ }
11468
11820
  function resolveComponent(base, relative, options, skipNormalization) {
11469
11821
  const target = {};
11470
11822
  if (!skipNormalization) {
@@ -11475,14 +11827,15 @@ var require_fast_uri = __commonJS(function(exports, module) {
11475
11827
  if (!options.tolerant && relative.scheme) {
11476
11828
  target.scheme = relative.scheme;
11477
11829
  target.userinfo = relative.userinfo;
11478
- target.host = relative.host;
11830
+ copyHost(target, relative);
11479
11831
  target.port = relative.port;
11480
- target.path = removeDotSegments(relative.path || "");
11832
+ const relativeSchemeHandler = getSchemeHandler(relative.scheme);
11833
+ target.path = relativeSchemeHandler && relativeSchemeHandler.absolutePath ? relative.path || "" : removeDotSegments(relative.path || "");
11481
11834
  target.query = relative.query;
11482
11835
  } else {
11483
11836
  if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
11484
11837
  target.userinfo = relative.userinfo;
11485
- target.host = relative.host;
11838
+ copyHost(target, relative);
11486
11839
  target.port = relative.port;
11487
11840
  target.path = removeDotSegments(relative.path || "");
11488
11841
  target.query = relative.query;
@@ -11498,19 +11851,20 @@ var require_fast_uri = __commonJS(function(exports, module) {
11498
11851
  if (relative.path[0] === "/") {
11499
11852
  target.path = removeDotSegments(relative.path);
11500
11853
  } else {
11501
- if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
11854
+ const baseHasAuthority = base.userinfo !== undefined || base.host !== undefined || base.port !== undefined;
11855
+ if (baseHasAuthority && !base.path) {
11502
11856
  target.path = "/" + relative.path;
11503
11857
  } else if (!base.path) {
11504
11858
  target.path = relative.path;
11505
11859
  } else {
11506
11860
  target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
11507
11861
  }
11508
- target.path = removeDotSegments(target.path);
11862
+ target.path = base.scheme === undefined && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
11509
11863
  }
11510
11864
  target.query = relative.query;
11511
11865
  }
11512
11866
  target.userinfo = base.userinfo;
11513
- target.host = base.host;
11867
+ copyHost(target, base);
11514
11868
  target.port = base.port;
11515
11869
  }
11516
11870
  target.scheme = base.scheme;
@@ -11526,6 +11880,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
11526
11880
  function serialize(cmpts, opts) {
11527
11881
  const component = {
11528
11882
  host: cmpts.host,
11883
+ ipv6Zone: cmpts.ipv6Zone,
11529
11884
  scheme: cmpts.scheme,
11530
11885
  userinfo: cmpts.userinfo,
11531
11886
  port: cmpts.port,
@@ -11538,18 +11893,23 @@ var require_fast_uri = __commonJS(function(exports, module) {
11538
11893
  reference: cmpts.reference,
11539
11894
  resourceName: cmpts.resourceName,
11540
11895
  secure: cmpts.secure,
11896
+ to: cmpts.to,
11897
+ subject: cmpts.subject,
11898
+ body: cmpts.body,
11899
+ headers: cmpts.headers,
11541
11900
  error: ""
11542
11901
  };
11543
11902
  const options = Object.assign({}, opts);
11544
11903
  const uriTokens = [];
11545
11904
  if (component.scheme) {
11546
- component.scheme = decodeValidScheme(component.scheme);
11905
+ component.scheme = validateScheme(component.scheme);
11547
11906
  }
11548
11907
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
11549
11908
  if (schemeHandler && schemeHandler.serialize)
11550
11909
  schemeHandler.serialize(component, options);
11551
11910
  const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
11552
- const pathNoScheme = !options.skipEscape && component.scheme === undefined && !hasAuthority;
11911
+ const schemelessReference = (component.scheme === undefined || options.reference === "suffix") && !hasAuthority;
11912
+ const pathNoScheme = !options.skipEscape && schemelessReference;
11553
11913
  if (component.path !== undefined) {
11554
11914
  if (!options.skipEscape) {
11555
11915
  component.path = serializePathEncoding(component.path, pathNoScheme);
@@ -11558,10 +11918,11 @@ var require_fast_uri = __commonJS(function(exports, module) {
11558
11918
  }
11559
11919
  }
11560
11920
  if (options.reference !== "suffix" && component.scheme) {
11561
- component.scheme = decodeValidScheme(component.scheme);
11921
+ component.scheme = validateScheme(component.scheme);
11562
11922
  uriTokens.push(component.scheme, ":");
11563
11923
  }
11564
- const authority = recomposeAuthority(component);
11924
+ const allowNonAsciiHost = options.unicodeSupport === true || Boolean(schemeHandler && schemeHandler.unicodeSupport);
11925
+ const authority = recomposeAuthority(component, allowNonAsciiHost);
11565
11926
  if (authority !== undefined) {
11566
11927
  if (options.reference !== "suffix") {
11567
11928
  uriTokens.push("//");
@@ -11574,9 +11935,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
11574
11935
  if (component.path !== undefined) {
11575
11936
  let s = component.path;
11576
11937
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
11577
- s = removeDotSegments(s);
11938
+ s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
11578
11939
  }
11579
- if (pathNoScheme) {
11940
+ if (schemelessReference) {
11580
11941
  s = serializePathEncoding(s, true);
11581
11942
  }
11582
11943
  if (authority === undefined && s[0] === "/" && s[1] === "/") {
@@ -11624,16 +11985,33 @@ var require_fast_uri = __commonJS(function(exports, module) {
11624
11985
  return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
11625
11986
  }
11626
11987
  function canonicalizeHost(parsed, options, schemeHandler, isIP) {
11627
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
11988
+ const bracketedIPLiteral = parsed.host && parsed.host[0] === "[" && parsed.host[parsed.host.length - 1] === "]";
11989
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
11990
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
11991
+ return true;
11992
+ }
11993
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && !bracketedIPLiteral && nonSimpleDomain(parsed.host)) {
11994
+ let url;
11628
11995
  try {
11629
- parsed.host = new URL("http://" + parsed.host).hostname;
11996
+ url = new URL("http://" + parsed.host);
11630
11997
  } catch (e) {
11631
11998
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
11632
11999
  return true;
11633
12000
  }
12001
+ if (!isHostOnlyURL(url)) {
12002
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
12003
+ return true;
12004
+ }
12005
+ parsed.host = url.hostname;
11634
12006
  }
11635
12007
  return false;
11636
12008
  }
12009
+ function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
12010
+ return Boolean(parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host));
12011
+ }
12012
+ function isHostOnlyURL(url) {
12013
+ return url.username === "" && url.password === "" && url.port === "" && url.pathname === "/" && url.search === "" && url.hash === "" && url.hostname !== "";
12014
+ }
11637
12015
  function parseWithStatus(uri, opts) {
11638
12016
  const options = Object.assign({}, opts);
11639
12017
  const parsed = {
@@ -11646,6 +12024,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
11646
12024
  fragment: undefined
11647
12025
  };
11648
12026
  let malformedAuthorityOrPort = false;
12027
+ const malformedReferenceEdge = uri.length !== 0 && (uri.charCodeAt(0) <= 32 || uri.charCodeAt(uri.length - 1) <= 32);
11649
12028
  let malformedPercentEncoding = false;
11650
12029
  let malformedSchemeSpecific = false;
11651
12030
  let malformedHost = false;
@@ -11678,6 +12057,9 @@ var require_fast_uri = __commonJS(function(exports, module) {
11678
12057
  }
11679
12058
  }
11680
12059
  }
12060
+ if (malformedReferenceEdge) {
12061
+ parsed.error = parsed.error || "URI must not contain leading or trailing C0 controls or spaces.";
12062
+ }
11681
12063
  const matches = uri.match(URI_PARSE);
11682
12064
  if (matches) {
11683
12065
  parsed.scheme = matches[1];
@@ -11688,9 +12070,8 @@ var require_fast_uri = __commonJS(function(exports, module) {
11688
12070
  parsed.query = matches[7];
11689
12071
  parsed.fragment = matches[8];
11690
12072
  if (parsed.scheme !== undefined) {
11691
- const decodedScheme = unescape(parsed.scheme);
11692
- if (VALID_SCHEME.test(decodedScheme)) {
11693
- parsed.scheme = decodedScheme.toLowerCase();
12073
+ if (VALID_SCHEME.test(parsed.scheme)) {
12074
+ parsed.scheme = parsed.scheme.toLowerCase();
11694
12075
  } else {
11695
12076
  parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
11696
12077
  malformedScheme = true;
@@ -11717,8 +12098,11 @@ var require_fast_uri = __commonJS(function(exports, module) {
11717
12098
  isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
11718
12099
  malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
11719
12100
  parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
12101
+ if (isIP && ipv6result.isIPV6 === true && parsed.host.indexOf("%") !== -1) {
12102
+ parsed.ipv6Zone = parsed.host.slice(parsed.host.indexOf("%") + 1);
12103
+ }
11720
12104
  if (malformedIPLiteral) {
11721
- parsed.error = parsed.error || "URI host is malformed.";
12105
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
11722
12106
  malformedAuthorityOrPort = true;
11723
12107
  }
11724
12108
  } else {
@@ -11741,12 +12125,18 @@ var require_fast_uri = __commonJS(function(exports, module) {
11741
12125
  if (!malformedIPLiteral) {
11742
12126
  malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
11743
12127
  }
11744
- if (uri.indexOf("%") !== -1 && parsed.host !== undefined && !malformedIPLiteral) {
11745
- let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
11746
- if (!isIP) {
12128
+ if (parsed.host !== undefined && !malformedIPLiteral) {
12129
+ let host = parsed.host;
12130
+ if (uri.indexOf("%") !== -1 && !isIP) {
12131
+ host = normalizePercentEncoding(host, true);
11747
12132
  host = normalizePercentEncoding(host.toLowerCase());
11748
12133
  }
11749
- parsed.host = reescapeHostDelimiters(host, isIP);
12134
+ if (options.scheme !== "null") {
12135
+ const allowNonAsciiHost = options.unicodeSupport === true || Boolean(schemeHandler && schemeHandler.unicodeSupport);
12136
+ parsed.host = encodeHost(host, isIP, allowNonAsciiHost);
12137
+ } else {
12138
+ parsed.host = host;
12139
+ }
11750
12140
  }
11751
12141
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
11752
12142
  if (parsed.path) {
@@ -11768,7 +12158,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
11768
12158
  } else {
11769
12159
  parsed.error = parsed.error || "URI can not be parsed.";
11770
12160
  }
11771
- return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
12161
+ return { parsed, malformedAuthorityOrPort, malformedReferenceEdge, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
11772
12162
  }
11773
12163
  function parse(uri, opts) {
11774
12164
  return parseWithStatus(uri, opts).parsed;
@@ -11777,10 +12167,11 @@ var require_fast_uri = __commonJS(function(exports, module) {
11777
12167
  return normalizeStringWithStatus(uri, opts).normalized;
11778
12168
  }
11779
12169
  function normalizeStringWithStatus(uri, opts) {
11780
- const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
12170
+ const { parsed, malformedAuthorityOrPort, malformedReferenceEdge, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
11781
12171
  return {
11782
- normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
12172
+ normalized: malformedAuthorityOrPort || malformedReferenceEdge || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
11783
12173
  malformedAuthorityOrPort,
12174
+ malformedReferenceEdge,
11784
12175
  malformedPercentEncoding,
11785
12176
  malformedSchemeSpecific,
11786
12177
  malformedHost,
@@ -11797,8 +12188,8 @@ var require_fast_uri = __commonJS(function(exports, module) {
11797
12188
  } catch {
11798
12189
  return;
11799
12190
  }
11800
- const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
11801
- return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
12191
+ const { normalized, malformedAuthorityOrPort, malformedReferenceEdge, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
12192
+ return malformedAuthorityOrPort || malformedReferenceEdge || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
11802
12193
  }
11803
12194
  var fastUri = {
11804
12195
  SCHEMES,
@@ -14677,7 +15068,7 @@ function decodeJsonPointerSegment(segment) {
14677
15068
  if (INVALID_JSON_POINTER_ESCAPE.test(segment)) {
14678
15069
  throw new Error(`Invalid JSON Pointer escape in segment "${segment}"`);
14679
15070
  }
14680
- return segment.replace(JSON_POINTER_ESCAPE, (escape2) => escape2 === "~1" ? "/" : "~");
15071
+ return segment.replace(JSON_POINTER_ESCAPE, (escape) => escape === "~1" ? "/" : "~");
14681
15072
  }
14682
15073
  function decodeHumanReviewJsonPointer(pointer) {
14683
15074
  const parsed = HumanReviewJsonPointerSchema.safeParse(pointer);
@@ -98980,7 +99371,7 @@ var require_lodash = __commonJS(function(exports, module) {
98980
99371
  position -= target.length;
98981
99372
  return position >= 0 && string.slice(position, end) == target;
98982
99373
  }
98983
- function escape2(string) {
99374
+ function escape(string) {
98984
99375
  string = toString(string);
98985
99376
  return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
98986
99377
  }
@@ -99220,7 +99611,7 @@ __p += '`;
99220
99611
  }
99221
99612
  return result + omission;
99222
99613
  }
99223
- function unescape2(string) {
99614
+ function unescape(string) {
99224
99615
  string = toString(string);
99225
99616
  return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
99226
99617
  }
@@ -99604,7 +99995,7 @@ __p += '`;
99604
99995
  lodash.divide = divide;
99605
99996
  lodash.endsWith = endsWith;
99606
99997
  lodash.eq = eq;
99607
- lodash.escape = escape2;
99998
+ lodash.escape = escape;
99608
99999
  lodash.escapeRegExp = escapeRegExp;
99609
100000
  lodash.every = every;
99610
100001
  lodash.find = find;
@@ -99733,7 +100124,7 @@ __p += '`;
99733
100124
  lodash.trimEnd = trimEnd;
99734
100125
  lodash.trimStart = trimStart;
99735
100126
  lodash.truncate = truncate;
99736
- lodash.unescape = unescape2;
100127
+ lodash.unescape = unescape;
99737
100128
  lodash.uniqueId = uniqueId;
99738
100129
  lodash.upperCase = upperCase;
99739
100130
  lodash.upperFirst = upperFirst;
@@ -189188,7 +189579,7 @@ function literal2(s) {
189188
189579
  read();
189189
189580
  }
189190
189581
  }
189191
- function escape2() {
189582
+ function escape() {
189192
189583
  const c2 = peek();
189193
189584
  switch (c2) {
189194
189585
  case "b":
@@ -203495,7 +203886,7 @@ globstar while`, file, fr, pattern, pr, swallowee);
203495
203886
  switch (c5) {
203496
203887
  case "\\":
203497
203888
  read();
203498
- buffer += escape2();
203889
+ buffer += escape();
203499
203890
  return;
203500
203891
  case '"':
203501
203892
  if (doubleQuote) {
@@ -215208,7 +215599,7 @@ function toPutBody(body) {
215208
215599
  // package.json
215209
215600
  var package_default = {
215210
215601
  name: "@eigenpal/cli",
215211
- version: "0.20.94",
215602
+ version: "0.20.95",
215212
215603
  description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
215213
215604
  keywords: [
215214
215605
  "eigenpal",
@@ -218811,13 +219202,13 @@ function parseResultsFormat(value) {
218811
219202
  throw new InvalidArgumentError("format must be csv or json");
218812
219203
  }
218813
219204
  function toCsv(rows, columns) {
218814
- const escape2 = (value) => {
219205
+ const escape = (value) => {
218815
219206
  const text = value == null ? "" : String(value);
218816
219207
  return /[",\n]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text;
218817
219208
  };
218818
219209
  return [
218819
219210
  columns.join(","),
218820
- ...rows.map((row) => columns.map((column) => escape2(row[column])).join(","))
219211
+ ...rows.map((row) => columns.map((column) => escape(row[column])).join(","))
218821
219212
  ].join(`
218822
219213
  `);
218823
219214
  }