firecrawl 1.23.0 → 1.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ var require_delayed_stream = __commonJS({
35
35
  "node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) {
36
36
  "use strict";
37
37
  var Stream = require("stream").Stream;
38
- var util2 = require("util");
38
+ var util3 = require("util");
39
39
  module2.exports = DelayedStream;
40
40
  function DelayedStream() {
41
41
  this.source = null;
@@ -46,7 +46,7 @@ var require_delayed_stream = __commonJS({
46
46
  this._released = false;
47
47
  this._bufferedEvents = [];
48
48
  }
49
- util2.inherits(DelayedStream, Stream);
49
+ util3.inherits(DelayedStream, Stream);
50
50
  DelayedStream.create = function(source, options) {
51
51
  var delayedStream = new this();
52
52
  options = options || {};
@@ -126,7 +126,7 @@ var require_delayed_stream = __commonJS({
126
126
  var require_combined_stream = __commonJS({
127
127
  "node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) {
128
128
  "use strict";
129
- var util2 = require("util");
129
+ var util3 = require("util");
130
130
  var Stream = require("stream").Stream;
131
131
  var DelayedStream = require_delayed_stream();
132
132
  module2.exports = CombinedStream;
@@ -142,7 +142,7 @@ var require_combined_stream = __commonJS({
142
142
  this._insideLoop = false;
143
143
  this._pendingNext = false;
144
144
  }
145
- util2.inherits(CombinedStream, Stream);
145
+ util3.inherits(CombinedStream, Stream);
146
146
  CombinedStream.create = function(options) {
147
147
  var combinedStream = new this();
148
148
  options = options || {};
@@ -9152,7 +9152,7 @@ var require_form_data = __commonJS({
9152
9152
  "node_modules/form-data/lib/form_data.js"(exports2, module2) {
9153
9153
  "use strict";
9154
9154
  var CombinedStream = require_combined_stream();
9155
- var util2 = require("util");
9155
+ var util3 = require("util");
9156
9156
  var path = require("path");
9157
9157
  var http2 = require("http");
9158
9158
  var https2 = require("https");
@@ -9163,7 +9163,7 @@ var require_form_data = __commonJS({
9163
9163
  var asynckit = require_asynckit();
9164
9164
  var populate = require_populate();
9165
9165
  module2.exports = FormData3;
9166
- util2.inherits(FormData3, CombinedStream);
9166
+ util3.inherits(FormData3, CombinedStream);
9167
9167
  function FormData3(options) {
9168
9168
  if (!(this instanceof FormData3)) {
9169
9169
  return new FormData3(options);
@@ -9188,7 +9188,7 @@ var require_form_data = __commonJS({
9188
9188
  if (typeof value == "number") {
9189
9189
  value = "" + value;
9190
9190
  }
9191
- if (util2.isArray(value)) {
9191
+ if (util3.isArray(value)) {
9192
9192
  this._error(new Error("Arrays are not supported."));
9193
9193
  return;
9194
9194
  }
@@ -9478,7 +9478,7 @@ var require_proxy_from_env = __commonJS({
9478
9478
  var stringEndsWith = String.prototype.endsWith || function(s) {
9479
9479
  return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
9480
9480
  };
9481
- function getProxyForUrl2(url2) {
9481
+ function getProxyForUrl(url2) {
9482
9482
  var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
9483
9483
  var proto = parsedUrl.protocol;
9484
9484
  var hostname = parsedUrl.host;
@@ -9528,7 +9528,7 @@ var require_proxy_from_env = __commonJS({
9528
9528
  function getEnv(key) {
9529
9529
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
9530
9530
  }
9531
- exports2.getProxyForUrl = getProxyForUrl2;
9531
+ exports2.getProxyForUrl = getProxyForUrl;
9532
9532
  }
9533
9533
  });
9534
9534
 
@@ -10104,14 +10104,14 @@ var require_node = __commonJS({
10104
10104
  "node_modules/debug/src/node.js"(exports2, module2) {
10105
10105
  "use strict";
10106
10106
  var tty = require("tty");
10107
- var util2 = require("util");
10107
+ var util3 = require("util");
10108
10108
  exports2.init = init;
10109
10109
  exports2.log = log;
10110
10110
  exports2.formatArgs = formatArgs;
10111
10111
  exports2.save = save;
10112
10112
  exports2.load = load;
10113
10113
  exports2.useColors = useColors;
10114
- exports2.destroy = util2.deprecate(
10114
+ exports2.destroy = util3.deprecate(
10115
10115
  () => {
10116
10116
  },
10117
10117
  "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
@@ -10242,7 +10242,7 @@ var require_node = __commonJS({
10242
10242
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
10243
10243
  }
10244
10244
  function log(...args) {
10245
- return process.stderr.write(util2.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
10245
+ return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
10246
10246
  }
10247
10247
  function save(namespaces) {
10248
10248
  if (namespaces) {
@@ -10265,11 +10265,11 @@ var require_node = __commonJS({
10265
10265
  var { formatters } = module2.exports;
10266
10266
  formatters.o = function(v) {
10267
10267
  this.inspectOpts.colors = this.useColors;
10268
- return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
10268
+ return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
10269
10269
  };
10270
10270
  formatters.O = function(v) {
10271
10271
  this.inspectOpts.colors = this.useColors;
10272
- return util2.inspect(v, this.inspectOpts);
10272
+ return util3.inspect(v, this.inspectOpts);
10273
10273
  };
10274
10274
  }
10275
10275
  });
@@ -10860,6 +10860,7 @@ var isFormData = (thing) => {
10860
10860
  kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
10861
10861
  };
10862
10862
  var isURLSearchParams = kindOfTest("URLSearchParams");
10863
+ var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
10863
10864
  var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
10864
10865
  function forEach(obj, fn, { allOwnKeys = false } = {}) {
10865
10866
  if (obj === null || typeof obj === "undefined") {
@@ -11063,23 +11064,7 @@ var toObjectSet = (arrayOrString, delimiter) => {
11063
11064
  var noop = () => {
11064
11065
  };
11065
11066
  var toFiniteNumber = (value, defaultValue) => {
11066
- value = +value;
11067
- return Number.isFinite(value) ? value : defaultValue;
11068
- };
11069
- var ALPHA = "abcdefghijklmnopqrstuvwxyz";
11070
- var DIGIT = "0123456789";
11071
- var ALPHABET = {
11072
- DIGIT,
11073
- ALPHA,
11074
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
11075
- };
11076
- var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
11077
- let str = "";
11078
- const { length } = alphabet;
11079
- while (size--) {
11080
- str += alphabet[Math.random() * length | 0];
11081
- }
11082
- return str;
11067
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
11083
11068
  };
11084
11069
  function isSpecCompliantForm(thing) {
11085
11070
  return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
@@ -11108,6 +11093,26 @@ var toJSONObject = (obj) => {
11108
11093
  };
11109
11094
  var isAsyncFn = kindOfTest("AsyncFunction");
11110
11095
  var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
11096
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
11097
+ if (setImmediateSupported) {
11098
+ return setImmediate;
11099
+ }
11100
+ return postMessageSupported ? ((token, callbacks) => {
11101
+ _global.addEventListener("message", ({ source, data }) => {
11102
+ if (source === _global && data === token) {
11103
+ callbacks.length && callbacks.shift()();
11104
+ }
11105
+ }, false);
11106
+ return (cb) => {
11107
+ callbacks.push(cb);
11108
+ _global.postMessage(token, "*");
11109
+ };
11110
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
11111
+ })(
11112
+ typeof setImmediate === "function",
11113
+ isFunction(_global.postMessage)
11114
+ );
11115
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
11111
11116
  var utils_default = {
11112
11117
  isArray,
11113
11118
  isArrayBuffer,
@@ -11119,6 +11124,10 @@ var utils_default = {
11119
11124
  isBoolean,
11120
11125
  isObject,
11121
11126
  isPlainObject,
11127
+ isReadableStream,
11128
+ isRequest,
11129
+ isResponse,
11130
+ isHeaders,
11122
11131
  isUndefined,
11123
11132
  isDate,
11124
11133
  isFile,
@@ -11155,12 +11164,12 @@ var utils_default = {
11155
11164
  findKey,
11156
11165
  global: _global,
11157
11166
  isContextDefined,
11158
- ALPHABET,
11159
- generateString,
11160
11167
  isSpecCompliantForm,
11161
11168
  toJSONObject,
11162
11169
  isAsyncFn,
11163
- isThenable
11170
+ isThenable,
11171
+ setImmediate: _setImmediate,
11172
+ asap
11164
11173
  };
11165
11174
 
11166
11175
  // node_modules/axios/lib/core/AxiosError.js
@@ -11176,7 +11185,10 @@ function AxiosError(message, code, config, request, response) {
11176
11185
  code && (this.code = code);
11177
11186
  config && (this.config = config);
11178
11187
  request && (this.request = request);
11179
- response && (this.response = response);
11188
+ if (response) {
11189
+ this.response = response;
11190
+ this.status = response.status ? response.status : null;
11191
+ }
11180
11192
  }
11181
11193
  utils_default.inherits(AxiosError, Error, {
11182
11194
  toJSON: function toJSON() {
@@ -11195,7 +11207,7 @@ utils_default.inherits(AxiosError, Error, {
11195
11207
  // Axios
11196
11208
  config: utils_default.toJSONObject(this.config),
11197
11209
  code: this.code,
11198
- status: this.response && this.response.status ? this.response.status : null
11210
+ status: this.status
11199
11211
  };
11200
11212
  }
11201
11213
  });
@@ -11393,6 +11405,11 @@ function buildURL(url2, params, options) {
11393
11405
  return url2;
11394
11406
  }
11395
11407
  const _encode = options && options.encode || encode2;
11408
+ if (utils_default.isFunction(options)) {
11409
+ options = {
11410
+ serialize: options
11411
+ };
11412
+ }
11396
11413
  const serializeFn = options && options.serialize;
11397
11414
  let serializedParams;
11398
11415
  if (serializeFn) {
@@ -11481,11 +11498,31 @@ var transitional_default = {
11481
11498
  clarifyTimeoutError: false
11482
11499
  };
11483
11500
 
11501
+ // node_modules/axios/lib/platform/node/index.js
11502
+ var import_crypto = __toESM(require("crypto"), 1);
11503
+
11484
11504
  // node_modules/axios/lib/platform/node/classes/URLSearchParams.js
11485
11505
  var import_url = __toESM(require("url"), 1);
11486
11506
  var URLSearchParams_default = import_url.default.URLSearchParams;
11487
11507
 
11488
11508
  // node_modules/axios/lib/platform/node/index.js
11509
+ var ALPHA = "abcdefghijklmnopqrstuvwxyz";
11510
+ var DIGIT = "0123456789";
11511
+ var ALPHABET = {
11512
+ DIGIT,
11513
+ ALPHA,
11514
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
11515
+ };
11516
+ var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
11517
+ let str = "";
11518
+ const { length } = alphabet;
11519
+ const randomValues = new Uint32Array(size);
11520
+ import_crypto.default.randomFillSync(randomValues);
11521
+ for (let i = 0; i < size; i++) {
11522
+ str += alphabet[randomValues[i] % length];
11523
+ }
11524
+ return str;
11525
+ };
11489
11526
  var node_default = {
11490
11527
  isNode: true,
11491
11528
  classes: {
@@ -11493,6 +11530,8 @@ var node_default = {
11493
11530
  FormData: FormData_default,
11494
11531
  Blob: typeof Blob !== "undefined" && Blob || null
11495
11532
  },
11533
+ ALPHABET,
11534
+ generateString,
11496
11535
  protocols: ["http", "https", "file", "data"]
11497
11536
  };
11498
11537
 
@@ -11501,16 +11540,18 @@ var utils_exports = {};
11501
11540
  __export(utils_exports, {
11502
11541
  hasBrowserEnv: () => hasBrowserEnv,
11503
11542
  hasStandardBrowserEnv: () => hasStandardBrowserEnv,
11504
- hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv
11543
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
11544
+ navigator: () => _navigator,
11545
+ origin: () => origin
11505
11546
  });
11506
11547
  var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
11507
- var hasStandardBrowserEnv = ((product) => {
11508
- return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
11509
- })(typeof navigator !== "undefined" && navigator.product);
11548
+ var _navigator = typeof navigator === "object" && navigator || void 0;
11549
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
11510
11550
  var hasStandardBrowserWebWorkerEnv = (() => {
11511
11551
  return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
11512
11552
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
11513
11553
  })();
11554
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
11514
11555
 
11515
11556
  // node_modules/axios/lib/platform/index.js
11516
11557
  var platform_default = {
@@ -11600,7 +11641,7 @@ function stringifySafely(rawValue, parser, encoder) {
11600
11641
  }
11601
11642
  var defaults = {
11602
11643
  transitional: transitional_default,
11603
- adapter: ["xhr", "http"],
11644
+ adapter: ["xhr", "http", "fetch"],
11604
11645
  transformRequest: [function transformRequest(data, headers) {
11605
11646
  const contentType = headers.getContentType() || "";
11606
11647
  const hasJSONContentType = contentType.indexOf("application/json") > -1;
@@ -11612,7 +11653,7 @@ var defaults = {
11612
11653
  if (isFormData2) {
11613
11654
  return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
11614
11655
  }
11615
- if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
11656
+ if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
11616
11657
  return data;
11617
11658
  }
11618
11659
  if (utils_default.isArrayBufferView(data)) {
@@ -11646,6 +11687,9 @@ var defaults = {
11646
11687
  const transitional2 = this.transitional || defaults.transitional;
11647
11688
  const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
11648
11689
  const JSONRequested = this.responseType === "json";
11690
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
11691
+ return data;
11692
+ }
11649
11693
  if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
11650
11694
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
11651
11695
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
@@ -11808,6 +11852,10 @@ var AxiosHeaders = class {
11808
11852
  setHeaders(header, valueOrRewrite);
11809
11853
  } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
11810
11854
  setHeaders(parseHeaders_default(header), valueOrRewrite);
11855
+ } else if (utils_default.isHeaders(header)) {
11856
+ for (const [key, value] of header.entries()) {
11857
+ setHeader(value, key, rewrite);
11858
+ }
11811
11859
  } else {
11812
11860
  header != null && setHeader(valueOrRewrite, header, rewrite);
11813
11861
  }
@@ -12007,8 +12055,9 @@ function combineURLs(baseURL, relativeURL) {
12007
12055
  }
12008
12056
 
12009
12057
  // node_modules/axios/lib/core/buildFullPath.js
12010
- function buildFullPath(baseURL, requestedURL) {
12011
- if (baseURL && !isAbsoluteURL(requestedURL)) {
12058
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
12059
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
12060
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
12012
12061
  return combineURLs(baseURL, requestedURL);
12013
12062
  }
12014
12063
  return requestedURL;
@@ -12023,7 +12072,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
12023
12072
  var import_zlib = __toESM(require("zlib"), 1);
12024
12073
 
12025
12074
  // node_modules/axios/lib/env/data.js
12026
- var VERSION = "1.6.8";
12075
+ var VERSION = "1.8.4";
12027
12076
 
12028
12077
  // node_modules/axios/lib/helpers/parseProtocol.js
12029
12078
  function parseProtocol(url2) {
@@ -12065,70 +12114,6 @@ var import_stream4 = __toESM(require("stream"), 1);
12065
12114
 
12066
12115
  // node_modules/axios/lib/helpers/AxiosTransformStream.js
12067
12116
  var import_stream = __toESM(require("stream"), 1);
12068
-
12069
- // node_modules/axios/lib/helpers/throttle.js
12070
- function throttle(fn, freq) {
12071
- let timestamp = 0;
12072
- const threshold = 1e3 / freq;
12073
- let timer = null;
12074
- return function throttled(force, args) {
12075
- const now = Date.now();
12076
- if (force || now - timestamp > threshold) {
12077
- if (timer) {
12078
- clearTimeout(timer);
12079
- timer = null;
12080
- }
12081
- timestamp = now;
12082
- return fn.apply(null, args);
12083
- }
12084
- if (!timer) {
12085
- timer = setTimeout(() => {
12086
- timer = null;
12087
- timestamp = Date.now();
12088
- return fn.apply(null, args);
12089
- }, threshold - (now - timestamp));
12090
- }
12091
- };
12092
- }
12093
- var throttle_default = throttle;
12094
-
12095
- // node_modules/axios/lib/helpers/speedometer.js
12096
- function speedometer(samplesCount, min) {
12097
- samplesCount = samplesCount || 10;
12098
- const bytes = new Array(samplesCount);
12099
- const timestamps = new Array(samplesCount);
12100
- let head = 0;
12101
- let tail = 0;
12102
- let firstSampleTS;
12103
- min = min !== void 0 ? min : 1e3;
12104
- return function push(chunkLength) {
12105
- const now = Date.now();
12106
- const startedAt = timestamps[tail];
12107
- if (!firstSampleTS) {
12108
- firstSampleTS = now;
12109
- }
12110
- bytes[head] = chunkLength;
12111
- timestamps[head] = now;
12112
- let i = tail;
12113
- let bytesCount = 0;
12114
- while (i !== head) {
12115
- bytesCount += bytes[i++];
12116
- i = i % samplesCount;
12117
- }
12118
- head = (head + 1) % samplesCount;
12119
- if (head === tail) {
12120
- tail = (tail + 1) % samplesCount;
12121
- }
12122
- if (now - firstSampleTS < min) {
12123
- return;
12124
- }
12125
- const passed = startedAt && now - startedAt;
12126
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
12127
- };
12128
- }
12129
- var speedometer_default = speedometer;
12130
-
12131
- // node_modules/axios/lib/helpers/AxiosTransformStream.js
12132
12117
  var kInternals = Symbol("internals");
12133
12118
  var AxiosTransformStream = class extends import_stream.default.Transform {
12134
12119
  constructor(options) {
@@ -12145,11 +12130,8 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12145
12130
  super({
12146
12131
  readableHighWaterMark: options.chunkSize
12147
12132
  });
12148
- const self2 = this;
12149
12133
  const internals = this[kInternals] = {
12150
- length: options.length,
12151
12134
  timeWindow: options.timeWindow,
12152
- ticksRate: options.ticksRate,
12153
12135
  chunkSize: options.chunkSize,
12154
12136
  maxRate: options.maxRate,
12155
12137
  minChunkSize: options.minChunkSize,
@@ -12160,7 +12142,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12160
12142
  bytes: 0,
12161
12143
  onReadCallback: null
12162
12144
  };
12163
- const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
12164
12145
  this.on("newListener", (event) => {
12165
12146
  if (event === "progress") {
12166
12147
  if (!internals.isCaptured) {
@@ -12168,30 +12149,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12168
12149
  }
12169
12150
  }
12170
12151
  });
12171
- let bytesNotified = 0;
12172
- internals.updateProgress = throttle_default(function throttledHandler() {
12173
- const totalBytes = internals.length;
12174
- const bytesTransferred = internals.bytesSeen;
12175
- const progressBytes = bytesTransferred - bytesNotified;
12176
- if (!progressBytes || self2.destroyed) return;
12177
- const rate = _speedometer(progressBytes);
12178
- bytesNotified = bytesTransferred;
12179
- process.nextTick(() => {
12180
- self2.emit("progress", {
12181
- "loaded": bytesTransferred,
12182
- "total": totalBytes,
12183
- "progress": totalBytes ? bytesTransferred / totalBytes : void 0,
12184
- "bytes": progressBytes,
12185
- "rate": rate ? rate : void 0,
12186
- "estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0
12187
- });
12188
- });
12189
- }, internals.ticksRate);
12190
- const onFinish = () => {
12191
- internals.updateProgress(true);
12192
- };
12193
- this.once("end", onFinish);
12194
- this.once("error", onFinish);
12195
12152
  }
12196
12153
  _read(size) {
12197
12154
  const internals = this[kInternals];
@@ -12201,7 +12158,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12201
12158
  return super._read(size);
12202
12159
  }
12203
12160
  _transform(chunk, encoding, callback) {
12204
- const self2 = this;
12205
12161
  const internals = this[kInternals];
12206
12162
  const maxRate = internals.maxRate;
12207
12163
  const readableHighWaterMark = this.readableHighWaterMark;
@@ -12209,14 +12165,12 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12209
12165
  const divider = 1e3 / timeWindow;
12210
12166
  const bytesThreshold = maxRate / divider;
12211
12167
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
12212
- function pushChunk(_chunk, _callback) {
12168
+ const pushChunk = (_chunk, _callback) => {
12213
12169
  const bytes = Buffer.byteLength(_chunk);
12214
12170
  internals.bytesSeen += bytes;
12215
12171
  internals.bytes += bytes;
12216
- if (internals.isCaptured) {
12217
- internals.updateProgress();
12218
- }
12219
- if (self2.push(_chunk)) {
12172
+ internals.isCaptured && this.emit("progress", internals.bytesSeen);
12173
+ if (this.push(_chunk)) {
12220
12174
  process.nextTick(_callback);
12221
12175
  } else {
12222
12176
  internals.onReadCallback = () => {
@@ -12224,7 +12178,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12224
12178
  process.nextTick(_callback);
12225
12179
  };
12226
12180
  }
12227
- }
12181
+ };
12228
12182
  const transformChunk = (_chunk, _callback) => {
12229
12183
  const chunkSize = Buffer.byteLength(_chunk);
12230
12184
  let chunkRemainder = null;
@@ -12270,10 +12224,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
12270
12224
  }
12271
12225
  });
12272
12226
  }
12273
- setLength(length) {
12274
- this[kInternals].length = +length;
12275
- return this;
12276
- }
12277
12227
  };
12278
12228
  var AxiosTransformStream_default = AxiosTransformStream;
12279
12229
 
@@ -12281,7 +12231,7 @@ var AxiosTransformStream_default = AxiosTransformStream;
12281
12231
  var import_events = require("events");
12282
12232
 
12283
12233
  // node_modules/axios/lib/helpers/formDataToStream.js
12284
- var import_util = require("util");
12234
+ var import_util = __toESM(require("util"), 1);
12285
12235
  var import_stream2 = require("stream");
12286
12236
 
12287
12237
  // node_modules/axios/lib/helpers/readBlob.js
@@ -12300,8 +12250,8 @@ var readBlob = async function* (blob) {
12300
12250
  var readBlob_default = readBlob;
12301
12251
 
12302
12252
  // node_modules/axios/lib/helpers/formDataToStream.js
12303
- var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
12304
- var textEncoder = new import_util.TextEncoder();
12253
+ var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
12254
+ var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util.default.TextEncoder();
12305
12255
  var CRLF = "\r\n";
12306
12256
  var CRLF_BYTES = textEncoder.encode(CRLF);
12307
12257
  var CRLF_BYTES_COUNT = 2;
@@ -12343,7 +12293,7 @@ var formDataToStream = (form, headersHandler, options) => {
12343
12293
  const {
12344
12294
  tag = "form-data-boundary",
12345
12295
  size = 25,
12346
- boundary = tag + "-" + utils_default.generateString(size, BOUNDARY_ALPHABET)
12296
+ boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET)
12347
12297
  } = options || {};
12348
12298
  if (!utils_default.isFormData(form)) {
12349
12299
  throw TypeError("FormData instance required");
@@ -12415,6 +12365,112 @@ var callbackify = (fn, reducer) => {
12415
12365
  };
12416
12366
  var callbackify_default = callbackify;
12417
12367
 
12368
+ // node_modules/axios/lib/helpers/speedometer.js
12369
+ function speedometer(samplesCount, min) {
12370
+ samplesCount = samplesCount || 10;
12371
+ const bytes = new Array(samplesCount);
12372
+ const timestamps = new Array(samplesCount);
12373
+ let head = 0;
12374
+ let tail = 0;
12375
+ let firstSampleTS;
12376
+ min = min !== void 0 ? min : 1e3;
12377
+ return function push(chunkLength) {
12378
+ const now = Date.now();
12379
+ const startedAt = timestamps[tail];
12380
+ if (!firstSampleTS) {
12381
+ firstSampleTS = now;
12382
+ }
12383
+ bytes[head] = chunkLength;
12384
+ timestamps[head] = now;
12385
+ let i = tail;
12386
+ let bytesCount = 0;
12387
+ while (i !== head) {
12388
+ bytesCount += bytes[i++];
12389
+ i = i % samplesCount;
12390
+ }
12391
+ head = (head + 1) % samplesCount;
12392
+ if (head === tail) {
12393
+ tail = (tail + 1) % samplesCount;
12394
+ }
12395
+ if (now - firstSampleTS < min) {
12396
+ return;
12397
+ }
12398
+ const passed = startedAt && now - startedAt;
12399
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
12400
+ };
12401
+ }
12402
+ var speedometer_default = speedometer;
12403
+
12404
+ // node_modules/axios/lib/helpers/throttle.js
12405
+ function throttle(fn, freq) {
12406
+ let timestamp = 0;
12407
+ let threshold = 1e3 / freq;
12408
+ let lastArgs;
12409
+ let timer;
12410
+ const invoke = (args, now = Date.now()) => {
12411
+ timestamp = now;
12412
+ lastArgs = null;
12413
+ if (timer) {
12414
+ clearTimeout(timer);
12415
+ timer = null;
12416
+ }
12417
+ fn.apply(null, args);
12418
+ };
12419
+ const throttled = (...args) => {
12420
+ const now = Date.now();
12421
+ const passed = now - timestamp;
12422
+ if (passed >= threshold) {
12423
+ invoke(args, now);
12424
+ } else {
12425
+ lastArgs = args;
12426
+ if (!timer) {
12427
+ timer = setTimeout(() => {
12428
+ timer = null;
12429
+ invoke(lastArgs);
12430
+ }, threshold - passed);
12431
+ }
12432
+ }
12433
+ };
12434
+ const flush = () => lastArgs && invoke(lastArgs);
12435
+ return [throttled, flush];
12436
+ }
12437
+ var throttle_default = throttle;
12438
+
12439
+ // node_modules/axios/lib/helpers/progressEventReducer.js
12440
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
12441
+ let bytesNotified = 0;
12442
+ const _speedometer = speedometer_default(50, 250);
12443
+ return throttle_default((e2) => {
12444
+ const loaded = e2.loaded;
12445
+ const total = e2.lengthComputable ? e2.total : void 0;
12446
+ const progressBytes = loaded - bytesNotified;
12447
+ const rate = _speedometer(progressBytes);
12448
+ const inRange = loaded <= total;
12449
+ bytesNotified = loaded;
12450
+ const data = {
12451
+ loaded,
12452
+ total,
12453
+ progress: total ? loaded / total : void 0,
12454
+ bytes: progressBytes,
12455
+ rate: rate ? rate : void 0,
12456
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
12457
+ event: e2,
12458
+ lengthComputable: total != null,
12459
+ [isDownloadStream ? "download" : "upload"]: true
12460
+ };
12461
+ listener(data);
12462
+ }, freq);
12463
+ };
12464
+ var progressEventDecorator = (total, throttled) => {
12465
+ const lengthComputable = total != null;
12466
+ return [(loaded) => throttled[0]({
12467
+ lengthComputable,
12468
+ total,
12469
+ loaded
12470
+ }), throttled[1]];
12471
+ };
12472
+ var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
12473
+
12418
12474
  // node_modules/axios/lib/adapters/http.js
12419
12475
  var zlibOptions = {
12420
12476
  flush: import_zlib.default.constants.Z_SYNC_FLUSH,
@@ -12430,6 +12486,10 @@ var isHttps = /https:?/;
12430
12486
  var supportedProtocols = platform_default.protocols.map((protocol) => {
12431
12487
  return protocol + ":";
12432
12488
  });
12489
+ var flushOnFinish = (stream4, [throttled, flush]) => {
12490
+ stream4.on("end", flush).on("error", flush);
12491
+ return throttled;
12492
+ };
12433
12493
  function dispatchBeforeRedirect(options, responseDetails) {
12434
12494
  if (options.beforeRedirects.proxy) {
12435
12495
  options.beforeRedirects.proxy(options);
@@ -12441,7 +12501,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
12441
12501
  function setProxy(options, configProxy, location) {
12442
12502
  let proxy = configProxy;
12443
12503
  if (!proxy && proxy !== false) {
12444
- const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(location);
12504
+ const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location);
12445
12505
  if (proxyUrl) {
12446
12506
  proxy = new URL(proxyUrl);
12447
12507
  }
@@ -12549,8 +12609,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12549
12609
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
12550
12610
  }
12551
12611
  }
12552
- const fullPath = buildFullPath(config.baseURL, config.url);
12553
- const parsed = new URL(fullPath, "http://localhost");
12612
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
12613
+ const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
12554
12614
  const protocol = parsed.protocol || supportedProtocols[0];
12555
12615
  if (protocol === "data:") {
12556
12616
  let convertedData;
@@ -12594,8 +12654,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12594
12654
  }
12595
12655
  const headers = AxiosHeaders_default.from(config.headers).normalize();
12596
12656
  headers.set("User-Agent", "axios/" + VERSION, false);
12597
- const onDownloadProgress = config.onDownloadProgress;
12598
- const onUploadProgress = config.onUploadProgress;
12657
+ const { onUploadProgress, onDownloadProgress } = config;
12599
12658
  const maxRate = config.maxRate;
12600
12659
  let maxUploadRate = void 0;
12601
12660
  let maxDownloadRate = void 0;
@@ -12616,7 +12675,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12616
12675
  } catch (e2) {
12617
12676
  }
12618
12677
  }
12619
- } else if (utils_default.isBlob(data)) {
12678
+ } else if (utils_default.isBlob(data) || utils_default.isFile(data)) {
12620
12679
  data.size && headers.setContentType(data.type || "application/octet-stream");
12621
12680
  headers.setContentLength(data.size || 0);
12622
12681
  data = import_stream4.default.Readable.from(readBlob_default(data));
@@ -12654,14 +12713,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12654
12713
  data = import_stream4.default.Readable.from(data, { objectMode: false });
12655
12714
  }
12656
12715
  data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({
12657
- length: contentLength,
12658
12716
  maxRate: utils_default.toFiniteNumber(maxUploadRate)
12659
12717
  })], utils_default.noop);
12660
- onUploadProgress && data.on("progress", (progress) => {
12661
- onUploadProgress(Object.assign(progress, {
12662
- upload: true
12663
- }));
12664
- });
12718
+ onUploadProgress && data.on("progress", flushOnFinish(
12719
+ data,
12720
+ progressEventDecorator(
12721
+ contentLength,
12722
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
12723
+ )
12724
+ ));
12665
12725
  }
12666
12726
  let auth = void 0;
12667
12727
  if (config.auth) {
@@ -12709,7 +12769,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12709
12769
  if (config.socketPath) {
12710
12770
  options.socketPath = config.socketPath;
12711
12771
  } else {
12712
- options.hostname = parsed.hostname;
12772
+ options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
12713
12773
  options.port = parsed.port;
12714
12774
  setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
12715
12775
  }
@@ -12741,16 +12801,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12741
12801
  if (req.destroyed) return;
12742
12802
  const streams = [res];
12743
12803
  const responseLength = +res.headers["content-length"];
12744
- if (onDownloadProgress) {
12804
+ if (onDownloadProgress || maxDownloadRate) {
12745
12805
  const transformStream = new AxiosTransformStream_default({
12746
- length: utils_default.toFiniteNumber(responseLength),
12747
12806
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
12748
12807
  });
12749
- onDownloadProgress && transformStream.on("progress", (progress) => {
12750
- onDownloadProgress(Object.assign(progress, {
12751
- download: true
12752
- }));
12753
- });
12808
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(
12809
+ transformStream,
12810
+ progressEventDecorator(
12811
+ responseLength,
12812
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
12813
+ )
12814
+ ));
12754
12815
  streams.push(transformStream);
12755
12816
  }
12756
12817
  let responseStream = res;
@@ -12817,7 +12878,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12817
12878
  return;
12818
12879
  }
12819
12880
  const err = new AxiosError_default(
12820
- "maxContentLength size of " + config.maxContentLength + " exceeded",
12881
+ "stream has been aborted",
12821
12882
  AxiosError_default.ERR_BAD_RESPONSE,
12822
12883
  config,
12823
12884
  lastRequest
@@ -12911,6 +12972,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
12911
12972
  });
12912
12973
  };
12913
12974
 
12975
+ // node_modules/axios/lib/helpers/isURLSameOrigin.js
12976
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
12977
+ url2 = new URL(url2, platform_default.origin);
12978
+ return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
12979
+ })(
12980
+ new URL(platform_default.origin),
12981
+ platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
12982
+ ) : () => true;
12983
+
12914
12984
  // node_modules/axios/lib/helpers/cookies.js
12915
12985
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
12916
12986
  // Standard browser envs support document.cookie
@@ -12944,104 +13014,139 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? (
12944
13014
  }
12945
13015
  );
12946
13016
 
12947
- // node_modules/axios/lib/helpers/isURLSameOrigin.js
12948
- var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
12949
- // Standard browser envs have full support of the APIs needed to test
12950
- // whether the request URL is of the same origin as current location.
12951
- function standardBrowserEnv() {
12952
- const msie = /(msie|trident)/i.test(navigator.userAgent);
12953
- const urlParsingNode = document.createElement("a");
12954
- let originURL;
12955
- function resolveURL(url2) {
12956
- let href = url2;
12957
- if (msie) {
12958
- urlParsingNode.setAttribute("href", href);
12959
- href = urlParsingNode.href;
12960
- }
12961
- urlParsingNode.setAttribute("href", href);
12962
- return {
12963
- href: urlParsingNode.href,
12964
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
12965
- host: urlParsingNode.host,
12966
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
12967
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
12968
- hostname: urlParsingNode.hostname,
12969
- port: urlParsingNode.port,
12970
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
12971
- };
13017
+ // node_modules/axios/lib/core/mergeConfig.js
13018
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
13019
+ function mergeConfig(config1, config2) {
13020
+ config2 = config2 || {};
13021
+ const config = {};
13022
+ function getMergedValue(target, source, prop, caseless) {
13023
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
13024
+ return utils_default.merge.call({ caseless }, target, source);
13025
+ } else if (utils_default.isPlainObject(source)) {
13026
+ return utils_default.merge({}, source);
13027
+ } else if (utils_default.isArray(source)) {
13028
+ return source.slice();
12972
13029
  }
12973
- originURL = resolveURL(window.location.href);
12974
- return function isURLSameOrigin(requestURL) {
12975
- const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
12976
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
12977
- };
12978
- }()
12979
- ) : (
12980
- // Non standard browser envs (web workers, react-native) lack needed support.
12981
- /* @__PURE__ */ function nonStandardBrowserEnv() {
12982
- return function isURLSameOrigin() {
12983
- return true;
12984
- };
12985
- }()
12986
- );
12987
-
12988
- // node_modules/axios/lib/adapters/xhr.js
12989
- function progressEventReducer(listener, isDownloadStream) {
12990
- let bytesNotified = 0;
12991
- const _speedometer = speedometer_default(50, 250);
12992
- return (e2) => {
12993
- const loaded = e2.loaded;
12994
- const total = e2.lengthComputable ? e2.total : void 0;
12995
- const progressBytes = loaded - bytesNotified;
12996
- const rate = _speedometer(progressBytes);
12997
- const inRange = loaded <= total;
12998
- bytesNotified = loaded;
12999
- const data = {
13000
- loaded,
13001
- total,
13002
- progress: total ? loaded / total : void 0,
13003
- bytes: progressBytes,
13004
- rate: rate ? rate : void 0,
13005
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
13006
- event: e2
13007
- };
13008
- data[isDownloadStream ? "download" : "upload"] = true;
13009
- listener(data);
13030
+ return source;
13031
+ }
13032
+ function mergeDeepProperties(a, b, prop, caseless) {
13033
+ if (!utils_default.isUndefined(b)) {
13034
+ return getMergedValue(a, b, prop, caseless);
13035
+ } else if (!utils_default.isUndefined(a)) {
13036
+ return getMergedValue(void 0, a, prop, caseless);
13037
+ }
13038
+ }
13039
+ function valueFromConfig2(a, b) {
13040
+ if (!utils_default.isUndefined(b)) {
13041
+ return getMergedValue(void 0, b);
13042
+ }
13043
+ }
13044
+ function defaultToConfig2(a, b) {
13045
+ if (!utils_default.isUndefined(b)) {
13046
+ return getMergedValue(void 0, b);
13047
+ } else if (!utils_default.isUndefined(a)) {
13048
+ return getMergedValue(void 0, a);
13049
+ }
13050
+ }
13051
+ function mergeDirectKeys(a, b, prop) {
13052
+ if (prop in config2) {
13053
+ return getMergedValue(a, b);
13054
+ } else if (prop in config1) {
13055
+ return getMergedValue(void 0, a);
13056
+ }
13057
+ }
13058
+ const mergeMap = {
13059
+ url: valueFromConfig2,
13060
+ method: valueFromConfig2,
13061
+ data: valueFromConfig2,
13062
+ baseURL: defaultToConfig2,
13063
+ transformRequest: defaultToConfig2,
13064
+ transformResponse: defaultToConfig2,
13065
+ paramsSerializer: defaultToConfig2,
13066
+ timeout: defaultToConfig2,
13067
+ timeoutMessage: defaultToConfig2,
13068
+ withCredentials: defaultToConfig2,
13069
+ withXSRFToken: defaultToConfig2,
13070
+ adapter: defaultToConfig2,
13071
+ responseType: defaultToConfig2,
13072
+ xsrfCookieName: defaultToConfig2,
13073
+ xsrfHeaderName: defaultToConfig2,
13074
+ onUploadProgress: defaultToConfig2,
13075
+ onDownloadProgress: defaultToConfig2,
13076
+ decompress: defaultToConfig2,
13077
+ maxContentLength: defaultToConfig2,
13078
+ maxBodyLength: defaultToConfig2,
13079
+ beforeRedirect: defaultToConfig2,
13080
+ transport: defaultToConfig2,
13081
+ httpAgent: defaultToConfig2,
13082
+ httpsAgent: defaultToConfig2,
13083
+ cancelToken: defaultToConfig2,
13084
+ socketPath: defaultToConfig2,
13085
+ responseEncoding: defaultToConfig2,
13086
+ validateStatus: mergeDirectKeys,
13087
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
13010
13088
  };
13089
+ utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
13090
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
13091
+ const configValue = merge2(config1[prop], config2[prop], prop);
13092
+ utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
13093
+ });
13094
+ return config;
13011
13095
  }
13096
+
13097
+ // node_modules/axios/lib/helpers/resolveConfig.js
13098
+ var resolveConfig_default = (config) => {
13099
+ const newConfig = mergeConfig({}, config);
13100
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
13101
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
13102
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
13103
+ if (auth) {
13104
+ headers.set(
13105
+ "Authorization",
13106
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
13107
+ );
13108
+ }
13109
+ let contentType;
13110
+ if (utils_default.isFormData(data)) {
13111
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
13112
+ headers.setContentType(void 0);
13113
+ } else if ((contentType = headers.getContentType()) !== false) {
13114
+ const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
13115
+ headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
13116
+ }
13117
+ }
13118
+ if (platform_default.hasStandardBrowserEnv) {
13119
+ withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
13120
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
13121
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
13122
+ if (xsrfValue) {
13123
+ headers.set(xsrfHeaderName, xsrfValue);
13124
+ }
13125
+ }
13126
+ }
13127
+ return newConfig;
13128
+ };
13129
+
13130
+ // node_modules/axios/lib/adapters/xhr.js
13012
13131
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
13013
13132
  var xhr_default = isXHRAdapterSupported && function(config) {
13014
13133
  return new Promise(function dispatchXhrRequest(resolve, reject) {
13015
- let requestData = config.data;
13016
- const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
13017
- let { responseType, withXSRFToken } = config;
13134
+ const _config = resolveConfig_default(config);
13135
+ let requestData = _config.data;
13136
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
13137
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
13018
13138
  let onCanceled;
13139
+ let uploadThrottled, downloadThrottled;
13140
+ let flushUpload, flushDownload;
13019
13141
  function done() {
13020
- if (config.cancelToken) {
13021
- config.cancelToken.unsubscribe(onCanceled);
13022
- }
13023
- if (config.signal) {
13024
- config.signal.removeEventListener("abort", onCanceled);
13025
- }
13026
- }
13027
- let contentType;
13028
- if (utils_default.isFormData(requestData)) {
13029
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
13030
- requestHeaders.setContentType(false);
13031
- } else if ((contentType = requestHeaders.getContentType()) !== false) {
13032
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
13033
- requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
13034
- }
13142
+ flushUpload && flushUpload();
13143
+ flushDownload && flushDownload();
13144
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
13145
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
13035
13146
  }
13036
13147
  let request = new XMLHttpRequest();
13037
- if (config.auth) {
13038
- const username = config.auth.username || "";
13039
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
13040
- requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
13041
- }
13042
- const fullPath = buildFullPath(config.baseURL, config.url);
13043
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
13044
- request.timeout = config.timeout;
13148
+ request.open(_config.method.toUpperCase(), _config.url, true);
13149
+ request.timeout = _config.timeout;
13045
13150
  function onloadend() {
13046
13151
  if (!request) {
13047
13152
  return;
@@ -13092,10 +13197,10 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13092
13197
  request = null;
13093
13198
  };
13094
13199
  request.ontimeout = function handleTimeout() {
13095
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
13096
- const transitional2 = config.transitional || transitional_default;
13097
- if (config.timeoutErrorMessage) {
13098
- timeoutErrorMessage = config.timeoutErrorMessage;
13200
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
13201
+ const transitional2 = _config.transitional || transitional_default;
13202
+ if (_config.timeoutErrorMessage) {
13203
+ timeoutErrorMessage = _config.timeoutErrorMessage;
13099
13204
  }
13100
13205
  reject(new AxiosError_default(
13101
13206
  timeoutErrorMessage,
@@ -13105,34 +13210,28 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13105
13210
  ));
13106
13211
  request = null;
13107
13212
  };
13108
- if (platform_default.hasStandardBrowserEnv) {
13109
- withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
13110
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(fullPath)) {
13111
- const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
13112
- if (xsrfValue) {
13113
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
13114
- }
13115
- }
13116
- }
13117
13213
  requestData === void 0 && requestHeaders.setContentType(null);
13118
13214
  if ("setRequestHeader" in request) {
13119
13215
  utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
13120
13216
  request.setRequestHeader(key, val);
13121
13217
  });
13122
13218
  }
13123
- if (!utils_default.isUndefined(config.withCredentials)) {
13124
- request.withCredentials = !!config.withCredentials;
13219
+ if (!utils_default.isUndefined(_config.withCredentials)) {
13220
+ request.withCredentials = !!_config.withCredentials;
13125
13221
  }
13126
13222
  if (responseType && responseType !== "json") {
13127
- request.responseType = config.responseType;
13223
+ request.responseType = _config.responseType;
13128
13224
  }
13129
- if (typeof config.onDownloadProgress === "function") {
13130
- request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
13225
+ if (onDownloadProgress) {
13226
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
13227
+ request.addEventListener("progress", downloadThrottled);
13131
13228
  }
13132
- if (typeof config.onUploadProgress === "function" && request.upload) {
13133
- request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
13229
+ if (onUploadProgress && request.upload) {
13230
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
13231
+ request.upload.addEventListener("progress", uploadThrottled);
13232
+ request.upload.addEventListener("loadend", flushUpload);
13134
13233
  }
13135
- if (config.cancelToken || config.signal) {
13234
+ if (_config.cancelToken || _config.signal) {
13136
13235
  onCanceled = (cancel) => {
13137
13236
  if (!request) {
13138
13237
  return;
@@ -13141,12 +13240,12 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13141
13240
  request.abort();
13142
13241
  request = null;
13143
13242
  };
13144
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
13145
- if (config.signal) {
13146
- config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
13243
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
13244
+ if (_config.signal) {
13245
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
13147
13246
  }
13148
13247
  }
13149
- const protocol = parseProtocol(fullPath);
13248
+ const protocol = parseProtocol(_config.url);
13150
13249
  if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
13151
13250
  reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
13152
13251
  return;
@@ -13155,10 +13254,288 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13155
13254
  });
13156
13255
  };
13157
13256
 
13257
+ // node_modules/axios/lib/helpers/composeSignals.js
13258
+ var composeSignals = (signals, timeout) => {
13259
+ const { length } = signals = signals ? signals.filter(Boolean) : [];
13260
+ if (timeout || length) {
13261
+ let controller = new AbortController();
13262
+ let aborted;
13263
+ const onabort = function(reason) {
13264
+ if (!aborted) {
13265
+ aborted = true;
13266
+ unsubscribe();
13267
+ const err = reason instanceof Error ? reason : this.reason;
13268
+ controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
13269
+ }
13270
+ };
13271
+ let timer = timeout && setTimeout(() => {
13272
+ timer = null;
13273
+ onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
13274
+ }, timeout);
13275
+ const unsubscribe = () => {
13276
+ if (signals) {
13277
+ timer && clearTimeout(timer);
13278
+ timer = null;
13279
+ signals.forEach((signal2) => {
13280
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
13281
+ });
13282
+ signals = null;
13283
+ }
13284
+ };
13285
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
13286
+ const { signal } = controller;
13287
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
13288
+ return signal;
13289
+ }
13290
+ };
13291
+ var composeSignals_default = composeSignals;
13292
+
13293
+ // node_modules/axios/lib/helpers/trackStream.js
13294
+ var streamChunk = function* (chunk, chunkSize) {
13295
+ let len = chunk.byteLength;
13296
+ if (!chunkSize || len < chunkSize) {
13297
+ yield chunk;
13298
+ return;
13299
+ }
13300
+ let pos = 0;
13301
+ let end;
13302
+ while (pos < len) {
13303
+ end = pos + chunkSize;
13304
+ yield chunk.slice(pos, end);
13305
+ pos = end;
13306
+ }
13307
+ };
13308
+ var readBytes = async function* (iterable, chunkSize) {
13309
+ for await (const chunk of readStream(iterable)) {
13310
+ yield* streamChunk(chunk, chunkSize);
13311
+ }
13312
+ };
13313
+ var readStream = async function* (stream4) {
13314
+ if (stream4[Symbol.asyncIterator]) {
13315
+ yield* stream4;
13316
+ return;
13317
+ }
13318
+ const reader = stream4.getReader();
13319
+ try {
13320
+ for (; ; ) {
13321
+ const { done, value } = await reader.read();
13322
+ if (done) {
13323
+ break;
13324
+ }
13325
+ yield value;
13326
+ }
13327
+ } finally {
13328
+ await reader.cancel();
13329
+ }
13330
+ };
13331
+ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
13332
+ const iterator = readBytes(stream4, chunkSize);
13333
+ let bytes = 0;
13334
+ let done;
13335
+ let _onFinish = (e2) => {
13336
+ if (!done) {
13337
+ done = true;
13338
+ onFinish && onFinish(e2);
13339
+ }
13340
+ };
13341
+ return new ReadableStream({
13342
+ async pull(controller) {
13343
+ try {
13344
+ const { done: done2, value } = await iterator.next();
13345
+ if (done2) {
13346
+ _onFinish();
13347
+ controller.close();
13348
+ return;
13349
+ }
13350
+ let len = value.byteLength;
13351
+ if (onProgress) {
13352
+ let loadedBytes = bytes += len;
13353
+ onProgress(loadedBytes);
13354
+ }
13355
+ controller.enqueue(new Uint8Array(value));
13356
+ } catch (err) {
13357
+ _onFinish(err);
13358
+ throw err;
13359
+ }
13360
+ },
13361
+ cancel(reason) {
13362
+ _onFinish(reason);
13363
+ return iterator.return();
13364
+ }
13365
+ }, {
13366
+ highWaterMark: 2
13367
+ });
13368
+ };
13369
+
13370
+ // node_modules/axios/lib/adapters/fetch.js
13371
+ var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
13372
+ var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
13373
+ var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
13374
+ var test = (fn, ...args) => {
13375
+ try {
13376
+ return !!fn(...args);
13377
+ } catch (e2) {
13378
+ return false;
13379
+ }
13380
+ };
13381
+ var supportsRequestStream = isReadableStreamSupported && test(() => {
13382
+ let duplexAccessed = false;
13383
+ const hasContentType = new Request(platform_default.origin, {
13384
+ body: new ReadableStream(),
13385
+ method: "POST",
13386
+ get duplex() {
13387
+ duplexAccessed = true;
13388
+ return "half";
13389
+ }
13390
+ }).headers.has("Content-Type");
13391
+ return duplexAccessed && !hasContentType;
13392
+ });
13393
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
13394
+ var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
13395
+ var resolvers = {
13396
+ stream: supportsResponseStream && ((res) => res.body)
13397
+ };
13398
+ isFetchSupported && ((res) => {
13399
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
13400
+ !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
13401
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
13402
+ });
13403
+ });
13404
+ })(new Response());
13405
+ var getBodyLength = async (body) => {
13406
+ if (body == null) {
13407
+ return 0;
13408
+ }
13409
+ if (utils_default.isBlob(body)) {
13410
+ return body.size;
13411
+ }
13412
+ if (utils_default.isSpecCompliantForm(body)) {
13413
+ const _request = new Request(platform_default.origin, {
13414
+ method: "POST",
13415
+ body
13416
+ });
13417
+ return (await _request.arrayBuffer()).byteLength;
13418
+ }
13419
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
13420
+ return body.byteLength;
13421
+ }
13422
+ if (utils_default.isURLSearchParams(body)) {
13423
+ body = body + "";
13424
+ }
13425
+ if (utils_default.isString(body)) {
13426
+ return (await encodeText(body)).byteLength;
13427
+ }
13428
+ };
13429
+ var resolveBodyLength = async (headers, body) => {
13430
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
13431
+ return length == null ? getBodyLength(body) : length;
13432
+ };
13433
+ var fetch_default = isFetchSupported && (async (config) => {
13434
+ let {
13435
+ url: url2,
13436
+ method,
13437
+ data,
13438
+ signal,
13439
+ cancelToken,
13440
+ timeout,
13441
+ onDownloadProgress,
13442
+ onUploadProgress,
13443
+ responseType,
13444
+ headers,
13445
+ withCredentials = "same-origin",
13446
+ fetchOptions
13447
+ } = resolveConfig_default(config);
13448
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
13449
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
13450
+ let request;
13451
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
13452
+ composedSignal.unsubscribe();
13453
+ });
13454
+ let requestContentLength;
13455
+ try {
13456
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
13457
+ let _request = new Request(url2, {
13458
+ method: "POST",
13459
+ body: data,
13460
+ duplex: "half"
13461
+ });
13462
+ let contentTypeHeader;
13463
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
13464
+ headers.setContentType(contentTypeHeader);
13465
+ }
13466
+ if (_request.body) {
13467
+ const [onProgress, flush] = progressEventDecorator(
13468
+ requestContentLength,
13469
+ progressEventReducer(asyncDecorator(onUploadProgress))
13470
+ );
13471
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
13472
+ }
13473
+ }
13474
+ if (!utils_default.isString(withCredentials)) {
13475
+ withCredentials = withCredentials ? "include" : "omit";
13476
+ }
13477
+ const isCredentialsSupported = "credentials" in Request.prototype;
13478
+ request = new Request(url2, {
13479
+ ...fetchOptions,
13480
+ signal: composedSignal,
13481
+ method: method.toUpperCase(),
13482
+ headers: headers.normalize().toJSON(),
13483
+ body: data,
13484
+ duplex: "half",
13485
+ credentials: isCredentialsSupported ? withCredentials : void 0
13486
+ });
13487
+ let response = await fetch(request);
13488
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
13489
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
13490
+ const options = {};
13491
+ ["status", "statusText", "headers"].forEach((prop) => {
13492
+ options[prop] = response[prop];
13493
+ });
13494
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
13495
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
13496
+ responseContentLength,
13497
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
13498
+ ) || [];
13499
+ response = new Response(
13500
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
13501
+ flush && flush();
13502
+ unsubscribe && unsubscribe();
13503
+ }),
13504
+ options
13505
+ );
13506
+ }
13507
+ responseType = responseType || "text";
13508
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
13509
+ !isStreamResponse && unsubscribe && unsubscribe();
13510
+ return await new Promise((resolve, reject) => {
13511
+ settle(resolve, reject, {
13512
+ data: responseData,
13513
+ headers: AxiosHeaders_default.from(response.headers),
13514
+ status: response.status,
13515
+ statusText: response.statusText,
13516
+ config,
13517
+ request
13518
+ });
13519
+ });
13520
+ } catch (err) {
13521
+ unsubscribe && unsubscribe();
13522
+ if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
13523
+ throw Object.assign(
13524
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
13525
+ {
13526
+ cause: err.cause || err
13527
+ }
13528
+ );
13529
+ }
13530
+ throw AxiosError_default.from(err, err && err.code, config, request);
13531
+ }
13532
+ });
13533
+
13158
13534
  // node_modules/axios/lib/adapters/adapters.js
13159
13535
  var knownAdapters = {
13160
13536
  http: http_default,
13161
- xhr: xhr_default
13537
+ xhr: xhr_default,
13538
+ fetch: fetch_default
13162
13539
  };
13163
13540
  utils_default.forEach(knownAdapters, (fn, value) => {
13164
13541
  if (fn) {
@@ -13253,86 +13630,6 @@ function dispatchRequest(config) {
13253
13630
  });
13254
13631
  }
13255
13632
 
13256
- // node_modules/axios/lib/core/mergeConfig.js
13257
- var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
13258
- function mergeConfig(config1, config2) {
13259
- config2 = config2 || {};
13260
- const config = {};
13261
- function getMergedValue(target, source, caseless) {
13262
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
13263
- return utils_default.merge.call({ caseless }, target, source);
13264
- } else if (utils_default.isPlainObject(source)) {
13265
- return utils_default.merge({}, source);
13266
- } else if (utils_default.isArray(source)) {
13267
- return source.slice();
13268
- }
13269
- return source;
13270
- }
13271
- function mergeDeepProperties(a, b, caseless) {
13272
- if (!utils_default.isUndefined(b)) {
13273
- return getMergedValue(a, b, caseless);
13274
- } else if (!utils_default.isUndefined(a)) {
13275
- return getMergedValue(void 0, a, caseless);
13276
- }
13277
- }
13278
- function valueFromConfig2(a, b) {
13279
- if (!utils_default.isUndefined(b)) {
13280
- return getMergedValue(void 0, b);
13281
- }
13282
- }
13283
- function defaultToConfig2(a, b) {
13284
- if (!utils_default.isUndefined(b)) {
13285
- return getMergedValue(void 0, b);
13286
- } else if (!utils_default.isUndefined(a)) {
13287
- return getMergedValue(void 0, a);
13288
- }
13289
- }
13290
- function mergeDirectKeys(a, b, prop) {
13291
- if (prop in config2) {
13292
- return getMergedValue(a, b);
13293
- } else if (prop in config1) {
13294
- return getMergedValue(void 0, a);
13295
- }
13296
- }
13297
- const mergeMap = {
13298
- url: valueFromConfig2,
13299
- method: valueFromConfig2,
13300
- data: valueFromConfig2,
13301
- baseURL: defaultToConfig2,
13302
- transformRequest: defaultToConfig2,
13303
- transformResponse: defaultToConfig2,
13304
- paramsSerializer: defaultToConfig2,
13305
- timeout: defaultToConfig2,
13306
- timeoutMessage: defaultToConfig2,
13307
- withCredentials: defaultToConfig2,
13308
- withXSRFToken: defaultToConfig2,
13309
- adapter: defaultToConfig2,
13310
- responseType: defaultToConfig2,
13311
- xsrfCookieName: defaultToConfig2,
13312
- xsrfHeaderName: defaultToConfig2,
13313
- onUploadProgress: defaultToConfig2,
13314
- onDownloadProgress: defaultToConfig2,
13315
- decompress: defaultToConfig2,
13316
- maxContentLength: defaultToConfig2,
13317
- maxBodyLength: defaultToConfig2,
13318
- beforeRedirect: defaultToConfig2,
13319
- transport: defaultToConfig2,
13320
- httpAgent: defaultToConfig2,
13321
- httpsAgent: defaultToConfig2,
13322
- cancelToken: defaultToConfig2,
13323
- socketPath: defaultToConfig2,
13324
- responseEncoding: defaultToConfig2,
13325
- validateStatus: mergeDirectKeys,
13326
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
13327
- };
13328
- utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
13329
- const merge2 = mergeMap[prop] || mergeDeepProperties;
13330
- const configValue = merge2(config1[prop], config2[prop], prop);
13331
- utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
13332
- });
13333
- return config;
13334
- }
13335
-
13336
13633
  // node_modules/axios/lib/helpers/validator.js
13337
13634
  var validators = {};
13338
13635
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
@@ -13364,6 +13661,12 @@ validators.transitional = function transitional(validator, version, message) {
13364
13661
  return validator ? validator(value, opt, opts) : true;
13365
13662
  };
13366
13663
  };
13664
+ validators.spelling = function spelling(correctSpelling) {
13665
+ return (value, opt) => {
13666
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
13667
+ return true;
13668
+ };
13669
+ };
13367
13670
  function assertOptions(options, schema, allowUnknown) {
13368
13671
  if (typeof options !== "object") {
13369
13672
  throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
@@ -13414,13 +13717,16 @@ var Axios = class {
13414
13717
  return await this._request(configOrUrl, config);
13415
13718
  } catch (err) {
13416
13719
  if (err instanceof Error) {
13417
- let dummy;
13418
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
13720
+ let dummy = {};
13721
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
13419
13722
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
13420
- if (!err.stack) {
13421
- err.stack = stack;
13422
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
13423
- err.stack += "\n" + stack;
13723
+ try {
13724
+ if (!err.stack) {
13725
+ err.stack = stack;
13726
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
13727
+ err.stack += "\n" + stack;
13728
+ }
13729
+ } catch (e2) {
13424
13730
  }
13425
13731
  }
13426
13732
  throw err;
@@ -13454,6 +13760,16 @@ var Axios = class {
13454
13760
  }, true);
13455
13761
  }
13456
13762
  }
13763
+ if (config.allowAbsoluteUrls !== void 0) {
13764
+ } else if (this.defaults.allowAbsoluteUrls !== void 0) {
13765
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
13766
+ } else {
13767
+ config.allowAbsoluteUrls = true;
13768
+ }
13769
+ validator_default.assertOptions(config, {
13770
+ baseUrl: validators2.spelling("baseURL"),
13771
+ withXsrfToken: validators2.spelling("withXSRFToken")
13772
+ }, true);
13457
13773
  config.method = (config.method || this.defaults.method || "get").toLowerCase();
13458
13774
  let contextHeaders = headers && utils_default.merge(
13459
13775
  headers.common,
@@ -13520,7 +13836,7 @@ var Axios = class {
13520
13836
  }
13521
13837
  getUri(config) {
13522
13838
  config = mergeConfig(this.defaults, config);
13523
- const fullPath = buildFullPath(config.baseURL, config.url);
13839
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
13524
13840
  return buildURL(fullPath, config.params, config.paramsSerializer);
13525
13841
  }
13526
13842
  };
@@ -13623,6 +13939,15 @@ var CancelToken = class _CancelToken {
13623
13939
  this._listeners.splice(index, 1);
13624
13940
  }
13625
13941
  }
13942
+ toAbortSignal() {
13943
+ const controller = new AbortController();
13944
+ const abort = (err) => {
13945
+ controller.abort(err);
13946
+ };
13947
+ this.subscribe(abort);
13948
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
13949
+ return controller.signal;
13950
+ }
13626
13951
  /**
13627
13952
  * Returns an object that contains a new `CancelToken` and a function that, when called,
13628
13953
  * cancels the `CancelToken`.