@aws/nx-plugin-mcp 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/aws-nx-mcp.js +871 -221
  2. package/package.json +1 -1
package/bin/aws-nx-mcp.js CHANGED
@@ -15,14 +15,14 @@ var __esmMin = (fn, res, err) => () => {
15
15
  }
16
16
  };
17
17
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
18
- var __exportAll = (all, no_symbols) => {
19
- let target = {};
18
+ var __exportAll = (all, flags) => {
19
+ let target = Object.setPrototypeOf({}, null);
20
20
  for (var name in all) __defProp(target, name, {
21
21
  get: all[name],
22
22
  enumerable: true
23
23
  });
24
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
25
- return target;
24
+ if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
25
+ return flags & 2 ? target : Object.preventExtensions(target);
26
26
  };
27
27
  var __copyProps = (to, from, except, desc) => {
28
28
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
@@ -16174,12 +16174,34 @@ var require_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16174
16174
  "additionalProperties": false
16175
16175
  };
16176
16176
  }));
16177
- // ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js
16177
+ // ../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/utils.js
16178
16178
  var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16179
16179
  /** @type {(value: string) => boolean} */
16180
16180
  const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
16181
16181
  /** @type {(value: string) => boolean} */
16182
16182
  const 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);
16183
+ /** @type {(value: string) => boolean} */
16184
+ const isPort = RegExp.prototype.test.bind(/^\d*$/u);
16185
+ /** @type {(value: string) => boolean} */
16186
+ const isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
16187
+ /** @type {(value: string) => boolean} */
16188
+ const isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
16189
+ /** @type {(value: string) => boolean} */
16190
+ const isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
16191
+ /** @type {(value: string) => boolean} */
16192
+ const isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
16193
+ /** @type {(value: string) => boolean} */
16194
+ const isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
16195
+ const BYTE_HEX = new Array(256);
16196
+ {
16197
+ const HEX_DIGITS = "0123456789ABCDEF";
16198
+ for (let i = 0; i < 256; i++) BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
16199
+ }
16200
+ function percentEncodeNonAscii(cp) {
16201
+ if (cp < 2048) return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
16202
+ if (cp < 65536) return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
16203
+ return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
16204
+ }
16183
16205
  /**
16184
16206
  * @param {Array<string>} input
16185
16207
  * @returns {string}
@@ -16202,121 +16224,162 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16202
16224
  }
16203
16225
  return acc;
16204
16226
  }
16205
- /**
16206
- * @typedef {Object} GetIPV6Result
16207
- * @property {boolean} error - Indicates if there was an error parsing the IPv6 address.
16208
- * @property {string} address - The parsed IPv6 address.
16209
- * @property {string} [zone] - The zone identifier, if present.
16210
- */
16227
+ /** @type {(value: string) => boolean} */
16228
+ const isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
16229
+ /** @type {(value: string) => boolean} */
16230
+ const isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
16231
+ /** @type {(value: string) => boolean} */
16232
+ const isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
16211
16233
  /**
16212
16234
  * @param {string} value
16213
16235
  * @returns {boolean}
16214
16236
  */
16215
16237
  const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
16216
16238
  /**
16217
- * @param {Array<string>} buffer
16239
+ * @param {string} zone
16218
16240
  * @returns {boolean}
16219
16241
  */
16220
- function consumeIsZone(buffer) {
16221
- buffer.length = 0;
16242
+ function isZoneIdentifier(zone) {
16243
+ if (zone.length === 0) return false;
16244
+ for (let i = 0; i < zone.length; i++) {
16245
+ if (isZoneCharacter(zone[i])) continue;
16246
+ if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
16247
+ i += 2;
16248
+ continue;
16249
+ }
16250
+ return false;
16251
+ }
16222
16252
  return true;
16223
16253
  }
16224
16254
  /**
16225
- * @param {Array<string>} buffer
16226
- * @param {Array<string>} address
16227
- * @param {GetIPV6Result} output
16228
- * @returns {boolean}
16255
+ * Compresses the longest run of zero hextets to "::" per RFC 5952. A run of a
16256
+ * single zero hextet is left uncompressed. On ties the leftmost run wins.
16257
+ *
16258
+ * @param {string[]} hextets
16259
+ * @returns {string}
16229
16260
  */
16230
- function consumeHextets(buffer, address, output) {
16231
- if (buffer.length) {
16232
- const hex = stringArrayToHexStripped(buffer);
16233
- if (hex !== "") address.push(hex);
16234
- else {
16235
- output.error = true;
16236
- return false;
16261
+ function compressIPv6ZeroRun(hextets) {
16262
+ let bestStart = -1;
16263
+ let bestLength = 0;
16264
+ let runStart = -1;
16265
+ let runLength = 0;
16266
+ for (let i = 0; i < hextets.length; i++) if (hextets[i] === "0") {
16267
+ if (runStart === -1) runStart = i;
16268
+ runLength++;
16269
+ if (runLength > bestLength) {
16270
+ bestLength = runLength;
16271
+ bestStart = runStart;
16237
16272
  }
16238
- buffer.length = 0;
16273
+ } else {
16274
+ runStart = -1;
16275
+ runLength = 0;
16239
16276
  }
16240
- return true;
16277
+ if (bestLength < 2) return hextets.join(":");
16278
+ const head = hextets.slice(0, bestStart).join(":");
16279
+ const tail = hextets.slice(bestStart + bestLength).join(":");
16280
+ return head + "::" + tail;
16241
16281
  }
16242
16282
  /**
16283
+ * Validates an IPv6 address against the alternatives in RFC 3986 section
16284
+ * 3.2.2 and returns the same address with leading hextet zeroes removed.
16285
+ * An embedded IPv4 address counts as two hextets and is only valid at the end.
16286
+ *
16243
16287
  * @param {string} input
16244
- * @returns {GetIPV6Result}
16288
+ * @returns {string|undefined}
16245
16289
  */
16246
- function getIPV6(input) {
16247
- let tokenCount = 0;
16248
- const output = {
16249
- error: false,
16250
- address: "",
16251
- zone: ""
16252
- };
16253
- /** @type {Array<string>} */
16254
- const address = [];
16255
- /** @type {Array<string>} */
16256
- const buffer = [];
16257
- let endipv6Encountered = false;
16258
- let endIpv6 = false;
16259
- let consume = consumeHextets;
16260
- for (let i = 0; i < input.length; i++) {
16261
- const cursor = input[i];
16262
- if (cursor === "[" || cursor === "]") continue;
16263
- if (cursor === ":") {
16264
- if (endipv6Encountered === true) endIpv6 = true;
16265
- if (!consume(buffer, address, output)) break;
16266
- if (++tokenCount > 7) {
16267
- output.error = true;
16268
- break;
16269
- }
16270
- if (i > 0 && input[i - 1] === ":") endipv6Encountered = true;
16271
- address.push(":");
16272
- continue;
16273
- } else if (cursor === "%") {
16274
- if (!consume(buffer, address, output)) break;
16275
- consume = consumeIsZone;
16276
- } else {
16277
- buffer.push(cursor);
16290
+ function normalizeIPv6Address(input) {
16291
+ const compression = input.indexOf("::");
16292
+ if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
16293
+ const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
16294
+ const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
16295
+ if (compression !== -1) {
16296
+ if (left.length === 1 && left[0] === "") left.length = 0;
16297
+ if (right.length === 1 && right[0] === "") right.length = 0;
16298
+ }
16299
+ const parts = left.concat(right);
16300
+ let hextetCount = 0;
16301
+ for (let i = 0; i < parts.length; i++) {
16302
+ const part = parts[i];
16303
+ if (part === "") return void 0;
16304
+ if (part.indexOf(".") !== -1) {
16305
+ if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
16306
+ hextetCount += 2;
16278
16307
  continue;
16279
16308
  }
16309
+ if (!isHextet(part)) return void 0;
16310
+ parts[i] = parseInt(part, 16).toString(16);
16311
+ hextetCount++;
16280
16312
  }
16281
- if (buffer.length) {
16282
- if (consume === consumeIsZone) output.zone = buffer.join("");
16283
- else if (endIpv6) address.push(buffer.join(""));
16284
- else address.push(stringArrayToHexStripped(buffer));
16313
+ if (compression === -1) {
16314
+ if (hextetCount !== 8) return void 0;
16315
+ return compressIPv6ZeroRun(parts);
16285
16316
  }
16286
- output.address = address.join("");
16287
- return output;
16317
+ if (hextetCount >= 8) return void 0;
16318
+ const expanded = parts.slice(0, left.length);
16319
+ for (let i = hextetCount; i < 8; i++) expanded.push("0");
16320
+ for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]);
16321
+ return compressIPv6ZeroRun(expanded);
16288
16322
  }
16289
16323
  /**
16290
16324
  * @typedef {Object} NormalizeIPv6Result
16291
16325
  * @property {string} host - The normalized host.
16292
16326
  * @property {string} [escapedHost] - The escaped host.
16293
16327
  * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.
16328
+ * @property {boolean} [isIPVFuture] - Indicates if the host is an IPvFuture literal.
16329
+ * @property {boolean} [error] - Indicates if a bracketed IP literal is malformed.
16294
16330
  */
16295
16331
  /**
16332
+ * Validates and normalizes a bracketed IP literal. Raw zone separators remain
16333
+ * accepted for backwards compatibility, while encoded separators and zone
16334
+ * contents follow RFC 6874.
16335
+ *
16296
16336
  * @param {string} host
16297
16337
  * @returns {NormalizeIPv6Result}
16298
16338
  */
16299
16339
  function normalizeIPv6(host) {
16300
- if (findToken(host, ":") < 2) return {
16340
+ const bracketed = host[0] === "[" && host[host.length - 1] === "]";
16341
+ if ((host[0] === "[" || host[host.length - 1] === "]") && !bracketed) return {
16301
16342
  host,
16302
- isIPV6: false
16343
+ isIPV6: false,
16344
+ error: true
16303
16345
  };
16304
- const ipv6 = getIPV6(host);
16305
- if (!ipv6.error) {
16306
- let newHost = ipv6.address;
16307
- let escapedHost = ipv6.address;
16308
- if (ipv6.zone) {
16309
- newHost += "%" + ipv6.zone;
16310
- escapedHost += "%25" + ipv6.zone;
16311
- }
16346
+ let input = bracketed ? host.slice(1, -1) : host;
16347
+ if (bracketed && isIPvFuture(input)) {
16348
+ input = input.toLowerCase();
16312
16349
  return {
16313
- host: newHost,
16314
- isIPV6: true,
16315
- escapedHost
16350
+ host: `[${input}]`,
16351
+ escapedHost: input,
16352
+ isIPV6: false,
16353
+ isIPVFuture: true
16316
16354
  };
16317
- } else return {
16355
+ }
16356
+ if (findToken(input, ":") < 2) return {
16318
16357
  host,
16319
- isIPV6: false
16358
+ isIPV6: false,
16359
+ error: bracketed
16360
+ };
16361
+ let zoneIdentifier = "";
16362
+ const zoneSeparator = input.indexOf("%");
16363
+ if (zoneSeparator !== -1) {
16364
+ const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
16365
+ zoneIdentifier = input.slice(zoneSeparator + separatorLength);
16366
+ if (!isZoneIdentifier(zoneIdentifier)) return {
16367
+ host,
16368
+ isIPV6: false,
16369
+ error: true
16370
+ };
16371
+ input = input.slice(0, zoneSeparator);
16372
+ }
16373
+ const address = normalizeIPv6Address(input);
16374
+ if (address === void 0) return {
16375
+ host,
16376
+ isIPV6: false,
16377
+ error: true
16378
+ };
16379
+ return {
16380
+ host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
16381
+ escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
16382
+ isIPV6: true
16320
16383
  };
16321
16384
  }
16322
16385
  /**
@@ -16405,19 +16468,296 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16405
16468
  return output.join("");
16406
16469
  }
16407
16470
  /**
16408
- * @param {import('../types/index').URIComponent} component
16409
- * @param {boolean} esc
16410
- * @returns {import('../types/index').URIComponent}
16471
+ * Removes dot segments from the path of a relative reference (a path that does
16472
+ * not start with "/") without changing what it resolves to against any base.
16473
+ * Unlike `removeDotSegments`, leading ".." segments that cannot be collapsed
16474
+ * are kept, the result never becomes root-relative, and a result that would be
16475
+ * empty or start with an empty segment is prefixed with "." (an empty path
16476
+ * means "same document" and a leading "//" would introduce an authority).
16477
+ *
16478
+ * @param {string} path
16479
+ * @returns {string}
16411
16480
  */
16412
- function normalizeComponentEncoding(component, esc) {
16413
- const func = esc !== true ? escape : unescape;
16414
- if (component.scheme !== void 0) component.scheme = func(component.scheme);
16415
- if (component.userinfo !== void 0) component.userinfo = func(component.userinfo);
16416
- if (component.host !== void 0) component.host = func(component.host);
16417
- if (component.path !== void 0) component.path = func(component.path);
16418
- if (component.query !== void 0) component.query = func(component.query);
16419
- if (component.fragment !== void 0) component.fragment = func(component.fragment);
16420
- return component;
16481
+ function removeDotSegmentsRelative(path) {
16482
+ if (path === "" || path[0] === "/") return removeDotSegments(path);
16483
+ const segments = path.split("/");
16484
+ const last = segments.length - 1;
16485
+ /** @type {string[]} */
16486
+ const output = [];
16487
+ let trailingDirectory = false;
16488
+ for (let i = 0; i <= last; i++) {
16489
+ const segment = segments[i];
16490
+ if (segment === "." || segment === "..") {
16491
+ if (segment === "..") {
16492
+ if (output.length !== 0 && output[output.length - 1] !== "..") output.pop();
16493
+ else output.push("..");
16494
+ }
16495
+ trailingDirectory = i === last;
16496
+ } else output.push(segment);
16497
+ }
16498
+ if (trailingDirectory && output[output.length - 1] !== "..") output.push("");
16499
+ if (output.length === 0 || output[0] === "" || output[0].includes(":")) output.unshift(".");
16500
+ return output.join("/");
16501
+ }
16502
+ /**
16503
+ * Re-escape RFC 3986 gen-delims that must not appear literally in the host.
16504
+ * After the URI regex parses, these characters cannot be literal in the host
16505
+ * field, so any that appear after decoding came from percent-encoding and
16506
+ * must be restored to prevent authority structure changes.
16507
+ *
16508
+ * @param {string} host
16509
+ * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)
16510
+ * @returns {string}
16511
+ */
16512
+ const HOST_DELIMS = {
16513
+ "@": "%40",
16514
+ "/": "%2F",
16515
+ "?": "%3F",
16516
+ "#": "%23",
16517
+ ":": "%3A"
16518
+ };
16519
+ const HOST_DELIM_RE = /[@/?#:]/g;
16520
+ const HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
16521
+ function reescapeHostDelimiters(host, isIP) {
16522
+ const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
16523
+ re.lastIndex = 0;
16524
+ return host.replace(re, (ch) => HOST_DELIMS[ch]);
16525
+ }
16526
+ /**
16527
+ * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.
16528
+ * Reserved delimiters such as `%2F` stay escaped; `%2E` is unreserved.
16529
+ *
16530
+ * @param {string} input
16531
+ * @param {boolean} [decodeUnreserved=false]
16532
+ * @returns {string}
16533
+ */
16534
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
16535
+ if (input.indexOf("%") === -1) return input;
16536
+ let output = "";
16537
+ for (let i = 0; i < input.length; i++) {
16538
+ if (input[i] === "%" && i + 2 < input.length) {
16539
+ const hex = input.slice(i + 1, i + 3);
16540
+ if (isHexPair(hex)) {
16541
+ const normalizedHex = hex.toUpperCase();
16542
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
16543
+ if (decodeUnreserved && isUnreserved(decoded)) output += decoded;
16544
+ else output += "%" + normalizedHex;
16545
+ i += 2;
16546
+ continue;
16547
+ }
16548
+ }
16549
+ output += input[i];
16550
+ }
16551
+ return output;
16552
+ }
16553
+ /**
16554
+ * Normalizes path data without turning reserved escapes into live path syntax.
16555
+ * Valid escapes are uppercased, raw unsafe characters are escaped, and only
16556
+ * unreserved bytes that are not `.` are decoded.
16557
+ *
16558
+ * @param {string} input
16559
+ * @returns {string}
16560
+ */
16561
+ function normalizePathEncoding(input) {
16562
+ let output = "";
16563
+ for (let i = 0; i < input.length; i++) {
16564
+ const ch = input[i];
16565
+ if (ch === "%" && i + 2 < input.length) {
16566
+ const hex = input.slice(i + 1, i + 3);
16567
+ if (isHexPair(hex)) {
16568
+ const normalizedHex = hex.toUpperCase();
16569
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
16570
+ if (decoded !== "." && isUnreserved(decoded)) output += decoded;
16571
+ else output += "%" + normalizedHex;
16572
+ i += 2;
16573
+ continue;
16574
+ }
16575
+ }
16576
+ if (isPathCharacter(ch)) output += ch;
16577
+ else {
16578
+ const code = input.charCodeAt(i);
16579
+ if (code < 128) output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
16580
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
16581
+ else if (code <= 56319 && i + 1 < input.length) {
16582
+ const low = input.charCodeAt(i + 1);
16583
+ if (low >= 56320 && low <= 57343) {
16584
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
16585
+ i++;
16586
+ } else output += percentEncodeNonAscii(65533);
16587
+ } else output += percentEncodeNonAscii(65533);
16588
+ }
16589
+ }
16590
+ return output;
16591
+ }
16592
+ /**
16593
+ * Serializes a path without rewriting reserved data. Raw RFC 3986 path
16594
+ * characters remain literal, valid escapes are preserved and uppercased, and
16595
+ * everything else is UTF-8 percent-encoded. In a path-noscheme, a colon in the
16596
+ * first segment must be escaped so the result cannot be parsed as a scheme.
16597
+ *
16598
+ * @param {string} input
16599
+ * @param {boolean} [pathNoScheme=false]
16600
+ * @returns {string}
16601
+ */
16602
+ function serializePathEncoding(input, pathNoScheme = false) {
16603
+ let output = "";
16604
+ let firstSegment = pathNoScheme && input[0] !== "/";
16605
+ for (let i = 0; i < input.length; i++) {
16606
+ const ch = input[i];
16607
+ if (ch === "%" && i + 2 < input.length) {
16608
+ const hex = input.slice(i + 1, i + 3);
16609
+ if (isHexPair(hex)) {
16610
+ output += "%" + hex.toUpperCase();
16611
+ i += 2;
16612
+ continue;
16613
+ }
16614
+ }
16615
+ if (ch === "/") firstSegment = false;
16616
+ if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) output += ch;
16617
+ else {
16618
+ const code = input.charCodeAt(i);
16619
+ if (code < 128) output += BYTE_HEX[code];
16620
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
16621
+ else if (code <= 56319 && i + 1 < input.length) {
16622
+ const low = input.charCodeAt(i + 1);
16623
+ if (low >= 56320 && low <= 57343) {
16624
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
16625
+ i++;
16626
+ } else output += percentEncodeNonAscii(65533);
16627
+ } else output += percentEncodeNonAscii(65533);
16628
+ }
16629
+ }
16630
+ return output;
16631
+ }
16632
+ /**
16633
+ * Percent-encodes a URI component using its RFC 3986 literal character set.
16634
+ * Existing valid escapes are preserved and normalized to uppercase hex.
16635
+ *
16636
+ * @param {string} input
16637
+ * @param {(value: string) => boolean} isAllowed
16638
+ * @returns {string}
16639
+ */
16640
+ function encodeComponent(input, isAllowed) {
16641
+ let output = "";
16642
+ for (let i = 0; i < input.length; i++) {
16643
+ const ch = input[i];
16644
+ if (ch === "%" && i + 2 < input.length) {
16645
+ const hex = input.slice(i + 1, i + 3);
16646
+ if (isHexPair(hex)) {
16647
+ output += "%" + hex.toUpperCase();
16648
+ i += 2;
16649
+ continue;
16650
+ }
16651
+ }
16652
+ if (isAllowed(ch)) output += ch;
16653
+ else {
16654
+ const code = input.charCodeAt(i);
16655
+ if (code < 128) output += BYTE_HEX[code];
16656
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
16657
+ else if (code <= 56319 && i + 1 < input.length) {
16658
+ const low = input.charCodeAt(i + 1);
16659
+ if (low >= 56320 && low <= 57343) {
16660
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
16661
+ i++;
16662
+ } else output += percentEncodeNonAscii(65533);
16663
+ } else output += percentEncodeNonAscii(65533);
16664
+ }
16665
+ }
16666
+ return output;
16667
+ }
16668
+ /**
16669
+ * Encodes userinfo while preserving its RFC 3986 §3.2.1 literal characters.
16670
+ * In particular, authority delimiters such as `@`, `/`, `?`, and `#` are data.
16671
+ *
16672
+ * @param {string} input
16673
+ * @returns {string}
16674
+ */
16675
+ function encodeUserinfo(input) {
16676
+ return encodeComponent(input, isUserinfoCharacter);
16677
+ }
16678
+ /**
16679
+ * Encodes query data using the RFC 3986 §3.4 grammar. A literal `#` must be
16680
+ * escaped because it would otherwise begin the fragment component.
16681
+ *
16682
+ * @param {string} input
16683
+ * @returns {string}
16684
+ */
16685
+ function encodeQuery(input) {
16686
+ return encodeComponent(input, isQueryFragmentCharacter);
16687
+ }
16688
+ /**
16689
+ * Encodes fragment data using the RFC 3986 §3.5 grammar.
16690
+ *
16691
+ * @param {string} input
16692
+ * @returns {string}
16693
+ */
16694
+ function encodeFragment(input) {
16695
+ return encodeComponent(input, isQueryFragmentCharacter);
16696
+ }
16697
+ function isEscapeSafe(cp) {
16698
+ 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;
16699
+ }
16700
+ /**
16701
+ * Normalizes the percent-encoding of a query or fragment component.
16702
+ *
16703
+ * Like `normalizePathEncoding`, but uses the query/fragment character set
16704
+ * (which additionally allows `?`) and decodes `.` since it has no dot-segment
16705
+ * meaning outside of a path.
16706
+ *
16707
+ * @param {string} input
16708
+ * @returns {string}
16709
+ */
16710
+ function normalizeQueryFragmentEncoding(input) {
16711
+ let output = "";
16712
+ for (let i = 0; i < input.length; i++) {
16713
+ const ch = input[i];
16714
+ if (ch === "%" && i + 2 < input.length) {
16715
+ const hex = input.slice(i + 1, i + 3);
16716
+ if (isHexPair(hex)) {
16717
+ const normalizedHex = hex.toUpperCase();
16718
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
16719
+ if (isUnreserved(decoded)) output += decoded;
16720
+ else output += "%" + normalizedHex;
16721
+ i += 2;
16722
+ continue;
16723
+ }
16724
+ }
16725
+ if (isQueryFragmentCharacter(ch)) output += ch;
16726
+ else {
16727
+ const code = input.charCodeAt(i);
16728
+ if (code < 128) output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
16729
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
16730
+ else if (code <= 56319 && i + 1 < input.length) {
16731
+ const low = input.charCodeAt(i + 1);
16732
+ if (low >= 56320 && low <= 57343) {
16733
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
16734
+ i++;
16735
+ } else output += percentEncodeNonAscii(65533);
16736
+ } else output += percentEncodeNonAscii(65533);
16737
+ }
16738
+ }
16739
+ return output;
16740
+ }
16741
+ /**
16742
+ * Escapes a component while preserving existing valid percent escapes.
16743
+ *
16744
+ * @param {string} input
16745
+ * @returns {string}
16746
+ */
16747
+ function escapePreservingEscapes(input) {
16748
+ let output = "";
16749
+ for (let i = 0; i < input.length; i++) {
16750
+ if (input[i] === "%" && i + 2 < input.length) {
16751
+ const hex = input.slice(i + 1, i + 3);
16752
+ if (isHexPair(hex)) {
16753
+ output += "%" + hex.toUpperCase();
16754
+ i += 2;
16755
+ continue;
16756
+ }
16757
+ }
16758
+ output += escape(input[i]);
16759
+ }
16760
+ return output;
16421
16761
  }
16422
16762
  /**
16423
16763
  * @param {import('../types/index').URIComponent} component
@@ -16426,39 +16766,54 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16426
16766
  function recomposeAuthority(component) {
16427
16767
  const uriTokens = [];
16428
16768
  if (component.userinfo !== void 0) {
16429
- uriTokens.push(component.userinfo);
16769
+ uriTokens.push(encodeUserinfo(component.userinfo));
16430
16770
  uriTokens.push("@");
16431
16771
  }
16432
16772
  if (component.host !== void 0) {
16433
- let host = unescape(component.host);
16773
+ let host = component.host;
16434
16774
  if (!isIPv4(host)) {
16435
- const ipV6res = normalizeIPv6(host);
16436
- if (ipV6res.isIPV6 === true) host = `[${ipV6res.escapedHost}]`;
16437
- else host = component.host;
16775
+ let ipV6res = normalizeIPv6(host);
16776
+ if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
16777
+ host = normalizePercentEncoding(host, true);
16778
+ ipV6res = normalizeIPv6(host);
16779
+ }
16780
+ if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) host = `[${ipV6res.escapedHost}]`;
16781
+ else host = reescapeHostDelimiters(host, false);
16438
16782
  }
16439
16783
  uriTokens.push(host);
16440
16784
  }
16441
16785
  if (typeof component.port === "number" || typeof component.port === "string") {
16786
+ const port = String(component.port);
16787
+ if (!isPort(port)) throw new TypeError("URI port is malformed.");
16442
16788
  uriTokens.push(":");
16443
- uriTokens.push(String(component.port));
16789
+ uriTokens.push(port);
16444
16790
  }
16445
16791
  return uriTokens.length ? uriTokens.join("") : void 0;
16446
16792
  }
16447
16793
  module.exports = {
16448
16794
  nonSimpleDomain,
16449
16795
  recomposeAuthority,
16450
- normalizeComponentEncoding,
16796
+ reescapeHostDelimiters,
16797
+ normalizePercentEncoding,
16798
+ normalizePathEncoding,
16799
+ serializePathEncoding,
16800
+ normalizeQueryFragmentEncoding,
16801
+ encodeUserinfo,
16802
+ encodeQuery,
16803
+ encodeFragment,
16804
+ escapePreservingEscapes,
16451
16805
  removeDotSegments,
16806
+ removeDotSegmentsRelative,
16452
16807
  isIPv4,
16453
16808
  isUUID,
16454
16809
  normalizeIPv6,
16455
16810
  stringArrayToHexStripped
16456
16811
  };
16457
16812
  }));
16458
- // ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js
16813
+ // ../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/schemes.js
16459
16814
  var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16460
16815
  const { isUUID } = require_utils();
16461
- const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
16816
+ const URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
16462
16817
  const supportedSchemeNames = [
16463
16818
  "http",
16464
16819
  "https",
@@ -16529,9 +16884,10 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16529
16884
  wsComponent.secure = void 0;
16530
16885
  }
16531
16886
  if (wsComponent.resourceName) {
16532
- const [path, query] = wsComponent.resourceName.split("?");
16887
+ const queryIndex = wsComponent.resourceName.indexOf("?");
16888
+ const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
16533
16889
  wsComponent.path = path && path !== "/" ? path : void 0;
16534
- wsComponent.query = query;
16890
+ wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
16535
16891
  wsComponent.resourceName = void 0;
16536
16892
  }
16537
16893
  wsComponent.fragment = void 0;
@@ -16544,7 +16900,7 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16544
16900
  return urnComponent;
16545
16901
  }
16546
16902
  const matches = urnComponent.path.match(URN_REG);
16547
- if (matches) {
16903
+ if (matches && matches[0] === urnComponent.path) {
16548
16904
  const scheme = options.scheme || urnComponent.scheme || "urn";
16549
16905
  urnComponent.nid = matches[1].toLowerCase();
16550
16906
  urnComponent.nss = matches[2];
@@ -16637,10 +16993,27 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16637
16993
  getSchemeHandler
16638
16994
  };
16639
16995
  }));
16640
- // ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js
16996
+ // ../../node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/index.js
16641
16997
  var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16642
- const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
16998
+ const { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
16643
16999
  const { SCHEMES, getSchemeHandler } = require_schemes();
17000
+ const VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
17001
+ const MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
17002
+ const MALFORMED_HOST_ERROR = "URI host is malformed.";
17003
+ const FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
17004
+ /**
17005
+ * RFC 3986 section 3.1 does not allow percent-encoding in a scheme, so the
17006
+ * scheme is validated as-is and never decoded. Decoding would let inert input
17007
+ * such as `%6Aavascript:` become a live `javascript:` scheme.
17008
+ *
17009
+ * @param {string} scheme
17010
+ * @returns {string}
17011
+ */
17012
+ function validateScheme(scheme) {
17013
+ const stringScheme = String(scheme);
17014
+ if (!VALID_SCHEME.test(stringScheme)) throw new TypeError(MALFORMED_SCHEME_ERROR);
17015
+ return stringScheme;
17016
+ }
16644
17017
  /**
16645
17018
  * @template {import('./types/index').URIComponent|string} T
16646
17019
  * @param {T} uri
@@ -16648,7 +17021,7 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16648
17021
  * @returns {T}
16649
17022
  */
16650
17023
  function normalize(uri, options) {
16651
- if (typeof uri === "string") uri = serialize(parse(uri, options), options);
17024
+ if (typeof uri === "string") uri = normalizeString(uri, options);
16652
17025
  else if (typeof uri === "object") uri = parse(serialize(uri, options), options);
16653
17026
  return uri;
16654
17027
  }
@@ -16660,7 +17033,17 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16660
17033
  */
16661
17034
  function resolve(baseURI, relativeURI, options) {
16662
17035
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
16663
- const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
17036
+ const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed, malformedPercentEncoding: baseMalformedPercentEncoding, malformedSchemeSpecific: baseMalformedSchemeSpecific, malformedHost: baseMalformedHost, malformedScheme: baseMalformedScheme } = parseWithStatus(baseURI, schemelessOptions);
17037
+ const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed, malformedPercentEncoding: relativeMalformedPercentEncoding, malformedSchemeSpecific: relativeMalformedSchemeSpecific, malformedHost: relativeMalformedHost, malformedScheme: relativeMalformedScheme } = parseWithStatus(relativeURI, schemelessOptions);
17038
+ if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
17039
+ const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
17040
+ const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
17041
+ const resolvedHost = resolved.host;
17042
+ const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
17043
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) throw new Error(MALFORMED_HOST_ERROR);
17044
+ canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
17045
+ const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
17046
+ if (resolved.error && !encodedASCIIHost) throw new Error(resolved.error);
16664
17047
  schemelessOptions.skipEscape = true;
16665
17048
  return serialize(resolved, schemelessOptions);
16666
17049
  }
@@ -16701,10 +17084,11 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16701
17084
  } else {
16702
17085
  if (relative.path[0] === "/") target.path = removeDotSegments(relative.path);
16703
17086
  else {
16704
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) target.path = "/" + relative.path;
17087
+ const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
17088
+ if (baseHasAuthority && !base.path) target.path = "/" + relative.path;
16705
17089
  else if (!base.path) target.path = relative.path;
16706
17090
  else target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
16707
- target.path = removeDotSegments(target.path);
17091
+ target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
16708
17092
  }
16709
17093
  target.query = relative.query;
16710
17094
  }
@@ -16724,27 +17108,9 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16724
17108
  * @returns {boolean}
16725
17109
  */
16726
17110
  function equal(uriA, uriB, options) {
16727
- if (typeof uriA === "string") {
16728
- uriA = unescape(uriA);
16729
- uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), {
16730
- ...options,
16731
- skipEscape: true
16732
- });
16733
- } else if (typeof uriA === "object") uriA = serialize(normalizeComponentEncoding(uriA, true), {
16734
- ...options,
16735
- skipEscape: true
16736
- });
16737
- if (typeof uriB === "string") {
16738
- uriB = unescape(uriB);
16739
- uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), {
16740
- ...options,
16741
- skipEscape: true
16742
- });
16743
- } else if (typeof uriB === "object") uriB = serialize(normalizeComponentEncoding(uriB, true), {
16744
- ...options,
16745
- skipEscape: true
16746
- });
16747
- return uriA.toLowerCase() === uriB.toLowerCase();
17111
+ const normalizedA = normalizeComparableURI(uriA, options);
17112
+ const normalizedB = normalizeComparableURI(uriB, options);
17113
+ return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
16748
17114
  }
16749
17115
  /**
16750
17116
  * @param {Readonly<import('./types/index').URIComponent>} cmpts
@@ -16770,15 +17136,20 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16770
17136
  };
16771
17137
  const options = Object.assign({}, opts);
16772
17138
  const uriTokens = [];
17139
+ if (component.scheme) component.scheme = validateScheme(component.scheme);
16773
17140
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
16774
17141
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
17142
+ const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
17143
+ const schemelessReference = (component.scheme === void 0 || options.reference === "suffix") && !hasAuthority;
17144
+ const pathNoScheme = !options.skipEscape && schemelessReference;
16775
17145
  if (component.path !== void 0) {
16776
- if (!options.skipEscape) {
16777
- component.path = escape(component.path);
16778
- if (component.scheme !== void 0) component.path = component.path.split("%3A").join(":");
16779
- } else component.path = unescape(component.path);
17146
+ if (!options.skipEscape) component.path = serializePathEncoding(component.path, pathNoScheme);
17147
+ else component.path = normalizePercentEncoding(component.path);
17148
+ }
17149
+ if (options.reference !== "suffix" && component.scheme) {
17150
+ component.scheme = validateScheme(component.scheme);
17151
+ uriTokens.push(component.scheme, ":");
16780
17152
  }
16781
- if (options.reference !== "suffix" && component.scheme) uriTokens.push(component.scheme, ":");
16782
17153
  const authority = recomposeAuthority(component);
16783
17154
  if (authority !== void 0) {
16784
17155
  if (options.reference !== "suffix") uriTokens.push("//");
@@ -16787,21 +17158,120 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16787
17158
  }
16788
17159
  if (component.path !== void 0) {
16789
17160
  let s = component.path;
16790
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) s = removeDotSegments(s);
17161
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
17162
+ if (schemelessReference) s = serializePathEncoding(s, true);
16791
17163
  if (authority === void 0 && s[0] === "/" && s[1] === "/") s = "/%2F" + s.slice(2);
16792
17164
  uriTokens.push(s);
16793
17165
  }
16794
- if (component.query !== void 0) uriTokens.push("?", component.query);
16795
- if (component.fragment !== void 0) uriTokens.push("#", component.fragment);
17166
+ if (component.query !== void 0) uriTokens.push("?", encodeQuery(component.query));
17167
+ if (component.fragment !== void 0) uriTokens.push("#", encodeFragment(component.fragment));
16796
17168
  return uriTokens.join("");
16797
17169
  }
16798
17170
  const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
17171
+ const AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
17172
+ const AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
17173
+ /**
17174
+ * @param {import('./types/index').URIComponent} parsed
17175
+ * @param {RegExpMatchArray} matches
17176
+ * @returns {string|undefined}
17177
+ */
17178
+ function getParseError(parsed, matches) {
17179
+ if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") return "URI path must start with \"/\" when authority is present.";
17180
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) return "URI port is malformed.";
17181
+ }
17182
+ /**
17183
+ * Checks percent syntax without decoding the represented octets. RFC 3986
17184
+ * percent-encoding is byte-oriented, so sequences such as `%FF` are valid even
17185
+ * though they are not independently valid UTF-8.
17186
+ *
17187
+ * @param {string|undefined} component
17188
+ * @returns {boolean}
17189
+ */
17190
+ function hasMalformedPercentEncoding(component) {
17191
+ if (component === void 0) return false;
17192
+ let percent = component.indexOf("%");
17193
+ while (percent !== -1) {
17194
+ if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) return true;
17195
+ percent = component.indexOf("%", percent + 3);
17196
+ }
17197
+ return false;
17198
+ }
17199
+ /**
17200
+ * Whether the host is a bracketed IP literal (RFC 3986 `IP-literal`).
17201
+ * An unterminated `[` is not a literal, so it must still be validated as a
17202
+ * reg-name instead of being waved through as an IP.
17203
+ *
17204
+ * @param {string} host
17205
+ * @returns {boolean}
17206
+ */
17207
+ function isIPLiteral(host) {
17208
+ return host[0] === "[" && host[host.length - 1] === "]";
17209
+ }
17210
+ /**
17211
+ * @param {RegExpMatchArray} matches
17212
+ * @returns {boolean}
17213
+ */
17214
+ function hasMalformedComponentPercentEncoding(matches) {
17215
+ const host = matches[4];
17216
+ return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
17217
+ }
17218
+ /**
17219
+ * @param {import('./types/index').URIComponent} parsed
17220
+ * @param {import('./types/index').Options} options
17221
+ * @param {{ domainHost?: boolean, unicodeSupport?: boolean }|undefined} schemeHandler
17222
+ * @param {boolean} isIP
17223
+ * @returns {boolean} whether host conversion failed
17224
+ */
17225
+ function canonicalizeHost(parsed, options, schemeHandler, isIP) {
17226
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
17227
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
17228
+ return true;
17229
+ }
17230
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
17231
+ let url;
17232
+ try {
17233
+ url = new URL("http://" + parsed.host);
17234
+ } catch (e) {
17235
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
17236
+ return true;
17237
+ }
17238
+ if (!isHostOnlyURL(url)) {
17239
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
17240
+ return true;
17241
+ }
17242
+ parsed.host = url.hostname;
17243
+ }
17244
+ return false;
17245
+ }
17246
+ /**
17247
+ * Whether a domain host contains an ASCII character that RFC 3986 does not
17248
+ * allow in a reg-name (unreserved, sub-delims, or pct-encoded). Such a host is
17249
+ * rejected instead of being handed to the WHATWG URL parser, which would treat
17250
+ * "@" as a userinfo delimiter (silently dropping the data before it) and strip
17251
+ * TAB, LF, and CR. Non-ASCII characters remain allowed for IDNs.
17252
+ *
17253
+ * @param {import('./types/index').URIComponent} parsed
17254
+ * @param {import('./types/index').Options} options
17255
+ * @param {{ domainHost?: boolean }|undefined} schemeHandler
17256
+ * @param {boolean} isIP
17257
+ * @returns {boolean}
17258
+ */
17259
+ function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
17260
+ return Boolean(parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host));
17261
+ }
17262
+ /**
17263
+ * @param {URL} url
17264
+ * @returns {boolean}
17265
+ */
17266
+ function isHostOnlyURL(url) {
17267
+ return url.username === "" && url.password === "" && url.port === "" && url.pathname === "/" && url.search === "" && url.hash === "" && url.hostname !== "";
17268
+ }
16799
17269
  /**
16800
17270
  * @param {string} uri
16801
17271
  * @param {import('./types/index').Options} [opts]
16802
- * @returns
17272
+ * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}
16803
17273
  */
16804
- function parse(uri, opts) {
17274
+ function parseWithStatus(uri, opts) {
16805
17275
  const options = Object.assign({}, opts);
16806
17276
  /** @type {import('./types/index').URIComponent} */
16807
17277
  const parsed = {
@@ -16813,11 +17283,36 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16813
17283
  query: void 0,
16814
17284
  fragment: void 0
16815
17285
  };
17286
+ let malformedAuthorityOrPort = false;
17287
+ let malformedPercentEncoding = false;
17288
+ let malformedSchemeSpecific = false;
17289
+ let malformedHost = false;
17290
+ let malformedIPLiteral = false;
17291
+ let malformedScheme = false;
16816
17292
  let isIP = false;
16817
17293
  if (options.reference === "suffix") {
16818
17294
  if (options.scheme) uri = options.scheme + ":" + uri;
16819
17295
  else uri = "//" + uri;
16820
17296
  }
17297
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
17298
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
17299
+ parsed.error = "URI authority must not contain a literal backslash.";
17300
+ malformedAuthorityOrPort = true;
17301
+ }
17302
+ const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
17303
+ if (introducerMatch !== null) {
17304
+ const region = introducerMatch[1];
17305
+ const normalizedRegion = region.replace(/[\t\n\r]/g, "");
17306
+ if (normalizedRegion.length >= 2) {
17307
+ if (normalizedRegion.slice(0, 2) !== "//") {
17308
+ parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
17309
+ malformedAuthorityOrPort = true;
17310
+ } else if (region.length !== normalizedRegion.length) {
17311
+ parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
17312
+ malformedAuthorityOrPort = true;
17313
+ }
17314
+ }
17315
+ }
16821
17316
  const matches = uri.match(URI_PARSE);
16822
17317
  if (matches) {
16823
17318
  parsed.scheme = matches[1];
@@ -16827,12 +17322,33 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16827
17322
  parsed.path = matches[6] || "";
16828
17323
  parsed.query = matches[7];
16829
17324
  parsed.fragment = matches[8];
17325
+ if (parsed.scheme !== void 0) {
17326
+ if (VALID_SCHEME.test(parsed.scheme)) parsed.scheme = parsed.scheme.toLowerCase();
17327
+ else {
17328
+ parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
17329
+ malformedScheme = true;
17330
+ }
17331
+ }
17332
+ malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
17333
+ if (malformedPercentEncoding) parsed.error = parsed.error || "URI contains malformed percent-encoding.";
16830
17334
  if (isNaN(parsed.port)) parsed.port = matches[5];
17335
+ const parseError = getParseError(parsed, matches);
17336
+ if (parseError !== void 0) {
17337
+ parsed.error = parsed.error || parseError;
17338
+ malformedAuthorityOrPort = true;
17339
+ }
16831
17340
  if (parsed.host) {
16832
17341
  if (isIPv4(parsed.host) === false) {
17342
+ const bracketedIPLiteral = isIPLiteral(parsed.host);
17343
+ const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
16833
17344
  const ipv6result = normalizeIPv6(parsed.host);
16834
- parsed.host = ipv6result.host.toLowerCase();
16835
- isIP = ipv6result.isIPV6;
17345
+ isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
17346
+ malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
17347
+ parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
17348
+ if (malformedIPLiteral) {
17349
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
17350
+ malformedAuthorityOrPort = true;
17351
+ }
16836
17352
  } else isIP = true;
16837
17353
  }
16838
17354
  if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) parsed.reference = "same-document";
@@ -16841,24 +17357,78 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16841
17357
  else parsed.reference = "uri";
16842
17358
  if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
16843
17359
  const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
16844
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
16845
- if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) try {
16846
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
16847
- } catch (e) {
16848
- parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
16849
- }
17360
+ if (!malformedIPLiteral) malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
17361
+ if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
17362
+ let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
17363
+ if (!isIP) host = normalizePercentEncoding(host.toLowerCase());
17364
+ parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
16850
17365
  }
16851
17366
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
16852
- if (uri.indexOf("%") !== -1) {
16853
- if (parsed.scheme !== void 0) parsed.scheme = unescape(parsed.scheme);
16854
- if (parsed.host !== void 0) parsed.host = unescape(parsed.host);
16855
- }
16856
- if (parsed.path) parsed.path = escape(unescape(parsed.path));
16857
- if (parsed.fragment) parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
17367
+ if (parsed.path) parsed.path = normalizePathEncoding(parsed.path);
17368
+ if (parsed.query) parsed.query = normalizeQueryFragmentEncoding(parsed.query);
17369
+ if (parsed.fragment) parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
17370
+ }
17371
+ if (schemeHandler && schemeHandler.parse) {
17372
+ schemeHandler.parse(parsed, options);
17373
+ if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) malformedSchemeSpecific = true;
16858
17374
  }
16859
- if (schemeHandler && schemeHandler.parse) schemeHandler.parse(parsed, options);
16860
17375
  } else parsed.error = parsed.error || "URI can not be parsed.";
16861
- return parsed;
17376
+ return {
17377
+ parsed,
17378
+ malformedAuthorityOrPort,
17379
+ malformedPercentEncoding,
17380
+ malformedSchemeSpecific,
17381
+ malformedHost,
17382
+ malformedScheme
17383
+ };
17384
+ }
17385
+ /**
17386
+ * @param {string} uri
17387
+ * @param {import('./types/index').Options} [opts]
17388
+ * @returns
17389
+ */
17390
+ function parse(uri, opts) {
17391
+ return parseWithStatus(uri, opts).parsed;
17392
+ }
17393
+ /**
17394
+ * @param {string} uri
17395
+ * @param {import('./types/index').Options} [opts]
17396
+ * @returns {string}
17397
+ */
17398
+ function normalizeString(uri, opts) {
17399
+ return normalizeStringWithStatus(uri, opts).normalized;
17400
+ }
17401
+ /**
17402
+ * @param {string} uri
17403
+ * @param {import('./types/index').Options} [opts]
17404
+ * @returns {{ normalized: string, malformedAuthorityOrPort: boolean, malformedPercentEncoding: boolean, malformedSchemeSpecific: boolean, malformedHost: boolean, malformedScheme: boolean }}
17405
+ */
17406
+ function normalizeStringWithStatus(uri, opts) {
17407
+ const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
17408
+ return {
17409
+ normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
17410
+ malformedAuthorityOrPort,
17411
+ malformedPercentEncoding,
17412
+ malformedSchemeSpecific,
17413
+ malformedHost,
17414
+ malformedScheme
17415
+ };
17416
+ }
17417
+ /**
17418
+ * @param {import ('./types/index').URIComponent|string} uri
17419
+ * @param {import('./types/index').Options} [opts]
17420
+ * @returns {string|undefined}
17421
+ */
17422
+ function normalizeComparableURI(uri, opts) {
17423
+ if (typeof uri !== "string" && typeof uri !== "object") return;
17424
+ let value;
17425
+ try {
17426
+ value = typeof uri === "string" ? uri : serialize(uri, opts);
17427
+ } catch {
17428
+ return;
17429
+ }
17430
+ const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
17431
+ return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
16862
17432
  }
16863
17433
  const fastUri = {
16864
17434
  SCHEMES,
@@ -22045,22 +22615,22 @@ const NX_VERSION = {
22045
22615
  "@a2a-js/sdk": "0.3.14",
22046
22616
  "@aws/aws-distro-opentelemetry-node-autoinstrumentation": "0.13.0",
22047
22617
  "@opentelemetry/propagator-jaeger": "2.12.0",
22048
- minimatch: "11.0.1",
22618
+ minimatch: "11.0.5",
22049
22619
  "deepmerge-ts": "8.0.2",
22050
22620
  mysql2: "3.24.6",
22051
- "@aws-sdk/client-dynamodb": "3.1161.0",
22052
- "@aws-sdk/client-api-gateway": "3.1161.0",
22053
- "@aws-sdk/client-iam": "3.1161.0",
22054
- "@aws-sdk/client-bedrock-agentcore": "3.1161.0",
22055
- "@aws-sdk/client-bedrock-runtime": "3.1161.0",
22056
- "@aws-sdk/client-greengrassv2": "3.1161.0",
22057
- "@aws-sdk/client-s3": "3.1161.0",
22058
- "@aws-sdk/client-sts": "3.1161.0",
22059
- "@aws-sdk/client-cognito-identity-provider": "3.1161.0",
22060
- "@aws-sdk/credential-providers": "3.1161.0",
22061
- "@aws-sdk/credential-provider-cognito-identity": "3.972.79",
22062
- "@aws-sdk/client-secrets-manager": "3.1161.0",
22063
- "@aws-sdk/rds-signer": "3.1161.0",
22621
+ "@aws-sdk/client-dynamodb": "3.1164.0",
22622
+ "@aws-sdk/client-api-gateway": "3.1164.0",
22623
+ "@aws-sdk/client-iam": "3.1164.0",
22624
+ "@aws-sdk/client-bedrock-agentcore": "3.1164.0",
22625
+ "@aws-sdk/client-bedrock-runtime": "3.1164.0",
22626
+ "@aws-sdk/client-greengrassv2": "3.1164.0",
22627
+ "@aws-sdk/client-s3": "3.1164.0",
22628
+ "@aws-sdk/client-sts": "3.1164.0",
22629
+ "@aws-sdk/client-cognito-identity-provider": "3.1164.0",
22630
+ "@aws-sdk/credential-providers": "3.1164.0",
22631
+ "@aws-sdk/credential-provider-cognito-identity": "3.972.81",
22632
+ "@aws-sdk/client-secrets-manager": "3.1164.0",
22633
+ "@aws-sdk/rds-signer": "3.1164.0",
22064
22634
  "@smithy/server-apigateway": "0.3.5",
22065
22635
  "@smithy/server-node": "0.3.5",
22066
22636
  "@aws-lambda-powertools/logger": "2.36.0",
@@ -22068,7 +22638,7 @@ const NX_VERSION = {
22068
22638
  "@aws-lambda-powertools/parameters": "2.36.0",
22069
22639
  "@aws-lambda-powertools/tracer": "2.36.0",
22070
22640
  "@aws-lambda-powertools/parser": "2.36.0",
22071
- "@aws-sdk/client-appconfigdata": "3.1161.0",
22641
+ "@aws-sdk/client-appconfigdata": "3.1164.0",
22072
22642
  "@middy/core": "7.9.2",
22073
22643
  "@nxlv/python": "23.3.1",
22074
22644
  "@nx-extend/terraform": "10.4.1",
@@ -22081,33 +22651,33 @@ const NX_VERSION = {
22081
22651
  "@nx/workspace": "23.3.1",
22082
22652
  "create-nx-workspace": "23.3.1",
22083
22653
  "@swc-node/register": "1.12.1",
22084
- "@swc/core": "1.16.21",
22654
+ "@swc/core": "1.16.22",
22085
22655
  "@modelcontextprotocol/sdk": "1.32.2",
22086
22656
  "@modelcontextprotocol/client": "2.4.0",
22087
- "@modelcontextprotocol/inspector": "2.13.0",
22657
+ "@modelcontextprotocol/inspector": "2.14.0",
22088
22658
  "@ag-ui/a2ui-toolkit": "0.0.5",
22089
22659
  "@ag-ui/aws-strands": "1.0.1",
22090
22660
  "@ag-ui/client": "1.0.2",
22091
22661
  "@ag-ui/core": "1.0.2",
22092
22662
  "@ag-ui/encoder": "1.0.2",
22093
22663
  "agent-chat-cli": "0.3.0",
22094
- "@copilotkit/react-core": "1.83.0",
22664
+ "@copilotkit/react-core": "1.85.0",
22095
22665
  rxjs: "7.8.2",
22096
- "@strands-agents/sdk": "1.23.0",
22666
+ "@strands-agents/sdk": "1.24.0",
22097
22667
  "@tanstack/react-router": "1.170.46",
22098
- "@tanstack/router-plugin": "1.168.48",
22099
- "@tanstack/router-generator": "1.167.46",
22668
+ "@tanstack/router-plugin": "1.169.0",
22669
+ "@tanstack/router-generator": "1.168.0",
22100
22670
  "@tanstack/virtual-file-routes": "1.162.0",
22101
- "@tanstack/router-utils": "1.162.4",
22102
- "@cloudscape-design/board-components": "3.0.243",
22103
- "@cloudscape-design/chat-components": "1.0.185",
22104
- "@cloudscape-design/components": "3.0.1407",
22105
- "@cloudscape-design/global-styles": "1.0.71",
22106
- "@tanstack/react-query": "5.105.0",
22107
- "@tanstack/react-query-devtools": "5.105.0",
22108
- "@trpc/tanstack-react-query": "11.22.1",
22109
- "@trpc/client": "11.22.1",
22110
- "@trpc/server": "11.22.1",
22671
+ "@tanstack/router-utils": "1.163.0",
22672
+ "@cloudscape-design/board-components": "3.0.245",
22673
+ "@cloudscape-design/chat-components": "1.0.188",
22674
+ "@cloudscape-design/components": "3.0.1410",
22675
+ "@cloudscape-design/global-styles": "1.0.72",
22676
+ "@tanstack/react-query": "5.107.1",
22677
+ "@tanstack/react-query-devtools": "5.107.1",
22678
+ "@trpc/tanstack-react-query": "11.25.0",
22679
+ "@trpc/client": "11.25.0",
22680
+ "@trpc/server": "11.25.0",
22111
22681
  "@types/node": "26.6.6",
22112
22682
  "@types/aws-lambda": "8.10.164",
22113
22683
  "@types/cors": "2.8.19",
@@ -22117,16 +22687,16 @@ const NX_VERSION = {
22117
22687
  "@types/express": "5.0.6",
22118
22688
  "@smithy/config-resolver": "4.7.2",
22119
22689
  "@smithy/node-config-provider": "4.6.2",
22120
- "@smithy/node-http-handler": "4.14.1",
22121
- "@smithy/types": "4.19.0",
22122
- "@vitest/coverage-v8": "5.0.5",
22123
- "@vitest/ui": "5.0.5",
22690
+ "@smithy/node-http-handler": "4.14.2",
22691
+ "@smithy/types": "4.20.0",
22692
+ "@vitest/coverage-v8": "5.1.0",
22693
+ "@vitest/ui": "5.1.0",
22124
22694
  "@astrojs/react": "6.0.6",
22125
- "@astrojs/starlight": "0.42.8",
22126
- astro: "7.4.4",
22127
- cookie: "2.0.1",
22695
+ "@astrojs/starlight": "0.42.10",
22696
+ astro: "7.4.7",
22697
+ cookie: "2.0.2",
22128
22698
  aws4fetch: "1.0.20",
22129
- "aws-cdk": "2.1147.0",
22699
+ "aws-cdk": "2.1148.0",
22130
22700
  "aws-cdk-lib": "2.275.0",
22131
22701
  "aws-iot-device-sdk-v2": "1.28.2",
22132
22702
  "aws-xray-sdk-core": "3.12.0",
@@ -22134,13 +22704,13 @@ const NX_VERSION = {
22134
22704
  cors: "2.8.6",
22135
22705
  chalk: "6.0.1",
22136
22706
  "class-variance-authority": "0.7.1",
22137
- cn: "0.5.1",
22138
- commander: "15.0.0",
22707
+ cn: "0.5.2",
22708
+ commander: "15.1.0",
22139
22709
  electrodb: "3.9.3",
22140
22710
  esbuild: "0.28.2",
22141
22711
  "event-source-polyfill": "1.0.31",
22142
22712
  "@types/event-source-polyfill": "1.0.5",
22143
- "@biomejs/biome": "2.6.4",
22713
+ "@biomejs/biome": "2.6.6",
22144
22714
  "@prisma/adapter-mariadb": "7.10.1",
22145
22715
  "@prisma/adapter-pg": "7.10.1",
22146
22716
  "@prisma/client": "7.10.1",
@@ -22153,8 +22723,8 @@ const NX_VERSION = {
22153
22723
  "@types/fs-extra": "11.0.4",
22154
22724
  "js-yaml": "4.3.2",
22155
22725
  mariadb: "3.5.4",
22156
- mise: "2026.10.25",
22157
- npm: "12.2.1",
22726
+ mise: "2026.11.4",
22727
+ npm: "12.2.2",
22158
22728
  "npm-check-updates": "23.1.1",
22159
22729
  "oidc-client-ts": "3.5.0",
22160
22730
  pg: "8.23.1",
@@ -22162,22 +22732,22 @@ const NX_VERSION = {
22162
22732
  "react-oidc-context": "3.3.1",
22163
22733
  react: "19.3.1",
22164
22734
  "react-dom": "19.3.1",
22165
- rolldown: "1.2.16",
22166
- "rolldown-plugin-dts": "0.29.0",
22735
+ rolldown: "1.3.0",
22736
+ "rolldown-plugin-dts": "0.30.0",
22167
22737
  shx: "0.4.0",
22168
22738
  "simple-git": "4.0.2",
22169
22739
  "source-map-support": "0.5.21",
22170
22740
  "starlight-blog": "0.30.2",
22171
- tailwindcss: "4.3.3",
22172
- "@tailwindcss/vite": "4.3.3",
22741
+ tailwindcss: "4.3.5",
22742
+ "@tailwindcss/vite": "4.3.5",
22173
22743
  tsx: "4.23.15",
22174
- "lucide-react": "1.66.0",
22744
+ "lucide-react": "1.70.0",
22175
22745
  "radix-ui": "1.8.1",
22176
22746
  shadcn: "4.23.0",
22177
22747
  "tw-animate-css": "1.4.0",
22178
- vite: "8.3.5",
22748
+ vite: "8.3.6",
22179
22749
  typescript: "6.0.3",
22180
- vitest: "5.0.5",
22750
+ vitest: "5.1.0",
22181
22751
  jsdom: "29.1.1",
22182
22752
  zod: "4.6.7",
22183
22753
  ws: "8.22.1"
@@ -37622,7 +38192,7 @@ var init_lib$16 = __esmMin((() => {
37622
38192
  var init_stringify_entities = __esmMin((() => {
37623
38193
  init_lib$16();
37624
38194
  }));
37625
- // ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.0_supports-color@10.2.2/node_modules/mdast-util-mdx-jsx/lib/index.js
38195
+ // ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.1_supports-color@10.2.2/node_modules/mdast-util-mdx-jsx/lib/index.js
37626
38196
  /**
37627
38197
  * Create an extension for `mdast-util-from-markdown` to enable MDX JSX.
37628
38198
  *
@@ -37683,6 +38253,8 @@ function mdxJsxFromMarkdown() {
37683
38253
  }
37684
38254
  };
37685
38255
  /**
38256
+ * Start a buffer.
38257
+ *
37686
38258
  * @this {CompileContext}
37687
38259
  * @type {FromMarkdownHandle}
37688
38260
  */
@@ -37705,6 +38277,8 @@ function mdxJsxFromMarkdown() {
37705
38277
  };
37706
38278
  }
37707
38279
  /**
38280
+ * Handle data.
38281
+ *
37708
38282
  * @this {CompileContext}
37709
38283
  * @type {FromMarkdownHandle}
37710
38284
  */
@@ -37713,6 +38287,8 @@ function mdxJsxFromMarkdown() {
37713
38287
  this.config.exit.data.call(this, token);
37714
38288
  }
37715
38289
  /**
38290
+ * Enter a tag.
38291
+ *
37716
38292
  * @this {CompileContext}
37717
38293
  * @type {FromMarkdownHandle}
37718
38294
  */
@@ -37731,6 +38307,8 @@ function mdxJsxFromMarkdown() {
37731
38307
  this.buffer();
37732
38308
  }
37733
38309
  /**
38310
+ * Enter the closing marker of a tag.
38311
+ *
37734
38312
  * @this {CompileContext}
37735
38313
  * @type {FromMarkdownHandle}
37736
38314
  */
@@ -37741,6 +38319,8 @@ function mdxJsxFromMarkdown() {
37741
38319
  }, "mdast-util-mdx-jsx:unexpected-closing-slash");
37742
38320
  }
37743
38321
  /**
38322
+ * Enter any attribute.
38323
+ *
37744
38324
  * @this {CompileContext}
37745
38325
  * @type {FromMarkdownHandle}
37746
38326
  */
@@ -37751,6 +38331,8 @@ function mdxJsxFromMarkdown() {
37751
38331
  }, "mdast-util-mdx-jsx:unexpected-attribute");
37752
38332
  }
37753
38333
  /**
38334
+ * Enter the self-closing marker of a tag.
38335
+ *
37754
38336
  * @this {CompileContext}
37755
38337
  * @type {FromMarkdownHandle}
37756
38338
  */
@@ -37761,6 +38343,8 @@ function mdxJsxFromMarkdown() {
37761
38343
  }, "mdast-util-mdx-jsx:unexpected-self-closing-slash");
37762
38344
  }
37763
38345
  /**
38346
+ * Exit the closing marker of a tag.
38347
+ *
37764
38348
  * @this {CompileContext}
37765
38349
  * @type {FromMarkdownHandle}
37766
38350
  */
@@ -37769,6 +38353,8 @@ function mdxJsxFromMarkdown() {
37769
38353
  tag.close = true;
37770
38354
  }
37771
38355
  /**
38356
+ * Exit the primary name of a tag.
38357
+ *
37772
38358
  * @this {CompileContext}
37773
38359
  * @type {FromMarkdownHandle}
37774
38360
  */
@@ -37777,6 +38363,8 @@ function mdxJsxFromMarkdown() {
37777
38363
  tag.name = this.sliceSerialize(token);
37778
38364
  }
37779
38365
  /**
38366
+ * Exit a member name of a tag.
38367
+ *
37780
38368
  * @this {CompileContext}
37781
38369
  * @type {FromMarkdownHandle}
37782
38370
  */
@@ -37785,6 +38373,8 @@ function mdxJsxFromMarkdown() {
37785
38373
  tag.name += "." + this.sliceSerialize(token);
37786
38374
  }
37787
38375
  /**
38376
+ * Exit the local name of a tag.
38377
+ *
37788
38378
  * @this {CompileContext}
37789
38379
  * @type {FromMarkdownHandle}
37790
38380
  */
@@ -37793,6 +38383,8 @@ function mdxJsxFromMarkdown() {
37793
38383
  tag.name += ":" + this.sliceSerialize(token);
37794
38384
  }
37795
38385
  /**
38386
+ * Enter an attribute.
38387
+ *
37796
38388
  * @this {CompileContext}
37797
38389
  * @type {FromMarkdownHandle}
37798
38390
  */
@@ -37810,6 +38402,8 @@ function mdxJsxFromMarkdown() {
37810
38402
  });
37811
38403
  }
37812
38404
  /**
38405
+ * Enter an expression attribute.
38406
+ *
37813
38407
  * @this {CompileContext}
37814
38408
  * @type {FromMarkdownHandle}
37815
38409
  */
@@ -37827,6 +38421,8 @@ function mdxJsxFromMarkdown() {
37827
38421
  this.buffer();
37828
38422
  }
37829
38423
  /**
38424
+ * Exit an expression attribute.
38425
+ *
37830
38426
  * @this {CompileContext}
37831
38427
  * @type {FromMarkdownHandle}
37832
38428
  */
@@ -37834,13 +38430,15 @@ function mdxJsxFromMarkdown() {
37834
38430
  const tag = this.data.mdxJsxTag;
37835
38431
  const tail = tag.attributes[tag.attributes.length - 1];
37836
38432
  tail.type;
37837
- const estree = token.estree;
38433
+ const { estree } = token;
37838
38434
  tail.value = this.resume();
37839
38435
  tail.position;
37840
38436
  tail.position.end = point(token.end);
37841
38437
  if (estree) tail.data = { estree };
37842
38438
  }
37843
38439
  /**
38440
+ * Exit the primary name of an attribute.
38441
+ *
37844
38442
  * @this {CompileContext}
37845
38443
  * @type {FromMarkdownHandle}
37846
38444
  */
@@ -37853,6 +38451,8 @@ function mdxJsxFromMarkdown() {
37853
38451
  node.position.end = point(token.end);
37854
38452
  }
37855
38453
  /**
38454
+ * Exit the local name of an attribute.
38455
+ *
37856
38456
  * @this {CompileContext}
37857
38457
  * @type {FromMarkdownHandle}
37858
38458
  */
@@ -37865,6 +38465,8 @@ function mdxJsxFromMarkdown() {
37865
38465
  node.position.end = point(token.end);
37866
38466
  }
37867
38467
  /**
38468
+ * Exit a literal attribute value.
38469
+ *
37868
38470
  * @this {CompileContext}
37869
38471
  * @type {FromMarkdownHandle}
37870
38472
  */
@@ -37876,6 +38478,8 @@ function mdxJsxFromMarkdown() {
37876
38478
  node.position.end = point(token.end);
37877
38479
  }
37878
38480
  /**
38481
+ * Exit an expression attribute value.
38482
+ *
37879
38483
  * @this {CompileContext}
37880
38484
  * @type {FromMarkdownHandle}
37881
38485
  */
@@ -37888,13 +38492,15 @@ function mdxJsxFromMarkdown() {
37888
38492
  type: "mdxJsxAttributeValueExpression",
37889
38493
  value: this.resume()
37890
38494
  };
37891
- const estree = token.estree;
38495
+ const { estree } = token;
37892
38496
  if (estree) node.data = { estree };
37893
38497
  tail.value = node;
37894
38498
  tail.position;
37895
38499
  tail.position.end = point(token.end);
37896
38500
  }
37897
38501
  /**
38502
+ * Exit the self-closing marker of a tag.
38503
+ *
37898
38504
  * @this {CompileContext}
37899
38505
  * @type {FromMarkdownHandle}
37900
38506
  */
@@ -37903,6 +38509,8 @@ function mdxJsxFromMarkdown() {
37903
38509
  tag.selfClosing = true;
37904
38510
  }
37905
38511
  /**
38512
+ * Exit a tag.
38513
+ *
37906
38514
  * @this {CompileContext}
37907
38515
  * @type {FromMarkdownHandle}
37908
38516
  */
@@ -37926,6 +38534,8 @@ function mdxJsxFromMarkdown() {
37926
38534
  else stack.push(tag);
37927
38535
  }
37928
38536
  /**
38537
+ * Crash when a tag is not closed before its parent closes.
38538
+ *
37929
38539
  * @this {CompileContext}
37930
38540
  * @type {OnEnterError}
37931
38541
  */
@@ -37943,6 +38553,8 @@ function mdxJsxFromMarkdown() {
37943
38553
  }) + ")" + place, position, "mdast-util-mdx-jsx:end-tag-mismatch");
37944
38554
  }
37945
38555
  /**
38556
+ * Crash when a tag is closed by a different construct.
38557
+ *
37946
38558
  * @this {CompileContext}
37947
38559
  * @type {OnExitError}
37948
38560
  */
@@ -37958,7 +38570,9 @@ function mdxJsxFromMarkdown() {
37958
38570
  * `self-closing` is not supported, because we don’t need it yet.
37959
38571
  *
37960
38572
  * @param {Tag} tag
38573
+ * Tag.
37961
38574
  * @returns {string}
38575
+ * Serialized tag.
37962
38576
  */
37963
38577
  function serializeAbbreviatedTag(tag) {
37964
38578
  return "<" + (tag.close ? "/" : "") + (tag.name || "") + ">";
@@ -37979,11 +38593,11 @@ function mdxJsxFromMarkdown() {
37979
38593
  function mdxJsxToMarkdown(options) {
37980
38594
  const options_ = options || {};
37981
38595
  const quote = options_.quote || "\"";
38596
+ if (quote !== "\"" && quote !== "'") throw new Error("Cannot serialize attribute values with `" + quote + "` for `options.quote`, expected `\"`, or `'`");
37982
38597
  const quoteSmart = options_.quoteSmart || false;
37983
38598
  const tightSelfClosing = options_.tightSelfClosing || false;
37984
- const printWidth = options_.printWidth || Number.POSITIVE_INFINITY;
38599
+ const printWidth = options_.printWidth || Infinity;
37985
38600
  const alternative = quote === "\"" ? "'" : "\"";
37986
- if (quote !== "\"" && quote !== "'") throw new Error("Cannot serialize attribute values with `" + quote + "` for `options.quote`, expected `\"`, or `'`");
37987
38601
  mdxElement.peek = peekElement;
37988
38602
  return {
37989
38603
  handlers: {
@@ -38001,13 +38615,18 @@ function mdxJsxToMarkdown(options) {
38001
38615
  resourceLink: true
38002
38616
  };
38003
38617
  /**
38618
+ * Serialize an element.
38619
+ *
38004
38620
  * @type {ToMarkdownHandle}
38005
38621
  * @param {MdxJsxFlowElement | MdxJsxTextElement} node
38622
+ * Node.
38006
38623
  */
38007
38624
  function mdxElement(node, _, state, info) {
38008
38625
  const flow = node.type === "mdxJsxFlowElement";
38009
38626
  const selfClosing = node.name ? !node.children || node.children.length === 0 : false;
38010
- const currentIndent = createIndent(inferDepth(state));
38627
+ const depth = inferDepth(state);
38628
+ const currentIndent = createIndent(depth);
38629
+ const expressionIndent = flow || depth === 0 ? indent : "";
38011
38630
  const trackerOneLine = state.createTracker(info);
38012
38631
  const trackerMultiLine = state.createTracker(info);
38013
38632
  /** @type {Array<string>} */
@@ -38023,14 +38642,14 @@ function mdxJsxToMarkdown(options) {
38023
38642
  const attribute = node.attributes[index];
38024
38643
  /** @type {string} */
38025
38644
  let result;
38026
- if (attribute.type === "mdxJsxExpressionAttribute") result = "{" + (attribute.value || "") + "}";
38645
+ if (attribute.type === "mdxJsxExpressionAttribute") result = serializeExpression(state, attribute.value || "", expressionIndent);
38027
38646
  else {
38028
38647
  if (!attribute.name) throw new Error("Cannot serialize attribute w/o name");
38029
- const value = attribute.value;
38648
+ const { value } = attribute;
38030
38649
  const left = attribute.name;
38031
38650
  /** @type {string} */
38032
38651
  let right = "";
38033
- if (value === null || value === void 0) {} else if (typeof value === "object") right = "{" + (value.value || "") + "}";
38652
+ if (value === null || value === void 0) {} else if (typeof value === "object") right = serializeExpression(state, value.value || "", expressionIndent);
38034
38653
  else {
38035
38654
  const appliedQuote = quoteSmart && ccount(value, quote) > ccount(value, alternative) ? alternative : quote;
38036
38655
  right = appliedQuote + stringifyEntitiesLight(value, { subset: [appliedQuote] }) + appliedQuote;
@@ -38072,6 +38691,8 @@ function mdxJsxToMarkdown(options) {
38072
38691
  }
38073
38692
  }
38074
38693
  /**
38694
+ * Serialize the flow children of an element.
38695
+ *
38075
38696
  * @param {MdxJsxFlowElement} parent
38076
38697
  * Parent of flow nodes.
38077
38698
  * @param {State} state
@@ -38082,8 +38703,8 @@ function mdxJsxToMarkdown(options) {
38082
38703
  * Serialized children, joined by (blank) lines.
38083
38704
  */
38084
38705
  function containerFlow$1(parent, state, info) {
38085
- const indexStack = state.indexStack;
38086
- const children = parent.children;
38706
+ const { indexStack } = state;
38707
+ const { children } = parent;
38087
38708
  const tracker = state.createTracker(info);
38088
38709
  const currentIndent = createIndent(inferDepth(state));
38089
38710
  /** @type {Array<string>} */
@@ -38110,8 +38731,12 @@ function containerFlow$1(parent, state, info) {
38110
38731
  return results.join("");
38111
38732
  }
38112
38733
  /**
38734
+ * Infer how many JSX elements we are in.
38735
+ *
38113
38736
  * @param {State} state
38737
+ * Info passed around about the current state.
38114
38738
  * @returns {number}
38739
+ * Depth.
38115
38740
  */
38116
38741
  function inferDepth(state) {
38117
38742
  let depth = 0;
@@ -38124,18 +38749,43 @@ function inferDepth(state) {
38124
38749
  return depth;
38125
38750
  }
38126
38751
  /**
38752
+ * Create an indent.
38753
+ *
38127
38754
  * @param {number} depth
38755
+ * Depth.
38128
38756
  * @returns {string}
38757
+ * Indent.
38129
38758
  */
38130
38759
  function createIndent(depth) {
38131
38760
  return indent.repeat(depth);
38132
38761
  }
38133
38762
  /**
38763
+ * Peek an element.
38764
+ *
38134
38765
  * @type {ToMarkdownHandle}
38135
38766
  */
38136
38767
  function peekElement() {
38137
38768
  return "<";
38138
38769
  }
38770
+ /**
38771
+ * Serialize an expression in an attribute.
38772
+ *
38773
+ * @param {State} state
38774
+ * Info passed around about the current state.
38775
+ * @param {string} value
38776
+ * Value of expression.
38777
+ * @param {string} indent
38778
+ * Indent to add to lines after the first.
38779
+ * @returns {string}
38780
+ * Serialized expression.
38781
+ */
38782
+ function serializeExpression(state, value, indent) {
38783
+ let result = value;
38784
+ if (indent) result = state.indentLines(result, function(line, index, blank) {
38785
+ return (index === 0 || blank ? "" : indent) + line;
38786
+ });
38787
+ return "{" + result + "}";
38788
+ }
38139
38789
  var indent;
38140
38790
  var init_lib$15 = __esmMin((() => {
38141
38791
  init_ccount();
@@ -38146,7 +38796,7 @@ var init_lib$15 = __esmMin((() => {
38146
38796
  init_vfile_message();
38147
38797
  indent = " ";
38148
38798
  }));
38149
- // ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.0_supports-color@10.2.2/node_modules/mdast-util-mdx-jsx/index.js
38799
+ // ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.1_supports-color@10.2.2/node_modules/mdast-util-mdx-jsx/index.js
38150
38800
  var init_mdast_util_mdx_jsx = __esmMin((() => {
38151
38801
  init_lib$15();
38152
38802
  }));