@meshsdk/bitcoin 1.9.0-beta.79 → 1.9.0-beta.80

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
@@ -317,9 +317,6 @@ function _overload_yield(value, kind) {
317
317
  function _sliced_to_array(arr, i) {
318
318
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
319
319
  }
320
- function _to_array(arr) {
321
- return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
322
- }
323
320
  function _to_consumable_array(arr) {
324
321
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
325
322
  }
@@ -696,7 +693,7 @@ var isContextDefined = function(context) {
696
693
  return !isUndefined(context) && context !== _global;
697
694
  };
698
695
  function merge() {
699
- var caseless = (isContextDefined(this) && this || {}).caseless;
696
+ var _ref = isContextDefined(this) && this || {}, caseless = _ref.caseless, skipUndefined = _ref.skipUndefined;
700
697
  var result = {};
701
698
  var assignValue = function(val, key) {
702
699
  var targetKey = caseless && findKey(result, key) || key;
@@ -706,7 +703,7 @@ function merge() {
706
703
  result[targetKey] = merge({}, val);
707
704
  } else if (isArray(val)) {
708
705
  result[targetKey] = val.slice();
709
- } else {
706
+ } else if (!skipUndefined || !isUndefined(val)) {
710
707
  result[targetKey] = val;
711
708
  }
712
709
  };
@@ -1051,9 +1048,16 @@ AxiosError.from = function(error, code, config, request, response, customProps)
1051
1048
  }, function(prop) {
1052
1049
  return prop !== "isAxiosError";
1053
1050
  });
1054
- AxiosError.call(axiosError, error.message, code, config, request, response);
1055
- axiosError.cause = error;
1056
- axiosError.name = error.name;
1051
+ var msg = error && error.message ? error.message : "Error";
1052
+ var errCode = code == null && error ? error.code : code;
1053
+ AxiosError.call(axiosError, msg, errCode, config, request, response);
1054
+ if (error && axiosError.cause == null) {
1055
+ Object.defineProperty(axiosError, "cause", {
1056
+ value: error,
1057
+ configurable: true
1058
+ });
1059
+ }
1060
+ axiosError.name = error && error.name || "Error";
1057
1061
  customProps && Object.assign(axiosError, customProps);
1058
1062
  return axiosError;
1059
1063
  };
@@ -1208,7 +1212,7 @@ prototype2.toString = function toString2(encoder) {
1208
1212
  var AxiosURLSearchParams_default = AxiosURLSearchParams;
1209
1213
  // ../../node_modules/axios/lib/helpers/buildURL.js
1210
1214
  function encode2(val) {
1211
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1215
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
1212
1216
  }
1213
1217
  function buildURL(url, params, options) {
1214
1218
  if (!params) {
@@ -1514,7 +1518,7 @@ var defaults = {
1514
1518
  var silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
1515
1519
  var strictJSONParsing = !silentJSONParsing && JSONRequested;
1516
1520
  try {
1517
- return JSON.parse(data);
1521
+ return JSON.parse(data, this.parseReviver);
1518
1522
  } catch (e) {
1519
1523
  if (strictJSONParsing) {
1520
1524
  if (e.name === "SyntaxError") {
@@ -2255,17 +2259,21 @@ var resolveConfig_default = function(config) {
2255
2259
  if (auth) {
2256
2260
  headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
2257
2261
  }
2258
- var contentType;
2259
2262
  if (utils_default.isFormData(data)) {
2260
2263
  if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
2261
2264
  headers.setContentType(void 0);
2262
- } else if ((contentType = headers.getContentType()) !== false) {
2263
- var _ref = _to_array(contentType ? contentType.split(";").map(function(token) {
2264
- return token.trim();
2265
- }).filter(Boolean) : []), type = _ref[0], tokens = _ref.slice(1);
2266
- headers.setContentType([
2267
- type || "multipart/form-data"
2268
- ].concat(_to_consumable_array(tokens)).join("; "));
2265
+ } else if (utils_default.isFunction(data.getHeaders)) {
2266
+ var formHeaders = data.getHeaders();
2267
+ var allowedHeaders = [
2268
+ "content-type",
2269
+ "content-length"
2270
+ ];
2271
+ Object.entries(formHeaders).forEach(function(param) {
2272
+ var _param = _sliced_to_array(param, 2), key = _param[0], val = _param[1];
2273
+ if (allowedHeaders.includes(key.toLowerCase())) {
2274
+ headers.set(key, val);
2275
+ }
2276
+ });
2269
2277
  }
2270
2278
  }
2271
2279
  if (platform_default.hasStandardBrowserEnv) {
@@ -2342,8 +2350,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
2342
2350
  reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
2343
2351
  request = null;
2344
2352
  };
2345
- request.onerror = function handleError() {
2346
- reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
2353
+ request.onerror = function handleError(event) {
2354
+ var msg = event && event.message ? event.message : "Network Error";
2355
+ var err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
2356
+ err.event = event || null;
2357
+ reject(err);
2347
2358
  request = null;
2348
2359
  };
2349
2360
  request.ontimeout = function handleTimeout() {
@@ -2728,35 +2739,16 @@ var trackStream = function(stream, chunkSize, onProgress, onFinish) {
2728
2739
  });
2729
2740
  };
2730
2741
  // ../../node_modules/axios/lib/adapters/fetch.js
2731
- var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
2732
- var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
2733
- var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ function(encoder) {
2734
- return function(str) {
2735
- return encoder.encode(str);
2742
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
2743
+ var isFunction2 = utils_default.isFunction;
2744
+ var globalFetchAPI = function(param) {
2745
+ var Request = param.Request, Response = param.Response;
2746
+ return {
2747
+ Request: Request,
2748
+ Response: Response
2736
2749
  };
2737
- }(new TextEncoder()) : function(str) {
2738
- return _async_to_generator(function() {
2739
- var _;
2740
- return _ts_generator(this, function(_state) {
2741
- switch(_state.label){
2742
- case 0:
2743
- _ = Uint8Array.bind;
2744
- return [
2745
- 4,
2746
- new Response(str).arrayBuffer()
2747
- ];
2748
- case 1:
2749
- return [
2750
- 2,
2751
- new (_.apply(Uint8Array, [
2752
- void 0,
2753
- _state.sent()
2754
- ]))
2755
- ];
2756
- }
2757
- });
2758
- })();
2759
- });
2750
+ }(utils_default.global);
2751
+ var _utils_default_global = utils_default.global, ReadableStream2 = _utils_default_global.ReadableStream, TextEncoder = _utils_default_global.TextEncoder;
2760
2752
  var test = function(fn) {
2761
2753
  for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
2762
2754
  args[_key - 1] = arguments[_key];
@@ -2767,254 +2759,319 @@ var test = function(fn) {
2767
2759
  return false;
2768
2760
  }
2769
2761
  };
2770
- var supportsRequestStream = isReadableStreamSupported && test(function() {
2771
- var duplexAccessed = false;
2772
- var hasContentType = new Request(platform_default.origin, {
2773
- body: new ReadableStream(),
2774
- method: "POST",
2775
- get duplex () {
2776
- duplexAccessed = true;
2777
- return "half";
2778
- }
2779
- }).headers.has("Content-Type");
2780
- return duplexAccessed && !hasContentType;
2781
- });
2782
- var DEFAULT_CHUNK_SIZE = 64 * 1024;
2783
- var supportsResponseStream = isReadableStreamSupported && test(function() {
2784
- return utils_default.isReadableStream(new Response("").body);
2785
- });
2786
- var resolvers = {
2787
- stream: supportsResponseStream && function(res) {
2788
- return res.body;
2762
+ var factory = function(env) {
2763
+ env = utils_default.merge.call({
2764
+ skipUndefined: true
2765
+ }, globalFetchAPI, env);
2766
+ var envFetch = env.fetch, Request = env.Request, Response = env.Response;
2767
+ var isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
2768
+ var isRequestSupported = isFunction2(Request);
2769
+ var isResponseSupported = isFunction2(Response);
2770
+ if (!isFetchSupported) {
2771
+ return false;
2789
2772
  }
2790
- };
2791
- isFetchSupported && function(res) {
2792
- [
2793
- "text",
2794
- "arrayBuffer",
2795
- "blob",
2796
- "formData",
2797
- "stream"
2798
- ].forEach(function(type) {
2799
- !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? function(res2) {
2800
- return res2[type]();
2801
- } : function(_, config) {
2802
- throw new AxiosError_default("Response type '".concat(type, "' is not supported"), AxiosError_default.ERR_NOT_SUPPORT, config);
2803
- });
2804
- });
2805
- }(new Response());
2806
- var getBodyLength = function(body) {
2807
- return _async_to_generator(function() {
2808
- var _request;
2809
- return _ts_generator(this, function(_state) {
2810
- switch(_state.label){
2811
- case 0:
2812
- if (body == null) {
2773
+ var isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
2774
+ var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ function(encoder) {
2775
+ return function(str) {
2776
+ return encoder.encode(str);
2777
+ };
2778
+ }(new TextEncoder()) : function(str) {
2779
+ return _async_to_generator(function() {
2780
+ var _;
2781
+ return _ts_generator(this, function(_state) {
2782
+ switch(_state.label){
2783
+ case 0:
2784
+ _ = Uint8Array.bind;
2813
2785
  return [
2814
- 2,
2815
- 0
2786
+ 4,
2787
+ new Request(str).arrayBuffer()
2816
2788
  ];
2817
- }
2818
- if (utils_default.isBlob(body)) {
2789
+ case 1:
2819
2790
  return [
2820
2791
  2,
2821
- body.size
2792
+ new (_.apply(Uint8Array, [
2793
+ void 0,
2794
+ _state.sent()
2795
+ ]))
2822
2796
  ];
2823
- }
2824
- if (!utils_default.isSpecCompliantForm(body)) return [
2825
- 3,
2826
- 2
2827
- ];
2828
- _request = new Request(platform_default.origin, {
2829
- method: "POST",
2830
- body: body
2831
- });
2832
- return [
2833
- 4,
2834
- _request.arrayBuffer()
2835
- ];
2836
- case 1:
2837
- return [
2838
- 2,
2839
- _state.sent().byteLength
2840
- ];
2841
- case 2:
2842
- if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
2843
- return [
2844
- 2,
2845
- body.byteLength
2846
- ];
2847
- }
2848
- if (utils_default.isURLSearchParams(body)) {
2849
- body = body + "";
2850
- }
2851
- if (!utils_default.isString(body)) return [
2852
- 3,
2853
- 4
2854
- ];
2855
- return [
2856
- 4,
2857
- encodeText(body)
2858
- ];
2859
- case 3:
2860
- return [
2861
- 2,
2862
- _state.sent().byteLength
2863
- ];
2864
- case 4:
2865
- return [
2866
- 2
2867
- ];
2797
+ }
2798
+ });
2799
+ })();
2800
+ });
2801
+ var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function() {
2802
+ var duplexAccessed = false;
2803
+ var hasContentType = new Request(platform_default.origin, {
2804
+ body: new ReadableStream2(),
2805
+ method: "POST",
2806
+ get duplex () {
2807
+ duplexAccessed = true;
2808
+ return "half";
2868
2809
  }
2810
+ }).headers.has("Content-Type");
2811
+ return duplexAccessed && !hasContentType;
2812
+ });
2813
+ var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function() {
2814
+ return utils_default.isReadableStream(new Response("").body);
2815
+ });
2816
+ var resolvers = {
2817
+ stream: supportsResponseStream && function(res) {
2818
+ return res.body;
2819
+ }
2820
+ };
2821
+ isFetchSupported && function() {
2822
+ [
2823
+ "text",
2824
+ "arrayBuffer",
2825
+ "blob",
2826
+ "formData",
2827
+ "stream"
2828
+ ].forEach(function(type) {
2829
+ !resolvers[type] && (resolvers[type] = function(res, config) {
2830
+ var method = res && res[type];
2831
+ if (method) {
2832
+ return method.call(res);
2833
+ }
2834
+ throw new AxiosError_default("Response type '".concat(type, "' is not supported"), AxiosError_default.ERR_NOT_SUPPORT, config);
2835
+ });
2869
2836
  });
2870
- })();
2871
- };
2872
- var resolveBodyLength = function(headers, body) {
2873
- return _async_to_generator(function() {
2874
- var length;
2875
- return _ts_generator(this, function(_state) {
2876
- length = utils_default.toFiniteNumber(headers.getContentLength());
2877
- return [
2878
- 2,
2879
- length == null ? getBodyLength(body) : length
2880
- ];
2881
- });
2882
- })();
2883
- };
2884
- var fetch_default = isFetchSupported && function(config) {
2885
- return _async_to_generator(function() {
2886
- var _resolveConfig_default, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig_default_withCredentials, withCredentials, fetchOptions, composedSignal, request, unsubscribe, requestContentLength, _tmp, _request, contentTypeHeader, _progressEventDecorator, onProgress, flush, isCredentialsSupported, response, isStreamResponse, options, responseContentLength, _ref, onProgress1, flush1, responseData, err;
2887
- return _ts_generator(this, function(_state) {
2888
- switch(_state.label){
2889
- case 0:
2890
- _resolveConfig_default = resolveConfig_default(config), url = _resolveConfig_default.url, method = _resolveConfig_default.method, data = _resolveConfig_default.data, signal = _resolveConfig_default.signal, cancelToken = _resolveConfig_default.cancelToken, timeout = _resolveConfig_default.timeout, onDownloadProgress = _resolveConfig_default.onDownloadProgress, onUploadProgress = _resolveConfig_default.onUploadProgress, responseType = _resolveConfig_default.responseType, headers = _resolveConfig_default.headers, _resolveConfig_default_withCredentials = _resolveConfig_default.withCredentials, withCredentials = _resolveConfig_default_withCredentials === void 0 ? "same-origin" : _resolveConfig_default_withCredentials, fetchOptions = _resolveConfig_default.fetchOptions;
2891
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
2892
- composedSignal = composeSignals_default([
2893
- signal,
2894
- cancelToken && cancelToken.toAbortSignal()
2895
- ], timeout);
2896
- unsubscribe = composedSignal && composedSignal.unsubscribe && function() {
2897
- composedSignal.unsubscribe();
2898
- };
2899
- _state.label = 1;
2900
- case 1:
2901
- _state.trys.push([
2902
- 1,
2903
- 7,
2904
- ,
2905
- 8
2906
- ]);
2907
- _tmp = onUploadProgress && supportsRequestStream && method !== "get" && method !== "head";
2908
- if (!_tmp) return [
2909
- 3,
2910
- 3
2911
- ];
2912
- return [
2913
- 4,
2914
- resolveBodyLength(headers, data)
2915
- ];
2916
- case 2:
2917
- _tmp = (requestContentLength = _state.sent()) !== 0;
2918
- _state.label = 3;
2919
- case 3:
2920
- if (_tmp) {
2921
- _request = new Request(url, {
2837
+ }();
2838
+ var getBodyLength = function(body) {
2839
+ return _async_to_generator(function() {
2840
+ var _request;
2841
+ return _ts_generator(this, function(_state) {
2842
+ switch(_state.label){
2843
+ case 0:
2844
+ if (body == null) {
2845
+ return [
2846
+ 2,
2847
+ 0
2848
+ ];
2849
+ }
2850
+ if (utils_default.isBlob(body)) {
2851
+ return [
2852
+ 2,
2853
+ body.size
2854
+ ];
2855
+ }
2856
+ if (!utils_default.isSpecCompliantForm(body)) return [
2857
+ 3,
2858
+ 2
2859
+ ];
2860
+ _request = new Request(platform_default.origin, {
2922
2861
  method: "POST",
2923
- body: data,
2924
- duplex: "half"
2862
+ body: body
2925
2863
  });
2926
- ;
2927
- if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
2928
- headers.setContentType(contentTypeHeader);
2864
+ return [
2865
+ 4,
2866
+ _request.arrayBuffer()
2867
+ ];
2868
+ case 1:
2869
+ return [
2870
+ 2,
2871
+ _state.sent().byteLength
2872
+ ];
2873
+ case 2:
2874
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
2875
+ return [
2876
+ 2,
2877
+ body.byteLength
2878
+ ];
2929
2879
  }
2930
- if (_request.body) {
2931
- _progressEventDecorator = _sliced_to_array(progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), 2), onProgress = _progressEventDecorator[0], flush = _progressEventDecorator[1];
2932
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
2880
+ if (utils_default.isURLSearchParams(body)) {
2881
+ body = body + "";
2933
2882
  }
2934
- }
2935
- if (!utils_default.isString(withCredentials)) {
2936
- withCredentials = withCredentials ? "include" : "omit";
2937
- }
2938
- isCredentialsSupported = "credentials" in Request.prototype;
2939
- request = new Request(url, _object_spread_props(_object_spread({}, fetchOptions), {
2940
- signal: composedSignal,
2941
- method: method.toUpperCase(),
2942
- headers: headers.normalize().toJSON(),
2943
- body: data,
2944
- duplex: "half",
2945
- credentials: isCredentialsSupported ? withCredentials : void 0
2946
- }));
2947
- return [
2948
- 4,
2949
- fetch(request, fetchOptions)
2950
- ];
2951
- case 4:
2952
- response = _state.sent();
2953
- isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
2954
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
2955
- options = {};
2956
- [
2957
- "status",
2958
- "statusText",
2959
- "headers"
2960
- ].forEach(function(prop) {
2961
- options[prop] = response[prop];
2962
- });
2963
- responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
2964
- _ref = _sliced_to_array(onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], 2), onProgress1 = _ref[0], flush1 = _ref[1];
2965
- response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress1, function() {
2966
- flush1 && flush1();
2967
- unsubscribe && unsubscribe();
2968
- }), options);
2969
- }
2970
- responseType = responseType || "text";
2971
- return [
2972
- 4,
2973
- resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config)
2974
- ];
2975
- case 5:
2976
- responseData = _state.sent();
2977
- !isStreamResponse && unsubscribe && unsubscribe();
2978
- return [
2979
- 4,
2980
- new Promise(function(resolve, reject) {
2981
- settle(resolve, reject, {
2982
- data: responseData,
2983
- headers: AxiosHeaders_default.from(response.headers),
2984
- status: response.status,
2985
- statusText: response.statusText,
2986
- config: config,
2987
- request: request
2883
+ if (!utils_default.isString(body)) return [
2884
+ 3,
2885
+ 4
2886
+ ];
2887
+ return [
2888
+ 4,
2889
+ encodeText(body)
2890
+ ];
2891
+ case 3:
2892
+ return [
2893
+ 2,
2894
+ _state.sent().byteLength
2895
+ ];
2896
+ case 4:
2897
+ return [
2898
+ 2
2899
+ ];
2900
+ }
2901
+ });
2902
+ })();
2903
+ };
2904
+ var resolveBodyLength = function(headers, body) {
2905
+ return _async_to_generator(function() {
2906
+ var length;
2907
+ return _ts_generator(this, function(_state) {
2908
+ length = utils_default.toFiniteNumber(headers.getContentLength());
2909
+ return [
2910
+ 2,
2911
+ length == null ? getBodyLength(body) : length
2912
+ ];
2913
+ });
2914
+ })();
2915
+ };
2916
+ return function(config) {
2917
+ return _async_to_generator(function() {
2918
+ var _resolveConfig_default, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig_default_withCredentials, withCredentials, fetchOptions, _fetch, composedSignal, request, unsubscribe, requestContentLength, _tmp, _request, contentTypeHeader, _progressEventDecorator, onProgress, flush, isCredentialsSupported, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref, onProgress1, flush1, responseData, err;
2919
+ return _ts_generator(this, function(_state) {
2920
+ switch(_state.label){
2921
+ case 0:
2922
+ _resolveConfig_default = resolveConfig_default(config), url = _resolveConfig_default.url, method = _resolveConfig_default.method, data = _resolveConfig_default.data, signal = _resolveConfig_default.signal, cancelToken = _resolveConfig_default.cancelToken, timeout = _resolveConfig_default.timeout, onDownloadProgress = _resolveConfig_default.onDownloadProgress, onUploadProgress = _resolveConfig_default.onUploadProgress, responseType = _resolveConfig_default.responseType, headers = _resolveConfig_default.headers, _resolveConfig_default_withCredentials = _resolveConfig_default.withCredentials, withCredentials = _resolveConfig_default_withCredentials === void 0 ? "same-origin" : _resolveConfig_default_withCredentials, fetchOptions = _resolveConfig_default.fetchOptions;
2923
+ _fetch = envFetch || fetch;
2924
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
2925
+ composedSignal = composeSignals_default([
2926
+ signal,
2927
+ cancelToken && cancelToken.toAbortSignal()
2928
+ ], timeout);
2929
+ request = null;
2930
+ unsubscribe = composedSignal && composedSignal.unsubscribe && function() {
2931
+ composedSignal.unsubscribe();
2932
+ };
2933
+ _state.label = 1;
2934
+ case 1:
2935
+ _state.trys.push([
2936
+ 1,
2937
+ 7,
2938
+ ,
2939
+ 8
2940
+ ]);
2941
+ _tmp = onUploadProgress && supportsRequestStream && method !== "get" && method !== "head";
2942
+ if (!_tmp) return [
2943
+ 3,
2944
+ 3
2945
+ ];
2946
+ return [
2947
+ 4,
2948
+ resolveBodyLength(headers, data)
2949
+ ];
2950
+ case 2:
2951
+ _tmp = (requestContentLength = _state.sent()) !== 0;
2952
+ _state.label = 3;
2953
+ case 3:
2954
+ if (_tmp) {
2955
+ _request = new Request(url, {
2956
+ method: "POST",
2957
+ body: data,
2958
+ duplex: "half"
2988
2959
  });
2989
- })
2990
- ];
2991
- case 6:
2992
- return [
2993
- 2,
2994
- _state.sent()
2995
- ];
2996
- case 7:
2997
- err = _state.sent();
2998
- unsubscribe && unsubscribe();
2999
- if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
3000
- throw Object.assign(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), {
3001
- cause: err.cause || err
2960
+ ;
2961
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
2962
+ headers.setContentType(contentTypeHeader);
2963
+ }
2964
+ if (_request.body) {
2965
+ _progressEventDecorator = _sliced_to_array(progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), 2), onProgress = _progressEventDecorator[0], flush = _progressEventDecorator[1];
2966
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
2967
+ }
2968
+ }
2969
+ if (!utils_default.isString(withCredentials)) {
2970
+ withCredentials = withCredentials ? "include" : "omit";
2971
+ }
2972
+ isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
2973
+ resolvedOptions = _object_spread_props(_object_spread({}, fetchOptions), {
2974
+ signal: composedSignal,
2975
+ method: method.toUpperCase(),
2976
+ headers: headers.normalize().toJSON(),
2977
+ body: data,
2978
+ duplex: "half",
2979
+ credentials: isCredentialsSupported ? withCredentials : void 0
3002
2980
  });
3003
- }
3004
- throw AxiosError_default.from(err, err && err.code, config, request);
3005
- case 8:
3006
- return [
3007
- 2
3008
- ];
3009
- }
3010
- });
3011
- })();
2981
+ request = isRequestSupported && new Request(url, resolvedOptions);
2982
+ return [
2983
+ 4,
2984
+ isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)
2985
+ ];
2986
+ case 4:
2987
+ response = _state.sent();
2988
+ isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
2989
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
2990
+ options = {};
2991
+ [
2992
+ "status",
2993
+ "statusText",
2994
+ "headers"
2995
+ ].forEach(function(prop) {
2996
+ options[prop] = response[prop];
2997
+ });
2998
+ responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
2999
+ _ref = _sliced_to_array(onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], 2), onProgress1 = _ref[0], flush1 = _ref[1];
3000
+ response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress1, function() {
3001
+ flush1 && flush1();
3002
+ unsubscribe && unsubscribe();
3003
+ }), options);
3004
+ }
3005
+ responseType = responseType || "text";
3006
+ return [
3007
+ 4,
3008
+ resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config)
3009
+ ];
3010
+ case 5:
3011
+ responseData = _state.sent();
3012
+ !isStreamResponse && unsubscribe && unsubscribe();
3013
+ return [
3014
+ 4,
3015
+ new Promise(function(resolve, reject) {
3016
+ settle(resolve, reject, {
3017
+ data: responseData,
3018
+ headers: AxiosHeaders_default.from(response.headers),
3019
+ status: response.status,
3020
+ statusText: response.statusText,
3021
+ config: config,
3022
+ request: request
3023
+ });
3024
+ })
3025
+ ];
3026
+ case 6:
3027
+ return [
3028
+ 2,
3029
+ _state.sent()
3030
+ ];
3031
+ case 7:
3032
+ err = _state.sent();
3033
+ unsubscribe && unsubscribe();
3034
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
3035
+ throw Object.assign(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), {
3036
+ cause: err.cause || err
3037
+ });
3038
+ }
3039
+ throw AxiosError_default.from(err, err && err.code, config, request);
3040
+ case 8:
3041
+ return [
3042
+ 2
3043
+ ];
3044
+ }
3045
+ });
3046
+ })();
3047
+ };
3012
3048
  };
3049
+ var seedCache = /* @__PURE__ */ new Map();
3050
+ var getFetch = function(config) {
3051
+ var env = config ? config.env : {};
3052
+ var fetch2 = env.fetch, Request = env.Request, Response = env.Response;
3053
+ var seeds = [
3054
+ Request,
3055
+ Response,
3056
+ fetch2
3057
+ ];
3058
+ var len = seeds.length, i = len, seed, target, map = seedCache;
3059
+ while(i--){
3060
+ seed = seeds[i];
3061
+ target = map.get(seed);
3062
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
3063
+ map = target;
3064
+ }
3065
+ return target;
3066
+ };
3067
+ var adapter = getFetch();
3013
3068
  // ../../node_modules/axios/lib/adapters/adapters.js
3014
3069
  var knownAdapters = {
3015
3070
  http: null_default,
3016
3071
  xhr: xhr_default,
3017
- fetch: fetch_default
3072
+ fetch: {
3073
+ get: getFetch
3074
+ }
3018
3075
  };
3019
3076
  utils_default.forEach(knownAdapters, function(fn, value) {
3020
3077
  if (fn) {
@@ -3031,34 +3088,34 @@ utils_default.forEach(knownAdapters, function(fn, value) {
3031
3088
  var renderReason = function(reason) {
3032
3089
  return "- ".concat(reason);
3033
3090
  };
3034
- var isResolvedHandle = function(adapter) {
3035
- return utils_default.isFunction(adapter) || adapter === null || adapter === false;
3091
+ var isResolvedHandle = function(adapter2) {
3092
+ return utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
3036
3093
  };
3037
3094
  var adapters_default = {
3038
- getAdapter: function(adapters) {
3095
+ getAdapter: function(adapters, config) {
3039
3096
  adapters = utils_default.isArray(adapters) ? adapters : [
3040
3097
  adapters
3041
3098
  ];
3042
3099
  var length = adapters.length;
3043
3100
  var nameOrAdapter;
3044
- var adapter;
3101
+ var adapter2;
3045
3102
  var rejectedReasons = {};
3046
3103
  for(var i = 0; i < length; i++){
3047
3104
  nameOrAdapter = adapters[i];
3048
3105
  var id = void 0;
3049
- adapter = nameOrAdapter;
3106
+ adapter2 = nameOrAdapter;
3050
3107
  if (!isResolvedHandle(nameOrAdapter)) {
3051
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3052
- if (adapter === void 0) {
3108
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3109
+ if (adapter2 === void 0) {
3053
3110
  throw new AxiosError_default("Unknown adapter '".concat(id, "'"));
3054
3111
  }
3055
3112
  }
3056
- if (adapter) {
3113
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
3057
3114
  break;
3058
3115
  }
3059
- rejectedReasons[id || "#" + i] = adapter;
3116
+ rejectedReasons[id || "#" + i] = adapter2;
3060
3117
  }
3061
- if (!adapter) {
3118
+ if (!adapter2) {
3062
3119
  var reasons = Object.entries(rejectedReasons).map(function(param) {
3063
3120
  var _param = _sliced_to_array(param, 2), id = _param[0], state = _param[1];
3064
3121
  return "adapter ".concat(id, " ") + (state === false ? "is not supported by the environment" : "is not available in the build");
@@ -3066,7 +3123,7 @@ var adapters_default = {
3066
3123
  var s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
3067
3124
  throw new AxiosError_default("There is no suitable adapter to dispatch the request " + s, "ERR_NOT_SUPPORT");
3068
3125
  }
3069
- return adapter;
3126
+ return adapter2;
3070
3127
  },
3071
3128
  adapters: knownAdapters
3072
3129
  };
@@ -3090,8 +3147,8 @@ function dispatchRequest(config) {
3090
3147
  ].indexOf(config.method) !== -1) {
3091
3148
  config.headers.setContentType("application/x-www-form-urlencoded", false);
3092
3149
  }
3093
- var adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
3094
- return adapter(config).then(function onAdapterResolution(response) {
3150
+ var adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
3151
+ return adapter2(config).then(function onAdapterResolution(response) {
3095
3152
  throwIfCancellationRequested(config);
3096
3153
  response.data = transformData.call(config, config.transformResponse, response);
3097
3154
  response.headers = AxiosHeaders_default.from(response.headers);
@@ -3108,7 +3165,7 @@ function dispatchRequest(config) {
3108
3165
  });
3109
3166
  }
3110
3167
  // ../../node_modules/axios/lib/env/data.js
3111
- var VERSION = "1.11.0";
3168
+ var VERSION = "1.12.2";
3112
3169
  // ../../node_modules/axios/lib/helpers/validator.js
3113
3170
  var validators = {};
3114
3171
  [
@@ -3323,7 +3380,6 @@ var Axios = /*#__PURE__*/ function() {
3323
3380
  }
3324
3381
  len = requestInterceptorChain.length;
3325
3382
  var newConfig = config;
3326
- i = 0;
3327
3383
  while(i < len){
3328
3384
  var onFulfilled = requestInterceptorChain[i++];
3329
3385
  var onRejected = requestInterceptorChain[i++];