@gammarers/aws-sns-slack-message-lambda-subscription 1.0.16 → 1.0.18

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.
@@ -10031,7 +10031,7 @@ var require_form_data = __commonJS({
10031
10031
  var CombinedStream = require_combined_stream();
10032
10032
  var util3 = require("util");
10033
10033
  var path = require("path");
10034
- var http2 = require("http");
10034
+ var http3 = require("http");
10035
10035
  var https2 = require("https");
10036
10036
  var parseUrl = require("url").parse;
10037
10037
  var fs = require("fs");
@@ -10303,7 +10303,7 @@ var require_form_data = __commonJS({
10303
10303
  if (options.protocol === "https:") {
10304
10304
  request = https2.request(options);
10305
10305
  } else {
10306
- request = http2.request(options);
10306
+ request = http3.request(options);
10307
10307
  }
10308
10308
  this.getLength(function(err, length) {
10309
10309
  if (err && err !== "Unknown stream") {
@@ -11208,7 +11208,7 @@ var require_follow_redirects = __commonJS({
11208
11208
  "use strict";
11209
11209
  var url2 = require("url");
11210
11210
  var URL2 = url2.URL;
11211
- var http2 = require("http");
11211
+ var http3 = require("http");
11212
11212
  var https2 = require("https");
11213
11213
  var Writable = require("stream").Writable;
11214
11214
  var assert = require("assert");
@@ -11216,7 +11216,7 @@ var require_follow_redirects = __commonJS({
11216
11216
  (function detectUnsupportedEnvironment() {
11217
11217
  var looksLikeNode = typeof process !== "undefined";
11218
11218
  var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
11219
- var looksLikeV8 = isFunction2(Error.captureStackTrace);
11219
+ var looksLikeV8 = isFunction3(Error.captureStackTrace);
11220
11220
  if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
11221
11221
  console.warn("The follow-redirects package should be excluded from browser builds.");
11222
11222
  }
@@ -11311,7 +11311,7 @@ var require_follow_redirects = __commonJS({
11311
11311
  if (!isString2(data) && !isBuffer2(data)) {
11312
11312
  throw new TypeError("data should be a string, Buffer or Uint8Array");
11313
11313
  }
11314
- if (isFunction2(encoding)) {
11314
+ if (isFunction3(encoding)) {
11315
11315
  callback = encoding;
11316
11316
  encoding = null;
11317
11317
  }
@@ -11331,10 +11331,10 @@ var require_follow_redirects = __commonJS({
11331
11331
  }
11332
11332
  };
11333
11333
  RedirectableRequest.prototype.end = function(data, encoding, callback) {
11334
- if (isFunction2(data)) {
11334
+ if (isFunction3(data)) {
11335
11335
  callback = data;
11336
11336
  data = encoding = null;
11337
- } else if (isFunction2(encoding)) {
11337
+ } else if (isFunction3(encoding)) {
11338
11338
  callback = encoding;
11339
11339
  encoding = null;
11340
11340
  }
@@ -11535,7 +11535,7 @@ var require_follow_redirects = __commonJS({
11535
11535
  if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
11536
11536
  removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
11537
11537
  }
11538
- if (isFunction2(beforeRedirect)) {
11538
+ if (isFunction3(beforeRedirect)) {
11539
11539
  var responseDetails = {
11540
11540
  headers: response.headers,
11541
11541
  statusCode
@@ -11570,7 +11570,7 @@ var require_follow_redirects = __commonJS({
11570
11570
  options = validateUrl(input);
11571
11571
  input = { protocol };
11572
11572
  }
11573
- if (isFunction2(options)) {
11573
+ if (isFunction3(options)) {
11574
11574
  callback = options;
11575
11575
  options = null;
11576
11576
  }
@@ -11650,7 +11650,7 @@ var require_follow_redirects = __commonJS({
11650
11650
  }
11651
11651
  function createErrorType(code, message, baseClass) {
11652
11652
  function CustomError(properties) {
11653
- if (isFunction2(Error.captureStackTrace)) {
11653
+ if (isFunction3(Error.captureStackTrace)) {
11654
11654
  Error.captureStackTrace(this, this.constructor);
11655
11655
  }
11656
11656
  Object.assign(this, properties || {});
@@ -11685,7 +11685,7 @@ var require_follow_redirects = __commonJS({
11685
11685
  function isString2(value) {
11686
11686
  return typeof value === "string" || value instanceof String;
11687
11687
  }
11688
- function isFunction2(value) {
11688
+ function isFunction3(value) {
11689
11689
  return typeof value === "function";
11690
11690
  }
11691
11691
  function isBuffer2(value) {
@@ -11694,7 +11694,7 @@ var require_follow_redirects = __commonJS({
11694
11694
  function isURL(value) {
11695
11695
  return URL2 && value instanceof URL2;
11696
11696
  }
11697
- module2.exports = wrap({ http: http2, https: https2 });
11697
+ module2.exports = wrap({ http: http3, https: https2 });
11698
11698
  module2.exports.wrap = wrap;
11699
11699
  }
11700
11700
  });
@@ -11707,8 +11707,9 @@ var require_axios = __commonJS({
11707
11707
  var crypto2 = require("crypto");
11708
11708
  var url2 = require("url");
11709
11709
  var proxyFromEnv2 = require_proxy_from_env();
11710
- var http2 = require("http");
11710
+ var http3 = require("http");
11711
11711
  var https2 = require("https");
11712
+ var http22 = require("http2");
11712
11713
  var util3 = require("util");
11713
11714
  var followRedirects2 = require_follow_redirects();
11714
11715
  var zlib2 = require("zlib");
@@ -11721,8 +11722,9 @@ var require_axios = __commonJS({
11721
11722
  var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto2);
11722
11723
  var url__default = /* @__PURE__ */ _interopDefaultLegacy(url2);
11723
11724
  var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv2);
11724
- var http__default = /* @__PURE__ */ _interopDefaultLegacy(http2);
11725
+ var http__default = /* @__PURE__ */ _interopDefaultLegacy(http3);
11725
11726
  var https__default = /* @__PURE__ */ _interopDefaultLegacy(https2);
11727
+ var http2__default = /* @__PURE__ */ _interopDefaultLegacy(http22);
11726
11728
  var util__default = /* @__PURE__ */ _interopDefaultLegacy(util3);
11727
11729
  var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects2);
11728
11730
  var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib2);
@@ -11747,7 +11749,7 @@ var require_axios = __commonJS({
11747
11749
  var { isArray: isArray2 } = Array;
11748
11750
  var isUndefined2 = typeOfTest2("undefined");
11749
11751
  function isBuffer2(val) {
11750
- return val !== null && !isUndefined2(val) && val.constructor !== null && !isUndefined2(val.constructor) && isFunction2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11752
+ return val !== null && !isUndefined2(val) && val.constructor !== null && !isUndefined2(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11751
11753
  }
11752
11754
  var isArrayBuffer2 = kindOfTest2("ArrayBuffer");
11753
11755
  function isArrayBufferView2(val) {
@@ -11760,7 +11762,7 @@ var require_axios = __commonJS({
11760
11762
  return result;
11761
11763
  }
11762
11764
  var isString2 = typeOfTest2("string");
11763
- var isFunction2 = typeOfTest2("function");
11765
+ var isFunction$1 = typeOfTest2("function");
11764
11766
  var isNumber2 = typeOfTest2("number");
11765
11767
  var isObject2 = (thing) => thing !== null && typeof thing === "object";
11766
11768
  var isBoolean2 = (thing) => thing === true || thing === false;
@@ -11785,11 +11787,11 @@ var require_axios = __commonJS({
11785
11787
  var isFile2 = kindOfTest2("File");
11786
11788
  var isBlob2 = kindOfTest2("Blob");
11787
11789
  var isFileList2 = kindOfTest2("FileList");
11788
- var isStream2 = (val) => isObject2(val) && isFunction2(val.pipe);
11790
+ var isStream2 = (val) => isObject2(val) && isFunction$1(val.pipe);
11789
11791
  var isFormData2 = (thing) => {
11790
11792
  let kind;
11791
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction2(thing.append) && ((kind = kindOf2(thing)) === "formdata" || // detect form-data instance
11792
- kind === "object" && isFunction2(thing.toString) && thing.toString() === "[object FormData]"));
11793
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf2(thing)) === "formdata" || // detect form-data instance
11794
+ kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
11793
11795
  };
11794
11796
  var isURLSearchParams2 = kindOfTest2("URLSearchParams");
11795
11797
  var [isReadableStream2, isRequest2, isResponse2, isHeaders2] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest2);
@@ -11842,7 +11844,7 @@ var require_axios = __commonJS({
11842
11844
  })();
11843
11845
  var isContextDefined2 = (context) => !isUndefined2(context) && context !== _global2;
11844
11846
  function merge2() {
11845
- const { caseless } = isContextDefined2(this) && this || {};
11847
+ const { caseless, skipUndefined } = isContextDefined2(this) && this || {};
11846
11848
  const result = {};
11847
11849
  const assignValue = (val, key) => {
11848
11850
  const targetKey = caseless && findKey2(result, key) || key;
@@ -11852,7 +11854,7 @@ var require_axios = __commonJS({
11852
11854
  result[targetKey] = merge2({}, val);
11853
11855
  } else if (isArray2(val)) {
11854
11856
  result[targetKey] = val.slice();
11855
- } else {
11857
+ } else if (!skipUndefined || !isUndefined2(val)) {
11856
11858
  result[targetKey] = val;
11857
11859
  }
11858
11860
  };
@@ -11863,7 +11865,7 @@ var require_axios = __commonJS({
11863
11865
  }
11864
11866
  var extend2 = (a, b, thisArg, { allOwnKeys } = {}) => {
11865
11867
  forEach2(b, (val, key) => {
11866
- if (thisArg && isFunction2(val)) {
11868
+ if (thisArg && isFunction$1(val)) {
11867
11869
  a[key] = bind2(val, thisArg);
11868
11870
  } else {
11869
11871
  a[key] = val;
@@ -11972,11 +11974,11 @@ var require_axios = __commonJS({
11972
11974
  };
11973
11975
  var freezeMethods2 = (obj) => {
11974
11976
  reduceDescriptors2(obj, (descriptor, name) => {
11975
- if (isFunction2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11977
+ if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11976
11978
  return false;
11977
11979
  }
11978
11980
  const value = obj[name];
11979
- if (!isFunction2(value)) return;
11981
+ if (!isFunction$1(value)) return;
11980
11982
  descriptor.enumerable = false;
11981
11983
  if ("writable" in descriptor) {
11982
11984
  descriptor.writable = false;
@@ -12005,7 +12007,7 @@ var require_axios = __commonJS({
12005
12007
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
12006
12008
  };
12007
12009
  function isSpecCompliantForm2(thing) {
12008
- return !!(thing && isFunction2(thing.append) && thing[toStringTag2] === "FormData" && thing[iterator2]);
12010
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag2] === "FormData" && thing[iterator2]);
12009
12011
  }
12010
12012
  var toJSONObject2 = (obj) => {
12011
12013
  const stack = new Array(10);
@@ -12033,7 +12035,7 @@ var require_axios = __commonJS({
12033
12035
  return visit(obj, 0);
12034
12036
  };
12035
12037
  var isAsyncFn2 = kindOfTest2("AsyncFunction");
12036
- var isThenable2 = (thing) => thing && (isObject2(thing) || isFunction2(thing)) && isFunction2(thing.then) && isFunction2(thing.catch);
12038
+ var isThenable2 = (thing) => thing && (isObject2(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
12037
12039
  var _setImmediate2 = ((setImmediateSupported, postMessageSupported) => {
12038
12040
  if (setImmediateSupported) {
12039
12041
  return setImmediate;
@@ -12051,10 +12053,10 @@ var require_axios = __commonJS({
12051
12053
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
12052
12054
  })(
12053
12055
  typeof setImmediate === "function",
12054
- isFunction2(_global2.postMessage)
12056
+ isFunction$1(_global2.postMessage)
12055
12057
  );
12056
12058
  var asap2 = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global2) : typeof process !== "undefined" && process.nextTick || _setImmediate2;
12057
- var isIterable2 = (thing) => thing != null && isFunction2(thing[iterator2]);
12059
+ var isIterable2 = (thing) => thing != null && isFunction$1(thing[iterator2]);
12058
12060
  var utils$1 = {
12059
12061
  isArray: isArray2,
12060
12062
  isArrayBuffer: isArrayBuffer2,
@@ -12076,7 +12078,7 @@ var require_axios = __commonJS({
12076
12078
  isFile: isFile2,
12077
12079
  isBlob: isBlob2,
12078
12080
  isRegExp: isRegExp2,
12079
- isFunction: isFunction2,
12081
+ isFunction: isFunction$1,
12080
12082
  isStream: isStream2,
12081
12083
  isURLSearchParams: isURLSearchParams2,
12082
12084
  isTypedArray: isTypedArray2,
@@ -12181,9 +12183,13 @@ var require_axios = __commonJS({
12181
12183
  }, (prop) => {
12182
12184
  return prop !== "isAxiosError";
12183
12185
  });
12184
- AxiosError3.call(axiosError, error.message, code, config, request, response);
12185
- axiosError.cause = error;
12186
- axiosError.name = error.name;
12186
+ const msg = error && error.message ? error.message : "Error";
12187
+ const errCode = code == null && error ? error.code : code;
12188
+ AxiosError3.call(axiosError, msg, errCode, config, request, response);
12189
+ if (error && axiosError.cause == null) {
12190
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
12191
+ }
12192
+ axiosError.name = error && error.name || "Error";
12187
12193
  customProps && Object.assign(axiosError, customProps);
12188
12194
  return axiosError;
12189
12195
  };
@@ -12330,7 +12336,7 @@ var require_axios = __commonJS({
12330
12336
  }, "").join("&");
12331
12337
  };
12332
12338
  function encode3(val) {
12333
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
12339
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
12334
12340
  }
12335
12341
  function buildURL2(url3, params, options) {
12336
12342
  if (!params) {
@@ -12384,7 +12390,7 @@ var require_axios = __commonJS({
12384
12390
  *
12385
12391
  * @param {Number} id The ID that was returned by `use`
12386
12392
  *
12387
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
12393
+ * @returns {void}
12388
12394
  */
12389
12395
  eject(id) {
12390
12396
  if (this.handlers[id]) {
@@ -12604,7 +12610,7 @@ var require_axios = __commonJS({
12604
12610
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
12605
12611
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
12606
12612
  try {
12607
- return JSON.parse(data);
12613
+ return JSON.parse(data, this.parseReviver);
12608
12614
  } catch (e) {
12609
12615
  if (strictJSONParsing) {
12610
12616
  if (e.name === "SyntaxError") {
@@ -12961,7 +12967,7 @@ var require_axios = __commonJS({
12961
12967
  }
12962
12968
  return requestedURL;
12963
12969
  }
12964
- var VERSION3 = "1.11.0";
12970
+ var VERSION3 = "1.13.2";
12965
12971
  function parseProtocol2(url3) {
12966
12972
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url3);
12967
12973
  return match && match[1] || "";
@@ -13325,6 +13331,55 @@ var require_axios = __commonJS({
13325
13331
  }), throttled[1]];
13326
13332
  };
13327
13333
  var asyncDecorator2 = (fn) => (...args) => utils$1.asap(() => fn(...args));
13334
+ function estimateDataURLDecodedBytes2(url3) {
13335
+ if (!url3 || typeof url3 !== "string") return 0;
13336
+ if (!url3.startsWith("data:")) return 0;
13337
+ const comma = url3.indexOf(",");
13338
+ if (comma < 0) return 0;
13339
+ const meta = url3.slice(5, comma);
13340
+ const body = url3.slice(comma + 1);
13341
+ const isBase64 = /;base64/i.test(meta);
13342
+ if (isBase64) {
13343
+ let effectiveLen = body.length;
13344
+ const len = body.length;
13345
+ for (let i = 0; i < len; i++) {
13346
+ if (body.charCodeAt(i) === 37 && i + 2 < len) {
13347
+ const a = body.charCodeAt(i + 1);
13348
+ const b = body.charCodeAt(i + 2);
13349
+ const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
13350
+ if (isHex) {
13351
+ effectiveLen -= 2;
13352
+ i += 2;
13353
+ }
13354
+ }
13355
+ }
13356
+ let pad = 0;
13357
+ let idx = len - 1;
13358
+ const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
13359
+ body.charCodeAt(j - 1) === 51 && // '3'
13360
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
13361
+ if (idx >= 0) {
13362
+ if (body.charCodeAt(idx) === 61) {
13363
+ pad++;
13364
+ idx--;
13365
+ } else if (tailIsPct3D(idx)) {
13366
+ pad++;
13367
+ idx -= 3;
13368
+ }
13369
+ }
13370
+ if (pad === 1 && idx >= 0) {
13371
+ if (body.charCodeAt(idx) === 61) {
13372
+ pad++;
13373
+ } else if (tailIsPct3D(idx)) {
13374
+ pad++;
13375
+ }
13376
+ }
13377
+ const groups = Math.floor(effectiveLen / 4);
13378
+ const bytes = groups * 3 - (pad || 0);
13379
+ return bytes > 0 ? bytes : 0;
13380
+ }
13381
+ return Buffer.byteLength(body, "utf8");
13382
+ }
13328
13383
  var zlibOptions2 = {
13329
13384
  flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
13330
13385
  finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
@@ -13343,6 +13398,76 @@ var require_axios = __commonJS({
13343
13398
  stream5.on("end", flush).on("error", flush);
13344
13399
  return throttled;
13345
13400
  };
13401
+ var Http2Sessions2 = class {
13402
+ constructor() {
13403
+ this.sessions = /* @__PURE__ */ Object.create(null);
13404
+ }
13405
+ getSession(authority, options) {
13406
+ options = Object.assign({
13407
+ sessionTimeout: 1e3
13408
+ }, options);
13409
+ let authoritySessions = this.sessions[authority];
13410
+ if (authoritySessions) {
13411
+ let len = authoritySessions.length;
13412
+ for (let i = 0; i < len; i++) {
13413
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
13414
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) {
13415
+ return sessionHandle;
13416
+ }
13417
+ }
13418
+ }
13419
+ const session = http2__default["default"].connect(authority, options);
13420
+ let removed;
13421
+ const removeSession = () => {
13422
+ if (removed) {
13423
+ return;
13424
+ }
13425
+ removed = true;
13426
+ let entries = authoritySessions, len = entries.length, i = len;
13427
+ while (i--) {
13428
+ if (entries[i][0] === session) {
13429
+ if (len === 1) {
13430
+ delete this.sessions[authority];
13431
+ } else {
13432
+ entries.splice(i, 1);
13433
+ }
13434
+ return;
13435
+ }
13436
+ }
13437
+ };
13438
+ const originalRequestFn = session.request;
13439
+ const { sessionTimeout } = options;
13440
+ if (sessionTimeout != null) {
13441
+ let timer;
13442
+ let streamsCount = 0;
13443
+ session.request = function() {
13444
+ const stream5 = originalRequestFn.apply(this, arguments);
13445
+ streamsCount++;
13446
+ if (timer) {
13447
+ clearTimeout(timer);
13448
+ timer = null;
13449
+ }
13450
+ stream5.once("close", () => {
13451
+ if (!--streamsCount) {
13452
+ timer = setTimeout(() => {
13453
+ timer = null;
13454
+ removeSession();
13455
+ }, sessionTimeout);
13456
+ }
13457
+ });
13458
+ return stream5;
13459
+ };
13460
+ }
13461
+ session.once("close", removeSession);
13462
+ let entry = [
13463
+ session,
13464
+ options
13465
+ ];
13466
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
13467
+ return session;
13468
+ }
13469
+ };
13470
+ var http2Sessions2 = new Http2Sessions2();
13346
13471
  function dispatchBeforeRedirect2(options, responseDetails) {
13347
13472
  if (options.beforeRedirects.proxy) {
13348
13473
  options.beforeRedirects.proxy(options);
@@ -13415,14 +13540,54 @@ var require_axios = __commonJS({
13415
13540
  };
13416
13541
  };
13417
13542
  var buildAddressEntry2 = (address, family) => resolveFamily2(utils$1.isObject(address) ? address : { address, family });
13543
+ var http2Transport2 = {
13544
+ request(options, cb) {
13545
+ const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80);
13546
+ const { http2Options, headers } = options;
13547
+ const session = http2Sessions2.getSession(authority, http2Options);
13548
+ const {
13549
+ HTTP2_HEADER_SCHEME,
13550
+ HTTP2_HEADER_METHOD,
13551
+ HTTP2_HEADER_PATH,
13552
+ HTTP2_HEADER_STATUS
13553
+ } = http2__default["default"].constants;
13554
+ const http2Headers = {
13555
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
13556
+ [HTTP2_HEADER_METHOD]: options.method,
13557
+ [HTTP2_HEADER_PATH]: options.path
13558
+ };
13559
+ utils$1.forEach(headers, (header, name) => {
13560
+ name.charAt(0) !== ":" && (http2Headers[name] = header);
13561
+ });
13562
+ const req = session.request(http2Headers);
13563
+ req.once("response", (responseHeaders) => {
13564
+ const response = req;
13565
+ responseHeaders = Object.assign({}, responseHeaders);
13566
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
13567
+ delete responseHeaders[HTTP2_HEADER_STATUS];
13568
+ response.headers = responseHeaders;
13569
+ response.statusCode = +status;
13570
+ cb(response);
13571
+ });
13572
+ return req;
13573
+ }
13574
+ };
13418
13575
  var httpAdapter2 = isHttpAdapterSupported2 && function httpAdapter3(config) {
13419
13576
  return wrapAsync2(async function dispatchHttpRequest(resolve, reject, onDone) {
13420
- let { data, lookup, family } = config;
13577
+ let { data, lookup, family, httpVersion = 1, http2Options } = config;
13421
13578
  const { responseType, responseEncoding } = config;
13422
13579
  const method = config.method.toUpperCase();
13423
13580
  let isDone;
13424
13581
  let rejected = false;
13425
13582
  let req;
13583
+ httpVersion = +httpVersion;
13584
+ if (Number.isNaN(httpVersion)) {
13585
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
13586
+ }
13587
+ if (httpVersion !== 1 && httpVersion !== 2) {
13588
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
13589
+ }
13590
+ const isHttp2 = httpVersion === 2;
13426
13591
  if (lookup) {
13427
13592
  const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
13428
13593
  lookup = (hostname, opt, cb) => {
@@ -13435,7 +13600,15 @@ var require_axios = __commonJS({
13435
13600
  });
13436
13601
  };
13437
13602
  }
13438
- const emitter = new events.EventEmitter();
13603
+ const abortEmitter = new events.EventEmitter();
13604
+ function abort(reason) {
13605
+ try {
13606
+ abortEmitter.emit("abort", !reason || reason.type ? new CanceledError3(null, config, req) : reason);
13607
+ } catch (err) {
13608
+ console.warn("emit error", err);
13609
+ }
13610
+ }
13611
+ abortEmitter.once("abort", reject);
13439
13612
  const onFinished = () => {
13440
13613
  if (config.cancelToken) {
13441
13614
  config.cancelToken.unsubscribe(abort);
@@ -13443,29 +13616,46 @@ var require_axios = __commonJS({
13443
13616
  if (config.signal) {
13444
13617
  config.signal.removeEventListener("abort", abort);
13445
13618
  }
13446
- emitter.removeAllListeners();
13619
+ abortEmitter.removeAllListeners();
13447
13620
  };
13448
- onDone((value, isRejected) => {
13449
- isDone = true;
13450
- if (isRejected) {
13451
- rejected = true;
13452
- onFinished();
13453
- }
13454
- });
13455
- function abort(reason) {
13456
- emitter.emit("abort", !reason || reason.type ? new CanceledError3(null, config, req) : reason);
13457
- }
13458
- emitter.once("abort", reject);
13459
13621
  if (config.cancelToken || config.signal) {
13460
13622
  config.cancelToken && config.cancelToken.subscribe(abort);
13461
13623
  if (config.signal) {
13462
13624
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
13463
13625
  }
13464
13626
  }
13627
+ onDone((response, isRejected) => {
13628
+ isDone = true;
13629
+ if (isRejected) {
13630
+ rejected = true;
13631
+ onFinished();
13632
+ return;
13633
+ }
13634
+ const { data: data2 } = response;
13635
+ if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) {
13636
+ const offListeners = stream__default["default"].finished(data2, () => {
13637
+ offListeners();
13638
+ onFinished();
13639
+ });
13640
+ } else {
13641
+ onFinished();
13642
+ }
13643
+ });
13465
13644
  const fullPath = buildFullPath2(config.baseURL, config.url, config.allowAbsoluteUrls);
13466
13645
  const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0);
13467
13646
  const protocol = parsed.protocol || supportedProtocols2[0];
13468
13647
  if (protocol === "data:") {
13648
+ if (config.maxContentLength > -1) {
13649
+ const dataUrl = String(config.url || fullPath || "");
13650
+ const estimated = estimateDataURLDecodedBytes2(dataUrl);
13651
+ if (estimated > config.maxContentLength) {
13652
+ return reject(new AxiosError3(
13653
+ "maxContentLength size of " + config.maxContentLength + " exceeded",
13654
+ AxiosError3.ERR_BAD_RESPONSE,
13655
+ config
13656
+ ));
13657
+ }
13658
+ }
13469
13659
  let convertedData;
13470
13660
  if (method !== "GET") {
13471
13661
  return settle2(resolve, reject, {
@@ -13616,7 +13806,8 @@ var require_axios = __commonJS({
13616
13806
  protocol,
13617
13807
  family,
13618
13808
  beforeRedirect: dispatchBeforeRedirect2,
13619
- beforeRedirects: {}
13809
+ beforeRedirects: {},
13810
+ http2Options
13620
13811
  };
13621
13812
  !utils$1.isUndefined(lookup) && (options.lookup = lookup);
13622
13813
  if (config.socketPath) {
@@ -13629,18 +13820,22 @@ var require_axios = __commonJS({
13629
13820
  let transport;
13630
13821
  const isHttpsRequest = isHttps2.test(options.protocol);
13631
13822
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
13632
- if (config.transport) {
13633
- transport = config.transport;
13634
- } else if (config.maxRedirects === 0) {
13635
- transport = isHttpsRequest ? https__default["default"] : http__default["default"];
13823
+ if (isHttp2) {
13824
+ transport = http2Transport2;
13636
13825
  } else {
13637
- if (config.maxRedirects) {
13638
- options.maxRedirects = config.maxRedirects;
13639
- }
13640
- if (config.beforeRedirect) {
13641
- options.beforeRedirects.config = config.beforeRedirect;
13826
+ if (config.transport) {
13827
+ transport = config.transport;
13828
+ } else if (config.maxRedirects === 0) {
13829
+ transport = isHttpsRequest ? https__default["default"] : http__default["default"];
13830
+ } else {
13831
+ if (config.maxRedirects) {
13832
+ options.maxRedirects = config.maxRedirects;
13833
+ }
13834
+ if (config.beforeRedirect) {
13835
+ options.beforeRedirects.config = config.beforeRedirect;
13836
+ }
13837
+ transport = isHttpsRequest ? httpsFollow2 : httpFollow2;
13642
13838
  }
13643
- transport = isHttpsRequest ? httpsFollow2 : httpFollow2;
13644
13839
  }
13645
13840
  if (config.maxBodyLength > -1) {
13646
13841
  options.maxBodyLength = config.maxBodyLength;
@@ -13653,7 +13848,7 @@ var require_axios = __commonJS({
13653
13848
  req = transport.request(options, function handleResponse(res) {
13654
13849
  if (req.destroyed) return;
13655
13850
  const streams = [res];
13656
- const responseLength = +res.headers["content-length"];
13851
+ const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]);
13657
13852
  if (onDownloadProgress || maxDownloadRate) {
13658
13853
  const transformStream = new AxiosTransformStream$1({
13659
13854
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
@@ -13695,10 +13890,6 @@ var require_axios = __commonJS({
13695
13890
  }
13696
13891
  }
13697
13892
  responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
13698
- const offListeners = stream__default["default"].finished(responseStream, () => {
13699
- offListeners();
13700
- onFinished();
13701
- });
13702
13893
  const response = {
13703
13894
  status: res.statusCode,
13704
13895
  statusText: res.statusMessage,
@@ -13718,7 +13909,7 @@ var require_axios = __commonJS({
13718
13909
  if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
13719
13910
  rejected = true;
13720
13911
  responseStream.destroy();
13721
- reject(new AxiosError3(
13912
+ abort(new AxiosError3(
13722
13913
  "maxContentLength size of " + config.maxContentLength + " exceeded",
13723
13914
  AxiosError3.ERR_BAD_RESPONSE,
13724
13915
  config,
@@ -13759,16 +13950,19 @@ var require_axios = __commonJS({
13759
13950
  settle2(resolve, reject, response);
13760
13951
  });
13761
13952
  }
13762
- emitter.once("abort", (err) => {
13953
+ abortEmitter.once("abort", (err) => {
13763
13954
  if (!responseStream.destroyed) {
13764
13955
  responseStream.emit("error", err);
13765
13956
  responseStream.destroy();
13766
13957
  }
13767
13958
  });
13768
13959
  });
13769
- emitter.once("abort", (err) => {
13770
- reject(err);
13771
- req.destroy(err);
13960
+ abortEmitter.once("abort", (err) => {
13961
+ if (req.close) {
13962
+ req.close();
13963
+ } else {
13964
+ req.destroy(err);
13965
+ }
13772
13966
  });
13773
13967
  req.on("error", function handleRequestError(err) {
13774
13968
  reject(AxiosError3.from(err, null, config, req));
@@ -13779,7 +13973,7 @@ var require_axios = __commonJS({
13779
13973
  if (config.timeout) {
13780
13974
  const timeout = parseInt(config.timeout, 10);
13781
13975
  if (Number.isNaN(timeout)) {
13782
- reject(new AxiosError3(
13976
+ abort(new AxiosError3(
13783
13977
  "error trying to parse `config.timeout` to int",
13784
13978
  AxiosError3.ERR_BAD_OPTION_VALUE,
13785
13979
  config,
@@ -13794,14 +13988,15 @@ var require_axios = __commonJS({
13794
13988
  if (config.timeoutErrorMessage) {
13795
13989
  timeoutErrorMessage = config.timeoutErrorMessage;
13796
13990
  }
13797
- reject(new AxiosError3(
13991
+ abort(new AxiosError3(
13798
13992
  timeoutErrorMessage,
13799
13993
  transitional2.clarifyTimeoutError ? AxiosError3.ETIMEDOUT : AxiosError3.ECONNABORTED,
13800
13994
  config,
13801
13995
  req
13802
13996
  ));
13803
- abort();
13804
13997
  });
13998
+ } else {
13999
+ req.setTimeout(0);
13805
14000
  }
13806
14001
  if (utils$1.isStream(data)) {
13807
14002
  let ended = false;
@@ -13820,7 +14015,8 @@ var require_axios = __commonJS({
13820
14015
  });
13821
14016
  data.pipe(req);
13822
14017
  } else {
13823
- req.end(data);
14018
+ data && req.write(data);
14019
+ req.end();
13824
14020
  }
13825
14021
  });
13826
14022
  };
@@ -13834,20 +14030,33 @@ var require_axios = __commonJS({
13834
14030
  var cookies = platform.hasStandardBrowserEnv ? (
13835
14031
  // Standard browser envs support document.cookie
13836
14032
  {
13837
- write(name, value, expires, path, domain, secure) {
13838
- const cookie = [name + "=" + encodeURIComponent(value)];
13839
- utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
13840
- utils$1.isString(path) && cookie.push("path=" + path);
13841
- utils$1.isString(domain) && cookie.push("domain=" + domain);
13842
- secure === true && cookie.push("secure");
14033
+ write(name, value, expires, path, domain, secure, sameSite) {
14034
+ if (typeof document === "undefined") return;
14035
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
14036
+ if (utils$1.isNumber(expires)) {
14037
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
14038
+ }
14039
+ if (utils$1.isString(path)) {
14040
+ cookie.push(`path=${path}`);
14041
+ }
14042
+ if (utils$1.isString(domain)) {
14043
+ cookie.push(`domain=${domain}`);
14044
+ }
14045
+ if (secure === true) {
14046
+ cookie.push("secure");
14047
+ }
14048
+ if (utils$1.isString(sameSite)) {
14049
+ cookie.push(`SameSite=${sameSite}`);
14050
+ }
13843
14051
  document.cookie = cookie.join("; ");
13844
14052
  },
13845
14053
  read(name) {
13846
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
13847
- return match ? decodeURIComponent(match[3]) : null;
14054
+ if (typeof document === "undefined") return null;
14055
+ const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
14056
+ return match ? decodeURIComponent(match[1]) : null;
13848
14057
  },
13849
14058
  remove(name) {
13850
- this.write(name, "", Date.now() - 864e5);
14059
+ this.write(name, "", Date.now() - 864e5, "/");
13851
14060
  }
13852
14061
  }
13853
14062
  ) : (
@@ -13951,13 +14160,17 @@ var require_axios = __commonJS({
13951
14160
  "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
13952
14161
  );
13953
14162
  }
13954
- let contentType;
13955
14163
  if (utils$1.isFormData(data)) {
13956
14164
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
13957
14165
  headers.setContentType(void 0);
13958
- } else if ((contentType = headers.getContentType()) !== false) {
13959
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
13960
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
14166
+ } else if (utils$1.isFunction(data.getHeaders)) {
14167
+ const formHeaders = data.getHeaders();
14168
+ const allowedHeaders = ["content-type", "content-length"];
14169
+ Object.entries(formHeaders).forEach(([key, val]) => {
14170
+ if (allowedHeaders.includes(key.toLowerCase())) {
14171
+ headers.set(key, val);
14172
+ }
14173
+ });
13961
14174
  }
13962
14175
  }
13963
14176
  if (platform.hasStandardBrowserEnv) {
@@ -14035,8 +14248,11 @@ var require_axios = __commonJS({
14035
14248
  reject(new AxiosError3("Request aborted", AxiosError3.ECONNABORTED, config, request));
14036
14249
  request = null;
14037
14250
  };
14038
- request.onerror = function handleError() {
14039
- reject(new AxiosError3("Network Error", AxiosError3.ERR_NETWORK, config, request));
14251
+ request.onerror = function handleError(event) {
14252
+ const msg = event && event.message ? event.message : "Network Error";
14253
+ const err = new AxiosError3(msg, AxiosError3.ERR_NETWORK, config, request);
14254
+ err.event = event || null;
14255
+ reject(err);
14040
14256
  request = null;
14041
14257
  };
14042
14258
  request.ontimeout = function handleTimeout() {
@@ -14205,9 +14421,16 @@ var require_axios = __commonJS({
14205
14421
  highWaterMark: 2
14206
14422
  });
14207
14423
  };
14208
- var isFetchSupported2 = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
14209
- var isReadableStreamSupported2 = isFetchSupported2 && typeof ReadableStream === "function";
14210
- var encodeText2 = isFetchSupported2 && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
14424
+ var DEFAULT_CHUNK_SIZE2 = 64 * 1024;
14425
+ var { isFunction: isFunction3 } = utils$1;
14426
+ var globalFetchAPI2 = (({ Request, Response }) => ({
14427
+ Request,
14428
+ Response
14429
+ }))(utils$1.global);
14430
+ var {
14431
+ ReadableStream: ReadableStream$1,
14432
+ TextEncoder: TextEncoder$1
14433
+ } = utils$1.global;
14211
14434
  var test2 = (fn, ...args) => {
14212
14435
  try {
14213
14436
  return !!fn(...args);
@@ -14215,162 +14438,202 @@ var require_axios = __commonJS({
14215
14438
  return false;
14216
14439
  }
14217
14440
  };
14218
- var supportsRequestStream2 = isReadableStreamSupported2 && test2(() => {
14219
- let duplexAccessed = false;
14220
- const hasContentType = new Request(platform.origin, {
14221
- body: new ReadableStream(),
14222
- method: "POST",
14223
- get duplex() {
14224
- duplexAccessed = true;
14225
- return "half";
14226
- }
14227
- }).headers.has("Content-Type");
14228
- return duplexAccessed && !hasContentType;
14229
- });
14230
- var DEFAULT_CHUNK_SIZE2 = 64 * 1024;
14231
- var supportsResponseStream2 = isReadableStreamSupported2 && test2(() => utils$1.isReadableStream(new Response("").body));
14232
- var resolvers2 = {
14233
- stream: supportsResponseStream2 && ((res) => res.body)
14234
- };
14235
- isFetchSupported2 && ((res) => {
14236
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
14237
- !resolvers2[type] && (resolvers2[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
14238
- throw new AxiosError3(`Response type '${type}' is not supported`, AxiosError3.ERR_NOT_SUPPORT, config);
14239
- });
14240
- });
14241
- })(new Response());
14242
- var getBodyLength2 = async (body) => {
14243
- if (body == null) {
14244
- return 0;
14245
- }
14246
- if (utils$1.isBlob(body)) {
14247
- return body.size;
14441
+ var factory2 = (env) => {
14442
+ env = utils$1.merge.call({
14443
+ skipUndefined: true
14444
+ }, globalFetchAPI2, env);
14445
+ const { fetch: envFetch, Request, Response } = env;
14446
+ const isFetchSupported = envFetch ? isFunction3(envFetch) : typeof fetch === "function";
14447
+ const isRequestSupported = isFunction3(Request);
14448
+ const isResponseSupported = isFunction3(Response);
14449
+ if (!isFetchSupported) {
14450
+ return false;
14248
14451
  }
14249
- if (utils$1.isSpecCompliantForm(body)) {
14250
- const _request = new Request(platform.origin, {
14452
+ const isReadableStreamSupported = isFetchSupported && isFunction3(ReadableStream$1);
14453
+ const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
14454
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test2(() => {
14455
+ let duplexAccessed = false;
14456
+ const hasContentType = new Request(platform.origin, {
14457
+ body: new ReadableStream$1(),
14251
14458
  method: "POST",
14252
- body
14253
- });
14254
- return (await _request.arrayBuffer()).byteLength;
14255
- }
14256
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
14257
- return body.byteLength;
14258
- }
14259
- if (utils$1.isURLSearchParams(body)) {
14260
- body = body + "";
14261
- }
14262
- if (utils$1.isString(body)) {
14263
- return (await encodeText2(body)).byteLength;
14264
- }
14265
- };
14266
- var resolveBodyLength2 = async (headers, body) => {
14267
- const length = utils$1.toFiniteNumber(headers.getContentLength());
14268
- return length == null ? getBodyLength2(body) : length;
14269
- };
14270
- var fetchAdapter = isFetchSupported2 && (async (config) => {
14271
- let {
14272
- url: url3,
14273
- method,
14274
- data,
14275
- signal,
14276
- cancelToken,
14277
- timeout,
14278
- onDownloadProgress,
14279
- onUploadProgress,
14280
- responseType,
14281
- headers,
14282
- withCredentials = "same-origin",
14283
- fetchOptions
14284
- } = resolveConfig(config);
14285
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
14286
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
14287
- let request;
14288
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
14289
- composedSignal.unsubscribe();
14459
+ get duplex() {
14460
+ duplexAccessed = true;
14461
+ return "half";
14462
+ }
14463
+ }).headers.has("Content-Type");
14464
+ return duplexAccessed && !hasContentType;
14290
14465
  });
14291
- let requestContentLength;
14292
- try {
14293
- if (onUploadProgress && supportsRequestStream2 && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength2(headers, data)) !== 0) {
14294
- let _request = new Request(url3, {
14295
- method: "POST",
14296
- body: data,
14297
- duplex: "half"
14466
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test2(() => utils$1.isReadableStream(new Response("").body));
14467
+ const resolvers = {
14468
+ stream: supportsResponseStream && ((res) => res.body)
14469
+ };
14470
+ isFetchSupported && (() => {
14471
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
14472
+ !resolvers[type] && (resolvers[type] = (res, config) => {
14473
+ let method = res && res[type];
14474
+ if (method) {
14475
+ return method.call(res);
14476
+ }
14477
+ throw new AxiosError3(`Response type '${type}' is not supported`, AxiosError3.ERR_NOT_SUPPORT, config);
14298
14478
  });
14299
- let contentTypeHeader;
14300
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
14301
- headers.setContentType(contentTypeHeader);
14302
- }
14303
- if (_request.body) {
14304
- const [onProgress, flush] = progressEventDecorator2(
14305
- requestContentLength,
14306
- progressEventReducer2(asyncDecorator2(onUploadProgress))
14307
- );
14308
- data = trackStream2(_request.body, DEFAULT_CHUNK_SIZE2, onProgress, flush);
14309
- }
14479
+ });
14480
+ })();
14481
+ const getBodyLength = async (body) => {
14482
+ if (body == null) {
14483
+ return 0;
14310
14484
  }
14311
- if (!utils$1.isString(withCredentials)) {
14312
- withCredentials = withCredentials ? "include" : "omit";
14485
+ if (utils$1.isBlob(body)) {
14486
+ return body.size;
14313
14487
  }
14314
- const isCredentialsSupported = "credentials" in Request.prototype;
14315
- request = new Request(url3, {
14316
- ...fetchOptions,
14317
- signal: composedSignal,
14318
- method: method.toUpperCase(),
14319
- headers: headers.normalize().toJSON(),
14320
- body: data,
14321
- duplex: "half",
14322
- credentials: isCredentialsSupported ? withCredentials : void 0
14323
- });
14324
- let response = await fetch(request, fetchOptions);
14325
- const isStreamResponse = supportsResponseStream2 && (responseType === "stream" || responseType === "response");
14326
- if (supportsResponseStream2 && (onDownloadProgress || isStreamResponse && unsubscribe)) {
14327
- const options = {};
14328
- ["status", "statusText", "headers"].forEach((prop) => {
14329
- options[prop] = response[prop];
14488
+ if (utils$1.isSpecCompliantForm(body)) {
14489
+ const _request = new Request(platform.origin, {
14490
+ method: "POST",
14491
+ body
14330
14492
  });
14331
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
14332
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator2(
14333
- responseContentLength,
14334
- progressEventReducer2(asyncDecorator2(onDownloadProgress), true)
14335
- ) || [];
14336
- response = new Response(
14337
- trackStream2(response.body, DEFAULT_CHUNK_SIZE2, onProgress, () => {
14338
- flush && flush();
14339
- unsubscribe && unsubscribe();
14340
- }),
14341
- options
14342
- );
14493
+ return (await _request.arrayBuffer()).byteLength;
14343
14494
  }
14344
- responseType = responseType || "text";
14345
- let responseData = await resolvers2[utils$1.findKey(resolvers2, responseType) || "text"](response, config);
14346
- !isStreamResponse && unsubscribe && unsubscribe();
14347
- return await new Promise((resolve, reject) => {
14348
- settle2(resolve, reject, {
14349
- data: responseData,
14350
- headers: AxiosHeaders$1.from(response.headers),
14351
- status: response.status,
14352
- statusText: response.statusText,
14353
- config,
14354
- request
14355
- });
14495
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
14496
+ return body.byteLength;
14497
+ }
14498
+ if (utils$1.isURLSearchParams(body)) {
14499
+ body = body + "";
14500
+ }
14501
+ if (utils$1.isString(body)) {
14502
+ return (await encodeText(body)).byteLength;
14503
+ }
14504
+ };
14505
+ const resolveBodyLength = async (headers, body) => {
14506
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
14507
+ return length == null ? getBodyLength(body) : length;
14508
+ };
14509
+ return async (config) => {
14510
+ let {
14511
+ url: url3,
14512
+ method,
14513
+ data,
14514
+ signal,
14515
+ cancelToken,
14516
+ timeout,
14517
+ onDownloadProgress,
14518
+ onUploadProgress,
14519
+ responseType,
14520
+ headers,
14521
+ withCredentials = "same-origin",
14522
+ fetchOptions
14523
+ } = resolveConfig(config);
14524
+ let _fetch = envFetch || fetch;
14525
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
14526
+ let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
14527
+ let request = null;
14528
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
14529
+ composedSignal.unsubscribe();
14356
14530
  });
14357
- } catch (err) {
14358
- unsubscribe && unsubscribe();
14359
- if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
14360
- throw Object.assign(
14361
- new AxiosError3("Network Error", AxiosError3.ERR_NETWORK, config, request),
14362
- {
14363
- cause: err.cause || err
14531
+ let requestContentLength;
14532
+ try {
14533
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
14534
+ let _request = new Request(url3, {
14535
+ method: "POST",
14536
+ body: data,
14537
+ duplex: "half"
14538
+ });
14539
+ let contentTypeHeader;
14540
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
14541
+ headers.setContentType(contentTypeHeader);
14364
14542
  }
14365
- );
14543
+ if (_request.body) {
14544
+ const [onProgress, flush] = progressEventDecorator2(
14545
+ requestContentLength,
14546
+ progressEventReducer2(asyncDecorator2(onUploadProgress))
14547
+ );
14548
+ data = trackStream2(_request.body, DEFAULT_CHUNK_SIZE2, onProgress, flush);
14549
+ }
14550
+ }
14551
+ if (!utils$1.isString(withCredentials)) {
14552
+ withCredentials = withCredentials ? "include" : "omit";
14553
+ }
14554
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
14555
+ const resolvedOptions = {
14556
+ ...fetchOptions,
14557
+ signal: composedSignal,
14558
+ method: method.toUpperCase(),
14559
+ headers: headers.normalize().toJSON(),
14560
+ body: data,
14561
+ duplex: "half",
14562
+ credentials: isCredentialsSupported ? withCredentials : void 0
14563
+ };
14564
+ request = isRequestSupported && new Request(url3, resolvedOptions);
14565
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url3, resolvedOptions));
14566
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
14567
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
14568
+ const options = {};
14569
+ ["status", "statusText", "headers"].forEach((prop) => {
14570
+ options[prop] = response[prop];
14571
+ });
14572
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
14573
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator2(
14574
+ responseContentLength,
14575
+ progressEventReducer2(asyncDecorator2(onDownloadProgress), true)
14576
+ ) || [];
14577
+ response = new Response(
14578
+ trackStream2(response.body, DEFAULT_CHUNK_SIZE2, onProgress, () => {
14579
+ flush && flush();
14580
+ unsubscribe && unsubscribe();
14581
+ }),
14582
+ options
14583
+ );
14584
+ }
14585
+ responseType = responseType || "text";
14586
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
14587
+ !isStreamResponse && unsubscribe && unsubscribe();
14588
+ return await new Promise((resolve, reject) => {
14589
+ settle2(resolve, reject, {
14590
+ data: responseData,
14591
+ headers: AxiosHeaders$1.from(response.headers),
14592
+ status: response.status,
14593
+ statusText: response.statusText,
14594
+ config,
14595
+ request
14596
+ });
14597
+ });
14598
+ } catch (err) {
14599
+ unsubscribe && unsubscribe();
14600
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
14601
+ throw Object.assign(
14602
+ new AxiosError3("Network Error", AxiosError3.ERR_NETWORK, config, request),
14603
+ {
14604
+ cause: err.cause || err
14605
+ }
14606
+ );
14607
+ }
14608
+ throw AxiosError3.from(err, err && err.code, config, request);
14366
14609
  }
14367
- throw AxiosError3.from(err, err && err.code, config, request);
14368
- }
14369
- });
14610
+ };
14611
+ };
14612
+ var seedCache2 = /* @__PURE__ */ new Map();
14613
+ var getFetch2 = (config) => {
14614
+ let env = config && config.env || {};
14615
+ const { fetch: fetch2, Request, Response } = env;
14616
+ const seeds = [
14617
+ Request,
14618
+ Response,
14619
+ fetch2
14620
+ ];
14621
+ let len = seeds.length, i = len, seed, target, map = seedCache2;
14622
+ while (i--) {
14623
+ seed = seeds[i];
14624
+ target = map.get(seed);
14625
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory2(env));
14626
+ map = target;
14627
+ }
14628
+ return target;
14629
+ };
14630
+ getFetch2();
14370
14631
  var knownAdapters2 = {
14371
14632
  http: httpAdapter2,
14372
14633
  xhr: xhrAdapter,
14373
- fetch: fetchAdapter
14634
+ fetch: {
14635
+ get: getFetch2
14636
+ }
14374
14637
  };
14375
14638
  utils$1.forEach(knownAdapters2, (fn, value) => {
14376
14639
  if (fn) {
@@ -14382,41 +14645,50 @@ var require_axios = __commonJS({
14382
14645
  }
14383
14646
  });
14384
14647
  var renderReason2 = (reason) => `- ${reason}`;
14385
- var isResolvedHandle2 = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
14386
- var adapters = {
14387
- getAdapter: (adapters2) => {
14388
- adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
14389
- const { length } = adapters2;
14390
- let nameOrAdapter;
14391
- let adapter;
14392
- const rejectedReasons = {};
14393
- for (let i = 0; i < length; i++) {
14394
- nameOrAdapter = adapters2[i];
14395
- let id;
14396
- adapter = nameOrAdapter;
14397
- if (!isResolvedHandle2(nameOrAdapter)) {
14398
- adapter = knownAdapters2[(id = String(nameOrAdapter)).toLowerCase()];
14399
- if (adapter === void 0) {
14400
- throw new AxiosError3(`Unknown adapter '${id}'`);
14401
- }
14402
- }
14403
- if (adapter) {
14404
- break;
14648
+ var isResolvedHandle2 = (adapter2) => utils$1.isFunction(adapter2) || adapter2 === null || adapter2 === false;
14649
+ function getAdapter3(adapters2, config) {
14650
+ adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
14651
+ const { length } = adapters2;
14652
+ let nameOrAdapter;
14653
+ let adapter2;
14654
+ const rejectedReasons = {};
14655
+ for (let i = 0; i < length; i++) {
14656
+ nameOrAdapter = adapters2[i];
14657
+ let id;
14658
+ adapter2 = nameOrAdapter;
14659
+ if (!isResolvedHandle2(nameOrAdapter)) {
14660
+ adapter2 = knownAdapters2[(id = String(nameOrAdapter)).toLowerCase()];
14661
+ if (adapter2 === void 0) {
14662
+ throw new AxiosError3(`Unknown adapter '${id}'`);
14405
14663
  }
14406
- rejectedReasons[id || "#" + i] = adapter;
14407
14664
  }
14408
- if (!adapter) {
14409
- const reasons = Object.entries(rejectedReasons).map(
14410
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
14411
- );
14412
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason2).join("\n") : " " + renderReason2(reasons[0]) : "as no adapter specified";
14413
- throw new AxiosError3(
14414
- `There is no suitable adapter to dispatch the request ` + s,
14415
- "ERR_NOT_SUPPORT"
14416
- );
14665
+ if (adapter2 && (utils$1.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
14666
+ break;
14417
14667
  }
14418
- return adapter;
14419
- },
14668
+ rejectedReasons[id || "#" + i] = adapter2;
14669
+ }
14670
+ if (!adapter2) {
14671
+ const reasons = Object.entries(rejectedReasons).map(
14672
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
14673
+ );
14674
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason2).join("\n") : " " + renderReason2(reasons[0]) : "as no adapter specified";
14675
+ throw new AxiosError3(
14676
+ `There is no suitable adapter to dispatch the request ` + s,
14677
+ "ERR_NOT_SUPPORT"
14678
+ );
14679
+ }
14680
+ return adapter2;
14681
+ }
14682
+ var adapters = {
14683
+ /**
14684
+ * Resolve an adapter from a list of adapter names or functions.
14685
+ * @type {Function}
14686
+ */
14687
+ getAdapter: getAdapter3,
14688
+ /**
14689
+ * Exposes all known adapters
14690
+ * @type {Object<string, Function|Object>}
14691
+ */
14420
14692
  adapters: knownAdapters2
14421
14693
  };
14422
14694
  function throwIfCancellationRequested2(config) {
@@ -14437,8 +14709,8 @@ var require_axios = __commonJS({
14437
14709
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
14438
14710
  config.headers.setContentType("application/x-www-form-urlencoded", false);
14439
14711
  }
14440
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
14441
- return adapter(config).then(function onAdapterResolution(response) {
14712
+ const adapter2 = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
14713
+ return adapter2(config).then(function onAdapterResolution(response) {
14442
14714
  throwIfCancellationRequested2(config);
14443
14715
  response.data = transformData2.call(
14444
14716
  config,
@@ -14640,7 +14912,6 @@ var require_axios = __commonJS({
14640
14912
  }
14641
14913
  len = requestInterceptorChain.length;
14642
14914
  let newConfig = config;
14643
- i = 0;
14644
14915
  while (i < len) {
14645
14916
  const onFulfilled = requestInterceptorChain[i++];
14646
14917
  const onRejected = requestInterceptorChain[i++];
@@ -14862,7 +15133,13 @@ var require_axios = __commonJS({
14862
15133
  InsufficientStorage: 507,
14863
15134
  LoopDetected: 508,
14864
15135
  NotExtended: 510,
14865
- NetworkAuthenticationRequired: 511
15136
+ NetworkAuthenticationRequired: 511,
15137
+ WebServerIsDown: 521,
15138
+ ConnectionTimedOut: 522,
15139
+ OriginIsUnreachable: 523,
15140
+ TimeoutOccurred: 524,
15141
+ SslHandshakeFailed: 525,
15142
+ InvalidSslCertificate: 526
14866
15143
  };
14867
15144
  Object.entries(HttpStatusCode3).forEach(([key, value]) => {
14868
15145
  HttpStatusCode3[value] = key;
@@ -15248,7 +15525,7 @@ var _global = (() => {
15248
15525
  })();
15249
15526
  var isContextDefined = (context) => !isUndefined(context) && context !== _global;
15250
15527
  function merge() {
15251
- const { caseless } = isContextDefined(this) && this || {};
15528
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
15252
15529
  const result = {};
15253
15530
  const assignValue = (val, key) => {
15254
15531
  const targetKey = caseless && findKey(result, key) || key;
@@ -15258,7 +15535,7 @@ function merge() {
15258
15535
  result[targetKey] = merge({}, val);
15259
15536
  } else if (isArray(val)) {
15260
15537
  result[targetKey] = val.slice();
15261
- } else {
15538
+ } else if (!skipUndefined || !isUndefined(val)) {
15262
15539
  result[targetKey] = val;
15263
15540
  }
15264
15541
  };
@@ -15589,9 +15866,13 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
15589
15866
  }, (prop) => {
15590
15867
  return prop !== "isAxiosError";
15591
15868
  });
15592
- AxiosError.call(axiosError, error.message, code, config, request, response);
15593
- axiosError.cause = error;
15594
- axiosError.name = error.name;
15869
+ const msg = error && error.message ? error.message : "Error";
15870
+ const errCode = code == null && error ? error.code : code;
15871
+ AxiosError.call(axiosError, msg, errCode, config, request, response);
15872
+ if (error && axiosError.cause == null) {
15873
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
15874
+ }
15875
+ axiosError.name = error && error.name || "Error";
15595
15876
  customProps && Object.assign(axiosError, customProps);
15596
15877
  return axiosError;
15597
15878
  };
@@ -15751,7 +16032,7 @@ var AxiosURLSearchParams_default = AxiosURLSearchParams;
15751
16032
 
15752
16033
  // node_modules/axios/lib/helpers/buildURL.js
15753
16034
  function encode2(val) {
15754
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
16035
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
15755
16036
  }
15756
16037
  function buildURL(url2, params, options) {
15757
16038
  if (!params) {
@@ -15807,7 +16088,7 @@ var InterceptorManager = class {
15807
16088
  *
15808
16089
  * @param {Number} id The ID that was returned by `use`
15809
16090
  *
15810
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
16091
+ * @returns {void}
15811
16092
  */
15812
16093
  eject(id) {
15813
16094
  if (this.handlers[id]) {
@@ -16048,7 +16329,7 @@ var defaults = {
16048
16329
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
16049
16330
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
16050
16331
  try {
16051
- return JSON.parse(data);
16332
+ return JSON.parse(data, this.parseReviver);
16052
16333
  } catch (e) {
16053
16334
  if (strictJSONParsing) {
16054
16335
  if (e.name === "SyntaxError") {
@@ -16429,12 +16710,13 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
16429
16710
  var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
16430
16711
  var import_http = __toESM(require("http"), 1);
16431
16712
  var import_https = __toESM(require("https"), 1);
16713
+ var import_http2 = __toESM(require("http2"), 1);
16432
16714
  var import_util2 = __toESM(require("util"), 1);
16433
16715
  var import_follow_redirects = __toESM(require_follow_redirects(), 1);
16434
16716
  var import_zlib = __toESM(require("zlib"), 1);
16435
16717
 
16436
16718
  // node_modules/axios/lib/env/data.js
16437
- var VERSION = "1.11.0";
16719
+ var VERSION = "1.13.2";
16438
16720
 
16439
16721
  // node_modules/axios/lib/helpers/parseProtocol.js
16440
16722
  function parseProtocol(url2) {
@@ -16833,6 +17115,57 @@ var progressEventDecorator = (total, throttled) => {
16833
17115
  };
16834
17116
  var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
16835
17117
 
17118
+ // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
17119
+ function estimateDataURLDecodedBytes(url2) {
17120
+ if (!url2 || typeof url2 !== "string") return 0;
17121
+ if (!url2.startsWith("data:")) return 0;
17122
+ const comma = url2.indexOf(",");
17123
+ if (comma < 0) return 0;
17124
+ const meta = url2.slice(5, comma);
17125
+ const body = url2.slice(comma + 1);
17126
+ const isBase64 = /;base64/i.test(meta);
17127
+ if (isBase64) {
17128
+ let effectiveLen = body.length;
17129
+ const len = body.length;
17130
+ for (let i = 0; i < len; i++) {
17131
+ if (body.charCodeAt(i) === 37 && i + 2 < len) {
17132
+ const a = body.charCodeAt(i + 1);
17133
+ const b = body.charCodeAt(i + 2);
17134
+ const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
17135
+ if (isHex) {
17136
+ effectiveLen -= 2;
17137
+ i += 2;
17138
+ }
17139
+ }
17140
+ }
17141
+ let pad = 0;
17142
+ let idx = len - 1;
17143
+ const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
17144
+ body.charCodeAt(j - 1) === 51 && // '3'
17145
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
17146
+ if (idx >= 0) {
17147
+ if (body.charCodeAt(idx) === 61) {
17148
+ pad++;
17149
+ idx--;
17150
+ } else if (tailIsPct3D(idx)) {
17151
+ pad++;
17152
+ idx -= 3;
17153
+ }
17154
+ }
17155
+ if (pad === 1 && idx >= 0) {
17156
+ if (body.charCodeAt(idx) === 61) {
17157
+ pad++;
17158
+ } else if (tailIsPct3D(idx)) {
17159
+ pad++;
17160
+ }
17161
+ }
17162
+ const groups = Math.floor(effectiveLen / 4);
17163
+ const bytes = groups * 3 - (pad || 0);
17164
+ return bytes > 0 ? bytes : 0;
17165
+ }
17166
+ return Buffer.byteLength(body, "utf8");
17167
+ }
17168
+
16836
17169
  // node_modules/axios/lib/adapters/http.js
16837
17170
  var zlibOptions = {
16838
17171
  flush: import_zlib.default.constants.Z_SYNC_FLUSH,
@@ -16852,6 +17185,76 @@ var flushOnFinish = (stream4, [throttled, flush]) => {
16852
17185
  stream4.on("end", flush).on("error", flush);
16853
17186
  return throttled;
16854
17187
  };
17188
+ var Http2Sessions = class {
17189
+ constructor() {
17190
+ this.sessions = /* @__PURE__ */ Object.create(null);
17191
+ }
17192
+ getSession(authority, options) {
17193
+ options = Object.assign({
17194
+ sessionTimeout: 1e3
17195
+ }, options);
17196
+ let authoritySessions = this.sessions[authority];
17197
+ if (authoritySessions) {
17198
+ let len = authoritySessions.length;
17199
+ for (let i = 0; i < len; i++) {
17200
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
17201
+ if (!sessionHandle.destroyed && !sessionHandle.closed && import_util2.default.isDeepStrictEqual(sessionOptions, options)) {
17202
+ return sessionHandle;
17203
+ }
17204
+ }
17205
+ }
17206
+ const session = import_http2.default.connect(authority, options);
17207
+ let removed;
17208
+ const removeSession = () => {
17209
+ if (removed) {
17210
+ return;
17211
+ }
17212
+ removed = true;
17213
+ let entries = authoritySessions, len = entries.length, i = len;
17214
+ while (i--) {
17215
+ if (entries[i][0] === session) {
17216
+ if (len === 1) {
17217
+ delete this.sessions[authority];
17218
+ } else {
17219
+ entries.splice(i, 1);
17220
+ }
17221
+ return;
17222
+ }
17223
+ }
17224
+ };
17225
+ const originalRequestFn = session.request;
17226
+ const { sessionTimeout } = options;
17227
+ if (sessionTimeout != null) {
17228
+ let timer;
17229
+ let streamsCount = 0;
17230
+ session.request = function() {
17231
+ const stream4 = originalRequestFn.apply(this, arguments);
17232
+ streamsCount++;
17233
+ if (timer) {
17234
+ clearTimeout(timer);
17235
+ timer = null;
17236
+ }
17237
+ stream4.once("close", () => {
17238
+ if (!--streamsCount) {
17239
+ timer = setTimeout(() => {
17240
+ timer = null;
17241
+ removeSession();
17242
+ }, sessionTimeout);
17243
+ }
17244
+ });
17245
+ return stream4;
17246
+ };
17247
+ }
17248
+ session.once("close", removeSession);
17249
+ let entry = [
17250
+ session,
17251
+ options
17252
+ ];
17253
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
17254
+ return session;
17255
+ }
17256
+ };
17257
+ var http2Sessions = new Http2Sessions();
16855
17258
  function dispatchBeforeRedirect(options, responseDetails) {
16856
17259
  if (options.beforeRedirects.proxy) {
16857
17260
  options.beforeRedirects.proxy(options);
@@ -16924,14 +17327,54 @@ var resolveFamily = ({ address, family }) => {
16924
17327
  };
16925
17328
  };
16926
17329
  var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
17330
+ var http2Transport = {
17331
+ request(options, cb) {
17332
+ const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80);
17333
+ const { http2Options, headers } = options;
17334
+ const session = http2Sessions.getSession(authority, http2Options);
17335
+ const {
17336
+ HTTP2_HEADER_SCHEME,
17337
+ HTTP2_HEADER_METHOD,
17338
+ HTTP2_HEADER_PATH,
17339
+ HTTP2_HEADER_STATUS
17340
+ } = import_http2.default.constants;
17341
+ const http2Headers = {
17342
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
17343
+ [HTTP2_HEADER_METHOD]: options.method,
17344
+ [HTTP2_HEADER_PATH]: options.path
17345
+ };
17346
+ utils_default.forEach(headers, (header, name) => {
17347
+ name.charAt(0) !== ":" && (http2Headers[name] = header);
17348
+ });
17349
+ const req = session.request(http2Headers);
17350
+ req.once("response", (responseHeaders) => {
17351
+ const response = req;
17352
+ responseHeaders = Object.assign({}, responseHeaders);
17353
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
17354
+ delete responseHeaders[HTTP2_HEADER_STATUS];
17355
+ response.headers = responseHeaders;
17356
+ response.statusCode = +status;
17357
+ cb(response);
17358
+ });
17359
+ return req;
17360
+ }
17361
+ };
16927
17362
  var http_default = isHttpAdapterSupported && function httpAdapter(config) {
16928
17363
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
16929
- let { data, lookup, family } = config;
17364
+ let { data, lookup, family, httpVersion = 1, http2Options } = config;
16930
17365
  const { responseType, responseEncoding } = config;
16931
17366
  const method = config.method.toUpperCase();
16932
17367
  let isDone;
16933
17368
  let rejected = false;
16934
17369
  let req;
17370
+ httpVersion = +httpVersion;
17371
+ if (Number.isNaN(httpVersion)) {
17372
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
17373
+ }
17374
+ if (httpVersion !== 1 && httpVersion !== 2) {
17375
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
17376
+ }
17377
+ const isHttp2 = httpVersion === 2;
16935
17378
  if (lookup) {
16936
17379
  const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
16937
17380
  lookup = (hostname, opt, cb) => {
@@ -16944,7 +17387,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
16944
17387
  });
16945
17388
  };
16946
17389
  }
16947
- const emitter = new import_events.EventEmitter();
17390
+ const abortEmitter = new import_events.EventEmitter();
17391
+ function abort(reason) {
17392
+ try {
17393
+ abortEmitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
17394
+ } catch (err) {
17395
+ console.warn("emit error", err);
17396
+ }
17397
+ }
17398
+ abortEmitter.once("abort", reject);
16948
17399
  const onFinished = () => {
16949
17400
  if (config.cancelToken) {
16950
17401
  config.cancelToken.unsubscribe(abort);
@@ -16952,29 +17403,46 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
16952
17403
  if (config.signal) {
16953
17404
  config.signal.removeEventListener("abort", abort);
16954
17405
  }
16955
- emitter.removeAllListeners();
17406
+ abortEmitter.removeAllListeners();
16956
17407
  };
16957
- onDone((value, isRejected) => {
16958
- isDone = true;
16959
- if (isRejected) {
16960
- rejected = true;
16961
- onFinished();
16962
- }
16963
- });
16964
- function abort(reason) {
16965
- emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
16966
- }
16967
- emitter.once("abort", reject);
16968
17408
  if (config.cancelToken || config.signal) {
16969
17409
  config.cancelToken && config.cancelToken.subscribe(abort);
16970
17410
  if (config.signal) {
16971
17411
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
16972
17412
  }
16973
17413
  }
17414
+ onDone((response, isRejected) => {
17415
+ isDone = true;
17416
+ if (isRejected) {
17417
+ rejected = true;
17418
+ onFinished();
17419
+ return;
17420
+ }
17421
+ const { data: data2 } = response;
17422
+ if (data2 instanceof import_stream4.default.Readable || data2 instanceof import_stream4.default.Duplex) {
17423
+ const offListeners = import_stream4.default.finished(data2, () => {
17424
+ offListeners();
17425
+ onFinished();
17426
+ });
17427
+ } else {
17428
+ onFinished();
17429
+ }
17430
+ });
16974
17431
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
16975
17432
  const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
16976
17433
  const protocol = parsed.protocol || supportedProtocols[0];
16977
17434
  if (protocol === "data:") {
17435
+ if (config.maxContentLength > -1) {
17436
+ const dataUrl = String(config.url || fullPath || "");
17437
+ const estimated = estimateDataURLDecodedBytes(dataUrl);
17438
+ if (estimated > config.maxContentLength) {
17439
+ return reject(new AxiosError_default(
17440
+ "maxContentLength size of " + config.maxContentLength + " exceeded",
17441
+ AxiosError_default.ERR_BAD_RESPONSE,
17442
+ config
17443
+ ));
17444
+ }
17445
+ }
16978
17446
  let convertedData;
16979
17447
  if (method !== "GET") {
16980
17448
  return settle(resolve, reject, {
@@ -17125,7 +17593,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17125
17593
  protocol,
17126
17594
  family,
17127
17595
  beforeRedirect: dispatchBeforeRedirect,
17128
- beforeRedirects: {}
17596
+ beforeRedirects: {},
17597
+ http2Options
17129
17598
  };
17130
17599
  !utils_default.isUndefined(lookup) && (options.lookup = lookup);
17131
17600
  if (config.socketPath) {
@@ -17138,18 +17607,22 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17138
17607
  let transport;
17139
17608
  const isHttpsRequest = isHttps.test(options.protocol);
17140
17609
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
17141
- if (config.transport) {
17142
- transport = config.transport;
17143
- } else if (config.maxRedirects === 0) {
17144
- transport = isHttpsRequest ? import_https.default : import_http.default;
17610
+ if (isHttp2) {
17611
+ transport = http2Transport;
17145
17612
  } else {
17146
- if (config.maxRedirects) {
17147
- options.maxRedirects = config.maxRedirects;
17148
- }
17149
- if (config.beforeRedirect) {
17150
- options.beforeRedirects.config = config.beforeRedirect;
17613
+ if (config.transport) {
17614
+ transport = config.transport;
17615
+ } else if (config.maxRedirects === 0) {
17616
+ transport = isHttpsRequest ? import_https.default : import_http.default;
17617
+ } else {
17618
+ if (config.maxRedirects) {
17619
+ options.maxRedirects = config.maxRedirects;
17620
+ }
17621
+ if (config.beforeRedirect) {
17622
+ options.beforeRedirects.config = config.beforeRedirect;
17623
+ }
17624
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
17151
17625
  }
17152
- transport = isHttpsRequest ? httpsFollow : httpFollow;
17153
17626
  }
17154
17627
  if (config.maxBodyLength > -1) {
17155
17628
  options.maxBodyLength = config.maxBodyLength;
@@ -17162,7 +17635,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17162
17635
  req = transport.request(options, function handleResponse(res) {
17163
17636
  if (req.destroyed) return;
17164
17637
  const streams = [res];
17165
- const responseLength = +res.headers["content-length"];
17638
+ const responseLength = utils_default.toFiniteNumber(res.headers["content-length"]);
17166
17639
  if (onDownloadProgress || maxDownloadRate) {
17167
17640
  const transformStream = new AxiosTransformStream_default({
17168
17641
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
@@ -17204,10 +17677,6 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17204
17677
  }
17205
17678
  }
17206
17679
  responseStream = streams.length > 1 ? import_stream4.default.pipeline(streams, utils_default.noop) : streams[0];
17207
- const offListeners = import_stream4.default.finished(responseStream, () => {
17208
- offListeners();
17209
- onFinished();
17210
- });
17211
17680
  const response = {
17212
17681
  status: res.statusCode,
17213
17682
  statusText: res.statusMessage,
@@ -17227,7 +17696,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17227
17696
  if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
17228
17697
  rejected = true;
17229
17698
  responseStream.destroy();
17230
- reject(new AxiosError_default(
17699
+ abort(new AxiosError_default(
17231
17700
  "maxContentLength size of " + config.maxContentLength + " exceeded",
17232
17701
  AxiosError_default.ERR_BAD_RESPONSE,
17233
17702
  config,
@@ -17268,16 +17737,19 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17268
17737
  settle(resolve, reject, response);
17269
17738
  });
17270
17739
  }
17271
- emitter.once("abort", (err) => {
17740
+ abortEmitter.once("abort", (err) => {
17272
17741
  if (!responseStream.destroyed) {
17273
17742
  responseStream.emit("error", err);
17274
17743
  responseStream.destroy();
17275
17744
  }
17276
17745
  });
17277
17746
  });
17278
- emitter.once("abort", (err) => {
17279
- reject(err);
17280
- req.destroy(err);
17747
+ abortEmitter.once("abort", (err) => {
17748
+ if (req.close) {
17749
+ req.close();
17750
+ } else {
17751
+ req.destroy(err);
17752
+ }
17281
17753
  });
17282
17754
  req.on("error", function handleRequestError(err) {
17283
17755
  reject(AxiosError_default.from(err, null, config, req));
@@ -17288,7 +17760,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17288
17760
  if (config.timeout) {
17289
17761
  const timeout = parseInt(config.timeout, 10);
17290
17762
  if (Number.isNaN(timeout)) {
17291
- reject(new AxiosError_default(
17763
+ abort(new AxiosError_default(
17292
17764
  "error trying to parse `config.timeout` to int",
17293
17765
  AxiosError_default.ERR_BAD_OPTION_VALUE,
17294
17766
  config,
@@ -17303,14 +17775,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17303
17775
  if (config.timeoutErrorMessage) {
17304
17776
  timeoutErrorMessage = config.timeoutErrorMessage;
17305
17777
  }
17306
- reject(new AxiosError_default(
17778
+ abort(new AxiosError_default(
17307
17779
  timeoutErrorMessage,
17308
17780
  transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
17309
17781
  config,
17310
17782
  req
17311
17783
  ));
17312
- abort();
17313
17784
  });
17785
+ } else {
17786
+ req.setTimeout(0);
17314
17787
  }
17315
17788
  if (utils_default.isStream(data)) {
17316
17789
  let ended = false;
@@ -17329,7 +17802,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17329
17802
  });
17330
17803
  data.pipe(req);
17331
17804
  } else {
17332
- req.end(data);
17805
+ data && req.write(data);
17806
+ req.end();
17333
17807
  }
17334
17808
  });
17335
17809
  };
@@ -17347,20 +17821,33 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
17347
17821
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
17348
17822
  // Standard browser envs support document.cookie
17349
17823
  {
17350
- write(name, value, expires, path, domain, secure) {
17351
- const cookie = [name + "=" + encodeURIComponent(value)];
17352
- utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
17353
- utils_default.isString(path) && cookie.push("path=" + path);
17354
- utils_default.isString(domain) && cookie.push("domain=" + domain);
17355
- secure === true && cookie.push("secure");
17824
+ write(name, value, expires, path, domain, secure, sameSite) {
17825
+ if (typeof document === "undefined") return;
17826
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
17827
+ if (utils_default.isNumber(expires)) {
17828
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
17829
+ }
17830
+ if (utils_default.isString(path)) {
17831
+ cookie.push(`path=${path}`);
17832
+ }
17833
+ if (utils_default.isString(domain)) {
17834
+ cookie.push(`domain=${domain}`);
17835
+ }
17836
+ if (secure === true) {
17837
+ cookie.push("secure");
17838
+ }
17839
+ if (utils_default.isString(sameSite)) {
17840
+ cookie.push(`SameSite=${sameSite}`);
17841
+ }
17356
17842
  document.cookie = cookie.join("; ");
17357
17843
  },
17358
17844
  read(name) {
17359
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
17360
- return match ? decodeURIComponent(match[3]) : null;
17845
+ if (typeof document === "undefined") return null;
17846
+ const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
17847
+ return match ? decodeURIComponent(match[1]) : null;
17361
17848
  },
17362
17849
  remove(name) {
17363
- this.write(name, "", Date.now() - 864e5);
17850
+ this.write(name, "", Date.now() - 864e5, "/");
17364
17851
  }
17365
17852
  }
17366
17853
  ) : (
@@ -17468,13 +17955,17 @@ var resolveConfig_default = (config) => {
17468
17955
  "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
17469
17956
  );
17470
17957
  }
17471
- let contentType;
17472
17958
  if (utils_default.isFormData(data)) {
17473
17959
  if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
17474
17960
  headers.setContentType(void 0);
17475
- } else if ((contentType = headers.getContentType()) !== false) {
17476
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
17477
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
17961
+ } else if (utils_default.isFunction(data.getHeaders)) {
17962
+ const formHeaders = data.getHeaders();
17963
+ const allowedHeaders = ["content-type", "content-length"];
17964
+ Object.entries(formHeaders).forEach(([key, val]) => {
17965
+ if (allowedHeaders.includes(key.toLowerCase())) {
17966
+ headers.set(key, val);
17967
+ }
17968
+ });
17478
17969
  }
17479
17970
  }
17480
17971
  if (platform_default.hasStandardBrowserEnv) {
@@ -17554,8 +18045,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
17554
18045
  reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
17555
18046
  request = null;
17556
18047
  };
17557
- request.onerror = function handleError() {
17558
- reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
18048
+ request.onerror = function handleError(event) {
18049
+ const msg = event && event.message ? event.message : "Network Error";
18050
+ const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
18051
+ err.event = event || null;
18052
+ reject(err);
17559
18053
  request = null;
17560
18054
  };
17561
18055
  request.ontimeout = function handleTimeout() {
@@ -17730,9 +18224,16 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
17730
18224
  };
17731
18225
 
17732
18226
  // node_modules/axios/lib/adapters/fetch.js
17733
- var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
17734
- var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
17735
- var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
18227
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
18228
+ var { isFunction: isFunction2 } = utils_default;
18229
+ var globalFetchAPI = (({ Request, Response }) => ({
18230
+ Request,
18231
+ Response
18232
+ }))(utils_default.global);
18233
+ var {
18234
+ ReadableStream: ReadableStream2,
18235
+ TextEncoder: TextEncoder2
18236
+ } = utils_default.global;
17736
18237
  var test = (fn, ...args) => {
17737
18238
  try {
17738
18239
  return !!fn(...args);
@@ -17740,164 +18241,204 @@ var test = (fn, ...args) => {
17740
18241
  return false;
17741
18242
  }
17742
18243
  };
17743
- var supportsRequestStream = isReadableStreamSupported && test(() => {
17744
- let duplexAccessed = false;
17745
- const hasContentType = new Request(platform_default.origin, {
17746
- body: new ReadableStream(),
17747
- method: "POST",
17748
- get duplex() {
17749
- duplexAccessed = true;
17750
- return "half";
17751
- }
17752
- }).headers.has("Content-Type");
17753
- return duplexAccessed && !hasContentType;
17754
- });
17755
- var DEFAULT_CHUNK_SIZE = 64 * 1024;
17756
- var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
17757
- var resolvers = {
17758
- stream: supportsResponseStream && ((res) => res.body)
17759
- };
17760
- isFetchSupported && ((res) => {
17761
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
17762
- !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
17763
- throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
17764
- });
17765
- });
17766
- })(new Response());
17767
- var getBodyLength = async (body) => {
17768
- if (body == null) {
17769
- return 0;
17770
- }
17771
- if (utils_default.isBlob(body)) {
17772
- return body.size;
18244
+ var factory = (env) => {
18245
+ env = utils_default.merge.call({
18246
+ skipUndefined: true
18247
+ }, globalFetchAPI, env);
18248
+ const { fetch: envFetch, Request, Response } = env;
18249
+ const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
18250
+ const isRequestSupported = isFunction2(Request);
18251
+ const isResponseSupported = isFunction2(Response);
18252
+ if (!isFetchSupported) {
18253
+ return false;
17773
18254
  }
17774
- if (utils_default.isSpecCompliantForm(body)) {
17775
- const _request = new Request(platform_default.origin, {
18255
+ const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
18256
+ const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
18257
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
18258
+ let duplexAccessed = false;
18259
+ const hasContentType = new Request(platform_default.origin, {
18260
+ body: new ReadableStream2(),
17776
18261
  method: "POST",
17777
- body
17778
- });
17779
- return (await _request.arrayBuffer()).byteLength;
17780
- }
17781
- if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
17782
- return body.byteLength;
17783
- }
17784
- if (utils_default.isURLSearchParams(body)) {
17785
- body = body + "";
17786
- }
17787
- if (utils_default.isString(body)) {
17788
- return (await encodeText(body)).byteLength;
17789
- }
17790
- };
17791
- var resolveBodyLength = async (headers, body) => {
17792
- const length = utils_default.toFiniteNumber(headers.getContentLength());
17793
- return length == null ? getBodyLength(body) : length;
17794
- };
17795
- var fetch_default = isFetchSupported && (async (config) => {
17796
- let {
17797
- url: url2,
17798
- method,
17799
- data,
17800
- signal,
17801
- cancelToken,
17802
- timeout,
17803
- onDownloadProgress,
17804
- onUploadProgress,
17805
- responseType,
17806
- headers,
17807
- withCredentials = "same-origin",
17808
- fetchOptions
17809
- } = resolveConfig_default(config);
17810
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
17811
- let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
17812
- let request;
17813
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
17814
- composedSignal.unsubscribe();
18262
+ get duplex() {
18263
+ duplexAccessed = true;
18264
+ return "half";
18265
+ }
18266
+ }).headers.has("Content-Type");
18267
+ return duplexAccessed && !hasContentType;
17815
18268
  });
17816
- let requestContentLength;
17817
- try {
17818
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
17819
- let _request = new Request(url2, {
17820
- method: "POST",
17821
- body: data,
17822
- duplex: "half"
18269
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
18270
+ const resolvers = {
18271
+ stream: supportsResponseStream && ((res) => res.body)
18272
+ };
18273
+ isFetchSupported && (() => {
18274
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
18275
+ !resolvers[type] && (resolvers[type] = (res, config) => {
18276
+ let method = res && res[type];
18277
+ if (method) {
18278
+ return method.call(res);
18279
+ }
18280
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
17823
18281
  });
17824
- let contentTypeHeader;
17825
- if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
17826
- headers.setContentType(contentTypeHeader);
17827
- }
17828
- if (_request.body) {
17829
- const [onProgress, flush] = progressEventDecorator(
17830
- requestContentLength,
17831
- progressEventReducer(asyncDecorator(onUploadProgress))
17832
- );
17833
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
17834
- }
18282
+ });
18283
+ })();
18284
+ const getBodyLength = async (body) => {
18285
+ if (body == null) {
18286
+ return 0;
17835
18287
  }
17836
- if (!utils_default.isString(withCredentials)) {
17837
- withCredentials = withCredentials ? "include" : "omit";
18288
+ if (utils_default.isBlob(body)) {
18289
+ return body.size;
17838
18290
  }
17839
- const isCredentialsSupported = "credentials" in Request.prototype;
17840
- request = new Request(url2, {
17841
- ...fetchOptions,
17842
- signal: composedSignal,
17843
- method: method.toUpperCase(),
17844
- headers: headers.normalize().toJSON(),
17845
- body: data,
17846
- duplex: "half",
17847
- credentials: isCredentialsSupported ? withCredentials : void 0
17848
- });
17849
- let response = await fetch(request, fetchOptions);
17850
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
17851
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
17852
- const options = {};
17853
- ["status", "statusText", "headers"].forEach((prop) => {
17854
- options[prop] = response[prop];
18291
+ if (utils_default.isSpecCompliantForm(body)) {
18292
+ const _request = new Request(platform_default.origin, {
18293
+ method: "POST",
18294
+ body
17855
18295
  });
17856
- const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
17857
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
17858
- responseContentLength,
17859
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
17860
- ) || [];
17861
- response = new Response(
17862
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
17863
- flush && flush();
17864
- unsubscribe && unsubscribe();
17865
- }),
17866
- options
17867
- );
18296
+ return (await _request.arrayBuffer()).byteLength;
17868
18297
  }
17869
- responseType = responseType || "text";
17870
- let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
17871
- !isStreamResponse && unsubscribe && unsubscribe();
17872
- return await new Promise((resolve, reject) => {
17873
- settle(resolve, reject, {
17874
- data: responseData,
17875
- headers: AxiosHeaders_default.from(response.headers),
17876
- status: response.status,
17877
- statusText: response.statusText,
17878
- config,
17879
- request
17880
- });
18298
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
18299
+ return body.byteLength;
18300
+ }
18301
+ if (utils_default.isURLSearchParams(body)) {
18302
+ body = body + "";
18303
+ }
18304
+ if (utils_default.isString(body)) {
18305
+ return (await encodeText(body)).byteLength;
18306
+ }
18307
+ };
18308
+ const resolveBodyLength = async (headers, body) => {
18309
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
18310
+ return length == null ? getBodyLength(body) : length;
18311
+ };
18312
+ return async (config) => {
18313
+ let {
18314
+ url: url2,
18315
+ method,
18316
+ data,
18317
+ signal,
18318
+ cancelToken,
18319
+ timeout,
18320
+ onDownloadProgress,
18321
+ onUploadProgress,
18322
+ responseType,
18323
+ headers,
18324
+ withCredentials = "same-origin",
18325
+ fetchOptions
18326
+ } = resolveConfig_default(config);
18327
+ let _fetch = envFetch || fetch;
18328
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
18329
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
18330
+ let request = null;
18331
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
18332
+ composedSignal.unsubscribe();
17881
18333
  });
17882
- } catch (err) {
17883
- unsubscribe && unsubscribe();
17884
- if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
17885
- throw Object.assign(
17886
- new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
17887
- {
17888
- cause: err.cause || err
18334
+ let requestContentLength;
18335
+ try {
18336
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
18337
+ let _request = new Request(url2, {
18338
+ method: "POST",
18339
+ body: data,
18340
+ duplex: "half"
18341
+ });
18342
+ let contentTypeHeader;
18343
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
18344
+ headers.setContentType(contentTypeHeader);
17889
18345
  }
17890
- );
18346
+ if (_request.body) {
18347
+ const [onProgress, flush] = progressEventDecorator(
18348
+ requestContentLength,
18349
+ progressEventReducer(asyncDecorator(onUploadProgress))
18350
+ );
18351
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
18352
+ }
18353
+ }
18354
+ if (!utils_default.isString(withCredentials)) {
18355
+ withCredentials = withCredentials ? "include" : "omit";
18356
+ }
18357
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
18358
+ const resolvedOptions = {
18359
+ ...fetchOptions,
18360
+ signal: composedSignal,
18361
+ method: method.toUpperCase(),
18362
+ headers: headers.normalize().toJSON(),
18363
+ body: data,
18364
+ duplex: "half",
18365
+ credentials: isCredentialsSupported ? withCredentials : void 0
18366
+ };
18367
+ request = isRequestSupported && new Request(url2, resolvedOptions);
18368
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
18369
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
18370
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
18371
+ const options = {};
18372
+ ["status", "statusText", "headers"].forEach((prop) => {
18373
+ options[prop] = response[prop];
18374
+ });
18375
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
18376
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
18377
+ responseContentLength,
18378
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
18379
+ ) || [];
18380
+ response = new Response(
18381
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
18382
+ flush && flush();
18383
+ unsubscribe && unsubscribe();
18384
+ }),
18385
+ options
18386
+ );
18387
+ }
18388
+ responseType = responseType || "text";
18389
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
18390
+ !isStreamResponse && unsubscribe && unsubscribe();
18391
+ return await new Promise((resolve, reject) => {
18392
+ settle(resolve, reject, {
18393
+ data: responseData,
18394
+ headers: AxiosHeaders_default.from(response.headers),
18395
+ status: response.status,
18396
+ statusText: response.statusText,
18397
+ config,
18398
+ request
18399
+ });
18400
+ });
18401
+ } catch (err) {
18402
+ unsubscribe && unsubscribe();
18403
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
18404
+ throw Object.assign(
18405
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
18406
+ {
18407
+ cause: err.cause || err
18408
+ }
18409
+ );
18410
+ }
18411
+ throw AxiosError_default.from(err, err && err.code, config, request);
17891
18412
  }
17892
- throw AxiosError_default.from(err, err && err.code, config, request);
18413
+ };
18414
+ };
18415
+ var seedCache = /* @__PURE__ */ new Map();
18416
+ var getFetch = (config) => {
18417
+ let env = config && config.env || {};
18418
+ const { fetch: fetch2, Request, Response } = env;
18419
+ const seeds = [
18420
+ Request,
18421
+ Response,
18422
+ fetch2
18423
+ ];
18424
+ let len = seeds.length, i = len, seed, target, map = seedCache;
18425
+ while (i--) {
18426
+ seed = seeds[i];
18427
+ target = map.get(seed);
18428
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
18429
+ map = target;
17893
18430
  }
17894
- });
18431
+ return target;
18432
+ };
18433
+ var adapter = getFetch();
17895
18434
 
17896
18435
  // node_modules/axios/lib/adapters/adapters.js
17897
18436
  var knownAdapters = {
17898
18437
  http: http_default,
17899
18438
  xhr: xhr_default,
17900
- fetch: fetch_default
18439
+ fetch: {
18440
+ get: getFetch
18441
+ }
17901
18442
  };
17902
18443
  utils_default.forEach(knownAdapters, (fn, value) => {
17903
18444
  if (fn) {
@@ -17909,41 +18450,50 @@ utils_default.forEach(knownAdapters, (fn, value) => {
17909
18450
  }
17910
18451
  });
17911
18452
  var renderReason = (reason) => `- ${reason}`;
17912
- var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
18453
+ var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
18454
+ function getAdapter(adapters, config) {
18455
+ adapters = utils_default.isArray(adapters) ? adapters : [adapters];
18456
+ const { length } = adapters;
18457
+ let nameOrAdapter;
18458
+ let adapter2;
18459
+ const rejectedReasons = {};
18460
+ for (let i = 0; i < length; i++) {
18461
+ nameOrAdapter = adapters[i];
18462
+ let id;
18463
+ adapter2 = nameOrAdapter;
18464
+ if (!isResolvedHandle(nameOrAdapter)) {
18465
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
18466
+ if (adapter2 === void 0) {
18467
+ throw new AxiosError_default(`Unknown adapter '${id}'`);
18468
+ }
18469
+ }
18470
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
18471
+ break;
18472
+ }
18473
+ rejectedReasons[id || "#" + i] = adapter2;
18474
+ }
18475
+ if (!adapter2) {
18476
+ const reasons = Object.entries(rejectedReasons).map(
18477
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
18478
+ );
18479
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
18480
+ throw new AxiosError_default(
18481
+ `There is no suitable adapter to dispatch the request ` + s,
18482
+ "ERR_NOT_SUPPORT"
18483
+ );
18484
+ }
18485
+ return adapter2;
18486
+ }
17913
18487
  var adapters_default = {
17914
- getAdapter: (adapters) => {
17915
- adapters = utils_default.isArray(adapters) ? adapters : [adapters];
17916
- const { length } = adapters;
17917
- let nameOrAdapter;
17918
- let adapter;
17919
- const rejectedReasons = {};
17920
- for (let i = 0; i < length; i++) {
17921
- nameOrAdapter = adapters[i];
17922
- let id;
17923
- adapter = nameOrAdapter;
17924
- if (!isResolvedHandle(nameOrAdapter)) {
17925
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
17926
- if (adapter === void 0) {
17927
- throw new AxiosError_default(`Unknown adapter '${id}'`);
17928
- }
17929
- }
17930
- if (adapter) {
17931
- break;
17932
- }
17933
- rejectedReasons[id || "#" + i] = adapter;
17934
- }
17935
- if (!adapter) {
17936
- const reasons = Object.entries(rejectedReasons).map(
17937
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
17938
- );
17939
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
17940
- throw new AxiosError_default(
17941
- `There is no suitable adapter to dispatch the request ` + s,
17942
- "ERR_NOT_SUPPORT"
17943
- );
17944
- }
17945
- return adapter;
17946
- },
18488
+ /**
18489
+ * Resolve an adapter from a list of adapter names or functions.
18490
+ * @type {Function}
18491
+ */
18492
+ getAdapter,
18493
+ /**
18494
+ * Exposes all known adapters
18495
+ * @type {Object<string, Function|Object>}
18496
+ */
17947
18497
  adapters: knownAdapters
17948
18498
  };
17949
18499
 
@@ -17966,8 +18516,8 @@ function dispatchRequest(config) {
17966
18516
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
17967
18517
  config.headers.setContentType("application/x-www-form-urlencoded", false);
17968
18518
  }
17969
- const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
17970
- return adapter(config).then(function onAdapterResolution(response) {
18519
+ const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
18520
+ return adapter2(config).then(function onAdapterResolution(response) {
17971
18521
  throwIfCancellationRequested(config);
17972
18522
  response.data = transformData.call(
17973
18523
  config,
@@ -18173,7 +18723,6 @@ var Axios = class {
18173
18723
  }
18174
18724
  len = requestInterceptorChain.length;
18175
18725
  let newConfig = config;
18176
- i = 0;
18177
18726
  while (i < len) {
18178
18727
  const onFulfilled = requestInterceptorChain[i++];
18179
18728
  const onRejected = requestInterceptorChain[i++];
@@ -18403,7 +18952,13 @@ var HttpStatusCode = {
18403
18952
  InsufficientStorage: 507,
18404
18953
  LoopDetected: 508,
18405
18954
  NotExtended: 510,
18406
- NetworkAuthenticationRequired: 511
18955
+ NetworkAuthenticationRequired: 511,
18956
+ WebServerIsDown: 521,
18957
+ ConnectionTimedOut: 522,
18958
+ OriginIsUnreachable: 523,
18959
+ TimeoutOccurred: 524,
18960
+ SslHandshakeFailed: 525,
18961
+ InvalidSslCertificate: 526
18407
18962
  };
18408
18963
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
18409
18964
  HttpStatusCode[value] = key;
@@ -18459,7 +19014,7 @@ var {
18459
19014
  AxiosHeaders: AxiosHeaders2,
18460
19015
  HttpStatusCode: HttpStatusCode2,
18461
19016
  formToJSON,
18462
- getAdapter,
19017
+ getAdapter: getAdapter2,
18463
19018
  mergeConfig: mergeConfig2
18464
19019
  } = axios_default;
18465
19020
 
@@ -18528,6 +19083,6 @@ mime-types/index.js:
18528
19083
  *)
18529
19084
 
18530
19085
  axios/dist/node/axios.cjs:
18531
- (*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors *)
19086
+ (*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors *)
18532
19087
  */
18533
19088
  //# sourceMappingURL=index.js.map