msw 0.0.0-fetch.rc-18 → 0.0.0-fetch.rc-19

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/lib/iife/index.js CHANGED
@@ -21,13 +21,6 @@ var MockServiceWorker = (() => {
21
21
  return a;
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
25
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
26
- }) : x)(function(x) {
27
- if (typeof require !== "undefined")
28
- return require.apply(this, arguments);
29
- throw new Error('Dynamic require of "' + x + '" is not supported');
30
- });
31
24
  var __objRest = (source, exclude) => {
32
25
  var target = {};
33
26
  for (var prop in source)
@@ -57,6 +50,28 @@ var MockServiceWorker = (() => {
57
50
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
58
51
  return value;
59
52
  };
53
+ var __accessCheck = (obj, member, msg) => {
54
+ if (!member.has(obj))
55
+ throw TypeError("Cannot " + msg);
56
+ };
57
+ var __privateGet = (obj, member, getter) => {
58
+ __accessCheck(obj, member, "read from private field");
59
+ return getter ? getter.call(obj) : member.get(obj);
60
+ };
61
+ var __privateAdd = (obj, member, value) => {
62
+ if (member.has(obj))
63
+ throw TypeError("Cannot add the same private member more than once");
64
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
65
+ };
66
+ var __privateSet = (obj, member, value, setter) => {
67
+ __accessCheck(obj, member, "write to private field");
68
+ setter ? setter.call(obj, value) : member.set(obj, value);
69
+ return value;
70
+ };
71
+ var __privateMethod = (obj, member, method) => {
72
+ __accessCheck(obj, member, "access private method");
73
+ return method;
74
+ };
60
75
  var __async = (__this, __arguments, generator) => {
61
76
  return new Promise((resolve, reject) => {
62
77
  var fulfilled = (value) => {
@@ -88,7 +103,6 @@ var MockServiceWorker = (() => {
88
103
  MAX_SERVER_RESPONSE_TIME: () => MAX_SERVER_RESPONSE_TIME,
89
104
  MIN_SERVER_RESPONSE_TIME: () => MIN_SERVER_RESPONSE_TIME,
90
105
  NODE_SERVER_RESPONSE_TIME: () => NODE_SERVER_RESPONSE_TIME,
91
- NetworkError: () => NetworkError,
92
106
  RequestHandler: () => RequestHandler,
93
107
  SET_TIMEOUT_MAX_ALLOWED_INT: () => SET_TIMEOUT_MAX_ALLOWED_INT,
94
108
  SetupApi: () => SetupApi,
@@ -628,7 +642,7 @@ var MockServiceWorker = (() => {
628
642
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
629
643
  var __getProtoOf = Object.getPrototypeOf;
630
644
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
631
- var __commonJS = (cb, mod) => function __require3() {
645
+ var __commonJS = (cb, mod) => function __require() {
632
646
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
633
647
  };
634
648
  var __copyProps2 = (to, from, except, desc) => {
@@ -876,8 +890,8 @@ var MockServiceWorker = (() => {
876
890
  }
877
891
  }
878
892
  get(name) {
879
- var _a2;
880
- return (_a2 = this[NORMALIZED_HEADERS][normalizeHeaderName(name)]) != null ? _a2 : null;
893
+ var _a3;
894
+ return (_a3 = this[NORMALIZED_HEADERS][normalizeHeaderName(name)]) != null ? _a3 : null;
881
895
  }
882
896
  set(name, value) {
883
897
  const normalizedName = normalizeHeaderName(name);
@@ -928,22 +942,6 @@ var MockServiceWorker = (() => {
928
942
  return (0, import_set_cookie_parser.splitCookiesString)(setCookieHeader);
929
943
  }
930
944
  };
931
- function headersToList(headers) {
932
- const headersList = [];
933
- headers.forEach((value, name) => {
934
- const resolvedValue = value.includes(",") ? value.split(",").map((value2) => value2.trim()) : value;
935
- headersList.push([name, resolvedValue]);
936
- });
937
- return headersList;
938
- }
939
- function headersToString(headers) {
940
- const list = headersToList(headers);
941
- const lines = list.map(([name, value]) => {
942
- const values = [].concat(value);
943
- return `${name}: ${values.join(", ")}`;
944
- });
945
- return lines.join("\r\n");
946
- }
947
945
  var singleValueHeaders = ["user-agent"];
948
946
  function headersToObject(headers) {
949
947
  const headersObject = {};
@@ -1003,7 +1001,7 @@ var MockServiceWorker = (() => {
1003
1001
  var __getOwnPropNames3 = Object.getOwnPropertyNames;
1004
1002
  var __getProtoOf2 = Object.getPrototypeOf;
1005
1003
  var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1006
- var __commonJS2 = (cb, mod) => function __require3() {
1004
+ var __commonJS2 = (cb, mod) => function __require() {
1007
1005
  return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1008
1006
  };
1009
1007
  var __copyProps3 = (to, from, except, desc) => {
@@ -1269,7 +1267,7 @@ var MockServiceWorker = (() => {
1269
1267
  options = {};
1270
1268
  }
1271
1269
  var tokens = lexer(str);
1272
- var _a2 = options.prefixes, prefixes = _a2 === void 0 ? "./" : _a2;
1270
+ var _a3 = options.prefixes, prefixes = _a3 === void 0 ? "./" : _a3;
1273
1271
  var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?");
1274
1272
  var result = [];
1275
1273
  var key = 0;
@@ -1283,7 +1281,7 @@ var MockServiceWorker = (() => {
1283
1281
  var value2 = tryConsume(type);
1284
1282
  if (value2 !== void 0)
1285
1283
  return value2;
1286
- var _a3 = tokens[i], nextType = _a3.type, index = _a3.index;
1284
+ var _a4 = tokens[i], nextType = _a4.type, index = _a4.index;
1287
1285
  throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
1288
1286
  };
1289
1287
  var consumeText = function() {
@@ -1355,9 +1353,9 @@ var MockServiceWorker = (() => {
1355
1353
  if (options === void 0) {
1356
1354
  options = {};
1357
1355
  }
1358
- var _a2 = options.decode, decode = _a2 === void 0 ? function(x) {
1356
+ var _a3 = options.decode, decode = _a3 === void 0 ? function(x) {
1359
1357
  return x;
1360
- } : _a2;
1358
+ } : _a3;
1361
1359
  return function(pathname) {
1362
1360
  var m = re.exec(pathname);
1363
1361
  if (!m)
@@ -1420,7 +1418,7 @@ var MockServiceWorker = (() => {
1420
1418
  if (options === void 0) {
1421
1419
  options = {};
1422
1420
  }
1423
- var _a2 = options.strict, strict = _a2 === void 0 ? false : _a2, _b2 = options.start, start = _b2 === void 0 ? true : _b2, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function(x) {
1421
+ var _a3 = options.strict, strict = _a3 === void 0 ? false : _a3, _b2 = options.start, start = _b2 === void 0 ? true : _b2, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function(x) {
1424
1422
  return x;
1425
1423
  } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f;
1426
1424
  var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
@@ -1742,11 +1740,11 @@ var MockServiceWorker = (() => {
1742
1740
  console.error(message3, ...positionals);
1743
1741
  }
1744
1742
  function getVariable(variableName) {
1745
- var _a2;
1743
+ var _a3;
1746
1744
  if (IS_NODE) {
1747
1745
  return process.env[variableName];
1748
1746
  }
1749
- return (_a2 = globalThis[variableName]) == null ? void 0 : _a2.toString();
1747
+ return (_a3 = globalThis[variableName]) == null ? void 0 : _a3.toString();
1750
1748
  }
1751
1749
  function isDefinedAndNotEquals(value, expected) {
1752
1750
  return value !== void 0 && value !== expected;
@@ -1767,14 +1765,7 @@ var MockServiceWorker = (() => {
1767
1765
  return message3.toString();
1768
1766
  }
1769
1767
 
1770
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-Y5QA6OEZ.mjs
1771
- var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
1772
- get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
1773
- }) : x)(function(x) {
1774
- if (typeof __require !== "undefined")
1775
- return __require.apply(this, arguments);
1776
- throw new Error('Dynamic require of "' + x + '" is not supported');
1777
- });
1768
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-RGYCLCLK.mjs
1778
1769
  function nextTick(callback) {
1779
1770
  setTimeout(callback, 0);
1780
1771
  }
@@ -1830,6 +1821,11 @@ var MockServiceWorker = (() => {
1830
1821
  });
1831
1822
  return super.emit(eventName, ...data);
1832
1823
  }
1824
+ /**
1825
+ * Returns a promise that resolves when all the listeners for the given event
1826
+ * has been called. Awaits asynchronous listeners.
1827
+ * If the event has no listeners, resolves immediately.
1828
+ */
1833
1829
  untilIdle(eventName, filter = () => true) {
1834
1830
  return __async(this, null, function* () {
1835
1831
  const listenersQueue = this.queue.get(eventName) || [];
@@ -1873,6 +1869,11 @@ var MockServiceWorker = (() => {
1873
1869
  this.readyState = "ACTIVE";
1874
1870
  logger.info("set state to:", this.readyState);
1875
1871
  }
1872
+ /**
1873
+ * Deactivate this event emitter.
1874
+ * Deactivated emitter can no longer emit and listen to events
1875
+ * and needs to be activated again in order to do so.
1876
+ */
1876
1877
  deactivate() {
1877
1878
  const logger = this.logger.extend("deactivate");
1878
1879
  logger.info("removing all listeners...");
@@ -1885,7 +1886,10 @@ var MockServiceWorker = (() => {
1885
1886
  }
1886
1887
  };
1887
1888
  function getGlobalSymbol(symbol) {
1888
- return globalThis[symbol] || void 0;
1889
+ return (
1890
+ // @ts-ignore https://github.com/Microsoft/TypeScript/issues/24587
1891
+ globalThis[symbol] || void 0
1892
+ );
1889
1893
  }
1890
1894
  function setGlobalSymbol(symbol, value) {
1891
1895
  globalThis[symbol] = value;
@@ -1903,9 +1907,17 @@ var MockServiceWorker = (() => {
1903
1907
  this.emitter.setMaxListeners(0);
1904
1908
  this.logger.info("constructing the interceptor...");
1905
1909
  }
1910
+ /**
1911
+ * Determine if this interceptor can be applied
1912
+ * in the current environment.
1913
+ */
1906
1914
  checkEnvironment() {
1907
1915
  return true;
1908
1916
  }
1917
+ /**
1918
+ * Apply this interceptor to the current process.
1919
+ * Returns an already running interceptor instance if it's present.
1920
+ */
1909
1921
  apply() {
1910
1922
  const logger = this.logger.extend("apply");
1911
1923
  logger.info("applying the interceptor...");
@@ -1940,8 +1952,16 @@ var MockServiceWorker = (() => {
1940
1952
  this.setInstance();
1941
1953
  this.readyState = "APPLIED";
1942
1954
  }
1955
+ /**
1956
+ * Setup the module augments and stubs necessary for this interceptor.
1957
+ * This method is not run if there's a running interceptor instance
1958
+ * to prevent instantiating an interceptor multiple times.
1959
+ */
1943
1960
  setup() {
1944
1961
  }
1962
+ /**
1963
+ * Listen to the interceptor's public events.
1964
+ */
1945
1965
  on(eventName, listener) {
1946
1966
  const logger = this.logger.extend("on");
1947
1967
  if (this.readyState === "DISPOSING" || this.readyState === "DISPOSED") {
@@ -1951,6 +1971,9 @@ var MockServiceWorker = (() => {
1951
1971
  logger.info('adding "%s" event listener:', eventName, listener.name);
1952
1972
  this.emitter.on(eventName, listener);
1953
1973
  }
1974
+ /**
1975
+ * Disposes of any side-effects this interceptor has introduced.
1976
+ */
1954
1977
  dispose() {
1955
1978
  const logger = this.logger.extend("dispose");
1956
1979
  if (this.readyState === "DISPOSED") {
@@ -1978,9 +2001,9 @@ var MockServiceWorker = (() => {
1978
2001
  this.readyState = "DISPOSED";
1979
2002
  }
1980
2003
  getInstance() {
1981
- var _a2;
2004
+ var _a3;
1982
2005
  const instance = getGlobalSymbol(this.symbol);
1983
- this.logger.info("retrieved global instance:", (_a2 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a2.name);
2006
+ this.logger.info("retrieved global instance:", (_a3 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a3.name);
1984
2007
  return instance;
1985
2008
  }
1986
2009
  setInstance() {
@@ -1993,7 +2016,7 @@ var MockServiceWorker = (() => {
1993
2016
  }
1994
2017
  };
1995
2018
 
1996
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-NUSH7ACE.mjs
2019
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-VS3GJPUE.mjs
1997
2020
  var BatchInterceptor = class extends Interceptor {
1998
2021
  constructor(options) {
1999
2022
  BatchInterceptor.symbol = Symbol(options.name);
@@ -2017,15 +2040,13 @@ var MockServiceWorker = (() => {
2017
2040
  }
2018
2041
  };
2019
2042
 
2020
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-LTX5IGCQ.mjs
2021
- var TextEncoder = typeof globalThis.TextEncoder === "undefined" ? __require2("util").TextEncoder : globalThis.TextEncoder;
2022
- var TextDecoder = typeof globalThis.TextDecoder === "undefined" ? __require2("util").TextDecoder : globalThis.TextDecoder;
2043
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-7II4SWKS.mjs
2023
2044
  var encoder = new TextEncoder();
2024
2045
 
2025
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-GFH37L5D.mjs
2046
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/chunk-GFH37L5D.mjs
2026
2047
  var IS_PATCHED_MODULE = Symbol("isPatchedModule");
2027
2048
 
2028
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/index.mjs
2049
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/node/index.mjs
2029
2050
  function getCleanUrl(url, isAbsolute = true) {
2030
2051
  return [isAbsolute && url.origin, url.pathname].filter(Boolean).join("");
2031
2052
  }
@@ -2109,7 +2130,7 @@ var MockServiceWorker = (() => {
2109
2130
  var __getOwnPropNames4 = Object.getOwnPropertyNames;
2110
2131
  var __getProtoOf3 = Object.getPrototypeOf;
2111
2132
  var __hasOwnProp4 = Object.prototype.hasOwnProperty;
2112
- var __commonJS3 = (cb, mod) => function __require3() {
2133
+ var __commonJS3 = (cb, mod) => function __require() {
2113
2134
  return mod || (0, cb[__getOwnPropNames4(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2114
2135
  };
2115
2136
  var __copyProps4 = (to, from, except, desc) => {
@@ -2278,7 +2299,7 @@ var MockServiceWorker = (() => {
2278
2299
  var __getOwnPropNames5 = Object.getOwnPropertyNames;
2279
2300
  var __getProtoOf4 = Object.getPrototypeOf;
2280
2301
  var __hasOwnProp5 = Object.prototype.hasOwnProperty;
2281
- var __commonJS4 = (cb, mod) => function __require3() {
2302
+ var __commonJS4 = (cb, mod) => function __require() {
2282
2303
  return mod || (0, cb[__getOwnPropNames5(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2283
2304
  };
2284
2305
  var __copyProps5 = (to, from, except, desc) => {
@@ -2465,8 +2486,8 @@ var MockServiceWorker = (() => {
2465
2486
  }
2466
2487
  const now = Date.now();
2467
2488
  const parsedResponseCookies = (0, import_set_cookie_parser2.parse)(responseCookies).map(
2468
- (_a2) => {
2469
- var _b2 = _a2, { maxAge } = _b2, cookie = __objRest(_b2, ["maxAge"]);
2489
+ (_a3) => {
2490
+ var _b2 = _a3, { maxAge } = _b2, cookie = __objRest(_b2, ["maxAge"]);
2470
2491
  return __spreadProps(__spreadValues({}, cookie), {
2471
2492
  expires: maxAge === void 0 ? cookie.expires : new Date(now + maxAge * 1e3),
2472
2493
  maxAge
@@ -2525,8 +2546,8 @@ var MockServiceWorker = (() => {
2525
2546
  this.store.set(
2526
2547
  origin,
2527
2548
  new Map(
2528
- cookies.map((_a2) => {
2529
- var [token, _b2] = _a2, _c = _b2, { expires } = _c, cookie = __objRest(_c, ["expires"]);
2549
+ cookies.map((_a3) => {
2550
+ var [token, _b2] = _a3, _c = _b2, { expires } = _c, cookie = __objRest(_c, ["expires"]);
2530
2551
  return [
2531
2552
  token,
2532
2553
  expires === void 0 ? cookie : __spreadProps(__spreadValues({}, cookie), { expires: new Date(expires) })
@@ -2598,11 +2619,11 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
2598
2619
  }
2599
2620
  }
2600
2621
  function getAllRequestCookies(request) {
2601
- var _a2;
2622
+ var _a3;
2602
2623
  const requestCookiesString = request.headers.get("cookie");
2603
2624
  const cookiesFromHeaders = requestCookiesString ? source_default2.parse(requestCookiesString) : {};
2604
2625
  store.hydrate();
2605
- const cookiesFromStore = Array.from((_a2 = store.get(request)) == null ? void 0 : _a2.entries()).reduce(
2626
+ const cookiesFromStore = Array.from((_a3 = store.get(request)) == null ? void 0 : _a3.entries()).reduce(
2606
2627
  (cookies, [name, { value }]) => {
2607
2628
  return Object.assign(cookies, { [name.trim()]: value });
2608
2629
  },
@@ -2682,9 +2703,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
2682
2703
  return this.info.method instanceof RegExp ? this.info.method.test(actualMethod) : isStringEqual(this.info.method, actualMethod);
2683
2704
  }
2684
2705
  extendInfo(_request, parsedResult) {
2685
- var _a2;
2706
+ var _a3;
2686
2707
  return {
2687
- params: ((_a2 = parsedResult.match) == null ? void 0 : _a2.params) || {},
2708
+ params: ((_a3 = parsedResult.match) == null ? void 0 : _a3.params) || {},
2688
2709
  cookies: parsedResult.cookies
2689
2710
  };
2690
2711
  }
@@ -5197,7 +5218,7 @@ spurious results.`);
5197
5218
 
5198
5219
  // src/core/utils/internal/parseMultipartData.ts
5199
5220
  function parseContentHeaders(headersString) {
5200
- var _a2, _b2;
5221
+ var _a3, _b2;
5201
5222
  const headers = stringToHeaders(headersString);
5202
5223
  const contentType = headers.get("content-type") || "text/plain";
5203
5224
  const disposition = headers.get("content-disposition");
@@ -5209,7 +5230,7 @@ spurious results.`);
5209
5230
  acc[name2] = rest.join("=");
5210
5231
  return acc;
5211
5232
  }, {});
5212
- const name = (_a2 = directives.name) == null ? void 0 : _a2.slice(1, -1);
5233
+ const name = (_a3 = directives.name) == null ? void 0 : _a3.slice(1, -1);
5213
5234
  const filename = (_b2 = directives.filename) == null ? void 0 : _b2.slice(1, -1);
5214
5235
  return {
5215
5236
  name,
@@ -5256,13 +5277,13 @@ spurious results.`);
5256
5277
 
5257
5278
  // src/core/utils/internal/parseGraphQLRequest.ts
5258
5279
  function parseDocumentNode(node) {
5259
- var _a2;
5280
+ var _a3;
5260
5281
  const operationDef = node.definitions.find((definition) => {
5261
5282
  return definition.kind === "OperationDefinition";
5262
5283
  });
5263
5284
  return {
5264
5285
  operationType: operationDef == null ? void 0 : operationDef.operation,
5265
- operationName: (_a2 = operationDef == null ? void 0 : operationDef.name) == null ? void 0 : _a2.value
5286
+ operationName: (_a3 = operationDef == null ? void 0 : operationDef.name) == null ? void 0 : _a3.value
5266
5287
  };
5267
5288
  }
5268
5289
  function parseQuery(query) {
@@ -5296,7 +5317,7 @@ spurious results.`);
5296
5317
  }
5297
5318
  function getGraphQLInput(request) {
5298
5319
  return __async(this, null, function* () {
5299
- var _a2;
5320
+ var _a3;
5300
5321
  switch (request.method) {
5301
5322
  case "GET": {
5302
5323
  const url = new URL(request.url);
@@ -5309,7 +5330,7 @@ spurious results.`);
5309
5330
  }
5310
5331
  case "POST": {
5311
5332
  const requestClone = request.clone();
5312
- if ((_a2 = request.headers.get("content-type")) == null ? void 0 : _a2.includes("multipart/form-data")) {
5333
+ if ((_a3 = request.headers.get("content-type")) == null ? void 0 : _a3.includes("multipart/form-data")) {
5313
5334
  const responseJson = parseMultipartData(
5314
5335
  yield requestClone.text(),
5315
5336
  request.headers
@@ -5558,7 +5579,7 @@ Consider naming this operation or using "graphql.operation()" request handler to
5558
5579
  var __getOwnPropNames6 = Object.getOwnPropertyNames;
5559
5580
  var __getProtoOf5 = Object.getPrototypeOf;
5560
5581
  var __hasOwnProp6 = Object.prototype.hasOwnProperty;
5561
- var __commonJS5 = (cb, mod) => function __require3() {
5582
+ var __commonJS5 = (cb, mod) => function __require() {
5562
5583
  return mod || (0, cb[__getOwnPropNames6(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5563
5584
  };
5564
5585
  var __copyProps6 = (to, from, except, desc) => {
@@ -5809,11 +5830,11 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5809
5830
  // src/core/utils/handleRequest.ts
5810
5831
  function handleRequest(request, requestId, handlers, options, emitter, handleRequestOptions) {
5811
5832
  return __async(this, null, function* () {
5812
- var _a2, _b2, _c, _d, _e, _f;
5833
+ var _a3, _b2, _c, _d, _e, _f;
5813
5834
  emitter.emit("request:start", { request, requestId });
5814
5835
  if (request.headers.get("x-msw-intention") === "bypass") {
5815
5836
  emitter.emit("request:end", { request, requestId });
5816
- (_a2 = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _a2.call(handleRequestOptions, request);
5837
+ (_a3 = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _a3.call(handleRequestOptions, request);
5817
5838
  return;
5818
5839
  }
5819
5840
  const lookupResult = yield until(() => {
@@ -5876,7 +5897,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5876
5897
  });
5877
5898
  }
5878
5899
  function decorateResponse(response, init) {
5879
- var _a2;
5900
+ var _a3;
5880
5901
  if (init.type) {
5881
5902
  Object.defineProperty(response, "type", {
5882
5903
  value: init.type,
@@ -5885,7 +5906,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
5885
5906
  });
5886
5907
  }
5887
5908
  if (typeof document !== "undefined") {
5888
- const responseCookies = ((_a2 = init.headers.get("Set-Cookie")) == null ? void 0 : _a2.split(",")) || [];
5909
+ const responseCookies = ((_a3 = init.headers.get("Set-Cookie")) == null ? void 0 : _a3.split(",")) || [];
5889
5910
  for (const cookieString of responseCookies) {
5890
5911
  document.cookie = cookieString;
5891
5912
  }
@@ -6073,14 +6094,6 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
6073
6094
  });
6074
6095
  }
6075
6096
 
6076
- // src/core/NetworkError.ts
6077
- var NetworkError = class extends Error {
6078
- constructor(message3) {
6079
- super(message3);
6080
- this.name = "NetworkError";
6081
- }
6082
- };
6083
-
6084
6097
  // src/core/index.ts
6085
6098
  checkGlobals();
6086
6099
 
@@ -6190,7 +6203,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
6190
6203
  // src/browser/setupWorker/start/utils/enableMocking.ts
6191
6204
  function enableMocking(context, options) {
6192
6205
  return __async(this, null, function* () {
6193
- var _a2, _b2;
6206
+ var _a3, _b2;
6194
6207
  context.workerChannel.send("MOCK_ACTIVATE");
6195
6208
  yield context.events.once("MOCKING_ENABLED");
6196
6209
  if (context.isMockingEnabled) {
@@ -6202,7 +6215,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
6202
6215
  context.isMockingEnabled = true;
6203
6216
  printStartMessage({
6204
6217
  quiet: options.quiet,
6205
- workerScope: (_a2 = context.registration) == null ? void 0 : _a2.scope,
6218
+ workerScope: (_a3 = context.registration) == null ? void 0 : _a3.scope,
6206
6219
  workerUrl: (_b2 = context.worker) == null ? void 0 : _b2.scriptURL
6207
6220
  });
6208
6221
  });
@@ -6259,7 +6272,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
6259
6272
  const request = parseWorkerRequest(message3.payload);
6260
6273
  const requestCloneForLogs = request.clone();
6261
6274
  try {
6262
- let _a2;
6275
+ let _a3;
6263
6276
  yield handleRequest(
6264
6277
  request,
6265
6278
  requestId,
@@ -6294,13 +6307,6 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
6294
6307
  }
6295
6308
  );
6296
6309
  } catch (error3) {
6297
- if (error3 instanceof NetworkError) {
6298
- messageChannel.postMessage("NETWORK_ERROR", {
6299
- name: error3.name,
6300
- message: error3.message
6301
- });
6302
- return;
6303
- }
6304
6310
  if (error3 instanceof Error) {
6305
6311
  devUtils.error(
6306
6312
  `Uncaught exception in the request handler for "%s %s":
@@ -6336,9 +6342,9 @@ This exception has been gracefully handled as a 500 response, however, it's stro
6336
6342
  const { payload: actualChecksum } = yield context.events.once(
6337
6343
  "INTEGRITY_CHECK_RESPONSE"
6338
6344
  );
6339
- if (actualChecksum !== "42fb047ce943b9103a6ed499f86548c4") {
6345
+ if (actualChecksum !== "e2d8525b2d1bdadf89a15ae5a2619512") {
6340
6346
  throw new Error(
6341
- `Currently active Service Worker (${actualChecksum}) is behind the latest published one (${"42fb047ce943b9103a6ed499f86548c4"}).`
6347
+ `Currently active Service Worker (${actualChecksum}) is behind the latest published one (${"e2d8525b2d1bdadf89a15ae5a2619512"}).`
6342
6348
  );
6343
6349
  }
6344
6350
  return serviceWorker;
@@ -6365,9 +6371,9 @@ This exception has been gracefully handled as a 500 response, however, it's stro
6365
6371
  // src/browser/setupWorker/start/createResponseListener.ts
6366
6372
  function createResponseListener(context) {
6367
6373
  return (_, message3) => {
6368
- var _a2;
6374
+ var _a3;
6369
6375
  const { payload: responseJson } = message3;
6370
- if ((_a2 = responseJson.type) == null ? void 0 : _a2.includes("opaque")) {
6376
+ if ((_a3 = responseJson.type) == null ? void 0 : _a3.includes("opaque")) {
6371
6377
  return;
6372
6378
  }
6373
6379
  const response = responseJson.status === 0 ? Response.error() : new Response(responseJson.body, responseJson);
@@ -6500,7 +6506,7 @@ If this message still persists after updating, please report an issue: https://g
6500
6506
  // src/browser/setupWorker/stop/createStop.ts
6501
6507
  var createStop = (context) => {
6502
6508
  return function stop() {
6503
- var _a2;
6509
+ var _a3;
6504
6510
  if (!context.isMockingEnabled) {
6505
6511
  devUtils.warn(
6506
6512
  'Found a redundant "worker.stop()" call. Note that stopping the worker while mocking already stopped has no effect. Consider removing this "worker.stop()" call.'
@@ -6510,7 +6516,7 @@ If this message still persists after updating, please report an issue: https://g
6510
6516
  context.workerChannel.send("MOCK_DEACTIVATE");
6511
6517
  context.isMockingEnabled = false;
6512
6518
  window.clearInterval(context.keepAliveInterval);
6513
- printStopMessage({ quiet: (_a2 = context.startOptions) == null ? void 0 : _a2.quiet });
6519
+ printStopMessage({ quiet: (_a3 = context.startOptions) == null ? void 0 : _a3.quiet });
6514
6520
  };
6515
6521
  };
6516
6522
 
@@ -6550,7 +6556,7 @@ If this message still persists after updating, please report an issue: https://g
6550
6556
  }
6551
6557
  };
6552
6558
 
6553
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-RT3ATOJH.mjs
6559
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-RT3ATOJH.mjs
6554
6560
  function uuidv4() {
6555
6561
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
6556
6562
  const r = Math.random() * 16 | 0;
@@ -6568,9 +6574,9 @@ If this message still persists after updating, please report an issue: https://g
6568
6574
  clearTimeout(autoResolveTimeout);
6569
6575
  });
6570
6576
  const fn = function(...args) {
6571
- var _a2;
6577
+ var _a3;
6572
6578
  if (options.maxCalls && calledTimes >= options.maxCalls) {
6573
- (_a2 = options.maxCallsCallback) == null ? void 0 : _a2.call(options);
6579
+ (_a3 = options.maxCallsCallback) == null ? void 0 : _a3.call(options);
6574
6580
  }
6575
6581
  remoteResolve(args);
6576
6582
  calledTimes++;
@@ -6603,11 +6609,7 @@ If this message still persists after updating, please report an issue: https://g
6603
6609
  return request;
6604
6610
  }
6605
6611
 
6606
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-MW6NCDWE.mjs
6607
- var __getOwnPropNames7 = Object.getOwnPropertyNames;
6608
- var __commonJS6 = (cb, mod) => function __require3() {
6609
- return mod || (0, cb[__getOwnPropNames7(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6610
- };
6612
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-GXJLJMOT.mjs
6611
6613
  var IS_PATCHED_MODULE2 = Symbol("isPatchedModule");
6612
6614
  function nextTick2(callback) {
6613
6615
  setTimeout(callback, 0);
@@ -6664,6 +6666,11 @@ If this message still persists after updating, please report an issue: https://g
6664
6666
  });
6665
6667
  return super.emit(eventName, ...data);
6666
6668
  }
6669
+ /**
6670
+ * Returns a promise that resolves when all the listeners for the given event
6671
+ * has been called. Awaits asynchronous listeners.
6672
+ * If the event has no listeners, resolves immediately.
6673
+ */
6667
6674
  untilIdle(eventName, filter = () => true) {
6668
6675
  return __async(this, null, function* () {
6669
6676
  const listenersQueue = this.queue.get(eventName) || [];
@@ -6707,6 +6714,11 @@ If this message still persists after updating, please report an issue: https://g
6707
6714
  this.readyState = "ACTIVE";
6708
6715
  logger.info("set state to:", this.readyState);
6709
6716
  }
6717
+ /**
6718
+ * Deactivate this event emitter.
6719
+ * Deactivated emitter can no longer emit and listen to events
6720
+ * and needs to be activated again in order to do so.
6721
+ */
6710
6722
  deactivate() {
6711
6723
  const logger = this.logger.extend("deactivate");
6712
6724
  logger.info("removing all listeners...");
@@ -6719,7 +6731,10 @@ If this message still persists after updating, please report an issue: https://g
6719
6731
  }
6720
6732
  };
6721
6733
  function getGlobalSymbol2(symbol) {
6722
- return globalThis[symbol] || void 0;
6734
+ return (
6735
+ // @ts-ignore https://github.com/Microsoft/TypeScript/issues/24587
6736
+ globalThis[symbol] || void 0
6737
+ );
6723
6738
  }
6724
6739
  function setGlobalSymbol2(symbol, value) {
6725
6740
  globalThis[symbol] = value;
@@ -6737,9 +6752,17 @@ If this message still persists after updating, please report an issue: https://g
6737
6752
  this.emitter.setMaxListeners(0);
6738
6753
  this.logger.info("constructing the interceptor...");
6739
6754
  }
6755
+ /**
6756
+ * Determine if this interceptor can be applied
6757
+ * in the current environment.
6758
+ */
6740
6759
  checkEnvironment() {
6741
6760
  return true;
6742
6761
  }
6762
+ /**
6763
+ * Apply this interceptor to the current process.
6764
+ * Returns an already running interceptor instance if it's present.
6765
+ */
6743
6766
  apply() {
6744
6767
  const logger = this.logger.extend("apply");
6745
6768
  logger.info("applying the interceptor...");
@@ -6774,8 +6797,16 @@ If this message still persists after updating, please report an issue: https://g
6774
6797
  this.setInstance();
6775
6798
  this.readyState = "APPLIED";
6776
6799
  }
6800
+ /**
6801
+ * Setup the module augments and stubs necessary for this interceptor.
6802
+ * This method is not run if there's a running interceptor instance
6803
+ * to prevent instantiating an interceptor multiple times.
6804
+ */
6777
6805
  setup() {
6778
6806
  }
6807
+ /**
6808
+ * Listen to the interceptor's public events.
6809
+ */
6779
6810
  on(eventName, listener) {
6780
6811
  const logger = this.logger.extend("on");
6781
6812
  if (this.readyState === "DISPOSING" || this.readyState === "DISPOSED") {
@@ -6785,6 +6816,9 @@ If this message still persists after updating, please report an issue: https://g
6785
6816
  logger.info('adding "%s" event listener:', eventName, listener.name);
6786
6817
  this.emitter.on(eventName, listener);
6787
6818
  }
6819
+ /**
6820
+ * Disposes of any side-effects this interceptor has introduced.
6821
+ */
6788
6822
  dispose() {
6789
6823
  const logger = this.logger.extend("dispose");
6790
6824
  if (this.readyState === "DISPOSED") {
@@ -6812,9 +6846,9 @@ If this message still persists after updating, please report an issue: https://g
6812
6846
  this.readyState = "DISPOSED";
6813
6847
  }
6814
6848
  getInstance() {
6815
- var _a2;
6849
+ var _a3;
6816
6850
  const instance = getGlobalSymbol2(this.symbol);
6817
- this.logger.info("retrieved global instance:", (_a2 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a2.name);
6851
+ this.logger.info("retrieved global instance:", (_a3 = instance == null ? void 0 : instance.constructor) == null ? void 0 : _a3.name);
6818
6852
  return instance;
6819
6853
  }
6820
6854
  setInstance() {
@@ -6827,7 +6861,74 @@ If this message still persists after updating, please report an issue: https://g
6827
6861
  }
6828
6862
  };
6829
6863
 
6830
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-AKTXHQ7X.mjs
6864
+ // node_modules/.pnpm/@open-draft+deferred-promise@2.2.0/node_modules/@open-draft/deferred-promise/build/index.mjs
6865
+ function createDeferredExecutor() {
6866
+ const executor = (resolve, reject) => {
6867
+ executor.state = "pending";
6868
+ executor.resolve = (data) => {
6869
+ if (executor.state !== "pending") {
6870
+ return;
6871
+ }
6872
+ executor.result = data;
6873
+ const onFulfilled = (value) => {
6874
+ executor.state = "fulfilled";
6875
+ return value;
6876
+ };
6877
+ return resolve(
6878
+ data instanceof Promise ? data : Promise.resolve(data).then(onFulfilled)
6879
+ );
6880
+ };
6881
+ executor.reject = (reason) => {
6882
+ if (executor.state !== "pending") {
6883
+ return;
6884
+ }
6885
+ queueMicrotask(() => {
6886
+ executor.state = "rejected";
6887
+ });
6888
+ return reject(executor.rejectionReason = reason);
6889
+ };
6890
+ };
6891
+ return executor;
6892
+ }
6893
+ var _executor, _decorate, decorate_fn, _a2;
6894
+ var DeferredPromise = (_a2 = class extends Promise {
6895
+ constructor(executor = null) {
6896
+ const deferredExecutor = createDeferredExecutor();
6897
+ super((originalResolve, originalReject) => {
6898
+ deferredExecutor(originalResolve, originalReject);
6899
+ executor == null ? void 0 : executor(deferredExecutor.resolve, deferredExecutor.reject);
6900
+ });
6901
+ __privateAdd(this, _decorate);
6902
+ __privateAdd(this, _executor, void 0);
6903
+ __publicField(this, "resolve");
6904
+ __publicField(this, "reject");
6905
+ __privateSet(this, _executor, deferredExecutor);
6906
+ this.resolve = __privateGet(this, _executor).resolve;
6907
+ this.reject = __privateGet(this, _executor).reject;
6908
+ }
6909
+ get state() {
6910
+ return __privateGet(this, _executor).state;
6911
+ }
6912
+ get rejectionReason() {
6913
+ return __privateGet(this, _executor).rejectionReason;
6914
+ }
6915
+ then(onFulfilled, onRejected) {
6916
+ return __privateMethod(this, _decorate, decorate_fn).call(this, super.then(onFulfilled, onRejected));
6917
+ }
6918
+ catch(onRejected) {
6919
+ return __privateMethod(this, _decorate, decorate_fn).call(this, super.catch(onRejected));
6920
+ }
6921
+ finally(onfinally) {
6922
+ return __privateMethod(this, _decorate, decorate_fn).call(this, super.finally(onfinally));
6923
+ }
6924
+ }, _executor = new WeakMap(), _decorate = new WeakSet(), decorate_fn = function(promise) {
6925
+ return Object.defineProperties(promise, {
6926
+ resolve: { configurable: true, value: this.resolve },
6927
+ reject: { configurable: true, value: this.reject }
6928
+ });
6929
+ }, _a2);
6930
+
6931
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-VMXB5F2J.mjs
6831
6932
  var _FetchInterceptor = class extends Interceptor2 {
6832
6933
  constructor() {
6833
6934
  super(_FetchInterceptor.symbol);
@@ -6842,7 +6943,7 @@ If this message still persists after updating, please report an issue: https://g
6842
6943
  'Failed to patch the "fetch" module: already patched.'
6843
6944
  );
6844
6945
  globalThis.fetch = (input, init) => __async(this, null, function* () {
6845
- var _a2;
6946
+ var _a3;
6846
6947
  const requestId = uuidv4();
6847
6948
  const request = new Request(input, init);
6848
6949
  this.logger.info("[%s] %s", request.method, request.url);
@@ -6856,27 +6957,43 @@ If this message still persists after updating, please report an issue: https://g
6856
6957
  requestId
6857
6958
  });
6858
6959
  this.logger.info("awaiting for the mocked response...");
6960
+ const signal = interactiveRequest.signal;
6961
+ const requestAborted = new DeferredPromise();
6962
+ signal.addEventListener(
6963
+ "abort",
6964
+ () => {
6965
+ requestAborted.reject(signal.reason);
6966
+ },
6967
+ { once: true }
6968
+ );
6859
6969
  const resolverResult = yield until(() => __async(this, null, function* () {
6860
- yield this.emitter.untilIdle(
6970
+ const allListenersResolved = this.emitter.untilIdle(
6861
6971
  "request",
6862
6972
  ({ args: [{ requestId: pendingRequestId }] }) => {
6863
6973
  return pendingRequestId === requestId;
6864
6974
  }
6865
6975
  );
6976
+ yield Promise.race([requestAborted, allListenersResolved]);
6866
6977
  this.logger.info("all request listeners have been resolved!");
6867
6978
  const [mockedResponse2] = yield interactiveRequest.respondWith.invoked();
6868
6979
  this.logger.info("event.respondWith called with:", mockedResponse2);
6869
6980
  return mockedResponse2;
6870
6981
  }));
6982
+ if (requestAborted.state === "rejected") {
6983
+ return Promise.reject(requestAborted.rejectionReason);
6984
+ }
6871
6985
  if (resolverResult.error) {
6872
- const error3 = Object.assign(new TypeError("Failed to fetch"), {
6873
- cause: resolverResult.error
6874
- });
6875
- return Promise.reject(error3);
6986
+ return Promise.reject(createNetworkError(resolverResult.error));
6876
6987
  }
6877
6988
  const mockedResponse = resolverResult.data;
6878
- if (mockedResponse && !((_a2 = request.signal) == null ? void 0 : _a2.aborted)) {
6989
+ if (mockedResponse && !((_a3 = request.signal) == null ? void 0 : _a3.aborted)) {
6879
6990
  this.logger.info("received mocked response:", mockedResponse);
6991
+ if (mockedResponse.type === "error") {
6992
+ this.logger.info(
6993
+ "received a network error response, rejecting the request promise..."
6994
+ );
6995
+ return Promise.reject(createNetworkError(mockedResponse));
6996
+ }
6880
6997
  const responseClone = mockedResponse.clone();
6881
6998
  this.emitter.emit("response", {
6882
6999
  response: responseClone,
@@ -6925,2142 +7042,83 @@ If this message still persists after updating, please report an issue: https://g
6925
7042
  };
6926
7043
  var FetchInterceptor = _FetchInterceptor;
6927
7044
  FetchInterceptor.symbol = Symbol("fetch");
7045
+ function createNetworkError(cause) {
7046
+ return Object.assign(new TypeError("Failed to fetch"), {
7047
+ cause
7048
+ });
7049
+ }
6928
7050
 
6929
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-MQA5WAD4.mjs
6930
- var require_shams = __commonJS6({
6931
- "node_modules/has-symbols/shams.js"(exports, module) {
6932
- "use strict";
6933
- module.exports = function hasSymbols() {
6934
- if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
6935
- return false;
6936
- }
6937
- if (typeof Symbol.iterator === "symbol") {
6938
- return true;
6939
- }
6940
- var obj = {};
6941
- var sym = Symbol("test");
6942
- var symObj = Object(sym);
6943
- if (typeof sym === "string") {
6944
- return false;
6945
- }
6946
- if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
6947
- return false;
6948
- }
6949
- if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
6950
- return false;
6951
- }
6952
- var symVal = 42;
6953
- obj[sym] = symVal;
6954
- for (sym in obj) {
6955
- return false;
6956
- }
6957
- if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
6958
- return false;
6959
- }
6960
- if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
6961
- return false;
6962
- }
6963
- var syms = Object.getOwnPropertySymbols(obj);
6964
- if (syms.length !== 1 || syms[0] !== sym) {
6965
- return false;
6966
- }
6967
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
6968
- return false;
6969
- }
6970
- if (typeof Object.getOwnPropertyDescriptor === "function") {
6971
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
6972
- if (descriptor.value !== symVal || descriptor.enumerable !== true) {
6973
- return false;
6974
- }
6975
- }
6976
- return true;
6977
- };
7051
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-7II4SWKS.mjs
7052
+ var encoder2 = new TextEncoder();
7053
+ function encodeBuffer2(text) {
7054
+ return encoder2.encode(text);
7055
+ }
7056
+ function decodeBuffer2(buffer, encoding) {
7057
+ const decoder = new TextDecoder(encoding);
7058
+ return decoder.decode(buffer);
7059
+ }
7060
+ function toArrayBuffer(array) {
7061
+ return array.buffer.slice(
7062
+ array.byteOffset,
7063
+ array.byteOffset + array.byteLength
7064
+ );
7065
+ }
7066
+
7067
+ // node_modules/.pnpm/@mswjs+interceptors@0.25.1/node_modules/@mswjs/interceptors/lib/browser/chunk-ANLPTCZ5.mjs
7068
+ function concatArrayBuffer(left, right) {
7069
+ const result = new Uint8Array(left.byteLength + right.byteLength);
7070
+ result.set(left, 0);
7071
+ result.set(right, left.byteLength);
7072
+ return result;
7073
+ }
7074
+ var EventPolyfill = class {
7075
+ constructor(type, options) {
7076
+ this.AT_TARGET = 0;
7077
+ this.BUBBLING_PHASE = 0;
7078
+ this.CAPTURING_PHASE = 0;
7079
+ this.NONE = 0;
7080
+ this.type = "";
7081
+ this.srcElement = null;
7082
+ this.currentTarget = null;
7083
+ this.eventPhase = 0;
7084
+ this.isTrusted = true;
7085
+ this.composed = false;
7086
+ this.cancelable = true;
7087
+ this.defaultPrevented = false;
7088
+ this.bubbles = true;
7089
+ this.lengthComputable = true;
7090
+ this.loaded = 0;
7091
+ this.total = 0;
7092
+ this.cancelBubble = false;
7093
+ this.returnValue = true;
7094
+ this.type = type;
7095
+ this.target = (options == null ? void 0 : options.target) || null;
7096
+ this.currentTarget = (options == null ? void 0 : options.currentTarget) || null;
7097
+ this.timeStamp = Date.now();
6978
7098
  }
6979
- });
6980
- var require_shams2 = __commonJS6({
6981
- "node_modules/has-tostringtag/shams.js"(exports, module) {
6982
- "use strict";
6983
- var hasSymbols = require_shams();
6984
- module.exports = function hasToStringTagShams() {
6985
- return hasSymbols() && !!Symbol.toStringTag;
6986
- };
7099
+ composedPath() {
7100
+ return [];
6987
7101
  }
6988
- });
6989
- var require_shams3 = __commonJS6({
6990
- "node_modules/call-bind/node_modules/has-symbols/shams.js"(exports, module) {
6991
- "use strict";
6992
- module.exports = function hasSymbols() {
6993
- if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
6994
- return false;
6995
- }
6996
- if (typeof Symbol.iterator === "symbol") {
6997
- return true;
6998
- }
6999
- var obj = {};
7000
- var sym = Symbol("test");
7001
- var symObj = Object(sym);
7002
- if (typeof sym === "string") {
7003
- return false;
7004
- }
7005
- if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
7006
- return false;
7007
- }
7008
- if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
7009
- return false;
7010
- }
7011
- var symVal = 42;
7012
- obj[sym] = symVal;
7013
- for (sym in obj) {
7014
- return false;
7015
- }
7016
- if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
7017
- return false;
7018
- }
7019
- if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
7020
- return false;
7021
- }
7022
- var syms = Object.getOwnPropertySymbols(obj);
7023
- if (syms.length !== 1 || syms[0] !== sym) {
7024
- return false;
7025
- }
7026
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
7027
- return false;
7028
- }
7029
- if (typeof Object.getOwnPropertyDescriptor === "function") {
7030
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
7031
- if (descriptor.value !== symVal || descriptor.enumerable !== true) {
7032
- return false;
7033
- }
7034
- }
7035
- return true;
7036
- };
7102
+ initEvent(type, bubbles, cancelable) {
7103
+ this.type = type;
7104
+ this.bubbles = !!bubbles;
7105
+ this.cancelable = !!cancelable;
7037
7106
  }
7038
- });
7039
- var require_has_symbols = __commonJS6({
7040
- "node_modules/call-bind/node_modules/has-symbols/index.js"(exports, module) {
7041
- "use strict";
7042
- var origSymbol = typeof Symbol !== "undefined" && Symbol;
7043
- var hasSymbolSham = require_shams3();
7044
- module.exports = function hasNativeSymbols() {
7045
- if (typeof origSymbol !== "function") {
7046
- return false;
7047
- }
7048
- if (typeof Symbol !== "function") {
7049
- return false;
7050
- }
7051
- if (typeof origSymbol("foo") !== "symbol") {
7052
- return false;
7053
- }
7054
- if (typeof Symbol("bar") !== "symbol") {
7055
- return false;
7056
- }
7057
- return hasSymbolSham();
7058
- };
7107
+ preventDefault() {
7108
+ this.defaultPrevented = true;
7059
7109
  }
7060
- });
7061
- var require_implementation = __commonJS6({
7062
- "node_modules/function-bind/implementation.js"(exports, module) {
7063
- "use strict";
7064
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
7065
- var slice = Array.prototype.slice;
7066
- var toStr = Object.prototype.toString;
7067
- var funcType = "[object Function]";
7068
- module.exports = function bind(that) {
7069
- var target = this;
7070
- if (typeof target !== "function" || toStr.call(target) !== funcType) {
7071
- throw new TypeError(ERROR_MESSAGE + target);
7072
- }
7073
- var args = slice.call(arguments, 1);
7074
- var bound;
7075
- var binder = function() {
7076
- if (this instanceof bound) {
7077
- var result = target.apply(
7078
- this,
7079
- args.concat(slice.call(arguments))
7080
- );
7081
- if (Object(result) === result) {
7082
- return result;
7083
- }
7084
- return this;
7085
- } else {
7086
- return target.apply(
7087
- that,
7088
- args.concat(slice.call(arguments))
7089
- );
7090
- }
7091
- };
7092
- var boundLength = Math.max(0, target.length - args.length);
7093
- var boundArgs = [];
7094
- for (var i = 0; i < boundLength; i++) {
7095
- boundArgs.push("$" + i);
7096
- }
7097
- bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder);
7098
- if (target.prototype) {
7099
- var Empty = function Empty2() {
7100
- };
7101
- Empty.prototype = target.prototype;
7102
- bound.prototype = new Empty();
7103
- Empty.prototype = null;
7104
- }
7105
- return bound;
7106
- };
7110
+ stopPropagation() {
7107
7111
  }
7108
- });
7109
- var require_function_bind = __commonJS6({
7110
- "node_modules/function-bind/index.js"(exports, module) {
7111
- "use strict";
7112
- var implementation = require_implementation();
7113
- module.exports = Function.prototype.bind || implementation;
7112
+ stopImmediatePropagation() {
7114
7113
  }
7115
- });
7116
- var require_src = __commonJS6({
7117
- "node_modules/has/src/index.js"(exports, module) {
7118
- "use strict";
7119
- var bind = require_function_bind();
7120
- module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
7121
- }
7122
- });
7123
- var require_get_intrinsic = __commonJS6({
7124
- "node_modules/call-bind/node_modules/get-intrinsic/index.js"(exports, module) {
7125
- "use strict";
7126
- var undefined2;
7127
- var $SyntaxError = SyntaxError;
7128
- var $Function = Function;
7129
- var $TypeError = TypeError;
7130
- var getEvalledConstructor = function(expressionSyntax) {
7131
- try {
7132
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
7133
- } catch (e) {
7134
- }
7135
- };
7136
- var $gOPD = Object.getOwnPropertyDescriptor;
7137
- if ($gOPD) {
7138
- try {
7139
- $gOPD({}, "");
7140
- } catch (e) {
7141
- $gOPD = null;
7142
- }
7143
- }
7144
- var throwTypeError = function() {
7145
- throw new $TypeError();
7146
- };
7147
- var ThrowTypeError = $gOPD ? function() {
7148
- try {
7149
- arguments.callee;
7150
- return throwTypeError;
7151
- } catch (calleeThrows) {
7152
- try {
7153
- return $gOPD(arguments, "callee").get;
7154
- } catch (gOPDthrows) {
7155
- return throwTypeError;
7156
- }
7157
- }
7158
- }() : throwTypeError;
7159
- var hasSymbols = require_has_symbols()();
7160
- var getProto = Object.getPrototypeOf || function(x) {
7161
- return x.__proto__;
7162
- };
7163
- var needsEval = {};
7164
- var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array);
7165
- var INTRINSICS = {
7166
- "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
7167
- "%Array%": Array,
7168
- "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
7169
- "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,
7170
- "%AsyncFromSyncIteratorPrototype%": undefined2,
7171
- "%AsyncFunction%": needsEval,
7172
- "%AsyncGenerator%": needsEval,
7173
- "%AsyncGeneratorFunction%": needsEval,
7174
- "%AsyncIteratorPrototype%": needsEval,
7175
- "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
7176
- "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
7177
- "%Boolean%": Boolean,
7178
- "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
7179
- "%Date%": Date,
7180
- "%decodeURI%": decodeURI,
7181
- "%decodeURIComponent%": decodeURIComponent,
7182
- "%encodeURI%": encodeURI,
7183
- "%encodeURIComponent%": encodeURIComponent,
7184
- "%Error%": Error,
7185
- "%eval%": eval,
7186
- "%EvalError%": EvalError,
7187
- "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
7188
- "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
7189
- "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
7190
- "%Function%": $Function,
7191
- "%GeneratorFunction%": needsEval,
7192
- "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
7193
- "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
7194
- "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
7195
- "%isFinite%": isFinite,
7196
- "%isNaN%": isNaN,
7197
- "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,
7198
- "%JSON%": typeof JSON === "object" ? JSON : undefined2,
7199
- "%Map%": typeof Map === "undefined" ? undefined2 : Map,
7200
- "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
7201
- "%Math%": Math,
7202
- "%Number%": Number,
7203
- "%Object%": Object,
7204
- "%parseFloat%": parseFloat,
7205
- "%parseInt%": parseInt,
7206
- "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
7207
- "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
7208
- "%RangeError%": RangeError,
7209
- "%ReferenceError%": ReferenceError,
7210
- "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
7211
- "%RegExp%": RegExp,
7212
- "%Set%": typeof Set === "undefined" ? undefined2 : Set,
7213
- "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
7214
- "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
7215
- "%String%": String,
7216
- "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2,
7217
- "%Symbol%": hasSymbols ? Symbol : undefined2,
7218
- "%SyntaxError%": $SyntaxError,
7219
- "%ThrowTypeError%": ThrowTypeError,
7220
- "%TypedArray%": TypedArray,
7221
- "%TypeError%": $TypeError,
7222
- "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
7223
- "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
7224
- "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
7225
- "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
7226
- "%URIError%": URIError,
7227
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
7228
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
7229
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
7230
- };
7231
- var doEval = function doEval2(name) {
7232
- var value;
7233
- if (name === "%AsyncFunction%") {
7234
- value = getEvalledConstructor("async function () {}");
7235
- } else if (name === "%GeneratorFunction%") {
7236
- value = getEvalledConstructor("function* () {}");
7237
- } else if (name === "%AsyncGeneratorFunction%") {
7238
- value = getEvalledConstructor("async function* () {}");
7239
- } else if (name === "%AsyncGenerator%") {
7240
- var fn = doEval2("%AsyncGeneratorFunction%");
7241
- if (fn) {
7242
- value = fn.prototype;
7243
- }
7244
- } else if (name === "%AsyncIteratorPrototype%") {
7245
- var gen = doEval2("%AsyncGenerator%");
7246
- if (gen) {
7247
- value = getProto(gen.prototype);
7248
- }
7249
- }
7250
- INTRINSICS[name] = value;
7251
- return value;
7252
- };
7253
- var LEGACY_ALIASES = {
7254
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
7255
- "%ArrayPrototype%": ["Array", "prototype"],
7256
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
7257
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
7258
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
7259
- "%ArrayProto_values%": ["Array", "prototype", "values"],
7260
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
7261
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
7262
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
7263
- "%BooleanPrototype%": ["Boolean", "prototype"],
7264
- "%DataViewPrototype%": ["DataView", "prototype"],
7265
- "%DatePrototype%": ["Date", "prototype"],
7266
- "%ErrorPrototype%": ["Error", "prototype"],
7267
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
7268
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
7269
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
7270
- "%FunctionPrototype%": ["Function", "prototype"],
7271
- "%Generator%": ["GeneratorFunction", "prototype"],
7272
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
7273
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
7274
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
7275
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
7276
- "%JSONParse%": ["JSON", "parse"],
7277
- "%JSONStringify%": ["JSON", "stringify"],
7278
- "%MapPrototype%": ["Map", "prototype"],
7279
- "%NumberPrototype%": ["Number", "prototype"],
7280
- "%ObjectPrototype%": ["Object", "prototype"],
7281
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
7282
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
7283
- "%PromisePrototype%": ["Promise", "prototype"],
7284
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
7285
- "%Promise_all%": ["Promise", "all"],
7286
- "%Promise_reject%": ["Promise", "reject"],
7287
- "%Promise_resolve%": ["Promise", "resolve"],
7288
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
7289
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
7290
- "%RegExpPrototype%": ["RegExp", "prototype"],
7291
- "%SetPrototype%": ["Set", "prototype"],
7292
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
7293
- "%StringPrototype%": ["String", "prototype"],
7294
- "%SymbolPrototype%": ["Symbol", "prototype"],
7295
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
7296
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
7297
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
7298
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
7299
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
7300
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
7301
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
7302
- "%URIErrorPrototype%": ["URIError", "prototype"],
7303
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
7304
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
7305
- };
7306
- var bind = require_function_bind();
7307
- var hasOwn = require_src();
7308
- var $concat = bind.call(Function.call, Array.prototype.concat);
7309
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
7310
- var $replace = bind.call(Function.call, String.prototype.replace);
7311
- var $strSlice = bind.call(Function.call, String.prototype.slice);
7312
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
7313
- var reEscapeChar = /\\(\\)?/g;
7314
- var stringToPath = function stringToPath2(string) {
7315
- var first = $strSlice(string, 0, 1);
7316
- var last = $strSlice(string, -1);
7317
- if (first === "%" && last !== "%") {
7318
- throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
7319
- } else if (last === "%" && first !== "%") {
7320
- throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
7321
- }
7322
- var result = [];
7323
- $replace(string, rePropName, function(match2, number, quote, subString) {
7324
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match2;
7325
- });
7326
- return result;
7327
- };
7328
- var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
7329
- var intrinsicName = name;
7330
- var alias;
7331
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
7332
- alias = LEGACY_ALIASES[intrinsicName];
7333
- intrinsicName = "%" + alias[0] + "%";
7334
- }
7335
- if (hasOwn(INTRINSICS, intrinsicName)) {
7336
- var value = INTRINSICS[intrinsicName];
7337
- if (value === needsEval) {
7338
- value = doEval(intrinsicName);
7339
- }
7340
- if (typeof value === "undefined" && !allowMissing) {
7341
- throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
7342
- }
7343
- return {
7344
- alias,
7345
- name: intrinsicName,
7346
- value
7347
- };
7348
- }
7349
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
7350
- };
7351
- module.exports = function GetIntrinsic(name, allowMissing) {
7352
- if (typeof name !== "string" || name.length === 0) {
7353
- throw new $TypeError("intrinsic name must be a non-empty string");
7354
- }
7355
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
7356
- throw new $TypeError('"allowMissing" argument must be a boolean');
7357
- }
7358
- var parts = stringToPath(name);
7359
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
7360
- var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
7361
- var intrinsicRealName = intrinsic.name;
7362
- var value = intrinsic.value;
7363
- var skipFurtherCaching = false;
7364
- var alias = intrinsic.alias;
7365
- if (alias) {
7366
- intrinsicBaseName = alias[0];
7367
- $spliceApply(parts, $concat([0, 1], alias));
7368
- }
7369
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
7370
- var part = parts[i];
7371
- var first = $strSlice(part, 0, 1);
7372
- var last = $strSlice(part, -1);
7373
- if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
7374
- throw new $SyntaxError("property names with quotes must have matching quotes");
7375
- }
7376
- if (part === "constructor" || !isOwn) {
7377
- skipFurtherCaching = true;
7378
- }
7379
- intrinsicBaseName += "." + part;
7380
- intrinsicRealName = "%" + intrinsicBaseName + "%";
7381
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
7382
- value = INTRINSICS[intrinsicRealName];
7383
- } else if (value != null) {
7384
- if (!(part in value)) {
7385
- if (!allowMissing) {
7386
- throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
7387
- }
7388
- return void 0;
7389
- }
7390
- if ($gOPD && i + 1 >= parts.length) {
7391
- var desc = $gOPD(value, part);
7392
- isOwn = !!desc;
7393
- if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
7394
- value = desc.get;
7395
- } else {
7396
- value = value[part];
7397
- }
7398
- } else {
7399
- isOwn = hasOwn(value, part);
7400
- value = value[part];
7401
- }
7402
- if (isOwn && !skipFurtherCaching) {
7403
- INTRINSICS[intrinsicRealName] = value;
7404
- }
7405
- }
7406
- }
7407
- return value;
7408
- };
7409
- }
7410
- });
7411
- var require_call_bind = __commonJS6({
7412
- "node_modules/call-bind/index.js"(exports, module) {
7413
- "use strict";
7414
- var bind = require_function_bind();
7415
- var GetIntrinsic = require_get_intrinsic();
7416
- var $apply = GetIntrinsic("%Function.prototype.apply%");
7417
- var $call = GetIntrinsic("%Function.prototype.call%");
7418
- var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
7419
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
7420
- var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
7421
- var $max = GetIntrinsic("%Math.max%");
7422
- if ($defineProperty) {
7423
- try {
7424
- $defineProperty({}, "a", { value: 1 });
7425
- } catch (e) {
7426
- $defineProperty = null;
7427
- }
7428
- }
7429
- module.exports = function callBind(originalFunction) {
7430
- var func = $reflectApply(bind, $call, arguments);
7431
- if ($gOPD && $defineProperty) {
7432
- var desc = $gOPD(func, "length");
7433
- if (desc.configurable) {
7434
- $defineProperty(
7435
- func,
7436
- "length",
7437
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
7438
- );
7439
- }
7440
- }
7441
- return func;
7442
- };
7443
- var applyBind = function applyBind2() {
7444
- return $reflectApply(bind, $apply, arguments);
7445
- };
7446
- if ($defineProperty) {
7447
- $defineProperty(module.exports, "apply", { value: applyBind });
7448
- } else {
7449
- module.exports.apply = applyBind;
7450
- }
7451
- }
7452
- });
7453
- var require_callBound = __commonJS6({
7454
- "node_modules/call-bind/callBound.js"(exports, module) {
7455
- "use strict";
7456
- var GetIntrinsic = require_get_intrinsic();
7457
- var callBind = require_call_bind();
7458
- var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
7459
- module.exports = function callBoundIntrinsic(name, allowMissing) {
7460
- var intrinsic = GetIntrinsic(name, !!allowMissing);
7461
- if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
7462
- return callBind(intrinsic);
7463
- }
7464
- return intrinsic;
7465
- };
7466
- }
7467
- });
7468
- var require_is_arguments = __commonJS6({
7469
- "node_modules/is-arguments/index.js"(exports, module) {
7470
- "use strict";
7471
- var hasToStringTag = require_shams2()();
7472
- var callBound = require_callBound();
7473
- var $toString = callBound("Object.prototype.toString");
7474
- var isStandardArguments = function isArguments(value) {
7475
- if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
7476
- return false;
7477
- }
7478
- return $toString(value) === "[object Arguments]";
7479
- };
7480
- var isLegacyArguments = function isArguments(value) {
7481
- if (isStandardArguments(value)) {
7482
- return true;
7483
- }
7484
- return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]";
7485
- };
7486
- var supportsStandardArguments = function() {
7487
- return isStandardArguments(arguments);
7488
- }();
7489
- isStandardArguments.isLegacyArguments = isLegacyArguments;
7490
- module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
7491
- }
7492
- });
7493
- var require_is_generator_function = __commonJS6({
7494
- "node_modules/is-generator-function/index.js"(exports, module) {
7495
- "use strict";
7496
- var toStr = Object.prototype.toString;
7497
- var fnToStr = Function.prototype.toString;
7498
- var isFnRegex = /^\s*(?:function)?\*/;
7499
- var hasToStringTag = require_shams2()();
7500
- var getProto = Object.getPrototypeOf;
7501
- var getGeneratorFunc = function() {
7502
- if (!hasToStringTag) {
7503
- return false;
7504
- }
7505
- try {
7506
- return Function("return function*() {}")();
7507
- } catch (e) {
7508
- }
7509
- };
7510
- var GeneratorFunction;
7511
- module.exports = function isGeneratorFunction(fn) {
7512
- if (typeof fn !== "function") {
7513
- return false;
7514
- }
7515
- if (isFnRegex.test(fnToStr.call(fn))) {
7516
- return true;
7517
- }
7518
- if (!hasToStringTag) {
7519
- var str = toStr.call(fn);
7520
- return str === "[object GeneratorFunction]";
7521
- }
7522
- if (!getProto) {
7523
- return false;
7524
- }
7525
- if (typeof GeneratorFunction === "undefined") {
7526
- var generatorFunc = getGeneratorFunc();
7527
- GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;
7528
- }
7529
- return getProto(fn) === GeneratorFunction;
7530
- };
7531
- }
7532
- });
7533
- var require_is_callable = __commonJS6({
7534
- "node_modules/is-callable/index.js"(exports, module) {
7535
- "use strict";
7536
- var fnToStr = Function.prototype.toString;
7537
- var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply;
7538
- var badArrayLike;
7539
- var isCallableMarker;
7540
- if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") {
7541
- try {
7542
- badArrayLike = Object.defineProperty({}, "length", {
7543
- get: function() {
7544
- throw isCallableMarker;
7545
- }
7546
- });
7547
- isCallableMarker = {};
7548
- reflectApply(function() {
7549
- throw 42;
7550
- }, null, badArrayLike);
7551
- } catch (_) {
7552
- if (_ !== isCallableMarker) {
7553
- reflectApply = null;
7554
- }
7555
- }
7556
- } else {
7557
- reflectApply = null;
7558
- }
7559
- var constructorRegex = /^\s*class\b/;
7560
- var isES6ClassFn = function isES6ClassFunction(value) {
7561
- try {
7562
- var fnStr = fnToStr.call(value);
7563
- return constructorRegex.test(fnStr);
7564
- } catch (e) {
7565
- return false;
7566
- }
7567
- };
7568
- var tryFunctionObject = function tryFunctionToStr(value) {
7569
- try {
7570
- if (isES6ClassFn(value)) {
7571
- return false;
7572
- }
7573
- fnToStr.call(value);
7574
- return true;
7575
- } catch (e) {
7576
- return false;
7577
- }
7578
- };
7579
- var toStr = Object.prototype.toString;
7580
- var fnClass = "[object Function]";
7581
- var genClass = "[object GeneratorFunction]";
7582
- var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag;
7583
- var documentDotAll = typeof document === "object" && typeof document.all === "undefined" && document.all !== void 0 ? document.all : {};
7584
- module.exports = reflectApply ? function isCallable(value) {
7585
- if (value === documentDotAll) {
7586
- return true;
7587
- }
7588
- if (!value) {
7589
- return false;
7590
- }
7591
- if (typeof value !== "function" && typeof value !== "object") {
7592
- return false;
7593
- }
7594
- if (typeof value === "function" && !value.prototype) {
7595
- return true;
7596
- }
7597
- try {
7598
- reflectApply(value, null, badArrayLike);
7599
- } catch (e) {
7600
- if (e !== isCallableMarker) {
7601
- return false;
7602
- }
7603
- }
7604
- return !isES6ClassFn(value);
7605
- } : function isCallable(value) {
7606
- if (value === documentDotAll) {
7607
- return true;
7608
- }
7609
- if (!value) {
7610
- return false;
7611
- }
7612
- if (typeof value !== "function" && typeof value !== "object") {
7613
- return false;
7614
- }
7615
- if (typeof value === "function" && !value.prototype) {
7616
- return true;
7617
- }
7618
- if (hasToStringTag) {
7619
- return tryFunctionObject(value);
7620
- }
7621
- if (isES6ClassFn(value)) {
7622
- return false;
7623
- }
7624
- var strClass = toStr.call(value);
7625
- return strClass === fnClass || strClass === genClass;
7626
- };
7627
- }
7628
- });
7629
- var require_for_each = __commonJS6({
7630
- "node_modules/for-each/index.js"(exports, module) {
7631
- "use strict";
7632
- var isCallable = require_is_callable();
7633
- var toStr = Object.prototype.toString;
7634
- var hasOwnProperty = Object.prototype.hasOwnProperty;
7635
- var forEachArray = function forEachArray2(array, iterator, receiver) {
7636
- for (var i = 0, len = array.length; i < len; i++) {
7637
- if (hasOwnProperty.call(array, i)) {
7638
- if (receiver == null) {
7639
- iterator(array[i], i, array);
7640
- } else {
7641
- iterator.call(receiver, array[i], i, array);
7642
- }
7643
- }
7644
- }
7645
- };
7646
- var forEachString = function forEachString2(string, iterator, receiver) {
7647
- for (var i = 0, len = string.length; i < len; i++) {
7648
- if (receiver == null) {
7649
- iterator(string.charAt(i), i, string);
7650
- } else {
7651
- iterator.call(receiver, string.charAt(i), i, string);
7652
- }
7653
- }
7654
- };
7655
- var forEachObject = function forEachObject2(object, iterator, receiver) {
7656
- for (var k in object) {
7657
- if (hasOwnProperty.call(object, k)) {
7658
- if (receiver == null) {
7659
- iterator(object[k], k, object);
7660
- } else {
7661
- iterator.call(receiver, object[k], k, object);
7662
- }
7663
- }
7664
- }
7665
- };
7666
- var forEach = function forEach2(list, iterator, thisArg) {
7667
- if (!isCallable(iterator)) {
7668
- throw new TypeError("iterator must be a function");
7669
- }
7670
- var receiver;
7671
- if (arguments.length >= 3) {
7672
- receiver = thisArg;
7673
- }
7674
- if (toStr.call(list) === "[object Array]") {
7675
- forEachArray(list, iterator, receiver);
7676
- } else if (typeof list === "string") {
7677
- forEachString(list, iterator, receiver);
7678
- } else {
7679
- forEachObject(list, iterator, receiver);
7680
- }
7681
- };
7682
- module.exports = forEach;
7683
- }
7684
- });
7685
- var require_available_typed_arrays = __commonJS6({
7686
- "node_modules/available-typed-arrays/index.js"(exports, module) {
7687
- "use strict";
7688
- var possibleNames = [
7689
- "BigInt64Array",
7690
- "BigUint64Array",
7691
- "Float32Array",
7692
- "Float64Array",
7693
- "Int16Array",
7694
- "Int32Array",
7695
- "Int8Array",
7696
- "Uint16Array",
7697
- "Uint32Array",
7698
- "Uint8Array",
7699
- "Uint8ClampedArray"
7700
- ];
7701
- var g = typeof globalThis === "undefined" ? global : globalThis;
7702
- module.exports = function availableTypedArrays() {
7703
- var out = [];
7704
- for (var i = 0; i < possibleNames.length; i++) {
7705
- if (typeof g[possibleNames[i]] === "function") {
7706
- out[out.length] = possibleNames[i];
7707
- }
7708
- }
7709
- return out;
7710
- };
7711
- }
7712
- });
7713
- var require_has_symbols2 = __commonJS6({
7714
- "node_modules/has-symbols/index.js"(exports, module) {
7715
- "use strict";
7716
- var origSymbol = typeof Symbol !== "undefined" && Symbol;
7717
- var hasSymbolSham = require_shams();
7718
- module.exports = function hasNativeSymbols() {
7719
- if (typeof origSymbol !== "function") {
7720
- return false;
7721
- }
7722
- if (typeof Symbol !== "function") {
7723
- return false;
7724
- }
7725
- if (typeof origSymbol("foo") !== "symbol") {
7726
- return false;
7727
- }
7728
- if (typeof Symbol("bar") !== "symbol") {
7729
- return false;
7730
- }
7731
- return hasSymbolSham();
7732
- };
7733
- }
7734
- });
7735
- var require_get_intrinsic2 = __commonJS6({
7736
- "node_modules/get-intrinsic/index.js"(exports, module) {
7737
- "use strict";
7738
- var undefined2;
7739
- var $SyntaxError = SyntaxError;
7740
- var $Function = Function;
7741
- var $TypeError = TypeError;
7742
- var getEvalledConstructor = function(expressionSyntax) {
7743
- try {
7744
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
7745
- } catch (e) {
7746
- }
7747
- };
7748
- var $gOPD = Object.getOwnPropertyDescriptor;
7749
- if ($gOPD) {
7750
- try {
7751
- $gOPD({}, "");
7752
- } catch (e) {
7753
- $gOPD = null;
7754
- }
7755
- }
7756
- var throwTypeError = function() {
7757
- throw new $TypeError();
7758
- };
7759
- var ThrowTypeError = $gOPD ? function() {
7760
- try {
7761
- arguments.callee;
7762
- return throwTypeError;
7763
- } catch (calleeThrows) {
7764
- try {
7765
- return $gOPD(arguments, "callee").get;
7766
- } catch (gOPDthrows) {
7767
- return throwTypeError;
7768
- }
7769
- }
7770
- }() : throwTypeError;
7771
- var hasSymbols = require_has_symbols2()();
7772
- var getProto = Object.getPrototypeOf || function(x) {
7773
- return x.__proto__;
7774
- };
7775
- var needsEval = {};
7776
- var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array);
7777
- var INTRINSICS = {
7778
- "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
7779
- "%Array%": Array,
7780
- "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
7781
- "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,
7782
- "%AsyncFromSyncIteratorPrototype%": undefined2,
7783
- "%AsyncFunction%": needsEval,
7784
- "%AsyncGenerator%": needsEval,
7785
- "%AsyncGeneratorFunction%": needsEval,
7786
- "%AsyncIteratorPrototype%": needsEval,
7787
- "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
7788
- "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
7789
- "%Boolean%": Boolean,
7790
- "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
7791
- "%Date%": Date,
7792
- "%decodeURI%": decodeURI,
7793
- "%decodeURIComponent%": decodeURIComponent,
7794
- "%encodeURI%": encodeURI,
7795
- "%encodeURIComponent%": encodeURIComponent,
7796
- "%Error%": Error,
7797
- "%eval%": eval,
7798
- "%EvalError%": EvalError,
7799
- "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
7800
- "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
7801
- "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
7802
- "%Function%": $Function,
7803
- "%GeneratorFunction%": needsEval,
7804
- "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
7805
- "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
7806
- "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
7807
- "%isFinite%": isFinite,
7808
- "%isNaN%": isNaN,
7809
- "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,
7810
- "%JSON%": typeof JSON === "object" ? JSON : undefined2,
7811
- "%Map%": typeof Map === "undefined" ? undefined2 : Map,
7812
- "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
7813
- "%Math%": Math,
7814
- "%Number%": Number,
7815
- "%Object%": Object,
7816
- "%parseFloat%": parseFloat,
7817
- "%parseInt%": parseInt,
7818
- "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
7819
- "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
7820
- "%RangeError%": RangeError,
7821
- "%ReferenceError%": ReferenceError,
7822
- "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
7823
- "%RegExp%": RegExp,
7824
- "%Set%": typeof Set === "undefined" ? undefined2 : Set,
7825
- "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
7826
- "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
7827
- "%String%": String,
7828
- "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2,
7829
- "%Symbol%": hasSymbols ? Symbol : undefined2,
7830
- "%SyntaxError%": $SyntaxError,
7831
- "%ThrowTypeError%": ThrowTypeError,
7832
- "%TypedArray%": TypedArray,
7833
- "%TypeError%": $TypeError,
7834
- "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
7835
- "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
7836
- "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
7837
- "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
7838
- "%URIError%": URIError,
7839
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
7840
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
7841
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
7842
- };
7843
- var doEval = function doEval2(name) {
7844
- var value;
7845
- if (name === "%AsyncFunction%") {
7846
- value = getEvalledConstructor("async function () {}");
7847
- } else if (name === "%GeneratorFunction%") {
7848
- value = getEvalledConstructor("function* () {}");
7849
- } else if (name === "%AsyncGeneratorFunction%") {
7850
- value = getEvalledConstructor("async function* () {}");
7851
- } else if (name === "%AsyncGenerator%") {
7852
- var fn = doEval2("%AsyncGeneratorFunction%");
7853
- if (fn) {
7854
- value = fn.prototype;
7855
- }
7856
- } else if (name === "%AsyncIteratorPrototype%") {
7857
- var gen = doEval2("%AsyncGenerator%");
7858
- if (gen) {
7859
- value = getProto(gen.prototype);
7860
- }
7861
- }
7862
- INTRINSICS[name] = value;
7863
- return value;
7864
- };
7865
- var LEGACY_ALIASES = {
7866
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
7867
- "%ArrayPrototype%": ["Array", "prototype"],
7868
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
7869
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
7870
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
7871
- "%ArrayProto_values%": ["Array", "prototype", "values"],
7872
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
7873
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
7874
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
7875
- "%BooleanPrototype%": ["Boolean", "prototype"],
7876
- "%DataViewPrototype%": ["DataView", "prototype"],
7877
- "%DatePrototype%": ["Date", "prototype"],
7878
- "%ErrorPrototype%": ["Error", "prototype"],
7879
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
7880
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
7881
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
7882
- "%FunctionPrototype%": ["Function", "prototype"],
7883
- "%Generator%": ["GeneratorFunction", "prototype"],
7884
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
7885
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
7886
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
7887
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
7888
- "%JSONParse%": ["JSON", "parse"],
7889
- "%JSONStringify%": ["JSON", "stringify"],
7890
- "%MapPrototype%": ["Map", "prototype"],
7891
- "%NumberPrototype%": ["Number", "prototype"],
7892
- "%ObjectPrototype%": ["Object", "prototype"],
7893
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
7894
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
7895
- "%PromisePrototype%": ["Promise", "prototype"],
7896
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
7897
- "%Promise_all%": ["Promise", "all"],
7898
- "%Promise_reject%": ["Promise", "reject"],
7899
- "%Promise_resolve%": ["Promise", "resolve"],
7900
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
7901
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
7902
- "%RegExpPrototype%": ["RegExp", "prototype"],
7903
- "%SetPrototype%": ["Set", "prototype"],
7904
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
7905
- "%StringPrototype%": ["String", "prototype"],
7906
- "%SymbolPrototype%": ["Symbol", "prototype"],
7907
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
7908
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
7909
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
7910
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
7911
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
7912
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
7913
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
7914
- "%URIErrorPrototype%": ["URIError", "prototype"],
7915
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
7916
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
7917
- };
7918
- var bind = require_function_bind();
7919
- var hasOwn = require_src();
7920
- var $concat = bind.call(Function.call, Array.prototype.concat);
7921
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
7922
- var $replace = bind.call(Function.call, String.prototype.replace);
7923
- var $strSlice = bind.call(Function.call, String.prototype.slice);
7924
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
7925
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
7926
- var reEscapeChar = /\\(\\)?/g;
7927
- var stringToPath = function stringToPath2(string) {
7928
- var first = $strSlice(string, 0, 1);
7929
- var last = $strSlice(string, -1);
7930
- if (first === "%" && last !== "%") {
7931
- throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
7932
- } else if (last === "%" && first !== "%") {
7933
- throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
7934
- }
7935
- var result = [];
7936
- $replace(string, rePropName, function(match2, number, quote, subString) {
7937
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match2;
7938
- });
7939
- return result;
7940
- };
7941
- var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
7942
- var intrinsicName = name;
7943
- var alias;
7944
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
7945
- alias = LEGACY_ALIASES[intrinsicName];
7946
- intrinsicName = "%" + alias[0] + "%";
7947
- }
7948
- if (hasOwn(INTRINSICS, intrinsicName)) {
7949
- var value = INTRINSICS[intrinsicName];
7950
- if (value === needsEval) {
7951
- value = doEval(intrinsicName);
7952
- }
7953
- if (typeof value === "undefined" && !allowMissing) {
7954
- throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
7955
- }
7956
- return {
7957
- alias,
7958
- name: intrinsicName,
7959
- value
7960
- };
7961
- }
7962
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
7963
- };
7964
- module.exports = function GetIntrinsic(name, allowMissing) {
7965
- if (typeof name !== "string" || name.length === 0) {
7966
- throw new $TypeError("intrinsic name must be a non-empty string");
7967
- }
7968
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
7969
- throw new $TypeError('"allowMissing" argument must be a boolean');
7970
- }
7971
- if ($exec(/^%?[^%]*%?$/g, name) === null) {
7972
- throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
7973
- }
7974
- var parts = stringToPath(name);
7975
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
7976
- var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
7977
- var intrinsicRealName = intrinsic.name;
7978
- var value = intrinsic.value;
7979
- var skipFurtherCaching = false;
7980
- var alias = intrinsic.alias;
7981
- if (alias) {
7982
- intrinsicBaseName = alias[0];
7983
- $spliceApply(parts, $concat([0, 1], alias));
7984
- }
7985
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
7986
- var part = parts[i];
7987
- var first = $strSlice(part, 0, 1);
7988
- var last = $strSlice(part, -1);
7989
- if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
7990
- throw new $SyntaxError("property names with quotes must have matching quotes");
7991
- }
7992
- if (part === "constructor" || !isOwn) {
7993
- skipFurtherCaching = true;
7994
- }
7995
- intrinsicBaseName += "." + part;
7996
- intrinsicRealName = "%" + intrinsicBaseName + "%";
7997
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
7998
- value = INTRINSICS[intrinsicRealName];
7999
- } else if (value != null) {
8000
- if (!(part in value)) {
8001
- if (!allowMissing) {
8002
- throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
8003
- }
8004
- return void 0;
8005
- }
8006
- if ($gOPD && i + 1 >= parts.length) {
8007
- var desc = $gOPD(value, part);
8008
- isOwn = !!desc;
8009
- if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
8010
- value = desc.get;
8011
- } else {
8012
- value = value[part];
8013
- }
8014
- } else {
8015
- isOwn = hasOwn(value, part);
8016
- value = value[part];
8017
- }
8018
- if (isOwn && !skipFurtherCaching) {
8019
- INTRINSICS[intrinsicRealName] = value;
8020
- }
8021
- }
8022
- }
8023
- return value;
8024
- };
8025
- }
8026
- });
8027
- var require_getOwnPropertyDescriptor = __commonJS6({
8028
- "node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js"(exports, module) {
8029
- "use strict";
8030
- var GetIntrinsic = require_get_intrinsic2();
8031
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
8032
- if ($gOPD) {
8033
- try {
8034
- $gOPD([], "length");
8035
- } catch (e) {
8036
- $gOPD = null;
8037
- }
8038
- }
8039
- module.exports = $gOPD;
8040
- }
8041
- });
8042
- var require_is_typed_array = __commonJS6({
8043
- "node_modules/is-typed-array/index.js"(exports, module) {
8044
- "use strict";
8045
- var forEach = require_for_each();
8046
- var availableTypedArrays = require_available_typed_arrays();
8047
- var callBound = require_callBound();
8048
- var $toString = callBound("Object.prototype.toString");
8049
- var hasToStringTag = require_shams2()();
8050
- var g = typeof globalThis === "undefined" ? global : globalThis;
8051
- var typedArrays = availableTypedArrays();
8052
- var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) {
8053
- for (var i = 0; i < array.length; i += 1) {
8054
- if (array[i] === value) {
8055
- return i;
8056
- }
8057
- }
8058
- return -1;
8059
- };
8060
- var $slice = callBound("String.prototype.slice");
8061
- var toStrTags = {};
8062
- var gOPD = require_getOwnPropertyDescriptor();
8063
- var getPrototypeOf = Object.getPrototypeOf;
8064
- if (hasToStringTag && gOPD && getPrototypeOf) {
8065
- forEach(typedArrays, function(typedArray) {
8066
- var arr = new g[typedArray]();
8067
- if (Symbol.toStringTag in arr) {
8068
- var proto = getPrototypeOf(arr);
8069
- var descriptor = gOPD(proto, Symbol.toStringTag);
8070
- if (!descriptor) {
8071
- var superProto = getPrototypeOf(proto);
8072
- descriptor = gOPD(superProto, Symbol.toStringTag);
8073
- }
8074
- toStrTags[typedArray] = descriptor.get;
8075
- }
8076
- });
8077
- }
8078
- var tryTypedArrays = function tryAllTypedArrays(value) {
8079
- var anyTrue = false;
8080
- forEach(toStrTags, function(getter, typedArray) {
8081
- if (!anyTrue) {
8082
- try {
8083
- anyTrue = getter.call(value) === typedArray;
8084
- } catch (e) {
8085
- }
8086
- }
8087
- });
8088
- return anyTrue;
8089
- };
8090
- module.exports = function isTypedArray(value) {
8091
- if (!value || typeof value !== "object") {
8092
- return false;
8093
- }
8094
- if (!hasToStringTag || !(Symbol.toStringTag in value)) {
8095
- var tag = $slice($toString(value), 8, -1);
8096
- return $indexOf(typedArrays, tag) > -1;
8097
- }
8098
- if (!gOPD) {
8099
- return false;
8100
- }
8101
- return tryTypedArrays(value);
8102
- };
8103
- }
8104
- });
8105
- var require_which_typed_array = __commonJS6({
8106
- "node_modules/which-typed-array/index.js"(exports, module) {
8107
- "use strict";
8108
- var forEach = require_for_each();
8109
- var availableTypedArrays = require_available_typed_arrays();
8110
- var callBound = require_callBound();
8111
- var $toString = callBound("Object.prototype.toString");
8112
- var hasToStringTag = require_shams2()();
8113
- var g = typeof globalThis === "undefined" ? global : globalThis;
8114
- var typedArrays = availableTypedArrays();
8115
- var $slice = callBound("String.prototype.slice");
8116
- var toStrTags = {};
8117
- var gOPD = require_getOwnPropertyDescriptor();
8118
- var getPrototypeOf = Object.getPrototypeOf;
8119
- if (hasToStringTag && gOPD && getPrototypeOf) {
8120
- forEach(typedArrays, function(typedArray) {
8121
- if (typeof g[typedArray] === "function") {
8122
- var arr = new g[typedArray]();
8123
- if (Symbol.toStringTag in arr) {
8124
- var proto = getPrototypeOf(arr);
8125
- var descriptor = gOPD(proto, Symbol.toStringTag);
8126
- if (!descriptor) {
8127
- var superProto = getPrototypeOf(proto);
8128
- descriptor = gOPD(superProto, Symbol.toStringTag);
8129
- }
8130
- toStrTags[typedArray] = descriptor.get;
8131
- }
8132
- }
8133
- });
8134
- }
8135
- var tryTypedArrays = function tryAllTypedArrays(value) {
8136
- var foundName = false;
8137
- forEach(toStrTags, function(getter, typedArray) {
8138
- if (!foundName) {
8139
- try {
8140
- var name = getter.call(value);
8141
- if (name === typedArray) {
8142
- foundName = name;
8143
- }
8144
- } catch (e) {
8145
- }
8146
- }
8147
- });
8148
- return foundName;
8149
- };
8150
- var isTypedArray = require_is_typed_array();
8151
- module.exports = function whichTypedArray(value) {
8152
- if (!isTypedArray(value)) {
8153
- return false;
8154
- }
8155
- if (!hasToStringTag || !(Symbol.toStringTag in value)) {
8156
- return $slice($toString(value), 8, -1);
8157
- }
8158
- return tryTypedArrays(value);
8159
- };
8160
- }
8161
- });
8162
- var require_types = __commonJS6({
8163
- "node_modules/util/support/types.js"(exports) {
8164
- "use strict";
8165
- var isArgumentsObject = require_is_arguments();
8166
- var isGeneratorFunction = require_is_generator_function();
8167
- var whichTypedArray = require_which_typed_array();
8168
- var isTypedArray = require_is_typed_array();
8169
- function uncurryThis(f) {
8170
- return f.call.bind(f);
8171
- }
8172
- var BigIntSupported = typeof BigInt !== "undefined";
8173
- var SymbolSupported = typeof Symbol !== "undefined";
8174
- var ObjectToString = uncurryThis(Object.prototype.toString);
8175
- var numberValue = uncurryThis(Number.prototype.valueOf);
8176
- var stringValue = uncurryThis(String.prototype.valueOf);
8177
- var booleanValue = uncurryThis(Boolean.prototype.valueOf);
8178
- if (BigIntSupported) {
8179
- bigIntValue = uncurryThis(BigInt.prototype.valueOf);
8180
- }
8181
- var bigIntValue;
8182
- if (SymbolSupported) {
8183
- symbolValue = uncurryThis(Symbol.prototype.valueOf);
8184
- }
8185
- var symbolValue;
8186
- function checkBoxedPrimitive(value, prototypeValueOf) {
8187
- if (typeof value !== "object") {
8188
- return false;
8189
- }
8190
- try {
8191
- prototypeValueOf(value);
8192
- return true;
8193
- } catch (e) {
8194
- return false;
8195
- }
8196
- }
8197
- exports.isArgumentsObject = isArgumentsObject;
8198
- exports.isGeneratorFunction = isGeneratorFunction;
8199
- exports.isTypedArray = isTypedArray;
8200
- function isPromise(input) {
8201
- return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
8202
- }
8203
- exports.isPromise = isPromise;
8204
- function isArrayBufferView(value) {
8205
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
8206
- return ArrayBuffer.isView(value);
8207
- }
8208
- return isTypedArray(value) || isDataView(value);
8209
- }
8210
- exports.isArrayBufferView = isArrayBufferView;
8211
- function isUint8Array(value) {
8212
- return whichTypedArray(value) === "Uint8Array";
8213
- }
8214
- exports.isUint8Array = isUint8Array;
8215
- function isUint8ClampedArray(value) {
8216
- return whichTypedArray(value) === "Uint8ClampedArray";
8217
- }
8218
- exports.isUint8ClampedArray = isUint8ClampedArray;
8219
- function isUint16Array(value) {
8220
- return whichTypedArray(value) === "Uint16Array";
8221
- }
8222
- exports.isUint16Array = isUint16Array;
8223
- function isUint32Array(value) {
8224
- return whichTypedArray(value) === "Uint32Array";
8225
- }
8226
- exports.isUint32Array = isUint32Array;
8227
- function isInt8Array(value) {
8228
- return whichTypedArray(value) === "Int8Array";
8229
- }
8230
- exports.isInt8Array = isInt8Array;
8231
- function isInt16Array(value) {
8232
- return whichTypedArray(value) === "Int16Array";
8233
- }
8234
- exports.isInt16Array = isInt16Array;
8235
- function isInt32Array(value) {
8236
- return whichTypedArray(value) === "Int32Array";
8237
- }
8238
- exports.isInt32Array = isInt32Array;
8239
- function isFloat32Array(value) {
8240
- return whichTypedArray(value) === "Float32Array";
8241
- }
8242
- exports.isFloat32Array = isFloat32Array;
8243
- function isFloat64Array(value) {
8244
- return whichTypedArray(value) === "Float64Array";
8245
- }
8246
- exports.isFloat64Array = isFloat64Array;
8247
- function isBigInt64Array(value) {
8248
- return whichTypedArray(value) === "BigInt64Array";
8249
- }
8250
- exports.isBigInt64Array = isBigInt64Array;
8251
- function isBigUint64Array(value) {
8252
- return whichTypedArray(value) === "BigUint64Array";
8253
- }
8254
- exports.isBigUint64Array = isBigUint64Array;
8255
- function isMapToString(value) {
8256
- return ObjectToString(value) === "[object Map]";
8257
- }
8258
- isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map());
8259
- function isMap(value) {
8260
- if (typeof Map === "undefined") {
8261
- return false;
8262
- }
8263
- return isMapToString.working ? isMapToString(value) : value instanceof Map;
8264
- }
8265
- exports.isMap = isMap;
8266
- function isSetToString(value) {
8267
- return ObjectToString(value) === "[object Set]";
8268
- }
8269
- isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set());
8270
- function isSet(value) {
8271
- if (typeof Set === "undefined") {
8272
- return false;
8273
- }
8274
- return isSetToString.working ? isSetToString(value) : value instanceof Set;
8275
- }
8276
- exports.isSet = isSet;
8277
- function isWeakMapToString(value) {
8278
- return ObjectToString(value) === "[object WeakMap]";
8279
- }
8280
- isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap());
8281
- function isWeakMap(value) {
8282
- if (typeof WeakMap === "undefined") {
8283
- return false;
8284
- }
8285
- return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
8286
- }
8287
- exports.isWeakMap = isWeakMap;
8288
- function isWeakSetToString(value) {
8289
- return ObjectToString(value) === "[object WeakSet]";
8290
- }
8291
- isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet());
8292
- function isWeakSet(value) {
8293
- return isWeakSetToString(value);
8294
- }
8295
- exports.isWeakSet = isWeakSet;
8296
- function isArrayBufferToString(value) {
8297
- return ObjectToString(value) === "[object ArrayBuffer]";
8298
- }
8299
- isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer());
8300
- function isArrayBuffer(value) {
8301
- if (typeof ArrayBuffer === "undefined") {
8302
- return false;
8303
- }
8304
- return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
8305
- }
8306
- exports.isArrayBuffer = isArrayBuffer;
8307
- function isDataViewToString(value) {
8308
- return ObjectToString(value) === "[object DataView]";
8309
- }
8310
- isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));
8311
- function isDataView(value) {
8312
- if (typeof DataView === "undefined") {
8313
- return false;
8314
- }
8315
- return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
8316
- }
8317
- exports.isDataView = isDataView;
8318
- var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
8319
- function isSharedArrayBufferToString(value) {
8320
- return ObjectToString(value) === "[object SharedArrayBuffer]";
8321
- }
8322
- function isSharedArrayBuffer(value) {
8323
- if (typeof SharedArrayBufferCopy === "undefined") {
8324
- return false;
8325
- }
8326
- if (typeof isSharedArrayBufferToString.working === "undefined") {
8327
- isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());
8328
- }
8329
- return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy;
8330
- }
8331
- exports.isSharedArrayBuffer = isSharedArrayBuffer;
8332
- function isAsyncFunction(value) {
8333
- return ObjectToString(value) === "[object AsyncFunction]";
8334
- }
8335
- exports.isAsyncFunction = isAsyncFunction;
8336
- function isMapIterator(value) {
8337
- return ObjectToString(value) === "[object Map Iterator]";
8338
- }
8339
- exports.isMapIterator = isMapIterator;
8340
- function isSetIterator(value) {
8341
- return ObjectToString(value) === "[object Set Iterator]";
8342
- }
8343
- exports.isSetIterator = isSetIterator;
8344
- function isGeneratorObject(value) {
8345
- return ObjectToString(value) === "[object Generator]";
8346
- }
8347
- exports.isGeneratorObject = isGeneratorObject;
8348
- function isWebAssemblyCompiledModule(value) {
8349
- return ObjectToString(value) === "[object WebAssembly.Module]";
8350
- }
8351
- exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
8352
- function isNumberObject(value) {
8353
- return checkBoxedPrimitive(value, numberValue);
8354
- }
8355
- exports.isNumberObject = isNumberObject;
8356
- function isStringObject(value) {
8357
- return checkBoxedPrimitive(value, stringValue);
8358
- }
8359
- exports.isStringObject = isStringObject;
8360
- function isBooleanObject(value) {
8361
- return checkBoxedPrimitive(value, booleanValue);
8362
- }
8363
- exports.isBooleanObject = isBooleanObject;
8364
- function isBigIntObject(value) {
8365
- return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
8366
- }
8367
- exports.isBigIntObject = isBigIntObject;
8368
- function isSymbolObject(value) {
8369
- return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
8370
- }
8371
- exports.isSymbolObject = isSymbolObject;
8372
- function isBoxedPrimitive(value) {
8373
- return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value);
8374
- }
8375
- exports.isBoxedPrimitive = isBoxedPrimitive;
8376
- function isAnyArrayBuffer(value) {
8377
- return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
8378
- }
8379
- exports.isAnyArrayBuffer = isAnyArrayBuffer;
8380
- ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) {
8381
- Object.defineProperty(exports, method, {
8382
- enumerable: false,
8383
- value: function() {
8384
- throw new Error(method + " is not supported in userland");
8385
- }
8386
- });
8387
- });
8388
- }
8389
- });
8390
- var require_isBufferBrowser = __commonJS6({
8391
- "node_modules/util/support/isBufferBrowser.js"(exports, module) {
8392
- module.exports = function isBuffer(arg) {
8393
- return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function";
8394
- };
8395
- }
8396
- });
8397
- var require_inherits_browser = __commonJS6({
8398
- "node_modules/inherits/inherits_browser.js"(exports, module) {
8399
- if (typeof Object.create === "function") {
8400
- module.exports = function inherits(ctor, superCtor) {
8401
- if (superCtor) {
8402
- ctor.super_ = superCtor;
8403
- ctor.prototype = Object.create(superCtor.prototype, {
8404
- constructor: {
8405
- value: ctor,
8406
- enumerable: false,
8407
- writable: true,
8408
- configurable: true
8409
- }
8410
- });
8411
- }
8412
- };
8413
- } else {
8414
- module.exports = function inherits(ctor, superCtor) {
8415
- if (superCtor) {
8416
- ctor.super_ = superCtor;
8417
- var TempCtor = function() {
8418
- };
8419
- TempCtor.prototype = superCtor.prototype;
8420
- ctor.prototype = new TempCtor();
8421
- ctor.prototype.constructor = ctor;
8422
- }
8423
- };
8424
- }
8425
- }
8426
- });
8427
- var require_util = __commonJS6({
8428
- "node_modules/util/util.js"(exports) {
8429
- var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) {
8430
- var keys = Object.keys(obj);
8431
- var descriptors = {};
8432
- for (var i = 0; i < keys.length; i++) {
8433
- descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
8434
- }
8435
- return descriptors;
8436
- };
8437
- var formatRegExp = /%[sdj%]/g;
8438
- exports.format = function(f) {
8439
- if (!isString(f)) {
8440
- var objects = [];
8441
- for (var i = 0; i < arguments.length; i++) {
8442
- objects.push(inspect2(arguments[i]));
8443
- }
8444
- return objects.join(" ");
8445
- }
8446
- var i = 1;
8447
- var args = arguments;
8448
- var len = args.length;
8449
- var str = String(f).replace(formatRegExp, function(x2) {
8450
- if (x2 === "%%")
8451
- return "%";
8452
- if (i >= len)
8453
- return x2;
8454
- switch (x2) {
8455
- case "%s":
8456
- return String(args[i++]);
8457
- case "%d":
8458
- return Number(args[i++]);
8459
- case "%j":
8460
- try {
8461
- return JSON.stringify(args[i++]);
8462
- } catch (_) {
8463
- return "[Circular]";
8464
- }
8465
- default:
8466
- return x2;
8467
- }
8468
- });
8469
- for (var x = args[i]; i < len; x = args[++i]) {
8470
- if (isNull(x) || !isObject2(x)) {
8471
- str += " " + x;
8472
- } else {
8473
- str += " " + inspect2(x);
8474
- }
8475
- }
8476
- return str;
8477
- };
8478
- exports.deprecate = function(fn, msg) {
8479
- if (typeof process !== "undefined" && process.noDeprecation === true) {
8480
- return fn;
8481
- }
8482
- if (typeof process === "undefined") {
8483
- return function() {
8484
- return exports.deprecate(fn, msg).apply(this, arguments);
8485
- };
8486
- }
8487
- var warned = false;
8488
- function deprecated() {
8489
- if (!warned) {
8490
- if (process.throwDeprecation) {
8491
- throw new Error(msg);
8492
- } else if (process.traceDeprecation) {
8493
- console.trace(msg);
8494
- } else {
8495
- console.error(msg);
8496
- }
8497
- warned = true;
8498
- }
8499
- return fn.apply(this, arguments);
8500
- }
8501
- return deprecated;
8502
- };
8503
- var debugs = {};
8504
- var debugEnvRegex = /^$/;
8505
- if (process.env.NODE_DEBUG) {
8506
- debugEnv = process.env.NODE_DEBUG;
8507
- debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
8508
- debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
8509
- }
8510
- var debugEnv;
8511
- exports.debuglog = function(set) {
8512
- set = set.toUpperCase();
8513
- if (!debugs[set]) {
8514
- if (debugEnvRegex.test(set)) {
8515
- var pid = process.pid;
8516
- debugs[set] = function() {
8517
- var msg = exports.format.apply(exports, arguments);
8518
- console.error("%s %d: %s", set, pid, msg);
8519
- };
8520
- } else {
8521
- debugs[set] = function() {
8522
- };
8523
- }
8524
- }
8525
- return debugs[set];
8526
- };
8527
- function inspect2(obj, opts) {
8528
- var ctx = {
8529
- seen: [],
8530
- stylize: stylizeNoColor
8531
- };
8532
- if (arguments.length >= 3)
8533
- ctx.depth = arguments[2];
8534
- if (arguments.length >= 4)
8535
- ctx.colors = arguments[3];
8536
- if (isBoolean(opts)) {
8537
- ctx.showHidden = opts;
8538
- } else if (opts) {
8539
- exports._extend(ctx, opts);
8540
- }
8541
- if (isUndefined(ctx.showHidden))
8542
- ctx.showHidden = false;
8543
- if (isUndefined(ctx.depth))
8544
- ctx.depth = 2;
8545
- if (isUndefined(ctx.colors))
8546
- ctx.colors = false;
8547
- if (isUndefined(ctx.customInspect))
8548
- ctx.customInspect = true;
8549
- if (ctx.colors)
8550
- ctx.stylize = stylizeWithColor;
8551
- return formatValue2(ctx, obj, ctx.depth);
8552
- }
8553
- exports.inspect = inspect2;
8554
- inspect2.colors = {
8555
- "bold": [1, 22],
8556
- "italic": [3, 23],
8557
- "underline": [4, 24],
8558
- "inverse": [7, 27],
8559
- "white": [37, 39],
8560
- "grey": [90, 39],
8561
- "black": [30, 39],
8562
- "blue": [34, 39],
8563
- "cyan": [36, 39],
8564
- "green": [32, 39],
8565
- "magenta": [35, 39],
8566
- "red": [31, 39],
8567
- "yellow": [33, 39]
8568
- };
8569
- inspect2.styles = {
8570
- "special": "cyan",
8571
- "number": "yellow",
8572
- "boolean": "yellow",
8573
- "undefined": "grey",
8574
- "null": "bold",
8575
- "string": "green",
8576
- "date": "magenta",
8577
- "regexp": "red"
8578
- };
8579
- function stylizeWithColor(str, styleType) {
8580
- var style = inspect2.styles[styleType];
8581
- if (style) {
8582
- return "\x1B[" + inspect2.colors[style][0] + "m" + str + "\x1B[" + inspect2.colors[style][1] + "m";
8583
- } else {
8584
- return str;
8585
- }
8586
- }
8587
- function stylizeNoColor(str, styleType) {
8588
- return str;
8589
- }
8590
- function arrayToHash(array) {
8591
- var hash = {};
8592
- array.forEach(function(val, idx) {
8593
- hash[val] = true;
8594
- });
8595
- return hash;
8596
- }
8597
- function formatValue2(ctx, value, recurseTimes) {
8598
- if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== exports.inspect && !(value.constructor && value.constructor.prototype === value)) {
8599
- var ret = value.inspect(recurseTimes, ctx);
8600
- if (!isString(ret)) {
8601
- ret = formatValue2(ctx, ret, recurseTimes);
8602
- }
8603
- return ret;
8604
- }
8605
- var primitive = formatPrimitive(ctx, value);
8606
- if (primitive) {
8607
- return primitive;
8608
- }
8609
- var keys = Object.keys(value);
8610
- var visibleKeys = arrayToHash(keys);
8611
- if (ctx.showHidden) {
8612
- keys = Object.getOwnPropertyNames(value);
8613
- }
8614
- if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
8615
- return formatError(value);
8616
- }
8617
- if (keys.length === 0) {
8618
- if (isFunction(value)) {
8619
- var name = value.name ? ": " + value.name : "";
8620
- return ctx.stylize("[Function" + name + "]", "special");
8621
- }
8622
- if (isRegExp(value)) {
8623
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
8624
- }
8625
- if (isDate(value)) {
8626
- return ctx.stylize(Date.prototype.toString.call(value), "date");
8627
- }
8628
- if (isError(value)) {
8629
- return formatError(value);
8630
- }
8631
- }
8632
- var base = "", array = false, braces = ["{", "}"];
8633
- if (isArray(value)) {
8634
- array = true;
8635
- braces = ["[", "]"];
8636
- }
8637
- if (isFunction(value)) {
8638
- var n = value.name ? ": " + value.name : "";
8639
- base = " [Function" + n + "]";
8640
- }
8641
- if (isRegExp(value)) {
8642
- base = " " + RegExp.prototype.toString.call(value);
8643
- }
8644
- if (isDate(value)) {
8645
- base = " " + Date.prototype.toUTCString.call(value);
8646
- }
8647
- if (isError(value)) {
8648
- base = " " + formatError(value);
8649
- }
8650
- if (keys.length === 0 && (!array || value.length == 0)) {
8651
- return braces[0] + base + braces[1];
8652
- }
8653
- if (recurseTimes < 0) {
8654
- if (isRegExp(value)) {
8655
- return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
8656
- } else {
8657
- return ctx.stylize("[Object]", "special");
8658
- }
8659
- }
8660
- ctx.seen.push(value);
8661
- var output;
8662
- if (array) {
8663
- output = formatArray2(ctx, value, recurseTimes, visibleKeys, keys);
8664
- } else {
8665
- output = keys.map(function(key) {
8666
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
8667
- });
8668
- }
8669
- ctx.seen.pop();
8670
- return reduceToSingleString(output, base, braces);
8671
- }
8672
- function formatPrimitive(ctx, value) {
8673
- if (isUndefined(value))
8674
- return ctx.stylize("undefined", "undefined");
8675
- if (isString(value)) {
8676
- var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
8677
- return ctx.stylize(simple, "string");
8678
- }
8679
- if (isNumber(value))
8680
- return ctx.stylize("" + value, "number");
8681
- if (isBoolean(value))
8682
- return ctx.stylize("" + value, "boolean");
8683
- if (isNull(value))
8684
- return ctx.stylize("null", "null");
8685
- }
8686
- function formatError(value) {
8687
- return "[" + Error.prototype.toString.call(value) + "]";
8688
- }
8689
- function formatArray2(ctx, value, recurseTimes, visibleKeys, keys) {
8690
- var output = [];
8691
- for (var i = 0, l = value.length; i < l; ++i) {
8692
- if (hasOwnProperty(value, String(i))) {
8693
- output.push(formatProperty(
8694
- ctx,
8695
- value,
8696
- recurseTimes,
8697
- visibleKeys,
8698
- String(i),
8699
- true
8700
- ));
8701
- } else {
8702
- output.push("");
8703
- }
8704
- }
8705
- keys.forEach(function(key) {
8706
- if (!key.match(/^\d+$/)) {
8707
- output.push(formatProperty(
8708
- ctx,
8709
- value,
8710
- recurseTimes,
8711
- visibleKeys,
8712
- key,
8713
- true
8714
- ));
8715
- }
8716
- });
8717
- return output;
8718
- }
8719
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
8720
- var name, str, desc;
8721
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
8722
- if (desc.get) {
8723
- if (desc.set) {
8724
- str = ctx.stylize("[Getter/Setter]", "special");
8725
- } else {
8726
- str = ctx.stylize("[Getter]", "special");
8727
- }
8728
- } else {
8729
- if (desc.set) {
8730
- str = ctx.stylize("[Setter]", "special");
8731
- }
8732
- }
8733
- if (!hasOwnProperty(visibleKeys, key)) {
8734
- name = "[" + key + "]";
8735
- }
8736
- if (!str) {
8737
- if (ctx.seen.indexOf(desc.value) < 0) {
8738
- if (isNull(recurseTimes)) {
8739
- str = formatValue2(ctx, desc.value, null);
8740
- } else {
8741
- str = formatValue2(ctx, desc.value, recurseTimes - 1);
8742
- }
8743
- if (str.indexOf("\n") > -1) {
8744
- if (array) {
8745
- str = str.split("\n").map(function(line) {
8746
- return " " + line;
8747
- }).join("\n").substr(2);
8748
- } else {
8749
- str = "\n" + str.split("\n").map(function(line) {
8750
- return " " + line;
8751
- }).join("\n");
8752
- }
8753
- }
8754
- } else {
8755
- str = ctx.stylize("[Circular]", "special");
8756
- }
8757
- }
8758
- if (isUndefined(name)) {
8759
- if (array && key.match(/^\d+$/)) {
8760
- return str;
8761
- }
8762
- name = JSON.stringify("" + key);
8763
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
8764
- name = name.substr(1, name.length - 2);
8765
- name = ctx.stylize(name, "name");
8766
- } else {
8767
- name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
8768
- name = ctx.stylize(name, "string");
8769
- }
8770
- }
8771
- return name + ": " + str;
8772
- }
8773
- function reduceToSingleString(output, base, braces) {
8774
- var numLinesEst = 0;
8775
- var length = output.reduce(function(prev, cur) {
8776
- numLinesEst++;
8777
- if (cur.indexOf("\n") >= 0)
8778
- numLinesEst++;
8779
- return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
8780
- }, 0);
8781
- if (length > 60) {
8782
- return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
8783
- }
8784
- return braces[0] + base + " " + output.join(", ") + " " + braces[1];
8785
- }
8786
- exports.types = require_types();
8787
- function isArray(ar) {
8788
- return Array.isArray(ar);
8789
- }
8790
- exports.isArray = isArray;
8791
- function isBoolean(arg) {
8792
- return typeof arg === "boolean";
8793
- }
8794
- exports.isBoolean = isBoolean;
8795
- function isNull(arg) {
8796
- return arg === null;
8797
- }
8798
- exports.isNull = isNull;
8799
- function isNullOrUndefined(arg) {
8800
- return arg == null;
8801
- }
8802
- exports.isNullOrUndefined = isNullOrUndefined;
8803
- function isNumber(arg) {
8804
- return typeof arg === "number";
8805
- }
8806
- exports.isNumber = isNumber;
8807
- function isString(arg) {
8808
- return typeof arg === "string";
8809
- }
8810
- exports.isString = isString;
8811
- function isSymbol(arg) {
8812
- return typeof arg === "symbol";
8813
- }
8814
- exports.isSymbol = isSymbol;
8815
- function isUndefined(arg) {
8816
- return arg === void 0;
8817
- }
8818
- exports.isUndefined = isUndefined;
8819
- function isRegExp(re) {
8820
- return isObject2(re) && objectToString(re) === "[object RegExp]";
8821
- }
8822
- exports.isRegExp = isRegExp;
8823
- exports.types.isRegExp = isRegExp;
8824
- function isObject2(arg) {
8825
- return typeof arg === "object" && arg !== null;
8826
- }
8827
- exports.isObject = isObject2;
8828
- function isDate(d) {
8829
- return isObject2(d) && objectToString(d) === "[object Date]";
8830
- }
8831
- exports.isDate = isDate;
8832
- exports.types.isDate = isDate;
8833
- function isError(e) {
8834
- return isObject2(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
8835
- }
8836
- exports.isError = isError;
8837
- exports.types.isNativeError = isError;
8838
- function isFunction(arg) {
8839
- return typeof arg === "function";
8840
- }
8841
- exports.isFunction = isFunction;
8842
- function isPrimitive(arg) {
8843
- return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
8844
- }
8845
- exports.isPrimitive = isPrimitive;
8846
- exports.isBuffer = require_isBufferBrowser();
8847
- function objectToString(o) {
8848
- return Object.prototype.toString.call(o);
8849
- }
8850
- function pad(n) {
8851
- return n < 10 ? "0" + n.toString(10) : n.toString(10);
8852
- }
8853
- var months = [
8854
- "Jan",
8855
- "Feb",
8856
- "Mar",
8857
- "Apr",
8858
- "May",
8859
- "Jun",
8860
- "Jul",
8861
- "Aug",
8862
- "Sep",
8863
- "Oct",
8864
- "Nov",
8865
- "Dec"
8866
- ];
8867
- function timestamp() {
8868
- var d = /* @__PURE__ */ new Date();
8869
- var time = [
8870
- pad(d.getHours()),
8871
- pad(d.getMinutes()),
8872
- pad(d.getSeconds())
8873
- ].join(":");
8874
- return [d.getDate(), months[d.getMonth()], time].join(" ");
8875
- }
8876
- exports.log = function() {
8877
- console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments));
8878
- };
8879
- exports.inherits = require_inherits_browser();
8880
- exports._extend = function(origin, add) {
8881
- if (!add || !isObject2(add))
8882
- return origin;
8883
- var keys = Object.keys(add);
8884
- var i = keys.length;
8885
- while (i--) {
8886
- origin[keys[i]] = add[keys[i]];
8887
- }
8888
- return origin;
8889
- };
8890
- function hasOwnProperty(obj, prop) {
8891
- return Object.prototype.hasOwnProperty.call(obj, prop);
8892
- }
8893
- var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
8894
- exports.promisify = function promisify(original) {
8895
- if (typeof original !== "function")
8896
- throw new TypeError('The "original" argument must be of type Function');
8897
- if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
8898
- var fn = original[kCustomPromisifiedSymbol];
8899
- if (typeof fn !== "function") {
8900
- throw new TypeError('The "util.promisify.custom" argument must be of type Function');
8901
- }
8902
- Object.defineProperty(fn, kCustomPromisifiedSymbol, {
8903
- value: fn,
8904
- enumerable: false,
8905
- writable: false,
8906
- configurable: true
8907
- });
8908
- return fn;
8909
- }
8910
- function fn() {
8911
- var promiseResolve, promiseReject;
8912
- var promise = new Promise(function(resolve, reject) {
8913
- promiseResolve = resolve;
8914
- promiseReject = reject;
8915
- });
8916
- var args = [];
8917
- for (var i = 0; i < arguments.length; i++) {
8918
- args.push(arguments[i]);
8919
- }
8920
- args.push(function(err, value) {
8921
- if (err) {
8922
- promiseReject(err);
8923
- } else {
8924
- promiseResolve(value);
8925
- }
8926
- });
8927
- try {
8928
- original.apply(this, args);
8929
- } catch (err) {
8930
- promiseReject(err);
8931
- }
8932
- return promise;
8933
- }
8934
- Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
8935
- if (kCustomPromisifiedSymbol)
8936
- Object.defineProperty(fn, kCustomPromisifiedSymbol, {
8937
- value: fn,
8938
- enumerable: false,
8939
- writable: false,
8940
- configurable: true
8941
- });
8942
- return Object.defineProperties(
8943
- fn,
8944
- getOwnPropertyDescriptors(original)
8945
- );
8946
- };
8947
- exports.promisify.custom = kCustomPromisifiedSymbol;
8948
- function callbackifyOnRejected(reason, cb) {
8949
- if (!reason) {
8950
- var newReason = new Error("Promise was rejected with a falsy value");
8951
- newReason.reason = reason;
8952
- reason = newReason;
8953
- }
8954
- return cb(reason);
8955
- }
8956
- function callbackify(original) {
8957
- if (typeof original !== "function") {
8958
- throw new TypeError('The "original" argument must be of type Function');
8959
- }
8960
- function callbackified() {
8961
- var args = [];
8962
- for (var i = 0; i < arguments.length; i++) {
8963
- args.push(arguments[i]);
8964
- }
8965
- var maybeCb = args.pop();
8966
- if (typeof maybeCb !== "function") {
8967
- throw new TypeError("The last argument must be of type Function");
8968
- }
8969
- var self = this;
8970
- var cb = function() {
8971
- return maybeCb.apply(self, arguments);
8972
- };
8973
- original.apply(this, args).then(
8974
- function(ret) {
8975
- process.nextTick(cb.bind(null, null, ret));
8976
- },
8977
- function(rej) {
8978
- process.nextTick(callbackifyOnRejected.bind(null, rej, cb));
8979
- }
8980
- );
8981
- }
8982
- Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
8983
- Object.defineProperties(
8984
- callbackified,
8985
- getOwnPropertyDescriptors(original)
8986
- );
8987
- return callbackified;
8988
- }
8989
- exports.callbackify = callbackify;
8990
- }
8991
- });
8992
- var TextEncoder2 = typeof globalThis.TextEncoder === "undefined" ? require_util().TextEncoder : globalThis.TextEncoder;
8993
- var TextDecoder2 = typeof globalThis.TextDecoder === "undefined" ? require_util().TextDecoder : globalThis.TextDecoder;
8994
- var encoder2 = new TextEncoder2();
8995
- function encodeBuffer2(text) {
8996
- return encoder2.encode(text);
8997
- }
8998
- function decodeBuffer2(buffer, encoding) {
8999
- const decoder = new TextDecoder2(encoding);
9000
- return decoder.decode(buffer);
9001
- }
9002
- function toArrayBuffer(array) {
9003
- return array.buffer.slice(
9004
- array.byteOffset,
9005
- array.byteOffset + array.byteLength
9006
- );
9007
- }
9008
-
9009
- // node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-DWXGORCS.mjs
9010
- function concatArrayBuffer(left, right) {
9011
- const result = new Uint8Array(left.byteLength + right.byteLength);
9012
- result.set(left, 0);
9013
- result.set(right, left.byteLength);
9014
- return result;
9015
- }
9016
- var EventPolyfill = class {
9017
- constructor(type, options) {
9018
- this.AT_TARGET = 0;
9019
- this.BUBBLING_PHASE = 0;
9020
- this.CAPTURING_PHASE = 0;
9021
- this.NONE = 0;
9022
- this.type = "";
9023
- this.srcElement = null;
9024
- this.currentTarget = null;
9025
- this.eventPhase = 0;
9026
- this.isTrusted = true;
9027
- this.composed = false;
9028
- this.cancelable = true;
9029
- this.defaultPrevented = false;
9030
- this.bubbles = true;
9031
- this.lengthComputable = true;
9032
- this.loaded = 0;
9033
- this.total = 0;
9034
- this.cancelBubble = false;
9035
- this.returnValue = true;
9036
- this.type = type;
9037
- this.target = (options == null ? void 0 : options.target) || null;
9038
- this.currentTarget = (options == null ? void 0 : options.currentTarget) || null;
9039
- this.timeStamp = Date.now();
9040
- }
9041
- composedPath() {
9042
- return [];
9043
- }
9044
- initEvent(type, bubbles, cancelable) {
9045
- this.type = type;
9046
- this.bubbles = !!bubbles;
9047
- this.cancelable = !!cancelable;
9048
- }
9049
- preventDefault() {
9050
- this.defaultPrevented = true;
9051
- }
9052
- stopPropagation() {
9053
- }
9054
- stopImmediatePropagation() {
9055
- }
9056
- };
9057
- var ProgressEventPolyfill = class extends EventPolyfill {
9058
- constructor(type, init) {
9059
- super(type);
9060
- this.lengthComputable = (init == null ? void 0 : init.lengthComputable) || false;
9061
- this.composed = (init == null ? void 0 : init.composed) || false;
9062
- this.loaded = (init == null ? void 0 : init.loaded) || 0;
9063
- this.total = (init == null ? void 0 : init.total) || 0;
7114
+ };
7115
+ var ProgressEventPolyfill = class extends EventPolyfill {
7116
+ constructor(type, init) {
7117
+ super(type);
7118
+ this.lengthComputable = (init == null ? void 0 : init.lengthComputable) || false;
7119
+ this.composed = (init == null ? void 0 : init.composed) || false;
7120
+ this.loaded = (init == null ? void 0 : init.loaded) || 0;
7121
+ this.total = (init == null ? void 0 : init.total) || 0;
9064
7122
  }
9065
7123
  };
9066
7124
  var SUPPORTS_PROGRESS_EVENT = typeof ProgressEvent !== "undefined";
@@ -9170,14 +7228,32 @@ If this message still persists after updating, please report an issue: https://g
9170
7228
  return null;
9171
7229
  }
9172
7230
  }
9173
- function createResponse(request, responseBody) {
9174
- return new Response(responseBody, {
7231
+ var statusCodesWithoutBody = [204, 205, 304];
7232
+ function createResponse(request, body) {
7233
+ const responseBodyOrNull = statusCodesWithoutBody.includes(request.status) ? null : body;
7234
+ return new Response(responseBodyOrNull, {
9175
7235
  status: request.status,
9176
7236
  statusText: request.statusText,
9177
- headers: stringToHeaders(request.getAllResponseHeaders())
7237
+ headers: createHeadersFromXMLHttpReqestHeaders(
7238
+ request.getAllResponseHeaders()
7239
+ )
9178
7240
  });
9179
7241
  }
7242
+ function createHeadersFromXMLHttpReqestHeaders(headersString) {
7243
+ const headers = new Headers();
7244
+ const lines = headersString.split(/[\r\n]+/);
7245
+ for (const line of lines) {
7246
+ if (line.trim() === "") {
7247
+ continue;
7248
+ }
7249
+ const [name, ...parts] = line.split(": ");
7250
+ const value = parts.join(": ");
7251
+ headers.append(name, value);
7252
+ }
7253
+ return headers;
7254
+ }
9180
7255
  var IS_MOCKED_RESPONSE = Symbol("isMockedResponse");
7256
+ var IS_NODE2 = isNodeProcess();
9181
7257
  var XMLHttpRequestController = class {
9182
7258
  constructor(initialRequest, logger) {
9183
7259
  this.initialRequest = initialRequest;
@@ -9185,6 +7261,7 @@ If this message still persists after updating, please report an issue: https://g
9185
7261
  this.method = "GET";
9186
7262
  this.url = null;
9187
7263
  this.events = /* @__PURE__ */ new Map();
7264
+ this.requestId = uuidv4();
9188
7265
  this.requestHeaders = new Headers();
9189
7266
  this.responseBuffer = new Uint8Array();
9190
7267
  this.request = createProxy(initialRequest, {
@@ -9203,11 +7280,10 @@ If this message still persists after updating, please report an issue: https://g
9203
7280
  }
9204
7281
  },
9205
7282
  methodCall: ([methodName, args], invoke) => {
9206
- var _a2;
7283
+ var _a3;
9207
7284
  switch (methodName) {
9208
7285
  case "open": {
9209
7286
  const [method, url] = args;
9210
- this.requestId = uuidv4();
9211
7287
  if (typeof url === "undefined") {
9212
7288
  this.method = "GET";
9213
7289
  this.url = toAbsoluteUrl(method);
@@ -9240,6 +7316,11 @@ If this message still persists after updating, please report an issue: https://g
9240
7316
  if (typeof this.onResponse !== "undefined") {
9241
7317
  const fetchResponse = createResponse(
9242
7318
  this.request,
7319
+ /**
7320
+ * The `response` property is the right way to read
7321
+ * the ambiguous response body, as the request's "responseType" may differ.
7322
+ * @see https://xhr.spec.whatwg.org/#the-response-attribute
7323
+ */
9243
7324
  this.request.response
9244
7325
  );
9245
7326
  this.onResponse.call(this, {
@@ -9251,7 +7332,7 @@ If this message still persists after updating, please report an issue: https://g
9251
7332
  }
9252
7333
  });
9253
7334
  const fetchRequest = this.toFetchApiRequest();
9254
- const onceRequestSettled = ((_a2 = this.onRequest) == null ? void 0 : _a2.call(this, {
7335
+ const onceRequestSettled = ((_a3 = this.onRequest) == null ? void 0 : _a3.call(this, {
9255
7336
  request: fetchRequest,
9256
7337
  requestId: this.requestId
9257
7338
  })) || Promise.resolve();
@@ -9261,7 +7342,9 @@ If this message still persists after updating, please report an issue: https://g
9261
7342
  "request callback settled but request has not been handled (readystate %d), performing as-is...",
9262
7343
  this.request.readyState
9263
7344
  );
9264
- this.request.setRequestHeader("X-Request-Id", this.requestId);
7345
+ if (IS_NODE2) {
7346
+ this.request.setRequestHeader("X-Request-Id", this.requestId);
7347
+ }
9265
7348
  return invoke();
9266
7349
  }
9267
7350
  });
@@ -9280,6 +7363,10 @@ If this message still persists after updating, please report an issue: https://g
9280
7363
  this.events.set(eventName, nextEvents);
9281
7364
  this.logger.info('registered event "%s"', eventName, listener.name);
9282
7365
  }
7366
+ /**
7367
+ * Responds to the current request with the given
7368
+ * Fetch API `Response` instance.
7369
+ */
9283
7370
  respondWith(response) {
9284
7371
  this.logger.info(
9285
7372
  "responding with a mocked response: %d %s",
@@ -9315,7 +7402,10 @@ If this message still persists after updating, please report an issue: https://g
9315
7402
  this.logger.info("headers not received yet, returning empty string");
9316
7403
  return "";
9317
7404
  }
9318
- const allHeaders = headersToString(response.headers);
7405
+ const headersList = Array.from(response.headers.entries());
7406
+ const allHeaders = headersList.map(([headerName, headerValue]) => {
7407
+ return `${headerName}: ${headerValue}`;
7408
+ }).join("\r\n");
9319
7409
  this.logger.info("resolved all response headers to", allHeaders);
9320
7410
  return allHeaders;
9321
7411
  }
@@ -9338,7 +7428,12 @@ If this message still persists after updating, please report an issue: https://g
9338
7428
  get: () => this.responseXML
9339
7429
  }
9340
7430
  });
9341
- const totalResponseBodyLength = response.headers.has("Content-Length") ? Number(response.headers.get("Content-Length")) : void 0;
7431
+ const totalResponseBodyLength = response.headers.has("Content-Length") ? Number(response.headers.get("Content-Length")) : (
7432
+ /**
7433
+ * @todo Infer the response body length from the response body.
7434
+ */
7435
+ void 0
7436
+ );
9342
7437
  this.logger.info("calculated response body length", totalResponseBodyLength);
9343
7438
  this.trigger("loadstart", {
9344
7439
  loaded: 0,
@@ -9469,6 +7564,9 @@ If this message still persists after updating, please report an issue: https://g
9469
7564
  this.trigger("error");
9470
7565
  this.trigger("loadend");
9471
7566
  }
7567
+ /**
7568
+ * Transitions this request's `readyState` to the given one.
7569
+ */
9472
7570
  setReadyState(nextReadyState) {
9473
7571
  this.logger.info(
9474
7572
  "setReadyState: %d -> %d",
@@ -9486,6 +7584,9 @@ If this message still persists after updating, please report an issue: https://g
9486
7584
  this.trigger("readystatechange");
9487
7585
  }
9488
7586
  }
7587
+ /**
7588
+ * Triggers given event on the `XMLHttpRequest` instance.
7589
+ */
9489
7590
  trigger(eventName, options) {
9490
7591
  const callback = this.request[`on${eventName}`];
9491
7592
  const event = createEvent(this.request, eventName, options);
@@ -9505,11 +7606,17 @@ If this message still persists after updating, please report an issue: https://g
9505
7606
  }
9506
7607
  }
9507
7608
  }
7609
+ /**
7610
+ * Converts this `XMLHttpRequest` instance into a Fetch API `Request` instance.
7611
+ */
9508
7612
  toFetchApiRequest() {
9509
7613
  this.logger.info("converting request to a Fetch API Request...");
9510
7614
  const fetchRequest = new Request(this.url.href, {
9511
7615
  method: this.method,
9512
7616
  headers: this.requestHeaders,
7617
+ /**
7618
+ * @see https://xhr.spec.whatwg.org/#cross-origin-credentials
7619
+ */
9513
7620
  credentials: this.request.withCredentials ? "include" : "same-origin",
9514
7621
  body: ["GET", "HEAD"].includes(this.method) ? null : this.requestBody
9515
7622
  });
@@ -9543,6 +7650,7 @@ If this message still persists after updating, please report an issue: https://g
9543
7650
  }
9544
7651
  function define(target, property, value) {
9545
7652
  Reflect.defineProperty(target, property, {
7653
+ // Ensure writable properties to allow redefining readonly properties.
9546
7654
  writable: true,
9547
7655
  enumerable: true,
9548
7656
  value
@@ -9609,6 +7717,13 @@ If this message still persists after updating, please report an issue: https://g
9609
7717
  mockedResponse.status,
9610
7718
  mockedResponse.statusText
9611
7719
  );
7720
+ if (mockedResponse.type === "error") {
7721
+ this.logger.info(
7722
+ "received a network error response, rejecting the request promise..."
7723
+ );
7724
+ requestController.errorWith(new TypeError("Network error"));
7725
+ return;
7726
+ }
9612
7727
  return requestController.respondWith(mockedResponse);
9613
7728
  }
9614
7729
  this.logger.info(
@@ -9748,8 +7863,8 @@ If this message still persists after updating, please report an issue: https://g
9748
7863
  // src/browser/setupWorker/stop/createFallbackStop.ts
9749
7864
  function createFallbackStop(context) {
9750
7865
  return function stop() {
9751
- var _a2, _b2;
9752
- (_a2 = context.fallbackInterceptor) == null ? void 0 : _a2.dispose();
7866
+ var _a3, _b2;
7867
+ (_a3 = context.fallbackInterceptor) == null ? void 0 : _a3.dispose();
9753
7868
  printStopMessage({ quiet: (_b2 = context.startOptions) == null ? void 0 : _b2.quiet });
9754
7869
  };
9755
7870
  }
@@ -9795,8 +7910,8 @@ If this message still persists after updating, please report an issue: https://g
9795
7910
  });
9796
7911
  },
9797
7912
  send: (type) => {
9798
- var _a2;
9799
- (_a2 = this.context.worker) == null ? void 0 : _a2.postMessage(type);
7913
+ var _a3;
7914
+ (_a3 = this.context.worker) == null ? void 0 : _a3.postMessage(type);
9800
7915
  }
9801
7916
  },
9802
7917
  events: {