@gammarers/aws-sns-slack-message-lambda-subscription 1.0.15 → 1.0.17

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.
@@ -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) {
@@ -11747,7 +11747,7 @@ var require_axios = __commonJS({
11747
11747
  var { isArray: isArray2 } = Array;
11748
11748
  var isUndefined2 = typeOfTest2("undefined");
11749
11749
  function isBuffer2(val) {
11750
- return val !== null && !isUndefined2(val) && val.constructor !== null && !isUndefined2(val.constructor) && isFunction2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11750
+ return val !== null && !isUndefined2(val) && val.constructor !== null && !isUndefined2(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11751
11751
  }
11752
11752
  var isArrayBuffer2 = kindOfTest2("ArrayBuffer");
11753
11753
  function isArrayBufferView2(val) {
@@ -11760,7 +11760,7 @@ var require_axios = __commonJS({
11760
11760
  return result;
11761
11761
  }
11762
11762
  var isString2 = typeOfTest2("string");
11763
- var isFunction2 = typeOfTest2("function");
11763
+ var isFunction$1 = typeOfTest2("function");
11764
11764
  var isNumber2 = typeOfTest2("number");
11765
11765
  var isObject2 = (thing) => thing !== null && typeof thing === "object";
11766
11766
  var isBoolean2 = (thing) => thing === true || thing === false;
@@ -11785,11 +11785,11 @@ var require_axios = __commonJS({
11785
11785
  var isFile2 = kindOfTest2("File");
11786
11786
  var isBlob2 = kindOfTest2("Blob");
11787
11787
  var isFileList2 = kindOfTest2("FileList");
11788
- var isStream2 = (val) => isObject2(val) && isFunction2(val.pipe);
11788
+ var isStream2 = (val) => isObject2(val) && isFunction$1(val.pipe);
11789
11789
  var isFormData2 = (thing) => {
11790
11790
  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]"));
11791
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf2(thing)) === "formdata" || // detect form-data instance
11792
+ kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
11793
11793
  };
11794
11794
  var isURLSearchParams2 = kindOfTest2("URLSearchParams");
11795
11795
  var [isReadableStream2, isRequest2, isResponse2, isHeaders2] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest2);
@@ -11842,7 +11842,7 @@ var require_axios = __commonJS({
11842
11842
  })();
11843
11843
  var isContextDefined2 = (context) => !isUndefined2(context) && context !== _global2;
11844
11844
  function merge2() {
11845
- const { caseless } = isContextDefined2(this) && this || {};
11845
+ const { caseless, skipUndefined } = isContextDefined2(this) && this || {};
11846
11846
  const result = {};
11847
11847
  const assignValue = (val, key) => {
11848
11848
  const targetKey = caseless && findKey2(result, key) || key;
@@ -11852,7 +11852,7 @@ var require_axios = __commonJS({
11852
11852
  result[targetKey] = merge2({}, val);
11853
11853
  } else if (isArray2(val)) {
11854
11854
  result[targetKey] = val.slice();
11855
- } else {
11855
+ } else if (!skipUndefined || !isUndefined2(val)) {
11856
11856
  result[targetKey] = val;
11857
11857
  }
11858
11858
  };
@@ -11863,7 +11863,7 @@ var require_axios = __commonJS({
11863
11863
  }
11864
11864
  var extend2 = (a, b, thisArg, { allOwnKeys } = {}) => {
11865
11865
  forEach2(b, (val, key) => {
11866
- if (thisArg && isFunction2(val)) {
11866
+ if (thisArg && isFunction$1(val)) {
11867
11867
  a[key] = bind2(val, thisArg);
11868
11868
  } else {
11869
11869
  a[key] = val;
@@ -11972,11 +11972,11 @@ var require_axios = __commonJS({
11972
11972
  };
11973
11973
  var freezeMethods2 = (obj) => {
11974
11974
  reduceDescriptors2(obj, (descriptor, name) => {
11975
- if (isFunction2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11975
+ if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11976
11976
  return false;
11977
11977
  }
11978
11978
  const value = obj[name];
11979
- if (!isFunction2(value)) return;
11979
+ if (!isFunction$1(value)) return;
11980
11980
  descriptor.enumerable = false;
11981
11981
  if ("writable" in descriptor) {
11982
11982
  descriptor.writable = false;
@@ -12005,7 +12005,7 @@ var require_axios = __commonJS({
12005
12005
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
12006
12006
  };
12007
12007
  function isSpecCompliantForm2(thing) {
12008
- return !!(thing && isFunction2(thing.append) && thing[toStringTag2] === "FormData" && thing[iterator2]);
12008
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag2] === "FormData" && thing[iterator2]);
12009
12009
  }
12010
12010
  var toJSONObject2 = (obj) => {
12011
12011
  const stack = new Array(10);
@@ -12033,7 +12033,7 @@ var require_axios = __commonJS({
12033
12033
  return visit(obj, 0);
12034
12034
  };
12035
12035
  var isAsyncFn2 = kindOfTest2("AsyncFunction");
12036
- var isThenable2 = (thing) => thing && (isObject2(thing) || isFunction2(thing)) && isFunction2(thing.then) && isFunction2(thing.catch);
12036
+ var isThenable2 = (thing) => thing && (isObject2(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
12037
12037
  var _setImmediate2 = ((setImmediateSupported, postMessageSupported) => {
12038
12038
  if (setImmediateSupported) {
12039
12039
  return setImmediate;
@@ -12051,10 +12051,10 @@ var require_axios = __commonJS({
12051
12051
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
12052
12052
  })(
12053
12053
  typeof setImmediate === "function",
12054
- isFunction2(_global2.postMessage)
12054
+ isFunction$1(_global2.postMessage)
12055
12055
  );
12056
12056
  var asap2 = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global2) : typeof process !== "undefined" && process.nextTick || _setImmediate2;
12057
- var isIterable2 = (thing) => thing != null && isFunction2(thing[iterator2]);
12057
+ var isIterable2 = (thing) => thing != null && isFunction$1(thing[iterator2]);
12058
12058
  var utils$1 = {
12059
12059
  isArray: isArray2,
12060
12060
  isArrayBuffer: isArrayBuffer2,
@@ -12076,7 +12076,7 @@ var require_axios = __commonJS({
12076
12076
  isFile: isFile2,
12077
12077
  isBlob: isBlob2,
12078
12078
  isRegExp: isRegExp2,
12079
- isFunction: isFunction2,
12079
+ isFunction: isFunction$1,
12080
12080
  isStream: isStream2,
12081
12081
  isURLSearchParams: isURLSearchParams2,
12082
12082
  isTypedArray: isTypedArray2,
@@ -12181,9 +12181,13 @@ var require_axios = __commonJS({
12181
12181
  }, (prop) => {
12182
12182
  return prop !== "isAxiosError";
12183
12183
  });
12184
- AxiosError3.call(axiosError, error.message, code, config, request, response);
12185
- axiosError.cause = error;
12186
- axiosError.name = error.name;
12184
+ const msg = error && error.message ? error.message : "Error";
12185
+ const errCode = code == null && error ? error.code : code;
12186
+ AxiosError3.call(axiosError, msg, errCode, config, request, response);
12187
+ if (error && axiosError.cause == null) {
12188
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
12189
+ }
12190
+ axiosError.name = error && error.name || "Error";
12187
12191
  customProps && Object.assign(axiosError, customProps);
12188
12192
  return axiosError;
12189
12193
  };
@@ -12330,7 +12334,7 @@ var require_axios = __commonJS({
12330
12334
  }, "").join("&");
12331
12335
  };
12332
12336
  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, "]");
12337
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
12334
12338
  }
12335
12339
  function buildURL2(url3, params, options) {
12336
12340
  if (!params) {
@@ -12604,7 +12608,7 @@ var require_axios = __commonJS({
12604
12608
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
12605
12609
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
12606
12610
  try {
12607
- return JSON.parse(data);
12611
+ return JSON.parse(data, this.parseReviver);
12608
12612
  } catch (e) {
12609
12613
  if (strictJSONParsing) {
12610
12614
  if (e.name === "SyntaxError") {
@@ -12961,7 +12965,7 @@ var require_axios = __commonJS({
12961
12965
  }
12962
12966
  return requestedURL;
12963
12967
  }
12964
- var VERSION3 = "1.11.0";
12968
+ var VERSION3 = "1.12.2";
12965
12969
  function parseProtocol2(url3) {
12966
12970
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url3);
12967
12971
  return match && match[1] || "";
@@ -13325,6 +13329,55 @@ var require_axios = __commonJS({
13325
13329
  }), throttled[1]];
13326
13330
  };
13327
13331
  var asyncDecorator2 = (fn) => (...args) => utils$1.asap(() => fn(...args));
13332
+ function estimateDataURLDecodedBytes2(url3) {
13333
+ if (!url3 || typeof url3 !== "string") return 0;
13334
+ if (!url3.startsWith("data:")) return 0;
13335
+ const comma = url3.indexOf(",");
13336
+ if (comma < 0) return 0;
13337
+ const meta = url3.slice(5, comma);
13338
+ const body = url3.slice(comma + 1);
13339
+ const isBase64 = /;base64/i.test(meta);
13340
+ if (isBase64) {
13341
+ let effectiveLen = body.length;
13342
+ const len = body.length;
13343
+ for (let i = 0; i < len; i++) {
13344
+ if (body.charCodeAt(i) === 37 && i + 2 < len) {
13345
+ const a = body.charCodeAt(i + 1);
13346
+ const b = body.charCodeAt(i + 2);
13347
+ 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);
13348
+ if (isHex) {
13349
+ effectiveLen -= 2;
13350
+ i += 2;
13351
+ }
13352
+ }
13353
+ }
13354
+ let pad = 0;
13355
+ let idx = len - 1;
13356
+ const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
13357
+ body.charCodeAt(j - 1) === 51 && // '3'
13358
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
13359
+ if (idx >= 0) {
13360
+ if (body.charCodeAt(idx) === 61) {
13361
+ pad++;
13362
+ idx--;
13363
+ } else if (tailIsPct3D(idx)) {
13364
+ pad++;
13365
+ idx -= 3;
13366
+ }
13367
+ }
13368
+ if (pad === 1 && idx >= 0) {
13369
+ if (body.charCodeAt(idx) === 61) {
13370
+ pad++;
13371
+ } else if (tailIsPct3D(idx)) {
13372
+ pad++;
13373
+ }
13374
+ }
13375
+ const groups = Math.floor(effectiveLen / 4);
13376
+ const bytes = groups * 3 - (pad || 0);
13377
+ return bytes > 0 ? bytes : 0;
13378
+ }
13379
+ return Buffer.byteLength(body, "utf8");
13380
+ }
13328
13381
  var zlibOptions2 = {
13329
13382
  flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
13330
13383
  finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
@@ -13466,6 +13519,17 @@ var require_axios = __commonJS({
13466
13519
  const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0);
13467
13520
  const protocol = parsed.protocol || supportedProtocols2[0];
13468
13521
  if (protocol === "data:") {
13522
+ if (config.maxContentLength > -1) {
13523
+ const dataUrl = String(config.url || fullPath || "");
13524
+ const estimated = estimateDataURLDecodedBytes2(dataUrl);
13525
+ if (estimated > config.maxContentLength) {
13526
+ return reject(new AxiosError3(
13527
+ "maxContentLength size of " + config.maxContentLength + " exceeded",
13528
+ AxiosError3.ERR_BAD_RESPONSE,
13529
+ config
13530
+ ));
13531
+ }
13532
+ }
13469
13533
  let convertedData;
13470
13534
  if (method !== "GET") {
13471
13535
  return settle2(resolve, reject, {
@@ -13951,13 +14015,17 @@ var require_axios = __commonJS({
13951
14015
  "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
13952
14016
  );
13953
14017
  }
13954
- let contentType;
13955
14018
  if (utils$1.isFormData(data)) {
13956
14019
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
13957
14020
  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("; "));
14021
+ } else if (utils$1.isFunction(data.getHeaders)) {
14022
+ const formHeaders = data.getHeaders();
14023
+ const allowedHeaders = ["content-type", "content-length"];
14024
+ Object.entries(formHeaders).forEach(([key, val]) => {
14025
+ if (allowedHeaders.includes(key.toLowerCase())) {
14026
+ headers.set(key, val);
14027
+ }
14028
+ });
13961
14029
  }
13962
14030
  }
13963
14031
  if (platform.hasStandardBrowserEnv) {
@@ -14035,8 +14103,11 @@ var require_axios = __commonJS({
14035
14103
  reject(new AxiosError3("Request aborted", AxiosError3.ECONNABORTED, config, request));
14036
14104
  request = null;
14037
14105
  };
14038
- request.onerror = function handleError() {
14039
- reject(new AxiosError3("Network Error", AxiosError3.ERR_NETWORK, config, request));
14106
+ request.onerror = function handleError(event) {
14107
+ const msg = event && event.message ? event.message : "Network Error";
14108
+ const err = new AxiosError3(msg, AxiosError3.ERR_NETWORK, config, request);
14109
+ err.event = event || null;
14110
+ reject(err);
14040
14111
  request = null;
14041
14112
  };
14042
14113
  request.ontimeout = function handleTimeout() {
@@ -14205,9 +14276,16 @@ var require_axios = __commonJS({
14205
14276
  highWaterMark: 2
14206
14277
  });
14207
14278
  };
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()));
14279
+ var DEFAULT_CHUNK_SIZE2 = 64 * 1024;
14280
+ var { isFunction: isFunction3 } = utils$1;
14281
+ var globalFetchAPI2 = (({ Request, Response }) => ({
14282
+ Request,
14283
+ Response
14284
+ }))(utils$1.global);
14285
+ var {
14286
+ ReadableStream: ReadableStream$1,
14287
+ TextEncoder: TextEncoder$1
14288
+ } = utils$1.global;
14211
14289
  var test2 = (fn, ...args) => {
14212
14290
  try {
14213
14291
  return !!fn(...args);
@@ -14215,162 +14293,202 @@ var require_axios = __commonJS({
14215
14293
  return false;
14216
14294
  }
14217
14295
  };
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;
14296
+ var factory2 = (env) => {
14297
+ env = utils$1.merge.call({
14298
+ skipUndefined: true
14299
+ }, globalFetchAPI2, env);
14300
+ const { fetch: envFetch, Request, Response } = env;
14301
+ const isFetchSupported = envFetch ? isFunction3(envFetch) : typeof fetch === "function";
14302
+ const isRequestSupported = isFunction3(Request);
14303
+ const isResponseSupported = isFunction3(Response);
14304
+ if (!isFetchSupported) {
14305
+ return false;
14248
14306
  }
14249
- if (utils$1.isSpecCompliantForm(body)) {
14250
- const _request = new Request(platform.origin, {
14307
+ const isReadableStreamSupported = isFetchSupported && isFunction3(ReadableStream$1);
14308
+ 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()));
14309
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test2(() => {
14310
+ let duplexAccessed = false;
14311
+ const hasContentType = new Request(platform.origin, {
14312
+ body: new ReadableStream$1(),
14251
14313
  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();
14314
+ get duplex() {
14315
+ duplexAccessed = true;
14316
+ return "half";
14317
+ }
14318
+ }).headers.has("Content-Type");
14319
+ return duplexAccessed && !hasContentType;
14290
14320
  });
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"
14321
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test2(() => utils$1.isReadableStream(new Response("").body));
14322
+ const resolvers = {
14323
+ stream: supportsResponseStream && ((res) => res.body)
14324
+ };
14325
+ isFetchSupported && (() => {
14326
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
14327
+ !resolvers[type] && (resolvers[type] = (res, config) => {
14328
+ let method = res && res[type];
14329
+ if (method) {
14330
+ return method.call(res);
14331
+ }
14332
+ throw new AxiosError3(`Response type '${type}' is not supported`, AxiosError3.ERR_NOT_SUPPORT, config);
14298
14333
  });
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
- }
14334
+ });
14335
+ })();
14336
+ const getBodyLength = async (body) => {
14337
+ if (body == null) {
14338
+ return 0;
14310
14339
  }
14311
- if (!utils$1.isString(withCredentials)) {
14312
- withCredentials = withCredentials ? "include" : "omit";
14340
+ if (utils$1.isBlob(body)) {
14341
+ return body.size;
14313
14342
  }
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];
14343
+ if (utils$1.isSpecCompliantForm(body)) {
14344
+ const _request = new Request(platform.origin, {
14345
+ method: "POST",
14346
+ body
14330
14347
  });
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
- );
14348
+ return (await _request.arrayBuffer()).byteLength;
14343
14349
  }
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
- });
14350
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
14351
+ return body.byteLength;
14352
+ }
14353
+ if (utils$1.isURLSearchParams(body)) {
14354
+ body = body + "";
14355
+ }
14356
+ if (utils$1.isString(body)) {
14357
+ return (await encodeText(body)).byteLength;
14358
+ }
14359
+ };
14360
+ const resolveBodyLength = async (headers, body) => {
14361
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
14362
+ return length == null ? getBodyLength(body) : length;
14363
+ };
14364
+ return async (config) => {
14365
+ let {
14366
+ url: url3,
14367
+ method,
14368
+ data,
14369
+ signal,
14370
+ cancelToken,
14371
+ timeout,
14372
+ onDownloadProgress,
14373
+ onUploadProgress,
14374
+ responseType,
14375
+ headers,
14376
+ withCredentials = "same-origin",
14377
+ fetchOptions
14378
+ } = resolveConfig(config);
14379
+ let _fetch = envFetch || fetch;
14380
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
14381
+ let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
14382
+ let request = null;
14383
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
14384
+ composedSignal.unsubscribe();
14356
14385
  });
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
14386
+ let requestContentLength;
14387
+ try {
14388
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
14389
+ let _request = new Request(url3, {
14390
+ method: "POST",
14391
+ body: data,
14392
+ duplex: "half"
14393
+ });
14394
+ let contentTypeHeader;
14395
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
14396
+ headers.setContentType(contentTypeHeader);
14364
14397
  }
14365
- );
14398
+ if (_request.body) {
14399
+ const [onProgress, flush] = progressEventDecorator2(
14400
+ requestContentLength,
14401
+ progressEventReducer2(asyncDecorator2(onUploadProgress))
14402
+ );
14403
+ data = trackStream2(_request.body, DEFAULT_CHUNK_SIZE2, onProgress, flush);
14404
+ }
14405
+ }
14406
+ if (!utils$1.isString(withCredentials)) {
14407
+ withCredentials = withCredentials ? "include" : "omit";
14408
+ }
14409
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
14410
+ const resolvedOptions = {
14411
+ ...fetchOptions,
14412
+ signal: composedSignal,
14413
+ method: method.toUpperCase(),
14414
+ headers: headers.normalize().toJSON(),
14415
+ body: data,
14416
+ duplex: "half",
14417
+ credentials: isCredentialsSupported ? withCredentials : void 0
14418
+ };
14419
+ request = isRequestSupported && new Request(url3, resolvedOptions);
14420
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url3, resolvedOptions));
14421
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
14422
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
14423
+ const options = {};
14424
+ ["status", "statusText", "headers"].forEach((prop) => {
14425
+ options[prop] = response[prop];
14426
+ });
14427
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
14428
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator2(
14429
+ responseContentLength,
14430
+ progressEventReducer2(asyncDecorator2(onDownloadProgress), true)
14431
+ ) || [];
14432
+ response = new Response(
14433
+ trackStream2(response.body, DEFAULT_CHUNK_SIZE2, onProgress, () => {
14434
+ flush && flush();
14435
+ unsubscribe && unsubscribe();
14436
+ }),
14437
+ options
14438
+ );
14439
+ }
14440
+ responseType = responseType || "text";
14441
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
14442
+ !isStreamResponse && unsubscribe && unsubscribe();
14443
+ return await new Promise((resolve, reject) => {
14444
+ settle2(resolve, reject, {
14445
+ data: responseData,
14446
+ headers: AxiosHeaders$1.from(response.headers),
14447
+ status: response.status,
14448
+ statusText: response.statusText,
14449
+ config,
14450
+ request
14451
+ });
14452
+ });
14453
+ } catch (err) {
14454
+ unsubscribe && unsubscribe();
14455
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
14456
+ throw Object.assign(
14457
+ new AxiosError3("Network Error", AxiosError3.ERR_NETWORK, config, request),
14458
+ {
14459
+ cause: err.cause || err
14460
+ }
14461
+ );
14462
+ }
14463
+ throw AxiosError3.from(err, err && err.code, config, request);
14366
14464
  }
14367
- throw AxiosError3.from(err, err && err.code, config, request);
14368
- }
14369
- });
14465
+ };
14466
+ };
14467
+ var seedCache2 = /* @__PURE__ */ new Map();
14468
+ var getFetch2 = (config) => {
14469
+ let env = config ? config.env : {};
14470
+ const { fetch: fetch2, Request, Response } = env;
14471
+ const seeds = [
14472
+ Request,
14473
+ Response,
14474
+ fetch2
14475
+ ];
14476
+ let len = seeds.length, i = len, seed, target, map = seedCache2;
14477
+ while (i--) {
14478
+ seed = seeds[i];
14479
+ target = map.get(seed);
14480
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory2(env));
14481
+ map = target;
14482
+ }
14483
+ return target;
14484
+ };
14485
+ getFetch2();
14370
14486
  var knownAdapters2 = {
14371
14487
  http: httpAdapter2,
14372
14488
  xhr: xhrAdapter,
14373
- fetch: fetchAdapter
14489
+ fetch: {
14490
+ get: getFetch2
14491
+ }
14374
14492
  };
14375
14493
  utils$1.forEach(knownAdapters2, (fn, value) => {
14376
14494
  if (fn) {
@@ -14382,30 +14500,30 @@ var require_axios = __commonJS({
14382
14500
  }
14383
14501
  });
14384
14502
  var renderReason2 = (reason) => `- ${reason}`;
14385
- var isResolvedHandle2 = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
14503
+ var isResolvedHandle2 = (adapter2) => utils$1.isFunction(adapter2) || adapter2 === null || adapter2 === false;
14386
14504
  var adapters = {
14387
- getAdapter: (adapters2) => {
14505
+ getAdapter: (adapters2, config) => {
14388
14506
  adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
14389
14507
  const { length } = adapters2;
14390
14508
  let nameOrAdapter;
14391
- let adapter;
14509
+ let adapter2;
14392
14510
  const rejectedReasons = {};
14393
14511
  for (let i = 0; i < length; i++) {
14394
14512
  nameOrAdapter = adapters2[i];
14395
14513
  let id;
14396
- adapter = nameOrAdapter;
14514
+ adapter2 = nameOrAdapter;
14397
14515
  if (!isResolvedHandle2(nameOrAdapter)) {
14398
- adapter = knownAdapters2[(id = String(nameOrAdapter)).toLowerCase()];
14399
- if (adapter === void 0) {
14516
+ adapter2 = knownAdapters2[(id = String(nameOrAdapter)).toLowerCase()];
14517
+ if (adapter2 === void 0) {
14400
14518
  throw new AxiosError3(`Unknown adapter '${id}'`);
14401
14519
  }
14402
14520
  }
14403
- if (adapter) {
14521
+ if (adapter2 && (utils$1.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
14404
14522
  break;
14405
14523
  }
14406
- rejectedReasons[id || "#" + i] = adapter;
14524
+ rejectedReasons[id || "#" + i] = adapter2;
14407
14525
  }
14408
- if (!adapter) {
14526
+ if (!adapter2) {
14409
14527
  const reasons = Object.entries(rejectedReasons).map(
14410
14528
  ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
14411
14529
  );
@@ -14415,7 +14533,7 @@ var require_axios = __commonJS({
14415
14533
  "ERR_NOT_SUPPORT"
14416
14534
  );
14417
14535
  }
14418
- return adapter;
14536
+ return adapter2;
14419
14537
  },
14420
14538
  adapters: knownAdapters2
14421
14539
  };
@@ -14437,8 +14555,8 @@ var require_axios = __commonJS({
14437
14555
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
14438
14556
  config.headers.setContentType("application/x-www-form-urlencoded", false);
14439
14557
  }
14440
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
14441
- return adapter(config).then(function onAdapterResolution(response) {
14558
+ const adapter2 = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
14559
+ return adapter2(config).then(function onAdapterResolution(response) {
14442
14560
  throwIfCancellationRequested2(config);
14443
14561
  response.data = transformData2.call(
14444
14562
  config,
@@ -14640,7 +14758,6 @@ var require_axios = __commonJS({
14640
14758
  }
14641
14759
  len = requestInterceptorChain.length;
14642
14760
  let newConfig = config;
14643
- i = 0;
14644
14761
  while (i < len) {
14645
14762
  const onFulfilled = requestInterceptorChain[i++];
14646
14763
  const onRejected = requestInterceptorChain[i++];
@@ -15248,7 +15365,7 @@ var _global = (() => {
15248
15365
  })();
15249
15366
  var isContextDefined = (context) => !isUndefined(context) && context !== _global;
15250
15367
  function merge() {
15251
- const { caseless } = isContextDefined(this) && this || {};
15368
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
15252
15369
  const result = {};
15253
15370
  const assignValue = (val, key) => {
15254
15371
  const targetKey = caseless && findKey(result, key) || key;
@@ -15258,7 +15375,7 @@ function merge() {
15258
15375
  result[targetKey] = merge({}, val);
15259
15376
  } else if (isArray(val)) {
15260
15377
  result[targetKey] = val.slice();
15261
- } else {
15378
+ } else if (!skipUndefined || !isUndefined(val)) {
15262
15379
  result[targetKey] = val;
15263
15380
  }
15264
15381
  };
@@ -15589,9 +15706,13 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
15589
15706
  }, (prop) => {
15590
15707
  return prop !== "isAxiosError";
15591
15708
  });
15592
- AxiosError.call(axiosError, error.message, code, config, request, response);
15593
- axiosError.cause = error;
15594
- axiosError.name = error.name;
15709
+ const msg = error && error.message ? error.message : "Error";
15710
+ const errCode = code == null && error ? error.code : code;
15711
+ AxiosError.call(axiosError, msg, errCode, config, request, response);
15712
+ if (error && axiosError.cause == null) {
15713
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
15714
+ }
15715
+ axiosError.name = error && error.name || "Error";
15595
15716
  customProps && Object.assign(axiosError, customProps);
15596
15717
  return axiosError;
15597
15718
  };
@@ -15751,7 +15872,7 @@ var AxiosURLSearchParams_default = AxiosURLSearchParams;
15751
15872
 
15752
15873
  // node_modules/axios/lib/helpers/buildURL.js
15753
15874
  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, "]");
15875
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
15755
15876
  }
15756
15877
  function buildURL(url2, params, options) {
15757
15878
  if (!params) {
@@ -16048,7 +16169,7 @@ var defaults = {
16048
16169
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
16049
16170
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
16050
16171
  try {
16051
- return JSON.parse(data);
16172
+ return JSON.parse(data, this.parseReviver);
16052
16173
  } catch (e) {
16053
16174
  if (strictJSONParsing) {
16054
16175
  if (e.name === "SyntaxError") {
@@ -16434,7 +16555,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
16434
16555
  var import_zlib = __toESM(require("zlib"), 1);
16435
16556
 
16436
16557
  // node_modules/axios/lib/env/data.js
16437
- var VERSION = "1.11.0";
16558
+ var VERSION = "1.12.2";
16438
16559
 
16439
16560
  // node_modules/axios/lib/helpers/parseProtocol.js
16440
16561
  function parseProtocol(url2) {
@@ -16833,6 +16954,57 @@ var progressEventDecorator = (total, throttled) => {
16833
16954
  };
16834
16955
  var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
16835
16956
 
16957
+ // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
16958
+ function estimateDataURLDecodedBytes(url2) {
16959
+ if (!url2 || typeof url2 !== "string") return 0;
16960
+ if (!url2.startsWith("data:")) return 0;
16961
+ const comma = url2.indexOf(",");
16962
+ if (comma < 0) return 0;
16963
+ const meta = url2.slice(5, comma);
16964
+ const body = url2.slice(comma + 1);
16965
+ const isBase64 = /;base64/i.test(meta);
16966
+ if (isBase64) {
16967
+ let effectiveLen = body.length;
16968
+ const len = body.length;
16969
+ for (let i = 0; i < len; i++) {
16970
+ if (body.charCodeAt(i) === 37 && i + 2 < len) {
16971
+ const a = body.charCodeAt(i + 1);
16972
+ const b = body.charCodeAt(i + 2);
16973
+ 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);
16974
+ if (isHex) {
16975
+ effectiveLen -= 2;
16976
+ i += 2;
16977
+ }
16978
+ }
16979
+ }
16980
+ let pad = 0;
16981
+ let idx = len - 1;
16982
+ const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
16983
+ body.charCodeAt(j - 1) === 51 && // '3'
16984
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
16985
+ if (idx >= 0) {
16986
+ if (body.charCodeAt(idx) === 61) {
16987
+ pad++;
16988
+ idx--;
16989
+ } else if (tailIsPct3D(idx)) {
16990
+ pad++;
16991
+ idx -= 3;
16992
+ }
16993
+ }
16994
+ if (pad === 1 && idx >= 0) {
16995
+ if (body.charCodeAt(idx) === 61) {
16996
+ pad++;
16997
+ } else if (tailIsPct3D(idx)) {
16998
+ pad++;
16999
+ }
17000
+ }
17001
+ const groups = Math.floor(effectiveLen / 4);
17002
+ const bytes = groups * 3 - (pad || 0);
17003
+ return bytes > 0 ? bytes : 0;
17004
+ }
17005
+ return Buffer.byteLength(body, "utf8");
17006
+ }
17007
+
16836
17008
  // node_modules/axios/lib/adapters/http.js
16837
17009
  var zlibOptions = {
16838
17010
  flush: import_zlib.default.constants.Z_SYNC_FLUSH,
@@ -16975,6 +17147,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
16975
17147
  const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
16976
17148
  const protocol = parsed.protocol || supportedProtocols[0];
16977
17149
  if (protocol === "data:") {
17150
+ if (config.maxContentLength > -1) {
17151
+ const dataUrl = String(config.url || fullPath || "");
17152
+ const estimated = estimateDataURLDecodedBytes(dataUrl);
17153
+ if (estimated > config.maxContentLength) {
17154
+ return reject(new AxiosError_default(
17155
+ "maxContentLength size of " + config.maxContentLength + " exceeded",
17156
+ AxiosError_default.ERR_BAD_RESPONSE,
17157
+ config
17158
+ ));
17159
+ }
17160
+ }
16978
17161
  let convertedData;
16979
17162
  if (method !== "GET") {
16980
17163
  return settle(resolve, reject, {
@@ -17468,13 +17651,17 @@ var resolveConfig_default = (config) => {
17468
17651
  "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
17469
17652
  );
17470
17653
  }
17471
- let contentType;
17472
17654
  if (utils_default.isFormData(data)) {
17473
17655
  if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
17474
17656
  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("; "));
17657
+ } else if (utils_default.isFunction(data.getHeaders)) {
17658
+ const formHeaders = data.getHeaders();
17659
+ const allowedHeaders = ["content-type", "content-length"];
17660
+ Object.entries(formHeaders).forEach(([key, val]) => {
17661
+ if (allowedHeaders.includes(key.toLowerCase())) {
17662
+ headers.set(key, val);
17663
+ }
17664
+ });
17478
17665
  }
17479
17666
  }
17480
17667
  if (platform_default.hasStandardBrowserEnv) {
@@ -17554,8 +17741,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
17554
17741
  reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
17555
17742
  request = null;
17556
17743
  };
17557
- request.onerror = function handleError() {
17558
- reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
17744
+ request.onerror = function handleError(event) {
17745
+ const msg = event && event.message ? event.message : "Network Error";
17746
+ const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
17747
+ err.event = event || null;
17748
+ reject(err);
17559
17749
  request = null;
17560
17750
  };
17561
17751
  request.ontimeout = function handleTimeout() {
@@ -17730,9 +17920,16 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
17730
17920
  };
17731
17921
 
17732
17922
  // 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()));
17923
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
17924
+ var { isFunction: isFunction2 } = utils_default;
17925
+ var globalFetchAPI = (({ Request, Response }) => ({
17926
+ Request,
17927
+ Response
17928
+ }))(utils_default.global);
17929
+ var {
17930
+ ReadableStream: ReadableStream2,
17931
+ TextEncoder: TextEncoder2
17932
+ } = utils_default.global;
17736
17933
  var test = (fn, ...args) => {
17737
17934
  try {
17738
17935
  return !!fn(...args);
@@ -17740,164 +17937,204 @@ var test = (fn, ...args) => {
17740
17937
  return false;
17741
17938
  }
17742
17939
  };
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;
17940
+ var factory = (env) => {
17941
+ env = utils_default.merge.call({
17942
+ skipUndefined: true
17943
+ }, globalFetchAPI, env);
17944
+ const { fetch: envFetch, Request, Response } = env;
17945
+ const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
17946
+ const isRequestSupported = isFunction2(Request);
17947
+ const isResponseSupported = isFunction2(Response);
17948
+ if (!isFetchSupported) {
17949
+ return false;
17773
17950
  }
17774
- if (utils_default.isSpecCompliantForm(body)) {
17775
- const _request = new Request(platform_default.origin, {
17951
+ const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
17952
+ const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
17953
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
17954
+ let duplexAccessed = false;
17955
+ const hasContentType = new Request(platform_default.origin, {
17956
+ body: new ReadableStream2(),
17776
17957
  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();
17958
+ get duplex() {
17959
+ duplexAccessed = true;
17960
+ return "half";
17961
+ }
17962
+ }).headers.has("Content-Type");
17963
+ return duplexAccessed && !hasContentType;
17815
17964
  });
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"
17965
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
17966
+ const resolvers = {
17967
+ stream: supportsResponseStream && ((res) => res.body)
17968
+ };
17969
+ isFetchSupported && (() => {
17970
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
17971
+ !resolvers[type] && (resolvers[type] = (res, config) => {
17972
+ let method = res && res[type];
17973
+ if (method) {
17974
+ return method.call(res);
17975
+ }
17976
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
17823
17977
  });
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
- }
17978
+ });
17979
+ })();
17980
+ const getBodyLength = async (body) => {
17981
+ if (body == null) {
17982
+ return 0;
17835
17983
  }
17836
- if (!utils_default.isString(withCredentials)) {
17837
- withCredentials = withCredentials ? "include" : "omit";
17984
+ if (utils_default.isBlob(body)) {
17985
+ return body.size;
17838
17986
  }
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];
17987
+ if (utils_default.isSpecCompliantForm(body)) {
17988
+ const _request = new Request(platform_default.origin, {
17989
+ method: "POST",
17990
+ body
17855
17991
  });
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
- );
17992
+ return (await _request.arrayBuffer()).byteLength;
17868
17993
  }
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
- });
17994
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
17995
+ return body.byteLength;
17996
+ }
17997
+ if (utils_default.isURLSearchParams(body)) {
17998
+ body = body + "";
17999
+ }
18000
+ if (utils_default.isString(body)) {
18001
+ return (await encodeText(body)).byteLength;
18002
+ }
18003
+ };
18004
+ const resolveBodyLength = async (headers, body) => {
18005
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
18006
+ return length == null ? getBodyLength(body) : length;
18007
+ };
18008
+ return async (config) => {
18009
+ let {
18010
+ url: url2,
18011
+ method,
18012
+ data,
18013
+ signal,
18014
+ cancelToken,
18015
+ timeout,
18016
+ onDownloadProgress,
18017
+ onUploadProgress,
18018
+ responseType,
18019
+ headers,
18020
+ withCredentials = "same-origin",
18021
+ fetchOptions
18022
+ } = resolveConfig_default(config);
18023
+ let _fetch = envFetch || fetch;
18024
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
18025
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
18026
+ let request = null;
18027
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
18028
+ composedSignal.unsubscribe();
17881
18029
  });
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
18030
+ let requestContentLength;
18031
+ try {
18032
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
18033
+ let _request = new Request(url2, {
18034
+ method: "POST",
18035
+ body: data,
18036
+ duplex: "half"
18037
+ });
18038
+ let contentTypeHeader;
18039
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
18040
+ headers.setContentType(contentTypeHeader);
17889
18041
  }
17890
- );
18042
+ if (_request.body) {
18043
+ const [onProgress, flush] = progressEventDecorator(
18044
+ requestContentLength,
18045
+ progressEventReducer(asyncDecorator(onUploadProgress))
18046
+ );
18047
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
18048
+ }
18049
+ }
18050
+ if (!utils_default.isString(withCredentials)) {
18051
+ withCredentials = withCredentials ? "include" : "omit";
18052
+ }
18053
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
18054
+ const resolvedOptions = {
18055
+ ...fetchOptions,
18056
+ signal: composedSignal,
18057
+ method: method.toUpperCase(),
18058
+ headers: headers.normalize().toJSON(),
18059
+ body: data,
18060
+ duplex: "half",
18061
+ credentials: isCredentialsSupported ? withCredentials : void 0
18062
+ };
18063
+ request = isRequestSupported && new Request(url2, resolvedOptions);
18064
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
18065
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
18066
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
18067
+ const options = {};
18068
+ ["status", "statusText", "headers"].forEach((prop) => {
18069
+ options[prop] = response[prop];
18070
+ });
18071
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
18072
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
18073
+ responseContentLength,
18074
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
18075
+ ) || [];
18076
+ response = new Response(
18077
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
18078
+ flush && flush();
18079
+ unsubscribe && unsubscribe();
18080
+ }),
18081
+ options
18082
+ );
18083
+ }
18084
+ responseType = responseType || "text";
18085
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
18086
+ !isStreamResponse && unsubscribe && unsubscribe();
18087
+ return await new Promise((resolve, reject) => {
18088
+ settle(resolve, reject, {
18089
+ data: responseData,
18090
+ headers: AxiosHeaders_default.from(response.headers),
18091
+ status: response.status,
18092
+ statusText: response.statusText,
18093
+ config,
18094
+ request
18095
+ });
18096
+ });
18097
+ } catch (err) {
18098
+ unsubscribe && unsubscribe();
18099
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
18100
+ throw Object.assign(
18101
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
18102
+ {
18103
+ cause: err.cause || err
18104
+ }
18105
+ );
18106
+ }
18107
+ throw AxiosError_default.from(err, err && err.code, config, request);
17891
18108
  }
17892
- throw AxiosError_default.from(err, err && err.code, config, request);
18109
+ };
18110
+ };
18111
+ var seedCache = /* @__PURE__ */ new Map();
18112
+ var getFetch = (config) => {
18113
+ let env = config ? config.env : {};
18114
+ const { fetch: fetch2, Request, Response } = env;
18115
+ const seeds = [
18116
+ Request,
18117
+ Response,
18118
+ fetch2
18119
+ ];
18120
+ let len = seeds.length, i = len, seed, target, map = seedCache;
18121
+ while (i--) {
18122
+ seed = seeds[i];
18123
+ target = map.get(seed);
18124
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
18125
+ map = target;
17893
18126
  }
17894
- });
18127
+ return target;
18128
+ };
18129
+ var adapter = getFetch();
17895
18130
 
17896
18131
  // node_modules/axios/lib/adapters/adapters.js
17897
18132
  var knownAdapters = {
17898
18133
  http: http_default,
17899
18134
  xhr: xhr_default,
17900
- fetch: fetch_default
18135
+ fetch: {
18136
+ get: getFetch
18137
+ }
17901
18138
  };
17902
18139
  utils_default.forEach(knownAdapters, (fn, value) => {
17903
18140
  if (fn) {
@@ -17909,30 +18146,30 @@ utils_default.forEach(knownAdapters, (fn, value) => {
17909
18146
  }
17910
18147
  });
17911
18148
  var renderReason = (reason) => `- ${reason}`;
17912
- var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
18149
+ var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
17913
18150
  var adapters_default = {
17914
- getAdapter: (adapters) => {
18151
+ getAdapter: (adapters, config) => {
17915
18152
  adapters = utils_default.isArray(adapters) ? adapters : [adapters];
17916
18153
  const { length } = adapters;
17917
18154
  let nameOrAdapter;
17918
- let adapter;
18155
+ let adapter2;
17919
18156
  const rejectedReasons = {};
17920
18157
  for (let i = 0; i < length; i++) {
17921
18158
  nameOrAdapter = adapters[i];
17922
18159
  let id;
17923
- adapter = nameOrAdapter;
18160
+ adapter2 = nameOrAdapter;
17924
18161
  if (!isResolvedHandle(nameOrAdapter)) {
17925
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
17926
- if (adapter === void 0) {
18162
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
18163
+ if (adapter2 === void 0) {
17927
18164
  throw new AxiosError_default(`Unknown adapter '${id}'`);
17928
18165
  }
17929
18166
  }
17930
- if (adapter) {
18167
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
17931
18168
  break;
17932
18169
  }
17933
- rejectedReasons[id || "#" + i] = adapter;
18170
+ rejectedReasons[id || "#" + i] = adapter2;
17934
18171
  }
17935
- if (!adapter) {
18172
+ if (!adapter2) {
17936
18173
  const reasons = Object.entries(rejectedReasons).map(
17937
18174
  ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
17938
18175
  );
@@ -17942,7 +18179,7 @@ var adapters_default = {
17942
18179
  "ERR_NOT_SUPPORT"
17943
18180
  );
17944
18181
  }
17945
- return adapter;
18182
+ return adapter2;
17946
18183
  },
17947
18184
  adapters: knownAdapters
17948
18185
  };
@@ -17966,8 +18203,8 @@ function dispatchRequest(config) {
17966
18203
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
17967
18204
  config.headers.setContentType("application/x-www-form-urlencoded", false);
17968
18205
  }
17969
- const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
17970
- return adapter(config).then(function onAdapterResolution(response) {
18206
+ const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
18207
+ return adapter2(config).then(function onAdapterResolution(response) {
17971
18208
  throwIfCancellationRequested(config);
17972
18209
  response.data = transformData.call(
17973
18210
  config,
@@ -18173,7 +18410,6 @@ var Axios = class {
18173
18410
  }
18174
18411
  len = requestInterceptorChain.length;
18175
18412
  let newConfig = config;
18176
- i = 0;
18177
18413
  while (i < len) {
18178
18414
  const onFulfilled = requestInterceptorChain[i++];
18179
18415
  const onRejected = requestInterceptorChain[i++];
@@ -18528,6 +18764,6 @@ mime-types/index.js:
18528
18764
  *)
18529
18765
 
18530
18766
  axios/dist/node/axios.cjs:
18531
- (*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors *)
18767
+ (*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors *)
18532
18768
  */
18533
18769
  //# sourceMappingURL=index.js.map